|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 3/3] xen/igd: fixup device id before registering rom
With the current implementation, Seabios does not see the fixup of
the device id done here and consequently Seabios does not load the
VGA bios and the guest screen does not light up until the guest OS
graphics driver is loaded. So there is no VGA output from the passed
through Intel IGD from either Seabios or the guest bootloader with
the current implementation in cases when the device id needs fixing.
Fix this by waiting until after doing fixup of the device id before
registering the option ROM. With this patch, Seabios sees the fixup
done here and loads the VGA bios, and both Seabios and the guest
bootloader light up the guest screen in cases when fixup of the
device id is needed.
Also, remove unused header hw/core/loader.h.
Signed-off-by: Chuck Zmudzinski <brchuckz@xxxxxxx>
---
Changes in v2:
- add a period to the end of the last sentence of the commit message
- add stable to Cc list
Changes in v3:
- fix Cc address for qemu-stable
hw/xen/xen_pt_graphics.c | 3 +++
hw/xen/xen_pt_load_rom.c | 18 ++++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 2ef941e..aface0b 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -222,6 +222,9 @@ void xen_pt_setup_vga(XenPCIPassthroughState *s,
XenHostPCIDevice *dev,
}
}
+ pci_register_bar(&s->dev, PCI_ROM_SLOT, 0, &s->dev.rom);
+ s->dev.has_rom = true;
+
/* Currently we fixed this address as a primary for legacy BIOS. */
physical_memory_write(0xc0000, bios, bios_size);
}
diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c
index 319efca..407b630 100644
--- a/hw/xen/xen_pt_load_rom.c
+++ b/hw/xen/xen_pt_load_rom.c
@@ -4,14 +4,22 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
-#include "hw/core/loader.h"
#include "hw/pci/pci.h"
#include "xen_pt.h"
/*
- * Scan the assigned devices for the devices that have an option ROM, and then
- * load the corresponding ROM data to RAM. If an error occurs while loading an
- * option ROM, we just ignore that option ROM and continue with the next one.
+ * Normally xen_pt_register_regions will handle loading the option ROM,
+ * but in some cases, such as for the Intel IGD, the option ROM might
+ * need to be modified.
+ *
+ * For such cases, use this function to get a pointer to the option ROM
+ * from sysfs. Caller has the responsibility to edit the option ROM as
+ * needed, call pci_register_bar to register the modified option ROM,
+ * and set has_rom to true for the PCI device.
+ *
+ * This function must be called before xen_pt_register_regions is called
+ * because if xen_pt_register_regions is called first, it will register
+ * the option ROM and any attempt to register it again will fail.
*/
void *pci_assign_dev_load_option_rom(PCIDevice *dev,
int *size, unsigned int domain,
@@ -76,8 +84,6 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
goto close_rom;
}
- pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom);
- dev->has_rom = true;
*size = st.st_size;
close_rom:
/* Write "0" to disable ROM */
--
2.52.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |