From: Tim Deegan Subject: Re: Re: xc_translate_foreign_address() returns mfn?? Date: Fri, 19 Dec 2008 17:13:12 +0000 Message-ID: <20081219171312.GA21790@york.uk.xensource.com> References: 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: Jun Koi Cc: "List: Xen Developers" List-Id: xen-devel@lists.xenproject.org Hi, At 23:38 +0900 on 19 Dec (1229729882), Jun Koi wrote: > So everything indicates that xc_translate_foreign_address() actually > returns gfn, not mfn like in its comment. Could anybody confirms that > the function works well on both PV and HVM? To the best of my knowledge that function does not work at all for HVM (at least, I know it is broken when using 32-bit tools and 64-bit xen). I have a half-done patchset that cleans it up considerably, fixing HVM and compat issues, which I'll probably post at the end of the month. In any case, you are right: these functions (like _almost_ every other interface dealing with guest memory) deals in what in the shadow code are called GFNs. That is, untranslated GPFNs for HVM guests, and MFNs for PV. The use of "mfn" in the source code is probably an indicator that this code pre-dates HVM guest support. > And I think xc_map_foreign_range() actually works with gfn, not mfn. > Does it work with both PV and HVM, too? Yes indeed! Lots of other things rely on it (qemu-dm, save/restore, etc). Cheers, Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]