|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 13/16]: PVH xen: introduce p2m_map_foreign
At 18:38 -0800 on 31 Jan (1359657504), Mukesh Rathor wrote:
> On Thu, 24 Jan 2013 17:18:15 +0000
> Tim Deegan <tim@xxxxxxx> wrote:
>
> > At 18:09 -0800 on 11 Jan (1357927784), Mukesh Rathor wrote:
> > > @@ -584,6 +584,11 @@ guest_physmap_add_entry(struct domain *d
> > > {
> > > ASSERT(mfn_valid(omfn));
> > > set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
> > > +
> > > + /* Because PVH domU uses kmalloc for grant pfn, we
> > > need to save
> > > + * and restore the old mfn */
> > > + if (is_pvh_domain(d) && p2m_is_grant(t))
> > > + free_domheap_page(mfn_to_page(omfn));
> >
> > I think you'll need to explain this in more detail. The comment
> > assumes that the guest is running linux, which is worrying. And in
> > any case you can't just free_domheap_page() the guest's memory! What
> > if another domain has a reference to it?
>
> Ok, I fixed linux side so instead of kmalloc it uses ballooning to
> get pfn space for the grant table. That means there should not be
> an omfn here. If there is, I think I should just fail the operation,
> ie, guest_physmap_add_entry(), right?
Currently, guest_physmap_add_entry() just overwrites the old entry,
allowing the guest to leak it if it wants to. It's perhaps not the best
interface in the world, but I think PVH guetst should get the same
treatment as HVM ones.
Tim.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |