Skip to content

KVM: x86: hyper-v: make KVM_GET_SUPPORTED_HV_CPUID more useful

Vitaly Kuznetsov kvm lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesNew
  2. v32 patches 2 repliesApplied
  3. v27 patches 5 repliesApplied
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches1 replySuperseded

Changes in v4 from the cover letter

- Rebase to the latest kvm/queue (KVM_CAP_SYS_HYPERV_CPUID changed to 191)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: x86: hyper-v: allow KVM_GET_SUPPORTED_HV_CPUID as a system ioctlDocumentation/virt/kvm/api.rst arch/x86/kvm/hyperv.c arch/x86/kvm/hyperv.h +3 more+46 -310 replies
2/2KVM: selftests: test KVM_GET_SUPPORTED_HV_CPUID as a system ioctltools/testing/selftests/kvm/include/kvm_util.h tools/testing/selftests/kvm/lib/kvm_util.c tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c+77 -380 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] KVM: x86: hyper-v: make KVM_GET_SUPPORTED_HV_CPUID more useful

Changes since v3:
- Rebase to the latest kvm/queue (KVM_CAP_SYS_HYPERV_CPUID changed to 191)

QEMU series using the feature:
https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg02017.html

Original description:

KVM_GET_SUPPORTED_HV_CPUID was initially implemented as a vCPU ioctl but this is not very useful when VMM is just trying to query which Hyper-V features are supported by the host prior to creating VM/vCPUs. The data in KVM_GET_SUPPORTED_HV_CPUID is mostly static with a few exceptions but it seems we can change this. Add support for KVM_GET_SUPPORTED_HV_CPUID as a system ioctl as well.

QEMU specific description:
In some cases QEMU needs to collect the information about which Hyper-V features are supported by KVM and pass it up the stack. For non-hyper-v features this is done with system-wide KVM_GET_SUPPORTED_CPUID/ KVM_GET_MSRS ioctls but Hyper-V specific features don't get in the output (as Hyper-V CPUIDs intersect with KVM's). In QEMU, CPU feature expansion happens before any KVM vcpus are created so KVM_GET_SUPPORTED_HV_CPUID can't be used in its current shape.

Vitaly Kuznetsov (2):
KVM: x86: hyper-v: allow KVM_GET_SUPPORTED_HV_CPUID as a system ioctl
KVM: selftests: test KVM_GET_SUPPORTED_HV_CPUID as a system ioctl

 Documentation/virt/kvm/api.rst                | 16 ++--
 arch/x86/kvm/hyperv.c                         |  6 +-
 arch/x86/kvm/hyperv.h                         |  4 +-
 arch/x86/kvm/vmx/evmcs.c                      |  3 +-
 arch/x86/kvm/x86.c                            | 45 ++++++----
 include/uapi/linux/kvm.h                      |  3 +-
 .../testing/selftests/kvm/include/kvm_util.h  |  2 +
 tools/testing/selftests/kvm/lib/kvm_util.c    | 26 ++++++
 .../selftests/kvm/x86_64/hyperv_cpuid.c       | 87 +++++++++++--------
 9 files changed, 123 insertions(+), 69 deletions(-)
Signature · 1 line
2.25.4