mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
hw/i386/xen/xen-hvm: Allow for stubbing xen_set_pci_link_route()
The only user of xen_set_pci_link_route() is xen_piix_pci_write_config_client() which implements PIIX-specific logic in the xen namespace. This makes xen-hvm depend on PIIX which could be avoided if xen_piix_pci_write_config_client() was implemented in PIIX. In order to do this, xen_set_pci_link_route() needs to be stubbable which this patch addresses. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Paul Durrant <paul@xen.org> Message-Id: <20220626094656.15673-2-shentey@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
99337bd1e3
commit
21d87050af
|
@ -161,11 +161,16 @@ void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)
|
||||||
}
|
}
|
||||||
v &= 0xf;
|
v &= 0xf;
|
||||||
if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) {
|
if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) {
|
||||||
xen_set_pci_link_route(xen_domid, address + i - PIIX_PIRQCA, v);
|
xen_set_pci_link_route(address + i - PIIX_PIRQCA, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xen_set_pci_link_route(uint8_t link, uint8_t irq)
|
||||||
|
{
|
||||||
|
return xendevicemodel_set_pci_link_route(xen_dmod, xen_domid, link, irq);
|
||||||
|
}
|
||||||
|
|
||||||
int xen_is_pirq_msi(uint32_t msi_data)
|
int xen_is_pirq_msi(uint32_t msi_data)
|
||||||
{
|
{
|
||||||
/* If vector is 0, the msi is remapped into a pirq, passed as
|
/* If vector is 0, the msi is remapped into a pirq, passed as
|
||||||
|
|
|
@ -21,6 +21,7 @@ extern enum xen_mode xen_mode;
|
||||||
extern bool xen_domid_restrict;
|
extern bool xen_domid_restrict;
|
||||||
|
|
||||||
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
|
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
|
||||||
|
int xen_set_pci_link_route(uint8_t link, uint8_t irq);
|
||||||
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
|
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
|
||||||
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
|
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
|
||||||
void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
|
void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
|
||||||
|
|
|
@ -316,12 +316,6 @@ static inline int xen_set_pci_intx_level(domid_t domid, uint16_t segment,
|
||||||
device, intx, level);
|
device, intx, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int xen_set_pci_link_route(domid_t domid, uint8_t link,
|
|
||||||
uint8_t irq)
|
|
||||||
{
|
|
||||||
return xendevicemodel_set_pci_link_route(xen_dmod, domid, link, irq);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int xen_inject_msi(domid_t domid, uint64_t msi_addr,
|
static inline int xen_inject_msi(domid_t domid, uint64_t msi_addr,
|
||||||
uint32_t msi_data)
|
uint32_t msi_data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,11 @@ void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xen_set_pci_link_route(uint8_t link, uint8_t irq)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
|
void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue