[PATCH] acpi: iort: update IORT node revision check

Sunny Wang Sunny.Wang at arm.com
Fri Apr 1 06:39:51 UTC 2022


Looks good to me! Thanks for fixing the issue, Ivan.

Reviewed-by: Sunny Wang <sunny.wang at arm.com>

-----Original Message-----
From: fwts-devel <fwts-devel-bounces at lists.ubuntu.com> On Behalf Of Ivan Hu
Sent: 01 April 2022 07:07
To: fwts-devel at lists.ubuntu.com
Subject: [PATCH] acpi: iort: update IORT node revision check

BugLink: https://bugs.launchpad.net/fwts/+bug/1963841

Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
 src/acpi/iort/iort.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/src/acpi/iort/iort.c b/src/acpi/iort/iort.c
index f2a8a062..dfd9c074 100644
--- a/src/acpi/iort/iort.c
+++ b/src/acpi/iort/iort.c
@@ -60,7 +60,35 @@ static void iort_node_check(
 {
        fwts_acpi_table_iort_node *node = (fwts_acpi_table_iort_node *)data;

-       if (node->type == 1 || node->type == 3 || node->type == 4) {
+       if (node->type == 1 || node->type == 2 || node->type == 4) {
+               if (node->revision > 4) {
+                       *passed = false;
+                       fwts_failed(fw, LOG_LEVEL_LOW,
+                               "IORTNodeRevisionInvalid",
+                               "IORT Node Revision field is 0x%2.2" PRIx8
+                               " and should be less than 5.",
+                               node->revision);
+               }
+       } else if (node->type == 3 || node->type == 6) {
+               if (node->revision > 3) {
+                       *passed = false;
+                       fwts_failed(fw, LOG_LEVEL_LOW,
+                               "IORTNodeRevisionInvalid",
+                               "IORT Node Revision field is 0x%2.2" PRIx8
+                               " and should be less than 4.",
+                               node->revision);
+               }
+       } else if (node->type == 5) {
+               if (node->revision > 2) {
+                       *passed = false;
+                       fwts_failed(fw, LOG_LEVEL_LOW,
+                               "IORTNodeRevisionInvalid",
+                               "IORT Node Revision field is 0x%2.2" PRIx8
+                               " and should be less than 3.",
+                               node->revision);
+               }
+       } else {
+               /* type 0 */
                if (node->revision > 1) {
                        *passed = false;
                        fwts_failed(fw, LOG_LEVEL_LOW,
@@ -69,9 +97,7 @@ static void iort_node_check(
                                " and should be zero or one.",
                                node->revision);
                }
-
-       } else
-               fwts_acpi_fixed_value(fw, LOG_LEVEL_MEDIUM, "IORT", "IORT Node Revision", node->revision, 0, passed);
+       }

        fwts_acpi_reserved_zero("IORT", "Node Reserved", node->reserved, passed);

--
2.17.1


--
fwts-devel mailing list
fwts-devel at lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the fwts-devel mailing list