aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2022-06-26 11:46:55 +0200
committerLaurent Vivier <laurent@vivier.eu>2022-06-29 00:24:13 +0200
commit21d87050af66f50c8d394a160e89560ceaa6bd5d (patch)
tree90d86f00c5344f04d1cca886a00cf2ccde0a5648 /hw
parent99337bd1e3a323d07dc29da99cf3f48d3990ad81 (diff)
downloadqemu-21d87050af66f50c8d394a160e89560ceaa6bd5d.zip
qemu-21d87050af66f50c8d394a160e89560ceaa6bd5d.tar.gz
qemu-21d87050af66f50c8d394a160e89560ceaa6bd5d.tar.bz2
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/i386/xen/xen-hvm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 0731f70..204fda7 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -161,11 +161,16 @@ void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)
}
v &= 0xf;
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)
{
/* If vector is 0, the msi is remapped into a pirq, passed as