Hi Mohamed and Phil,

On 10/29/25 17:54, Mohamed Mediouni wrote:
Looks like in the prior Qemu ACPI table handling, GICv2 configurations
had vms->its=1...

To me, ITS should not be present on machines that have GICv2, so we should not 
generate
any ACPI table advertising ITS when GICv2 is used.


Cheers,
Gustavo

Match that assumption to not make the test suite fail. Probably not 
merge-worthy...

And then maybe see what to do for older releases too?

Signed-off-by: Mohamed Mediouni <[email protected]>
---
  hw/arm/virt-acpi-build.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index a6a56455a9..39dd3d1020 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -472,7 +472,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, 
VirtMachineState *vms)
          nb_nodes = num_smmus + 1; /* RC and SMMUv3 */
          rc_mapping_count = rc_smmu_idmaps_len;
- if (virt_is_its_enabled(vms)) {
+        if (virt_is_its_enabled(vms) || vms->gic_version == 2) {
              /*
               * 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.
@@ -483,7 +483,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, 
VirtMachineState *vms)
              rc_mapping_count += rc_its_idmaps->len;
          }
      } else {
-        if (virt_is_its_enabled(vms)) {
+        if (virt_is_its_enabled(vms) || vms->gic_version == 2) {
              nb_nodes = 2; /* RC and ITS */
              rc_mapping_count = 1; /* Direct map to ITS */
          } else {
@@ -498,7 +498,7 @@ 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 */
- if (virt_is_its_enabled(vms)) {
+    if (virt_is_its_enabled(vms) || vms->gic_version == 2) {
          /* 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 
*/;
@@ -517,7 +517,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, 
VirtMachineState *vms)
          int smmu_mapping_count, offset_to_id_array;
          int irq = sdev->irq;
- if (virt_is_its_enabled(vms)) {
+        if (virt_is_its_enabled(vms) || vms->gic_version == 2) {
              smmu_mapping_count = 1; /* ITS Group node */
              offset_to_id_array = SMMU_V3_ENTRY_SIZE; /* Just after the header 
*/
          } else {
@@ -610,7 +610,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, 
VirtMachineState *vms)
              }
          }
- if (virt_is_its_enabled(vms)) {
+        if (virt_is_its_enabled(vms) || vms->gic_version == 2) {
              /*
               * Map bypassed (don't go through the SMMU) RIDs (input) to
               * ITS Group node directly: RC -> ITS.


Reply via email to