[PATCH v4.2] xen/p2m: put reference for level 2 superpage

2024-05-28 Thread Luca Fancellu
such superpages, for which at some point Xen might end up freeing memory and therefore for such a big mapping it could end up in a very long operation. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v4.2 changes: - rework commit message to don't explicit say the size of the mapping

Re: [PATCH v4 3/7] xen/p2m: put reference for level 2 superpage

2024-05-28 Thread Luca Fancellu
Hi Julien, > On 24 May 2024, at 13:56, Julien Grall wrote: > > Hi Luca, > > On 24/05/2024 13:40, Luca Fancellu wrote: >> From: Penny Zheng >> We are doing foreign memory mapping for static shared memory, and >> there is a great possibility that it co

[PATCH v4 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-24 Thread Luca Fancellu
for every bank. When the bank is already allocated, for every bank allocated with the corresponding shm_id, handle_shared_mem_bank is called and the mapping are done. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v4 changes: - Add R-by Michal v3 changes: - reworded commit msg

[PATCH v4 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-05-24 Thread Luca Fancellu
esn't need to be allocated, however it will be convenient later to use it as an argument for assign_shared_memory when dealing with the use case where the Host physical address is not supplied by the user. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3 changes: - switch strncmp w

[PATCH v4 0/7] Static shared memory followup v2 - pt2

2024-05-24 Thread Luca Fancellu
the static shared memory allocation from the Xen heap. Luca Fancellu (5): xen/arm: Lookup bootinfo shm bank during the mapping xen/arm: Wrap shared memory mapping code in one function xen/arm: Parse xen,shared-mem when host phys address is not provided xen/arm: Rework heap page allocation

[PATCH v4 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-24 Thread Luca Fancellu
Wrap the code and logic that is calling assign_shared_memory and map_regions_p2mt into a new function 'handle_shared_mem_bank', it will become useful later when the code will allow the user to don't pass the host physical address. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3

[PATCH v4 7/7] xen/docs: Describe static shared memory when host address is not provided

2024-05-24 Thread Luca Fancellu
From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luc

[PATCH v4 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-24 Thread Luca Fancellu
with INVALID_PADDR from any computation. The changes above holds because of this consideration. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v4 changes: - Fix wrong condition for paddr_assigned (Michal) v3 changes: - fix typo in commit msg, add R-by Michal v2 changes: - fix comments, add

[PATCH v4 3/7] xen/p2m: put reference for level 2 superpage

2024-05-24 Thread Luca Fancellu
to handle such superpages, for which at some point Xen might end up freeing memory and therefore for such a big mapping it could end up in a very long operation. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v4 changes: - optimised the path to call put_page() on the foreign mapping

[PATCH v4 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory

2024-05-24 Thread Luca Fancellu
the signature of allocate_bank_memory and remove the 'struct domain' parameter, which can be retrieved from 'struct kernel_info'. No functional changes is intended. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3 changes: - Add R-by Michal v2: - Reduced scope of pg var

Re: [PATCH v3 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-22 Thread Luca Fancellu
Hi Michal, >> for ( i = 0; i < mem->nr_banks; i++ ) >> { >> /* >> * Meet the following check: >> - * 1) The shm ID matches and the region exactly match >> - * 2) The shm ID doesn't match and the region doesn't overlap >> - * with an existing one >>

Re: [PATCH v3 3/7] xen/p2m: put reference for level 2 superpage

2024-05-22 Thread Luca Fancellu
Hi Julien, > On 22 May 2024, at 14:25, Julien Grall wrote: > >> diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c >> index 41fcca011cf4..b496266deef6 100644 >> --- a/xen/arch/arm/mmu/p2m.c >> +++ b/xen/arch/arm/mmu/p2m.c >> @@ -753,17 +753,9 @@ static int

[PATCH v3 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-22 Thread Luca Fancellu
for every bank. When the bank is already allocated, for every bank allocated with the corresponding shm_id, handle_shared_mem_bank is called and the mapping are done. Signed-off-by: Luca Fancellu --- v3 changes: - reworded commit msg section, swap role_str and gbase

[PATCH v3 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory

2024-05-22 Thread Luca Fancellu
the signature of allocate_bank_memory and remove the 'struct domain' parameter, which can be retrieved from 'struct kernel_info'. No functional changes is intended. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3 changes: - Add R-by Michal v2: - Reduced scope of pg var

[PATCH v3 7/7] xen/docs: Describe static shared memory when host address is not provided

2024-05-22 Thread Luca Fancellu
From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luc

[PATCH v3 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-22 Thread Luca Fancellu
with INVALID_PADDR from any computation. The changes above holds because of this consideration. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3 changes: - fix typo in commit msg, add R-by Michal v2 changes: - fix comments, add parenthesis to some conditions, remove unneeded variables

[PATCH v3 0/7] Static shared memory followup v2 - pt2

2024-05-22 Thread Luca Fancellu
the static shared memory allocation from the Xen heap. Luca Fancellu (5): xen/arm: Lookup bootinfo shm bank during the mapping xen/arm: Wrap shared memory mapping code in one function xen/arm: Parse xen,shared-mem when host phys address is not provided xen/arm: Rework heap page allocation

[PATCH v3 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-22 Thread Luca Fancellu
Wrap the code and logic that is calling assign_shared_memory and map_regions_p2mt into a new function 'handle_shared_mem_bank', it will become useful later when the code will allow the user to don't pass the host physical address. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3

[PATCH v3 3/7] xen/p2m: put reference for level 2 superpage

2024-05-22 Thread Luca Fancellu
to handle such superpages, for which at some point Xen might end up freeing memory and therefore for such a big mapping it could end up in a very long operation. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v3: - Add reasoning why we don't support now 1GB superpage, remove level_order

[PATCH v3 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-05-22 Thread Luca Fancellu
esn't need to be allocated, however it will be convenient later to use it as an argument for assign_shared_memory when dealing with the use case where the Host physical address is not supplied by the user. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3 changes: - switch strncmp w

Re: [PATCH v2 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-20 Thread Luca Fancellu
>> >>> +struct shmem_membank_extra *bank_extra_info; +} alloc_heap_pages_cb_extra; + +static struct meminfo __initdata shm_heap_banks = { +.common.max_banks = NR_MEM_BANKS >>> Do we expect that many banks? >> >> Not really, but I was trying to don’t introduce

Re: [PATCH v2 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-20 Thread Luca Fancellu
Hi Michal, > On 20 May 2024, at 12:16, Michal Orzel wrote: > > Hi Luca, > > On 15/05/2024 16:26, Luca Fancellu wrote: >> >> >> This commit implements the logic to have the static shared memory banks >> from the Xen heap instead of having the host p

Re: [PATCH v3 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains

2024-05-20 Thread Luca Fancellu
> On 20 May 2024, at 12:24, Michal Orzel wrote: > > Hi Henry, > > +CC: Luca > > On 17/05/2024 05:21, Henry Wang wrote: >> >> >> Currently, users are allowed to map static shared memory in a >> non-direct-mapped way for direct-mapped domains. This can lead to >> clashing of guest memory

Re: [PATCH v2 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-16 Thread Luca Fancellu
Hi Michal, >> >> -/* >> - * "role" property is optional and if it is defined explicitly, >> - * then the owner domain is not the default "dom_io" domain. >> - */ >> -if ( dt_property_read_string(shm_node, "role", _str) == 0 ) >> -owner_dom_io =

[PATCH v2 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-15 Thread Luca Fancellu
and if it is, then assign_pages is called for every bank. When the bank is already allocated, for every bank allocated with the corresponding shm_id, handle_shared_mem_bank is called and the mapping are done. Signed-off-by: Luca Fancellu --- v2 changes: - add static inline get_shmem_heap_banks(), given the changes

[PATCH v2 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-15 Thread Luca Fancellu
with INVALID_PADDR from any computation. The changes above holds because of this consideration. Signed-off-by: Luca Fancellu --- v2 changes: - fix comments, add parenthesis to some conditions, remove unneeded variables, remove else branch, increment counter in the for loop, skip INVALID_PADDR start

[PATCH v2 0/7] Static shared memory followup v2 - pt2

2024-05-15 Thread Luca Fancellu
the static shared memory allocation from the Xen heap. Luca Fancellu (5): xen/arm: Lookup bootinfo shm bank during the mapping xen/arm: Wrap shared memory mapping code in one function xen/arm: Parse xen,shared-mem when host phys address is not provided xen/arm: Rework heap page allocation

[PATCH v2 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory

2024-05-15 Thread Luca Fancellu
the signature of allocate_bank_memory and remove the 'struct domain' parameter, which can be retrieved from 'struct kernel_info'. No functional changes is intended. Signed-off-by: Luca Fancellu --- v2: - Reduced scope of pg var in allocate_domheap_memory, removed not necessary BUG_ON(), changed

[PATCH v2 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-15 Thread Luca Fancellu
Wrap the code and logic that is calling assign_shared_memory and map_regions_p2mt into a new function 'handle_shared_mem_bank', it will become useful later when the code will allow the user to don't pass the host physical address. Signed-off-by: Luca Fancellu --- v2 changes: - add blank line

[PATCH v2 7/7] xen/docs: Describe static shared memory when host address is not provided

2024-05-15 Thread Luca Fancellu
From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luc

[PATCH v2 3/7] xen/p2m: put reference for level 2 superpage

2024-05-15 Thread Luca Fancellu
, specifically for helping put extra references for foreign superpages. Modify relinquish_p2m_mapping as well to take into account preemption when type is foreign memory and order is above 9 (2MB). Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v2: - Do not handle 1GB super page

[PATCH v2 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-05-15 Thread Luca Fancellu
esn't need to be allocated, however it will be convinient later to use it as an argument for assign_shared_memory when dealing with the use case where the Host physical address is not supplied by the user. Signed-off-by: Luca Fancellu --- v2 changes: - fix typo commit msg, rename

Re: [RFC PATCH 1/2] xen/arm: Add DT reserve map regions to bootinfo.reserved_mem

2024-05-15 Thread Luca Fancellu
> On 14 May 2024, at 22:06, Julien Grall wrote: > > Hi, > > On 14/05/2024 08:53, Luca Fancellu wrote: >> Hi Julien, >> Thanks for having a look on the patch, >>> On 13 May 2024, at 22:54, Julien Grall wrote: >>> >>> Hi Luca, >>>

Re: [PATCH 3/7] xen/p2m: put reference for superpage

2024-05-14 Thread Luca Fancellu
Hi Julien, > >> Note also that a foreign unmap resulting in a page free is also not >> the common case, as that should only happen when the foreign domain >> has been destroyed, or the page ballooned out, so to benchmark the >> worst case some effort will be needed in order to model this >>

Re: [RFC PATCH 1/2] xen/arm: Add DT reserve map regions to bootinfo.reserved_mem

2024-05-14 Thread Luca Fancellu
Hi Julien, Thanks for having a look on the patch, > On 13 May 2024, at 22:54, Julien Grall wrote: > > Hi Luca, > > On 25/04/2024 14:11, Luca Fancellu wrote: >> Currently the code is listing device tree reserve map regions >> as reserved memory for

Re: [PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-10 Thread Luca Fancellu
> On 10 May 2024, at 10:32, Michal Orzel wrote: > > Hi Luca, > > On 10/05/2024 11:25, Luca Fancellu wrote: >> >> >>> On 10 May 2024, at 10:17, Michal Orzel wrote: >>> >>> Hi Luca, >>> >>> On 23/04/2024 10:25, Luca F

Re: [PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-05-10 Thread Luca Fancellu
> On 10 May 2024, at 10:17, Michal Orzel wrote: > > Hi Luca, > > On 23/04/2024 10:25, Luca Fancellu wrote: >> >> >> This commit implements the logic to have the static shared memory banks >> from the Xen heap instead of having the host physical addre

Re: [PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-09 Thread Luca Fancellu
Hi Michal, >> >>> +if ( shm_id_match ) >>>{ >>> -if ( strncmp(shm_id, shmem_extra[i].shm_id, >>> - MAX_SHM_ID_LENGTH) == 0 ) >>> +/* >>> + * Regions have same shm_id (cases): >>> + * 1) physical host address

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-08 Thread Luca Fancellu
> On 2 May 2024, at 19:35, Stefano Stabellini wrote: > > On Tue, 30 Apr 2024, Luca Fancellu wrote: >> Commit 2209c1e35b47 ("xen/arm: Introduce a generic way to access memory >> bank structures") introduced a MISRA regression for Rule 1.1 because a >>

Re: [PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-05-08 Thread Luca Fancellu
Hi Michal, > On 8 May 2024, at 13:09, Michal Orzel wrote: > > Hi Luca, > > On 23/04/2024 10:25, Luca Fancellu wrote: >> >> >> Handle the parsing of the 'xen,shared-mem' property when the host physical >> address is not provided, this c

Re: [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-07 Thread Luca Fancellu
Hi Michal, int __init process_shm(struct domain *d, struct kernel_info *kinfo, const struct dt_device_node *node) { @@ -249,32 +290,10 @@ int __init process_shm(struct domain *d, struct kernel_info *kinfo, if (

Re: [PATCH 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-05-07 Thread Luca Fancellu
Hi Michal, >> @@ -440,6 +431,26 @@ int __init process_shm_node(const void *fdt, int node, uint32_t address_cells, device_tree_get_reg(, address_cells, address_cells, , ); size = dt_next_cell(size_cells, ); +if ( !IS_ALIGNED(paddr, PAGE_SIZE)

Re: [PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-05-07 Thread Luca Fancellu
Hi Michal, >> >> +static int __init handle_shared_mem_bank(struct domain *d, paddr_t gbase, >> + bool owner_dom_io, >> + const char *role_str, >> + const struct membank

Re: [PATCH 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-05-07 Thread Luca Fancellu
Hi Michal, Thanks for your review. > On 6 May 2024, at 14:24, Michal Orzel wrote: > > Hi Luca, > > On 23/04/2024 10:25, Luca Fancellu wrote: >> >> >> The current static shared memory code is using bootinfo banks when it >> needs to fin

Re: [PATCH 3/7] xen/p2m: put reference for superpage

2024-05-07 Thread Luca Fancellu
Hi Julien, > On 7 May 2024, at 14:20, Julien Grall wrote: > > Hi Luca, > > On 23/04/2024 09:25, Luca Fancellu wrote: >> From: Penny Zheng >> We are doing foreign memory mapping for static shared memory, and >> there is a great possibility that it could be supe

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-02 Thread Luca Fancellu
> On 2 May 2024, at 11:30, Jan Beulich wrote: > > On 02.05.2024 12:12, Luca Fancellu wrote: >>>> In any case it would be used soon also for other architectures using >>>> bootinfo. >>> >>> Oh, would it? >> >> PPC people

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-02 Thread Luca Fancellu
> >> In any case it would be used soon also for other architectures using >> bootinfo. > > Oh, would it? PPC people have plans on putting that interface in common:

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-02 Thread Luca Fancellu
> On 2 May 2024, at 07:43, Jan Beulich wrote: > > On 02.05.2024 08:33, Luca Fancellu wrote: >> >> >>> On 2 May 2024, at 07:14, Jan Beulich wrote: >>> >>> On 01.05.2024 08:57, Luca Fancellu wrote: >>>> Hi J

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-02 Thread Luca Fancellu
> On 2 May 2024, at 07:14, Jan Beulich wrote: > > On 01.05.2024 08:57, Luca Fancellu wrote: >> Hi Jan, >> >>> On 30 Apr 2024, at 12:37, Jan Beulich wrote: >>> >>> On 30.04.2024 13:09, Luca Fancellu wrote: >>>> --- a/xen/arch

Re: [PATCH 1/2] xen/kernel.h: Import __struct_group from Linux

2024-05-02 Thread Luca Fancellu
> On 2 May 2024, at 07:09, Jan Beulich wrote: > > On 01.05.2024 08:54, Luca Fancellu wrote: >>> On 30 Apr 2024, at 12:43, Jan Beulich wrote: >>> On 30.04.2024 13:09, Luca Fancellu wrote: >>>> --- a/xen/include/xen/kernel.h >>>>

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-05-01 Thread Luca Fancellu
Hi Jan, > On 30 Apr 2024, at 12:37, Jan Beulich wrote: > > On 30.04.2024 13:09, Luca Fancellu wrote: >> --- a/xen/arch/arm/include/asm/setup.h >> +++ b/xen/arch/arm/include/asm/setup.h >> @@ -64,18 +64,20 @@ struct membank { >> }; >> >> st

Re: [PATCH 1/2] xen/kernel.h: Import __struct_group from Linux

2024-05-01 Thread Luca Fancellu
Hi Jan, > On 30 Apr 2024, at 12:43, Jan Beulich wrote: > > On 30.04.2024 13:09, Luca Fancellu wrote: >> --- a/xen/include/xen/kernel.h >> +++ b/xen/include/xen/kernel.h >> @@ -54,6 +54,27 @@ >> typeof_field(type, member) *__mptr = (ptr);

[PATCH 1/2] xen/kernel.h: Import __struct_group from Linux

2024-04-30 Thread Luca Fancellu
hree/.four on the struct foo. This construct will become useful in order to have some generalized interfaces that shares some common members. Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 50d7bd38c3aa Signed-off-by: Luca Fancellu --- xen/include/xen/kernel.h | 21 ++

[PATCH 0/2] Fix MISRA regression about flexible array member not at the end

2024-04-30 Thread Luca Fancellu
. [1] https://lore.kernel.org/all/8be082b6d22d61c0b14910680d383...@bugseng.com/ Luca Fancellu (2): xen/kernel.h: Import __struct_group from Linux xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end xen/arch/arm/acpi/domain_build.c| 2 +- xen/arch/arm

[PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-04-30 Thread Luca Fancellu
("xen/arm: Introduce a generic way to access memory bank structures") Signed-off-by: Luca Fancellu --- xen/arch/arm/acpi/domain_build.c| 2 +- xen/arch/arm/domain_build.c | 6 +++--- xen/arch/arm/include/asm/kernel.h | 11 ++- xen/arch/arm/include/asm

Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-26 Thread Luca Fancellu
t; Is this patch safe to commit now? Or would it cause gitlab-ci breakage? >> Yes, it is safe because the ECLAIR analysis is still allowed to fail. >> Committing this patch wouldn't break the CI but it will highlight some >> regressions with the orange badge and the following me

[RFC PATCH 2/2] xen/arm: Rework dt_unreserved_regions to avoid recursion

2024-04-25 Thread Luca Fancellu
an iterative algorithm with the same result. The function was taking an additional parameter 'first', but given the rework and given that the function was always initially called with this parameter as zero, remove the parameter and update the codebase to reflect the change. Signed-off-by: Luca Fancellu

[RFC PATCH 0/2] xen/arm: Remove recursion from dt_unreserved_regions

2024-04-25 Thread Luca Fancellu
p that can go through all the different structures. Comments are welcome. Luca Fancellu (2): xen/arm: Add DT reserve map regions to bootinfo.reserved_mem xen/arm: Rework dt_unreserved_regions to avoid recursion xen/arch/arm/arm32/mmu/mm.c | 29 + xen/arch/arm

[RFC PATCH 1/2] xen/arm: Add DT reserve map regions to bootinfo.reserved_mem

2024-04-25 Thread Luca Fancellu
. Signed-off-by: Luca Fancellu --- xen/arch/arm/arm32/mmu/mm.c | 29 + xen/arch/arm/bootfdt.c | 51 ++ xen/arch/arm/domain_build.c | 3 +- xen/arch/arm/include/asm/setup.h | 5 +++ xen/arch/arm/setup.c | 53

Re: [PATCH v3 12/12] xen/arm: List static shared memory regions as /memory nodes

2024-04-24 Thread Luca Fancellu
Hi Julien, > > Rest LGTM: > Reviewed-by: Michal Orzel Thanks, I will send the next one shortly. >>> I don't think there is a need to respin the whole series just for these >>> fixes. >>> You should wait for the committers opinion. >> AFAICT, there are multiple

[PATCH 5/7] xen/arm: Rework heap page allocation outside allocate_bank_memory

2024-04-23 Thread Luca Fancellu
to change the signature of allocate_bank_memory and remove the 'struct domain' parameter, which can be retrieved from 'struct kernel_info'. No functional changes is intended. Signed-off-by: Luca Fancellu --- xen/arch/arm/dom0less-build.c | 4 +- xen/arch/arm/domain_build.c | 77

[PATCH 2/7] xen/arm: Wrap shared memory mapping code in one function

2024-04-23 Thread Luca Fancellu
Wrap the code and logic that is calling assign_shared_memory and map_regions_p2mt into a new function 'handle_shared_mem_bank', it will become useful later when the code will allow the user to don't pass the host physical address. Signed-off-by: Luca Fancellu --- xen/arch/arm/static-shmem.c

[PATCH 3/7] xen/p2m: put reference for superpage

2024-04-23 Thread Luca Fancellu
for helping put extra references for foreign superpages. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v1: - patch from https://patchwork.kernel.org/project/xen-devel/patch/20231206090623.1932275-9-penny.zh...@arm.com/ --- xen/arch/arm/mmu/p2m.c | 58

[PATCH 7/7] xen/docs: Describe static shared memory when host address is not provided

2024-04-23 Thread Luca Fancellu
From: Penny Zheng This commit describe the new scenario where host address is not provided in "xen,shared-mem" property and a new example is added to the page to explain in details. Take the occasion to fix some typos in the page. Signed-off-by: Penny Zheng Signed-off-by: Luc

[PATCH 4/7] xen/arm: Parse xen,shared-mem when host phys address is not provided

2024-04-23 Thread Luca Fancellu
for these bank to have the start address as INVALID_PADDR. The change holds because of this consideration. Signed-off-by: Luca Fancellu --- xen/arch/arm/setup.c| 3 +- xen/arch/arm/static-shmem.c | 129 +--- 2 files changed, 93 insertions(+), 39 deletions

[PATCH 6/7] xen/arm: Implement the logic for static shared memory from Xen heap

2024-04-23 Thread Luca Fancellu
and if it is, then assign_pages is called for every bank. When the bank is already allocated, for every bank allocated with the corresponding shm_id, handle_shared_mem_bank is called and the mapping are done. Signed-off-by: Luca Fancellu --- xen/arch/arm/static-shmem.c | 193 +--- 1 file

[PATCH 0/7] Static shared memory followup v2 - pt2

2024-04-23 Thread Luca Fancellu
/xen-devel/patch/20240422110207.204968-1-luca.fance...@arm.com/ Luca Fancellu (5): xen/arm: Lookup bootinfo shm bank during the mapping xen/arm: Wrap shared memory mapping code in one function xen/arm: Parse xen,shared-mem when host phys address is not provided xen/arm: Rework heap page

[PATCH 1/7] xen/arm: Lookup bootinfo shm bank during the mapping

2024-04-23 Thread Luca Fancellu
esn't need to be allocated, however it will be convinient later to use it as an argument for assign_shared_memory when dealing with the use case where the Host physical address is not supplied by the user. Signed-off-by: Luca Fancellu --- xen/arch/arm/static-shmem.c | 105 --

[PATCH v3.2 12/12] xen/arm: List static shared memory regions as /memory nodes

2024-04-22 Thread Luca Fancellu
the unused struct domain parameter. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3.2: - changed u64 to uint64_t and used %u as format specifier for var i in make_memory_node, changed u64 to paddr_t in shm_mem_node_fill_reg_range, add Michal R-by v3: - removed previous patch

Re: [PATCH v3 12/12] xen/arm: List static shared memory regions as /memory nodes

2024-04-22 Thread Luca Fancellu
> On 22 Apr 2024, at 11:24, Julien Grall wrote: > > Hi, > > On 22/04/2024 10:26, Michal Orzel wrote: >> On 22/04/2024 10:07, Luca Fancellu wrote: >>> >>> >>> Hi Michal, >>> >>>>> +for ( c

Re: [PATCH v3 12/12] xen/arm: List static shared memory regions as /memory nodes

2024-04-22 Thread Luca Fancellu
Hi Michal, >> +for ( cells = reg, i = 0; cells < reg + nr_cells; i++, cells += >> reg_size ) >> +{ >> +u64 start = dt_read_number(cells, addrcells); > We should no longer use Linux derived types like u64. Use uint64_t. > >> +u64 size = dt_read_number(cells + addrcells,

[PATCH v3 11/12] xen/arm: fix duplicate /reserved-memory node in Dom0

2024-04-18 Thread Luca Fancellu
it to make_shm_resv_memory_node to make clear it produces childs for /reserved-memory. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - fix comment, remove function signature change, fixed commit msg - rename make_shm_memory_node to make_shm_resv_memory_node

Re: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals

2024-04-18 Thread Luca Fancellu
> On 18 Apr 2024, at 07:28, Jan Beulich wrote: > > On 09.04.2024 13:45, Luca Fancellu wrote: >> --- a/xen/arch/x86/extable.c >> +++ b/xen/arch/x86/extable.c >> @@ -23,7 +23,8 @@ static inline unsigned long ex_cont(const struct >> exception_table_ent

[PATCH v3 12/12] xen/arm: List static shared memory regions as /memory nodes

2024-04-18 Thread Luca Fancellu
the unused struct domain parameter. Signed-off-by: Luca Fancellu --- v3: - removed previous patch that was merging the intervals, rebase changes. v2: - try to use make_memory_node, don't add overlapping ranges of memory, commit message changed. v1: - new patch --- --- xen/arch/arm

[PATCH v3 09/12] xen/arm: Reduce struct membank size on static shared memory

2024-04-18 Thread Luca Fancellu
memory banks from the 'reserved_mem' to a new 'shmem' member of the 'struct bootinfo'. Change also the 'shm_mem' member type to be 'struct shared_meminfo' in order to match the above changes and allow a memory space reduction also in 'struct kernel_info'. Now that the structure Signed-off-by: Luca

[PATCH v3 10/12] xen/arm: remove shm holes from extended regions

2024-04-18 Thread Luca Fancellu
shm info from "kinfo", we use "remove_shm_from_rangeset" to remove static shm. For direct-map domain with iommu off, as static shm has already been taken care of through find_unallocated_memory, we do nothing. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu --- v3: - Put size -1

[PATCH v3 07/12] xen/arm: Avoid code duplication in check_reserved_regions_overlap

2024-04-18 Thread Luca Fancellu
The function check_reserved_regions_overlap is calling 'meminfo_overlap_check' on the same type of structure, this code can be written in a way to avoid code duplication, so rework the function to do that. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3: - add Michal R-by v2

[PATCH v3 08/12] xen/arm: Introduce helper for static memory pages

2024-04-18 Thread Luca Fancellu
banks will be removed from reserved_mem. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - Add Michal R-by - Changed commit msg v1: - new patch --- --- xen/arch/arm/include/asm/static-memory.h | 13 + xen/arch/arm/static-memory.c | 12 +--- 2 files

[PATCH v3 06/12] xen/arm: Avoid code duplication in find_unallocated_memory

2024-04-18 Thread Luca Fancellu
will be introduced as a separate structure from reserved memory. Take the occasion to add the error code to the error message in case 'rangeset_remove_range' fails. Signed-off-by: Luca Fancellu --- v3: - Fixed the wrong logic, now the function correctly adds the available ram to the rangeset

[PATCH v3 01/12] xen/arm: remove stale addr_cells/size_cells in assign_shared_memory

2024-04-18 Thread Luca Fancellu
From: Penny Zheng Function parameters {addr_cells,size_cells} are stale parameters in assign_shared_memory, so we shall remove them. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - no change v1: - This is this patch: https://patchwork.kernel.org

[PATCH v3 05/12] xen/arm: Conditional compilation of kernel_info.shm_mem member

2024-04-18 Thread Luca Fancellu
the member with the Kconfig parameter and modify the signature of the only function using it to remove any reference to the member from outside the static-shmem module. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - add Michal R-by - Removed the signature modification

[PATCH v3 03/12] xen/arm: Pass struct kernel_info parameter to make_{resv,shm}_memory_node

2024-04-18 Thread Luca Fancellu
. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3: - Fix commit title/msg, add Michal R-by v2: - new patch --- --- xen/arch/arm/dom0less-build.c | 3 +-- xen/arch/arm/domain_build.c | 3 +-- xen/arch/arm/include/asm/static-shmem.h | 9 - xen/arch/arm

[PATCH v3 02/12] xen/arm: avoid repetitive checking in process_shm_node

2024-04-18 Thread Luca Fancellu
From: Penny Zheng Putting overlap and overflow checking in the loop is causing repetitive operation, so this commit extracts both checking outside the loop. Signed-off-by: Penny Zheng Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - add Michal R-by v1: - Rework of https

[PATCH v3 04/12] xen/arm: Introduce a generic way to access memory bank structures

2024-04-18 Thread Luca Fancellu
on will be used to initialize 'struct kernel_info' and 'struct bootinfo' respectively, in order to initialize their 'struct meminfo' .common.max_banks members. Constify pointers where needed. Suggested-by: Julien Grall Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3

[PATCH v3 00/12] Static shared memory followup v2 - pt1

2024-04-18 Thread Luca Fancellu
atches, moved the patch related to the static memory helper. Luca Fancellu (8): xen/arm: Pass struct kernel_info parameter to make_{resv,shm}_memory_node xen/arm: Introduce a generic way to access memory bank structures xen/arm: Conditional compilation of kernel_info.shm_mem member x

Re: [PATCH] public: xen: Define missing guest handle for int32_t

2024-04-17 Thread Luca Fancellu
| XEN_GUEST_HANDLE(int32_t) errs; > > Fix it. Also, drop guest handle definition for int given no further use. > > Fixes: afab29d0882f ("public: s/int/int32_t") > Signed-off-by: Michal Orzel > --- I’ve build it for arm64, arm32 and x86 Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

Re: docs/misra: add R21.6 R21.14 R21.15 R21.16

2024-04-17 Thread Luca Fancellu
> + essentially enum type Also here. > + - > + >* - `Rule 21.17 > <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_17.c>`_ > - Mandatory > - Use of the string handling functions from shall not result > in > Apart from them, that I guess can be addressed on commit, it looks good to me, I’ve also tested that the changes don’t break convert_misra_doc.py build. Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu

Re: [PATCH v2 13/13] xen/arm: List static shared memory regions as /memory nodes

2024-04-16 Thread Luca Fancellu
> On 16 Apr 2024, at 10:06, Julien Grall wrote: > > > > On 16/04/2024 09:59, Luca Fancellu wrote: >>> On 16 Apr 2024, at 09:50, Julien Grall wrote: >>> >>> >>> >>> On 16/04/2024 07:27, Luca Fancellu wrote: >>>>

Re: [PATCH v2 13/13] xen/arm: List static shared memory regions as /memory nodes

2024-04-16 Thread Luca Fancellu
> On 16 Apr 2024, at 09:50, Julien Grall wrote: > > > > On 16/04/2024 07:27, Luca Fancellu wrote: >> Hi Julien, > > Hi Luca, > >>> On 15 Apr 2024, at 19:41, Julien Grall wrote: >>> >>> Hi Luca, >>> >>> On

Re: [PATCH v2 13/13] xen/arm: List static shared memory regions as /memory nodes

2024-04-16 Thread Luca Fancellu
Hi Julien, > On 15 Apr 2024, at 19:41, Julien Grall wrote: > > Hi Luca, > > On 09/04/2024 12:45, Luca Fancellu wrote: >> Currently Xen is not exporting the static shared memory regions >> to the device tree as /memory node, this commit is fixing this >> issue.

Re: [PATCH] docs: arm: Update where Xen should be loaded in memory

2024-04-12 Thread Luca Fancellu
> Signed-off-by: Michal Orzel > --- Reviewed-by: Luca Fancellu

Re: [PATCH 1/5] gzip: colocate gunzip code files

2024-04-11 Thread Luca Fancellu
>>> create mode 100644 xen/common/gzip/Makefile >>> rename xen/common/{ => gzip}/gunzip.c (100%) >>> rename xen/common/{ => gzip}/inflate.c (100%) >> For inflate.c you will need to update also docs/misra/exclude-list.json > > Something like this? > > diff --git a/docs/misra/exclude-list.json

Re: [PATCH 1/5] gzip: colocate gunzip code files

2024-04-11 Thread Luca Fancellu
> On 11 Apr 2024, at 16:25, Daniel P. Smith > wrote: > > This patch moves the gunzip code files to common/gzip. Makefiles are adjusted > accordingly. > > Signed-off-by: Daniel P. Smith > --- > xen/common/Makefile | 2 +- > xen/common/gzip/Makefile| 1 + > xen/common/{ =>

Re: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals

2024-04-11 Thread Luca Fancellu
> > I’ve just spotted an issue with the algorithm, the fix is this one: > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c > index 24914a80d03b..262385a041a8 100644 > --- a/xen/common/device_tree.c > +++ b/xen/common/device_tree.c > @@ -2360,6 +2360,10 @@ int __init >

Re: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals

2024-04-11 Thread Luca Fancellu
> On 9 Apr 2024, at 12:45, Luca Fancellu wrote: > > Introduce a function that given an array of cells containing > (address,size) intervals, merges the overlapping ones, returning > an array with no overlapping intervals. > > The algorithm needs to sort the interva

Re: [PATCH v2 4/4] xen/virtual-region: Drop setup_virtual_regions()

2024-04-10 Thread Luca Fancellu
the opportunity to move 'core' into read_mostly, where it probably should > have lived all along. > > Signed-off-by: Andrew Cooper For the arm part: Reviewed-by: Luca Fancellu #arm I’ve also tested the serie on arm32 and arm64 on qemu Tested-by: Luca Fancellu

Re: [PATCH] xen/nospec: Remove unreachable code

2024-04-10 Thread Luca Fancellu
gt; } > > Insert an #else to take out the second return. > > Fixes: 7ef0084418e1 ("x86/spinlock: introduce support for blocking > speculation into critical regions") > Signed-off-by: Andrew Cooper > --- Reviewed-by: Luca Fancellu

Re: [PATCH] xen/vPCI: Remove shadowed variable

2024-04-10 Thread Luca Fancellu
> On 10 Apr 2024, at 20:33, Andrew Cooper wrote: > > Resolves a MISRA R5.3 violation. > > Fixes: 622bdd962822 ("vpci/header: handle p2m range sets per BAR") > Signed-off-by: Andrew Cooper > --- Reviewed-by: Luca Fancellu

Re: [PATCH] xen/spinlock: Adjust LOCK_DEBUG_INITVAL to placate MISRA

2024-04-10 Thread Luca Fancellu
> On 10 Apr 2024, at 20:35, Andrew Cooper wrote: > > Resolves an R7.2 violation. > > Fixes: c286bb93d20c ("xen/spinlock: support higher number of cpus") > Signed-off-by: Andrew Cooper Yes makes sense Reviewed-by: Luca Fancellu

Re: [PATCH v2 10/13] xen/arm: remove shm holes from extended regions

2024-04-10 Thread Luca Fancellu
Hi Michal, >> >> For direct-map domain with iommu off, as static shm has already been taken >> care of through reserved memory banks, we do nothing. > Stale info given that shmem is no longer part of reserved memory banks. It's > been taken care > of by removing shmem regions in

  1   2   3   4   5   6   7   8   9   10   >