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

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