From: Tim Deegan Subject: Re: Is there a way to map pv guest pseudo physical address into dom0? Date: Mon, 27 Jun 2011 10:33:45 +0100 Message-ID: <20110627093345.GH17634@whitby.uk.xensource.com> References: <1309165317.32717.160.camel@zakaz.uk.xensource.com> <1309166253.32717.167.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Wei Liu Cc: Ian Campbell , Anthony Perard , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org At 17:26 +0800 on 27 Jun (1309195596), Wei Liu wrote: > > You need to arrange for the Xen specific bit of the virtio frontend to > > do the p2m translation. All externally visible addresses from a PV guest > > must be in MFN space. > > > > That's not a good approach. Dirvers reside on a higher level from the > "Xen specific bit". Doing this kind of translation will break their > generality. But there seems no other way to get this job done... This is a general problem with operating systems: bus addresses are not always the same as CPU memory addresses (even though in the easy case of a simple x86 PC they often are). This is why OSes already have interfaces to allocate DMA-able memory and to translate between the address that CPU will map and the one the peripheral should use. If your driver's not using the right address-space to program its hardware it is broken; the Xen PV model is just an extreme case of this. Tim. -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)