Skip to content

KVM: SVM: Fix a bug where TSC_AUX can get clobbered

Sean Christopherson kvm lkml 2 versions – Applied

Status from this message: Applied to kvm-x86 svm, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v22 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Collect reviews. [Xiaoyao]
- Make tsc_aux_uret_slot globally visible instead of passing it as a param. [Xiaoyao]
- Mark tsc_aux_uret_slot __ro_after_init.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: x86: Add helper to retrieve current value of user return MSRarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+7 -00 replies
2/2KVM: SVM: Re-load current, not host, TSC_AUX on #VMEXIT from SEV-ES guestarch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+18 -190 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchXiaoyao Li
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] KVM: SVM: Fix a bug where TSC_AUX can get clobbered

Fix a bug where an SEV-ES vCPU running on the same pCPU as a non-SEV-ES vCPU could clobber TSC_AUX due to loading the host's TSC_AUX on #VMEXIT, as opposed to restoring whatever was in hardware at the time of VMRUN.

v3:
- Collect reviews. [Xiaoyao]
- Make tsc_aux_uret_slot globally visible instead of passing it as a param. [Xiaoyao]
- Mark tsc_aux_uret_slot __ro_after_init.

v2:
- https://lore.kernel.org/all/[email protected]
- Drop "cache" from the user_return API.
- Handle the SEV-ES case in SEV-ES code.
- Tag everything for stable@.
- Massage changelog to avoid talking about the host's value and instead focus on failing to restore what KVM thinks is in hardware.

v1: https://lore.kernel.org/all/05a018a6997407080b3b7921ba692aa69a720f07.1758166596.git.houwenlong.hwl@antgroup.com

Hou Wenlong (2):
KVM: x86: Add helper to retrieve current value of user return MSR
KVM: SVM: Re-load current, not host, TSC_AUX on #VMEXIT from SEV-ES
guest

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/svm/sev.c          | 10 ++++++++++
 arch/x86/kvm/svm/svm.c          | 25 ++++++-------------------
 arch/x86/kvm/svm/svm.h          |  2 ++
 arch/x86/kvm/x86.c              |  6 ++++++
 5 files changed, 25 insertions(+), 19 deletions(-)

base-commit: c8fbf7ceb2ae3f64b0c377c8c21f6df577a13eb4

Signature · 1 line
2.51.0.534.gc79095c0ca-goog