Skip to content

Commit d8c3b52

Browse files
suryasaimadhuKAGA-KOKO
authored andcommitted
x86/microcode/intel: Look into the patch cache first
The cache might contain a newer patch - look in there first. A follow-on change will make sure newest patches are loaded into the cache of microcode patches. Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Tom Lendacky <[email protected]> Tested-by: Ashok Raj <[email protected]> Cc: Arjan Van De Ven <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 30ec26d commit d8c3b52

File tree

1 file changed

+5
-6
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+5
-6
lines changed

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,21 +791,20 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
791791

792792
static enum ucode_state apply_microcode_intel(int cpu)
793793
{
794-
struct microcode_intel *mc;
795-
struct ucode_cpu_info *uci;
794+
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
796795
struct cpuinfo_x86 *c = &cpu_data(cpu);
796+
struct microcode_intel *mc;
797797
static int prev_rev;
798798
u32 rev;
799799

800800
/* We should bind the task to the CPU */
801801
if (WARN_ON(raw_smp_processor_id() != cpu))
802802
return UCODE_ERROR;
803803

804-
uci = ucode_cpu_info + cpu;
805-
mc = uci->mc;
804+
/* Look for a newer patch in our cache: */
805+
mc = find_patch(uci);
806806
if (!mc) {
807-
/* Look for a newer patch in our cache: */
808-
mc = find_patch(uci);
807+
mc = uci->mc;
809808
if (!mc)
810809
return UCODE_NFOUND;
811810
}

0 commit comments

Comments
 (0)