diff mbox series

[RFC,1/2] acpi: update madt revisions to ACPI 6.5.next

Message ID 7106e6c0372debb29b3a4fd2d7bb1bcfa8ef1796.1693215246.git.haibo1.xu@intel.com
State New
Headers show
Series [RFC,1/2] acpi: update madt revisions to ACPI 6.5.next | expand

Commit Message

Haibo Xu Aug. 28, 2023, 9:37 a.m. UTC
Add risc-v madt subtable types which were accepted
in ACPI 6.5.next[1].

[1] https://github.com/riscv-non-isa/riscv-acpi/wiki/ACPI-ASWG-ECR-Process
---
 src/acpi/madt/madt.c        | 14 +++++++++-
 src/lib/include/fwts_acpi.h | 55 +++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)

Comments

Ivan Hu Sept. 1, 2023, 2:13 a.m. UTC | #1
Thank you for bringing this matter to our attention.


Do you have matis number for this ECR, we could follow?  Has it already gained approval from the ASWG?
and which ACPI specification version will include this ECR?


On 8/28/23 17:37, Haibo Xu wrote:
> Add risc-v madt subtable types which were accepted
> in ACPI 6.5.next[1].
> 
> [1] https://github.com/riscv-non-isa/riscv-acpi/wiki/ACPI-ASWG-ECR-Process
> ---
>   src/acpi/madt/madt.c        | 14 +++++++++-
>   src/lib/include/fwts_acpi.h | 55 +++++++++++++++++++++++++++++++++++++
>   2 files changed, 68 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index 05f93ed8..2b857a08 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -122,7 +122,7 @@
>   
>   #define SUBTABLE_UNDEFINED	0x00
>   #define SUBTABLE_VARIABLE	0xff
> -#define NUM_SUBTABLE_TYPES	24
> +#define NUM_SUBTABLE_TYPES	28
>   #define MAX_IO_APIC_ID		256 /* IO APIC ID field is 1 byte */
>   
>   #define SBBR_ACPI_MAJOR_VERSION 6
> @@ -250,6 +250,18 @@ static struct acpi_madt_subtable_lengths spec_info[] = {
>   			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
>   			     SUBTABLE_VARIABLE }
>   	},
> +	{ /* for ACPI 6.5.next */
> +		.major_version = 6,
> +		.minor_version = 5,
> +		.madt_version = 6,
> +		.num_types = 28,
> +		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
> +			     16, 16, 12, 82, 24, 24, 16, 20, 16,
> +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> +			     SUBTABLE_VARIABLE, 36, 16, 36, 36 }

