[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f58c2a4-0f37-d507-7767-00161c6b5d98@arm.com>
Date: Wed, 27 May 2020 14:45:32 +0100
From: Robin Murphy <robin.murphy@....com>
To: Nick Desaulniers <ndesaulniers@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>
Cc: Naohiro Aota <naohiro.aota@....com>,
Stephen Boyd <swboyd@...gle.com>,
Masahiro Yamada <masahiroy@...nel.org>,
linux-kernel@...r.kernel.org, Manoj Gupta <manojgupta@...gle.com>,
Luis Lozano <llozano@...gle.com>,
Nathan Chancellor <natechancellor@...il.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm
On 2020-05-26 18:31, Nick Desaulniers wrote:
> Custom toolchains that modify the default target to -mthumb cannot
> compile the arm64 compat vdso32, as
> arch/arm64/include/asm/vdso/compat_gettimeofday.h
> contains assembly that's invalid in -mthumb. Force the use of -marm,
> always.
FWIW, this seems suspicious - the only assembly instructions I see there
are SWI(SVC), MRRC, and a MOV, all of which exist in Thumb for the
-march=armv7a baseline that we set.
On a hunch, I've just bodged "VDSO_CFLAGS += -mthumb" into my tree and
built a Thumb VDSO quite happily with Ubuntu 19.04's
gcc-arm-linux-gnueabihf. What was the actual failure you saw?
Robin.
> Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1084372
> Cc: Stephen Boyd <swboyd@...gle.com>
> Reported-by: Luis Lozano <llozano@...gle.com>
> Tested-by: Manoj Gupta <manojgupta@...gle.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> ---
> Surgeon General's Warning: changing the compiler defaults is not
> recommended and can lead to spooky bugs that are hard to reproduce
> upstream.
>
> arch/arm64/kernel/vdso32/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index 3964738ebbde..c449a293d81e 100644
> --- a/arch/arm64/kernel/vdso32/Makefile
> +++ b/arch/arm64/kernel/vdso32/Makefile
> @@ -104,6 +104,8 @@ VDSO_CFLAGS += -D__uint128_t='void*'
> # (on GCC 4.8 or older, there is unfortunately no way to silence this warning)
> VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow)
> VDSO_CFLAGS += -Wno-int-to-pointer-cast
> +# Force vdso to be compiled in ARM mode, not THUMB.
> +VDSO_CFLAGS += -marm
>
> VDSO_AFLAGS := $(VDSO_CAFLAGS)
> VDSO_AFLAGS += -D__ASSEMBLY__
>
Powered by blists - more mailing lists