]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put
authorChristoffer Dall <cdall@cs.columbia.edu>
Thu, 24 Mar 2016 10:21:04 +0000 (11:21 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:45:22 +0000 (07:45 -0700)
commit8dd0b0492ac8e0a2d36d8db3af9699d3854d8d76
treed8812bef5ccfa0aab49c3af64be5ba495682c76d
parent426b98731f34b99694fff7eb16f38215d054c979
KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put

We don't have to save/restore the VMCR on every entry to/from the guest,
since on GICv2 we can access the control interface from EL1 and on VHE
systems with GICv3 we can access the control interface from KVM running
in EL2.

GICv3 systems without VHE becomes the rare case, which has to
save/restore the register on each round trip.

Note that userspace accesses may see out-of-date values if the VCPU is
running while accessing the VGIC state via the KVM device API, but this
is already the case and it is up to userspace to quiesce the CPUs before
reading the CPU registers from the GIC for an up-to-date view.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/include/asm/kvm_asm.h
arch/arm/kvm/arm.c
arch/arm64/include/asm/kvm_asm.h
include/kvm/arm_vgic.h
virt/kvm/arm/hyp/vgic-v2-sr.c
virt/kvm/arm/hyp/vgic-v3-sr.c
virt/kvm/arm/vgic/vgic-init.c
virt/kvm/arm/vgic/vgic-v2.c
virt/kvm/arm/vgic/vgic-v3.c
virt/kvm/arm/vgic/vgic.c
virt/kvm/arm/vgic/vgic.h