Received: by 10.223.176.5 with SMTP id f5csp376947wra; Tue, 30 Jan 2018 13:01:17 -0800 (PST) X-Google-Smtp-Source: AH8x2251tqThRxRGUyczOftxLq3As32fwANIRYgpblAEtGPVuEotV1WcEBj/fdiRVdD1Id/P/AjJ X-Received: by 10.99.116.22 with SMTP id p22mr24151251pgc.182.1517346076810; Tue, 30 Jan 2018 13:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517346076; cv=none; d=google.com; s=arc-20160816; b=pJCreJcg0LIW40Ki8I9/aHroua4fCISZLlNS9qQ781s1cQMv9U7KfR28IE581jzGmm j3VEjgE62nQ5iRzzqeEk7+hFgmHz82Z4fI1xyU6cZaUlSRuKVqIBXVvFuL5qau+M8L9w cuGDp6LRrDxwn8KAStgT46XhAggK0N8q9wKRuGk/GsHiqa1uErLyXTRWeaQnakUNuBgg bysB2+dnNDlaQ0yrhjUoHnJvJJffzLFiUExbEw2nkoHF6b0D9VK92K/M6wPA1Uu0Je3D bsW+S70KrqZsA5cmzWq2OPsgHlfhWO+Hvad1E+fniKz0zPEBjf09+r3wQCCZX5XjwYch 5Fcw== 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=usm7nzxKuuzEaOZzFmfqS7bmMrzRTenxIejjeoheCRnJnC+B63A5mmc4fdQmG8hNNQ l8ELIJNcs92dS+zqsX8HVt5EFGDyYTzOMSYY+oca/XoCL8uBLaISB2woEPeEmNfHUyOf Pu14j5m9gTEszREzl/B/xaKw0E7HadWLDufT/yLi8BtjjDvgQUIOrJAid5SVzf81134a iK+Dd7kAaiBllwBFTkSq1WnBm5mL/BzjM+by8HGa/M+BOjxmTVQBzjObPXIjdzoIWhVQ zPQgcGYNapXuBGFJhQd1gkcuBmOVi6eouH9UaBwlEF8LffVtmUTBc05JbxbjxnD5AMvF N62A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Wv2/gL2x; 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 p8si2094113pgr.443.2018.01.30.13.01.01; Tue, 30 Jan 2018 13:01: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=Wv2/gL2x; 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 S1752731AbeA3Tpa (ORCPT + 99 others); Tue, 30 Jan 2018 14:45:30 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:44756 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbeA3TpH (ORCPT ); Tue, 30 Jan 2018 14:45:07 -0500 Received: by mail-qk0-f194.google.com with SMTP id n188so314261qkn.11; Tue, 30 Jan 2018 11:45:07 -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=Wv2/gL2xB7aGxgAG1VLpnaexRZpB+dVpJmRtP8FYIlIoBDWnuRzOi5yptsb+fMwSx0 /Rhj7I16P83dUZg8UVKA8lRkIP8HnbQXYZo8V2ADU/GfBDJlqW3oYThkybuYUOlsW8/s NAHNM9lMWc5wcD4KgQGenKcUOPVOwnoVL4MsJgDFz5g+2PrLmt0AcQYnz+DbIpxKt0sE mT5DVCmkBznD7FX74+OjVlP+rzVcDM2Tn8QRnejp2KO9mziOv10+vezltbawBzwOnyxx BAM7cRzBMiS5B0JllTPbSgAM3OMKKv2Bu+xXmvyZiGmSYAn0Q86TgS69xMqj8mwwuAEU 0YmQ== 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=dR1pigtpG5tB7ciUgraILfHLx/ENF3QLNW1goUez2BJPDxdRJiEdiifi2MGcTx0dwB c13zFVOPLu0jASbjJs98QtG+QEUKdCXv5D5sEJ//3PUndiYNOhIXrH8eJqn2Q4rXTPdT 6YtV2fu3KX3cEWeQn4Ts6a4wEbmxKb3bwePuuf6eFKaUuKq/WTn6v+HJtfkkoJc5juvp mdRpqaGj4Tg8oUgPnHI2NJ47cmyU+v7KqIxwV/UmJ10vxMzhHpJxGLP/qw3aS8qlPgmz iZr5nlJW2t2phOFMT6hDm6llV1mKUlmGxRrFS4ZrR/G7yQ5f1mxNwWbCmiI8ISTkWugw iXIA== X-Gm-Message-State: AKwxytcoZHkD/UiSpFDUbActCeDqfyUD0sYgZ1kEjhBefvMMfjQJ/F8S FlfAJiCyvkE7OQaohnlYt44= X-Received: by 10.55.5.1 with SMTP id 1mr42199942qkf.247.1517341506768; Tue, 30 Jan 2018 11:45:06 -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 i39sm12117017qte.19.2018.01.30.11.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 11:45:06 -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 v11 2/3] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey Date: Tue, 30 Jan 2018 11:44:11 -0800 Message-Id: <1517341452-11924-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1517341452-11924-1-git-send-email-linuxram@us.ibm.com> References: <1517341452-11924-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