Skip to content

RFC Hyper-V / VMBus

Roman Kagan qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest34 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34hyperv: ensure VP index equal to QEMU cpu_indextarget/i386/hyperv.c target/i386/hyperv.h target/i386/kvm.c+68 -40 replies
2/34hyperv_testdev: refactor for readabilityhw/misc/hyperv_testdev.c+53 -610 replies
3/34hyperv: cosmetic: g_malloc -> g_newtarget/i386/hyperv.c+1 -10 replies
4/34hyperv: synic: only setup ack notifier if there's a callbacktarget/i386/hyperv.c+19 -140 replies
5/34hyperv: allow passing arbitrary data to sint ack callbackhw/misc/hyperv_testdev.c target/i386/hyperv.c target/i386/hyperv.h+18 -140 replies
6/34hyperv: address HvSintRoute by X86CPU pointertarget/i386/hyperv.c+8 -20 replies
7/34hyperv: make HvSintRoute reference-countedhw/misc/hyperv_testdev.c target/i386/hyperv.c target/i386/hyperv.h+28 -110 replies
8/34hyperv: qom-ify SynICtarget/i386/hyperv.c target/i386/hyperv.h target/i386/kvm.c +1 more+134 -43 replies
9/34hyperv: block SynIC use in QEMU in incompatible configurationsinclude/hw/i386/pc.h target/i386/hyperv.c target/i386/hyperv.h +1 more+80 -72 replies
10/34hyperv: make overlay pages for SynICtarget/i386/hyperv.c+64 -60 replies
11/34hyperv: add synic message deliverytarget/i386/hyperv.c target/i386/hyperv.h+111 -143 replies
12/34hyperv: add synic event flag signalingtarget/i386/hyperv.c target/i386/hyperv.h+34 -03 replies
13/34hyperv: process SIGNAL_EVENT hypercalltarget/i386/hyperv.c target/i386/hyperv.h+111 -40 replies
14/34hyperv: process POST_MESSAGE hypercalltarget/i386/hyperv.c target/i386/hyperv.h+92 -00 replies
15/34hyperv_testdev: add SynIC message and event testmodeshw/misc/hyperv_testdev.c+161 -10 replies
16/34hyperv: update copyright noticeshw/misc/hyperv_testdev.c target/i386/hyperv.c target/i386/hyperv.h+3 -00 replies
17/34import HYPERV_EVENTFD stuff from kernellinux-headers/linux/kvm.h+14 -00 replies
18/34hyperv: add support for KVM_HYPERV_EVENTFDaccel/kvm/kvm-all.c include/sysemu/kvm.h target/i386/hyperv.c+36 -13 replies
19/34vmbus: add vmbus protocol definitionsinclude/hw/vmbus/vmbus-proto.h+222 -01 reply
20/34vmbus: vmbus implementationMakefile.objs hw/vmbus/Makefile.objs hw/vmbus/trace-events +2 more+2552 -01 reply
21/34vmbus: build configurationconfigure hw/Makefile.objs+12 -03 replies
22/34i386: Hyper-V VMBus ACPI DSDT entryhw/i386/acpi-build.c+42 -02 replies
23/34i386: en/disable vmbus by a machine propertyhw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +2 more+51 -01 reply
24/34scsi: add Hyper-V/VMBus SCSI protocol definitionshw/scsi/hvscsi-proto.h+150 -00 replies
25/34scsi: add Hyper-V/VMBus SCSI controllerhw/scsi/Makefile.objs hw/scsi/hv-scsi.c hw/scsi/trace-events+406 -03 replies
26/34hv-scsi: limit the number of requests per notificationhw/scsi/hv-scsi.c+6 -10 replies
27/34tests: hv-scsi: add start-stop testtests/Makefile.include tests/hv-scsi-test.c+60 -02 replies
28/34net: add RNDIS definitionshw/net/rndis.h+391 -01 reply
29/34net: add Hyper-V/VMBus network protocol definitionshw/net/hvnet-proto.h+1161 -03 replies
30/34net: add Hyper-V/VMBus net adapterhw/net/Makefile.objs hw/net/hv-net.c+1442 -00 replies
31/34hv-net: add .bootindex supporthw/net/hv-net.c+9 -00 replies
32/34loader: allow arbitrary basename for fw_cfg file romshw/core/loader.c include/hw/loader.h+22 -231 reply
33/34vmbus: add support for rom fileshw/vmbus/vmbus.c include/hw/vmbus/vmbus.h+42 -02 replies
34/34hv-net: define default rom file namehw/net/hv-net.c+1 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [Qemu-devel] [RFC PATCH 00/34] Hyper-V / VMBus

This is a work-in-progress series with Hyper-V / VMBus device emulation. It's still very raw but it's testable so I'd appreciate feedback on whether the design is sound.

This stuff can also be seen at https://src.openvz.org/scm/up/qemu.git.

Current status of the components included:

* Hyper-V infrastructure (SynIC, VP_INDEX, events & messages, etc):
- works, mostly submission-ready but needs addressing some issues

* VMBus infrastructure (types, vmbus state machine, channel communication, etc):
- works in main scenarios

* SCSI controller:
- works in main scenarios
- supports multiqueue
- iothread-unaware
- performance competitive to virtio-scsi [*]
- can be used for booting [**]

* network interface:
- basic operation only
- no mac filtering
- no offloads
- no multiqueue
- can be used for booting with limitations [***]

Overall, it's in bad need for documentation, tests, proper patch split. Migration works but only tested very lightly.

