qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/27] Implementing a MSHV (Microsoft Hypervisor) accelerator
@ 2025-07-01 17:28 Magnus Kulke
  2025-07-01 17:28 ` [PATCH v2 01/27] accel: Add Meson and config support for MSHV accelerator Magnus Kulke
                   ` (27 more replies)
  0 siblings, 28 replies; 39+ messages in thread
From: Magnus Kulke @ 2025-07-01 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Cameron Esfahani, Phil Dennis-Jordan, Roman Bolshakov,
	Thomas Huth, Zhao Liu, Wei Liu, Paolo Bonzini, Wei Liu,
	Richard Henderson, Philippe Mathieu-Daudé, Markus Armbruster,
	Cornelia Huck, Magnus Kulke, Marc-André Lureau,
	Michael S. Tsirkin, Daniel P. Berrangé, Alex Bennée

Hey all,

This is the second revision of an accelerator implemented for the MSHV
kernel driver, exposing HyperV to Linux "Dom0" hosts. Thanks for the
helpful and quick feedback on the RFC patch. I attempted to address all
comments and we worked on fixing some of the limitation that we
identified in internal testing.

Best,

Magnus

Changelog:

v1 (RFC) => v2

- Addressed code review comments (style, consilidation).
- Rewrote the logic that handles overlap-in-userspace mappings to use
  a static list of slots, inspired by the HVF accelerator code.
- Fixed a bug that wrote corrupt payload in a MSHV_SET_MSI_ROUTING
  call, preventing vhost=on to work on tap network devices.
- Removed an erronous truncation of guest addresses to 32bit when
  registering ioeventfd's using MSHV_IOEVENTFD. This resulted in
  shadowing of low memory when ioevents were registered with
  addresses beyond the 4gb barrier and thus unexpected "unmapped gpa"
  vm exits in lower mem regions (impacting io performance).
- Fixed problem in which the MSI routing table was committed for KVM
  KVM instead of MSHV in virtio-pci bus initialization.
- Added some "mshv" strings to the documentation.
- The above fixes removed a few limitation present in the previous
  revision:
  - Guest with machine type "pc" are booting (testing is still mostly
    performed with q35)
  - Tap network devices can be used with vhost=on option.
  - Seabios can be used with >2.75G memory and multiple virtio-pci
    devices
  - I/O performance improvement as extranous MMIO vm exits are avoided
    by registering ioevents with a correct address.

Notes:

- Changes to the mshv kernel driver that would allow to map regions of
  userspace multiple times into the guest are still being discussed.
  For now commit #26 will work around this limitation.
- A kernel ioctl "set_immediate_exit" will be added to the mshv driver
  to avoid a race condition when handling signals (like ctrl-a x).

Magnus Kulke (27):
  accel: Add Meson and config support for MSHV accelerator
  target/i386/emulate: Allow instruction decoding from stream
  target/i386/mshv: Add x86 decoder/emu implementation
  hw/intc: Generalize APIC helper names from kvm_* to accel_*
  include/hw/hyperv: Add MSHV ABI header definitions
  accel/mshv: Add accelerator skeleton
  accel/mshv: Register memory region listeners
  accel/mshv: Initialize VM partition
  accel/mshv: Register guest memory regions with hypervisor
  accel/mshv: Add ioeventfd support
  accel/mshv: Add basic interrupt injection support
  accel/mshv: Add vCPU creation and execution loop
  accel/mshv: Add vCPU signal handling
  target/i386/mshv: Add CPU create and remove logic
  target/i386/mshv: Implement mshv_store_regs()
  target/i386/mshv: Implement mshv_get_standard_regs()
  target/i386/mshv: Implement mshv_get_special_regs()
  target/i386/mshv: Implement mshv_arch_put_registers()
  target/i386/mshv: Set local interrupt controller state
  target/i386/mshv: Register CPUID entries with MSHV
  target/i386/mshv: Register MSRs with MSHV
  target/i386/mshv: Integrate x86 instruction decoder/emulator
  target/i386/mshv: Write MSRs to the hypervisor
  target/i386/mshv: Implement mshv_vcpu_run()
  target/i386/mshv: Handle HVMSG_X64_HALT vm exit
  accel/mshv: Workaround for overlappig mem mappings
  docs: Add mshv to documentation

 accel/Kconfig                    |    3 +
 accel/accel-irq.c                |   95 ++
 accel/meson.build                |    3 +-
 accel/mshv/irq.c                 |  369 +++++++
 accel/mshv/mem.c                 |  415 ++++++++
 accel/mshv/meson.build           |    9 +
 accel/mshv/mshv-all.c            |  727 +++++++++++++
 accel/mshv/msr.c                 |  372 +++++++
 accel/mshv/trace-events          |   29 +
 accel/mshv/trace.h               |    1 +
 docs/devel/codebase.rst          |    2 +-
 hw/intc/apic.c                   |    9 +
 hw/intc/ioapic.c                 |   20 +-
 hw/virtio/virtio-pci.c           |   21 +-
 include/hw/hyperv/hvgdk.h        |   19 +
 include/hw/hyperv/hvhdk.h        |  164 +++
 include/hw/hyperv/hvhdk_mini.h   |  105 ++
 include/system/accel-irq.h       |   26 +
 include/system/mshv.h            |  184 ++++
 linux-headers/linux/mshv.h       | 1038 ++++++++++++++++++
 meson.build                      |   11 +
 meson_options.txt                |    2 +
 qemu-options.hx                  |   16 +-
 scripts/meson-buildoptions.sh    |    3 +
 scripts/update-linux-headers.sh  |    2 +-
 target/i386/cpu.h                |    4 +-
 target/i386/emulate/meson.build  |    7 +-
 target/i386/emulate/x86_decode.c |   31 +-
 target/i386/emulate/x86_decode.h |   10 +
 target/i386/emulate/x86_emu.c    |    3 +-
 target/i386/emulate/x86_emu.h    |    1 +
 target/i386/meson.build          |    2 +
 target/i386/mshv/meson.build     |    8 +
 target/i386/mshv/mshv-cpu.c      | 1699 ++++++++++++++++++++++++++++++
 target/i386/mshv/x86.c           |  297 ++++++
 35 files changed, 5671 insertions(+), 36 deletions(-)
 create mode 100644 accel/accel-irq.c
 create mode 100644 accel/mshv/irq.c
 create mode 100644 accel/mshv/mem.c
 create mode 100644 accel/mshv/meson.build
 create mode 100644 accel/mshv/mshv-all.c
 create mode 100644 accel/mshv/msr.c
 create mode 100644 accel/mshv/trace-events
 create mode 100644 accel/mshv/trace.h
 create mode 100644 include/hw/hyperv/hvgdk.h
 create mode 100644 include/hw/hyperv/hvhdk.h
 create mode 100644 include/hw/hyperv/hvhdk_mini.h
 create mode 100644 include/system/accel-irq.h
 create mode 100644 include/system/mshv.h
 create mode 100644 linux-headers/linux/mshv.h
 create mode 100644 target/i386/mshv/meson.build
 create mode 100644 target/i386/mshv/mshv-cpu.c
 create mode 100644 target/i386/mshv/x86.c

