From: Jean Guyader Subject: Re: [PATCH] hvmloader: Intel GPU passthrough, reverse OpRegion Date: Thu, 24 Nov 2011 11:19:49 +0000 Message-ID: <20111124111948.GE22563@spongy.cam.xci-test.com> References: <1322064460-22248-1-git-send-email-jean.guyader@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: Stefano Stabellini Cc: Jean Guyader , Keir Fraser , "allen.m.kay@intel.com" , "xen-devel@lists.xensource.com" , Jean Guyader List-Id: xen-devel@lists.xenproject.org On 24/11 11:18, Stefano Stabellini wrote: > On Wed, 23 Nov 2011, Jean Guyader wrote: > > On 23 November 2011 17:28, Jean Guyader wrote: > > > On 23 November 2011 17:20, Keir Fraser wrote: > > >> On 23/11/2011 16:07, "Jean Guyader" wrote: > > >> > > >>> > > >>> The Intel GPU uses a two pages NVS region called OpRegion. > > >>> In order to get full support for the driver in the guest > > >>> we need to map this region. > > >>> > > >>> This patch reserves 2 pages on the top of the RAM and > > >>> mark this region as NVS in the e820. Then we write the > > >>> address to the config space (offset 0xfc) so the device > > >>> model can map the OpRegion at this address in the guest. > > >> > > >> Please use mem_hole_alloc() rather than adjusting {low,high}_mem_pgend. > > >> > > > > > > Ok, that is handy. > > > > > >> Is it correct to do this for *all* gfx devices with Intel vendor id? > > >> > > > > > > The OpRegion is a Intel GPU specific thing. > > > > > > > Sorry didn't read carefully the first time, yes I think it's correct > > to do that for > > all the Intel GPU. Maybe I can do a read on 0xfc first to check if I don't get > > something dodgy like 0xfffffff or 0. I could also double check in Qemu that it's > > a NVS region on the host, but that won't work for stub domain. > > access to physical memory through /dev/mem should work from the stubdom I would think that /dev/mem in a stubdom will expose the memory of the guest but maybe I'm wrong. Jean