diff options
| author | Sean Christopherson <[email protected]> | 2025-05-05 18:03:00 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2025-05-08 14:17:10 +0000 |
| commit | e3417ab75ab2e7dca6372a1bfa26b1be3ac5889e (patch) | |
| tree | d9119713f0dfed465599a342c686bc913310e055 /drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | |
| parent | KVM: x86/mmu: Prevent installing hugepages when mem attributes are changing (diff) | |
| download | kernel-e3417ab75ab2e7dca6372a1bfa26b1be3ac5889e.tar.gz kernel-e3417ab75ab2e7dca6372a1bfa26b1be3ac5889e.zip | |
KVM: SVM: Set/clear SRSO's BP_SPEC_REDUCE on 0 <=> 1 VM count transitions
Set the magic BP_SPEC_REDUCE bit to mitigate SRSO when running VMs if and
only if KVM has at least one active VM. Leaving the bit set at all times
unfortunately degrades performance by a wee bit more than expected.
Use a dedicated spinlock and counter instead of hooking virtualization
enablement, as changing the behavior of kvm.enable_virt_at_load based on
SRSO_BP_SPEC_REDUCE is painful, and has its own drawbacks, e.g. could
result in performance issues for flows that are sensitive to VM creation
latency.
Defer setting BP_SPEC_REDUCE until VMRUN is imminent to avoid impacting
performance on CPUs that aren't running VMs, e.g. if a setup is using
housekeeping CPUs. Setting BP_SPEC_REDUCE in task context, i.e. without
blasting IPIs to all CPUs, also helps avoid serializing 1<=>N transitions
without incurring a gross amount of complexity (see the Link for details
on how ugly coordinating via IPIs gets).
Link: https://lore.kernel.org/all/[email protected]
Fixes: 8442df2b49ed ("x86/bugs: KVM: Add support for SRSO_MSR_FIX")
Reported-by: Michael Larabel <[email protected]>
Closes: https://www.phoronix.com/review/linux-615-amd-regression
Cc: Borislav Petkov <[email protected]>
Tested-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c')
0 files changed, 0 insertions, 0 deletions
