From 1fc04d0a8dd8aaebae0af3cc69fcfedc0eab9156 Mon Sep 17 00:00:00 2001 From: Tamas K Lengyel Date: Fri, 26 Sep 2014 16:31:15 +0200 Subject: [PATCH] mem_access: abstract architecture specific sanity check Signed-off-by: Tamas K Lengyel Acked-by: Tim Deegan --- 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 64e5301467..6c2724bef5 100644 --- a/xen/common/mem_access.c +++ b/xen/common/mem_access.c @@ -70,7 +70,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 f6136f9a49..90ddd15029 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -598,6 +598,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.30.2