Commit 4aacacee authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86_microcode_for_v6.5' of git://git.kernel.org/pub/scm/linux/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()
parents 04fc8904 a32b0f0d
...@@ -78,8 +78,6 @@ static u16 find_equiv_id(struct equiv_cpu_table *et, u32 sig) ...@@ -78,8 +78,6 @@ static u16 find_equiv_id(struct equiv_cpu_table *et, u32 sig)
if (sig == e->installed_cpu) if (sig == e->installed_cpu)
return e->equiv_cpu; return e->equiv_cpu;
e++;
} }
return 0; return 0;
} }
...@@ -596,11 +594,6 @@ void reload_ucode_amd(unsigned int cpu) ...@@ -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 * a small, trivial cache of per-family ucode patches
...@@ -651,9 +644,11 @@ static void free_cache(void) ...@@ -651,9 +644,11 @@ static void free_cache(void)
static struct ucode_patch *find_patch(unsigned int cpu) static struct ucode_patch *find_patch(unsigned int cpu)
{ {
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
u16 equiv_id; u16 equiv_id;
equiv_id = __find_equiv_id(cpu);
equiv_id = find_equiv_id(&equiv_table, uci->cpu_sig.sig);
if (!equiv_id) if (!equiv_id)
return NULL; return NULL;
...@@ -705,7 +700,7 @@ static enum ucode_state apply_microcode_amd(int cpu) ...@@ -705,7 +700,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy); rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
/* need to apply patch? */ /* need to apply patch? */
if (rev >= mc_amd->hdr.patch_id) { if (rev > mc_amd->hdr.patch_id) {
ret = UCODE_OK; ret = UCODE_OK;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment