[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v3] arm/mem_access: add conditional build of mem_access.c



Hi Jan,

On 14/05/2024 09:10, Jan Beulich wrote:
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?

Because they are not used by nor defined in common code. It is pure coincidence they are named the same. If at some point, some code can be shared, then yes I would agree it could be common.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.