From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suravee Suthikulpanit Subject: Re: [PART1 RFC v2 06/10] svm: Add interrupt injection via AVIC Date: Mon, 14 Mar 2016 16:41:34 +0700 Message-ID: <56E6874E.4010807@amd.com> References: <1457124368-2025-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1457124368-2025-7-git-send-email-Suravee.Suthikulpanit@amd.com> <56DD9FF5.7010201@redhat.com> <20160308215424.GA31328@potion.brq.redhat.com> <56E004A2.70702@redhat.com> <20160309160050.GB31328@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: , , , , , , , To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Paolo Bonzini Return-path: Received: from mail-bn1on0086.outbound.protection.outlook.com ([157.56.110.86]:31088 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752194AbcCNJlz (ORCPT ); Mon, 14 Mar 2016 05:41:55 -0400 In-Reply-To: <20160309160050.GB31328@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi On 03/09/2016 11:00 PM, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > 2016-03-09 12:10+0100, Paolo Bonzini: >> On 08/03/2016 22:54, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>> 2016-03-07 16:36+0100, Paolo Bonzini: >>>> On 04/03/2016 21:46, Suravee Suthikulpanit wrote: >>>>> +static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec= ) >>>>> +{ >>>>> + struct vcpu_svm *svm =3D to_svm(vcpu); >>>>> + >>>>> + kvm_lapic_set_vector(vec, avic_get_bk_page_entry(svm, APIC_IRR)= ); >>> >>> (I think that smp_mb here would make sense, even though we're fine = now >>> thanks to re-checking vcpu->mode in kvm_vcpu_kick. >> >> Right, though only a smp_mb__after_atomic() is required (which is a >> compiler barrier). It is similarly required in vmx. > > True, kvm_lapic_set_vector uses a lock prefix. > > (I thought it behaves like atomic_set, which would require MFENCE for > correct ordering here ... I don't like smp_mb__after_atomic much > because of the discrepancy on some atomic operations.) > So, should i just use smb_mb() in this case? Suravee.