Blame SOURCES/kvm-hw-intc-arm_gicv3_its-Implement-full-reset.patch

4a2fec
From 4a5658befb21d06adda6e6faf5c507990f08d270 Mon Sep 17 00:00:00 2001
4a2fec
From: Auger Eric <eric.auger@redhat.com>
4a2fec
Date: Tue, 28 Nov 2017 15:14:08 +0100
4a2fec
Subject: [PATCH 7/9] hw/intc/arm_gicv3_its: Implement full reset
4a2fec
4a2fec
RH-Author: Auger Eric <eric.auger@redhat.com>
4a2fec
Message-id: <1511882048-11256-8-git-send-email-eric.auger@redhat.com>
4a2fec
Patchwork-id: 77942
4a2fec
O-Subject: [RHV7.5 qemu-kvm-ma PATCH 7/7] hw/intc/arm_gicv3_its: Implement full reset
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
Voiding the ITS caches is not supposed to happen via
4a2fec
individual register writes. So we introduced a dedicated
4a2fec
ITS KVM device ioctl to perform a cold reset of the ITS:
4a2fec
KVM_DEV_ARM_VGIC_GRP_CTRL/KVM_DEV_ARM_ITS_CTRL_RESET. Let's
4a2fec
use this latter if the kernel supports it.
4a2fec
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 | 9 ++++++++-
4a2fec
 1 file changed, 8 insertions(+), 1 deletion(-)
4a2fec
4a2fec
diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
4a2fec
index 1c663ac..bf290b8 100644
4a2fec
--- a/hw/intc/arm_gicv3_its_kvm.c
4a2fec
+++ b/hw/intc/arm_gicv3_its_kvm.c
4a2fec
@@ -204,7 +204,14 @@ static void kvm_arm_its_reset(DeviceState *dev)
4a2fec
 
4a2fec
     c->parent_reset(dev);
4a2fec
 
4a2fec
-    error_report("ITS KVM: full reset is not supported by QEMU");
4a2fec
+    if (kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL,
4a2fec
+                               KVM_DEV_ARM_ITS_CTRL_RESET)) {
4a2fec
+        kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL,
4a2fec
+                          KVM_DEV_ARM_ITS_CTRL_RESET, NULL, true, &error_abort);
4a2fec
+        return;
4a2fec
+    }
4a2fec
+
4a2fec
+    error_report("ITS KVM: full reset is not supported by the host kernel");
4a2fec
 
4a2fec
     if (!kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS,
4a2fec
                                GITS_CTLR)) {
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec