[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 07/10] hw/arm: xenpvh: Reverse virtio-mmio creation order
|
From: |
Edgar E. Iglesias |
|
Subject: |
[PATCH v1 07/10] hw/arm: xenpvh: Reverse virtio-mmio creation order |
|
Date: |
Mon, 12 Aug 2024 15:06:02 +0200 |
From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
We've been creating the virtio-mmio devices in forwards order
but since the qbus lists prepend (rather than append) entries,
the virtio busses end up with decreasing base address order.
Xen enables virtio-mmio nodes in forwards order so there's been
a missmatch. So far, we've been working around this with an
out-of-tree patch to Xen.
This reverses the order making sure the virtio busses end up
ordered with increasing base addresses avoiding the need to
patch Xen.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
hw/xen/xen-pvh-common.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 0d368398d0..69a2dbdb6d 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -73,7 +73,18 @@ static void xen_create_virtio_mmio_devices(XenPVHCommonState
*s)
{
int i;
- for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
+ /*
+ * We create the transports in reverse order. Since qbus_realize()
+ * prepends (not appends) new child buses, the decrementing loop below will
+ * create a list of virtio-mmio buses with increasing base addresses.
+ *
+ * When a -device option is processed from the command line,
+ * qbus_find_recursive() picks the next free virtio-mmio bus in forwards
+ * order.
+ *
+ * This is what the Xen tools expect.
+ */
+ for (i = s->cfg.virtio_mmio_num - 1; i >= 0; i--) {
hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
s->cfg.virtio_mmio_irq_base + i);
--
2.43.0
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, (continued)
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Stefano Stabellini, 2024/08/13
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Edgar E. Iglesias, 2024/08/14
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Stefano Stabellini, 2024/08/14
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Edgar E. Iglesias, 2024/08/16
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Stefano Stabellini, 2024/08/16
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Jason Andryuk, 2024/08/16
- Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests, Edgar E. Iglesias, 2024/08/20
[PATCH v1 05/10] hw/arm: xenpvh: Break out a common PVH module, Edgar E. Iglesias, 2024/08/12
[PATCH v1 07/10] hw/arm: xenpvh: Reverse virtio-mmio creation order,
Edgar E. Iglesias <=
[PATCH v1 08/10] hw/xen: pvh-common: Add support for creating PCIe/GPEX, Edgar E. Iglesias, 2024/08/12
[PATCH v1 10/10] docs/system/i386: xenpvh: Add a basic description, Edgar E. Iglesias, 2024/08/12
[PATCH v1 09/10] hw/i386/xen: Add a Xen PVH x86 machine, Edgar E. Iglesias, 2024/08/12