From: leroy christophe <christophe.leroy@c-s.fr>
To: Scott Wood <scottwood@freescale.com>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [v2 PATCH 1/2] powerpc32: adds handling of _PAGE_RO
Date: Mon, 22 Dec 2014 11:25:39 +0100 [thread overview]
Message-ID: <5497F1A3.7060004@c-s.fr> (raw)
In-Reply-To: <1418868868.5581.121.camel@freescale.com>
Le 18/12/2014 03:14, Scott Wood a écrit :
> On Wed, 2014-12-17 at 10:14 +0100, Christophe Leroy wrote:
>> Some powerpc like the 8xx don't have a RW bit in PTE bits but a RO (Read Only) bit.
>> This patch implements the handling of a _PAGE_RO flag to be used in place 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/pgtable-ppc32.h | 11 ++++++-----
>> arch/powerpc/include/asm/pgtable.h | 10 +++++++---
>> arch/powerpc/include/asm/pte-common.h | 27 ++++++++++++++++++---------
>> arch/powerpc/mm/gup.c | 2 ++
>> arch/powerpc/mm/mem.c | 2 +-
>> arch/powerpc/mm/pgtable_32.c | 24 ++++++++++++++++++++----
>> 6 files changed, 54 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
>> index 543bb8e..64ed9e1 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc32.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
>> @@ -125,7 +125,7 @@ extern int icache_44x_need_flush;
>> #ifndef __ASSEMBLY__
>>
>> #define pte_clear(mm, addr, ptep) \
>> - do { pte_update(ptep, ~_PAGE_HASHPTE, 0); } while (0)
>> + do { pte_update(ptep, ~_PAGE_HASHPTE, _PAGE_RO); } while (0)
> Is this really necessary? It's already clearing the valid bit.
>
> Likewise in several other places that set or check for _PAGE_RO on pages
> for which no access is permitted.
>
>
You are right, this is not needed. I needed it because I had defined
pte_none() as requiring _PAGE_RO set. But we can keep value 0 as
pte_none. Taken into account in v3
Christophe
WARNING: multiple messages have this Message-ID (diff)
From: leroy christophe <christophe.leroy@c-s.fr>
To: Scott Wood <scottwood@freescale.com>
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 1/2] powerpc32: adds handling of _PAGE_RO
Date: Mon, 22 Dec 2014 11:25:39 +0100 [thread overview]
Message-ID: <5497F1A3.7060004@c-s.fr> (raw)
In-Reply-To: <1418868868.5581.121.camel@freescale.com>
Le 18/12/2014 03:14, Scott Wood a écrit :
> On Wed, 2014-12-17 at 10:14 +0100, Christophe Leroy wrote:
>> Some powerpc like the 8xx don't have a RW bit in PTE bits but a RO (Read Only) bit.
>> This patch implements the handling of a _PAGE_RO flag to be used in place 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/pgtable-ppc32.h | 11 ++++++-----
>> arch/powerpc/include/asm/pgtable.h | 10 +++++++---
>> arch/powerpc/include/asm/pte-common.h | 27 ++++++++++++++++++---------
>> arch/powerpc/mm/gup.c | 2 ++
>> arch/powerpc/mm/mem.c | 2 +-
>> arch/powerpc/mm/pgtable_32.c | 24 ++++++++++++++++++++----
>> 6 files changed, 54 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
>> index 543bb8e..64ed9e1 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc32.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
>> @@ -125,7 +125,7 @@ extern int icache_44x_need_flush;
>> #ifndef __ASSEMBLY__
>>
>> #define pte_clear(mm, addr, ptep) \
>> - do { pte_update(ptep, ~_PAGE_HASHPTE, 0); } while (0)
>> + do { pte_update(ptep, ~_PAGE_HASHPTE, _PAGE_RO); } while (0)
> Is this really necessary? It's already clearing the valid bit.
>
> Likewise in several other places that set or check for _PAGE_RO on pages
> for which no access is permitted.
>
>
You are right, this is not needed. I needed it because I had defined
pte_none() as requiring _PAGE_RO set. But we can keep value 0 as
pte_none. Taken into account in v3
Christophe
next prev parent reply other threads:[~2014-12-22 10:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 9:14 [v2 PATCH 1/2] powerpc32: adds handling of _PAGE_RO Christophe Leroy
2014-12-17 9:14 ` Christophe Leroy
2014-12-18 2:14 ` Scott Wood
2014-12-18 2:14 ` Scott Wood
2014-12-18 7:11 ` leroy christophe
2014-12-18 7:11 ` leroy christophe
2014-12-18 11:23 ` Scott Wood
2014-12-18 11:23 ` Scott Wood
2014-12-22 10:25 ` leroy christophe [this message]
2014-12-22 10:25 ` 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=5497F1A3.7060004@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=scottwood@freescale.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.