diff mbox series

acpi: madt: add GICC new flag and length change (mantis 2285, 2303)

Message ID 20231227082623.11307-1-ivan.hu@canonical.com
State Accepted
Headers show
Series acpi: madt: add GICC new flag and length change (mantis 2285, 2303) | expand

Commit Message

ivanhu Dec. 27, 2023, 8:26 a.m. UTC
BugLink:https://bugs.launchpad.net/fwts/+bug/2047212
Add MADT GICC new flags and length change in ACPI 6.5

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/acpi/madt/madt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index 318ac668..1d50e55a 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -1091,6 +1091,10 @@  static int madt_gicc(fwts_framework *fw,
 		mask = 0xfffffff8;
 		start = 3;
 	}
+	if (hdr->length == 82) {	/* ACPI 6.5 */
+		mask = 0xfffffff0;
+		start = 4;
+	}
 	if (gic->flags & mask)
 		fwts_failed(fw, LOG_LEVEL_MEDIUM,
 			    "MADTGICFLags",
@@ -1103,6 +1107,15 @@  static int madt_gicc(fwts_framework *fw,
 			    "properly set to zero.",
 			    madt_sub_names[hdr->type], start);
 
+	if (hdr->length == 82) {	/* ACPI 6.5 */
+		/* If the Enabled bit is set, Online Capable bit is reserved and must be zero. */
+		if ((gic->flags & 1) && (gic->flags & (1 << 3)))
+			fwts_failed(fw, LOG_LEVEL_MEDIUM,
+				    "MADTGICBadFLag",
+				    "MADT %s, flags, if Enable bit is set, the Online Capable bit "
+				    "is reserved and must be zero.",madt_sub_names[hdr->type]);
+	}	
+
 	if (gic->parking_protocol_version != 0 &&
 	    gic->parking_protocol_version != 1)
 		fwts_failed(fw, LOG_LEVEL_MEDIUM,