WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Does paging_gva_to_gfn() convert to mfn for PV guests?

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
Subject: Re: [Xen-devel] Does paging_gva_to_gfn() convert to mfn for PV guests?
From: "Mike Sun" <msun@xxxxxxxxxx>
Date: Tue, 13 May 2008 12:12:35 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 13 May 2008 09:13:00 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=kQrF+UvTfYq7tGFa1WnEWVzzoryllHcrw+m3IOw5bfA=; b=mBWffpshJgcX/Iwp16Nye4m8kLMUFMQJY6xJYiDCdH1RfzneBETf9c7DJxWP2BUCG+aaH9m9Cycr2rVef+aezK8bNBjH8aGlK5uM9Th5PIxvftdOYAL/o3z3XzC7dBWg/VKJBlQzJ3jC0tQSvlrylzQmrsi5rT5WN7Po7PyFdaI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=XCvtE0yMoTXcqaYxZ0SO/6u8CRxDraMmgDCjUjsKvfuqG3TkFqPgwSifskbEJRLU+SgSxu0hLSHQwHoPNsxPqzKxqkRv0gXuUkxKWX6bP5GmBDp2fBonITPWorW45sYjZgxG9XcEb4IiLZeunCUEVdiDPeuz9Bt030i4rm8uV3o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080513160425.GB4923@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <e4e579070805121301j1f823221u6160adee2080fdc5@xxxxxxxxxxxxxx> <20080513083428.GA4923@xxxxxxxxxxxxxxxxxxxxx> <e4e579070805130823s5f75406fh65c9bea8ea2edeca@xxxxxxxxxxxxxx> <20080513160425.GB4923@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks Tim.  In that case, is there a function or macro that will
translate a guest va from dom0 to mfn in Xen?

I've seen that functions like copy_to_guest will allow Xen to write
into a dom0 guest address, but the way it's it's implemented (kernel
to userspace copy), seems to require that the current address space in
cr3 be the same as the guest process containing that guest address.  I
want to be able to copy from Xen to a guest address in dom0 regardless
of what guest address space is currently loaded in cr3.  I was hoping
to do the gva --> mfn translation, store the mfn and map that mfn in
to Xen on demand when I wanted to do the copy.

Any ideas?

Thanks,
Mike

On Tue, May 13, 2008 at 12:04 PM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
> At 11:23 -0400 on 13 May (1210677791), Mike Sun wrote:
>  > Hmm... I'm not sure if I'm understanding clearly what you're saying.
>  > If I use this function to translate virtual addresses from dom0 (a PV
>  > guest without shadow paging). will I get an mfn or a pfn?
>
>  No. :)  The code behind that function relies on data structures which are
>  only maintained if paging assistance (shadow or HAP) is turned on.
>
>
>  > My expectation would be that I get an mfn since PV guests without any
>  > sort of shadow paging have virt --> machine translations installed in
>  > the page tables and do not actually use the p2m table for translation.
>  >  Is this correct?
>
>  In the case of PV guests with shadow pagetables turned on (typically
>  this is only while live migration is in progress), then yes, you should
>  get an MFN.
>
>  Cheers,
>
>
>
>  Tim
>
>  --
>  Tim Deegan <Tim.Deegan@xxxxxxxxxx>
>  Principal Software Engineer, Citrix Systems (R&D) Ltd.
>  [Company #02300071, SL9 0DZ, UK.]
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel