Skip to contentSkip to conversation

arm64: vdso32: force vdso32 to be compiled as -marm

PATCH Applied Nick Desaulniers 7 participants 25 messages May 26, 2020 – Jun 10, 2020 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: vdso32: force vdso32 to be compiled as -marm

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.

---
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(+)
arch/arm64/kernel/vdso32/Makefile +2 -0
index 3964738ebbde..c449a293d81e 100644
@@ -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__
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog
Reviewed-by on v1 1/1
#1 lore raw

Quoting Nick Desaulniers (2020-05-26 10:31:14)

Quoted 6 lines

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.

Quoted 6 lines

---

maintainer Applied
#2 lore raw
In reply to Nick Desaulniers
Quoted 5 lines · Nick Desaulniers

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.

Applied to arm64 (for-next/vdso), thanks!

[1/1] arm64: vdso32: force vdso32 to be compiled as -marm

      https://git.kernel.org/arm64/c/20363b59ad4f

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
#3 lore raw
Quoted 2 lines · Will Deacon
Quoted 1 line · Nick Desaulniers

Custom toolchains that modify the default target to -mthumb cannot

It's probably too late to water this down, but it's unfortunate to have this comment in the upstream commit history.

It's not constructive to call the native compiler configuration of major distros for many years a "custom" toolchain. Unmodified GCC has had a clean configure option for this for a very long time; it's not someone's dirty hack. (The wisdom of armhf's choice of -mthumb might be debated, but it is well established.)

Ignoring the triplet and passing random options to a compiler in the hopes that it will do the right thing for an irregular usecase has never been reliable. Usecases don't get much more irregular than building vdso32.

arch/arm has the proper options in its Makefiles.

This patch is a kernel bugfix, plain and simple.

Quoted 9 lines
Quoted 4 lines

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.

Applied to arm64 (for-next/vdso), thanks!

[1/1] arm64: vdso32: force vdso32 to be compiled as -marm

      https://git.kernel.org/arm64/c/20363b59ad4f

Does this need to go to stable?

Cheers
---Dave

#4 lore raw
Quoted 10 lines · Dave Martin
Quoted 2 lines · Will Deacon
Quoted 1 line · Nick Desaulniers

Custom toolchains that modify the default target to -mthumb cannot

It's probably too late to water this down, but it's unfortunate to have this comment in the upstream commit history.

It's not constructive to call the native compiler configuration of major distros for many years a "custom" toolchain. Unmodified GCC has

I don't think you know which toolchain or distro I'm referring to. ;)

Quoted 4 lines

