Commit ebccf40e authored by Catalin Marinas's avatar Catalin Marinas

Set the XN bit for the device areas

The XN bit has to be set to avoid speculative prefetch from the device
mappings on newer architectures (post ARMv6).
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 5d56e82d
......@@ -274,6 +274,10 @@ __create_page_tables:
#ifdef CONFIG_DEBUG_LL
bic r7, r7, #0x0c @ turn off cacheable
@ and bufferable bits
#if __LINUX_ARM_ARCH__ >= 6
orr r7, r7, #(1 << 4) @ must set XN to avoid
@ speculative prefetch
#endif
/*
* Map in IO space for serial debugging.
* This allows debug messages to be output
......
......@@ -420,9 +420,11 @@ void __init build_mem_type_table(void)
/*
* Mark the device area as "shared device"
* Bit 4 (execute-never) has to be set to avoid
* speculative prefetching
*/
mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED|PMD_BIT4;
/*
* User pages need to be mapped with the ASID
......
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