From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org,
peter.maydell@linaro.org, alex.bennee@linaro.org,
xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
edgar.iglesias@amd.com, xen-devel@lists.xenproject.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 09/12] hw/arm: xenpvh: Reverse virtio-mmio creation order
Date: Tue, 20 Aug 2024 16:29:46 +0200 [thread overview]
Message-ID: <20240820142949.533381-10-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
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>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
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 880e8143d7..295f920442 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -75,7 +75,18 @@ static void xen_create_virtio_mmio_devices(XenPVHMachineState *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
next prev parent reply other threads:[~2024-08-20 14:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 14:29 [PATCH v2 00/12] xen: pvh: Partial QOM:fication with new x86 PVH machine Edgar E. Iglesias
2024-08-20 14:29 ` [PATCH v2 01/12] MAINTAINERS: Add docs/system/arm/xenpvh.rst Edgar E. Iglesias
2024-08-20 14:29 ` [PATCH v2 02/12] hw/arm: xenpvh: Update file header to use SPDX Edgar E. Iglesias
2024-08-20 14:29 ` [PATCH v2 03/12] hw/arm: xenpvh: Tweak machine description Edgar E. Iglesias
2024-08-20 14:29 ` [PATCH v2 04/12] hw/arm: xenpvh: Add support for SMP guests Edgar E. Iglesias
2024-08-21 0:55 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 05/12] hw/arm: xenpvh: Remove double-negation in warning Edgar E. Iglesias
2024-08-21 0:56 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 06/12] hw/arm: xenpvh: Move stubbed functions to xen-stubs.c Edgar E. Iglesias
2024-08-21 1:06 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 07/12] hw/arm: xenpvh: Break out a common PVH machine Edgar E. Iglesias
2024-08-21 1:16 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 08/12] hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c Edgar E. Iglesias
2024-08-20 14:29 ` Edgar E. Iglesias [this message]
2024-08-20 14:29 ` [PATCH v2 10/12] hw/xen: pvh-common: Add support for creating PCIe/GPEX Edgar E. Iglesias
2024-08-21 1:22 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 11/12] hw/i386/xen: Add a Xen PVH x86 machine Edgar E. Iglesias
2024-08-21 1:22 ` Stefano Stabellini
2024-08-20 14:29 ` [PATCH v2 12/12] docs/system/i386: xenpvh: Add a basic description Edgar E. Iglesias
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240820142949.533381-10-edgar.iglesias@gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=anthony@xenproject.org \
--cc=edgar.iglesias@amd.com \
--cc=jason.andryuk@amd.com \
--cc=paul@xen.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).