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

Re: [Xen-devel] [PATCH 14/18 V2]: PVH xen: add xenmem_add_foreign_to_pmap()



On Mon, 8 Apr 2013 17:17:58 -0700
Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> wrote:

> On Thu, 21 Mar 2013 17:41:46 +0000
> Tim Deegan <tim@xxxxxxx> wrote:
> 
> > > diff --git a/xen/common/memory.c b/xen/common/memory.c
> > > index 68501d1..91a56b6 100644
> > 
> 
> Actually, looking at this again, I can't find reason why I can't just
> change get_page_from_gfn_p2m() to return page for foreign also:
> 
>     if ( likely(!p2m_locked_by_me(p2m)) )
>     {   
>         /* Fast path: look up and get out */
>         p2m_read_lock(p2m);
>         mfn = __get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
>         if ( (p2m_is_ram(*t) || p2m_is_grant(*t) ||
> p2m_is_foreign(*t)) <==== && mfn_valid(mfn)
>              && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
>         {
>             page = mfn_to_page(mfn);
>             if ( !get_page(page, d)
>                  /* Page could be shared */
>                  && !get_page(page, dom_cow) )
>                 page = NULL;
>         }
> ......

Nah, get_page() barfs on me because the mfn owner is foreign domain.
Sigh... any suggestion? May be for now, I can just leave
get_page_from_gfn_p2m() as is, and put my change back in
XENMEM_remove_from_physmap where it checks for p2m_is_foreign. 

thanks,
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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