diff options
author | Andrey Konovalov <andrey.konovalov@linaro.org> | 2015-04-14 17:42:42 +0300 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2015-04-14 17:42:42 +0300 |
commit | 29dfbd875f09ec67d28033da496c7e4613fabbc9 (patch) | |
tree | 986ad6ebb66a95d60a78f3398fbefff3c8a8de59 /arch | |
parent | 5b05a7bfb614b57ead12010b92429946ca12e5bb (diff) | |
parent | 230b22d72454f0b9ed2cf1410771bbba7830f89e (diff) |
Automatically merging tracking-llvm into merge-linux-linaro
Conflicting files:
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Makefile | 14 | ||||
-rw-r--r-- | arch/arm/boot/compressed/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/firmware/trusted_foundations.c | 5 | ||||
-rw-r--r-- | arch/arm/include/asm/thread_info.h | 5 | ||||
-rw-r--r-- | arch/arm/kernel/psci.c | 30 | ||||
-rw-r--r-- | arch/arm/lib/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/lib/eabi.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-bcm/bcm_kona_smc.c | 9 | ||||
-rw-r--r-- | arch/arm/mm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm64/crypto/Makefile | 2 | ||||
-rw-r--r-- | arch/arm64/include/asm/futex.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/processor.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/asmmacro.h | 8 | ||||
-rw-r--r-- | arch/mips/include/asm/checksum.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/thread_info.h | 6 | ||||
-rw-r--r-- | arch/mips/include/uapi/asm/inst.h | 2 | ||||
-rw-r--r-- | arch/mips/math-emu/dp_add.c | 10 | ||||
-rw-r--r-- | arch/mips/math-emu/dp_sub.c | 10 | ||||
-rw-r--r-- | arch/mips/math-emu/sp_add.c | 10 | ||||
-rw-r--r-- | arch/mips/math-emu/sp_sub.c | 10 | ||||
-rw-r--r-- | arch/x86/boot/memory.c | 7 | ||||
-rw-r--r-- | arch/x86/boot/string.h | 2 | ||||
-rw-r--r-- | arch/x86/um/ksyms.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 35 |
24 files changed, 133 insertions, 79 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 510d46e9aba6..439615dca6e0 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -26,6 +26,10 @@ GZFLAGS :=-9 # Never generate .eh_frame KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) +ifeq ($(COMPILER),clang) +KBUILD_CFLAGS += -Wa,-mno-warn-deprecated +endif + # Do not use arch/arm/defconfig - it's always outdated. # Select a platform tht is kept up-to-date KBUILD_DEFCONFIG := versatile_defconfig @@ -37,15 +41,15 @@ KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access) endif ifeq ($(CONFIG_FRAME_POINTER),y) -KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog +KBUILD_CFLAGS +=-fno-omit-frame-pointer $(call cc-option,-mapcs,) $(call cc-option,-mno-sched-prolog,) endif ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) -KBUILD_CPPFLAGS += -mbig-endian +KBUILD_CPPFLAGS += $(call cc-option,-mbig-endian) AS += -EB LD += -EB else -KBUILD_CPPFLAGS += -mlittle-endian +KBUILD_CPPFLAGS += $(call cc-option,-mlittle-endian) AS += -EL LD += -EL endif @@ -94,7 +98,7 @@ tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) tune-y := $(tune-y) ifeq ($(CONFIG_AEABI),y) -CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp +CFLAGS_ABI :=-mabi=aapcs-linux $(call cc-option,-mno-thumb-interwork,) -mfpu=vfp else CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) endif @@ -118,7 +122,7 @@ AFLAGS_ISA :=$(CFLAGS_ISA) endif # Need -Uarm for gcc < 3.x -KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm +KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float $(call cc-option, -Uarm,) KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float CHECKFLAGS += -D__arm__ diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 3ea230aa94b7..b7a39fbebad7 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -123,7 +123,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif -ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj) +ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj) asflags-y := -DZIMAGE # Supply kernel BSS size to the decompressor via a linker symbol. diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c index 3fb1b5a1dce9..f319c3fa0fe5 100644 --- a/arch/arm/firmware/trusted_foundations.c +++ b/arch/arm/firmware/trusted_foundations.c @@ -31,14 +31,11 @@ static unsigned long cpu_boot_addr; -static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2) +static inline void tf_generic_smc(u32 type, u32 arg1, u32 arg2) { asm volatile( ".arch_extension sec\n\t" "stmfd sp!, {r4 - r11, lr}\n\t" - __asmeq("%0", "r0") - __asmeq("%1", "r1") - __asmeq("%2", "r2") "mov r3, #0\n\t" "mov r4, #0\n\t" "smc #0\n\t" diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 72812a1f3d1c..32a0716bdef1 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -91,6 +91,11 @@ struct thread_info { register unsigned long current_stack_pointer asm ("sp"); /* + * how to get the current stack pointer in C + */ +register unsigned long current_stack_pointer asm ("sp"); + +/* * how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) __attribute_const__; diff --git a/arch/arm/kernel/psci.c b/arch/arm/kernel/psci.c index f73891b6b730..824809eb8775 100644 --- a/arch/arm/kernel/psci.c +++ b/arch/arm/kernel/psci.c @@ -78,31 +78,33 @@ static u32 psci_power_state_pack(struct psci_power_state state) static noinline int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) { + register u32 function_id_r0 asm ("r0") = function_id; + register u32 arg0_r1 asm ("r1") = arg0; + register u32 arg1_r2 asm ("r2") = arg1; + register u32 arg2_r3 asm ("r3") = arg2; + asm volatile( - __asmeq("%0", "r0") - __asmeq("%1", "r1") - __asmeq("%2", "r2") - __asmeq("%3", "r3") __HVC(0) - : "+r" (function_id) - : "r" (arg0), "r" (arg1), "r" (arg2)); + : "+r" (function_id_r0) + : "r" (arg0_r1), "r" (arg1_r2), "r" (arg2_r3)); - return function_id; + return function_id_r0; } static noinline int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) { + register u32 function_id_r0 asm ("r0") = function_id; + register u32 arg0_r1 asm ("r1") = arg0; + register u32 arg1_r2 asm ("r2") = arg1; + register u32 arg2_r3 asm ("r3") = arg2; + asm volatile( - __asmeq("%0", "r0") - __asmeq("%1", "r1") - __asmeq("%2", "r2") - __asmeq("%3", "r3") __SMC(0) - : "+r" (function_id) - : "r" (arg0), "r" (arg1), "r" (arg2)); + : "+r" (function_id_r0) + : "r" (arg0_r1), "r" (arg1_r2), "r" (arg2_r3)); - return function_id; + return function_id_r0; } static int psci_get_version(void) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index d8a780799506..6c7a5b715584 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -15,6 +15,10 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ io-readsb.o io-writesb.o io-readsl.o io-writesl.o \ call_with_stack.o bswapsdi2.o +ifeq ($(COMPILER),clang) +lib-y += eabi.o +endif + mmu-y := clear_user.o copy_page.o getuser.o putuser.o \ copy_from_user.o copy_to_user.o diff --git a/arch/arm/lib/eabi.c b/arch/arm/lib/eabi.c new file mode 100644 index 000000000000..636a403c9579 --- /dev/null +++ b/arch/arm/lib/eabi.c @@ -0,0 +1,28 @@ +/* + * EABI routines + * + * Copyright (C) 2012 Mark Charlebois + */ + +#include <linux/types.h> +#include <linux/string.h> +#include <linux/ctype.h> +#include <linux/export.h> + +void __aeabi_memcpy(void *dest, const void *src, size_t n) +{ + (void)memcpy(dest, src, n); +} +EXPORT_SYMBOL(__aeabi_memcpy); + +void __aeabi_memmove(void *dest, const void *src, size_t n) +{ + (void)memmove(dest, src, n); +} +EXPORT_SYMBOL(__aeabi_memmove); + +void __aeabi_memset(void *s, size_t n, int c) +{ + (void)memset(s, c, n); +} +EXPORT_SYMBOL(__aeabi_memset); diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c index a55a7ecf146a..3937bd5d452f 100644 --- a/arch/arm/mach-bcm/bcm_kona_smc.c +++ b/arch/arm/mach-bcm/bcm_kona_smc.c @@ -106,9 +106,14 @@ int __init bcm_kona_smc_init(void) * request result appropriately. This result value is found in r0 * when the "smc" request completes. */ +#ifdef __clang__ +#define R12 "r12" +#else /* !__clang__ */ +#define R12 "ip" /* gcc calls r12 "ip" */ +#endif /* !__clang__ */ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) { - register u32 ip asm("ip"); /* Also called r12 */ + register u32 ip asm(R12); /* Also called r12 */ register u32 r0 asm("r0"); register u32 r4 asm("r4"); register u32 r5 asm("r5"); @@ -120,7 +125,7 @@ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) asm volatile ( /* Make sure we got the registers we want */ - __asmeq("%0", "ip") + __asmeq("%0", R12) __asmeq("%1", "r0") __asmeq("%2", "r4") __asmeq("%3", "r5") diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 9b4f29e595a4..da44697a4b06 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -697,7 +697,7 @@ config SWP_EMULATE config CPU_BIG_ENDIAN bool "Build big-endian kernel" - depends on ARCH_SUPPORTS_BIG_ENDIAN + depends on ARCH_SUPPORTS_BIG_ENDIAN && BROKEN help Say Y if you plan on running a kernel in big-endian mode. Note that your board must be properly built and your board diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile index abb79b3cfcfe..574851096072 100644 --- a/arch/arm64/crypto/Makefile +++ b/arch/arm64/crypto/Makefile @@ -18,7 +18,7 @@ obj-$(CONFIG_CRYPTO_GHASH_ARM64_CE) += ghash-ce.o ghash-ce-y := ghash-ce-glue.o ghash-ce-core.o obj-$(CONFIG_CRYPTO_AES_ARM64_CE) += aes-ce-cipher.o -CFLAGS_aes-ce-cipher.o += -march=armv8-a+crypto +CFLAGS_aes-ce-cipher.o += -march=armv8-a+crypto -Wa,-march=armv8-a+crypto obj-$(CONFIG_CRYPTO_AES_ARM64_CE_CCM) += aes-ce-ccm.o aes-ce-ccm-y := aes-ce-ccm-glue.o aes-ce-ccm-core.o diff --git a/arch/arm64/include/asm/futex.h b/arch/arm64/include/asm/futex.h index 5f750dc96e0f..9e5ed17447ca 100644 --- a/arch/arm64/include/asm/futex.h +++ b/arch/arm64/include/asm/futex.h @@ -108,7 +108,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, int ret = 0; u32 val, tmp; - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) + /* compiler may optimize uaddr to xzr if all uses are 0 which fails */ + if (uaddr == 0 || !access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) return -EFAULT; asm volatile("// futex_atomic_cmpxchg_inatomic\n" diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 20e9591a60cf..42ca271b6c60 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -146,13 +146,13 @@ extern struct task_struct *cpu_switch_to(struct task_struct *prev, #define ARCH_HAS_PREFETCH static inline void prefetch(const void *ptr) { - asm volatile("prfm pldl1keep, %a0\n" : : "p" (ptr)); + asm volatile("prfm pldl1keep, [%x0]\n" : : "r" (ptr)); } #define ARCH_HAS_PREFETCHW static inline void prefetchw(const void *ptr) { - asm volatile("prfm pstl1keep, %a0\n" : : "p" (ptr)); + asm volatile("prfm pstl1keep, [%x0]\n" : : "r" (ptr)); } #define ARCH_HAS_SPINLOCK_PREFETCH diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index 0cae4595e985..68acc034a901 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h @@ -202,12 +202,12 @@ .word 0x41600021 | (\reg << 16) .endm - .macro MFTR rt=0, rd=0, u=0, sel=0 - .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel) + .macro MFTR rt=0, rd=0, _u=0, sel=0 + .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\_u << 5) | (\sel) .endm - .macro MTTR rt=0, rd=0, u=0, sel=0 - .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel) + .macro MTTR rt=0, rd=0, _u=0, sel=0 + .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\_u << 5) | (\sel) .endm #ifdef TOOLCHAIN_SUPPORTS_MSA diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 5c585c5c1c3e..966c36a9391b 100644 --- a/arch/mips/include/asm/checksum.h +++ b/arch/mips/include/asm/checksum.h @@ -215,7 +215,7 @@ static inline __sum16 ip_compute_csum(const void *buff, int len) #define _HAVE_ARCH_IPV6_CSUM static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, - __u32 len, unsigned short proto, + __u32 len, __u32 proto, __wsum sum) { __asm__( diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 55ed6602204c..397ae940bcee 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h @@ -55,11 +55,11 @@ struct thread_info { #define init_stack (init_thread_union.stack) /* How to get the thread information struct from C. */ +register struct thread_info *current_gp_register asm("$28"); + static inline struct thread_info *current_thread_info(void) { - register struct thread_info *__current_thread_info __asm__("$28"); - - return __current_thread_info; + return current_gp_register; } #endif /* !__ASSEMBLY__ */ diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index fc0cf5ac0cf7..368dad88dbbc 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h @@ -915,7 +915,7 @@ union mips_instruction { }; union mips16e_instruction { - unsigned int full : 16; + unsigned short full; struct m16e_rr rr; struct m16e_jal jal; struct m16e_i64 i64; diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c index 7f64577df984..31d31de1f6cb 100644 --- a/arch/mips/math-emu/dp_add.c +++ b/arch/mips/math-emu/dp_add.c @@ -150,8 +150,8 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y) * leaving result in xm, xs and xe. */ xm = xm + ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ xm = XDPSRS1(xm); @@ -160,11 +160,11 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y) } else { if (xm >= ym) { xm = xm - ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ } else { xm = ym - xm; - xe = xe; + /* xe does not change */ xs = ys; } if (xm == 0) diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c index 7a174029043a..5a109735cb50 100644 --- a/arch/mips/math-emu/dp_sub.c +++ b/arch/mips/math-emu/dp_sub.c @@ -153,8 +153,8 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y) /* generate 28 bit result of adding two 27 bit numbers */ xm = xm + ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */ xm = XDPSRS1(xm); /* shift preserving sticky */ @@ -163,11 +163,11 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y) } else { if (xm >= ym) { xm = xm - ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ } else { xm = ym - xm; - xe = xe; + /* xe does not change */ xs = ys; } if (xm == 0) { diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c index 2d84d460cb67..18e71f517a1c 100644 --- a/arch/mips/math-emu/sp_add.c +++ b/arch/mips/math-emu/sp_add.c @@ -148,8 +148,8 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y) * leaving result in xm, xs and xe. */ xm = xm + ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ SPXSRSX1(); @@ -157,11 +157,11 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y) } else { if (xm >= ym) { xm = xm - ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ } else { xm = ym - xm; - xe = xe; + /* xe does not change */ xs = ys; } if (xm == 0) diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c index 8592e49032b8..b3443f5438a7 100644 --- a/arch/mips/math-emu/sp_sub.c +++ b/arch/mips/math-emu/sp_sub.c @@ -148,8 +148,8 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y) /* generate 28 bit result of adding two 27 bit numbers */ xm = xm + ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */ SPXSRSX1(); /* shift preserving sticky */ @@ -157,11 +157,11 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y) } else { if (xm >= ym) { xm = xm - ym; - xe = xe; - xs = xs; + /* xe does not change */ + /* xs does not change */ } else { xm = ym - xm; - xe = xe; + /* xe does not change */ xs = ys; } if (xm == 0) { diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c index db75d07c3645..7af65046dfad 100644 --- a/arch/x86/boot/memory.c +++ b/arch/x86/boot/memory.c @@ -63,8 +63,13 @@ static int detect_memory_e820(void) count = 0; break; } - +#ifdef __clang__ + /* PR18415 */ + memcpy(desc, &buf, sizeof(*desc)); + desc++; +#else *desc++ = buf; +#endif count++; } while (ireg.ebx && count < ARRAY_SIZE(boot_params.e820_map)); diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h index 725e820602b1..3e07af1d80e3 100644 --- a/arch/x86/boot/string.h +++ b/arch/x86/boot/string.h @@ -14,8 +14,10 @@ int memcmp(const void *s1, const void *s2, size_t len); * Access builtin version by default. If one needs to use optimized version, * do "undef memcpy" in .c file and link against right string.c */ +#ifndef __clang__ /* PR18415 */ #define memcpy(d,s,l) __builtin_memcpy(d,s,l) #define memset(d,c,l) __builtin_memset(d,c,l) #define memcmp __builtin_memcmp +#endif #endif /* BOOT_STRING_H */ diff --git a/arch/x86/um/ksyms.c b/arch/x86/um/ksyms.c index 2e8f43ec6214..04aedcecd887 100644 --- a/arch/x86/um/ksyms.c +++ b/arch/x86/um/ksyms.c @@ -4,7 +4,7 @@ #ifndef CONFIG_X86_32 /*XXX: we need them because they would be exported by x86_64 */ -#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 +#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 || defined(__clang__) EXPORT_SYMBOL(memcpy); #else EXPORT_SYMBOL(__memcpy); diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index adca9e2b6553..09e3b5c0e632 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1271,36 +1271,37 @@ static void xen_flush_tlb_others(const struct cpumask *cpus, struct mm_struct *mm, unsigned long start, unsigned long end) { - struct { - struct mmuext_op op; -#ifdef CONFIG_SMP - DECLARE_BITMAP(mask, num_processors); -#else - DECLARE_BITMAP(mask, NR_CPUS); -#endif - } *args; struct multicall_space mcs; + struct mmuext_op *op; + struct cpumask *mask; trace_xen_mmu_flush_tlb_others(cpus, mm, start, end); if (cpumask_empty(cpus)) return; /* nothing to do */ - mcs = xen_mc_entry(sizeof(*args)); - args = mcs.args; - args->op.arg2.vcpumask = to_cpumask(args->mask); +#ifdef CONFIG_SMP + mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(num_processors)*sizeof(unsigned long)); +#else + mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(NR_CPUS)*sizeof(unsigned long)); +#endif + /* Extract fields */ + op = mcs.args; + mask = to_cpumask(mcs.args + sizeof(struct mmuext_op)); + + op->arg2.vcpumask = mask; /* Remove us, and any offline CPUS. */ - cpumask_and(to_cpumask(args->mask), cpus, cpu_online_mask); - cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask)); + cpumask_and(mask, cpus, cpu_online_mask); + cpumask_clear_cpu(smp_processor_id(), mask); - args->op.cmd = MMUEXT_TLB_FLUSH_MULTI; + op->cmd = MMUEXT_TLB_FLUSH_MULTI; if (end != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) { - args->op.cmd = MMUEXT_INVLPG_MULTI; - args->op.arg1.linear_addr = start; + op->cmd = MMUEXT_INVLPG_MULTI; + op->arg1.linear_addr = start; } - MULTI_mmuext_op(mcs.mc, &args->op, 1, NULL, DOMID_SELF); + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); xen_mc_issue(PARAVIRT_LAZY_MMU); } |