From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226LD/VNzTxQVfhS0i5K/6hQLgBoYi/SqrDXhq0odHgLdmCKByXirCYw1bilUTmmKyGEBNFN ARC-Seal: i=1; a=rsa-sha256; t=1519264788; cv=none; d=google.com; s=arc-20160816; b=KYuMDoFU3Kf2lodcYveD0lERjr9hh31w9dWeQlwlRCokx4lc0HrZz/Ni6POKtGLm4+ fue3h1giakU4VWyStDXnWj+JSUH0YB+gbYWRYGaWy0LRkpIMBKuszrWZEXNgzsOWAcg1 +5SPmwrCndjXgl7YRtOLJMj8I9mo1xXGy9QOXvuI14j3FM9ydLwryqhC5stZUrms6zuZ uggswXaaX2vQtsu0/cpe5tJDrup2YV4rXvF3j9vyHFM0BowfKUrM8fj0DS8Df5VURlw3 GSiNQ5zFZqSBin9cnsYwHSH5njJHadSCrNBEr0qcnibESWrt0mgWTaStoWQ838Q6JaGL yP3A== 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=6Mdu7M72g8s3iHURmwgkZUgfnUD5vohliguAoFi9vaI=; b=hXaHxdBDuHxm7qp/0LUHgSYyZ0HrdkCq0qvNO7Mcyq7TlkaA0Nn931JacbdZiBEc1P NnxPB5X6EB/zECPb3w1zW5OFZo+JIjH7POiiHhWyL9zOAXwo0iJt2SniOSpOdcOH9/R+ R0GraPk+tGtkKJBVd+X7rGtnw4eLRFVqo8oEtmcaB0+kRLAl8bFWVdwIWXIghOwYfr4U YeEEcxGBTR3+h2uzWgZSt9B/pfnNb7+msvD/Kib1GK/2dRK33RhTfdzbJpub9Gyw3rpj D4/ru6OEw79NAqQfWxzJWwIcL7yq9O0DBMpJtJqLFDJELMsyqB+E2DFPZzumJsDf8DrS p/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=SzDM2T8V; spf=pass (google.com: best guess record for domain of linux-kselftest-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=SzDM2T8V; spf=pass (google.com: best guess record for domain of linux-kselftest-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kselftest-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 S1751785AbeBVB7e (ORCPT ); Wed, 21 Feb 2018 20:59:34 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:34630 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752099AbeBVB5J (ORCPT ); Wed, 21 Feb 2018 20:57:09 -0500 From: Ram Pai To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, akpm@linux-foundation.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, arnd@arndb.de Subject: [PATCH v12 14/22] selftests/vm: clear the bits in shadow reg when a pkey is freed. Date: Wed, 21 Feb 2018 17:55:33 -0800 Message-Id: <1519264541-7621-15-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kselftest-owner@vger.kernel.org X-Mailing-List: linux-kselftest@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1593064595048468921?= X-GMAIL-MSGID: =?utf-8?q?1593064595048468921?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index c4c73e6..e82bd88 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ 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); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; } -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: linuxram at us.ibm.com (Ram Pai) Date: Wed, 21 Feb 2018 17:55:33 -0800 Subject: [PATCH v12 14/22] selftests/vm: clear the bits in shadow reg when a pkey is freed. In-Reply-To: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> Message-ID: <1519264541-7621-15-git-send-email-linuxram@us.ibm.com> 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. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index c4c73e6..e82bd88 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ 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); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: linuxram@us.ibm.com (Ram Pai) Date: Wed, 21 Feb 2018 17:55:33 -0800 Subject: [PATCH v12 14/22] selftests/vm: clear the bits in shadow reg when a pkey is freed. In-Reply-To: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> Message-ID: <1519264541-7621-15-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset="UTF-8" Message-ID: <20180222015533.zO2-W5_oFC0637qZXXJf7XwnulK6YDWTaW-yqgyoi04@z> 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. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index c4c73e6..e82bd88 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ 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); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ram Pai Subject: [PATCH v12 14/22] selftests/vm: clear the bits in shadow reg when a pkey is freed. Date: Wed, 21 Feb 2018 17:55:33 -0800 Message-ID: <1519264541-7621-15-git-send-email-linuxram@us.ibm.com> References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> Return-path: In-Reply-To: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org 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 List-Id: linux-arch.vger.kernel.org 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. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index c4c73e6..e82bd88 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ 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); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; } -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 8363F6B025F for ; Wed, 21 Feb 2018 20:57:09 -0500 (EST) Received: by mail-qk0-f199.google.com with SMTP id c21so2828753qkg.0 for ; Wed, 21 Feb 2018 17:57:09 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 133sor685583qkj.114.2018.02.21.17.57.08 for (Google Transport Security); Wed, 21 Feb 2018 17:57:08 -0800 (PST) From: Ram Pai Subject: [PATCH v12 14/22] selftests/vm: clear the bits in shadow reg when a pkey is freed. Date: Wed, 21 Feb 2018 17:55:33 -0800 Message-Id: <1519264541-7621-15-git-send-email-linuxram@us.ibm.com> In-Reply-To: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, akpm@linux-foundation.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, arnd@arndb.de 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. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index c4c73e6..e82bd88 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ 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); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; } -- 1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org