[RFC PATCH 00/10] QEMU Support for KVM Planes

Jörg Rödel posted 10 patches 8 hours ago
Failed in applying to current master (apply log)
accel/accel-system.c                          |  13 +
accel/kvm/kvm-all.c                           | 247 ++++++++--
accel/kvm/trace-events                        |   2 +
dtc                                           |   1 +
hw/core/machine.c                             |  22 +
hw/core/qdev.c                                |  26 +
hw/i386/kvm/apic.c                            |   6 +-
hw/pci/msi.c                                  |   3 +
hw/pci/msix.c                                 |   3 +
include/accel/accel-ops.h                     |   3 +
include/hw/core/boards.h                      |   3 +
include/hw/core/cpu.h                         |  17 +-
include/hw/core/qdev.h                        |   5 +
include/hw/pci/msi.h                          |   1 +
include/qemu/accel.h                          |   7 +
include/standard-headers/drm/drm_fourcc.h     |  28 +-
include/standard-headers/linux/const.h        |  18 +
include/standard-headers/linux/ethtool.h      |  28 +-
.../linux/input-event-codes.h                 |  13 +
include/standard-headers/linux/pci_regs.h     |  71 ++-
include/standard-headers/linux/typelimits.h   |   8 +
include/standard-headers/linux/virtio_ring.h  |   3 +-
include/standard-headers/linux/virtio_rtc.h   | 237 ++++++++++
include/standard-headers/linux/vmclock-abi.h  |  20 +
include/system/kvm.h                          |   7 +
include/system/kvm_int.h                      |  30 +-
linux-headers/asm-arm64/kvm.h                 |   1 +
linux-headers/asm-arm64/unistd_64.h           |   1 +
linux-headers/asm-generic/unistd.h            |   5 +-
linux-headers/asm-loongarch/kvm.h             |   5 +
linux-headers/asm-loongarch/kvm_para.h        |   1 +
linux-headers/asm-loongarch/unistd_64.h       |   2 +
linux-headers/asm-mips/unistd_n32.h           |   1 +
linux-headers/asm-mips/unistd_n64.h           |   1 +
linux-headers/asm-mips/unistd_o32.h           |   1 +
linux-headers/asm-powerpc/unistd_32.h         |   1 +
linux-headers/asm-powerpc/unistd_64.h         |   1 +
linux-headers/asm-riscv/kvm.h                 |  11 +-
linux-headers/asm-riscv/ptrace.h              |  37 ++
linux-headers/asm-riscv/unistd_32.h           |   1 +
linux-headers/asm-riscv/unistd_64.h           |   1 +
linux-headers/asm-s390/unistd_32.h            | 446 ------------------
linux-headers/asm-s390/unistd_64.h            |   1 +
linux-headers/asm-x86/kvm.h                   |  21 +-
linux-headers/asm-x86/unistd_32.h             |   1 +
linux-headers/asm-x86/unistd_64.h             |   1 +
linux-headers/asm-x86/unistd_x32.h            |   1 +
linux-headers/linux/const.h                   |  18 +
linux-headers/linux/iommufd.h                 |  48 ++
linux-headers/linux/kvm.h                     |  64 ++-
linux-headers/linux/mshv.h                    |   4 +-
linux-headers/linux/psp-sev.h                 |   2 +-
linux-headers/linux/stddef.h                  |   4 +
linux-headers/linux/vduse.h                   |  85 +++-
linux-headers/linux/vfio.h                    |  30 +-
target/arm/kvm.c                              |   2 +-
target/i386/kvm/kvm.c                         |  57 +++
tests/unit/test-qdev-global-props.c           |   5 +
tests/unit/test-qdev.c                        |   5 +
ui/keycodemapdb                               |   1 +
60 files changed, 1150 insertions(+), 538 deletions(-)
create mode 160000 dtc
create mode 100644 include/standard-headers/linux/typelimits.h
create mode 100644 include/standard-headers/linux/virtio_rtc.h
delete mode 100644 linux-headers/asm-s390/unistd_32.h
create mode 160000 ui/keycodemapdb
[RFC PATCH 00/10] QEMU Support for KVM Planes
Posted by Jörg Rödel 8 hours ago
From: Joerg Roedel <joerg.roedel@amd.com>

