xen_arm: Create virtio-mmio devices during initialization

In order to use virtio backends we need to allocate virtio-mmio
parameters (irq and base) and register corresponding buses.

Use the constants defined in public header arch-arm.h to be
aligned with the toolstack. So the number of current supported
virtio-mmio devices is 10.

For the interrupts triggering use already existing on Arm
device-model hypercall.

The toolstack should then insert the same amount of device nodes
into guest device-tree.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
This commit is contained in:
Oleksandr Tyshchenko 2023-08-29 21:35:17 -07:00 committed by Stefano Stabellini
parent 156618d9ea
commit 0c8ab1cddd
2 changed files with 51 additions and 0 deletions

View file

@ -523,4 +523,20 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
enable);
}
#if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41500
static inline int xendevicemodel_set_irq_level(xendevicemodel_handle *dmod,
domid_t domid, uint32_t irq,
unsigned int level)
{
return 0;
}
#endif
#if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41700
#define GUEST_VIRTIO_MMIO_BASE xen_mk_ullong(0x02000000)
#define GUEST_VIRTIO_MMIO_SIZE xen_mk_ullong(0x00100000)
#define GUEST_VIRTIO_MMIO_SPI_FIRST 33
#define GUEST_VIRTIO_MMIO_SPI_LAST 43
#endif
#endif /* QEMU_HW_XEN_NATIVE_H */