]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Clear pv eoi pending bit only when it is set
authorLi RongQing <lirongqing@baidu.com>
Thu, 4 Nov 2021 11:56:14 +0000 (19:56 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:25:14 +0000 (04:25 -0500)
commitb3e026e71dae5c6187f8b3087f5654ff1d8665c1
treedd4cfaf87b740edb51e3a8c401856a85c5472d66
parent5136118aed21a95e10c0094a881addf16a8578bf
KVM: Clear pv eoi pending bit only when it is set

merge pv_eoi_get_pending and pv_eoi_clr_pending into a single
function pv_eoi_test_and_clear_pending, which returns and clear
the value of the pending bit.

This makes it possible to clear the pending bit only if the guest
had set it, and otherwise skip the call to pv_eoi_put_user().
This can save up to 300 nsec on AMD EPYC processors.

Suggested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Message-Id: <1636026974-50555-2-git-send-email-lirongqing@baidu.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c