Blame SOURCES/kvm-hw-intc-arm_gicv3_its-Don-t-abort-on-table-save-fail.patch

4a2fec
From 3e611f18f7a3d0a76c07f822e6190a79c09f82e7 Mon Sep 17 00:00:00 2001
4a2fec
From: Auger Eric <eric.auger@redhat.com>
4a2fec
Date: Tue, 28 Nov 2017 15:14:04 +0100
4a2fec
Subject: [PATCH 3/9] hw/intc/arm_gicv3_its: Don't abort on table save failure
4a2fec
4a2fec
RH-Author: Auger Eric <eric.auger@redhat.com>
4a2fec
Message-id: <1511882048-11256-4-git-send-email-eric.auger@redhat.com>
4a2fec
Patchwork-id: 77940
4a2fec
O-Subject: [RHV7.5 qemu-kvm-ma PATCH 3/7] hw/intc/arm_gicv3_its: Don't abort on table save failure
4a2fec
Bugzilla: 1513323
4a2fec
RH-Acked-by: Andrew Jones <drjones@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
RH-Acked-by: Wei Huang <wei@redhat.com>
4a2fec
4a2fec
The ITS is not fully properly reset at the moment. Caches are
4a2fec
not emptied.
4a2fec
4a2fec
After a reset, in case we attempt to save the state before
4a2fec
the bound devices have registered their MSIs and after the
4a2fec
1st level table has been allocated by the ITS driver
4a2fec
(device BASER is valid), the first level entries are still
4a2fec
invalid. If the device cache is not empty (devices registered
4a2fec
before the reset), vgic_its_save_device_tables fails with -EINVAL.
4a2fec
This causes a QEMU abort().
4a2fec
4a2fec
Cc: qemu-stable@nongnu.org
4a2fec
Signed-off-by: Eric Auger <eric.auger@redhat.com>
4a2fec
Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
4a2fec
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
4a2fec
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4a2fec
(cherry picked from commit 8a7348b5d62d7ea16807e6bea54b448a0184bb0f)
4a2fec
Signed-off-by: Eric Auger <eric.auger@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/intc/arm_gicv3_its_kvm.c | 8 ++------
4a2fec
 1 file changed, 2 insertions(+), 6 deletions(-)
4a2fec
4a2fec
diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
4a2fec
index 9b00ce5..6fb45df 100644
4a2fec
--- a/hw/intc/arm_gicv3_its_kvm.c
4a2fec
+++ b/hw/intc/arm_gicv3_its_kvm.c
4a2fec
@@ -64,20 +64,16 @@ static void vm_change_state_handler(void *opaque, int running,
4a2fec
 {
4a2fec
     GICv3ITSState *s = (GICv3ITSState *)opaque;
4a2fec
     Error *err = NULL;
4a2fec
-    int ret;
4a2fec
 
4a2fec
     if (running) {
4a2fec
         return;
4a2fec
     }
4a2fec
 
4a2fec
-    ret = kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL,
4a2fec
-                            KVM_DEV_ARM_ITS_SAVE_TABLES, NULL, true, &err;;
4a2fec
+    kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL,
4a2fec
+                      KVM_DEV_ARM_ITS_SAVE_TABLES, NULL, true, &err;;
4a2fec
     if (err) {
4a2fec
         error_report_err(err);
4a2fec
     }
4a2fec
-    if (ret < 0 && ret != -EFAULT) {
4a2fec
-        abort();
4a2fec
-    }
4a2fec
 }
4a2fec
 
4a2fec
 static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec