Received: by 10.223.176.46 with SMTP id f43csp305777wra; Thu, 18 Jan 2018 17:53:09 -0800 (PST) X-Google-Smtp-Source: ACJfBovt64C85dQBbUx+XDNHZ3unzxsRrL6ZqJpbupXw8vDgH0yFMZXIEGVuZNAI183u8kh78Fna X-Received: by 10.99.42.83 with SMTP id q80mr38209175pgq.183.1516326789269; Thu, 18 Jan 2018 17:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516326789; cv=none; d=google.com; s=arc-20160816; b=NFuLyqZLjT3TkAKd2Wlm6VGGXI244K1i++Ubq0aaMDE5XxX2SDtaW7VRLFAtR89IRf 114959Ky75GX5BbeQFQUWw4gELqA6C5LCVylyeRCjJfhAEJd6mY0dOxqxCQX1loqWeF8 Jx2S0qJRk6X+QJlZo61Vjaa8HCkWqF+AS+JYRNQmktolm8ITo1My2Zv8kdPdb+WApvrF bOBLYuDKwi+G4t2CbEVInr0gK4G121eCAdyNO8DPbnVv6+cBW33bZU1yICc6i0VihGqC p46WA5sFHX5FG7+Zjqt0MCUgyMQAjyNEkxWFR380/1VRH8fkKF2yrBqMxszDOoRwcRdK l/OQ== 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=qw80giFeTGldkEz1Oc3oVOaNWggliaOMKA5hCrtW7CE=; b=HHDgcw6EmHko/tHUsEM0Xy0D0hCVk8U+fATA4LpI+snYeI37bHRhbHWf4Nu5JYXq19 +qo4KSf7M7KrpMp6nTqVPrwVDn/CtIlyC0IHQZ+/FYp9g3GoXHA9YEBtmgXcLRCFnJOt zniLpq6m4tkaJO5BGjdw6bS80mkgy6XLFglVOQk6zESDws1PAyBCaHhb3DLeuEw+QEbb 0AianFCByQ4w3sHK5IJ64Kl51kCR6inXDV8uDiI8Yo8wf47KpidDJAsDp6o3QOqWUcub y0cGtptzI2yjzFc9Yind9CKR47aOT6loS1App5lKX3TnH/DODLBGJi5c5pHtRLNoEpnT nyJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GTRra4jC; 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 a23si8222820pfe.414.2018.01.18.17.52.54; Thu, 18 Jan 2018 17:53:09 -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=GTRra4jC; 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 S1755501AbeASBv7 (ORCPT + 99 others); Thu, 18 Jan 2018 20:51:59 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:45245 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755404AbeASBvq (ORCPT ); Thu, 18 Jan 2018 20:51:46 -0500 Received: by mail-qt0-f195.google.com with SMTP id x27so413203qtm.12; Thu, 18 Jan 2018 17:51:45 -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=qw80giFeTGldkEz1Oc3oVOaNWggliaOMKA5hCrtW7CE=; b=GTRra4jC03CeIt7ubVSzNtct/pTnAPK0SStqN1ewbQqaERLeoRfvUolCyV1psFC0nY qG7Jtm1pdI1+YNUFcm3TqEXTRILiYne0Uk+LjdLrKsMjXY+5xuzNklz5ZVCwLxiIVbON Yi1QarCkDXf6opoglBEhq0wg+3GZyZto2YiO9R9lBDwIqnG05nc934HAYtle4sQhVhsO dx2RY3d4salBdGjfUSp+KMvb1yaH4dDCE94L0Whx9fspJ3qq77j23ycaVdVoqh16BfWw djT4PA1JlxXfTQzn1RcvuINOjMrXTcpiQRrqbJrE1B2EaXXCtAk0N9dPtuCyYgB7a0QN 0ndQ== 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=qw80giFeTGldkEz1Oc3oVOaNWggliaOMKA5hCrtW7CE=; b=ZDwoOW6axalEkqGfCB6IaVQlkJ3z8C3z3dspUm+9f0a7y2UQVExj1U80rRlVGGLgWg 9RqpAZpXIwAJ0r/33JNvydfL3mEDfD1rbJ+uZE7tLg7aMLKJrMh6Se435WwXhhns+xqV qqLUDtl3UDlbUDWQ/gYhIEjv5mKUgbTkQjq1Pix0Z+zh2dZFPhDR56PimcpTuI7xxCsx zGcoKRgz66VyoS/bkA3jCmhE34U4e8SRLvHQmYB3pzQwWB5UmHvcEtuTd/oZrI/B7IS4 XrMmU7ZXLwqsY+E8bHhdOuLrJfiTZ83oUlvjgH4PhsVlVUx8h/xV/OrNE/zvkcfjmrbR a5Ww== X-Gm-Message-State: AKwxytf/7EzT+wA53USyOsI3IzQtCtLgtrMSg8xqDABkado/HoncugeJ lOo8jWeKgpTWbeGvQ9RTWhU= X-Received: by 10.237.52.226 with SMTP id x89mr21713400qtd.114.1516326705339; Thu, 18 Jan 2018 17:51:45 -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 c127sm5483161qke.78.2018.01.18.17.51.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 17:51:44 -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 v10 02/27] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey Date: Thu, 18 Jan 2018 17:50:23 -0800 Message-Id: <1516326648-22775-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> References: <1516326648-22775-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 b139617..0edd4da 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -680,6 +680,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 01381d3..ebcb997 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -231,9 +231,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