qemu/hw
Phil Dennis-Jordan 2352159c97 hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support
MacOS provides a framework (library) that allows any vmm to implement a
paravirtualized 3d graphics passthrough to the host metal stack called
ParavirtualizedGraphics.Framework (PVG). The library abstracts away
almost every aspect of the paravirtualized device model and only provides
and receives callbacks on MMIO access as well as to share memory address
space between the VM and PVG.

This patch implements a QEMU device that drives PVG for the VMApple
variant of it.

Signed-off-by: Alexander Graf <graf@amazon.com>
Co-authored-by: Alexander Graf <graf@amazon.com>

Subsequent changes:

 * Cherry-pick/rebase conflict fixes, API use updates.
 * Moved from hw/vmapple/ (useful outside that machine type)
 * Overhaul of threading model, many thread safety improvements.
 * Asynchronous rendering.
 * Memory and object lifetime fixes.
 * Refactoring to split generic and (vmapple) MMIO variant specific
   code.

Implementation wise, most of the complexity lies in the differing threading
models of ParavirtualizedGraphics.framework, which uses libdispatch and
internal locks, versus QEMU, which heavily uses the BQL, especially during
memory-mapped device I/O. Great care has therefore been taken to prevent
deadlocks by never calling into PVG methods while holding the BQL, and
similarly never acquiring the BQL in a callback from PVG. Different strategies
have been used (libdispatch, blocking and non-blocking BHs, RCU, etc.)
depending on the specific requirements at each framework entry and exit point.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-ID: <20241223221645.29911-3-phil@philjordan.eu>
[PMD: Re-ordered imported headers, style fixups]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-12-31 21:21:34 +01:00
..
9pfs Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
acpi Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
adc include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
alpha alpha: switch boards to "default y" 2024-05-03 15:47:47 +02:00
arm hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
audio Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
avr Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
block hw/block/virtio-blk: Replaces request free function with g_free 2024-12-31 21:21:34 +01:00
char Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
core Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
cpu Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
cxl Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
display hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support 2024-12-31 21:21:34 +01:00
dma Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
fsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
gpio Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
hppa include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hyperv Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
i2c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
i386 hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature 2024-12-31 21:21:34 +01:00
ide Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
input Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
intc Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
ipack include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
ipmi Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
isa Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
loongarch hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
m68k next-cube: add my copyright to the top of the file 2024-12-29 07:13:47 +01:00
mem Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
microblaze hw/microblaze: Propagate CPU endianness to microblaze_load_kernel() 2024-12-31 21:21:34 +01:00
mips hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
misc hw/misc/vmcoreinfo: Rename opaque pointer as 'opaque' 2024-12-31 21:21:34 +01:00
net hw/net/xilinx_ethlite: Rename rxbuf -> port_index 2024-12-31 21:21:34 +01:00
nubus include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
nvme Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
nvram fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read() 2024-12-31 21:21:34 +01:00
openrisc hw/openrisc: Mark devices as big-endian 2024-12-31 21:21:34 +01:00
pci Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
pci-bridge Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
pci-host hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
ppc Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
remote Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
riscv hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
rtc Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
rx Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
s390x Hi, 2024-12-22 14:33:27 -05:00
scsi Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
sd Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
sensor hw/sensor: Replace type_register() with type_register_static() 2024-12-10 18:49:25 +01:00
sh4 include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
smbios include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
sparc hw/sparc: Mark devices as big-endian 2024-12-31 21:21:34 +01:00
sparc64 hw/sparc: Mark devices as big-endian 2024-12-31 21:21:34 +01:00
ssi Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
timer hw/timer/hpet: Fix comment about capabilities register 2024-12-28 14:42:52 +03:00
tpm Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
tricore hw/tricore: Mark devices as little-endian 2024-12-31 21:21:34 +01:00
ufs Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
usb hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO 2024-12-31 21:21:34 +01:00
vfio vfio/migration: Rename vfio_devices_all_dirty_tracking() 2024-12-26 07:23:38 +01:00
virtio qmp: update vhost-user protocol feature maps 2024-12-28 14:42:53 +03:00
watchdog Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
xen hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
xenpv include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
xtensa hw/pci-host/gpex: Allow more than 4 legacy IRQs 2024-12-30 20:04:50 +01:00
Kconfig hw: Remove PCMCIA subsystem 2024-10-15 15:16:17 +01:00
meson.build hw: Remove PCMCIA subsystem 2024-10-15 15:16:17 +01:00