All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [GIT pull] locking/urgent for v5.12-rc3
Date: Mon, 15 Mar 2021 12:26:12 +0100	[thread overview]
Message-ID: <YE9EVNG4/5UMJvFp@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <YE9AkgbqL+eVO6p1@hirez.programming.kicks-ass.net>

On Mon, Mar 15, 2021 at 12:10:10PM +0100, Peter Zijlstra wrote:
> On Mon, Mar 15, 2021 at 09:33:45AM +0100, Peter Zijlstra wrote:
> > On Sun, Mar 14, 2021 at 01:15:25PM -0700, Linus Torvalds wrote:
> > > On Sun, Mar 14, 2021 at 8:40 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> > > >
> > > >  - A fix for the static_call mechanism so it handles unaligned
> > > >    addresses correctly.
> > > 
> > > I'm not disputing the fix in any way, but why weren't the relocation
> > > info and function start addresses mutually aligned?
> > > 
> > > Are we perhaps missing some .align directive somewhere?
> > > 
> > > Or am I missing something?
> > 
> > So I considered looking into that, but since carrying the flag on the
> > absolute address is always correct I figured it was the more robust fix.
> > 
> > I suppose I can try and figure out where alignment went wobbly.
> 
> include/asm-generic/vmlinux.lds.h:
> 
> #define STATIC_CALL_DATA						\
> 	. = ALIGN(8);							\
> 	__start_static_call_sites = .;					\
> 	KEEP(*(.static_call_sites))					\
> 	__stop_static_call_sites = .;					\
> 	__start_static_call_tramp_key = .;				\
> 	KEEP(*(.static_call_tramp_key))					\
> 	__stop_static_call_tramp_key = .;
> 
> #ifndef RO_AFTER_INIT_DATA
> #define RO_AFTER_INIT_DATA						\
> 	. = ALIGN(8);							\
> 	__start_ro_after_init = .;					\
> 	*(.data..ro_after_init)						\
> 	JUMP_TABLE_DATA							\
> 	STATIC_CALL_DATA						\
> 	__end_ro_after_init = .;
> #endif
> 
> 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> 		__start_rodata = .;					\
> 		*(.rodata) *(.rodata.*)					\
> 		SCHED_DATA						\
> 		RO_AFTER_INIT_DATA	/* Read only after init */	\
> 		. = ALIGN(8);						\
> 		__start___tracepoints_ptrs = .;				\
> 		KEEP(*(__tracepoints_ptrs)) /* Tracepoints: pointer array */ \
> 		__stop___tracepoints_ptrs = .;				\
> 		*(__tracepoints_strings)/* Tracepoints: strings */	\
> 	}								\
> 
> 
> $ nm defconfig-build/vmlinux | grep static_call_sites
> ffffffff82916dc0 D __start_static_call_sites
> ffffffff8291aaf0 D __stop_static_call_sites
> 
> 
> Which all reads to me like it *SHOULD* work. Howver when I was debugging
> the crash as reported by Steve (using his .config), I definitely saw
> non-aligned base offsets causing mayhem.

Ooooh, modules don't have this. They still have regular
.static_call_sites sections, and *those* are unaligned.

Section Headers:
[Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al

[16] .static_call_sites PROGBITS        0000000000000000 008aa1 0006f0 00  WA  0   0  1

And that goes *BOOM*.. Let me ses if I can figure out how to make
objtool align those sections.

  reply	other threads:[~2021-03-15 11:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 15:39 [GIT pull] locking/urgent for v5.12-rc3 Thomas Gleixner
2021-03-14 15:39 ` [GIT pull] objtool/urgent " Thomas Gleixner
2021-03-14 20:38   ` pr-tracker-bot
2021-03-14 15:39 ` [GIT pull] sched/urgent " Thomas Gleixner
2021-03-14 20:38   ` pr-tracker-bot
2021-03-14 15:40 ` [GIT pull] timers/urgent " Thomas Gleixner
2021-03-14 20:38   ` pr-tracker-bot
2021-03-14 15:40 ` [GIT pull] irq/urgent for v5.12-rc2 Thomas Gleixner
2021-03-14 20:38   ` pr-tracker-bot
2021-03-14 20:15 ` [GIT pull] locking/urgent for v5.12-rc3 Linus Torvalds
2021-03-15  8:33   ` Peter Zijlstra
2021-03-15 11:10     ` Peter Zijlstra
2021-03-15 11:26       ` Peter Zijlstra [this message]
2021-03-15 12:08         ` Peter Zijlstra
2021-03-15 13:31           ` Steven Rostedt
2021-03-15 17:03           ` Josh Poimboeuf
2021-03-15 17:43             ` Peter Zijlstra
2021-03-15 18:59             ` Linus Torvalds
2021-03-15 22:09               ` Peter Zijlstra
2021-03-14 20:38 ` pr-tracker-bot

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=YE9EVNG4/5UMJvFp@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@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.