Received: by 10.223.185.116 with SMTP id b49csp1286477wrg; Wed, 21 Feb 2018 15:54:16 -0800 (PST) X-Google-Smtp-Source: AH8x227B7Loqj2as/Var2yW2dAgEolAQaQWpXEeL6ODOSxRpO+bY6yVno0oUQaYfGl7y8xUkdT40 X-Received: by 2002:a17:902:7d8d:: with SMTP id a13-v6mr4658944plm.304.1519257256391; Wed, 21 Feb 2018 15:54:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519257256; cv=none; d=google.com; s=arc-20160816; b=VBNHUl2zbSBjBfty3b3IP5Dcdr2TmJ5/AlogCJjaIkfq0M8URqSpzKKRDcYcp9BaSg XZK8fXSOT3+qFF8wtsQKfnO7Cd1pOUBsXGRriMdVJraDuis7g1bD4n/BpEATuBuTXPMQ DO1a/rNeVmveE/Wgr9Ftew7nNfuWpThcrt+I2L9FgAeU3V9pGEelJ7ir1pr8F/kL4yAP teexMwY9plwruRZGjZhuQYSntfgbJg1ZQq65SQ2OMbrDUMJdCzo6nEj187g35Qh02uXO GBVLRYC0ZLcoWVWFyuRAr2b11/7xgix4ivh6jpN+30ZJIplVkIbWTriys6AYJB28d+gI iSiw== 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=kerfeK2JoO7+oQrs2Rs90drlJqT4/y+dgPYmSKQcDZY=; b=g0gIm1oq2iG415MGMv/iJpnnsHqH/2f+w/xHC5Ym7oZ9vbNciVKV9gsAdra6faBvMZ HE+7M8ehr2VfWmVkjdHzdTT/moZiwWzggVMVSh5EEk+zMyD/kfQo+IEOaRpRUIHgn+A4 w95OJL00DuG5U2/4TAaaEnxrO8+Efk6gO1/FcMkzvv2gxpaer5zGI0M94s+MPkn+sHRK QxcOjBE8WQKNPHKBA52EPRqgv+IqyECJLtEuusaQcADaaTdp0Kb/0/HT8B8tQ+v0P1U3 LT9pthFlotJPoFM8MkIvVCzi+b0EEy36C8RNE/xDcZPoqK1mjmDX7d+HWUT0lIVvZJeG QMrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=u0/e+LQc; 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 s124si1780080pgc.403.2018.02.21.15.54.01; Wed, 21 Feb 2018 15:54:16 -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=u0/e+LQc; 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 S1751474AbeBUXxN (ORCPT + 99 others); Wed, 21 Feb 2018 18:53:13 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:39492 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbeBUXxK (ORCPT ); Wed, 21 Feb 2018 18:53:10 -0500 Received: by mail-qk0-f196.google.com with SMTP id z197so4337409qkb.6; Wed, 21 Feb 2018 15: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=kerfeK2JoO7+oQrs2Rs90drlJqT4/y+dgPYmSKQcDZY=; b=u0/e+LQcHjwlE++qProYJNHFVAWSboHk+pTuapK+feHTcoNwsYRUgo1RDbU/FqVpXE alNuph1inarT+WH0kwVoba6R8nrK10N4A2nzbEFk7mQmKviDayT6gmoT/BEj2l7W+0xU OxKheFbIKciqASfv/FLCGYv5gVt3JJFJn6M3rVhkwTb70gcl/srSSbt+kiDooyVNLrMt oFxqqBN7u32ZsCOXyIsRYJp50GKrw2HLm7MQQfZuib+087hVf0/cJ8dkEWr/aa9tVP2M UdQbhKuB6VZ8dbPFxKi7RPq87jTtpNLl6eSWoWS87B1n0VguzBJs2dEkCeVLp41cw91r 2dsg== 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=kerfeK2JoO7+oQrs2Rs90drlJqT4/y+dgPYmSKQcDZY=; b=AT7OquKHirHC3T1WN0Z13zq6Sz4t9uxF+qU1+aUZoPH/2MjpWw1REhQJbWE9Lf8Llo CB7LxV0CpFdOEZTsTHlLAOrSZk+0tBnF6tVlp8+PjygiIIXfDLNZupEkYyTO98V1HBcr QhG0ZPq4HO0k87sRKXeA+9o2pKEp4/8+CyBL0yL6VDjbRZaAbCU1/RQeWFXndAW/ziLB zpbTyYQs9/iV8zV68RdIp/913T1jnTnoLZoX+KjrhS70xIXcZUfergdqH27+RojtSNru dDUX1F5AE6t1BkdqlcA63AeEdxJ9Jyau7ThGyptKliymXlEMY30ZqyTAW81BX0eFBM3N DxHg== X-Gm-Message-State: APf1xPCm1DcGm5Zw76/r+tIskG8RMCoG7SWe+ibEsd1w99k+SRbGms9C u4TLYjtrYJ2TLT39lV9U6iY= X-Received: by 10.55.3.66 with SMTP id 63mr7599323qkd.283.1519257189138; Wed, 21 Feb 2018 15:53:09 -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 b25sm3804881qte.40.2018.02.21.15.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 15:53:08 -0800 (PST) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@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, corbet@lwn.net, arnd@arndb.de, fweimer@redhat.com, msuchanek@suse.com Subject: [PATCH v12 2/3] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey Date: Wed, 21 Feb 2018 15:52:17 -0800 Message-Id: <1519257138-23797-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1519257138-23797-1-git-send-email-linuxram@us.ibm.com> References: <1519257138-23797-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. cc: Dave Hansen cc: Michael Ellermen cc: Benjamin Herrenschmidt cc: Andrew Morton Reviewed-by: Ingo Molnar 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 6b996d0..6d83bb7 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -685,6 +685,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 ad207ad..d534f46 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