From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bslGr-0003zb-Ed for qemu-devel@nongnu.org; Sat, 08 Oct 2016 02:38:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bslGn-00039t-9x for qemu-devel@nongnu.org; Sat, 08 Oct 2016 02:38:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bslGn-00039j-3P for qemu-devel@nongnu.org; Sat, 08 Oct 2016 02:38:05 -0400 Date: Sat, 8 Oct 2016 14:37:59 +0800 From: Peter Xu Message-ID: <20161008063759.GF3666@pxdev.xzpeter.org> References: <20161005130657.3399-1-rkrcmar@redhat.com> <20161005130657.3399-3-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161005130657.3399-3-rkrcmar@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 2/8] apic: add send_msi() to APICCommonClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: qemu-devel@nongnu.org, Igor Mammedov , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" On Wed, Oct 05, 2016 at 03:06:51PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99 wro= te: > The MMIO based interface to APIC doesn't work well with MSIs that have > upper address bits set (remapped x2APIC MSIs). A specialized interface > is a quick and dirty way to avoid the shortcoming. >=20 > Reviewed-by: Igor Mammedov > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Reviewed-by: Peter Xu And... > --- > v4: r-b Igor > v2: change apic_send_msi() to accept MSIMessage [Igor] > --- > hw/i386/kvm/apic.c | 19 +++++++++++++------ > hw/i386/xen/xen_apic.c | 6 ++++++ > hw/intc/apic.c | 8 ++++++-- > include/hw/i386/apic_internal.h | 4 ++++ > 4 files changed, 29 insertions(+), 8 deletions(-) >=20 > diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c > index c016e63fc2ba..be55102c00ca 100644 > --- a/hw/i386/kvm/apic.c > +++ b/hw/i386/kvm/apic.c > @@ -169,6 +169,17 @@ static void kvm_apic_external_nmi(APICCommonState = *s) > run_on_cpu(CPU(s->cpu), do_inject_external_nmi, s); > } > =20 > +static void kvm_send_msi(MSIMessage *msg) > +{ > + int ret; > + > + ret =3D kvm_irqchip_send_msi(kvm_state, *msg); > + if (ret < 0) { > + fprintf(stderr, "KVM: injection failed, MSI lost (%s)\n", > + strerror(-ret)); Maybe use error_report() better? A nit not sufficient for a new spin though. And, this patch is assuming MSIMessage as host endianess (which is good to me). Not sure whether we need fixes for the whole MSIMessage cleanup (after all, kvm_irqchip_send_msi() is taking it as LE). Or we can do it afterwards since it won't break anything AFAIU. -- peterx