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

Re: [PATCH 13/36] xen/arm: A domain is not direct mapped when coloring is enabled



Hi,

On 04/03/2022 17:46, Marco Solieri wrote:
From: Luca Miccio <lucmiccio@xxxxxxxxx>

Based on the intrinsic nature of cache coloring, it is trivial to state
that each domain that is colored is also not direct mapped.
Set the directmap variable to false when coloring is enabled.

This is basically fixing a bug that was introduced in the previous patch. Please fold it.


Signed-off-by: Luca Miccio <lucmiccio@xxxxxxxxx>
Signed-off-by: Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>
---
  xen/arch/arm/domain.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 33471b3c58..80a6f39464 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -785,6 +785,8 @@ int arch_domain_create(struct domain *d,
d->max_colors = 0;
  #ifdef CONFIG_COLORING
+    d->arch.directmap = false;

We should avoid silently overwriting what the user requested. Instead, we should add a check in arch_sanitise_domain_config() to forbid case where CDF_directmap is set *and* the number of colors is > 0.

+
      /* Setup domain colors */
      if ( !config->arch.colors.max_colors )
      {

Cheers,

--
Julien Grall



 


Rackspace

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