[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Carlo Nonato <carlo.nonato@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 12 Jan 2024 11:39:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=minervasys.tech smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zleXylavJ1CuW4VXEdB9REEC+cE6odoh5gtbbdbr0v8=; b=V6e8OmW61opnEPb2+Beh6m1DpyKeXyfFKvoOzPl/2sttGUktjvfe/GCOcMAG5YziXxOJ7XaGxspUybcSAtWgiNrpJHHbzIpkSaDMcH4x6U9m634BySn+/IYXgtmUsWwB29dFnqA1fgUI8JNKDHw5LaijDwOBB2MRSbnL100RAU2jYhU2Cc2vl4FYJqWbYp0Gd0h45MPaj5fpExuuCQYJKHN+E0U5o59BbqVQPhQIePHUvMhImxsXK7hySOeF6KBZEAFXL1mSm0OiB29d0v4BAk+aFVI7M8bns2+Ql6AJ1nA+bNv9E3oN2eYecMrf5MyESy+Q8rILFgALQtELIrB+Hw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cnB2poUZDhMAVsGYYrPOOGujxWZKpTiQvJsL9tRgUIUzX+4wWyXcPM3lLlcQRnsGMPkdemjTd75kc3cCPNgp/4W3bOs6sREKvtAgaFIQnpNaMO6aLVAXWLMklzD9ub96RZRRIzNBv8ZrwKchKBUIyFbh8zzFrfoRdG9JaJEH15zWonvswA7M/NosZPiKRu0rUzmOecy7gSADpnvI0MMu+INhtDxH2KxccAHsKEUp2NIYx46QeTeV6yAsVQ0vpyq0sG4ab+6w+zZIpl1tFyBIPVVmcnda7qfQUvlcxw6XDn6Wy4tlERsPoeY8lPbt01wgxa3kqsc0DQIf+24wXhua1Q==
  • Cc: Luca Miccio <lucmiccio@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 12 Jan 2024 10:39:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 12/01/2024 10:24, Michal Orzel wrote:
> 
> 
> Hi Carlo,
> 
> On 23/01/2023 16:47, Carlo Nonato wrote:
>>
>>
>> From: Luca Miccio <lucmiccio@xxxxxxxxx>
>>
>> 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@xxxxxxxxx>
>> Signed-off-by: Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>
>> Signed-off-by: Carlo Nonato <carlo.nonato@xxxxxxxxxxxxxxx>
>> ---
>> 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?
Sorry. I answered to the wrong revision :)
Anyway, the remark still applies to v5.

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.