Hi Jordan,

On Sat, Feb 07, 2015 at 03:12:26PM -0800, Jordan Justen wrote:
> On 2015-02-07 08:26:39, Laszlo Ersek wrote:
> > On 02/06/15 21:57, Gabriel L. Somlo wrote:
> > > Insert a default, OVMF-specific Type 0 (BIOS Information) structure
> > > into the SMBIOS table, unless the underlying guest VM supplies its
> > > own, overriding instance.
> > > 
> > > As an example, QEMU, while allowing the user to specifically force
> > > generation of a Type 0 structure, will not generate one by default,
> > > considering that task to be the responsibility of the BIOS itself.
> > > 
> > > Based on an earlier out-of-tree patch by Laszlo Ersek <[email protected]>
> > 
> > I'll let Jordan review this one.
> 
> It looks good. Does this need Contributed-under and Signed-off-by from
> Laszlo too?

Laszlo came up with the awesomely clever way to statically initialize
a SMBIOS structure, complete with unformatted trailing text strings !

So I lifted his Type0 definition, polished it a bit, and added the
logic deciding whether it needs to be inserted into the table or not.

As for exactly how we acknowledge that, I'm really too new at this to
have an informed opinion -- whatever you all end up deciding is completely
fine by me !

Thanks much,
--Gabriel

> > > +//
> > > +// Type definition and contents of the default Type 0 SMBIOS table.
> > > +//
> > > +#pragma pack(1)
> > > +typedef struct {
> > > +  SMBIOS_TABLE_TYPE0 Base;
> > > +  UINT8              Strings[];
> > > +} OVMF_TYPE0;
> > > +#pragma pack()
> > > +
> > > +STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
> > > +  {
> > > +    // SMBIOS_STRUCTURE Hdr
> > > +    {
> > > +      EFI_SMBIOS_TYPE_BIOS_INFORMATION, // UINT8 Type
> > > +      sizeof (SMBIOS_TABLE_TYPE0),      // UINT8 Length
> > > +    },
> > > +    1,     // SMBIOS_TABLE_STRING       Vendor
> > > +    2,     // SMBIOS_TABLE_STRING       BiosVersion
> > > +    0xE800,// UINT16                    BiosSegment
> > > +    3,     // SMBIOS_TABLE_STRING       BiosReleaseDate
> > > +    0,     // UINT8                     BiosSize
> > > +    {      // MISC_BIOS_CHARACTERISTICS BiosCharacteristics
> > > +      0,     // Reserved                                      :2
> > > +      0,     // Unknown                                       :1
> > > +      1,     // BiosCharacteristicsNotSupported               :1
> > > +             // Remaining BiosCharacteristics bits left unset :60
> > > +    },
> > > +    {      // BIOSCharacteristicsExtensionBytes[2]
> > > +      0,     // BiosReserved
> > > +      0x1C   // SystemReserved = VirtualMachineSupported |
> > > +             //                  UefiSpecificationSupported |
> > > +             //                  TargetContentDistributionEnabled
> > > +    },
> > > +    0,     // UINT8                     SystemBiosMajorRelease
> > > +    0,     // UINT8                     SystemBiosMinorRelease
> > > +    0xFF,  // UINT8                     
> > > EmbeddedControllerFirmwareMajorRelease
> > > +    0xFF   // UINT8                     
> > > EmbeddedControllerFirmwareMinorRelease
> > > +  },
> > > +  // Text strings (unformatted area)
> > > +  "EFI Development Kit II / OVMF\0"     // Vendor
> > > +  "0.1\0"                               // BiosVersion
> > > +  "02/06/2015\0"                        // BiosReleaseDate
> > > +};
> > > +

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to