From 6433c71bcadba4a21f5da315b1e4cf6ae78323b5 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Wed, 30 Jul 2014 15:55:33 -0700 Subject: DO-NOT-UPSTREAM arm64, LLVMLinux: prfm Fix for prfm error on AArch64 The following error is generated with the mainline clang compiler for AArch64: arch/arm64/include/asm/processor.h:149:15: error: invalid operand in inline asm: 'prfm pldl1keep, ${0:a} ' Per comments by Tim Northover on the LLVM Bug database: "It's rather unclear how it's better than "prfm pstl1keep, [%0]" though. Not all instructions can make use of any offset, so wouldn't we have to be conservative and always map it to "[xN]"? When %a0 is changed to [%x0] it uncovered a GCC bug: https://bugs.linaro.org/show_bug.cgi?id=635 Changing the "p" to "r" resolves the issue for both clang and GCC. Signed-off-by: Mark Charlebois --- arch/arm64/include/asm/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 286b1bec547c..1e894f7d5e22 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -147,13 +147,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 -- cgit v1.2.3