Message ID | 1516647137-11174-8-git-send-email-linuxram@us.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zQLtr3ZqBz9s7M for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:23:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F6ThyQ2T"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zQLtr0xTKzF0ZB for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:23:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F6ThyQ2T"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::242; helo=mail-qt0-x242.google.com; envelope-from=ram.n.pai@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F6ThyQ2T"; dkim-atps=neutral Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zQLD55Rx4zF0XB for <linuxppc-dev@lists.ozlabs.org>; Tue, 23 Jan 2018 05:53:09 +1100 (AEDT) Received: by mail-qt0-x242.google.com with SMTP id c2so23465899qtn.9 for <linuxppc-dev@lists.ozlabs.org>; Mon, 22 Jan 2018 10:53:09 -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=X9LwKtDU1DFc8jWh6Mb/aebc8MFwmV4fHbVLg2DPUMg=; b=F6ThyQ2T0zpCLJQ3hY9Cj7cKCffBU9cbo6tx+G0JBrRnLVxRjGbCUFlZhkUhf76vpx 9VPC1KkcRNDRNwisjY3BlJ9xSzmqKDEEKKlq61ixO7TNwHjZ3XS07huIYwL8BvZ+zuF0 fMhjgLBSXpd5t9NO9oadXoiiOqlOcYVB0offqqeBBtuMWpVNGOg8pA4U4TZf2zYvp/Z3 UHOyDFiIMT4l5SGcYaAXFlDqYjNE4PPmjX0cooJCU+YZtofpRfuGTtY6FF9hRtkdjUpK 3O9izpEvL8sg3TFIxKXZPOM3WaW2Fs5fF1vxZxe+x4AsN/qfO1+VNoeUPFo/N3fwKkNL XzBg== 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=X9LwKtDU1DFc8jWh6Mb/aebc8MFwmV4fHbVLg2DPUMg=; b=HgxQU0URt/Wo0wQMTH6f0BP0omG+1rPKIJAJ3ldNo4+evs95tdaSUVfNrYAEswsQlO G0YGD3PfoEBfQzGvnExMym9hT0u50dl8FFT/w4l2hUEWsRO7k8TWlDuBsn/jM5YArYCp T6ypRVlIuyUGg6FLfcLCq6VNWs6iBWj1tG9TZFhiLWxFP8fvAWa9TOEY2KvyQZclL4+a NLfR0823xR70xMj3Bj8P/z10XIekW/MqV6izfnI20FvjQnJ5WrLZ8AIYDiYRSmsh/SdP YAB67iwIiuTtP73YzTlVZ5N8YHF1LYTEd9tTqNUpqsZEjF4mtTob7QgImeTcTib44FBa d5Nw== X-Gm-Message-State: AKwxytf+3P41j9bd1MBYnPm/X5ewJVQz4dpq+FgNz08lW0TWh5vH1goU tS0JUSZea+rPGpGkYASRmtU= X-Google-Smtp-Source: AH8x227GvH/uV7Y4x04hJNOhyk5yFj6cBmABm354PfcKf5SWhgeE7Ht+OIM+kojfL+GxCIu3AEffkA== X-Received: by 10.200.17.25 with SMTP id c25mr11352605qtj.97.1516647187917; Mon, 22 Jan 2018 10:53:07 -0800 (PST) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id o20sm10790061qkl.14.2018.01.22.10.53.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:53:07 -0800 (PST) From: Ram Pai <linuxram@us.ibm.com> To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Subject: [PATCH v10 07/24] selftests/vm: fixed bugs in pkey_disable_clear() Date: Mon, 22 Jan 2018 10:52:00 -0800 Message-Id: <1516647137-11174-8-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> References: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev/> List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> |
Series |
selftests, powerpc, x86 : Memory Protection Keys
|
expand
|
diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index 0109388..ca54a95 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)
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 <linuxram@us.ibm.com> --- tools/testing/selftests/vm/protection_keys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)