[PATCH v4 00/15] Add ARM64 support for MSHV accelerator

Aastha Rawat posted 15 patches 3 days, 11 hours ago
Failed in applying to current master (apply log)
MAINTAINERS                        |   8 +
accel/mshv/irq.c                   |   2 +
accel/mshv/meson.build             |   4 +-
accel/mshv/mshv-all.c              |  26 +-
accel/mshv/mshv-cpu-common.c       | 151 ++++++++++
hw/arm/virt.c                      |  15 +-
hw/intc/arm_gicv3_common.c         |   6 +-
hw/intc/arm_gicv3_mshv.c           | 181 ++++++++++++
hw/intc/meson.build                |   1 +
include/hw/hyperv/hvgdk_mini.h     | 130 +++++++++
include/hw/hyperv/hvhdk.h          | 101 ++++++-
include/hw/hyperv/hvhdk_mini.h     |   6 +
include/hw/intc/arm_gicv3_common.h |   2 +-
include/system/hw_accel.h          |   3 +-
include/system/mshv.h              |   2 +
include/system/mshv_int.h          |   6 +-
meson.build                        |   8 +-
target/arm/cpu.c                   |   8 +-
target/arm/cpu64.c                 |  27 +-
target/arm/helper.c                |  62 ++++
target/arm/helper.h                |  16 ++
target/arm/hvf/hvf.c               |  57 ++--
target/arm/meson.build             |   1 +
target/arm/mshv/meson.build        |   7 +
target/arm/mshv/mshv-all.c         | 572 +++++++++++++++++++++++++++++++++++++
target/arm/mshv_arm.h              |  18 ++
target/arm/syndrome.h              |  47 +++
target/arm/whpx/whpx-all.c         |  41 ++-
target/i386/mshv/meson.build       |   2 +
target/i386/mshv/mshv-all.c        |  85 ++++++
target/i386/mshv/mshv-cpu.c        | 170 +----------
{accel => target/i386}/mshv/msr.c  |   0
32 files changed, 1505 insertions(+), 260 deletions(-)
[PATCH v4 00/15] Add ARM64 support for MSHV accelerator
Posted by Aastha Rawat 3 days, 11 hours ago
This series adds ARM64 guest support to the MSHV (Microsoft Hypervisor)
accelerator, enabling QEMU to run aarch64 VMs on Microsoft's hypervisor
using the mshv Linux kernel module.

The first few patches refactor the existing x86 MSHV code to separate
arch-specific pieces from common infrastructure: moving MSR handling to
target/i386, extracting shared register hypercall helpers, provisioning
host CPU features, and introducing arch-specific init hooks.

The remaining patches add the ARM64 backend:
 - vCPU state get/set using hypervisor register hypercalls
 - -cpu host support by querying ID registers from the hypervisor
 - vCPU run loop with MMIO emulation via ESR_EL2 syndrome decoding
 - In-kernel vGICv3 backed by HVCALL_ASSERT_VIRTUAL_INTERRUPT
 - Interrupt control structure adjustments for arm64

With this series, a standard aarch64 virt machine can be launched with:
  qemu-system-aarch64 -accel mshv -cpu host -M virt ...

Caveats:
- Live migration is not yet supported.

---
Changes in v2:
- Removed PATCH: "accel/mshv: provision guests with the same features as host".
- Extracted common MMIO emulation logic for hvf, whpx and mshv to a
  common place.
- Fixed checkpatch errors/warnings.
- Picked up reviewed-by tags.
- Link to v1: https://lore.kernel.org/qemu-devel/20260311-mshv_accel_arm64_supp-v1-0-c31699b7bc1f@anirudhrb.com

---
Changes in v3:
- Handled GPA Intercept in vCPU run loop to fix EDK2 firmware boot.
- Updated the cover letter: removed caveat about EDK2 firmware boot as
  it is now fixed.
- Link to v2: https://lore.kernel.org/qemu-devel/20260402-mshv_accel_arm64_supp-v2-0-754895c15e9e@linux.microsoft.com/

