linux-stable/arch/x86
Breno Leitao 2135dd1be6 x86/bugs: Reset speculation control settings on init
[ Upstream commit 0125acda7d ]

Currently, x86_spec_ctrl_base is read at boot time and speculative bits
are set if Kconfig items are enabled. For example, IBRS is enabled if
CONFIG_CPU_IBRS_ENTRY is configured, etc. These MSR bits are not cleared
if the mitigations are disabled.

This is a problem when kexec-ing a kernel that has the mitigation
disabled from a kernel that has the mitigation enabled. In this case,
the MSR bits are not cleared during the new kernel boot. As a result,
this might have some performance degradation that is hard to pinpoint.

This problem does not happen if the machine is (hard) rebooted because
the bit will be cleared by default.

  [ bp: Massage. ]

Suggested-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20221128153148.1129350-1-leitao@debian.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:49 +01:00
..
boot x86/sev: Add SEV-SNP guest feature negotiation support 2023-02-01 08:34:50 +01:00
coco x86/tdx: Panic on bad configs that #VE on "private" memory access 2022-11-01 16:02:40 -07:00
configs x86/defconfig: Enable CONFIG_DEBUG_WX=y 2022-09-02 10:41:42 +02:00
crypto crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-10 09:32:51 +01:00
entry x86/vdso: Conditionally export __vdso_sgx_enter_enclave() 2022-12-21 17:48:01 +01:00
events perf/x86/intel/uncore: Add Meteor Lake support 2023-03-10 09:33:47 +01:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-12-31 13:32:56 +01:00
ia32
include x86/bugs: Reset speculation control settings on init 2023-03-10 09:33:49 +01:00
kernel x86/bugs: Reset speculation control settings on init 2023-03-10 09:33:49 +01:00
kvm KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET 2023-02-25 11:25:40 +01:00
lib x86/asm: Fix an assembler warning with current binutils 2023-01-24 07:24:31 +01:00
math-emu
mm x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case 2023-01-18 11:58:22 +01:00
net bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop") 2022-11-04 23:13:08 +01:00
pci
platform EFI updates for v6.1 2022-10-09 08:56:54 -07:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-11-21 14:16:16 +01:00
purgatory x86/purgatory: disable KMSAN instrumentation 2022-10-28 13:37:23 -07:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-12-31 13:32:16 +01:00
tools x86/tools/relocs: Ignore __kcfi_typeid_ relocations 2022-09-26 10:13:15 -07:00
um elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} 2023-01-18 11:58:12 +01:00
video
virt/vmx/tdx
xen x86/boot: Skip realmode init code when running as Xen PV guest 2022-12-31 13:32:16 +01:00
.gitignore x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
Kbuild
Kconfig x86/apic: Handle no CONFIG_X86_X2APIC on systems with x2APIC enabled by BIOS 2022-12-31 13:32:58 +01:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Move '-mindirect-branch-cs-prefix' out of GCC-only block 2023-02-09 11:28:13 +01:00
Makefile.um
Makefile_32.cpu