From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR6Vt-0003dH-1i for qemu-devel@nongnu.org; Thu, 26 Feb 2015 17:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YR6Vo-0002p5-TT for qemu-devel@nongnu.org; Thu, 26 Feb 2015 17:02:32 -0500 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:38319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR6Vo-0002om-NV for qemu-devel@nongnu.org; Thu, 26 Feb 2015 17:02:28 -0500 Received: by wesw55 with SMTP id w55so15176995wes.5 for ; Thu, 26 Feb 2015 14:02:28 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54EF97F0.7020104@redhat.com> Date: Thu, 26 Feb 2015 23:02:24 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150226144504.GA23124@stefanha-thinkpad.redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ahci: map memory via device's address space instead of address_space_memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jordan Hargrave , Stefan Hajnoczi Cc: qemu-devel@nongnu.org On 26/02/2015 22:31, Jordan Hargrave wrote: > > My OS initializes DMAR page tables and then enables the IOMMU translation. > Then OS initializes AHCI driver. Writes VIRTUAL DMA to FIS registers. > eg. FIS DMA address is 0x10000 (maps to some hardware physical address > via iommu) > > The OS writes 0x00 PORT_FIS_ADDR_HI -> qemu calls map_page (0x00 << 32) > | 0x7fae0000... 0x7fae0000 is stale, and is not in the IOMMU page map. > Causes a non-recoverable IOMMU fault. That's a bug in QEMU. map_page must be skipped unless PORT_CMD_FIS_ON is set in pr->cmd (also, QEMU is never resetting PORT_CMD_FIS_ON when PORT_CMD_FIS_RX goes down). Paolo