[PATCH v3 0/4] KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN for CPU hotplug

Vitaly Kuznetsov posted 4 patches 4 years, 5 months ago
There is a newer version of this series
arch/x86/kvm/cpuid.c                          | 70 ++++++++++++++++---
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, 129 insertions(+), 36 deletions(-)
rename tools/testing/selftests/kvm/x86_64/{get_cpuid_test.c => cpuid_test.c} (83%)
[PATCH v3 0/4] KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN for CPU hotplug
Posted by Vitaly Kuznetsov 4 years, 5 months ago
Changes since v2:
- Tighten the check for CPUID data equality, require CPUID entries for the
update to be supplied in the exact same order as the original data [Paolo]

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                          | 70 ++++++++++++++++---
 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, 129 insertions(+), 36 deletions(-)
 rename tools/testing/selftests/kvm/x86_64/{get_cpuid_test.c => cpuid_test.c} (83%)

-- 
2.34.1