Re: [for-4.20][PATCH] xen/arm64: Drop relocate_and_switch_ttbr() stub

2025-01-08 Thread Luca Fancellu
> On 8 Jan 2025, at 09:01, Luca Fancellu wrote: > > > >> On 8 Jan 2025, at 07:57, Michal Orzel wrote: >> >> In the original patch e7a80636f16e ("xen/arm: add cache coloring support >> for Xen image"), the stub was added under wrong assumption

Re: [PATCH 3/5] xen/arm: mpu: Move some of the definitions to common file

2025-02-06 Thread Luca Fancellu
Hi Ayan, > On 4 Feb 2025, at 19:23, Ayan Kumar Halder wrote: > > For AArch32, refer to ARM DDI 0568A.c ID110520. > MPU_REGION_SHIFT is same between AArch32 and AArch64 (HPRBAR). > Also, NUM_MPU_REGIONS_SHIFT is same between AArch32 and AArch64 > (HMPUIR). > > Signed-off-by: Ayan Kumar Halder >

Re: [PATCH 2/5] xen/arm: mpu: Enclose access to MMU specific registers under CONFIG_MMU (arm32)

2025-02-06 Thread Luca Fancellu
0, HTCR) > +#endif I was wondering if here it was better, for readability, to have this part defined in the arm32/mmu/head.S and arm32/mpu/head.S could have implemented a stub, maybe the maintainer could help with that. Anyway this solution works for me. Reviewed-by: Luca Fancellu > > mov_w r0, HSCTLR_SET > mcr CP32(r0, HSCTLR) > -- > 2.25.1 > >

Re: [PATCH 1/5] xen/arm: mpu: Ensure that the page size is 4KB (arm32)

2025-02-06 Thread Luca Fancellu
n line with what is done for arm64. Reviewed-by: Luca Fancellu

Re: [PATCH 5/5] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm (arm32)

2025-02-06 Thread Luca Fancellu
Hi Ayan, > On 4 Feb 2025, at 19:23, Ayan Kumar Halder wrote: > > Secondary cpus initialization is not yet supported. Thus, we print an > appropriate message and put the secondary cpus in WFE state. > > Signed-off-by: Ayan Kumar Halder > --- Reviewed-by: Luca Fancellu

Re: [PATCH 4/5] xen/arm: mpu: Create boot-time MPU protection regions (arm32)

2025-02-06 Thread Luca Fancellu
Hi Ayan, > On 4 Feb 2025, at 19:23, Ayan Kumar Halder wrote: > > Define enable_boot_cpu_mm() for the Armv8-R AArch64. > > Like boot-time page table in MMU system, we need a boot-time MPU protection > region configuration in MPU system so Xen can fetch code and data from normal > memory. > > To

Re: Coding Style Review and Automation

2025-02-11 Thread Luca Fancellu
Hi Roger, 5) You name it. I think many people in the community can name their points for and against clang-format. >>> >>> What are the parts of our coding style that clang-format cannot >>> correctly represent? Could you make a list of what would need to >>> change in Xen

Re: Coding Style Review and Automation

2025-02-11 Thread Luca Fancellu
Hi Roger, >> >> 3) The size of the patch after applying clang-format is huge. Really. >> Something >> like 9 MB. Even if everyone agrees that the approach is good and we can >> proceed >> with it, it is highly unlikely anyone will be able to review it. Considering >> that new patches are being

[PATCH 0/2] Prerequisite patches for Arm64 MPU build

2025-02-12 Thread Luca Fancellu
Hi all, in order to build Xen for Arm64 with MPU support, there are few changes to support the compilation of Arm code without HAS_PASSTHROUGH and some refactoring around the start_xen for Arm. Luca Fancellu (2): xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH xen/arm: Move

[PATCH 2/2] xen/arm: Move early mapping operations to new function

2025-02-12 Thread Luca Fancellu
64 and not numa. Now setup_pagetables() is called only in the mmu/setup.c module, limit its visibility and remove it from mm.h header. Signed-off-by: Luca Fancellu --- xen/arch/arm/Kconfig | 2 +- xen/arch/arm/include/asm/mm.h | 4 ++-- xen/arch/arm/mmu/setup.c | 35 +

[PATCH 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-12 Thread Luca Fancellu
, which is the case for example on systems with MPU support. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/grant_table.h | 8 ++ xen/include/xen/iommu.h| 40 +++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include

Re: [PATCH 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-12 Thread Luca Fancellu
Hi Andrew, thanks for your review, > On 12 Feb 2025, at 11:50, Andrew Cooper wrote: > > On 12/02/2025 9:18 am, Luca Fancellu wrote: >> When Xen is built without HAS_PASSTHROUGH, there are some parts >> in arm and x86 where iommu_* functions are called in the c

[PATCH v5] xen/arm: Check for Static Heap feature when freeing resources

2024-12-11 Thread Luca Fancellu
from init data bootinfo, as it will be needed after destroying the init data section, rename it to using_static_heap and use it to tell whether the Xen static heap feature is enabled. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu Reviewed-by: Jan Beulich

Re: [PATCH v5] xen/arm: Check for Static Heap feature when freeing resources

2024-12-11 Thread Luca Fancellu
Hi Michal, > On 11 Dec 2024, at 11:59, Michal Orzel wrote: > > > > On 11/12/2024 12:11, Luca Fancellu wrote: >> >> >> From: Penny Zheng >> >> If the Xen heap is statically configured in Device Tree, its size is >> definite, so

Re: [PATCH] arm/domain_build: Make find_unallocated_memory() more generic

2024-12-10 Thread Luca Fancellu
_banks. > --- Hi Michal, it looks good to me, I’ve also tested in our CI and no issues! Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

[PATCH v6] xen/arm: Check for Static Heap feature when freeing resources

2024-12-12 Thread Luca Fancellu
from init data bootinfo, as it will be needed after destroying the init data section, rename it to using_static_heap and use it to tell whether the Xen static heap feature is enabled. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- Changes from v5: - Drop Jan

Re: [PATCH v2 1/1] tools, xen/scripts: clear out Python syntax warnings

2024-12-17 Thread Luca Fancellu
pygrub understand default entry in > string format") > Fixes: 622e368758b ("Add ZFS libfsimage support patch") > Fixes: 02b26c02c7c ("xen/scripts: add cppcheck tool to the xen-analysis.py > script") > Fixes: 56c0063f4e7 ("xen/misra: xen-analysis.py:

[PATCH v7] xen/arm: Check for Static Heap feature when freeing resources

2024-12-13 Thread Luca Fancellu
from init data bootinfo, as it will be needed after destroying the init data section, rename it to using_static_heap and use it to tell whether the Xen static heap feature is enabled. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel

Re: [PATCH 1/1] xen/scripts: Fix regex syntax warnings with Python 3.12

2024-12-20 Thread Luca Fancellu
s: add cppcheck tool to the xen-analysis.py > script) > Signed-off-by: Ariel Otilibili > -- Reviewed-by: Luca Fancellu

[PATCH] xen/arm: Initialise memory type for struct kernel_info

2024-12-20 Thread Luca Fancellu
tly used while managing kernel_info structures, it's good to have it for completeness. Fixes: a14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges") Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/kernel.h | 5 - 1 file changed, 4 inser

Re: [PATCH] xen/arm: Initialise memory type for struct kernel_info

2024-12-23 Thread Luca Fancellu
Hi Julien and Michal, > On 23 Dec 2024, at 10:45, Julien Grall wrote: > > Hi, > > On 23/12/2024 10:42, Michal Orzel wrote: >> On 23/12/2024 11:06, Julien Grall wrote: >>> >>> >>> Hi Michal, >>> >>> On 23/12/2024 07:58, Micha

Re: [for-4.20][PATCH 1/2] device-tree: bootfdt: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

2025-01-27 Thread Luca Fancellu
bank > structures") > Signed-off-by: Michal Orzel > --- Apart from Julien’s comments for which I’ll leave you both to agree on a solution, I’ve reproduced the issue and tested that your change is fixing it and it’s not breaking a different setup (e.g. 64 bit). Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

Re: [for-4.20][PATCH 2/2] xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

2025-01-27 Thread Luca Fancellu
virt()") > Signed-off-by: Michal Orzel > --- I’ve tested this one and it fix the compilation issue on the above setup, I’ve also tested that it doesn’t introduce issues on other setup (e.g. arm64) Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

Re: [for-4.20][PATCH v2 1/2] device-tree: bootfdt: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

2025-01-28 Thread Luca Fancellu
k" are equally aligned */ > +BUILD_BUG_ON(alignof(struct membanks) != alignof(struct membank)); Apologies for not catching the issue for your v1, probably I didn't understand very well the test itself, why are we checking that the structure have the same alignment? I see we c

[for-4.20 PATCH v3] xen/arm: Fully initialise struct membanks_hdr fields

2025-01-09 Thread Luca Fancellu
14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges") Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- Changes from v2: - Banks created by Xen should be MEMORY type. (Michal) - Add R-by Michal Changes from v1: - Changed commit title and body msg

Re: [PATCH v2] xen/arm: Fully initialise struct membanks_hdr fields

2025-01-09 Thread Luca Fancellu
>> >>> --- --- xen/arch/arm/domain_build.c | 13 - xen/arch/arm/include/asm/kernel.h | 5 - xen/arch/arm/static-shmem.c | 3 ++- xen/include/xen/bootfdt.h | 16 4 files changed, 26 insertions(+), 11 deletions(-)

Re: [PATCH v2] xen/arm: Fully initialise struct membanks_hdr fields

2025-01-09 Thread Luca Fancellu
Hi Michal, > On 9 Jan 2025, at 10:00, Michal Orzel wrote: > > Hi Luca, > > Is this patch for 4.20? I would say so, therefore it should have "for-4.20" > tag and Oleksii as release manager > should be CCed. Doing it now. Thanks, I forgot the procedure > >> --- >> --- >> xen/arch/arm/domain_b

[PATCH v2] xen/arm: Fully initialise struct membanks_hdr fields

2025-01-09 Thread Luca Fancellu
14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges") Signed-off-by: Luca Fancellu --- Changes from v1: - Changed commit title and body msg - initialised max_banks and type for all structures using 'struct membanks_hdr' I didn't get why the fixe

Re: [PATCH 2/2] xen/arm: Move early mapping operations to new function

2025-02-13 Thread Luca Fancellu
Hi Julien, thanks for your review. >> +void __init setup_early_mappings(paddr_t fdt_paddr) >> +{ >> +const char *cmdline; >> +struct bootmodule *xen_bootmodule; >> + >> +device_tree_flattened = early_fdt_map(fdt_paddr); >> +if ( !device_tree_flattened ) >> +panic("Invalid

Re: [PATCH] radix-tree: don't left-shift negative values

2025-02-13 Thread Luca Fancellu
se that file >> to generate the exclusion list dynamically, but then someone might want to >> exclude certain files only in some analyses and not others, which is not a >> good fit for exclude-list.json as it is now. >> @Stefano, thoughts? > > I forgot to address the f

Re: [PATCH 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-12 Thread Luca Fancellu
> On 12 Feb 2025, at 12:37, Luca Fancellu wrote: > > Hi Andrew, > > thanks for your review, > >> On 12 Feb 2025, at 11:50, Andrew Cooper wrote: >> >> On 12/02/2025 9:18 am, Luca Fancellu wrote: >>> When Xen is built without HAS_PASSTHROUGH,

[PATCH v2 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-17 Thread Luca Fancellu
, which is the case for example on systems with MPU support. For gnttab_need_iommu_mapping() in the Arm part, modify the macro to use IS_ENABLED for the HAS_PASSTHROUGH Kconfig. Signed-off-by: Luca Fancellu --- v2 Changes: - modify gnttab_need_iommu_mapping to use IS_ENABLED - removed macro that

[PATCH v2 0/2] Prerequisite patches for Arm64 MPU build

2025-02-17 Thread Luca Fancellu
Hi all, in order to build Xen for Arm64 with MPU support, there are few changes to support the compilation of Arm code without HAS_PASSTHROUGH and some refactoring around the start_xen for Arm. Luca Fancellu (2): xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH xen/arm: Restrict

[PATCH v2 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-17 Thread Luca Fancellu
(), because it parses the memory banks from the DT, but to discover that the developer needs to dig into the function. Signed-off-by: Luca Fancellu --- v2 changes: - dropped part of the v1 code, now this one is simpler, I will discuss better how to design a common boot flow for MPU and implement on

Re: [PATCH v2 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-17 Thread Luca Fancellu
Hi Jan, thanks for your review, > On 17 Feb 2025, at 10:50, Jan Beulich wrote: > > On 17.02.2025 11:27, Luca Fancellu wrote: >> When Xen is built without HAS_PASSTHROUGH, there are some parts >> in arm and x86 where iommu_* functions are called in the codebase, >>

Re: [PATCH v2 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-17 Thread Luca Fancellu
>>> +static inline int iommu_domain_init(struct domain *d, unsigned int opts) >>> +{ >>> +return 0; >> >> Shouldn't this fail when is_iommu_enabled(d) is true? (The use of the >> predicate here as well as in the real function is slightly strange, but >> that's the way it is.) > > Right, prob

[PATCH v3] xen/arm: Don't use copy_from_paddr for DTB relocation

2025-02-26 Thread Luca Fancellu
pen-coding copy_from_paddr inside relocate_fdt, without mapping on the fixmap. Signed-off-by: Luca Fancellu --- Changes from v2: - fixed pointer issue for dtb_vaddr. --- xen/arch/arm/setup.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/setup.c b/xe

Re: [PATCH 3/5] xen/arm: mpu: Move some of the definitions to common file

2025-02-26 Thread Luca Fancellu
Hi Julien, >>> >>> #ifdef CONFIG_EARLY_PRINTK >>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h >>> b/xen/arch/arm/include/asm/mpu.h >> Why not in include/mpu/ ? > > Do you mean include/asm/mpu? or something different? Yes, sorry typo, I mean include/asm/mpu/mpu.h Cheers, Luca

Re: [PATCH] xen/arm: Don't use copy_from_paddr for DTB relocation

2025-02-26 Thread Luca Fancellu
>> >>> return fdt; } @@ -362,7 +363,7 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr) if ( acpi_disabled ) { printk("Booting using Device Tree\n"); -device_tree_flattened = relocate_fdt(fdt_paddr, fdt_size);

Re: [PATCH] xen/arm: Don't use copy_from_paddr for DTB relocation

2025-02-26 Thread Luca Fancellu
Hi Michal, > On 26 Feb 2025, at 10:38, Orzel, Michal wrote: > > > > On 26/02/2025 09:36, Luca Fancellu wrote: >> >> >> Currently the early stage of the Arm boot maps the DTB using >> early_fdt_map() using PAGE_HYPERVISOR_RO which is cacheable >>

[PATCH v2] xen/arm: Don't use copy_from_paddr for DTB relocation

2025-02-26 Thread Luca Fancellu
pen-coding copy_from_paddr inside relocate_fdt, without mapping on the fixmap. Signed-off-by: Luca Fancellu --- xen/arch/arm/setup.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index c1f2d1b89d43..2a9747a50abc 100644 ---

[PATCH] xen/arm: Don't use copy_from_paddr for DTB relocation

2025-02-26 Thread Luca Fancellu
pen-coding copy_from_paddr inside relocate_fdt, without mapping on the fixmap. Fixes: 1bdc81dac816 ("arm: setup MM using information from the device tree") Signed-off-by: Luca Fancellu --- xen/arch/arm/setup.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xe

Re: [PATCH v2 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-17 Thread Luca Fancellu
Hi Michal, > On 17 Feb 2025, at 12:55, Orzel, Michal wrote: > > > > On 17/02/2025 11:27, Luca Fancellu wrote: >> >> >> LLC coloring can be used only on MMU system, move the code >> that selects it from ARM_64 to MMU and add the ARM_64 >> depend

Re: [PATCH v2 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-17 Thread Luca Fancellu
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index c1f2d1b89d43..91fa579e73e5 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -328,6 +328,7 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr) (padd

Re: [PATCH v2 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-17 Thread Luca Fancellu
> --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -110,6 +110,8 @@ extern int8_t iommu_hwdom_reserved; extern unsigned int iommu_dev_iotlb_timeout; +#ifdef CONFIG_HAS_PASSTHROUGH + int iommu_setup(void); int iommu_hardware_setup(vo

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-18 Thread Luca Fancellu
Hi Oleksandr, > > 2. Long strings in ptintk violations > I filed an issue on printk format strings [5] > == > @@ -225,9 +231,9 @@ void __init acpi_table_print_madt_entry(struct > acpi_subtable_header *header) > p

[PATCH v3 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-18 Thread Luca Fancellu
the case for example on systems with MPU support. For gnttab_need_iommu_mapping() in the Arm part, modify the macro to use IS_ENABLED for the HAS_PASSTHROUGH Kconfig. Fixes: 0388a5979b21 ("xen/arm: mpu: Introduce choice between MMU and MPU") Signed-off-by: Luca Fancellu --- v3 Changes:

[PATCH v3 0/2] Prerequisite patches for Arm64 MPU build

2025-02-18 Thread Luca Fancellu
Hi all, in order to build Xen for Arm64 with MPU support, there are few changes to support the compilation of Arm code without HAS_PASSTHROUGH and some Kconfig changes. Luca Fancellu (2): xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH xen/arm: Restrict Kconfig configuration

[PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-18 Thread Luca Fancellu
LLC coloring can be used only on MMU system, move the code that selects it from ARM_64 to MMU and add the ARM_64 dependency. Signed-off-by: Luca Fancellu --- v3 changes: - Dropped comment on top of boot_fdt_info() v2 changes: - dropped part of the v1 code, now this one is simpler, I will

Re: [PATCH v3 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-19 Thread Luca Fancellu
> On 19 Feb 2025, at 12:45, Jan Beulich wrote: > > On 18.02.2025 10:51, Luca Fancellu wrote: >> --- a/xen/include/xen/iommu.h >> +++ b/xen/include/xen/iommu.h >> @@ -110,6 +110,8 @@ extern int8_t iommu_hwdom_reserved; >> >> extern unsigned int

Re: [PATCH v3 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-02-19 Thread Luca Fancellu
> On 19 Feb 2025, at 13:30, Jan Beulich wrote: > > On 19.02.2025 14:06, Luca Fancellu wrote: >>> On 19 Feb 2025, at 12:45, Jan Beulich wrote: >>> On 18.02.2025 10:51, Luca Fancellu wrote: >>>> --- a/xen/include/xen/iommu.h >>>> +++ b/xen/

[PATCH 0/9] First chunk for Arm R82 and MPU support

2025-02-28 Thread Luca Fancellu
Hi all, This is the first chunk of work to support MPU and R82 on Xen, this serie reaches the early boot stages until setup_pagetables() which will be renamed in one of the commit on the serie to have a more generic name between MPU and MMU memory management subsystem. Luca Fancellu (7): arm

[PATCH 2/9] arm/mpu: Implement virt/maddr conversion in MPU system

2025-02-28 Thread Luca Fancellu
Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mm.h | 13 +++-- xen/arch/arm/include/asm/mmu/mm.h | 7 +++ xen/arch/arm/include/asm/mpu/mm.h | 27 +++ 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 xen/arch/arm/include/as

[PATCH 6/9] arm/mpu: Provide a constructor for pr_t type

2025-02-28 Thread Luca Fancellu
Provide a function that creates a pr_t object from a memory range and some attributes. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 15 ++ xen/arch/arm/include/asm/mpu/mm.h| 3 ++ xen/arch/arm/mpu/mm.c| 73 3 files

[PATCH 3/9] arm/mpu: Introduce MPU memory region map structure

2025-02-28 Thread Luca Fancellu
PU_REGIONS macro that uses the value of NUM_MPU_REGIONS_MASK just for clarity, because using the latter as number of elements of the xen_mpumap array might be misleading. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- xen/arch/arm/Makefile| 1 +

[PATCH 5/9] arm/mpu: Introduce utility functions for the pr_t type

2025-02-28 Thread Luca Fancellu
Introduce few utility function to manipulate and handle the pr_t type. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 36 1 file changed, 36 insertions(+) diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64

[PATCH 9/9] arm/mpu: Implement setup_mappings for MPU system

2025-02-28 Thread Luca Fancellu
start introducing data structures and functions to track the MPU status from the C world. The xen_mpumap_mask bitmap is used to track which MPU region are enabled at runtime. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 2 ++ xen/arch/arm/include/asm/mm.h| 2 +- xen

[PATCH 7/9] arm/mpu: Introduce MPU memory mapping flags

2025-02-28 Thread Luca Fancellu
Introduce the MPU memory mapping flags in asm/page.h. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/page.h | 25 + 1 file changed, 25 insertions(+) diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h index 69f817d1e68a

[PATCH 1/9] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S

2025-02-28 Thread Luca Fancellu
The define HYPERVISOR_VIRT_START is required by the common code, even if MPU system doesn't use virtual memory, define it in mpu/layout.h in order to reuse existing code. Disable a check in the linker script for arm for !MMU systems. Signed-off-by: Luca Fancellu --- xen/arch/arm/includ

[PATCH 8/9] arm/mpu: Implement early_fdt_map support in MPU systems

2025-02-28 Thread Luca Fancellu
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 --- xen/arch/arm/mpu/Makefile | 1 + xen/arch/arm/mpu/setup.c | 72 +++ 2 files

[PATCH 4/9] arm/mpu: Provide access to the MPU region from the C code

2025-03-01 Thread Luca Fancellu
Implement some utility function in order to access the MPU regions from the C world. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 1 + xen/arch/arm/include/asm/mpu/mm.h| 29 ++ xen/arch/arm/mpu/mm.c| 130 ++- 3 files

Re: [PATCH v2 2/2] xen/arm: mpu: Ensure that the page size is 4KB

2025-03-05 Thread Luca Fancellu
The existing build assertion is moved under "xen/arch/arm/mpu" as it applies > for both arm64 and arm32 based systems. > > Signed-off-by: Ayan Kumar Halder > --- Reviewed-by: Luca Fancellu

Re: [PATCH v3 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-03-05 Thread Luca Fancellu
Hi Stefano, > On 4 Mar 2025, at 19:22, Stefano Stabellini wrote: > > On Wed, 19 Feb 2025, Jan Beulich wrote: >> On 19.02.2025 16:25, Luca Fancellu wrote: >>>> On 19 Feb 2025, at 13:30, Jan Beulich wrote: >>>> On 19.02.2025 14:06, Luca Fancellu wrot

Re: [PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-03-05 Thread Luca Fancellu
Hi Stefano, > On 4 Mar 2025, at 19:20, Stefano Stabellini wrote: > > On Tue, 4 Mar 2025, Luca Fancellu wrote: >> Hi, >> >>> On 18 Feb 2025, at 15:06, Jan Beulich wrote: >>> >>> On 18.02.2025 16:01, Orzel, Michal wrote: >>>> On 18

Re: [PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-03-04 Thread Luca Fancellu
Hi, > On 18 Feb 2025, at 15:06, Jan Beulich wrote: > > On 18.02.2025 16:01, Orzel, Michal wrote: >> On 18/02/2025 14:44, Jan Beulich wrote: >>> On 18.02.2025 10:51, Luca Fancellu wrote: >>>> LLC coloring can be used only on MMU system, >>> >>

Re: [PATCH 7/9] arm/mpu: Introduce MPU memory mapping flags

2025-03-04 Thread Luca Fancellu
Hi Ayan, > On 4 Mar 2025, at 11:55, Ayan Kumar Halder wrote: > > Hi Luca, > > On 28/02/2025 16:18, Luca Fancellu wrote: >> CAUTION: This message has originated from an External Source. Please use >> proper judgment and caution when opening attachments, clicking

Re: [PATCH 3/5] xen/arm: mpu: Move some of the definitions to common file

2025-03-04 Thread Luca Fancellu
> On 28 Feb 2025, at 10:34, Ayan Kumar Halder wrote: > > Hi Julien/Luca, > > On 28/02/2025 09:22, Julien Grall wrote: >> >> >> On 26/02/2025 08:28, Luca Fancellu wrote: >>> Hi Julien, >> >> Hi Luca, >> >>> >&

Re: [PATCH 3/9] arm/mpu: Introduce MPU memory region map structure

2025-03-04 Thread Luca Fancellu
Hi Ayan, > On 4 Mar 2025, at 10:53, Ayan Kumar Halder wrote: > > Hi Luca, > > On 28/02/2025 16:18, Luca Fancellu wrote: >> CAUTION: This message has originated from an External Source. Please use >> proper judgment and caution when opening attachments, clicking

Re: [PATCH 8/9] arm/mpu: Implement early_fdt_map support in MPU systems

2025-03-04 Thread Luca Fancellu
Hi Ayan, > On 4 Mar 2025, at 12:13, Ayan Kumar Halder wrote: > > Hi Luca, > > On 28/02/2025 16:18, Luca Fancellu wrote: >> CAUTION: This message has originated from an External Source. Please use >> proper judgment and caution when opening attachments, clicking

Re: [PATCH 6/9] arm/mpu: Provide a constructor for pr_t type

2025-03-04 Thread Luca Fancellu
> On 4 Mar 2025, at 11:45, Ayan Kumar Halder wrote: > > Hi Luca, > > On 28/02/2025 16:18, Luca Fancellu wrote: >> CAUTION: This message has originated from an External Source. Please use >> proper judgment and caution when opening attachments, clicking links, or

Re: [PATCH v8 0/6] (mostly) Arm32: add/convert entry point annotations

2025-03-04 Thread Luca Fancellu
m32: use new-style entry annotations for entry code > 4: Arm32: use new-style entry annotations in head.S > 5: Arm: purge ENTRY(), ENDPROC(), and ALIGN > 6: common: honor CONFIG_CC_SPLIT_SECTIONS also for assembly functions I’ve tested the serie on arm32 and arm64: Tested-by: Luca Fancellu # arm > > Jan >

Re: [PATCH v4 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-03-07 Thread Luca Fancellu
Hi Jan, + +static inline int iommu_domain_init(struct domain *d, unsigned int opts) +{ +/* + * Return as the real iommu_domain_init() would: Success when + * !is_iommu_enabled(), following from !iommu_enabled when !HAS_PASSTHROUGH + */

[PATCH v4 0/2] Prerequisite patches for Arm64 MPU build

2025-03-07 Thread Luca Fancellu
Hi all, in order to build Xen for Arm64 with MPU support, there are few changes to support the compilation of Arm code without HAS_PASSTHROUGH and some Kconfig changes. Luca Fancellu (2): xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH xen/arm: Restrict Kconfig configuration

[PATCH v4 1/2] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-03-07 Thread Luca Fancellu
the case for example on systems with MPU support. For gnttab_need_iommu_mapping() in the Arm part, modify the macro to use IS_ENABLED for the HAS_PASSTHROUGH Kconfig. Fixes: 0388a5979b21 ("xen/arm: mpu: Introduce choice between MMU and MPU") Signed-off-by: Luca Fancellu --- v4 chan

[PATCH v4 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-03-06 Thread Luca Fancellu
Xen LLC coloring feature can be used only on the MMU subsystem, move the code that selects it from ARM_64 to MMU and add the ARM_64 dependency. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v4 changes: - clarified that it's the Xen feature LLC coloring that is not applicab

Re: [PATCH] x86/shadow: replace p2m_is_valid() uses

2025-03-12 Thread Luca Fancellu
both cases, p2m_is_valid() in combination with p2m_is_grant() still > doesn't cover foreign mappings. Hence use p2m_is_any_ram() plus (as > necessary) p2m_mmio_* instead. > > Fixes: be59cceb2dbb ("x86/P2M: don't include MMIO_DM in p2m_is_valid()") > Reported-by: Luc

Re: [PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Luca Fancellu
> Error: Unexpected fault 0x800d0802, #GP[IDT[256]] > Test result: ERROR > > (Clearly I have a bug in XTF's rendering of the error code too.) > > Reported-by: Luca Fancellu > Signed-off-by: Andrew Cooper I’ve runned XTF on this one and I confirm it solves the issue: Tested-by: Luca Fancellu

[PATCH 07/10] arm/mpu: Implement stubs for ioremap_attr on MPU

2025-03-12 Thread Luca Fancellu
Implement ioremap_attr() stub for MPU system; the implementation of ioremap() is the same between MMU and MPU system, and it relies on ioremap_attr(), so move the definition from mmu/pt.c to arm/mm.c. Signed-off-by: Luca Fancellu --- xen/arch/arm/mm.c | 5 + xen/arch/arm/mmu/pt.c | 5

[PATCH 09/10] xen/arm: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-12 Thread Luca Fancellu
be used for MPU systems, remove 'struct paging_domain' from Arm 'struct arch_domain' when the field is not required. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- xen/arch/arm/Kconfig | 4 xen/arch/arm/dom0less-build.c

[v5,01/10] xen/passthrough: Provide stub functions when !HAS_PASSTHROUGH

2025-03-12 Thread Luca Fancellu
the case for example on systems with MPU support. For gnttab_need_iommu_mapping() in the Arm part, modify the macro to use IS_ENABLED for the HAS_PASSTHROUGH Kconfig. Fixes: 0388a5979b21 ("xen/arm: mpu: Introduce choice between MMU and MPU") Signed-off-by: Luca Fancellu Acked-by: Ju

[v5,02/10] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-03-12 Thread Luca Fancellu
Xen LLC coloring feature can be used only on the MMU subsystem, move the code that selects it from ARM_64 to MMU and add the ARM_64 dependency. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- https://patchwork.kernel.org/project/xen-devel/patch/20250307075818.740649-3-luca.fance

[PATCH 00/10] MPU mm subsistem skeleton

2025-03-12 Thread Luca Fancellu
Hi all, this serie implements the skeleton for the MPU memory management subsystem, at the end of the serie it will be possible to compile the Arm arch using MPU. The minimum Arm Kconfig configuration is this one: CONFIG_UNSUPPORTED=y CONFIG_MPU=y CONFIG_XEN_START_ADDRESS=0x0 Luca Fancellu (8

[PATCH 08/10] xen/arm: Rename setup_pagetables with a more generic name

2025-03-12 Thread Luca Fancellu
Rename the setup_pagetables function to setup_mappings in order to be implemented also for MPU system that does not have page tables. Introduce a stub implementation for MPU in order to allow the compilation. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mm.h | 2 +- xen/arch/arm

[PATCH 06/10] arm/mpu: Kconfig symbols for MPU build

2025-03-12 Thread Luca Fancellu
-r. Signed-off-by: Luca Fancellu --- xen/arch/arm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index ffdff1f0a36c..5ac6ec0212d2 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -85,6 +85,7 @@ config MMU

[PATCH 05/10] arm/mpu: Introduce frame_table, virt_to_page, maddr_to_virt

2025-03-12 Thread Luca Fancellu
truct page_info', so protect it with CONFIG_MMU and provide the MPU variant in the #else branch. Introduce FRAMETABLE_NR that is required for 'pdx_group_valid' in pdx.c. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mm.h | 18 ++ xen/arch/arm/include/a

[PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation

2025-03-12 Thread Luca Fancellu
This commit introduces the skeleton for the MPU memory management subsystem that allows the compilation. Signed-off-by: Luca Fancellu --- The implementation of setup_virt_paging() is under arm64/mpu because it will have a different implementation from arm32. --- --- xen/arch/arm/arm64/mpu

[PATCH 04/10] arm/mpu: Implement virt/maddr conversion in MPU system

2025-03-12 Thread Luca Fancellu
o mpu/mm.c. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mm.h | 13 +++-- xen/arch/arm/include/asm/mmu/mm.h | 7 +++ xen/arch/arm/include/asm/mpu/mm.h | 27 +++ xen/arch/arm/mpu/mm.c

[PATCH 03/10] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S

2025-03-12 Thread Luca Fancellu
The define HYPERVISOR_VIRT_START is required by the common code, even if MPU system doesn't use virtual memory, define it in mpu/layout.h in order to reuse existing code. Disable a check in the linker script for arm for !MMU systems. Signed-off-by: Luca Fancellu --- xen/arch/arm/includ

<    9   10   11   12   13   14