diff options
| author | Sean Christopherson <[email protected]> | 2023-07-29 01:15:51 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2023-08-04 00:16:29 +0000 |
| commit | 229725acfaea0dd81f245aec40986dc766de40fa (patch) | |
| tree | fa50aa1c16a6a0e44a3e0e2850cac03b5ebd3f1f /arch/x86/kvm/svm/nested.c | |
| parent | KVM: nSVM: Use the "outer" helper for writing multiplier to MSR_AMD64_TSC_RATIO (diff) | |
| download | kernel-229725acfaea0dd81f245aec40986dc766de40fa.tar.gz kernel-229725acfaea0dd81f245aec40986dc766de40fa.zip | |
KVM: SVM: Clean up preemption toggling related to MSR_AMD64_TSC_RATIO
Explicitly disable preemption when writing MSR_AMD64_TSC_RATIO only in the
"outer" helper, as all direct callers of the "inner" helper now run with
preemption already disabled. And that isn't a coincidence, as the outer
helper requires a vCPU and is intended to be used when modifying guest
state and/or emulating guest instructions, which are typically done with
preemption enabled.
Direct use of the inner helper should be extremely limited, as the only
time KVM should modify MSR_AMD64_TSC_RATIO without a vCPU is when
sanitizing the MSR for a specific pCPU (currently done when {en,dis}abling
disabling SVM). The other direct caller is svm_prepare_switch_to_guest(),
which does have a vCPU, but is a one-off special case: KVM is about to
enter the guest on a specific pCPU and thus must have preemption disabled.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'arch/x86/kvm/svm/nested.c')
0 files changed, 0 insertions, 0 deletions