had a clean configure option for this for a very long time; it's not someone's dirty hack. (The wisdom of armhf's choice of -mthumb might be debated, but it is well established.)

Quoted 8 lines

Ignoring the triplet and passing random options to a compiler in the hopes that it will do the right thing for an irregular usecase has never been reliable. Usecases don't get much more irregular than building vdso32.

arch/arm has the proper options in its Makefiles.

This patch is a kernel bugfix, plain and simple.

Borrowing from the Zen of Python: Explicit is better than Implicit. Better not to rely on implicit defaults that may be changed at configure time.

Quoted 1 line

Does this need to go to stable?

Oh, probably. Need to wait until it hits mainline now. I don't think the compat vdso series was backported to 5.4, but IIUC stable maintains a branch for the latest release, which would have that series.

Signature · 2 lines
Thanks,
~Nick Desaulniers
#5 lore raw
In reply to Nick Desaulniers
Quoted 5 lines · Nick Desaulniers

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.

Quoted 27 lines

---
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(+)
arch/arm64/kernel/vdso32/Makefile +2 -0
index 3964738ebbde..c449a293d81e 100644
@@ -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__
#6 lore raw
Quoted 8 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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.

Quoted 7 lines

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?

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer
#7 lore raw
Quoted 17 lines · Nick Desaulniers
Quoted 8 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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.

Quoted 7 lines

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?

Quoted 6 lines

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

Hmm, but this *is* weird because if I build a 32-bit kernel then I get either an ARM or a Thumb-2 VDSO depending on CONFIG_THUMB2_KERNEL. I'm not sure if that's deliberate, but both build and appear to work.

I'll drop this patch for now, while we figure it out a bit more.

Cheers,

Will

#8 lore raw
Quoted 23 lines · Will Deacon
Quoted 21 lines · Nick Desaulniers
Quoted 8 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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.

Quoted 7 lines

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?

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

Quoted 6 lines
Quoted 2 lines

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

Hmm, but this *is* weird because if I build a 32-bit kernel then I get either an ARM or a Thumb-2 VDSO depending on CONFIG_THUMB2_KERNEL. I'm not sure if that's deliberate, but both build and appear to work.

That's because there's 3 VDSO's when it comes to ARM:
arm64's 64b vdso: arch/arm64/kernel/vdso arm64's 32b vdso: arch/arm64/kernel/vdso32/ arm's 32b vdso: arch/arm/kernel/vdso.c

When you build a 32b kernel, you're only making use of the last of those three; the arm64 vdso and vdso32 code is irrelevant. This patch is specific to the second case, which is the 32b compat vdso for a 64b kernel.

Quoted 6 lines

I'll drop this patch for now, while we figure it out a bit more.

Cheers,

Will

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer
#9 lore raw
Quoted 27 lines · Nick Desaulniers
Quoted 26 lines · Will Deacon
Quoted 23 lines · Nick Desaulniers
Quoted 8 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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.

Quoted 7 lines

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?

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

Quoted 8 lines
Quoted 3 lines

Hmm, but this *is* weird because if I build a 32-bit kernel then I get either an ARM or a Thumb-2 VDSO depending on CONFIG_THUMB2_KERNEL. I'm not sure if that's deliberate, but both build and appear to work.

That's because there's 3 VDSO's when it comes to ARM:
arm64's 64b vdso: arch/arm64/kernel/vdso arm64's 32b vdso: arch/arm64/kernel/vdso32/ arm's 32b vdso: arch/arm/kernel/vdso.c

Yes, I know that :)

Quoted 4 lines

When you build a 32b kernel, you're only making use of the last of those three; the arm64 vdso and vdso32 code is irrelevant. This patch is specific to the second case, which is the 32b compat vdso for a 64b kernel.

Sure, but if you can build a Thumb-2 vDSO object for arch/arm/ using then we should be able to build a Thumb-2 compat vDSO for arch/arm64, and your patch is papering over a deeper issue. Generally, having the compat vDSO behave differently to the arch/arm/ vDSO is indicative of something being broken.

In other words, if your patch was correct (not sure that it is) then I would expect a corresponding change to arch/arm/ to pass -marm when CONFIG_THUMB2_KERNEL=y. Make sense?

Will

#10 lore raw

PATCH v2 1/1 arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Allow the compat vdso (32b) to be compiled as either THUMB2 (default) or ARM.

For THUMB2, the register r7 is reserved for the frame pointer, but code in arch/arm64/include/asm/vdso/compat_gettimeofday.h uses r7. Explicitly set -fomit-frame-pointer, since unwinding through interworked THUMB2 and ARM is unreliable anyways. See also how CONFIG_UNWINDER_FRAME_POINTER cannot be selected for CONFIG_THUMB2_KERNEL for ARCH=arm.

This also helps toolchains that differ in their implicit value if the choice of -f{no-}omit-frame-pointer is left unspecified, to not error on the use of r7.

2019 Q4 ARM AAPCS seeks to standardize the use of r11 as the reserved frame pointer register, but no production compiler that can compile the Linux kernel currently implements this. We're actively discussing such a transition with ARM toolchain developers currently.

---
Changes V1 -> V2:
* add THUMB2_COMPAT_VDSO config, making -mthumb/-marm configurable rather than hard coding.
* Fixed https://reviews.llvm.org/D80828 in Clang, but still an issue. Not due to implicit state of -marm vs -mthumb, but actually -f{no-}omit-frame-pointer due to
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/master:src/third_party/toolchain-utils/compiler_wrapper/config.go;l=110,
which prefixes -fno-omit-frame-pointer for all arches and projects. Projects that don't set -f{no-}omit-frame-pointer thus don't overwrite the prefixed -fno-omit-frame-pointer, which is an issue when inline asm compiled as -mthumb uses r7.
* I don't have a strong preference on the default state of this config.

 arch/arm64/Kconfig                | 8 ++++++++
 arch/arm64/kernel/vdso32/Makefile | 8 ++++++++
 2 files changed, 16 insertions(+)
