Skip to content

Commit

Permalink
Merge tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/tip

Pull x86 microcode loader updates from Borislav Petkov:

 - Load late on both SMT threads on AMD, just like it is being done in
   the early loading procedure

  - Cleanups

* tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/microcode/AMD: Load late on both threads too
  x86/microcode/amd: Remove unneeded pointer arithmetic
  x86/microcode/AMD: Get rid of __find_equiv_id()
  • Loading branch information
torvalds committed Jun 27, 2023
2 parents 04fc890 + a32b0f0 commit 4aacace
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions arch/x86/kernel/cpu/microcode/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ static u16 find_equiv_id(struct equiv_cpu_table *et, u32 sig)

if (sig == e->installed_cpu)
return e->equiv_cpu;

e++;
}
return 0;
}
Expand Down Expand Up @@ -596,11 +594,6 @@ void reload_ucode_amd(unsigned int cpu)
}
}
}
static u16 __find_equiv_id(unsigned int cpu)
{
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
return find_equiv_id(&equiv_table, uci->cpu_sig.sig);
}

/*
* a small, trivial cache of per-family ucode patches
Expand Down Expand Up @@ -651,9 +644,11 @@ static void free_cache(void)

static struct ucode_patch *find_patch(unsigned int cpu)
{
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
u16 equiv_id;

equiv_id = __find_equiv_id(cpu);

equiv_id = find_equiv_id(&equiv_table, uci->cpu_sig.sig);
if (!equiv_id)
return NULL;

Expand Down Expand Up @@ -705,7 +700,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);

/* need to apply patch? */
if (rev >= mc_amd->hdr.patch_id) {
if (rev > mc_amd->hdr.patch_id) {
ret = UCODE_OK;
goto out;
}
Expand Down

0 comments on commit 4aacace

Please sign in to comment.