From: Jan Kiszka <[email protected]>

There is no need to kick off a vcpu cache flush right after setup. We
just installed the new mapping and didn't use it yet, thus nothing can
be cached.

Actually, this didn't fully trigger a flush on ARM and ARM64 anyway
because those archs didn't kick all CPUs but rather expected them to be
suspended - which they aren't during setup.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/control.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/hypervisor/control.c b/hypervisor/control.c
index 2214406f..5da95ada 100644
--- a/hypervisor/control.c
+++ b/hypervisor/control.c
@@ -1,7 +1,7 @@
 /*
  * Jailhouse, a Linux-based partitioning hypervisor
  *
- * Copyright (c) Siemens AG, 2013-2016
+ * Copyright (c) Siemens AG, 2013-2022
  *
  * Authors:
  *  Jan Kiszka <[email protected]>
@@ -285,9 +285,16 @@ static void cell_exit(struct cell *cell)
  */
 void config_commit(struct cell *cell_added_removed)
 {
-       arch_flush_cell_vcpu_caches(&root_cell);
-       if (cell_added_removed && cell_added_removed != &root_cell)
-               arch_flush_cell_vcpu_caches(cell_added_removed);
+       /*
+        * We do not need to flush the caches during setup, i.e. when the root
+        * cell was added, because there was no reconfiguration of the new
+        * mapping done yet.
+        */
+       if (cell_added_removed != &root_cell) {
+               arch_flush_cell_vcpu_caches(&root_cell);
+               if (cell_added_removed)
+                       arch_flush_cell_vcpu_caches(cell_added_removed);
+       }
 
        arch_config_commit(cell_added_removed);
        pci_config_commit(cell_added_removed);
-- 
2.36.1

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20220627131329.3659-3-ralf.ramsauer%40oth-regensburg.de.

Reply via email to