arch/arm64/Kconfig +8 -0
index 7f9d38444d6d..fe9e6b231cac 100644
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
 	  You must have a 32-bit build of glibc 2.22 or later for programs
 	  to seamlessly take advantage of this.
 
+config THUMB2_COMPAT_VDSO
+	bool "Compile the vDSO in THUMB2 mode"
+	depends on COMPAT_VDSO
+	default y
+	help
+	  Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+	  as -marm.
+
 menuconfig ARMV8_DEPRECATED
 	bool "Emulate deprecated/obsolete ARMv8 instructions"
 	depends on SYSCTL
arch/arm64/kernel/vdso32/Makefile +8 -0
index 3964738ebbde..7ea1e827e505 100644
@@ -105,6 +105,14 @@ VDSO_CFLAGS += -D__uint128_t='void*'
 VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow)
 VDSO_CFLAGS += -Wno-int-to-pointer-cast
 
+# Compile as THUMB2 or ARM. Unwinding via frame-pointers in THUMB2 is
+# unreliable.
+ifeq ($(CONFIG_THUMB2_COMPAT_VDSO), y)
+VDSO_CFLAGS += -mthumb -fomit-frame-pointer
+else
+VDSO_CFLAGS += -marm
+endif
+
 VDSO_AFLAGS := $(VDSO_CAFLAGS)
 VDSO_AFLAGS += -D__ASSEMBLY__
 
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
maintainer
#11 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Quoted 5 lines · Nick Desaulniers
arch/arm64/Kconfig +0 -0
index 7f9d38444d6d..fe9e6b231cac 100644

arch/arm64/Kconfig config COMPAT_VDSO · line 1308

Quoted 10 lines
arch/arm64/Kconfig +7 -0
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
 	  You must have a 32-bit build of glibc 2.22 or later for programs
 	  to seamlessly take advantage of this.
 
+config THUMB2_COMPAT_VDSO
+	bool "Compile the vDSO in THUMB2 mode"
+	depends on COMPAT_VDSO
+	default y
+	help
+	  Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+	  as -marm.

Now that we understood the issue (I think), do we actually need this choice? Why not going for -mthumb -fomit-frame-pointer always for the compat vdso?

Signature · 1 line
Catalin
#12 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Quoted 10 lines · Catalin Marinas
Quoted 8 lines · Nick Desaulniers
arch/arm64/Kconfig +0 -0
index 7f9d38444d6d..fe9e6b231cac 100644
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
        You must have a 32-bit build of glibc 2.22 or later for programs
        to seamlessly take advantage of this.
 
Quoted 11 lines

arch/arm64/Kconfig config COMPAT_VDSO · line 1308

Quoted 7 lines
arch/arm64/Kconfig +7 -0
+config THUMB2_COMPAT_VDSO
+     bool "Compile the vDSO in THUMB2 mode"
+     depends on COMPAT_VDSO
+     default y
+     help
+       Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+       as -marm.

Now that we understood the issue (I think), do we actually need this choice? Why not going for -mthumb -fomit-frame-pointer always for the compat vdso?

"Why should the compat vdso be configurable?" is a fair question. I don't have an answer, but maybe some of the folks on thread do?

Our problem is more so "if the vdso is built as thumb, we need it also explicitly built with -fomit-frame-pointer." Whether it should be built as thumb, arm, or configurable (and which default to pick in that case) are still an open questions. Will asked for it to be configurable, so I sent a patch making it configurable.

I'm not sure what the tradeoffs would be for a A32 vs T32 compat vdso image.

Is it possible to have hardware that's A64+A32 but not T32, or A64+T32 but not A32? (I suspect not).

I'm not sure whether userspace cares about frame pointer based unwinding through the vdso, but if it's built as THUMB, then that likely doesn't work for binaries with A32/T32 interworking. Whether the functions in the vdso are faster when built as A32 or T32 I cannot say.

