]> git.baikalelectronics.ru Git - kernel.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)
commite964cee6902539f4a9a8d14ac9f58ee78dc5df7e
tree947613a9b9ca8970e457000fd47769e2a6c60894
parent5c5848855e7c7e824b98226d819aa61b5ee5f516
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