mbox series

[v2,0/3] Add support for loading SMBIOS OEM strings from a file

Message ID 20200923104102.2068416-1-berrange@redhat.com
Headers show
Series Add support for loading SMBIOS OEM strings from a file | expand

Message

Daniel P. Berrangé Sept. 23, 2020, 10:40 a.m. UTC
I previously added support for SMBIOS OEM strings tables but only
allowed for data to be passed inline. Potential users indicated they
wanted to pass some quite large data blobs which is inconvenient todo
inline. Thus I'm adding support for passing the data from a file.

In testing this I discovered the hard way that on x86 we're limited to
using the SMBIOS 2.1 entry point currently. This has a maximum size of
0xffff, and if you exceed this all sorts of wierd behaviour happens.

QEMU forces SMBIOS 2.1 on x86 because the default SeaBIOS firmware does
not support SMBIOS 3.0. The EDK2 firmware supports SMBIOS 3.0 and QEMU
defaults to this on the ARM virt machine type.

This series adds support for checking the SMBIOS 2.1 limits to protect
users from impossible to diagnose problems.

There is also a fix needed to SeaBIOS which fails to check for
integer overflow when it appends the type 0 table.

  https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/3EMIOY=
6YS6MG5UQN3JJJS2A3DJZOVFR6/

IIUC, SMBIOS 3.0 should only be limited by what you can fit into RAM,
but in testing, EDK2 appears to hang shortly after the SMBIOS 3.0 data
size exceeds 128 KB. I've not spotted an obvious flaw in EDK2 or QEMU,
nor do I attempt to enforce a limit in QEMU for SMBIOS 3.0.

Changed in v2:

 - Drop the patches that allowed choice of SMBIOS 2.1 / 3.0 entry
   point. There's no compelling reason to need 3.0 on x86 while
   aarch64 is 3.0 only.

Daniel P. Berrang=C3=A9 (3):
  hw/smbios: support loading OEM strings values from a file
  hw/smbios: report error if table size is too large
  qemu-options: document SMBIOS type 11 settings

 hw/smbios/smbios.c | 86 +++++++++++++++++++++++++++++++++++++++-------
 qemu-options.hx    | 41 ++++++++++++++++++++++
 2 files changed, 114 insertions(+), 13 deletions(-)

--=20
2.26.2

Comments

no-reply@patchew.org Sept. 23, 2020, 1:19 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20200923104102.2068416-1-berrange@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

Host machine cpu: x86_64
Target machine cpu family: x86
Target machine cpu: x86_64
../src/meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
Configuring ninjatool using configuration
---
done
copying static files... ... Compiling C object libqemu-x86_64-softmmu.fa.p/target_i386_seg_helper.c.obj
../src/hw/smbios/smbios.c: In function 'save_opt_one':
../src/hw/smbios/smbios.c:978:18: error: too few arguments to function 'qemu_open'
  978 |         int fd = qemu_open(value, O_RDONLY);
      |                  ^~~~~~~~~
In file included from ../src/hw/smbios/smbios.c:18:
/tmp/qemu-test/src/include/qemu/osdep.h:505:5: note: declared here
  505 | int qemu_open(const char *name, int flags, Error **errp);
      |     ^~~~~~~~~
make: *** [Makefile.ninja:1391: libcommon.fa.p/hw_smbios_smbios.c.obj] Error 1
make: *** Waiting for unfinished jobs....
done
copying extra files... done
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--rm', '--label', 'com.qemu.instance.uuid=2a6817d121314e55a2f8ae80f641f8d8', '-u', '1003', '--security-opt', 'seccomp=unconfined', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-_uibmeyt/src/docker-src.2020-09-23-09.16.19.12753:/var/tmp/qemu:z,ro', 'qemu/fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=2a6817d121314e55a2f8ae80f641f8d8
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-_uibmeyt/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    3m26.585s
user    0m21.696s


The full log is available at
http://patchew.org/logs/20200923104102.2068416-1-berrange@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org Sept. 23, 2020, 1:23 p.m. UTC | #2
Patchew URL: https://patchew.org/QEMU/20200923104102.2068416-1-berrange@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

C linker for the host machine: cc ld.bfd 2.27-43
Host machine cpu family: x86_64
Host machine cpu: x86_64
../src/meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
Configuring ninjatool using configuration
---
Compiling C object libcommon.fa.p/hw_timer_hpet.c.o
Compiling C object libcommon.fa.p/ui_input-keymap.c.o
../src/hw/smbios/smbios.c: In function 'save_opt_one':
../src/hw/smbios/smbios.c:978:9: error: too few arguments to function 'qemu_open'
         int fd = qemu_open(value, O_RDONLY);
         ^
In file included from ../src/hw/smbios/smbios.c:18:0:
/tmp/qemu-test/src/include/qemu/osdep.h:505:5: note: declared here
 int qemu_open(const char *name, int flags, Error **errp);
     ^
make: *** [libcommon.fa.p/hw_smbios_smbios.c.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 709, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--rm', '--label', 'com.qemu.instance.uuid=5dd36d109cb849d0af8a1a26424a4d18', '-u', '1003', '--security-opt', 'seccomp=unconfined', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-7ak3dvd1/src/docker-src.2020-09-23-09.20.24.18349:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=5dd36d109cb849d0af8a1a26424a4d18
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-7ak3dvd1/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    3m30.634s
user    0m22.614s


The full log is available at
http://patchew.org/logs/20200923104102.2068416-1-berrange@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com