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