From: Razvan Cojocaru Date: Wed, 21 Nov 2018 09:55:21 +0000 (+0100) Subject: x86/mem_access: move p2m_mem_access_sanity_check() from header X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=56d2e9786a3ba7b9a92ea3e9fac18e2892f9f38b;p=people%2Froyger%2Fxen.git x86/mem_access: move p2m_mem_access_sanity_check() from header Move p2m_mem_access_sanity_check() from the asm-x86/mem_access.h header, where it currently is declared inline, to arch/x86/mm/mem_access.c. This allows source code that includes it directly, or indirectly (such as xen/mem_access.h), to not worry about also including sched.h for is_hvm_domain(). Including xen/mem_access.h is useful for code wanting to use p2m_access_t. Signed-off-by: Razvan Cojocaru Acked-by: Tamas K Lengyel --- diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index 2f1295e56a..30c2f1a137 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -541,6 +541,11 @@ void arch_p2m_set_access_required(struct domain *d, bool access_required) #endif } +bool p2m_mem_access_sanity_check(struct domain *d) +{ + return is_hvm_domain(d) && cpu_has_vmx && hap_enabled(d); +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-x86/mem_access.h b/xen/include/asm-x86/mem_access.h index 4043c9fb4d..c815db87c5 100644 --- a/xen/include/asm-x86/mem_access.h +++ b/xen/include/asm-x86/mem_access.h @@ -44,10 +44,7 @@ bool p2m_mem_access_emulate_check(struct vcpu *v, const vm_event_response_t *rsp); /* Sanity check for mem_access hardware support */ -static inline bool p2m_mem_access_sanity_check(struct domain *d) -{ - return is_hvm_domain(d) && cpu_has_vmx && hap_enabled(d); -} +bool p2m_mem_access_sanity_check(struct domain *d); #endif /*__ASM_X86_MEM_ACCESS_H__ */