Voiding the ITS caches is not supposed to happen via individual register writes. So we introduced a dedicated ITS KVM device ioctl to perform a cold reset of the ITS: KVM_DEV_ARM_VGIC_GRP_CTRL/KVM_DEV_ARM_ITS_CTRL_RESET. Let's use this latter if the kernel supports it.
Signed-off-by: Eric Auger <eric.au...@redhat.com> --- hw/intc/arm_gicv3_its_kvm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 537cea1..73e2530 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -215,9 +215,19 @@ static void kvm_arm_its_post_load(GICv3ITSState *s) static void kvm_arm_its_reset(DeviceState *dev) { + GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev); KVMARMITSClass *c = KVM_ARM_ITS_GET_CLASS(s); c->parent_reset(dev); + + if (!kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, + KVM_DEV_ARM_ITS_CTRL_RESET)) { + error_report("ITS KVM: reset is not supported by the kernel"); + return; + } + + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, + KVM_DEV_ARM_ITS_CTRL_RESET, NULL, true, &error_abort); } static Property kvm_arm_its_props[] = { -- 2.5.5