From c379bd7551f34e42c4c935783c0c08bab41d70c1 Mon Sep 17 00:00:00 2001 From: Bernhard Beschow Date: Sun, 26 Jun 2022 11:46:56 +0200 Subject: hw/i386/xen/xen-hvm: Inline xen_piix_pci_write_config_client() and remove it xen_piix_pci_write_config_client() is implemented in the xen sub tree and uses PIIX constants internally, thus creating a direct dependency on PIIX. Now that xen_set_pci_link_route() is stubbable, the logic of xen_piix_pci_write_config_client() can be moved to PIIX which resolves the dependency. Signed-off-by: Bernhard Beschow Acked-by: Michael S. Tsirkin Reviewed-by: Paul Durrant Message-Id: <20220626094656.15673-3-shentey@gmail.com> Signed-off-by: Laurent Vivier --- hw/isa/piix3.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'hw/isa') diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 6388558..48f9ab1 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -138,7 +138,20 @@ static void piix3_write_config(PCIDevice *dev, static void piix3_write_config_xen(PCIDevice *dev, uint32_t address, uint32_t val, int len) { - xen_piix_pci_write_config_client(address, val, len); + int i; + + /* Scan for updates to PCI link routes (0x60-0x63). */ + for (i = 0; i < len; i++) { + uint8_t v = (val >> (8 * i)) & 0xff; + if (v & 0x80) { + v = 0; + } + v &= 0xf; + if (((address + i) >= PIIX_PIRQCA) && ((address + i) <= PIIX_PIRQCD)) { + xen_set_pci_link_route(address + i - PIIX_PIRQCA, v); + } + } + piix3_write_config(dev, address, val, len); } -- cgit v1.1