Merge tag 'x86_microcode_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 microcode update from Borislav Petkov:
 "A single fix to the late microcode loading machinery which corrects
  the ordering of when new microcode is loaded from the fs, vs checking
  whether all CPUs are online"

* tag 'x86_microcode_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/microcode: Check for offline CPUs before requesting new microcode
This commit is contained in:
Linus Torvalds
2021-04-26 08:58:49 -07:00

View File

@ -629,16 +629,16 @@ static ssize_t reload_store(struct device *dev,
if (val != 1) if (val != 1)
return size; return size;
tmp_ret = microcode_ops->request_microcode_fw(bsp, &microcode_pdev->dev, true);
if (tmp_ret != UCODE_NEW)
return size;
get_online_cpus(); get_online_cpus();
ret = check_online_cpus(); ret = check_online_cpus();
if (ret) if (ret)
goto put; goto put;
tmp_ret = microcode_ops->request_microcode_fw(bsp, &microcode_pdev->dev, true);
if (tmp_ret != UCODE_NEW)
goto put;
mutex_lock(&microcode_mutex); mutex_lock(&microcode_mutex);
ret = microcode_reload_late(); ret = microcode_reload_late();
mutex_unlock(&microcode_mutex); mutex_unlock(&microcode_mutex);