public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* OVMF and SMBIOS
@ 2019-05-28 15:18 Tomas Pilar (tpilar)
  2019-05-28 17:06 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Pilar (tpilar) @ 2019-05-28 15:18 UTC (permalink / raw)
  To: Devel EDK2


[-- Attachment #1.1: Type: text/plain, Size: 404 bytes --]

Hi,

I am trying to create kvm instance using libvirt and Qemu and OVMF that also has SMBIOS included. My current version of Qemu only supports type 0 and type 1 SMBIOS tables so I specify those. However, when I use smbiosview in the UEFI shell, I get back "SMBIOS not found".

I attach my current libvirt xml specification for the kvm host.

Does anyone have any immediate ideas?

Cheers,
Tom

[-- Attachment #1.2: Type: text/html, Size: 2483 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu.xml --]
[-- Type: text/xml; name="qemu.xml", Size: 2682 bytes --]

<domain type='kvm' id='5'>
  <name>Qemu Test</name>
  <uuid>f6433268-9cc0-4aee-848f-819c27ff3b62</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64'>hvm</type>
    <bootmenu enable='yes' timeout='3000'/>
    <loader readonly='yes' secure='no' type='pflash'>/tmp/ovmf-test/OVMF_CODE.fd</loader>
    <nvram template='/tmp/ovmf-test/OVMF_VARS.fd'>/tmp/ovmf-test/OVMF_VARS2.fd</nvram>
    <smbios mode='sysinfo' />
  </os>
  <sysinfo type='smbios'>
    <bios>
      <entry name='vendor'>Sfc Qemu</entry>
    </bios>
    <system>
      <entry name='manufacturer'>Qemu</entry>
      <entry name='product'>Virt-Manager</entry>
      <entry name='version'>0.9.4</entry>
      <entry name='uuid'>f6433268-9cc0-4aee-848f-819c27ff3b62</entry>
    </system>
  </sysinfo>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>preserve</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>preserve</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        [ADDRESS]
      </source>
    </hostdev>
    <serial type='file'>
      <source path='/tmp/ovmf-test/serial0.log'/>
      <target port='0' />
      <alias name='serial0'/>
    </serial>
    <serial type='file'>
      <source path='/tmp/ovmf-test/serial1.log'/>
      <target port='1' />
      <alias name='serial1'/>
    </serial>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </rng>
  </devices>
</domain>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] OVMF and SMBIOS
  2019-05-28 15:18 OVMF and SMBIOS Tomas Pilar (tpilar)
@ 2019-05-28 17:06 ` Laszlo Ersek
  2019-05-29  9:44   ` Tomas Pilar (tpilar)
  0 siblings, 1 reply; 3+ messages in thread
From: Laszlo Ersek @ 2019-05-28 17:06 UTC (permalink / raw)
  To: devel, tpilar

On 05/28/19 17:18, Tomas Pilar (tpilar) wrote:
> Hi,
> 
> I am trying to create kvm instance using libvirt and Qemu and OVMF that also has SMBIOS included. My current version of Qemu only supports type 0 and type 1 SMBIOS tables so I specify those. However, when I use smbiosview in the UEFI shell, I get back "SMBIOS not found".
> 
> I attach my current libvirt xml specification for the kvm host.
> 
> Does anyone have any immediate ideas?

The SMBIOS fw_cfg interface between QEMU and guest firmware was reworked
in the QEMU v2.1.0 release (primarily in commit c97294ec1b9e, "SMBIOS:
Build aggregate smbios tables and entry point", 2014-05-05).

If you use an earlier QEMU release, or else you use a machine type
earlier than pc-i440fx-2.1, then the new SMBIOS fw_cfg interface is not
exposed to guest firmware.

And, upstream OVMF never gained patches for the "legacy" SMBIOS fw_cfg
interface. I had posted patches for that in 2013, but they were not
accepted. The thread starts here:

[edk2] [PATCH 0/3] OvmfPkg: basic SMBIOS support on QEMU
https://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg02917.html

We (RH) carried forward these patches for quite some time in RHEL7 and
(IIRC) Fedora as well, but QEMU v2.1.0 was released in Aug 2014 if I
read the git log right, and so we too dropped the downstream-only
patches at some point, in favor of the new interface.

Based on your libvirt domain xml... It looks likely that you use the
qemu-kvm package that is part of base RHEL7. That package is based on
upstream QEMU 1.5.3, and so it indeed lacks support for the "new" SMBIOS
interface. If you can use CentOS, you could try the qemu-kvm-ev package
instead. (That one is based on upstream 2.12.)

Alternatively, you could check the "OVMF-20160202-2.gitd7c0dfa.el7"
package (or earlier), which should (a) still include the
above-referenced patches, and (b) still run on the 1.5.3-based qemu-kvm
emulator. (Later OVMF packages would only provide the SMM_REQUIRE
firmware binary, which does not boot on the 1.5.3-based qemu-kvm emulator.)

Thanks
Laszlo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] OVMF and SMBIOS
  2019-05-28 17:06 ` [edk2-devel] " Laszlo Ersek
@ 2019-05-29  9:44   ` Tomas Pilar (tpilar)
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Pilar (tpilar) @ 2019-05-29  9:44 UTC (permalink / raw)
  To: devel, lersek

On 28/05/2019 18:06, Laszlo Ersek wrote:
> On 05/28/19 17:18, Tomas Pilar (tpilar) wrote:
>> Hi,
>>
>> I am trying to create kvm instance using libvirt and Qemu and OVMF that also has SMBIOS included. My current version of Qemu only supports type 0 and type 1 SMBIOS tables so I specify those. However, when I use smbiosview in the UEFI shell, I get back "SMBIOS not found".
>>
>> I attach my current libvirt xml specification for the kvm host.
>>
>> Does anyone have any immediate ideas?
> The SMBIOS fw_cfg interface between QEMU and guest firmware was reworked
> in the QEMU v2.1.0 release (primarily in commit c97294ec1b9e, "SMBIOS:
> Build aggregate smbios tables and entry point", 2014-05-05).
>
> If you use an earlier QEMU release, or else you use a machine type
> earlier than pc-i440fx-2.1, then the new SMBIOS fw_cfg interface is not
> exposed to guest firmware.
>
> And, upstream OVMF never gained patches for the "legacy" SMBIOS fw_cfg
> interface. I had posted patches for that in 2013, but they were not
> accepted. The thread starts here:
>
> [edk2] [PATCH 0/3] OvmfPkg: basic SMBIOS support on QEMU
> https://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg02917.html
>
> We (RH) carried forward these patches for quite some time in RHEL7 and
> (IIRC) Fedora as well, but QEMU v2.1.0 was released in Aug 2014 if I
> read the git log right, and so we too dropped the downstream-only
> patches at some point, in favor of the new interface.
>
> Based on your libvirt domain xml... It looks likely that you use the
> qemu-kvm package that is part of base RHEL7. That package is based on
> upstream QEMU 1.5.3, and so it indeed lacks support for the "new" SMBIOS
> interface. If you can use CentOS, you could try the qemu-kvm-ev package
> instead. (That one is based on upstream 2.12.)
>
> Alternatively, you could check the "OVMF-20160202-2.gitd7c0dfa.el7"
> package (or earlier), which should (a) still include the
> above-referenced patches, and (b) still run on the 1.5.3-based qemu-kvm
> emulator. (Later OVMF packages would only provide the SMM_REQUIRE
> firmware binary, which does not boot on the 1.5.3-based qemu-kvm emulator.)
>
> Thanks
> Laszlo
Thank you Laszlo, that was incredibly thorough! I should be able to work with this.

Cheers,
Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-29  9:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28 15:18 OVMF and SMBIOS Tomas Pilar (tpilar)
2019-05-28 17:06 ` [edk2-devel] " Laszlo Ersek
2019-05-29  9:44   ` Tomas Pilar (tpilar)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox