Received: by 10.223.164.202 with SMTP id h10csp18813wrb; Mon, 6 Nov 2017 01:41:07 -0800 (PST) X-Google-Smtp-Source: ABhQp+TzdruxlxzLL8qHbhn8MRgSGCYdzEBeaamA0D9JgVpVm6mSIFsjqSl6e6fmUjw3WeyWPwjb X-Received: by 10.99.160.71 with SMTP id u7mr14887652pgn.22.1509961267597; Mon, 06 Nov 2017 01:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509961267; cv=none; d=google.com; s=arc-20160816; b=wDvXaYlu5Mg71BezyYIMejzpY3glC4D5NQ3/Qe1exYs1rLNP4AeyvGQGeBirA1H1zR ff87n0ggQKRBhrYLUyn7tBM25Xsny8PK17827OeFeSVCN8QyEJlDt7sys1WPaNTfuS5n Js+ZgQQu96GOHjvH4a5B5uNZED69TIIysc+53kgemSzOM6by866Qk/mkZhWt29CbvZ/n HHazNqSLJY2iSIEPGSBmWINvEF2vy4cv6ofYKHv65ThoFOoU8TlPtcLN/l9iPqEzP2M0 b4eIij3KUgeuYriq6jI7aEnlig3clW8kRx3UIGxQdUQpTLlXzttMOzbOFFWRc5VMgocc qPmg== 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=KGKRpDy3CY/+zy6RggtRDdK0V8VvjcMafH0bWxSKL64=; b=lT6T8b0V7qQ9xYwGHvVdgLqOGFbpUj9oQ4eSRbnQCwA/NgkCA7CVbE8meCKwbqMYbb peJIFgWyhjfVGDu99XX7t7Q0JlJ2Q3UZ5BJSgN+jDHW8iz29ai2LTyJI5vSP1PhWPrl/ uS4XZThhjuaZRRs0QEksilTyqUnW8bgUFDdUr8iAXfotDVZjSLjfmKWbLcdDafJ3+b8M PnhOJQWi3dd4TKS9tZpCadvbOKPrNrOr9+tW17njBhcUopU3WddpO2d/6nl6ZztCgkNw uZpW6g5Mii23pYIEk6ZGlzoE1191XDGUM9XYdnG71RblPD6CAVdXTW8wS6gaFy8/hdIt VROg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=U/pgwhVk; 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 e67si12118306pfk.252.2017.11.06.01.40.53; Mon, 06 Nov 2017 01:41:07 -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=U/pgwhVk; 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 S1752150AbdKFJkV (ORCPT + 99 others); Mon, 6 Nov 2017 04:40:21 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:53522 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdKFI62 (ORCPT ); Mon, 6 Nov 2017 03:58:28 -0500 Received: by mail-qt0-f195.google.com with SMTP id n61so9982784qte.10; Mon, 06 Nov 2017 00:58:26 -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=KGKRpDy3CY/+zy6RggtRDdK0V8VvjcMafH0bWxSKL64=; b=U/pgwhVk46h8j0x7bjl/O60X0zSRcaeU83w6rn4F9dl7PQk6FIAu/XP3kuNNQq/GAm dIvCL5pRs6Qx7G4oyxqdRDpeKZAvY4dpc4GEM52sTshV44vmPj7pSPOqtxMk3yJC5Fz2 L43bNWMbWi6enW2Z9JApH6/gbBd2QMzj/2LYzXi0MU2JIy9wIsH6uO5fSrKskssJhVsx hFnlEzt6Q6vA+ImCwbb9H+yO6ocgpYMqZHNXiMcAg15o8Y6fI5//e+IT9pBO4TLZMjFv a5Zg/S0Y1QmKcwwxptZ5Y+Ibnff4vNsL7lc2VEzIrS3CjMYv+dAnYIk401qhcWxPCXS9 m9pg== 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=KGKRpDy3CY/+zy6RggtRDdK0V8VvjcMafH0bWxSKL64=; b=Smlg8QIfsCqc/HR9RWt3jfb0LD7tliyjPWyZveUjwPAQ6JU5WMlylkiAkXc0BY8zrV AFrs3ERwkrrowEMlPLC+ip8AvMGGIpoi7Sot52i3mARX9/+veuuRq+xamyRn/3xoSico fRY2GV8YODRANTUBwQQVO14bK0NFbdqbbCN+kmA/nkxXOrCv8eaV9e7GrSrabi/3qNNW 3rLiOrb5YLeXg8T5hdnabLES/f4y2x0+8ovMDzOPj/UHwIImZxbUv1X9APBeXUOx/UlI OIt1cr5gSC7Ypg+vfnfvA9z4eTA3Dw1Mv3m9eU90fRrIUg8G+cYi4n5ygM3AHpQD1wqw B/Yw== X-Gm-Message-State: AMCzsaVxc4gab71maYBBAgwUYKe62XcvzVMobLeM0I5eeEqGWiFE53mp 60y83I7up1nY0LRAg6WWIqk= X-Received: by 10.200.6.136 with SMTP id f8mr22271886qth.265.1509958706167; Mon, 06 Nov 2017 00:58:26 -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.00.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 00:58:25 -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 02/51] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey Date: Mon, 6 Nov 2017 00:56:54 -0800 Message-Id: <1509958663-18737-3-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 Currently only 4bits are allocated in the vma flags to hold 16 keys. This is sufficient for x86. PowerPC supports 32 keys, which needs 5bits. This patch allocates an additional bit. Acked-by: Balbir Singh Signed-off-by: Ram Pai --- fs/proc/task_mmu.c | 1 + include/linux/mm.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 677866e..fad19a0 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -683,6 +683,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_PKEY_BIT1)] = "", [ilog2(VM_PKEY_BIT2)] = "", [ilog2(VM_PKEY_BIT3)] = "", + [ilog2(VM_PKEY_BIT4)] = "", #endif /* CONFIG_ARCH_HAS_PKEYS */ }; size_t i; diff --git a/include/linux/mm.h b/include/linux/mm.h index 2c5ea48..f5330a9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -221,9 +221,10 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, #ifdef CONFIG_ARCH_HAS_PKEYS # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 # define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ -# define VM_PKEY_BIT1 VM_HIGH_ARCH_1 +# define VM_PKEY_BIT1 VM_HIGH_ARCH_1 /* on x86 and 5-bit value on ppc64 */ # define VM_PKEY_BIT2 VM_HIGH_ARCH_2 # define VM_PKEY_BIT3 VM_HIGH_ARCH_3 +# define VM_PKEY_BIT4 VM_HIGH_ARCH_4 #endif /* CONFIG_ARCH_HAS_PKEYS */ #if defined(CONFIG_X86) -- 1.7.1 From 1583345000571417051@xxx Mon Nov 06 19:11:01 +0000 2017 X-GM-THRID: 1583345000571417051 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread