summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier2013-01-22 01:36:16 +0100
committerMarc Zyngier2013-02-11 20:00:10 +0100
commit01ac5e342f3b87a9b83b991230d96c22c4167ec9 (patch)
tree84c06fa12415ef191bee35914323c7c65a9c4b0d /arch/arm/kvm/arm.c
parentARM: KVM: VGIC control interface world switch (diff)
downloadkernel-qcow2-linux-01ac5e342f3b87a9b83b991230d96c22c4167ec9.tar.gz
kernel-qcow2-linux-01ac5e342f3b87a9b83b991230d96c22c4167ec9.tar.xz
kernel-qcow2-linux-01ac5e342f3b87a9b83b991230d96c22c4167ec9.zip
ARM: KVM: VGIC initialisation code
Add the init code for the hypervisor, the virtual machine, and the virtual CPUs. An interrupt handler is also wired to allow the VGIC maintenance interrupts, used to deal with level triggered interrupts and LR underflows. A CPU hotplug notifier is registered to disable/enable the interrupt as requested. Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 3c8d6a9be123..ea7383293ed0 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -642,6 +642,17 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
vcpu->arch.has_run_once = true;
/*
+ * Initialize the VGIC before running a vcpu the first time on
+ * this VM.
+ */
+ if (irqchip_in_kernel(vcpu->kvm) &&
+ unlikely(!vgic_initialized(vcpu->kvm))) {
+ int ret = kvm_vgic_init(vcpu->kvm);
+ if (ret)
+ return ret;
+ }
+
+ /*
* Handle the "start in power-off" case by calling into the
* PSCI code.
*/
@@ -1085,6 +1096,10 @@ static int init_hyp_mode(void)
if (err)
goto out_free_vfp;
+#ifdef CONFIG_KVM_ARM_VGIC
+ vgic_present = true;
+#endif
+
kvm_info("Hyp mode initialized successfully\n");
return 0;
out_free_vfp: