Skip to content

i386: KVM: expand Hyper-V features early

Vitaly Kuznetsov qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest9 patches 9 repliesIn review
  2. v79 patches 18 repliesSuperseded
  3. v619 patches 41 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v517 patches0 repliesSuperseded
v421 patches30 repliesSuperseded

Changes in v8 from the cover letter

- Make eVMCS version check future proof [Eduardo]
- Collect R-b tags [Eduardo]
- Drop 'if (!strcmp(arch, "i386") || !strcmp(arch, "x86_64"))' check from qtest [Eduardo]
- s/priviliges/privileges/ [Eric]

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9i386: avoid hardcoding '12' as 'hyperv_vendor_id' lengthtarget/i386/cpu.c+5 -41 reply
2/9i386: clarify 'hv-passthrough' behaviordocs/hyperv.txt+5 -20 replies
3/9i386: hardcode supported eVMCS version to '1'docs/hyperv.txt target/i386/kvm/kvm.c+36 -52 replies
4/9i386: make hyperv_expand_features() return booltarget/i386/kvm/kvm.c+21 -190 replies
5/9i386: expand Hyper-V features during CPU feature expansion timetarget/i386/cpu.c target/i386/kvm/kvm-stub.c target/i386/kvm/kvm.c +1 more+30 -40 replies
6/9i386: kill off hv_cpuid_check_and_set()target/i386/kvm/kvm.c+36 -680 replies
7/9i386: HV_HYPERCALL_AVAILABLE privilege bit is always neededtarget/i386/kvm/kvm.c+5 -50 replies
8/9i386: Hyper-V SynIC requires POST_MESSAGES/SIGNAL_EVENTS privilegestarget/i386/kvm/hyperv-proto.h target/i386/kvm/kvm.c+12 -00 replies
9/9qtest/hyperv: Introduce a simple hyper-v testMAINTAINERS tests/qtest/hyperv-test.c tests/qtest/meson.build+224 -15 replies

Reviews trailers per patch

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

PatchEduardo HabkostPhilippe Mathieu-Daudé
1/9R-b R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9A-b

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

Read the v8 thread

Cover letter [PATCH v8 0/9] i386: KVM: expand Hyper-V features early

Changes since v7:
- Make eVMCS version check future proof [Eduardo]
- Collect R-b tags [Eduardo]
- Drop 'if (!strcmp(arch, "i386") || !strcmp(arch, "x86_64"))' check from qtest [Eduardo]
- s/priviliges/privileges/ [Eric]

The last two functional patches are inspired by 'Fine-grained access check to Hyper-V hypercalls and MSRs' work for KVM:
https://lore.kernel.org/kvm/[email protected]/

Original description:

Upper layer tools like libvirt want to figure out which Hyper-V features are supported by the underlying stack (QEMU/KVM) but currently they are unable to do so. We have a nice 'hv_passthrough' CPU flag supported by QEMU but it has no effect on e.g. QMP's

query-cpu-model-expansion type=full model={"name":"host","props":{"hv-passthrough":true}}

command as we parse Hyper-V features after creating KVM vCPUs and not at feature expansion time. To support the use-case we first need to make KVM_GET_SUPPORTED_HV_CPUID ioctl a system-wide ioctl as the existing vCPU version can't be used that early. This is what KVM part does. With that done, we can make early Hyper-V feature expansion (this series).

Vitaly Kuznetsov (9):
i386: avoid hardcoding '12' as 'hyperv_vendor_id' length
i386: clarify 'hv-passthrough' behavior
i386: hardcode supported eVMCS version to '1'
i386: make hyperv_expand_features() return bool
i386: expand Hyper-V features during CPU feature expansion time
i386: kill off hv_cpuid_check_and_set()
i386: HV_HYPERCALL_AVAILABLE privilege bit is always needed
i386: Hyper-V SynIC requires POST_MESSAGES/SIGNAL_EVENTS privileges qtest/hyperv: Introduce a simple hyper-v test

 MAINTAINERS                    |   1 +
 docs/hyperv.txt                |   9 +-
 target/i386/cpu.c              |  13 +-
 target/i386/kvm/hyperv-proto.h |   6 +
 target/i386/kvm/kvm-stub.c     |   5 +
 target/i386/kvm/kvm.c          | 189 +++++++++++++++-------------
 target/i386/kvm/kvm_i386.h     |   1 +
 tests/qtest/hyperv-test.c      | 221 +++++++++++++++++++++++++++++++++
 tests/qtest/meson.build        |   3 +-
 9 files changed, 357 insertions(+), 91 deletions(-)
 create mode 100644 tests/qtest/hyperv-test.c
Signature · 1 line
2.31.1