From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices
Date: Thu, 15 Jan 2009 12:54:45 +1100 [thread overview]
Message-ID: <1231984485.22571.114.camel@pasglop> (raw)
In-Reply-To: <1231960174.31244.8.camel@norville.austin.ibm.com>
On Wed, 2009-01-14 at 13:09 -0600, Dave Kleikamp wrote:
> powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices
>
> The subpage_prot syscall fails on second and subsequent calls for a given
> region, because is_hugepage_only_range() is mis-identifying the 4 kB
> slices when the process has a 64 kB page size.
>
> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Looks good. I'll put that in for .29
Cheers,
Ben.
> diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
> index db44e02..ba51948 100644
> --- a/arch/powerpc/mm/slice.c
> +++ b/arch/powerpc/mm/slice.c
> @@ -710,9 +710,18 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
> unsigned long len)
> {
> struct slice_mask mask, available;
> + unsigned int psize = mm->context.user_psize;
>
> mask = slice_range_to_mask(addr, len);
> - available = slice_mask_for_size(mm, mm->context.user_psize);
> + available = slice_mask_for_size(mm, psize);
> +#ifdef CONFIG_PPC_64K_PAGES
> + /* We need to account for 4k slices too */
> + if (psize == MMU_PAGE_64K) {
> + struct slice_mask compat_mask;
> + compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K);
> + or_mask(available, compat_mask);
> + }
> +#endif
>
> #if 0 /* too verbose */
> slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n",
>
prev parent reply other threads:[~2009-01-15 1:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 19:09 [PATCH] powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices Dave Kleikamp
2009-01-15 1:54 ` Benjamin Herrenschmidt [this message]
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=1231984485.22571.114.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=shaggy@linux.vnet.ibm.com \
/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).