thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
495e37
From c08c3fbb2bb8494738fd34ec8fc9dc434ce82f4b Mon Sep 17 00:00:00 2001
495e37
From: Eric Auger <eric.auger@redhat.com>
495e37
Date: Wed, 2 Feb 2022 12:16:02 +0100
495e37
Subject: [PATCH 12/12] hw/arm/smmuv3: Fix device reset
495e37
495e37
RH-Author: Eric Auger <eric.auger@redhat.com>
495e37
RH-MergeRequest: 72: hw/arm/smmuv3: Fix device reset
495e37
RH-Commit: [1/1] 2cfee2f7a03692681224fed96bb4f28406bf460a (eauger1/centos-qemu-kvm)
495e37
RH-Bugzilla: 2042481
495e37
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
RH-Acked-by: Peter Xu <peterx@redhat.com>
495e37
RH-Acked-by: Andrew Jones <drjones@redhat.com>
495e37
495e37
branch: c9s
495e37
Brew: 42958737
495e37
Upstream: yes
495e37
495e37
We currently miss a bunch of register resets in the device reset
495e37
function. This sometimes prevents the guest from rebooting after
495e37
a system_reset (with virtio-blk-pci). For instance, we may get
495e37
the following errors:
495e37
495e37
invalid STE
495e37
smmuv3-iommu-memory-region-0-0 translation failed for iova=0x13a9d2000(SMMU_EVT_C_BAD_STE)
495e37
Invalid read at addr 0x13A9D2000, size 2, region '(null)', reason: rejected
495e37
invalid STE
495e37
smmuv3-iommu-memory-region-0-0 translation failed for iova=0x13a9d2000(SMMU_EVT_C_BAD_STE)
495e37
Invalid write at addr 0x13A9D2000, size 2, region '(null)', reason: rejected
495e37
invalid STE
495e37
495e37
Signed-off-by: Eric Auger <eric.auger@redhat.com>
495e37
Message-id: 20220202111602.627429-1-eric.auger@redhat.com
495e37
Fixes: 10a83cb988 ("hw/arm/smmuv3: Skeleton")
495e37
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
495e37
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
495e37
(cherry picked from commit 43530095e18fd16dcd51a4b385ad2a22c36f5698)
495e37
Signed-off-by: Eric Auger <eric.auger@redhat.com>
495e37
---
495e37
 hw/arm/smmuv3.c | 6 ++++++
495e37
 1 file changed, 6 insertions(+)
495e37
495e37
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
495e37
index 01b60bee49..1b5640bb98 100644
495e37
--- a/hw/arm/smmuv3.c
495e37
+++ b/hw/arm/smmuv3.c
495e37
@@ -276,6 +276,12 @@ static void smmuv3_init_regs(SMMUv3State *s)
495e37
     s->features = 0;
495e37
     s->sid_split = 0;
495e37
     s->aidr = 0x1;
495e37
+    s->cr[0] = 0;
495e37
+    s->cr0ack = 0;
495e37
+    s->irq_ctrl = 0;
495e37
+    s->gerror = 0;
495e37
+    s->gerrorn = 0;
495e37
+    s->statusr = 0;
495e37
 }
495e37
 
495e37
 static int smmu_get_ste(SMMUv3State *s, dma_addr_t addr, STE *buf,
495e37
-- 
495e37
2.27.0
495e37