|
[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 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
> > --- a/xen/common/memory.c
> > +++ b/xen/common/memory.c
> > + /* PVH note: if PVH, the gfn could be mapped to a mfn from
> > foreign
> > + * domain by the user space tool during domain creation.
> > We need to
> > + * check for that, free it up from the p2m, and release
> > refcnt on it.
> > + * In such a case, page would be NULL. */
> > +
> > + page = get_page_from_gfn(d, xrfp.gpfn, &p2mt, P2M_ALLOC);
> > + valid_pvh_pg = is_curr_pvh &&
> > + (p2m_is_mmio(p2mt) || p2m_is_foreign(p2mt));
>
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;
}
......
/* Slow path: take the write lock and do fixups */
mfn = get_gfn_type_access(p2m, gfn, t, a, q, NULL);
if ( p2m_is_ram(*t) && mfn_valid(mfn) ) <======= Add p2m_is_foreign HERE
{
Please lmk if you forsee any issues with above.
BTW, in the slow path, why doesn't it check for grant?
Also, I removed the mmio from map, so I can remove from here also.
thanks,
Mukesh
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |