Appreciate any quick comments you have. This is v2 that I intend to publish on qemu lists. Main changes since v1 is adding support for protected VM.
=== Gunyah is an open-source Type-1 hypervisor, that is currently supported on ARM64 architecture. Source code for it can be obtained from: https://github.com/quic/gunyah-hypervisor This patch series adds support for Gunyah hypervisor via a new accelerator option, 'gunyah'. This patch series is based on the Linux kernel's Gunyah driver, which is being actively developed and not yet merged upstream [1, 2]. This patch series is thus *NOT YET READY* for merge. Early versions of this patch is being published to solicit comments from Qemu community. This patch has been tested with the open-source version of Gunyah hypervisor and using v14 Linux Gunyah driver [1]. Instructions to build hypervisor and test this patch are provided in this patch series. Changes in v2: * Extended ARM virt machine to support confidential guests * Extended CPU run loop to recognize VM shutdown Changes in v1: * Fixed SMP boot issues * Addressed comments received for previous version (v0) of the patches series Limitations: * Confidential guests (or protected VMs) are not yet supported by Linux Gunyah driver published upstream. I have tested it using a variant of the driver available in Android Common Kernel [3]. * Instructions provided to test with open-source Gunyah is based on v14 Gunyah driver [1]. Updated instruction that is based on v17 Gunyah driver will be provided later. Prior version, v1, of this patch can be referenced at: https://lists.nongnu.org/archive/html/qemu-devel/2024-01/msg01397.html Ref: 1. https://lore.kernel.org/lkml/20230613172054.3959700-1-quic_eber...@quicinc.com/ 2. https://lore.kernel.org/lkml/20240222-gunyah-v17-0-1e9da6763...@quicinc.com/ 3. https://android.googlesource.com/kernel/common/+/refs/heads/android14-6.1/drivers/virt/gunyah/ Base commit on which this series was tested: 4e66a08546 (origin/master, origin/HEAD) Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging Srivatsa Vaddagiri (12): gunyah: UAPI header (NOT FOR MERGE) accel: Introduce check_capability() callback hw/arm/virt: confidential guest support gunyah: Basic support gunyah: Support memory assignment gunyah: Add IRQFD and IOEVENTFD functions gunyah: Add gicv3 interrupt controller gunyah: Specific device-tree location gunyah: Customize device-tree gunyah: CPU execution loop gunyah: Workarounds (NOT FOR MERGE) gunyah: Documentation MAINTAINERS | 11 + docs/about/build-platforms.rst | 2 +- docs/system/arm/gunyah.rst | 326 +++++++++++++++ meson.build | 12 +- qapi/qom.json | 14 + include/hw/arm/virt.h | 1 + include/sysemu/accel-ops.h | 8 + include/sysemu/gunyah.h | 36 ++ include/sysemu/gunyah_int.h | 67 +++ linux-headers/linux/gunyah.h | 311 ++++++++++++++ accel/gunyah/gunyah-accel-ops.c | 128 ++++++ accel/gunyah/gunyah-all.c | 698 ++++++++++++++++++++++++++++++++ accel/stubs/gunyah-stub.c | 28 ++ hw/arm/boot.c | 17 +- hw/arm/virt.c | 173 +++++++- hw/intc/arm_gicv3_common.c | 3 + hw/intc/arm_gicv3_gunyah.c | 106 +++++ hw/intc/arm_gicv3_its_common.c | 3 + target/arm/cpu.c | 3 +- target/arm/cpu64.c | 5 +- target/arm/gunyah.c | 142 +++++++ accel/Kconfig | 3 + accel/gunyah/meson.build | 7 + accel/meson.build | 1 + accel/stubs/meson.build | 1 + hw/intc/meson.build | 1 + meson_options.txt | 2 + scripts/meson-buildoptions.sh | 3 + target/arm/meson.build | 3 + 29 files changed, 2107 insertions(+), 8 deletions(-) create mode 100644 docs/system/arm/gunyah.rst create mode 100644 include/sysemu/gunyah.h create mode 100644 include/sysemu/gunyah_int.h create mode 100644 linux-headers/linux/gunyah.h create mode 100644 accel/gunyah/gunyah-accel-ops.c create mode 100644 accel/gunyah/gunyah-all.c create mode 100644 accel/stubs/gunyah-stub.c create mode 100644 hw/intc/arm_gicv3_gunyah.c create mode 100644 target/arm/gunyah.c create mode 100644 accel/gunyah/meson.build -- 2.25.1