x86/mem_access: move p2m_mem_access_sanity_check() from header
PATCH 1/1 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.
--- xen/arch/x86/mm/mem_access.c | 5 +++++ xen/include/asm-x86/mem_access.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-)
xen/arch/x86/mm/mem_access.c +5 -0
@@ -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
xen/include/asm-x86/mem_access.h +1 -4
@@ -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__ */
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 9 lines · Razvan Cojocaru
Move
p2m_mem_access_sanity_check()from theasm-x86/mem_access.hheader, where it currently is declared inline, toarch/x86/mm/mem_access.c. This allows source code that includes it directly, or indirectly (such asxen/mem_access.h), to not worry about also includingsched.hforis_hvm_domain(). Includingxen/mem_access.his useful for code wanting to usep2m_access_t.Signed-off-by Razvan Cojocaru <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
xen/arch/x86/mm/mem_access.c void arch_p2m_set_access_required(struct domain *d, bool access_required) · line 547
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 20.11.18 at 19:05, <[email protected]> wrote:
xen/arch/x86/mm/mem_access.c +4
-0@@ -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); +}
With Tamas's ack I've committed this as is, but for the future may I ask that you take the opportunity and do trivial improvements in such cases (here: add const)?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 20.11.18 at 19:05, <[email protected]> wrote:
xen/arch/x86/mm/mem_access.c +0
-0@@ -541,6 +541,11 @@ void arch_p2m_set_access_required(struct domain *d, bool access_required)#endif }
Quoted 8 lines
xen/arch/x86/mm/mem_access.c void arch_p2m_set_access_required(struct domain *d, bool access_required) · line 547
Quoted 4 lines
xen/arch/x86/mm/mem_access.c +4
-0+bool p2m_mem_access_sanity_check (struct domain *d) +{ +return is_hvm_domain (d) && cpu_has_vmx &&hap_enabled (d); +}With Tamas's ack I've committed this as is, but for the future may I ask that you take the opportunity and do trivial improvements in such cases (here: add const)?
Of course, I'll send a new patch as soon as possible.
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel