diff options
author | Krzysztof Koch <krzysztof.koch@arm.com> | 2020-03-25 17:39:24 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-05-06 17:00:57 +0000 |
commit | faef5a367c8345df906be3755e15e0dabc3105b3 (patch) | |
tree | 93d22947cc6a0ebe6ad4bef4d034cd67bb5f577a | |
parent | f793bfcae94ffe81537967ac2ce3f83a56f3e73a (diff) | |
download | edk2-faef5a367c8345df906be3755e15e0dabc3105b3.zip edk2-faef5a367c8345df906be3755e15e0dabc3105b3.tar.gz edk2-faef5a367c8345df906be3755e15e0dabc3105b3.tar.bz2 |
ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installed
For Arm-based platforms, count the instances of installed tables for
each ACPI table listed as 'mandatory' in any Server Base Boot
Requirements (SBBR) specification.
Validate that the all the mandatory SBBR tables present. Report an error
for each missing table.
This new feature is optional and can be enabled with the -r command line
parameter.
Reference(s):
- Arm Server Base Boot Requirements 1.2, September 2019
- Arm Server Base Boot Requirements 1.1, May 2018
- Arm Server Base Boot Requirements 1.0, March 2016
Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c | 16 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c | 22 |
2 files changed, 38 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c index 501967c..d5b9eee 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c @@ -3,6 +3,12 @@ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Glossary:
+ - Sbbr or SBBR - Server Base Boot Requirements
+
+ @par Reference(s):
+ - Arm Server Base Boot Requirements 1.2, September 2019
**/
#include <Uefi.h>
@@ -12,6 +18,10 @@ #include "AcpiTableParser.h"
#include "AcpiView.h"
+#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
+#include "Arm/SbbrValidator.h"
+#endif
+
/**
A list of registered ACPI table parsers.
**/
@@ -216,6 +226,12 @@ ProcessAcpiTable ( }
}
+#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
+ if (GetMandatoryTableValidate ()) {
+ ArmSbbrIncrementTableCount (*AcpiTableSignature);
+ }
+#endif
+
Status = GetParser (*AcpiTableSignature, &ParserProc);
if (EFI_ERROR (Status)) {
// No registered parser found, do default handling.
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index 49c2e87..84ffb35 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -2,6 +2,12 @@ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Glossary:
+ - Sbbr or SBBR - Server Base Boot Requirements
+
+ @par Reference(s):
+ - Arm Server Base Boot Requirements 1.2, September 2019
**/
#include <Library/PrintLib.h>
@@ -16,6 +22,10 @@ #include "AcpiView.h"
#include "UefiShellAcpiViewCommandLib.h"
+#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
+#include "Arm/SbbrValidator.h"
+#endif
+
EFI_HII_HANDLE gShellAcpiViewHiiHandle = NULL;
// Report variables
@@ -438,6 +448,12 @@ AcpiView ( return EFI_UNSUPPORTED;
}
+#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
+ if (GetMandatoryTableValidate ()) {
+ ArmSbbrResetTableCounts ();
+ }
+#endif
+
// The RSDP length is 4 bytes starting at offset 20
RsdpLength = *(UINT32*)(RsdpPtr + RSDP_LENGTH_OFFSET);
@@ -466,6 +482,12 @@ AcpiView ( return EFI_NOT_FOUND;
}
+#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
+ if (GetMandatoryTableValidate ()) {
+ ArmSbbrReqsValidate ((ARM_SBBR_VERSION)GetMandatoryTableSpec ());
+ }
+#endif
+
ReportOption = GetReportOption ();
if (ReportTableList != ReportOption) {
if (((ReportSelected == ReportOption) ||
|