arm: Preserve L_PTE_VALID in pte_modify()
PATCH 1/1 arm: Preserve L_PTE_VALID in pte_modify()
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().
--- arch/arm/include/asm/pgtable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/include/asm/pgtable.h +2 -1
@@ -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; }
PATCH 1/1 arm: Preserve L_PTE_VALID in pte_modify()
Quoted 6 lines · Catalin Marinas
Following commit
26ffd0d4(ARM: mm: introduce present, faulting entries forPAGE_NONE), if a page has been mapped asPROT_NONE, theL_PTE_VALIDbit is cleared by theset_pte_ext()code. With LPAE the software and hardware pte share the same location and subsequent modifications of pte range (change_protection()) will leave theL_PTE_VALIDbit cleared.
Quoted 6 lines
This patch adds the
L_PTE_VALIDbit to the newprot mask inpte_modify().Signed-off-by Catalin Marinas <[email protected]>Reported-by Subash Patel <[email protected]>Tested-by Subash Patel <[email protected]>Cc Will Deacon <[email protected]>
This matches what I did for arm64, so:
Cheers,
Will
Quoted 18 lines
--- arch/arm/include/asm/pgtable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/include/asm/pgtable.h +2
-1@@ -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; }
PATCH 1/1 arm: Preserve L_PTE_VALID in pte_modify()
Hi Catalin,
Quoted 9 lines · Will Deacon
Quoted 8 lines · Catalin Marinas
Following commit
26ffd0d4(ARM: mm: introduce present, faulting entries forPAGE_NONE), if a page has been mapped asPROT_NONE, theL_PTE_VALIDbit is cleared by theset_pte_ext()code. With LPAE the software and hardware pte share the same location and subsequent modifications of pte range (change_protection()) will leave theL_PTE_VALIDbit cleared.This patch adds the
L_PTE_VALIDbit to the newprot mask inpte_modify().
Quoted 8 lines
Quoted 4 lines
Signed-off-by Catalin Marinas <[email protected]>Reported-by Subash Patel <[email protected]>Tested-by Subash Patel <[email protected]>Cc Will Deacon <[email protected]>This matches what I did for arm64, so:
Acked-by Will Deacon <[email protected]>
Can you put this into the patch system please?
Cheers,
Will
PATCH 1/1 arm: Preserve L_PTE_VALID in pte_modify()
Quoted 17 lines · Will Deacon
Hi Catalin,
Quoted 14 lines · Will Deacon
Quoted 12 lines · Catalin Marinas
Following commit
26ffd0d4(ARM: mm: introduce present, faulting entries forPAGE_NONE), if a page has been mapped asPROT_NONE, theL_PTE_VALIDbit is cleared by theset_pte_ext()code. With LPAE the software and hardware pte share the same location and subsequent modifications of pte range (change_protection()) will leave theL_PTE_VALIDbit cleared.This patch adds the
L_PTE_VALIDbit to the newprot mask inpte_modify().Signed-off-by Catalin Marinas <[email protected]>Reported-by Subash Patel <[email protected]>Tested-by Subash Patel <[email protected]>Cc Will Deacon <[email protected]>
Quoted 5 lines
Quoted 3 lines
This matches what I did for arm64, so:
Acked-by Will Deacon <[email protected]>Can you put this into the patch system please?
Already picked by rmk (I don't remember the patch number).
Signature · 1 line
Catalin
PATCH 1/1 arm: Preserve L_PTE_VALID in pte_modify()
Quoted 18 lines · Catalin Marinas
Quoted 17 lines · Will Deacon
Hi Catalin,
Quoted 14 lines · Will Deacon
Quoted 12 lines · Catalin Marinas
Following commit
26ffd0d4(ARM: mm: introduce present, faulting entries forPAGE_NONE), if a page has been mapped asPROT_NONE, theL_PTE_VALIDbit is cleared by theset_pte_ext()code. With LPAE the software and hardware pte share the same location and subsequent modifications of pte range (change_protection()) will leave theL_PTE_VALIDbit cleared.This patch adds the
L_PTE_VALIDbit to the newprot mask inpte_modify().Signed-off-by Catalin Marinas <[email protected]>Reported-by Subash Patel <[email protected]>Tested-by Subash Patel <[email protected]>Cc Will Deacon <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This matches what I did for arm64, so:
Acked-by Will Deacon <[email protected]>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