[*] basic measurements with fio rw=randread bs=4k iodepth=256 using
null-co backend give
o Windows guests: hv-scsi 10%-30% better than virtio-scsi
o Linux guests: hv-scsi 10%-20% worse than virtio-scsi No performance analysis has been done yet.

[**] patches for SeaBIOS and OVMF can be found at

     https://src.openvz.org/scm/up/seabios.git and
     https://src.openvz.org/scm/up/edk2.git

[***] patches for iPXE can be found at
https://src.openvz.org/scm/up/ipxe.git, limitations:
- OVMF is yet unsupported
- iPXE takes over VMBus state management from SeaBIOS so after iPXE failure to boot off hv-net booting off hv-scsi doesn't work

Prerequisites:
- KVM 4.14+
- HYPERV_EVENTFD support (in kvm/queue) is optional but recommended for better performance

How to use:

# qemu \
    ... \
    -machine ...,accel=kvm,vmbus \
    -cpu ...,hv_vpindex,hv_synic,hv_stimer,(other hv_* recommended),kvm=off \
    -nodefaults \
    ...
    -device hv-scsi,(usual scsi props),(instanceid=<uuid> optional) \
    -drive ... \
    -device scsi-hd,... \
    ...
    -netdev ... \
    -device hv-net,(usual net props),(instanceid=<uuid> optional) \
    ...

Big kudos to Andrey Smetanin and Evgeny Yakovlev for their research and prototyping.

Andrey Smetanin (1):
i386: Hyper-V VMBus ACPI DSDT entry

Evgeny Yakovlev (1):
vmbus: build configuration

Roman Kagan (32):
hyperv: ensure VP index equal to QEMU cpu_index
hyperv_testdev: refactor for readability
hyperv: cosmetic: g_malloc -> g_new
hyperv: synic: only setup ack notifier if there's a callback
hyperv: allow passing arbitrary data to sint ack callback
hyperv: address HvSintRoute by X86CPU pointer
hyperv: make HvSintRoute reference-counted
hyperv: qom-ify SynIC
hyperv: block SynIC use in QEMU in incompatible configurations
hyperv: make overlay pages for SynIC
hyperv: add synic message delivery
hyperv: add synic event flag signaling
hyperv: process SIGNAL_EVENT hypercall
hyperv: process POST_MESSAGE hypercall
hyperv_testdev: add SynIC message and event testmodes
hyperv: update copyright notices
[not to commit] import HYPERV_EVENTFD stuff from kernel
hyperv: add support for KVM_HYPERV_EVENTFD
vmbus: add vmbus protocol definitions
vmbus: vmbus implementation
i386: en/disable vmbus by a machine property
scsi: add Hyper-V/VMBus SCSI protocol definitions
scsi: add Hyper-V/VMBus SCSI controller
hv-scsi: limit the number of requests per notification
tests: hv-scsi: add start-stop test
net: add RNDIS definitions
net: add Hyper-V/VMBus network protocol definitions
net: add Hyper-V/VMBus net adapter
hv-net: add .bootindex support
loader: allow arbitrary basename for fw_cfg file roms
vmbus: add support for rom files
hv-net: define default rom file name

 configure                      |   11 +
 Makefile.objs                  |    1 +
 hw/net/hvnet-proto.h           | 1161 +++++++++++++++++++
 hw/net/rndis.h                 |  391 +++++++
 hw/scsi/hvscsi-proto.h         |  150 +++
 include/hw/i386/pc.h           |    8 +
 include/hw/loader.h            |    2 +-
 include/hw/vmbus/vmbus-proto.h |  222 ++++
 include/hw/vmbus/vmbus.h       |  109 ++
 include/sysemu/kvm.h           |    1 +
 linux-headers/linux/kvm.h      |   14 +
 target/i386/hyperv.h           |   40 +-
 accel/kvm/kvm-all.c            |   15 +
 hw/core/loader.c               |   43 +-
 hw/i386/acpi-build.c           |   42 +
 hw/i386/pc.c                   |   34 +
 hw/i386/pc_piix.c              |    5 +
 hw/i386/pc_q35.c               |    5 +
 hw/misc/hyperv_testdev.c       |  267 ++++-
 hw/net/hv-net.c                | 1450 +++++++++++++++++++++++
 hw/scsi/hv-scsi.c              |  403 +++++++
 hw/vmbus/vmbus.c               | 2475 ++++++++++++++++++++++++++++++++++++++++
 target/i386/hyperv.c           |  681 ++++++++++-
 target/i386/kvm.c              |   63 +-
 target/i386/machine.c          |    9 +
 tests/hv-scsi-test.c           |   57 +
 util/qemu-config.c             |    4 +
 hw/Makefile.objs               |    1 +
 hw/net/Makefile.objs           |    2 +
 hw/scsi/Makefile.objs          |    2 +
 hw/scsi/trace-events           |    6 +
 hw/vmbus/Makefile.objs         |    1 +
 hw/vmbus/trace-events          |    8 +
 tests/Makefile.include         |    3 +
 34 files changed, 7561 insertions(+), 125 deletions(-)
 create mode 100644 hw/net/hvnet-proto.h
 create mode 100644 hw/net/rndis.h
 create mode 100644 hw/scsi/hvscsi-proto.h
 create mode 100644 include/hw/vmbus/vmbus-proto.h
 create mode 100644 include/hw/vmbus/vmbus.h
 create mode 100644 hw/net/hv-net.c
 create mode 100644 hw/scsi/hv-scsi.c
 create mode 100644 hw/vmbus/vmbus.c
 create mode 100644 tests/hv-scsi-test.c
 create mode 100644 hw/vmbus/Makefile.objs
 create mode 100644 hw/vmbus/trace-events
Signature · 1 line
2.14.3