Received: by 10.223.164.200 with SMTP id h8csp925823wrb; Mon, 6 Nov 2017 01:05:33 -0800 (PST) X-Google-Smtp-Source: ABhQp+TDuvRZoXhkN1HanNgNfhX0qyWh91XGUGqD0pPCLlMDfjdCzOYd0Zj/MrJ/HObgtSMkkOq+ X-Received: by 10.159.197.1 with SMTP id bj1mr13885574plb.219.1509959133059; Mon, 06 Nov 2017 01:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509959133; cv=none; d=google.com; s=arc-20160816; b=P9KDYxGhmBIW2j2UwIxhFG6087ozs9D5n2BgkUHci9cVH1+nwqR+CwMRkPEWJTWTeE opW9n7QojSsH0A1vFzVGRE1dQ9bmx3ddhxYhlG4xVDmfh7x0BjLInh5Lm0q9k0KgSGrO 66W6VhtP85NcMx+WZjAoQSGPmu4zUN0DM5zcoWh+hUkZkLuOaCsJHixezS7cEb1sgQtZ FO4GnH5peaP3PFN7SXS/0BTG71xz6xWoVy5KsMvcB48F03qNIkLLX+UQKVr5QPrnKdCf aHTnoiHJzG2VLF7h2TN0q9OstGftwHM/+9lb0CSVPb77xgGmg+ISH51NP4JJbyjIneqM BMUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7fYn2izaxSjTxs8dUtt7yzb8vGOAgqpr6p90p3ZLgcE=; b=TEzziCkfLWWvIARHa7ZAGtcdB1SekKDoTIOXIvGnbbZoP1WJm2wVMjrCLOSiQwcdJZ pJT2nGjGZPIMQ/qO0Erakoom07zRq+jRO1NJiCAvGAR1ZqZbKTIFPyQTrUwZ5sNIXZZ6 RlQNmPO2YHWtti9MuX8u3B08YA/LlTa54BCdQ77UvUAjkRl7bVNYEnaEKDZ5kcK6uNRE JhsEe8W6b4RV3oEn9CSXPi6AIAXOiu6Z3CTHoJcOacGxzEvsY4ON6Ht1MpxV7xUETGzI daqY4pMC3XMCnEeq2NA3QfHb6u2tgfgjbpunRoEpOsLh3rdZ2UWfZou5UO+nBzt31S4P Zs7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vfW/QW1r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t123si11098105pgc.151.2017.11.06.01.05.19; Mon, 06 Nov 2017 01:05:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vfW/QW1r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752658AbdKFJAa (ORCPT + 98 others); Mon, 6 Nov 2017 04:00:30 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:45821 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590AbdKFJAR (ORCPT ); Mon, 6 Nov 2017 04:00:17 -0500 Received: by mail-qt0-f195.google.com with SMTP id p1so10031253qtg.2; Mon, 06 Nov 2017 01:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7fYn2izaxSjTxs8dUtt7yzb8vGOAgqpr6p90p3ZLgcE=; b=vfW/QW1rVJ+PtV0rvyTfwT9LkW4gRcVsC0/BxmSrWCxYFWp65pG2nZrgSUbBn8MJ92 VSleaBQ6n8Jn7bwShB6EU13IN9p22o/tWFody8vlWJm44bQSzsuJLKJhJw7NcxRk31Li 5kFyxuDSHFGjimIGLQPbJgwdBcF3wfr7UAJNTitCaG9OGJM08vsiopQOd1VGD3OrpYyI 4Bv9xCQWO8jh7rosIJUtsO6ABgAOHYxy2z1vYyIoZgxmg94errUixJT46j6ofqH2G0ge jChtgzKi5Uf1Fx4Xk+T0F5TzEIzW4zCR51lmqN8qwAk3rZuDEm+LXaUOEBsYgduLbZDZ y06w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7fYn2izaxSjTxs8dUtt7yzb8vGOAgqpr6p90p3ZLgcE=; b=OMP60W2BjkIWwPd0/EZavkTt5540JFEbn3/oPRSYXl52LyiApShbGxDHtLPwVdC/8T VzDb+Plk/M70hkyQ5/r0Ug+dJq/N6vTGAj9eFW1MIiXFKVtZQevTPNLva2i1u++fZKXr RdrdTzpcD22qgUHIwiCgMACMmyBYKDrwDY65kCtN6U+xnIjCbZSwPFJZPk37xmE2cIUc +9ObQ/rjdLcpuelSLWDsGf/TbXbVBXa0D83WLvaS1Lm22GAnUWws+wrkZt6o3HptjRJx ZnLZRZMpjuQCoXAVRUb8miL+1tXUVMhJBgpeL6nwRxnx9iQogR+wOGLUi29r173Er0yU qrLw== X-Gm-Message-State: AMCzsaW5LxKXFq4lfYuEDHm1ycPjItqbUAsXZwEh6R8CiMVO0d3HrNuD WlbJfQDCl4doDBqkV+6viLA= X-Received: by 10.200.37.107 with SMTP id 40mr22048624qtn.85.1509958816274; Mon, 06 Nov 2017 01:00:16 -0800 (PST) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id r26sm8001094qki.42.2017.11.06.01.00.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 01:00:15 -0800 (PST) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, linuxram@us.ibm.com Subject: [PATCH v9 42/51] selftest/vm: pkey register should match shadow pkey Date: Mon, 6 Nov 2017 00:57:34 -0800 Message-Id: <1509958663-18737-43-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> References: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org expected_pkey_fault() is comparing the contents of pkey register with 0. This may not be true all the time. There could be bits set by default by the architecture which can never be changed. Hence compare the value against shadow pkey register, which is supposed to track the bits accurately all throughout Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index 19ae991..2600f7a 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -926,10 +926,10 @@ void expected_pkey_fault(int pkey) pkey_assert(last_pkey_faults + 1 == pkey_faults); pkey_assert(last_si_pkey == pkey); /* - * The signal handler shold have cleared out PKEY register to let the + * The signal handler shold have cleared out pkey-register to let the * test program continue. We now have to restore it. */ - if (__rdpkey_reg() != 0) + if (__rdpkey_reg() != shadow_pkey_reg) pkey_assert(0); __wrpkey_reg(shadow_pkey_reg); -- 1.7.1 From 1584619336918074391@xxx Mon Nov 20 20:46:02 +0000 2017 X-GM-THRID: 1583732270078976484 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread