qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
#ifndef QEMU_SMBIOS_H
|
|
|
|
#define QEMU_SMBIOS_H
|
2016-06-29 15:29:06 +02:00
|
|
|
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
/*
|
|
|
|
* SMBIOS Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Alex Williamson <alex.williamson@hp.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
|
|
* the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-08-16 15:18:29 +02:00
|
|
|
#include "qemu/option.h"
|
|
|
|
|
2014-04-23 15:42:41 +02:00
|
|
|
#define SMBIOS_MAX_TYPE 127
|
|
|
|
|
2015-08-12 04:08:19 +02:00
|
|
|
/* memory area description, used by type 19 table */
|
|
|
|
struct smbios_phys_mem_area {
|
|
|
|
uint64_t address;
|
|
|
|
uint64_t length;
|
|
|
|
};
|
|
|
|
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
/*
|
|
|
|
* SMBIOS spec defined tables
|
|
|
|
*/
|
2015-09-07 11:39:28 +02:00
|
|
|
typedef enum SmbiosEntryPointType {
|
|
|
|
SMBIOS_ENTRY_POINT_21,
|
|
|
|
SMBIOS_ENTRY_POINT_30,
|
|
|
|
} SmbiosEntryPointType;
|
|
|
|
|
|
|
|
/* SMBIOS Entry Point
|
|
|
|
* There are two types of entry points defined in the SMBIOS specification
|
2016-03-29 11:48:44 +02:00
|
|
|
* (see below). BIOS must place the entry point(s) at a 16-byte-aligned
|
2015-09-07 11:39:28 +02:00
|
|
|
* address between 0xf0000 and 0xfffff. Note that either entry point type
|
|
|
|
* can be used in a 64-bit target system, except that SMBIOS 2.1 entry point
|
|
|
|
* only allows the SMBIOS struct table to reside below 4GB address space.
|
|
|
|
*/
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2015-09-07 11:39:28 +02:00
|
|
|
/* SMBIOS 2.1 (32-bit) Entry Point
|
|
|
|
* - introduced since SMBIOS 2.1
|
|
|
|
* - supports structure table below 4GB only
|
2014-04-23 15:42:39 +02:00
|
|
|
*/
|
2015-09-07 11:39:28 +02:00
|
|
|
struct smbios_21_entry_point {
|
2014-04-23 15:42:39 +02:00
|
|
|
uint8_t anchor_string[4];
|
|
|
|
uint8_t checksum;
|
|
|
|
uint8_t length;
|
|
|
|
uint8_t smbios_major_version;
|
|
|
|
uint8_t smbios_minor_version;
|
|
|
|
uint16_t max_structure_size;
|
|
|
|
uint8_t entry_point_revision;
|
|
|
|
uint8_t formatted_area[5];
|
|
|
|
uint8_t intermediate_anchor_string[5];
|
|
|
|
uint8_t intermediate_checksum;
|
|
|
|
uint16_t structure_table_length;
|
|
|
|
uint32_t structure_table_address;
|
|
|
|
uint16_t number_of_structures;
|
|
|
|
uint8_t smbios_bcd_revision;
|
|
|
|
} QEMU_PACKED;
|
|
|
|
|
2015-09-07 11:39:28 +02:00
|
|
|
/* SMBIOS 3.0 (64-bit) Entry Point
|
|
|
|
* - introduced since SMBIOS 3.0
|
|
|
|
* - supports structure table at 64-bit address space
|
|
|
|
*/
|
|
|
|
struct smbios_30_entry_point {
|
|
|
|
uint8_t anchor_string[5];
|
|
|
|
uint8_t checksum;
|
|
|
|
uint8_t length;
|
|
|
|
uint8_t smbios_major_version;
|
|
|
|
uint8_t smbios_minor_version;
|
|
|
|
uint8_t smbios_doc_rev;
|
|
|
|
uint8_t entry_point_revision;
|
|
|
|
uint8_t reserved;
|
|
|
|
uint32_t structure_table_max_size;
|
|
|
|
uint64_t structure_table_address;
|
|
|
|
} QEMU_PACKED;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
struct smbios_21_entry_point ep21;
|
|
|
|
struct smbios_30_entry_point ep30;
|
|
|
|
} QEMU_PACKED SmbiosEntryPoint;
|
|
|
|
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
/* This goes at the beginning of every SMBIOS structure. */
|
|
|
|
struct smbios_structure_header {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t length;
|
|
|
|
uint16_t handle;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
|
|
|
/* SMBIOS type 0 - BIOS Information */
|
|
|
|
struct smbios_type_0 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t vendor_str;
|
|
|
|
uint8_t bios_version_str;
|
|
|
|
uint16_t bios_starting_address_segment;
|
|
|
|
uint8_t bios_release_date_str;
|
|
|
|
uint8_t bios_rom_size;
|
2014-05-19 16:09:54 +02:00
|
|
|
uint64_t bios_characteristics;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
uint8_t bios_characteristics_extension_bytes[2];
|
|
|
|
uint8_t system_bios_major_release;
|
|
|
|
uint8_t system_bios_minor_release;
|
|
|
|
uint8_t embedded_controller_major_release;
|
|
|
|
uint8_t embedded_controller_minor_release;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
smbios: Encode UUID according to SMBIOS specification
Differently from older versions, SMBIOS version 2.6 is explicit about
the encoding of UUID fields:
> Although RFC 4122 recommends network byte order for all fields, the PC
> industry (including the ACPI, UEFI, and Microsoft specifications) has
> consistently used little-endian byte encoding for the first three fields:
> time_low, time_mid, time_hi_and_version. The same encoding, also known as
> wire format, should also be used for the SMBIOS representation of the UUID.
>
> The UUID {00112233-4455-6677-8899-AABBCCDDEEFF} would thus be represented
> as 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF.
The dmidecode tool implements this and decodes the above "wire format"
when SMBIOS version >= 2.6. We moved from SMBIOS version 2.4 to 2.8 when
we started building the SMBIOS entry point inside QEMU, on commit
c97294ec1b9e36887e119589d456557d72ab37b5.
Change smbios_build_type_1_table() to encode the UUID as specified.
To make sure we won't change the guest-visible UUID when upgrading to a
newer QEMU version, keep the old behavior on pc-*-2.1 and older.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-10-29 14:26:08 +01:00
|
|
|
/* UUID encoding. The time_* fields are little-endian, as specified by SMBIOS
|
|
|
|
* version 2.6.
|
|
|
|
*/
|
|
|
|
struct smbios_uuid {
|
|
|
|
uint32_t time_low;
|
|
|
|
uint16_t time_mid;
|
|
|
|
uint16_t time_hi_and_version;
|
|
|
|
uint8_t clock_seq_hi_and_reserved;
|
|
|
|
uint8_t clock_seq_low;
|
|
|
|
uint8_t node[6];
|
|
|
|
} QEMU_PACKED;
|
|
|
|
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
/* SMBIOS type 1 - System Information */
|
|
|
|
struct smbios_type_1 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t manufacturer_str;
|
|
|
|
uint8_t product_name_str;
|
|
|
|
uint8_t version_str;
|
|
|
|
uint8_t serial_number_str;
|
smbios: Encode UUID according to SMBIOS specification
Differently from older versions, SMBIOS version 2.6 is explicit about
the encoding of UUID fields:
> Although RFC 4122 recommends network byte order for all fields, the PC
> industry (including the ACPI, UEFI, and Microsoft specifications) has
> consistently used little-endian byte encoding for the first three fields:
> time_low, time_mid, time_hi_and_version. The same encoding, also known as
> wire format, should also be used for the SMBIOS representation of the UUID.
>
> The UUID {00112233-4455-6677-8899-AABBCCDDEEFF} would thus be represented
> as 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF.
The dmidecode tool implements this and decodes the above "wire format"
when SMBIOS version >= 2.6. We moved from SMBIOS version 2.4 to 2.8 when
we started building the SMBIOS entry point inside QEMU, on commit
c97294ec1b9e36887e119589d456557d72ab37b5.
Change smbios_build_type_1_table() to encode the UUID as specified.
To make sure we won't change the guest-visible UUID when upgrading to a
newer QEMU version, keep the old behavior on pc-*-2.1 and older.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-10-29 14:26:08 +01:00
|
|
|
struct smbios_uuid uuid;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
uint8_t wake_up_type;
|
|
|
|
uint8_t sku_number_str;
|
|
|
|
uint8_t family_str;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2014-04-23 15:42:39 +02:00
|
|
|
/* SMBIOS type 2 - Base Board */
|
|
|
|
struct smbios_type_2 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t manufacturer_str;
|
|
|
|
uint8_t product_str;
|
|
|
|
uint8_t version_str;
|
|
|
|
uint8_t serial_number_str;
|
|
|
|
uint8_t asset_tag_number_str;
|
|
|
|
uint8_t feature_flags;
|
|
|
|
uint8_t location_str;
|
|
|
|
uint16_t chassis_handle;
|
|
|
|
uint8_t board_type;
|
|
|
|
uint8_t contained_element_count;
|
|
|
|
/* contained elements follow */
|
|
|
|
} QEMU_PACKED;
|
|
|
|
|
|
|
|
/* SMBIOS type 3 - System Enclosure (v2.7) */
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
struct smbios_type_3 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t manufacturer_str;
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t version_str;
|
|
|
|
uint8_t serial_number_str;
|
|
|
|
uint8_t asset_tag_number_str;
|
|
|
|
uint8_t boot_up_state;
|
|
|
|
uint8_t power_supply_state;
|
|
|
|
uint8_t thermal_state;
|
|
|
|
uint8_t security_status;
|
|
|
|
uint32_t oem_defined;
|
|
|
|
uint8_t height;
|
|
|
|
uint8_t number_of_power_cords;
|
|
|
|
uint8_t contained_element_count;
|
2014-04-23 15:42:39 +02:00
|
|
|
uint8_t sku_number_str;
|
|
|
|
/* contained elements follow */
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2014-04-23 15:42:39 +02:00
|
|
|
/* SMBIOS type 4 - Processor Information (v2.6) */
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
struct smbios_type_4 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t socket_designation_str;
|
|
|
|
uint8_t processor_type;
|
|
|
|
uint8_t processor_family;
|
|
|
|
uint8_t processor_manufacturer_str;
|
|
|
|
uint32_t processor_id[2];
|
|
|
|
uint8_t processor_version_str;
|
|
|
|
uint8_t voltage;
|
|
|
|
uint16_t external_clock;
|
|
|
|
uint16_t max_speed;
|
|
|
|
uint16_t current_speed;
|
|
|
|
uint8_t status;
|
|
|
|
uint8_t processor_upgrade;
|
|
|
|
uint16_t l1_cache_handle;
|
|
|
|
uint16_t l2_cache_handle;
|
|
|
|
uint16_t l3_cache_handle;
|
2014-04-23 15:42:39 +02:00
|
|
|
uint8_t serial_number_str;
|
|
|
|
uint8_t asset_tag_number_str;
|
|
|
|
uint8_t part_number_str;
|
|
|
|
uint8_t core_count;
|
|
|
|
uint8_t core_enabled;
|
|
|
|
uint8_t thread_count;
|
|
|
|
uint16_t processor_characteristics;
|
|
|
|
uint16_t processor_family2;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2014-04-23 15:42:39 +02:00
|
|
|
/* SMBIOS type 16 - Physical Memory Array (v2.7) */
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
struct smbios_type_16 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t location;
|
|
|
|
uint8_t use;
|
|
|
|
uint8_t error_correction;
|
|
|
|
uint32_t maximum_capacity;
|
|
|
|
uint16_t memory_error_information_handle;
|
|
|
|
uint16_t number_of_memory_devices;
|
2014-04-23 15:42:39 +02:00
|
|
|
uint64_t extended_maximum_capacity;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
2014-04-23 15:42:39 +02:00
|
|
|
|
|
|
|
/* SMBIOS type 17 - Memory Device (v2.8) */
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
struct smbios_type_17 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint16_t physical_memory_array_handle;
|
|
|
|
uint16_t memory_error_information_handle;
|
|
|
|
uint16_t total_width;
|
|
|
|
uint16_t data_width;
|
|
|
|
uint16_t size;
|
|
|
|
uint8_t form_factor;
|
|
|
|
uint8_t device_set;
|
|
|
|
uint8_t device_locator_str;
|
|
|
|
uint8_t bank_locator_str;
|
|
|
|
uint8_t memory_type;
|
|
|
|
uint16_t type_detail;
|
2014-04-23 15:42:39 +02:00
|
|
|
uint16_t speed;
|
|
|
|
uint8_t manufacturer_str;
|
|
|
|
uint8_t serial_number_str;
|
|
|
|
uint8_t asset_tag_number_str;
|
|
|
|
uint8_t part_number_str;
|
|
|
|
uint8_t attributes;
|
|
|
|
uint32_t extended_size;
|
2014-05-19 16:09:55 +02:00
|
|
|
uint16_t configured_clock_speed;
|
|
|
|
uint16_t minimum_voltage;
|
|
|
|
uint16_t maximum_voltage;
|
|
|
|
uint16_t configured_voltage;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2014-04-23 15:42:39 +02:00
|
|
|
/* SMBIOS type 19 - Memory Array Mapped Address (v2.7) */
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
struct smbios_type_19 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint32_t starting_address;
|
|
|
|
uint32_t ending_address;
|
|
|
|
uint16_t memory_array_handle;
|
|
|
|
uint8_t partition_width;
|
2014-04-23 15:42:39 +02:00
|
|
|
uint64_t extended_starting_address;
|
|
|
|
uint64_t extended_ending_address;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
|
|
|
/* SMBIOS type 32 - System Boot Information */
|
|
|
|
struct smbios_type_32 {
|
|
|
|
struct smbios_structure_header header;
|
|
|
|
uint8_t reserved[6];
|
|
|
|
uint8_t boot_status;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
|
|
|
/* SMBIOS type 127 -- End-of-table */
|
|
|
|
struct smbios_type_127 {
|
|
|
|
struct smbios_structure_header header;
|
2011-08-31 12:38:01 +02:00
|
|
|
} QEMU_PACKED;
|
qemu: Add support for SMBIOS command line otions (Alex Williamson)
Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.
Binary SMBIOS entries can be generated as follows:
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
These can then be passed to the BIOS using this switch:
-smbios file=smbios_type_1.bin
Command line generation supports the following syntax:
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
[,uuid=$(uuidgen)][,sku=str][,family=str]
For instance, to add a serial number to the type 1 table:
-smbios type=1,serial=0123456789
Interface is extensible to support more fields/tables as needed.
aliguori: remove texi formatting from help output
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-17 20:59:56 +02:00
|
|
|
|
2016-12-22 16:18:28 +01:00
|
|
|
void smbios_entry_add(QemuOpts *opts, Error **errp);
|
2015-09-07 11:39:28 +02:00
|
|
|
void smbios_set_cpuid(uint32_t version, uint32_t features);
|
|
|
|
void smbios_set_defaults(const char *manufacturer, const char *product,
|
|
|
|
const char *version, bool legacy_mode,
|
|
|
|
bool uuid_encoded, SmbiosEntryPointType ep_type);
|
|
|
|
uint8_t *smbios_get_table_legacy(size_t *length);
|
|
|
|
void smbios_get_tables(const struct smbios_phys_mem_area *mem_array,
|
|
|
|
const unsigned int mem_array_size,
|
|
|
|
uint8_t **tables, size_t *tables_len,
|
|
|
|
uint8_t **anchor, size_t *anchor_len);
|
2016-06-29 15:29:06 +02:00
|
|
|
#endif /* QEMU_SMBIOS_H */
|