From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id CC2966B0007 for ; Wed, 20 Jun 2018 11:07:34 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id d64-v6so1705757pfd.13 for ; Wed, 20 Jun 2018 08:07:34 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com. [192.55.52.120]) by mx.google.com with ESMTPS id r1-v6si2473355plb.172.2018.06.20.08.07.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 08:07:33 -0700 (PDT) Subject: Re: [PATCH v13 16/24] selftests/vm: clear the bits in shadow reg when a pkey is freed. References: <1528937115-10132-1-git-send-email-linuxram@us.ibm.com> <1528937115-10132-17-git-send-email-linuxram@us.ibm.com> From: Dave Hansen Message-ID: <0b534ee8-5747-2811-745c-d87b3e720955@intel.com> Date: Wed, 20 Jun 2018 08:07:31 -0700 MIME-Version: 1.0 In-Reply-To: <1528937115-10132-17-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ram Pai , 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, mingo@redhat.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, fweimer@redhat.com, msuchanek@suse.de, aneesh.kumar@linux.vnet.ibm.com On 06/13/2018 05:45 PM, Ram Pai wrote: > --- a/tools/testing/selftests/vm/protection_keys.c > +++ b/tools/testing/selftests/vm/protection_keys.c > @@ -577,7 +577,8 @@ int sys_pkey_free(unsigned long pkey) > int ret = syscall(SYS_pkey_free, pkey); > > if (!ret) > - shadow_pkey_reg &= clear_pkey_flags(pkey, PKEY_DISABLE_ACCESS); > + shadow_pkey_reg &= clear_pkey_flags(pkey, > + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); > dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); > return ret; > } Why did you introduce this code earlier and then modify it now? BTW, my original aversion to this code still stands.