[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251013134250.GAaO0B2rb_smA83z32@fat_crate.local>
Date: Mon, 13 Oct 2025 15:42:50 +0200
From: Borislav Petkov <bp@...en8.de>
To: "Chang S. Bae" <chang.seok.bae@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, tglx@...utronix.de,
mingo@...hat.com, dave.hansen@...ux.intel.com, chao.gao@...el.com,
abusse@...zon.de, tony.luck@...el.com
Subject: Re: [PATCH v6 3/7] x86/microcode/intel: Establish staging control
logic
On Sun, Sep 21, 2025 at 03:48:37PM -0700, Chang S. Bae wrote:
> When microcode staging is initiated, operations are carried out through
> an MMIO interface. Each package has a unique interface specified by the
> IA32_MCU_STAGING_MBOX_ADDR MSR, which maps to a set of 32-bit registers.
>
> Prepare staging with the following steps:
>
> 1. Ensure the microcode image is 32-bit aligned to match the MMIO
> register size.
>
> 2. Identify each MMIO interface based on its per-package scope.
>
> 3. Invoke the staging function for each identified interface, which
> will be implemented separately.
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Chang S. Bae <chang.seok.bae@...el.com>
> Tested-by: Anselm Busse <abusse@...zon.de>
> Reviewed-by: Tony Luck <tony.luck@...el.com>
> Link: https://lore.kernel.org/all/871pznq229.ffs@tglx
> ---
Fixups ontop:
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index daae74858347..216595a45564 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -315,15 +315,18 @@ static void stage_microcode(void)
int cpu, err;
u64 mmio_pa;
- if (!IS_ALIGNED(get_totalsize(&ucode_patch_late->hdr), sizeof(u32)))
+ if (!IS_ALIGNED(get_totalsize(&ucode_patch_late->hdr), sizeof(u32))) {
+ pr_err("Microcode image 32-bit misaligned (0x%x), staging failed.\n",
+ get_totalsize(&ucode_patch_late->hdr));
return;
+ }
lockdep_assert_cpus_held();
/*
* The MMIO address is unique per package, and all the SMT
* primary threads are online here. Find each MMIO space by
- * their package ids to avoid duplicate staging.
+ * their package IDs to avoid duplicate staging.
*/
for_each_cpu(cpu, cpu_primary_thread_mask) {
if (topology_logical_package_id(cpu) == pkg_id)
@@ -337,7 +340,7 @@ static void stage_microcode(void)
err = do_stage(mmio_pa);
if (err) {
- pr_err("Error: staging failed (code = %d) for CPU%d at package %u.\n",
+ pr_err("Error: staging failed (%d) for CPU%d at package %u.\n",
err, cpu, pkg_id);
return;
}
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists