xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Tim Deegan <tim@xen.org>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: pvh dom0: memory leak from iomem map
Date: Fri, 6 Jun 2014 12:36:21 -0700	[thread overview]
Message-ID: <20140606123621.11c657b3@mantra.us.oracle.com> (raw)
In-Reply-To: <20140606095334.GB13425@deinos.phlegethon.org>

On Fri, 6 Jun 2014 11:53:34 +0200
Tim Deegan <tim@xen.org> wrote:

> At 19:12 -0700 on 05 Jun (1401991969), Mukesh Rathor wrote:
> > On Thu, 5 Jun 2014 11:20:32 +0200
> > Tim Deegan <tim@xen.org> wrote:
> > 
> > > 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
> > 
> > 
> > I thought about that, and wasn't sure how easy it would be to change
> > construct_dom0 for that purpose. It's common for both PV and PVH,
> > and is pretty messy as is. Anyways, Roger has already done the work
> > of reusing the frames via snooping into M2P, and repopulating those
> > frames that got invalidated when mapping iomem 1:1. 
> > 
> > We don't have any case where a frame is used for some special
> > purpose and does not have a mapping in the M2P, right? Otherwise,
> > his code would be broken....
> 
> Not that I know of.  But I can't believe that any path that builds a
> p2m, punches holes in it, and then uses the _m2p_ to figure out where
> the memory went could be the easy option. 
> 
> If doing it right the first time is too fiddly, we do have code that
> moves a frame from one gfn to another (for the xatp call) -- perhaps
> you could do that when you want to make a hole for mmio?

Well, doing it right the first time, meaning in construct_dom0 when we
populate the p2m would be the cleanest IMO. JFYI.. the reason it didn't
happen that way is because initially it didn't need to happen, because
linux guest did the repopulating. But then Roger noticed it could 
be done in xen itself, and the patch got done quickly for pvh, linux
still has the old code for pv fwiw.

Anyways, I'll add to my list.

thanks
Mukesh

      reply	other threads:[~2014-06-06 19:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04  1:29 pvh dom0: memory leak from iomem map Mukesh Rathor
2014-06-04  7:33 ` Jan Beulich
2014-06-04 23:32   ` Mukesh Rathor
2014-06-05  6:33     ` Jan Beulich
2014-06-05 10:17     ` Roger Pau Monné
2014-06-05 10:29       ` Jan Beulich
2014-06-06  2:04       ` Mukesh Rathor
2014-06-05  9:20 ` Tim Deegan
2014-06-06  2:12   ` Mukesh Rathor
2014-06-06  9:53     ` Tim Deegan
2014-06-06 19:36       ` Mukesh Rathor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140606123621.11c657b3@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=tim@xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).