| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU systems
 On 30/06/2023 11:49, Ayan Kumar Halder wrote: On 30/06/2023 05:07, Penny Zheng wrote:Hi,Hi Penny,On 2023/6/30 01:22, Ayan Kumar Halder wrote:On 26/06/2023 04:34, Penny Zheng wrote:CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.I don't think this is related to MPU. At least when I look at the bit representation of PRBAR_EL1/2,In MPU system, MPU memory region is always mapped PAGE_ALIGN, so in order to not access unexpected memory area, dtb section in xen.lds.S should be madepage-aligned too.We add . = ALIGN(PAGE_SIZE); in the head of dtb section to make it happen.In this commit, we map early FDT with a transient MPU memory region, as it will be relocated into heap and unmapped at the end of boot. Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx> Signed-off-by: Wei Chen <wei.chen@xxxxxxx> --- v3:- map the first 2MB. Check the size and then re-map with an extra 2MB if needed--- xen/arch/arm/include/asm/arm64/mpu.h | 3 ++- xen/arch/arm/include/asm/page.h | 5 +++++ xen/arch/arm/mm.c | 26 ++++++++++++++++++++------ xen/arch/arm/mpu/mm.c | 1 + xen/arch/arm/xen.lds.S | 5 ++++- 5 files changed, 32 insertions(+), 8 deletions(-)diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h Penny's approach matches what we are doing in the MMU code. We want to have a way for the caller to pass just set of flags and let the callee to decide what to do with them. This may be flags converted for HW fields or just used by the logic.If you disagree with this approach, then can you propose a different way that we can discuss? You are right, the top bits are RES0 (not ignored like on ARMv8-A). So we can't use to store the p2m_type.2. Also, refer xen/arch/arm/include/asm/arm64/mpu.h, typedef union prbar_t {} :- Cheers, -- Julien Grall 
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |