Re: [PATCH v3 6/6] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm

2024-10-14 Thread Luca Fancellu
of the changes to the arch/arm part looks ok to me: Reviewed-by: Luca Fancellu

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-14 Thread Luca Fancellu
ov lr, x6 Shall these changes to enable_boot_cpu_mm be part of the previous commit? The rest looks good to me: Reviewed-by: Luca Fancellu

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-21 Thread Luca Fancellu
Hi Ayan, >>> + */ >>> +FUNC_LOCAL(enable_mpu) >>> +mrs x0, SCTLR_EL2 >>> +bic x0, x0, #SCTLR_ELx_BR /* Disable Background region */ >>> +orr x0, x0, #SCTLR_Axx_ELx_M/* Enable MPU */ >>> +orr x0, x0, #SCTLR_Axx_ELx_C/* Enable D-cache */ >>> +orr x0, x0, #

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-22 Thread Luca Fancellu
Hi Julien, > On 22 Oct 2024, at 14:13, Julien Grall wrote: > > > > On 22/10/2024 10:56, Luca Fancellu wrote: >>> On 22 Oct 2024, at 10:47, Julien Grall wrote: >>> >>> Hi Luca, >>> >>> On 22/10/2024 10:41, Luca Fancellu wrote: >

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-22 Thread Luca Fancellu
Hi Julien, > On 21 Oct 2024, at 17:27, Julien Grall wrote: > > > > On 21/10/2024 17:24, Luca Fancellu wrote: >> Hi Ayan, >>>>> + */ >>>>> +FUNC_LOCAL(enable_mpu) >>>>> +mrs x0, SCTLR_EL2 >>>>> +bic x0

Re: [PATCH v3 3/6] xen/arm: mpu: Define Xen start address for MPU systems

2024-10-14 Thread Luca Fancellu
address at which Xen is loaded. > + */ > +#define XEN_VIRT_START _AT(paddr_t, XEN_START_ADDRESS) > + > +#endif /* __ARM_MPU_LAYOUT_H__ */ ^-- ASM___ARM__MPU__LAYOUT_H ? Apart from that, the rest looks ok to me: Reviewed-by: Luca Fancellu

Re: [PATCH v3 2/6] xen/arm: mpu: Introduce choice between MMU and MPU

2024-10-14 Thread Luca Fancellu
when MPU is supported? In this case we are just having the Kconfig setting. Apart from that, the rest looks good to me: Reviewed-by: Luca Fancellu

Re: [PATCH v3 1/6] xen/arm: Skip initializing the BSS section when it is empty

2024-10-14 Thread Luca Fancellu
Hi Ayan, > On 10 Oct 2024, at 15:03, Ayan Kumar Halder wrote: > > If the BSS section is empty, then the function can just return. > > Signed-off-by: Ayan Kumar Halder Reviewed-by: Luca Fancellu mailto:luca.fance...@arm.com>>

Re: [PATCH v3 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-14 Thread Luca Fancellu
Hi Ayan, > diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S > new file mode 100644 > index 00..4a21bc815c > --- /dev/null > +++ b/xen/arch/arm/arm64/mpu/head.S > @@ -0,0 +1,130 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Start-of-day code for an

Re: [PATCH v4 6/6] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm

2024-10-29 Thread Luca Fancellu
Hi Jan, > On 29 Oct 2024, at 08:08, Jan Beulich wrote: > > On 28.10.2024 18:38, Ayan Kumar Halder wrote: >> On 28/10/2024 15:01, Jan Beulich wrote: >>> On 28.10.2024 15:39, Ayan Kumar Halder wrote: On 28/10/2024 12:55, Jan Beulich wrote: > On 28.10.2024 13:45, Ayan Kumar Halder wrote: >

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-22 Thread Luca Fancellu
> On 22 Oct 2024, at 10:47, Julien Grall wrote: > > Hi Luca, > > On 22/10/2024 10:41, Luca Fancellu wrote: >>> On 21 Oct 2024, at 17:27, Julien Grall wrote: >> 2) dsb+isb barrier after enabling the MPU, since we are enabling the MPU but >> also because we

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-24 Thread Luca Fancellu
gt;>>> >>>> >>>> On 23/10/2024 17:06, Ayan Kumar Halder wrote: >>>>> Hi Luca/Julien, >>>>> >>>>> On 22/10/2024 17:31, Luca Fancellu wrote: >>>>>> Hi Julien, >>>>>> >>&g

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-29 Thread Luca Fancellu
Hi Ayan, I forgot another thing: > diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S > new file mode 100644 > index 00..9377ae778c > --- /dev/null > +++ b/xen/arch/arm/arm64/mpu/head.S > @@ -0,0 +1,122 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + *

Re: [PATCH v4 6/6] xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm

2024-10-29 Thread Luca Fancellu
> On 29 Oct 2024, at 09:41, Jan Beulich wrote: > > On 29.10.2024 10:30, Luca Fancellu wrote: >> Hi Jan, >> >>> On 29 Oct 2024, at 08:08, Jan Beulich wrote: >>> >>> On 28.10.2024 18:38, Ayan Kumar Halder wrote: >>>> On 28/10/20

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-30 Thread Luca Fancellu
Hi Ayan, While I rebased the branch on top of your patches, I saw you’ve changed the number of regions mapped at boot time, can I ask why? Compared to https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-25-penny.zh...@arm.com/: > +FUNC(enable_boot_cpu_mm) > + > +/*

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-30 Thread Luca Fancellu
Hi Julien, > On 30 Oct 2024, at 10:32, Julien Grall wrote: > > On 30/10/2024 10:08, Luca Fancellu wrote: >> Hi Julien, >>> On 30 Oct 2024, at 09:52, Julien Grall wrote: >>> >>> On Wed, 30 Oct 2024 at 09:17, Luca Fancellu wrote: >>>> >

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-30 Thread Luca Fancellu
Hi Julien, > On 30 Oct 2024, at 09:52, Julien Grall wrote: > > On Wed, 30 Oct 2024 at 09:17, Luca Fancellu wrote: >> >> Hi Ayan, >> >> While I rebased the branch on top of your patches, I saw you’ve changed the >> number of regions >> mapped a

Re: [PATCH] CI: Fix cppcheck parallel build more

2024-10-31 Thread Luca Fancellu
t;xen/misra: xen-analysis.py: fix parallel analysis > Cppcheck errors") > Fixes: db8acf31f96b ("x86/boot: Reuse code to relocate trampoline") > Suggested-by: Luca Fancellu > Signed-off-by: Andrew Cooper > — Looks good to me! I’ve also checked with and without the patch and I can’t see any regression in terms of cppcheck issues report. Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

Re: [PATCH v4 5/6] xen/arm: mpu: Enable MPU

2024-10-28 Thread Luca Fancellu
executable and the data cache is > enabled. > > As enable_mpu() is invoked from enable_boot_cpu_mm(), one needs to save and > restore the lr. > > Signed-off-by: Ayan Kumar Halder > --- > It looks good to me: Reviewed-by: Luca Fancellu

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-28 Thread Luca Fancellu
Hy Ayan, >> + >> +#define REGION_TEXT_PRBAR 0x38/* SH=11 AP=10 XN=00 */ >> +#define REGION_RO_PRBAR 0x3A/* SH=11 AP=10 XN=10 */ >> +#define REGION_DATA_PRBAR 0x32/* SH=11 AP=00 XN=10 */ > > NIT: alignment > >> + >> +#define REGION_NORMAL_PRLAR 0x0f/* NS=0

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-10-28 Thread Luca Fancellu
Hi Ayan, > On 28 Oct 2024, at 12:45, Ayan Kumar Halder wrote: > > Define enable_boot_cpu_mm() for the AArch64-V8R system. Could you use here "Armv8-R AArch64” instead of “AArch64-V8R" > > Like boot-time page table in MMU system, we need a boot-time MPU protection > region configuration in MPU

Re: [PATCH v4 1/6] xen/arm: Skip initializing the BSS section when it is empty

2024-10-28 Thread Luca Fancellu
n critical data). > > Fixes: dac84b66cc9a ("xen: arm64: initial build + config changes, start of > day code") > Signed-off-by: Ayan Kumar Halder > — Looks good to me Reviewed-by: Luca Fancellu

Re: [PATCH v4 3/6] xen/arm: mpu: Define Xen start address for MPU systems

2024-10-28 Thread Luca Fancellu
.h so that it includes mpu/layout.h when CONFIG_MPU is > defined. > > Signed-off-by: Wei Chen > Signed-off-by: Jiamei.Xie > Signed-off-by: Ayan Kumar Halder > — Looks good to me Reviewed-by: Luca Fancellu

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Luca Fancellu
Hi Ayan, > On 11 Nov 2024, at 16:00, Ayan Kumar Halder wrote: > > > On 11/11/2024 13:45, Julien Grall wrote: >> Hi Ayan, > Hi Julien, >> >> On 11/11/2024 13:24, Ayan Kumar Halder wrote: >>> On 11/11/2024 11:12, Julien Grall wrote: Hi, >>> Hi Julien, On 08/11/2024 19:59, Ayan K

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Luca Fancellu
enny Zheng > Signed-off-by: Ayan Kumar Halder > — Reviewed-by: Luca Fancellu

Re: [PATCH v5 1/3] xen/arm: mpu: Create boot-time MPU protection regions

2024-11-11 Thread Luca Fancellu
/xen/arch/arm/include/asm/mm.h +++ b/xen/arch/arm/include/asm/mm.h @@ -16,7 +16,7 @@ #if defined(CONFIG_MMU) # include -#else +#elif !defined(CONFIG_MPU) # error "Unknown memory management layout" #endif ^— maybe this change is not needed at this stage, it will be soon though Anyway:

Re: [PATCH v1 1/2] xen/mpu: Map early uart when earlyprintk on

2024-11-11 Thread Luca Fancellu
;---0100 Device memory nGnRE") and Doc ID - 102670_0101_02_en > Table 4-3, Armv8 architecture memory types (nGnRE - Corresponds to Device in > Armv7 architecture). Also, it is mapped as outer shareable, RW at EL2 only > and execution of instructions from the region is not permitted.

Re: [ARM] preparations for 4.19.1

2024-11-13 Thread Luca Fancellu
Hi all, On 12 Nov 2024, at 16:11, Julien Grall wrote: Hi, On 12/11/2024 16:00, Stewart Hildebrand wrote: On 11/12/24 08:00, Jan Beulich wrote: All, the release is due by the end of the month. Please point out backports you find missing from the respective staging branch, but which you consider

Re: [PATCH] xen/device-tree: Allow exact match for overlapping regions

2024-11-13 Thread Luca Fancellu
Hi Julien, > On 13 Nov 2024, at 14:01, Julien Grall wrote: > > Hi Luca, > > On 06/11/2024 13:41, Luca Fancellu wrote: >> There are some cases where the device tree exposes a memory range >> in both /memreserve/ and reserved-memory node, in this case the >> c

Re: [PATCH] xen/device-tree: Allow exact match for overlapping regions

2024-11-13 Thread Luca Fancellu
Hi Julien, -} + +if ( (allow_match_type != MEMBANK_NONE) && + (region_start == bank_start) && (region_end == bank_end) && >>> >>> Why is this only an exact match? >> Apparently what we are fixing is only a case where memreserve regions >> matches

Re: [PATCH] xen/device-tree: Allow exact match for overlapping regions

2024-11-06 Thread Luca Fancellu
Hi Michal, > So we have 2 separate issues. I don't particularly like the concept of > introducing MEMBANK_NONE > and the changes below look a bit too much for me, given that for boot modules > we can only have > /memreserve/ matching initrd. > > Shawn patch fixes the first issue. AFAICT the sec

[PATCH] xen/device-tree: Allow exact match for overlapping regions

2024-11-06 Thread Luca Fancellu
modules to have an exact match with ranges from /memreserve/. While there, set a type for the memory recorded during ACPI boot. Fixes: 53dc37829c31 ("xen/arm: Add DT reserve map regions to bootinfo.reserved_mem") Reported-by: Shawn Anastasio Reported-by: Grygorii Strashko Signed-off-by

[PATCH v3 2/5] arm/setup: Move MMU specific extern declarations to mmu/setup.h

2024-11-29 Thread Luca Fancellu
Move some extern declarations related to MMU structures and define from asm/setup.h to asm/mmu/setup.h, in order to increase encapsulation and allow the MPU part to build, since it has no clue about them. Signed-off-by: Luca Fancellu --- Changes from v2: - No changes Changes from v1: - Moved

[PATCH v3 4/5] xen/arm: Check for Static Heap feature when freeing resources

2024-11-29 Thread Luca Fancellu
from init data bootinfo, as it will be needed after destroying the init data section. Introduce a new helper using_static_heap() to tell whether Xen Heap is statically configured in the Device Tree. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- Changes from

[PATCH v3 0/5] Prerequisite patches for R82 upstreaming

2024-11-29 Thread Luca Fancellu
1-penny.zh...@arm.com/ Changes between v2 and v3: - New patch - changes to previous patch are listed inside them Luca Fancellu (4): common/vmap: Fall back to simple allocator when !HAS_VMAP arm/setup: Move MMU specific extern declarations to mmu/setup.h xen/arm: Use vmap_contig instead

[PATCH v3 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-29 Thread Luca Fancellu
ned-off-by: Luca Fancellu --- Changes from v2: - Don't protect declarations. Changes from v1: - put back static inline iounmap - changed commit message - hide not used declaration for system with !HAS_VMAP - correct function declared in xvmalloc.h to be static inline - prefer '#if

[PATCH v3 5/5] xen/arm: Move setup_frametable_mappings to arm/mmu

2024-11-29 Thread Luca Fancellu
it is used only on MMU systems. Signed-off-by: Luca Fancellu --- Changes to v2: - New patch --- --- xen/arch/arm/mm.c | 40 - xen/arch/arm/mmu/Makefile | 1 + xen/arch/arm/mmu/mm.c | 61 +++ 3 files changed, 62 insertions(+

[PATCH v3 3/5] xen/arm: Use vmap_contig instead of __vmap where it's possible

2024-11-29 Thread Luca Fancellu
Currently the arm code uses __vmap function in few parts to map physically contiguous pages, vmap_contig was introduced recently and does the same because it's a wrapper for __vmap, so use the latter instead of the direct __vmap function. Signed-off-by: Luca Fancellu Acked-by: Julien

Re: [PATCH v3 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-29 Thread Luca Fancellu
Hi Jan, > On 29 Nov 2024, at 11:06, Jan Beulich wrote: > > On 29.11.2024 10:12, Luca Fancellu wrote: >> --- a/xen/include/xen/xvmalloc.h >> +++ b/xen/include/xen/xvmalloc.h >> @@ -40,20 +40,46 @@ >> ((typeof(ptr))_xvrealloc(ptr,

Re: [PATCH v3 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-29 Thread Luca Fancellu
>>> >>> Just to double check: Was it at least considered to use simple #define-s >>> to effect the aliasing? Wrapper functions like the above ones have the >>> downside of needing touching (easy to miss) when the wrapped function >>> types change in whichever minor way. (And yes, I do understand

[PATCH v2 4/4] xen/arm: do not give memory back to static heap

2024-11-19 Thread Luca Fancellu
as it will be needed after destroying the init data section. Introduce a new helper xen_is_using_staticheap() to tell whether Xenheap is statically configured in the Device Tree. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu --- Changes from v1: - moved static_he

[PATCH v2 1/4] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-19 Thread Luca Fancellu
otect with #ifdef CONFIG_HAS_VMAP all the declaration that won't be used in a MPU system built without HAS_VMAP. Signed-off-by: Luca Fancellu --- Changes from v1: - put back static inline iounmap - changed commit message - hide not used declaration for system with !HAS_VMAP - correct fu

[PATCH v2 3/4] xen/arm: Use vmap_contig instead of __vmap where it's possible

2024-11-19 Thread Luca Fancellu
Currently the arm code uses __vmap function in few parts to map physically contiguous pages, vmap_contig was introduced recently and does the same because it's a wrapper for __vmap, so use the latter instead of the direct __vmap function. Signed-off-by: Luca Fancellu Acked-by: Julien

[PATCH v2 2/4] arm/setup: Move MMU specific extern declarations to mmu/setup.h

2024-11-19 Thread Luca Fancellu
Move some extern declarations related to MMU structures and define from asm/setup.h to asm/mmu/setup.h, in order to increase encapsulation and allow the MPU part to build, since it has no clue about them. Signed-off-by: Luca Fancellu --- Changes from v1: - Moved extern to mmu/setup.h instead of

[PATCH v2 0/4] Prerequisite patches for R82 upstreaming

2024-11-19 Thread Luca Fancellu
1-penny.zh...@arm.com/ Luca Fancellu (3): common/vmap: Fall back to simple allocator when !HAS_VMAP arm/setup: Move MMU specific extern declarations to mmu/setup.h xen/arm: Use vmap_contig instead of __vmap where it's possible Penny Zheng (1): xen/arm: do not give memory back to st

Re: [PATCH] bootfdt: Unify early printing of memory ranges endpoints

2024-11-20 Thread Luca Fancellu
print > all the endpoints as inclusive. > > Signed-off-by: Michal Orzel > --- Looks good to me! Reviewed-by: Luca Fancellu Outside early boot there are other places where we print exclusive ranges, do you know if there is any general style we should apply or does it depend on case by case? Cheers, Luca

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
Hi Andrew, + +void *_xvrealloc(void *va, size_t size, unsigned int align) +{ +return _xrealloc(va, size, align); +} + +#endif >>> Does this really compile with the wrappers not being static inline ? >>> >>> That aside, could we not do this using conditional

[PATCH 2/5] arm/setup: Move MMU specific extern declarations to mmu/mm.h

2024-11-15 Thread Luca Fancellu
Move some extern declarations related to MMU structures and define from asm/setup.h to asm/mm.h, in order to increase encapsulation and allow the MPU part to build, since it has no clue about them. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mmu/mm.h | 11 +++ xen/arch/arm

[PATCH 0/5] Prerequisite patches for R82 upstreaming

2024-11-15 Thread Luca Fancellu
1-penny.zh...@arm.com/ Luca Fancellu (3): common/vmap: Fall back to simple allocator when !HAS_VMAP arm/setup: Move MMU specific extern declarations to mmu/mm.h xen/arm: Use vmap_contig instead of __vmap where it's possible Penny Zheng (2): xen/arm: only map the init tex

[PATCH 4/5] xen/arm: Use vmap_contig instead of __vmap where it's possible

2024-11-15 Thread Luca Fancellu
Currently the arm code uses __vmap function in few parts to map physically contiguous pages, vmap_contig was introduced recently and does the same because it's a wrapper for __vmap, so use the latter instead of the direct __vmap function. Signed-off-by: Luca Fancellu --- xen/arc

[PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
ve iounmap function to the vmap.c file, because it uses the vunmap function that won't be compiled in when !HAS_VMAP. Signed-off-by: Luca Fancellu --- This is a rework of this one: https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-16-penny.zh...@arm.com/ wh

[PATCH 5/5] xen/arm: do not give memory back to static heap

2024-11-15 Thread Luca Fancellu
as it will be needed after destroying the init data section. Introduce a new helper xen_is_using_staticheap() to tell whether Xenheap is statically configured in the Device Tree. Signed-off-by: Luca Fancellu --- This is a rebase of this one: https://patchwork.kernel.org/project/xen-devel/

[PATCH 3/5] xen/arm: only map the init text section RW in free_init_memory

2024-11-15 Thread Luca Fancellu
From: Penny Zheng In free_init_memory, we do not need to map the whole init section RW, as only init text section is mapped RO in boot time. Signed-off-by: Luca Fancellu --- This is this one: https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-19-penny.zh...@arm.com

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 12:00, Andrew Cooper wrote: > > On 15/11/2024 10:50 am, Luca Fancellu wrote: >> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h >> index 440d85a284bb..802be6687085 100644 >> --- a/xen/include/xen/xvmalloc.h >>

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 12:00, Andrew Cooper wrote: > > On 15/11/2024 10:50 am, Luca Fancellu wrote: >> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h >> index 440d85a284bb..802be6687085 100644 >> --- a/xen/include/xen/xvmalloc.h >>

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
>> >> Sure, I’ll wrap what can’t be used in MPU case with HAS_VMAP, I would like >> to keep out: >> >> void *vmap_contig(mfn_t mfn, unsigned int nr); >> >> void vunmap(const void *va); >> >> void __iomem *ioremap(paddr_t pa, size_t len); >> >> static inline void iounmap(void __iomem *va) >>

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 11:12, Jan Beulich wrote: > > On 15.11.2024 11:50, Luca Fancellu wrote: >> --- a/xen/common/vmap.c >> +++ b/xen/common/vmap.c >> @@ -426,3 +426,10 @@ void *_xvrealloc(void *va, size_t size, unsigned int >> align) >> >>

Re: [PATCH 5/5] xen/arm: do not give memory back to static heap

2024-11-18 Thread Luca Fancellu
Hi Julien, >> -fw_unreserved_regions(addr, addr + size, init_domheap_pages, 0); >> +if ( !xen_is_using_staticheap() ) > > The comment on top needs to be updated. I’ll update, is this ok: /* * In case Xen is not using the static heap feature, free the original * kernel, update the poin

Re: [PATCH 2/5] arm/setup: Move MMU specific extern declarations to mmu/mm.h

2024-11-18 Thread Luca Fancellu
Hi Julien, > On 17 Nov 2024, at 17:46, Julien Grall wrote: > > Hi Luca, > > On 15/11/2024 10:50, Luca Fancellu wrote: >> Move some extern declarations related to MMU structures and define >> from asm/setup.h to asm/mm.h, in order to increase encapsulation and >

Re: [PATCH 3/5] xen/arm: only map the init text section RW in free_init_memory

2024-11-18 Thread Luca Fancellu
Hi Julien, > On 17 Nov 2024, at 17:58, Julien Grall wrote: > > Hi Luca, > > On 15/11/2024 10:50, Luca Fancellu wrote: >> From: Penny Zheng >> In free_init_memory, we do not need to map the whole init section RW, >> as only init text section is mapped RO in bo

Re: [PATCH v2 4/4] xen/arm: do not give memory back to static heap

2024-11-26 Thread Luca Fancellu
> On 26 Nov 2024, at 13:29, Jan Beulich wrote: > > On 26.11.2024 14:25, Luca Fancellu wrote: >>> This reads better, thanks. Follow-on question: Is what is statically >>> configured for the heap guaranteed to never overlap with anything passed >>> to init_

[PATCH v2 0/6] Boot time cpupools

2022-03-10 Thread Luca Fancellu
200 { compatible = "multiboot,kernel", "multiboot,module"; reg = <0x9200 0x1ff>; bootargs = "..."; }; }; }; [...] The example DT is instructing Xen to have two cpu pools, the one with id 0 having two phisica

[PATCH v2 1/6] tools/cpupools: Give a name to unnamed cpupools

2022-03-10 Thread Luca Fancellu
hange, remove the check for poolid == 0 from libxl_cpupoolid_to_name(...). Signed-off-by: Luca Fancellu --- Changes in v2: - Remove unused variable, moved xc_cpupool_infofree ahead to simplify the code, use asprintf (Juergen) --- tools/helpers/xen-init-dom0.c

[PATCH v2 2/6] xen/sched: create public function for cpupools creation

2022-03-10 Thread Luca Fancellu
Create new public function to create cpupools, can take as parameter the scheduler id or a negative value that means the default Xen scheduler will be used. Signed-off-by: Luca Fancellu --- Changes in v2: - cpupool_create_pool doesn't check anymore for pool id uniqueness before ca

[PATCH v2 3/6] xen/sched: retrieve scheduler id by name

2022-03-10 Thread Luca Fancellu
scheduler_init. Signed-off-by: Luca Fancellu --- Changes in v2: - replace open coded scheduler search in scheduler_init (Juergen) --- xen/common/sched/core.c | 40 ++-- xen/include/xen/sched.h | 11 +++ 2 files changed, 37 insertions(+), 14 deletions(-) diff

[PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-10 Thread Luca Fancellu
specification of the cpupools from the device tree to build pools and assign cpus to them. Documentation is created to explain the feature. Signed-off-by: Luca Fancellu --- Changes in v2: - Move feature to common code (Juergen) - Try to decouple dtb parse and cpupool creation to allow more way to

[PATCH v2 6/6] xen/cpupool: Allow cpupool0 to use different scheduler

2022-03-10 Thread Luca Fancellu
cated). Signed-off-by: Luca Fancellu --- Changes in v2: - new patch --- xen/common/boot_cpupools.c | 39 ++ xen/common/sched/cpupool.c | 8 +--- xen/include/xen/sched.h| 5 - 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/xen/c

[PATCH v2 5/6] arm/dom0less: assign dom0less guests to cpupools

2022-03-10 Thread Luca Fancellu
XEN_DOMCTL_INTERFACE_VERSION version is bumped. Add public function to retrieve a pool id from the device tree cpupool node. Update documentation about the property. Signed-off-by: Luca Fancellu --- Changes in v2: - Moved cpupool_id from arch specific to common part (Juergen) - Implemented

Re: [PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-11 Thread Luca Fancellu
Hi Juergen, Thanks for your review > On 11 Mar 2022, at 08:09, Juergen Gross wrote: > > On 10.03.22 18:10, Luca Fancellu wrote: >> Introduce a way to create different cpupools at boot time, this is >> particularly useful on ARM big.LITTLE system where there might b

Re: [PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-11 Thread Luca Fancellu
> On 11 Mar 2022, at 10:18, Juergen Gross wrote: > > On 11.03.22 10:46, Jan Beulich wrote: >> On 11.03.2022 10:29, Juergen Gross wrote: >>> On 11.03.22 09:56, Luca Fancellu wrote: >>>>> On 11 Mar 2022, at 08:09, Juergen Gross wrote: >&

Re: [PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-11 Thread Luca Fancellu
Hi Stefano, > On 11 Mar 2022, at 03:57, Stefano Stabellini wrote: > > On Thu, 10 Mar 2022, Luca Fancellu wrote: >> Introduce a way to create different cpupools at boot time, this is >> particularly useful on ARM big.LITTLE system where there might be the >> need to

Re: [PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-11 Thread Luca Fancellu
> On 11 Mar 2022, at 14:11, Luca Fancellu wrote: > > Hi Stefano, > >> On 11 Mar 2022, at 03:57, Stefano Stabellini wrote: >> >> On Thu, 10 Mar 2022, Luca Fancellu wrote: >>> Introduce a way to create different cpupools at boot time, this is >>&

Re: [XEN][RFC PATCH v3 01/14] xen/arm/device: Remove __init from function type

2022-03-14 Thread Luca Fancellu
> On 8 Mar 2022, at 19:46, Vikram Garhwal wrote: > > Change function type of following function to access during runtime: >1. map_irq_to_domain() >2. handle_device_interrupt() >3. map_range_to_domain() >4. unflatten_dt_node() >5. unflatten_device_tree() > > Move map_irq_to

Re: [XEN][RFC PATCH v3 02/14] xen/arm: Add CONFIG_OVERLAY_DTB

2022-03-14 Thread Luca Fancellu
> On 8 Mar 2022, at 19:46, Vikram Garhwal wrote: > > Introduce a config option where the user can enable support for > adding/removing > device tree nodes using a device tree binary overlay. > > Signed-off-by: Vikram Garhwal > --- > xen/arch/arm/Kconfig | 6 ++ > 1 file changed, 6 inserti

Re: [XEN][RFC PATCH v3 04/14] libfdt: overlay: change overlay_get_target()

2022-03-14 Thread Luca Fancellu
> On 8 Mar 2022, at 19:46, Vikram Garhwal wrote: > > Rename overlay_get_target() to fdt_overlay_target_offset() and remove static > function type. > > This is done to get the target path for the overlay nodes which is very useful > in many cases. For example, Xen hypervisor needs it when apply

Re: [XEN][RFC PATCH v3 05/14] xen/device-tree: Add _dt_find_node_by_path() to find nodes in device tree

2022-03-14 Thread Luca Fancellu
Hi Vikram, > On 8 Mar 2022, at 19:46, Vikram Garhwal wrote: > > Add _dt_find_by_path() to find a matching node with path for a dt_device_node. > > Signed-off-by: Vikram Garhwal > --- > xen/common/device_tree.c | 10 -- > xen/include/xen/device_tree.h | 9 + > 2 files change

Re: [XEN][RFC PATCH v3 06/14] xen/smmu: Add remove_device callback for smmu_iommu ops

2022-03-14 Thread Luca Fancellu
am Garhwal Seems ok to me, Reviewed-by: Luca Fancellu

Re: [XEN][RFC PATCH v3 07/14] xen/iommu: Move spin_lock from iommu_dt_device_is_assigned to caller

2022-03-14 Thread Luca Fancellu
s_assigned_lock(const struct dt_device_node > *dev) > { > bool_t assigned = 0; > You can add an ASSERT(spin_is_locked(&dtdevs_lock)); to be sure, however the name is pretty clear, so for me with or without it: Reviewed-by: Luca Fancellu > if ( !dt_device_is_protected(de

Re: [XEN][RFC PATCH v3 08/14] xen/iommu: protect iommu_add_dt_device() with dtdevs_lock

2022-03-14 Thread Luca Fancellu
> On 8 Mar 2022, at 19:46, Vikram Garhwal wrote: > > Protect iommu_add_dt_device() with dtdevs_lock to prevent concurrent access > add. > > Signed-off-by: Vikram Garhwal Reviewed-by: Luca Fancellu > --- > xen/drivers/passthrough/device_tree.c | 9 - > 1

Re: [XEN][RFC PATCH v3 09/14] xen/iommu: Introduce iommu_remove_dt_device()

2022-03-14 Thread Luca Fancellu
> +int iommu_remove_dt_device(struct dt_device_node *np) > +{ > +const struct iommu_ops *ops = iommu_get_ops(); > +struct device *dev = dt_to_dev(np); > +int rc; > + > +if ( !ops ) > +return -EOPNOTSUPP; Here we have that the counterpart iommu_add_dt_device returns EINVAL

Re: [PATCH v2 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-15 Thread Luca Fancellu
> Hmm, this will fail the ASSERT(spin_is_locked(&cpupool_lock)) in > __cpupool_find_by_id(). > > I think you need to use cpupool_get_by_id() and cpupool_put() by making them > globally visible (move their prototypes to sched.h). Hi Juergen, Yes I was thinking more to a __init wrapper that take

Re: [XEN][RFC PATCH v3 10/14] xen/arm: Implement device tree node removal functionalities

2022-03-15 Thread Luca Fancellu
> > diff --git a/xen/common/Makefile b/xen/common/Makefile > index dc8d3a13f5..2eb5734f8e 100644 > --- a/xen/common/Makefile > +++ b/xen/common/Makefile > @@ -54,6 +54,7 @@ obj-y += wait.o > obj-bin-y += warning.init.o > obj-$(CONFIG_XENOPROF) += xenoprof.o > obj-y += xmalloc_tlsf.o > +obj-$(CONFI

Re: [XEN][RFC PATCH v3 11/14] xen/arm: Implement device tree node addition functionalities

2022-03-15 Thread Luca Fancellu
> > +static int dt_overlay_add_node(struct dt_device_node *device_node, > + const char *parent_node_path) Const should be indented at the same level of struct > +/* > + * Adds device tree nodes under target node. > + * We use dt_host_new to unflatten the updated device_tree_fla

Re: [XEN][RFC PATCH v3 12/14] tools/libs/ctrl: Implement new xc interfaces for dt overlay

2022-03-15 Thread Luca Fancellu
> > diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile > index ef7362327f..848a8737c7 100644 > --- a/tools/libs/ctrl/Makefile > +++ b/tools/libs/ctrl/Makefile > @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk > > SRCS-y += xc_altp2m.c > SRCS-y += xc_cpupool.c > +SRCS-

Re: [XEN][RFC PATCH v3 13/14] tools/libs/light: Implement new libxl functions for device tree overlay ops

2022-03-15 Thread Luca Fancellu
> On 8 Mar 2022, at 19:47, Vikram Garhwal wrote: > > Signed-off-by: Vikram Garhwal I don’t know if an empty commit message is ok here, will leave to the maintainer the choice, for me the code looks ok Reviewed-by: Luca Fancellu

Re: [XEN][RFC PATCH v3 14/14] tools/xl: Add new xl command overlay for device tree overlay support

2022-03-15 Thread Luca Fancellu
> On 8 Mar 2022, at 19:47, Vikram Garhwal wrote: > > Signed-off-by: Vikram Garhwal > --- > tools/xl/xl.h | 4 > tools/xl/xl_cmdtable.c | 6 ++ > tools/xl/xl_vmcontrol.c | 45 + > 3 files changed, 55 insertions(+) > > diff --git a/too

Re: [PATCH v2 2/6] xen/sched: create public function for cpupools creation

2022-03-15 Thread Luca Fancellu
> On 15 Mar 2022, at 17:45, Andrew Cooper wrote: > > On 10/03/2022 17:10, Luca Fancellu wrote: >> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h >> index 10ea969c7af9..47fc856e0fe0 100644 >> --- a/xen/include/xen/sched.h >> +++ b/xen/include/x

Re: [PATCH 1/3] tools/xenstore: add documentation for new set/get-feature commands

2022-03-16 Thread Luca Fancellu
> On 16 Mar 2022, at 16:10, Juergen Gross wrote: > > Add documentation for two new Xenstore wire commands SET_FEATURE and > GET_FEATURE used to set or query the Xenstore features visible in the > ring page of a given domain. > > Signed-off-by: Juergen Gross Revie

Re: [PATCH 2/3] tools/xenstore: add documentation for new set/get-quota commands

2022-03-16 Thread Luca Fancellu
> On 16 Mar 2022, at 16:10, Juergen Gross wrote: > > Add documentation for two new Xenstore wire commands SET_QUOTA and > GET_QUOTA used to set or query the Xenstore quota of a given domain. > > Signed-off-by: Juergen Gross Reviewed-by: Luca Fancellu Cheers, Luca

Re: [PATCH 3/3] tools/xenstore: add documentation for extended watch command

2022-03-16 Thread Luca Fancellu
c > + domain by specifying @releaseDomain/ for the path. > > When a watch is first set up it is triggered once straight > away, with equal to . Watches may be triggered > -- > 2.34.1 > > I’m not an English native speaker so apologies if there is no mistake. With that fixed (if it’s wrong): Reviewed-by: Luca Fancellu Cheers, Luca

Re: [XEN PATCH] evtchn/fifo: Don't set PENDING bit if guest misbehaves

2022-03-17 Thread Luca Fancellu
_set_pending( >> unsigned int port; >> event_word_t *word; >> unsigned long flags; >> -bool_t was_pending; >> +bool_t check_pollers = false; > > Considering your commit message, did you intend to change this to bool? > > Can be fixed

Re: [PATCH] Livepatch: fix typos

2022-03-17 Thread Luca Fancellu
> On 11 Mar 2022, at 19:11, Bjoern Doebel wrote: > > Fix a couple of typos in livepatch code. NIT: I would say: [...] in livepatch code comments. > > Signed-off-by: Bjoern Doebel With or without it: Reviewed-by: Luca Fancellu Cheers, Luca > CC: Konrad Rzeszute

Re: [PATCH] xen/arm: fix typos in comments

2022-03-18 Thread Luca Fancellu
> On 18 Mar 2022, at 10:37, Julia Lawall wrote: > > Various spelling mistakes in comments. > Detected with the help of Coccinelle. > > Signed-off-by: Julia Lawall Reviewed-by: Luca Fancellu Cheers, Luca > > --- > arch/arm/xen/mm.c |2 +- > 1 file chang

[PATCH v3 1/6] tools/cpupools: Give a name to unnamed cpupools

2022-03-18 Thread Luca Fancellu
hange, remove the check for poolid == 0 from libxl_cpupoolid_to_name(...). Signed-off-by: Luca Fancellu Reviewed-by: Juergen Gross --- Changes in v3: - no changes, add R-by Changes in v2: - Remove unused variable, moved xc_cpupool_infofree ahead to simplify the code, use asprintf (Juergen) ---

[PATCH v3 5/6] arm/dom0less: assign dom0less guests to cpupools

2022-03-18 Thread Luca Fancellu
XEN_DOMCTL_INTERFACE_VERSION version is bumped. Add public function to retrieve a pool id from the device tree cpupool node. Update documentation about the property. Signed-off-by: Luca Fancellu --- Changes in v3: - Use explicitely sized integer for struct xen_domctl_createdomain cpupool_id

[PATCH v3 4/6] xen/cpupool: Create different cpupools at boot time

2022-03-18 Thread Luca Fancellu
specification of the cpupools from the device tree to build pools and assign cpus to them. Documentation is created to explain the feature. Signed-off-by: Luca Fancellu --- Changes in v3: - Add newline to cpupools.txt and removed "default n" from Kconfig (Jan) - Fixed comment, moved def

[PATCH v3 6/6] xen/cpupool: Allow cpupool0 to use different scheduler

2022-03-18 Thread Luca Fancellu
cated). Signed-off-by: Luca Fancellu --- Changes in v3: - fix typo in commit message (Juergen) - rebase changes Changes in v2: - new patch --- xen/common/boot_cpupools.c | 5 - xen/common/sched/cpupool.c | 8 +--- xen/include/xen/sched.h| 5 - 3 files changed, 9 insertions(+), 9 dele

[PATCH v3 2/6] xen/sched: create public function for cpupools creation

2022-03-18 Thread Luca Fancellu
Create new public function to create cpupools, can take as parameter the scheduler id or a negative value that means the default Xen scheduler will be used. Signed-off-by: Luca Fancellu --- Changes in v3: - Fixed comment (Andrew) Changes in v2: - cpupool_create_pool doesn't check anymor

[PATCH v3 3/6] xen/sched: retrieve scheduler id by name

2022-03-18 Thread Luca Fancellu
scheduler_init. Signed-off-by: Luca Fancellu Reviewed-by: Juergen Gross --- Changes in v3: - add R-by Changes in v2: - replace open coded scheduler search in scheduler_init (Juergen) --- xen/common/sched/core.c | 40 ++-- xen/include/xen/sched.h | 11 +++ 2

[PATCH v3 0/6] Boot time cpupools

2022-03-18 Thread Luca Fancellu
= <&cp1>; module@9200 { compatible = "multiboot,kernel", "multiboot,module"; reg = <0x9200 0x1ff>; bootargs = "..."; }; }; }; [...] The example DT is instructing Xen to have two cpu pools, the

  1   2   3   4   5   6   7   8   9   10   >