From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40301C2nKczF1J0 for ; Sat, 17 Mar 2018 09:06:55 +1100 (AEDT) Subject: Re: [PATCH v12 06/22] selftests/vm: fix the wrong assert in pkey_disable_set() To: Ram Pai , shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> <1519264541-7621-7-git-send-email-linuxram@us.ibm.com> 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, 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, arnd@arndb.de From: Dave Hansen Message-ID: Date: Fri, 16 Mar 2018 15:06:44 -0700 MIME-Version: 1.0 In-Reply-To: <1519264541-7621-7-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 02/21/2018 05:55 PM, Ram Pai wrote: > If the flag is 0, no bits will be set. Hence we cant expect > the resulting bitmap to have a higher value than what it > was earlier. > > cc: Dave Hansen > cc: Florian Weimer > Signed-off-by: Ram Pai > --- > tools/testing/selftests/vm/protection_keys.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c > index 83216c5..0109388 100644 > --- a/tools/testing/selftests/vm/protection_keys.c > +++ b/tools/testing/selftests/vm/protection_keys.c > @@ -443,7 +443,7 @@ void pkey_disable_set(int pkey, int flags) > dprintf1("%s(%d) pkey_reg: 0x%lx\n", > __func__, pkey, rdpkey_reg()); > if (flags) > - pkey_assert(rdpkey_reg() > orig_pkey_reg); > + pkey_assert(rdpkey_reg() >= orig_pkey_reg); > dprintf1("END<---%s(%d, 0x%x)\n", __func__, > pkey, flags); > } I'm not sure about this one. Did this cause a problem for you? Why would you call this and ask no bits to be set?