]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
x86/speculation: Restore speculation related MSRs during S3 resume
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Tue, 5 Apr 2022 00:35:45 +0000 (17:35 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:41:17 +0000 (14:41 +0200)
commit6d865aceb96980e3e664dee4e120835a5ad4feb6
tree8e417e60897bfd3a42eb613c3547ef5af4857da1
parent9a623d8626cd7ffd64db53e5773b6254c0e138ca
x86/speculation: Restore speculation related MSRs during S3 resume

BugLink: https://bugs.launchpad.net/bugs/1969107
commit e2a1256b17b16f9b9adf1b6fea56819e7b68e463 upstream.

After resuming from suspend-to-RAM, the MSRs that control CPU's
speculative execution behavior are not being restored on the boot CPU.

These MSRs are used to mitigate speculative execution vulnerabilities.
Not restoring them correctly may leave the CPU vulnerable.  Secondary
CPU's MSRs are correctly being restored at S3 resume by
identify_secondary_cpu().

During S3 resume, restore these MSRs for boot CPU when restoring its
processor state.

Fixes: 772439717dbf ("x86/bugs/intel: Set proper CPU features and setup RDS")
Reported-by: Neelima Krishnan <neelima.krishnan@intel.com>
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fab4b79e869a8e1c0f7d931a4eff0285d9b5efa7)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/power/cpu.c