Skip to contentSkip to conversation

KVM: apic: reuse smp_wmb() in kvm_make_request()

PATCH Applied linmiaohe 3 participants 3 messages Feb 7, 2020 – Feb 12, 2020

Subsystems (3)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw

PATCH v2 1/1 KVM: apic: reuse smp_wmb() in kvm_make_request()

From: Miaohe Lin <[email protected]>

kvm_make_request() provides smp_wmb() so pending_events changes are guaranteed to be visible.

---
v1->v2:
Collected Vitaly's R-b
Use Vitaly's alternative wording
Drop unnecessary comment as suggested by Sean Christopherson

---
 arch/x86/kvm/lapic.c | 3 ---
 1 file changed, 3 deletions(-)
arch/x86/kvm/lapic.c +0 -3
index eafc631d305c..afcd30d44cbb 100644
@@ -1080,9 +1080,6 @@ 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();
 			kvm_make_request(KVM_REQ_EVENT, vcpu);
 			kvm_vcpu_kick(vcpu);
 		}
Signature · 1 line
2.19.1
maintainer Applied
#2 lore raw
In reply to linmiaohe
Quoted 22 lines · linmiaohe

From: Miaohe Lin <[email protected]>

kvm_make_request() provides smp_wmb() so pending_events changes are guaranteed to be visible.

---
v1->v2:
Collected Vitaly's R-b
Use Vitaly's alternative wording
Drop unnecessary comment as suggested by Sean Christopherson

---
 arch/x86/kvm/lapic.c | 3 ---
 1 file changed, 3 deletions(-)
arch/x86/kvm/lapic.c +0 -0
index eafc631d305c..afcd30d44cbb 100644

arch/x86/kvm/lapic.c static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · line 1085

Quoted 9 lines
arch/x86/kvm/lapic.c +0 -3
@@ -1080,9 +1080,6 @@ 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();
 			kvm_make_request(KVM_REQ_EVENT, vcpu);
 			kvm_vcpu_kick(vcpu);
 		}

Queued, thanks.

Paolo