aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-01-29 19:04:48 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2016-02-29 18:34:22 +0000
commit9b4a3004439d5be680faf41f4267968ca11bb9f6 (patch)
tree7d0105f0da12af41b04a23dd4e4f65066d80d6f0 /arch/arm/kvm/arm.c
parentARM: KVM: Switch the CP reg search to be a binary search (diff)
downloadlinux-dev-9b4a3004439d5be680faf41f4267968ca11bb9f6.tar.xz
linux-dev-9b4a3004439d5be680faf41f4267968ca11bb9f6.zip
KVM: arm/arm64: timer: Add active state caching
Programming the active state in the (re)distributor can be an expensive operation so it makes some sense to try and reduce the number of accesses as much as possible. So far, we program the active state on each VM entry, but there is some opportunity to do less. An obvious solution is to cache the active state in memory, and only program it in the HW when conditions change. But because the HW can also change things under our feet (the active state can transition from 1 to 0 when the guest does an EOI), some precautions have to be taken, which amount to only caching an "inactive" state, and always programing it otherwise. With this in place, we observe a reduction of around 700 cycles on a 2GHz GICv2 platform for a NULL hypercall. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 75c7fed5d14c..9ca653e34d8c 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -322,6 +322,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
vcpu->cpu = -1;
kvm_arm_set_running_vcpu(NULL);
+ kvm_timer_vcpu_put(vcpu);
}
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,