Re: [PATCH v13 00/12] Arm cache coloring

2024-12-20 Thread Carlo Nonato
On Fri, Dec 20, 2024 at 8:34 AM Michal Orzel wrote: > > On 17/12/2024 18:06, Carlo Nonato wrote: > > > > Shared caches in multi-core CPU architectures represent a problem for > > predictability of memory access latency. This jeopardizes applicability > > of many Arm

[PATCH v13 11/12] xen/arm: make consider_modules() available for xen relocation

2024-12-17 Thread Carlo Nonato
2. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato Reviewed-by: Michal Orzel --- v13: - no changes v12: - no changes v11: - removed useless #include v10: - no changes v9: - no changes v8: - patch adapted to new changes to consider_mo

[PATCH v13 12/12] xen/arm: add cache coloring support for Xen image

2024-12-17 Thread Carlo Nonato
Xen protection must happen after the copy. Finally, since the alternative framework needs to remap the Xen text and inittext sections, this operation must be done in a coloring-aware way. The function xen_remap_colored() is introduced for that. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solie

[PATCH v13 01/12] xen/common: add cache coloring common code

2024-12-17 Thread Carlo Nonato
er of colors that fit in a 4 KiB page when integers are 4 bytes long. LLC colors are a property of the domain, so struct domain has to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Acked-by: Michal Orzel --- v13: - added no

[PATCH v13 08/12] xen/page_alloc: introduce preserved page flags macro

2024-12-17 Thread Carlo Nonato
PGC_static and PGC_extra need to be preserved when assigning a page. Define a new macro that groups those flags and use it instead of or'ing every time. Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v13: - no changes v12: - fixed wrong patch sent in v11 - added comme

[PATCH v13 10/12] xen/arm: add Xen cache colors command line parameter

2024-12-17 Thread Carlo Nonato
essly partitions a cache memory that is already private, i.e. underutilize it. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v13: - no changes v12: - no changes v11: - no changes v10: - no changes v9: - no changes v8: - added bound che

[PATCH v13 04/12] xen/arm: add Dom0 cache coloring support

2024-12-17 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich Reviewed-by: Michal Orzel --- v13: - no changes v12: - no change

[PATCH v13 02/12] xen/arm: add initial support for LLC coloring on arm64

2024-12-17 Thread Carlo Nonato
allocation and cache coloring are incompatible because static memory can't be guaranteed to use only colors assigned to the domain. Panic during DomUs creation when both are enabled. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Review

[PATCH v13 05/12] xen: extend domctl interface for cache coloring

2024-12-17 Thread Carlo Nonato
Add a new domctl hypercall to allow the user to set LLC coloring configurations. Colors can be set only once, just after domain creation, since recoloring isn't supported. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by

