Skip to content

KVM: x86: Fix KVM_FEATURE_PV_UNHALT update logic

Vitaly Kuznetsov kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 hyperv. I won't send a pull request for this until next week,

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: x86: Introduce __kvm_get_hypervisor_cpuid() helperarch/x86/kvm/cpuid.c+10 -30 replies
2/3KVM: x86: Use actual kvm_cpuid.base for clearing KVM_FEATURE_PV_UNHALTarch/x86/kvm/cpuid.c+17 -143 replies
3/3KVM: selftests: Check that KVM_FEATURE_PV_UNHALT is cleared with KVM_X86_DISABLE_EXITS_HLTtools/testing/selftests/kvm/x86_64/kvm_pv_test.c+42 -01 reply

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchLi RongQing
1/3
2/3Reported-and-tested-by
3/3

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

Read the v1 thread

Cover letter [PATCH 0/3] KVM: x86: Fix KVM_FEATURE_PV_UNHALT update logic

Guest hangs in specific configurations (KVM_X86_DISABLE_EXITS_HLT) are reported and the issue was bisected to commit ee3a5f9e3d9b ("KVM: x86: Do runtime CPUID update before updating vcpu->arch.cpuid_entries") which, of course, carries "No functional change intended" blurb. Turns out, moving __kvm_update_cpuid_runtime() earlier in kvm_set_cpuid() to tweak the incoming CPUID data before checking it wasn't innocent as KVM_FEATURE_PV_UNHALT reset logic relies on cached KVM CPUID base which gets updated later.

I was not able to reproduce the issue with QEMU myself so I wrote a selftest to show the problem.

Vitaly Kuznetsov (3):
KVM: x86: Introduce __kvm_get_hypervisor_cpuid() helper
KVM: x86: Use actual kvm_cpuid.base for clearing KVM_FEATURE_PV_UNHALT
KVM: selftests: Check that KVM_FEATURE_PV_UNHALT is cleared with
KVM_X86_DISABLE_EXITS_HLT

 arch/x86/kvm/cpuid.c                          | 42 ++++++++++++-------
 .../selftests/kvm/x86_64/kvm_pv_test.c        | 42 +++++++++++++++++++
 2 files changed, 68 insertions(+), 16 deletions(-)

base-commit: 0cbca1bf44a0b8666c91ce3438f235c6fe70fbf1

Signature · 1 line
2.43.0