Skip to contentSkip to conversation

libxc: Expose xc_reserved_device_memory_map to ARM too

PATCH In review Julien Grall 3 participants 3 messages Jul 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxc: Expose xc_reserved_device_memory_map to ARM too

The commit 25652f2 "tools/libxl: detect and avoid conflicts with RDM" introduced the usage of xc_reserved_device_memory_map in the libxl generic code. But the function is only defined for x86 which breaks the ARM build.

The hypercall called by this helper is implemented in the generic code and doesn't contain any x86 specific code. Therefore, it's fine to expose the helper to ARM.

CC Ian Jackson <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Ian Campbell <[email protected]>
CC Wei Liu <[email protected]>
CC Tiejun Chen <[email protected]>

---
This is a bug fixes for Xen 4.6. The build has been breaked by commit 25652f2. After looking to the code, the hypercal XENMEM_reserved_device_memory_map is not x86 specific and make usage of the IOMMU generic code. So it's perfectly fine to use it on ARM, it will return always 0 reserved area.

Note that it requires code movement in xc_domain.c in order to move out the function from the #ifdef.

---
 tools/libxc/include/xenctrl.h |  2 +-
 tools/libxc/xc_domain.c       | 70 +++++++++++++++++++++----------------------
 2 files changed, 36 insertions(+), 36 deletions(-)
tools/libxc/include/xenctrl.h +1 -1
index 3f2381a..0a98aee 100644
@@ -1314,6 +1314,7 @@ int xc_domain_set_memory_map(xc_interface *xch,
 int xc_get_machine_memory_map(xc_interface *xch,
                               struct e820entry entries[],
                               uint32_t max_entries);
+#endif
 
 int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint32_t flags,
@@ -1322,7 +1323,6 @@ int xc_reserved_device_memory_map(xc_interface *xch,
                                   uint8_t devfn,
                                   struct xen_reserved_device_memory entries[],
                                   uint32_t *max_entries);
-#endif
 int xc_domain_set_time_offset(xc_interface *xch,
                               uint32_t domid,
                               int32_t time_offset_seconds);
tools/libxc/xc_domain.c +35 -35

82 lines not on this page · raw message

Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Julien Grall

The commit 25652f2 "tools/libxl: detect and avoid conflicts with RDM" introduced the usage of xc_reserved_device_memory_map in the libxl generic code. But the function is only defined for x86 which breaks the ARM build.

The hypercall called by this helper is implemented in the generic code and doesn't contain any x86 specific code. Therefore, it's fine to expose the helper to ARM.

Quoted 7 lines
CC Ian Jackson <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Ian Campbell <[email protected]>
CC Wei Liu <[email protected]>
CC Tiejun Chen <[email protected]>
Acked-by
#2 lore raw

Wei Liu writes ("Re: [PATCH] libxc: Expose xc_reserved_device_memory_map to ARM too"):

Quoted 9 lines · Julien Grall
Quoted 8 lines

The commit 25652f2 "tools/libxl: detect and avoid conflicts with RDM" introduced the usage of xc_reserved_device_memory_map in the libxl generic code. But the function is only defined for x86 which breaks the ARM build.

The hypercall called by this helper is implemented in the generic code and doesn't contain any x86 specific code. Therefore, it's fine to expose the helper to ARM.

Thanks, Julien. Sorry for breaking the ARM build.

Quoted 1 line

Ian.