All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-04-25 10:43 ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Philippe Mathieu-Daudé, Igor Mammedov

Repo:      https://github.com/lersek/qemu.git
Branch:    smbios_lp_1821884
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884

In

  [Qemu-devel] [PATCH for 4.1 v2 09/13]
  tests: acpi: ignore SMBIOS tests when UEFI firmware is used

at

  http://mid.mail-archive.com/1553605799-168605-10-git-send-email-imammedo@redhat.com
  https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07037.html

Igor had to temporarily exclude SMBIOS unit testing with UEFI guests.

Let the BiosTablesTest guest UEFI app report the SMBIOS entry point(s),
so that SMBIOS unit tests can cover UEFI guests.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>

Thanks
Laszlo

Laszlo Ersek (2):
  tests/uefi-test-tools: report the SMBIOS entry point structures
  tests/uefi-boot-images: report the SMBIOS entry point structures

 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
 7 files changed, 40 insertions(+), 10 deletions(-)

-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-04-25 10:43 ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Igor Mammedov, Philippe Mathieu-Daudé

Repo:      https://github.com/lersek/qemu.git
Branch:    smbios_lp_1821884
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884

In

  [Qemu-devel] [PATCH for 4.1 v2 09/13]
  tests: acpi: ignore SMBIOS tests when UEFI firmware is used

at

  http://mid.mail-archive.com/1553605799-168605-10-git-send-email-imammedo@redhat.com
  https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07037.html

Igor had to temporarily exclude SMBIOS unit testing with UEFI guests.

Let the BiosTablesTest guest UEFI app report the SMBIOS entry point(s),
so that SMBIOS unit tests can cover UEFI guests.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>

Thanks
Laszlo

Laszlo Ersek (2):
  tests/uefi-test-tools: report the SMBIOS entry point structures
  tests/uefi-boot-images: report the SMBIOS entry point structures

 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
 7 files changed, 40 insertions(+), 10 deletions(-)

-- 
2.19.1.3.g30247aa5d201



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

* [Qemu-devel] [PATCH 1/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-04-25 10:43   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Philippe Mathieu-Daudé, Igor Mammedov

On UEFI systems, the SMBIOS entry point (a.k.a. anchor) structures are
found similarly to the ACPI RSD PTR table(s): by scanning the
ConfigurationTable array in the EFI system table for well-known GUIDs.

Locate the SMBIOS 2.1 (32-bit) and 3.0 (64-bit) anchors in the
BiosTablesTest UEFI application, and report the addresses in new fields
appended to the BIOS_TABLES_TEST structure.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     | 25 +++++++++++++++-----
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  2 ++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 23 ++++++++++++++----
 3 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
index 0b72c61254af..7a74c121d596 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 ()
 
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
index 924d8a80d00b..708bc1e7982b 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/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
index b208e17fb00f..75891e68ec20 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();
 
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 1/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-04-25 10:43   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Igor Mammedov, Philippe Mathieu-Daudé

On UEFI systems, the SMBIOS entry point (a.k.a. anchor) structures are
found similarly to the ACPI RSD PTR table(s): by scanning the
ConfigurationTable array in the EFI system table for well-known GUIDs.

Locate the SMBIOS 2.1 (32-bit) and 3.0 (64-bit) anchors in the
BiosTablesTest UEFI application, and report the addresses in new fields
appended to the BIOS_TABLES_TEST structure.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     | 25 +++++++++++++++-----
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  2 ++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 23 ++++++++++++++----
 3 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
index 0b72c61254af..7a74c121d596 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 ()
 
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
index 924d8a80d00b..708bc1e7982b 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/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
index b208e17fb00f..75891e68ec20 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();
 
-- 
2.19.1.3.g30247aa5d201




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

* [Qemu-devel] [PATCH 2/2] tests/uefi-boot-images: report the SMBIOS entry point structures
@ 2019-04-25 10:43   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Philippe Mathieu-Daudé, Igor Mammedov

Rebuild the "bios-tables-test" UEFI boot images with the SMBIOS entry
point reporting that has been added in the previous patch.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 | Bin 11776 -> 12288 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2     | Bin 11776 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2    | Bin 12800 -> 13312 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2  | Bin 13312 -> 13312 bytes
 4 files changed, 0 insertions(+), 0 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 ac0b7b1b8f89..d588cf3ebd7d 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 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 d20fa7c81925..552c7a7ddce6 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 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 26c882baeaba..c66ad155196d 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 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 9ec3c1f20bb2..f59e07c85415 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 differ
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 2/2] tests/uefi-boot-images: report the SMBIOS entry point structures
@ 2019-04-25 10:43   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-04-25 10:43 UTC (permalink / raw)
  To: qemu devel list; +Cc: Igor Mammedov, Philippe Mathieu-Daudé

Rebuild the "bios-tables-test" UEFI boot images with the SMBIOS entry
point reporting that has been added in the previous patch.

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 | Bin 11776 -> 12288 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2     | Bin 11776 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2    | Bin 12800 -> 13312 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2  | Bin 13312 -> 13312 bytes
 4 files changed, 0 insertions(+), 0 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 ac0b7b1b8f89..d588cf3ebd7d 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 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 d20fa7c81925..552c7a7ddce6 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 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 26c882baeaba..c66ad155196d 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 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 9ec3c1f20bb2..f59e07c85415 100644
Binary files a/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 and b/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 differ
-- 
2.19.1.3.g30247aa5d201



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

* Re: [Qemu-devel] [PATCH 1/2] tests/uefi-test-tools: report the SMBIOS entry point structures
  2019-04-25 10:43   ` Laszlo Ersek
  (?)
@ 2019-04-25 11:40   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-04-25 11:40 UTC (permalink / raw)
  To: Laszlo Ersek, qemu devel list; +Cc: Igor Mammedov

On 4/25/19 12:43 PM, Laszlo Ersek wrote:
> On UEFI systems, the SMBIOS entry point (a.k.a. anchor) structures are
> found similarly to the ACPI RSD PTR table(s): by scanning the
> ConfigurationTable array in the EFI system table for well-known GUIDs.
> 
> Locate the SMBIOS 2.1 (32-bit) and 3.0 (64-bit) anchors in the
> BiosTablesTest UEFI application, and report the addresses in new fields
> appended to the BIOS_TABLES_TEST structure.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     | 25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 23 ++++++++++++++----
>  3 files changed, 40 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
> index 0b72c61254af..7a74c121d596 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 ()
>  
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
> index 924d8a80d00b..708bc1e7982b 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/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> index b208e17fb00f..75891e68ec20 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();
>  
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
  2019-04-25 10:43 ` Laszlo Ersek
                   ` (2 preceding siblings ...)
  (?)
@ 2019-04-25 12:43 ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-04-25 12:43 UTC (permalink / raw)
  To: Laszlo Ersek, qemu devel list; +Cc: Igor Mammedov

On 4/25/19 12:43 PM, Laszlo Ersek wrote:
> Repo:      https://github.com/lersek/qemu.git
> Branch:    smbios_lp_1821884
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> 
> In
> 
>   [Qemu-devel] [PATCH for 4.1 v2 09/13]
>   tests: acpi: ignore SMBIOS tests when UEFI firmware is used
> 
> at
> 
>   http://mid.mail-archive.com/1553605799-168605-10-git-send-email-imammedo@redhat.com
>   https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07037.html
> 
> Igor had to temporarily exclude SMBIOS unit testing with UEFI guests.
> 
> Let the BiosTablesTest guest UEFI app report the SMBIOS entry point(s),
> so that SMBIOS unit tests can cover UEFI guests.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (2):
>   tests/uefi-test-tools: report the SMBIOS entry point structures
>   tests/uefi-boot-images: report the SMBIOS entry point structures
> 
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
>  tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
>  tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
>  tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
>  tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
>  7 files changed, 40 insertions(+), 10 deletions(-)
> 

Series:
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02  9:16   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-05-02  9:16 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: qemu devel list, Philippe Mathieu-Daudé

Hi Igor,

On 04/25/19 12:43, Laszlo Ersek wrote:
> Repo:      https://github.com/lersek/qemu.git
> Branch:    smbios_lp_1821884
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> 
> In
> 
>   [Qemu-devel] [PATCH for 4.1 v2 09/13]
>   tests: acpi: ignore SMBIOS tests when UEFI firmware is used
> 
> at
> 
>   http://mid.mail-archive.com/1553605799-168605-10-git-send-email-imammedo@redhat.com
>   https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07037.html
> 
> Igor had to temporarily exclude SMBIOS unit testing with UEFI guests.
> 
> Let the BiosTablesTest guest UEFI app report the SMBIOS entry point(s),
> so that SMBIOS unit tests can cover UEFI guests.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (2):
>   tests/uefi-test-tools: report the SMBIOS entry point structures
>   tests/uefi-boot-images: report the SMBIOS entry point structures
> 
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
>  tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
>  tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
>  tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
>  tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
>  7 files changed, 40 insertions(+), 10 deletions(-)
> 

can you ACK or test (or both) this series, please?

Thanks
Laszlo

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

* Re: [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02  9:16   ` Laszlo Ersek
  0 siblings, 0 replies; 14+ messages in thread
