From: Kees Cook <keescook@chromium.org>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
arnd@kernel.org, davem@davemloft.net, peterz@infradead.org,
Arnd Bergmann <arnd@arndb.de>,
linux@roeck-us.net, geert@linux-m68k.org, mingo@kernel.org,
andi.shyti@linux.intel.com, andrzej.hajda@intel.com,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc: mark __arch_xchg() as __always_inline
Date: Thu, 13 Jul 2023 09:55:29 -0700 [thread overview]
Message-ID: <202307130954.562F14E@keescook> (raw)
In-Reply-To: <mhng-0bca249b-95f1-4e3f-b241-f37835e1c623@palmer-ri-x1c9a>
On Thu, Jul 13, 2023 at 07:00:37AM -0700, Palmer Dabbelt wrote:
> On Wed, 28 Jun 2023 04:45:43 PDT (-0700), Mark Rutland wrote:
> > On Wed, Jun 28, 2023 at 11:49:18AM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > An otherwise correct change to the atomic operations uncovered an
> > > existing bug in the sparc __arch_xchg() function, which is calls
> > > __xchg_called_with_bad_pointer() when its arguments are unknown at
> > > compile time:
> > >
> > > ERROR: modpost: "__xchg_called_with_bad_pointer" [lib/atomic64_test.ko] undefined!
> > >
> > > This now happens because gcc determines that it's better to not inline the
> > > function. Avoid this by just marking the function as __always_inline
> > > to force the compiler to do the right thing here.
> > >
> > > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > > Link: https://lore.kernel.org/all/c525adc9-6623-4660-8718-e0c9311563b8@roeck-us.net/
> > > Fixes: d12157efc8e08 ("locking/atomic: make atomic*_{cmp,}xchg optional")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Aha; you saved me writing a patch! :)
> >
> > We should probably do likewise for all the other bits like __cmpxchg(), but
> > either way:
> >
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> Though I'm not sure that means a whole lot over here ;)
I've carried some other sparc stuff before. I can send this to Linus
with other fixes.
--
Kees Cook
next prev parent reply other threads:[~2023-07-13 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 9:49 [PATCH] sparc: mark __arch_xchg() as __always_inline Arnd Bergmann
2023-06-28 11:45 ` Mark Rutland
2023-07-13 14:00 ` Palmer Dabbelt
2023-07-13 16:55 ` Kees Cook [this message]
2023-06-28 12:35 ` Guenter Roeck
2023-06-28 15:51 ` Sam Ravnborg
2023-07-13 13:47 ` Linux regression tracking (Thorsten Leemhuis)
2023-06-28 16:23 ` Andi Shyti
2023-07-13 17:55 ` Kees Cook
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=202307130954.562F14E@keescook \
--to=keescook@chromium.org \
--cc=andi.shyti@linux.intel.com \
--cc=andrzej.hajda@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=palmer@rivosinc.com \
--cc=peterz@infradead.org \
--cc=sparclinux@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox