xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Invalid P2M entries after gnttab unmap
@ 2011-03-04 16:34 Daniel De Graaf
  2011-03-04 17:02 ` Tim Deegan
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel De Graaf @ 2011-03-04 16:34 UTC (permalink / raw)
  To: xen-devel, Ian Campbell

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.
The unmap operation sets the p2m mapping of the GFN to INVALID_MFN (and it
appears that replace_grant_p2m_mapping will not accept valid MFNs).

Most of the time, this appears to be true in testing. However, I have
noticed a few cases where the GFNs are valid following the unmap operation.
This has happened when a large number of grants (1284) are being unmapped
due to a domain shutdown; 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.

There doesn't appear to be any documentation on the intended behavior here.
>From the guest kernel's perspective, it makes the most sense for GFNs that
pointed to RAM prior to the map operation to continue to point to RAM after
the unmap operation - that is, the unmap fully undoes what the map did. The
contents of the pages (and which exact MFN they point to) aren't important.

-- 
Daniel De Graaf
National Security Agency

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-05  9:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).