mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
vfio-user: handle device interrupts
Forward remote device's interrupts to the guest Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com> Signed-off-by: John G Johnson <john.g.johnson@oracle.com> Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Message-id: 9523479eaafe050677f4de2af5dd0df18c27cfd9.1655151679.git.jag.raman@oracle.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
3123f93d6b
commit
08cf3dc611
13 changed files with 298 additions and 12 deletions
|
@ -43,6 +43,7 @@ void msi_notify(PCIDevice *dev, unsigned int vector);
|
|||
void msi_send_message(PCIDevice *dev, MSIMessage msg);
|
||||
void msi_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len);
|
||||
unsigned int msi_nr_vectors_allocated(const PCIDevice *dev);
|
||||
void msi_set_mask(PCIDevice *dev, int vector, bool mask, Error **errp);
|
||||
|
||||
static inline bool msi_present(const PCIDevice *dev)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ void msix_clr_pending(PCIDevice *dev, int vector);
|
|||
int msix_vector_use(PCIDevice *dev, unsigned vector);
|
||||
void msix_vector_unuse(PCIDevice *dev, unsigned vector);
|
||||
void msix_unuse_all_vectors(PCIDevice *dev);
|
||||
void msix_set_mask(PCIDevice *dev, int vector, bool mask, Error **errp);
|
||||
|
||||
void msix_notify(PCIDevice *dev, unsigned vector);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ extern bool pci_available;
|
|||
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
|
||||
#define PCI_FUNC(devfn) ((devfn) & 0x07)
|
||||
#define PCI_BUILD_BDF(bus, devfn) ((bus << 8) | (devfn))
|
||||
#define PCI_BDF_TO_DEVFN(x) ((x) & 0xff)
|
||||
#define PCI_BUS_MAX 256
|
||||
#define PCI_DEVFN_MAX 256
|
||||
#define PCI_SLOT_MAX 32
|
||||
|
@ -127,6 +128,10 @@ typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num,
|
|||
pcibus_t addr, pcibus_t size, int type);
|
||||
typedef void PCIUnregisterFunc(PCIDevice *pci_dev);
|
||||
|
||||
typedef void MSITriggerFunc(PCIDevice *dev, MSIMessage msg);
|
||||
typedef MSIMessage MSIPrepareMessageFunc(PCIDevice *dev, unsigned vector);
|
||||
typedef MSIMessage MSIxPrepareMessageFunc(PCIDevice *dev, unsigned vector);
|
||||
|
||||
typedef struct PCIIORegion {
|
||||
pcibus_t addr; /* current PCI mapping address. -1 means not mapped */
|
||||
#define PCI_BAR_UNMAPPED (~(pcibus_t)0)
|
||||
|
@ -329,6 +334,14 @@ struct PCIDevice {
|
|||
/* Space to store MSIX table & pending bit array */
|
||||
uint8_t *msix_table;
|
||||
uint8_t *msix_pba;
|
||||
|
||||
/* May be used by INTx or MSI during interrupt notification */
|
||||
void *irq_opaque;
|
||||
|
||||
MSITriggerFunc *msi_trigger;
|
||||
MSIPrepareMessageFunc *msi_prepare_message;
|
||||
MSIxPrepareMessageFunc *msix_prepare_message;
|
||||
|
||||
/* MemoryRegion container for msix exclusive BAR setup */
|
||||
MemoryRegion msix_exclusive_bar;
|
||||
/* Memory Regions for MSIX table and pending bit entries. */
|
||||
|
|
6
include/hw/remote/vfio-user-obj.h
Normal file
6
include/hw/remote/vfio-user-obj.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef VFIO_USER_OBJ_H
|
||||
#define VFIO_USER_OBJ_H
|
||||
|
||||
void vfu_object_set_bus_irq(PCIBus *pci_bus);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue