Received: from eggs.gnu.org ([2001:4830:134:3::10]:39693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fziQf-0005bB-T2 for qemu-devel@nongnu.org; Tue, 11 Sep 2018 09:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fziQY-0000ys-KL for qemu-devel@nongnu.org; Tue, 11 Sep 2018 09:10:04 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41602 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fziQY-0000xI-94 for qemu-devel@nongnu.org; Tue, 11 Sep 2018 09:09:58 -0400 References: <48ae78d8-58ec-8813-8680-6f407ea46041@siemens.com> From: Paolo Bonzini Message-ID: <94aed630-5087-d523-1d14-475b79af80d1@redhat.com> Date: Tue, 11 Sep 2018 15:09:49 +0200 MIME-Version: 1.0 In-Reply-To: <48ae78d8-58ec-8813-8680-6f407ea46041@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka , qemu-devel Cc: "Michael S. Tsirkin" , Peter Xu , Christopher Goldsworthy On 27/08/2018 10:47, Jan Kiszka wrote: > The AMD IOMMU does not (yet) support interrupt remapping. But > kvm_arch_fixup_msi_route assumes that all implementations do and crashes > when the AMD IOMMU is used in KVM mode. > > Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip") > Reported-by: Christopher Goldsworthy > Signed-off-by: Jan Kiszka > --- > target/i386/kvm.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target/i386/kvm.c b/target/i386/kvm.c > index 9313602d3d..1fe3a73a10 100644 > --- a/target/i386/kvm.c > +++ b/target/i386/kvm.c > @@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, > MSIMessage src, dst; > X86IOMMUClass *class = X86_IOMMU_GET_CLASS(iommu); > > + if (!class->int_remap) { > + return 0; > + } > + > src.address = route->u.msi.address_hi; > src.address <<= VTD_MSI_ADDR_HI_SHIFT; > src.address |= route->u.msi.address_lo; > Queued, thanks. Paolo