All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	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>
Subject: Re: [GIT pull] locking/urgent for v5.12-rc3
Date: Mon, 15 Mar 2021 23:09:15 +0100	[thread overview]
Message-ID: <YE/bCyJM/xGsqsd3@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHk-=wjE1Z2L87B_ahMMEd9E+jumMwsw=HDCgDkV4gmS=F9u6A@mail.gmail.com>

On Mon, Mar 15, 2021 at 11:59:12AM -0700, Linus Torvalds wrote:
> Is it only the static_call_sites entry itself that needs the
> alignment? Or do we end up depending on the static call function being
> at least 4-byte aligned too? The way it plays games with the key makes
> me worry.

The only thing that absolutely needs to be aligned is the
struct static_call_key address. We use the 2 LSB there.

The code address has no alignment requirements, due to x86 instruction
coding the actual CALL (or JMP for tail-calls) can be anywhere.

Now, static_call_site is PC32 encoded, that is:

	struct static_call_key *key =
		(void *)((unsigned long)&site->key + site->key);

And assuming &site->key is aligned, then site->key & 3 == key & 3.

Per the missing alignment for modules, the above went side-ways. The
patch in question fixed this by not relying on that and always computing
the absolute address first, then transfer the LSBs and then re-encoding
it.

Anyway, still good to also fix the alignment.

  reply	other threads:[~2021-03-15 22:10 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
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 [this message]
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=YE/bCyJM/xGsqsd3@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.