[PATCH] ARM: Kconfig: Disable ARM_VIRT extension if XIP_KERNEL

Rob Herring (Arm) robh at kernel.org
Tue Apr 28 14:58:15 PDT 2026


From: Vishnu Banavath <vishnu.banavath at arm.com>

XIP is intended to execute kernel inplace and typically from
flash and is used mostly on low memory devices.

.macro  store_primary_cpu_mode  reg1, reg2, reg3
        mrs     \reg1, cpsr
        and     \reg1, \reg1, #MODE_MASK
        adr     \reg2, .L__boot_cpu_mode_offset
        ldr     \reg3, [\reg2]
        str     \reg1, [\reg2, \reg3]

As text section is in flash memory and data section is in RAM.
L__boot_cpu_mode_offset would evaluate to address based
on virtual addresses provided by linker script. At this stage
the MMU is OFF.

The logic used based stored @L__boot_cpu_mode_offset on the offset
between the  boot_cpu_mode in data section and the location of
L__boot_cpu_mode_offset can't be used along with PC to fetch the value
of boot_cpu_mode doesn't work.

Signed-off-by: Vishnu Banavath <vishnu.banavath at arm.com>
Signed-off-by: Rob Herring (Arm) <robh at kernel.org>
---
This patch is from Alif E8 SoC tree which I'm working on. It's 
originally from corstone700 trees.

 arch/arm/mm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 7b27ee9482b3..e2f5d3d7d3fb 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -705,6 +705,7 @@ config ARM_THUMBEE
 
 config ARM_VIRT_EXT
 	bool
+	depends on MMU && !XIP_KERNEL
 	default y if CPU_V7
 	help
 	  Enable the kernel to make use of the ARM Virtualization
-- 
2.53.0




More information about the linux-arm-kernel mailing list