qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Udo Steinberg" <udo@hypervisor.org>,
	qemu-arm@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Shannon Zhao" <shannon.zhaosl@gmail.com>,
	"Gustavo Romero" <gustavo.romero@linaro.org>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-10.0 3/5] hw/arm/virt-acpi: Factor its_enabled() helper out
Date: Tue,  1 Apr 2025 00:12:37 +0200	[thread overview]
Message-ID: <20250331221239.87150-4-philmd@linaro.org> (raw)
In-Reply-To: <20250331221239.87150-1-philmd@linaro.org>

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>
---
 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 3ac8f8e1786..fdc08b40883 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 its_class_name() && !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 (its_class_name() && !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 (its_class_name() && !vmc->no_its) {
+    if (its_enabled(vms)) {
         acpi_add_table(table_offsets, tables_blob);
         build_iort(tables_blob, tables->linker, vms);
     }
-- 
2.47.1



  parent reply	other threads:[~2025-03-31 22:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 22:12 [PATCH-for-10.0 0/5] hw/arm/virt-acpi: Do not advertise disabled GIC ITS in MADT table Philippe Mathieu-Daudé
2025-03-31 22:12 ` [PATCH-for-10.0 1/5] qtest/bios-tables-test: Add test for -M virt, its=off Philippe Mathieu-Daudé
2025-04-02  6:41   ` [PATCH-for-10.0 1/5] qtest/bios-tables-test: Add test for -M virt,its=off Gustavo Romero
2025-04-02 10:30     ` Philippe Mathieu-Daudé
2025-04-03  6:25       ` Gustavo Romero
2025-04-03 12:47         ` Philippe Mathieu-Daudé
2025-04-04  0:49           ` Gustavo Romero
2025-03-31 22:12 ` [PATCH-for-10.0 2/5] qtest/bios-tables-test: Whitelist aarch64/virt/APIC.its_off blob Philippe Mathieu-Daudé
2025-04-02  6:43   ` Gustavo Romero
2025-04-02 10:31     ` Philippe Mathieu-Daudé
2025-04-03  6:27       ` Gustavo Romero
2025-03-31 22:12 ` Philippe Mathieu-Daudé [this message]
2025-04-02  6:43   ` [PATCH-for-10.0 3/5] hw/arm/virt-acpi: Factor its_enabled() helper out Gustavo Romero
2025-04-02 10:27     ` Philippe Mathieu-Daudé
2025-04-03  6:28       ` Gustavo Romero
2025-03-31 22:12 ` [PATCH-for-10.0 4/5] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
2025-04-02  6:45   ` Gustavo Romero
2025-03-31 22:12 ` [PATCH-for-10.0 5/5] qtest/bios-tables-test: Update aarch64/virt/APIC.its_off blob Philippe Mathieu-Daudé
2025-04-02  6:45   ` Gustavo Romero
2025-04-02 10:34     ` Philippe Mathieu-Daudé
2025-04-03  6:31       ` Gustavo Romero
2025-04-03 14:04 ` [PATCH-for-10.0 0/5] hw/arm/virt-acpi: Do not advertise disabled GIC ITS in MADT table Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250331221239.87150-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=anisinha@redhat.com \
    --cc=gustavo.romero@linaro.org \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=udo@hypervisor.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).