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

Re: [Xen-devel] pvh dom0: memory leak from iomem map



At 18:29 -0700 on 03 Jun (1401816588), Mukesh Rathor wrote:
> Hi Tim,
> 
> When building a dom0 pvh, we populate the p2m with 0..N pfns upfront. Then
> in pvh_map_all_iomem, we walk the e820 and map all iomem 1:1. As such
> any iomem range below N would cause those ram frames to be silently dropped. 
> Since the holes could be pretty big, I am concenred this could result
> in significant loss of frames. 

Right.  So, er, don't do that then? :)  You have all the information
you need available at the time that you build dom0's p2m, so why not
just do it right the first time instead of fixing up afterwards?  It's
not like the pvh dom0 p2m building code is shared with anything else.

The change you suggest doesn't really DTRT anyway: it just drops dom0
memory on the floor.  A sufficiently inconvenient host memory map
would lead to freeing most of dom0's memory and failing the boot.

Tim.

> In my very early patches I had:
> 
> set_typed_p2m_entry():
> ...
>     else if ( p2m_is_ram(ot) )
>     {
>          if ( is_pvh_domain(d) )                    <---
>              free_domheap_page(mfn_to_page(omfn));  <---
> 
>          ASSERT(mfn_valid(omfn));
>          set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
> ..
> 
> I'd like you to reconsider it. Since there is a dislike using is_pvh, 
> I suppose one alternative could be, 'if ( gfn_p2mt == p2m_mmio_direct)'.
> 
> If you have any other suggestions, I'm open to them. LMK your thoughts..
> 
> 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®.