summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2024-01-19 13:41:55 -0700
committerMark Hatle <mark.hatle@amd.com>2024-01-22 16:31:41 -0700
commit4eccda49693a2c75f906dffda47abbeb4197d12e (patch)
tree16f583c98d89590757918584886d4a0dd6373df7 /meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch
parentd925a82f3631bd20648a91bc23d5746e457c9b8b (diff)
downloadmeta-xilinx-4eccda49693a2c75f906dffda47abbeb4197d12e.tar.gz
qemu: Rename qemu-xen to qemu-xen_7.1
Rename qemu-xen to qemu-xen_7.1 inclusion file and update the same in qemu-xilinx_2023 qemu_7.1 recipes. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch')
-rw-r--r--meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch
new file mode 100644
index 00000000..a6925acf
--- /dev/null
+++ b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-7.1/0014-xen_arm-Create-virtio-mmio-devices-during-initializa.patch
@@ -0,0 +1,83 @@
1From 3dc39d71c3652bea37dc955d5dbf8cd391d2aed0 Mon Sep 17 00:00:00 2001
2From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
3Date: Sat, 30 Jul 2022 17:51:19 +0300
4Subject: [PATCH 14/16] xen_arm: Create virtio-mmio devices during
5 initialization
6
7In order to use virtio backends we need to allocate virtio-mmio
8parameters (irq and base) and register corresponding buses.
9
10Use the constants defined in public header arch-arm.h to be
11aligned with the toolstack. So the number of current supported
12virtio-mmio devices is 10.
13
14For the interrupts triggering use already existing on Arm
15device-model hypercall.
16
17The toolstack should then insert the same amount of device nodes
18into guest device-tree.
19
20Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
21Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
22Reviewed-by: Stefano Stabellini <stefano.stabellini@amd.com>
23---
24 hw/arm/xen_arm.c | 29 +++++++++++++++++++++++++++++
25 1 file changed, 29 insertions(+)
26
27diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
28index 153cedfeb4..2012ee7aff 100644
29--- a/hw/arm/xen_arm.c
30+++ b/hw/arm/xen_arm.c
31@@ -25,6 +25,7 @@
32 #include "qemu/error-report.h"
33 #include "qapi/qapi-commands-migration.h"
34 #include "hw/boards.h"
35+#include "hw/irq.h"
36 #include "hw/sysbus.h"
37 #include "sysemu/block-backend.h"
38 #include "sysemu/tpm_backend.h"
39@@ -55,6 +56,32 @@ struct XenArmState {
40 XenIOState *state;
41 };
42
43+#define VIRTIO_MMIO_DEV_SIZE 0x200
44+
45+#define NR_VIRTIO_MMIO_DEVICES \
46+ (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
47+
48+static void xen_set_irq(void *opaque, int irq, int level)
49+{
50+ xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level);
51+}
52+
53+static void xen_create_virtio_mmio_devices(XenArmState *xam)
54+{
55+ int i;
56+
57+ for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
58+ hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
59+ qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
60+ GUEST_VIRTIO_MMIO_SPI_FIRST + i);
61+
62+ sysbus_create_simple("virtio-mmio", base, irq);
63+
64+ DPRINTF("Created virtio-mmio device %d: irq %d base 0x%lx\n",
65+ i, GUEST_VIRTIO_MMIO_SPI_FIRST + i, base);
66+ }
67+}
68+
69 void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
70 {
71 hw_error("Invalid ioreq type 0x%x\n", req->type);
72@@ -132,6 +159,8 @@ static void xen_arm_init(MachineState *machine)
73 return;
74 }
75
76+ xen_create_virtio_mmio_devices(xam);
77+
78 xen_enable_tpm();
79
80 return;
81--
822.17.1
83