KVM: nSVM: Use the "outer" helper for writing multiplier to MSR_AMD64_TSC_RATIO
authorSean Christopherson <seanjc@google.com>
Sat, 29 Jul 2023 01:15:50 +0000 (18:15 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 4 Aug 2023 00:16:28 +0000 (17:16 -0700)
commitc0dc39bd2c584879748dfd1321f8541d1cbeb9b8
tree32aa9d714bb09aca4fb61f595409a7a809aff077
parent0c94e2468491cbf0754f49a5136ab51294a96b69
KVM: nSVM: Use the "outer" helper for writing multiplier to MSR_AMD64_TSC_RATIO

When emulating nested SVM transitions, use the outer helper for writing
the TSC multiplier for L2.  Using the inner helper only for one-off cases,
i.e. for paths where KVM is NOT emulating or modifying vCPU state, will
allow for multiple cleanups:

 - Explicitly disabling preemption only in the outer helper
 - Getting the multiplier from the vCPU field in the outer helper
 - Skipping the WRMSR in the outer helper if guest state isn't loaded

Opportunistically delete an extra newline.

No functional change intended.

Link: https://lore.kernel.org/r/20230729011608.1065019-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h