Skip to content

KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN for CPU hotplug

Vitaly Kuznetsov stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: x86: Do runtime CPUID update before updating vcpu->arch.cpuid_entriesarch/x86/kvm/cpuid.c+34 -200 replies
2/4KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUNarch/x86/kvm/cpuid.c arch/x86/kvm/x86.c+36 -190 replies
3/4KVM: selftests: Rename 'get_cpuid_test' to 'cpuid_test'tools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/x86_64/cpuid_test.c+3 -30 replies
4/4KVM: selftests: Test KVM_SET_CPUID2 after KVM_RUNtools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/lib/x86_64/processor.c tools/testing/selftests/kvm/x86_64/cpuid_test.c+66 -40 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Bonzini
SeriesA-b
1/4
2/4
3/4
4/4

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 stable 5.16 v1 0/4] KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN for CPU hotplug

This is a backport of the recently merged "[PATCH v3 0/4] KVM: x86:
Partially allow KVM_SET_CPUID{,2} after KVM_RUN for CPU hotplug"
(https://lore.kernel.org/kvm/[email protected]/)

Original description:

Recently, KVM made it illegal to change CPUID after KVM_RUN but unfortunately this change is not fully compatible with existing VMMs. In particular, QEMU reuses vCPU fds for CPU hotplug after unplug and it calls KVM_SET_CPUID2. Relax the requirement by implementing an allowing KVM_SET_CPUID{,2} with the exact same data.

Vitaly Kuznetsov (4):
KVM: x86: Do runtime CPUID update before updating

    vcpu->arch.cpuid_entries

KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN
KVM: selftests: Rename 'get_cpuid_test' to 'cpuid_test'
KVM: selftests: Test KVM_SET_CPUID2 after KVM_RUN

 arch/x86/kvm/cpuid.c                          | 90 ++++++++++++++-----
 arch/x86/kvm/x86.c                            | 19 ----
 tools/testing/selftests/kvm/.gitignore        |  2 +-
 tools/testing/selftests/kvm/Makefile          |  4 +-
 .../selftests/kvm/include/x86_64/processor.h  |  7 ++
 .../selftests/kvm/lib/x86_64/processor.c      | 33 ++++++-
 .../x86_64/{get_cpuid_test.c => cpuid_test.c} | 30 +++++++
 7 files changed, 139 insertions(+), 46 deletions(-)
 rename tools/testing/selftests/kvm/x86_64/{get_cpuid_test.c => cpuid_test.c} (83%)
Signature · 1 line
2.34.1