|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 6/7] arm/mpu: Implement early_fdt_map support in MPU systems
Hi Luca, On 11/04/2025 23:56, Luca Fancellu wrote: Implement early_fdt_map() function, that is responsible to map the device tree blob in the early stages of the boot process, since at this stage the MPU C data structure are not yet initialised, it is using low level APIs to write into the MPU registers at a fixed MPU region number. The MPU memory management is designed to work on pages of PAGE_SIZE in order to reuse helpers and macros already available on the Xen memory management system. Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx> --- xen/arch/arm/mpu/setup.c | 54 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c index b4da77003f47..5969065250d4 100644 --- a/xen/arch/arm/mpu/setup.c +++ b/xen/arch/arm/mpu/setup.c @@ -1,17 +1,67 @@ /* SPDX-License-Identifier: GPL-2.0-only */+#include <xen/bootfdt.h>#include <xen/bug.h> #include <xen/init.h> +#include <xen/libfdt/libfdt.h> #include <xen/mm.h> +#include <xen/pfn.h> #include <xen/types.h> +#include <asm/mpu.h> +#include <asm/page.h> #include <asm/setup.h>+/* Needs to be kept in sync with the regions programmed in arm64/mpu/head.S */ This is common code. So you will need to keep in sync for both 32-bit and 64-bit. That said, someone modifying head.S will not necessarily remember that this needs to be kept in sync. Such comment would be more effective in head.S just after the last section. However, the number of regions mapped can change. So I am not sure why we are... +#define EARLY_FDT_MAP_REGION_NUMBER 6 ... hardcoding to 6 rather than using the next available region.
NIT: IIRC, the minimum for the MPU is 64-byte. So is there any reason we are enforcing a bigger alignment? Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |