All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: Naohiro Aota <naohiro.aota@wdc.com>,
	Stephen Boyd <swboyd@google.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org, Manoj Gupta <manojgupta@google.com>,
	Luis Lozano <llozano@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm
Date: Wed, 27 May 2020 14:45:32 +0100	[thread overview]
Message-ID: <2f58c2a4-0f37-d507-7767-00161c6b5d98@arm.com> (raw)
In-Reply-To: <20200526173117.155339-1-ndesaulniers@google.com>

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@google.com>
> Reported-by: Luis Lozano <llozano@google.com>
> Tested-by: Manoj Gupta <manojgupta@google.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.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__
> 

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: Naohiro Aota <naohiro.aota@wdc.com>,
	Stephen Boyd <swboyd@google.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org, Manoj Gupta <manojgupta@google.com>,
	Luis Lozano <llozano@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm
Date: Wed, 27 May 2020 14:45:32 +0100	[thread overview]
Message-ID: <2f58c2a4-0f37-d507-7767-00161c6b5d98@arm.com> (raw)
In-Reply-To: <20200526173117.155339-1-ndesaulniers@google.com>

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@google.com>
> Reported-by: Luis Lozano <llozano@google.com>
> Tested-by: Manoj Gupta <manojgupta@google.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.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__
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-05-27 13:45 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 17:31 [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm Nick Desaulniers
2020-05-26 17:31 ` Nick Desaulniers
2020-05-26 18:55 ` Stephen Boyd
2020-05-26 18:55   ` Stephen Boyd
2020-05-26 20:45 ` Will Deacon
2020-05-26 20:45   ` Will Deacon
2020-05-27 13:53   ` Dave Martin
2020-05-27 13:53     ` Dave Martin
2020-05-27 17:58     ` Nick Desaulniers
2020-05-27 17:58       ` Nick Desaulniers
2020-05-27 13:45 ` Robin Murphy [this message]
2020-05-27 13:45   ` Robin Murphy
2020-05-27 17:55   ` Nick Desaulniers
2020-05-27 17:55     ` Nick Desaulniers
2020-05-27 18:08     ` Will Deacon
2020-05-27 18:08       ` Will Deacon
2020-05-27 18:17       ` Nick Desaulniers
2020-05-27 18:17         ` Nick Desaulniers
2020-05-28  7:20         ` Will Deacon
2020-05-28  7:20           ` Will Deacon
2020-06-08 20:57           ` [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO Nick Desaulniers
2020-06-08 20:57             ` Nick Desaulniers
2020-06-09 20:35             ` Catalin Marinas
2020-06-09 20:35               ` Catalin Marinas
2020-06-09 23:55               ` Nick Desaulniers
2020-06-09 23:55                 ` Nick Desaulniers
2020-06-10  8:47                 ` Will Deacon
2020-06-10  8:47                   ` Will Deacon
2020-06-10 10:29                   ` Catalin Marinas
2020-06-10 10:29                     ` Catalin Marinas
2020-06-10 10:32                     ` Will Deacon
2020-06-10 10:32                       ` Will Deacon
2020-06-10 11:21             ` Will Deacon
2020-06-10 11:21               ` Will Deacon
2020-05-27 19:28     ` [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm Robin Murphy
2020-05-27 19:28       ` Robin Murphy
2020-05-27 20:02       ` Robin Murphy
2020-05-27 20:02         ` Robin Murphy
2020-05-27 20:14       ` Nick Desaulniers
2020-05-27 20:14         ` Nick Desaulniers
2020-05-27 20:31         ` Nick Desaulniers
2020-05-27 20:31           ` Nick Desaulniers
2020-05-27 21:47           ` Nick Desaulniers
2020-05-27 21:47             ` Nick Desaulniers
2020-05-28  8:05           ` Peter Smith
2020-05-28  8:05             ` Peter Smith
2020-05-28  9:41             ` Catalin Marinas
2020-05-28  9:41               ` Catalin Marinas
2020-05-28 19:06               ` Nick Desaulniers
2020-05-28 19:06                 ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f58c2a4-0f37-d507-7767-00161c6b5d98@arm.com \
    --to=robin.murphy@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llozano@google.com \
    --cc=manojgupta@google.com \
    --cc=masahiroy@kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=swboyd@google.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.