madt: fix the Local APIC NMI processor UID checking
diff mbox series

Message ID 1540979110-29263-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show
Series
  • madt: fix the Local APIC NMI processor UID checking
Related show

Commit Message

Ivan Hu Oct. 31, 2018, 9:45 a.m. UTC
ACPI specification define 0xFF value for ACPI processor UID on Local APIC NMI
Structure as "A value of 0xFF signifies that this applies to all processors in
the machine", we shouldn't match it as invalid UID.

Medium failures: 1
 madt: LAPICNMI has no matching processor UID 255

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

Comments

Alex Hung Nov. 6, 2018, 2:37 a.m. UTC | #1
On 2018-10-31 5:45 p.m., Ivan Hu wrote:
> ACPI specification define 0xFF value for ACPI processor UID on Local APIC NMI
> Structure as "A value of 0xFF signifies that this applies to all processors in
> the machine", we shouldn't match it as invalid UID.
> 
> Medium failures: 1
>  madt: LAPICNMI has no matching processor UID 255
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/acpi/madt/madt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index 19a6e14..8814166 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -312,6 +312,14 @@ static ACPI_OBJECT_TYPE madt_find_processor_uid(fwts_framework *fw,
>  				    "UID %" PRIu64 ".", table_name, uid);
>  			return listint->type;
>  		}
> +
> +		if ((uid == 0xFF) && (strcmp(table_name, "LAPICNMI") == 0)) {
> +			fwts_passed(fw, "MADT %s has processor "
> +					"UID 0x%" PRIx64 " which signifies "
> +					"that this applies to all processors "
> +					"in the machine.", table_name, uid);
> +				return listint->type;
> +		}
>  	}
>  
>  	sprintf(table_label, "MADT%sUidMismatch", table_name);
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King Nov. 13, 2018, 9:17 a.m. UTC | #2
On 31/10/2018 09:45, Ivan Hu wrote:
> ACPI specification define 0xFF value for ACPI processor UID on Local APIC NMI
> Structure as "A value of 0xFF signifies that this applies to all processors in
> the machine", we shouldn't match it as invalid UID.
> 
> Medium failures: 1
>  madt: LAPICNMI has no matching processor UID 255
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/acpi/madt/madt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index 19a6e14..8814166 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -312,6 +312,14 @@ static ACPI_OBJECT_TYPE madt_find_processor_uid(fwts_framework *fw,
>  				    "UID %" PRIu64 ".", table_name, uid);
>  			return listint->type;
>  		}
> +
> +		if ((uid == 0xFF) && (strcmp(table_name, "LAPICNMI") == 0)) {
> +			fwts_passed(fw, "MADT %s has processor "
> +					"UID 0x%" PRIx64 " which signifies "
> +					"that this applies to all processors "
> +					"in the machine.", table_name, uid);
> +				return listint->type;
> +		}
>  	}
>  
>  	sprintf(table_label, "MADT%sUidMismatch", table_name);
> 

Well spotted.

Acked-by: Colin Ian King <colin.king@canonical.com>

Patch
diff mbox series

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index 19a6e14..8814166 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -312,6 +312,14 @@  static ACPI_OBJECT_TYPE madt_find_processor_uid(fwts_framework *fw,
 				    "UID %" PRIu64 ".", table_name, uid);
 			return listint->type;
 		}
+
+		if ((uid == 0xFF) && (strcmp(table_name, "LAPICNMI") == 0)) {
+			fwts_passed(fw, "MADT %s has processor "
+					"UID 0x%" PRIx64 " which signifies "
+					"that this applies to all processors "
+					"in the machine.", table_name, uid);
+				return listint->type;
+		}
 	}
 
 	sprintf(table_label, "MADT%sUidMismatch", table_name);