From: Jan Kiszka <[email protected]>

We must update S2CR and SMRs first, then flush. Otherwise, TLB entries
might be left which refer to the old settings.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm64/smmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hypervisor/arch/arm64/smmu.c b/hypervisor/arch/arm64/smmu.c
index 95d45148..34f2b821 100644
--- a/hypervisor/arch/arm64/smmu.c
+++ b/hypervisor/arch/arm64/smmu.c
@@ -583,9 +583,6 @@ static void arm_smmu_cell_exit(struct cell *cell)
                return;
 
        for_each_smmu(smmu, dev) {
-               mmio_write32(ARM_SMMU_GR0(smmu) + ARM_SMMU_GR0_TLBIVMID, id);
-               arm_smmu_tlb_sync_global(smmu);
-
                for_each_stream_id(sid, cell->config, n) {
                        idx = arm_smmu_find_sme(sid, smmu);
                        if (idx < 0)
@@ -603,6 +600,9 @@ static void arm_smmu_cell_exit(struct cell *cell)
                        smmu->cbs[id].cfg = NULL;
                        arm_smmu_write_context_bank(smmu, id);
                }
+
+               mmio_write32(ARM_SMMU_GR0(smmu) + ARM_SMMU_GR0_TLBIVMID, id);
+               arm_smmu_tlb_sync_global(smmu);
        }
 }
 
-- 
2.26.2

-- 
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/91e4c4947061c405ca9a2e7008426d55be2205cf.1602664150.git.jan.kiszka%40siemens.com.

Reply via email to