From: joserz@linux.vnet.ibm.com
To: "Oliver O'Halloran" <oohall@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au,
sjitindarsingh@gmail.com
Subject: Re: [PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap()
Date: Thu, 27 Jul 2017 18:47:21 -0300 [thread overview]
Message-ID: <20170727214721.GA595@pacoca> (raw)
In-Reply-To: <20170727153553.9160-1-oohall@gmail.com>
On Fri, Jul 28, 2017 at 01:35:53AM +1000, Oliver O'Halloran wrote:
> The ISA radix translation tree contains two different types of entry,
> directories and leaves. The formats of the two entries are different
> with the directory entries containing no spare bits for use by software.
> As a result we need to ensure that the *_devmap() family of functions
> check fail for everything except leaf (PTE) entries.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
> "i'll just tweak the mbox before i sent it, what's the worst that can happen"
> *completely breaks KVM*
> "..."
> ---
> arch/powerpc/include/asm/book3s/64/pgtable.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index d1da415..6bc6248 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -610,7 +610,9 @@ static inline pte_t pte_mkdevmap(pte_t pte)
>
> static inline int pte_devmap(pte_t pte)
> {
> - return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP));
> + uint64_t mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);
> +
> + return (pte_raw(pte) & mask) == mask;
> }
>
> static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
> --
> 2.7.4
>
Michael should thank you because I was about to send another insane
suggestion and ask him if that makes sense. :-D
Tested-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
next prev parent reply other threads:[~2017-07-27 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 15:35 [PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap() Oliver O'Halloran
2017-07-27 19:14 ` Laurent Vivier
2017-07-27 21:47 ` joserz [this message]
2017-07-28 1:14 ` Suraj Jitindar Singh
2017-07-28 10:15 ` [v2] " Michael Ellerman
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=20170727214721.GA595@pacoca \
--to=joserz@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=oohall@gmail.com \
--cc=sjitindarsingh@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.