Commit 034aa9cd authored by Will Deacon's avatar Will Deacon

arm64: pgtable: Clear the GP bit for non-executable kernel pages

Commit cca98e9f ("mm: enforce that vmap can't map pages executable")
introduced 'pgprot_nx(prot)' for arm64 but collided silently with the
BTI support during the merge window, which endeavours to clear the GP
bit for non-executable kernel mappings in set_memory_nx().

For consistency between the two APIs, clear the GP bit in pgprot_nx().
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200615154642.3579-1-will@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 8dd4daa0
...@@ -416,7 +416,7 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd) ...@@ -416,7 +416,7 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd)
__pgprot((pgprot_val(prot) & ~(mask)) | (bits)) __pgprot((pgprot_val(prot) & ~(mask)) | (bits))
#define pgprot_nx(prot) \ #define pgprot_nx(prot) \
__pgprot_modify(prot, 0, PTE_PXN) __pgprot_modify(prot, PTE_MAYBE_GP, PTE_PXN)
/* /*
* Mark the prot value as uncacheable and unbufferable. * Mark the prot value as uncacheable and unbufferable.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment