From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 608546B000E for ; Fri, 16 Mar 2018 18:06:54 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id d5so5801551pfn.12 for ; Fri, 16 Mar 2018 15:06:54 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com. [134.134.136.24]) by mx.google.com with ESMTPS id u70si5678624pgd.619.2018.03.16.15.06.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 15:06:53 -0700 (PDT) Subject: Re: [PATCH v12 06/22] selftests/vm: fix the wrong assert in pkey_disable_set() References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> <1519264541-7621-7-git-send-email-linuxram@us.ibm.com> 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 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, 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 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?