lkml.org 
[lkml]   [2020]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] KVM: apic: reuse smp_wmb() in kvm_make_request()
Date
From: Miaohe Lin <linmiaohe@huawei.com>

There is already an smp_mb() barrier in kvm_make_request(). We reuse it
here.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
arch/x86/kvm/lapic.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index eafc631d305c..ea871206a370 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1080,9 +1080,12 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
result = 1;
/* assumes that there are only KVM_APIC_INIT/SIPI */
apic->pending_events = (1UL << KVM_APIC_INIT);
- /* make sure pending_events is visible before sending
- * the request */
- smp_wmb();
+ /*
+ * Make sure pending_events is visible before sending
+ * the request.
+ * There is already an smp_wmb() in kvm_make_request(),
+ * we reuse that barrier here.
+ */
kvm_make_request(KVM_REQ_EVENT, vcpu);
kvm_vcpu_kick(vcpu);
}
--
2.19.1
\
 
 \ /
  Last update: 2020-02-06 02:59    [W:0.032 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site