From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: [PATCH] VT-d: Fix iommu map page for mmio pages Date: Sat, 27 Sep 2008 02:57:31 +0300 Message-ID: <20080926235730.GE9118@il.ibm.com> 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> <48DC07DC.2010201@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org, Amit Shah , "Kay, Allen M" , Ben-Ami Yassour1 To: Anthony Liguori Return-path: Received: from mtagate4.uk.ibm.com ([195.212.29.137]:37847 "EHLO mtagate4.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbYIZX6B (ORCPT ); Fri, 26 Sep 2008 19:58:01 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate4.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m8QNw068269464 for ; Fri, 26 Sep 2008 23:58:00 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8QNvx1J4083820 for ; Sat, 27 Sep 2008 00:57:59 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8QNvxuV000548 for ; Sat, 27 Sep 2008 00:57:59 +0100 Content-Disposition: inline In-Reply-To: <48DC07DC.2010201@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Sep 25, 2008 at 04:51:24PM -0500, Anthony Liguori wrote: > 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. Unlikely, but ok. > 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. It would be insane to me. Have you tried this on real hardware and seen it work? >> 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). I strongly disagree. You are advocating something that is potentially unsafe---for the sake of code simplicity?! I am advocating caution in what we let an *untrusted* guest do. Cheers, Muli -- The First Workshop on I/O Virtualization (WIOV '08) Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/ xxx SYSTOR 2009---The Israeli Experimental Systems Conference http://www.haifa.il.ibm.com/conferences/systor2009/