qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0
@ 2025-04-03 15:18 Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure Philippe Mathieu-Daudé
                   ` (14 more replies)
  0 siblings, 15 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Hi,

I tried to gather all the hw/arm/-related patches for
the GitLab issues tagged for 10.0.

First, trivial ones fixing / disabling broken tests;
then disable the VMapple machine (not sure about it);
finally fix ACPI tables for '-M its=off' CLI option.

While polishing the series, I noticed MST mentioning
the ACPI changes are likely too late:
https://lore.kernel.org/qemu-devel/20250403100406-mutt-send-email-mst@kernel.org/
I'll defer that jugement to Alex :)

Regards,

Phil.

Philippe Mathieu-Daudé (13):
  tests/functional: Add a decorator for skipping tests on particular OS
  tests/functional: Skip aarch64_replay test on macOS
  tests/qtest: Skip Aarch64 VMapple machine
  hw/arm: Do not build VMapple machine by default
  hw/arm/virt: Remove pointless VirtMachineState::tcg_its field
  hw/intc/gicv3_its: Do not check its_class_name() for NULL
  hw/arm/virt: Simplify create_its()
  hw/arm/virt-acpi: Factor its_enabled() helper out
  qtest/bios-tables-test: Add test for -M virt,its=off
  qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs
  hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled)
  hw/arm/virt-acpi: Do not advertise disabled GIC ITS
  qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs

Pierrick Bouvier (1):
  tests/functional/test_aarch64_rme_virt: fix sporadic failure

 configs/devices/aarch64-softmmu/default.mak |   1 +
 include/hw/arm/virt.h                       |   1 -
 include/hw/intc/arm_gicv3_its_common.h      |   2 +-
 hw/arm/virt-acpi-build.c                    |  48 ++++++++++++--------
 hw/arm/virt.c                               |  23 +++-------
 tests/qtest/bios-tables-test.c              |  22 +++++++++
 tests/qtest/libqtest.c                      |   1 +
 tests/data/acpi/aarch64/virt/APIC.its_off   | Bin 0 -> 164 bytes
 tests/data/acpi/aarch64/virt/FACP.its_off   | Bin 0 -> 276 bytes
 tests/data/acpi/aarch64/virt/IORT.its_off   | Bin 0 -> 212 bytes
 tests/functional/qemu_test/__init__.py      |   2 +-
 tests/functional/qemu_test/decorators.py    |  15 +++++-
 tests/functional/test_aarch64_replay.py     |   4 +-
 tests/functional/test_aarch64_rme_virt.py   |   4 +-
 14 files changed, 82 insertions(+), 41 deletions(-)
 create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
 create mode 100644 tests/data/acpi/aarch64/virt/FACP.its_off
 create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off

-- 
2.47.1



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

* [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao, Pierrick Bouvier,
	Richard Henderson

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This test was randomly failing on our CI, and on dev machines,
especially with QEMU debug builds.

From the information collected, it's related to an implementation choice
in edk2 QEMU virt support. The workaround is to disable KASLR, to avoid
accessing protected memory.
Note: this is *not* needed for the similar test_aarch64_rme_sbsaref.

More information is available on the associated GitLab issue.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2823
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250328183816.2687925-1-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/functional/test_aarch64_rme_virt.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/functional/test_aarch64_rme_virt.py b/tests/functional/test_aarch64_rme_virt.py
index f4ad4d33d58..a1abf584f0e 100755
--- a/tests/functional/test_aarch64_rme_virt.py
+++ b/tests/functional/test_aarch64_rme_virt.py
@@ -87,7 +87,9 @@ def test_aarch64_rme_virt(self):
         self.vm.add_args('-fsdev', f'local,security_model=none,path={rme_stack},id=shr0')
         self.vm.add_args('-device', 'virtio-net-pci,netdev=net0')
         self.vm.add_args('-netdev', 'user,id=net0')
-        self.vm.add_args('-append', 'root=/dev/vda')
+        # We need to add nokaslr to avoid triggering this sporadic bug:
+        # https://gitlab.com/qemu-project/qemu/-/issues/2823
+        self.vm.add_args('-append', 'root=/dev/vda nokaslr')
 
         self.vm.launch()
         # Wait for host VM boot to complete.
-- 
2.47.1



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

* [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:31   ` Richard Henderson
  2025-04-03 18:04   ` Thomas Huth
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  14 siblings, 2 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Since tests might be failing on some operating systems,
introduce the skipIfOperatingSystem() decorator.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/functional/qemu_test/__init__.py   |  2 +-
 tests/functional/qemu_test/decorators.py | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py
index 45f7befa374..af41c2c6a22 100644
--- a/tests/functional/qemu_test/__init__.py
+++ b/tests/functional/qemu_test/__init__.py
@@ -15,6 +15,6 @@
 from .linuxkernel import LinuxKernelTest
 from .decorators import skipIfMissingCommands, skipIfNotMachine, \
     skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \
-    skipIfMissingImports
+    skipIfMissingImports, skipIfOperatingSystem
 from .archive import archive_extract
 from .uncompress import uncompress
diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py
index 1651eb739a7..b6a1d41c55c 100644
--- a/tests/functional/qemu_test/decorators.py
+++ b/tests/functional/qemu_test/decorators.py
@@ -5,7 +5,7 @@
 import importlib
 import os
 import platform
-from unittest import skipUnless
+from unittest import skipIf, skipUnless
 
 from .cmd import which
 
@@ -26,6 +26,19 @@ def skipIfMissingCommands(*args):
     return skipUnless(has_cmds, 'required command(s) "%s" not installed' %
                                 ", ".join(args))
 
+'''
+Decorator to skip execution of a test if the current
+host operating system does not match one of the permitted
+ones.
+Example
+
+  @skipIfOperatingSystem("Linux", "Darwin")
+'''
+def skipIfOperatingSystem(*args):
+    return skipIf(platform.system() in args,
+                  'not running on one of the required OS(s) "%s"' %
+                  ", ".join(args))
+
 '''
 Decorator to skip execution of a test if the current
 host machine does not match one of the permitted
-- 
2.47.1



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

* [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:31   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

As of v10.0.0-rc2 this test is still failing on macos:

  $ make check-functional-aarch64 V=1
  ...
  ERROR:../../replay/replay-internal.c:235:replay_mutex_unlock: assertion failed: (replay_mutex_locked())
  Bail out! ERROR:../../replay/replay-internal.c:235:replay_mutex_unlock: assertion failed: (replay_mutex_locked())

This is tracked as https://gitlab.com/qemu-project/qemu/-/issues/2907

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/functional/test_aarch64_replay.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/functional/test_aarch64_replay.py b/tests/functional/test_aarch64_replay.py
index 04cde433bcf..029fef3cbf8 100755
--- a/tests/functional/test_aarch64_replay.py
+++ b/tests/functional/test_aarch64_replay.py
@@ -5,7 +5,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-from qemu_test import Asset
+from qemu_test import Asset, skipIfOperatingSystem
 from replay_kernel import ReplayKernelBase
 
 
@@ -16,6 +16,8 @@ class Aarch64Replay(ReplayKernelBase):
          'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'),
         '7e1430b81c26bdd0da025eeb8fbd77b5dc961da4364af26e771bd39f379cbbf7')
 
+    # Failing on Darwin: https://gitlab.com/qemu-project/qemu/-/issues/2907
+    @skipIfOperatingSystem('Darwin')
     def test_aarch64_virt(self):
         self.set_machine('virt')
         self.cpu = 'cortex-a53'
-- 
2.47.1



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

* [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:33   ` Richard Henderson
  2025-04-03 18:00   ` Thomas Huth
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  14 siblings, 2 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

First, the VMapple machine only works with the ARM 'host' CPU
type, which isn't accepted for QTest:

  $ qemu-system-aarch64 -M vmapple -accel qtest
  qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF

Second, the QTest framework expects machines to be createable
without specifying optional arguments, however the VMapple
machine requires few of them:

  $ qemu-system-aarch64 -M vmapple -accel qtest
  qemu-system-aarch64: No firmware specified

  $ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
  qemu-system-aarch64: No AUX device. Please specify one as pflash drive.

Restrict this machine with QTest so we can at least run check-qtest,
otherwise we get:

  $ make check-qtest-aarch64
  qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
  Broken pipe
  ../tests/qtest/libqtest.c:199: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
  ...
   7/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/test-hmp     ERROR      24.71s   killed by signal 6 SIGABRT
   2/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/qom-test     ERROR      71.23s   killed by signal 6 SIGABRT

Suggested-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/libqtest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 2750067861e..fad307d125a 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -1788,6 +1788,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
         if (!strncmp("xenfv", machines[i].name, 5) ||
             g_str_equal("xenpv", machines[i].name) ||
             g_str_equal("xenpvh", machines[i].name) ||
+            g_str_equal("vmapple", machines[i].name) ||
             g_str_equal("nitro-enclave", machines[i].name)) {
             continue;
         }
-- 
2.47.1



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

* [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:34   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Unfortunately as of v10.0.0-rc2 the VMapple machine is unusable:

  $ qemu-system-aarch64 -M vmapple [...]
  *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
      reason: '-[PGIOSurfaceHostDeviceDescriptor setMapMemory:]: unrecognized selector sent to instance 0x600001ede820'
  *** First throw call stack:
  (
    0   CoreFoundation          0x000000019c759df0 __exceptionPreprocess + 176
    1   libobjc.A.dylib         0x000000019c21eb60 objc_exception_throw + 88
    2   CoreFoundation          0x000000019c816ce0 -[NSObject(NSObject) __retain_OA] + 0
    3   CoreFoundation          0x000000019c6c7efc ___forwarding___ + 1500
    4   CoreFoundation          0x000000019c6c7860 _CF_forwarding_prep_0 + 96
    5   qemu-system-aarch64     0x000000010486dbd0 apple_gfx_mmio_realize + 200
    6   qemu-system-aarch64     0x0000000104e6ab5c device_set_realized + 352
    7   qemu-system-aarch64     0x0000000104e7250c property_set_bool + 100
    8   qemu-system-aarch64     0x0000000104e7023c object_property_set + 136
    9   qemu-system-aarch64     0x0000000104e74870 object_property_set_qobject + 60
    10  qemu-system-aarch64     0x0000000104e70748 object_property_set_bool + 60
    11  qemu-system-aarch64     0x0000000104e69bd8 qdev_realize_and_unref + 20
    12  qemu-system-aarch64     0x0000000104e258e0 mach_vmapple_init + 1728
    13  qemu-system-aarch64     0x000000010481b0ac machine_run_board_init + 1892
    14  qemu-system-aarch64     0x0000000104a4def8 qmp_x_exit_preconfig + 260
    15  qemu-system-aarch64     0x0000000104a51ba8 qemu_init + 14460
    16  qemu-system-aarch64     0x0000000104f7cef8 main + 36
    17  dyld                    0x000000019c25eb4c start + 6000
  )
  libc++abi: terminating due to uncaught exception of type NSException
  Abort trap: 6

Disable the machine so it isn't built by default.

This is tracked as https://gitlab.com/qemu-project/qemu/-/issues/2913

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 configs/devices/aarch64-softmmu/default.mak | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/devices/aarch64-softmmu/default.mak b/configs/devices/aarch64-softmmu/default.mak
index 93f4022ad62..ad8028cfd48 100644
--- a/configs/devices/aarch64-softmmu/default.mak
+++ b/configs/devices/aarch64-softmmu/default.mak
@@ -9,3 +9,4 @@ include ../arm-softmmu/default.mak
 # CONFIG_XLNX_VERSAL=n
 # CONFIG_SBSA_REF=n
 # CONFIG_NPCM8XX=n
+CONFIG_VMAPPLE=n
-- 
2.47.1



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

* [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:36   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

VirtMachineState::tcg_its has the same value of
VirtMachineClass::no_tcg_its. Directly use the latter,
removing the former.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/arm/virt.h |  1 -
 hw/arm/virt.c         | 13 +++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index c8e94e6aedc..17c160429ea 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -150,7 +150,6 @@ struct VirtMachineState {
     bool highmem_mmio;
     bool highmem_redists;
     bool its;
-    bool tcg_its;
     bool virt;
     bool ras;
     bool mte;
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a96452f17a4..c0748cbb95a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -710,11 +710,12 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms)
 
 static void create_its(VirtMachineState *vms)
 {
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
     const char *itsclass = its_class_name();
     DeviceState *dev;
 
     if (!strcmp(itsclass, "arm-gicv3-its")) {
-        if (!vms->tcg_its) {
+        if (!vmc->no_tcg_its) {
             itsclass = NULL;
         }
     }
@@ -831,7 +832,9 @@ static void create_gic(VirtMachineState *vms, MemoryRegion *mem)
                             redist_region_count);
 
         if (!kvm_irqchip_in_kernel()) {
-            if (vms->tcg_its) {
+            VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
+
+            if (vmc->no_tcg_its) {
                 object_property_set_link(OBJECT(vms->gic), "sysmem",
                                          OBJECT(mem), &error_fatal);
                 qdev_prop_set_bit(vms->gic, "has-lpi", true);
@@ -3357,12 +3360,6 @@ static void virt_instance_init(Object *obj)
     } else {
         /* Default allows ITS instantiation */
         vms->its = true;
-
-        if (vmc->no_tcg_its) {
-            vms->tcg_its = false;
-        } else {
-            vms->tcg_its = true;
-        }
     }
 
     /* Default disallows iommu instantiation */
-- 
2.47.1



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

* [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:37   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its() Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Since commit cc5e719e2c8 ("kvm: require KVM_CAP_SIGNAL_MSI"),
its_class_name() single implementation doesn't return NULL
anymore. Update the prototype docstring, and remove the
pointless checks.

Reported-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/intc/arm_gicv3_its_common.h | 2 +-
 hw/arm/virt-acpi-build.c               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_gicv3_its_common.h
index 7dc712b38d2..3c7b543b018 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);
 
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 3ac8f8e1786..9b7fc99f170 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -741,7 +741,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
                                           memmap[VIRT_HIGH_GIC_REDIST2].size);
         }
 
-        if (its_class_name() && !vmc->no_its) {
+        if (!vmc->no_its) {
             /*
              * ACPI spec, Revision 6.0 Errata A
              * (original 6.0 definition has invalid Length)
@@ -973,7 +973,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
                           vms->oem_table_id);
     }
 
-    if (its_class_name() && !vmc->no_its) {
+    if (!vmc->no_its) {
         acpi_add_table(table_offsets, tables_blob);
         build_iort(tables_blob, tables->linker, vms);
     }
-- 
2.47.1



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

* [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its()
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:38   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

No need to strstr() check the class name when we can
use kvm_irqchip_in_kernel().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c0748cbb95a..d17755548e8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -711,21 +711,15 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms)
 static void create_its(VirtMachineState *vms)
 {
     VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
-    const char *itsclass = its_class_name();
     DeviceState *dev;
 
-    if (!strcmp(itsclass, "arm-gicv3-its")) {
-        if (!vmc->no_tcg_its) {
-            itsclass = NULL;
-        }
-    }
-
-    if (!itsclass) {
+    assert(!vmc->no_its);
+    if (!kvm_irqchip_in_kernel() && !vmc->no_tcg_its) {
         /* Do nothing if not supported */
         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.47.1



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

* [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its() Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 17:38   ` Richard Henderson
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 10/14] qtest/bios-tables-test: Add test for -M virt, its=off Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

