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 once v7

[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_b

[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

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

2024-05-02 Thread Carlo Nonato
rm32. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato --- 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 v8 01/13] xen/common: add cache coloring common code

2024-05-02 Thread Carlo Nonato
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 --- v8: - minor documentation fixes - "llc-col

[PATCH v8 00/13] Arm cache coloring

2024-05-02 Thread Carlo Nonato
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: add

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

2024-05-02 Thread Carlo Nonato
function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v8: - requests that uses MEMF_* flags that can't be served are now going to fail - free_color_heap_page() is called directly from free_heap_pages() v7: - requests

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

2024-05-02 Thread Carlo Nonato
emporarily 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 v8 11/13] xen/arm: add Xen cache colors command line parameter

2024-05-02 Thread Carlo Nonato
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 --- v8: - added bound check on xen_colors in llc_coloring_init() v7: - removed XEN_DEFAULT_COLOR - XEN_DEFAULT_NUM_COLORS is now used

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

2024-05-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 --- v8: - patch adap

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

2024-05-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 --- v8

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

2024-05-02 Thread Carlo Nonato
before freeing new pages as this is considered an error and can cause ASSERT violations. Signed-off-by: Carlo Nonato --- v8: - fixed PGC_extra ASSERT fail in alloc_domheap_pages() by removing PGC_extra before freeing v7: - PGC_preserved used also in mark_page_free() v6: - preserved_flags renamed

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

2024-05-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 --- v8: - fixed memory

Re: [PATCH v7 04/14] xen/arm: add Dom0 cache coloring support

2024-03-27 Thread Carlo Nonato
Hi guys, On Fri, Mar 22, 2024 at 8:26 AM Jan Beulich wrote: > > On 21.03.2024 18:31, Carlo Nonato wrote: > > On Thu, Mar 21, 2024 at 4:57 PM Jan Beulich wrote: > >> > >> On 21.03.2024 16:04, Carlo Nonato wrote: > >>> On Tue, Mar 19, 2024 at 4:30 PM Jan

Re: [PATCH v7 08/14] xen/page_alloc: introduce preserved page flags macro

2024-03-27 Thread Carlo Nonato
Hi guys, > Question is: How would you justify such a change? IOW I'm not convinced > (yet) this wants doing there. You mean in this series? > Looking at the code, the flag is originally set in > alloc_domheap_pages(). So I guess it would make sense to do it in > free_domheap_pages(). We don't

Re: [PATCH v7 08/14] xen/page_alloc: introduce preserved page flags macro

2024-03-26 Thread Carlo Nonato
Hi Jan, On Mon, Mar 25, 2024 at 8:19 AM Jan Beulich wrote: > > On 22.03.2024 16:07, Carlo Nonato wrote: > > Hi guys, > > > > On Thu, Mar 21, 2024 at 5:23 PM Jan Beulich wrote: > >> > >> On 21.03.2024 17:10, Julien Grall wrote: > >>> On 21/0

Re: [PATCH v7 06/14] tools: add support for cache coloring configuration

2024-03-25 Thread Carlo Nonato
Hi Anthony, On Mon, Mar 25, 2024 at 11:55 AM Anthony PERARD wrote: > > On Fri, Mar 15, 2024 at 11:58:54AM +0100, Carlo Nonato wrote: > > diff --git a/tools/libs/light/libxl_create.c > > b/tools/libs/light/libxl_create.c > > index 5546335973..79f206f616 100644 &g

Re: [PATCH v7 08/14] xen/page_alloc: introduce preserved page flags macro

2024-03-22 Thread Carlo Nonato
Hi guys, On Thu, Mar 21, 2024 at 5:23 PM Jan Beulich wrote: > > On 21.03.2024 17:10, Julien Grall wrote: > > On 21/03/2024 16:07, Julien Grall wrote: > >> On 15/03/2024 10:58, Carlo Nonato wrote: > >>> PGC_static and PGC_extra needs to be preserved when assigning

Re: [PATCH v7 04/14] xen/arm: add Dom0 cache coloring support