Hi,

here are the required QEMU changes to make use of the KVM Planes
interface posted here[1].

The patches are based on QEMU v11.0.0 and can be used to launch an AMD
SEV-SNP VM with COCONUT-SVSM + a Linux guest.

To make this work a change to the QEMU command line is required to
tell QEMU which plane to target external IRQs to. this is done with
the new device-plane property to the machine specification, e.g:

$ qemu-system-x86_64 \
  -enable-kvm \
  -cpu EPYC-v4 \
  -machine q35,confidential-guest-support=sev0,memory-backend=ram1,igvm-cfg=igvm0,kernel-irqchip=split,device-plane=2 \
  -object memory-backend-memfd,id=ram1,size=32G,share=true \
  -object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
  -object igvm-cfg,id=igvm0,file=$IGVM_FILE \
  ...

Any feedback appreciated.

-Joerg

[1] https://lore.kernel.org/kvm/20260608144252.351443-1-joro@8bytes.org/T/#t

Joerg Roedel (10):
  Update Linux Header for KVM Planes Support
  accel/kvm: Extend KVMState to carry fds for planes
  accel/kvm: Extend CPUState to handle Planes
  accel: Add nr_planes() op
  accel/kvm: Support nr_planes call-back
  accel/kvm: Handle KVM_PLANE_EVENT_CREATE_CPU event
  hw/core/machine: Add device-plane property
  qdev: Add plane property
  MSI: Inject into correct plane
  KVM: Set GSI routes for default plane

 accel/accel-system.c                          |  13 +
 accel/kvm/kvm-all.c                           | 247 ++++++++--
 accel/kvm/trace-events                        |   2 +
 dtc                                           |   1 +
 hw/core/machine.c                             |  22 +
 hw/core/qdev.c                                |  26 +
 hw/i386/kvm/apic.c                            |   6 +-
 hw/pci/msi.c                                  |   3 +
 hw/pci/msix.c                                 |   3 +
 include/accel/accel-ops.h                     |   3 +
 include/hw/core/boards.h                      |   3 +
 include/hw/core/cpu.h                         |  17 +-
 include/hw/core/qdev.h                        |   5 +
 include/hw/pci/msi.h                          |   1 +
 include/qemu/accel.h                          |   7 +
 include/standard-headers/drm/drm_fourcc.h     |  28 +-
 include/standard-headers/linux/const.h        |  18 +
 include/standard-headers/linux/ethtool.h      |  28 +-
 .../linux/input-event-codes.h                 |  13 +
 include/standard-headers/linux/pci_regs.h     |  71 ++-
 include/standard-headers/linux/typelimits.h   |   8 +
 include/standard-headers/linux/virtio_ring.h  |   3 +-
 include/standard-headers/linux/virtio_rtc.h   | 237 ++++++++++
 include/standard-headers/linux/vmclock-abi.h  |  20 +
 include/system/kvm.h                          |   7 +
 include/system/kvm_int.h                      |  30 +-
 linux-headers/asm-arm64/kvm.h                 |   1 +
 linux-headers/asm-arm64/unistd_64.h           |   1 +
 linux-headers/asm-generic/unistd.h            |   5 +-
 linux-headers/asm-loongarch/kvm.h             |   5 +
 linux-headers/asm-loongarch/kvm_para.h        |   1 +
 linux-headers/asm-loongarch/unistd_64.h       |   2 +
 linux-headers/asm-mips/unistd_n32.h           |   1 +
 linux-headers/asm-mips/unistd_n64.h           |   1 +
 linux-headers/asm-mips/unistd_o32.h           |   1 +
 linux-headers/asm-powerpc/unistd_32.h         |   1 +
 linux-headers/asm-powerpc/unistd_64.h         |   1 +
 linux-headers/asm-riscv/kvm.h                 |  11 +-
 linux-headers/asm-riscv/ptrace.h              |  37 ++
 linux-headers/asm-riscv/unistd_32.h           |   1 +
 linux-headers/asm-riscv/unistd_64.h           |   1 +
 linux-headers/asm-s390/unistd_32.h            | 446 ------------------
 linux-headers/asm-s390/unistd_64.h            |   1 +
 linux-headers/asm-x86/kvm.h                   |  21 +-
 linux-headers/asm-x86/unistd_32.h             |   1 +
 linux-headers/asm-x86/unistd_64.h             |   1 +
 linux-headers/asm-x86/unistd_x32.h            |   1 +
 linux-headers/linux/const.h                   |  18 +
 linux-headers/linux/iommufd.h                 |  48 ++
 linux-headers/linux/kvm.h                     |  64 ++-
 linux-headers/linux/mshv.h                    |   4 +-
 linux-headers/linux/psp-sev.h                 |   2 +-
 linux-headers/linux/stddef.h                  |   4 +
 linux-headers/linux/vduse.h                   |  85 +++-
 linux-headers/linux/vfio.h                    |  30 +-
 target/arm/kvm.c                              |   2 +-
 target/i386/kvm/kvm.c                         |  57 +++
 tests/unit/test-qdev-global-props.c           |   5 +
 tests/unit/test-qdev.c                        |   5 +
 ui/keycodemapdb                               |   1 +
 60 files changed, 1150 insertions(+), 538 deletions(-)
 create mode 160000 dtc
 create mode 100644 include/standard-headers/linux/typelimits.h
 create mode 100644 include/standard-headers/linux/virtio_rtc.h
 delete mode 100644 linux-headers/asm-s390/unistd_32.h
 create mode 160000 ui/keycodemapdb

