All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Michal Orzel <michal.orzel@amd.com>
Cc: Carlo Nonato <carlo.nonato@minervasys.tech>,
	 xen-devel@lists.xenproject.org,
	Luca Miccio <lucmiccio@gmail.com>,
	 Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	 Bertrand Marquis <bertrand.marquis@arm.com>,
	 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	 Marco Solieri <marco.solieri@minervasys.tech>
Subject: Re: [PATCH v4 03/11] xen/arm: add Dom0 cache coloring support
Date: Wed, 17 Jan 2024 16:23:40 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2401171617320.2287888@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <a7a06a26-ae79-402c-96a4-a1ebfe8b5862@amd.com>

On Fri, 12 Jan 2024, Michal Orzel wrote:
> Hi Carlo,
> 
> On 23/01/2023 16:47, Carlo Nonato wrote:
> > 
> > 
> > From: Luca Miccio <lucmiccio@gmail.com>
> > 
> > This commit allows the user to set the cache coloring configuration for
> > Dom0 via a command line parameter.
> > Since cache coloring and static memory are incompatible, direct mapping
> > Dom0 isn't possible when coloring is enabled.
> > 
> > Here is also introduced a common configuration syntax for cache colors.
> > 
> > Signed-off-by: Luca Miccio <lucmiccio@gmail.com>
> > Signed-off-by: Marco Solieri <marco.solieri@minervasys.tech>
> > Signed-off-by: Carlo Nonato <carlo.nonato@minervasys.tech>
> > ---
> > 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/cache-coloring.rst        | 32 ++++++++++++++++++++++---
> >  xen/arch/arm/domain_build.c             | 17 +++++++++++--
> >  xen/arch/arm/include/asm/llc_coloring.h |  4 ++++
> >  xen/arch/arm/llc_coloring.c             | 14 +++++++++++
> >  4 files changed, 62 insertions(+), 5 deletions(-)
> > 
> > diff --git a/docs/misc/arm/cache-coloring.rst b/docs/misc/arm/cache-coloring.rst
> > index 0244d2f606..c2e0e87426 100644
> > --- a/docs/misc/arm/cache-coloring.rst
> > +++ b/docs/misc/arm/cache-coloring.rst
> > @@ -83,12 +83,38 @@ manually set the way size it's left for the user to overcome failing situations
> >  or for debugging/testing purposes. See `Coloring parameters and domain
> >  configurations`_ section for more information on that.
> > 
> > +Colors selection format
> > +***********************
> > +
> > +Regardless of the memory pool that has to be colored (Xen, Dom0/DomUs),
> > +the color selection can be expressed using the same syntax. In particular a
> > +comma-separated list of colors or ranges of colors is used.
> > +Ranges are hyphen-separated intervals (such as `0-4`) and are inclusive on both
> > +sides.
> > +
> > +Note that:
> > + - no spaces are allowed between values.
> > + - no overlapping ranges or duplicated colors are allowed.
> > + - values must be written in ascending order.
> > +
> > +Examples:
> > +
> > ++---------------------+-----------------------------------+
> > +|**Configuration**    |**Actual selection**               |
> > ++---------------------+-----------------------------------+
> > +|  1-2,5-8            | [1, 2, 5, 6, 7, 8]                |
> > ++---------------------+-----------------------------------+
> > +|  4-8,10,11,12       | [4, 5, 6, 7, 8, 10, 11, 12]       |
> > ++---------------------+-----------------------------------+
> > +|  0                  | [0]                               |
> > ++---------------------+-----------------------------------+
> > +
> >  Coloring parameters and domain configurations
> >  *********************************************
> > 
> > -LLC way size (as previously discussed) can be set using the appropriate command
> > -line parameter. See the relevant documentation in
> > -"docs/misc/xen-command-line.pandoc".
> > +LLC way size (as previously discussed) and Dom0 colors can be set using the
> > +appropriate command line parameters. See the relevant documentation
> > +in "docs/misc/xen-command-line.pandoc".
> > 
> >  **Note:** If no color configuration is provided for a domain, the default one,
> >  which corresponds to all available colors, is used instead.
> > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> > index f35f4d2456..093d4ad6f6 100644
> > --- a/xen/arch/arm/domain_build.c
> > +++ b/xen/arch/arm/domain_build.c
> > @@ -2,6 +2,7 @@
> >  #include <xen/init.h>
> >  #include <xen/compile.h>
> >  #include <xen/lib.h>
> > +#include <xen/llc_coloring.h>
> >  #include <xen/mm.h>
> >  #include <xen/param.h>
> >  #include <xen/domain_page.h>
> > @@ -4014,7 +4015,10 @@ static int __init construct_dom0(struct domain *d)
> >      /* type must be set before allocate_memory */
> >      d->arch.type = kinfo.type;
> >  #endif
> > -    allocate_memory_11(d, &kinfo);
> > +    if ( is_domain_llc_colored(d) )
> > +        allocate_memory(d, &kinfo);
> While doing some checks, I realized that the issue from previous series is still present.
> Given that dom0 is hwdom, how are you going to prevent conflicts between allocated RAM and HW resources
> that are to be mapped to dom0?

Are you referring to the address ranges picked for RAM region and how to
make sure they don't conflict with something else (e.g. the MMIO region
of a device)?

I thought that for dom0 we were reusing the same address layout of the
host, so device MMIO would be mapped 1:1, memory would not be mapped 1:1
(due to cache coloring) but it would be mapped to the same guest address
ranges corresponding to RAM addresses on the host. Is it not the case in
this version of the patch series?


  parent reply	other threads:[~2024-01-18  0:24 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 15:47 [PATCH v4 00/11] Arm cache coloring Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 01/11] xen/common: add cache coloring common code Carlo Nonato
2023-01-24 16:37   ` Jan Beulich
2023-01-25 11:18     ` Carlo Nonato
2023-01-25 13:10       ` Jan Beulich
2023-01-25 16:18         ` Carlo Nonato
2023-01-26  8:06           ` Jan Beulich
2023-01-26 10:15             ` Julien Grall
2023-01-26 11:03               ` Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 02/11] xen/arm: add cache coloring initialization Carlo Nonato
2023-01-24 16:20   ` Jan Beulich
2023-01-23 15:47 ` [PATCH v4 03/11] xen/arm: add Dom0 cache coloring support Carlo Nonato
2024-01-12  9:24   ` Michal Orzel
2024-01-12 10:39     ` Michal Orzel
2024-01-18  0:23     ` Stefano Stabellini [this message]
2024-01-18  7:40       ` Michal Orzel
2023-01-23 15:47 ` [PATCH v4 04/11] xen: extend domctl interface for cache coloring Carlo Nonato
2023-01-24 16:29   ` Jan Beulich
2023-01-25 16:27     ` Carlo Nonato
2023-01-26 10:20       ` Julien Grall
2023-01-26 11:19         ` Carlo Nonato
2023-01-26  7:25     ` Jan Beulich
2023-01-26 11:18       ` Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 05/11] tools: add support for cache coloring configuration Carlo Nonato
2023-01-26 14:22   ` Anthony PERARD
2023-01-26 16:34     ` Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 06/11] xen/arm: add support for cache coloring configuration via device-tree Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 07/11] xen: add cache coloring allocator for domains Carlo Nonato
2023-01-24 16:50   ` Jan Beulich
2023-01-26 11:00     ` Carlo Nonato
2023-01-26 12:37       ` Jan Beulich
2023-01-24 16:58   ` Jan Beulich
2023-01-26 16:29   ` Jan Beulich
2023-01-27 10:17     ` Carlo Nonato
2023-01-27 13:31       ` Jan Beulich
2023-01-23 15:47 ` [PATCH v4 08/11] xen/arm: use colored allocator for p2m page tables Carlo Nonato
2023-01-26 10:25   ` Julien Grall
2023-01-26 11:02     ` Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 09/11] Revert "xen/arm: Remove unused BOOT_RELOC_VIRT_START" Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 10/11] xen/arm: add Xen cache colors command line parameter Carlo Nonato
2023-01-23 15:47 ` [PATCH v4 11/11] xen/arm: add cache coloring support for Xen Carlo Nonato
2023-01-23 15:52 ` [PATCH v4 00/11] Arm cache coloring Jan Beulich
2023-01-23 16:17   ` Carlo Nonato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2401171617320.2287888@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=carlo.nonato@minervasys.tech \
    --cc=julien@xen.org \
    --cc=lucmiccio@gmail.com \
    --cc=marco.solieri@minervasys.tech \
    --cc=michal.orzel@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.