patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <nathan@kernel.org>,
	linux-kernel@vger.kernel.org,  Kees Cook <kees@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	 Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	llvm@lists.linux.dev,  patches@lists.linux.dev,
	Russell King <linux@armlinux.org.uk>,
	 linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 03/12] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS
Date: Tue, 26 Aug 2025 15:18:48 +0200	[thread overview]
Message-ID: <CAMj1kXEOmvUx8f=_v7_AFhMLobtauSw20t76sEDmzays4NLQnw@mail.gmail.com> (raw)
In-Reply-To: <6b2c0063-1523-4644-a32c-6aa918ad9dd8@app.fastmail.com>

On Fri, 22 Aug 2025 at 22:04, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Aug 22, 2025, at 09:05, Arnd Bergmann wrote:
> > On Thu, Aug 21, 2025, at 23:15, Nathan Chancellor wrote:
> >
> > Would it be possible to either change the macro or to move
> > the overflow_stack_ptr closer in order to completely eliminate
> > the CONFIG_ARM_HAS_GROUP_RELOCS symbol and have VMAP_STACK
> > enabled for all CONFIG_MMU builds?
> >
> > Are there any other build testing issues with ARM_HAS_GROUP_RELOCS
> > besides the one I saw here?
>
> With some more randconfig testing, I did come across a few
> configurations that each fail with hundreds of errors like
>
> arm-linux-gnueabi-ld: drivers/crypto/hifn_795x.o(.text+0x99c): overflow whilst splitting 0x10a61854 for group relocation R_ARM_LDR_PC_G2
>
> so I guess we'll have to stick with the current dependency,
> at least for ARMv6 and below.
>

This is due to LOAD_SYM_ARMV6() (rather than the ldr_this_cpu_armv6
asm macro), which is used to implement get_current() on configs that
use a global variable to store the current task pointer (i.e., non-k
v6 and older). It eliminates the first of two LDRs, which would
pollute the D-cache otherwise, as every occurrence of get_current()
emits a literal into .text carrying the address of the __current
global variable. The D-cache footprint of each such literal is a
cacheline, which never contains other useful data.
(The second LDR is needed and always refers to the same address so it
does not impact D-cache efficiency)

The LOAD_SYM_ARMV6() sequence has a range of 256 MiB, which is
sufficient for any ARM kernel that can be meaningfully used in
production. However, randconfigs may produce kernels that are larger
than this, and so we need the COMPILE_TEST check if we are going to
keep the optimization, and I think it is meaningful enough to do so.

  reply	other threads:[~2025-08-26 13:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21 21:15 [PATCH v2 00/12] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 01/12] kbuild: Bump minimum " Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 02/12] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 03/12] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS Nathan Chancellor
2025-08-22  7:05   ` Arnd Bergmann
2025-08-22 20:03     ` Arnd Bergmann
2025-08-26 13:18       ` Ard Biesheuvel [this message]
2025-08-21 21:15 ` [PATCH v2 04/12] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 05/12] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 06/12] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault() Nathan Chancellor
2025-08-22 10:01   ` Christophe Leroy
2025-08-21 21:15 ` [PATCH v2 07/12] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
2025-08-22 12:31   ` Alexandre Ghiti
2025-08-27 17:31   ` Conor Dooley
2025-08-21 21:15 ` [PATCH v2 08/12] riscv: Unconditionally use linker relaxation Nathan Chancellor
2025-08-22 12:35   ` Alexandre Ghiti
2025-08-21 21:15 ` [PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs Nathan Chancellor
2025-08-22 12:38   ` Alexandre Ghiti
2025-08-27 17:30   ` Conor Dooley
2025-08-21 21:15 ` [PATCH v2 10/12] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 11/12] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 12/12] KMSAN: Remove tautological checks Nathan Chancellor
2025-08-29 22:33 ` [PATCH v2 00/12] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor

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='CAMj1kXEOmvUx8f=_v7_AFhMLobtauSw20t76sEDmzays4NLQnw@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=patches@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).