Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
* Processor MMIO stale data
* vulnerabilities.
*/
#define ARCH_CAP_MCU_ENUM BIT(16) /*
* Indicates the presence of microcode update
* feature enumeration and status information.
*/
#define ARCH_CAP_FB_CLEAR BIT(17) /*
* VERW clears CPU fill buffer
* even on MDS_NO CPUs.
Expand Down Expand Up @@ -851,6 +855,10 @@
#define MSR_IA32_APICBASE_BASE (0xfffff<<12)

#define MSR_IA32_UCODE_WRITE 0x00000079

#define MSR_IA32_MCU_ENUMERATION 0x0000007b
#define MCU_STAGING BIT(4)

#define MSR_IA32_UCODE_REV 0x0000008b

/* Intel SGX Launch Enclave Public Key Hash MSRs */
Expand Down Expand Up @@ -1157,6 +1165,8 @@
#define VMX_BASIC_MEM_TYPE_WB 6LLU
#define VMX_BASIC_INOUT 0x0040000000000000LLU

#define MSR_IA32_MCU_STAGING_MBOX_ADDR 0x000007a5

/* Resctrl MSRs: */
/* - Intel: */
#define MSR_IA32_L3_QOS_CFG 0xc81
Expand Down
11 changes: 11 additions & 0 deletions arch/x86/kernel/cpu/microcode/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,17 @@ static int load_late_stop_cpus(bool is_safe)
pr_err("You should switch to early loading, if possible.\n");
}

/*
* Pre-load the microcode image into a staging device. This
* process is preemptible and does not require stopping CPUs.
* Successful staging simplifies the subsequent late-loading
* process, reducing rendezvous time.
*
* Even if the transfer fails, the update will proceed as usual.
*/
if (microcode_ops->use_staging)
microcode_ops->stage_microcode();

atomic_set(&late_cpus_in, num_online_cpus());
atomic_set(&offline_in_nmi, 0);
loops_per_usec = loops_per_jiffy / (TICK_NSEC / 1000);
Expand Down
Loading