All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Darren Hart <dvhart@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Elena Reshetova <elena.reshetova@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'
Date: Thu, 7 Mar 2019 23:24:26 +0100	[thread overview]
Message-ID: <CAK8P3a1sPvO=V07oSUQ2Sdf4S5voVLfWeK=1Fu10_BNAJYWF8Q@mail.gmail.com> (raw)
In-Reply-To: <20190307182102.GA12466@archlinux-ryzen>

On Thu, Mar 7, 2019 at 7:21 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Thu, Mar 07, 2019 at 10:12:11AM -0800, Nick Desaulniers wrote:
> > On Thu, Mar 7, 2019 at 1:15 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > >
> > > On 32-bit ARM, I got a link failure in futex_init() when building
> > > with clang in some random configurations:
> > >
> > > kernel/futex.o:(.text.fixup+0x5c): relocation truncated to fit: R_ARM_JUMP24 against `.init.text'
> >
> > Do we know what function from the fixup text section is calling
> > futex_detect_cmpxchg?  I'm curious if this is maybe another case of
> > -Wsection where some function may be in the wrong section?
> >
>
> Looks like this is the call stack:
>
> futex_init ->
>     futex_detect_cmpxchg ->
>         cmpxchg_futex_value_locked ->
>             futex_atomic_cmpxchg_inatomic
>
> This is the same issue I reported: https://github.com/ClangBuiltLinux/linux/issues/325
>
> Marking arm's futex_atomic_cmpxchg_inatomic as noinline also fixes this
> so maybe that's it?

I think part of the problem is the linker sometimes failing to generate
veneers for long calls. I've seen this in the past with relocations in
non-executable sections, but it's possible that the problem here is
having a relocation to a section that doesn't start with ".text".

I have not analyzed the linker behavior in more detail, but have
experimentally shown that the problem doesn't happen if the relocation
is from the .text.fixup segment to .text rather than .init.text. It's
also possible that this is simply a result of the relative distance of
the locations in memory as Russell said, so it could come back
if the kernel grows further.

        Arnd

  reply	other threads:[~2019-03-07 22:24 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07  9:14 [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Arnd Bergmann
2019-03-07  9:14 ` [PATCH 2/2] ARM: futex: make futex_detect_cmpxchg more reliable Arnd Bergmann
2019-03-07  9:14   ` Arnd Bergmann
2019-03-07 19:39   ` Nick Desaulniers
2019-03-07 19:39     ` Nick Desaulniers
2019-03-07 23:48     ` Russell King - ARM Linux admin
2019-03-07 23:48       ` Russell King - ARM Linux admin
2019-03-08  0:04       ` Nick Desaulniers
2019-03-08  0:04         ` Nick Desaulniers
2019-03-08  9:54         ` Russell King - ARM Linux admin
2019-03-08  9:54           ` Russell King - ARM Linux admin
2019-03-08  8:57       ` Ard Biesheuvel
2019-03-08  8:57         ` Ard Biesheuvel
2019-03-08  9:53         ` Russell King - ARM Linux admin
2019-03-08  9:53           ` Russell King - ARM Linux admin
2019-03-08 10:08           ` Ard Biesheuvel
2019-03-08 10:08             ` Ard Biesheuvel
2019-03-08 10:16             ` Ard Biesheuvel
2019-03-08 10:16               ` Ard Biesheuvel
2019-03-08 10:56               ` Russell King - ARM Linux admin
2019-03-08 10:56                 ` Russell King - ARM Linux admin
2019-03-08 10:34             ` Russell King - ARM Linux admin
2019-03-08 10:34               ` Russell King - ARM Linux admin
2019-03-08 10:45               ` Ard Biesheuvel
2019-03-08 10:45                 ` Ard Biesheuvel
2019-03-08 10:58                 ` Russell King - ARM Linux admin
2019-03-08 10:58                   ` Russell King - ARM Linux admin
2019-03-08 11:55                   ` Ard Biesheuvel
2019-03-08 11:55                     ` Ard Biesheuvel
2019-03-11 14:34                     ` Arnd Bergmann
2019-03-11 14:34                       ` Arnd Bergmann
2019-03-11 14:36                       ` Ard Biesheuvel
2019-03-11 14:36                         ` Ard Biesheuvel
2019-03-11 16:29                         ` Arnd Bergmann
2019-03-11 16:29                           ` Arnd Bergmann
2019-03-11 16:36                           ` Ard Biesheuvel
2019-03-11 16:36                             ` Ard Biesheuvel
2019-03-11 20:58                             ` Arnd Bergmann
2019-03-11 20:58                               ` Arnd Bergmann
2019-03-08 11:55                 ` Dave Martin
2019-03-08 11:55                   ` Dave Martin
2019-03-07 17:19 ` [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline' Joe Perches
2019-03-07 17:25   ` Russell King - ARM Linux admin
2019-03-07 17:42     ` Joe Perches
2019-03-07 18:07       ` Russell King - ARM Linux admin
2019-03-07 18:12 ` Nick Desaulniers
2019-03-07 18:21   ` Nathan Chancellor
2019-03-07 22:24     ` Arnd Bergmann [this message]
2020-12-12 12:26 ` Marco Elver
2020-12-12 20:01   ` Thomas Gleixner
2020-12-14 10:22     ` Marco Elver
2020-12-14 13:15     ` Arnd Bergmann
2020-12-14 13:15       ` Arnd Bergmann
2020-12-15  6:09       ` Guo Ren
2020-12-15  6:09         ` Guo Ren
2020-12-15 11:26         ` Arnd Bergmann
2020-12-15 11:26           ` Arnd Bergmann
2020-12-15 19:38           ` Sam Ravnborg
2020-12-15 19:38             ` Sam Ravnborg
2020-12-15 23:24             ` Arnd Bergmann
2020-12-15 23:24               ` Arnd Bergmann
2020-12-17 15:32               ` Andreas Larsson
2020-12-17 15:32                 ` Andreas Larsson
2020-12-17 16:43                 ` Arnd Bergmann
2020-12-17 16:43                   ` Arnd Bergmann
2020-12-18 11:08                   ` Andreas Larsson
2020-12-18 11:08                     ` Andreas Larsson
2020-12-17 20:03               ` Sam Ravnborg
2020-12-17 20:03                 ` Sam Ravnborg
2020-12-16 10:07             ` David Laight
2020-12-16 11:40           ` Peter Zijlstra
2020-12-16 11:40             ` Peter Zijlstra
2020-12-20 15:44           ` Guo Ren
2020-12-20 15:44             ` Guo Ren
2020-12-20 17:49             ` Arnd Bergmann
2020-12-20 17:49               ` Arnd Bergmann
2020-12-21  2:58               ` Guo Ren
2020-12-21  2:58                 ` Guo Ren
2021-07-22 20:05     ` Nathan Chancellor
2021-10-25 13:52       ` Arnd Bergmann

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='CAK8P3a1sPvO=V07oSUQ2Sdf4S5voVLfWeK=1Fu10_BNAJYWF8Q@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=elena.reshetova@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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.