On Jan 29, 2025, at 2:25 AM, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
Hi
Matthew,
On
28/1/25 17:02, Matthew R. Ochs wrote:
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=1099511627776
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
---
docs/system/arm/virt.rst | 4 ++++
hw/arm/virt.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 49eb0355ef0c..43d47ffedd9a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2773,6 +2773,35 @@ static void virt_set_highmem_mmio(Object *obj, bool value, Error **errp)
vms->highmem_mmio = value;
}
+static void virt_get_highmem_mmio_size(Object *obj, Visitor *v, const char *name,
+ void *opaque, Error **errp)
+{
+ uint64_t size = extended_memmap[VIRT_HIGH_PCIE_MMIO].size;
+
+ visit_type_size(v, name, &size, errp);
Since
you correctly use visit_type_size(), maybe use in commit
description
example "highmem-mmio-size=1TB" rather than 1099511627776?
Yes, this will be updated in v2.
|