All d-cache entries related to memory that a new cell will use or that
a destructed cell was using are irrelevant now. Invalidate them so that
nothing leaks from/to other cells.

CC: Marc Zyngier <marc.zyng...@arm.com>
CC: Mark Rutland <mark.rutl...@arm.com>
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 hypervisor/arch/arm/control.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hypervisor/arch/arm/control.c b/hypervisor/arch/arm/control.c
index f9e117d..83add4c 100644
--- a/hypervisor/arch/arm/control.c
+++ b/hypervisor/arch/arm/control.c
@@ -378,6 +378,12 @@ void arch_flush_cell_vcpu_caches(struct cell *cell)
 
 void arch_config_commit(struct cell *cell_added_removed)
 {
+       /*
+        * We only need to flush caches for non-root cells and can ignore this
+        * call when being invoked during setup on the root cell.
+        */
+       if (cell_added_removed && cell_added_removed != &root_cell)
+               arm_cell_dcaches_flush(cell_added_removed, DCACHE_INVALIDATE);
 }
 
 void __attribute__((noreturn)) arch_panic_stop(void)
-- 
2.1.4

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to