Hi,

On 04/03/2022 17:46, Marco Solieri wrote:
From: Luca Miccio <[email protected]>

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 <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>
---
  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

Reply via email to