---
Changes in v4:
- Split "target/arm: convert host CPU features ifdef ladder to runtime
  checks" out of the -cpu host patch to separate the refactoring.
- Refactored MMIO emulation helper (arm_emulate_mmio) to use callback
  ops for per-register access avoiding full CPU state sync for single
  register MMIo operations for HVF & WHPX.
- Reordered patches: moved "arch-specific accelerator init hook" earlier
  (patch 3), before the arm64 build enablenment.
- Updated cpu_thread_is_idle() comment to be arch-neutral.
- Link to v3: https://lore.kernel.org/qemu-devel/20260421-mshv_accel_arm64_supp-v3-0-469f544778ba@linux.microsoft.com

---
Aastha Rawat (9):
      accel/mshv: move msr.c to target/i386
      accel/mshv: extract common CPU register helpers
      meson, target/arm/mshv: Enable arm64 build & add initial MSHV support
      target/arm/mshv: implement vcpu state operations for ARM64
      target/arm: convert host CPU feature ifdef ladder to runtime checks
      target/arm/mshv: implement -cpu host for MSHV
      accel/mshv: Add access_vp_regs synthetic proc features
      target/arm: cpu: Mark MSHV supporting PSCI 1.3
      target/arm: extract MMIO emulation logic for HVF & WHPX

Anirudh Rayabharam (Microsoft) (5):
      accel/mshv: add arch-specific accelerator init hook
      target/arm/mshv: add vCPU run loop
      include/hw/hyperv: adjust hv_interrupt_control structure for arm64
      hw/intc,target/arm/mshv: add MSHV vGICv3 implementation
      MAINTAINERS: updates for MSHV arm64 code

Magnus Kulke (1):
      accel/mshv: implement cpu_thread_is_idle() hook

 MAINTAINERS                        |   8 +
 accel/mshv/irq.c                   |   2 +
 accel/mshv/meson.build             |   4 +-
 accel/mshv/mshv-all.c              |  26 +-
 accel/mshv/mshv-cpu-common.c       | 151 ++++++++++
 hw/arm/virt.c                      |  15 +-
 hw/intc/arm_gicv3_common.c         |   6 +-
 hw/intc/arm_gicv3_mshv.c           | 181 ++++++++++++
 hw/intc/meson.build                |   1 +
 include/hw/hyperv/hvgdk_mini.h     | 130 +++++++++
 include/hw/hyperv/hvhdk.h          | 101 ++++++-
 include/hw/hyperv/hvhdk_mini.h     |   6 +
 include/hw/intc/arm_gicv3_common.h |   2 +-
 include/system/hw_accel.h          |   3 +-
 include/system/mshv.h              |   2 +
 include/system/mshv_int.h          |   6 +-
 meson.build                        |   8 +-
 target/arm/cpu.c                   |   8 +-
 target/arm/cpu64.c                 |  27 +-
 target/arm/helper.c                |  62 ++++
 target/arm/helper.h                |  16 ++
 target/arm/hvf/hvf.c               |  57 ++--
 target/arm/meson.build             |   1 +
 target/arm/mshv/meson.build        |   7 +
 target/arm/mshv/mshv-all.c         | 572 +++++++++++++++++++++++++++++++++++++
 target/arm/mshv_arm.h              |  18 ++
 target/arm/syndrome.h              |  47 +++
 target/arm/whpx/whpx-all.c         |  41 ++-
 target/i386/mshv/meson.build       |   2 +
 target/i386/mshv/mshv-all.c        |  85 ++++++
 target/i386/mshv/mshv-cpu.c        | 170 +----------
 {accel => target/i386}/mshv/msr.c  |   0
 32 files changed, 1505 insertions(+), 260 deletions(-)
---
base-commit: 554cbfb1cf4601d2762f5315c884319e361b24cb
change-id: 20260311-mshv_accel_arm64_supp-e86b0082aee4

Best regards,
--  
Aastha Rawat <aastharawat@linux.microsoft.com>