Received: from eggs.gnu.org ([2001:4830:134:3::10]:52838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en0dT-0001Ts-Nf for qemu-devel@nongnu.org; Sat, 17 Feb 2018 06:26:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en0dQ-00018y-K3 for qemu-devel@nongnu.org; Sat, 17 Feb 2018 06:26:31 -0500 Received: from mout.web.de ([217.72.192.78]:52833) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en0dQ-000189-9x for qemu-devel@nongnu.org; Sat, 17 Feb 2018 06:26:28 -0500 From: Jan Kiszka Message-ID: <2837d007-760a-f2c1-c8cd-6f7d4f6f0bbd@web.de> Date: Sat, 17 Feb 2018 12:26:19 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] intel-iommu: Accept 64-bit writes to FEADDR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Peter Xu Cc: qemu-devel , "Lloret, Luis" From: Jan Kiszka Xen is doing this [1] and currently triggers an abort. [1] http://xenbits.xenproject.org/gitweb/?p=xen.git;a=blob;f=xen/drivers/passthrough/vtd/iommu.c;h=daaed0abbdd06b6ba3d948ea103aadf02651e83c;hb=refs/heads/master#l1108 Reported-by: Luis Lloret Signed-off-by: Jan Kiszka --- hw/i386/intel_iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 2e841cde27..b61d0da270 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2129,7 +2129,12 @@ static void vtd_mem_write(void *opaque, hwaddr addr, /* Fault Event Address Register, 32-bit */ case DMAR_FEADDR_REG: - assert(size == 4); + /* + * While the register is 32-bit only, some guests (Xen...) write to it + * with 64-bit. Ignore the upper part, that's likely what the hardware + * does as well (plus the upper part is not used by our model anyway). + */ + assert(size >= 4); vtd_set_long(s, addr, val); break; -- 2.13.6