summary refs log tree commit diff stats
path: root/hw/xen/xen-pvh-common.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-10-04 12:24:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2024-10-04 12:24:26 +0100
commit33dab2dda093a330656778c48ce88fb9c446cbf9 (patch)
tree4a2d797ec28a24eaffa874d1704af33fb386ae9e /hw/xen/xen-pvh-common.c
parent423be09ab9492735924e73a2d36069784441ebc6 (diff)
parentca9275a4b11aced3074219d1712e29fce5036f72 (diff)
downloadfocaccia-qemu-33dab2dda093a330656778c48ce88fb9c446cbf9.tar.gz
focaccia-qemu-33dab2dda093a330656778c48ce88fb9c446cbf9.zip
Merge tag 'edgar/xen-queue-2024-10-03-v2.for-upstream' of https://gitlab.com/edgar.iglesias/qemu into staging
Edgars Xen Queue.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEErET+3BT38evtv0FRKcWWeA9ryoMFAmb+1rIACgkQKcWWeA9r
# yoN67QgAgg4eTLF00cXBGp+hCOs+Oy9go7MHkaiCrKRHde0f82wnPLH6BfaVfafd
# 3dn+y2MAv+v/gjrqcgQHlKOojoYwkBrvIc0yMXOK7GPwS/ppA4+L0ZSyONFcoM7j
# 1b7pfXn8yiJnRRWvSaM81nLWj3CgUR/piTMao72jBM0t+oVgY3ZEcidFlN2rcQwj
# 27BSNEF+CTYyA+fXGV0EgIjTLWHvvUR+WNO6jRsTpLK+/2tl1idoLm8t7hihfoN8
# MW34R6RwmNv0PYCsz9+LCPUW+KbrA2w8YX+Rq1W4UVCm5BocibQ4Vwrn2bLAOgLP
# i7RwTtew+avZoQvA8lM3+yU8vo+Q+A==
# =95Ye
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 03 Oct 2024 18:38:58 BST
# gpg:                using RSA key AC44FEDC14F7F1EBEDBF415129C596780F6BCA83
# gpg: Good signature from "Edgar E. Iglesias (Xilinx key) <edgar.iglesias@xilinx.com>" [unknown]
# gpg:                 aka "Edgar E. Iglesias <edgar.iglesias@gmail.com>" [full]
# Primary key fingerprint: AC44 FEDC 14F7 F1EB EDBF  4151 29C5 9678 0F6B CA83

* tag 'edgar/xen-queue-2024-10-03-v2.for-upstream' of https://gitlab.com/edgar.iglesias/qemu:
  hw/arm: xenpvh: Enable PCI for ARM PVH
  hw/xen: xenpvh: Add pci-intx-irq-base property
  hw/xen: xenpvh: Disable buffered IOREQs for ARM
  hw/xen: Expose handle_bufioreq in xen_register_ioreq
  hw/xen: Remove deadcode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/xen/xen-pvh-common.c')
-rw-r--r--hw/xen/xen-pvh-common.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 28d7168446..218ac851cf 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -194,7 +194,9 @@ static void xen_pvh_init(MachineState *ms)
     }
 
     xen_pvh_init_ram(s, sysmem);
-    xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, &xen_memory_listener);
+    xen_register_ioreq(&s->ioreq, ms->smp.max_cpus,
+                       xpc->handle_bufioreq,
+                       &xen_memory_listener);
 
     if (s->cfg.virtio_mmio_num) {
         xen_create_virtio_mmio_devices(s);
@@ -216,6 +218,11 @@ static void xen_pvh_init(MachineState *ms)
             error_report("pci-ecam-size only supports values 0 or 0x10000000");
             exit(EXIT_FAILURE);
         }
+        if (!s->cfg.pci_intx_irq_base) {
+            error_report("PCI enabled but pci-intx-irq-base not set");
+            exit(EXIT_FAILURE);
+        }
+
         xenpvh_gpex_init(s, xpc, sysmem);
     }
 
@@ -271,6 +278,30 @@ XEN_PVH_PROP_MEMMAP(pci_ecam)
 XEN_PVH_PROP_MEMMAP(pci_mmio)
 XEN_PVH_PROP_MEMMAP(pci_mmio_high)
 
+static void xen_pvh_set_pci_intx_irq_base(Object *obj, Visitor *v,
+                                          const char *name, void *opaque,
+                                          Error **errp)
+{
+    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);
+    uint32_t value;
+
+    if (!visit_type_uint32(v, name, &value, errp)) {
+        return;
+    }
+
+    xp->cfg.pci_intx_irq_base = value;
+}
+
+static void xen_pvh_get_pci_intx_irq_base(Object *obj, Visitor *v,
+                                          const char *name, void *opaque,
+                                          Error **errp)
+{
+    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);
+    uint32_t value = xp->cfg.pci_intx_irq_base;
+
+    visit_type_uint32(v, name, &value, errp);
+}
+
 void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
 {
     ObjectClass *oc = OBJECT_CLASS(xpc);
@@ -316,6 +347,13 @@ do {                                                                      \
         OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
         OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
         OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
+
+        object_class_property_add(oc, "pci-intx-irq-base", "uint32_t",
+                                  xen_pvh_get_pci_intx_irq_base,
+                                  xen_pvh_set_pci_intx_irq_base,
+                                  NULL, NULL);
+        object_class_property_set_description(oc, "pci-intx-irq-base",
+                                  "Set PCI INTX interrupt base line.");
     }
 
 #ifdef CONFIG_TPM