diff options
-rw-r--r-- | Config.mk | 6 | ||||
-rw-r--r-- | tools/Rules.mk | 5 | ||||
-rw-r--r-- | xen/arch/x86/Rules.mk | 18 | ||||
-rw-r--r-- | xen/common/perfc.c | 17 | ||||
-rw-r--r-- | xen/include/public/arch-x86/xen-x86_32.h | 2 |
5 files changed, 19 insertions, 29 deletions
@@ -36,6 +36,12 @@ endif cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \ /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;) +# cc-ver +# Usage: ifeq ($(call cc-ver,$(CC),0x030400),y) +cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \ + '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \ + then echo y; else echo n; fi ;) + ifneq ($(debug),y) CFLAGS += -DNDEBUG else diff --git a/tools/Rules.mk b/tools/Rules.mk index df3b231a1a..3e13eceb55 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -23,6 +23,11 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) CFLAGS += $(CFLAGS-y) +# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers) +ifeq ($(CONFIG_X86)$(call cc-ver,$(CC),0x030400),yn) +$(error Xen tools require at least gcc-3.4) +endif + %.opic: %.c $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 899f28129c..86b9f33ab1 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -58,19 +58,7 @@ HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/*.h) HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/svm/*.h) HDRS += $(wildcard $(BASEDIR)/include/asm-x86/hvm/vmx/*.h) -# Test for at least GCC v3.2.x. -gcc-ver = $(shell $(CC) -dumpversion | sed -e 's/^\(.\)\.\(.\)\.\(.\)/\$(1)/') -ifeq ($(call gcc-ver,1),1) -$(error gcc-1.x.x unsupported - upgrade to at least gcc-3.2.x) -endif -ifeq ($(call gcc-ver,1),2) -$(error gcc-2.x.x unsupported - upgrade to at least gcc-3.2.x) -endif -ifeq ($(call gcc-ver,1),3) -ifeq ($(call gcc-ver,2),0) -$(error gcc-3.0.x unsupported - upgrade to at least gcc-3.2.x) -endif -ifeq ($(call gcc-ver,2),1) -$(error gcc-3.1.x unsupported - upgrade to at least gcc-3.2.x) -endif +# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers) +ifneq ($(call cc-ver,$(CC),0x030400),y) +$(error Xen requires at least gcc-3.4) endif diff --git a/xen/common/perfc.c b/xen/common/perfc.c index d5bcd9b2e1..bbff5d7b5c 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[NR_PERFCTRS]; static xen_sysctl_perfc_val_t *perfc_vals; static int perfc_nbr_vals; static int perfc_init = 0; -static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc, - XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val) +static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, + XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val) { unsigned int i, j; unsigned int v = 0; @@ -217,29 +217,20 @@ static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc, int perfc_control(xen_sysctl_perfc_op_t *pc) { static DEFINE_SPINLOCK(lock); - XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc; - XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val; int rc; - /* - * 64 bit guest handles cannot be passed as parameters to - * functions so cast to a regular guest handle. - */ - desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t); - val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t); - spin_lock(&lock); switch ( pc->cmd ) { case XEN_SYSCTL_PERFCOP_reset: - perfc_copy_info(desc, val); + perfc_copy_info(pc->desc, pc->val); perfc_reset(0); rc = 0; break; case XEN_SYSCTL_PERFCOP_query: - perfc_copy_info(desc, val); + perfc_copy_info(pc->desc, pc->val); rc = 0; break; diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h index 2633ff082f..6728b818cd 100644 --- a/xen/include/public/arch-x86/xen-x86_32.h +++ b/xen/include/public/arch-x86/xen-x86_32.h @@ -103,7 +103,7 @@ (hnd).p = val; \ } while ( 0 ) #define uint64_aligned_t uint64_t __attribute__((aligned(8))) -#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name __attribute__((aligned(8))) +#define XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name #endif #ifndef __ASSEMBLY__ |