Skip to contentSkip to conversation

arm: compile tools

PATCH Superseded Stefano Stabellini 3 participants 14 messages Feb 2, 2012

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover arm: compile tools

Hi all,
this patch series allows tools/ to compile on ARM, mostly providing an empty implementation for all the arch specific functions that are needed.

Ian Campbell (4):
arm: add stub hvm/save.h
libxl: do not allocate e820 for non x86 guests. blktap2/libvhd: Build shared objects using -fPIC.
tools: only compile libfsimage/xfs on X86

Stefano Stabellini (7):
arm: few missing #define
arm: arch_dump_shared_mem_info as a no-op
arm: compile libxc
arm: compile libxenguest
arm: compile libxl
arm: compile memshr
arm: compile xentrace

 tools/blktap2/vhd/lib/Makefile         |   13 +++-
 tools/libfsimage/Makefile              |    3 +-
 tools/libxc/Makefile                   |   16 ++++-
 tools/libxc/xc_core.h                  |    2 +
 tools/libxc/xc_core_arm.c              |  106 ++++++++++++++++++++++++++++++++
 tools/libxc/xc_core_arm.h              |   60 ++++++++++++++++++
 tools/libxc/xc_dom_arm.c               |   49 +++++++++++++++
 tools/libxc/xc_nohvm.c                 |   31 +++++++++
 tools/libxc/xc_nomigrate.c             |   40 ++++++++++++
 tools/libxc/xenctrl.h                  |    4 +
 tools/libxl/Makefile                   |    1 +
 tools/libxl/libxl_create.c             |    3 +-
 tools/libxl/libxl_json.c               |    8 +++
 tools/libxl/libxl_nocpuid.c            |    2 +-
 tools/libxl/libxl_pci.c                |    2 +
 tools/memshr/bidir-hash.c              |   31 +++++++++
 tools/xentrace/xenctx.c                |   12 ++++
 xen/arch/arm/mm.c                      |    4 +
 xen/include/public/arch-arm.h          |    2 +
 xen/include/public/arch-arm/hvm/save.h |   39 ++++++++++++
 xen/include/public/hvm/save.h          |    2 +
 xen/include/public/io/protocols.h      |    3 +
 22 files changed, 423 insertions(+), 10 deletions(-)

A git tree based on 28b2fd7fcdc735178c509a895e52db07964c7b1b, plus my previous arm patch series, is available here:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git arm-tools-1

Cheers,

Stefano

#1 lore raw

PATCH 1/11 arm: few missing #define

Few missing #define are the cause of a compile failure with XEN_TARGET_ARM=arm and XEN_COMPILE_ARM=arm (for example in the case of a native compilation). This patch fill the gaps.

---
 xen/include/public/arch-arm.h     |    2 ++
 xen/include/public/io/protocols.h |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
xen/include/public/arch-arm.h +2 -0
index c430cf3..e04c4fd 100644
@@ -110,6 +110,8 @@ typedef struct arch_vcpu_info arch_vcpu_info_t;
 
 struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
+typedef unsigned long xen_callback_t;
+
 #endif
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
xen/include/public/io/protocols.h +3 -0
index 77bd1bd..0b7a2ea 100644
@@ -26,6 +26,7 @@
 #define XEN_IO_PROTO_ABI_X86_32     "x86_32-abi"
 #define XEN_IO_PROTO_ABI_X86_64     "x86_64-abi"
 #define XEN_IO_PROTO_ABI_IA64       "ia64-abi"
+#define XEN_IO_PROTO_ABI_ARM        "arm-abi"
 
 #if defined(__i386__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
@@ -33,6 +34,8 @@
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
 #elif defined(__ia64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
+#elif defined(__arm__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
 #else
 # error arch fixup needed here
 #endif
Signature · 1 line
1.7.8.3
#2 lore raw

Re: [PATCH 01/11] arm: few missing #define

Quoted 15 lines · Stefano Stabellini

Few missing #define are the cause of a compile failure with XEN_TARGET_ARM=arm and XEN_COMPILE_ARM=arm (for example in the case of a native compilation). This patch fill the gaps.

---
 xen/include/public/arch-arm.h     |    2 ++
 xen/include/public/io/protocols.h |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
xen/include/public/arch-arm.h +0 -0
index c430cf3..e04c4fd 100644

xen/include/public/arch-arm.h typedef struct arch_vcpu_info arch_vcpu_info_t; · line 113

Quoted 4 lines
xen/include/public/arch-arm.h +1 -0
@@ -110,6 +110,8 @@ typedef struct arch_vcpu_info arch_vcpu_info_t;
 
 struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
+typedef unsigned long xen_callback_t;

Can we make all new public interfaces explicitly sized, please?

Cheers,

Tim.

#3 lore raw

Re: [PATCH 01/11] arm: few missing #define

Quoted 17 lines · Tim Deegan
Quoted 16 lines · Stefano Stabellini

Few missing #define are the cause of a compile failure with XEN_TARGET_ARM=arm and XEN_COMPILE_ARM=arm (for example in the case of a native compilation). This patch fill the gaps.

---
 xen/include/public/arch-arm.h     |    2 ++
 xen/include/public/io/protocols.h |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
xen/include/public/arch-arm.h +0 -0
index c430cf3..e04c4fd 100644
@@ -110,6 +110,8 @@ typedef struct arch_vcpu_info arch_vcpu_info_t;
 
Quoted 5 lines

xen/include/public/arch-arm.h typedef struct arch_vcpu_info arch_vcpu_info_t; · line 113

Quoted 3 lines
xen/include/public/arch-arm.h +1 -0
 struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
+typedef unsigned long xen_callback_t;

Can we make all new public interfaces explicitly sized, please?

Yes please, and explicitly sized in a way which is compatible with 64 bits too (i.e. u64 here rather than u32 even though PC happens to be 32 bits).

I'd quite like to do a sweep of the existing interfaces and arrange this to be the case even for existing interfaces when used on new architectures. I expect that will be an enormous amount of churn though -- possibly not worth it.

Ian.

#4 lore raw

PATCH 2/11 arm: add stub hvm/save.h

In reply to Stefano Stabellini

From: Ian Campbell <[email protected]>

---
 xen/include/public/arch-arm/hvm/save.h |   39 ++++++++++++++++++++++++++++++++
 xen/include/public/hvm/save.h          |    2 +
 2 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 xen/include/public/arch-arm/hvm/save.h
xen/include/public/arch-arm/hvm/save.h new file +39 -0
new file mode 100644
index 0000000..ec61298
@@ -0,0 +1,39 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2012 Citrix Systems Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_PUBLIC_HVM_SAVE_ARM_H__
+#define __XEN_PUBLIC_HVM_SAVE_ARM_H__
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
xen/include/public/hvm/save.h +2 -0
index d0f2661..58f8433 100644
@@ -104,6 +104,8 @@ DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm_save_end);
 #include "../arch-x86/hvm/save.h"
 #elif defined(__ia64__)
 #include "../arch-ia64/hvm/save.h"
+#elif defined(__arm__)
+#include "../arch-arm/hvm/save.h"
 #else
 #error "unsupported architecture"
 #endif
Signature · 1 line
1.7.8.3
#5 lore raw

PATCH 3/11 arm: arch_dump_shared_mem_info as a no-op

In reply to Stefano Stabellini
---
 xen/arch/arm/mm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
xen/arch/arm/mm.c +4 -0
index 613d084..7ce9a70 100644
@@ -311,6 +311,10 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
+/* Simple no-op */
+void arch_dump_shared_mem_info(void)
+{
+}
 /*
  * Local variables:
  * mode: C
Signature · 1 line
1.7.8.3
#6 lore raw

PATCH 4/11 libxl: do not allocate e820 for non x86 guests.

In reply to Stefano Stabellini

From: Ian Campbell <[email protected]>

---
 tools/libxl/libxl_create.c |    3 ++-
 tools/libxl/libxl_pci.c    |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
tools/libxl/libxl_create.c +2 -1
index e1c615f..05c0b67 100644
@@ -652,7 +652,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
             goto error_out;
         }
     }
-
+#if defined(__i386__) || defined(__x86_64__)
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
         d_config->b_info.u.pv.e820_host) {
         int rc;
@@ -662,6 +662,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
                       "Failed while collecting E820 with: %d (errno:%d)\n",
                       rc, errno);
     }
+#endif
     if ( cb && (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM ||
                 (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
                  d_config->b_info.u.pv.bootloader ))) {
tools/libxl/libxl_pci.c +2 -0
index 99591c2..c545b85 100644
@@ -1149,6 +1149,7 @@ int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid)
     return 0;
 }
 
+#if defined(__i386__) || defined(__x86_64__)
 static const char *e820_names(int type)
 {
     switch (type) {
@@ -1390,6 +1391,7 @@ int libxl__e820_alloc(libxl__gc *gc, uint32_t domid, libxl_domain_config *d_conf
     }
     return 0;
 }
+#endif
 
 /*
  * Local variables:
Signature · 1 line
1.7.8.3
#7 lore raw

PATCH 5/11 blktap2/libvhd: Build shared objects using -fPIC.

In reply to Stefano Stabellini

From: Ian Campbell <[email protected]>

---
 tools/blktap2/vhd/lib/Makefile |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
tools/blktap2/vhd/lib/Makefile +9 -4
index b72e4d9..1acee70 100644
@@ -49,27 +49,32 @@ LIB-SRCS        += atomicio.c
 LIB-OBJS         = $(patsubst %.c,%.o,$(LIB-SRCS))
 LIB-OBJS        += $(LVM-UTIL-OBJ)
 
+LIB-PICOBJS      = $(patsubst %.o,%.opic,$(LIB-OBJS))
+
 LIBVHD           = libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
 
 all: build
 
-build: $(LIBVHD-BUILD)
+build: libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
 
 libvhd.a: $(LIB-OBJS)
+	$(AR) rc $@ $^
+
+libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR): $(LIB-PICOBJS)
 	$(CC) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_LDFLAGS) \
 		$(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $^ $(LIBS)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhd.so.$(LIBVHD-MAJOR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR) libvhd.so
-	$(AR) rc $@ $^
 
 install: all
 	$(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
-	$(INSTALL_PROG) $(LIBVHD) $(DESTDIR)$(INST-DIR)
+	$(INSTALL_PROG) libvhd.a $(DESTDIR)$(INST-DIR)
+	$(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
 	ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
 
 clean:
-	rm -rf *.a *.so* *.o *~ $(DEPS) $(LIBVHD)
+	rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD)
 
 .PHONY: all build clean install libvhd
 
Signature · 1 line
1.7.8.3
#8 lore raw

PATCH 6/11 arm: compile libxc

In reply to Stefano Stabellini

Introduce an empty implementation of the arch specific ARM functions in xc_core_arm.c and xc_core_arm.h; define barriers on ARM.

---
 tools/libxc/Makefile      |    1 +
 tools/libxc/xc_core.h     |    2 +
 tools/libxc/xc_core_arm.c |  106 +++++++++++++++++++++++++++++++++++++++++++++
 tools/libxc/xc_core_arm.h |   60 +++++++++++++++++++++++++
 tools/libxc/xenctrl.h     |    4 ++
 5 files changed, 173 insertions(+), 0 deletions(-)
 create mode 100644 tools/libxc/xc_core_arm.c
 create mode 100644 tools/libxc/xc_core_arm.h
tools/libxc/Makefile +1 -0
index b5e7022..f2e1ba7 100644
@@ -8,6 +8,7 @@ CTRL_SRCS-y       :=
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
+CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c
 CTRL_SRCS-y       += xc_cpupool.c
 CTRL_SRCS-y       += xc_domain.c
 CTRL_SRCS-y       += xc_evtchn.c
tools/libxc/xc_core.h +2 -0
index 1e88a75..358a8c1 100644
@@ -155,6 +155,8 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
 # include "xc_core_x86.h"
 #elif defined (__ia64__)
 # include "xc_core_ia64.h"
+#elif defined (__arm__)
+# include "xc_core_arm.h"
 #else
 # error "unsupported architecture"
 #endif
tools/libxc/xc_core_arm.c new file +106 -0

106 lines not on this page · raw message

tools/libxc/xc_core_arm.h new file +60 -0

60 lines not on this page · raw message

tools/libxc/xenctrl.h +4 -0
index 7813331..a8235fb 100644
@@ -83,6 +83,10 @@
 #define xen_mb()   asm volatile ("mf" ::: "memory")
 #define xen_rmb()  asm volatile ("mf" ::: "memory")
 #define xen_wmb()  asm volatile ("mf" ::: "memory")
+#elif defined(__arm__)
+#define xen_mb()   asm volatile ("dmb" : : : "memory")
+#define xen_rmb()  asm volatile ("dmb" : : : "memory")
+#define xen_wmb()  asm volatile ("dmb" : : : "memory")
 #else
 #error "Define barriers"
 #endif
Signature · 1 line
1.7.8.3
#9 lore raw

PATCH 7/11 arm: compile libxenguest

In reply to Stefano Stabellini

Introduce an empty implementation of the arch specific ARM functions in xc_dom_arm.c.
Also provide empty implementations of xc_domain_save, xc_domain_restore and xc_hvm_build_target_mem when CONFIG_HVM or CONFIG_MIGRATE are not set.

---
 tools/libxc/Makefile       |   15 ++++++++++--
 tools/libxc/xc_dom_arm.c   |   49 ++++++++++++++++++++++++++++++++++++++++++++
 tools/libxc/xc_nohvm.c     |   31 +++++++++++++++++++++++++++
 tools/libxc/xc_nomigrate.c |   40 +++++++++++++++++++++++++++++++++++
 4 files changed, 132 insertions(+), 3 deletions(-)
 create mode 100644 tools/libxc/xc_dom_arm.c
 create mode 100644 tools/libxc/xc_nohvm.c
 create mode 100644 tools/libxc/xc_nomigrate.c
tools/libxc/Makefile +12 -3
index f2e1ba7..57ceee6 100644
@@ -42,9 +42,17 @@ CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c xc_suspend.c
-GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
-GUEST_SRCS-$(CONFIG_MIGRATE) += xc_offline_page.c xc_compression.c
-GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
+ifeq ($(CONFIG_MIGRATE),y)
+GUEST_SRCS-y += xc_domain_restore.c xc_domain_save.c
+GUEST_SRCS-y += xc_offline_page.c xc_compression.c
+else
+GUEST_SRCS-y += xc_nomigrate.c
+endif
+ifeq ($(CONFIG_HVM),y)
+GUEST_SRCS-y += xc_hvm_build.c
+else
+GUEST_SRCS-y += xc_nohvm.c
+endif
 
 vpath %.c ../../xen/common/libelf
 CFLAGS += -I../../xen/common/libelf
@@ -62,6 +70,7 @@ GUEST_SRCS-y                 += xc_dom_compat_linux.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_dom_x86.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_cpuid_x86.c
 GUEST_SRCS-$(CONFIG_IA64)    += xc_dom_ia64.c
+GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_arm.c
 
 OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 
tools/libxc/xc_dom_arm.c new file +49 -0

49 lines not on this page · raw message

tools/libxc/xc_nohvm.c new file +31 -0
new file mode 100644
index 0000000..a899f7c
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Copyright (c) 2011, Citrix Systems
+ */
+
+#include <inttypes.h>
+#include <errno.h>
+#include <xenctrl.h>
+#include <xenguest.h>
+
+int xc_hvm_build_target_mem(xc_interface *xch,
+                           uint32_t domid,
+                           int memsize,
+                           int target,
+                           const char *image_name)
+{
+    return -ENOSYS;
+}
tools/libxc/xc_nomigrate.c new file +40 -0
new file mode 100644
index 0000000..63090e0
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Copyright (c) 2011, Citrix Systems
+ */
+
+#include <inttypes.h>
+#include <errno.h>
+#include <xenctrl.h>
+#include <xenguest.h>
+
+int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
+                   uint32_t max_factor, uint32_t flags,
+                   struct save_callbacks* callbacks, int hvm,
+                   unsigned long vm_generationid_addr)
+{
+    return -ENOSYS;
+}
+
+int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
+                      unsigned int store_evtchn, unsigned long *store_mfn,
+                      unsigned int console_evtchn, unsigned long *console_mfn,
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int no_incr_generationid,
+                      unsigned long *vm_generationid_addr)
+{
+    return -ENOSYS;
+}
Signature · 1 line
1.7.8.3
#10 lore raw

PATCH 8/11 arm: compile libxl

In reply to Stefano Stabellini

libxl_cpuid_destroy has been renamed to libxl_cpuid_dispose; also cpuid functions are only available on x86, so ifdef the new cpuid related function in libxl_json.c.

---
 tools/libxl/Makefile        |    1 +
 tools/libxl/libxl_json.c    |    8 ++++++++
 tools/libxl/libxl_nocpuid.c |    2 +-
 3 files changed, 10 insertions(+), 1 deletions(-)
tools/libxl/Makefile +1 -0
index 3c3661b..5dcaa0e 100644
@@ -32,6 +32,7 @@ LIBXL_OBJS-y += libxl_noblktap2.o
 endif
 LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o
 LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpuid.o
+LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o
 
 ifeq ($(CONFIG_NetBSD),y)
 LIBXL_OBJS-y += libxl_netbsd.o
tools/libxl/libxl_json.c +8 -0
index 6ff2910..f35943b 100644
@@ -140,6 +140,7 @@ out:
     return s;
 }
 
+#if defined(__i386__) || defined(__x86_64__)
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
@@ -199,6 +200,13 @@ empty:
 out:
     return s;
 }
+#else
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                libxl_cpuid_policy_list *pcpuid)
+{
+    return 0;
+}
+#endif
 
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *pl)
 {
tools/libxl/libxl_nocpuid.c +1 -1
index 9e52f8d..313d55b 100644
@@ -14,7 +14,7 @@
 
 #include "libxl_internal.h"
 
-void libxl_cpuid_destroy(libxl_cpuid_policy_list *p_cpuid_list)
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
 {
 }
 
Signature · 1 line
1.7.8.3
#11 lore raw

PATCH 9/11 arm: compile memshr

In reply to Stefano Stabellini
---
 tools/memshr/bidir-hash.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
tools/memshr/bidir-hash.c +31 -0
index 6c0dc3d..45d473e 100644
@@ -109,6 +109,37 @@ static void      hash_resize(struct __hash *h);
 } while (0)
 static inline void atomic_inc(uint32_t *v) { ia64_fetchadd4_rel(v, 1); }
 static inline void atomic_dec(uint32_t *v) { ia64_fetchadd4_rel(v, -1); }
+#elif defined(__arm__)
+static inline void atomic_inc(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        __asm__ __volatile__("@ atomic_add\n"
+"1:     ldrex   %0, [%3]\n"
+"       add     %0, %0, #1\n"
+"       strex   %1, %0, [%3]\n"
+"       teq     %1, #0\n"
+"       bne     1b"
+        : "=&r" (result), "=&r" (tmp), "+Qo" (*v)
+        : "r" (v)
+        : "cc");
+}
+static inline void atomic_dec(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        __asm__ __volatile__("@ atomic_sub\n"
+"1:     ldrex   %0, [%3]\n"
+"       sub     %0, %0, #1\n"
+"       strex   %1, %0, [%3]\n"
+"       teq     %1, #0\n"
+"       bne     1b"
+        : "=&r" (result), "=&r" (tmp), "+Qo" (*v)
+        : "r" (v)
+        : "cc");
+}
 #else /* __x86__ */
 static inline void atomic_inc(uint32_t *v)
 {
Signature · 1 line
1.7.8.3
#12 lore raw

PATCH 10/11 arm: compile xentrace

In reply to Stefano Stabellini
---
 tools/xentrace/xenctx.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
tools/xentrace/xenctx.c +12 -0
index a12cc21..29c70e1 100644
@@ -60,6 +60,12 @@ int disp_ar_regs;
 int disp_br_regs;
 int disp_bank_regs;
 int disp_tlb;
+
+#elif defined(__arm__)
+#define NO_TRANSLATION
+typedef unsigned long long guest_word_t;
+#define FMT_32B_WORD "%08llx"
+#define FMT_64B_WORD "%016llx"
 #endif
 
 struct symbol {
@@ -678,6 +684,12 @@ void print_ctx(vcpu_guest_context_any_t *ctx)
             print_tr(i, &tr->dtrs[i]);
     }
 }
+#elif defined(__arm__)
+static void print_ctx(vcpu_guest_context_any_t *ctx)
+{
+    /* XXX: properly implement this */
+    print_symbol(0);
+}
 #endif
 
 #ifndef NO_TRANSLATION
Signature · 1 line
1.7.8.3
#13 lore raw

PATCH 11/11 tools: only compile libfsimage/xfs on X86

In reply to Stefano Stabellini

From: Ian Campbell <[email protected]>

xfs is not portable, only compile it on X86

---
 tools/libfsimage/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
tools/libfsimage/Makefile +2 -1
index 2deb830..bcb8b40 100644
@@ -1,7 +1,8 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS-y = common ufs reiserfs iso9660 fat zfs xfs
+SUBDIRS-y = common ufs reiserfs iso9660 fat zfs
+SUBDIRS-$(CONFIG_X86) += xfs
 SUBDIRS-y += $(shell env CC="$(CC)" ./check-libext2fs)
 
 .PHONY: all clean install
Signature · 1 line
1.7.8.3