Signature · 7 lines
Thanks,
~Nick Desaulniers

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#13 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Quoted 23 lines · Nick Desaulniers
Quoted 10 lines · Catalin Marinas
Quoted 8 lines · Nick Desaulniers
arch/arm64/Kconfig +0 -0
index 7f9d38444d6d..fe9e6b231cac 100644
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
        You must have a 32-bit build of glibc 2.22 or later for programs
        to seamlessly take advantage of this.
 
Quoted 11 lines

arch/arm64/Kconfig config COMPAT_VDSO · line 1308

Quoted 7 lines
arch/arm64/Kconfig +7 -0
+config THUMB2_COMPAT_VDSO
+     bool "Compile the vDSO in THUMB2 mode"
+     depends on COMPAT_VDSO
+     default y
+     help
+       Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+       as -marm.

Now that we understood the issue (I think), do we actually need this choice? Why not going for -mthumb -fomit-frame-pointer always for the compat vdso?

Quoted 8 lines

"Why should the compat vdso be configurable?" is a fair question. I don't have an answer, but maybe some of the folks on thread do?

Our problem is more so "if the vdso is built as thumb, we need it also explicitly built with -fomit-frame-pointer." Whether it should be built as thumb, arm, or configurable (and which default to pick in that case) are still an open questions. Will asked for it to be configurable, so I sent a patch making it configurable.

It's configurable for 32-bit arm, so I was just following that as it's hardly a maintenance burden to support both. I suppose you could have a toolchain that only supports one or the other, but it does seem a little esoteric if you're building a kernel for an arm64 CPU.

Will

maintainer Acked-by
#14 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Quoted 26 lines · Will Deacon
Quoted 25 lines · Nick Desaulniers
Quoted 9 lines · Catalin Marinas
Quoted 8 lines · Nick Desaulniers
arch/arm64/Kconfig +0 -0
index 7f9d38444d6d..fe9e6b231cac 100644
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
        You must have a 32-bit build of glibc 2.22 or later for programs
        to seamlessly take advantage of this.
 
Quoted 11 lines

arch/arm64/Kconfig config COMPAT_VDSO · line 1308

Quoted 7 lines
arch/arm64/Kconfig +7 -0
+config THUMB2_COMPAT_VDSO
+     bool "Compile the vDSO in THUMB2 mode"
+     depends on COMPAT_VDSO
+     default y
+     help
+       Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+       as -marm.

Now that we understood the issue (I think), do we actually need this choice? Why not going for -mthumb -fomit-frame-pointer always for the compat vdso?

"Why should the compat vdso be configurable?" is a fair question. I don't have an answer, but maybe some of the folks on thread do?

Quoted 7 lines
Quoted 5 lines

Our problem is more so "if the vdso is built as thumb, we need it also explicitly built with -fomit-frame-pointer." Whether it should be built as thumb, arm, or configurable (and which default to pick in that case) are still an open questions. Will asked for it to be configurable, so I sent a patch making it configurable.

It's configurable for 32-bit arm,

On 32-bit, the vdso mode is a side-effect of how we build the kernel image. I guess we haven't put much thought into whether we want to keep the vdso in Thumb-2 or ARM mode.

Quoted 4 lines

so I was just following that as it's
hardly a maintenance burden to support both. I suppose you could have a toolchain that only supports one or the other, but it does seem a little esoteric if you're building a kernel for an arm64 CPU.

We could leave the config option in if we ever need to change the compat vdso mode. But as not to confuse others with too many options, maybe add:

bool "Compile the vDSO in THUMB2 mode" if EXPERT

Either way:

maintainer
#15 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

Quoted 33 lines · Catalin Marinas
Quoted 32 lines · Will Deacon
Quoted 30 lines · Nick Desaulniers
Quoted 9 lines · Catalin Marinas
Quoted 8 lines · Nick Desaulniers
arch/arm64/Kconfig +0 -0
index 7f9d38444d6d..fe9e6b231cac 100644
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
        You must have a 32-bit build of glibc 2.22 or later for programs
        to seamlessly take advantage of this.
 
Quoted 11 lines

arch/arm64/Kconfig config COMPAT_VDSO · line 1308

Quoted 7 lines
arch/arm64/Kconfig +7 -0
+config THUMB2_COMPAT_VDSO
+     bool "Compile the vDSO in THUMB2 mode"
+     depends on COMPAT_VDSO
+     default y
+     help
+       Compile the compat vDSO with -mthumb -fomit-frame-pointer if y, otherwise
+       as -marm.

Now that we understood the issue (I think), do we actually need this choice? Why not going for -mthumb -fomit-frame-pointer always for the compat vdso?

"Why should the compat vdso be configurable?" is a fair question. I don't have an answer, but maybe some of the folks on thread do?

Our problem is more so "if the vdso is built as thumb, we need it also explicitly built with -fomit-frame-pointer." Whether it should be built as thumb, arm, or configurable (and which default to pick in that case) are still an open questions. Will asked for it to be configurable, so I sent a patch making it configurable.

Quoted 5 lines
Quoted 1 line

It's configurable for 32-bit arm,

On 32-bit, the vdso mode is a side-effect of how we build the kernel image. I guess we haven't put much thought into whether we want to keep the vdso in Thumb-2 or ARM mode.

I think your guess is correct!

Quoted 9 lines
Quoted 4 lines

so I was just following that as it's
hardly a maintenance burden to support both. I suppose you could have a toolchain that only supports one or the other, but it does seem a little esoteric if you're building a kernel for an arm64 CPU.

We could leave the config option in if we ever need to change the compat vdso mode. But as not to confuse others with too many options, maybe add:

Quoted 5 lines

bool "Compile the vDSO in THUMB2 mode" if EXPERT

Either way:

Cheers, I'll add the dependency on EXPERT since I agree it's probably not something most people would want to touch. I'll also change the text to say "compat vDSO" not just vDSO.

Will

maintainer Applied
#16 lore raw

Re: [PATCH v2] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

In reply to Nick Desaulniers
Quoted 11 lines · Nick Desaulniers

Allow the compat vdso (32b) to be compiled as either THUMB2 (default) or ARM.

For THUMB2, the register r7 is reserved for the frame pointer, but code in arch/arm64/include/asm/vdso/compat_gettimeofday.h uses r7. Explicitly set -fomit-frame-pointer, since unwinding through interworked THUMB2 and ARM is unreliable anyways. See also how CONFIG_UNWINDER_FRAME_POINTER cannot be selected for CONFIG_THUMB2_KERNEL for ARCH=arm.

[...]

Applied to arm64 (for-next/core), thanks!

[1/1] arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO

      https://git.kernel.org/arm64/c/625412c210fb

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
#17 lore raw
In reply to Nick Desaulniers
Quoted 13 lines · Nick Desaulniers
Quoted 12 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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.

Quoted 7 lines
Quoted 3 lines

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?

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too. I take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Quoted 2 lines

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

As Dave pointed out, like the probable majority of users it's Thumb:

$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 8.3.0-6ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include
Thread model: posix
gcc version 8.3.0 (Ubuntu/Linaro 8.3.0-6ubuntu1)

(yeah, I didn't actually need to hack my makefile at all)

Robin.

#18 lore raw
Quoted 18 lines · Robin Murphy
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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?

Quoted 5 lines
Quoted 3 lines

 From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too. I

Oh, and for the avoidance of ambiguity that's "Arm" as in the 32-bit Arm architecture port, not a specific instruction set.

Robin.

Quoted 40 lines

take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Quoted 2 lines

What is the implicit default of your gcc-arm-linux-gnueabihf at -O2? -mthumb, or -marm?

As Dave pointed out, like the probable majority of users it's Thumb:

$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 8.3.0-6ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs 
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-8 --enable-shared 
--enable-linker-build-id --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --libdir=/usr/lib 
--enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-gnu-unique-object 
--disable-libitm --disable-libquadmath --disable-libquadmath-support 
--enable-plugin --enable-default-pie --with-system-zlib 
--with-target-system-zlib --enable-multiarch --enable-multilib 
--disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 
--with-float=hard --with-mode=thumb --disable-werror --enable-multilib 
--enable-checking=release --build=aarch64-linux-gnu 
--host=aarch64-linux-gnu --target=arm-linux-gnueabihf 
--program-prefix=arm-linux-gnueabihf- 
--includedir=/usr/arm-linux-gnueabihf/include
Thread model: posix
gcc version 8.3.0 (Ubuntu/Linaro 8.3.0-6ubuntu1)

(yeah, I didn't actually need to hack my makefile at all)

Robin.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#19 lore raw
In reply to Robin Murphy
Quoted 19 lines · Robin Murphy
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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?

Quoted 7 lines
Quoted 3 lines

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too.

Ah, right, with -fomit-frame-pointer, this error also goes away. Not sure if we prefer either:
- build the compat vdso as -marm always or
- disable frame pointers for the vdso (does this have unwinding implications?)
- other?

Quoted 4 lines

I
take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Was the intent not obvious? We would have gotten away with it, too, if wasn't for you meddling kids and your stupid dog! /s
https://www.youtube.com/watch?v=hXUqwuzcGeU
Anyways, this seems to explain more the intentions:
https://reviews.llvm.org/D76848#1945810
+ Victor, Kristof (ARM)

Signature · 2 lines
Thanks,
~Nick Desaulniers
#20 lore raw
Quoted 40 lines · Nick Desaulniers
Quoted 19 lines · Robin Murphy
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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?

Quoted 7 lines
Quoted 3 lines

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too.

Ah, right, with -fomit-frame-pointer, this error also goes away. Not sure if we prefer either:
- build the compat vdso as -marm always or
- disable frame pointers for the vdso (does this have unwinding implications?)
- other?

Quoted 4 lines

I
take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Quoted 6 lines

Was the intent not obvious? We would have gotten away with it, too, if wasn't for you meddling kids and your stupid dog! /s
https://www.youtube.com/watch?v=hXUqwuzcGeU
Anyways, this seems to explain more the intentions:
https://reviews.llvm.org/D76848#1945810
+ Victor, Kristof (ARM)

And maybe some other useful data points regarding warning on use of r7 and frame pointers.
https://github.com/ClangBuiltLinux/linux/issues/701#issuecomment-591325758
https://bugs.llvm.org/show_bug.cgi?id=45826
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94986

+ Peter (ARM)
+ David, Arnd (Linaro)

Signature · 2 lines
Thanks,
~Nick Desaulniers
#21 lore raw
Quoted 50 lines · Nick Desaulniers
Quoted 40 lines · Nick Desaulniers
Quoted 19 lines · Robin Murphy
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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?

Quoted 7 lines
Quoted 3 lines

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too.

Ah, right, with -fomit-frame-pointer, this error also goes away. Not sure if we prefer either:
- build the compat vdso as -marm always or
- disable frame pointers for the vdso (does this have unwinding implications?)
- other?

Quoted 4 lines

I
take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Quoted 6 lines

Was the intent not obvious? We would have gotten away with it, too, if wasn't for you meddling kids and your stupid dog! /s
https://www.youtube.com/watch?v=hXUqwuzcGeU
Anyways, this seems to explain more the intentions:
https://reviews.llvm.org/D76848#1945810
+ Victor, Kristof (ARM)

Quoted 8 lines

And maybe some other useful data points regarding warning on use of r7 and frame pointers.
https://github.com/ClangBuiltLinux/linux/issues/701#issuecomment-591325758
https://bugs.llvm.org/show_bug.cgi?id=45826
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94986

+ Peter (ARM)
+ David, Arnd (Linaro)

Also, when I looked into this briefly, I didn't happen to see anything in AAPCS that mentions r7 is used as the frame pointer for THUMB. Does AAPCS not cover THUMB? It also states the TPCS is obsolete.
https://developer.arm.com/docs/ihi0042/latest
https://static.docs.arm.com/ihi0042/i/aapcs32.pdf

Signature · 2 lines
Thanks,
~Nick Desaulniers
#22 lore raw
In reply to Nick Desaulniers
Quoted 61 lines

From: Nick Desaulniers <[email protected]>
Sent: 27 May 2020 21:31
To: Robin Murphy
Cc: Catalin Marinas; Will Deacon; Naohiro Aota; Stephen Boyd; Masahiro Yamada; LKML; Manoj Gupta; Luis Lozano; Nathan Chancellor; Vincenzo Frascino; Linux ARM; Kristof Beyls; Victor Campos; [email protected]; Arnd Bergmann; Peter Smith
Subject: Re: [PATCH] arm64: vdso32: force vdso32 to be compiled as -marm

Quoted 40 lines · Nick Desaulniers
Quoted 19 lines · Robin Murphy
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Robin Murphy
Quoted 5 lines · Nick Desaulniers

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?

Quoted 7 lines
Quoted 3 lines

From the link in the commit message: write to reserved register 'R7'
https://godbolt.org/z/zwr7iZ
IIUC r7 is reserved for the frame pointer in THUMB?

It can be, if you choose to build with frame pointers and the common frame pointer ABI for Thumb code that uses r7. However it can also be for other things like the syscall number in the Arm syscall ABI too.

Ah, right, with -fomit-frame-pointer, this error also goes away. Not sure if we prefer either:
- build the compat vdso as -marm always or
- disable frame pointers for the vdso (does this have unwinding implications?)
- other?

Quoted 4 lines

I
take it Clang has decided that writing syscall wrappers with minimal inline asm is not a thing people deserve to do without arbitrary other restrictions?

Quoted 6 lines

Was the intent not obvious? We would have gotten away with it, too, if wasn't for you meddling kids and your stupid dog! /s
https://www.youtube.com/watch?v=hXUqwuzcGeU
Anyways, this seems to explain more the intentions:
https://reviews.llvm.org/D76848#1945810
+ Victor, Kristof (ARM)

And maybe some other useful data points regarding warning on use of r7 and frame pointers.
https://github.com/ClangBuiltLinux/linux/issues/701#issuecomment-591325758
https://bugs.llvm.org/show_bug.cgi?id=45826
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94986

Quoted 5 lines

+ Peter (ARM)
+ David, Arnd (Linaro)
--
Thanks,
~Nick Desaulniers

Hello Nick,

The AAPCS has only recently (28th January 2020) been updated with a specification of the frame pointer and frame chain.

My understanding is that neither gcc nor clang implement this part yet. Historically the frame pointer in Thumb has not been defined in the AAPCS with implementations falling back to historic definitions of fp = r7 in Thumb and fp = r11 in Arm. The use of different frame pointer registers in Arm and Thumb state makes it difficult to construct a frame chain with interworking. My understanding of the AAPCS is that it has been changed to make the frame pointer r11 on both Arm and Thumb to make unwinding possible, at the expense of r11 being harder to access from 16-bit Thumb instructions. There are 4 levels of conformance with respect to construction of frame records and frame chain as it is likely some platforms will want to persist with r7.

An implementation of the latest version of the AAPCS would permit a frame pointer and use of r7 as a reserved register. Although as you'll need to support older compilers this may not be an option. I suggest using Arm if you need a frame pointer, and disable the frame pointer if you want/need to use Thumb. My understanding is that runtime unwinding using the frame pointer in Thumb is already difficult due to Arm and Thumb functions using different registers for the frame pointer.

Hope this helps

Peter

maintainer
#23 lore raw
Quoted 5 lines · Peter Smith

I suggest using Arm if you need a frame pointer, and disable the frame pointer if you want/need to use Thumb. My understanding is that runtime unwinding using the frame pointer in Thumb is already difficult due to Arm and Thumb functions using different registers for the frame pointer.

IIRC from the Thumb-2 kernel porting days, even in the absence of ARM/Thumb interworking, the Thumb-2 frame pointer was pretty useless for unwinding since it points to the bottom of the current stack frame (the reason I think is that some LDR/STR instructions with negative indexing are not available). So finding the previous frame pointer was not possible and had to rely on the exception unwinding information.

Signature · 1 line
Catalin
#24 lore raw
Quoted 1 line · Will Deacon
Quoted 1 line

Yes, I know that :)

Right, I forgot; you wrote the 64b one. :)

Quoted 8 lines · Catalin Marinas
Quoted 5 lines · Peter Smith

I suggest using Arm if you need a frame pointer, and disable the frame pointer if you want/need to use Thumb. My understanding is that runtime unwinding using the frame pointer in Thumb is already difficult due to Arm and Thumb functions using different registers for the frame pointer.

Quoted 6 lines

IIRC from the Thumb-2 kernel porting days, even in the absence of ARM/Thumb interworking, the Thumb-2 frame pointer was pretty useless for unwinding since it points to the bottom of the current stack frame (the reason I think is that some LDR/STR instructions with negative indexing are not available). So finding the previous frame pointer was not possible and had to rely on the exception unwinding information.

Eureka! That's it! Implicit state of -fomit-frame-pointer.

Ok, forgetting ARCH=arm64 for a second, for ARCH=arm we have the choice CONFIG_THUMB2_KERNEL. Regardless of which is chosen, we *always* explicitly set -mthumb or -marm, but we never rely on implicit defaults. Again for ARCH=arm, we have a choice of unwinders, or at least we do when *not* targeting thumb. If we select CONFIG_THUMB2_KERNEL, then CONFIG_UNWINDER_FRAME_POINTER cannot be selected.

arch/arm/Kconfig.debug:
57 config UNWINDER_FRAME_POINTER
58 bool "Frame pointer unwinder"
59 depends on !THUMB2_KERNEL
...

