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

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

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

[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

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

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

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

[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

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

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

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

[PATCH 03/12] xen/arm: dump cache colors in domain info debug-key

2022-08-26 Thread Carlo Nonato
This commit adds cache colors to the information dumped with the domain info debug-key. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- xen/arch/arm/coloring.c | 16 xen/arch/arm/domain.c | 3 +++ xen/arch/arm/include/asm/coloring.h | 1

[PATCH 07/12] xen/common: add colored heap info debug-key

2022-08-26 Thread Carlo Nonato
This commit adds a debug-key to let the user inspect the colored heap information. The number of pages stored for each available color is dumped. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- xen/common/page_alloc.c | 24 1 file changed, 24 insertions

[PATCH 01/12] xen/arm: add cache coloring initialization

2022-08-26 Thread Carlo Nonato
colors from physical addresses. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc/arm/cache-coloring.rst | 112 ++ docs/misc/xen-command-line.pandoc| 22 +++ xen/arch/arm/Kconfig | 16 ++ xen/arch/arm/Makefile| 1

[PATCH 10/12] Revert "xen/arm: Remove unused BOOT_RELOC_VIRT_START"

2022-08-26 Thread Carlo Nonato
This reverts commit 0c18fb76323bfb13615b6f13c98767face2d8097. Cache coloring support for Xen needs to relocate Xen code and data in a new colored physical space. The BOOT_RELOC_VIRT_START will be used as the virtual base address for a temporary mapping to this new space. --- xen/arch/arm/include/

[PATCH 00/12] Arm cache coloring

2022-08-26 Thread Carlo Nonato
an RFC to address a problem with the switch_ttbr function. For the moment I haven't considered it since it's still a work in progress. Acknowledgements This work is sponsored by Xilinx Inc., and supported by University of Modena and Reggio Emilia and Minerva Systems.

[PATCH 02/12] xen/arm: add cache coloring initialization for domains

2022-08-26 Thread Carlo Nonato
not be created with the directmap flag. The latter instead frees allocated memory. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc/arm/cache-coloring.rst| 7 ++-- xen/arch/arm/coloring.c | 56 + xen/arch/arm/domain.c

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

2022-08-26 Thread Carlo Nonato
This commit adds the "colors" Device Tree attribute that can be used for DomUs and Dom0less color configurations. The syntax is the same used for every color config. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc/arm/cache-coloring.rst

[PATCH 08/12] Revert "xen/arm: setup: Add Xen as boot module before printing all boot modules"

2022-08-26 Thread Carlo Nonato
initialization. This commit moves the Xen boot module after the coloring initialization to allow the order of operations previously described to take place. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- xen/arch/arm/setup.c | 12 ++-- 1 file changed, 6 insertions(+), 6

[PATCH 04/12] tools/xl: add support for cache coloring configuration

2022-08-26 Thread Carlo Nonato
nges. Also documentation is added. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/man/xl.cfg.5.pod.in | 10 ++ tools/libs/light/libxl_create.c | 12 tools/libs/light/libxl_types.idl | 1 + tools/xl/xl_parse.c | 52 +

[PATCH 09/12] Revert "xen/arm: mm: Initialize page-tables earlier"

2022-08-26 Thread Carlo Nonato
mapping for it that could be configured using some command line options. In order to parse all the needed information from the device tree, we need to revert the above commit and restore the previous order for page-tables initialization. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri

[PATCH 06/12] xen/common: add cache coloring allocator for domains

2022-08-26 Thread Carlo Nonato
ng is enabled, this memory isn't managed by the colored allocator. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc/arm/cache-coloring.rst| 43 +- docs/misc/xen-command-line.pandoc | 14 ++ xen/arch/arm/Kconfig| 12 ++ xen/arch/arm/

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

2022-08-26 Thread Carlo Nonato
ff-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc/arm/cache-coloring.rst | 8 docs/misc/xen-command-line.pandoc | 9 + xen/arch/arm/coloring.c | 30 ++ 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/docs/mis

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

2022-08-26 Thread Carlo Nonato
vmap, with the exception that it doesn't take for granted that the physical memory is contiguous. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- xen/arch/arm/alternative.c | 5 ++ xen/arch/arm/coloring.c | 16 xen/arch/arm/include/asm/coloring.h

Re: [PATCH 07/12] xen/common: add colored heap info debug-key

2022-08-26 Thread Carlo Nonato
On Fri, Aug 26, 2022 at 4:13 PM Jan Beulich wrote: > On 26.08.2022 14:51, Carlo Nonato wrote: > > --- a/xen/common/page_alloc.c > > +++ b/xen/common/page_alloc.c > > @@ -605,6 +605,27 @@ static struct page_info > *alloc_col_domheap_page(struct domai

Re: [PATCH 00/12] Arm cache coloring

2022-09-12 Thread Carlo Nonato
Hi Julien, On Sat, Sep 10, 2022 at 5:12 PM Julien Grall wrote: > > Hi Carlo, > > On 26/08/2022 13:50, Carlo Nonato wrote: > > Shared caches in multi-core CPU architectures represent a problem for > > predictability of memory access latency. This jeopardizes applicability

Re: [PATCH 08/12] Revert "xen/arm: setup: Add Xen as boot module before printing all boot modules"

2022-09-12 Thread Carlo Nonato
Hi Julien, On Sat, Sep 10, 2022 at 4:01 PM Julien Grall wrote: > > Hi, > > On 26/08/2022 13:51, Carlo Nonato wrote: > > From: Luca Miccio > > > > This reverts commit 48fb2a9deba11ee48dde21c5c1aa93b4d4e1043b. > > > > The cache coloring support has

Re: [PATCH 09/12] Revert "xen/arm: mm: Initialize page-tables earlier"

2022-09-12 Thread Carlo Nonato
Hi Julien, On Sat, Sep 10, 2022 at 4:29 PM Julien Grall wrote: > > Hi Carlo, > > On 26/08/2022 13:51, Carlo Nonato wrote: > > From: Luca Miccio > > > > This reverts commit 3a5d341681af650825bbe3bee9be5d187da35080. > > Usually, this indicates that this w

Re: [PATCH 06/12] xen/common: add cache coloring allocator for domains

2022-09-16 Thread Carlo Nonato
Hi Jan, On Thu, Sep 15, 2022 at 3:13 PM Jan Beulich wrote: > > On 26.08.2022 14:51, Carlo Nonato wrote: > > This commit adds a new memory page allocator that implements the cache > > coloring mechanism. The allocation algorithm follows the given color > > configu

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

2022-09-16 Thread Carlo Nonato
Hi Jan, On Thu, Sep 15, 2022 at 3:25 PM Jan Beulich wrote: > > On 26.08.2022 14:51, Carlo Nonato wrote: > > --- a/xen/common/vmap.c > > +++ b/xen/common/vmap.c > > @@ -8,6 +8,9 @@ > > #include > > #include > > #include > > +#ifdef CONFIG_CA

[PATCH v4 00/11] Arm cache coloring

2023-01-23 Thread Carlo Nonato
o remove ambiguity with too generic "colors". "llc" is also shorter than "cache" - reordered again patches since code is now splitted in common + arch Carlo Nonato (8): xen/common: add cache coloring common code xen/arm: add cache coloring initialization xen: ex

[PATCH v4 03/11] xen/arm: add Dom0 cache coloring support

2023-01-23 Thread Carlo Nonato
ation syntax for cache colors. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v4: - dom0 colors are dynamically allocated as for any other domain (colors are duplicated in dom0_colors and in the new array, but logic is simpler) --- docs/misc/arm/

[PATCH v4 06/11] xen/arm: add support for cache coloring configuration via device-tree

2023-01-23 Thread Carlo Nonato
This commit adds the "llc-colors" Device Tree attribute that can be used for DomUs and Dom0less color configurations. The syntax is the same used for every color config. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- docs/misc

[PATCH v4 05/11] tools: add support for cache coloring configuration

2023-01-23 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 --- v4: - removed overlapping color ranges checks during parsing - moved hypercall buffer initialization in libxenctrl --- docs/man/xl.cfg.5.pod.in

[PATCH v4 02/11] xen/arm: add cache coloring initialization

2023-01-23 Thread Carlo Nonato
this patch, there are no implemented methods for actually configuring cache colors for domains and all the configurations fall back to the default one. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v4: - added "llc-coloring&quo

[PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-23 Thread Carlo Nonato
This commit updates the domctl interface to allow the user to set cache coloring configurations from the toolstack. It also implements the functionality for arm64. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v4: - updated

[PATCH v4 09/11] Revert "xen/arm: Remove unused BOOT_RELOC_VIRT_START"

2023-01-23 Thread Carlo Nonato
Xen needs to relocate Xen code and data in a new colored physical space. The BOOT_RELOC_VIRT_START will be used as the virtual base address for a temporary mapping to this new space. Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- xen/arch/arm/include/asm/config.h | 4 +++- xen/arch

[PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-23 Thread Carlo Nonato
Miccio Signed-off-by: Carlo Nonato Signed-off-by: Marco Solieri --- v4: - Kconfig options moved to xen/arch - removed range for CONFIG_NR_LLC_COLORS - added "llc_coloring_enabled" global to later implement the boot-time switch - added domain_create_llc_colored() to be able to p

[PATCH v4 08/11] xen/arm: use colored allocator for p2m page tables

2023-01-23 Thread Carlo Nonato
: Carlo Nonato Signed-off-by: Marco Solieri --- v4: - fixed p2m page allocation using MEMF_no_owner memflag --- xen/arch/arm/p2m.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 948f199d84..f9faeb61af 100644 --- a/xen/arch

[PATCH v4 07/11] xen: add cache coloring allocator for domains

2023-01-23 Thread Carlo Nonato
s enabled, this memory isn't managed by the colored allocator. Colored heap information is dumped in the dump_heap() debug-key function. Signed-off-by: Luca Miccio Signed-off-by: Marco Solieri Signed-off-by: Carlo Nonato --- v4: - moved colored allocator code after buddy allocator becau

[PATCH v4 10/11] xen/arm: add Xen cache colors command line parameter

2023-01-23 Thread Carlo Nonato
et 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/arch/arm/llc_coloring.c | 30 ++ 2 files changed, 40 insertions(+) diff --git a/docs/misc/xen-co

[PATCH v4 11/11] xen/arm: add cache coloring support for Xen

2023-01-23 Thread Carlo Nonato
pagetables()). 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. Based on original work from: Luca Miccio Signed-off-by: Carlo Nonato Signed-off-by: Mar

Re: [PATCH v4 00/11] Arm cache coloring

2023-01-23 Thread Carlo Nonato
Hi Jan, On Mon, Jan 23, 2023 at 4:52 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > Shared caches in multi-core CPU architectures represent a problem for > > predictability of memory access latency. This jeopardizes applicability > > of many A

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-25 Thread Carlo Nonato
Hi Jan, Julien On Tue, Jan 24, 2023 at 5:37 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > @@ -769,6 +776,13 @@ struct domain *domain_create(domid_t domid, > > return ERR_PTR(err); > > } > > > > +struct

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-25 Thread Carlo Nonato
On Wed, Jan 25, 2023 at 2:10 PM Jan Beulich wrote: > > On 25.01.2023 12:18, Carlo Nonato wrote: > > On Tue, Jan 24, 2023 at 5:37 PM Jan Beulich wrote: > >> On 23.01.2023 16:47, Carlo Nonato wrote: > >>> --- /dev/null > >>> +++ b/xen/i

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-25 Thread Carlo Nonato
Hi Jan, On Tue, Jan 24, 2023 at 5:29 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > @@ -275,6 +276,19 @@ unsigned int *dom0_llc_colors(unsigned int *num_colors) > > return colors; > > } > > > > +unsigned int *llc_colors_from_

Re: [PATCH v4 07/11] xen: add cache coloring allocator for domains

2023-01-26 Thread Carlo Nonato
Hi Jan, On Tue, Jan 24, 2023 at 5:50 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > From: Luca Miccio > > > > This commit adds a new memory page allocator that implements the cache > > coloring mechanism. The allocation algorithm

Re: [PATCH v4 08/11] xen/arm: use colored allocator for p2m page tables

2023-01-26 Thread Carlo Nonato
Hi Julien, On Thu, Jan 26, 2023 at 11:25 AM Julien Grall wrote: > > Hi Carlo, > > On 23/01/2023 15:47, Carlo Nonato wrote: > > Cache colored domains can benefit from having p2m page tables allocated > > with the same coloring schema so that isolation can be achieved al

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-26 Thread Carlo Nonato
Hi Julien and Jan, On Thu, Jan 26, 2023 at 11:16 AM Julien Grall wrote: > > Hi Jan, > > On 26/01/2023 08:06, Jan Beulich wrote: > > On 25.01.2023 17:18, Carlo Nonato wrote: > >> On Wed, Jan 25, 2023 at 2:10 PM Jan Beulich wrote: > >>> On 25.01.2023 12:18,

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-26 Thread Carlo Nonato
Hi Jan, On Thu, Jan 26, 2023 at 8:25 AM Jan Beulich wrote: > > On 24.01.2023 17:29, Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > >> @@ -92,6 +92,10 @@ struct xen_domctl_createdomain { > >> /* CPU pool to use; specify 0 or a specific exist

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-26 Thread Carlo Nonato
Hi Julien and Jan, On Thu, Jan 26, 2023 at 11:21 AM Julien Grall wrote: > > Hi, > > On 25/01/2023 16:27, Carlo Nonato wrote: > > On Tue, Jan 24, 2023 at 5:29 PM Jan Beulich wrote: > >> > >> On 23.01.2023 16:47, Carlo Nonato wrote: > >>> @@

Re: [PATCH v4 05/11] tools: add support for cache coloring configuration

2023-01-26 Thread Carlo Nonato
Hi Anthony, On Thu, Jan 26, 2023 at 3:22 PM Anthony PERARD wrote: > > On Mon, Jan 23, 2023 at 04:47:29PM +0100, Carlo Nonato wrote: > > diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c > > index e939d07157..064f54c349 100644 > > --- a/tools/libs/ct

Re: [PATCH v4 07/11] xen: add cache coloring allocator for domains

2023-01-27 Thread Carlo Nonato
Hi Jan, On Thu, Jan 26, 2023 at 5:29 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > --- a/docs/misc/xen-command-line.pandoc > > +++ b/docs/misc/xen-command-line.pandoc > > @@ -299,6 +299,20 @@ can be maintained with the pv-shim mechanism. >

Re: [PATCH v3 2/9] xen/arm: add cache coloring initialization for domains

2022-11-21 Thread Carlo Nonato
alue passing. See below for more comments. I know that these two questions are very specific so let me know if something is unclear. On Sat, Oct 22, 2022 at 5:51 PM Carlo Nonato wrote: > > This commit adds array pointers to domains as well as to the hypercall > and configuration structur

Re: [PATCH v3 2/9] xen/arm: add cache coloring initialization for domains

2022-11-21 Thread Carlo Nonato
On Mon, Nov 21, 2022 at 4:14 PM Jan Beulich wrote: > > On 21.11.2022 15:50, Carlo Nonato wrote: > > Hi x86 devs, > > Any reason you didn't include Roger? Nope. Sorry, forgot to add him. > > I want to ask you some questions about this patch because in the previous &

Re: [PATCH v3 4/9] tools/xl: add support for cache coloring configuration

2022-12-22 Thread Carlo Nonato
Hi Anthony, On Thu, Nov 24, 2022 at 4:21 PM Anthony PERARD wrote: > > On Sat, Oct 22, 2022 at 05:51:15PM +0200, Carlo Nonato wrote: > > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > > index b2901e04cf..5f53cec8bf 100644 > > --- a/docs/man/xl.cfg.5.p

Re: [RFC PATCH] xen/common: cache colored buddy allocator for domains

2022-12-22 Thread Carlo Nonato
Hi Jan On Wed, Dec 7, 2022 at 12:52 PM Jan Beulich wrote: > > On 22.10.2022 18:08, Carlo Nonato wrote: > > This commit replaces the colored allocator for domains with a simple buddy > > allocator indexed also by colors, so that it can allocate pages based on > > som

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

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

2024-05-02 Thread Carlo Nonato
extra 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 renam

[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 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 11/13] xen/arm: add Xen cache colors command line parameter

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

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

2024-05-02 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 v8 09/13] xen: add cache coloring allocator for domains

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

[PATCH v8 00/13] Arm cache coloring

2024-05-02 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 v8 01/13] xen/common: add cache coloring common code

2024-05-02 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 --- v8: - minor documentation fixes - "ll

[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
2. 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 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 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

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 > > &

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 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 04/36] xen/arm: add parsing function for cache coloring configuration

2022-05-13 Thread Carlo Nonato
ere to have coloring since there are locking primitives that provides sufficient isolation and so the problem is not common. On x86 instead, the functions that map memory into caches are not so easy to exploit to achieve isolation. Thanks. - Carlo Nonato

  1   2   3   >