public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Krzysztof Koch" <krzysztof.koch@arm.com>
To: <devel@edk2.groups.io>
Cc: <ray.ni@intel.com>, <zhichao.gao@intel.com>,
	<Sami.Mujawar@arm.com>, <Matteo.Carlini@arm.com>,
	<Laura.Moretta@arm.com>, <nd@arm.com>
Subject: [PATCH v1 3/3] ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installed
Date: Wed, 25 Mar 2020 09:39:24 +0000	[thread overview]
Message-ID: <20200325093924.22884-4-krzysztof.koch@arm.com> (raw)
In-Reply-To: <20200325093924.22884-1-krzysztof.koch@arm.com>

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>
---

Notes:
    v1:
    - check if SBBR mandatory ACPI tables are installed [Krzysztof]

 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c | 16 ++++++++++++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c        | 22 ++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c
index 501967c4dde680809c56e5d79ed744a1013a69e1..d5b9eee5232399c4df50d0f9598810413759fed6 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 49c2e87c430d7fb57793f6405ebee91cb8f6cbaa..84ffb3595750a3e7d65fdb82c0f90bc2d76c659e 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)  ||
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


  parent reply	other threads:[~2020-03-25  9:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25  9:39 [PATCH v1 0/3] Check if required ACPI tables are installed Krzysztof Koch
2020-03-25  9:39 ` [PATCH v1 1/3] ShellPkg: acpiview: Add -r parameter for table requirements validation Krzysztof Koch
2020-03-25  9:39 ` [PATCH v1 2/3] ShellPkg: acpiview: Add library for SBBR ACPI " Krzysztof Koch
2020-03-25  9:39 ` Krzysztof Koch [this message]
2020-04-03 10:41 ` [PATCH v1 0/3] Check if required ACPI tables are installed Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325093924.22884-4-krzysztof.koch@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox