From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] VT-d: Fix iommu map page for mmio pages Date: Thu, 25 Sep 2008 16:51:24 -0500 Message-ID: <48DC07DC.2010201@codemonkey.ws> References: <0122C7C995D32147B66BF4F440D3016301BE2C10@pdsmsx415.ccr.corp.intel.com> <48DB6777.7070709@redhat.com> <0122C7C995D32147B66BF4F440D3016301C7D0EB@pdsmsx415.ccr.corp.intel.com> <48DB98FD.3000307@redhat.com> <0122C7C995D32147B66BF4F440D3016301C7D0FF@pdsmsx415.ccr.corp.intel.com> <48DBA40A.7030508@redhat.com> <20080925211423.GC6788@il.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Amit Shah , "Kay, Allen M" , Ben-Ami Yassour1 To: Muli Ben-Yehuda Return-path: Received: from mail-gx0-f16.google.com ([209.85.217.16]:51250 "EHLO mail-gx0-f16.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754156AbYIYVw0 (ORCPT ); Thu, 25 Sep 2008 17:52:26 -0400 Received: by gxk9 with SMTP id 9so7668912gxk.13 for ; Thu, 25 Sep 2008 14:52:25 -0700 (PDT) In-Reply-To: <20080925211423.GC6788@il.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Muli Ben-Yehuda wrote: > On Thu, Sep 25, 2008 at 05:45:30PM +0300, Avi Kivity wrote: > >> Han, Weidong wrote: >> >>> Is it possible DMA into an mmio page? >>> >> I don't see why not. >> > > Two reasons. First it makes no sense. MMIO pages don't have RAM > backing them, they have another device's register window. So the > effect of DMA'ing into an MMIO page would be for one device to DMA > into the register window of another device, which sounds to me insane. > MMIO isn't just a register window. It may be an on-device buffer. For instance, all packets are stored in a buffer on the ne2k that's mapped via mmio. It would seem entirely reasonable to me to program an IDE driver to DMA directly into the devices packet buffer. > Second, and more importantly, I've seen systems where doing the above > caused a nice, immediate, reboot. So I think that unless someone comes > with a valid scenario where we need to support it or something breaks, > we'd better err on the side of caution and not map pages that should > not be DMA targets. > Xen maps the MMIO pages into the VT-d table. The system you were using could have just been busted. I think the burden is to prove that this is illegal (via the architecture specification). Regards, Anthony Liguori > Cheers, > Muli >