From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Armbruster Subject: Re: [PATCH] Paravirt framebuffer frontend kernel support [1/5] Date: Thu, 02 Nov 2006 08:53:38 +0100 Message-ID: <87ac3az3lp.fsf@pike.pond.sub.org> References: <1157227080.11059.38.camel@aglarond.local> <20060904090045.GA4812@cam.ac.uk> <87hczgrx07.fsf@pike.pond.sub.org> <20060910093801.GA1874@cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <20060910093801.GA1874@cam.ac.uk> (Steven Smith's message of "Sun, 10 Sep 2006 10:38:01 +0100") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Steven Smith Cc: aliguori , Jeremy Katz , xen-devel , sos22@srcf.ucam.org List-Id: xen-devel@lists.xenproject.org Steven Smith writes: [...] >> As far as I can see, this is our only option right now. I'm ignorant >> of `shadow translate mode'; can somebody please educate me on how to >> detect and translate shadow translate mode frontend mfns in the >> backend? > Shadow translate mode is a mode of the shadow page tables in which Xen > does machine<->physical address translations on behalf of the guest. > It's mostly used for HVM guests to give them the impression of a > mostly-contiguous block of memory starting at machine address 0. > > If you just bung the guest-supplied machine frame numbers through > xc_translate_gpfn_list you should be fine. That does the translation > if you're in shadow translate mode and does nothing if you're not. Assuming you mean xc_domain_translate_gpfn_list(). I tried translating fbdev_mfn right before use, as follows: ret = xc_domain_translate_gpfn_list(xenfb->xc, domid, 1, &fbdev_mfn, &fbdev_mfn); if (ret < 0) goto error; xenfb->fb_info = xc_map_foreign_range(xenfb->xc, domid, XC_PAGE_SIZE, PROT_READ | PROT_WRITE, fbdev_mfn); if (xenfb->fb_info == NULL) goto error; However, xc_domain_translate_gpfn_list() always fails with EINVAL for me. If I read its code correctly, this can happen because op.nr_gpfns is too large, or !shadow_mode_translate(). I suspect its the latter. Should I call it only when in shadow translate mode? How to check for that? Or am I doing something wrong?