From patchwork Mon Nov 6 08:56:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 834528 Return-Path: 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 3yVnHJ0x5fz9s5L for ; Mon, 6 Nov 2017 20:26:04 +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="U/pgwhVk"; 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 3yVnHH6f65zDqlM for ; Mon, 6 Nov 2017 20:26:03 +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="U/pgwhVk"; 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::244; helo=mail-qt0-x244.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U/pgwhVk"; dkim-atps=neutral Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 3yVmgS1bzkzDrJn for ; Mon, 6 Nov 2017 19:58:28 +1100 (AEDT) Received: by mail-qt0-x244.google.com with SMTP id 31so9992562qtz.9 for ; Mon, 06 Nov 2017 00:58:28 -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=fSE5RALMJDb7YYBCrP++2zDg3t/hdHR6O1bdBs2sEG5+bM1SNgkccT3t82FtwbomqC jDptNTx6WQdF31YGwAgSh2sMuut+5mV70A4kolqkmf1pPNHaclorfIuPJEawUkNF7jff EtBvBCZgt+MAfjN3YRiEX/eAqwr17BWCMcpDFsQSbd2bJopQiWy6TGM5xaxqNZM+FZcu bpMDKaDdkmJUeUu/yUoxA8q4zVfJpeMR/EuK65ox/GyiXZD667aFPnC3bMV/CgULSbVf QL7Vg+ceqaiN8d7uoRTdkLVdbrA7t/4WqHktuXFgKu+QVQJHyjo+9UE9cBqPfg328Pd/ qWNA== X-Gm-Message-State: AMCzsaVWfPKR846pFdlWBx2UJynuthUj0s/63Zc+mMfeFID1eVoWokGO gEJBXj4lxYiYv2BzIg0AuOA= X-Google-Smtp-Source: ABhQp+QMh7Kl0r3uISkCn6NXXs3h4dzBrxbZXaB+ZatlqZzntSopjMXbfh1vjIpCkqY5AT8ejzU3NQ== 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 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, ebiederm@xmission.com, 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, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, linux-kselftest@vger.kernel.org, bauerman@linux.vnet.ibm.com, 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" 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)