[PATCH v13 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-17 Thread Carlo Nonato
n() before allocate_memory() in construct_dom0(). Introduce add_hwdom_free_regions() callback to add hwdom banks in descending order. Signed-off-by: Carlo Nonato Reviewed-by: Michal Orzel --- v13: - removed ASSERT(llc_coloring_enabled) from allocate_memory() - mentioned the reordering of find_gnt

[PATCH v13 00/12] Arm cache coloring

2024-12-17 Thread Carlo Nonato
pport the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (11): xen/common: add cache coloring common code xen/arm: add initial support for LLC coloring on arm64 xen/arm: permit non direct-mapped Dom0 construction xen/arm

[PATCH v13 09/12] xen: add cache coloring allocator for domains

2024-12-17 Thread Carlo Nonato
eap() debug-key function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich Acked-by: Michal Orzel --- v13: - no changes v12: - fixed #ifdef CONFIG_LLC_COLORING in init_color_heap_pages() v11: - CONFIG_BUDDY_ALLOCATOR_

[PATCH v13 07/12] xen/arm: add support for cache coloring configuration via device-tree

2024-12-17 Thread Carlo Nonato
Add the "llc-colors" Device Tree property to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich # non-Arm Reviewed-by: Michal Orzel --- v13: - no changes

[PATCH v13 06/12] tools: add support for cache coloring configuration

2024-12-17 Thread Carlo Nonato
the color ranges. Documentation is also added. Golang bindings are regenerated. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Anthony PERARD --- v13: - no changes v12: - no changes v11: - turned unsigned int to u

Re: [PATCH v12 01/12] xen/common: add cache coloring common code

2024-12-17 Thread Carlo Nonato
On Tue, Dec 17, 2024 at 12:12 PM Jan Beulich wrote: > > On 17.12.2024 11:25, Carlo Nonato wrote: > > On Tue, Dec 17, 2024 at 9:57 AM Jan Beulich wrote: > >> > >> On 16.12.2024 17:33, Carlo Nonato wrote: > >>> On Mon, Dec 16, 2024 at 11:51 AM Jan Beulich

Re: [PATCH v12 01/12] xen/common: add cache coloring common code

2024-12-17 Thread Carlo Nonato
On Tue, Dec 17, 2024 at 9:57 AM Jan Beulich wrote: > > On 16.12.2024 17:33, Carlo Nonato wrote: > > On Mon, Dec 16, 2024 at 11:51 AM Jan Beulich wrote: > >> On 13.12.2024 17:28, Carlo Nonato wrote: > >>> --- /dev/null > >>> +++ b/xen/common/llc-colo

Re: [PATCH v12 01/12] xen/common: add cache coloring common code

2024-12-16 Thread Carlo Nonato
Hi Jan, On Mon, Dec 16, 2024 at 11:51 AM Jan Beulich wrote: > > On 13.12.2024 17:28, Carlo Nonato wrote: > > Last Level Cache (LLC) coloring allows to partition the cache in smaller > > chunks called cache colors. > > > > Since not all architectures ca

Re: [PATCH v12 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-16 Thread Carlo Nonato
Hi Michal, On Mon, Dec 16, 2024 at 1:08 PM Michal Orzel wrote: > > On 13/12/2024 17:28, Carlo Nonato wrote: > > > > Cache coloring requires Dom0 not to be direct-mapped because of its non > > contiguous mapping nature, so allocate_memory() is needed in this case. > &g

Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2024-12-16 Thread Carlo Nonato
Hi Jan, On Mon, Dec 16, 2024 at 3:36 PM Jan Beulich wrote: > > On 16.12.2024 15:28, Carlo Nonato wrote: > > On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrote: > >> On 13/12/2024 17:28, Carlo Nonato wrote: > >>> --- a/xen/arch/arm/arm64/mmu/mm.c > &

Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2024-12-16 Thread Carlo Nonato
Hi Michal, On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrote: > > On 13/12/2024 17:28, Carlo Nonato wrote: > > > > Xen image is relocated to a new colored physical space. Some relocation > > functionalities must be brought back: > > - the virtual address

Re: [PATCH v12 08/12] xen/page_alloc: introduce preserved page flags macro

2024-12-16 Thread Carlo Nonato
Hi Jan, On Mon, Dec 16, 2024 at 1:42 PM Jan Beulich wrote: > > On 13.12.2024 17:28, Carlo Nonato wrote: > > PGC_static and PGC_extra need to be preserved when assigning a page. > > Define a new macro that groups those flags and use it instead of or'ing > > ever

[PATCH v12 10/12] xen/arm: add Xen cache colors command line parameter

2024-12-13 Thread Carlo Nonato
essly partitions a cache memory that is already private, i.e. underutilize it. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v12: - no changes v11: - no changes v10: - no changes v9: - no changes v8: - added bound check on xen_colo

[PATCH v12 08/12] xen/page_alloc: introduce preserved page flags macro

2024-12-13 Thread Carlo Nonato
PGC_static and PGC_extra need to be preserved when assigning a page. Define a new macro that groups those flags and use it instead of or'ing every time. Signed-off-by: Carlo Nonato --- v12: - fixed wrong patch sent in v11 - added comment on PGC_preserved v11: - removed PGC_broken

[PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2024-12-13 Thread Carlo Nonato
Xen protection must happen after the copy. Finally, since the alternative framework needs to remap the Xen text and inittext sections, this operation must be done in a coloring-aware way. The function xen_remap_colored() is introduced for that. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solie

[PATCH v12 11/12] xen/arm: make consider_modules() available for xen relocation

2024-12-13 Thread Carlo Nonato
2. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato Reviewed-by: Michal Orzel --- v12: - no changes v11: - removed useless #include v10: - no changes v9: - no changes v8: - patch adapted to new changes to consider_modules() v

[PATCH v12 07/12] xen/arm: add support for cache coloring configuration via device-tree

2024-12-13 Thread Carlo Nonato
Add the "llc-colors" Device Tree property to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich # non-Arm Reviewed-by: Michal Orzel --- v12: - no changes v

[PATCH v12 05/12] xen: extend domctl interface for cache coloring

2024-12-13 Thread Carlo Nonato
Add a new domctl hypercall to allow the user to set LLC coloring configurations. Colors can be set only once, just after domain creation, since recoloring isn't supported. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by

[PATCH v12 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-13 Thread Carlo Nonato
ort_ranges() and move the membanks struct after the callback function in find_unallocated_memory(). Introduce add_hwdom_free_regions() callback to add hwdom banks in descending order. Signed-off-by: Carlo Nonato --- v12: - used the new generic find_unallocated_memory() - added add_hwdom_fr

[PATCH v12 09/12] xen: add cache coloring allocator for domains

2024-12-13 Thread Carlo Nonato
eap() debug-key function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v12: - fixed #ifdef CONFIG_LLC_COLORING in init_color_heap_pages() v11: - CONFIG_BUDDY_ALLOCATOR_SIZE depends on CONFIG_LLC_COLORING - budd

[PATCH v12 01/12] xen/common: add cache coloring common code

2024-12-13 Thread Carlo Nonato
er of colors that fit in a 4 KiB page when integers are 4 bytes long. LLC colors are a property of the domain, so struct domain has to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Acked-by: Michal Orzel --- v12: - fixed build e

[PATCH v12 06/12] tools: add support for cache coloring configuration

2024-12-13 Thread Carlo Nonato
the color ranges. Documentation is also added. Golang bindings are regenerated. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Anthony PERARD --- v12: - no changes v11: - turned unsigned int to uint32_t in xc_domain_set_llc_colors(

[PATCH v12 04/12] xen/arm: add Dom0 cache coloring support

2024-12-13 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich Reviewed-by: Michal Orzel --- v12: - no changes v11: - minor ch

[PATCH v12 00/12] Arm cache coloring

2024-12-13 Thread Carlo Nonato
pport the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (11): xen/common: add cache coloring common code xen/arm: add initial support for LLC coloring on arm64 xen/arm: permit non direct-mapped Dom0 construction xen/arm

[PATCH v12 02/12] xen/arm: add initial support for LLC coloring on arm64

2024-12-13 Thread Carlo Nonato
allocation and cache coloring are incompatible because static memory can't be guaranteed to use only colors assigned to the domain. Panic during DomUs creation when both are enabled. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Review

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-13 Thread Carlo Nonato
On Fri, Dec 13, 2024 at 12:47 PM Michal Orzel wrote: > > > > On 13/12/2024 12:33, Carlo Nonato wrote: > > > > > > Using paste.debian: > > > > https://paste.debian.net/1339647/ > > 1. Issue I mentioned with prefixing with double underscore > 2. Ge

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-13 Thread Carlo Nonato
Using paste.debian: https://paste.debian.net/1339647/ Thanks. - Carlo

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-13 Thread Carlo Nonato
On Fri, Dec 13, 2024 at 11:56 AM Michal Orzel wrote: > > > > On 13/12/2024 11:26, Carlo Nonato wrote: > > > > > > Hi Michal, > > > > On Fri, Dec 13, 2024 at 10:46 AM Michal Orzel wrote: > >> > >> Hi Carlo, Andrea, > >> >

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-13 Thread Carlo Nonato
Hi Michal, On Fri, Dec 13, 2024 at 10:46 AM Michal Orzel wrote: > > Hi Carlo, Andrea, > > On 12/12/2024 19:22, Andrea Bastoni wrote: > > > > > > On 12/12/2024 18:48, Carlo Nonato wrote: > >> Hi, > >> > >> On Mon, Dec 9, 2024 at 8:17 PM J

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-12 Thread Carlo Nonato
er. > >> > >> On 05/12/2024 09:40, Michal Orzel wrote: > >>> > >>> > >>> On 02/12/2024 17:59, Carlo Nonato wrote: > >>>> > >>>> > >>>> Cache coloring requires Dom0 not to be direct-mapped because of its

Re: [PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-09 Thread Carlo Nonato
Hi Michal, Julien On Sat, Dec 7, 2024 at 4:05 PM Michal Orzel wrote: > > On 06/12/2024 19:37, Julien Grall wrote: > > > > > > Hi, > > > > Sorry for the late answer. > > > > On 05/12/2024 09:40, Michal Orzel wrote: > >> > >> >

Re: [PATCH v11 12/12] xen/arm: add cache coloring support for Xen image

2024-12-03 Thread Carlo Nonato
Hi Julien, On Tue, Dec 3, 2024 at 11:36 AM Julien Grall wrote: > > On 03/12/2024 10:08, Carlo Nonato wrote: > > Hi Julien, > > > > On Mon, Dec 2, 2024 at 10:44 PM Julien Grall wrote: > >> > >> Hi Carlo, > > > > [...] > > > >&g

Re: [PATCH v11 12/12] xen/arm: add cache coloring support for Xen image

2024-12-03 Thread Carlo Nonato
Hi Julien, On Mon, Dec 2, 2024 at 10:44 PM Julien Grall wrote: > > Hi Carlo, [...] > > diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c > > index 671eaadbc1..3732d5897e 100644 > > --- a/xen/arch/arm/arm64/mmu/mm.c > > +++ b/xen/arch/arm/arm64/mmu/mm.c > > @@ -1,6 +1,7 @@ >

[PATCH v11 05/12] xen: extend domctl interface for cache coloring

2024-12-02 Thread Carlo Nonato
Add a new domctl hypercall to allow the user to set LLC coloring configurations. Colors can be set only once, just after domain creation, since recoloring isn't supported. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by

[PATCH v11 07/12] xen/arm: add support for cache coloring configuration via device-tree

2024-12-02 Thread Carlo Nonato
Add the "llc-colors" Device Tree property to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich # non-Arm Reviewed-by: Michal Orzel --- v11: - made clear that

[PATCH v11 08/12] xen/page_alloc: introduce preserved page flags macro

2024-12-02 Thread Carlo Nonato
PGC_static and PGC_extra need to be preserved when assigning a page. Define a new macro that groups those flags and use it instead of or'ing every time. Signed-off-by: Carlo Nonato --- v11: - removed PGC_broken from PGC_preserved - removed PGC preservation from mark_page_free() v10: -

[PATCH v11 06/12] tools: add support for cache coloring configuration

2024-12-02 Thread Carlo Nonato
the color ranges. Documentation is also added. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v11: - turned unsigned int to uint32_t in xc_domain_set_llc_colors() - return -1 in case of error instead of ENOMEM in xc_domain_set_llc_colors

[PATCH v11 01/12] xen/common: add cache coloring common code

2024-12-02 Thread Carlo Nonato
er of colors that fit in a 4 KiB page when integers are 4 bytes long. LLC colors are a property of the domain, so struct domain has to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Acked-by: Michal Orzel --- v11: - __COLORIN

[PATCH v11 09/12] xen: add cache coloring allocator for domains

2024-12-02 Thread Carlo Nonato
eap() debug-key function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v11: - CONFIG_BUDDY_ALLOCATOR_SIZE depends on CONFIG_LLC_COLORING - buddy_alloc_size is defined only if CONFIG_LLC_COLORING - buddy-alloc-size param is

[PATCH v11 11/12] xen/arm: make consider_modules() available for xen relocation

2024-12-02 Thread Carlo Nonato
2. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato Reviewed-by: Michal Orzel --- v11: - removed useless #include v10: - no changes v9: - no changes v8: - patch adapted to new changes to consider_modules() v7: - moved consider_modules()

[PATCH v11 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-12-02 Thread Carlo Nonato
it in Dom0 construction bring it back to domain_build.c and declare it in domain_build.h. Take the opportunity to adapt the implementation of allocate_memory() so that it uses the host layout when called on the hwdom, via find_unallocated_memory(). Signed-off-by: Carlo Nonato --- v11: - GUEST_RAM_BAN

[PATCH v11 00/12] Arm cache coloring

2024-12-02 Thread Carlo Nonato
pport the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (11): xen/common: add cache coloring common code xen/arm: add initial support for LLC coloring on arm64 xen/arm: permit non direct-mapped Dom0 construction xen/arm

[PATCH v11 04/12] xen/arm: add Dom0 cache coloring support

2024-12-02 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich Reviewed-by: Michal Orzel --- v11: - minor changes v10: - fixed

[PATCH v11 12/12] xen/arm: add cache coloring support for Xen image

2024-12-02 Thread Carlo Nonato
Xen protection must happen after the copy. Finally, since the alternative framework needs to remap the Xen text and inittext sections, this operation must be done in a coloring-aware way. The function xen_remap_colored() is introduced for that. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solie

[PATCH v11 10/12] xen/arm: add Xen cache colors command line parameter

2024-12-02 Thread Carlo Nonato
essly partitions a cache memory that is already private, i.e. underutilize it. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v11: - no changes v10: - no changes v9: - no changes v8: - added bound check on xen_colors in llc_coloring_init

[PATCH v11 02/12] xen/arm: add initial support for LLC coloring on arm64

2024-12-02 Thread Carlo Nonato
allocation and cache coloring are incompatible because static memory can't be guaranteed to use only colors assigned to the domain. Panic during DomUs creation when both are enabled. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Review

Re: [PATCH v11 08/12] xen/page_alloc: introduce preserved page flags macro

2024-12-02 Thread Carlo Nonato
Hi all, On Mon, Dec 2, 2024 at 5:59 PM Carlo Nonato wrote: > > PGC_static and PGC_extra need to be preserved when assigning a page. > Define a new macro that groups those flags and use it instead of or'ing > every time. > > Signed-off-by: Carlo Nonato > --- > v11

Re: [PATCH v10 09/12] xen: add cache coloring allocator for domains

2024-11-29 Thread Carlo Nonato
Hi Jan, On Thu, Nov 28, 2024 at 12:43 PM Jan Beulich wrote: > > On 19.11.2024 15:13, Carlo Nonato wrote: > > --- a/docs/misc/xen-command-line.pandoc > > +++ b/docs/misc/xen-command-line.pandoc > > @@ -270,6 +270,20 @@ and not running softirqs. Reduce this if softirq

Re: [PATCH v10 08/12] xen/page_alloc: introduce preserved page flags macro

2024-11-29 Thread Carlo Nonato
Hi Jan, On Thu, Nov 28, 2024 at 12:05 PM Jan Beulich wrote: > > On 19.11.2024 15:13, Carlo Nonato wrote: > > PGC_static, PGC_extra and PGC_broken need to be preserved when assigning a > > page. Define a new macro that groups those flags and use it instead of > &g

Re: [PATCH v10 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-11-29 Thread Carlo Nonato
Hi Michal, On Thu, Nov 28, 2024 at 11:34 AM Michal Orzel wrote: > On 19/11/2024 15:13, Carlo Nonato wrote: > > > > > > Cache coloring requires Dom0 not to be direct-mapped because of its non > > contiguous mapping nature, so allocate_memory() is needed in this c

Re: [PATCH v10 01/12] xen/common: add cache coloring common code

2024-11-27 Thread Carlo Nonato
Hi Michal, On Wed, Nov 27, 2024 at 11:48 AM Michal Orzel wrote: > On 19/11/2024 15:13, Carlo Nonato wrote: > > > > > > Last Level Cache (LLC) coloring allows to partition the cache in smaller > > chunks called cache colors. > > > > Since not all archite

Re: [PATCH v10 06/12] tools: add support for cache coloring configuration

2024-11-21 Thread Carlo Nonato
Hi Anthony, On Wed, Nov 20, 2024 at 5:25 PM Anthony PERARD wrote: > > Hi Carlo, > > On Tue, Nov 19, 2024 at 03:13:23PM +0100, Carlo Nonato wrote: > > diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c > > index e3538ec0ba..4ed339e6e4 100644 &

[PATCH v10 09/12] xen: add cache coloring allocator for domains

2024-11-20 Thread Carlo Nonato
eap() debug-key function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v10: - stated explicit dependency on CONFIG_LLC_COLORING for buddy-alloc-size - fix for MISRA rule 20.7 parenthesis v9: - added ASSERT(order == 0) when freeing a color

[PATCH v10 12/12] xen/arm: add cache coloring support for Xen

2024-11-20 Thread Carlo Nonato
rarily available for relocation. This implies that Xen protection must happen after the copy. Finally, since the alternative framework needs to remap the Xen text and inittext sections, this operation must be done in a coloring-aware way. The function xen_remap_colored() is introduced for that.

[PATCH v10 08/12] xen/page_alloc: introduce preserved page flags macro

2024-11-19 Thread Carlo Nonato
al of PGC_extra before freeing domain pages as this is considered an error and can cause ASSERT violations. Signed-off-by: Carlo Nonato --- v10: - fixed commit message v9: - add PGC_broken to PGC_preserved - clear PGC_extra in alloc_domheap_pages() only if MEMF_no_refcount is set v8: - fixed PGC_

[PATCH v10 10/12] xen/arm: add Xen cache colors command line parameter

2024-11-19 Thread Carlo Nonato
essly partitions a cache memory that is already private, i.e. underutilize it. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v10: - no changes v9: - no changes v8: - added bound check on xen_colors in llc_coloring_init() v7: - re

[PATCH v10 03/12] xen/arm: permit non direct-mapped Dom0 construction

2024-11-19 Thread Carlo Nonato
it in Dom0 construction bring it back to domain_build.c and declare it in domain_build.h. Take the opportunity to adapt the implementation of allocate_memory() so that it uses the host layout when called on the hwdom, via find_unallocated_memory(). Signed-off-by: Carlo Nonato --- v10: - fixed a compi

[PATCH v10 01/12] xen/common: add cache coloring common code

2024-11-19 Thread Carlo Nonato
er of colors that fit in a 4 KiB page when integers are 4 bytes long. LLC colors are a property of the domain, so struct domain has to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v10: - fixed commit message to use LLC_COLORS_

[PATCH v10 02/12] xen/arm: add initial support for LLC coloring on arm64

2024-11-19 Thread Carlo Nonato
allocation and cache coloring are incompatible because static memory can't be guaranteed to use only colors assigned to the domain. Panic during DomUs creation when both are enabled. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v10: -

[PATCH v10 11/12] xen/arm: make consider_modules() available for xen relocation

2024-11-19 Thread Carlo Nonato
2. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato --- v10: - no changes v9: - no changes v8: - patch adapted to new changes to consider_modules() v7: - moved consider_modules() to arm/mmu/setup.c v6: - new patch --- xen/arch/arm/arm3

[PATCH v10 05/12] xen: extend domctl interface for cache coloring

2024-11-19 Thread Carlo Nonato
Add a new domctl hypercall to allow the user to set LLC coloring configurations. Colors can be set only once, just after domain creation, since recoloring isn't supported. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by

Re: Xen 4.20 Development Update [August-October]

2024-11-19 Thread Carlo Nonato
Hi all, I would like to see "Arm cache coloring" in 4.20. I just sent v10. Best regards. - Carlo Nonato On Tue, Nov 12, 2024 at 5:16 PM Oleksii Kurochko wrote: > > Hello everyone, > > This email only tracks big items for xen.git tree. Please reply for items you > wou

[PATCH v10 06/12] tools: add support for cache coloring configuration

2024-11-19 Thread Carlo Nonato
the color ranges. Documentation is also added. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v10: - no changes v9: - turned warning into error in case of coloring not enabled v8: - warn the user in case of coloring not supported at hyperviso

[PATCH v10 07/12] xen/arm: add support for cache coloring configuration via device-tree

2024-11-19 Thread Carlo Nonato
Add the "llc-colors" Device Tree attribute to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich # non-Arm --- v10: - no changes v9: - use best-effort all

[PATCH v10 00/12] Arm cache coloring

2024-11-19 Thread Carlo Nonato
pport the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (11): xen/common: add cache coloring common code xen/arm: add initial support for LLC coloring on arm64 xen/arm: permit non direct-mapped Dom0 construction xen/arm

[PATCH v10 04/12] xen/arm: add Dom0 cache coloring support

2024-11-19 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich --- v10: - fixed array type for colors parameter in check_colors

Re: [PATCH v9 01/13] xen/common: add cache coloring common code

2024-11-07 Thread Carlo Nonato
Hi Jan, On Thu, Nov 7, 2024 at 10:05 AM Jan Beulich wrote: > > On 06.11.2024 17:09, Carlo Nonato wrote: > > On Tue, Nov 5, 2024 at 4:46 PM Jan Beulich wrote: > >> On 25.10.2024 11:50, Carlo Nonato wrote: > >>> --- a/xen/common/Kconfig > >>>

Re: [PATCH v9 09/13] xen: add cache coloring allocator for domains

2024-11-07 Thread Carlo Nonato
Hi Jan On Tue, Nov 5, 2024 at 5:11 PM Jan Beulich wrote: > > On 25.10.2024 11:50, Carlo Nonato wrote: > > --- a/docs/misc/xen-command-line.pandoc > > +++ b/docs/misc/xen-command-line.pandoc > > @@ -270,6 +270,20 @@ and not running softirqs. Reduce this if softirq

Re: [PATCH v9 08/13] xen/page_alloc: introduce preserved page flags macro

2024-11-07 Thread Carlo Nonato
Hi Jan, On Tue, Nov 5, 2024 at 4:59 PM Jan Beulich wrote: > > On 25.10.2024 11:50, Carlo Nonato wrote: > > PGC_static and PGC_extra needs to be preserved when assigning a page. > > Define a new macro that groups those flags and use it instead of or'ing > > every ti

Re: [PATCH v9 01/13] xen/common: add cache coloring common code

2024-11-06 Thread Carlo Nonato
On Tue, Nov 5, 2024 at 4:46 PM Jan Beulich wrote: > > On 25.10.2024 11:50, Carlo Nonato wrote: > > Last Level Cache (LLC) coloring allows to partition the cache in smaller > > chunks called cache colors. > > > > Since not all architectures can actually implement i

[PATCH v9 08/13] xen/page_alloc: introduce preserved page flags macro

2024-10-25 Thread Carlo Nonato
extra before freeing new pages as this is considered an error and can cause ASSERT violations. Signed-off-by: Carlo Nonato --- v9: - add PGC_broken to PGC_preserved - clear PGC_extra in alloc_domheap_pages() only if MEMF_no_refcount is set v8: - fixed PGC_extra ASSERT fail in alloc_domheap_pages

[PATCH v9 11/13] xen/arm: add Xen cache colors command line parameter

2024-10-25 Thread Carlo Nonato
essly partitions a cache memory that is already private, i.e. underutilize it. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato Reviewed-by: Jan Beulich --- v9: - no changes v8: - added bound check on xen_colors in llc_coloring_init() v7: - removed XEN_DEFAULT_

[PATCH v9 05/13] xen: extend domctl interface for cache coloring

2024-10-25 Thread Carlo Nonato
Add a new domctl hypercall to allow the user to set LLC coloring configurations. Colors can be set only once, just after domain creation, since recoloring isn't supported. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by

[PATCH v9 13/13] xen/arm: add cache coloring support for Xen

2024-10-25 Thread Carlo Nonato
rarily available for relocation. This implies that Xen protection must happen after the copy. Finally, since the alternative framework needs to remap the Xen text and inittext sections, this operation must be done in a coloring-aware way. The function xen_remap_colored() is introduced for that.

[PATCH v9 09/13] xen: add cache coloring allocator for domains

2024-10-25 Thread Carlo Nonato
eap() debug-key function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v9: - added ASSERT(order == 0) when freeing a colored page - moved buddy_alloc_size initialization logic in Kconfig v8: - requests that uses MEMF_* flags that can'

[PATCH v9 07/13] xen/arm: add support for cache coloring configuration via device-tree

2024-10-25 Thread Carlo Nonato
Add the "llc-colors" Device Tree attribute to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v9: - use best-effort allocation in domain_set_llc_colors_from_str() v8: - fixed memo

[PATCH v9 12/13] xen/arm: make consider_modules() available for xen relocation

2024-10-25 Thread Carlo Nonato
2. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato --- v9: - no changes v8: - patch adapted to new changes to consider_modules() v7: - moved consider_modules() to arm/mmu/setup.c v6: - new patch --- xen/arch/arm/arm32/mmu/mm.c

[PATCH v9 10/13] xen/arm: use domain memory to allocate p2m page tables

2024-10-25 Thread Carlo Nonato
also when NUMA will be supported on Arm. Signed-off-by: Carlo Nonato Acked-by: Julien Grall --- v9: - no changes v8: - no changes v7: - no changes v6: - Carlo Nonato as the only signed-off-by v5: - new patch --- xen/arch/arm/mmu/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH v9 01/13] xen/common: add cache coloring common code

2024-10-25 Thread Carlo Nonato
umber of colors that fit in a 4 KiB page when integers are 4 bytes long. LLC colors are a property of the domain, so struct domain has to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v9: - dropped _MAX_

[PATCH v9 06/13] tools: add support for cache coloring configuration

2024-10-25 Thread Carlo Nonato
the color ranges. Documentation is also added. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v9: - turned warning into error in case of coloring not enabled v8: - warn the user in case of coloring not supported at hypervisor level v7:

[PATCH v9 03/13] xen/arm: permit non direct-mapped Dom0 construction

2024-10-25 Thread Carlo Nonato
it in Dom0 construction bring it back to domain_build.c and declare it in domain_build.h. Take the opportunity to adapt the implementation of allocate_memory() so that it uses the host layout when called on the hwdom, via find_unallocated_memory(). Signed-off-by: Carlo Nonato --- v9: - no changes v

[PATCH v9 00/13] Arm cache coloring

2024-10-25 Thread Carlo Nonato
pport the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (12): xen/common: add cache coloring common code xen/arm: add initial support for LLC coloring on arm64 xen/arm: permit non direct-mapped Dom0 construction xen/arm

[PATCH v9 04/13] xen/arm: add Dom0 cache coloring support

2024-10-25 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri Reviewed-by: Jan Beulich --- v9: - moved domain_llc_coloring_free() in next patch cause

[PATCH v9 02/13] xen/arm: add initial support for LLC coloring on arm64

2024-10-25 Thread Carlo Nonato
allocation and cache coloring are incompatible because static memory can't be guaranteed to use only colors assigned to the domain. Panic during DomUs creation when both are enabled. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v9:

Re: [PATCH v8 08/13] xen/page_alloc: introduce preserved page flags macro

2024-05-06 Thread Carlo Nonato
Hi Jan, On Mon, May 6, 2024 at 2:22 PM Jan Beulich wrote: > > On 02.05.2024 18:55, Carlo Nonato wrote: > > --- a/xen/common/page_alloc.c > > +++ b/xen/common/page_alloc.c > > @@ -159,6 +159,7 @@ > > #endif > > > > #define PGC_no_buddy_merge PGC_st

Re: [PATCH v8 04/13] xen/arm: add Dom0 cache coloring support

2024-05-06 Thread Carlo Nonato
Hi Jan, On Mon, May 6, 2024 at 2:01 PM Jan Beulich wrote: > > On 02.05.2024 18:55, Carlo Nonato wrote: > > Add a command line parameter to allow the user to set the coloring > > configuration for Dom0. > > A common configuration syntax for cache colors is introduced and

Re: [PATCH v8 01/13] xen/common: add cache coloring common code

2024-05-06 Thread Carlo Nonato
Hi Jan, On Mon, May 6, 2024 at 1:54 PM Jan Beulich wrote: > > On 02.05.2024 18:55, Carlo Nonato wrote: > > --- a/xen/common/Kconfig > > +++ b/xen/common/Kconfig > > @@ -71,6 +71,9 @@ config HAS_IOPORTS > > config HAS_KEXEC > > bool > > &

[PATCH v8 04/13] xen/arm: add Dom0 cache coloring support

2024-05-02 Thread Carlo Nonato
mapping Dom0 isn't possible when coloring is enabled, so CDF_directmap flag is removed when creating it. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v8: - added bound check on dom0_num_colors - default colors array set just on

[PATCH v8 10/13] xen/arm: use domain memory to allocate p2m page tables

2024-05-02 Thread Carlo Nonato
also when NUMA will be supported on Arm. Signed-off-by: Carlo Nonato Acked-by: Julien Grall --- v8: - no changes v7: - no changes v6: - Carlo Nonato as the only signed-off-by v5: - new patch --- xen/arch/arm/mmu/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen

[PATCH v8 06/13] tools: add support for cache coloring configuration

2024-05-02 Thread Carlo Nonato
the color ranges. Documentation is also added. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v8: - warn the user in case of coloring not supported at hypervisor level v7: - removed unneeded NULL check before xc_hypercall_buffer

[PATCH v8 07/13] xen/arm: add support for cache coloring configuration via device-tree

2024-05-02 Thread Carlo Nonato
Add the "llc-colors" Device Tree attribute to express DomUs and Dom0less color configurations. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v8: - fixed memory leak on error path of domain_set_llc_colors_from_str() - realloc co

  1   2   3   >