Public git URL: https://github.com/lersek/edk2/commits/smbios_v1

This series extends OvmfPkg/SmbiosPlatformDxe with the following
features on QEMU:
- install SMBIOS tables that are provided over fw_cfg in complete form,
- supply a default Type 0 (BIOS Information) table, and patch it as QEMU
  requests via fw_cfg,
- supply a default Type 1 (System Information) table, and patch it as
  QEMU requests via fw_cfg.

In the CSM build of SeaBIOS we plan to detect a virtual machine from the
SMBIOS tables, and key access to the debug port off that.

Testing:

* On a RHEL-6.4 qemu-kvm host, "dmidecode" reports the following in a
  Fedora 19 guest:

    # dmidecode 2.12
    # SMBIOS entry point at 0x3f8f7000
    SMBIOS 2.7 present.
    3 structures occupying 163 bytes.
    Table at 0x3F8F6000.

    Handle 0x0000, DMI type 0, 24 bytes
    BIOS Information
            Vendor: EFI Development Kit II / OVMF
            Version: 0.1
            Release Date: 06/03/2013
            Address: 0xE8000
            Runtime Size: 96 kB
            ROM Size: 64 kB
            Characteristics:
                    BIOS characteristics not supported
                    UEFI is supported
                    System is a virtual machine
            BIOS Revision: 0.1

    Handle 0x0001, DMI type 1, 27 bytes
    System Information
            Manufacturer: Red Hat
            Product Name: KVM
            Version: RHEL 6.4.0 PC
            Serial Number: n/a
            UUID: 7B20A9F5-274C-0F58-8183-A89538BCA62A
            Wake-up Type: Power Switch
            SKU Number: n/a
            Family: Red Hat Enterprise Linux

    Handle 0xFEFF, DMI type 127, 4 bytes
    End Of Table

  (In the Type 0 table, I shaped the "unclear" fields "Address" and "ROM
  Size" according to what "dmidecode" reported in a SeaBIOS guest.

  Regarding the KVM & Red Hat specific values visible in the Type 1
  table, they are not hard-wired in the series, it is field patching at
  work. The code contains neutral defaults for Type 1 too (see patch
  2/2).)

* Tested the "complete table" functionality with a hex-edited Type 3
  table passed with the qemu option

  -smbios file=.../type3.smbios

  and with "dmidecode" in the Fedora 19 guest again.

* Since we don't export Type 4 tables yet (one for each VCPU), but we do
  export an MADT ACPI table, I checked the following guests, each with 2
  VCPUs, for any CPU count regressions:

  - Fedora 19:
    - "/proc/cpuinfo" lists 2 processors
    - the dmesg says:

      efi:  SMBIOS=0x3f8f7000  ACPI=0x3f8ff000  ACPI 2.0=0x3f8ff014
      [...]
      SMBIOS 2.7 present.
      DMI: Red Hat KVM, BIOS 0.1 06/03/2013
      [...]
      Using ACPI (MADT) for SMP configuration information
      smpboot: Allowing 2 CPUs, 0 hotplug CPUs

  - RHEL-6:
    - "/proc/cpuinfo" lists 2 processors
    - the dmesg says:

      EFI v2.31 by EDK II
       SMBIOS=0x3f8f7000  ACPI=0x3f8ff000  ACPI 2.0=0x3f8ff014
      [...]
      DMI 2.7 present.
      SMBIOS version 2.7 @ 0x3F8F7000
      DMI: Red Hat KVM, BIOS 0.1 06/03/2013
      [...]
      Using ACPI (MADT) for SMP configuration information
      SMP: Allowing 2 CPUs, 0 hotplug CPUs

  - Windows 2008 R2 SP1:
    - CSM build of SeaBIOS included in OVMF.fd,
    - tested with SVN r14386, r14378, r14377, and r14372 reverted, in
      this order (the chronologically first one, r14372, breaks Windows
      boot in general, see
      <http://thread.gmane.org/gmane.comp.bios.tianocore.devel/3033>;
      the other commits depend on r14372),
    - Windows Task Manager | Performance | CPU Usage History
      displays two charts.

  - Windows 8 Consumer Preview Build 8250:
    - CSM not needed,
    - for this guest too it is necessary to back out r14372 and
      dependent commits (see above),
    - Task Manager | Performance | Change graph to | Logical processors
      displays two charts.


Laszlo Ersek (3):
  OvmfPkg/SmbiosPlatformDxe: install tables and save fields coming from
    QEMU
  OvmfPkg/SmbiosPlatformDxe: install and patch default table for SMBIOS
    Type 0
  OvmfPkg/SmbiosPlatformDxe: install and patch default table for SMBIOS
    Type 1

 OvmfPkg/SmbiosPlatformDxe/Qemu.h                |   52 ++
 OvmfPkg/SmbiosPlatformDxe/QemuInternal.h        |  281 +++++++++
 OvmfPkg/SmbiosPlatformDxe/Qemu.c                |  702 +++++++++++++++++++++++
 OvmfPkg/SmbiosPlatformDxe/QemuType0.c           |  180 ++++++
 OvmfPkg/SmbiosPlatformDxe/QemuType1.c           |  178 ++++++
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c   |    4 +
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf |    6 +
 7 files changed, 1403 insertions(+), 0 deletions(-)
 create mode 100644 OvmfPkg/SmbiosPlatformDxe/Qemu.h
 create mode 100644 OvmfPkg/SmbiosPlatformDxe/QemuInternal.h
 create mode 100644 OvmfPkg/SmbiosPlatformDxe/Qemu.c
 create mode 100644 OvmfPkg/SmbiosPlatformDxe/QemuType0.c
 create mode 100644 OvmfPkg/SmbiosPlatformDxe/QemuType1.c


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to