arm64: Set PXN/UXN attributes for uncached mem
The attributes should be set to avoid speculative access to memory-mapped peripherals. The patch has been tested with: noinline unsigned long nox(void) { return get_pc(); } static void xn_test(void) { void *adr = (void *)SOME_SRAM_ADDRESS; unsigned long ret; unsigned long (*fn)(void) = adr; memcpy(adr, nox, 0x1000); sync_caches_for_execution(); ret = fn(); printf("pc: 0x%08lx\n", ret); } Without this patch nox() gets executed in SRAM, with it runs into a abort as expected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> |
---|
|
arch/arm/cpu/mmu-early_64.c |
---|
arch/arm/cpu/mmu_64.c |
---|
arch/arm/cpu/mmu_64.h |
---|