From 25bd6b1ff87765c4620c2af38da262aecf1cb6f0 Mon Sep 17 00:00:00 2001 From: Jean Guyader Date: Thu, 19 Mar 2009 15:28:48 +0000 Subject: [PATCH] Pass through the device ID and the vendor ID of the host bridge. For a linux guest it needs to be the same as on the host otherwise you have no /dev/agpart. --- hw/pci.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index b5c517cd..89c17aca 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -476,14 +476,22 @@ uint32_t pci_data_read(void *opaque, uint32_t addr, int len) if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge { - val = 0; + val = pci_dev->config_read(pci_dev, config_addr, len); if (config_addr == 0x52) // GMCH val = pt_pci_host_read_word(0, 0, 0, 0x52); -/* if (config_addr == 0xa0) // Top Memory addrress - val = pt_pci_host_read_byte(0, 0, 0, 0xa0);*/ if (config_addr == 0x02) // Device ID - val = pt_pci_host_read_byte(0, 0, 0, 0x02); + { + if (len == 2) + val = pt_pci_host_read_word(0, 0, 0, 0x02); + } + if (config_addr == 0x0) + { + if (len == 2) + val = pt_pci_host_read_word(0, 0, 0, 0x00); + else if (len == 4) + val = pt_pci_host_read_long(0, 0, 0, 0x00); + } } else val = pci_dev->config_read(pci_dev, config_addr, len); -- 2.39.5