KVM: arm/arm64: Avoid work when userspace iqchips are not used
authorChristoffer Dall <christoffer.dall@linaro.org>
Fri, 27 Oct 2017 17:57:51 +0000 (19:57 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Tue, 2 Jan 2018 09:05:46 +0000 (10:05 +0100)
commit61bbe38027334780964e4b2658f722ed0b3cb2f9
tree51acd9c382cbb311bf931a68552eeae3ae20e27f
parent4c60e360d6dfa4d9c3586b687f348eeb3fd675dd
KVM: arm/arm64: Avoid work when userspace iqchips are not used

We currently check if the VM has a userspace irqchip in several places
along the critical path, and if so, we do some work which is only
required for having an irqchip in userspace.  This is unfortunate, as we
could avoid doing any work entirely, if we didn't have to support
irqchip in userspace.

Realizing the userspace irqchip on ARM is mostly a developer or hobby
feature, and is unlikely to be used in servers or other scenarios where
performance is a priority, we can use a refcounted static key to only
check the irqchip configuration when we have at least one VM that uses
an irqchip in userspace.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
virt/kvm/arm/arch_timer.c
virt/kvm/arm/arm.c