Message ID | 1528937115-10132-10-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 415lxq68sNz9s01 for <patchwork-incoming@ozlabs.org>; Thu, 14 Jun 2018 11:13:51 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jlmGrYbq"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 415lxq4Y87zDrnp for <patchwork-incoming@ozlabs.org>; Thu, 14 Jun 2018 11:13:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com 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="jlmGrYbq"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::241; helo=mail-qt0-x241.google.com; envelope-from=ram.n.pai@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jlmGrYbq"; dkim-atps=neutral Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (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 415lLw5X4BzF09h for <linuxppc-dev@lists.ozlabs.org>; Thu, 14 Jun 2018 10:47:04 +1000 (AEST) Received: by mail-qt0-x241.google.com with SMTP id h5-v6so4252904qtm.13 for <linuxppc-dev@lists.ozlabs.org>; Wed, 13 Jun 2018 17:47:04 -0700 (PDT) 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=1F1c8MwqE4ydAwBXz/KrkKyy0nq0RWNRyOBZbicYdfg=; b=jlmGrYbqx5bOPc96bGGB82mykhJw7IsD+8UYE1CUAyhE6fCAeTmWBMeFDXgGtW6muV YoFutY/eoXd2IJjoXvt7LbPuJ2Qc3gjK9IlB3LCz2hIMvLEKSuG+KEOyB9ZLfxgOywrK V7/xnTgshOW6D9Cy18BPoniS27PBsh41PthJ3hBds2xc40FVlt8uxrsuxIX6wAOeHlY+ nhMtq13tyBwrS+GcgEN+mjGjNicfqDyQ7njncm/ZCYja9yRcJrhU+n1WP/9IocAa97NA I1eo8CbPcUrCmLIoN00Q0K3XuJzyztxPevzJWozyFC641TWQrpw5lHA+QDNfPuH1mKT/ iK9g== 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=1F1c8MwqE4ydAwBXz/KrkKyy0nq0RWNRyOBZbicYdfg=; b=O4ajGwx4cXKP720tGR1s0FjuYIlGk4SZJK3dEwOsRiH9zqXv1eO0idbZJ+7fla+Jm5 YWy+vG2OM06bGp/qkV6jPbsdLSxGEmNabnpdEa8y2mE2f2v/5NMYRuyBfMc/9rkZQmdd t8StBjGWkRVSRpAdNUecxgrS8H7lfnWINmUtghyWJ1cVcqNKIJb2z4Oh3F2QP4AYf+2c KgqP2v1sYfd3n2esA3feElmJOPjVgZIV2l6w3Vxkn7zEUc9GTTMP5zi6r1GddDgTs+Cz PbjqOO7fYGdC7YDi8zhSbCs0hEt5+7LPgz4CqmA3KqUS3qyuhvLpEi7ELPO6GY0Dtzjw dJhw== X-Gm-Message-State: APt69E11rma9oaeytnzwhGlcBSRHd9koyUyz3AYqJCBkb6GLa5D0eL0K ZFHZbFGOd/QbMygXs1HUhPw= X-Google-Smtp-Source: ADUXVKI/bR5M7FelMVO0pjYptzxAmDzDgDj0WX6mjH5tXqM58D5Z3IOrNCOPZE1wpBQh3X+LEF0O4Q== X-Received: by 2002:aed:3966:: with SMTP id l93-v6mr386596qte.220.1528937222661; Wed, 13 Jun 2018 17:47:02 -0700 (PDT) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id u31-v6sm3225898qtc.28.2018.06.13.17.47.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 17:47:02 -0700 (PDT) From: Ram Pai <linuxram@us.ibm.com> To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Subject: [PATCH v13 09/24] selftests/vm: fixed bugs in pkey_disable_clear() Date: Wed, 13 Jun 2018 17:45:00 -0700 Message-Id: <1528937115-10132-10-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1528937115-10132-1-git-send-email-linuxram@us.ibm.com> References: <1528937115-10132-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 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, fweimer@redhat.com, dave.hansen@intel.com, x86@kernel.org, linuxram@us.ibm.com, mhocko@kernel.org, linux-mm@kvack.org, mingo@redhat.com, aneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org 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 5fcccdb..da4f5d5 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -433,7 +433,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 = hw_pkey_set(pkey, pkey_rights, 0); shadow_pkey_reg &= clear_pkey_flags(pkey, flags); @@ -446,7 +446,7 @@ void pkey_disable_clear(int pkey, int flags) dprintf1("%s(%d) pkey_reg: 0x"PKEY_REG_FMT"\n", __func__, pkey, read_pkey_reg()); if (flags) - assert(read_pkey_reg() > orig_pkey_reg); + assert(read_pkey_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. This hasn't been a problem so far because this code isn't currently used. cc: Dave Hansen <dave.hansen@intel.com> cc: Florian Weimer <fweimer@redhat.com> Signed-off-by: Ram Pai <linuxram@us.ibm.com> --- tools/testing/selftests/vm/protection_keys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)