2021-12-16 04:00:59

by Naresh Kamboju

[permalink] [raw]
Subject: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

[ Please ignore this email if it is already reported ]

While building Linux next 20211215 arm64 defconfig with gcc-8
following warnings / errors noticed.
and gcc-9, gcc-10 and gcc-11 builds pass.

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/current \
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- \
'CC=sccache aarch64-linux-gnu-gcc' \
'HOSTCC=sccache gcc'

/builds/linux/arch/arm64/kernel/efi-rt-wrapper.S: Assembler messages:
/builds/linux/arch/arm64/kernel/efi-rt-wrapper.S:8: Error: unknown
mnemonic `bti' -- `bti c'
make[3]: *** [/builds/linux/scripts/Makefile.build:411:
arch/arm64/kernel/efi-rt-wrapper.o] Error 1


meta data:
-----------
git describe: next-20211215
git_repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git_sha: 93bf6eee76c0e716f6b32de690b1c52991547bb4
git_short_log: 93bf6eee76c0 (\"Add linux-next specific files for 20211215\")
target_arch: arm64
toolchain: gcc-8

steps to reproduce:
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake

tuxmake --runtime podman --target-arch arm64 --toolchain gcc-8
--kconfig defconfig

Reported-by: Linux Kernel Functional Testing <[email protected]>

build log:
https://builds.tuxbuild.com/22LCvXNzzZHquxsEYJUxEGe1kHW/

--
Linaro LKFT
https://lkft.linaro.org


2021-12-17 14:00:35

by Catalin Marinas

[permalink] [raw]
Subject: Re: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

Thanks Naresh for the report.

On Thu, Dec 16, 2021 at 09:30:44AM +0530, Naresh Kamboju wrote:
> [ Please ignore this email if it is already reported ]
>
> While building Linux next 20211215 arm64 defconfig with gcc-8
> following warnings / errors noticed.
> and gcc-9, gcc-10 and gcc-11 builds pass.
>
> make --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/current \
> ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- \
> 'CC=sccache aarch64-linux-gnu-gcc' \
> 'HOSTCC=sccache gcc'
>
> /builds/linux/arch/arm64/kernel/efi-rt-wrapper.S: Assembler messages:
> /builds/linux/arch/arm64/kernel/efi-rt-wrapper.S:8: Error: unknown
> mnemonic `bti' -- `bti c'
> make[3]: *** [/builds/linux/scripts/Makefile.build:411:
> arch/arm64/kernel/efi-rt-wrapper.o] Error 1

We defined the bti macro in assembler.h but that's not included by
linkage.h and not all asm files seem to include the former. At a quick
grep we need the diff below, not sure it's the best solution:

diff --git a/arch/arm64/crypto/nh-neon-core.S b/arch/arm64/crypto/nh-neon-core.S
index 51c0a534ef87..bf6f7ee46d63 100644
--- a/arch/arm64/crypto/nh-neon-core.S
+++ b/arch/arm64/crypto/nh-neon-core.S
@@ -8,6 +8,7 @@
*/

#include <linux/linkage.h>
+#include <asm/assembler.h>

KEY .req x0
MESSAGE .req x1
diff --git a/arch/arm64/kernel/efi-rt-wrapper.S b/arch/arm64/kernel/efi-rt-wrapper.S
index 75691a2641c1..9fde85521146 100644
--- a/arch/arm64/kernel/efi-rt-wrapper.S
+++ b/arch/arm64/kernel/efi-rt-wrapper.S
@@ -4,6 +4,7 @@
*/

#include <linux/linkage.h>
+#include <asm/assembler.h>

SYM_FUNC_START(__efi_rt_asm_wrapper)
stp x29, x30, [sp, #-32]!
diff --git a/arch/arm64/kernel/reloc_test_syms.S b/arch/arm64/kernel/reloc_test_syms.S
index c50f45fa29fa..57bf78446a29 100644
--- a/arch/arm64/kernel/reloc_test_syms.S
+++ b/arch/arm64/kernel/reloc_test_syms.S
@@ -4,6 +4,7 @@
*/

#include <linux/linkage.h>
+#include <asm/assembler.h>

SYM_FUNC_START(absolute_data64)
ldr x0, 0f

--
Catalin

2021-12-17 14:49:39

by Mark Brown

[permalink] [raw]
Subject: Re: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

On Fri, Dec 17, 2021 at 02:00:24PM +0000, Catalin Marinas wrote:
> On Thu, Dec 16, 2021 at 09:30:44AM +0530, Naresh Kamboju wrote:
> > [ Please ignore this email if it is already reported ]

It's probably not worth reporting -next issues to the -next maintainer
unless they're specifically in the -next merge - I'd not read this
report since it was part of a small batch of reports you'd sent at the
same time which appeared to be being sent to me because I was running
-next rather than them being directed at me. It can result in things
that need attention getting missed.

> We defined the bti macro in assembler.h but that's not included by
> linkage.h and not all asm files seem to include the former. At a quick
> grep we need the diff below, not sure it's the best solution:

That seems sensible to me, especially given the small number of files
affected. The other thing would be to decide that all assembly files
should have the header included by default but that seems like it's
invasive and probably disproportionate.


Attachments:
(No filename) (1.01 kB)
signature.asc (488.00 B)
Download all attachments

2021-12-17 15:53:33

by Catalin Marinas

[permalink] [raw]
Subject: Re: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

On Fri, Dec 17, 2021 at 02:49:30PM +0000, Mark Brown wrote:
> On Fri, Dec 17, 2021 at 02:00:24PM +0000, Catalin Marinas wrote:
> > We defined the bti macro in assembler.h but that's not included by
> > linkage.h and not all asm files seem to include the former. At a quick
> > grep we need the diff below, not sure it's the best solution:
>
> That seems sensible to me, especially given the small number of files
> affected. The other thing would be to decide that all assembly files
> should have the header included by default but that seems like it's
> invasive and probably disproportionate.

There's also this:

diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
index 9065e4749b42..b77e9b3f5371 100644
--- a/arch/arm64/include/asm/linkage.h
+++ b/arch/arm64/include/asm/linkage.h
@@ -1,6 +1,10 @@
#ifndef __ASM_LINKAGE_H
#define __ASM_LINKAGE_H

+#ifdef __ASSEMBLY__
+#include <asm/assembler.h>
+#endif
+
#define __ALIGN .align 2
#define __ALIGN_STR ".align 2"

--
Catalin

2021-12-17 16:12:12

by Mark Brown

[permalink] [raw]
Subject: Re: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

On Fri, Dec 17, 2021 at 03:53:13PM +0000, Catalin Marinas wrote:
> On Fri, Dec 17, 2021 at 02:49:30PM +0000, Mark Brown wrote:

> > That seems sensible to me, especially given the small number of files
> > affected. The other thing would be to decide that all assembly files
> > should have the header included by default but that seems like it's
> > invasive and probably disproportionate.

> There's also this:

True, that's even simpler.


Attachments:
(No filename) (442.00 B)
signature.asc (488.00 B)
Download all attachments

2021-12-17 16:18:26

by Catalin Marinas

[permalink] [raw]
Subject: Re: [next] arm64: efi-rt-wrapper.S:8: Error: unknown mnemonic `bti' -- `bti c'

On Fri, Dec 17, 2021 at 04:12:00PM +0000, Mark Brown wrote:
> On Fri, Dec 17, 2021 at 03:53:13PM +0000, Catalin Marinas wrote:
> > On Fri, Dec 17, 2021 at 02:49:30PM +0000, Mark Brown wrote:
>
> > > That seems sensible to me, especially given the small number of files
> > > affected. The other thing would be to decide that all assembly files
> > > should have the header included by default but that seems like it's
> > > invasive and probably disproportionate.
>
> > There's also this:
>
> True, that's even simpler.

I'll fold this into your bti patch.

--
Catalin