GIC ITS is checked for the MADT and IORT tables.
Factor the checks out to the its_enabled() helper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
---
 hw/arm/virt-acpi-build.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 9b7fc99f170..1c389ef5cdb 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -208,6 +208,13 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
 #define ROOT_COMPLEX_ENTRY_SIZE 36
 #define IORT_NODE_OFFSET 48
 
+static bool its_enabled(VirtMachineState *vms)
+{
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
+
+    return !vmc->no_its;
+}
+
 /*
  * Append an ID mapping entry as described by "Table 4 ID mapping format" in
  * "IO Remapping Table System Software on ARM Platforms", Chapter 3.
@@ -670,7 +677,6 @@ static void
 build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
 {
     int i;
-    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
     const MemMapEntry *memmap = vms->memmap;
     AcpiTable table = { .sig = "APIC", .rev = 4, .oem_id = vms->oem_id,
                         .oem_table_id = vms->oem_table_id };
@@ -741,7 +747,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
                                           memmap[VIRT_HIGH_GIC_REDIST2].size);
         }
 
-        if (!vmc->no_its) {
+        if (its_enabled(vms)) {
             /*
              * ACPI spec, Revision 6.0 Errata A
              * (original 6.0 definition has invalid Length)
@@ -973,7 +979,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
                           vms->oem_table_id);
     }
 
-    if (!vmc->no_its) {
+    if (its_enabled(vms)) {
         acpi_add_table(table_offsets, tables_blob);
         build_iort(tables_blob, tables->linker, vms);
     }
-- 
2.47.1



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

* [PATCH-for-10.0? v2 10/14] qtest/bios-tables-test: Add test for -M virt, its=off
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Add the use case reported as issue #2886 [*]. The test
passes while it shouldn't. We are going to fix that in
the following commits.

[*] https://gitlab.com/qemu-project/qemu/-/issues/2886

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 0a333ec4353..baaf199e01c 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",
+        .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 virtualization=on,secure=off "
+                  "-M gic-version=max,its=off,iommu=smmuv3", &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.47.1



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

* [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 10/14] qtest/bios-tables-test: Add test for -M virt, its=off Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-04 10:50   ` Igor Mammedov
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 12/14] hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled) Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

We are going to fix the test_acpi_aarch64_virt_tcg_its_off()
test. In preparation, copy the ACPI tables which will be
altered as 'its_off' variants, and whitelist them.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/bios-tables-test-allowed-diff.h |   3 +++
 tests/qtest/bios-tables-test.c              |   1 +
 tests/data/acpi/aarch64/virt/APIC.its_off   | Bin 0 -> 184 bytes
 tests/data/acpi/aarch64/virt/FACP.its_off   | Bin 0 -> 276 bytes
 tests/data/acpi/aarch64/virt/IORT.its_off   | Bin 0 -> 236 bytes
 5 files changed, 4 insertions(+)
 create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
 create mode 100644 tests/data/acpi/aarch64/virt/FACP.its_off
 create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off

diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8bf..3421dd5adf3 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,4 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/aarch64/virt/APIC.its_off",
+"tests/data/acpi/aarch64/virt/FACP.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 baaf199e01c..55366bf4956 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -2151,6 +2151,7 @@ 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",
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..c37d05d6e05805304f10afe73eb7cb9100fcccfa
GIT binary patch
literal 184
zcmZ<^@O0k6z`($=+{xeBBUr&HBEVSz2pEB4AU24G0Uik$i-7~iVgWL^17JJ`2AFzr
bgb+@aBn}xq0gwb2)Q)cq{30-g9B_L93G4|0

literal 0
HcmV?d00001

diff --git a/tests/data/acpi/aarch64/virt/FACP.its_off b/tests/data/acpi/aarch64/virt/FACP.its_off
new file mode 100644
index 0000000000000000000000000000000000000000..606dac3fe4b55c31fd68b25d3a4127eeef227434
GIT binary patch
literal 276
zcmZ>BbPf<<WME(uaq@Te2v%^42yj*a0-z8Bhz+8t3j|P&V`N}P6&N^PpsQ~v$aVnZ
CVg~^L

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

-- 
2.47.1



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

* [PATCH-for-10.0? v2 12/14] hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled)
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Citing Gustavo [*]:

  Gating IORT table generation entirely based on the presence
  of ITS looks wrong because IORT table has data beyond GIC ITS,
  like for SMMUv3 etc..

[*] https://lore.kernel.org/qemu-devel/bae6e29a-7290-47d2-8caf-14702ee091f0@linaro.org/

Reported-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt-acpi-build.c | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 1c389ef5cdb..e7e27951cb9 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -287,6 +287,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
     uint32_t id = 0;
     GArray *smmu_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
     GArray *its_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping));
+    bool has_its = its_enabled(vms);
 
     AcpiTable table = { .sig = "IORT", .rev = 3, .oem_id = vms->oem_id,
                         .oem_table_id = vms->oem_table_id };
@@ -325,9 +326,12 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
 
         nb_nodes = 3; /* RC, ITS, SMMUv3 */
         rc_mapping_count = smmu_idmaps->len + its_idmaps->len;
