|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 12/40] xen/mpu: introduce helpers for MPU enablement
Hi Penny, On 13/01/2023 05:28, Penny Zheng wrote: We need a new helper for Xen to enable MPU in boot-time. The new helper is semantically consistent with the original enable_mmu. If the Background region is enabled, then the MPU uses the default memory map as the Background region for generating the memory attributes when MPU is disabled. Since the default memory map of the Armv8-R AArch64 architecture is IMPLEMENTATION DEFINED, we always turn off the Background region. You are saying this. But I don't see any code below clearing SCTLR_EL2.BR. Can you clarify? In this patch, we also introduce a neutral name enable_mm for Xen to enable MMU/MPU. This can help us to keep one code flow in head.S NIT: Missing full stop.
Please document which register you are clobberring. See the MMU code for examples how to do you. + */ +ENTRY(enable_mm) + mrs x0, SCTLR_EL2 + orr x0, x0, #SCTLR_Axx_ELx_M /* Enable MPU */ + orr x0, x0, #SCTLR_Axx_ELx_C /* Enable D-cache */ + orr x0, x0, #SCTLR_Axx_ELx_WXN /* Enable WXN */ + dsb sy Please document the reason of each dsb. In this case, it is not entirely clear what this is for. + msr SCTLR_EL2, x0 + isb Likely for isb. + ret +ENDPROC(enable_mm) + Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |