From nobody Fri Oct 24 21:49:10 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; 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 1519923059976832.0506878261573; Thu, 1 Mar 2018 08:50:59 -0800 (PST) Received: from localhost ([::1]:58090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erRQ3-0001S2-2F for importer@patchew.org; Thu, 01 Mar 2018 11:50:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erRLC-0006AG-7K for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erRLB-0000ku-5X for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:45:58 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52422 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 1erRLA-0000kS-W5 for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:45:57 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FF6A404085A; Thu, 1 Mar 2018 16:45:56 +0000 (UTC) Received: from redhat.com (ovpn-123-220.rdu2.redhat.com [10.10.123.220]) by smtp.corp.redhat.com (Postfix) with SMTP id 0AF2A2026E04; Thu, 1 Mar 2018 16:45:56 +0000 (UTC) Date: Thu, 1 Mar 2018 18:45:55 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1519922735-29054-4-git-send-email-mst@redhat.com> References: <1519922735-29054-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1519922735-29054-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 16:45:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 16:45:56 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/13] intel-iommu: Accept 64-bit writes to FEADDR 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: Peter Maydell , Eduardo Habkost , Jan Kiszka , Peter Xu , Marcel Apfelbaum , Luis Lloret , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jan Kiszka Xen is doing this [1] and currently triggers an abort. [1] http://xenbits.xenproject.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Dxen/driv= ers/passthrough/vtd/iommu.c;h=3Ddaaed0abbdd06b6ba3d948ea103aadf02651e83c;hb= =3Drefs/heads/master#l1108 Reported-by: Luis Lloret Signed-off-by: Jan Kiszka Reviewed-by: Peter Xu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/intel_iommu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 2e841cd..fb31de9 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2129,8 +2129,15 @@ static void vtd_mem_write(void *opaque, hwaddr addr, =20 /* Fault Event Address Register, 32-bit */ case DMAR_FEADDR_REG: - assert(size =3D=3D 4); - vtd_set_long(s, addr, val); + if (size =3D=3D 4) { + vtd_set_long(s, addr, val); + } else { + /* + * While the register is 32-bit only, some guests (Xen...) wri= te to + * it with 64-bit. + */ + vtd_set_quad(s, addr, val); + } break; =20 /* Fault Event Upper Address Register, 32-bit */ --=20 MST