diff mbox

[1/2] acpi: madt: Add support for ACPI 6.0a

Message ID 1468797499-8715-1-git-send-email-jhugo@codeaurora.org
State Rejected
Headers show

Commit Message

Jeffrey Hugo July 17, 2016, 11:18 p.m. UTC
ACPI 6.0 Errata A corrects the GIC ITS length to 20 bytes, and also
increases the MADT revision to 4.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
---
 src/acpi/madt/madt.c | 48 ++++++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 20 deletions(-)

Comments

Al Stone July 19, 2016, 9:17 p.m. UTC | #1
On 07/17/2016 05:18 PM, Jeffrey Hugo wrote:
> ACPI 6.0 Errata A corrects the GIC ITS length to 20 bytes, and also
> increases the MADT revision to 4.
> 
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---
>  src/acpi/madt/madt.c | 48 ++++++++++++++++++++++++++++--------------------
>  1 file changed, 28 insertions(+), 20 deletions(-)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index b65b89e..0926f64 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -84,27 +84,27 @@
>   * subtable is doing okay.  And that's what our tests below check.
>   *
>   *
> - * FADT Major Version ->       1    3    4     4     5     5     6
> - * FADT Minor Version ->       x    x    x     x     x     1     0
> - * MADT revision ->            1    1    2     3     3     3     3
> - * Spec Version ->            1.0  2.0  3.0b  4.0a  5.0b  5.1a  6.0
> + * FADT Major Version ->       1    3    4     4     5     5     6    6
> + * FADT Minor Version ->       x    x    x     x     x     1     0    0
> + * MADT revision ->            1    1    2     3     3     3     3    4
> + * Spec Version ->            1.0  2.0  3.0b  4.0a  5.0b  5.1a  6.0  6.0a
>   * Subtable Name	Type  Expected Length ->
> - * Processor Local APIC  0x0    8    8    8     8     8     8     8
> - * IO APIC               0x1   12   12   12    12    12    12    12
> - * Int Src Override      0x2   10   10   10    10    10    10    10
> - * NMI Src               0x3    8    8    8     8     8     8     8
> - * Local APIC NMI Struct 0x4    6    6    6     6     6     6     6
> - * Local APIC Addr Ovrrd 0x5        16   12    12    12    12    12
> - * IO SAPIC              0x6        20   16    16    16    16    16
> - * Local SAPIC           0x7         8  >16   >16   >16   >16   >16
> - * Platform Int Src      0x8        16   16    16    16    16    16
> - * Proc Local x2APIC     0x9                   16    16    16    16
> - * Local x2APIC NMI      0xa                   12    12    12    12
> - * GICC CPU I/F          0xb                         40    76    80
> - * GICD                  0xc                         24    24    24
> - * GICv2m MSI            0xd                               24    24
> - * GICR                  0xe                               16    16
> - * GIC ITS               0xf                                     20
> + * Processor Local APIC  0x0    8    8    8     8     8     8     8    8
> + * IO APIC               0x1   12   12   12    12    12    12    12   12
> + * Int Src Override      0x2   10   10   10    10    10    10    10   10
> + * NMI Src               0x3    8    8    8     8     8     8     8    8
> + * Local APIC NMI Struct 0x4    6    6    6     6     6     6     6    6
> + * Local APIC Addr Ovrrd 0x5        16   12    12    12    12    12   12
> + * IO SAPIC              0x6        20   16    16    16    16    16   16
> + * Local SAPIC           0x7         8  >16   >16   >16   >16   >16  >16
> + * Platform Int Src      0x8        16   16    16    16    16    16   16
> + * Proc Local x2APIC     0x9                   16    16    16    16   16
> + * Local x2APIC NMI      0xa                   12    12    12    12   12
> + * GICC CPU I/F          0xb                         40    76    80   80
> + * GICD                  0xc                         24    24    24   24
> + * GICv2m MSI            0xd                               24    24   24
> + * GICR                  0xe                               16    16   16
> + * GIC ITS               0xf                                     16   20

I would fix the ITS length here for 6.0 and make it 20, as it really should be.
As mentioned in another thread, it's not exactly what the spec said, but it is
also clear the spec is wrong and we don't want to tell people to break something
that actually works (i.e., change a proper length of 20 to 16).

>   *
>   * In the table, each length entry is what should be in the length
>   * field of the subtable, and -- in general -- it should match the
> @@ -185,6 +185,14 @@ static struct acpi_madt_subtable_lengths spec_info[] = {
>  		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
>  			     16, 16, 12, 80, 24, 24, 16, 16 }
>  	},
> +	{ /* for ACPI 6.0a */
> +		.major_version = 6,
> +		.minor_version = 0,
> +		.madt_version = 4,
> +		.num_types = 16,
> +		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
> +			     16, 16, 12, 80, 24, 24, 16, 20 }
> +	},
>  	{ /* terminator */
>  		.major_version = 0,
>  		.minor_version = 0,
> 

Apart from the comment above, this patch looks good.  Thanks for doing this!
diff mbox

Patch

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index b65b89e..0926f64 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -84,27 +84,27 @@ 
  * subtable is doing okay.  And that's what our tests below check.
  *
  *
- * FADT Major Version ->       1    3    4     4     5     5     6
- * FADT Minor Version ->       x    x    x     x     x     1     0
- * MADT revision ->            1    1    2     3     3     3     3
- * Spec Version ->            1.0  2.0  3.0b  4.0a  5.0b  5.1a  6.0
+ * FADT Major Version ->       1    3    4     4     5     5     6    6
+ * FADT Minor Version ->       x    x    x     x     x     1     0    0
+ * MADT revision ->            1    1    2     3     3     3     3    4
+ * Spec Version ->            1.0  2.0  3.0b  4.0a  5.0b  5.1a  6.0  6.0a
  * Subtable Name	Type  Expected Length ->
- * Processor Local APIC  0x0    8    8    8     8     8     8     8
- * IO APIC               0x1   12   12   12    12    12    12    12
- * Int Src Override      0x2   10   10   10    10    10    10    10
- * NMI Src               0x3    8    8    8     8     8     8     8
- * Local APIC NMI Struct 0x4    6    6    6     6     6     6     6
- * Local APIC Addr Ovrrd 0x5        16   12    12    12    12    12
- * IO SAPIC              0x6        20   16    16    16    16    16
- * Local SAPIC           0x7         8  >16   >16   >16   >16   >16
- * Platform Int Src      0x8        16   16    16    16    16    16
- * Proc Local x2APIC     0x9                   16    16    16    16
- * Local x2APIC NMI      0xa                   12    12    12    12
- * GICC CPU I/F          0xb                         40    76    80
- * GICD                  0xc                         24    24    24
- * GICv2m MSI            0xd                               24    24
- * GICR                  0xe                               16    16
- * GIC ITS               0xf                                     20
+ * Processor Local APIC  0x0    8    8    8     8     8     8     8    8
+ * IO APIC               0x1   12   12   12    12    12    12    12   12
+ * Int Src Override      0x2   10   10   10    10    10    10    10   10
+ * NMI Src               0x3    8    8    8     8     8     8     8    8
+ * Local APIC NMI Struct 0x4    6    6    6     6     6     6     6    6
+ * Local APIC Addr Ovrrd 0x5        16   12    12    12    12    12   12
+ * IO SAPIC              0x6        20   16    16    16    16    16   16
+ * Local SAPIC           0x7         8  >16   >16   >16   >16   >16  >16
+ * Platform Int Src      0x8        16   16    16    16    16    16   16
+ * Proc Local x2APIC     0x9                   16    16    16    16   16
+ * Local x2APIC NMI      0xa                   12    12    12    12   12
+ * GICC CPU I/F          0xb                         40    76    80   80
+ * GICD                  0xc                         24    24    24   24
+ * GICv2m MSI            0xd                               24    24   24
+ * GICR                  0xe                               16    16   16
+ * GIC ITS               0xf                                     16   20
  *
  * In the table, each length entry is what should be in the length
  * field of the subtable, and -- in general -- it should match the
@@ -185,6 +185,14 @@  static struct acpi_madt_subtable_lengths spec_info[] = {
 		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
 			     16, 16, 12, 80, 24, 24, 16, 16 }
 	},
+	{ /* for ACPI 6.0a */
+		.major_version = 6,
+		.minor_version = 0,
+		.madt_version = 4,
+		.num_types = 16,
+		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+			     16, 16, 12, 80, 24, 24, 16, 20 }
+	},
 	{ /* terminator */
 		.major_version = 0,
 		.minor_version = 0,