Received: by 10.223.164.200 with SMTP id h8csp922675wrb; Mon, 6 Nov 2017 01:02:00 -0800 (PST) X-Google-Smtp-Source: ABhQp+TRcYEc7EZF0gc1+b6X4Jmg4F7sBoluZ2on8v6hDsYI4GVzNuj7Pz3S3wYlB2MV/kLNrZON X-Received: by 10.101.78.138 with SMTP id b10mr14566183pgs.160.1509958920137; Mon, 06 Nov 2017 01:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509958920; cv=none; d=google.com; s=arc-20160816; b=YR16HEkpiwAPkqo2h7q+OtYFWk6O+7ZOl3sQNdA8UN71yvm+bWMJdt21wa3461LxC6 QZMOtw8f0y6frMDTJXsgii+fFvBaLYmqUB6IAYfTSIP8eZpe6+YhSkePPVUooBB3Hj0J Tjh1oh/B4qycE1apIaaD1Gikl+VdHTwhaB3maxpaO98Ke8Df6BsgfcKpMF0qZ3wrxTXs CFWYz3k/hjY6TYrtumESvbPy1xUn6Q6xuTgl8cIrrLQx48ShJWWN6Np4QRLx5UP1qgF6 Y/uMwyNcGuJUDZEzlOqZ6IPm+PvKoAAFZiqhb58fNPQOjqSFFG7Mm5vWPOuCzBO0/aaI vB8Q== 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=D1bW2Jji+c5cCyLY77a10WO2VGSNe/C5KRW6ZQ/QMtI=; b=vwAtEPY02p7CuQJdrb/KY2xJFKU0JGAvEyIu/YVj+Co8Nj93mdqrTS/n1vW4QpWxY3 j7EArYomJm1t9JxcjPnhHLzeeoqllGR5qpn90rAcb9krWHMCrPSd+A5KaDLyrYQvLYH0 ilkzAB2KjjX6HZaNO06FvKpfmSpZiH6er+dsRn+Kx9x2VBTEd1FOGOjWmSJaG5AiE43B Sb1DTiS/NLxF6QWZ32+tA13CchHXKksOLYkg7XvmJNgVccQX33tcheg+pLTg/RKK0lFD oli1EtugHn4B+88AerT7ivrO+vuwZcuEtwQ65O6Upa1yjdXIH86MhQ7D3XlCoP6QKxu+ n7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZLpxesTJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si10836781plh.282.2017.11.06.01.01.46; Mon, 06 Nov 2017 01:02:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZLpxesTJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752581AbdKFJAL (ORCPT + 98 others); Mon, 6 Nov 2017 04:00:11 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:48074 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbdKFJAF (ORCPT ); Mon, 6 Nov 2017 04:00:05 -0500 Received: by mail-qk0-f195.google.com with SMTP id m189so10027773qke.4; Mon, 06 Nov 2017 01:00:05 -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=D1bW2Jji+c5cCyLY77a10WO2VGSNe/C5KRW6ZQ/QMtI=; b=ZLpxesTJseqNssMhrCHjmrFB5rslXMDY1YRB0KGI0tAVy4xfZiGS//20l2ldWbE7T0 IwrJs/1hDDGXsXriQIE1Wyt1SwSZuRnXrz8MOT9xF+rHeSX8LsFY+yLg+FotcvOQG97E jPjp9VsdtiVJ6I+1+HncCPlxhPx7raKNZNn+z0fPNSwl/+M+Hs9vj6l4+TMTGU9KNXmm O6pPUc9Dds/DxA273ORHPWbpgd5yB1dhV4KqyGGZTEEsIIQyF7QbCo9pseDCbZtSU0qt nNzg9Nb4FLDgHrQC0xCKZzh5zDcalpAuVbp6hkUiy88vMtg1DUVa5v2L13UH79F9aULb hV2Q== 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=D1bW2Jji+c5cCyLY77a10WO2VGSNe/C5KRW6ZQ/QMtI=; b=glDv31G11Ors+CjABCGlNdtOvMeuwUyQo3uZHrywr4nN1s/9vxROl1b+EGsDhrqkmK fxZUNZGIpQ2EHZBShmobZZpuna38n4xNwQFB9CDy7Vk8PGuu7fyaq9FXUFlZXobe5Rxp qMzn+Omu0ENm6O0r4zK6s15dDJG3lCKtP2phgz00iAQsmu+1kVaHuPpWPElpbEbnKrAI yfSFg5yLgJkh1CgAH3Y9BF2PlqdqVDBFRAsDyjqDOwsy+EGnB3lSkmZDnScsFaKAQIBQ cZrhJ9VpZhpxvG4f1GmN41XnkR26X/L75u5t0nMA/41OPFTAW52mcdCezWAf+OgCbqZh +gfA== X-Gm-Message-State: AJaThX76gSKDaeBN87Yo2+zD5SXHxpGFq/I1dBKfRJTAMPvg4ifYB4ya o1ZO41r3TkerSsvuTCGBJBKRNl4j X-Received: by 10.55.42.75 with SMTP id q72mr1346115qkh.57.1509958804665; Mon, 06 Nov 2017 01:00:04 -0800 (PST) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id r26sm8001094qki.42.2017.11.06.01.00.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 01:00:04 -0800 (PST) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.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 Subject: [PATCH v9 38/51] selftest/vm: fixed bugs in pkey_disable_clear() Date: Mon, 6 Nov 2017 00:57:30 -0800 Message-Id: <1509958663-18737-39-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> References: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org instead of clearing the bits, pkey_disable_clear() was setting the bits. Fixed it. Also fixed a wrong assertion in that function. When bits are cleared, the resulting bit value will be less than the original. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/protection_keys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index 5aba137..384cc9a 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -461,7 +461,7 @@ void pkey_disable_clear(int pkey, int flags) pkey, pkey, pkey_rights); pkey_assert(pkey_rights >= 0); - pkey_rights |= flags; + pkey_rights &= ~flags; ret = pkey_set(pkey, pkey_rights, 0); /* pkey_reg and flags have the same format */ @@ -475,7 +475,7 @@ void pkey_disable_clear(int pkey, int flags) dprintf1("%s(%d) pkey_reg: 0x%016lx\n", __func__, pkey, rdpkey_reg()); if (flags) - assert(rdpkey_reg() > orig_pkey_reg); + assert(rdpkey_reg() < orig_pkey_reg); } void pkey_write_allow(int pkey) -- 1.7.1 From 1583279823135774746@xxx Mon Nov 06 01:55:03 +0000 2017 X-GM-THRID: 1582827082359046937 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread