From: Scott Wood <scottwood@freescale.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
<linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
"Joakim Tjernlund" <joakim.tjernlund@transmode.se>
Subject: Re: [v2 PATCH 2/2] powerpc/8xx: use _PAGE_RO instead of _PAGE_RW
Date: Wed, 17 Dec 2014 20:22:43 -0600 [thread overview]
Message-ID: <1418869363.5581.123.camel@freescale.com> (raw)
In-Reply-To: <20141217091432.072901A5E12@localhost.localdomain>
On Wed, 2014-12-17 at 10:14 +0100, Christophe Leroy wrote:
> On powerpc 8xx, in TLB entries, 0x400 bit is set to 1 for read-only pages
> and is set to 0 for RW pages. So we should use _PAGE_RO instead of _PAGE_RW
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> ---
> v2 is a complete rework compared to v1
>
> arch/powerpc/include/asm/pte-8xx.h | 7 +++----
> arch/powerpc/kernel/head_8xx.S | 3 ---
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/pte-8xx.h b/arch/powerpc/include/asm/pte-8xx.h
> index daa4616..4f5583e 100644
> --- a/arch/powerpc/include/asm/pte-8xx.h
> +++ b/arch/powerpc/include/asm/pte-8xx.h
> @@ -46,7 +46,7 @@
> * require a TLB exception handler change. It is assumed unused bits
> * are always zero.
> */
> -#define _PAGE_RW 0x0400 /* lsb PP bits, inverted in HW */
> +#define _PAGE_RO 0x0400 /* lsb PP bits */
It looks like pte_update() needs to be updated to match.
> #define _PAGE_USER 0x0800 /* msb PP bits */
> /* set when neither _PAGE_USER nor _PAGE_RW are set */
Also update this comment.
> #define _PAGE_KNLRO 0x0200
> @@ -62,9 +62,8 @@
> #define PTE_ATOMIC_UPDATES 1
>
> /* We need to add _PAGE_SHARED to kernel pages */
> -#define _PAGE_KERNEL_RO (_PAGE_SHARED | _PAGE_KNLRO)
> -#define _PAGE_KERNEL_ROX (_PAGE_EXEC | _PAGE_KNLRO)
> -#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
> +#define _PAGE_KERNEL_RO (_PAGE_SHARED | _PAGE_RO | _PAGE_KNLRO)
> +#define _PAGE_KERNEL_ROX (_PAGE_EXEC | _PAGE_RO | _PAGE_KNLRO)
>
> #endif /* __KERNEL__ */
> #endif /* _ASM_POWERPC_PTE_8xx_H */
Where did _PAGE_KERNEL_RW go?
-Scott
next prev parent reply other threads:[~2014-12-18 2:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 9:14 [v2 PATCH 2/2] powerpc/8xx: use _PAGE_RO instead of _PAGE_RW Christophe Leroy
2014-12-18 2:22 ` Scott Wood [this message]
2014-12-18 7:05 ` leroy christophe
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=1418869363.5581.123.camel@freescale.com \
--to=scottwood@freescale.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=joakim.tjernlund@transmode.se \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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