]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: vgic-v3: De-optimize VMCR save/restore when emulating a GICv2
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 19 Apr 2017 11:15:26 +0000 (12:15 +0100)
committerChristoffer Dall <cdall@linaro.org>
Wed, 19 Apr 2017 15:28:38 +0000 (17:28 +0200)
commit76ad848b679e9642c72a7a08c84db48a49fe6719
tree0c94982d34a072e6654e177b1ce39522b4c6f6a6
parente1d6750d23251578f4928bb771d55357c67ce2bf
KVM: arm/arm64: vgic-v3: De-optimize VMCR save/restore when emulating a GICv2

When emulating a GICv2-on-GICv3, special care must be taken to only
save/restore VMCR_EL2 when ICC_SRE_EL1.SRE is cleared. Otherwise,
all Group-0 interrupts end-up being delivered as FIQ, which is
probably not what the guest expects, as demonstrated here with
an unhappy EFI:

FIQ Exception at 0x000000013BD21CC4

This means that we cannot perform the load/put trick when dealing
with VMCR_EL2 (because the host has SRE set), and we have to deal
with it in the world-switch.

Fortunately, this is not the most common case (modern guests should
be able to deal with GICv3 directly), and the performance is not worse
than what it was before the VMCR optimization.

Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
virt/kvm/arm/hyp/vgic-v3-sr.c
virt/kvm/arm/vgic/vgic-v3.c