[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 07/15] xen/mem_access: Abstract architecture specific sanity check



Signed-off-by: Tamas K Lengyel <tklengyel@xxxxxxxxxxxxx>
---
v2: Move sanity check function into architecture specific p2m.h
---
 xen/common/mem_access.c   | 6 ++++--
 xen/include/asm-x86/p2m.h | 8 ++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/common/mem_access.c b/xen/common/mem_access.c
index 07161a2..26cf0a8 100644
--- a/xen/common/mem_access.c
+++ b/xen/common/mem_access.c
@@ -43,9 +43,11 @@ int mem_access_memop(unsigned long cmd,
     if ( rc )
         return rc;
 
-    rc = -EINVAL;
-    if ( !is_hvm_domain(d) )
+    if ( !p2m_mem_access_sanity_check(d) )
+    {
+        rc = -EINVAL;
         goto out;
+    }
 
     rc = xsm_mem_event_op(XSM_DM_PRIV, d, XENMEM_access_op);
     if ( rc )
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 9a1fae3..5152862 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -627,6 +627,14 @@ static inline bool_t p2m_mem_event_sanity_check(struct 
domain *d)
     return 1;
 }
 
+/* Sanity check for mem_access hardware support */
+static inline bool_t p2m_mem_access_sanity_check(struct domain *d)
+{
+    if ( !is_hvm_domain(d) )
+        return 0;
+    return 1;
+}
+
 /* 
  * Internal functions, only called by other p2m code
  */
-- 
2.1.0.rc1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.