-- 
2.34.1



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-07-02 13:49 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 17:28 [PATCH v2 00/27] Implementing a MSHV (Microsoft Hypervisor) accelerator Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 01/27] accel: Add Meson and config support for MSHV accelerator Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 02/27] target/i386/emulate: Allow instruction decoding from stream Magnus Kulke
2025-07-02  4:41   ` Wei Liu
2025-07-01 17:28 ` [PATCH v2 03/27] target/i386/mshv: Add x86 decoder/emu implementation Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 04/27] hw/intc: Generalize APIC helper names from kvm_* to accel_* Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 05/27] include/hw/hyperv: Add MSHV ABI header definitions Magnus Kulke
2025-07-02  9:11   ` Cornelia Huck
2025-07-02 10:11     ` Magnus Kulke
2025-07-02 10:32       ` Cornelia Huck
2025-07-02 13:48         ` Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 06/27] accel/mshv: Add accelerator skeleton Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 07/27] accel/mshv: Register memory region listeners Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 08/27] accel/mshv: Initialize VM partition Magnus Kulke
2025-07-02  4:45   ` Wei Liu
2025-07-01 17:28 ` [PATCH v2 09/27] accel/mshv: Register guest memory regions with hypervisor Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 10/27] accel/mshv: Add ioeventfd support Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 11/27] accel/mshv: Add basic interrupt injection support Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 12/27] accel/mshv: Add vCPU creation and execution loop Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 13/27] accel/mshv: Add vCPU signal handling Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 14/27] target/i386/mshv: Add CPU create and remove logic Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 15/27] target/i386/mshv: Implement mshv_store_regs() Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 16/27] target/i386/mshv: Implement mshv_get_standard_regs() Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 17/27] target/i386/mshv: Implement mshv_get_special_regs() Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 18/27] target/i386/mshv: Implement mshv_arch_put_registers() Magnus Kulke
2025-07-02  4:46   ` Wei Liu
2025-07-01 17:28 ` [PATCH v2 19/27] target/i386/mshv: Set local interrupt controller state Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 20/27] target/i386/mshv: Register CPUID entries with MSHV Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 21/27] target/i386/mshv: Register MSRs " Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 22/27] target/i386/mshv: Integrate x86 instruction decoder/emulator Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 23/27] target/i386/mshv: Write MSRs to the hypervisor Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 24/27] target/i386/mshv: Implement mshv_vcpu_run() Magnus Kulke
2025-07-02  5:30   ` Wei Liu
2025-07-01 17:28 ` [PATCH v2 25/27] target/i386/mshv: Handle HVMSG_X64_HALT vm exit Magnus Kulke
2025-07-01 17:39   ` Magnus Kulke
2025-07-01 17:28 ` [PATCH v2 26/27] accel/mshv: Workaround for overlappig mem mappings Magnus Kulke
2025-07-01 18:22   ` Philippe Mathieu-Daudé
2025-07-01 17:28 ` [PATCH v2 27/27] docs: Add mshv to documentation Magnus Kulke
2025-07-02  5:35 ` [PATCH v2 00/27] Implementing a MSHV (Microsoft Hypervisor) accelerator Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).