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. Changes in v2: - rebased on a22587ae517170a7755d3a88611ae0e2d5bb555e; - dropped "arm: arch_dump_shared_mem_info as a no-op" that is already in xen-unstable; - define xen_callback_t as uint64_t; - define guest_word_t as uint64_t. 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 (6): arm: few missing #define arm: compile libxc arm: compile libxenguest arm: compile libxl arm: compile memshr arm: compile xentrace 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/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 + 21 files changed, 419 insertions(+), 10 deletions(-) A git tree based on a22587ae517170a7755d3a88611ae0e2d5bb555e, is available here: git://xenbits.xen.org/people/sstabellini/xen-unstable.git arm-tools-2 Cheers, Stefano
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. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- xen/include/public/arch-arm.h | 2 ++ xen/include/public/io/protocols.h | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index c430cf3..e3d5c08 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -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 uint64_t xen_callback_t; + #endif #endif /* __XEN_PUBLIC_ARCH_ARM_H__ */ diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h index 77bd1bd..0b7a2ea 100644 --- a/xen/include/public/io/protocols.h +++ b/xen/include/public/io/protocols.h @@ -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 -- 1.7.8.3
From: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- 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 diff --git a/xen/include/public/arch-arm/hvm/save.h b/xen/include/public/arch-arm/hvm/save.h new file mode 100644 index 0000000..ec61298 --- /dev/null +++ b/xen/include/public/arch-arm/hvm/save.h @@ -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: + */ diff --git a/xen/include/public/hvm/save.h b/xen/include/public/hvm/save.h index d0f2661..58f8433 100644 --- a/xen/include/public/hvm/save.h +++ b/xen/include/public/hvm/save.h @@ -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 -- 1.7.8.3
Stefano Stabellini
2012-Feb-10 12:02 UTC
[PATCH v2 03/10] libxl: do not allocate e820 for non x86 guests.
From: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- tools/libxl/libxl_create.c | 3 ++- tools/libxl/libxl_pci.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index f28d814..3a63be0 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -616,7 +616,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; @@ -626,6 +626,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 ))) { diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 99591c2..c545b85 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -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: -- 1.7.8.3
Stefano Stabellini
2012-Feb-10 12:02 UTC
[PATCH v2 04/10] blktap2/libvhd: Build shared objects using -fPIC.
From: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- tools/blktap2/vhd/lib/Makefile | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/Makefile index b72e4d9..1acee70 100644 --- a/tools/blktap2/vhd/lib/Makefile +++ b/tools/blktap2/vhd/lib/Makefile @@ -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 -- 1.7.8.3
Introduce an empty implementation of the arch specific ARM functions in xc_core_arm.c and xc_core_arm.h; define barriers on ARM. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- 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 diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index b5e7022..f2e1ba7 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -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 diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h index 1e88a75..358a8c1 100644 --- a/tools/libxc/xc_core.h +++ b/tools/libxc/xc_core.h @@ -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 diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c new file mode 100644 index 0000000..b1482ec --- /dev/null +++ b/tools/libxc/xc_core_arm.c @@ -0,0 +1,106 @@ +/* + * 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; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 "xg_private.h" +#include "xc_core.h" + +int +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt, + unsigned long pfn) +{ + /* TODO: memory from DT */ + if (pfn >= 0x80000 && pfn < 0x88000) + return 1; + return 0; +} + + +static int nr_gpfns(xc_interface *xch, domid_t domid) +{ + return xc_domain_maximum_gpfn(xch, domid) + 1; +} + +int +xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info) +{ + return 1; +} + +int +xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unused, + xc_dominfo_t *info, shared_info_any_t *live_shinfo, + xc_core_memory_map_t **mapp, + unsigned int *nr_entries) +{ + unsigned long p2m_size = nr_gpfns(xch, info->domid); + xc_core_memory_map_t *map; + + map = malloc(sizeof(*map)); + if ( map == NULL ) + { + PERROR("Could not allocate memory"); + return -1; + } + + map->addr = 0; + map->size = ((uint64_t)p2m_size) << PAGE_SHIFT; + + *mapp = map; + *nr_entries = 1; + return 0; +} + +static int +xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc_dominfo_t *info, + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, + unsigned long *pfnp, int rw) +{ + return -ENOSYS; +} + +int +xc_core_arch_map_p2m(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info, + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, + unsigned long *pfnp) +{ + struct domain_info_context _dinfo = { .guest_width = guest_width }; + struct domain_info_context *dinfo = &_dinfo; + return xc_core_arch_map_p2m_rw(xch, dinfo, info, + live_shinfo, live_p2m, pfnp, 0); +} + +int +xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info, + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, + unsigned long *pfnp) +{ + struct domain_info_context _dinfo = { .guest_width = guest_width }; + struct domain_info_context *dinfo = &_dinfo; + return xc_core_arch_map_p2m_rw(xch, dinfo, info, + live_shinfo, live_p2m, pfnp, 1); +} +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xc_core_arm.h b/tools/libxc/xc_core_arm.h new file mode 100644 index 0000000..3a6be2a --- /dev/null +++ b/tools/libxc/xc_core_arm.h @@ -0,0 +1,60 @@ +/* + * 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; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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) 2012 Citrix Systems + * + */ + +#ifndef XC_CORE_ARM_H +#define XC_CORE_ARM_H + +#define ELF_ARCH_DATA ELFDATA2LSB +#define ELF_ARCH_MACHINE EM_ARM + +struct xc_core_arch_context { + /* nothing */ +}; + +#define xc_core_arch_context_init(arch_ctxt) do {} while (0) +#define xc_core_arch_context_free(arch_ctxt) do {} while (0) +#define xc_core_arch_context_get(arch_ctxt, ctxt, xch, domid) \ + (0) +#define xc_core_arch_context_dump(xch, arch_ctxt, args, dump_rtn) (0) + +int +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt, + unsigned long pfn); +static inline int +xc_core_arch_context_get_shdr(xc_interface *xch, + struct xc_core_arch_context *arch_ctxt, + struct xc_core_section_headers *sheaders, + struct xc_core_strtab *strtab, + uint64_t *filesz, uint64_t offset) +{ + *filesz = 0; + return 0; +} + +#endif /* XC_CORE_ARM_H */ + +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index e6fd488..3ee8c59 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -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 -- 1.7.8.3
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. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- 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 diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index f2e1ba7..57ceee6 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -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 diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c new file mode 100644 index 0000000..bdd28e1 --- /dev/null +++ b/tools/libxc/xc_dom_arm.c @@ -0,0 +1,49 @@ +/* + * Xen domain builder -- ARM + * + * 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 <xen/xen.h> +#include "xg_private.h" +#include "xc_dom.h" + +int arch_setup_meminit(struct xc_dom_image *dom) +{ + return -ENOSYS; +} + +int arch_setup_bootearly(struct xc_dom_image *dom) +{ + DOMPRINTF("%s: doing nothing", __FUNCTION__); + return 0; +} + +int arch_setup_bootlate(struct xc_dom_image *dom) +{ + DOMPRINTF("%s: doing nothing", __FUNCTION__); + return 0; +} +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xc_nohvm.c b/tools/libxc/xc_nohvm.c new file mode 100644 index 0000000..a899f7c --- /dev/null +++ b/tools/libxc/xc_nohvm.c @@ -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; +} diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c new file mode 100644 index 0000000..63090e0 --- /dev/null +++ b/tools/libxc/xc_nomigrate.c @@ -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; +} -- 1.7.8.3
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. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/libxl/Makefile | 1 + tools/libxl/libxl_json.c | 8 ++++++++ tools/libxl/libxl_nocpuid.c | 2 +- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 06764f2..41b6ac4 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -36,6 +36,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 diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c index 5418683..e48e83a 100644 --- a/tools/libxl/libxl_json.c +++ b/tools/libxl/libxl_json.c @@ -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) { diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libxl/libxl_nocpuid.c index 9e52f8d..313d55b 100644 --- a/tools/libxl/libxl_nocpuid.c +++ b/tools/libxl/libxl_nocpuid.c @@ -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) { } -- 1.7.8.3
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/memshr/bidir-hash.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/tools/memshr/bidir-hash.c b/tools/memshr/bidir-hash.c index 6c0dc3d..45d473e 100644 --- a/tools/memshr/bidir-hash.c +++ b/tools/memshr/bidir-hash.c @@ -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) { -- 1.7.8.3
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/xentrace/xenctx.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c index a12cc21..530ef65 100644 --- a/tools/xentrace/xenctx.c +++ b/tools/xentrace/xenctx.c @@ -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 uint64_t 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 -- 1.7.8.3
Stefano Stabellini
2012-Feb-10 12:02 UTC
[PATCH v2 10/10] tools: only compile libfsimage/xfs on X86
From: Ian Campbell <ian.campbell@citrix.com> xfs is not portable, only compile it on X86 Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/libfsimage/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/libfsimage/Makefile b/tools/libfsimage/Makefile index 2deb830..bcb8b40 100644 --- a/tools/libfsimage/Makefile +++ b/tools/libfsimage/Makefile @@ -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 -- 1.7.8.3
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> From: Ian Campbell <ian.campbell@citrix.com> > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>When forwarding on other peoples patches please can you remember to include your own explicit Signed-off-by or Acked-by (I think the former is generally more appropriate per 2b or 2c of the DCO). This is particularly important if I am the original author since I don''t want to act as both Ack-er and commit-er of my own patches. Ian.> --- > 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 > > diff --git a/xen/include/public/arch-arm/hvm/save.h b/xen/include/public/arch-arm/hvm/save.h > new file mode 100644 > index 0000000..ec61298 > --- /dev/null > +++ b/xen/include/public/arch-arm/hvm/save.h > @@ -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: > + */ > diff --git a/xen/include/public/hvm/save.h b/xen/include/public/hvm/save.h > index d0f2661..58f8433 100644 > --- a/xen/include/public/hvm/save.h > +++ b/xen/include/public/hvm/save.h > @@ -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
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> 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).Have you tried native compilation? I get: $ make -C xen make: Entering directory `/local/scratch/ianc/devel/xen-unstable/xen'' make -f Rules.mk _build make[1]: Entering directory `/local/scratch/ianc/devel/xen-unstable/xen'' /local/scratch/ianc/devel/xen-unstable/xen/../Config.mk:45: /local/scratch/ianc/devel/xen-unstable/xen/../config/armv7l.mk: No such file or directory Rules.mk:35: /local/scratch/ianc/devel/xen-unstable/xen/arch/armv7l/Rules.mk: No such file or directory make[1]: *** No rule to make target `/local/scratch/ianc/devel/xen-unstable/xen/arch/armv7l/Rules.mk''. Stop. I presume this is because of: $ uname -m armv7l The following fixes it for me and matches what Linux does. 8<--------------------------------------------------------------- From 810e27651f0f883bab01f55e804fe733b92dd824 Mon Sep 17 00:00:00 2001 From: Ian Campbell <ian.campbell@citrix.com> Date: Mon, 13 Feb 2012 13:46:53 +0000 Subject: [PATCH] arm: Set XEN_COMPILE_ARCH correctly from "umame -m" on ARM Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- Config.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Config.mk b/Config.mk index e2dc4b9..df34718 100644 --- a/Config.mk +++ b/Config.mk @@ -13,7 +13,7 @@ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo " debug ?= y XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ - -e s/i86pc/x86_32/ -e s/amd64/x86_64/) + -e s/i86pc/x86_32/ -e s/amd64/x86_64/ -e s/arm.*/arm/) XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) XEN_OS ?= $(shell uname -s) -- 1.7.8.3
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> 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. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>I committed this. Ian.
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> Introduce an empty implementation of the arch specific ARM functions in > xc_core_arm.c and xc_core_arm.h; define barriers on ARM. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > 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 > > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile > index b5e7022..f2e1ba7 100644 > --- a/tools/libxc/Makefile > +++ b/tools/libxc/Makefile > @@ -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 > diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h > index 1e88a75..358a8c1 100644 > --- a/tools/libxc/xc_core.h > +++ b/tools/libxc/xc_core.h > @@ -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 > diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c > new file mode 100644 > index 0000000..b1482ec > --- /dev/null > +++ b/tools/libxc/xc_core_arm.c > @@ -0,0 +1,106 @@ > +/* > + * 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; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * 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 "xg_private.h" > +#include "xc_core.h" > + > +int > +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt, > + unsigned long pfn) > +{ > + /* TODO: memory from DT */ > + if (pfn >= 0x80000 && pfn < 0x88000) > + return 1; > + return 0; > +} > + > + > +static int nr_gpfns(xc_interface *xch, domid_t domid) > +{ > + return xc_domain_maximum_gpfn(xch, domid) + 1; > +} > + > +int > +xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info) > +{ > + return 1; > +} > + > +int > +xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unused, > + xc_dominfo_t *info, shared_info_any_t *live_shinfo, > + xc_core_memory_map_t **mapp, > + unsigned int *nr_entries) > +{ > + unsigned long p2m_size = nr_gpfns(xch, info->domid); > + xc_core_memory_map_t *map; > + > + map = malloc(sizeof(*map)); > + if ( map == NULL ) > + { > + PERROR("Could not allocate memory"); > + return -1; > + } > + > + map->addr = 0; > + map->size = ((uint64_t)p2m_size) << PAGE_SHIFT; > + > + *mapp = map; > + *nr_entries = 1; > + return 0; > +} > + > +static int > +xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc_dominfo_t *info, > + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, > + unsigned long *pfnp, int rw) > +{ > + return -ENOSYS; > +} > + > +int > +xc_core_arch_map_p2m(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info, > + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, > + unsigned long *pfnp) > +{ > + struct domain_info_context _dinfo = { .guest_width = guest_width }; > + struct domain_info_context *dinfo = &_dinfo; > + return xc_core_arch_map_p2m_rw(xch, dinfo, info, > + live_shinfo, live_p2m, pfnp, 0); > +} > + > +int > +xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info, > + shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m, > + unsigned long *pfnp) > +{ > + struct domain_info_context _dinfo = { .guest_width = guest_width }; > + struct domain_info_context *dinfo = &_dinfo; > + return xc_core_arch_map_p2m_rw(xch, dinfo, info, > + live_shinfo, live_p2m, pfnp, 1); > +} > +/* > + * Local variables: > + * mode: C > + * c-set-style: "BSD" > + * c-basic-offset: 4 > + * tab-width: 4 > + * indent-tabs-mode: nil > + * End: > + */ > diff --git a/tools/libxc/xc_core_arm.h b/tools/libxc/xc_core_arm.h > new file mode 100644 > index 0000000..3a6be2a > --- /dev/null > +++ b/tools/libxc/xc_core_arm.h > @@ -0,0 +1,60 @@ > +/* > + * 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; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * 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) 2012 Citrix Systems > + * > + */ > + > +#ifndef XC_CORE_ARM_H > +#define XC_CORE_ARM_H > + > +#define ELF_ARCH_DATA ELFDATA2LSB > +#define ELF_ARCH_MACHINE EM_ARM > + > +struct xc_core_arch_context { > + /* nothing */ > +}; > + > +#define xc_core_arch_context_init(arch_ctxt) do {} while (0) > +#define xc_core_arch_context_free(arch_ctxt) do {} while (0) > +#define xc_core_arch_context_get(arch_ctxt, ctxt, xch, domid) \ > + (0) > +#define xc_core_arch_context_dump(xch, arch_ctxt, args, dump_rtn) (0) > + > +int > +xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt, > + unsigned long pfn); > +static inline int > +xc_core_arch_context_get_shdr(xc_interface *xch, > + struct xc_core_arch_context *arch_ctxt, > + struct xc_core_section_headers *sheaders, > + struct xc_core_strtab *strtab, > + uint64_t *filesz, uint64_t offset) > +{ > + *filesz = 0; > + return 0; > +} > + > +#endif /* XC_CORE_ARM_H */ > + > +/* > + * Local variables: > + * mode: C > + * c-set-style: "BSD" > + * c-basic-offset: 4 > + * tab-width: 4 > + * indent-tabs-mode: nil > + * End: > + */ > diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h > index e6fd488..3ee8c59 100644 > --- a/tools/libxc/xenctrl.h > +++ b/tools/libxc/xenctrl.h > @@ -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
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> Introduce an empty implementation of the arch specific ARM functions in > xc_dom_arm.c.This bit: Acked-by: Ian Campbell <ian.campbell@citrix.com>> 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.Less sure about this bit. Is the content of xc_hvm_build x86 specific? ia64 seems to have it''s own version in tools/libxc/ia64/xc_ia64_hvm_build.c. (I guess ia64 does not define CONFG_HVM, despite apparently supporting HVM? Otherwise I don''t see how the tools/libxc/Makefile stuff could work) Perhaps xc_hvm_build should go to xc_x86_hvm_build.c and xc_x86_arm_build.c should have stubs? Also xc_hvm_build.c has public functions other than the one you have stubbed out in it. Should stub them too? The migrate case seems more like a temporary band-aid since we will eventually want to support that on ARM -- I guess there''s no quick hack to make it compile since we''d need to define all sorts of things we aren''t ready to define yet?> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > --- > 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 > > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile > index f2e1ba7..57ceee6 100644 > --- a/tools/libxc/Makefile > +++ b/tools/libxc/Makefile > @@ -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 > > diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c > new file mode 100644 > index 0000000..bdd28e1 > --- /dev/null > +++ b/tools/libxc/xc_dom_arm.c > @@ -0,0 +1,49 @@ > +/* > + * Xen domain builder -- ARM > + * > + * 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 <xen/xen.h> > +#include "xg_private.h" > +#include "xc_dom.h" > + > +int arch_setup_meminit(struct xc_dom_image *dom) > +{ > + return -ENOSYS; > +} > + > +int arch_setup_bootearly(struct xc_dom_image *dom) > +{ > + DOMPRINTF("%s: doing nothing", __FUNCTION__); > + return 0; > +} > + > +int arch_setup_bootlate(struct xc_dom_image *dom) > +{ > + DOMPRINTF("%s: doing nothing", __FUNCTION__); > + return 0; > +} > +/* > + * Local variables: > + * mode: C > + * c-set-style: "BSD" > + * c-basic-offset: 4 > + * tab-width: 4 > + * indent-tabs-mode: nil > + * End: > + */ > diff --git a/tools/libxc/xc_nohvm.c b/tools/libxc/xc_nohvm.c > new file mode 100644 > index 0000000..a899f7c > --- /dev/null > +++ b/tools/libxc/xc_nohvm.c > @@ -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; > +} > diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c > new file mode 100644 > index 0000000..63090e0 > --- /dev/null > +++ b/tools/libxc/xc_nomigrate.c > @@ -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; > +}
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> 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. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/libxl/Makefile | 1 + > tools/libxl/libxl_json.c | 8 ++++++++ > tools/libxl/libxl_nocpuid.c | 2 +- > 3 files changed, 10 insertions(+), 1 deletions(-) > > diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile > index 06764f2..41b6ac4 100644 > --- a/tools/libxl/Makefile > +++ b/tools/libxl/Makefile > @@ -36,6 +36,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 > diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c > index 5418683..e48e83a 100644 > --- a/tools/libxl/libxl_json.c > +++ b/tools/libxl/libxl_json.c > @@ -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) > { > diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libxl/libxl_nocpuid.c > index 9e52f8d..313d55b 100644 > --- a/tools/libxl/libxl_nocpuid.c > +++ b/tools/libxl/libxl_nocpuid.c > @@ -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) > { > } >
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>I''m a little surprised we don''t have some more "utils" type place to put these but since it was already like this: Acked-by: Ian Campbell <Ian.campbell@citrix.com>> --- > tools/memshr/bidir-hash.c | 31 +++++++++++++++++++++++++++++++ > 1 files changed, 31 insertions(+), 0 deletions(-) > > diff --git a/tools/memshr/bidir-hash.c b/tools/memshr/bidir-hash.c > index 6c0dc3d..45d473e 100644 > --- a/tools/memshr/bidir-hash.c > +++ b/tools/memshr/bidir-hash.c > @@ -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) > {
On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/xentrace/xenctx.c | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c > index a12cc21..530ef65 100644 > --- a/tools/xentrace/xenctx.c > +++ b/tools/xentrace/xenctx.c > @@ -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 uint64_t 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
On Fri, 2012-02-10 at 12:01 +0000, Stefano Stabellini wrote:> 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.#1 committed. #2 I will commit if someone else acks (since I wrote it). #3-4 are not arm specific and should be committed by IanJ, no need for me to ack since I wrote them but it would be useful for you (or someone else) to explicitly ack them for his benefit. #5 is pretty arm specific, however I''ve only Acked and not committed since it may as well go in with the rest. #6 partially acked + commented upon #7-9 acked but left for a more appropriate committer to pick up (ianj mostly) #10 I''m the author, also for IanJ to commit I think. (For "Ian J to commit" read "... or I''ll do it with his Ack+OK") Ian.> > > Changes in v2: > > - rebased on a22587ae517170a7755d3a88611ae0e2d5bb555e; > > - dropped "arm: arch_dump_shared_mem_info as a no-op" that is already in > xen-unstable; > > - define xen_callback_t as uint64_t; > > - define guest_word_t as uint64_t. > > > > 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 (6): > arm: few missing #define > arm: compile libxc > arm: compile libxenguest > arm: compile libxl > arm: compile memshr > arm: compile xentrace > 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/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 + > 21 files changed, 419 insertions(+), 10 deletions(-) > > A git tree based on a22587ae517170a7755d3a88611ae0e2d5bb555e, is available here: > > git://xenbits.xen.org/people/sstabellini/xen-unstable.git arm-tools-2 > > Cheers, > > Stefano
Ian Jackson
2012-Feb-13 17:28 UTC
Re: [PATCH v2 03/10] libxl: do not allocate e820 for non x86 guests.
Stefano Stabellini writes ("[Xen-devel] [PATCH v2 03/10] libxl: do not allocate e820 for non x86 guests."): ...> - > +#if defined(__i386__) || defined(__x86_64__)I would prefer to avoid these kind of platform-specific ifdefs in libxl if possible. I think we may need to invent libxl_x86.c or something. Ian.
Ian Jackson
2012-Feb-13 17:29 UTC
Re: [PATCH v2 04/10] blktap2/libvhd: Build shared objects using -fPIC.
Stefano Stabellini writes ("[Xen-devel] [PATCH v2 04/10] blktap2/libvhd: Build shared objects using -fPIC."):> diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap2/vhd/lib/MakefileAcked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson
2012-Feb-13 17:32 UTC
Re: [PATCH v2 10/10] tools: only compile libfsimage/xfs on X86
Stefano Stabellini writes ("[Xen-devel] [PATCH v2 10/10] tools: only compile libfsimage/xfs on X86"):> xfs is not portable, only compile it on X86Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Stefano Stabellini writes ("[Xen-devel] [PATCH v2 07/10] arm: compile libxl"):> 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....> +#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; > +} > +#endifAgain, can''t this be moved to libxl_{no,}cpuid.c ? If we really do have to have #ifdefs (eg, if we have code that needs to be controlled by several different conditions at once) we should invent a suitable single #define for each feature, eg LIBXL_HAVE_CPUID or something rather than spreading "defined(__i386__) || defined(__x86_64__)" all over the place. Ian.
Stefano Stabellini writes ("[Xen-devel] [PATCH v2 05/10] arm: compile libxc"):> Introduce an empty implementation of the arch specific ARM functions in > xc_core_arm.c and xc_core_arm.h; define barriers on ARM.Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell writes ("Re: [Xen-devel] [PATCH v2 00/10] arm: compile tools"):> #1 committed.Thanks for this series, Stefano. I have applied a couple that were obviously good to go standalone. For the others which had a tools part I have either acked or commented and I think it might be best if they all went in together ? Ian.
On Mon, 13 Feb 2012, Ian Campbell wrote:> 8<--------------------------------------------------------------- > > From 810e27651f0f883bab01f55e804fe733b92dd824 Mon Sep 17 00:00:00 2001 > From: Ian Campbell <ian.campbell@citrix.com> > Date: Mon, 13 Feb 2012 13:46:53 +0000 > Subject: [PATCH] arm: Set XEN_COMPILE_ARCH correctly from "umame -m" on ARMack> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > --- > Config.mk | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/Config.mk b/Config.mk > index e2dc4b9..df34718 100644 > --- a/Config.mk > +++ b/Config.mk > @@ -13,7 +13,7 @@ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo " > debug ?= y > > XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ > - -e s/i86pc/x86_32/ -e s/amd64/x86_64/) > + -e s/i86pc/x86_32/ -e s/amd64/x86_64/ -e s/arm.*/arm/) > XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) > XEN_OS ?= $(shell uname -s) > > -- > 1.7.8.3 > > > >
On Mon, 13 Feb 2012, Ian Campbell wrote:> On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote: > > Introduce an empty implementation of the arch specific ARM functions in > > xc_dom_arm.c. > > This bit: > Acked-by: Ian Campbell <ian.campbell@citrix.com> > > > 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. > > Less sure about this bit. > > Is the content of xc_hvm_build x86 specific? ia64 seems to have it''s own > version in tools/libxc/ia64/xc_ia64_hvm_build.c. (I guess ia64 does not > define CONFG_HVM, despite apparently supporting HVM? Otherwise I don''t > see how the tools/libxc/Makefile stuff could work) > > Perhaps xc_hvm_build should go to xc_x86_hvm_build.c and > xc_x86_arm_build.c should have stubs?Yes, good idea.> Also xc_hvm_build.c has public functions other than the one you have > stubbed out in it. Should stub them too?Yes, they should.> The migrate case seems more like a temporary band-aid since we will > eventually want to support that on ARM -- I guess there''s no quick hack > to make it compile since we''d need to define all sorts of things we > aren''t ready to define yet?I don''t think quick hacks are possible here: give a look at vcpu_guest_context_any_t: it contains two additional fields (x32 and x64) that are x86_32/64 specific and they are referenced through all the save/restore code without any ifdefs.
Stefano Stabellini
2012-Feb-14 19:16 UTC
Re: [PATCH v2 03/10] libxl: do not allocate e820 for non x86 guests.
On Mon, 13 Feb 2012, Ian Jackson wrote:> Stefano Stabellini writes ("[Xen-devel] [PATCH v2 03/10] libxl: do not allocate e820 for non x86 guests."): > ... > > - > > +#if defined(__i386__) || defined(__x86_64__) > > I would prefer to avoid these kind of platform-specific ifdefs in > libxl if possible. I think we may need to invent libxl_x86.c or > something.OK
On Mon, 13 Feb 2012, Ian Jackson wrote:> Stefano Stabellini writes ("[Xen-devel] [PATCH v2 07/10] arm: compile libxl"): > > 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. > ... > > +#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 > > Again, can''t this be moved to libxl_{no,}cpuid.c ?Yes, it can.
On Mon, 13 Feb 2012, Ian Jackson wrote:> Ian Campbell writes ("Re: [Xen-devel] [PATCH v2 00/10] arm: compile tools"): > > #1 committed. > > Thanks for this series, Stefano. I have applied a couple that were > obviously good to go standalone. For the others which had a tools > part I have either acked or commented and I think it might be best if > they all went in together ?Yes, it is easier for me to keep track of them this way.
On Mon, 13 Feb 2012, Ian Campbell wrote:> On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote: > > From: Ian Campbell <ian.campbell@citrix.com> > > > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > > When forwarding on other peoples patches please can you remember to > include your own explicit Signed-off-by or Acked-by (I think the former > is generally more appropriate per 2b or 2c of the DCO). > > This is particularly important if I am the original author since I don''t > want to act as both Ack-er and commit-er of my own patches. >OK
On Tue, 2012-02-14 at 15:11 +0000, Stefano Stabellini wrote:> On Mon, 13 Feb 2012, Ian Campbell wrote: > > 8<--------------------------------------------------------------- > > > > From 810e27651f0f883bab01f55e804fe733b92dd824 Mon Sep 17 00:00:00 2001 > > From: Ian Campbell <ian.campbell@citrix.com> > > Date: Mon, 13 Feb 2012 13:46:53 +0000 > > Subject: [PATCH] arm: Set XEN_COMPILE_ARCH correctly from "umame -m" on ARM > > ackThanks, committed.