On 10.05.2024 14:32, Alessandro Zucchelli wrote:
> --- a/xen/arch/arm/include/asm/mem_access.h
> +++ b/xen/arch/arm/include/asm/mem_access.h
> @@ -17,6 +17,8 @@
>  #ifndef _ASM_ARM_MEM_ACCESS_H
>  #define _ASM_ARM_MEM_ACCESS_H
>  
> +#include <xen/types.h>
> +
>  static inline
>  bool p2m_mem_access_emulate_check(struct vcpu *v,
>                                    const struct vm_event_st *rsp)
> @@ -35,12 +37,28 @@ static inline bool p2m_mem_access_sanity_check(struct 
> domain *d)
>   * Send mem event based on the access. Boolean return value indicates if trap
>   * needs to be injected into guest.
>   */
> +#ifdef CONFIG_MEM_ACCESS
>  bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec 
> npfec);
>  
>  struct page_info*
>  p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag,
>                                    const struct vcpu *v);
> +#else
> +
> +static inline bool
> +p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec npfec)
> +{
> +    return false;
> +}
> +
> +static inline struct page_info*
> +p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag,
> +                                  const struct vcpu *v)
> +{
> +    return NULL;
> +}
>  
> +#endif /*CONFIG_MEM_ACCESS*/

Why would each arch need to repeat these stubs? IOW why would they not
live in xen/mem_access.h?

Jan

Reply via email to