arm: Add XN bit to pgrprot_stronglyordered
pgprot_stronglyordered sets page attributes to the strongly ordered
memory type. This type is often used for regions of memory which
cannot be speculated into. Strongly ordered memory by itself prevents
speculative data accesses but it will not prevent speculative instruction
accesses. Since strongly ordered memory will never be used for
instructions, set the XN bit as well to prevent speculative instruction
fethces.
Change-Id: I3405a6f791499f32d94b0a60f55f2ffa08620c85
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 6bbe966..e0376d1 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -101,7 +101,7 @@
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
#define pgprot_stronglyordered(prot) \
- __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
+ __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED | L_PTE_XN)
#define pgprot_device(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_DEV_NONSHARED)