From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753288AbdGEVYT (ORCPT ); Wed, 5 Jul 2017 17:24:19 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33907 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbdGEVYM (ORCPT ); Wed, 5 Jul 2017 17:24:12 -0400 From: Ram Pai To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, dave.hansen@intel.com, hbabu@us.ibm.com, linuxram@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com Subject: [RFC v5 34/38] procfs: display the protection-key number associated with a vma Date: Wed, 5 Jul 2017 14:22:11 -0700 Message-Id: <1499289735-14220-35-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> References: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Display the pkey number associated with the vma in smaps of a task. The key will be seen as below: ProtectionKey: 0 Signed-off-by: Ram Pai --- arch/powerpc/kernel/setup_64.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f35ff9d..ebc82b3 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -745,3 +746,10 @@ static int __init disable_hardlockup_detector(void) } early_initcall(disable_hardlockup_detector); #endif + +#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS +void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) +{ + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); +} +#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */ -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id CD60B6B0405 for ; Wed, 5 Jul 2017 17:23:52 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id o8so669169qtc.1 for ; Wed, 05 Jul 2017 14:23:52 -0700 (PDT) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com. [2607:f8b0:400d:c09::244]) by mx.google.com with ESMTPS id 55si117367qtq.162.2017.07.05.14.23.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 14:23:51 -0700 (PDT) Received: by mail-qk0-x244.google.com with SMTP id p21so206401qke.0 for ; Wed, 05 Jul 2017 14:23:51 -0700 (PDT) From: Ram Pai Subject: [RFC v5 34/38] procfs: display the protection-key number associated with a vma Date: Wed, 5 Jul 2017 14:22:11 -0700 Message-Id: <1499289735-14220-35-git-send-email-linuxram@us.ibm.com> In-Reply-To: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> References: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, dave.hansen@intel.com, hbabu@us.ibm.com, linuxram@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com Display the pkey number associated with the vma in smaps of a task. The key will be seen as below: ProtectionKey: 0 Signed-off-by: Ram Pai --- arch/powerpc/kernel/setup_64.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f35ff9d..ebc82b3 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -745,3 +746,10 @@ static int __init disable_hardlockup_detector(void) } early_initcall(disable_hardlockup_detector); #endif + +#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS +void arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) +{ + seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); +} +#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */ -- 1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org