summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-09-06 04:28:45 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2016-09-08 06:53:00 -0400
commitfb5ee369ccd3986b28adc20d43d73a2b2c141977 (patch)
tree34722e194ff7610827d4950bd4f06aab6da3c96e /virt
parent8cebe750c4d9acdfdce41ee0a83a58be973ebc5e (diff)
arm64: KVM: vgic-v2: Add the GICV emulation infrastructure
In order to efficiently perform the GICV access on behalf of the guest, we need to be able to avoid going back all the way to the host kernel. For this, we introduce a new hook in the world switch code, conveniently placed just after populating the fault info. At that point, we only have saved/restored the GP registers, and we can quickly perform all the required checks (data abort, translation fault, valid faulting syndrome, not an external abort, not a PTW). Coming back from the emulation code, we need to skip the emulated instruction. This involves an additional bit of save/restore in order to be able to access the guest's PC (and possibly CPSR if this is a 32bit guest). At this stage, no emulation code is provided. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/hyp/vgic-v2-sr.c7
-rw-r--r--virt/kvm/arm/vgic/vgic-v2.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/virt/kvm/arm/hyp/vgic-v2-sr.c b/virt/kvm/arm/hyp/vgic-v2-sr.c
index 7cffd9338c49..3e2a62e27eba 100644
--- a/virt/kvm/arm/hyp/vgic-v2-sr.c
+++ b/virt/kvm/arm/hyp/vgic-v2-sr.c
@@ -167,3 +167,10 @@ void __hyp_text __vgic_v2_restore_state(struct kvm_vcpu *vcpu)
167 writel_relaxed(cpu_if->vgic_vmcr, base + GICH_VMCR); 167 writel_relaxed(cpu_if->vgic_vmcr, base + GICH_VMCR);
168 vcpu->arch.vgic_cpu.live_lrs = live_lrs; 168 vcpu->arch.vgic_cpu.live_lrs = live_lrs;
169} 169}
170
171#ifdef CONFIG_ARM64
172bool __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu)
173{
174 return false;
175}
176#endif
diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
index 0bf6709d1006..b8da9011889d 100644
--- a/virt/kvm/arm/vgic/vgic-v2.c
+++ b/virt/kvm/arm/vgic/vgic-v2.c
@@ -294,6 +294,8 @@ out:
294 return ret; 294 return ret;
295} 295}
296 296
297DEFINE_STATIC_KEY_FALSE(vgic_v2_cpuif_trap);
298
297/** 299/**
298 * vgic_v2_probe - probe for a GICv2 compatible interrupt controller in DT 300 * vgic_v2_probe - probe for a GICv2 compatible interrupt controller in DT
299 * @node: pointer to the DT node 301 * @node: pointer to the DT node