2024-03-21 Thread Carlo Nonato
On Thu, Mar 21, 2024 at 4:57 PM Jan Beulich wrote: > > On 21.03.2024 16:04, Carlo Nonato wrote: > > On Tue, Mar 19, 2024 at 4:30 PM Jan Beulich wrote: > >> On 15.03.2024 11:58, Carlo Nonato wrote: > >>> --- a/docs/misc/xen-command-line.pandoc > >>

Re: [PATCH v7 01/14] xen/common: add cache coloring common code

2024-03-21 Thread Carlo Nonato
Hi Jan, On Thu, Mar 21, 2024 at 4:53 PM Jan Beulich wrote: > > On 21.03.2024 16:03, Carlo Nonato wrote: > > On Tue, Mar 19, 2024 at 3:58 PM Jan Beulich wrote: > >> On 15.03.2024 11:58, Carlo Nonato wrote: > >>> --- a/docs/misc/xen-command-line.pandoc

Re: [PATCH v7 10/14] xen: add cache coloring allocator for domains

2024-03-21 Thread Carlo Nonato
Hi Jan, On Tue, Mar 19, 2024 at 5:43 PM Jan Beulich wrote: > > On 15.03.2024 11:58, Carlo Nonato wrote: > > Add a new memory page allocator that implements the cache coloring > > mechanism. > > The allocation algorithm enforces equal frequency distribution of cache &

Re: [PATCH v7 12/14] xen/arm: add Xen cache colors command line parameter

2024-03-21 Thread Carlo Nonato
Hi Jan On Tue, Mar 19, 2024 at 4:54 PM Jan Beulich wrote: > > On 15.03.2024 11:59, Carlo Nonato wrote: > > From: Luca Miccio > > > > Add a new command line parameter to configure Xen cache colors. > > These colors can be dumped with the cache coloring info debu

Re: [PATCH v7 07/14] xen/arm: add support for cache coloring configuration via device-tree

2024-03-21 Thread Carlo Nonato
Hi Jan, On Tue, Mar 19, 2024 at 4:41 PM Jan Beulich wrote: > > On 15.03.2024 11:58, Carlo Nonato wrote: > > --- a/xen/common/llc-coloring.c > > +++ b/xen/common/llc-coloring.c > > @@ -253,6 +253,37 @@ int domain_set_llc_colors(struct domain *d, > > return

Re: [PATCH v7 05/14] xen: extend domctl interface for cache coloring

2024-03-21 Thread Carlo Nonato
Hi Jan, On Tue, Mar 19, 2024 at 4:37 PM Jan Beulich wrote: > > On 15.03.2024 11:58, Carlo Nonato wrote: > > @@ -219,6 +220,39 @@ void domain_llc_coloring_free(struct domain *d) > > xfree(__va(__pa(d->llc_colors))); > > } > > > > +int

Re: [PATCH v7 04/14] xen/arm: add Dom0 cache coloring support

2024-03-21 Thread Carlo Nonato
Hi Jan, On Tue, Mar 19, 2024 at 4:30 PM Jan Beulich wrote: > > On 15.03.2024 11:58, Carlo Nonato wrote: > > --- a/docs/misc/xen-command-line.pandoc > > +++ b/docs/misc/xen-command-line.pandoc > > @@ -963,6 +963,15 @@ Controls for the dom0 IOMMU setup. > > &

Re: [PATCH v7 01/14] xen/common: add cache coloring common code

2024-03-21 Thread Carlo Nonato
Hi Jan, (adding Andrea Bastoni in cc) On Tue, Mar 19, 2024 at 3:58 PM Jan Beulich wrote: > > On 15.03.2024 11:58, Carlo Nonato wrote: > > +Background > > +** > > + > > +Cache hierarchy of a modern multi-core CPU typically has first levels > > dedi

Re: [PATCH v7 01/14] xen/common: add cache coloring common code

2024-03-15 Thread Carlo Nonato
Hi all, unfortunately, this patch doesn't apply cleanly to the latest master. The conflict is very small: just a reordering of two lines in xen/common/Kconfig. Should I resend the whole series? Thanks. On Fri, Mar 15, 2024 at 11:59 AM Carlo Nonato wrote: > > Last Level Cache (LLC) co

[PATCH v7 12/14] xen/arm: add Xen cache colors command line parameter

2024-03-15 Thread Carlo Nonato
it. The default amount of Xen colors is thus set to one. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v7: - removed XEN_DEFAULT_COLOR - XEN_DEFAULT_NUM_COLORS is now used in a for loop to set xen default colors --- docs/misc/cache-coloring.rst | 2

[PATCH v7 13/14] xen/arm: make consider_modules() available for xen relocation

2024-03-15 Thread Carlo Nonato
rm32. Move it to mmu/setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato --- v7: - moved consider_modules() to arm/mmu/setup.c v6: - new patch --- xen/arch/arm/arm32/mmu/mm.c | 93 +-- xen/arch/arm/include/asm/setup.h | 3 + xe

[PATCH v7 11/14] xen/arm: use domain memory to allocate p2m page tables

2024-03-15 Thread Carlo Nonato
also when NUMA will be supported on Arm. Signed-off-by: Carlo Nonato Acked-by: Julien Grall --- 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/arch/arm/mmu/p2m.c

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

2024-03-15 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 --- v7: - removed alloc_colors() helper usage from domain_set_llc_colors_from_str() v6:

[PATCH v7 08/14] xen/page_alloc: introduce preserved page flags macro

2024-03-15 Thread Carlo Nonato
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 time. To make preserved flags even more meaningful, they are kept also when switching state in mark_page_free(). Signed-off-by: Carlo Nonato --- v7

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

2024-03-15 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 --- v7: - only

[PATCH v7 04/14] xen/arm: add Dom0 cache coloring support

2024-03-15 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 --- v7: - parse_color_config() doesn't accept leading/trailing commas anymore - removed

[PATCH v7 14/14] xen/arm: add cache coloring support for Xen

2024-03-15 Thread Carlo Nonato
emporarily 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 v7 10/14] xen: add cache coloring allocator for domains

2024-03-15 Thread Carlo Nonato
function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v7: - requests to alloc_color_heap_page() now fail if MEMF_bits is used v6: - colored allocator functions are now static v5: - Carlo Nonato as the new author - the colored allocator

[PATCH v7 00/14] Arm cache coloring

2024-03-15 Thread Carlo Nonato
the static-mem feature. The solution has been tested in several scenarios, including Xilinx Zynq MPSoCs. Carlo Nonato (13): 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: add

[PATCH v7 09/14] xen/page_alloc: introduce page flag to stop buddy merging

2024-03-15 Thread Carlo Nonato
Add a new PGC_no_buddy_merge flag that prevents the buddy algorithm in free_heap_pages() from merging pages that have it set. As of now, only PGC_static has this feature, but future work can extend it easier than before. Signed-off-by: Carlo Nonato --- v7: - new patch --- xen/common

[PATCH v7 06/14] tools: add support for cache coloring configuration

2024-03-15 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 --- v7: - removed unneeded NULL check before xc_hypercall_buffer_free() in xc_domain_set_llc_colors() v6: - no edits v5: - added LIBXL_HAVE_BUILDINFO_

[PATCH v7 01/14] xen/common: add cache coloring common code

2024-03-15 Thread Carlo Nonato
to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v7: - SUPPORT.md changes added to this patch - extended documentation to better address applicability of cache coloring - "llc-nr-ways" and "llc-size" params

[PATCH v7 05/14] xen: extend domctl interface for cache coloring

2024-03-15 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 --- v7: - -EOPNOTSUPP

[PATCH v7 03/14] xen/arm: permit non direct-mapped Dom0 construction

2024-03-15 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 --- v7: - allocate_me

Re: [PATCH v2 4/5] xen/arm: Find unallocated spaces for magic pages of direct-mapped domU

