2 * QEMU Xen PVH machine - common code.
4 * Copyright (c) 2024 Advanced Micro Devices, Inc.
6 * SPDX-License-Identifier: GPL-2.0-or-later
9 #ifndef XEN_PVH_COMMON_H__
10 #define XEN_PVH_COMMON_H__
13 #include "hw/sysbus.h"
15 #include "hw/xen/xen-hvm-common.h"
16 #include "hw/pci-host/gpex.h"
18 #define TYPE_XEN_PVH_MACHINE MACHINE_TYPE_NAME("xen-pvh-base")
19 OBJECT_DECLARE_TYPE(XenPVHMachineState
, XenPVHMachineClass
,
22 struct XenPVHMachineClass
{
25 /* PVH implementation specific init. */
26 void (*init
)(MachineState
*state
);
29 * set_pci_intx_irq - Deliver INTX irqs to the guest.
31 * @opaque: pointer to XenPVHMachineState.
32 * @irq: IRQ after swizzling, between 0-3.
35 void (*set_pci_intx_irq
)(void *opaque
, int irq
, int level
);
38 * set_pci_link_route: - optional implementation call to setup
39 * routing between INTX IRQ (0 - 3) and GSI's.
41 * @line: line the INTx line (0 => A .. 3 => B)
44 int (*set_pci_link_route
)(uint8_t line
, uint8_t irq
);
46 /* Allow implementations to optionally enable buffered ioreqs. */
47 uint8_t handle_bufioreq
;
50 * Each implementation can optionally enable features that it
51 * supports and are known to work.
58 struct XenPVHMachineState
{
71 MemoryRegion mmio_alias
;
72 MemoryRegion mmio_high_alias
;
76 MemMapEntry ram_low
, ram_high
;
80 MemMapEntry virtio_mmio
;
81 uint32_t virtio_mmio_num
;
82 uint32_t virtio_mmio_irq_base
;
85 MemMapEntry pci_ecam
, pci_mmio
, pci_mmio_high
;
86 uint32_t pci_intx_irq_base
;
90 void xen_pvh_class_setup_common_props(XenPVHMachineClass
*xpc
);