linux-stable/arch/x86/kvm/vmx
Pawan Gupta da67116b74 KVM/VMX: Move VERW closer to VMentry for MDS mitigation
commit 43fb862de8 upstream.

During VMentry VERW is executed to mitigate MDS. After VERW, any memory
access like register push onto stack may put host data in MDS affected
CPU buffers. A guest can then use MDS to sample host data.

Although likelihood of secrets surviving in registers at current VERW
callsite is less, but it can't be ruled out. Harden the MDS mitigation
by moving the VERW mitigation late in VMentry path.

Note that VERW for MMIO Stale Data mitigation is unchanged because of
the complexity of per-guest conditional VERW which is not easy to handle
that late in asm with no GPRs available. If the CPU is also affected by
MDS, VERW is unconditionally executed late in asm regardless of guest
having MMIO access.

  [ pawan: conflict resolved in backport ]

Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/all/20240213-delay-verw-v8-6-a6216d83edb7%40linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-06 14:45:20 +00:00
..
capabilities.h KVM: x86: Track supported PERF_CAPABILITIES in kvm_caps 2023-05-17 11:53:27 +02:00
evmcs.c KVM: VMX: Get rid of eVMCS specific VMX controls sanitization 2022-09-26 12:02:48 -04:00
evmcs.h KVM: VMX: Fix crash due to uninitialized current_vmcs 2023-03-10 09:34:11 +01:00
nested.c KVM: VMX: Make CR0.WP a guest owned bit 2023-05-17 11:53:29 +02:00
nested.h KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs 2022-09-26 12:03:00 -04:00
pmu_intel.c KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl 2024-02-23 09:12:43 +01:00
posted_intr.c
posted_intr.h
run_flags.h KVM/VMX: Use BT+JNC, i.e. EFLAGS.CF to select VMRESUME vs. VMLAUNCH 2024-03-06 14:45:20 +00:00
sgx.c KVM: VMX: Resume guest immediately when injecting #GP on ECREATE 2023-01-07 11:11:47 +01:00
sgx.h
vmcs.h
vmcs12.c
vmcs12.h
vmcs_shadow_fields.h
vmenter.S KVM/VMX: Move VERW closer to VMentry for MDS mitigation 2024-03-06 14:45:20 +00:00
vmx.c KVM/VMX: Move VERW closer to VMentry for MDS mitigation 2024-03-06 14:45:20 +00:00
vmx.h KVM: VMX: Make CR0.WP a guest owned bit 2023-05-17 11:53:29 +02:00
vmx_ops.h work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00