Skip to content

RFC Expose GPU memory as coherently CPU accessible

[email protected] qemu-arm qemu-devel 1 version NAK

Status from this message: Nak, this means our kernel emulation of the BAR is broken, a BAR that

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 6 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/4qemu: add GPU memory information as objecthw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/pci.h +1 more+89 -01 reply
2/4qemu: patch guest SRAT for GPU memoryhw/arm/virt-acpi-build.c+54 -01 reply
3/4qemu: patch guest DSDT for GPU memoryhw/pci-host/gpex-acpi.c+71 -00 replies
4/4qemu: adjust queried bar size to power-of-2hw/vfio/common.c+1 -13 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC v1 0/4] Expose GPU memory as coherently CPU accessible

From: Ankit Agrawal <[email protected]>

NVIDIA is building systems which allows the CPU to coherently access GPU memory. This GPU device memory can be added and managed by the kernel memory manager. The patch holds the required changes in QEMU to expose this memory to the device assigned VMs.

The GPU device memory region is exposed as device BAR1 and QEMU mmaps to it. It then adds new proximity domains to represent the memory in the VM ACPI SRAT. This allows the device memory to be added as separate NUMA nodes inside the VM. The proximity domains (PXM) are passed to the VM using ACPI DSD properties to help VM kernel modules add the memory.

Current Linux cannot create NUMA nodes on the fly, hence creating enough NUMA nodes in ACPI is needed so that they are available at the VM bootup time. The physical platform firwmare provides 8 NUMA nodes, which QEMU is emulating here.

A new vfio-pci variant driver is added to manage the device memory and report as a BAR. Ongoing review of the corresponding kernel side changes along with the new vfio-pci variant driver.
Ref: https://lore.kernel.org/lkml/[email protected]/

Applied over v8.0.2.

Ankit Agrawal (4):
qemu: add GPU memory information as object
qemu: patch guest SRAT for GPU memory
qemu: patch guest DSDT for GPU memory
qemu: adjust queried bar size to power-of-2

 hw/arm/virt-acpi-build.c    | 54 ++++++++++++++++++++++++++++
 hw/pci-host/gpex-acpi.c     | 71 ++++++++++++++++++++++++++++++++++++
 hw/vfio/common.c            |  2 +-
 hw/vfio/pci-quirks.c        | 13 +++++++
 hw/vfio/pci.c               | 72 +++++++++++++++++++++++++++++++++++++
 hw/vfio/pci.h               |  1 +
 include/hw/pci/pci_device.h |  3 ++
 7 files changed, 215 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1