The same version with ACPI 6.5
	{ /* for ACPI 6.5 */
		.major_version = 6,
		.minor_version = 5,
		.madt_version = 6,

Potential conflicts may arise during testing for ACPI 6.5.
Could we confirm the above versions?
If not, we prefer to wait the formal release and get the actually versions confirmed rather than using the same.


Cheers,
Ivan



> +	},
>   	{ /* terminator */
>   		.major_version = 0,
>   		.minor_version = 0,
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index eb958b0e..510addb4 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -531,6 +531,10 @@ typedef enum {
>   	FWTS_MADT_MSI_PIC,
>   	FWTS_MADT_BIO_PIC,
>   	FWTS_MADT_LPC_PIC,
> +	FWTS_MADT_RINTC,
> +	FWTS_MADT_IMSIC,
> +	FWTS_MADT_APLIC,
> +	FWTS_MADT_PLIC,
>   	FWTS_MADT_RESERVED, /* does not have defined structure */
>   	FWTS_MADT_OEM /* does not have defined structure */
>   } fwts_acpi_madt_type;
> @@ -691,6 +695,57 @@ typedef struct {
>   	uint64_t	mail_box_address;
>   } __attribute__ ((packed)) fwts_acpi_madt_mp_wakeup;
>   
> +/* Type 24, FWTS_MADT_RINTC */
> +typedef struct {
> +	uint8_t version;
> +	uint8_t reserved;
> +	uint32_t flags;
> +	uint64_t hart_id;
> +	uint32_t uid;
> +	uint32_t ext_intc_id;
> +	uint64_t imsic_addr;
> +	uint32_t imsic_size;
> +} __attribute__ ((packed)) fwts_acpi_madt_rintc;
> +
> +/* Type 25, FWTS_MADT_IMSIC */
> +typedef struct {
> +	uint8_t version;
> +	uint8_t reserved;
> +	uint32_t flags;
> +	uint16_t num_ids;
> +	uint16_t num_guest_ids;
> +	uint8_t guest_index_bits;
> +	uint8_t hart_index_bits;
> +	uint8_t group_index_bits;
> +	uint8_t group_index_shift;
> +} __attribute__ ((packed)) fwts_acpi_madt_imsic;
> +
> +/* Type 26, FWTS_MADT_APLIC */
> +typedef struct {
> +	uint8_t version;
> +	uint8_t id;
> +	uint32_t flags;
> +	uint8_t hw_id[8];
> +	uint16_t num_idcs;
> +	uint16_t num_sources;
> +	uint32_t gsi_base;
> +	uint64_t addr;
> +	uint32_t size;
> +} __attribute__ ((packed)) fwts_acpi_madt_aplic;
> +
> +/* Type 27, FWTS_MADT_PLIC */
> +typedef struct {
> +	uint8_t version;
> +	uint8_t id;
> +	uint8_t hw_id[8];
> +	uint16_t num_irqs;
> +	uint16_t max_prio;
> +	uint32_t flags;
> +	uint32_t size;
> +	uint64_t base_addr;
> +	uint32_t gsi_base;
> +} __attribute__ ((packed)) fwts_acpi_madt_plic;
> +
>   /*
>    * ACPI TCPA (Trusted Computing Platform Alliance Capabilities Table)
>    *   http://www.kuro5hin.org/story/2002/10/27/16622/530,
Haibo Xu Sept. 1, 2023, 2:27 a.m. UTC | #2
> -----Original Message-----
> From: ivanhu <ivan.hu@canonical.com>
> Sent: Friday, September 1, 2023 10:13 AM
> To: Xu, Haibo1 <haibo1.xu@intel.com>; fwts-devel@lists.ubuntu.com
> Cc: heinrich.schuchardt@canonical.com
> Subject: Re: [RFC PATCH 1/2] acpi: update madt revisions to ACPI 6.5.next
> 
> Thank you for bringing this matter to our attention.
> 
> 
> Do you have matis number for this ECR, we could follow?  Has it already
> gained approval from the ASWG?

Yes, it had been approved by the ASWG. I can't find the matis number in
the related ECR document below and will send to you after getting it.

https://drive.google.com/file/d/1R6k4MshhN3WTT-hwqAquu5nX6xSEqK2l/view
https://drive.google.com/file/d/1nP3nFiH4jkPMp6COOxP6123DCZKR-tia/view
https://drive.google.com/file/d/1sKbOa8m1UZw1JkquZYe3F1zQBN1xXsaf/view
https://drive.google.com/file/d/1oMGPyOD58JaPgMl1pKasT-VKsIKia7zR/view

> and which ACPI specification version will include this ECR?
> 

Currently, all the ECR changes are in 6.5.next and it supposed to be included in
the next ACPI release(6.6?).

> 
> On 8/28/23 17:37, Haibo Xu wrote:
> > Add risc-v madt subtable types which were accepted in ACPI
> > 6.5.next[1].
> >
> > [1]
> > https://github.com/riscv-non-isa/riscv-acpi/wiki/ACPI-ASWG-ECR-Process
> > ---
> >   src/acpi/madt/madt.c        | 14 +++++++++-
> >   src/lib/include/fwts_acpi.h | 55
> +++++++++++++++++++++++++++++++++++++
> >   2 files changed, 68 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c index
> > 05f93ed8..2b857a08 100644
> > --- a/src/acpi/madt/madt.c
> > +++ b/src/acpi/madt/madt.c
> > @@ -122,7 +122,7 @@
> >
> >   #define SUBTABLE_UNDEFINED	0x00
> >   #define SUBTABLE_VARIABLE	0xff
> > -#define NUM_SUBTABLE_TYPES	24
> > +#define NUM_SUBTABLE_TYPES	28
> >   #define MAX_IO_APIC_ID		256 /* IO APIC ID field is 1 byte */
> >
> >   #define SBBR_ACPI_MAJOR_VERSION 6
> > @@ -250,6 +250,18 @@ static struct acpi_madt_subtable_lengths
> spec_info[] = {
> >   			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> >   			     SUBTABLE_VARIABLE }
> >   	},
> > +	{ /* for ACPI 6.5.next */
> > +		.major_version = 6,
> > +		.minor_version = 5,
> > +		.madt_version = 6,
> > +		.num_types = 28,
> > +		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
> > +			     16, 16, 12, 82, 24, 24, 16, 20, 16,
> > +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> > +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> > +			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
> > +			     SUBTABLE_VARIABLE, 36, 16, 36, 36 }
> 
> The same version with ACPI 6.5
> 	{ /* for ACPI 6.5 */
> 		.major_version = 6,
> 		.minor_version = 5,
> 		.madt_version = 6,
> 
> Potential conflicts may arise during testing for ACPI 6.5.
> Could we confirm the above versions?
> If not, we prefer to wait the formal release and get the actually versions
> confirmed rather than using the same.
> 

Thanks for your review! I will confirm it with the ECR owner.

Haibo

> Cheers,
> Ivan
> 
> 
> 
> > +	},
> >   	{ /* terminator */
> >   		.major_version = 0,
> >   		.minor_version = 0,
> > diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> > index eb958b0e..510addb4 100644
> > --- a/src/lib/include/fwts_acpi.h
> > +++ b/src/lib/include/fwts_acpi.h
> > @@ -531,6 +531,10 @@ typedef enum {
> >   	FWTS_MADT_MSI_PIC,
> >   	FWTS_MADT_BIO_PIC,
> >   	FWTS_MADT_LPC_PIC,
> > +	FWTS_MADT_RINTC,
> > +	FWTS_MADT_IMSIC,
> > +	FWTS_MADT_APLIC,
> > +	FWTS_MADT_PLIC,
> >   	FWTS_MADT_RESERVED, /* does not have defined structure */
> >   	FWTS_MADT_OEM /* does not have defined structure */
> >   } fwts_acpi_madt_type;
> > @@ -691,6 +695,57 @@ typedef struct {
> >   	uint64_t	mail_box_address;
> >   } __attribute__ ((packed)) fwts_acpi_madt_mp_wakeup;
> >
> > +/* Type 24, FWTS_MADT_RINTC */
> > +typedef struct {
> > +	uint8_t version;
> > +	uint8_t reserved;
> > +	uint32_t flags;
> > +	uint64_t hart_id;
> > +	uint32_t uid;
> > +	uint32_t ext_intc_id;
> > +	uint64_t imsic_addr;
> > +	uint32_t imsic_size;
> > +} __attribute__ ((packed)) fwts_acpi_madt_rintc;
> > +
> > +/* Type 25, FWTS_MADT_IMSIC */
> > +typedef struct {
> > +	uint8_t version;
> > +	uint8_t reserved;
> > +	uint32_t flags;
> > +	uint16_t num_ids;
> > +	uint16_t num_guest_ids;
> > +	uint8_t guest_index_bits;
> > +	uint8_t hart_index_bits;
> > +	uint8_t group_index_bits;
> > +	uint8_t group_index_shift;
> > +} __attribute__ ((packed)) fwts_acpi_madt_imsic;
> > +
> > +/* Type 26, FWTS_MADT_APLIC */
> > +typedef struct {
> > +	uint8_t version;
> > +	uint8_t id;
> > +	uint32_t flags;
> > +	uint8_t hw_id[8];
> > +	uint16_t num_idcs;
> > +	uint16_t num_sources;
> > +	uint32_t gsi_base;
> > +	uint64_t addr;
> > +	uint32_t size;
> > +} __attribute__ ((packed)) fwts_acpi_madt_aplic;
> > +
> > +/* Type 27, FWTS_MADT_PLIC */
> > +typedef struct {
> > +	uint8_t version;
> > +	uint8_t id;
> > +	uint8_t hw_id[8];
> > +	uint16_t num_irqs;
> > +	uint16_t max_prio;
> > +	uint32_t flags;
> > +	uint32_t size;
> > +	uint64_t base_addr;
> > +	uint32_t gsi_base;
> > +} __attribute__ ((packed)) fwts_acpi_madt_plic;
> > +
> >   /*
> >    * ACPI TCPA (Trusted Computing Platform Alliance Capabilities Table)
> >    *   http://www.kuro5hin.org/story/2002/10/27/16622/530,
diff mbox series

Patch

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index 05f93ed8..2b857a08 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -122,7 +122,7 @@ 
 
 #define SUBTABLE_UNDEFINED	0x00
 #define SUBTABLE_VARIABLE	0xff
-#define NUM_SUBTABLE_TYPES	24
+#define NUM_SUBTABLE_TYPES	28
 #define MAX_IO_APIC_ID		256 /* IO APIC ID field is 1 byte */
 
 #define SBBR_ACPI_MAJOR_VERSION 6
@@ -250,6 +250,18 @@  static struct acpi_madt_subtable_lengths spec_info[] = {
 			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
 			     SUBTABLE_VARIABLE }
 	},
