# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1308135727 -3600
# Node ID 29b2d5e110d5fa740be65cab7817788a28631e0d
# Parent f4a47275aebf383cf565e0a265a56a8c1110d45e
x86/mm/p2m: Move check for non-translated guests in one layer
so that direct callers of gfn_to_mfn_type_p2m() can operate safely
on PV domains.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
diff -r f4a47275aebf -r 29b2d5e110d5 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h Tue Jun 14 13:13:18 2011 +0100
+++ b/xen/include/asm-x86/p2m.h Wed Jun 15 12:02:07 2011 +0100
@@ -291,7 +291,17 @@
gfn_to_mfn_type_p2m(struct p2m_domain *p2m, unsigned long gfn,
p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
{
- mfn_t mfn = p2m->get_entry(p2m, gfn, t, a, q);
+ mfn_t mfn;
+
+ if ( !p2m || !paging_mode_translate(p2m->domain) )
+ {
+ /* Not necessarily true, but for non-translated guests, we claim
+ * it's the most generic kind of memory */
+ *t = p2m_ram_rw;
+ return _mfn(gfn);
+ }
+
+ mfn = p2m->get_entry(p2m, gfn, t, a, q);
#ifdef __x86_64__
if ( q == p2m_unshare && p2m_is_shared(*t) )
@@ -321,18 +331,8 @@
unsigned long gfn, p2m_type_t *t,
p2m_query_t q)
{
- struct p2m_domain *p2m = p2m_get_hostp2m(d);
p2m_access_t a;
-
- if ( !p2m || !paging_mode_translate(p2m->domain) )
- {
- /* Not necessarily true, but for non-translated guests, we claim
- * it's the most generic kind of memory */
- *t = p2m_ram_rw;
- return _mfn(gfn);
- }
-
- return gfn_to_mfn_type_p2m(p2m, gfn, t, &a, q);
+ return gfn_to_mfn_type_p2m(p2m_get_hostp2m(d), gfn, t, &a, q);
}
/* Syntactic sugar: most callers will use one of these.
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|