[SeaBIOS] [PATCH 2/3] vgahooks: Register 155f vga hooks for Xen Intel passthrough devices

Kevin O'Connor kevin at koconnor.net
Fri Feb 3 02:07:35 CET 2012


On Thu, Feb 02, 2012 at 01:37:28PM +0000, Julian Pidancet wrote:
> On Wed, Feb 1, 2012 at 4:13 AM, Kevin O'Connor <kevin at koconnor.net> wrote:
> > Is Xen passthrough special, or will the same thing occur on KVM
> > passthrough?  If the 155f hooks are needed on Intel VGA cards, I
> > wouldn't tie it to Xen - we can just turn it on by default and enable
> > it if the VGA card is recognized as Intel based.
> >
> 
> I can't answer you about KVM as I never used it, but I suppose it
> might have the same problem if it has VGA passthrough support.
> 
> The problem I had was that the CBvendor and the CBpart variables were
> only set in the coreboot.c file which is specific to coreboot. How can
> we make the vgahooks part more generic and independent ?

Something like (untested):

--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -117,7 +117,7 @@ find_cb_subtable(struct cb_header *cbh, u32 tag)
 }
 
 static struct cb_memory *CBMemTable;
-const char *CBvendor, *CBpart;
+const char *CBvendor = "", *CBpart = "";
 
 // Populate max ram and e820 map info by scanning for a coreboot table.
 static void
diff --git a/src/vgahooks.c b/src/vgahooks.c
index a8f667c..520044c 100644
--- a/src/vgahooks.c
+++ b/src/vgahooks.c
@@ -254,7 +254,7 @@ handle_155f(struct bregs *regs)
 void
 vgahook_setup(struct pci_device *pci)
 {
-    if (!CONFIG_VGAHOOKS || !CBvendor || !CBpart)
+    if (!CONFIG_VGAHOOKS)
         return;
 
     if (strcmp(CBvendor, "KONTRON") == 0 && strcmp(CBpart, "986LCD-M") == 0)
@@ -265,4 +265,6 @@ vgahook_setup(struct pci_device *pci)
         roda_setup(pci);
     else if (pci->vendor == PCI_VENDOR_ID_VIA)
         via_setup(pci);
+    else if (pci->vendor == PCI_VENDOR_ID_INTEL)
+        /* ... */;
 }

-Kevin



More information about the SeaBIOS mailing list