[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.