* [PATCH] arm: Preserve L_PTE_VALID in pte_modify()
@ 2013-02-12 18:25 Catalin Marinas
2013-02-18 16:21 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2013-02-12 18:25 UTC (permalink / raw)
To: linux-arm-kernel
Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
bit is cleared by the set_pte_ext() code. With LPAE the software and
hardware pte share the same location and subsequent modifications of pte
range (change_protection()) will leave the L_PTE_VALID bit cleared.
This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Subash Patel <subash.rp@samsung.com>
Tested-by: Subash Patel <subash.rp@samsung.com>
Cc: Will Deacon <will.deacon@arm.com>
---
arch/arm/include/asm/pgtable.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 9c82f988..c094749 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -240,7 +240,8 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
- const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | L_PTE_NONE;
+ const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER |
+ L_PTE_NONE | L_PTE_VALID;
pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
return pte;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] arm: Preserve L_PTE_VALID in pte_modify()
2013-02-12 18:25 [PATCH] arm: Preserve L_PTE_VALID in pte_modify() Catalin Marinas
@ 2013-02-18 16:21 ` Will Deacon
2013-02-25 14:43 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2013-02-18 16:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 12, 2013 at 06:25:50PM +0000, Catalin Marinas wrote:
> Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
> for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
> bit is cleared by the set_pte_ext() code. With LPAE the software and
> hardware pte share the same location and subsequent modifications of pte
> range (change_protection()) will leave the L_PTE_VALID bit cleared.
>
> This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Reported-by: Subash Patel <subash.rp@samsung.com>
> Tested-by: Subash Patel <subash.rp@samsung.com>
> Cc: Will Deacon <will.deacon@arm.com>
This matches what I did for arm64, so:
Acked-by: Will Deacon <will.deacon@arm.com>
Cheers,
Will
> ---
> arch/arm/include/asm/pgtable.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
> index 9c82f988..c094749 100644
> --- a/arch/arm/include/asm/pgtable.h
> +++ b/arch/arm/include/asm/pgtable.h
> @@ -240,7 +240,8 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
>
> static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
> {
> - const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER | L_PTE_NONE;
> + const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER |
> + L_PTE_NONE | L_PTE_VALID;
> pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
> return pte;
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Preserve L_PTE_VALID in pte_modify()
2013-02-18 16:21 ` Will Deacon
@ 2013-02-25 14:43 ` Will Deacon
2013-02-25 14:51 ` Catalin Marinas
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2013-02-25 14:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi Catalin,
On Mon, Feb 18, 2013 at 04:21:50PM +0000, Will Deacon wrote:
> On Tue, Feb 12, 2013 at 06:25:50PM +0000, Catalin Marinas wrote:
> > Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
> > for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
> > bit is cleared by the set_pte_ext() code. With LPAE the software and
> > hardware pte share the same location and subsequent modifications of pte
> > range (change_protection()) will leave the L_PTE_VALID bit cleared.
> >
> > This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
> >
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > Reported-by: Subash Patel <subash.rp@samsung.com>
> > Tested-by: Subash Patel <subash.rp@samsung.com>
> > Cc: Will Deacon <will.deacon@arm.com>
>
> This matches what I did for arm64, so:
>
> Acked-by: Will Deacon <will.deacon@arm.com>
Can you put this into the patch system please?
Cheers,
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Preserve L_PTE_VALID in pte_modify()
2013-02-25 14:43 ` Will Deacon
@ 2013-02-25 14:51 ` Catalin Marinas
2013-02-25 14:54 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2013-02-25 14:51 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 25, 2013 at 02:43:56PM +0000, Will Deacon wrote:
> Hi Catalin,
>
> On Mon, Feb 18, 2013 at 04:21:50PM +0000, Will Deacon wrote:
> > On Tue, Feb 12, 2013 at 06:25:50PM +0000, Catalin Marinas wrote:
> > > Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
> > > for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
> > > bit is cleared by the set_pte_ext() code. With LPAE the software and
> > > hardware pte share the same location and subsequent modifications of pte
> > > range (change_protection()) will leave the L_PTE_VALID bit cleared.
> > >
> > > This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
> > >
> > > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > > Reported-by: Subash Patel <subash.rp@samsung.com>
> > > Tested-by: Subash Patel <subash.rp@samsung.com>
> > > Cc: Will Deacon <will.deacon@arm.com>
> >
> > This matches what I did for arm64, so:
> >
> > Acked-by: Will Deacon <will.deacon@arm.com>
>
> Can you put this into the patch system please?
Already picked by rmk (I don't remember the patch number).
--
Catalin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: Preserve L_PTE_VALID in pte_modify()
2013-02-25 14:51 ` Catalin Marinas
@ 2013-02-25 14:54 ` Will Deacon
0 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2013-02-25 14:54 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 25, 2013 at 02:51:10PM +0000, Catalin Marinas wrote:
> On Mon, Feb 25, 2013 at 02:43:56PM +0000, Will Deacon wrote:
> > Hi Catalin,
> >
> > On Mon, Feb 18, 2013 at 04:21:50PM +0000, Will Deacon wrote:
> > > On Tue, Feb 12, 2013 at 06:25:50PM +0000, Catalin Marinas wrote:
> > > > Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
> > > > for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
> > > > bit is cleared by the set_pte_ext() code. With LPAE the software and
> > > > hardware pte share the same location and subsequent modifications of pte
> > > > range (change_protection()) will leave the L_PTE_VALID bit cleared.
> > > >
> > > > This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
> > > >
> > > > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > > > Reported-by: Subash Patel <subash.rp@samsung.com>
> > > > Tested-by: Subash Patel <subash.rp@samsung.com>
> > > > Cc: Will Deacon <will.deacon@arm.com>
> > >
> > > This matches what I did for arm64, so:
> > >
> > > Acked-by: Will Deacon <will.deacon@arm.com>
> >
> > Can you put this into the patch system please?
>
> Already picked by rmk (I don't remember the patch number).
Great, sorry for the bother (I can't see the patch in any upstream trees).
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-25 14:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 18:25 [PATCH] arm: Preserve L_PTE_VALID in pte_modify() Catalin Marinas
2013-02-18 16:21 ` Will Deacon
2013-02-25 14:43 ` Will Deacon
2013-02-25 14:51 ` Catalin Marinas
2013-02-25 14:54 ` Will Deacon
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.