summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic/vgic-v2.c
diff options
context:
space:
mode:
authorEric Auger <eric.auger@linaro.org>2015-12-02 10:30:13 +0100
committerChristoffer Dall <christoffer.dall@linaro.org>2016-05-20 15:40:07 +0200
commitf7b6985cc3d0f0f6f35990301d80d858c148e10c (patch)
treee4cf74e3ba323fce1d659a4117c4bdfdf7e34212 /virt/kvm/arm/vgic/vgic-v2.c
parentb0442ee227e826afc4df16cdfb8bd6eef6a8f425 (diff)
downloadblackbird-op-linux-f7b6985cc3d0f0f6f35990301d80d858c148e10c.tar.gz
blackbird-op-linux-f7b6985cc3d0f0f6f35990301d80d858c148e10c.zip
KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable
Enable the VGIC operation by properly initialising the registers in the hypervisor GIC interface. Signed-off-by: Eric Auger <eric.auger@linaro.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt/kvm/arm/vgic/vgic-v2.c')
-rw-r--r--virt/kvm/arm/vgic/vgic-v2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
index 1fe031b7ba43..8ad42c217770 100644
--- a/virt/kvm/arm/vgic/vgic-v2.c
+++ b/virt/kvm/arm/vgic/vgic-v2.c
@@ -206,9 +206,18 @@ void vgic_v2_get_vmcr(struct kvm_vcpu *vcpu, struct vgic_vmcr *vmcrp)
GICH_VMCR_PRIMASK_SHIFT;
}
-/* not yet implemented */
void vgic_v2_enable(struct kvm_vcpu *vcpu)
{
+ /*
+ * By forcing VMCR to zero, the GIC will restore the binary
+ * points to their reset values. Anything else resets to zero
+ * anyway.
+ */
+ vcpu->arch.vgic_cpu.vgic_v2.vgic_vmcr = 0;
+ vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr = ~0;
+
+ /* Get the show on the road... */
+ vcpu->arch.vgic_cpu.vgic_v2.vgic_hcr = GICH_HCR_EN;
}
/* check for overlapping regions and for regions crossing the end of memory */
OpenPOWER on IntegriCloud