hw/arm/virt: Support larger highmem MMIO regions
PATCH v5 1/1 hw/arm/virt: Support larger highmem MMIO regions
The MMIO region size required to support virtualized environments with large PCI BAR regions can exceed the hardcoded limit configured in QEMU. For example, a VM with multiple NVIDIA Grace-Hopper GPUs passed through requires more MMIO memory than the amount provided by VIRT_HIGH_PCIE_MMIO (currently 512GB). Instead of updating VIRT_HIGH_PCIE_MMIO, introduce a new parameter, highmem-mmio-size, that specifies the MMIO size required to support the VM configuration.
Example usage with 1TB MMIO region size:
-machine virt,gic-version=3,highmem-mmio-size=1T
---
v5: - Removed hyphens from power of 2
- Consistently use property name in all error messages
- Use #defines for default high PCIE MMIO size
- Use size_to_str() when printing size values
- Add comment clarifying that highmem-mmio-size will update the corresponding value in extended_memmap
v4: - Added default size to highmem-mmio-size description
v3: - Updated highmem-mmio-size description
v2: - Add unit suffix to example in commit message
- Use existing "high memory region" terminology
- Resolve minor braces nit
docs/system/arm/virt.rst | 4 ++++ hw/arm/virt.c | 50 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-)
docs/system/arm/virt.rst +4 -0
@@ -144,6 +144,10 @@ highmem-mmio Set ``on``/``off`` to enable/disable the high memory region for PCI MMIO. The default is ``on``. +highmem-mmio-size + Set the high memory region size for PCI MMIO. Must be a power of 2 and + greater than or equal to the default size (512G). + gic-version Specify the version of the Generic Interrupt Controller (GIC) to provide. Valid values are:
hw/arm/virt.c +49 -1
86 lines not on this page · raw message
Signature · 1 line
2.46.0
Review
Quoted 2 lines · Matthew R. Ochs
(quoted diff) +2
-0+static void virt_get_highmem_mmio_size(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp)
Just some coding style nit:
static void virt_get_highmem_mmio_size(Object *obj, Visitor *v,
const char *name, void *opaque, Error **errp)
hw/arm/virt.c static void virt_set_highmem_mmio(Object *obj, bool value, Error **errp) · line 2570
Quoted 2 lines
hw/arm/virt.c +2
-0+static void virt_set_highmem_mmio_size (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp)
Ditto.
Otherwise,