]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
KVM: PPC: Book 3S: XICS: Don't lock twice when checking for resend
authorLi Zhong <zhong@linux.vnet.ibm.com>
Fri, 11 Nov 2016 04:57:36 +0000 (12:57 +0800)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
commit645542ef1ddb96d02167dcd431ba12565637e816
treecb46cd954539399c19f4a7fe3a7f6b365723c94f
parentf176099fa899798efe1fffe4dcc5eabac25c7b55
KVM: PPC: Book 3S: XICS: Don't lock twice when checking for resend

BugLink: http://bugs.launchpad.net/bugs/1651248
This patch improves the code that takes lock twice to check the resend flag
and do the actual resending, by checking the resend flag locklessly, and
add a boolean parameter check_resend to icp_[rm_]deliver_irq(), so the
resend flag can be checked in the lock when doing the delivery.

We need make sure when we clear the ics's bit in the icp's resend_map, we
don't miss the resend flag of the irqs that set the bit. It could be
ordered through the barrier in test_and_clear_bit(), and a newly added
wmb between setting irq's resend flag, and icp's resend_map.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
(cherry picked from linux-next commit 21acd0e4df04f02176e773468658c3cebff096bb)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/powerpc/kvm/book3s_hv_rm_xics.c
arch/powerpc/kvm/book3s_xics.c