From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Tim Deegan <Tim.Deegan@eu.citrix.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
xen-devel <xen-devel@lists.xensource.com>
Subject: Re: Invalid P2M entries after gnttab unmap
Date: Fri, 4 Mar 2011 18:34:53 +0000 [thread overview]
Message-ID: <1299263693.13328.9.camel@localhost.localdomain> (raw)
In-Reply-To: <20110304170236.GB23341@whitby.uk.xensource.com>
On Fri, 2011-03-04 at 17:02 +0000, Tim Deegan wrote:
> Hi,
>
> At 16:34 +0000 on 04 Mar (1299256499), Daniel De Graaf wrote:
> > When an HVM guest uses gnttab_map_grant_ref to map granted on top of valid
> > GFNs, it appears that the original MFNs referred to by these GFNs are lost.
>
> Yes. The p2m table only holds one MFN for each PFN (and vice versa).
> If you want to keep that memory you could move it somewhere else
> using XENMAPSPACE_gmfn,
In which case you might as well do the grant map to "somewhere else" I
guess?
> or just map your grant refs into an MMIO hole.
The platform-pci device has a BAR for this sort of purpose, doesn't it?
Mostly it just gets used for the grant table itself and perhaps it isn't
large enough to be a suitable source of mapping space.
Is there some reason the gntdev driver can't just balloon down
(XENMEM_decrease_reservation) to make itself a space to map and then
balloon back up (XENMEM_increase_reservation) after unmap when running
HVM?
> > in this case, perhaps half of the unmapped GFNs
> > will point to valid memory, and half will point to invalid memory. In this
> > case, "invalid memory" discards writes and returns 0xFF on all reads; valid
> > memory appears to be normal RAM.
The workaround relies entirely on this discard and read 0xff behaviour,
which I'm not sure is wise.
I'm not especially happy about the idea of 2.6.39 getting released into
the wild with this hack in it. Luckily there is plenty of time to fix
the issue properly before then.
Ian.
next prev parent reply other threads:[~2011-03-04 18:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 16:34 Invalid P2M entries after gnttab unmap Daniel De Graaf
2011-03-04 17:02 ` Tim Deegan
2011-03-04 18:34 ` Ian Campbell [this message]
2011-03-04 19:03 ` Daniel De Graaf
2011-03-04 20:53 ` [RFC/PATCH v1] xen-gntdev: Use XENMEM_populate_physmap on unmapped pages in HVM Daniel De Graaf
2011-03-05 9:50 ` Ian Campbell
2011-03-04 19:03 ` Invalid P2M entries after gnttab unmap Daniel De Graaf
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=1299263693.13328.9.camel@localhost.localdomain \
--to=ian.campbell@eu.citrix.com \
--cc=Tim.Deegan@eu.citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=xen-devel@lists.xensource.com \
/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).