public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
To: stable@vger.kernel.org
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Subject: Request to port to 6.6.y : c809b0d0e52d ("x86/microcode/AMD: Flush patch buffer mapping after application")
Date: Tue, 17 Dec 2024 16:32:55 +0100	[thread overview]
Message-ID: <Z2GZp14ZFOadAskq@antipodes> (raw)

Hello,

Below commit was ported to 6.12, but I would like to request porting to the 6.6
longterm branch we are currently using:

    commit c809b0d0e52d01c30066367b2952c4c4186b1047
    Author: Borislav Petkov (AMD) <bp@alien8.de>
    Date:   2024-11-19 12:21:33 +0100

        x86/microcode/AMD: Flush patch buffer mapping after application
        [...]


The patch itself is small, but the consequence of not patching is large on
affected systems (tens of seconds to minutes, of boot delay). See original
discussion [1] for details.

The patch in master relies on a variable 'bsp_cpuid_1_eax' introduced in commit
94838d230a6c ("x86/microcode/AMD: Use the family,model,stepping encoded in the
patch ID"), but porting that entire commit seems excessive, especially because
there are several 'Fixes' commits for that one (e.g. 5343558a868e, d1744a4c975b,
1d81d85d1a19).

I think the simplest prerequisite change is (for Borislav Petkov to confirm):

diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index bbd1dc38ea03..555fa76bd1f3 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -96,6 +97,8 @@ struct cont_desc {
 
 static u32 ucode_new_rev;
 
+static u32 bsp_cpuid_1_eax __ro_after_init;
+
 /*
  * Microcode patch container file is prepended to the initrd in cpio
  * format. See Documentation/arch/x86/microcode.rst
@@ -551,6 +566,7 @@ static void apply_ucode_from_containers(unsigned int cpuid_1_eax)
 
 void load_ucode_amd_early(unsigned int cpuid_1_eax)
 {
+	bsp_cpuid_1_eax = cpuid_1_eax;
 	return apply_ucode_from_containers(cpuid_1_eax);
 }
 


Thanks,
Thomas

[1] https://lore.kernel.org/lkml/ZyulbYuvrkshfsd2@antipodes/T/

             reply	other threads:[~2024-12-17 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 15:32 Thomas De Schampheleire [this message]
2024-12-17 15:53 ` Request to port to 6.6.y : c809b0d0e52d ("x86/microcode/AMD: Flush patch buffer mapping after application") Greg KH
2024-12-18 12:28   ` Thomas De Schampheleire
2024-12-23 12:33     ` Greg KH
2024-12-23 13:23       ` Thomas De Schampheleire
2024-12-23 15:49         ` Greg KH

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=Z2GZp14ZFOadAskq@antipodes \
    --to=thomas.de_schampheleire@nokia.com \
    --cc=bp@alien8.de \
    --cc=stable@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