Skip to content

Commit

Permalink
x86/microcode/intel: Look into the patch cache first
Browse files Browse the repository at this point in the history
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 <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Ashok Raj <ashok.raj@intel.com>
Cc: Arjan Van De Ven <arjan.van.de.ven@intel.com>
Link: https://lkml.kernel.org/r/20180228102846.13447-6-bp@alien8.de
  • Loading branch information
Borislav Petkov authored and Thomas Gleixner committed Mar 8, 2018
1 parent 30ec26d commit d8c3b52
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions arch/x86/kernel/cpu/microcode/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,21 +791,20 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)

static enum ucode_state apply_microcode_intel(int cpu)
{
struct microcode_intel *mc;
struct ucode_cpu_info *uci;
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
struct cpuinfo_x86 *c = &cpu_data(cpu);
struct microcode_intel *mc;
static int prev_rev;
u32 rev;

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

uci = ucode_cpu_info + cpu;
mc = uci->mc;
/* Look for a newer patch in our cache: */
mc = find_patch(uci);
if (!mc) {
/* Look for a newer patch in our cache: */
mc = find_patch(uci);
mc = uci->mc;
if (!mc)
return UCODE_NFOUND;
}
Expand Down

0 comments on commit d8c3b52

Please sign in to comment.