aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-10-18 11:49:09 +0100
committerPeter Maydell <peter.maydell@linaro.org>2012-10-18 11:49:09 +0100
commit334a663a459ec9de7c241fb0aab2a54abe680b17 (patch)
treed502a6e1826179473bdcc8e885df224f6225984f /hw
parentbdd7f9c38e93426c9a50d13856998df30f2b41dd (diff)
target-arm: Use MemoryListener to identify GIC base address for KVMkvm-arm-dev-addr-test
When using an in-kernel GIC with KVM, we need to tell the kernel where the GIC's memory mapped registers live. Do this by registering a MemoryListener which tracks where the board model maps the A15's private peripherals, so we can finish the GIC initialisation when the GIC is actually mapped. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/a15mpcore.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/a15mpcore.c b/hw/a15mpcore.c
index a37fc612ab..b048518685 100644
--- a/hw/a15mpcore.c
+++ b/hw/a15mpcore.c
@@ -20,6 +20,7 @@
#include "sysbus.h"
#include "kvm.h"
+#include "kvm_arm.h"
/* A15MP private memory region. */
@@ -73,7 +74,14 @@ static int a15mp_priv_init(SysBusDevice *dev)
sysbus_mmio_get_region(busdev, 0));
memory_region_add_subregion(&s->container, 0x2000,
sysbus_mmio_get_region(busdev, 1));
-
+#ifdef CONFIG_KVM
+ kvm_arm_register_device(sysbus_mmio_get_region(busdev, 0),
+ (KVM_ARM_DEVICE_VGIC_V2 << KVM_DEVICE_ID_SHIFT) |
+ KVM_VGIC_V2_ADDR_TYPE_DIST);
+ kvm_arm_register_device(sysbus_mmio_get_region(busdev, 1),
+ (KVM_ARM_DEVICE_VGIC_V2 << KVM_DEVICE_ID_SHIFT) |
+ KVM_VGIC_V2_ADDR_TYPE_CPU);
+#endif
sysbus_init_mmio(dev, &s->container);
return 0;
}