2024-03-13 Thread Carlo Nonato
Hi Henry, On Tue, Mar 12, 2024 at 4:25 AM Henry Wang wrote: > > Hi Michal, > > On 3/11/2024 9:46 PM, Michal Orzel wrote: > > Hi Henry, > > > > diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c > > index 1e1c8d83ae..99447bfb0c 100644 > > ---

Re: [PATCH v6 06/15] tools: add support for cache coloring configuration

2024-03-01 Thread Carlo Nonato
Hi Anthony, On Wed, Feb 28, 2024 at 7:05 PM Anthony PERARD wrote: > > On Mon, Jan 29, 2024 at 06:18:02PM +0100, Carlo Nonato wrote: > > diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h > > index 2ef8b4e054..4b541fffd2 100644 > > --- a/tools/include/xenctrl.h

Re: [PATCH v6 02/15] xen/arm: add initial support for LLC coloring on arm64

2024-02-20 Thread Carlo Nonato
Hi Julien On Tue, Feb 20, 2024 at 12:06 AM Julien Grall wrote: > > Hi, > > On 14/02/2024 13:52, Carlo Nonato wrote: > > On Wed, Feb 14, 2024 at 11:14 AM Michal Orzel wrote: > >>> diff --git a/xen/arch/arm/include/asm/processor.h > >>> b/xen/ar

Re: [PATCH v6 14/15] xen/arm: add cache coloring support for Xen

2024-02-14 Thread Carlo Nonato
Hi Jan, On Wed, Feb 14, 2024 at 8:55 AM Jan Beulich wrote: > > On 13.02.2024 18:29, Carlo Nonato wrote: > > On Tue, Feb 13, 2024 at 4:25 PM Jan Beulich wrote: > >> On 29.01.2024 18:18, Carlo Nonato wrote: > >>> @@ -218,9 +230,44 @@ static void xen_pt_enforce_wnx

Re: [PATCH v6 02/15] xen/arm: add initial support for LLC coloring on arm64

2024-02-14 Thread Carlo Nonato
Hi Michal, On Wed, Feb 14, 2024 at 11:14 AM Michal Orzel wrote: > > Hi Carlo, > > On 29/01/2024 18:17, Carlo Nonato wrote: > > > > > > LLC coloring needs to know the last level cache layout in order to make the > > best use of it. This can be probed by inspe

Re: [PATCH v6 14/15] xen/arm: add cache coloring support for Xen

2024-02-13 Thread Carlo Nonato
Hi Jan, On Tue, Feb 13, 2024 at 4:25 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > @@ -218,9 +230,44 @@ static void xen_pt_enforce_wnx(void) > > flush_xen_tlb_local(); > > } > > > > +static void __init create_llc_coloring_mappi

Re: [PATCH v6 05/15] xen: extend domctl interface for cache coloring

2024-02-06 Thread Carlo Nonato
On Tue, Feb 6, 2024 at 12:51 PM Jan Beulich wrote: > > On 06.02.2024 12:46, Carlo Nonato wrote: > > On Thu, Feb 1, 2024 at 2:51 PM Jan Beulich wrote: > >> On 29.01.2024 18:18, Carlo Nonato wrote: > >>> @@ -229,6 +230,30 @@ int __init dom0_set_llc_colors(st

Re: [PATCH v6 05/15] xen: extend domctl interface for cache coloring

2024-02-06 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 2:51 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > @@ -858,6 +859,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) > > u_domctl) > > __HYPERVISOR_domctl, "h", u_domctl); >

Re: [PATCH v6 10/15] xen: add cache coloring allocator for domains

2024-02-05 Thread Carlo Nonato
Hi Jan, On Mon, Feb 5, 2024 at 1:38 PM Jan Beulich wrote: > > On 05.02.2024 12:59, Carlo Nonato wrote: > > On Thu, Feb 1, 2024 at 4:53 PM Jan Beulich wrote: > >> On 29.01.2024 18:18, Carlo Nonato wrote: > >>> @@ -157,7 +158,11 @@ > >>> #define PG

Re: [PATCH v6 10/15] xen: add cache coloring allocator for domains

