aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Auger <eric.auger@linaro.org>2015-03-16 12:30:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-16 12:30:47 +0000
commitf0bb55890a173cb1e9e87d608647cac70f8f9dd4 (patch)
treeb676de0e75f0cd16605901be35c1d88e926b331f
parentd8e052b387635639a6ba4a09a7874fd2f113b218 (diff)
downloadqemu-f0bb55890a173cb1e9e87d608647cac70f8f9dd4.zip
qemu-f0bb55890a173cb1e9e87d608647cac70f8f9dd4.tar.gz
qemu-f0bb55890a173cb1e9e87d608647cac70f8f9dd4.tar.bz2
hw/intc/arm_gic: Initialize the vgic in the realize function
This patch forces vgic initialization in the vgic realize function. It uses a new group/attribute that allows such operation: KVM_DEV_ARM_VGIC_GRP_CTRL/KVM_DEV_ARM_VGIC_CTRL_INIT This earlier initialization allows, for example, to setup VFIO signaling and irqfd after vgic initialization, on a reset notifier. Signed-off-by: Eric Auger <eric.auger@linaro.org> Message-id: 1426094226-8515-1-git-send-email-eric.auger@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/intc/arm_gic_kvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
index 1ad3eb0..0d20750 100644
--- a/hw/intc/arm_gic_kvm.c
+++ b/hw/intc/arm_gic_kvm.c
@@ -573,6 +573,13 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
kvm_gic_access(s, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0, 0, &numirqs, 1);
}
+ /* Tell the kernel to complete VGIC initialization now */
+ if (kvm_gic_supports_attr(s, KVM_DEV_ARM_VGIC_GRP_CTRL,
+ KVM_DEV_ARM_VGIC_CTRL_INIT)) {
+ kvm_gic_access(s, KVM_DEV_ARM_VGIC_GRP_CTRL,
+ KVM_DEV_ARM_VGIC_CTRL_INIT, 0, 0, 1);
+ }
+
/* Distributor */
memory_region_init_reservation(&s->iomem, OBJECT(s),
"kvm-gic_dist", 0x1000);