Skip to contentSkip to conversation

disable Xen on ARM (until supported)

RFC PATCH In review Philippe Mathieu-Daudé 3 participants 7 messages Jul 11, 2017

lore
Share & tools
lore
#0 lore raw

cover disable Xen on ARM (until supported)

Hi,

Those errors were triggered installing libxen v4.8 on debian Stretch ARM (32b and 64b).

It seems QEMU only support Xen on x86 host.

patch 1 disable PCI Passthrough if not on x86,
patch 2 disable xen_map_cache() on ARM, I don't think it is the correct way to do it, then
patch 3 add few comments to think about spliting x86 part from arch agnostic Xen code.

That said, I realize there is no Xen ARM entry in MAINTAINERS, I'll Cc:
X86 maintainers although.

Regards,

Phil.

Philippe Mathieu-Daudé (3):
configure: disable Xen PCI Passthrough on !x86 archs [XXX] xen/mapcache: disable on arm*
[XXX] xen/pt: comment about !x86 archs

 configure                     | 11 +++++++++--
 hw/xen/xen_pt.c               |  4 ++--
 include/sysemu/xen-mapcache.h |  4 +++-
 3 files changed, 14 insertions(+), 5 deletions(-)
Signature · 7 lines
2.13.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

RFC PATCH 1/3 configure: disable Xen PCI Passthrough on !x86 archs

linking on Linux debian/stretch/arm64 with libxen-4.8:

hw/xen/xen_pt.o: In function `xen_pt_pci_read_config':
qemu/hw/xen/xen_pt.c:206: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt.o: In function xen_igd_passthrough_isa_bridge_create':
qemu/hw/xen/xen_pt.c:698: undefined reference to igd_passthrough_isa_bridge_create' hw/xen/xen_pt.o: In function xen_pt_pci_write_config':
qemu/hw/xen/xen_pt.c:355: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_config_init.o: In function xen_pt_status_reg_init':
qemu/hw/xen/xen_pt_config_init.c:281: undefined reference to xen_shutdown_fatal_error' qemu/hw/xen/xen_pt_config_init.c:275: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_graphics.o: In function `get_vgabios':
qemu/hw/xen/xen_pt_graphics.c:135: undefined reference to `pci_assign_dev_load_option_rom'
collect2: error: ld returned 1 exit status
Makefile:197: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1

---
 configure | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
configure +9 -2
index 806658c98b..e4b173405a 100755
@@ -2344,8 +2344,15 @@ EOF
 fi
 
 if test "$xen_pci_passthrough" != "no"; then
-  if test "$xen" = "yes" && test "$linux" = "yes"; then
-    xen_pci_passthrough=yes
+  if test "$xen" = "yes"; then
+    case "$cpu" in
+    i386|x32|x86_64)
+        if test "$linux" = "yes"; then
+            xen_pci_passthrough=yes
+        fi ;;
+    *)  echo "Disabling Xen PCI Passthrough (not implemented on $cpu)"
+        xen_pci_passthrough=no ;;
+    esac
   else
     if test "$xen_pci_passthrough" = "yes"; then
       error_exit "User requested feature Xen PCI Passthrough" \
Signature · 7 lines
2.13.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

Re: [RFC PATCH 1/3] configure: disable Xen PCI Passthrough on !x86 archs

It seems our minds crossed at the same time since Alex/Pablo fixed it and got merged in master as b5ed2e11ef39 "build: disable Xen on ARM" so this patch is no more necessary.

Alex/Pablo, any thought on patch 2 regarding xen-mapcache.h?

Phil.

Quoted 45 lines · Philippe Mathieu-Daudé

linking on Linux debian/stretch/arm64 with libxen-4.8:

hw/xen/xen_pt.o: In function `xen_pt_pci_read_config':
qemu/hw/xen/xen_pt.c:206: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt.o: In function xen_igd_passthrough_isa_bridge_create':
qemu/hw/xen/xen_pt.c:698: undefined reference to igd_passthrough_isa_bridge_create' hw/xen/xen_pt.o: In function xen_pt_pci_write_config':
qemu/hw/xen/xen_pt.c:355: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_config_init.o: In function xen_pt_status_reg_init':
qemu/hw/xen/xen_pt_config_init.c:281: undefined reference to xen_shutdown_fatal_error' qemu/hw/xen/xen_pt_config_init.c:275: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_graphics.o: In function `get_vgabios':
qemu/hw/xen/xen_pt_graphics.c:135: undefined reference to `pci_assign_dev_load_option_rom'
collect2: error: ld returned 1 exit status
Makefile:197: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1

---
  configure | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
configure +9 -2
index 806658c98b..e4b173405a 100755
@@ -2344,8 +2344,15 @@ EOF
  fi
 
  if test "$xen_pci_passthrough" != "no"; then
-  if test "$xen" = "yes" && test "$linux" = "yes"; then
-    xen_pci_passthrough=yes
+  if test "$xen" = "yes"; then
+    case "$cpu" in
+    i386|x32|x86_64)
+        if test "$linux" = "yes"; then
+            xen_pci_passthrough=yes
+        fi ;;
+    *)  echo "Disabling Xen PCI Passthrough (not implemented on $cpu)"
+        xen_pci_passthrough=no ;;
+    esac
    else
      if test "$xen_pci_passthrough" = "yes"; then
        error_exit "User requested feature Xen PCI Passthrough" \
#3 lore raw

Re: [RFC PATCH 1/3] configure: disable Xen PCI Passthrough on !x86 archs

Quoted 5 lines · Philippe Mathieu-Daudé

It seems our minds crossed at the same time since Alex/Pablo fixed it and got merged in master as b5ed2e11ef39 "build: disable Xen on ARM" so this patch is no more necessary.

Alex/Pablo, any thought on patch 2 regarding xen-mapcache.h?

Pass, I know little of Xen on ARM other than I think it doesn't need QEMU for device emulation. IIRC the use of QEMU on x86 is to handle the weird set of devices you can get on a PC without bloating the hypervisor. ARM is a lot simpler in that regard.

Quoted 40 lines

Phil.

Quoted 36 lines · Philippe Mathieu-Daudé

linking on Linux debian/stretch/arm64 with libxen-4.8:

hw/xen/xen_pt.o: In function `xen_pt_pci_read_config':
qemu/hw/xen/xen_pt.c:206: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt.o: In function xen_igd_passthrough_isa_bridge_create':
qemu/hw/xen/xen_pt.c:698: undefined reference to igd_passthrough_isa_bridge_create' hw/xen/xen_pt.o: In function xen_pt_pci_write_config':
qemu/hw/xen/xen_pt.c:355: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_config_init.o: In function xen_pt_status_reg_init':
qemu/hw/xen/xen_pt_config_init.c:281: undefined reference to xen_shutdown_fatal_error' qemu/hw/xen/xen_pt_config_init.c:275: undefined reference to xen_shutdown_fatal_error' hw/xen/xen_pt_graphics.o: In function `get_vgabios':
qemu/hw/xen/xen_pt_graphics.c:135: undefined reference to `pci_assign_dev_load_option_rom'
collect2: error: ld returned 1 exit status
Makefile:197: recipe for target 'qemu-system-aarch64' failed
make[1]: *** [qemu-system-aarch64] Error 1

---
  configure | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
configure +5 -2
index 806658c98b..e4b173405a 100755
@@ -2344,8 +2344,15 @@ EOF
  fi
    if test "$xen_pci_passthrough" != "no"; then
-  if test "$xen" = "yes" && test "$linux" = "yes"; then
-    xen_pci_passthrough=yes
+  if test "$xen" = "yes"; then
+    case "$cpu" in
+    i386|x32|x86_64)
+        if test "$linux" = "yes"; then
+            xen_pci_passthrough=yes
Quoted 8 lines

configure EOF

Quoted 8 lines
configure +4 -0
+        fi ;;
+    *)  echo "Disabling Xen PCI Passthrough (not implemented on $cpu)"
+        xen_pci_passthrough=no ;;
+    esac
    else
      if test "$xen_pci_passthrough" = "yes"; then
        error_exit "User requested feature Xen PCI Passthrough" \
 

--
Alex Bennée

#4 lore raw

Re: [RFC PATCH 1/3] configure: disable Xen PCI Passthrough on !x86 archs

Quoted 10 lines · Alex Bennée
Quoted 5 lines

It seems our minds crossed at the same time since Alex/Pablo fixed it and got merged in master as b5ed2e11ef39 "build: disable Xen on ARM" so this patch is no more necessary.

Alex/Pablo, any thought on patch 2 regarding xen-mapcache.h?

Pass, I know little of Xen on ARM other than I think it doesn't need QEMU for device emulation. IIRC the use of QEMU on x86 is to handle the weird set of devices you can get on a PC without bloating the hypervisor. ARM is a lot simpler in that regard.

Yes, my understanding is that Xen on ARM doesn't need the mapcache.

Another thing being discussed a few years ago was the creation of qemu-system-xenpv (aka xenpv-softmmu), where the same code would run on x86 or ARM. It would never support TCG, so the --disable-tcg patches would be a prerequisite for that.

Paolo

#5 lore raw

RFC PATCH 2/3 xen/mapcache: disable Xen on arm*

In reply to Philippe Mathieu-Daudé

linking on Linux debian/stretch/arm[64] with libxen-4.8:

exec.o: In function `reclaim_ramblock':
qemu/exec.c:2071: undefined reference to xen_invalidate_map_cache_entry' exec.o: In function qemu_map_ram_ptr':
qemu/exec.c:2177: undefined reference to xen_map_cache' qemu/exec.c:2174: undefined reference to xen_map_cache' exec.o: In function `qemu_ram_block_from_host':
qemu/exec.c:2242: undefined reference to xen_ram_addr_from_mapcache' qemu/exec.c:2242: undefined reference to xen_ram_addr_from_mapcache' exec.o: In function `qemu_ram_ptr_length':
qemu/exec.c:2210: undefined reference to xen_map_cache' qemu/exec.c:2207: undefined reference to xen_map_cache' exec.o: In function `address_space_unmap':
qemu/exec.c:3357: undefined reference to `xen_invalidate_map_cache_entry'
collect2: error: ld returned 1 exit status
Makefile:197: recipe for target 'qemu-system-aarch64' failed make[1]: *** [qemu-system-aarch64] Error 1

---
 include/sysemu/xen-mapcache.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/sysemu/xen-mapcache.h +3 -1
index 01daaad00c..75f0988e04 100644
@@ -12,7 +12,9 @@
 typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr start_addr,
                                                      ram_addr_t size,
                                                      void *opaque);
-#ifdef CONFIG_XEN
+/* FIXME ARM supported since Xen 4.3? */
+#if defined(CONFIG_XEN) /* XXX supported_xen_target() wrong? */ && \
+    !defined(HOST_ARM) && !defined(HOST_AARCH64)
 
 void xen_map_cache_init(phys_offset_to_gaddr_t f,
                         void *opaque);
Signature · 7 lines
2.13.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#6 lore raw

RFC PATCH 3/3 xen/pt: add comments about !x86 archs

In reply to Philippe Mathieu-Daudé
---
 hw/xen/xen_pt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/xen/xen_pt.c +2 -2
index 375efa68f6..21c32b0991 100644
@@ -58,7 +58,7 @@
 
 #include "hw/pci/pci.h"
 #include "hw/xen/xen.h"
-#include "hw/i386/pc.h"
+#include "hw/i386/pc.h" /* TODO check !x86 */
 #include "hw/xen/xen_backend.h"
 #include "xen_pt.h"
 #include "qemu/range.h"
@@ -687,7 +687,7 @@ static const MemoryListener xen_pt_io_listener = {
     .priority = 10,
 };
 
-static void
+static void /* TODO check !x86 */
 xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
                                       XenHostPCIDevice *dev)
 {
Signature · 7 lines
2.13.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel