qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions
@ 2025-07-24 11:03 Sunil V L
  2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sunil V L @ 2025-07-24 11:03 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra, Sunil V L

Since RISC-V support is added only in ACPI 6.6, it should adhere to the
expected FADT and MADT versions. Update them.

Changes since v1:
	1) Updated code comments to reflect ACPI 6.6 chapter number.
	2) Added Michael's Ack.
	
Sunil V L (3):
  bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes
  hw/riscv/virt-acpi-build.c: Update FADT and MADT versions
  tests/data/acpi/riscv64: Update expected FADT and MADT

 hw/riscv/virt-acpi-build.c        |  25 ++++++++++---------------
 tests/data/acpi/riscv64/virt/APIC | Bin 116 -> 116 bytes
 tests/data/acpi/riscv64/virt/FACP | Bin 276 -> 276 bytes
 3 files changed, 10 insertions(+), 15 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes
  2025-07-24 11:03 [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Sunil V L
@ 2025-07-24 11:03 ` Sunil V L
  2025-07-24 11:29   ` Daniel Henrique Barboza
  2025-07-25  4:02   ` Nutty Liu
  2025-07-24 11:03 ` [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions Sunil V L
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Sunil V L @ 2025-07-24 11:03 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra, Sunil V L

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..0c3f7a6cac 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,3 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/riscv64/virt/APIC",
+"tests/data/acpi/riscv64/virt/FACP",
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions
  2025-07-24 11:03 [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Sunil V L
  2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
@ 2025-07-24 11:03 ` Sunil V L
  2025-07-24 11:30   ` Daniel Henrique Barboza
  2025-07-25  4:03   ` Nutty Liu
  2025-07-24 11:03 ` [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT Sunil V L
  2025-07-29  3:03 ` [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Alistair Francis
  3 siblings, 2 replies; 11+ messages in thread
From: Sunil V L @ 2025-07-24 11:03 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra, Sunil V L

RISC-V support is added only in ACPI 6.6. According to the ACPI 6.6
specification, the minor version of the Fixed ACPI Description Table
(FADT) should be 6, and the Multiple APIC Description Table (MADT)
should use revision 7. So, update the RISC-V FADT and MADT to reflect
correct versions.

Update the code comments to reflect ACPI 6.6 version details.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/riscv/virt-acpi-build.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
index ee1416d264..f1406cb683 100644
--- a/hw/riscv/virt-acpi-build.c
+++ b/hw/riscv/virt-acpi-build.c
@@ -270,11 +270,8 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, RISCVVirtState *s)
 #define RHCT_NODE_ARRAY_OFFSET 56
 
 /*
- * ACPI spec, Revision 6.5+
- * 5.2.36 RISC-V Hart Capabilities Table (RHCT)
- * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/16
- *      https://drive.google.com/file/d/1nP3nFiH4jkPMp6COOxP6123DCZKR-tia/view
- *      https://drive.google.com/file/d/1sKbOa8m1UZw1JkquZYe3F1zQBN1xXsaf/view
+ * ACPI spec, Revision 6.6
+ * 5.2.37 RISC-V Hart Capabilities Table (RHCT)
  */
 static void build_rhct(GArray *table_data,
                        BIOSLinker *linker,
@@ -421,7 +418,10 @@ static void build_rhct(GArray *table_data,
     acpi_table_end(linker, &table);
 }
 
-/* FADT */
+/*
+ * ACPI spec, Revision 6.6
+ * 5.2.9 Fixed ACPI Description Table (MADT)
+ */
 static void build_fadt_rev6(GArray *table_data,
                             BIOSLinker *linker,
                             RISCVVirtState *s,
@@ -429,7 +429,7 @@ static void build_fadt_rev6(GArray *table_data,
 {
     AcpiFadtData fadt = {
         .rev = 6,
-        .minor_ver = 5,
+        .minor_ver = 6,
         .flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI,
         .xdsdt_tbl_offset = &dsdt_tbl_offset,
     };
@@ -508,11 +508,8 @@ static void build_dsdt(GArray *table_data,
 }
 
 /*
- * ACPI spec, Revision 6.5+
+ * ACPI spec, Revision 6.6
  * 5.2.12 Multiple APIC Description Table (MADT)
- * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/15
- *      https://drive.google.com/file/d/1R6k4MshhN3WTT-hwqAquu5nX6xSEqK2l/view
- *      https://drive.google.com/file/d/1oMGPyOD58JaPgMl1pKasT-VKsIKia7zR/view
  */
 static void build_madt(GArray *table_data,
                        BIOSLinker *linker,
@@ -537,7 +534,7 @@ static void build_madt(GArray *table_data,
 
     hart_index_bits = imsic_num_bits(imsic_max_hart_per_socket);
 
-    AcpiTable table = { .sig = "APIC", .rev = 6, .oem_id = s->oem_id,
+    AcpiTable table = { .sig = "APIC", .rev = 7, .oem_id = s->oem_id,
                         .oem_table_id = s->oem_table_id };
 
     acpi_table_begin(&table, table_data);
@@ -812,10 +809,8 @@ static void build_rimt(GArray *table_data, BIOSLinker *linker,
 }
 
 /*
- * ACPI spec, Revision 6.5+
+ * ACPI spec, Revision 6.6
  * 5.2.16 System Resource Affinity Table (SRAT)
- * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/25
- *      https://drive.google.com/file/d/1YTdDx2IPm5IeZjAW932EYU-tUtgS08tX/view
  */
 static void
 build_srat(GArray *table_data, BIOSLinker *linker, RISCVVirtState *vms)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT
  2025-07-24 11:03 [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Sunil V L
  2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
  2025-07-24 11:03 ` [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions Sunil V L
@ 2025-07-24 11:03 ` Sunil V L
  2025-07-24 11:31   ` Daniel Henrique Barboza
  2025-07-25  4:03   ` Nutty Liu
  2025-07-29  3:03 ` [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Alistair Francis
  3 siblings, 2 replies; 11+ messages in thread
From: Sunil V L @ 2025-07-24 11:03 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra, Sunil V L

Update the expected tables for the version change.
 /*
  *
  * ACPI Data Table [FACP]
  *
  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
  */

 [000h 0000 004h]                   Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
 [004h 0004 004h]                Table Length : 00000114
 [008h 0008 001h]                    Revision : 06
-[009h 0009 001h]                    Checksum : 13
+[009h 0009 001h]                    Checksum : 12
 [00Ah 0010 006h]                      Oem ID : "BOCHS "
 [010h 0016 008h]                Oem Table ID : "BXPC    "
 [018h 0024 004h]                Oem Revision : 00000001
 [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
 [020h 0032 004h]       Asl Compiler Revision : 00000001

 [024h 0036 004h]                FACS Address : 00000000
 [028h 0040 004h]                DSDT Address : 00000000
 [02Ch 0044 001h]                       Model : 00
 [02Dh 0045 001h]                  PM Profile : 00 [Unspecified]
 [02Eh 0046 002h]               SCI Interrupt : 0000
 [030h 0048 004h]            SMI Command Port : 00000000
 [034h 0052 001h]           ACPI Enable Value : 00
 [035h 0053 001h]          ACPI Disable Value : 00
 [036h 0054 001h]              S4BIOS Command : 00
 [037h 0055 001h]             P-State Control : 00
@@ -86,33 +86,33 @@
      Use APIC Physical Destination Mode (V4) : 0
                        Hardware Reduced (V5) : 1
                       Low Power S0 Idle (V5) : 0

 [074h 0116 00Ch]              Reset Register : [Generic Address Structure]
 [074h 0116 001h]                    Space ID : 00 [SystemMemory]
 [075h 0117 001h]                   Bit Width : 00
 [076h 0118 001h]                  Bit Offset : 00
 [077h 0119 001h]        Encoded Access Width : 00 [Undefined/Legacy]
 [078h 0120 008h]                     Address : 0000000000000000

 [080h 0128 001h]        Value to cause reset : 00
 [081h 0129 002h]   ARM Flags (decoded below) : 0000
                               PSCI Compliant : 0
                        Must use HVC for PSCI : 0

-[083h 0131 001h]         FADT Minor Revision : 05
+[083h 0131 001h]         FADT Minor Revision : 06
 [084h 0132 008h]                FACS Address : 0000000000000000
[...]

 /*
  *
  * ACPI Data Table [APIC]
  *
  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
  */

 [000h 0000 004h]                   Signature : "APIC"    [Multiple APIC Description Table (MADT)]
 [004h 0004 004h]                Table Length : 00000074
-[008h 0008 001h]                    Revision : 06
-[009h 0009 001h]                    Checksum : B4
+[008h 0008 001h]                    Revision : 07
+[009h 0009 001h]                    Checksum : B3
 [00Ah 0010 006h]                      Oem ID : "BOCHS "
 [010h 0016 008h]                Oem Table ID : "BXPC    "
[...]

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/data/acpi/riscv64/virt/APIC           | Bin 116 -> 116 bytes
 tests/data/acpi/riscv64/virt/FACP           | Bin 276 -> 276 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   2 --
 3 files changed, 2 deletions(-)

diff --git a/tests/data/acpi/riscv64/virt/APIC b/tests/data/acpi/riscv64/virt/APIC
index 66a25dfd2d6ea2b607c024722b2eab95873a01e9..3fb5b753596fc7c2618b3d5210be8b00b0c177f6 100644
GIT binary patch
delta 16
XcmXRZ;c^V{bS`0FU|`=okt+)TB&q~M

delta 16
XcmXRZ;c^V{bS`0FU|`!akt+)TB&h^L

diff --git a/tests/data/acpi/riscv64/virt/FACP b/tests/data/acpi/riscv64/virt/FACP
index a5276b65ea8ce46cc9b40d96d98f0669c9089ed4..78e1b14b1d4ff0533a6a4c041f195a69b4ef114d 100644
GIT binary patch
delta 30
mcmbQjG=+)F&CxkPgpq-PO=u!lB_rF!iPaMgcqj8PasU8k76z;U

delta 30
mcmbQjG=+)F&CxkPgpq-PO?V<#B_r#^iPaMgcqj8PasU8k8wRWZ

diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 0c3f7a6cac..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,3 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/riscv64/virt/APIC",
-"tests/data/acpi/riscv64/virt/FACP",
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes
  2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
@ 2025-07-24 11:29   ` Daniel Henrique Barboza
  2025-07-25  4:02   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Henrique Barboza @ 2025-07-24 11:29 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li, Liu Zhiwei,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Andrew Jones,
	Anup Patel, Atish Kumar Patra



On 7/24/25 8:03 AM, Sunil V L wrote:
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8b..0c3f7a6cac 100644
> --- a/tests/qtest/bios-tables-test-allowed-diff.h
> +++ b/tests/qtest/bios-tables-test-allowed-diff.h
> @@ -1 +1,3 @@
>   /* List of comma-separated changed AML files to ignore */
> +"tests/data/acpi/riscv64/virt/APIC",
> +"tests/data/acpi/riscv64/virt/FACP",



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions
  2025-07-24 11:03 ` [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions Sunil V L
@ 2025-07-24 11:30   ` Daniel Henrique Barboza
  2025-07-25  4:03   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Henrique Barboza @ 2025-07-24 11:30 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li, Liu Zhiwei,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Andrew Jones,
	Anup Patel, Atish Kumar Patra



On 7/24/25 8:03 AM, Sunil V L wrote:
> RISC-V support is added only in ACPI 6.6. According to the ACPI 6.6
> specification, the minor version of the Fixed ACPI Description Table
> (FADT) should be 6, and the Multiple APIC Description Table (MADT)
> should use revision 7. So, update the RISC-V FADT and MADT to reflect
> correct versions.
> 
> Update the code comments to reflect ACPI 6.6 version details.
> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   hw/riscv/virt-acpi-build.c | 25 ++++++++++---------------
>   1 file changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> index ee1416d264..f1406cb683 100644
> --- a/hw/riscv/virt-acpi-build.c
> +++ b/hw/riscv/virt-acpi-build.c
> @@ -270,11 +270,8 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, RISCVVirtState *s)
>   #define RHCT_NODE_ARRAY_OFFSET 56
>   
>   /*
> - * ACPI spec, Revision 6.5+
> - * 5.2.36 RISC-V Hart Capabilities Table (RHCT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/16
> - *      https://drive.google.com/file/d/1nP3nFiH4jkPMp6COOxP6123DCZKR-tia/view
> - *      https://drive.google.com/file/d/1sKbOa8m1UZw1JkquZYe3F1zQBN1xXsaf/view
> + * ACPI spec, Revision 6.6
> + * 5.2.37 RISC-V Hart Capabilities Table (RHCT)
>    */
>   static void build_rhct(GArray *table_data,
>                          BIOSLinker *linker,
> @@ -421,7 +418,10 @@ static void build_rhct(GArray *table_data,
>       acpi_table_end(linker, &table);
>   }
>   
> -/* FADT */
> +/*
> + * ACPI spec, Revision 6.6
> + * 5.2.9 Fixed ACPI Description Table (MADT)
> + */
>   static void build_fadt_rev6(GArray *table_data,
>                               BIOSLinker *linker,
>                               RISCVVirtState *s,
> @@ -429,7 +429,7 @@ static void build_fadt_rev6(GArray *table_data,
>   {
>       AcpiFadtData fadt = {
>           .rev = 6,
> -        .minor_ver = 5,
> +        .minor_ver = 6,
>           .flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI,
>           .xdsdt_tbl_offset = &dsdt_tbl_offset,
>       };
> @@ -508,11 +508,8 @@ static void build_dsdt(GArray *table_data,
>   }
>   
>   /*
> - * ACPI spec, Revision 6.5+
> + * ACPI spec, Revision 6.6
>    * 5.2.12 Multiple APIC Description Table (MADT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/15
> - *      https://drive.google.com/file/d/1R6k4MshhN3WTT-hwqAquu5nX6xSEqK2l/view
> - *      https://drive.google.com/file/d/1oMGPyOD58JaPgMl1pKasT-VKsIKia7zR/view
>    */
>   static void build_madt(GArray *table_data,
>                          BIOSLinker *linker,
> @@ -537,7 +534,7 @@ static void build_madt(GArray *table_data,
>   
>       hart_index_bits = imsic_num_bits(imsic_max_hart_per_socket);
>   
> -    AcpiTable table = { .sig = "APIC", .rev = 6, .oem_id = s->oem_id,
> +    AcpiTable table = { .sig = "APIC", .rev = 7, .oem_id = s->oem_id,
>                           .oem_table_id = s->oem_table_id };
>   
>       acpi_table_begin(&table, table_data);
> @@ -812,10 +809,8 @@ static void build_rimt(GArray *table_data, BIOSLinker *linker,
>   }
>   
>   /*
> - * ACPI spec, Revision 6.5+
> + * ACPI spec, Revision 6.6
>    * 5.2.16 System Resource Affinity Table (SRAT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/25
> - *      https://drive.google.com/file/d/1YTdDx2IPm5IeZjAW932EYU-tUtgS08tX/view
>    */
>   static void
>   build_srat(GArray *table_data, BIOSLinker *linker, RISCVVirtState *vms)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT
  2025-07-24 11:03 ` [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT Sunil V L
@ 2025-07-24 11:31   ` Daniel Henrique Barboza
  2025-07-25  4:03   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Henrique Barboza @ 2025-07-24 11:31 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li, Liu Zhiwei,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Andrew Jones,
	Anup Patel, Atish Kumar Patra



On 7/24/25 8:03 AM, Sunil V L wrote:
> Update the expected tables for the version change.
>   /*
>    *
>    * ACPI Data Table [FACP]
>    *
>    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
>    */
> 
>   [000h 0000 004h]                   Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
>   [004h 0004 004h]                Table Length : 00000114
>   [008h 0008 001h]                    Revision : 06
> -[009h 0009 001h]                    Checksum : 13
> +[009h 0009 001h]                    Checksum : 12
>   [00Ah 0010 006h]                      Oem ID : "BOCHS "
>   [010h 0016 008h]                Oem Table ID : "BXPC    "
>   [018h 0024 004h]                Oem Revision : 00000001
>   [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
>   [020h 0032 004h]       Asl Compiler Revision : 00000001
> 
>   [024h 0036 004h]                FACS Address : 00000000
>   [028h 0040 004h]                DSDT Address : 00000000
>   [02Ch 0044 001h]                       Model : 00
>   [02Dh 0045 001h]                  PM Profile : 00 [Unspecified]
>   [02Eh 0046 002h]               SCI Interrupt : 0000
>   [030h 0048 004h]            SMI Command Port : 00000000
>   [034h 0052 001h]           ACPI Enable Value : 00
>   [035h 0053 001h]          ACPI Disable Value : 00
>   [036h 0054 001h]              S4BIOS Command : 00
>   [037h 0055 001h]             P-State Control : 00
> @@ -86,33 +86,33 @@
>        Use APIC Physical Destination Mode (V4) : 0
>                          Hardware Reduced (V5) : 1
>                         Low Power S0 Idle (V5) : 0
> 
>   [074h 0116 00Ch]              Reset Register : [Generic Address Structure]
>   [074h 0116 001h]                    Space ID : 00 [SystemMemory]
>   [075h 0117 001h]                   Bit Width : 00
>   [076h 0118 001h]                  Bit Offset : 00
>   [077h 0119 001h]        Encoded Access Width : 00 [Undefined/Legacy]
>   [078h 0120 008h]                     Address : 0000000000000000
> 
>   [080h 0128 001h]        Value to cause reset : 00
>   [081h 0129 002h]   ARM Flags (decoded below) : 0000
>                                 PSCI Compliant : 0
>                          Must use HVC for PSCI : 0
> 
> -[083h 0131 001h]         FADT Minor Revision : 05
> +[083h 0131 001h]         FADT Minor Revision : 06
>   [084h 0132 008h]                FACS Address : 0000000000000000
> [...]
> 
>   /*
>    *
>    * ACPI Data Table [APIC]
>    *
>    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
>    */
> 
>   [000h 0000 004h]                   Signature : "APIC"    [Multiple APIC Description Table (MADT)]
>   [004h 0004 004h]                Table Length : 00000074
> -[008h 0008 001h]                    Revision : 06
> -[009h 0009 001h]                    Checksum : B4
> +[008h 0008 001h]                    Revision : 07
> +[009h 0009 001h]                    Checksum : B3
>   [00Ah 0010 006h]                      Oem ID : "BOCHS "
>   [010h 0016 008h]                Oem Table ID : "BXPC    "
> [...]
> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   tests/data/acpi/riscv64/virt/APIC           | Bin 116 -> 116 bytes
>   tests/data/acpi/riscv64/virt/FACP           | Bin 276 -> 276 bytes
>   tests/qtest/bios-tables-test-allowed-diff.h |   2 --
>   3 files changed, 2 deletions(-)
> 
> diff --git a/tests/data/acpi/riscv64/virt/APIC b/tests/data/acpi/riscv64/virt/APIC
> index 66a25dfd2d6ea2b607c024722b2eab95873a01e9..3fb5b753596fc7c2618b3d5210be8b00b0c177f6 100644
> GIT binary patch
> delta 16
> XcmXRZ;c^V{bS`0FU|`=okt+)TB&q~M
> 
> delta 16
> XcmXRZ;c^V{bS`0FU|`!akt+)TB&h^L
> 
> diff --git a/tests/data/acpi/riscv64/virt/FACP b/tests/data/acpi/riscv64/virt/FACP
> index a5276b65ea8ce46cc9b40d96d98f0669c9089ed4..78e1b14b1d4ff0533a6a4c041f195a69b4ef114d 100644
> GIT binary patch
> delta 30
> mcmbQjG=+)F&CxkPgpq-PO=u!lB_rF!iPaMgcqj8PasU8k76z;U
> 
> delta 30
> mcmbQjG=+)F&CxkPgpq-PO?V<#B_r#^iPaMgcqj8PasU8k8wRWZ
> 
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index 0c3f7a6cac..dfb8523c8b 100644
> --- a/tests/qtest/bios-tables-test-allowed-diff.h
> +++ b/tests/qtest/bios-tables-test-allowed-diff.h
> @@ -1,3 +1 @@
>   /* List of comma-separated changed AML files to ignore */
> -"tests/data/acpi/riscv64/virt/APIC",
> -"tests/data/acpi/riscv64/virt/FACP",



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes
  2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
  2025-07-24 11:29   ` Daniel Henrique Barboza
@ 2025-07-25  4:02   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Nutty Liu @ 2025-07-25  4:02 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra

On 7/24/2025 7:03 PM, Sunil V L wrote:
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>

Thanks,
Nutty
>   tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8b..0c3f7a6cac 100644
> --- a/tests/qtest/bios-tables-test-allowed-diff.h
> +++ b/tests/qtest/bios-tables-test-allowed-diff.h
> @@ -1 +1,3 @@
>   /* List of comma-separated changed AML files to ignore */
> +"tests/data/acpi/riscv64/virt/APIC",
> +"tests/data/acpi/riscv64/virt/FACP",


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions
  2025-07-24 11:03 ` [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions Sunil V L
  2025-07-24 11:30   ` Daniel Henrique Barboza
@ 2025-07-25  4:03   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Nutty Liu @ 2025-07-25  4:03 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra

On 7/24/2025 7:03 PM, Sunil V L wrote:
> RISC-V support is added only in ACPI 6.6. According to the ACPI 6.6
> specification, the minor version of the Fixed ACPI Description Table
> (FADT) should be 6, and the Multiple APIC Description Table (MADT)
> should use revision 7. So, update the RISC-V FADT and MADT to reflect
> correct versions.
>
> Update the code comments to reflect ACPI 6.6 version details.
>
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>

Thanks,
Nutty
>   hw/riscv/virt-acpi-build.c | 25 ++++++++++---------------
>   1 file changed, 10 insertions(+), 15 deletions(-)
>
> diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> index ee1416d264..f1406cb683 100644
> --- a/hw/riscv/virt-acpi-build.c
> +++ b/hw/riscv/virt-acpi-build.c
> @@ -270,11 +270,8 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, RISCVVirtState *s)
>   #define RHCT_NODE_ARRAY_OFFSET 56
>   
>   /*
> - * ACPI spec, Revision 6.5+
> - * 5.2.36 RISC-V Hart Capabilities Table (RHCT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/16
> - *      https://drive.google.com/file/d/1nP3nFiH4jkPMp6COOxP6123DCZKR-tia/view
> - *      https://drive.google.com/file/d/1sKbOa8m1UZw1JkquZYe3F1zQBN1xXsaf/view
> + * ACPI spec, Revision 6.6
> + * 5.2.37 RISC-V Hart Capabilities Table (RHCT)
>    */
>   static void build_rhct(GArray *table_data,
>                          BIOSLinker *linker,
> @@ -421,7 +418,10 @@ static void build_rhct(GArray *table_data,
>       acpi_table_end(linker, &table);
>   }
>   
> -/* FADT */
> +/*
> + * ACPI spec, Revision 6.6
> + * 5.2.9 Fixed ACPI Description Table (MADT)
> + */
>   static void build_fadt_rev6(GArray *table_data,
>                               BIOSLinker *linker,
>                               RISCVVirtState *s,
> @@ -429,7 +429,7 @@ static void build_fadt_rev6(GArray *table_data,
>   {
>       AcpiFadtData fadt = {
>           .rev = 6,
> -        .minor_ver = 5,
> +        .minor_ver = 6,
>           .flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI,
>           .xdsdt_tbl_offset = &dsdt_tbl_offset,
>       };
> @@ -508,11 +508,8 @@ static void build_dsdt(GArray *table_data,
>   }
>   
>   /*
> - * ACPI spec, Revision 6.5+
> + * ACPI spec, Revision 6.6
>    * 5.2.12 Multiple APIC Description Table (MADT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/15
> - *      https://drive.google.com/file/d/1R6k4MshhN3WTT-hwqAquu5nX6xSEqK2l/view
> - *      https://drive.google.com/file/d/1oMGPyOD58JaPgMl1pKasT-VKsIKia7zR/view
>    */
>   static void build_madt(GArray *table_data,
>                          BIOSLinker *linker,
> @@ -537,7 +534,7 @@ static void build_madt(GArray *table_data,
>   
>       hart_index_bits = imsic_num_bits(imsic_max_hart_per_socket);
>   
> -    AcpiTable table = { .sig = "APIC", .rev = 6, .oem_id = s->oem_id,
> +    AcpiTable table = { .sig = "APIC", .rev = 7, .oem_id = s->oem_id,
>                           .oem_table_id = s->oem_table_id };
>   
>       acpi_table_begin(&table, table_data);
> @@ -812,10 +809,8 @@ static void build_rimt(GArray *table_data, BIOSLinker *linker,
>   }
>   
>   /*
> - * ACPI spec, Revision 6.5+
> + * ACPI spec, Revision 6.6
>    * 5.2.16 System Resource Affinity Table (SRAT)
> - * REF: https://github.com/riscv-non-isa/riscv-acpi/issues/25
> - *      https://drive.google.com/file/d/1YTdDx2IPm5IeZjAW932EYU-tUtgS08tX/view
>    */
>   static void
>   build_srat(GArray *table_data, BIOSLinker *linker, RISCVVirtState *vms)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT
  2025-07-24 11:03 ` [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT Sunil V L
  2025-07-24 11:31   ` Daniel Henrique Barboza
@ 2025-07-25  4:03   ` Nutty Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Nutty Liu @ 2025-07-25  4:03 UTC (permalink / raw)
  To: Sunil V L, qemu-riscv, qemu-devel
  Cc: Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Andrew Jones, Anup Patel,
	Atish Kumar Patra

On 7/24/2025 7:03 PM, Sunil V L wrote:
> Update the expected tables for the version change.
>   /*
>    *
>    * ACPI Data Table [FACP]
>    *
>    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
>    */
>
>   [000h 0000 004h]                   Signature : "FACP"    [Fixed ACPI Description Table (FADT)]
>   [004h 0004 004h]                Table Length : 00000114
>   [008h 0008 001h]                    Revision : 06
> -[009h 0009 001h]                    Checksum : 13
> +[009h 0009 001h]                    Checksum : 12
>   [00Ah 0010 006h]                      Oem ID : "BOCHS "
>   [010h 0016 008h]                Oem Table ID : "BXPC    "
>   [018h 0024 004h]                Oem Revision : 00000001
>   [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
>   [020h 0032 004h]       Asl Compiler Revision : 00000001
>
>   [024h 0036 004h]                FACS Address : 00000000
>   [028h 0040 004h]                DSDT Address : 00000000
>   [02Ch 0044 001h]                       Model : 00
>   [02Dh 0045 001h]                  PM Profile : 00 [Unspecified]
>   [02Eh 0046 002h]               SCI Interrupt : 0000
>   [030h 0048 004h]            SMI Command Port : 00000000
>   [034h 0052 001h]           ACPI Enable Value : 00
>   [035h 0053 001h]          ACPI Disable Value : 00
>   [036h 0054 001h]              S4BIOS Command : 00
>   [037h 0055 001h]             P-State Control : 00
> @@ -86,33 +86,33 @@
>        Use APIC Physical Destination Mode (V4) : 0
>                          Hardware Reduced (V5) : 1
>                         Low Power S0 Idle (V5) : 0
>
>   [074h 0116 00Ch]              Reset Register : [Generic Address Structure]
>   [074h 0116 001h]                    Space ID : 00 [SystemMemory]
>   [075h 0117 001h]                   Bit Width : 00
>   [076h 0118 001h]                  Bit Offset : 00
>   [077h 0119 001h]        Encoded Access Width : 00 [Undefined/Legacy]
>   [078h 0120 008h]                     Address : 0000000000000000
>
>   [080h 0128 001h]        Value to cause reset : 00
>   [081h 0129 002h]   ARM Flags (decoded below) : 0000
>                                 PSCI Compliant : 0
>                          Must use HVC for PSCI : 0
>
> -[083h 0131 001h]         FADT Minor Revision : 05
> +[083h 0131 001h]         FADT Minor Revision : 06
>   [084h 0132 008h]                FACS Address : 0000000000000000
> [...]
>
>   /*
>    *
>    * ACPI Data Table [APIC]
>    *
>    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
>    */
>
>   [000h 0000 004h]                   Signature : "APIC"    [Multiple APIC Description Table (MADT)]
>   [004h 0004 004h]                Table Length : 00000074
> -[008h 0008 001h]                    Revision : 06
> -[009h 0009 001h]                    Checksum : B4
> +[008h 0008 001h]                    Revision : 07
> +[009h 0009 001h]                    Checksum : B3
>   [00Ah 0010 006h]                      Oem ID : "BOCHS "
>   [010h 0016 008h]                Oem Table ID : "BXPC    "
> [...]
>
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>

Thanks,
Nutty
>   tests/data/acpi/riscv64/virt/APIC           | Bin 116 -> 116 bytes
>   tests/data/acpi/riscv64/virt/FACP           | Bin 276 -> 276 bytes
>   tests/qtest/bios-tables-test-allowed-diff.h |   2 --
>   3 files changed, 2 deletions(-)
>
> diff --git a/tests/data/acpi/riscv64/virt/APIC b/tests/data/acpi/riscv64/virt/APIC
> index 66a25dfd2d6ea2b607c024722b2eab95873a01e9..3fb5b753596fc7c2618b3d5210be8b00b0c177f6 100644
> GIT binary patch
> delta 16
> XcmXRZ;c^V{bS`0FU|`=okt+)TB&q~M
>
> delta 16
> XcmXRZ;c^V{bS`0FU|`!akt+)TB&h^L
>
> diff --git a/tests/data/acpi/riscv64/virt/FACP b/tests/data/acpi/riscv64/virt/FACP
> index a5276b65ea8ce46cc9b40d96d98f0669c9089ed4..78e1b14b1d4ff0533a6a4c041f195a69b4ef114d 100644
> GIT binary patch
> delta 30
> mcmbQjG=+)F&CxkPgpq-PO=u!lB_rF!iPaMgcqj8PasU8k76z;U
>
> delta 30
> mcmbQjG=+)F&CxkPgpq-PO?V<#B_r#^iPaMgcqj8PasU8k8wRWZ
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index 0c3f7a6cac..dfb8523c8b 100644
> --- a/tests/qtest/bios-tables-test-allowed-diff.h
> +++ b/tests/qtest/bios-tables-test-allowed-diff.h
> @@ -1,3 +1 @@
>   /* List of comma-separated changed AML files to ignore */
> -"tests/data/acpi/riscv64/virt/APIC",
> -"tests/data/acpi/riscv64/virt/FACP",


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions
  2025-07-24 11:03 [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Sunil V L
                   ` (2 preceding siblings ...)
  2025-07-24 11:03 ` [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT Sunil V L
@ 2025-07-29  3:03 ` Alistair Francis
  3 siblings, 0 replies; 11+ messages in thread
From: Alistair Francis @ 2025-07-29  3:03 UTC (permalink / raw)
  To: Sunil V L
  Cc: qemu-riscv, qemu-devel, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Andrew Jones,
	Anup Patel, Atish Kumar Patra

On Thu, Jul 24, 2025 at 9:04 PM Sunil V L <sunilvl@ventanamicro.com> wrote:
>
> Since RISC-V support is added only in ACPI 6.6, it should adhere to the
> expected FADT and MADT versions. Update them.
>
> Changes since v1:
>         1) Updated code comments to reflect ACPI 6.6 chapter number.
>         2) Added Michael's Ack.
>
> Sunil V L (3):
>   bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes
>   hw/riscv/virt-acpi-build.c: Update FADT and MADT versions
>   tests/data/acpi/riscv64: Update expected FADT and MADT

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  hw/riscv/virt-acpi-build.c        |  25 ++++++++++---------------
>  tests/data/acpi/riscv64/virt/APIC | Bin 116 -> 116 bytes
>  tests/data/acpi/riscv64/virt/FACP | Bin 276 -> 276 bytes
>  3 files changed, 10 insertions(+), 15 deletions(-)
>
> --
> 2.43.0
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-07-29  3:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 11:03 [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Sunil V L
2025-07-24 11:03 ` [PATCH v2 1/3] bios-tables-test-allowed-diff.h: Allow RISC-V FADT and MADT changes Sunil V L
2025-07-24 11:29   ` Daniel Henrique Barboza
2025-07-25  4:02   ` Nutty Liu
2025-07-24 11:03 ` [PATCH v2 2/3] hw/riscv/virt-acpi-build.c: Update FADT and MADT versions Sunil V L
2025-07-24 11:30   ` Daniel Henrique Barboza
2025-07-25  4:03   ` Nutty Liu
2025-07-24 11:03 ` [PATCH v2 3/3] tests/data/acpi/riscv64: Update expected FADT and MADT Sunil V L
2025-07-24 11:31   ` Daniel Henrique Barboza
2025-07-25  4:03   ` Nutty Liu
2025-07-29  3:03 ` [PATCH v2 0/3] RISC-V: ACPI: Update FADT and MADT versions Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).