mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00

Add a way to enable/disable buffered IOREQs for PVH machines and disable them for ARM. ARM does not support buffered IOREQ's nor the legacy way to map IOREQ info pages. See the following for more details: https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=2fbd7e609e1803ac5e5c26e22aa8e4b5a6cddbb1 https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/ioreq.c;h=2e829d2e7f3760401b96fa7c930e2015fb1cf463;hb=HEAD#l138 Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
91 lines
2.1 KiB
C
91 lines
2.1 KiB
C
/*
|
|
* QEMU Xen PVH machine - common code.
|
|
*
|
|
* Copyright (c) 2024 Advanced Micro Devices, Inc.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef XEN_PVH_COMMON_H__
|
|
#define XEN_PVH_COMMON_H__
|
|
|
|
#include <assert.h>
|
|
#include "hw/sysbus.h"
|
|
#include "hw/hw.h"
|
|
#include "hw/xen/xen-hvm-common.h"
|
|
#include "hw/pci-host/gpex.h"
|
|
|
|
#define TYPE_XEN_PVH_MACHINE MACHINE_TYPE_NAME("xen-pvh-base")
|
|
OBJECT_DECLARE_TYPE(XenPVHMachineState, XenPVHMachineClass,
|
|
XEN_PVH_MACHINE)
|
|
|
|
struct XenPVHMachineClass {
|
|
MachineClass parent;
|
|
|
|
/* PVH implementation specific init. */
|
|
void (*init)(MachineState *state);
|
|
|
|
/*
|
|
* set_pci_intx_irq - Deliver INTX irqs to the guest.
|
|
*
|
|
* @opaque: pointer to XenPVHMachineState.
|
|
* @irq: IRQ after swizzling, between 0-3.
|
|
* @level: IRQ level.
|
|
*/
|
|
void (*set_pci_intx_irq)(void *opaque, int irq, int level);
|
|
|
|
/*
|
|
* set_pci_link_route: - optional implementation call to setup
|
|
* routing between INTX IRQ (0 - 3) and GSI's.
|
|
*
|
|
* @line: line the INTx line (0 => A .. 3 => B)
|
|
* @irq: GSI
|
|
*/
|
|
int (*set_pci_link_route)(uint8_t line, uint8_t irq);
|
|
|
|
/* Allow implementations to optionally enable buffered ioreqs. */
|
|
uint8_t handle_bufioreq;
|
|
|
|
/*
|
|
* Each implementation can optionally enable features that it
|
|
* supports and are known to work.
|
|
*/
|
|
bool has_pci;
|
|
bool has_tpm;
|
|
bool has_virtio_mmio;
|
|
};
|
|
|
|
struct XenPVHMachineState {
|
|
/*< private >*/
|
|
MachineState parent;
|
|
|
|
XenIOState ioreq;
|
|
|
|
struct {
|
|
MemoryRegion low;
|
|
MemoryRegion high;
|
|
} ram;
|
|
|
|
struct {
|
|
GPEXHost gpex;
|
|
MemoryRegion mmio_alias;
|
|
MemoryRegion mmio_high_alias;
|
|
} pci;
|
|
|
|
struct {
|
|
MemMapEntry ram_low, ram_high;
|
|
MemMapEntry tpm;
|
|
|
|
/* Virtio-mmio */
|
|
MemMapEntry virtio_mmio;
|
|
uint32_t virtio_mmio_num;
|
|
uint32_t virtio_mmio_irq_base;
|
|
|
|
/* PCI */
|
|
MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
|
|
uint32_t pci_intx_irq_base;
|
|
} cfg;
|
|
};
|
|
|
|
void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc);
|
|
#endif
|