-- 
2.53.0
Re: [RFC PATCH 00/10] QEMU Support for KVM Planes
Posted by Daniel P. Berrangé 8 hours ago
On Mon, Jun 08, 2026 at 05:20:59PM +0200, Jörg Rödel wrote:
> From: Joerg Roedel <joerg.roedel@amd.com>
> 
> Hi,
> 
> here are the required QEMU changes to make use of the KVM Planes
> interface posted here[1].
> 
> The patches are based on QEMU v11.0.0 and can be used to launch an AMD
> SEV-SNP VM with COCONUT-SVSM + a Linux guest.
> 
> To make this work a change to the QEMU command line is required to
> tell QEMU which plane to target external IRQs to. this is done with
> the new device-plane property to the machine specification, e.g:
> 
> $ qemu-system-x86_64 \
>   -enable-kvm \
>   -cpu EPYC-v4 \
>   -machine q35,confidential-guest-support=sev0,memory-backend=ram1,igvm-cfg=igvm0,kernel-irqchip=split,device-plane=2 \
>   -object memory-backend-memfd,id=ram1,size=32G,share=true \
>   -object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1 \
>   -object igvm-cfg,id=igvm0,file=$IGVM_FILE \
>   ...

How are device-plane values intended to be chosen by the user ?

Is "2" a value that can/should always be used, or is there a dependency
on the igvm file, or somethihng else ?


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Re: [RFC PATCH 00/10] QEMU Support for KVM Planes
Posted by Jörg Rödel 8 hours ago
Hi Daniel,

On Mon, Jun 08, 2026 at 04:40:12PM +0100, Daniel P. Berrangé wrote:
> How are device-plane values intended to be chosen by the user ?
> 
> Is "2" a value that can/should always be used, or is there a dependency
> on the igvm file, or somethihng else ?

Currently it is based on how COCONUT in the IGVM file it built. It will launch
the Linux guest at plane 2, so all IRQs must go to plane 2 as well. For the
future we are considering passing the device-plane value to the SVSM so it can
decide on which plane to run Linux based on that value.

-Joerg