From: "Jan Beulich" Subject: Re: pvh dom0: memory leak from iomem map Date: Wed, 04 Jun 2014 08:33:59 +0100 Message-ID: <538EE80702000078000179F3@mail.emea.novell.com> References: <20140603182948.073180cf@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ws5hy-00005q-0m for xen-devel@lists.xenproject.org; Wed, 04 Jun 2014 07:34:02 +0000 In-Reply-To: <20140603182948.073180cf@mantra.us.oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: xen-devel , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 04.06.14 at 03:29, 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. > > 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.. Isn't Roger's af06d66e ("x86: fix setup of PVH Dom0 memory map") already taking care of this? Jan