From patchwork Thu Jun 14 00:45:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 929180 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415m9103g7z9s3q for ; Thu, 14 Jun 2018 11:23:32 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UfgBGIZV"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 415m903zz6zF0Tn for ; Thu, 14 Jun 2018 11:23:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UfgBGIZV"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::242; helo=mail-qt0-x242.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UfgBGIZV"; dkim-atps=neutral Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 415lM43dyyzF0Rs for ; Thu, 14 Jun 2018 10:47:12 +1000 (AEST) Received: by mail-qt0-x242.google.com with SMTP id d3-v6so4285511qto.1 for ; Wed, 13 Jun 2018 17:47:12 -0700 (PDT) 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=DFomrVs4YU+TZzRnIOv68GvYhpyt/0GAbgDOQSBvV/c=; b=UfgBGIZVQaoYBCw/sN532WtHqWI2GsIebWXhgPVKXTumuqpyiBkg5+3MT+dQxFhPFu vhiaSy9OjPltY8OKiESUsVIRK27GoS5ODhALFZ46z4dcmBDZ5BSNNq/sCKiSPjv0XiRP ViQ9XUJANrlEyOg7RqQ6mmG9OvulSgBkqn8avkTkrNIRVkfLoQQaAVPX9naNdMG0vEJS cBd2ood8vFvSDF1IqKPq5AGcklWnaXBQyhgiVs0gntCQshUwCSXaeuD15YKJs8OfOp/U KYT7QK59ppe+ZZuvgN0nI2ZRbh+EoRSw1U5qpq1xkTdyRGUHEbOhTHi3MdlTod12tqc8 cVxQ== 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=DFomrVs4YU+TZzRnIOv68GvYhpyt/0GAbgDOQSBvV/c=; b=qLuuZTZ//Bw0vojy4zAP/VcQHjx2vOx8CKjVg5yn5jOMWDgVYYwIHjGCXJLW3vJZmR PlvoONpGe6JiInhnH+5eDc4bNdRtZSLYo6FJf1M0mIm6+wpGyrU3z+V1UUb2UOd41WaZ jOyYAGntbiWZjnjgADfh2t53fhhKSGBuLhq54bfNSn2L424LEp5186UUHExBQ969CXhO ZglL2f83/jt8zJG8DcZ/di2DR1CC4jZnXVrTRhImeK1GnfgmHkuNn7g+3IxCeYPH4ZQ7 CZLBL23zUX9bc1XsAKoWSJTliMjnRGf9NSNbBoZXVwl6Rj3axcDFREApJPXlKxcd2EWy n9tA== X-Gm-Message-State: APt69E0MVXzjyySCHpjYIHaSGAu2YAlNGCS1ExCo/Ukieo/19WPK6qYC Tj5F2cjylgWr02N4JeFSctg= X-Google-Smtp-Source: ADUXVKJMvcsVS1ibL3NcHRtU0I9zXs9hfwJdzYyq8kXvrEvoqfLkMRlN54mhPJblU/67PASWykDcBA== X-Received: by 2002:aed:252c:: with SMTP id v41-v6mr343212qtc.403.1528937230477; Wed, 13 Jun 2018 17:47:10 -0700 (PDT) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id u31-v6sm3225898qtc.28.2018.06.13.17.47.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 17:47:10 -0700 (PDT) From: Ram Pai To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Subject: [PATCH v13 13/24] selftests/vm: pkey register should match shadow pkey Date: Wed, 13 Jun 2018 17:45:04 -0700 Message-Id: <1528937115-10132-14-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1528937115-10132-1-git-send-email-linuxram@us.ibm.com> References: <1528937115-10132-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, fweimer@redhat.com, dave.hansen@intel.com, x86@kernel.org, linuxram@us.ibm.com, mhocko@kernel.org, linux-mm@kvack.org, mingo@redhat.com, aneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 cc: Dave Hansen cc: Florian Weimer 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 9afe894..adcae4a 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -916,10 +916,10 @@ void expected_pkey_fault(int pkey) pkey_assert(last_si_pkey == pkey); /* - * The signal handler shold have cleared out PKEY register to let the + * The signal handler should have cleared out pkey-register to let the * test program continue. We now have to restore it. */ - if (__read_pkey_reg() != 0) + if (__read_pkey_reg() != shadow_pkey_reg) pkey_assert(0); __write_pkey_reg(shadow_pkey_reg);