From: Laszlo Ersek @ 2019-05-02  9:16 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: Philippe Mathieu-Daudé, qemu devel list

Hi Igor,

On 04/25/19 12:43, Laszlo Ersek wrote:
> Repo:      https://github.com/lersek/qemu.git
> Branch:    smbios_lp_1821884
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> 
> In
> 
>   [Qemu-devel] [PATCH for 4.1 v2 09/13]
>   tests: acpi: ignore SMBIOS tests when UEFI firmware is used
> 
> at
> 
>   http://mid.mail-archive.com/1553605799-168605-10-git-send-email-imammedo@redhat.com
>   https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07037.html
> 
> Igor had to temporarily exclude SMBIOS unit testing with UEFI guests.
> 
> Let the BiosTablesTest guest UEFI app report the SMBIOS entry point(s),
> so that SMBIOS unit tests can cover UEFI guests.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (2):
>   tests/uefi-test-tools: report the SMBIOS entry point structures
>   tests/uefi-boot-images: report the SMBIOS entry point structures
> 
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
>  tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
>  tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
>  tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
>  tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
>  7 files changed, 40 insertions(+), 10 deletions(-)
> 

can you ACK or test (or both) this series, please?

Thanks
Laszlo


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

* Re: [Qemu-devel] [PATCH 1/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02 14:46     ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2019-05-02 14:46 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: qemu devel list, Philippe Mathieu-Daudé

On Thu, 25 Apr 2019 12:43:25 +0200
Laszlo Ersek <lersek@redhat.com> wrote:

> On UEFI systems, the SMBIOS entry point (a.k.a. anchor) structures are
> found similarly to the ACPI RSD PTR table(s): by scanning the
> ConfigurationTable array in the EFI system table for well-known GUIDs.
> 
> Locate the SMBIOS 2.1 (32-bit) and 3.0 (64-bit) anchors in the
> BiosTablesTest UEFI application, and report the addresses in new fields
> appended to the BIOS_TABLES_TEST structure.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     | 25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 23 ++++++++++++++----
>  3 files changed, 40 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
> index 0b72c61254af..7a74c121d596 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 ()
>  
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
> index 924d8a80d00b..708bc1e7982b 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/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> index b208e17fb00f..75891e68ec20 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();
>  

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

* Re: [Qemu-devel] [PATCH 1/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02 14:46     ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2019-05-02 14:46 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Philippe Mathieu-Daudé, qemu devel list

On Thu, 25 Apr 2019 12:43:25 +0200
Laszlo Ersek <lersek@redhat.com> wrote:

> On UEFI systems, the SMBIOS entry point (a.k.a. anchor) structures are
> found similarly to the ACPI RSD PTR table(s): by scanning the
> ConfigurationTable array in the EFI system table for well-known GUIDs.
> 
> Locate the SMBIOS 2.1 (32-bit) and 3.0 (64-bit) anchors in the
> BiosTablesTest UEFI application, and report the addresses in new fields
> appended to the BIOS_TABLES_TEST structure.
> 
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     | 25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 23 ++++++++++++++----
>  3 files changed, 40 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
> index 0b72c61254af..7a74c121d596 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 ()
>  
> diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
> index 924d8a80d00b..708bc1e7982b 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/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
> index b208e17fb00f..75891e68ec20 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();
>  



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

* Re: [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02 14:48   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2019-05-02 14:48 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: qemu devel list, Philippe Mathieu-Daudé

On Thu, 25 Apr 2019 12:43:24 +0200
Laszlo Ersek <lersek@redhat.com> wrote:

> Repo:      https://github.com/lersek/qemu.git
> Branch:    smbios_lp_1821884
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
[...]
> 
> Laszlo Ersek (2):
>   tests/uefi-test-tools: report the SMBIOS entry point structures
>   tests/uefi-boot-images: report the SMBIOS entry point structures

Tested-by: Igor Mammedov <imammedo@redhat.com>

> 
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
>  tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
>  tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
>  tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
>  tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
>  7 files changed, 40 insertions(+), 10 deletions(-)
> 

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

* Re: [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures
@ 2019-05-02 14:48   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2019-05-02 14:48 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Philippe Mathieu-Daudé, qemu devel list

On Thu, 25 Apr 2019 12:43:24 +0200
Laszlo Ersek <lersek@redhat.com> wrote:

> Repo:      https://github.com/lersek/qemu.git
> Branch:    smbios_lp_1821884
> Launchpad: https://bugs.launchpad.net/qemu/+bug/1821884
[...]
> 
> Laszlo Ersek (2):
>   tests/uefi-test-tools: report the SMBIOS entry point structures
>   tests/uefi-boot-images: report the SMBIOS entry point structures

Tested-by: Igor Mammedov <imammedo@redhat.com>

> 
>  tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  25 +++++++++++++++-----
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |   2 ++
>  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   |  23 ++++++++++++++----
>  tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 11776 -> 12288 bytes
>  tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 11776 -> 11776 bytes
>  tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 12800 -> 13312 bytes
>  tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 13312 -> 13312 bytes
>  7 files changed, 40 insertions(+), 10 deletions(-)
> 



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

end of thread, other threads:[~2019-05-02 15:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25 10:43 [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: report the SMBIOS entry point structures Laszlo Ersek
2019-04-25 10:43 ` Laszlo Ersek
2019-04-25 10:43 ` [Qemu-devel] [PATCH 1/2] " Laszlo Ersek
2019-04-25 10:43   ` Laszlo Ersek
2019-04-25 11:40   ` Philippe Mathieu-Daudé
2019-05-02 14:46   ` Igor Mammedov
2019-05-02 14:46     ` Igor Mammedov
2019-04-25 10:43 ` [Qemu-devel] [PATCH 2/2] tests/uefi-boot-images: " Laszlo Ersek
2019-04-25 10:43   ` Laszlo Ersek
2019-04-25 12:43 ` [Qemu-devel] [PATCH 0/2] tests/uefi-test-tools: " Philippe Mathieu-Daudé
2019-05-02  9:16 ` Laszlo Ersek
2019-05-02  9:16   ` Laszlo Ersek
2019-05-02 14:48 ` Igor Mammedov
2019-05-02 14:48   ` Igor Mammedov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.