arm64: enable mpu background region

Enable SCTLR_EL1.BR bit to activate MPU background region support. This simplifies MPU
configuration by providing a default MAIR attribute for unmapped regions, reducing the
need for exhaustive region coverage and improving MPU flexibility.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2025-07-08 16:17:07 +08:00 committed by Xiang Xiao
parent 564c9d7dcd
commit 7d30afa589
2 changed files with 2 additions and 0 deletions

View file

@ -97,6 +97,7 @@
#define SCTLR_C_BIT BIT(2)
#define SCTLR_SA_BIT BIT(3)
#define SCTLR_I_BIT BIT(12)
#define SCTLR_BR_BIT BIT(17)
/* Controls the impact of tag check faults
* due to loads and stores in EL0 EL1.

View file

@ -222,6 +222,7 @@ void arm64_mpu_enable(void)
#ifndef CONFIG_ARM64_DCACHE_DISABLE
| SCTLR_C_BIT
#endif
| SCTLR_BR_BIT /* Background region enable */
);
write_sysreg(val, sctlr_el1);
UP_MB();