-    } else {
+    } else if (has_its) {
         nb_nodes = 2; /* RC, ITS */
         rc_mapping_count = 1;
+    } else {
+        nb_nodes = 1; /* RC */
+        rc_mapping_count = 1;
     }
     /* Number of IORT Nodes */
     build_append_int_noprefix(table_data, nb_nodes, 4);
@@ -336,17 +340,19 @@ 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 (has_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;
@@ -429,7 +435,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
             build_iort_id_mapping(table_data, range->input_base,
                                   range->id_count, IORT_NODE_OFFSET);
         }
-    } else {
+    } else if (has_its) {
         /* output IORT node is the ITS group node (the first node) */
         build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET);
     }
@@ -979,10 +985,8 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
                           vms->oem_table_id);
     }
 
-    if (its_enabled(vms)) {
-        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) {
-- 
2.47.1



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

* [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 12/14] hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled) Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-04 10:41   ` Igor Mammedov
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 14/14] qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
  2025-04-03 16:31 ` [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Michael S. Tsirkin
  14 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

GIC ITS can be disabled at runtime using '-M its=off',
which sets VirtMachineState::its = false. Check this
field to avoid advertising the ITS in the MADT table.

Reported-by: Udo Steinberg <udo@hypervisor.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
---
 hw/arm/virt-acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index e7e27951cb9..38a9e6fe0c5 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -212,7 +212,7 @@ static bool its_enabled(VirtMachineState *vms)
 {
     VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
 
-    return !vmc->no_its;
+    return !vmc->no_its && vms->its;
 }
 
 /*
-- 
2.47.1



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

* [PATCH-for-10.0? v2 14/14] qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
@ 2025-04-03 15:18 ` Philippe Mathieu-Daudé
  2025-04-03 16:31 ` [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Michael S. Tsirkin
  14 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Gustavo Romero,
	Peter Maydell, Laurent Vivier, Ani Sinha, Udo Steinberg,
	Michael S. Tsirkin, qemu-arm, Paolo Bonzini, Igor Mammedov,
	Andrew Jones, Daniel P. Berrangé, Fabiano Rosas,
	Alex Bennée, Shannon Zhao

Commit the blobs generated by tests/data/acpi/rebuild-expected-aml.sh.

Changes in the tables:

  @@ -1,32 +1,32 @@
   /*
    * Intel ACPI Component Architecture
    * AML/ASL+ Disassembler version 20240927 (64-bit version)
    * Copyright (c) 2000 - 2023 Intel Corporation
    *
    * Disassembly of tests/data/acpi/aarch64/virt/APIC.its_off
    *
    * ACPI Data Table [APIC]
    *
    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
    */

   [000h 0000 004h]                   Signature : "APIC"    [Multiple APIC Description Table (MADT)]
  -[004h 0004 004h]                Table Length : 000000B8
  +[004h 0004 004h]                Table Length : 000000A4
   [008h 0008 001h]                    Revision : 04
  -[009h 0009 001h]                    Checksum : A7
  +[009h 0009 001h]                    Checksum : EE
   [00Ah 0010 006h]                      Oem ID : "BOCHS "
   [010h 0016 008h]                Oem Table ID : "BXPC    "
   [018h 0024 004h]                Oem Revision : 00000001
   [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
   [020h 0032 004h]       Asl Compiler Revision : 00000001

   [024h 0036 004h]          Local Apic Address : 00000000
   [028h 0040 004h]       Flags (decoded below) : 00000000
                            PC-AT Compatibility : 0

   [02Ch 0044 001h]               Subtable Type : 0C [Generic Interrupt Distributor]
   [02Dh 0045 001h]                      Length : 18
   [02Eh 0046 002h]                    Reserved : 0000
   [030h 0048 004h]       Local GIC Hardware ID : 00000000
   [034h 0052 008h]                Base Address : 0000000008000000
   [03Ch 0060 004h]              Interrupt Base : 00000000
  @@ -49,37 +49,29 @@
   [06Ch 0108 008h]    Virtual GIC Base Address : 0000000000000000
   [074h 0116 008h] Hypervisor GIC Base Address : 0000000000000000
   [07Ch 0124 004h]       Virtual GIC Interrupt : 00000019
   [080h 0128 008h]  Redistributor Base Address : 0000000000000000
   [088h 0136 008h]                   ARM MPIDR : 0000000000000000
   [090h 0144 001h]            Efficiency Class : 00
   [091h 0145 001h]                    Reserved : 00
   [092h 0146 002h]      SPE Overflow Interrupt : 0000
   [094h 0148 002h]              TRBE Interrupt : 100E

   [094h 0148 001h]               Subtable Type : 0E [Generic Interrupt Redistributor]
   [095h 0149 001h]                      Length : 10
   [097h 0151 002h]                    Reserved : 0000
   [098h 0152 008h]                Base Address : 00000000080A0000
   [0A0h 0160 004h]                      Length : 00F60000

  -[0A4h 0164 001h]               Subtable Type : 0F [Generic Interrupt Translator]
  -[0A5h 0165 001h]                      Length : 14
  -[0A7h 0167 002h]                    Reserved : 0000
  -[0A8h 0168 004h]              Translation ID : 00000000
  -[0ACh 0172 008h]                Base Address : 0000000008080000
  -[0B4h 0180 004h]                    Reserved : 00000000
  +Raw Table Data: Length 164 (0xA4)

  -Raw Table Data: Length 184 (0xB8)
  -
  -    0000: 41 50 49 43 B8 00 00 00 04 A7 42 4F 43 48 53 20  // APIC......BOCHS
  +    0000: 41 50 49 43 A4 00 00 00 04 EE 42 4F 43 48 53 20  // APIC......BOCHS
       0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43  // BXPC    ....BXPC
       0020: 01 00 00 00 00 00 00 00 00 00 00 00 0C 18 00 00  // ................
       0030: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00  // ................
       0040: 04 00 00 00 0B 50 00 00 00 00 00 00 00 00 00 00  // .....P..........
       0050: 01 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00  // ................
       0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0070: 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00  // ................
       0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0090: 00 00 00 00 0E 10 00 00 00 00 0A 08 00 00 00 00  // ................
  -    00A0: 00 00 F6 00 0F 14 00 00 00 00 00 00 00 00 08 08  // ................
  -    00B0: 00 00 00 00 00 00 00 00                          // ........
  +    00A0: 00 00 F6 00                                      // ....

   /*
    * Intel ACPI Component Architecture
    * AML/ASL+ Disassembler version 20240927 (64-bit version)
    * Copyright (c) 2000 - 2023 Intel Corporation
    *
    * Disassembly of tests/data/acpi/aarch64/virt/FACP
    *
    * ACPI Data Table [FACP]
    *
    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
    */

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

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

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

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

   [083h 0131 001h]         FADT Minor Revision : 03
   [084h 0132 008h]                FACS Address : 0000000000000000
   [08Ch 0140 008h]                DSDT Address : 0000000000000000
   [094h 0148 00Ch]            PM1A Event Block : [Generic Address Structure]
   [094h 0148 001h]                    Space ID : 00 [SystemMemory]
   [095h 0149 001h]                   Bit Width : 00
   [096h 0150 001h]                  Bit Offset : 00
   [097h 0151 001h]        Encoded Access Width : 00 [Undefined/Legacy]
   [098h 0152 008h]                     Address : 0000000000000000

   [0A0h 0160 00Ch]            PM1B Event Block : [Generic Address Structure]
   [0A0h 0160 001h]                    Space ID : 00 [SystemMemory]
   [0A1h 0161 001h]                   Bit Width : 00
   [0A2h 0162 001h]                  Bit Offset : 00
   [0A3h 0163 001h]        Encoded Access Width : 00 [Undefined/Legacy]
  @@ -164,34 +164,34 @@
   [0F5h 0245 001h]                   Bit Width : 00
   [0F6h 0246 001h]                  Bit Offset : 00
   [0F7h 0247 001h]        Encoded Access Width : 00 [Undefined/Legacy]
   [0F8h 0248 008h]                     Address : 0000000000000000

   [100h 0256 00Ch]       Sleep Status Register : [Generic Address Structure]
   [100h 0256 001h]                    Space ID : 00 [SystemMemory]
   [101h 0257 001h]                   Bit Width : 00
   [102h 0258 001h]                  Bit Offset : 00
   [103h 0259 001h]        Encoded Access Width : 00 [Undefined/Legacy]
   [104h 0260 008h]                     Address : 0000000000000000

   [10Ch 0268 008h]               Hypervisor ID : 00000000554D4551

   Raw Table Data: Length 276 (0x114)

  -    0000: 46 41 43 50 14 01 00 00 06 12 42 4F 43 48 53 20  // FACP......BOCHS
  +    0000: 46 41 43 50 14 01 00 00 06 14 42 4F 43 48 53 20  // FACP......BOCHS
       0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43  // BXPC    ....BXPC
       0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0070: 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
  -    0080: 00 03 00 03 00 00 00 00 00 00 00 00 00 00 00 00  // ................
  +    0080: 00 01 00 03 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
       0100: 00 00 00 00 00 00 00 00 00 00 00 00 51 45 4D 55  // ............QEMU
       0110: 00 00 00 00                                      // ....

  @@ -1,122 +1,111 @@
   /*
    * Intel ACPI Component Architecture
    * AML/ASL+ Disassembler version 20240927 (64-bit version)
    * Copyright (c) 2000 - 2023 Intel Corporation
    *
    * Disassembly of tests/data/acpi/aarch64/virt/IORT.its_off
    *
    * ACPI Data Table [IORT]
    *
    * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue (in hex)
    */

   [000h 0000 004h]                   Signature : "IORT"    [IO Remapping Table]
  -[004h 0004 004h]                Table Length : 000000EC
  +[004h 0004 004h]                Table Length : 000000D4
   [008h 0008 001h]                    Revision : 03
  -[009h 0009 001h]                    Checksum : 57
  +[009h 0009 001h]                    Checksum : A3
   [00Ah 0010 006h]                      Oem ID : "BOCHS "
   [010h 0016 008h]                Oem Table ID : "BXPC    "
   [018h 0024 004h]                Oem Revision : 00000001
   [01Ch 0028 004h]             Asl Compiler ID : "BXPC"
   [020h 0032 004h]       Asl Compiler Revision : 00000001

   [024h 0036 004h]                  Node Count : 00000003
   [028h 0040 004h]                 Node Offset : 00000030
   [02Ch 0044 004h]                    Reserved : 00000000

  -[030h 0048 001h]                        Type : 00
  -[031h 0049 002h]                      Length : 0018
  -[033h 0051 001h]                    Revision : 01
  +[030h 0048 001h]                        Type : 04
  +[031h 0049 002h]                      Length : 0058
  +[033h 0051 001h]                    Revision : 04
   [034h 0052 004h]                  Identifier : 00000000
  -[038h 0056 004h]               Mapping Count : 00000000
  -[03Ch 0060 004h]              Mapping Offset : 00000000
  +[038h 0056 004h]               Mapping Count : 00000001
  +[03Ch 0060 004h]              Mapping Offset : 00000044

  -[040h 0064 004h]                    ItsCount : 00000001
  -[044h 0068 004h]                 Identifiers : 00000000
  -
  -[048h 0072 001h]                        Type : 04
  -[049h 0073 002h]                      Length : 0058
  -[04Bh 0075 001h]                    Revision : 04
  -[04Ch 0076 004h]                  Identifier : 00000001
  -[050h 0080 004h]               Mapping Count : 00000001
  -[054h 0084 004h]              Mapping Offset : 00000044
  -
  -[058h 0088 008h]                Base Address : 0000000009050000
  -[060h 0096 004h]       Flags (decoded below) : 00000001
  +[040h 0064 008h]                Base Address : 0000000009050000
  +[048h 0072 004h]       Flags (decoded below) : 00000001
                                COHACC Override : 1
                                  HTTU Override : 0
                         Proximity Domain Valid : 0
                                 DeviceID Valid : 0
  -[064h 0100 004h]                    Reserved : 00000000
  -[068h 0104 008h]               VATOS Address : 0000000000000000
  -[070h 0112 004h]                       Model : 00000000
  -[074h 0116 004h]                  Event GSIV : 0000006A
  -[078h 0120 004h]                    PRI GSIV : 0000006B
  -[07Ch 0124 004h]                   GERR GSIV : 0000006D
  -[080h 0128 004h]                   Sync GSIV : 0000006C
  -[084h 0132 004h]            Proximity Domain : 00000000
  -[088h 0136 004h]     Device ID Mapping Index : 00000000
  +[04Ch 0076 004h]                    Reserved : 00000000
  +[050h 0080 008h]               VATOS Address : 0000000000000000
  +[058h 0088 004h]                       Model : 00000000
  +[05Ch 0092 004h]                  Event GSIV : 0000006A
  +[060h 0096 004h]                    PRI GSIV : 0000006B
  +[064h 0100 004h]                   GERR GSIV : 0000006D
  +[068h 0104 004h]                   Sync GSIV : 0000006C
  +[06Ch 0108 004h]            Proximity Domain : 00000000
  +[070h 0112 004h]     Device ID Mapping Index : 00000000

  -[08Ch 0140 004h]                  Input base : 00000000
  -[090h 0144 004h]                    ID Count : 0000FFFF
  -[094h 0148 004h]                 Output Base : 00000000
  -[098h 0152 004h]            Output Reference : 00000030
  -[09Ch 0156 004h]       Flags (decoded below) : 00000000
  +[074h 0116 004h]                  Input base : 00000000
  +[078h 0120 004h]                    ID Count : 0000FFFF
  +[07Ch 0124 004h]                 Output Base : 00000000
  +[080h 0128 004h]            Output Reference : 00000030
  +[084h 0132 004h]       Flags (decoded below) : 00000000
                                 Single Mapping : 0

  -[0A0h 0160 001h]                        Type : 02
  -[0A1h 0161 002h]                      Length : 004C
  -[0A3h 0163 001h]                    Revision : 03
  -[0A4h 0164 004h]                  Identifier : 00000002
  -[0A8h 0168 004h]               Mapping Count : 00000002
  -[0ACh 0172 004h]              Mapping Offset : 00000024
  +[088h 0136 001h]                        Type : 02
  +[089h 0137 002h]                      Length : 004C
  +[08Bh 0139 001h]                    Revision : 03
  +[08Ch 0140 004h]                  Identifier : 00000001
  +[090h 0144 004h]               Mapping Count : 00000002
  +[094h 0148 004h]              Mapping Offset : 00000024

  -[0B0h 0176 008h]           Memory Properties : [IORT Memory Access Properties]
  -[0B0h 0176 004h]             Cache Coherency : 00000001
  -[0B4h 0180 001h]       Hints (decoded below) : 00
  +[098h 0152 008h]           Memory Properties : [IORT Memory Access Properties]
  +[098h 0152 004h]             Cache Coherency : 00000001
  +[09Ch 0156 001h]       Hints (decoded below) : 00
                                      Transient : 0
                                 Write Allocate : 0
                                  Read Allocate : 0
                                       Override : 0
  -[0B5h 0181 002h]                    Reserved : 0000
  -[0B7h 0183 001h] Memory Flags (decoded below) : 03
  +[09Dh 0157 002h]                    Reserved : 0000
  +[09Fh 0159 001h] Memory Flags (decoded below) : 03
                                      Coherency : 1
                               Device Attribute : 1
                  Ensured Coherency of Accesses : 0
  -[0B8h 0184 004h]               ATS Attribute : 00000000
  -[0BCh 0188 004h]          PCI Segment Number : 00000000
  -[0C0h 0192 001h]           Memory Size Limit : 40
  -[0C1h 0193 002h]          PASID Capabilities : 0000
  -[0C3h 0195 001h]                    Reserved : 00
  +[0A0h 0160 004h]               ATS Attribute : 00000000
  +[0A4h 0164 004h]          PCI Segment Number : 00000000
  +[0A8h 0168 001h]           Memory Size Limit : 40
  +[0A9h 0169 002h]          PASID Capabilities : 0000
  +[0ABh 0171 001h]                    Reserved : 00

  -[0C4h 0196 004h]                  Input base : 00000000
  -[0C8h 0200 004h]                    ID Count : 000000FF
  -[0CCh 0204 004h]                 Output Base : 00000000
  -[0D0h 0208 004h]            Output Reference : 00000048
  -[0D4h 0212 004h]       Flags (decoded below) : 00000000
  +[0ACh 0172 004h]                  Input base : 00000000
  +[0B0h 0176 004h]                    ID Count : 000000FF
  +[0B4h 0180 004h]                 Output Base : 00000000
  +[0B8h 0184 004h]            Output Reference : 00000030
  +[0BCh 0188 004h]       Flags (decoded below) : 00000000
                                 Single Mapping : 0

  -[0D8h 0216 004h]                  Input base : 00000100
  -[0DCh 0220 004h]                    ID Count : 0000FEFF
  -[0E0h 0224 004h]                 Output Base : 00000100
  -[0E4h 0228 004h]            Output Reference : 00000030
  -[0E8h 0232 004h]       Flags (decoded below) : 00000000
  +[0C0h 0192 004h]                  Input base : 00000100
  +[0C4h 0196 004h]                    ID Count : 0000FEFF
  +[0C8h 0200 004h]                 Output Base : 00000100
  +[0CCh 0204 004h]            Output Reference : 00000030
  +[0D0h 0208 004h]       Flags (decoded below) : 00000000
                                 Single Mapping : 0

  -Raw Table Data: Length 236 (0xEC)
  +Raw Table Data: Length 212 (0xD4)

  -    0000: 49 4F 52 54 EC 00 00 00 03 57 42 4F 43 48 53 20  // IORT.....WBOCHS
  +    0000: 49 4F 52 54 D4 00 00 00 03 A3 42 4F 43 48 53 20  // IORT......BOCHS
       0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43  // BXPC    ....BXPC
       0020: 01 00 00 00 03 00 00 00 30 00 00 00 00 00 00 00  // ........0.......
  -    0030: 00 18 00 01 00 00 00 00 00 00 00 00 00 00 00 00  // ................
  -    0040: 01 00 00 00 00 00 00 00 04 58 00 04 01 00 00 00  // .........X......
  -    0050: 01 00 00 00 44 00 00 00 00 00 05 09 00 00 00 00  // ....D...........
  -    0060: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // ................
  -    0070: 00 00 00 00 6A 00 00 00 6B 00 00 00 6D 00 00 00  // ....j...k...m...
  -    0080: 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // l...............
  -    0090: FF FF 00 00 00 00 00 00 30 00 00 00 00 00 00 00  // ........0.......
  -    00A0: 02 4C 00 03 02 00 00 00 02 00 00 00 24 00 00 00  // .L..........$...
  -    00B0: 01 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00  // ................
  -    00C0: 40 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00  // @...............
  -    00D0: 48 00 00 00 00 00 00 00 00 01 00 00 FF FE 00 00  // H...............
  -    00E0: 00 01 00 00 30 00 00 00 00 00 00 00              // ....0.......
  +    0030: 04 58 00 04 00 00 00 00 01 00 00 00 44 00 00 00  // .X..........D...
  +    0040: 00 00 05 09 00 00 00 00 01 00 00 00 00 00 00 00  // ................
  +    0050: 00 00 00 00 00 00 00 00 00 00 00 00 6A 00 00 00  // ............j...
  +    0060: 6B 00 00 00 6D 00 00 00 6C 00 00 00 00 00 00 00  // k...m...l.......
  +    0070: 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00  // ................
  +    0080: 30 00 00 00 00 00 00 00 02 4C 00 03 01 00 00 00  // 0........L......
  +    0090: 02 00 00 00 24 00 00 00 01 00 00 00 00 00 00 03  // ....$...........
  +    00A0: 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  // ........@.......
  +    00B0: FF 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00  // ........0.......
  +    00C0: 00 01 00 00 FF FE 00 00 00 01 00 00 30 00 00 00  // ............0...
  +    00D0: 00 00 00 00                                      // ....

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/bios-tables-test-allowed-diff.h |   3 ---
 tests/data/acpi/aarch64/virt/APIC.its_off   | Bin 184 -> 164 bytes
 tests/data/acpi/aarch64/virt/IORT.its_off   | Bin 236 -> 212 bytes
 3 files changed, 3 deletions(-)

diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 3421dd5adf3..dfb8523c8bf 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,4 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/aarch64/virt/APIC.its_off",
-"tests/data/acpi/aarch64/virt/FACP.its_off",
-"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
index c37d05d6e05805304f10afe73eb7cb9100fcccfa..f24ac8fbff5261a52434abcfcff96dbdc7709de4 100644
GIT binary patch
delta 18
ZcmdnNxP+0*F~HM#2?GNI%e#qOvj8xy1yKM1

delta 39
jcmZ3&xPy_)F~HM#2Ll5G%kqg_vqbnsfJ`vp;DE6Jpmzmj

diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aarch64/virt/IORT.its_off
index 0fceb820d509e852ca0849baf568a8e93e426738..25f64407c4aac11bda2d1ac24cd8999a1d84c80d 100644
GIT binary patch
delta 37
tcmaFEc!iP6(?2NW3IhWJ^WuqIYOE{~3@i*2eZv_UCoa`yG?;i%8UVn-3Gn~`

delta 61
zcmcb@_=b_o(?2NW4FdxMbNECqHCYA;21XzU4qzOX2nH6$iKgL<OcQ&x89gTMlm-Aj
CGzq}~

-- 
2.47.1



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

* Re: [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0
  2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 14/14] qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
@ 2025-04-03 16:31 ` Michael S. Tsirkin
  14 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2025-04-03 16:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, Gustavo Romero, Peter Maydell,
	Laurent Vivier, Ani Sinha, Udo Steinberg, qemu-arm, Paolo Bonzini,
	Igor Mammedov, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On Thu, Apr 03, 2025 at 05:18:15PM +0200, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> I tried to gather all the hw/arm/-related patches for
> the GitLab issues tagged for 10.0.
> 
> First, trivial ones fixing / disabling broken tests;
> then disable the VMapple machine (not sure about it);
> finally fix ACPI tables for '-M its=off' CLI option.
> 
> While polishing the series, I noticed MST mentioning
> the ACPI changes are likely too late:
> https://lore.kernel.org/qemu-devel/20250403100406-mutt-send-email-mst@kernel.org/
> I'll defer that jugement to Alex :)
> 
> Regards,
> 
> Phil.


Patches 1-4:

Acked-by: Michael S. Tsirkin <mst@redhat.com>


The rest indeed seems late.


> Philippe Mathieu-Daudé (13):
>   tests/functional: Add a decorator for skipping tests on particular OS
>   tests/functional: Skip aarch64_replay test on macOS
>   tests/qtest: Skip Aarch64 VMapple machine
>   hw/arm: Do not build VMapple machine by default
>   hw/arm/virt: Remove pointless VirtMachineState::tcg_its field
>   hw/intc/gicv3_its: Do not check its_class_name() for NULL
>   hw/arm/virt: Simplify create_its()
>   hw/arm/virt-acpi: Factor its_enabled() helper out
>   qtest/bios-tables-test: Add test for -M virt,its=off
>   qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs
>   hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled)
>   hw/arm/virt-acpi: Do not advertise disabled GIC ITS
>   qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs
> 
> Pierrick Bouvier (1):
>   tests/functional/test_aarch64_rme_virt: fix sporadic failure
> 
>  configs/devices/aarch64-softmmu/default.mak |   1 +
>  include/hw/arm/virt.h                       |   1 -
>  include/hw/intc/arm_gicv3_its_common.h      |   2 +-
>  hw/arm/virt-acpi-build.c                    |  48 ++++++++++++--------
>  hw/arm/virt.c                               |  23 +++-------
>  tests/qtest/bios-tables-test.c              |  22 +++++++++
>  tests/qtest/libqtest.c                      |   1 +
>  tests/data/acpi/aarch64/virt/APIC.its_off   | Bin 0 -> 164 bytes
>  tests/data/acpi/aarch64/virt/FACP.its_off   | Bin 0 -> 276 bytes
>  tests/data/acpi/aarch64/virt/IORT.its_off   | Bin 0 -> 212 bytes
>  tests/functional/qemu_test/__init__.py      |   2 +-
>  tests/functional/qemu_test/decorators.py    |  15 +++++-
>  tests/functional/test_aarch64_replay.py     |   4 +-
>  tests/functional/test_aarch64_rme_virt.py   |   4 +-
>  14 files changed, 82 insertions(+), 41 deletions(-)
>  create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
>  create mode 100644 tests/data/acpi/aarch64/virt/FACP.its_off
>  create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off
> 
> -- 
> 2.47.1



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

* Re: [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
@ 2025-04-03 17:31   ` Richard Henderson
  2025-04-03 18:04   ` Thomas Huth
  1 sibling, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:31 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> +Decorator to skip execution of a test if the current
> +host operating system does not match one of the permitted
> +ones.
> +Example
> +
> +  @skipIfOperatingSystem("Linux", "Darwin")
> +'''
> +def skipIfOperatingSystem(*args):
> +    return skipIf(platform.system() in args,
> +                  'not running on one of the required OS(s) "%s"' %

s/required/prohibited/ ?

With that, or similar wording,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


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

* Re: [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS Philippe Mathieu-Daudé
@ 2025-04-03 17:31   ` Richard Henderson
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:31 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> As of v10.0.0-rc2 this test is still failing on macos:
> 
>    $ make check-functional-aarch64 V=1
>    ...
>    ERROR:../../replay/replay-internal.c:235:replay_mutex_unlock: assertion failed: (replay_mutex_locked())
>    Bail out! ERROR:../../replay/replay-internal.c:235:replay_mutex_unlock: assertion failed: (replay_mutex_locked())
> 
> This is tracked as https://gitlab.com/qemu-project/qemu/-/issues/2907
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/functional/test_aarch64_replay.py | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Acked-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/tests/functional/test_aarch64_replay.py b/tests/functional/test_aarch64_replay.py
> index 04cde433bcf..029fef3cbf8 100755
> --- a/tests/functional/test_aarch64_replay.py
> +++ b/tests/functional/test_aarch64_replay.py
> @@ -5,7 +5,7 @@
>   #
>   # SPDX-License-Identifier: GPL-2.0-or-later
>   
> -from qemu_test import Asset
> +from qemu_test import Asset, skipIfOperatingSystem
>   from replay_kernel import ReplayKernelBase
>   
>   
> @@ -16,6 +16,8 @@ class Aarch64Replay(ReplayKernelBase):
>            'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz'),
>           '7e1430b81c26bdd0da025eeb8fbd77b5dc961da4364af26e771bd39f379cbbf7')
>   
> +    # Failing on Darwin: https://gitlab.com/qemu-project/qemu/-/issues/2907
> +    @skipIfOperatingSystem('Darwin')
>       def test_aarch64_virt(self):
>           self.set_machine('virt')
>           self.cpu = 'cortex-a53'



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

* Re: [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
@ 2025-04-03 17:33   ` Richard Henderson
  2025-04-03 18:00   ` Thomas Huth
  1 sibling, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:33 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> First, the VMapple machine only works with the ARM 'host' CPU
> type, which isn't accepted for QTest:
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest
>    qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
> 
> Second, the QTest framework expects machines to be createable
> without specifying optional arguments, however the VMapple
> machine requires few of them:
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest
>    qemu-system-aarch64: No firmware specified
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
>    qemu-system-aarch64: No AUX device. Please specify one as pflash drive.
> 
> Restrict this machine with QTest so we can at least run check-qtest,
> otherwise we get:
> 
>    $ make check-qtest-aarch64
>    qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
>    Broken pipe
>    ../tests/qtest/libqtest.c:199: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
>    ...
>     7/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/test-hmp     ERROR      24.71s   killed by signal 6 SIGABRT
>     2/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/qom-test     ERROR      71.23s   killed by signal 6 SIGABRT
> 
> Suggested-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/qtest/libqtest.c | 1 +
>   1 file changed, 1 insertion(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 2750067861e..fad307d125a 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -1788,6 +1788,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
>           if (!strncmp("xenfv", machines[i].name, 5) ||
>               g_str_equal("xenpv", machines[i].name) ||
>               g_str_equal("xenpvh", machines[i].name) ||
> +            g_str_equal("vmapple", machines[i].name) ||
>               g_str_equal("nitro-enclave", machines[i].name)) {
>               continue;
>           }



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

* Re: [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default Philippe Mathieu-Daudé
@ 2025-04-03 17:34   ` Richard Henderson
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:34 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> Unfortunately as of v10.0.0-rc2 the VMapple machine is unusable:
> 
>    $ qemu-system-aarch64 -M vmapple [...]
>    *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
>        reason: '-[PGIOSurfaceHostDeviceDescriptor setMapMemory:]: unrecognized selector sent to instance 0x600001ede820'
>    *** First throw call stack:
>    (
>      0   CoreFoundation          0x000000019c759df0 __exceptionPreprocess + 176
>      1   libobjc.A.dylib         0x000000019c21eb60 objc_exception_throw + 88
>      2   CoreFoundation          0x000000019c816ce0 -[NSObject(NSObject) __retain_OA] + 0
>      3   CoreFoundation          0x000000019c6c7efc ___forwarding___ + 1500
>      4   CoreFoundation          0x000000019c6c7860 _CF_forwarding_prep_0 + 96
>      5   qemu-system-aarch64     0x000000010486dbd0 apple_gfx_mmio_realize + 200
>      6   qemu-system-aarch64     0x0000000104e6ab5c device_set_realized + 352
>      7   qemu-system-aarch64     0x0000000104e7250c property_set_bool + 100
>      8   qemu-system-aarch64     0x0000000104e7023c object_property_set + 136
>      9   qemu-system-aarch64     0x0000000104e74870 object_property_set_qobject + 60
>      10  qemu-system-aarch64     0x0000000104e70748 object_property_set_bool + 60
>      11  qemu-system-aarch64     0x0000000104e69bd8 qdev_realize_and_unref + 20
>      12  qemu-system-aarch64     0x0000000104e258e0 mach_vmapple_init + 1728
>      13  qemu-system-aarch64     0x000000010481b0ac machine_run_board_init + 1892
>      14  qemu-system-aarch64     0x0000000104a4def8 qmp_x_exit_preconfig + 260
>      15  qemu-system-aarch64     0x0000000104a51ba8 qemu_init + 14460
>      16  qemu-system-aarch64     0x0000000104f7cef8 main + 36
>      17  dyld                    0x000000019c25eb4c start + 6000
>    )
>    libc++abi: terminating due to uncaught exception of type NSException
>    Abort trap: 6
> 
> Disable the machine so it isn't built by default.
> 
> This is tracked as https://gitlab.com/qemu-project/qemu/-/issues/2913
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   configs/devices/aarch64-softmmu/default.mak | 1 +
>   1 file changed, 1 insertion(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

> 
> diff --git a/configs/devices/aarch64-softmmu/default.mak b/configs/devices/aarch64-softmmu/default.mak
> index 93f4022ad62..ad8028cfd48 100644
> --- a/configs/devices/aarch64-softmmu/default.mak
> +++ b/configs/devices/aarch64-softmmu/default.mak
> @@ -9,3 +9,4 @@ include ../arm-softmmu/default.mak
>   # CONFIG_XLNX_VERSAL=n
>   # CONFIG_SBSA_REF=n
>   # CONFIG_NPCM8XX=n
> +CONFIG_VMAPPLE=n



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

* Re: [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field Philippe Mathieu-Daudé
@ 2025-04-03 17:36   ` Richard Henderson
  2025-04-03 20:24     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:36 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> VirtMachineState::tcg_its has the same value of
> VirtMachineClass::no_tcg_its. Directly use the latter,
> removing the former.

No it doesn't.

> -        if (vmc->no_tcg_its) {
> -            vms->tcg_its = false;
> -        } else {
> -            vms->tcg_its = true;
> -        }

This is a stupidly verbose not.
But at least the names had correct logic.
Therefore all of the uses you replace need inversion.


r~


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

* Re: [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL Philippe Mathieu-Daudé
@ 2025-04-03 17:37   ` Richard Henderson
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:37 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> Since commit cc5e719e2c8 ("kvm: require KVM_CAP_SIGNAL_MSI"),
> its_class_name() single implementation doesn't return NULL
> anymore. Update the prototype docstring, and remove the
> pointless checks.
> 
> Reported-by: Gustavo Romero<gustavo.romero@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/hw/intc/arm_gicv3_its_common.h | 2 +-
>   hw/arm/virt-acpi-build.c               | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its()
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its() Philippe Mathieu-Daudé
@ 2025-04-03 17:38   ` Richard Henderson
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:38 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> No need to strstr() check the class name when we can
> use kvm_irqchip_in_kernel().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/arm/virt.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


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

* Re: [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out Philippe Mathieu-Daudé
@ 2025-04-03 17:38   ` Richard Henderson
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2025-04-03 17:38 UTC (permalink / raw)
  To: qemu-devel

On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> GIC ITS is checked for the MADT and IORT tables.
> Factor the checks out to the its_enabled() helper.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> Reviewed-by: Gustavo Romero<gustavo.romero@linaro.org>
> ---
>   hw/arm/virt-acpi-build.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
  2025-04-03 17:33   ` Richard Henderson
@ 2025-04-03 18:00   ` Thomas Huth
  1 sibling, 0 replies; 32+ messages in thread
From: Thomas Huth @ 2025-04-03 18:00 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Gustavo Romero, Peter Maydell, Laurent Vivier, Ani Sinha,
	Udo Steinberg, Michael S. Tsirkin, qemu-arm, Paolo Bonzini,
	Igor Mammedov, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On 03/04/2025 17.18, Philippe Mathieu-Daudé wrote:
> First, the VMapple machine only works with the ARM 'host' CPU
> type, which isn't accepted for QTest:
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest
>    qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
> 
> Second, the QTest framework expects machines to be createable
> without specifying optional arguments, however the VMapple
> machine requires few of them:
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest
>    qemu-system-aarch64: No firmware specified
> 
>    $ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
>    qemu-system-aarch64: No AUX device. Please specify one as pflash drive.
> 
> Restrict this machine with QTest so we can at least run check-qtest,
> otherwise we get:
> 
>    $ make check-qtest-aarch64
>    qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
>    Broken pipe
>    ../tests/qtest/libqtest.c:199: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
>    ...
>     7/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/test-hmp     ERROR      24.71s   killed by signal 6 SIGABRT
>     2/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/qom-test     ERROR      71.23s   killed by signal 6 SIGABRT
> 
> Suggested-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/qtest/libqtest.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 2750067861e..fad307d125a 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -1788,6 +1788,7 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
>           if (!strncmp("xenfv", machines[i].name, 5) ||
>               g_str_equal("xenpv", machines[i].name) ||
>               g_str_equal("xenpvh", machines[i].name) ||
> +            g_str_equal("vmapple", machines[i].name) ||
>               g_str_equal("nitro-enclave", machines[i].name)) {
>               continue;
>           }

Reviewed-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS
  2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
  2025-04-03 17:31   ` Richard Henderson
@ 2025-04-03 18:04   ` Thomas Huth
  2025-04-03 20:27     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 32+ messages in thread
From: Thomas Huth @ 2025-04-03 18:04 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Gustavo Romero, Peter Maydell, Laurent Vivier, Ani Sinha,
	Udo Steinberg, Michael S. Tsirkin, qemu-arm, Paolo Bonzini,
	Igor Mammedov, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On 03/04/2025 17.18, Philippe Mathieu-Daudé wrote:
> Since tests might be failing on some operating systems,
> introduce the skipIfOperatingSystem() decorator.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/functional/qemu_test/__init__.py   |  2 +-
>   tests/functional/qemu_test/decorators.py | 15 ++++++++++++++-
>   2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py
> index 45f7befa374..af41c2c6a22 100644
> --- a/tests/functional/qemu_test/__init__.py
> +++ b/tests/functional/qemu_test/__init__.py
> @@ -15,6 +15,6 @@
>   from .linuxkernel import LinuxKernelTest
>   from .decorators import skipIfMissingCommands, skipIfNotMachine, \
>       skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \
> -    skipIfMissingImports
> +    skipIfMissingImports, skipIfOperatingSystem
>   from .archive import archive_extract
>   from .uncompress import uncompress
> diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py
> index 1651eb739a7..b6a1d41c55c 100644
> --- a/tests/functional/qemu_test/decorators.py
> +++ b/tests/functional/qemu_test/decorators.py
> @@ -5,7 +5,7 @@
>   import importlib
>   import os
>   import platform
> -from unittest import skipUnless
> +from unittest import skipIf, skipUnless
>   
>   from .cmd import which
>   
> @@ -26,6 +26,19 @@ def skipIfMissingCommands(*args):
>       return skipUnless(has_cmds, 'required command(s) "%s" not installed' %
>                                   ", ".join(args))
>   
> +'''
> +Decorator to skip execution of a test if the current
> +host operating system does not match one of the permitted
> +ones.

"permitted ones" sounds like you'd need to specify the ones that are allowed 
to run the test, but it's rather the other way round, you have to specify 
the ones that are not able to run the test. I'd suggest to rewrite the 
comment accordingly.

> +Example
> +
> +  @skipIfOperatingSystem("Linux", "Darwin")
> +'''
> +def skipIfOperatingSystem(*args):
> +    return skipIf(platform.system() in args,
> +                  'not running on one of the required OS(s) "%s"' %

Same here, maybe rather: "running on an OS (%s) that is not able to run this 
test" ?

  Thomas



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

* Re: [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field
  2025-04-03 17:36   ` Richard Henderson
@ 2025-04-03 20:24     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 20:24 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel

On 3/4/25 19:36, Richard Henderson wrote:
> On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
>> VirtMachineState::tcg_its has the same value of
>> VirtMachineClass::no_tcg_its. Directly use the latter,
>> removing the former.
> 
> No it doesn't.
> 
>> -        if (vmc->no_tcg_its) {
>> -            vms->tcg_its = false;
>> -        } else {
>> -            vms->tcg_its = true;
>> -        }
> 
> This is a stupidly verbose not.
> But at least the names had correct logic.
> Therefore all of the uses you replace need inversion.

Oops, thanks.



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

* Re: [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS
  2025-04-03 18:04   ` Thomas Huth
@ 2025-04-03 20:27     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 20:27 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Gustavo Romero, Peter Maydell, Laurent Vivier, Ani Sinha,
	Udo Steinberg, Michael S. Tsirkin, qemu-arm, Paolo Bonzini,
	Igor Mammedov, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On 3/4/25 20:04, Thomas Huth wrote:
> On 03/04/2025 17.18, Philippe Mathieu-Daudé wrote:
>> Since tests might be failing on some operating systems,
>> introduce the skipIfOperatingSystem() decorator.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   tests/functional/qemu_test/__init__.py   |  2 +-
>>   tests/functional/qemu_test/decorators.py | 15 ++++++++++++++-
>>   2 files changed, 15 insertions(+), 2 deletions(-)


>> diff --git a/tests/functional/qemu_test/decorators.py b/tests/ 
>> functional/qemu_test/decorators.py
>> index 1651eb739a7..b6a1d41c55c 100644
>> --- a/tests/functional/qemu_test/decorators.py
>> +++ b/tests/functional/qemu_test/decorators.py
>> @@ -5,7 +5,7 @@
>>   import importlib
>>   import os
>>   import platform
>> -from unittest import skipUnless
>> +from unittest import skipIf, skipUnless
>>   from .cmd import which
>> @@ -26,6 +26,19 @@ def skipIfMissingCommands(*args):
>>       return skipUnless(has_cmds, 'required command(s) "%s" not 
>> installed' %
>>                                   ", ".join(args))
>> +'''
>> +Decorator to skip execution of a test if the current
>> +host operating system does not match one of the permitted
>> +ones.
> 
> "permitted ones" sounds like you'd need to specify the ones that are 
> allowed to run the test, but it's rather the other way round, you have 
> to specify the ones that are not able to run the test. I'd suggest to 
> rewrite the comment accordingly.
> 
>> +Example
>> +
>> +  @skipIfOperatingSystem("Linux", "Darwin")
>> +'''
>> +def skipIfOperatingSystem(*args):
>> +    return skipIf(platform.system() in args,
>> +                  'not running on one of the required OS(s) "%s"' %
> 
> Same here, maybe rather: "running on an OS (%s) that is not able to run 
> this test" ?

Yes indeed, thanks!



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

* Re: [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
@ 2025-04-04 10:41   ` Igor Mammedov
  2025-04-04 12:49     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 32+ messages in thread
From: Igor Mammedov @ 2025-04-04 10:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, Gustavo Romero, Peter Maydell,
	Laurent Vivier, Ani Sinha, Udo Steinberg, Michael S. Tsirkin,
	qemu-arm, Paolo Bonzini, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On Thu,  3 Apr 2025 17:18:28 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> GIC ITS can be disabled at runtime using '-M its=off',
> which sets VirtMachineState::its = false. Check this
> field to avoid advertising the ITS in the MADT table.
> 
> Reported-by: Udo Steinberg <udo@hypervisor.org>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
>  hw/arm/virt-acpi-build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index e7e27951cb9..38a9e6fe0c5 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -212,7 +212,7 @@ static bool its_enabled(VirtMachineState *vms)
>  {
>      VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
>  
> -    return !vmc->no_its;
> +    return !vmc->no_its && vms->its;

It's confusing have both no_its and its,
it would be better to lean this mess up (i.e dedup or rename if something is poorly named)

>  }
>  
>  /*



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

* Re: [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs
  2025-04-03 15:18 ` [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
@ 2025-04-04 10:50   ` Igor Mammedov
  0 siblings, 0 replies; 32+ messages in thread
From: Igor Mammedov @ 2025-04-04 10:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, Gustavo Romero, Peter Maydell,
	Laurent Vivier, Ani Sinha, Udo Steinberg, Michael S. Tsirkin,
	qemu-arm, Paolo Bonzini, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On Thu,  3 Apr 2025 17:18:26 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> We are going to fix the test_acpi_aarch64_virt_tcg_its_off()
> test. In preparation, copy the ACPI tables which will be
> altered as 'its_off' variants, and whitelist them.
> 
> Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/qtest/bios-tables-test-allowed-diff.h |   3 +++
>  tests/qtest/bios-tables-test.c              |   1 +
>  tests/data/acpi/aarch64/virt/APIC.its_off   | Bin 0 -> 184 bytes
>  tests/data/acpi/aarch64/virt/FACP.its_off   | Bin 0 -> 276 bytes
>  tests/data/acpi/aarch64/virt/IORT.its_off   | Bin 0 -> 236 bytes
>  5 files changed, 4 insertions(+)
>  create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off
>  create mode 100644 tests/data/acpi/aarch64/virt/FACP.its_off
>  create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off
> 
> diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
> index dfb8523c8bf..3421dd5adf3 100644
> --- a/tests/qtest/bios-tables-test-allowed-diff.h
> +++ b/tests/qtest/bios-tables-test-allowed-diff.h
> @@ -1 +1,4 @@
>  /* List of comma-separated changed AML files to ignore */
> +"tests/data/acpi/aarch64/virt/APIC.its_off",
> +"tests/data/acpi/aarch64/virt/FACP.its_off",
> +"tests/data/acpi/aarch64/virt/IORT.its_off",

1) separate patch for this please 

> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index baaf199e01c..55366bf4956 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -2151,6 +2151,7 @@ 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",
ditto

and the same for blobs below as well (commit message for those shall
contain relevant diff for changes or explain why there is none).
blobs update seems to be a bit confusing at this point (aka unexpected).

looking at this patch, I'd make a copy 1st, then '.variant = ".its_off",' patch
and only then whitelist right before patches that would actually change
tables.

> 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..c37d05d6e05805304f10afe73eb7cb9100fcccfa
> GIT binary patch
> literal 184
> zcmZ<^@O0k6z`($=+{xeBBUr&HBEVSz2pEB4AU24G0Uik$i-7~iVgWL^17JJ`2AFzr
> bgb+@aBn}xq0gwb2)Q)cq{30-g9B_L93G4|0
> 
> literal 0
> HcmV?d00001
> 
> diff --git a/tests/data/acpi/aarch64/virt/FACP.its_off b/tests/data/acpi/aarch64/virt/FACP.its_off
> new file mode 100644
> index 0000000000000000000000000000000000000000..606dac3fe4b55c31fd68b25d3a4127eeef227434
> GIT binary patch
> literal 276
> zcmZ>BbPf<<WME(uaq@Te2v%^42yj*a0-z8Bhz+8t3j|P&V`N}P6&N^PpsQ~v$aVnZ  
> CVg~^L
> 
> 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
> 



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

* Re: [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS
  2025-04-04 10:41   ` Igor Mammedov
@ 2025-04-04 12:49     ` Philippe Mathieu-Daudé
  2025-05-06 15:49       ` Igor Mammedov
  0 siblings, 1 reply; 32+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-04 12:49 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: qemu-devel, Thomas Huth, Gustavo Romero, Peter Maydell,
	Laurent Vivier, Ani Sinha, Udo Steinberg, Michael S. Tsirkin,
	qemu-arm, Paolo Bonzini, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On 4/4/25 12:41, Igor Mammedov wrote:
> On Thu,  3 Apr 2025 17:18:28 +0200
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 
>> GIC ITS can be disabled at runtime using '-M its=off',
>> which sets VirtMachineState::its = false. Check this
>> field to avoid advertising the ITS in the MADT table.
>>
>> Reported-by: Udo Steinberg <udo@hypervisor.org>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
>> ---
>>   hw/arm/virt-acpi-build.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index e7e27951cb9..38a9e6fe0c5 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -212,7 +212,7 @@ static bool its_enabled(VirtMachineState *vms)
>>   {
>>       VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
>>   
>> -    return !vmc->no_its;
>> +    return !vmc->no_its && vms->its;
> 
> It's confusing have both no_its and its,
> it would be better to lean this mess up (i.e dedup or rename if something is poorly named)

What about:

class: s/no_its/!its_createable/ or !its_usable
state: s/its/its_created/ or its_used or its_in_use



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

* Re: [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS
  2025-04-04 12:49     ` Philippe Mathieu-Daudé
@ 2025-05-06 15:49       ` Igor Mammedov
  0 siblings, 0 replies; 32+ messages in thread
From: Igor Mammedov @ 2025-05-06 15:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Thomas Huth, Gustavo Romero, Peter Maydell,
	Laurent Vivier, Ani Sinha, Udo Steinberg, Michael S. Tsirkin,
	qemu-arm, Paolo Bonzini, Andrew Jones, Daniel P. Berrangé,
	Fabiano Rosas, Alex Bennée, Shannon Zhao

On Fri, 4 Apr 2025 14:49:45 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> On 4/4/25 12:41, Igor Mammedov wrote:
> > On Thu,  3 Apr 2025 17:18:28 +0200
> > Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> >   
> >> GIC ITS can be disabled at runtime using '-M its=off',
> >> which sets VirtMachineState::its = false. Check this
> >> field to avoid advertising the ITS in the MADT table.
> >>
> >> Reported-by: Udo Steinberg <udo@hypervisor.org>
> >> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886
> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> >> Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
> >> ---
> >>   hw/arm/virt-acpi-build.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> >> index e7e27951cb9..38a9e6fe0c5 100644
> >> --- a/hw/arm/virt-acpi-build.c
> >> +++ b/hw/arm/virt-acpi-build.c
> >> @@ -212,7 +212,7 @@ static bool its_enabled(VirtMachineState *vms)
> >>   {
> >>       VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
> >>   
> >> -    return !vmc->no_its;
> >> +    return !vmc->no_its && vms->its;  
> > 
> > It's confusing have both no_its and its,
> > it would be better to lean this mess up (i.e dedup or rename if something is poorly named)  
> 
> What about:
> 
> class: s/no_its/!its_createable/ or !its_usable
> state: s/its/its_created/ or its_used or its_in_use

looking at the code what we are essentially doing with variables in class,
is selecting its device type. And then playing scattered if/then game to decide
which 'its' to create or not create.
can we make something like this instead:

 machine_foo_class_init_vX():
  vmc->its_type = NULL;

 machine_foo_class_init_vX+1():
  vmc->its_type = accel_get_its_type()
 
and then elsewhere:

if(vmc->its_type && vms->its_enabled)
    create_its(vmc->its_type)




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

end of thread, other threads:[~2025-05-06 15:50 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
2025-04-03 17:31   ` Richard Henderson
2025-04-03 18:04   ` Thomas Huth
2025-04-03 20:27     ` Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS Philippe Mathieu-Daudé
2025-04-03 17:31   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
2025-04-03 17:33   ` Richard Henderson
2025-04-03 18:00   ` Thomas Huth
2025-04-03 15:18 ` [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default Philippe Mathieu-Daudé
2025-04-03 17:34   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field Philippe Mathieu-Daudé
2025-04-03 17:36   ` Richard Henderson
2025-04-03 20:24     ` Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL Philippe Mathieu-Daudé
2025-04-03 17:37   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its() Philippe Mathieu-Daudé
2025-04-03 17:38   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out Philippe Mathieu-Daudé
2025-04-03 17:38   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 10/14] qtest/bios-tables-test: Add test for -M virt, its=off Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
2025-04-04 10:50   ` Igor Mammedov
2025-04-03 15:18 ` [PATCH-for-10.0? v2 12/14] hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled) Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
2025-04-04 10:41   ` Igor Mammedov
2025-04-04 12:49     ` Philippe Mathieu-Daudé
2025-05-06 15:49       ` Igor Mammedov
2025-04-03 15:18 ` [PATCH-for-10.0? v2 14/14] qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
2025-04-03 16:31 ` [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Michael S. Tsirkin

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