Message ID | 1516647137-11174-9-git-send-email-linuxram@us.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zQLyB46xnz9s7M for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:26:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="emqYjWUK"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zQLyB2jrjzDqXw for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:26:10 +1100 (AEDT) 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="emqYjWUK"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: 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=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="emqYjWUK"; 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 3zQLD84rQ5zF0Xr for <linuxppc-dev@lists.ozlabs.org>; Tue, 23 Jan 2018 05:53:12 +1100 (AEDT) Received: by mail-qt0-x242.google.com with SMTP id z10so23463237qti.5 for <linuxppc-dev@lists.ozlabs.org>; Mon, 22 Jan 2018 10:53:12 -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=RmAxQc6qgJFMG9zx+ucCq/VxCdY2teR3zKOd74p92fY=; b=emqYjWUKnhZxMBwglCvMpk8X21RiIHVgR2eE6cbtTew662p9IXM/GPdn5gxp2spqGQ IcTjESODucGQNGJa5IWmYErVOI7GXRxxHGYyiOxurWYfABmawiKBt1yxPikmr6TpVxzR 9/tbbfHOLRwGkCx+N3eZzOYU6GClG3sgA69XaNb4sh0O4mE5q/HWAXCUTOawW9bY2FdO NSWA3dkpo802c0SylH4CWCBCASBgyWiU5XIzFBUZiHF0ADnCyOJAUzqzVUpKb2vJrWY2 f3Nl/FY/vQ5rr/eg3bA2AXmz1R03hkWfUsKrVt1LGrBSd8XWNybcnkak43ENBTQrvPEJ ABww== 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=RmAxQc6qgJFMG9zx+ucCq/VxCdY2teR3zKOd74p92fY=; b=nmhSnbJuqZMUomsH6YHpJ31Q2i5RA1IXPlw1tiJAhwkvSGPGBqu+vS0K9zfwARI2TV WO5D2RqwPQ0LCem059LHZdvUuy3+PEqhKaK3tXfkEpwT7gDdi+cuzdIR71rflEnv9b0k 2r1iB7ZWbljsWFrjCep+q+aAZf2QzDduu1E5ZkiQfYfc4S/Fe2+9JQwjF+1MpUZ/CJuy pKcASYtQvZbkNt2dLc+YUIK/3LpIgP1hOPXUER+9bbW4yA7Iqx3gF6cvPu3G6hWREhQr vu5gG6YgxLsBJwbY/QmgauUjM0M0BVLalF70KDvQWY7jLW1XD0837Y9e5bf3SIwMQ/K4 HVlw== X-Gm-Message-State: AKwxytciQ/fO2jvIaGW5SGDvNJJiwz0+CTO5p7zNmJWRccVNlZdlsHXV dQBHVcitScEmrq8s9vTtPJI= X-Google-Smtp-Source: AH8x2260Ri9BJwbN+Q0ZA8SHarm+PaIZU7eXdM8HvZdisa4MVEqxP1v1722REri7BcCyPN3/+cL8kA== X-Received: by 10.200.58.129 with SMTP id x1mr11398467qte.146.1516647190795; Mon, 22 Jan 2018 10:53:10 -0800 (PST) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id o20sm10790061qkl.14.2018.01.22.10.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:53:10 -0800 (PST) From: Ram Pai <linuxram@us.ibm.com> To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Subject: [PATCH v10 08/24] selftests/vm: clear the bits in shadow reg when a pkey is freed. Date: Mon, 22 Jan 2018 10:52:01 -0800 Message-Id: <1516647137-11174-9-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> References: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev/> List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> Cc: linux-arch@vger.kernel.org, ebiederm@xmission.com, arnd@arndb.de, linux-doc@vger.kernel.org, x86@kernel.org, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linuxram@us.ibm.com, mhocko@kernel.org, linux-mm@kvack.org, mingo@redhat.com, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> |
Series |
selftests, powerpc, x86 : Memory Protection Keys
|
expand
|
diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index ca54a95..aaf9f09 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -582,6 +582,9 @@ int alloc_pkey(void) int sys_pkey_free(unsigned long pkey) { int ret = syscall(SYS_pkey_free, pkey); + + if (!ret) + shadow_pkey_reg &= reset_bits(pkey, PKEY_DISABLE_ACCESS); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; }
When a key is freed, the key is no more effective. Clear the bits corresponding to the pkey in the shadow register. Otherwise it will carry some spurious bits which can trigger false-positive asserts. Signed-off-by: Ram Pai <linuxram@us.ibm.com> --- tools/testing/selftests/vm/protection_keys.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)