From: Ram Pai <linuxram@us.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: mingo@redhat.com, linuxppc-dev@ozlabs.org, linux-mm@kvack.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
dave.hansen@intel.com
Subject: Re: [PATCH 2/8] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey
Date: Tue, 8 May 2018 09:18:28 -0700 [thread overview]
Message-ID: <20180508161828.GA5474@ram.oc3035372033.ibm.com> (raw)
In-Reply-To: <20180508145948.9492-3-mpe@ellerman.id.au>
On Wed, May 09, 2018 at 12:59:42AM +1000, Michael Ellerman wrote:
> From: Ram Pai <linuxram@us.ibm.com>
>
> 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.
>
> Reviewed-by: Ingo Molnar <mingo@kernel.org>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> [mpe: Fold in #if VM_PKEY_BIT4 as noticed by Dave Hansen]
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> fs/proc/task_mmu.c | 3 +++
> include/linux/mm.h | 3 ++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 541392a62608..c2163606e6fb 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -679,6 +679,9 @@ 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)] = "",
> +#if VM_PKEY_BIT4
> + [ilog2(VM_PKEY_BIT4)] = "",
> +#endif
> #endif /* CONFIG_ARCH_HAS_PKEYS */
> };
> size_t i;
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index c6a6f2492c1b..abfd758ff83a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -231,9 +231,10 @@ extern unsigned int kobjsize(const void *objp);
> #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 */
this has to be:
+#if defined(CONFIG_PPC)
+# define VM_PKEY_BIT4 VM_HIGH_ARCH_4
+#else
+# define VM_PKEY_BIT4 0
+#endif
next prev parent reply other threads:[~2018-05-08 16:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 14:59 [PATCH 0/8] mm, x86, powerpc: Consolidate pkey code Michael Ellerman
2018-05-08 14:59 ` [PATCH 1/8] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled Michael Ellerman
2018-05-08 14:59 ` [PATCH 2/8] mm, powerpc, x86: introduce an additional vma bit for powerpc pkey Michael Ellerman
2018-05-08 16:18 ` Ram Pai [this message]
2018-05-08 14:59 ` [PATCH 3/8] mm/pkeys: Remove include of asm/mmu_context.h from pkeys.h Michael Ellerman
2018-05-08 14:59 ` [PATCH 4/8] mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h Michael Ellerman
2018-05-08 16:27 ` Ram Pai
2018-05-08 16:45 ` Dave Hansen
2018-05-08 14:59 ` [PATCH 5/8] x86/pkeys: Move vma_pkey() into asm/pkeys.h Michael Ellerman
2018-05-08 16:45 ` Dave Hansen
2018-05-09 1:56 ` Michael Ellerman
2018-05-08 14:59 ` [PATCH 6/8] x86/pkeys: Add arch_pkeys_enabled() Michael Ellerman
2018-05-08 14:59 ` [PATCH 7/8] mm/pkeys: Add an empty arch_pkeys_enabled() Michael Ellerman
2018-05-08 14:59 ` [PATCH 8/8] mm/pkeys, x86, powerpc: Display pkey in smaps if arch supports pkeys Michael Ellerman
2018-05-08 16:47 ` Dave Hansen
2018-05-09 1:57 ` Michael Ellerman
2018-05-10 13:54 ` [PATCH 9/8] powerpc/pkeys: Drop private VM_PKEY definitions Michael Ellerman
2018-05-10 20:24 ` Ram Pai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180508161828.GA5474@ram.oc3035372033.ibm.com \
--to=linuxram@us.ibm.com \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).