+	{ /* for ACPI 6.5.next */
+		.major_version = 6,
+		.minor_version = 5,
+		.madt_version = 6,
+		.num_types = 28,
+		.lengths = { 8, 12, 10, 8, 6, 12, 16, SUBTABLE_VARIABLE,
+			     16, 16, 12, 82, 24, 24, 16, 20, 16,
+			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
+			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
+			     SUBTABLE_VARIABLE, SUBTABLE_VARIABLE,
+			     SUBTABLE_VARIABLE, 36, 16, 36, 36 }
+	},
 	{ /* terminator */
 		.major_version = 0,
 		.minor_version = 0,
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index eb958b0e..510addb4 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -531,6 +531,10 @@  typedef enum {
 	FWTS_MADT_MSI_PIC,
 	FWTS_MADT_BIO_PIC,
 	FWTS_MADT_LPC_PIC,
+	FWTS_MADT_RINTC,
+	FWTS_MADT_IMSIC,
+	FWTS_MADT_APLIC,
+	FWTS_MADT_PLIC,
 	FWTS_MADT_RESERVED, /* does not have defined structure */
 	FWTS_MADT_OEM /* does not have defined structure */
 } fwts_acpi_madt_type;
@@ -691,6 +695,57 @@  typedef struct {
 	uint64_t	mail_box_address;
 } __attribute__ ((packed)) fwts_acpi_madt_mp_wakeup;
 
+/* Type 24, FWTS_MADT_RINTC */
+typedef struct {
+	uint8_t version;
+	uint8_t reserved;
+	uint32_t flags;
+	uint64_t hart_id;
+	uint32_t uid;
+	uint32_t ext_intc_id;
+	uint64_t imsic_addr;
+	uint32_t imsic_size;
+} __attribute__ ((packed)) fwts_acpi_madt_rintc;
+
+/* Type 25, FWTS_MADT_IMSIC */
+typedef struct {
+	uint8_t version;
+	uint8_t reserved;
+	uint32_t flags;
+	uint16_t num_ids;
+	uint16_t num_guest_ids;
+	uint8_t guest_index_bits;
+	uint8_t hart_index_bits;
+	uint8_t group_index_bits;
+	uint8_t group_index_shift;
+} __attribute__ ((packed)) fwts_acpi_madt_imsic;
+
+/* Type 26, FWTS_MADT_APLIC */
+typedef struct {
+	uint8_t version;
+	uint8_t id;
+	uint32_t flags;
+	uint8_t hw_id[8];
+	uint16_t num_idcs;
+	uint16_t num_sources;
+	uint32_t gsi_base;
+	uint64_t addr;
+	uint32_t size;
+} __attribute__ ((packed)) fwts_acpi_madt_aplic;
+
+/* Type 27, FWTS_MADT_PLIC */
+typedef struct {
+	uint8_t version;
+	uint8_t id;
+	uint8_t hw_id[8];
+	uint16_t num_irqs;
+	uint16_t max_prio;
+	uint32_t flags;
+	uint32_t size;
+	uint64_t base_addr;
+	uint32_t gsi_base;
+} __attribute__ ((packed)) fwts_acpi_madt_plic;
+
 /*
  * ACPI TCPA (Trusted Computing Platform Alliance Capabilities Table)
  *   http://www.kuro5hin.org/story/2002/10/27/16622/530,