Patchwork [3/3] acpi: acpitables: Add checks for MADT GIC and GICD

login
register
mail settings
Submitter Colin King
Date Sept. 18, 2012, 11:23 a.m.
Message ID <1347967380-24722-4-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/184677/
State Accepted
Headers show

Comments

Colin King - Sept. 18, 2012, 11:23 a.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpitables/acpitables.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
Alex Hung - Sept. 20, 2012, 6:17 a.m.
On 09/18/2012 07:23 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpitables/acpitables.c |   15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/src/acpi/acpitables/acpitables.c b/src/acpi/acpitables/acpitables.c
> index 7f1a748..3a71456 100644
> --- a/src/acpi/acpitables/acpitables.c
> +++ b/src/acpi/acpitables/acpitables.c
> @@ -397,6 +397,21 @@ static void acpi_table_check_madt(fwts_framework *fw, fwts_acpi_table_info *tabl
>   				skip = (sizeof(fwts_acpi_madt_local_x2apic_nmi));
>   			}
>   			break;
> +		case 11: {
> +				fwts_acpi_madt_gic *gic = (fwts_acpi_madt_gic*)data;
> +
> +				if (gic->flags & 0xfffffffc)
> +					fwts_failed(fw, LOG_LEVEL_MEDIUM, "MADTGICFLags",
> +						"MADT GIC, flags, bits 2..31 are reserved "
> +						"and should be zero, but are set as: %lx.",
> +						(unsigned long int)gic->flags);
> +				skip = sizeof(fwts_acpi_madt_gic);
> +			}
> +			break;
> +		case 12:
> +			/* Not much to sanity check */
> +			skip = sizeof(fwts_acpi_madt_gicd);
> +			break;
>   		default:
>   			skip = 0;
>   			break;
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Sept. 20, 2012, 8:22 a.m.
On Tue, Sep 18, 2012 at 7:23 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/acpitables/acpitables.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/acpi/acpitables/acpitables.c b/src/acpi/acpitables/acpitables.c
> index 7f1a748..3a71456 100644
> --- a/src/acpi/acpitables/acpitables.c
> +++ b/src/acpi/acpitables/acpitables.c
> @@ -397,6 +397,21 @@ static void acpi_table_check_madt(fwts_framework *fw, fwts_acpi_table_info *tabl
>                                 skip = (sizeof(fwts_acpi_madt_local_x2apic_nmi));
>                         }
>                         break;
> +               case 11: {
> +                               fwts_acpi_madt_gic *gic = (fwts_acpi_madt_gic*)data;
> +
> +                               if (gic->flags & 0xfffffffc)
> +                                       fwts_failed(fw, LOG_LEVEL_MEDIUM, "MADTGICFLags",
> +                                               "MADT GIC, flags, bits 2..31 are reserved "
> +                                               "and should be zero, but are set as: %lx.",
> +                                               (unsigned long int)gic->flags);
> +                               skip = sizeof(fwts_acpi_madt_gic);
> +                       }
> +                       break;
> +               case 12:
> +                       /* Not much to sanity check */
> +                       skip = sizeof(fwts_acpi_madt_gicd);
> +                       break;
>                 default:
>                         skip = 0;
>                         break;
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpi/acpitables/acpitables.c b/src/acpi/acpitables/acpitables.c
index 7f1a748..3a71456 100644
--- a/src/acpi/acpitables/acpitables.c
+++ b/src/acpi/acpitables/acpitables.c
@@ -397,6 +397,21 @@  static void acpi_table_check_madt(fwts_framework *fw, fwts_acpi_table_info *tabl
 				skip = (sizeof(fwts_acpi_madt_local_x2apic_nmi));
 			}
 			break;
+		case 11: {
+				fwts_acpi_madt_gic *gic = (fwts_acpi_madt_gic*)data;
+
+				if (gic->flags & 0xfffffffc)
+					fwts_failed(fw, LOG_LEVEL_MEDIUM, "MADTGICFLags",
+						"MADT GIC, flags, bits 2..31 are reserved "
+						"and should be zero, but are set as: %lx.",
+						(unsigned long int)gic->flags);
+				skip = sizeof(fwts_acpi_madt_gic);
+			}
+			break;
+		case 12: 
+			/* Not much to sanity check */
+			skip = sizeof(fwts_acpi_madt_gicd);
+			break;
 		default:
 			skip = 0;
 			break;