KVM: arm/arm64: Factor out functionality to get vgic mmio requester_vcpu
authorChristoffer Dall <christoffer.dall@linaro.org>
Thu, 14 Sep 2017 18:08:45 +0000 (11:08 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Tue, 2 Jan 2018 09:05:45 +0000 (10:05 +0100)
commit6c1b7521f4a07cc63bbe2dfe290efed47cdb780a
tree13582e856147158b57fccd022e6e5f0b77dc2444
parent5a24575032971c5a9a4580417a791c427ebdb8e5
KVM: arm/arm64: Factor out functionality to get vgic mmio requester_vcpu

We are about to distinguish between userspace accesses and mmio traps
for a number of the mmio handlers.  When the requester vcpu is NULL, it
means we are handling a userspace access.

Factor out the functionality to get the request vcpu into its own
function, mostly so we have a common place to document the semantics of
the return value.

Also take the chance to move the functionality outside of holding a
spinlock and instead explicitly disable and enable preemption.  This
supports PREEMPT_RT kernels as well.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic/vgic-mmio.c