aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/domctl.c
diff options
context:
space:
mode:
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>2011-11-11 18:11:34 +0000
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>2011-11-11 18:11:34 +0000
commit51032ca058e43fbd37ea1f7c7c003496f6451340 (patch)
tree179fda9e3eba652562ca7aa3e6139852cbe3ed23 /xen/arch/x86/domctl.c
parente0594d9bc1c7996840f421a4084830d5a296e51b (diff)
downloadxen-51032ca058e43fbd37ea1f7c7c003496f6451340.tar.gz
xen-51032ca058e43fbd37ea1f7c7c003496f6451340.tar.bz2
xen-51032ca058e43fbd37ea1f7c7c003496f6451340.zip
Modify naming of queries into the p2m
Callers of lookups into the p2m code are now variants of get_gfn. All callers need to call put_gfn. The code behind it is a no-op at the moment, but will change to proper locking in a later patch. This patch does not change functionality. Only naming, and adds put_gfn's. set_p2m_entry retains its name because it is always called with p2m_lock held. This patch is humongous, unfortunately, given the dozens of call sites involved. After this patch, anyone using old style gfn_to_mfn will not succeed in compiling their code. This is on purpose: adapt to the new API. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/domctl.c')
-rw-r--r--xen/arch/x86/domctl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 5d5cd3a01b..02f8c85443 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -199,7 +199,7 @@ long arch_do_domctl(
for ( j = 0; j < k; j++ )
{
- unsigned long type = 0, mfn = gmfn_to_mfn(d, arr[j]);
+ unsigned long type = 0, mfn = get_gfn_untyped(d, arr[j]);
page = mfn_to_page(mfn);
@@ -235,6 +235,7 @@ long arch_do_domctl(
type = XEN_DOMCTL_PFINFO_XTAB;
arr[j] = type;
+ put_gfn(d, arr[j]);
}
if ( copy_to_guest_offset(domctl->u.getpageframeinfo3.array,
@@ -299,7 +300,8 @@ long arch_do_domctl(
for ( j = 0; j < k; j++ )
{
struct page_info *page;
- unsigned long mfn = gmfn_to_mfn(d, arr32[j]);
+ unsigned long gfn = arr32[j];
+ unsigned long mfn = get_gfn_untyped(d, gfn);
page = mfn_to_page(mfn);
@@ -310,8 +312,10 @@ long arch_do_domctl(
unlikely(is_xen_heap_mfn(mfn)) )
arr32[j] |= XEN_DOMCTL_PFINFO_XTAB;
else if ( xsm_getpageframeinfo(page) != 0 )
+ {
+ put_gfn(d, gfn);
continue;
- else if ( likely(get_page(page, d)) )
+ } else if ( likely(get_page(page, d)) )
{
unsigned long type = 0;
@@ -339,6 +343,7 @@ long arch_do_domctl(
else
arr32[j] |= XEN_DOMCTL_PFINFO_XTAB;
+ put_gfn(d, gfn);
}
if ( copy_to_guest_offset(domctl->u.getpageframeinfo2.array,
@@ -425,12 +430,13 @@ long arch_do_domctl(
break;
}
- mfn = gmfn_to_mfn(d, gmfn);
+ mfn = get_gfn_untyped(d, gmfn);
ret = -EACCES;
if ( !mfn_valid(mfn) ||
!get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
{
+ put_gfn(d, gmfn);
rcu_unlock_domain(d);
break;
}
@@ -443,6 +449,7 @@ long arch_do_domctl(
put_page_and_type(mfn_to_page(mfn));
+ put_gfn(d, gmfn);
rcu_unlock_domain(d);
}
break;