Now that we have an ARM build environment[0] I''ve made a very basic start on getting the Xen tools for the ARMv7 w/ virt extensions port to compile. A short series follows. Nothing too earth shatteringly exciting... Currently compiles a fair bit of interesting stuff (libxc, xenstore, xenconsole) and gets as far as mid way through libxl before it fails due to CPUID stuff. Solving that needs some more infrastructure work in libxl to be able to have per-arch members in IDL structs. But I thought I might as well share what I have now. Note that I''ve not run any of it. Obviously the final patch is not to be applied! Ian. [0] https://plus.google.com/106815887686504011057/posts/Kgdakxs5cFt
On Mon, 2012-01-16 at 12:02 +0000, Ian Campbell wrote:> Now that we have an ARM build environment[0] I''ve made a very basic > start on getting the Xen tools for the ARMv7 w/ virt extensions port to > compile. A short series follows. Nothing too earth shatteringly > exciting...I made a typo in the xen-devel address on first posting of the series so I''m resending. Apologies for the noise.
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
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- Config.mk | 2 +- tools/libxc/Makefile | 1 + tools/libxc/xc_core.h | 2 + tools/libxc/xc_core_arm.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ tools/libxc/xc_core_arm.h | 61 +++++++++++++++++++++++++++++++++++++++ tools/libxc/xenctrl.h | 4 ++ 6 files changed, 139 insertions(+), 1 deletions(-) create mode 100644 tools/libxc/xc_core_arm.c create mode 100644 tools/libxc/xc_core_arm.h diff --git a/Config.mk b/Config.mk index 1c229c0..13a569e 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) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index b5e7022..b5bd7fb 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -6,6 +6,7 @@ MINOR = 0 CTRL_SRCS-y : CTRL_SRCS-y += xc_core.c +CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c CTRL_SRCS-y += xc_cpupool.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..9009295 --- /dev/null +++ b/tools/libxc/xc_core_arm.c @@ -0,0 +1,70 @@ +/* + * 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) 2012 Citrix Systems Ltd. + */ + +#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) +{ + /* default to trying to map the page */ + /* TODO consult p2m */ + return 1; +} + +int +xc_core_arch_memory_map_get(xc_interface *xch, + struct xc_core_arch_context *arch_ctxt, + xc_dominfo_t *info, + shared_info_any_t *live_shinfo, + xc_core_memory_map_t **mapp, + unsigned int *nr_entries) +{ + /* TODO return the memory map! */ + ERROR("%s is not implemented yet\n", __func__); + errno = ENOSYS; + return -1; +} + +int +xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info) +{ + /* All domains are auto_translated_physmap mode. */ + return 1; +} + +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) +{ + /* All domains are auto_translated_physmap mode. */ + errno = ENOSYS; + return -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..a2ef5a8 --- /dev/null +++ b/tools/libxc/xc_core_arm.h @@ -0,0 +1,61 @@ +/* + * 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) 2007 Isaku Yamahata <yamahata at valinux co jp> + * VA Linux Systems Japan K.K. + * + */ + +#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 1e149c1..1054584 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -81,6 +81,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 ("dsb" : : : "memory") +#define xen_rmb() asm volatile ("dsb" : : : "memory") +#define xen_wmb() asm volatile ("dsb" : : : "memory") #else #error "Define barriers" #endif -- 1.7.8.3
Ian Campbell
2012-Jan-16 12:16 UTC
[PATCH 3/5] libxl: do not allocate e820 for non x86 guests.
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 ebf2ed7..1c04e22 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -640,7 +640,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; @@ -650,6 +650,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 8b2a1c5..cae4fe6 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1163,6 +1163,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) { @@ -1404,6 +1405,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
Ian Campbell
2012-Jan-16 12:16 UTC
[PATCH 4/5] blktap2/libvhd: Build shared objects using -fPIC.
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 97379c1..8ee169e 100644 --- a/tools/blktap2/vhd/lib/Makefile +++ b/tools/blktap2/vhd/lib/Makefile @@ -45,27 +45,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
Ian Campbell
2012-Jan-16 12:16 UTC
[PATCH 5/5] DO-NOT-APPLY: Hackily remove bits which don''t (yet) build on ARM.
For the most part these tools need domU support to be more fully baked before they can be ported. In a few cases (e.g. blktap 1) I don''t think it makes sense to provide them for a new platform. In some cases the lack of portability is just gratuitous (libfsimage/xfs -- I''m looking at you). --- tools/Makefile | 6 +++--- tools/libfsimage/Makefile | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 443ee7f..7ad7afc 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -14,7 +14,7 @@ SUBDIRS-y += xenstore SUBDIRS-y += misc SUBDIRS-y += examples SUBDIRS-y += hotplug -SUBDIRS-y += xentrace +#SUBDIRS-y += xentrace SUBDIRS-$(CONFIG_XCUTILS) += xcutils SUBDIRS-$(CONFIG_X86) += firmware SUBDIRS-y += console @@ -23,8 +23,8 @@ SUBDIRS-$(VTPM_TOOLS) += vtpm_manager SUBDIRS-$(VTPM_TOOLS) += vtpm SUBDIRS-y += xenstat SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio) -SUBDIRS-$(CONFIG_Linux) += memshr -SUBDIRS-$(CONFIG_Linux) += blktap +#SUBDIRS-$(CONFIG_Linux) += memshr +#SUBDIRS-$(CONFIG_Linux) += blktap SUBDIRS-$(CONFIG_Linux) += blktap2 SUBDIRS-$(CONFIG_NetBSD) += $(SUBDIRS-libaio) SUBDIRS-$(CONFIG_NetBSD) += blktap2 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
Stefano Stabellini
2012-Jan-16 18:01 UTC
Re: [PATCH 2/5] arm: allow libxc to build (untested)
On Mon, 16 Jan 2012, Ian Campbell wrote:> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > --- > Config.mk | 2 +- > tools/libxc/Makefile | 1 + > tools/libxc/xc_core.h | 2 + > tools/libxc/xc_core_arm.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ > tools/libxc/xc_core_arm.h | 61 +++++++++++++++++++++++++++++++++++++++ > tools/libxc/xenctrl.h | 4 ++ > 6 files changed, 139 insertions(+), 1 deletions(-) > create mode 100644 tools/libxc/xc_core_arm.c > create mode 100644 tools/libxc/xc_core_arm.h > > diff --git a/Config.mk b/Config.mk > index 1c229c0..13a569e 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) > > diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile > index b5e7022..b5bd7fb 100644 > --- a/tools/libxc/Makefile > +++ b/tools/libxc/Makefile > @@ -6,6 +6,7 @@ MINOR = 0 > > CTRL_SRCS-y :> CTRL_SRCS-y += xc_core.c > +CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c > CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c > CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c > CTRL_SRCS-y += xc_cpupool.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..9009295 > --- /dev/null > +++ b/tools/libxc/xc_core_arm.c > @@ -0,0 +1,70 @@ > +/* > + * 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) 2012 Citrix Systems Ltd. > + */ > + > +#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) > +{ > + /* default to trying to map the page */ > + /* TODO consult p2m */ > + return 1; > +} > + > +int > +xc_core_arch_memory_map_get(xc_interface *xch, > + struct xc_core_arch_context *arch_ctxt, > + xc_dominfo_t *info, > + shared_info_any_t *live_shinfo, > + xc_core_memory_map_t **mapp, > + unsigned int *nr_entries) > +{ > + /* TODO return the memory map! */ > + ERROR("%s is not implemented yet\n", __func__); > + errno = ENOSYS; > + return -1; > +} > + > +int > +xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info) > +{ > + /* All domains are auto_translated_physmap mode. */ > + return 1; > +} > + > +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) > +{ > + /* All domains are auto_translated_physmap mode. */ > + errno = ENOSYS; > + return -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..a2ef5a8 > --- /dev/null > +++ b/tools/libxc/xc_core_arm.h > @@ -0,0 +1,61 @@ > +/* > + * 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) 2007 Isaku Yamahata <yamahata at valinux co jp> > + * VA Linux Systems Japan K.K. > + * > + */ > + > +#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) > +{/* TODO */ ?> + *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 1e149c1..1054584 100644 > --- a/tools/libxc/xenctrl.h > +++ b/tools/libxc/xenctrl.h > @@ -81,6 +81,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 ("dsb" : : : "memory") > +#define xen_rmb() asm volatile ("dsb" : : : "memory") > +#define xen_wmb() asm volatile ("dsb" : : : "memory") > #else > #error "Define barriers" > #endifI think the memory barriers are correct