From nobody Thu Nov 6 01:10:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538296433499653.2349150706143; Sun, 30 Sep 2018 01:33:53 -0700 (PDT) Received: from localhost ([::1]:54314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6XAj-0004It-C7 for importer@patchew.org; Sun, 30 Sep 2018 04:33:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WrB-00028y-Rj for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WrA-0000BB-Le for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:37 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:42318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WrA-00009B-D4 for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:36 -0400 Received: by mail-wr1-x443.google.com with SMTP id b11-v6so10455217wru.9 for ; Sun, 30 Sep 2018 01:13:36 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.13.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VP2jWCRKMalZ2ZNwt8YqF6mNrKAYTDF8cH0RwhYDLF4=; b=iC7EyEga77iGGR3hfjJPpSVeAB2Kr/xQOqTqP7h6FKILTj6tTBKmTr81vf+7PIW6+P xB/UnpnQAFCLpJM8XaNNx+JZdnRwfG6/VWc+SxFJgYrnM/eyoEK0hgDi/K9rmjZJ+Jcm BJeVUHu0PjYmY/8TSJ1DKw40ny3zzfQMJYkxl/Kj+oVsei8vvSILUZdpYtdUBdU/MLKx /QmeYBfGjD7++SdD9CV+lPDuAOQsQ4ENreRbleslT0ny3UeH1RyCFHmA1/DqZMpiWmaa ZXmaOCKHegQX1QB/kjYJbIPR0CnIcvD3Uc07tIlgI5qXPSugXMmcWmtv7DWLe7rO6J5F WsKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VP2jWCRKMalZ2ZNwt8YqF6mNrKAYTDF8cH0RwhYDLF4=; b=pejvMo1eHjGdiZe8LA3qaB69WKyEepdat1EN4sabW2Ty8ZGxTe+N0tml0PGrGgRd/1 Z4V61qrxAxC5apFZ2oEl6cyTOMbCbkS03GxbUxpSCwhh4pIssX31t3DmNSZe6V8muu4f RTK90EOGjGhxSrYOJOfgBcjS+vhiwkpS6BjQYWUxb9PoPNJ8IblCsTv4fo8/2IhknwYx hcKzYpDr9UbxSKXpKYmQ8JP3Fb4TyUnzfQ0ClV1qshp0iAem36PvRwg3JtSH6fxFGACK P+CwCav939zbKGjpfaKhQM7CJR5be47fYyKEEKTrJkbJnXH/S8faeGSBgmv2t5FwT/5O sPqQ== X-Gm-Message-State: ABuFfoh+eDBRLJVzeCLsnNFDivgmt8Utnmbna0isisUghazgf5j02IUo FSI+DKtH+g2Ow50WIN6BcwCHG7OO X-Google-Smtp-Source: ACcGV63A1rzl5EXF5xGZi06uXN78pXOfapgYdf5WXA8rve/Ah4Oe8qrD885KIY0WV9yYCHsYeNxtbg== X-Received: by 2002:adf:a144:: with SMTP id r4-v6mr3641774wrr.169.1538295215038; Sun, 30 Sep 2018 01:13:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:15 +0200 Message-Id: <1538295197-23704-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PULL 17/79] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kiszka Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jan Kiszka 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 Message-Id: <48ae78d8-58ec-8813-8680-6f407ea46041@siemens.com> Reviewed-by: Peter Xu Reviewed-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0b2a07d..de892db 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3669,6 +3669,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_= entry *route, MSIMessage src, dst; X86IOMMUClass *class =3D X86_IOMMU_GET_CLASS(iommu); =20 + if (!class->int_remap) { + return 0; + } + src.address =3D route->u.msi.address_hi; src.address <<=3D VTD_MSI_ADDR_HI_SHIFT; src.address |=3D route->u.msi.address_lo; --=20 1.8.3.1