From patchwork Wed Jan 24 14:18:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 10182645 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 3F6E1602B7 for ; Wed, 24 Jan 2018 14:28:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32ED1260CD for ; Wed, 24 Jan 2018 14:28:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25695288D2; Wed, 24 Jan 2018 14:28:28 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 188A0260CD for ; Wed, 24 Jan 2018 14:28:27 +0000 (UTC) Received: from localhost ([::1]:52119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeM2M-0003N5-7q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jan 2018 09:28:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeLuB-00075x-Gw for qemu-devel@nongnu.org; Wed, 24 Jan 2018 09:20:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeLu6-00080J-M6 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 09:19:59 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53471) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eeLu6-0007yG-G0 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 09:19:54 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 8E6052230D; Wed, 24 Jan 2018 09:19:52 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Wed, 24 Jan 2018 09:19:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=n/YkMZJHJXwGBY4MscDO6nA1EPJOM 8dhpxXheI1GzGU=; b=BCUnN9mNRBkzw/jpH0ml0YPcdTjpDSIYc2Mucv2Klru2+ jsxOahST+PRFAjpUVJZMEmh6ETre1pjgHLbaSObgjTZnja90YVjTsHU4LSdYmf4P aRfAKpOcYSYiZRTFPTDe0wQsZVND84I5igmocqbhUNVxPQYn9Lqn/u3gwKSJukQV 23eemH4uOC6Cg8CcEKC4MeImWPxOLTHqN56jl4aQFW5hrrj4GnHs757m41CcIvFs lBrIMdh96QVEAK+LiI44uETvAWYlSocvrXLlgrRx+2j3zuuG6j6CUFvNT68txo/S 7CBTAfDs/SZs8fD5WbiSIkS3MwWlT/E8gZ3h/EhtA== X-ME-Sender: Received: from localhost.localdomain (ip5b40bfaa.dynamic.kabel-deutschland.de [91.64.191.170]) by mail.messagingengine.com (Postfix) with ESMTPA id C6BF3247A9; Wed, 24 Jan 2018 09:19:51 -0500 (EST) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: qemu-devel@nongnu.org Date: Wed, 24 Jan 2018 15:18:48 +0100 Message-Id: <20180124141848.3969-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 Organization: Invisible Things Lab X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 X-Mailman-Approved-At: Wed, 24 Jan 2018 09:27:13 -0500 Subject: [Qemu-devel] [PATCH] intel_iommu: allow updating FEADDR and FEUADDR with one 64bit write 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: xen-devel@lists.xenproject.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Allow updating those two adjacent 32bit fields with one 64bit write. This fixes qemu crash when booting Xen inside. See discussion on Xen side of the thing here: http://xen.markmail.org/message/6mrmemrnmhxvaxba Signed-off-by: Marek Marczykowski-Górecki --- hw/i386/intel_iommu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 2e841cde27..d214dce277 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2129,8 +2129,12 @@ static void vtd_mem_write(void *opaque, hwaddr addr, /* Fault Event Address Register, 32-bit */ case DMAR_FEADDR_REG: - assert(size == 4); - vtd_set_long(s, addr, val); + assert(size == 4 || size == 8); + if (size == 4) { + vtd_set_long(s, addr, val); + } else { + vtd_set_quad(s, addr, val); + } break; /* Fault Event Upper Address Register, 32-bit */