From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: [PATCH for-4.5 v8 11/19] xen/mem_access: Abstract architecture specific sanity check Date: Tue, 23 Sep 2014 15:14:22 +0200 Message-ID: <1411478070-13836-12-git-send-email-tklengyel@sec.in.tum.de> References: <1411478070-13836-1-git-send-email-tklengyel@sec.in.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411478070-13836-1-git-send-email-tklengyel@sec.in.tum.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, tim@xen.org, julien.grall@linaro.org, ian.jackson@eu.citrix.com, stefano.stabellini@citrix.com, andres@lagarcavilla.org, jbeulich@suse.com, dgdegra@tycho.nsa.gov, Tamas K Lengyel List-Id: xen-devel@lists.xenproject.org Signed-off-by: Tamas K Lengyel Acked-by: Tim Deegan --- 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 42423c1..b9081e6 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 484538b..13df43d 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.1.0