From patchwork Sat Feb 17 11:26:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 10226071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 622FD602CB for ; Sat, 17 Feb 2018 11:27:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39FAE20407 for ; Sat, 17 Feb 2018 11:27:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C9EF21327; Sat, 17 Feb 2018 11:27:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62F3E20407 for ; Sat, 17 Feb 2018 11:27:30 +0000 (UTC) Received: from localhost ([::1]:38899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en0eP-0001Vf-Rz for patchwork-qemu-devel@patchwork.kernel.org; Sat, 17 Feb 2018 06:27:29 -0500 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 Received: from [192.168.1.10] ([95.157.57.47]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MI63m-1emTSs0y0U-003sO5; Sat, 17 Feb 2018 12:26:20 +0100 To: "Michael S. Tsirkin" , Peter Xu From: Jan Kiszka Message-ID: <2837d007-760a-f2c1-c8cd-6f7d4f6f0bbd@web.de> Date: Sat, 17 Feb 2018 12:26:19 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:jYEZPtVw8b7vjQz0UQ/OVnuLA736+I0AQvAJjphsws6YvdEJJgR mYqxPm7qsviLmzkDPpILU1/bh5UP7iY0x9Rmnl68x++dbtYzBLAVFAdsfxeEeh2XbDGGIsz 6m/bkID6bPyZa+CUA7TtjkY3CDPqFBEZxG+V4kvsC7NbEXe0E+cYiS+VjsiYtg7uW6wZCMY zYGfxl2TaA+Aw2ly0bcyQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:LWkQm3tcxeU=:QdY94Fq70BowKp3Oe9bSqS Um5dkOcvXOrRI4CFhfmwF8XO2ih3pcagFA9lUlpURJFF+0885R0cLciXpDRZ9xMJ5BtQIfzY9 ZyVmumcY9RRjGs236vY39QMXXLXWW8r7ktM/QcBWpIlyq6h0DyAPvPrwOiaNbZ2g4Lw3BEKLS qPQR3mwJnNtumwKrmhvLaHS2AjydjKu5997Xkemur2m3pOC6kpvB60UhwxmI+dGstb0m2EyFr p+x76fHCIsxSv0T9N1/rt/tX9fOGLUToruX5xkX+/XSt//k5mJsGKaBetcFxNNHTCkQPV4k+t QiMZRreJW/uLrVXz29d2BKzqE47kz1zJ5fLq+Nw0jx7oppdkabASc/caFX80lclPLUJXhov7J mxObkV7TxY0f+KIHb2sPAvTX9uLQJH+xBs/aPG9PaFbLmMZ6Qivg2OoIpsICZ/dGRduknOlZ3 YdzOwJH7BAHSHU/DcdpY5BjpFGtup5Alis2X5HQ/s8miXqmsP7F+e7FmFioPluF3uqRna3hX7 Ve8svFO3cfNQ8s6CCIDWNM5+q+7n1eKkFGKlxtaX5Fe5vGSYGbYLoQG91t3BG91vdgKehh/yL fmSWk4NmzT+qY7oS6tPcMG5ptefdsedeDzZfOAtG2je3r47NrpwQD7XP0dfENlNcdOCeZeEF8 gGyBUnc+mWr1dXGLhPyaHSspuGAq+lEXHC1a0A+hRWsnLI8S858YxMJi9LNYy60ps8Gximt8S 7xCHvjySOJrWA3fV/GHVKlHovbFzpWLAOkqSS9BMdQqSquohl5OAw0pNl2hRstQU7iOk9zMZQ dQ8yE1H1TM8Enk1SvjaKEnmc6I2INTLswa/cS7BabnvOn9eNa4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.78 Subject: [Qemu-devel] [PATCH] 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: "Lloret, Luis" , qemu-devel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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;