aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/physdev.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/physdev.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/physdev.c')
-rw-r--r--xen/arch/x86/physdev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 569ad81a87..cca56bb6f0 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -297,16 +297,20 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
break;
ret = -EINVAL;
- mfn = gmfn_to_mfn(current->domain, info.gmfn);
+ mfn = get_gfn_untyped(current->domain, info.gmfn);
if ( !mfn_valid(mfn) ||
!get_page_and_type(mfn_to_page(mfn), v->domain,
PGT_writable_page) )
+ {
+ put_gfn(current->domain, info.gmfn);
break;
+ }
if ( cmpxchg(&v->domain->arch.pv_domain.pirq_eoi_map_mfn,
0, mfn) != 0 )
{
put_page_and_type(mfn_to_page(mfn));
+ put_gfn(current->domain, info.gmfn);
ret = -EBUSY;
break;
}
@@ -316,10 +320,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
{
v->domain->arch.pv_domain.pirq_eoi_map_mfn = 0;
put_page_and_type(mfn_to_page(mfn));
+ put_gfn(current->domain, info.gmfn);
ret = -ENOSPC;
break;
}
+ put_gfn(current->domain, info.gmfn);
ret = 0;
break;
}