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

Julian Pidancet julian.pidancet at gmail.com
Thu Feb 2 14:37:28 CET 2012


On Wed, Feb 1, 2012 at 4:13 AM, Kevin O'Connor <kevin at koconnor.net> wrote:
> On Mon, Jan 30, 2012 at 01:55:55PM +0000, julian.pidancet at gmail.com wrote:
>> From: Julian Pidancet <julian.pidancet at citrix.com>
>>
>> Some Intel VGA option ROMs require some 155f hooks implemented in the
>> BIOS.
>>
>> Signed-off-by: Julian Pidancet <julian.pidancet at citrix.com>
>> ---
>>  src/vgahooks.c |   20 +++++++++++++++++++-
>>  1 files changed, 19 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/vgahooks.c b/src/vgahooks.c
>> index a8f667c..ca12e31 100644
>> --- a/src/vgahooks.c
>> +++ b/src/vgahooks.c
>> @@ -11,6 +11,7 @@
>>  #include "pci_ids.h" // PCI_VENDOR_ID_VIA
>>  #include "util.h" // handle_155f
>>  #include "config.h" // CONFIG_*
>> +#include "xen.h" // usingXen
>>
>>  #define VH_VIA 1
>>  #define VH_INTEL 2
>> @@ -228,6 +229,15 @@ getac_setup(struct pci_device *pci)
>>  {
>>  }
>>
>> +static void
>> +xen_vgapt_setup(struct pci_device *pci)
>> +{
>> +    if (pci->vendor == 0x8086 && pci->class == 0x300) {
>> +        VGAHookHandlerType = VH_INTEL;
>> +        IntelDisplayType = BOOT_DISPLAY_DEFAULT;
>> +        IntelDisplayId = 3;
>> +    }
>> +}
>>
>>  /****************************************************************
>>   * Entry and setup
>> @@ -254,7 +264,15 @@ handle_155f(struct bregs *regs)
>>  void
>>  vgahook_setup(struct pci_device *pci)
>>  {
>> -    if (!CONFIG_VGAHOOKS || !CBvendor || !CBpart)
>> +    if (!CONFIG_VGAHOOKS)
>> +        return;
>> +
>> +    if (usingXen()) {
>> +        xen_vgapt_setup(pci);
>> +        return;
>> +    }
>> +
>> +    if (!CBvendor || !CBpart)
>>          return;
>
> 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 ?

-- 
Julian



More information about the SeaBIOS mailing list