[PATCH 2/3] hw/loongarch/virt: Set MADT revision to 6

Dongyan Qian posted 3 patches 1 month, 1 week ago
Maintainers: Song Gao <17746591750@163.com>, Bibo Mao <maobibo@loongson.cn>, Xianglai Li <lixianglai@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>
[PATCH 2/3] hw/loongarch/virt: Set MADT revision to 6
Posted by Dongyan Qian 1 month, 1 week ago
The LoongArch virt machine emits Core PIC, EIO PIC, MSI PIC and BIO PIC
subtables, but advertises MADT revision 1. Revision 1 predates these
LoongArch interrupt controller structures.

ACPI 6.5 introduced the LoongArch interrupt controller structures and
defined MADT revision 6. ACPI 6.6 raises the MADT revision to 7 for the
additional RISC-V interrupt controller structures, while leaving the
LoongArch structures unchanged.

Since the virt machine emits only the LoongArch structures defined by
ACPI 6.5, set the MADT header revision to 6, the minimum revision that
describes the table contents.

ACPI specifications:
https://uefi.org/specs/ACPI/6.5/
https://uefi.org/specs/ACPI/6.6/

Fixes: 735143f10d3 ("hw/loongarch: Add acpi ged support")
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
---
 hw/loongarch/virt-acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c
index a0b445f297..600ef60fc5 100644
--- a/hw/loongarch/virt-acpi-build.c
+++ b/hw/loongarch/virt-acpi-build.c
@@ -128,7 +128,7 @@ build_madt(GArray *table_data, BIOSLinker *linker,
     MachineClass *mc = MACHINE_GET_CLASS(ms);
     const CPUArchIdList *arch_ids = mc->possible_cpu_arch_ids(ms);
     int i, arch_id, flags;
-    AcpiTable table = { .sig = "APIC", .rev = 1, .oem_id = lvms->oem_id,
+    AcpiTable table = { .sig = "APIC", .rev = 6, .oem_id = lvms->oem_id,
                         .oem_table_id = lvms->oem_table_id };
 
     acpi_table_begin(&table, table_data);
-- 
2.43.0
Re: [PATCH 2/3] hw/loongarch/virt: Set MADT revision to 6
Posted by Bibo Mao 1 month, 1 week ago

On 2026/8/4 上午11:30, Dongyan Qian wrote:
> The LoongArch virt machine emits Core PIC, EIO PIC, MSI PIC and BIO PIC
> subtables, but advertises MADT revision 1. Revision 1 predates these
> LoongArch interrupt controller structures.
> 
> ACPI 6.5 introduced the LoongArch interrupt controller structures and
> defined MADT revision 6. ACPI 6.6 raises the MADT revision to 7 for the
> additional RISC-V interrupt controller structures, while leaving the
> LoongArch structures unchanged.
> 
> Since the virt machine emits only the LoongArch structures defined by
> ACPI 6.5, set the MADT header revision to 6, the minimum revision that
> describes the table contents.
> 
> ACPI specifications:
> https://uefi.org/specs/ACPI/6.5/
> https://uefi.org/specs/ACPI/6.6/
> 
> Fixes: 735143f10d3 ("hw/loongarch: Add acpi ged support")
> Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
> ---
>   hw/loongarch/virt-acpi-build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c
> index a0b445f297..600ef60fc5 100644
> --- a/hw/loongarch/virt-acpi-build.c
> +++ b/hw/loongarch/virt-acpi-build.c
> @@ -128,7 +128,7 @@ build_madt(GArray *table_data, BIOSLinker *linker,
>       MachineClass *mc = MACHINE_GET_CLASS(ms);
>       const CPUArchIdList *arch_ids = mc->possible_cpu_arch_ids(ms);
>       int i, arch_id, flags;
> -    AcpiTable table = { .sig = "APIC", .rev = 1, .oem_id = lvms->oem_id,
> +    AcpiTable table = { .sig = "APIC", .rev = 6, .oem_id = lvms->oem_id,
>                           .oem_table_id = lvms->oem_table_id };
>   
>       acpi_table_begin(&table, table_data);
> 
For this series.

Reviewed-by: Bibo Mao <maobibo@loongson.cn>