Hi Will, On 18/02/2020 16:54, Will Deacon wrote: > [+Sami] > Thanks for this, I forgot to add Sami in Cc. > On Tue, Feb 18, 2020 at 04:49:06PM +0000, Vincenzo Frascino wrote: >> The introduction of the commit e0d5896bd356cd broke the compilation of >> the kernel when the selected compiler is clang and it is used in >> combination with "-no-integrated-as". > > Curious, but have you tested this change with the integrated assembler as > well? > The integrated assembler as far as I am aware cannot assemble the kernel for reasons independent from lse (AS=clang generates a lot of errors). Not sure how Sami is testing it. I would be happy to learn it myself. The default option for clang in the kernel Makefile is "-no-integrated-as" though hence e0d5896bd356cd introduces a regression. >> This happens because __LSE_PREAMBLE is defined as ".arch armv8-a+lse" >> and this overrides the version of the architecture passed via -march >> command line to the gas compiler. >> >> The issue was noticed during the development of pauth on arm64 and an >> error example is reported below: >> >> $ aarch64-none-linux-gnu-as -EL -I ./arch/arm64/include >> -I ./arch/arm64/include/generated >> -I ./include -I ./include >> -I ./arch/arm64/include/uapi >> -I ./arch/arm64/include/generated/uapi >> -I ./include/uapi -I ./include/generated/uapi >> -I ./init -I ./init >> -march=armv8.3-a -o init/do_mounts.o >> /tmp/do_mounts-d7992a.s >> /tmp/do_mounts-d7992a.s: Assembler messages: >> /tmp/do_mounts-d7992a.s:1959: Error: selected processor does not support `autiasp' >> /tmp/do_mounts-d7992a.s:2021: Error: selected processor does not support `paciasp' >> /tmp/do_mounts-d7992a.s:2157: Error: selected processor does not support `autiasp' >> /tmp/do_mounts-d7992a.s:2175: Error: selected processor does not support `paciasp' >> /tmp/do_mounts-d7992a.s:2494: Error: selected processor does not support `autiasp' >> >> Fix the issue replacing ".arch armv8-a+lse" with ".arch_extension lse" that does >> not override the command line parameter. >> >> Fixes: e0d5896bd356cd ("arm64: lse: fix LSE atomics with LLVM's integrated assembler") >> Cc: Catalin Marinas >> Cc: Will Deacon >> Reported-by: Amit Kachhap >> Signed-off-by: Vincenzo Frascino >> --- >> arch/arm64/include/asm/lse.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h >> index d429f7701c36..5d10051c3e62 100644 >> --- a/arch/arm64/include/asm/lse.h >> +++ b/arch/arm64/include/asm/lse.h >> @@ -6,7 +6,7 @@ >> >> #ifdef CONFIG_ARM64_LSE_ATOMICS >> >> -#define __LSE_PREAMBLE ".arch armv8-a+lse\n" >> +#define __LSE_PREAMBLE ".arch_extension lse\n" > > I'm ok with this, but Sami assumedly changed this for a reason in > e0d5896bd356cd ("arm64: lse: fix LSE atomics with LLVM's integrated > assembler"). > > Sami? > > Will > -- Regards, Vincenzo