]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: arm/arm64: vgic: Avoid flushing vgic state when there's no pending IRQ
authorShih-Wei Li <shihwei@cs.columbia.edu>
Wed, 19 Oct 2016 18:12:34 +0000 (18:12 +0000)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:45:31 +0000 (07:45 -0700)
commitf6769581e90ba2535b3e587fe15b74f6cbc4aaab
tree947613a9b9ca8970e457000fd47769e2a6c60894
parent328e566479449194979d64685ae6d74c989599bb
KVM: arm/arm64: vgic: Avoid flushing vgic state when there's no pending IRQ

We do not need to flush vgic states in each world switch unless
there is pending IRQ queued to the vgic's ap list. We can thus reduce
the overhead by not grabbing the spinlock and not making the extra
function call to vgic_flush_lr_state.

Note: list_empty is a single atomic read (uses READ_ONCE) and can
therefore check if a list is empty or not without the need to take the
spinlock protecting the list.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Shih-Wei Li <shihwei@cs.columbia.edu>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
virt/kvm/arm/vgic/vgic.c