summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-03 14:57:35 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-03 14:57:35 +0100
commit5b396a8c36f490cbc93fa1aa91cea4a03b94de54 (patch)
tree2aa4064f7ccf1dc38ebc02307beedfbf584a3ef7
parentc58f3911b282e14991d540394e82a4be547466e5 (diff)
parent24496b8d27d95c4b317039e2c48f262cfd40fb4d (diff)
Merge remote-tracking branch 'remotes/lersek/tags/smbios_lp_1821884_20190503' into staging
Fix <https://bugs.launchpad.net/qemu/+bug/1821884>: "Extend uefi-test-tools to report SMBIOS location". # gpg: Signature made Fri 03 May 2019 10:10:31 BST # gpg: using RSA key D39DA71E0D496CFA # gpg: Good signature from "Laszlo Ersek <lersek@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: F5D9 660F 1BA5 F310 A95A C5E0 466A EAE0 6125 3988 # Subkey fingerprint: B3A5 5D3F 88A8 90ED 2E63 3E8D D39D A71E 0D49 6CFA * remotes/lersek/tags/smbios_lp_1821884_20190503: tests/uefi-boot-images: report the SMBIOS entry point structures tests/uefi-test-tools: report the SMBIOS entry point structures Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2bin11776 -> 12288 bytes
-rw-r--r--tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2bin11776 -> 11776 bytes
-rw-r--r--tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2bin12800 -> 13312 bytes
-rw-r--r--tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2bin13312 -> 13312 bytes
-rw-r--r--tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c23
-rw-r--r--tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf2
-rw-r--r--tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h25
7 files changed, 40 insertions, 10 deletions
diff --git a/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2
index ac0b7b1b8f..d588cf3ebd 100644
--- a/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2
+++ b/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2
Binary files differ
diff --git a/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2
index d20fa7c819..552c7a7ddc 100644
--- a/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2
+++ b/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2
Binary files differ
diff --git a/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2
index 26c882baea..c66ad15519 100644
--- a/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2
+++ b/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2
Binary files differ
diff --git a/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2
index 9ec3c1f20b..f59e07c854 100644
--- a/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2
+++ b/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2
Binary files differ
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
index b208e17fb0..75891e68ec 100644
--- a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
@@ -14,6 +14,7 @@
#include <Guid/Acpi.h>
#include <Guid/BiosTablesTest.h>
+#include <Guid/SmBios.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
@@ -55,6 +56,8 @@ BiosTablesTestMain (
volatile BIOS_TABLES_TEST *BiosTablesTest;
CONST VOID *Rsdp10;
CONST VOID *Rsdp20;
+ CONST VOID *Smbios21;
+ CONST VOID *Smbios30;
CONST EFI_CONFIGURATION_TABLE *ConfigTable;
CONST EFI_CONFIGURATION_TABLE *ConfigTablesEnd;
volatile EFI_GUID *InverseSignature;
@@ -77,31 +80,43 @@ BiosTablesTestMain (
}
//
- // Locate both gEfiAcpi10TableGuid and gEfiAcpi20TableGuid config tables in
- // one go.
+ // Locate all the gEfiAcpi10TableGuid, gEfiAcpi20TableGuid,
+ // gEfiSmbiosTableGuid, gEfiSmbios3TableGuid config tables in one go.
//
Rsdp10 = NULL;
Rsdp20 = NULL;
+ Smbios21 = NULL;
+ Smbios30 = NULL;
ConfigTable = gST->ConfigurationTable;
ConfigTablesEnd = gST->ConfigurationTable + gST->NumberOfTableEntries;
- while ((Rsdp10 == NULL || Rsdp20 == NULL) && ConfigTable < ConfigTablesEnd) {
+ while ((Rsdp10 == NULL || Rsdp20 == NULL ||
+ Smbios21 == NULL || Smbios30 == NULL) &&
+ ConfigTable < ConfigTablesEnd) {
if (CompareGuid (&ConfigTable->VendorGuid, &gEfiAcpi10TableGuid)) {
Rsdp10 = ConfigTable->VendorTable;
} else if (CompareGuid (&ConfigTable->VendorGuid, &gEfiAcpi20TableGuid)) {
Rsdp20 = ConfigTable->VendorTable;
+ } else if (CompareGuid (&ConfigTable->VendorGuid, &gEfiSmbiosTableGuid)) {
+ Smbios21 = ConfigTable->VendorTable;
+ } else if (CompareGuid (&ConfigTable->VendorGuid, &gEfiSmbios3TableGuid)) {
+ Smbios30 = ConfigTable->VendorTable;
}
++ConfigTable;
}
AsciiPrint ("%a: BiosTablesTest=%p Rsdp10=%p Rsdp20=%p\n",
gEfiCallerBaseName, Pages, Rsdp10, Rsdp20);
+ AsciiPrint ("%a: Smbios21=%p Smbios30=%p\n", gEfiCallerBaseName, Smbios21,
+ Smbios30);
//
- // Store the RSD PTR address(es) first, then the signature second.
+ // Store the config table addresses first, then the signature second.
//
BiosTablesTest = Pages;
BiosTablesTest->Rsdp10 = (UINTN)Rsdp10;
BiosTablesTest->Rsdp20 = (UINTN)Rsdp20;
+ BiosTablesTest->Smbios21 = (UINTN)Smbios21;
+ BiosTablesTest->Smbios30 = (UINTN)Smbios30;
MemoryFence();
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
index 924d8a80d0..708bc1e798 100644
--- a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
@@ -35,6 +35,8 @@
gBiosTablesTestGuid
gEfiAcpi10TableGuid
gEfiAcpi20TableGuid
+ gEfiSmbios3TableGuid
+ gEfiSmbiosTableGuid
[Packages]
MdePkg/MdePkg.dec
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
index 0b72c61254..7a74c121d5 100644
--- a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
@@ -1,13 +1,14 @@
/** @file
- Expose the address(es) of the ACPI RSD PTR table(s) in a MB-aligned structure
- to the hypervisor.
+ Expose the address(es) of the ACPI RSD PTR table(s) and the SMBIOS entry
+ point(s) in a MB-aligned structure to the hypervisor.
The hypervisor locates the MB-aligned structure based on the signature GUID
- that is at offset 0 in the structure. Once the RSD PTR address(es) are
- retrieved, the hypervisor may perform various ACPI checks.
+ that is at offset 0 in the structure. Once the RSD PTR and SMBIOS anchor
+ address(es) are retrieved, the hypervisor may perform various ACPI and SMBIOS
+ checks.
- This feature is a development aid, for supporting ACPI table unit tests in
- hypervisors. Do not enable in production builds.
+ This feature is a development aid, for supporting ACPI and SMBIOS table unit
+ tests in hypervisors. Do not enable in production builds.
Copyright (C) 2019, Red Hat, Inc.
@@ -61,6 +62,18 @@ typedef struct {
//
EFI_PHYSICAL_ADDRESS Rsdp10;
EFI_PHYSICAL_ADDRESS Rsdp20;
+ //
+ // The Smbios21 and Smbios30 fields may be read when the signature GUID
+ // matches. Smbios21 is the guest-physical address of the SMBIOS 2.1 (32-bit)
+ // Entry Point Structure from the SMBIOS v3.2.0 specification, in 8-byte
+ // little endian representation. Smbios30 is the guest-physical address of
+ // the SMBIOS 3.0 (64-bit) Entry Point Structure from the same specification,
+ // in the same representation. Each of these fields may be zero
+ // (independently of the other) if the UEFI System Table does not provide the
+ // corresponding UEFI Configuration Table.
+ //
+ EFI_PHYSICAL_ADDRESS Smbios21;
+ EFI_PHYSICAL_ADDRESS Smbios30;
} BIOS_TABLES_TEST;
#pragma pack ()