aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@citrix.com>2011-06-02 13:16:52 +0100
committerTim Deegan <Tim.Deegan@citrix.com>2011-06-02 13:16:52 +0100
commit4ce6c4a45536f7e8094ef3f1cebfa048f23028f0 (patch)
tree93a99593392617e3cd4a608bf414ea15569e564a /xen/common/memory.c
parent8c7d0b26207932a07061b03e1873dc3c8987f568 (diff)
downloadxen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.tar.gz
xen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.tar.bz2
xen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.zip
x86/mm/p2m: Make p2m interfaces take struct domain arguments.
As part of the nested HVM patch series, many p2m functions were changed to take pointers to p2m tables rather than to domains. This patch reverses that for almost all of them, which: - gets rid of a lot of "p2m_get_hostp2m(d)" in code which really shouldn't have to know anything about how gfns become mfns. - ties sharing and paging interfaces to a domain, which is what they actually act on, rather than a particular p2m table. In developing this patch it became clear that memory-sharing and nested HVM are unlikely to work well together. I haven't tried to fix that here beyond adding some assertions around suspect paths (as this patch is big enough with just the interface changes) Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 382caf6c51..b3dfa07b9e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -162,11 +162,11 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
unsigned long mfn;
#ifdef CONFIG_X86
- mfn = mfn_x(gfn_to_mfn(p2m_get_hostp2m(d), gmfn, &p2mt));
+ mfn = mfn_x(gfn_to_mfn(d, gmfn, &p2mt));
if ( unlikely(p2m_is_paging(p2mt)) )
{
guest_physmap_remove_page(d, gmfn, mfn, 0);
- p2m_mem_paging_drop_page(p2m_get_hostp2m(d), gmfn);
+ p2m_mem_paging_drop_page(d, gmfn);
return 1;
}
#else
@@ -363,7 +363,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
p2m_type_t p2mt;
/* Shared pages cannot be exchanged */
- mfn = mfn_x(gfn_to_mfn_unshare(p2m_get_hostp2m(d), gmfn + k, &p2mt));
+ mfn = mfn_x(gfn_to_mfn_unshare(d, gmfn + k, &p2mt));
if ( p2m_is_shared(p2mt) )
{
rc = -ENOMEM;