* [PATCH v5 1/9] hw/intc/gicv3_its: Do not check its_class_name()
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 2/9] hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable Gustavo Romero
` (7 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Since commit cc5e719e2c8 ("kvm: require KVM_CAP_SIGNAL_MSI"), the single
implementation of its_class_name() no longer returns NULL (it now always
returns a valid char pointer). Hence, update the prototype docstring and
remove the tautological checks that use the its_class_name() returned
value.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
---
hw/arm/virt-acpi-build.c | 32 +++++++++++---------------
include/hw/intc/arm_gicv3_its_common.h | 2 +-
2 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 7e8e0f0298..9eee284c80 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -737,20 +737,18 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
memmap[VIRT_HIGH_GIC_REDIST2].size);
}
- if (its_class_name()) {
- /*
- * ACPI spec, Revision 6.0 Errata A
- * (original 6.0 definition has invalid Length)
- * 5.2.12.18 GIC ITS Structure
- */
- build_append_int_noprefix(table_data, 0xF, 1); /* Type */
- build_append_int_noprefix(table_data, 20, 1); /* Length */
- build_append_int_noprefix(table_data, 0, 2); /* Reserved */
- build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
- /* Physical Base Address */
- build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
- build_append_int_noprefix(table_data, 0, 4); /* Reserved */
- }
+ /*
+ * ACPI spec, Revision 6.0 Errata A
+ * (original 6.0 definition has invalid Length)
+ * 5.2.12.18 GIC ITS Structure
+ */
+ build_append_int_noprefix(table_data, 0xF, 1); /* Type */
+ build_append_int_noprefix(table_data, 20, 1); /* Length */
+ build_append_int_noprefix(table_data, 0, 2); /* Reserved */
+ build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
+ /* Physical Base Address */
+ build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
+ build_append_int_noprefix(table_data, 0, 4); /* Reserved */
} else {
const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
@@ -969,10 +967,8 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
vms->oem_table_id);
}
- if (its_class_name()) {
- acpi_add_table(table_offsets, tables_blob);
- build_iort(tables_blob, tables->linker, vms);
- }
+ acpi_add_table(table_offsets, tables_blob);
+ build_iort(tables_blob, tables->linker, vms);
#ifdef CONFIG_TPM
if (tpm_get_version(tpm_find()) == TPM_VERSION_2_0) {
diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_gicv3_its_common.h
index 7dc712b38d..3c7b543b01 100644
--- a/include/hw/intc/arm_gicv3_its_common.h
+++ b/include/hw/intc/arm_gicv3_its_common.h
@@ -128,7 +128,7 @@ struct GICv3ITSCommonClass {
* Return the ITS class name to use depending on whether KVM acceleration
* and KVM CAP_SIGNAL_MSI are supported
*
- * Returns: class name to use or NULL
+ * Returns: class name to use
*/
const char *its_class_name(void);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 2/9] hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 1/9] hw/intc/gicv3_its: Do not check its_class_name() Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 3/9] hw/arm/virt: Simplify create_its() Gustavo Romero
` (6 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
Because 'tcg_its' in the machine instance is set based on the machine
class’s negated variable 'no_tcg_its', 'tcg_its' is the opposite of
'no_tcg_its' and hence the code in question can be simplified as:
tcg_its = !no_tcg_its.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
---
hw/arm/virt.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9a6cd085a3..19f85d0abf 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3337,12 +3337,8 @@ static void virt_instance_init(Object *obj)
/* Default allows ITS instantiation */
vms->its = true;
-
- if (vmc->no_tcg_its) {
- vms->tcg_its = false;
- } else {
- vms->tcg_its = true;
- }
+ /* Allow ITS emulation if the machine version supports it */
+ vms->tcg_its = !vmc->no_tcg_its;
/* Default disallows iommu instantiation */
vms->iommu = VIRT_IOMMU_NONE;
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 3/9] hw/arm/virt: Simplify create_its()
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 1/9] hw/intc/gicv3_its: Do not check its_class_name() Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 2/9] hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort Gustavo Romero
` (5 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha, Richard Henderson
From: Philippe Mathieu-Daudé <philmd@linaro.org>
No need to strstr() check the class name when we can use
kvm_irqchip_in_kernel() to check if the ITS from the host can be used.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
---
hw/arm/virt.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 19f85d0abf..96a09c3eac 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -705,21 +705,18 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms)
static void create_its(VirtMachineState *vms)
{
- const char *itsclass = its_class_name();
DeviceState *dev;
- if (!strcmp(itsclass, "arm-gicv3-its")) {
- if (!vms->tcg_its) {
- itsclass = NULL;
- }
- }
-
- if (!itsclass) {
- /* Do nothing if not supported */
+ assert(vms->its);
+ if (!kvm_irqchip_in_kernel() && !vms->tcg_its) {
+ /*
+ * Do nothing if ITS is neither supported by the host nor emulated by
+ * the machine.
+ */
return;
}
- dev = qdev_new(itsclass);
+ dev = qdev_new(its_class_name());
object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(vms->gic),
&error_abort);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (2 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 3/9] hw/arm/virt: Simplify create_its() Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 13:57 ` Eric Auger
2025-06-23 13:57 ` [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps Gustavo Romero
` (4 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
When building the Root Complex table, the comment about the code that
maps the RC node to SMMU node is misleading because it reads
"RC -> SMMUv3 -> ITS", but the code is only mapping the RCs IDs to the
SMMUv3 node. The step of mapping from the SMMUv3 IDs to the ITS Group
node is actually defined in another table (in the SMMUv3 node). So
change the comment to read "RC -> SMMUv3" instead.
Signed-off-by Gustavo Romero <gustavo.romero@linaro.org>
---
hw/arm/virt-acpi-build.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 9eee284c80..e9cd3fb351 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -370,7 +370,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
/* DeviceID mapping index (ignored since interrupts are GSIV based) */
build_append_int_noprefix(table_data, 0, 4);
- /* output IORT node is the ITS group node (the first node) */
+ /* Output IORT node is the ITS Group node (the first node) */
build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
}
@@ -407,23 +407,36 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
if (vms->iommu == VIRT_IOMMU_SMMUV3) {
AcpiIortIdMapping *range;
- /* translated RIDs connect to SMMUv3 node: RC -> SMMUv3 -> ITS */
+ /*
+ * Map RIDs (input) from RC to SMMUv3 nodes: RC -> SMMUv3.
+ *
+ * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
+ * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
+ * ITS Group node.
+ */
for (i = 0; i < smmu_idmaps->len; i++) {
range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
- /* output IORT node is the smmuv3 node */
+ /* Output IORT node is the SMMUv3 node. */
build_iort_id_mapping(table_data, range->input_base,
range->id_count, smmu_offset);
}
- /* bypassed RIDs connect to ITS group node directly: RC -> ITS */
+ /*
+ * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
+ * node directly: RC -> ITS.
+ */
for (i = 0; i < its_idmaps->len; i++) {
range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
- /* output IORT node is the ITS group node (the first node) */
+ /* Output IORT node is the ITS Group node (the first node). */
build_iort_id_mapping(table_data, range->input_base,
range->id_count, IORT_NODE_OFFSET);
}
} else {
- /* output IORT node is the ITS group node (the first node) */
+ /*
+ * Map all RIDs (input) to ITS Group node directly, since there is no
+ * SMMU: RC -> ITS.
+ * Output IORT node is the ITS Group node (the first node).
+ */
build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort
2025-06-23 13:57 ` [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort Gustavo Romero
@ 2025-06-27 13:57 ` Eric Auger
2025-06-27 14:05 ` Eric Auger via
0 siblings, 1 reply; 21+ messages in thread
From: Eric Auger @ 2025-06-27 13:57 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Gustavo,
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> When building the Root Complex table, the comment about the code that
s/table/node? or do you refer to the IORT table?
> maps the RC node to SMMU node is misleading because it reads
> "RC -> SMMUv3 -> ITS", but the code is only mapping the RCs IDs to the
> SMMUv3 node. The step of mapping from the SMMUv3 IDs to the ITS Group
> node is actually defined in another table (in the SMMUv3 node). So
> change the comment to read "RC -> SMMUv3" instead.
>
> Signed-off-by Gustavo Romero <gustavo.romero@linaro.org>
> ---
> hw/arm/virt-acpi-build.c | 25 +++++++++++++++++++------
> 1 file changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 9eee284c80..e9cd3fb351 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -370,7 +370,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
> build_append_int_noprefix(table_data, 0, 4);
>
> - /* output IORT node is the ITS group node (the first node) */
> + /* Output IORT node is the ITS Group node (the first node) */
> build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> }
>
> @@ -407,23 +407,36 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
> AcpiIortIdMapping *range;
>
> - /* translated RIDs connect to SMMUv3 node: RC -> SMMUv3 -> ITS */
> + /*
> + * Map RIDs (input) from RC to SMMUv3 nodes: RC -> SMMUv3.
> + *
> + * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
> + * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
s/table/node
> + * ITS Group node.
> + */
> for (i = 0; i < smmu_idmaps->len; i++) {
> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
> - /* output IORT node is the smmuv3 node */
> + /* Output IORT node is the SMMUv3 node. */
> build_iort_id_mapping(table_data, range->input_base,
> range->id_count, smmu_offset);
> }
>
> - /* bypassed RIDs connect to ITS group node directly: RC -> ITS */
> + /*
> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
> + * node directly: RC -> ITS.
> + */
> for (i = 0; i < its_idmaps->len; i++) {
> range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> - /* output IORT node is the ITS group node (the first node) */
> + /* Output IORT node is the ITS Group node (the first node). */
> build_iort_id_mapping(table_data, range->input_base,
> range->id_count, IORT_NODE_OFFSET);
> }
> } else {
> - /* output IORT node is the ITS group node (the first node) */
> + /*
> + * Map all RIDs (input) to ITS Group node directly, since there is no
> + * SMMU: RC -> ITS.
> + * Output IORT node is the ITS Group node (the first node).
> + */
> build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> }
>
Besides:
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort
2025-06-27 13:57 ` Eric Auger
@ 2025-06-27 14:05 ` Eric Auger via
0 siblings, 0 replies; 21+ messages in thread
From: Eric Auger via @ 2025-06-27 14:05 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
On 6/27/25 3:57 PM, Eric Auger wrote:
> Hi Gustavo,
>
> On 6/23/25 3:57 PM, Gustavo Romero wrote:
>> When building the Root Complex table, the comment about the code that
> s/table/node? or do you refer to the IORT table?
Reading the IORT spec again, both terminologies are used, ie. node / table
So please ignore my comment
Thanks
Eric
>> maps the RC node to SMMU node is misleading because it reads
>> "RC -> SMMUv3 -> ITS", but the code is only mapping the RCs IDs to the
>> SMMUv3 node. The step of mapping from the SMMUv3 IDs to the ITS Group
>> node is actually defined in another table (in the SMMUv3 node). So
>> change the comment to read "RC -> SMMUv3" instead.
>>
>> Signed-off-by Gustavo Romero <gustavo.romero@linaro.org>
>> ---
>> hw/arm/virt-acpi-build.c | 25 +++++++++++++++++++------
>> 1 file changed, 19 insertions(+), 6 deletions(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 9eee284c80..e9cd3fb351 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -370,7 +370,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
>> build_append_int_noprefix(table_data, 0, 4);
>>
>> - /* output IORT node is the ITS group node (the first node) */
>> + /* Output IORT node is the ITS Group node (the first node) */
>> build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> }
>>
>> @@ -407,23 +407,36 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
>> AcpiIortIdMapping *range;
>>
>> - /* translated RIDs connect to SMMUv3 node: RC -> SMMUv3 -> ITS */
>> + /*
>> + * Map RIDs (input) from RC to SMMUv3 nodes: RC -> SMMUv3.
>> + *
>> + * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
>> + * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
> s/table/node
>> + * ITS Group node.
>> + */
>> for (i = 0; i < smmu_idmaps->len; i++) {
>> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
>> - /* output IORT node is the smmuv3 node */
>> + /* Output IORT node is the SMMUv3 node. */
>> build_iort_id_mapping(table_data, range->input_base,
>> range->id_count, smmu_offset);
>> }
>>
>> - /* bypassed RIDs connect to ITS group node directly: RC -> ITS */
>> + /*
>> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
>> + * node directly: RC -> ITS.
>> + */
>> for (i = 0; i < its_idmaps->len; i++) {
>> range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
>> - /* output IORT node is the ITS group node (the first node) */
>> + /* Output IORT node is the ITS Group node (the first node). */
>> build_iort_id_mapping(table_data, range->input_base,
>> range->id_count, IORT_NODE_OFFSET);
>> }
>> } else {
>> - /* output IORT node is the ITS group node (the first node) */
>> + /*
>> + * Map all RIDs (input) to ITS Group node directly, since there is no
>> + * SMMU: RC -> ITS.
>> + * Output IORT node is the ITS Group node (the first node).
>> + */
>> build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> }
>>
> Besides:
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Eric
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (3 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 15:28 ` Eric Auger
2025-06-23 13:57 ` [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64 Gustavo Romero
` (3 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
Factor out a new function, create_its_idmaps(), from the current
build_iort code. Add proper comments to it clarifying how the ID ranges
that go directly to the ITS Group node are computed based on the ones
that go to the SMMU node.
Suggested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
hw/arm/virt-acpi-build.c | 64 +++++++++++++++++++++++++---------------
1 file changed, 41 insertions(+), 23 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index e9cd3fb351..40a782a498 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -266,6 +266,42 @@ static int iort_idmap_compare(gconstpointer a, gconstpointer b)
return idmap_a->input_base - idmap_b->input_base;
}
+/* Compute ID ranges (RIDs) from RC that do directly to the ITS Group node */
+static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps)
+{
+ AcpiIortIdMapping *idmap;
+ AcpiIortIdMapping next_range = {0};
+
+ /*
+ * Based on the RID ranges that go to the SMMU, determine the bypassed RID
+ * ranges, i.e., the ones that go directly to the ITS Group node, by
+ * subtracting the SMMU-bound ranges from the full RID range, 0x0000–0xFFFF.
+ */
+ for (int i = 0; i < smmu_idmaps->len; i++) {
+ idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
+
+ if (next_range.input_base < idmap->input_base) {
+ next_range.id_count = idmap->input_base - next_range.input_base;
+ g_array_append_val(its_idmaps, next_range);
+ }
+
+ next_range.input_base = idmap->input_base + idmap->id_count;
+ }
+
+ /*
+ * Append the last RC -> ITS ID mapping.
+ *
+ * RIDs are 16-bit, according to the PCI Express 2.0 Base Specification, rev
+ * 0.9, section 2.2.6.2, "Transaction Descriptor - Transaction ID Field",
+ * hence, the end of the range is 0x10000.
+ */
+ if (next_range.input_base < 0x10000) {
+ next_range.id_count = 0x10000 - next_range.input_base;
+ g_array_append_val(its_idmaps, next_range);
+ }
+}
+
+
/*
* Input Output Remapping Table (IORT)
* Conforms to "IO Remapping Table System Software on ARM Platforms",
@@ -276,7 +312,6 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
{
int i, nb_nodes, rc_mapping_count;
size_t node_size, smmu_offset = 0;
- AcpiIortIdMapping *idmap;
uint32_t id = 0;
GArray *smmu_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
GArray *its_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
@@ -287,34 +322,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
acpi_table_begin(&table, table_data);
if (vms->iommu == VIRT_IOMMU_SMMUV3) {
- AcpiIortIdMapping next_range = {0};
-
object_child_foreach_recursive(object_get_root(),
iort_host_bridges, smmu_idmaps);
/* Sort the smmu idmap by input_base */
g_array_sort(smmu_idmaps, iort_idmap_compare);
- /*
- * Split the whole RIDs by mapping from RC to SMMU,
- * build the ID mapping from RC to ITS directly.
- */
- for (i = 0; i < smmu_idmaps->len; i++) {
- idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
-
- if (next_range.input_base < idmap->input_base) {
- next_range.id_count = idmap->input_base - next_range.input_base;
- g_array_append_val(its_idmaps, next_range);
- }
-
- next_range.input_base = idmap->input_base + idmap->id_count;
- }
-
- /* Append the last RC -> ITS ID mapping */
- if (next_range.input_base < 0x10000) {
- next_range.id_count = 0x10000 - next_range.input_base;
- g_array_append_val(its_idmaps, next_range);
- }
+ /*
+ * Knowing the ID ranges from the RC to the SMMU, it's possible to
+ * determine the ID ranges from RC that go directly to ITS.
+ */
+ create_its_idmaps(its_idmaps, smmu_idmaps);
nb_nodes = 3; /* RC, ITS, SMMUv3 */
rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps
2025-06-23 13:57 ` [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps Gustavo Romero
@ 2025-06-27 15:28 ` Eric Auger
2025-06-28 19:43 ` Gustavo Romero
0 siblings, 1 reply; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:28 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Gustavo,
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> Factor out a new function, create_its_idmaps(), from the current
I would call it build_rc_its_idmap() to be clearer on what relationship
we build.
> build_iort code. Add proper comments to it clarifying how the ID ranges
> that go directly to the ITS Group node are computed based on the ones
> that go to the SMMU node.
>
> Suggested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
> hw/arm/virt-acpi-build.c | 64 +++++++++++++++++++++++++---------------
> 1 file changed, 41 insertions(+), 23 deletions(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index e9cd3fb351..40a782a498 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -266,6 +266,42 @@ static int iort_idmap_compare(gconstpointer a, gconstpointer b)
> return idmap_a->input_base - idmap_b->input_base;
> }
>
> +/* Compute ID ranges (RIDs) from RC that do directly to the ITS Group node */
s/do/go
Ior use the spec terminology: that are directed to the ITS Group node
> +static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps)
> +{
> + AcpiIortIdMapping *idmap;
> + AcpiIortIdMapping next_range = {0};
> +
> + /*
> + * Based on the RID ranges that go to the SMMU, determine the bypassed RID
same here
> + * ranges, i.e., the ones that go directly to the ITS Group node, by
> + * subtracting the SMMU-bound ranges from the full RID range, 0x0000–0xFFFF.
substracting
> + */
> + for (int i = 0; i < smmu_idmaps->len; i++) {
> + idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
> +
> + if (next_range.input_base < idmap->input_base) {
> + next_range.id_count = idmap->input_base - next_range.input_base;
> + g_array_append_val(its_idmaps, next_range);
> + }
> +
> + next_range.input_base = idmap->input_base + idmap->id_count;
> + }
> +
> + /*
> + * Append the last RC -> ITS ID mapping.
> + *
> + * RIDs are 16-bit, according to the PCI Express 2.0 Base Specification, rev
> + * 0.9, section 2.2.6.2, "Transaction Descriptor - Transaction ID Field",
> + * hence, the end of the range is 0x10000.
> + */
> + if (next_range.input_base < 0x10000) {
> + next_range.id_count = 0x10000 - next_range.input_base;
> + g_array_append_val(its_idmaps, next_range);
> + }
> +}
> +
> +
> /*
> * Input Output Remapping Table (IORT)
> * Conforms to "IO Remapping Table System Software on ARM Platforms",
> @@ -276,7 +312,6 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> {
> int i, nb_nodes, rc_mapping_count;
> size_t node_size, smmu_offset = 0;
> - AcpiIortIdMapping *idmap;
> uint32_t id = 0;
> GArray *smmu_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
> GArray *its_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
> @@ -287,34 +322,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> acpi_table_begin(&table, table_data);
>
> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
> - AcpiIortIdMapping next_range = {0};
> -
> object_child_foreach_recursive(object_get_root(),
> iort_host_bridges, smmu_idmaps);
>
> /* Sort the smmu idmap by input_base */
> g_array_sort(smmu_idmaps, iort_idmap_compare);
>
> - /*
> - * Split the whole RIDs by mapping from RC to SMMU,
> - * build the ID mapping from RC to ITS directly.
> - */
> - for (i = 0; i < smmu_idmaps->len; i++) {
> - idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
> -
> - if (next_range.input_base < idmap->input_base) {
> - next_range.id_count = idmap->input_base - next_range.input_base;
> - g_array_append_val(its_idmaps, next_range);
> - }
> -
> - next_range.input_base = idmap->input_base + idmap->id_count;
> - }
> -
> - /* Append the last RC -> ITS ID mapping */
> - if (next_range.input_base < 0x10000) {
> - next_range.id_count = 0x10000 - next_range.input_base;
> - g_array_append_val(its_idmaps, next_range);
> - }
> + /*
> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
> + * determine the ID ranges from RC that go directly to ITS.
are directed to
> + */
> + create_its_idmaps(its_idmaps, smmu_idmaps);
>
> nb_nodes = 3; /* RC, ITS, SMMUv3 */
> rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
Thanks
Eric
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps
2025-06-27 15:28 ` Eric Auger
@ 2025-06-28 19:43 ` Gustavo Romero
0 siblings, 0 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-28 19:43 UTC (permalink / raw)
To: eric.auger, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Eric,
Thanks a lot for another round of reviews :)
On 6/27/25 12:28, Eric Auger wrote:
> Hi Gustavo,
>
> On 6/23/25 3:57 PM, Gustavo Romero wrote:
>> Factor out a new function, create_its_idmaps(), from the current
> I would call it build_rc_its_idmap() to be clearer on what relationship
> we build.
>> build_iort code. Add proper comments to it clarifying how the ID ranges
>> that go directly to the ITS Group node are computed based on the ones
>> that go to the SMMU node.
>>
>> Suggested-by: Eric Auger <eric.auger@redhat.com>
>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>> ---
>> hw/arm/virt-acpi-build.c | 64 +++++++++++++++++++++++++---------------
>> 1 file changed, 41 insertions(+), 23 deletions(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index e9cd3fb351..40a782a498 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -266,6 +266,42 @@ static int iort_idmap_compare(gconstpointer a, gconstpointer b)
>> return idmap_a->input_base - idmap_b->input_base;
>> }
>>
>> +/* Compute ID ranges (RIDs) from RC that do directly to the ITS Group node */
> s/do/go
> Ior use the spec terminology: that are directed to the ITS Group node
Thanks, I stuck to "directed to" in v6.
>> +static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps)
>> +{
>> + AcpiIortIdMapping *idmap;
>> + AcpiIortIdMapping next_range = {0};
>> +
>> + /*
>> + * Based on the RID ranges that go to the SMMU, determine the bypassed RID
> same here
>> + * ranges, i.e., the ones that go directly to the ITS Group node, by
>> + * subtracting the SMMU-bound ranges from the full RID range, 0x0000–0xFFFF.
> substracting
I believe that "subtracting" is the correct form (but I'm not a native English speaker, of course).
It seems the "substract" is sometimes used in ancient texts and I do see them occurring in the
commit messages, but they occur much less frequently than "subtract":
gromero@gromero0:/mnt/git/qemu_/build$ git log | grep substract | wc -l
13
gromero@gromero0:/mnt/git/qemu_/build$ git log | grep subtract | wc -l
188
Cheers,
Gustavo
>> + */
>> + for (int i = 0; i < smmu_idmaps->len; i++) {
>> + idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
>> +
>> + if (next_range.input_base < idmap->input_base) {
>> + next_range.id_count = idmap->input_base - next_range.input_base;
>> + g_array_append_val(its_idmaps, next_range);
>> + }
>> +
>> + next_range.input_base = idmap->input_base + idmap->id_count;
>> + }
>> +
>> + /*
>> + * Append the last RC -> ITS ID mapping.
>> + *
>> + * RIDs are 16-bit, according to the PCI Express 2.0 Base Specification, rev
>> + * 0.9, section 2.2.6.2, "Transaction Descriptor - Transaction ID Field",
>> + * hence, the end of the range is 0x10000.
>> + */
>> + if (next_range.input_base < 0x10000) {
>> + next_range.id_count = 0x10000 - next_range.input_base;
>> + g_array_append_val(its_idmaps, next_range);
>> + }
>> +}
>> +
>> +
>> /*
>> * Input Output Remapping Table (IORT)
>> * Conforms to "IO Remapping Table System Software on ARM Platforms",
>> @@ -276,7 +312,6 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> {
>> int i, nb_nodes, rc_mapping_count;
>> size_t node_size, smmu_offset = 0;
>> - AcpiIortIdMapping *idmap;
>> uint32_t id = 0;
>> GArray *smmu_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
>> GArray *its_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
>> @@ -287,34 +322,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> acpi_table_begin(&table, table_data);
>>
>> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
>> - AcpiIortIdMapping next_range = {0};
>> -
>> object_child_foreach_recursive(object_get_root(),
>> iort_host_bridges, smmu_idmaps);
>>
>> /* Sort the smmu idmap by input_base */
>> g_array_sort(smmu_idmaps, iort_idmap_compare);
>>
>> - /*
>> - * Split the whole RIDs by mapping from RC to SMMU,
>> - * build the ID mapping from RC to ITS directly.
>> - */
>> - for (i = 0; i < smmu_idmaps->len; i++) {
>> - idmap = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
>> -
>> - if (next_range.input_base < idmap->input_base) {
>> - next_range.id_count = idmap->input_base - next_range.input_base;
>> - g_array_append_val(its_idmaps, next_range);
>> - }
>> -
>> - next_range.input_base = idmap->input_base + idmap->id_count;
>> - }
>> -
>> - /* Append the last RC -> ITS ID mapping */
>> - if (next_range.input_base < 0x10000) {
>> - next_range.id_count = 0x10000 - next_range.input_base;
>> - g_array_append_val(its_idmaps, next_range);
>> - }
>> + /*
>> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
>> + * determine the ID ranges from RC that go directly to ITS.
> are directed to
>> + */
>> + create_its_idmaps(its_idmaps, smmu_idmaps);
>>
>> nb_nodes = 3; /* RC, ITS, SMMUv3 */
>> rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
> Thanks
>
> Eric
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (4 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 15:30 ` Eric Auger
2025-06-23 13:57 ` [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test " Gustavo Romero
` (2 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Arm64 GIC ITS (Interrupt Translation Service) is an optional piece of
hardware introduced in GICv3 and, being optional, it can be disabled
in QEMU aarch64 VMs that support it using machine option "its=off",
like, for instance: "-M virt,its=off".
In ACPI, the ITS is advertised, if present, in the MADT (aka APIC)
table, while the ID mappings from the Root Complex (RC) and from the
SMMU nodes to the ITS Group nodes are described in the IORT table.
This new test verifies that when the "its=off" option is passed to the
machine the ITS-related data is correctly pruned from the ACPI tables.
The new blobs for this test will be added in a following commit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
+"tests/data/acpi/aarch64/virt/IORT.its_off",
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 0b2bdf9d0d..4dbc07ec5e 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -2146,6 +2146,25 @@ static void test_acpi_aarch64_virt_tcg_topology(void)
free_test_data(&data);
}
+static void test_acpi_aarch64_virt_tcg_its_off(void)
+{
+ test_data data = {
+ .machine = "virt",
+ .arch = "aarch64",
+ .variant = ".its_off",
+ .tcg_only = true,
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
+ .ram_start = 0x40000000ULL,
+ .scan_len = 128ULL * 1024 * 1024,
+ };
+
+ test_acpi_one("-cpu cortex-a57 "
+ "-M gic-version=3,iommu=smmuv3,its=off", &data);
+ free_test_data(&data);
+}
+
static void test_acpi_q35_viot(void)
{
test_data data = {
@@ -2577,6 +2596,8 @@ int main(int argc, char *argv[])
test_acpi_aarch64_virt_tcg_acpi_hmat);
qtest_add_func("acpi/virt/topology",
test_acpi_aarch64_virt_tcg_topology);
+ qtest_add_func("acpi/virt/its_off",
+ test_acpi_aarch64_virt_tcg_its_off);
qtest_add_func("acpi/virt/numamem",
test_acpi_aarch64_virt_tcg_numamem);
qtest_add_func("acpi/virt/memhp", test_acpi_aarch64_virt_tcg_memhp);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64
2025-06-23 13:57 ` [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64 Gustavo Romero
@ 2025-06-27 15:30 ` Eric Auger
0 siblings, 0 replies; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:30 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> Arm64 GIC ITS (Interrupt Translation Service) is an optional piece of
> hardware introduced in GICv3 and, being optional, it can be disabled
> in QEMU aarch64 VMs that support it using machine option "its=off",
> like, for instance: "-M virt,its=off".
>
> In ACPI, the ITS is advertised, if present, in the MADT (aka APIC)
> table, while the ID mappings from the Root Complex (RC) and from the
> SMMU nodes to the ITS Group nodes are described in the IORT table.
>
> This new test verifies that when the "its=off" option is passed to the
> machine the ITS-related data is correctly pruned from the ACPI tables.
>
> The new blobs for this test will be added in a following commit.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> tests/qtest/bios-tables-test-allowed-diff.h | 2 ++
> tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
> +"tests/data/acpi/aarch64/virt/IORT.its_off",
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 0b2bdf9d0d..4dbc07ec5e 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -2146,6 +2146,25 @@ static void test_acpi_aarch64_virt_tcg_topology(void)
> free_test_data(&data);
> }
>
> +static void test_acpi_aarch64_virt_tcg_its_off(void)
> +{
> + test_data data = {
> + .machine = "virt",
> + .arch = "aarch64",
> + .variant = ".its_off",
> + .tcg_only = true,
> + .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
> + .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
> + .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
> + .ram_start = 0x40000000ULL,
> + .scan_len = 128ULL * 1024 * 1024,
> + };
> +
> + test_acpi_one("-cpu cortex-a57 "
> + "-M gic-version=3,iommu=smmuv3,its=off", &data);
> + free_test_data(&data);
> +}
> +
> static void test_acpi_q35_viot(void)
> {
> test_data data = {
> @@ -2577,6 +2596,8 @@ int main(int argc, char *argv[])
> test_acpi_aarch64_virt_tcg_acpi_hmat);
> qtest_add_func("acpi/virt/topology",
> test_acpi_aarch64_virt_tcg_topology);
> + qtest_add_func("acpi/virt/its_off",
> + test_acpi_aarch64_virt_tcg_its_off);
> qtest_add_func("acpi/virt/numamem",
> test_acpi_aarch64_virt_tcg_numamem);
> qtest_add_func("acpi/virt/memhp", test_acpi_aarch64_virt_tcg_memhp);
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test on aarch64
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (5 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64 Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 15:32 ` Eric Auger
2025-06-23 13:57 ` [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Gustavo Romero
2025-06-23 13:57 ` [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64 Gustavo Romero
8 siblings, 1 reply; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
Add blobs for test_acpi_aarch64_virt_tcg_its_off(), which introduces a
new variant, .its_off, that requires variations of the MADT and IORT
tables.
MADT (aka APIC) diff:
+[000h 0000 4] Signature : "APIC" [Multiple APIC Description Table (MADT)]
+[004h 0004 4] Table Length : 000000B8
+[008h 0008 1] Revision : 04
+[009h 0009 1] Checksum : C1
+[00Ah 0010 6] Oem ID : "BOCHS "
+[010h 0016 8] Oem Table ID : "BXPC "
+[018h 0024 4] Oem Revision : 00000001
+[01Ch 0028 4] Asl Compiler ID : "BXPC"
+[020h 0032 4] Asl Compiler Revision : 00000001
+
+[024h 0036 4] Local Apic Address : 00000000
+[028h 0040 4] Flags (decoded below) : 00000000
+ PC-AT Compatibility : 0
+
+[02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distributor]
+[02Dh 0045 1] Length : 18
+[02Eh 0046 2] Reserved : 0000
+[030h 0048 4] Local GIC Hardware ID : 00000000
+[034h 0052 8] Base Address : 0000000008000000
+[03Ch 0060 4] Interrupt Base : 00000000
+[040h 0064 1] Version : 03
+[041h 0065 3] Reserved : 000000
+
+[044h 0068 1] Subtable Type : 0B [Generic Interrupt Controller]
+[045h 0069 1] Length : 50
+[046h 0070 2] Reserved : 0000
+[048h 0072 4] CPU Interface Number : 00000000
+[04Ch 0076 4] Processor UID : 00000000
+[050h 0080 4] Flags (decoded below) : 00000001
+ Processor Enabled : 1
+ Performance Interrupt Trigger Mode : 0
+ Virtual GIC Interrupt Trigger Mode : 0
+[054h 0084 4] Parking Protocol Version : 00000000
+[058h 0088 4] Performance Interrupt : 00000017
+[05Ch 0092 8] Parked Address : 0000000000000000
+[064h 0100 8] Base Address : 0000000000000000
+[06Ch 0108 8] Virtual GIC Base Address : 0000000000000000
+[074h 0116 8] Hypervisor GIC Base Address : 0000000000000000
+[07Ch 0124 4] Virtual GIC Interrupt : 00000000
+[080h 0128 8] Redistributor Base Address : 0000000000000000
+[088h 0136 8] ARM MPIDR : 0000000000000000
+[090h 0144 1] Efficiency Class : 00
+[091h 0145 1] Reserved : 00
+[092h 0146 2] SPE Overflow Interrupt : 0000
+
+[094h 0148 1] Subtable Type : 0E [Generic Interrupt Redistributor]
+[095h 0149 1] Length : 10
+[096h 0150 2] Reserved : 0000
+[098h 0152 8] Base Address : 00000000080A0000
+[0A0h 0160 4] Length : 00F60000
+
+[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Translator]
+[0A5h 0165 1] Length : 14
+[0A6h 0166 2] Reserved : 0000
+[0A8h 0168 4] Translation ID : 00000000
+[0ACh 0172 8] Base Address : 0000000008080000
+[0B4h 0180 4] Reserved : 00000000
IORT diff:
+[000h 0000 4] Signature : "IORT" [IO Remapping Table]
+[004h 0004 4] Table Length : 000000EC
+[008h 0008 1] Revision : 03
+[009h 0009 1] Checksum : 57
+[00Ah 0010 6] Oem ID : "BOCHS "
+[010h 0016 8] Oem Table ID : "BXPC "
+[018h 0024 4] Oem Revision : 00000001
+[01Ch 0028 4] Asl Compiler ID : "BXPC"
+[020h 0032 4] Asl Compiler Revision : 00000001
+
+[024h 0036 4] Node Count : 00000003
+[028h 0040 4] Node Offset : 00000030
+[02Ch 0044 4] Reserved : 00000000
+
+[030h 0048 1] Type : 00
+[031h 0049 2] Length : 0018
+[033h 0051 1] Revision : 01
+[034h 0052 4] Reserved : 00000000
+[038h 0056 4] Mapping Count : 00000000
+[03Ch 0060 4] Mapping Offset : 00000000
+
+[040h 0064 4] ItsCount : 00000001
+[044h 0068 4] Identifiers : 00000000
+
+[048h 0072 1] Type : 04
+[049h 0073 2] Length : 0058
+[04Bh 0075 1] Revision : 04
+[04Ch 0076 4] Reserved : 00000001
+[050h 0080 4] Mapping Count : 00000001
+[054h 0084 4] Mapping Offset : 00000044
+
+[058h 0088 8] Base Address : 0000000009050000
+[060h 0096 4] Flags (decoded below) : 00000001
+ COHACC Override : 1
+ HTTU Override : 0
+ Proximity Domain Valid : 0
+[064h 0100 4] Reserved : 00000000
+[068h 0104 8] VATOS Address : 0000000000000000
+[070h 0112 4] Model : 00000000
+[074h 0116 4] Event GSIV : 0000006A
+[078h 0120 4] PRI GSIV : 0000006B
+[07Ch 0124 4] GERR GSIV : 0000006D
+[080h 0128 4] Sync GSIV : 0000006C
+[084h 0132 4] Proximity Domain : 00000000
+[088h 0136 4] Device ID Mapping Index : 00000000
+
+[08Ch 0140 4] Input base : 00000000
+[090h 0144 4] ID Count : 0000FFFF
+[094h 0148 4] Output Base : 00000000
+[098h 0152 4] Output Reference : 00000030
+[09Ch 0156 4] Flags (decoded below) : 00000000
+ Single Mapping : 0
+
+[0A0h 0160 1] Type : 02
+[0A1h 0161 2] Length : 004C
+[0A3h 0163 1] Revision : 03
+[0A4h 0164 4] Reserved : 00000002
+[0A8h 0168 4] Mapping Count : 00000002
+[0ACh 0172 4] Mapping Offset : 00000024
+
+[0B0h 0176 8] Memory Properties : [IORT Memory Access Properties]
+[0B0h 0176 4] Cache Coherency : 00000001
+[0B4h 0180 1] Hints (decoded below) : 00
+ Transient : 0
+ Write Allocate : 0
+ Read Allocate : 0
+ Override : 0
+[0B5h 0181 2] Reserved : 0000
+[0B7h 0183 1] Memory Flags (decoded below) : 03
+ Coherency : 1
+ Device Attribute : 1
+[0B8h 0184 4] ATS Attribute : 00000000
+[0BCh 0188 4] PCI Segment Number : 00000000
+[0C0h 0192 1] Memory Size Limit : 40
+[0C1h 0193 3] Reserved : 000000
+
+[0C4h 0196 4] Input base : 00000000
+[0C8h 0200 4] ID Count : 000000FF
+[0CCh 0204 4] Output Base : 00000000
+[0D0h 0208 4] Output Reference : 00000048
+[0D4h 0212 4] Flags (decoded below) : 00000000
+ Single Mapping : 0
+
+[0D8h 0216 4] Input base : 00000100
+[0DCh 0220 4] ID Count : 0000FEFF
+[0E0h 0224 4] Output Base : 00000100
+[0E4h 0228 4] Output Reference : 00000030
+[0E8h 0232 4] Flags (decoded below) : 00000000
+ Single Mapping : 0
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/data/acpi/aarch64/virt/APIC.its_off | Bin 0 -> 184 bytes
tests/data/acpi/aarch64/virt/IORT.its_off | Bin 0 -> 236 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 2 --
3 files changed, 2 deletions(-)
create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off
diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aarch64/virt/APIC.its_off
new file mode 100644
index 0000000000000000000000000000000000000000..37d82e970b1331cb5b259f0bd2d3654bacb2d623
GIT binary patch
literal 184
zcmZ<^@O0k6z`($A(8=G~BUr&HBEVSz2pEB4AU24G0Uik$i-7~iVg@p}17JJ`2AFzr
Zgb>LrJ^_#xE~p*f82CkCMsUFG1ppOZ2>}2A
literal 0
HcmV?d00001
diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aarch64/virt/IORT.its_off
new file mode 100644
index 0000000000000000000000000000000000000000..0fceb820d509e852ca0849baf568a8e93e426738
GIT binary patch
literal 236
zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=RgMkDCNC*yK9F_<M77!bR
zUBI%eoFED&4;F$FSwK1)h;xBB2Py`m{{M%tVD>TjFfcO#g+N#Zh@s|zoCF3AP#UU@
R!2`+%Dg6Hr$N|zYvjDIZ5CH%H
literal 0
HcmV?d00001
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index a88198d5c2..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/aarch64/virt/APIC.its_off",
-"tests/data/acpi/aarch64/virt/IORT.its_off",
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test on aarch64
2025-06-23 13:57 ` [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test " Gustavo Romero
@ 2025-06-27 15:32 ` Eric Auger
0 siblings, 0 replies; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:32 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> Add blobs for test_acpi_aarch64_virt_tcg_its_off(), which introduces a
> new variant, .its_off, that requires variations of the MADT and IORT
> tables.
>
> MADT (aka APIC) diff:
>
> +[000h 0000 4] Signature : "APIC" [Multiple APIC Description Table (MADT)]
> +[004h 0004 4] Table Length : 000000B8
> +[008h 0008 1] Revision : 04
> +[009h 0009 1] Checksum : C1
> +[00Ah 0010 6] Oem ID : "BOCHS "
> +[010h 0016 8] Oem Table ID : "BXPC "
> +[018h 0024 4] Oem Revision : 00000001
> +[01Ch 0028 4] Asl Compiler ID : "BXPC"
> +[020h 0032 4] Asl Compiler Revision : 00000001
> +
> +[024h 0036 4] Local Apic Address : 00000000
> +[028h 0040 4] Flags (decoded below) : 00000000
> + PC-AT Compatibility : 0
> +
> +[02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distributor]
> +[02Dh 0045 1] Length : 18
> +[02Eh 0046 2] Reserved : 0000
> +[030h 0048 4] Local GIC Hardware ID : 00000000
> +[034h 0052 8] Base Address : 0000000008000000
> +[03Ch 0060 4] Interrupt Base : 00000000
> +[040h 0064 1] Version : 03
> +[041h 0065 3] Reserved : 000000
> +
> +[044h 0068 1] Subtable Type : 0B [Generic Interrupt Controller]
> +[045h 0069 1] Length : 50
> +[046h 0070 2] Reserved : 0000
> +[048h 0072 4] CPU Interface Number : 00000000
> +[04Ch 0076 4] Processor UID : 00000000
> +[050h 0080 4] Flags (decoded below) : 00000001
> + Processor Enabled : 1
> + Performance Interrupt Trigger Mode : 0
> + Virtual GIC Interrupt Trigger Mode : 0
> +[054h 0084 4] Parking Protocol Version : 00000000
> +[058h 0088 4] Performance Interrupt : 00000017
> +[05Ch 0092 8] Parked Address : 0000000000000000
> +[064h 0100 8] Base Address : 0000000000000000
> +[06Ch 0108 8] Virtual GIC Base Address : 0000000000000000
> +[074h 0116 8] Hypervisor GIC Base Address : 0000000000000000
> +[07Ch 0124 4] Virtual GIC Interrupt : 00000000
> +[080h 0128 8] Redistributor Base Address : 0000000000000000
> +[088h 0136 8] ARM MPIDR : 0000000000000000
> +[090h 0144 1] Efficiency Class : 00
> +[091h 0145 1] Reserved : 00
> +[092h 0146 2] SPE Overflow Interrupt : 0000
> +
> +[094h 0148 1] Subtable Type : 0E [Generic Interrupt Redistributor]
> +[095h 0149 1] Length : 10
> +[096h 0150 2] Reserved : 0000
> +[098h 0152 8] Base Address : 00000000080A0000
> +[0A0h 0160 4] Length : 00F60000
> +
> +[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Translator]
> +[0A5h 0165 1] Length : 14
> +[0A6h 0166 2] Reserved : 0000
> +[0A8h 0168 4] Translation ID : 00000000
> +[0ACh 0172 8] Base Address : 0000000008080000
> +[0B4h 0180 4] Reserved : 00000000
>
> IORT diff:
>
> +[000h 0000 4] Signature : "IORT" [IO Remapping Table]
> +[004h 0004 4] Table Length : 000000EC
> +[008h 0008 1] Revision : 03
> +[009h 0009 1] Checksum : 57
> +[00Ah 0010 6] Oem ID : "BOCHS "
> +[010h 0016 8] Oem Table ID : "BXPC "
> +[018h 0024 4] Oem Revision : 00000001
> +[01Ch 0028 4] Asl Compiler ID : "BXPC"
> +[020h 0032 4] Asl Compiler Revision : 00000001
> +
> +[024h 0036 4] Node Count : 00000003
> +[028h 0040 4] Node Offset : 00000030
> +[02Ch 0044 4] Reserved : 00000000
> +
> +[030h 0048 1] Type : 00
> +[031h 0049 2] Length : 0018
> +[033h 0051 1] Revision : 01
> +[034h 0052 4] Reserved : 00000000
> +[038h 0056 4] Mapping Count : 00000000
> +[03Ch 0060 4] Mapping Offset : 00000000
> +
> +[040h 0064 4] ItsCount : 00000001
> +[044h 0068 4] Identifiers : 00000000
> +
> +[048h 0072 1] Type : 04
> +[049h 0073 2] Length : 0058
> +[04Bh 0075 1] Revision : 04
> +[04Ch 0076 4] Reserved : 00000001
> +[050h 0080 4] Mapping Count : 00000001
> +[054h 0084 4] Mapping Offset : 00000044
> +
> +[058h 0088 8] Base Address : 0000000009050000
> +[060h 0096 4] Flags (decoded below) : 00000001
> + COHACC Override : 1
> + HTTU Override : 0
> + Proximity Domain Valid : 0
> +[064h 0100 4] Reserved : 00000000
> +[068h 0104 8] VATOS Address : 0000000000000000
> +[070h 0112 4] Model : 00000000
> +[074h 0116 4] Event GSIV : 0000006A
> +[078h 0120 4] PRI GSIV : 0000006B
> +[07Ch 0124 4] GERR GSIV : 0000006D
> +[080h 0128 4] Sync GSIV : 0000006C
> +[084h 0132 4] Proximity Domain : 00000000
> +[088h 0136 4] Device ID Mapping Index : 00000000
> +
> +[08Ch 0140 4] Input base : 00000000
> +[090h 0144 4] ID Count : 0000FFFF
> +[094h 0148 4] Output Base : 00000000
> +[098h 0152 4] Output Reference : 00000030
> +[09Ch 0156 4] Flags (decoded below) : 00000000
> + Single Mapping : 0
> +
> +[0A0h 0160 1] Type : 02
> +[0A1h 0161 2] Length : 004C
> +[0A3h 0163 1] Revision : 03
> +[0A4h 0164 4] Reserved : 00000002
> +[0A8h 0168 4] Mapping Count : 00000002
> +[0ACh 0172 4] Mapping Offset : 00000024
> +
> +[0B0h 0176 8] Memory Properties : [IORT Memory Access Properties]
> +[0B0h 0176 4] Cache Coherency : 00000001
> +[0B4h 0180 1] Hints (decoded below) : 00
> + Transient : 0
> + Write Allocate : 0
> + Read Allocate : 0
> + Override : 0
> +[0B5h 0181 2] Reserved : 0000
> +[0B7h 0183 1] Memory Flags (decoded below) : 03
> + Coherency : 1
> + Device Attribute : 1
> +[0B8h 0184 4] ATS Attribute : 00000000
> +[0BCh 0188 4] PCI Segment Number : 00000000
> +[0C0h 0192 1] Memory Size Limit : 40
> +[0C1h 0193 3] Reserved : 000000
> +
> +[0C4h 0196 4] Input base : 00000000
> +[0C8h 0200 4] ID Count : 000000FF
> +[0CCh 0204 4] Output Base : 00000000
> +[0D0h 0208 4] Output Reference : 00000048
> +[0D4h 0212 4] Flags (decoded below) : 00000000
> + Single Mapping : 0
> +
> +[0D8h 0216 4] Input base : 00000100
> +[0DCh 0220 4] ID Count : 0000FEFF
> +[0E0h 0224 4] Output Base : 00000100
> +[0E4h 0228 4] Output Reference : 00000030
> +[0E8h 0232 4] Flags (decoded below) : 00000000
> + Single Mapping : 0
>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> tests/data/acpi/aarch64/virt/APIC.its_off | Bin 0 -> 184 bytes
> tests/data/acpi/aarch64/virt/IORT.its_off | Bin 0 -> 236 bytes
> tests/qtest/bios-tables-test-allowed-diff.h | 2 --
> 3 files changed, 2 deletions(-)
> create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
> create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off
>
> diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aarch64/virt/APIC.its_off
> new file mode 100644
> index 0000000000000000000000000000000000000000..37d82e970b1331cb5b259f0bd2d3654bacb2d623
> GIT binary patch
> literal 184
> zcmZ<^@O0k6z`($A(8=G~BUr&HBEVSz2pEB4AU24G0Uik$i-7~iVg@p}17JJ`2AFzr
> Zgb>LrJ^_#xE~p*f82CkCMsUFG1ppOZ2>}2A
>
> literal 0
> HcmV?d00001
>
> diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aarch64/virt/IORT.its_off
> new file mode 100644
> index 0000000000000000000000000000000000000000..0fceb820d509e852ca0849baf568a8e93e426738
> GIT binary patch
> literal 236
> zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=RgMkDCNC*yK9F_<M77!bR
> zUBI%eoFED&4;F$FSwK1)h;xBB2Py`m{{M%tVD>TjFfcO#g+N#Zh@s|zoCF3AP#UU@
> R!2`+%Dg6Hr$N|zYvjDIZ5CH%H
>
> literal 0
> HcmV?d00001
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index a88198d5c2..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/aarch64/virt/APIC.its_off",
> -"tests/data/acpi/aarch64/virt/IORT.its_off",
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (6 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test " Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 15:44 ` Eric Auger
2025-06-27 15:45 ` Eric Auger
2025-06-23 13:57 ` [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64 Gustavo Romero
8 siblings, 2 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct
in the MADT table are always generated, even if GIC ITS is not available
on the machine.
This commit fixes it by not generating the ITS Group nodes, not mapping
any other node to them, and not advertising the GIC ITS in the MADT
table, when GIC ITS is not available on the machine.
Since the fix changes the MADT and IORT tables, add the blobs for the
"its=off" test to the allow list and update them in the next commit.
Reported-by: Udo Steinberg <udo@hypervisor.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/virt-acpi-build.c | 128 ++++++++++++--------
tests/qtest/bios-tables-test-allowed-diff.h | 2 +
2 files changed, 80 insertions(+), 50 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 40a782a498..17ae46804a 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
/* Sort the smmu idmap by input_base */
g_array_sort(smmu_idmaps, iort_idmap_compare);
- /*
- * Knowing the ID ranges from the RC to the SMMU, it's possible to
- * determine the ID ranges from RC that go directly to ITS.
- */
- create_its_idmaps(its_idmaps, smmu_idmaps);
-
- nb_nodes = 3; /* RC, ITS, SMMUv3 */
- rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
+ nb_nodes = 2; /* RC and SMMUv3 */
+ rc_mapping_count = smmu_idmaps->len;
+
+ if (vms->its) {
+ /*
+ * Knowing the ID ranges from the RC to the SMMU, it's possible to
+ * determine the ID ranges from RC that go directly to ITS.
+ */
+ create_its_idmaps(its_idmaps, smmu_idmaps);
+
+ nb_nodes++; /* ITS */
+ rc_mapping_count += its_idmaps->len;
+ }
} else {
- nb_nodes = 2; /* RC, ITS */
- rc_mapping_count = 1;
+ if (vms->its) {
+ nb_nodes = 2; /* RC and ITS */
+ rc_mapping_count = 1; /* Direct map to ITS */
+ } else {
+ nb_nodes = 1; /* RC only */
+ rc_mapping_count = 0; /* No output mapping */
+ }
}
/* Number of IORT Nodes */
build_append_int_noprefix(table_data, nb_nodes, 4);
@@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4);
build_append_int_noprefix(table_data, 0, 4); /* Reserved */
- /* Table 12 ITS Group Format */
- build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
- node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
- build_append_int_noprefix(table_data, node_size, 2); /* Length */
- build_append_int_noprefix(table_data, 1, 1); /* Revision */
- build_append_int_noprefix(table_data, id++, 4); /* Identifier */
- build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
- build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
- build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
- /* GIC ITS Identifier Array */
- build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
+ if (vms->its) {
+ /* Table 12 ITS Group Format */
+ build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
+ node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
+ build_append_int_noprefix(table_data, node_size, 2); /* Length */
+ build_append_int_noprefix(table_data, 1, 1); /* Revision */
+ build_append_int_noprefix(table_data, id++, 4); /* Identifier */
+ build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
+ build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
+ build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
+ /* GIC ITS Identifier Array */
+ build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
+ }
if (vms->iommu == VIRT_IOMMU_SMMUV3) {
int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE;
-
+ int num_id_mappings, offset_to_id_array;
+
+ if (vms->its) {
+ num_id_mappings = 1; /* ITS Group node */
+ offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header */
+ } else {
+ num_id_mappings = 0; /* No ID mappings */
+ offset_to_id_array = 0; /* No ID mappings array */
+ }
smmu_offset = table_data->len - table.table_offset;
/* Table 9 SMMUv3 Format */
build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */
- node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE;
+ node_size = SMMU_V3_ENTRY_SIZE +
+ (ID_MAPPING_ENTRY_SIZE * num_id_mappings);
build_append_int_noprefix(table_data, node_size, 2); /* Length */
build_append_int_noprefix(table_data, 4, 1); /* Revision */
build_append_int_noprefix(table_data, id++, 4); /* Identifier */
- build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */
+ /* Number of ID mappings */
+ build_append_int_noprefix(table_data, num_id_mappings, 4);
/* Reference to ID Array */
- build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4);
+ build_append_int_noprefix(table_data, offset_to_id_array, 4);
/* Base address */
build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8);
/* Flags */
@@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */
/* DeviceID mapping index (ignored since interrupts are GSIV based) */
build_append_int_noprefix(table_data, 0, 4);
-
- /* Output IORT node is the ITS Group node (the first node) */
- build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
+ /* Array of ID mappings */
+ if (num_id_mappings) {
+ /* Output IORT node is the ITS Group node (the first node). */
+ build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
+ }
}
/* Table 17 Root Complex Node */
@@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
*
* N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
* defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
- * ITS Group node.
+ * ITS Group node, if ITS is available.
*/
for (i = 0; i < smmu_idmaps->len; i++) {
range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
@@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
range->id_count, smmu_offset);
}
- /*
- * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
- * node directly: RC -> ITS.
- */
- for (i = 0; i < its_idmaps->len; i++) {
- range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
- /* Output IORT node is the ITS Group node (the first node). */
- build_iort_id_mapping(table_data, range->input_base,
- range->id_count, IORT_NODE_OFFSET);
+ if (vms->its) {
+ /*
+ * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
+ * node directly: RC -> ITS.
+ */
+ for (i = 0; i < its_idmaps->len; i++) {
+ range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
+ /* Output IORT node is the ITS Group node (the first node). */
+ build_iort_id_mapping(table_data, range->input_base,
+ range->id_count, IORT_NODE_OFFSET);
+ }
}
} else {
/*
@@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
memmap[VIRT_HIGH_GIC_REDIST2].size);
}
- /*
- * ACPI spec, Revision 6.0 Errata A
- * (original 6.0 definition has invalid Length)
- * 5.2.12.18 GIC ITS Structure
- */
- build_append_int_noprefix(table_data, 0xF, 1); /* Type */
- build_append_int_noprefix(table_data, 20, 1); /* Length */
- build_append_int_noprefix(table_data, 0, 2); /* Reserved */
- build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
- /* Physical Base Address */
- build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
- build_append_int_noprefix(table_data, 0, 4); /* Reserved */
+ if (vms->its) {
+ /*
+ * ACPI spec, Revision 6.0 Errata A
+ * (original 6.0 definition has invalid Length)
+ * 5.2.12.18 GIC ITS Structure
+ */
+ build_append_int_noprefix(table_data, 0xF, 1); /* Type */
+ build_append_int_noprefix(table_data, 20, 1); /* Length */
+ build_append_int_noprefix(table_data, 0, 2); /* Reserved */
+ build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
+ /* Physical Base Address */
+ build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
+ build_append_int_noprefix(table_data, 0, 4); /* Reserved */
+ }
} else {
const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
+"tests/data/acpi/aarch64/virt/IORT.its_off",
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off
2025-06-23 13:57 ` [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Gustavo Romero
@ 2025-06-27 15:44 ` Eric Auger
2025-06-28 19:44 ` Gustavo Romero
2025-06-27 15:45 ` Eric Auger
1 sibling, 1 reply; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:44 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Gustavo,
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct
> in the MADT table are always generated, even if GIC ITS is not available
> on the machine.
>
> This commit fixes it by not generating the ITS Group nodes, not mapping
> any other node to them, and not advertising the GIC ITS in the MADT
> table, when GIC ITS is not available on the machine.
>
> Since the fix changes the MADT and IORT tables, add the blobs for the
> "its=off" test to the allow list and update them in the next commit.
>
> Reported-by: Udo Steinberg <udo@hypervisor.org>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/arm/virt-acpi-build.c | 128 ++++++++++++--------
> tests/qtest/bios-tables-test-allowed-diff.h | 2 +
> 2 files changed, 80 insertions(+), 50 deletions(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 40a782a498..17ae46804a 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> /* Sort the smmu idmap by input_base */
> g_array_sort(smmu_idmaps, iort_idmap_compare);
>
> - /*
> - * Knowing the ID ranges from the RC to the SMMU, it's possible to
> - * determine the ID ranges from RC that go directly to ITS.
> - */
> - create_its_idmaps(its_idmaps, smmu_idmaps);
> -
> - nb_nodes = 3; /* RC, ITS, SMMUv3 */
> - rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
> + nb_nodes = 2; /* RC and SMMUv3 */
> + rc_mapping_count = smmu_idmaps->len;
> +
> + if (vms->its) {
> + /*
> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
> + * determine the ID ranges from RC that go directly to ITS.
> + */
> + create_its_idmaps(its_idmaps, smmu_idmaps);
> +
> + nb_nodes++; /* ITS */
> + rc_mapping_count += its_idmaps->len;
> + }
> } else {
> - nb_nodes = 2; /* RC, ITS */
> - rc_mapping_count = 1;
> + if (vms->its) {
> + nb_nodes = 2; /* RC and ITS */
> + rc_mapping_count = 1; /* Direct map to ITS */
> + } else {
> + nb_nodes = 1; /* RC only */
> + rc_mapping_count = 0; /* No output mapping */
> + }
> }
> /* Number of IORT Nodes */
> build_append_int_noprefix(table_data, nb_nodes, 4);
> @@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4);
> build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>
> - /* Table 12 ITS Group Format */
> - build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
> - node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
> - build_append_int_noprefix(table_data, node_size, 2); /* Length */
> - build_append_int_noprefix(table_data, 1, 1); /* Revision */
> - build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> - build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
> - build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
> - build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
> - /* GIC ITS Identifier Array */
> - build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
> + if (vms->its) {
> + /* Table 12 ITS Group Format */
> + build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
> + node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
> + build_append_int_noprefix(table_data, node_size, 2); /* Length */
> + build_append_int_noprefix(table_data, 1, 1); /* Revision */
> + build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> + build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
> + build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
> + build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
> + /* GIC ITS Identifier Array */
> + build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
> + }
>
> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
> int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE;
> -
> + int num_id_mappings, offset_to_id_array;
> +
> + if (vms->its) {
> + num_id_mappings = 1; /* ITS Group node */
While at it, I would suggest to rename num_id_mappings into
smmu_mapping_count for consistency with
rc_mapping_count.
Also I would recommend to rename smmu_idmaps and its_idmaps into rc_smmu_idmaps and rc_its_idmaps to make things clearer. But that be done outside of thise series if you prefer.
Otherwise this looks good.
Thanks
Eric
> + offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header */
> + } else {
> + num_id_mappings = 0; /* No ID mappings */
> + offset_to_id_array = 0; /* No ID mappings array */
> + }
> smmu_offset = table_data->len - table.table_offset;
> /* Table 9 SMMUv3 Format */
> build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */
> - node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE;
> + node_size = SMMU_V3_ENTRY_SIZE +
> + (ID_MAPPING_ENTRY_SIZE * num_id_mappings);
> build_append_int_noprefix(table_data, node_size, 2); /* Length */
> build_append_int_noprefix(table_data, 4, 1); /* Revision */
> build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> - build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */
> + /* Number of ID mappings */
> + build_append_int_noprefix(table_data, num_id_mappings, 4);
> /* Reference to ID Array */
> - build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4);
> + build_append_int_noprefix(table_data, offset_to_id_array, 4);
> /* Base address */
> build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8);
> /* Flags */
> @@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */
> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
> build_append_int_noprefix(table_data, 0, 4);
> -
> - /* Output IORT node is the ITS Group node (the first node) */
> - build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> + /* Array of ID mappings */
> + if (num_id_mappings) {
> + /* Output IORT node is the ITS Group node (the first node). */
> + build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> + }
> }
>
> /* Table 17 Root Complex Node */
> @@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> *
> * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
> * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
> - * ITS Group node.
> + * ITS Group node, if ITS is available.
> */
> for (i = 0; i < smmu_idmaps->len; i++) {
> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
> @@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> range->id_count, smmu_offset);
> }
>
> - /*
> - * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
> - * node directly: RC -> ITS.
> - */
> - for (i = 0; i < its_idmaps->len; i++) {
> - range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> - /* Output IORT node is the ITS Group node (the first node). */
> - build_iort_id_mapping(table_data, range->input_base,
> - range->id_count, IORT_NODE_OFFSET);
> + if (vms->its) {
> + /*
> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
> + * node directly: RC -> ITS.
> + */
> + for (i = 0; i < its_idmaps->len; i++) {
> + range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> + /* Output IORT node is the ITS Group node (the first node). */
> + build_iort_id_mapping(table_data, range->input_base,
> + range->id_count, IORT_NODE_OFFSET);
> + }
> }
> } else {
> /*
> @@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> memmap[VIRT_HIGH_GIC_REDIST2].size);
> }
>
> - /*
> - * ACPI spec, Revision 6.0 Errata A
> - * (original 6.0 definition has invalid Length)
> - * 5.2.12.18 GIC ITS Structure
> - */
> - build_append_int_noprefix(table_data, 0xF, 1); /* Type */
> - build_append_int_noprefix(table_data, 20, 1); /* Length */
> - build_append_int_noprefix(table_data, 0, 2); /* Reserved */
> - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
> - /* Physical Base Address */
> - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
> - build_append_int_noprefix(table_data, 0, 4); /* Reserved */
> + if (vms->its) {
> + /*
> + * ACPI spec, Revision 6.0 Errata A
> + * (original 6.0 definition has invalid Length)
> + * 5.2.12.18 GIC ITS Structure
> + */
> + build_append_int_noprefix(table_data, 0xF, 1); /* Type */
> + build_append_int_noprefix(table_data, 20, 1); /* Length */
> + build_append_int_noprefix(table_data, 0, 2); /* Reserved */
> + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
> + /* Physical Base Address */
> + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
> + build_append_int_noprefix(table_data, 0, 4); /* Reserved */
> + }
> } else {
> const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
> +"tests/data/acpi/aarch64/virt/IORT.its_off",
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off
2025-06-27 15:44 ` Eric Auger
@ 2025-06-28 19:44 ` Gustavo Romero
0 siblings, 0 replies; 21+ messages in thread
From: Gustavo Romero @ 2025-06-28 19:44 UTC (permalink / raw)
To: eric.auger, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Eric,
On 6/27/25 12:44, Eric Auger wrote:
> Hi Gustavo,
>
> On 6/23/25 3:57 PM, Gustavo Romero wrote:
>> Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct
>> in the MADT table are always generated, even if GIC ITS is not available
>> on the machine.
>>
>> This commit fixes it by not generating the ITS Group nodes, not mapping
>> any other node to them, and not advertising the GIC ITS in the MADT
>> table, when GIC ITS is not available on the machine.
>>
>> Since the fix changes the MADT and IORT tables, add the blobs for the
>> "its=off" test to the allow list and update them in the next commit.
>>
>> Reported-by: Udo Steinberg <udo@hypervisor.org>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>> Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/arm/virt-acpi-build.c | 128 ++++++++++++--------
>> tests/qtest/bios-tables-test-allowed-diff.h | 2 +
>> 2 files changed, 80 insertions(+), 50 deletions(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 40a782a498..17ae46804a 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> /* Sort the smmu idmap by input_base */
>> g_array_sort(smmu_idmaps, iort_idmap_compare);
>>
>> - /*
>> - * Knowing the ID ranges from the RC to the SMMU, it's possible to
>> - * determine the ID ranges from RC that go directly to ITS.
>> - */
>> - create_its_idmaps(its_idmaps, smmu_idmaps);
>> -
>> - nb_nodes = 3; /* RC, ITS, SMMUv3 */
>> - rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
>> + nb_nodes = 2; /* RC and SMMUv3 */
>> + rc_mapping_count = smmu_idmaps->len;
>> +
>> + if (vms->its) {
>> + /*
>> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
>> + * determine the ID ranges from RC that go directly to ITS.
>> + */
>> + create_its_idmaps(its_idmaps, smmu_idmaps);
>> +
>> + nb_nodes++; /* ITS */
>> + rc_mapping_count += its_idmaps->len;
>> + }
>> } else {
>> - nb_nodes = 2; /* RC, ITS */
>> - rc_mapping_count = 1;
>> + if (vms->its) {
>> + nb_nodes = 2; /* RC and ITS */
>> + rc_mapping_count = 1; /* Direct map to ITS */
>> + } else {
>> + nb_nodes = 1; /* RC only */
>> + rc_mapping_count = 0; /* No output mapping */
>> + }
>> }
>> /* Number of IORT Nodes */
>> build_append_int_noprefix(table_data, nb_nodes, 4);
>> @@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4);
>> build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>>
>> - /* Table 12 ITS Group Format */
>> - build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
>> - node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
>> - build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> - build_append_int_noprefix(table_data, 1, 1); /* Revision */
>> - build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> - build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
>> - build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
>> - build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
>> - /* GIC ITS Identifier Array */
>> - build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
>> + if (vms->its) {
>> + /* Table 12 ITS Group Format */
>> + build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
>> + node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
>> + build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> + build_append_int_noprefix(table_data, 1, 1); /* Revision */
>> + build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> + build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
>> + build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
>> + build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
>> + /* GIC ITS Identifier Array */
>> + build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
>> + }
>>
>> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
>> int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE;
>> -
>> + int num_id_mappings, offset_to_id_array;
>> +
>> + if (vms->its) {
>> + num_id_mappings = 1; /* ITS Group node */
> While at it, I would suggest to rename num_id_mappings into
> smmu_mapping_count for consistency with
>
> rc_mapping_count.
>
> Also I would recommend to rename smmu_idmaps and its_idmaps into rc_smmu_idmaps and rc_its_idmaps to make things clearer. But that be done outside of thise series if you prefer.
Thanks, that's indeed a nice change for clarification. I've done it in v6.
> Otherwise this looks good.
I was not sure if I had to add your R-b in v6 after I addressed your comments so
I left v6 without a R-b.
Cheers,
Gustavo
> Thanks
>
> Eric
>
>> + offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header */
>> + } else {
>> + num_id_mappings = 0; /* No ID mappings */
>> + offset_to_id_array = 0; /* No ID mappings array */
>> + }
>> smmu_offset = table_data->len - table.table_offset;
>> /* Table 9 SMMUv3 Format */
>> build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */
>> - node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE;
>> + node_size = SMMU_V3_ENTRY_SIZE +
>> + (ID_MAPPING_ENTRY_SIZE * num_id_mappings);
>> build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> build_append_int_noprefix(table_data, 4, 1); /* Revision */
>> build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> - build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */
>> + /* Number of ID mappings */
>> + build_append_int_noprefix(table_data, num_id_mappings, 4);
>> /* Reference to ID Array */
>> - build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4);
>> + build_append_int_noprefix(table_data, offset_to_id_array, 4);
>> /* Base address */
>> build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8);
>> /* Flags */
>> @@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */
>> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
>> build_append_int_noprefix(table_data, 0, 4);
>> -
>> - /* Output IORT node is the ITS Group node (the first node) */
>> - build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> + /* Array of ID mappings */
>> + if (num_id_mappings) {
>> + /* Output IORT node is the ITS Group node (the first node). */
>> + build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> + }
>> }
>>
>> /* Table 17 Root Complex Node */
>> @@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> *
>> * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
>> * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
>> - * ITS Group node.
>> + * ITS Group node, if ITS is available.
>> */
>> for (i = 0; i < smmu_idmaps->len; i++) {
>> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
>> @@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> range->id_count, smmu_offset);
>> }
>>
>> - /*
>> - * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
>> - * node directly: RC -> ITS.
>> - */
>> - for (i = 0; i < its_idmaps->len; i++) {
>> - range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
>> - /* Output IORT node is the ITS Group node (the first node). */
>> - build_iort_id_mapping(table_data, range->input_base,
>> - range->id_count, IORT_NODE_OFFSET);
>> + if (vms->its) {
>> + /*
>> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
>> + * node directly: RC -> ITS.
>> + */
>> + for (i = 0; i < its_idmaps->len; i++) {
>> + range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
>> + /* Output IORT node is the ITS Group node (the first node). */
>> + build_iort_id_mapping(table_data, range->input_base,
>> + range->id_count, IORT_NODE_OFFSET);
>> + }
>> }
>> } else {
>> /*
>> @@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> memmap[VIRT_HIGH_GIC_REDIST2].size);
>> }
>>
>> - /*
>> - * ACPI spec, Revision 6.0 Errata A
>> - * (original 6.0 definition has invalid Length)
>> - * 5.2.12.18 GIC ITS Structure
>> - */
>> - build_append_int_noprefix(table_data, 0xF, 1); /* Type */
>> - build_append_int_noprefix(table_data, 20, 1); /* Length */
>> - build_append_int_noprefix(table_data, 0, 2); /* Reserved */
>> - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
>> - /* Physical Base Address */
>> - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
>> - build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>> + if (vms->its) {
>> + /*
>> + * ACPI spec, Revision 6.0 Errata A
>> + * (original 6.0 definition has invalid Length)
>> + * 5.2.12.18 GIC ITS Structure
>> + */
>> + build_append_int_noprefix(table_data, 0xF, 1); /* Type */
>> + build_append_int_noprefix(table_data, 20, 1); /* Length */
>> + build_append_int_noprefix(table_data, 0, 2); /* Reserved */
>> + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
>> + /* Physical Base Address */
>> + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
>> + build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>> + }
>> } else {
>> const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
>>
>> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
>> index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
>> +"tests/data/acpi/aarch64/virt/IORT.its_off",
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off
2025-06-23 13:57 ` [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Gustavo Romero
2025-06-27 15:44 ` Eric Auger
@ 2025-06-27 15:45 ` Eric Auger
2025-06-27 15:46 ` Eric Auger via
1 sibling, 1 reply; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:45 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct
> in the MADT table are always generated, even if GIC ITS is not available
> on the machine.
>
> This commit fixes it by not generating the ITS Group nodes, not mapping
> any other node to them, and not advertising the GIC ITS in the MADT
> table, when GIC ITS is not available on the machine.
>
> Since the fix changes the MADT and IORT tables, add the blobs for the
> "its=off" test to the allow list and update them in the next commit.
>
> Reported-by: Udo Steinberg <udo@hypervisor.org>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> hw/arm/virt-acpi-build.c | 128 ++++++++++++--------
> tests/qtest/bios-tables-test-allowed-diff.h | 2 +
> 2 files changed, 80 insertions(+), 50 deletions(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 40a782a498..17ae46804a 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> /* Sort the smmu idmap by input_base */
> g_array_sort(smmu_idmaps, iort_idmap_compare);
>
> - /*
> - * Knowing the ID ranges from the RC to the SMMU, it's possible to
> - * determine the ID ranges from RC that go directly to ITS.
> - */
> - create_its_idmaps(its_idmaps, smmu_idmaps);
> -
> - nb_nodes = 3; /* RC, ITS, SMMUv3 */
> - rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
> + nb_nodes = 2; /* RC and SMMUv3 */
> + rc_mapping_count = smmu_idmaps->len;
> +
> + if (vms->its) {
> + /*
> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
> + * determine the ID ranges from RC that go directly to ITS.
> + */
> + create_its_idmaps(its_idmaps, smmu_idmaps);
> +
> + nb_nodes++; /* ITS */
> + rc_mapping_count += its_idmaps->len;
> + }
> } else {
> - nb_nodes = 2; /* RC, ITS */
> - rc_mapping_count = 1;
> + if (vms->its) {
> + nb_nodes = 2; /* RC and ITS */
> + rc_mapping_count = 1; /* Direct map to ITS */
> + } else {
> + nb_nodes = 1; /* RC only */
> + rc_mapping_count = 0; /* No output mapping */
> + }
> }
> /* Number of IORT Nodes */
> build_append_int_noprefix(table_data, nb_nodes, 4);
> @@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4);
> build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>
> - /* Table 12 ITS Group Format */
> - build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
> - node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
> - build_append_int_noprefix(table_data, node_size, 2); /* Length */
> - build_append_int_noprefix(table_data, 1, 1); /* Revision */
> - build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> - build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
> - build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
> - build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
> - /* GIC ITS Identifier Array */
> - build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
> + if (vms->its) {
> + /* Table 12 ITS Group Format */
> + build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
> + node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
> + build_append_int_noprefix(table_data, node_size, 2); /* Length */
> + build_append_int_noprefix(table_data, 1, 1); /* Revision */
> + build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> + build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
> + build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
> + build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
> + /* GIC ITS Identifier Array */
> + build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
> + }
>
> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
> int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE;
> -
> + int num_id_mappings, offset_to_id_array;
> +
> + if (vms->its) {
> + num_id_mappings = 1; /* ITS Group node */
> + offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header */
> + } else {
> + num_id_mappings = 0; /* No ID mappings */
> + offset_to_id_array = 0; /* No ID mappings array */
> + }
> smmu_offset = table_data->len - table.table_offset;
> /* Table 9 SMMUv3 Format */
> build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */
> - node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE;
> + node_size = SMMU_V3_ENTRY_SIZE +
> + (ID_MAPPING_ENTRY_SIZE * num_id_mappings);
> build_append_int_noprefix(table_data, node_size, 2); /* Length */
> build_append_int_noprefix(table_data, 4, 1); /* Revision */
> build_append_int_noprefix(table_data, id++, 4); /* Identifier */
> - build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */
> + /* Number of ID mappings */
> + build_append_int_noprefix(table_data, num_id_mappings, 4);
> /* Reference to ID Array */
> - build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4);
> + build_append_int_noprefix(table_data, offset_to_id_array, 4);
> /* Base address */
> build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8);
> /* Flags */
> @@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */
> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
> build_append_int_noprefix(table_data, 0, 4);
> -
> - /* Output IORT node is the ITS Group node (the first node) */
> - build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> + /* Array of ID mappings */
> + if (num_id_mappings) {
> + /* Output IORT node is the ITS Group node (the first node). */
> + build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
> + }
> }
>
> /* Table 17 Root Complex Node */
> @@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> *
> * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
> * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
> - * ITS Group node.
> + * ITS Group node, if ITS is available.
> */
> for (i = 0; i < smmu_idmaps->len; i++) {
> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
> @@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> range->id_count, smmu_offset);
> }
>
> - /*
> - * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
> - * node directly: RC -> ITS.
> - */
> - for (i = 0; i < its_idmaps->len; i++) {
> - range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> - /* Output IORT node is the ITS Group node (the first node). */
> - build_iort_id_mapping(table_data, range->input_base,
> - range->id_count, IORT_NODE_OFFSET);
> + if (vms->its) {
> + /*
> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
> + * node directly: RC -> ITS.
> + */
> + for (i = 0; i < its_idmaps->len; i++) {
> + range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
> + /* Output IORT node is the ITS Group node (the first node). */
> + build_iort_id_mapping(table_data, range->input_base,
> + range->id_count, IORT_NODE_OFFSET);
> + }
> }
> } else {
> /*
> @@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> memmap[VIRT_HIGH_GIC_REDIST2].size);
> }
>
> - /*
> - * ACPI spec, Revision 6.0 Errata A
> - * (original 6.0 definition has invalid Length)
> - * 5.2.12.18 GIC ITS Structure
> - */
> - build_append_int_noprefix(table_data, 0xF, 1); /* Type */
> - build_append_int_noprefix(table_data, 20, 1); /* Length */
> - build_append_int_noprefix(table_data, 0, 2); /* Reserved */
> - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
> - /* Physical Base Address */
> - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
> - build_append_int_noprefix(table_data, 0, 4); /* Reserved */
> + if (vms->its) {
> + /*
> + * ACPI spec, Revision 6.0 Errata A
> + * (original 6.0 definition has invalid Length)
> + * 5.2.12.18 GIC ITS Structure
> + */
> + build_append_int_noprefix(table_data, 0xF, 1); /* Type */
> + build_append_int_noprefix(table_data, 20, 1); /* Length */
> + build_append_int_noprefix(table_data, 0, 2); /* Reserved */
> + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
> + /* Physical Base Address */
> + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
> + build_append_int_noprefix(table_data, 0, 4); /* Reserved */
> + }
> } else {
> const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
> +"tests/data/acpi/aarch64/virt/IORT.its_off",
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off
2025-06-27 15:45 ` Eric Auger
@ 2025-06-27 15:46 ` Eric Auger via
0 siblings, 0 replies; 21+ messages in thread
From: Eric Auger via @ 2025-06-27 15:46 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
On 6/27/25 5:45 PM, Eric Auger wrote:
>
>
> On 6/23/25 3:57 PM, Gustavo Romero wrote:
>> Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct
>> in the MADT table are always generated, even if GIC ITS is not available
>> on the machine.
>>
>> This commit fixes it by not generating the ITS Group nodes, not mapping
>> any other node to them, and not advertising the GIC ITS in the MADT
>> table, when GIC ITS is not available on the machine.
>>
>> Since the fix changes the MADT and IORT tables, add the blobs for the
>> "its=off" test to the allow list and update them in the next commit.
>>
>> Reported-by: Udo Steinberg <udo@hypervisor.org>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
>> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
>> Co-authored-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
revoking that one. Sent on the wrong patch :-(
sorry for the noise
Eric
>
> Eric
>> ---
>> hw/arm/virt-acpi-build.c | 128 ++++++++++++--------
>> tests/qtest/bios-tables-test-allowed-diff.h | 2 +
>> 2 files changed, 80 insertions(+), 50 deletions(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 40a782a498..17ae46804a 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> /* Sort the smmu idmap by input_base */
>> g_array_sort(smmu_idmaps, iort_idmap_compare);
>>
>> - /*
>> - * Knowing the ID ranges from the RC to the SMMU, it's possible to
>> - * determine the ID ranges from RC that go directly to ITS.
>> - */
>> - create_its_idmaps(its_idmaps, smmu_idmaps);
>> -
>> - nb_nodes = 3; /* RC, ITS, SMMUv3 */
>> - rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
>> + nb_nodes = 2; /* RC and SMMUv3 */
>> + rc_mapping_count = smmu_idmaps->len;
>> +
>> + if (vms->its) {
>> + /*
>> + * Knowing the ID ranges from the RC to the SMMU, it's possible to
>> + * determine the ID ranges from RC that go directly to ITS.
>> + */
>> + create_its_idmaps(its_idmaps, smmu_idmaps);
>> +
>> + nb_nodes++; /* ITS */
>> + rc_mapping_count += its_idmaps->len;
>> + }
>> } else {
>> - nb_nodes = 2; /* RC, ITS */
>> - rc_mapping_count = 1;
>> + if (vms->its) {
>> + nb_nodes = 2; /* RC and ITS */
>> + rc_mapping_count = 1; /* Direct map to ITS */
>> + } else {
>> + nb_nodes = 1; /* RC only */
>> + rc_mapping_count = 0; /* No output mapping */
>> + }
>> }
>> /* Number of IORT Nodes */
>> build_append_int_noprefix(table_data, nb_nodes, 4);
>> @@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4);
>> build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>>
>> - /* Table 12 ITS Group Format */
>> - build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
>> - node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
>> - build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> - build_append_int_noprefix(table_data, 1, 1); /* Revision */
>> - build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> - build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
>> - build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
>> - build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
>> - /* GIC ITS Identifier Array */
>> - build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
>> + if (vms->its) {
>> + /* Table 12 ITS Group Format */
>> + build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */
>> + node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */;
>> + build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> + build_append_int_noprefix(table_data, 1, 1); /* Revision */
>> + build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> + build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */
>> + build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */
>> + build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */
>> + /* GIC ITS Identifier Array */
>> + build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4);
>> + }
>>
>> if (vms->iommu == VIRT_IOMMU_SMMUV3) {
>> int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE;
>> -
>> + int num_id_mappings, offset_to_id_array;
>> +
>> + if (vms->its) {
>> + num_id_mappings = 1; /* ITS Group node */
>> + offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header */
>> + } else {
>> + num_id_mappings = 0; /* No ID mappings */
>> + offset_to_id_array = 0; /* No ID mappings array */
>> + }
>> smmu_offset = table_data->len - table.table_offset;
>> /* Table 9 SMMUv3 Format */
>> build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */
>> - node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE;
>> + node_size = SMMU_V3_ENTRY_SIZE +
>> + (ID_MAPPING_ENTRY_SIZE * num_id_mappings);
>> build_append_int_noprefix(table_data, node_size, 2); /* Length */
>> build_append_int_noprefix(table_data, 4, 1); /* Revision */
>> build_append_int_noprefix(table_data, id++, 4); /* Identifier */
>> - build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */
>> + /* Number of ID mappings */
>> + build_append_int_noprefix(table_data, num_id_mappings, 4);
>> /* Reference to ID Array */
>> - build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4);
>> + build_append_int_noprefix(table_data, offset_to_id_array, 4);
>> /* Base address */
>> build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8);
>> /* Flags */
>> @@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */
>> /* DeviceID mapping index (ignored since interrupts are GSIV based) */
>> build_append_int_noprefix(table_data, 0, 4);
>> -
>> - /* Output IORT node is the ITS Group node (the first node) */
>> - build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> + /* Array of ID mappings */
>> + if (num_id_mappings) {
>> + /* Output IORT node is the ITS Group node (the first node). */
>> + build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
>> + }
>> }
>>
>> /* Table 17 Root Complex Node */
>> @@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> *
>> * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS) is
>> * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to the
>> - * ITS Group node.
>> + * ITS Group node, if ITS is available.
>> */
>> for (i = 0; i < smmu_idmaps->len; i++) {
>> range = &g_array_index(smmu_idmaps, AcpiIortIdMapping, i);
>> @@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> range->id_count, smmu_offset);
>> }
>>
>> - /*
>> - * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
>> - * node directly: RC -> ITS.
>> - */
>> - for (i = 0; i < its_idmaps->len; i++) {
>> - range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
>> - /* Output IORT node is the ITS Group node (the first node). */
>> - build_iort_id_mapping(table_data, range->input_base,
>> - range->id_count, IORT_NODE_OFFSET);
>> + if (vms->its) {
>> + /*
>> + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS Group
>> + * node directly: RC -> ITS.
>> + */
>> + for (i = 0; i < its_idmaps->len; i++) {
>> + range = &g_array_index(its_idmaps, AcpiIortIdMapping, i);
>> + /* Output IORT node is the ITS Group node (the first node). */
>> + build_iort_id_mapping(table_data, range->input_base,
>> + range->id_count, IORT_NODE_OFFSET);
>> + }
>> }
>> } else {
>> /*
>> @@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>> memmap[VIRT_HIGH_GIC_REDIST2].size);
>> }
>>
>> - /*
>> - * ACPI spec, Revision 6.0 Errata A
>> - * (original 6.0 definition has invalid Length)
>> - * 5.2.12.18 GIC ITS Structure
>> - */
>> - build_append_int_noprefix(table_data, 0xF, 1); /* Type */
>> - build_append_int_noprefix(table_data, 20, 1); /* Length */
>> - build_append_int_noprefix(table_data, 0, 2); /* Reserved */
>> - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
>> - /* Physical Base Address */
>> - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
>> - build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>> + if (vms->its) {
>> + /*
>> + * ACPI spec, Revision 6.0 Errata A
>> + * (original 6.0 definition has invalid Length)
>> + * 5.2.12.18 GIC ITS Structure
>> + */
>> + build_append_int_noprefix(table_data, 0xF, 1); /* Type */
>> + build_append_int_noprefix(table_data, 20, 1); /* Length */
>> + build_append_int_noprefix(table_data, 0, 2); /* Reserved */
>> + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */
>> + /* Physical Base Address */
>> + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8);
>> + build_append_int_noprefix(table_data, 0, 4); /* Reserved */
>> + }
>> } else {
>> const uint16_t spi_base = vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE;
>>
>> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
>> index dfb8523c8b..a88198d5c2 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/aarch64/virt/APIC.its_off",
>> +"tests/data/acpi/aarch64/virt/IORT.its_off",
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64
2025-06-23 13:57 [PATCH-for-10.1 v5 0/9] hw/arm: GIC 'its=off' ACPI table fixes Gustavo Romero
` (7 preceding siblings ...)
2025-06-23 13:57 ` [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Gustavo Romero
@ 2025-06-23 13:57 ` Gustavo Romero
2025-06-27 15:49 ` Eric Auger
8 siblings, 1 reply; 21+ messages in thread
From: Gustavo Romero @ 2025-06-23 13:57 UTC (permalink / raw)
To: qemu-devel, eric.auger, philmd, mst
Cc: qemu-arm, alex.bennee, gustavo.romero, udo, ajones, peter.maydell,
imammedo, anisinha
Update blobs for the its=off test on aarch64 after fix.
Basically, all structs related to ITS are gone in MADT and IORT
tables after the fix (previously ITS was not properly disabled
when "its=off" option was passed to the machine).
MADT diff:
[000h 0000 4] Signature : "APIC" [Multiple APIC Description Table (MADT)]
-[004h 0004 4] Table Length : 000000B8
+[004h 0004 4] Table Length : 000000A4
[008h 0008 1] Revision : 04
-[009h 0009 1] Checksum : C1
+[009h 0009 1] Checksum : 08
[00Ah 0010 6] Oem ID : "BOCHS "
[010h 0016 8] Oem Table ID : "BXPC "
[018h 0024 4] Oem Revision : 00000001
[01Ch 0028 4] Asl Compiler ID : "BXPC"
[020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 4] Local Apic Address : 00000000
[028h 0040 4] Flags (decoded below) : 00000000
PC-AT Compatibility : 0
[02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distributor]
[02Dh 0045 1] Length : 18
[02Eh 0046 2] Reserved : 0000
[030h 0048 4] Local GIC Hardware ID : 00000000
[034h 0052 8] Base Address : 0000000008000000
[03Ch 0060 4] Interrupt Base : 00000000
@@ -48,37 +48,29 @@
[064h 0100 8] Base Address : 0000000000000000
[06Ch 0108 8] Virtual GIC Base Address : 0000000000000000
[074h 0116 8] Hypervisor GIC Base Address : 0000000000000000
[07Ch 0124 4] Virtual GIC Interrupt : 00000000
[080h 0128 8] Redistributor Base Address : 0000000000000000
[088h 0136 8] ARM MPIDR : 0000000000000000
[090h 0144 1] Efficiency Class : 00
[091h 0145 1] Reserved : 00
[092h 0146 2] SPE Overflow Interrupt : 0000
[094h 0148 1] Subtable Type : 0E [Generic Interrupt Redistributor]
[095h 0149 1] Length : 10
[096h 0150 2] Reserved : 0000
[098h 0152 8] Base Address : 00000000080A0000
[0A0h 0160 4] Length : 00F60000
-[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Translator]
-[0A5h 0165 1] Length : 14
-[0A6h 0166 2] Reserved : 0000
-[0A8h 0168 4] Translation ID : 00000000
-[0ACh 0172 8] Base Address : 0000000008080000
-[0B4h 0180 4] Reserved : 00000000
IORT diff:
[000h 0000 4] Signature : "IORT" [IO Remapping Table]
-[004h 0004 4] Table Length : 000000EC
+[004h 0004 4] Table Length : 000000AC
[008h 0008 1] Revision : 03
-[009h 0009 1] Checksum : 57
+[009h 0009 1] Checksum : 97
[00Ah 0010 6] Oem ID : "BOCHS "
[010h 0016 8] Oem Table ID : "BXPC "
[018h 0024 4] Oem Revision : 00000001
[01Ch 0028 4] Asl Compiler ID : "BXPC"
[020h 0032 4] Asl Compiler Revision : 00000001
-[024h 0036 4] Node Count : 00000003
+[024h 0036 4] Node Count : 00000002
[028h 0040 4] Node Offset : 00000030
[02Ch 0044 4] Reserved : 00000000
-[030h 0048 1] Type : 00
-[031h 0049 2] Length : 0018
-[033h 0051 1] Revision : 01
+[030h 0048 1] Type : 04
+[031h 0049 2] Length : 0044
+[033h 0051 1] Revision : 04
[034h 0052 4] Reserved : 00000000
[038h 0056 4] Mapping Count : 00000000
[03Ch 0060 4] Mapping Offset : 00000000
-[040h 0064 4] ItsCount : 00000001
-[044h 0068 4] Identifiers : 00000000
-
-[048h 0072 1] Type : 04
-[049h 0073 2] Length : 0058
-[04Bh 0075 1] Revision : 04
-[04Ch 0076 4] Reserved : 00000001
-[050h 0080 4] Mapping Count : 00000001
-[054h 0084 4] Mapping Offset : 00000044
-
-[058h 0088 8] Base Address : 0000000009050000
-[060h 0096 4] Flags (decoded below) : 00000001
+[040h 0064 8] Base Address : 0000000009050000
+[048h 0072 4] Flags (decoded below) : 00000001
COHACC Override : 1
HTTU Override : 0
Proximity Domain Valid : 0
-[064h 0100 4] Reserved : 00000000
-[068h 0104 8] VATOS Address : 0000000000000000
-[070h 0112 4] Model : 00000000
-[074h 0116 4] Event GSIV : 0000006A
-[078h 0120 4] PRI GSIV : 0000006B
-[07Ch 0124 4] GERR GSIV : 0000006D
-[080h 0128 4] Sync GSIV : 0000006C
-[084h 0132 4] Proximity Domain : 00000000
-[088h 0136 4] Device ID Mapping Index : 00000000
-
-[08Ch 0140 4] Input base : 00000000
-[090h 0144 4] ID Count : 0000FFFF
-[094h 0148 4] Output Base : 00000000
-[098h 0152 4] Output Reference : 00000030
-[09Ch 0156 4] Flags (decoded below) : 00000000
- Single Mapping : 0
-
-[0A0h 0160 1] Type : 02
-[0A1h 0161 2] Length : 004C
-[0A3h 0163 1] Revision : 03
-[0A4h 0164 4] Reserved : 00000002
-[0A8h 0168 4] Mapping Count : 00000002
-[0ACh 0172 4] Mapping Offset : 00000024
-
-[0B0h 0176 8] Memory Properties : [IORT Memory Access Properties]
-[0B0h 0176 4] Cache Coherency : 00000001
-[0B4h 0180 1] Hints (decoded below) : 00
+[04Ch 0076 4] Reserved : 00000000
+[050h 0080 8] VATOS Address : 0000000000000000
+[058h 0088 4] Model : 00000000
+[05Ch 0092 4] Event GSIV : 0000006A
+[060h 0096 4] PRI GSIV : 0000006B
+[064h 0100 4] GERR GSIV : 0000006D
+[068h 0104 4] Sync GSIV : 0000006C
+[06Ch 0108 4] Proximity Domain : 00000000
+[070h 0112 4] Device ID Mapping Index : 00000000
+
+[074h 0116 1] Type : 02
+[075h 0117 2] Length : 0038
+[077h 0119 1] Revision : 03
+[078h 0120 4] Reserved : 00000001
+[07Ch 0124 4] Mapping Count : 00000001
+[080h 0128 4] Mapping Offset : 00000024
+
+[084h 0132 8] Memory Properties : [IORT Memory Access Properties]
+[084h 0132 4] Cache Coherency : 00000001
+[088h 0136 1] Hints (decoded below) : 00
Transient : 0
Write Allocate : 0
Read Allocate : 0
Override : 0
-[0B5h 0181 2] Reserved : 0000
-[0B7h 0183 1] Memory Flags (decoded below) : 03
+[089h 0137 2] Reserved : 0000
+[08Bh 0139 1] Memory Flags (decoded below) : 03
Coherency : 1
Device Attribute : 1
-[0B8h 0184 4] ATS Attribute : 00000000
-[0BCh 0188 4] PCI Segment Number : 00000000
-[0C0h 0192 1] Memory Size Limit : 40
-[0C1h 0193 3] Reserved : 000000
-
-[0C4h 0196 4] Input base : 00000000
-[0C8h 0200 4] ID Count : 000000FF
-[0CCh 0204 4] Output Base : 00000000
-[0D0h 0208 4] Output Reference : 00000048
-[0D4h 0212 4] Flags (decoded below) : 00000000
- Single Mapping : 0
-
-[0D8h 0216 4] Input base : 00000100
-[0DCh 0220 4] ID Count : 0000FEFF
-[0E0h 0224 4] Output Base : 00000100
-[0E4h 0228 4] Output Reference : 00000030
-[0E8h 0232 4] Flags (decoded below) : 00000000
+[08Ch 0140 4] ATS Attribute : 00000000
+[090h 0144 4] PCI Segment Number : 00000000
+[094h 0148 1] Memory Size Limit : 40
+[095h 0149 3] Reserved : 000000
+
+[098h 0152 4] Input base : 00000000
+[09Ch 0156 4] ID Count : 000000FF
+[0A0h 0160 4] Output Base : 00000000
+[0A4h 0164 4] Output Reference : 00000030
+[0A8h 0168 4] Flags (decoded below) : 00000000
Single Mapping : 0
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/data/acpi/aarch64/virt/APIC.its_off | Bin 184 -> 164 bytes
tests/data/acpi/aarch64/virt/IORT.its_off | Bin 236 -> 172 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 2 --
3 files changed, 2 deletions(-)
diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aarch64/virt/APIC.its_off
index 37d82e970b1331cb5b259f0bd2d3654bacb2d623..6130cb7d07103b326feb4dcd7034f85808bebadf 100644
GIT binary patch
delta 18
ZcmdnNxP+0*F~HM#2?GNI3&%vRSpY2+1Zw~Q
delta 39
jcmZ3&xPy_)F~HM#2Ll5G%fX3UvqbnsfJ`vp;DE6JqX7kf
diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aarch64/virt/IORT.its_off
index 0fceb820d509e852ca0849baf568a8e93e426738..c10da4e61dd00e7eb062558a2735d49ca0b20620 100644
GIT binary patch
delta 69
zcmaFExQ3C-(?2L=4FdxM^Yn>aQj$zSmH`lh0E-I)3xowECx)7HGFdP%GXmL+6IZHp
Hz*GSMclZc%
literal 236
zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=RgMkDCNC*yK9F_<M77!bR
zUBI%eoFED&4;F$FSwK1)h;xBB2Py`m{{M%tVD>TjFfcO#g+N#Zh@s|zoCF3AP#UU@
R!2`+%Dg6Hr$N|zYvjDIZ5CH%H
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index a88198d5c2..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/aarch64/virt/APIC.its_off",
-"tests/data/acpi/aarch64/virt/IORT.its_off",
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64
2025-06-23 13:57 ` [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64 Gustavo Romero
@ 2025-06-27 15:49 ` Eric Auger
0 siblings, 0 replies; 21+ messages in thread
From: Eric Auger @ 2025-06-27 15:49 UTC (permalink / raw)
To: Gustavo Romero, qemu-devel, philmd, mst
Cc: qemu-arm, alex.bennee, udo, ajones, peter.maydell, imammedo,
anisinha
Hi Gustavo,
On 6/23/25 3:57 PM, Gustavo Romero wrote:
> Update blobs for the its=off test on aarch64 after fix.
>
> Basically, all structs related to ITS are gone in MADT and IORT
> tables after the fix (previously ITS was not properly disabled
> when "its=off" option was passed to the machine).
>
> MADT diff:
>
> [000h 0000 4] Signature : "APIC" [Multiple APIC Description Table (MADT)]
> -[004h 0004 4] Table Length : 000000B8
> +[004h 0004 4] Table Length : 000000A4
> [008h 0008 1] Revision : 04
> -[009h 0009 1] Checksum : C1
> +[009h 0009 1] Checksum : 08
> [00Ah 0010 6] Oem ID : "BOCHS "
> [010h 0016 8] Oem Table ID : "BXPC "
> [018h 0024 4] Oem Revision : 00000001
> [01Ch 0028 4] Asl Compiler ID : "BXPC"
> [020h 0032 4] Asl Compiler Revision : 00000001
>
> [024h 0036 4] Local Apic Address : 00000000
> [028h 0040 4] Flags (decoded below) : 00000000
> PC-AT Compatibility : 0
>
> [02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distributor]
> [02Dh 0045 1] Length : 18
> [02Eh 0046 2] Reserved : 0000
> [030h 0048 4] Local GIC Hardware ID : 00000000
> [034h 0052 8] Base Address : 0000000008000000
> [03Ch 0060 4] Interrupt Base : 00000000
> @@ -48,37 +48,29 @@
> [064h 0100 8] Base Address : 0000000000000000
> [06Ch 0108 8] Virtual GIC Base Address : 0000000000000000
> [074h 0116 8] Hypervisor GIC Base Address : 0000000000000000
> [07Ch 0124 4] Virtual GIC Interrupt : 00000000
> [080h 0128 8] Redistributor Base Address : 0000000000000000
> [088h 0136 8] ARM MPIDR : 0000000000000000
> [090h 0144 1] Efficiency Class : 00
> [091h 0145 1] Reserved : 00
> [092h 0146 2] SPE Overflow Interrupt : 0000
>
> [094h 0148 1] Subtable Type : 0E [Generic Interrupt Redistributor]
> [095h 0149 1] Length : 10
> [096h 0150 2] Reserved : 0000
> [098h 0152 8] Base Address : 00000000080A0000
> [0A0h 0160 4] Length : 00F60000
>
> -[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Translator]
> -[0A5h 0165 1] Length : 14
> -[0A6h 0166 2] Reserved : 0000
> -[0A8h 0168 4] Translation ID : 00000000
> -[0ACh 0172 8] Base Address : 0000000008080000
> -[0B4h 0180 4] Reserved : 00000000
>
> IORT diff:
>
> [000h 0000 4] Signature : "IORT" [IO Remapping Table]
> -[004h 0004 4] Table Length : 000000EC
> +[004h 0004 4] Table Length : 000000AC
> [008h 0008 1] Revision : 03
> -[009h 0009 1] Checksum : 57
> +[009h 0009 1] Checksum : 97
> [00Ah 0010 6] Oem ID : "BOCHS "
> [010h 0016 8] Oem Table ID : "BXPC "
> [018h 0024 4] Oem Revision : 00000001
> [01Ch 0028 4] Asl Compiler ID : "BXPC"
> [020h 0032 4] Asl Compiler Revision : 00000001
>
> -[024h 0036 4] Node Count : 00000003
> +[024h 0036 4] Node Count : 00000002
> [028h 0040 4] Node Offset : 00000030
> [02Ch 0044 4] Reserved : 00000000
>
> -[030h 0048 1] Type : 00
> -[031h 0049 2] Length : 0018
> -[033h 0051 1] Revision : 01
> +[030h 0048 1] Type : 04
> +[031h 0049 2] Length : 0044
> +[033h 0051 1] Revision : 04
> [034h 0052 4] Reserved : 00000000
> [038h 0056 4] Mapping Count : 00000000
> [03Ch 0060 4] Mapping Offset : 00000000
>
> -[040h 0064 4] ItsCount : 00000001
> -[044h 0068 4] Identifiers : 00000000
> -
> -[048h 0072 1] Type : 04
> -[049h 0073 2] Length : 0058
> -[04Bh 0075 1] Revision : 04
> -[04Ch 0076 4] Reserved : 00000001
> -[050h 0080 4] Mapping Count : 00000001
> -[054h 0084 4] Mapping Offset : 00000044
> -
> -[058h 0088 8] Base Address : 0000000009050000
> -[060h 0096 4] Flags (decoded below) : 00000001
> +[040h 0064 8] Base Address : 0000000009050000
> +[048h 0072 4] Flags (decoded below) : 00000001
> COHACC Override : 1
> HTTU Override : 0
> Proximity Domain Valid : 0
> -[064h 0100 4] Reserved : 00000000
> -[068h 0104 8] VATOS Address : 0000000000000000
> -[070h 0112 4] Model : 00000000
> -[074h 0116 4] Event GSIV : 0000006A
> -[078h 0120 4] PRI GSIV : 0000006B
> -[07Ch 0124 4] GERR GSIV : 0000006D
> -[080h 0128 4] Sync GSIV : 0000006C
> -[084h 0132 4] Proximity Domain : 00000000
> -[088h 0136 4] Device ID Mapping Index : 00000000
> -
> -[08Ch 0140 4] Input base : 00000000
> -[090h 0144 4] ID Count : 0000FFFF
> -[094h 0148 4] Output Base : 00000000
> -[098h 0152 4] Output Reference : 00000030
> -[09Ch 0156 4] Flags (decoded below) : 00000000
> - Single Mapping : 0
> -
> -[0A0h 0160 1] Type : 02
> -[0A1h 0161 2] Length : 004C
> -[0A3h 0163 1] Revision : 03
> -[0A4h 0164 4] Reserved : 00000002
> -[0A8h 0168 4] Mapping Count : 00000002
> -[0ACh 0172 4] Mapping Offset : 00000024
> -
> -[0B0h 0176 8] Memory Properties : [IORT Memory Access Properties]
> -[0B0h 0176 4] Cache Coherency : 00000001
> -[0B4h 0180 1] Hints (decoded below) : 00
> +[04Ch 0076 4] Reserved : 00000000
> +[050h 0080 8] VATOS Address : 0000000000000000
> +[058h 0088 4] Model : 00000000
> +[05Ch 0092 4] Event GSIV : 0000006A
> +[060h 0096 4] PRI GSIV : 0000006B
> +[064h 0100 4] GERR GSIV : 0000006D
> +[068h 0104 4] Sync GSIV : 0000006C
> +[06Ch 0108 4] Proximity Domain : 00000000
> +[070h 0112 4] Device ID Mapping Index : 00000000
> +
> +[074h 0116 1] Type : 02
> +[075h 0117 2] Length : 0038
> +[077h 0119 1] Revision : 03
> +[078h 0120 4] Reserved : 00000001
> +[07Ch 0124 4] Mapping Count : 00000001
> +[080h 0128 4] Mapping Offset : 00000024
> +
> +[084h 0132 8] Memory Properties : [IORT Memory Access Properties]
> +[084h 0132 4] Cache Coherency : 00000001
> +[088h 0136 1] Hints (decoded below) : 00
> Transient : 0
> Write Allocate : 0
> Read Allocate : 0
> Override : 0
> -[0B5h 0181 2] Reserved : 0000
> -[0B7h 0183 1] Memory Flags (decoded below) : 03
> +[089h 0137 2] Reserved : 0000
> +[08Bh 0139 1] Memory Flags (decoded below) : 03
> Coherency : 1
> Device Attribute : 1
> -[0B8h 0184 4] ATS Attribute : 00000000
> -[0BCh 0188 4] PCI Segment Number : 00000000
> -[0C0h 0192 1] Memory Size Limit : 40
> -[0C1h 0193 3] Reserved : 000000
> -
> -[0C4h 0196 4] Input base : 00000000
> -[0C8h 0200 4] ID Count : 000000FF
> -[0CCh 0204 4] Output Base : 00000000
> -[0D0h 0208 4] Output Reference : 00000048
> -[0D4h 0212 4] Flags (decoded below) : 00000000
> - Single Mapping : 0
> -
> -[0D8h 0216 4] Input base : 00000100
> -[0DCh 0220 4] ID Count : 0000FEFF
> -[0E0h 0224 4] Output Base : 00000100
> -[0E4h 0228 4] Output Reference : 00000030
> -[0E8h 0232 4] Flags (decoded below) : 00000000
> +[08Ch 0140 4] ATS Attribute : 00000000
> +[090h 0144 4] PCI Segment Number : 00000000
> +[094h 0148 1] Memory Size Limit : 40
> +[095h 0149 3] Reserved : 000000
> +
> +[098h 0152 4] Input base : 00000000
> +[09Ch 0156 4] ID Count : 000000FF
> +[0A0h 0160 4] Output Base : 00000000
> +[0A4h 0164 4] Output Reference : 00000030
> +[0A8h 0168 4] Flags (decoded below) : 00000000
> Single Mapping : 0
>
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> tests/data/acpi/aarch64/virt/APIC.its_off | Bin 184 -> 164 bytes
> tests/data/acpi/aarch64/virt/IORT.its_off | Bin 236 -> 172 bytes
> tests/qtest/bios-tables-test-allowed-diff.h | 2 --
> 3 files changed, 2 deletions(-)
>
> diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aarch64/virt/APIC.its_off
> index 37d82e970b1331cb5b259f0bd2d3654bacb2d623..6130cb7d07103b326feb4dcd7034f85808bebadf 100644
> GIT binary patch
> delta 18
> ZcmdnNxP+0*F~HM#2?GNI3&%vRSpY2+1Zw~Q
>
> delta 39
> jcmZ3&xPy_)F~HM#2Ll5G%fX3UvqbnsfJ`vp;DE6JqX7kf
>
> diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aarch64/virt/IORT.its_off
> index 0fceb820d509e852ca0849baf568a8e93e426738..c10da4e61dd00e7eb062558a2735d49ca0b20620 100644
> GIT binary patch
> delta 69
> zcmaFExQ3C-(?2L=4FdxM^Yn>aQj$zSmH`lh0E-I)3xowECx)7HGFdP%GXmL+6IZHp
> Hz*GSMclZc%
>
> literal 236
> zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=RgMkDCNC*yK9F_<M77!bR
> zUBI%eoFED&4;F$FSwK1)h;xBB2Py`m{{M%tVD>TjFfcO#g+N#Zh@s|zoCF3AP#UU@
> R!2`+%Dg6Hr$N|zYvjDIZ5CH%H
>
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index a88198d5c2..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/aarch64/virt/APIC.its_off",
> -"tests/data/acpi/aarch64/virt/IORT.its_off",
^ permalink raw reply [flat|nested] 21+ messages in thread