2024-02-05 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 4:53 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > @@ -157,7 +158,11 @@ > > #define PGC_static 0 > > #endif > > > > -#define PGC_preserved (PGC_extra | PGC_static) > > +#ifndef PGC_colo

Re: [PATCH v6 04/15] xen/arm: add Dom0 cache coloring support

2024-02-05 Thread Carlo Nonato
Hi Jan, On Mon, Feb 5, 2024 at 10:35 AM Jan Beulich wrote: > > On 03.02.2024 12:39, Carlo Nonato wrote: > > On Thu, Feb 1, 2024 at 2:30 PM Jan Beulich wrote: > >> On 29.01.2024 18:18, Carlo Nonato wrote: > >>> --- a/xen/common/llc-coloring.c > >>> +

Re: [PATCH v6 07/15] xen/arm: add support for cache coloring configuration via device-tree

2024-02-03 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 3:19 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > @@ -950,6 +951,11 @@ void __init create_domUs(void) > > #endif > > } > > > > +dt_property_read_st

Re: [PATCH v6 05/15] xen: extend domctl interface for cache coloring

2024-02-03 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 2:51 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > @@ -858,6 +859,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) > > u_domctl) > > __HYPERVISOR_domctl, "h", u_domctl); >

Re: [PATCH v6 04/15] xen/arm: add Dom0 cache coloring support

2024-02-03 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 2:30 PM Jan Beulich wrote: > > On 29.01.2024 18:18, 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 v6 01/15] xen/common: add cache coloring common code

2024-02-03 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 1:18 PM Jan Beulich wrote: > > On 29.01.2024 18:17, Carlo Nonato wrote: > > --- /dev/null > > +++ b/docs/misc/cache-coloring.rst > > @@ -0,0 +1,87 @@ > > +Xen cache coloring user guide > > += > >

Re: [PATCH v6 01/15] xen/common: add cache coloring common code

2024-02-03 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 1:59 PM Jan Beulich wrote: > > On 29.01.2024 18:17, Carlo Nonato wrote: > > --- a/xen/arch/Kconfig > > +++ b/xen/arch/Kconfig > > @@ -31,3 +31,20 @@ config NR_NUMA_NODES > > associated with multiple-nodes man

Re: [PATCH v6 01/15] xen/common: add cache coloring common code

2024-02-03 Thread Carlo Nonato
Hi Jan, On Wed, Jan 31, 2024 at 4:57 PM Jan Beulich wrote: > > On 29.01.2024 18:17, 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 it

Re: [PATCH v6 09/15] xen/page_alloc: introduce preserved page flags macro

2024-02-01 Thread Carlo Nonato
Hi Jan, On Thu, Feb 1, 2024 at 3:24 PM Jan Beulich wrote: > > On 29.01.2024 18:18, Carlo Nonato wrote: > > PGC_static and PGC_extra are flags that needs to be preserved when assigning > > a page. Define a new macro that groups those flags and use it instead of > > or'i

[PATCH v6 13/15] xen/arm: make consider_modules() available for xen relocation

2024-01-29 Thread Carlo Nonato
rm32. Move it back to setup.c and make it non-static so that it can be used outside. Signed-off-by: Carlo Nonato --- v6: - new patch --- xen/arch/arm/arm32/mmu/mm.c | 93 +--- xen/arch/arm/include/asm/setup.h | 3 ++ xen/arch/arm/setup.c

[PATCH v6 00/15] Arm cache coloring

2024-01-29 Thread Carlo Nonato
without too much headache, even if this means that they are using a suboptimal configuration that includes shared colors. - I don't know how to split #14 in smaller patches. I hope also not to have misunderstood any comment there. Carlo Nonato (14): xen/common: add cache coloring common code

[PATCH v6 09/15] xen/page_alloc: introduce preserved page flags macro

2024-01-29 Thread Carlo Nonato
PGC_static and PGC_extra are flags that needs 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 --- v6: - preserved_flags renamed to PGC_preserved - PGC_preserved is used only in assign_pages

[PATCH v6 15/15] support: add cache coloring arm64 experimental feature

2024-01-29 Thread Carlo Nonato
Signed-off-by: Carlo Nonato --- v6: - new patch --- SUPPORT.md | 7 +++ 1 file changed, 7 insertions(+) diff --git a/SUPPORT.md b/SUPPORT.md index a90d1108c9..f94569c862 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -363,6 +363,13 @@ by maintaining multiple physical to machine (p2m) memory

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

2024-01-29 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 --- v6: - rewrote domain_set_llc_colors_from_str() to be more explicit v5: - static-mem

[PATCH v6 05/15] xen: extend domctl interface for cache coloring

2024-01-29 Thread Carlo Nonato
Update the domctl interface to allow the user to set coloring configurations from the toolstack. Implement also the functionality for arm64. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v6: - reverted the XEN_DOMCTL_INTERFACE_VERSION

[PATCH v6 03/15] xen/arm: permit non direct-mapped Dom0 construction

2024-01-29 Thread Carlo Nonato
it in Dom0 construction bring it back to domain_build.c and declare it in domain_build.h. Signed-off-by: Carlo Nonato --- v6: - new patch --- xen/arch/arm/dom0less-build.c | 43 - xen/arch/arm/domain_build.c | 50 +++-- xen/arch/arm/i

[PATCH v6 11/15] xen/arm: use domain memory to allocate p2m page tables

2024-01-29 Thread Carlo Nonato
also when NUMA will be supported on Arm. Signed-off-by: Carlo Nonato Acked-by: Julien Grall --- 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/arch/arm/mmu/p2m.c b/xen/arch/arm

[PATCH v6 14/15] xen/arm: add cache coloring support for Xen

2024-01-29 Thread Carlo Nonato
emporarily 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 v6 10/15] xen: add cache coloring allocator for domains

2024-01-29 Thread Carlo Nonato
function. Based on original work from: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v6: - colored allocator functions are now static v5: - Carlo Nonato as the new author - the colored allocator balances color usage for each domain and it searches linearly only

[PATCH v6 12/15] xen/arm: add Xen cache colors command line parameter

2024-01-29 Thread Carlo Nonato
it. The default amount of Xen colors is thus set to one. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- docs/misc/xen-command-line.pandoc | 10 ++ xen/common/llc-coloring.c | 26 ++ 2 files changed, 36 insertions

[PATCH v6 08/15] xen/page_alloc: introduce init_free_page_fields() helper

2024-01-29 Thread Carlo Nonato
Introduce a new helper to initialize fields that have different uses for free pages. Signed-off-by: Carlo Nonato --- v6: - Carlo Nonato as the only signed-off-by v5: - new patch --- xen/common/page_alloc.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xen

[PATCH v6 06/15] tools: add support for cache coloring configuration

2024-01-29 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 --- v6: - no edits v5: - added LIBXL_HAVE_BUILDINFO_LLC_COLORS - moved color configuration in xc_domain_set_llc_colors() cause of the new hypercall v4:

[PATCH v6 01/15] xen/common: add cache coloring common code

2024-01-29 Thread Carlo Nonato
to be extended. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v6: - moved almost all code in common - moved documentation in this patch - reintroduced range for CONFIG_NR_LLC_COLORS - reintroduced some stub functions to reduce the number

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

2024-01-29 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 --- v6

[PATCH v6 04/15] xen/arm: add Dom0 cache coloring support

2024-01-29 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 --- v6: - moved domain_llc_coloring_free() in this patch - removed domain_alloc_colors() in favor

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

2024-01-18 Thread Carlo Nonato
Hi Jan, On Tue, Jan 9, 2024 at 11:33 AM Jan Beulich wrote: > > On 09.01.2024 11:28, Jan Beulich wrote: > > On 02.01.2024 10:51, Carlo Nonato wrote: > >> v5: > >> - Carlo Nonato as the new author > >> - the colored allocator balances color usag

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

2024-01-17 Thread Carlo Nonato
Hi Julien, On Tue, Jan 16, 2024 at 12:59 PM Julien Grall wrote: > > Hi, > > On 15/01/2024 16:16, Julien Grall wrote: > > On 15/01/2024 15:43, Carlo Nonato wrote: > >> Hi Julien, > > > > Hi Carlo, > > > >> On Mon, Jan 15, 2024 at 12:18 PM

Re: [PATCH v1 repost 4/4] [DO NOT COMMIT] xen/arm: Create a trampoline for secondary boot CPUs

2024-01-17 Thread Carlo Nonato
Hi Julien On Tue, Jan 16, 2024 at 3:37 PM Julien Grall wrote: > > From: Julien Grall > > In order to confirm the early boot code is self-contained, allocate a > separate trampoline region for secondary to boot from it. > > Signed-off-by: Julien Grall > --- > xen/arch/arm/arm64/mmu/mm.c | 7

Re: [PATCH 3/3] [DO NOT COMMIT] xen/arm: Create a trampoline for secondary boot CPUs

2024-01-16 Thread Carlo Nonato
Hi Julien, On Tue, Jan 16, 2024 at 12:55 PM Julien Grall wrote: > > From: Julien Grall > > In order to confirm the early boot code is self-contained, allocate a > separate trampoline region for secondary to boot from it. > > Signed-off-by: Julien Grall > --- > xen/arch/arm/arm64/mmu/mm.c | 7

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

2024-01-16 Thread Carlo Nonato
Hi Julien, On Mon, Jan 15, 2024 at 5:16 PM Julien Grall wrote: > On 15/01/2024 15:43, Carlo Nonato wrote: > > Hi Julien, > > Hi Carlo, > > > On Mon, Jan 15, 2024 at 12:18 PM Julien Grall wrote: > >> On 15/01/2024 10:11, Carlo Nonato wrote: > >&g

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

2024-01-15 Thread Carlo Nonato
Hi Julien, On Mon, Jan 15, 2024 at 12:18 PM Julien Grall wrote: > On 15/01/2024 10:11, Carlo Nonato wrote: > > Hi Julien, > > Hi Carlo, > > > On Sun, Jan 14, 2024 at 8:22 PM Julien Grall wrote: > >> > >> Hi Carlo, > >> > >> On 13/01/2

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

2024-01-15 Thread Carlo Nonato
Hi Jan, On Tue, Jan 9, 2024 at 11:28 AM Jan Beulich wrote: > > On 02.01.2024 10:51, Carlo Nonato wrote: > > This commit adds a new memory page allocator that implements the cache > > coloring mechanism. The allocation algorithm enforces equal frequency > > distribu

Re: [PATCH v5 02/13] xen/arm: add cache coloring initialization

