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

Re: [Xen-devel] guest physical to xen machine copy?



On 29/9/08 19:50, "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> wrote:

> Hmmm...  gfn_to_mfn() when used as below seems to just
> return the original gfn, e.g.
> 
> guest_mfn = gfn_to_mfn(current->domain,gpfn,&t);
> 
> Is this correct?  Note that current->domain is a 32-bit
> paravirtualized domain and xen is 64-bit, if that matters.
> (Is there a better way if one knows that the domain is
> always pv?)

Xen doesn't do pfn-to-mfn translation for PV guests. They do it themselves
with their own p2m table. So, for a PV guest, gfn==mfn.

>> Use p2m_is_ram() instead of checking individual p2m ram type
> 
> In copying the other direction (e.g. copy_page_TO_guest),
> I think I need to check for t==p2m_ram_rw, right?

You need to check for not p2m_ram_ro. You also should page_mark_dirty()
(__hvm_copy() does it unconditionally on pages it modifies).

 -- Keir

> If so, the "Not necessarily true" comment in static
> inline _gfn_to_mfn in include/asm-x86/p2m.h worries me.
> Should it?




_______________________________________________
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®.