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

[Xen-devel] [PATCH for-4.5 v6 09/17] xen/mem_access: Abstract architecture specific sanity check



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

diff --git a/xen/common/mem_access.c b/xen/common/mem_access.c
index 1674d7a..78cfcbf 100644
--- a/xen/common/mem_access.c
+++ b/xen/common/mem_access.c
@@ -68,7 +68,7 @@ int mem_access_memop(unsigned long cmd,
         return rc;
 
     rc = -EINVAL;
-    if ( !is_hvm_domain(d) )
+    if ( !p2m_mem_access_sanity_check(d) )
         goto out;
 
     rc = xsm_mem_event_op(XSM_DM_PRIV, d, XENMEM_access_op);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index c256a3a..520bd51 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -618,6 +618,12 @@ static inline bool_t p2m_mem_event_sanity_check(struct 
domain *d)
     return hap_enabled(d) && cpu_has_vmx;
 }
 
+/* Sanity check for mem_access hardware support */
+static inline bool_t p2m_mem_access_sanity_check(struct domain *d)
+{
+    return is_hvm_domain(d);
+}
+
 /* 
  * Internal functions, only called by other p2m code
  */
-- 
2.1.0


_______________________________________________
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®.