2024-01-15 Thread Carlo Nonato
Hi Julien, On Thu, Jan 11, 2024 at 11:44 AM Julien Grall wrote: > On 11/01/2024 10:17, Carlo Nonato wrote: > > Hi Julien, > > Hi Carlo, > > >>>> +bool __init llc_coloring_init(void) > >>>> +{ > >>>&g

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

2024-01-15 Thread Carlo Nonato
Hi Julien, On Sun, Jan 14, 2024 at 8:22 PM Julien Grall wrote: > > Hi Carlo, > > On 13/01/2024 17:07, Carlo Nonato wrote: > >>> diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c > >>> index 37b6d230ad..66b674eeab 100644 > >>> --- a/x

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

2024-01-13 Thread Carlo Nonato
Hi Julien, On Fri, Jan 5, 2024 at 8:12 PM Julien Grall wrote: > > Hi Carlo, > > On 02/01/2024 09:51, Carlo Nonato wrote: > > This commit adds the cache coloring support for Xen own physical space. > > > > It extends the implementation of setup_pagetables() to make

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

2024-01-12 Thread Carlo Nonato
Hi Jan, On Mon, Jan 8, 2024 at 6:08 PM Jan Beulich wrote: > > On 02.01.2024 10:51, Carlo Nonato wrote: > > PGC_static and PGC_extra are flags that needs to be preserved when assigning > > a page. Define a new macro that groups those flags and use it instead of >

Re: [PATCH v5 07/13] xen/page_alloc: introduce init_free_page_fields() helper

2024-01-12 Thread Carlo Nonato
Hi Jan, On Tue, Jan 9, 2024 at 11:36 AM Jan Beulich wrote: > > On 02.01.2024 10:51, Carlo Nonato wrote: > > Introduce a new helper to initialize fields that have different uses for > > free pages. > > > > Signed-off-by: Carlo Nonato > > Signed-off-by: Marco S

Re: [PATCH v5 02/13] xen/arm: add cache coloring initialization

2024-01-11 Thread Carlo Nonato
Hi Julien, > > > +bool __init llc_coloring_init(void) > > > +{ > > > +if ( !llc_way_size && !(llc_way_size = get_llc_way_size()) ) > > > +{ > > > +printk(XENLOG_ERR > > > + "Probed LLC way size is 0 and no custom value > > > provided\n"); > > > +return

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

2024-01-11 Thread Carlo Nonato
Hi Jan, On Mon, Jan 8, 2024 at 5:53 PM Jan Beulich wrote: > > On 02.01.2024 10:51, Carlo Nonato wrote: > > This commit adds the Last Level Cache (LLC) coloring common header, Kconfig > > options and functions. Since this is an arch specific feature, actual > > imp

Re: [PATCH v5 04/13] xen: extend domctl interface for cache coloring

2024-01-08 Thread Carlo Nonato
Hi Jan, On Mon, Jan 8, 2024 at 5:40 PM Jan Beulich wrote: > > On 08.01.2024 17:31, Carlo Nonato wrote: > > On Mon, Jan 8, 2024 at 4:32 PM Julien Grall wrote: > >> On 08/01/2024 15:18, Carlo Nonato wrote: > >>>> No. I am saying that that we should not be able

Re: [PATCH v5 04/13] xen: extend domctl interface for cache coloring

2024-01-08 Thread Carlo Nonato
Hi Julien, On Mon, Jan 8, 2024 at 4:32 PM Julien Grall wrote: > > Hi, > > On 08/01/2024 15:18, Carlo Nonato wrote: > >> No. I am saying that that we should not be able to allow changing the > >> colors after the memory has been allocated. To give an example, your

Re: [PATCH v5 04/13] xen: extend domctl interface for cache coloring

2024-01-08 Thread Carlo Nonato
Hi Julien On Mon, Jan 8, 2024 at 12:36 PM Julien Grall wrote: > > Hi Carlo, > > On 08/01/2024 11:19, Carlo Nonato wrote: > > Hi Julien, > > > > On Mon, Jan 8, 2024 at 12:01 PM Julien Grall wrote: > >> > >> Hi Carlo, > >> > >>

Re: [PATCH v5 03/13] xen/arm: add Dom0 cache coloring support

2024-01-08 Thread Carlo Nonato
On Mon, Jan 8, 2024 at 12:44 PM Julien Grall wrote: > > > > On 08/01/2024 11:04, Carlo Nonato wrote: > > Hi Julien, > > > > On Mon, Jan 8, 2024 at 11:25 AM Julien Grall wrote: > >> > >> Hi Carlo, > >> > >> On 08/01/20

Re: [PATCH v5 11/13] Revert "xen/arm: Remove unused BOOT_RELOC_VIRT_START"

2024-01-08 Thread Carlo Nonato
Hi Julien, On Fri, Jan 5, 2024 at 7:20 PM Julien Grall wrote: > > Hi Carlo, > > On 02/01/2024 09:51, Carlo Nonato wrote: > > This reverts commit 0c18fb76323bfb13615b6f13c98767face2d8097 (not clean). > > > > This is not a clean revert since t

Re: [PATCH v5 06/13] xen/arm: add support for cache coloring configuration via device-tree

2024-01-08 Thread Carlo Nonato
Hi Julien, On Fri, Jan 5, 2024 at 6:38 PM Julien Grall wrote: > > Hi Carlo, > > On 02/01/2024 09:51, Carlo Nonato wrote: > > This commit adds the "llc-colors" Device Tree attribute that can be used > > for DomUs and Dom0less color configurations. The syntax is

  1   2   >