mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org
Subject: Re: [tip: x86/core] x86/alternative: Patch a single alternative location only once
Date: Tue, 14 Oct 2025 16:22:09 +0200	[thread overview]
Message-ID: <c0fb45d5-c4a0-498d-8378-dd96ec261c8c@suse.com> (raw)
In-Reply-To: <20251014141245.GCaO5aXSQqglFrT9Iy@fat_crate.local>


[-- Attachment #1.1.1: Type: text/plain, Size: 1218 bytes --]

On 14.10.25 16:12, Borislav Petkov wrote:
> On Tue, Oct 14, 2025 at 04:08:47PM +0200, Jürgen Groß wrote:
>> And just for the record: NMI handling is using ALTERNATIVE_2, so you
>> can't just "disable interrupts" and be sure it will work.
> 
> Are you fixing anything you're actually hitting while patching alternatives or
> are you talking hypothetically here?

I really ran into issues while writing my paravirt MSR series, as I had
an ALTERNATIVE3() invocation modifying the original instruction (the
indirect paravirt call) with an WRMSR and then trying to turn the no
longer existing indirect call into a direct one.

So I didn't have the intermediate issue in interrupt handling, but the
issue with rules how to place indirect call replacements in ALTERNATIVEn()
invocations.

The interrupt handling still might be a thing, while NMI is for sure rather
unlikely.

> 
> Because I can't think of an easy way to trigger NMIs that early during boot,
> when not even SMP is up.
> 

NMIs are probably really a more theoretical issue. And even if NMIs are
affected, they will still be affected in case they happen just when half of
the new instruction bytes have been written.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2025-10-14 14:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 11:29 [PATCH 0/3] x86/alternative: Make alternative patching more robust Juergen Gross
2025-09-29 11:29 ` [PATCH 1/3] x86/alternative: Drop not needed test after call of alt_replace_call() Juergen Gross
2025-10-14  8:42   ` [tip: x86/core] " tip-bot2 for Juergen Gross
2025-09-29 11:29 ` [PATCH 2/3] x86/alternative: Refactor apply_alternatives() Juergen Gross
2025-10-14  8:42   ` [tip: x86/core] " tip-bot2 for Juergen Gross
2025-09-29 11:29 ` [PATCH 3/3] x86/alternative: Patch a single alternative location only once Juergen Gross
2025-09-30  7:26   ` Peter Zijlstra
2025-09-30  7:33     ` Jürgen Groß
2025-09-30  7:39       ` Peter Zijlstra
2025-09-30  8:04         ` Jürgen Groß
2025-10-14  8:42   ` [tip: x86/core] " tip-bot2 for Juergen Gross
2025-10-14 12:59     ` Borislav Petkov
2025-10-14 13:25       ` Borislav Petkov
2025-10-14 14:13         ` Jürgen Groß
2025-10-14 14:17           ` Borislav Petkov
2025-10-14 14:18           ` Peter Zijlstra
2025-10-14 14:26             ` Juergen Gross
2025-10-14 14:29               ` Borislav Petkov
2025-10-14 14:08       ` Jürgen Groß
2025-10-14 14:12         ` Borislav Petkov
2025-10-14 14:22           ` Jürgen Groß [this message]
2025-10-14 14:26             ` Borislav Petkov
2025-10-14 14:31               ` Jürgen Groß
2025-10-14 14:39                 ` Borislav Petkov
2025-10-14 14:46                   ` Jürgen Groß

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=c0fb45d5-c4a0-498d-8378-dd96ec261c8c@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®