Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d21f704 authored by Mark Charlebois's avatar Mark Charlebois Committed by Satya Durga Srinivasu Prabhala
Browse files

LLVMLINUX: 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.

Change-Id: I833620cb2ed7ebb0bbd25da3b77624e06fe46a85
Signed-off-by: default avatarMark Charlebois <charlebm@gmail.com>
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
Git-commit: c3212ac08fa69652a7f8fb60121a9721d9a441d3
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 94cec697
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -167,13 +167,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