CONFIG_UNWINDER_FRAME_POINTER selects CONFIG_FRAME_POINTER which sets -fno-omit-frame-pointer. Otherwise, it looks like the choice of -f{no-}omit-frame-pointer is left unspecified, relying on compiler defaults.

And that's just for ARCH=arm. Returning to ARCH=arm64, and the compat vdso in particular, it doesn't look like we ever set -f{no-}omit-frame-pointer either, so again we're looking at the compiler defaults.

And when we look at the default behavior for the implicit state of -f{no-}omit-frame-pointer, we find differences.

Here's a test case you can play around with:
https://godbolt.org/z/0oY39t

For Clang, can you tell what the default state is if left off? For GCC, can you tell what the default state is if left off? Do they match?
Is this specific to -mthumb?
(Bonus: what happens when you remove -O2?)

Answers:
-fno-omit-frame-pointer
-fomit-frame-pointer
No.
No.
-fno-omit-frame-pointer in GCC (-fomit-frame-pointer is an optimization)

Deja vu, I fixed a very similar discrepancy reported by Linus not too long ago.
https://reviews.llvm.org/D74698
Looking at the relevant logic in Clang:
https://github.com/llvm/llvm-project/blob/58beb76b7bd2f7caa1df461b9db6629521c3b60b/clang/lib/Driver/ToolChains/Clang.cpp#L527-L591
Noticely absent are arm, thumb, aarch64, and big endian variants, specifically here:
https://github.com/llvm/llvm-project/blob/58beb76b7bd2f7caa1df461b9db6629521c3b60b/clang/lib/Driver/ToolChains/Clang.cpp#L556-L571

I should fix that in Clang.

That should also speed up our 32b ARM kernels that select CONFIG_THUMB2_KERNEL (ie. CrOS veyron-minnie platform, rk3288). Shouldn't make a difference for 64b ARM kernels since those select frame pointers. Though I am curious about the userspaces now for CrOS and Android...

Quoted 1 line · Peter Smith
Quoted 1 line

Hope this helps

Always, m8, you're the expert.

So r11 will be the frame pointer for arm and thumb according to latest aapcs, but the compilers haven't yet made any changes related to this, and can still use r7 in a bunch of cases (-mthumb --target=arm-linux-gnueabi being the most relevant one for our discussion).

Quoted 3 lines · Will Deacon

your
patch is papering over a deeper issue.

Ah, your right. Sorry, I was wrong. I owe you (another) beer? I'm going into debt over these and will have to take out a loan, soon!

Signature · 7 lines
Thanks,
~Nick Desaulniers

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel