From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687169; cv=none; d=zohomail.com; s=zohoarc; b=P7THBF0qSRwA3bIFdhwStMoG5g3ibigRjRhUnlAFY9nbIT32L3P1GJ4RanDC1ioYBrtMOUEa4G+eZkc27r3I/Vqz9Qi3SVDK7LdTUgpRZS810KLZP5ZnGWuwvGkt0oOAcmhPVVDJ7qoGcUvZ06BWO02hQ6xqfaW12WlciFMUTKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687169; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uTp8cYLG6UEglvnDlfAVLBZ5UreW7WM/U27Ywrb2bxw=; b=adDec3XT9u36qdxfod+GLs/vPfn2si8/QVtSm5W+G4RAW4w6LVlUG2pLG3KfpFa1yPfv4TKBYbZjeQg/CyzYwjP/4bz4i8LKsULpLhuY7huNqdlBq6i52rEcxNMlOXRhxkjKbTCncO3106Qbd7Oq56MUVFUwXlj/RqEzz6CuXHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687169728604.4170141690981; Mon, 23 Jun 2025 06:59:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThgt-0008D7-JA; Mon, 23 Jun 2025 09:58:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThgs-0008CE-Cg for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:30 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThgq-0007G2-A3 for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:30 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-748f54dfa5fso2896069b3a.2 for ; Mon, 23 Jun 2025 06:58:27 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687106; x=1751291906; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uTp8cYLG6UEglvnDlfAVLBZ5UreW7WM/U27Ywrb2bxw=; b=T4rJAkXWaERde7dS1Nge27V2+ssLediK5CJ+cljANpmCC12vRoQCnYe29OEIRuzZRR 8lo5Sd92bmGugiWEGnypCsBW/w0iu6kd766srsKstGGLX1pjNLcrVa1s5tygqoQdCARZ u9M1J3DYorM4ktA1PPQqyPjSeafCh2OQViOJ3fQcwYrFZMxPXeJLJhTA2tWZv72EVDWd fsIxUuM2l/k/3+swIarOEXqqEqWvqj0Ov+gxM120i0NX9Cw2br18Ln9LhyLXVkAZUC/y lMRbw60rpvFlQ9NkL9LNuEMX+ePAHljQwFs07dFB0SYtC7/HSv5LkomV+E8G8ji/ts28 6TZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687106; x=1751291906; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uTp8cYLG6UEglvnDlfAVLBZ5UreW7WM/U27Ywrb2bxw=; b=AbitbULWfaLrH012lkThIZFxHATpFWoUf1WAM4aifAqaJudqjADsmE6jSBl3VTkdbg 04OQI/H9abLbXQ8VM1ueUmHkDRxr+kgAKjjq1jzyHCYE6jmT7Rdqd058GILFvt6b6xOe EekNkaLCUTrcyUyl47kfRsmTSEiGKvlsifom7tTD0jGgW3Orl0VKfYuWtXj+GSs3+MZu xfTQpMzPnwkuBBw2Pha2M0x9SaWUG9zPrP3sGwat4amDIMmZ7M9UGPoyr0kEx8fnJ6H+ sr7i0UEcTPPV3xhp+GUKnUtFSQfZ5PpIIxZ+R9/Qz9dKPzoflSgxwP/rfhSk0boGYBQj E/7w== X-Gm-Message-State: AOJu0YwhsOpI3aNcJJaDqFPDTfLfuqXKvaI+TuSk7OBYD12ie0hDfVR3 2Oysvv/4iiDMgEompNfYpZ+ZPm4GiQ/NFiyZtJCSUraeCR6owG6kalwedleXoE2ANU4r3tg4/R3 hOVuq X-Gm-Gg: ASbGncuS298SIa5lasUYRDK/pR1ddFyuI9NiVtWDvcLzDU6fnlzHRjLEadbrLVosIXr Ny3XoJsl8ukIVWFWAPzUwKqq8GV2v6LEVfBV9ELA8zhr5SwBDkFMYGWmxuk5SOVmztV2bW4rcfI 8x0ZkNJ3wEupdL3aSPEMdUmErS6wIbgWA0MK12lwkubAUVPu2O4b7KvGUvBSoMq9hfwf818+FUu 85iHE6TE1MLMNHx4jAYPDJ/apJLOt3+W1sv+4r2giwmzyW19qh1mzorp3bQhmnb4KO8Rfu00jHK 3zezqJPare4AzkzAQ7t/qb6RRhyYvlLJzEeyURSJy8dNcNXAwUJgtCAzVYrkLxoz59Q= X-Google-Smtp-Source: AGHT+IEEiQa2+IhXySW3Jk+w8bOwu5gQ9GdPyLkWhYn94fbqI08woD1B5i1A76i9mPtaPcsSqUILXg== X-Received: by 2002:a05:6a20:7d9f:b0:220:1215:fea7 with SMTP id adf61e73a8af0-22026c19994mr19958025637.9.1750687106268; Mon, 23 Jun 2025 06:58:26 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com, Richard Henderson Subject: [PATCH v5 1/9] hw/intc/gicv3_its: Do not check its_class_name() Date: Mon, 23 Jun 2025 13:57:41 +0000 Message-Id: <20250623135749.691137-2-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687170897116600 From: Philippe Mathieu-Daud=C3=A9 Since commit cc5e719e2c8 ("kvm: require KVM_CAP_SIGNAL_MSI"), the single implementation of its_class_name() no longer returns NULL (it now always returns a valid char pointer). Hence, update the prototype docstring and remove the tautological checks that use the its_class_name() returned value. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 32 +++++++++++--------------- include/hw/intc/arm_gicv3_its_common.h | 2 +- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 7e8e0f0298..9eee284c80 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -737,20 +737,18 @@ build_madt(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) memmap[VIRT_HIGH_GIC_REDIST2].si= ze); } =20 - if (its_class_name()) { - /* - * ACPI spec, Revision 6.0 Errata A - * (original 6.0 definition has invalid Length) - * 5.2.12.18 GIC ITS Structure - */ - build_append_int_noprefix(table_data, 0xF, 1); /* Type */ - build_append_int_noprefix(table_data, 20, 1); /* Length */ - build_append_int_noprefix(table_data, 0, 2); /* Reserved */ - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID = */ - /* Physical Base Address */ - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].bas= e, 8); - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ - } + /* + * ACPI spec, Revision 6.0 Errata A + * (original 6.0 definition has invalid Length) + * 5.2.12.18 GIC ITS Structure + */ + build_append_int_noprefix(table_data, 0xF, 1); /* Type */ + build_append_int_noprefix(table_data, 20, 1); /* Length */ + build_append_int_noprefix(table_data, 0, 2); /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */ + /* Physical Base Address */ + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8= ); + build_append_int_noprefix(table_data, 0, 4); /* Reserved */ } else { const uint16_t spi_base =3D vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BA= SE; =20 @@ -969,10 +967,8 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildT= ables *tables) vms->oem_table_id); } =20 - if (its_class_name()) { - acpi_add_table(table_offsets, tables_blob); - build_iort(tables_blob, tables->linker, vms); - } + acpi_add_table(table_offsets, tables_blob); + build_iort(tables_blob, tables->linker, vms); =20 #ifdef CONFIG_TPM if (tpm_get_version(tpm_find()) =3D=3D TPM_VERSION_2_0) { diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_g= icv3_its_common.h index 7dc712b38d..3c7b543b01 100644 --- a/include/hw/intc/arm_gicv3_its_common.h +++ b/include/hw/intc/arm_gicv3_its_common.h @@ -128,7 +128,7 @@ struct GICv3ITSCommonClass { * Return the ITS class name to use depending on whether KVM acceleration * and KVM CAP_SIGNAL_MSI are supported * - * Returns: class name to use or NULL + * Returns: class name to use */ const char *its_class_name(void); =20 --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687154; cv=none; d=zohomail.com; s=zohoarc; b=eHFkDQOOlISnX2L6iREfchKdOVw1/E0377Nrm+GuKtJ81f3Bq2wySHbRmZS6SfbR44qhdxSUVZcuD49vPGctk4TxwLP9hqhb+yFe1dx92xX6tv7yreoIEAuCtWTZrywxI42CaG5SCoI6SQHbHgkKj75vgevQPDU/rW2IojQ5TaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687154; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Nlo8as5e/cpldlYDplp41yosw6ZzdGOstiWraYoHkls=; b=KYYRtUSvaghyMxuhEtNG1S0VyxZrw+yPlJcKA5vkNOMsGp/fv58k4kvgwhEDsbdnMfFZMgTttGeP++LsLB72a3o5JN99l+VfjwpbzeHC9vz1kNOcwreutOmE5YepUGHUHvs48+ivo/auYmSDDu+8ykyVbB90NSV0TyXo4QPrgNs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687154897665.70539594489; Mon, 23 Jun 2025 06:59:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThgw-0008E2-PT; Mon, 23 Jun 2025 09:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThgv-0008DF-2r for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:33 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThgt-0007Gn-Ia for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:32 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-74264d1832eso5342673b3a.0 for ; Mon, 23 Jun 2025 06:58:31 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687110; x=1751291910; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Nlo8as5e/cpldlYDplp41yosw6ZzdGOstiWraYoHkls=; b=oHRKiiECvDy/vU8G3L3PgadJZcssOkVlPB3T8PRyvtC+CYcCv2ExkaXwJmT5XBLz5y o0xMIYjy1J/P4+RyM123QGUTzxXXOZyHpq0QKz7ePus01mw0YgHhonokjENr7lbigfEZ J8DlN5L16w3lk0bsWf+aTLenSiJ2Vi7f6Xtff0DqDp6cztOEW2pumZ+M0FiyiYM/Ho9w epSB1MxH7vPv5PvrbcgXCnIAbgFLh1DdNj27nEJnE2jYGU5Ybox/coGRNF+bmYcyUa2o FtOoW4KYUcjEAzNobujdA02PQrSY0MeUI2DGQe3PQkx2eQ3VcSDkWKOq5XFRUjo2Kc0P EC0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687110; x=1751291910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nlo8as5e/cpldlYDplp41yosw6ZzdGOstiWraYoHkls=; b=ifNnFAIjRk0W7lEZldkoO7R16DUbhSoQt+bHLMp8HMhHtRCup+MrXKOxaFcpqKJ3ZZ hIHHuuznjsq2lMnA1pbzcyNl29O3P1y9RVsXKVXrxKGiIhZZRDs3dqWQoVLGuKrCD62S mC1xEkGl8U7Q3JqVxFTLDwHxCQMpCpuUYmR7bwf+wPauNL82VuSqcrXWFfvepfkCcyaK mlFl7QPqvawXDdwNltypEtuQcYIrPCvukyzkRom4Oq4hnYcyoacIyJPq0FIUD6ikEkSU WH8vU+y+daohc6wMGktID9TuquT38R73x/1H5c4CqZNYracFe4Hc5idyPxbLoTGDnjAS r1vQ== X-Gm-Message-State: AOJu0YysBwPNo2j2QynvGtpjfW+Hq0IOd9TyWWaiVdjVoix6GaNAIT/l zjACgJEqJKWqDnM0Xw1VJPQzI4rVhCXRoUQCz6ph8ZrpZZKeFkkhKRp2yZV+CV0L4fl46GrHyzM QiuFB X-Gm-Gg: ASbGncss3y1KICTbsMwCJFOlyMMgzXfyhBNCERjfFxoi8tQVAqzW2gtgDK8XX0QxSec rkFjkz8Q5OF5CJQXDN0MQ7OY8f9MjA6DGIsl582fHujn210IH0xgYxlxbHknLv4poAJw3wgo2gj blK4QY6HcwciS41mCa1VKBc1PKpot38V3lBYO0bW2ifpyYf5LkCYwyP1Gftxs2pHd86Be8edaTh zwVUs7ig9Ql7mLTdZo+9xxnPv9UIScyNbBSSJFKvooqlps0+RPvhGe9MxtIF4BoTS6iNcRaMF5C k+jM8VWYmCJ3SEXoufq1GFWG1TEJXd2dKd4fsQSqHULgwI/5lsBBMyJd9/AnUR9nP4l5rLdGMAu iZg== X-Google-Smtp-Source: AGHT+IGg0Hu01Sq7RKr8UgZ1A7DHPgd6q0vY0ikfWBIFKs7+PyeEB47pid34WctGwhJJz5vwK28x2A== X-Received: by 2002:a05:6300:614:20b0:220:2a67:14a5 with SMTP id adf61e73a8af0-2202a671568mr16673077637.32.1750687109875; Mon, 23 Jun 2025 06:58:29 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 2/9] hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable Date: Mon, 23 Jun 2025 13:57:42 +0000 Message-Id: <20250623135749.691137-3-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687156688116600 Because 'tcg_its' in the machine instance is set based on the machine class=E2=80=99s negated variable 'no_tcg_its', 'tcg_its' is the opposite of 'no_tcg_its' and hence the code in question can be simplified as: tcg_its =3D !no_tcg_its. Signed-off-by: Gustavo Romero Reviewed-by: Eric Auger --- hw/arm/virt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9a6cd085a3..19f85d0abf 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3337,12 +3337,8 @@ static void virt_instance_init(Object *obj) =20 /* Default allows ITS instantiation */ vms->its =3D true; - - if (vmc->no_tcg_its) { - vms->tcg_its =3D false; - } else { - vms->tcg_its =3D true; - } + /* Allow ITS emulation if the machine version supports it */ + vms->tcg_its =3D !vmc->no_tcg_its; =20 /* Default disallows iommu instantiation */ vms->iommu =3D VIRT_IOMMU_NONE; --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687169; cv=none; d=zohomail.com; s=zohoarc; b=MPKUz+vR8NJYbbTDuSmVVywxAjUGiReZlSQ8La0bTa033UTPDSCfkY1/yBeGRDCBMsrJgx2IU8GrB4MHaoc3mIr67UEnT90ewH+SGzjLWg3D5DxcoSFPZ3Tmr3PZfnuzaTUJWPqUHCy1PAyyAntQZRQrpfJTmhxX5dTob/q+g1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687169; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+KCO4Ulw21w48TY/8gHQVa7B2eOfuj0N7B3tO1GbSlc=; b=FrmGtZz54QAaLTtaH1bKfVKKPkkHZCG0sQLy5goFeZR1D9w5EoE94sfI48yokeRlWHVblyMaH3SD+myMVK1PzoMNYb/SPDZm7Hn6a6pFXSNADv/Qbz3Mo+wniUSueN9SXzjYaIXz+1pXh78DCreufb/DavbViJ2cZMLADOmlG5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687169317961.8629707261675; Mon, 23 Jun 2025 06:59:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThh1-0008EX-BO; Mon, 23 Jun 2025 09:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThgz-0008EF-3b for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:37 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThgx-0007HC-Eg for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:36 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-748feca4a61so2258174b3a.3 for ; Mon, 23 Jun 2025 06:58:34 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687114; x=1751291914; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+KCO4Ulw21w48TY/8gHQVa7B2eOfuj0N7B3tO1GbSlc=; b=X0IjcMN2Z1ZBLqjqcodnvT9efzMOCZNs0ilPaZVSXioepVnGRciAS4BY4pUW9f2TUx gQEJ7vOZFVGLPQHlRVtcVSYc99iH90EhA4Gt62sR00egfUVEjbD33tfkjf6Fe5iTL5R5 lyukawTQCYCPbOQCEAEBFmYM8xmuKtk9payAUf/Zbu6daZ6ysNO/m5412/lanYYg3eU0 LOBhQ5YuTPHsBkjiLf5nEqAlbITS1gjukstetFqme3IgMatzva+uejs6X1mus+13mB4n oMS79VR1IAMVA9ouEhzCKGRKCYGkXBb4qfT+PvosgRAulkFx0gR14jxhaG/WeazoijE8 NuPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687114; x=1751291914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+KCO4Ulw21w48TY/8gHQVa7B2eOfuj0N7B3tO1GbSlc=; b=JXJXWGBvJXn4+eING+3pnrbVnINE8IsOd/j9PpeRrYT67QKUMiWGMfey/jmfhFP/G9 PM7/q59GRrq51GCuFNTs33YzB9cxc1MhjqxoKgINNzQ3hAgbQIthO38sFsgSM9C9PTIy 8oejvRhqedWgKy0fA50m+Rf3+muSHz4Qexsbme2nEXseFauDJhVPVU2SmntA0fvOLdrj cbcr8Dfsbr5WIDYG0TBer0wvXtacvsxRJo8lGz/vn9PJEYxTok3Bneh8sH+scR+rE+bz CjpoM5xmLZCf4EXr8qfuA74NRfZlR1tZHnRRNGH3vix9WfSD2pc/QAG4t32m8qSDFMJO RAaQ== X-Gm-Message-State: AOJu0YzzraV6z7dUHfqWLmRHqB04Petd+Wmku4q/zUqLDUFpMhS2rVr6 iowmEPh6FVd4Pwus5qltpK71xNdXUldK2XnpXWsQFGvZSSzoL/2+jN+PWRUMcZYgwXHAURALp4c HcpcE X-Gm-Gg: ASbGncvWTF9BJPzEqZHL8XG+9TCLy+gOjUUEMUEa0GaIeRrrOSzu1rWEWp7uyCZzJ07 fuChxQvU7jlFz+6f3hQJUy2OCiNXEnZLJ0zQ9lwjwK0cZfIZtPJmZFdeCugVRfOPGbPAv85qdX8 /EUcRrKKFbG2JDlKKv2ur7o6HCbzQDSzhpJZ10M8FawLEwncsTIP5i6j+cJW+SFRBZ4hCOUgDB8 ZQ5C1X6VC9tM8bdy4BAm3TDfMhcRHq6uMEOnoV3WriCzFe70MbLjP0XHm62HPpUN/tD7klGzEfD ZgAIF7EwbAbKahYHCEDxRHvnobf5oKoTVDnxBNwhFlEdtBdiT4uHUeBwJWKW9vI5Qb4= X-Google-Smtp-Source: AGHT+IFjQAm59TTKInxOZjJuXB8hdE+jbTwwM+gqUvzv9UPWZ6u/2k9EzU7681DoI3yXvDXyaxvJhA== X-Received: by 2002:a05:6a20:a108:b0:216:1476:f71 with SMTP id adf61e73a8af0-22026f13166mr19283222637.39.1750687113626; Mon, 23 Jun 2025 06:58:33 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com, Richard Henderson Subject: [PATCH v5 3/9] hw/arm/virt: Simplify create_its() Date: Mon, 23 Jun 2025 13:57:43 +0000 Message-Id: <20250623135749.691137-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687170806116600 From: Philippe Mathieu-Daud=C3=A9 No need to strstr() check the class name when we can use kvm_irqchip_in_kernel() to check if the ITS from the host can be used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Reviewed-by: Gustavo Romero --- hw/arm/virt.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 19f85d0abf..96a09c3eac 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -705,21 +705,18 @@ static inline DeviceState *create_acpi_ged(VirtMachin= eState *vms) =20 static void create_its(VirtMachineState *vms) { - const char *itsclass =3D its_class_name(); DeviceState *dev; =20 - if (!strcmp(itsclass, "arm-gicv3-its")) { - if (!vms->tcg_its) { - itsclass =3D NULL; - } - } - - if (!itsclass) { - /* Do nothing if not supported */ + assert(vms->its); + if (!kvm_irqchip_in_kernel() && !vms->tcg_its) { + /* + * Do nothing if ITS is neither supported by the host nor emulated= by + * the machine. + */ return; } =20 - dev =3D qdev_new(itsclass); + dev =3D qdev_new(its_class_name()); =20 object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(vms->gic), &error_abort); --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687221; cv=none; d=zohomail.com; s=zohoarc; b=PR23GzJZLSr6kqWVM13KofRuOWx8TitjxN6vgR81ZIfgCCMdlqCaxgs87y40wg1sFI2AOaAEmrWwYjw+gscVawbRYKn+MY5YkgaXn2pbNr7xqVHq86xw0UdvmNE2lENC3/t6q7S1qdoQKiy22rxUecInARUtseh5uUQoaK2kpu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687221; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QHmEaaRegYwFGlGoVTGRYvzmrkIrypDwOG7loJLMkas=; b=QfJAo1+hD2s4X3Rrb2/8w3pkyfsBK6W7VeuNSNHkIUWVzAQrZUy44KIL80IXpvdgOyaZrgOsP6bDHNfr5/frathNha3MW7THcOZCds3FzvzmqF7+/xiTMcf22wMEd+14pYWUyd3JoOLrsiH0EVKigmR4tI37RHoCAhPnK8N9/5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687221390810.2094440456905; Mon, 23 Jun 2025 07:00:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThh6-0008Fv-10; Mon, 23 Jun 2025 09:58:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThh4-0008FS-AY for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:42 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThh0-0007Hj-Qw for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:42 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7490702fc7cso2138162b3a.1 for ; Mon, 23 Jun 2025 06:58:38 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687117; x=1751291917; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QHmEaaRegYwFGlGoVTGRYvzmrkIrypDwOG7loJLMkas=; b=Tv2cBmAONAeOiVmp3jTu7az+lR9QWIVg4qa4HOZ2BxWaiYPgUOLSuXtWpJPvjMp1W4 JmCBvzCAb1dQocbavhLpZ1/Qh1/3wUBcrXGsU21iahi+lQ3jatDp3bbnx9v9FgT6y773 FCBiQKe6TBdgEbfmRd6vQAtjRa2TTznDZqrqxPvzc1A7LC8gv27lghtFCr87+DP2ZRZS 1e0/8CyLH9QADC9xC6ka8oegbYHL+e/MzgFM1aWsozbtq4hi+Mp9r63H19Gq28TCdiCf QhvsOqHDXXdkl+8w3Wy2Wz6Jj4uP4Owwnx/2zpJBwxkPYNEJPEMwBv9AIUSQ+IOLb/d7 7BAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687117; x=1751291917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QHmEaaRegYwFGlGoVTGRYvzmrkIrypDwOG7loJLMkas=; b=lR7MShJ4rQMqiPnQHPKtHV8Tw0cN/VpQ5QIja+ZPUu1UxRsntGYQsl321d5lsvOMHi M2e7h1o2wkrIg01a30zPA3VjCFdZJNYfMDyr4JHc6/wrOTyVGz1kgmLKzm7o7+Oi8vCY 5Xv2XQB9BkrWLUgD5vuvzCWNPYLdALX9Xow+Eqbm2nfF6mGZeUP/tz8KGL2aksO+x98g p60LYxnfRo+opz3QgKPaxRdpadGwypBPFj5OtCzUSEV/oXLlzIDjh0ZoQDa8tmty5Rse oykQ7QiV/KgYK0m09wWXbBP9XhBB17T8EL+YrRfygzeE3lzCQ2KzC3WOpiecvMv/OdS1 RrWg== X-Gm-Message-State: AOJu0Yw+4HyiFbZPLk8pbvohf70dpCgF8FLZ1qv5rJ9WljEg6m2AM7+W 9gZkc0h4sN6azmICPMiDr+9sWSZ7BTcwIRQEOnI6AnPL6qIu9HouOIIx0oD9ou4m9WrEB9Bi6I0 utSrV X-Gm-Gg: ASbGnctdcMt/PPOnrxuB/Zes+WQMDfibtU1MsYz21UmvIJGI0tIdGvgjgueugsc67cd R1FqiUdlG8cwO1r0oU8pNrW/gxaelJnUKFAtopmGh4OhclhzB07CvGELlgoHDlGamd+3wnYbnY5 aOB6o4mpG7aOrnLec9zjW7br0knmNhRGvlGqwEcoojzcmNGCZGi50jRF5nJ2WFVJANK+qTyr4T1 vliW/eXjz6o+yYAnmJ/MWw+ZMxS7S0N4BWqnefvy//8KEnmsQsWzNmZJn/6JdZBHakblkHg8mdr It/NeR/bhJyvcYXEYw9gstDDOMGt89PDZT7btNxxPCrAH4JQ34mqFN7t2OfiP2/GpXM= X-Google-Smtp-Source: AGHT+IErWAFwMzcz/MjBmkN38EukFVknW17niV69zGOxvdKP40Jbzg6+ebXlnwGxu8z2XQPLIQXvZw== X-Received: by 2002:a05:6a21:a342:b0:21f:53a9:b72c with SMTP id adf61e73a8af0-22026e9c88cmr19082150637.38.1750687117248; Mon, 23 Jun 2025 06:58:37 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort Date: Mon, 23 Jun 2025 13:57:44 +0000 Message-Id: <20250623135749.691137-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687223962116600 Content-Type: text/plain; charset="utf-8" When building the Root Complex table, the comment about the code that maps the RC node to SMMU node is misleading because it reads "RC -> SMMUv3 -> ITS", but the code is only mapping the RCs IDs to the SMMUv3 node. The step of mapping from the SMMUv3 IDs to the ITS Group node is actually defined in another table (in the SMMUv3 node). So change the comment to read "RC -> SMMUv3" instead. Signed-off-by Gustavo Romero Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 9eee284c80..e9cd3fb351 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -370,7 +370,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) /* DeviceID mapping index (ignored since interrupts are GSIV based= ) */ build_append_int_noprefix(table_data, 0, 4); =20 - /* output IORT node is the ITS group node (the first node) */ + /* Output IORT node is the ITS Group node (the first node) */ build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET); } =20 @@ -407,23 +407,36 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) if (vms->iommu =3D=3D VIRT_IOMMU_SMMUV3) { AcpiIortIdMapping *range; =20 - /* translated RIDs connect to SMMUv3 node: RC -> SMMUv3 -> ITS */ + /* + * Map RIDs (input) from RC to SMMUv3 nodes: RC -> SMMUv3. + * + * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS)= is + * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to= the + * ITS Group node. + */ for (i =3D 0; i < smmu_idmaps->len; i++) { range =3D &g_array_index(smmu_idmaps, AcpiIortIdMapping, i); - /* output IORT node is the smmuv3 node */ + /* Output IORT node is the SMMUv3 node. */ build_iort_id_mapping(table_data, range->input_base, range->id_count, smmu_offset); } =20 - /* bypassed RIDs connect to ITS group node directly: RC -> ITS */ + /* + * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS G= roup + * node directly: RC -> ITS. + */ for (i =3D 0; i < its_idmaps->len; i++) { range =3D &g_array_index(its_idmaps, AcpiIortIdMapping, i); - /* output IORT node is the ITS group node (the first node) */ + /* Output IORT node is the ITS Group node (the first node). */ build_iort_id_mapping(table_data, range->input_base, range->id_count, IORT_NODE_OFFSET); } } else { - /* output IORT node is the ITS group node (the first node) */ + /* + * Map all RIDs (input) to ITS Group node directly, since there is= no + * SMMU: RC -> ITS. + * Output IORT node is the ITS Group node (the first node). + */ build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET); } =20 --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687287; cv=none; d=zohomail.com; s=zohoarc; b=lUEJlZlYtCUfY4TDu9vjPPNagdh1BnA8dNIE5M3B8vL51+Eng6k6cLDeb8HjUrIKxET5/0476JV/fsLXykQG2TrbvDtCXLzjPXwYdXBGsCMskMUoZ1YgbRwNriLlLZvIqLoEZrEZOyCkjr8jtirM3L60gvw7PnWn4BN6QbASKSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687287; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tWwtJe7sGsUGEueqmsN3PVBl6pSQ948gCik+Qy6mwyc=; b=GI1EccdM8lJUzw8ifi3UJuMVsDosHUbrLW8VWmI/eftuQ6LS72Mi5aFnXilr1MoVzKhzujO6/OvAyOYyCFuEYXg6tzcjAJxEyUU0bz3J7huZOfEOu52c6qJJVNCnLSbpV1v6yS83dfeXzSa5msu73h1BGPWPg8+v7OuLqpEBuCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687287010664.205328482041; Mon, 23 Jun 2025 07:01:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThhX-0008Po-CF; Mon, 23 Jun 2025 09:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThhA-0008Gt-4w for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:48 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThh5-0007IA-D3 for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:47 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-7399a2dc13fso4883941b3a.2 for ; Mon, 23 Jun 2025 06:58:41 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687121; x=1751291921; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tWwtJe7sGsUGEueqmsN3PVBl6pSQ948gCik+Qy6mwyc=; b=F0cNz4wjTLppFhMHQFPclwPGqV87cx3u9fuCusGtta1cbn+1TKIAaN+CeQXMLQq1K2 iwYIi0PMB3gmGQNUPXUIfx8J5GWo1hd2LjzHFXwSod3HSaDu0DQQMXt22OR38w6WBAbq jz4eHinCwE0o0f3l4Sqs7mooWKbCgrNVvRDYGKpQrDJcmARhntAwqIw3aUA+zlThdl+f Do8LbqA/uJwUZuMdZk3bjE38Zn0e5UzKg5vta1m7yJbbg1x+52pcZOw6auZla2+W7RIC Ard7wlDjT9npXzcN05MKuKpTQLnj2Gv3iHcYaD8thR0/oFeKlsIroJHUNKDK2iUtBlfn p6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687121; x=1751291921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tWwtJe7sGsUGEueqmsN3PVBl6pSQ948gCik+Qy6mwyc=; b=cKyguhY6xlezafNf9rnxGPtGZS2e6IepVWOoAA7EkCrsc/Cnv5HzwITrSkUtsnwfpg 7ltJ4FG0T2VjZaimFBc26VLAPT+NjPTxVBesk4+KzfmHdM6V+gddaeQ4HsfdWyHUY+VU HFIHQ4Qerk3a5uv3o769sV/CpedN81hsxeLuYr9xDvq5jZ4Rs9apbkKXzGqiQXYuLpyx soyWxMTpKT0B0fL3hG6IsdFfK4amMAhMowrnAU0SkBsi0kxGImnrQXY+YARep8Fii/bI x9oy+v6+Az1f4uAv21kgdqkkjbn2OxLS7TW6zy0If250NJM4qgW20HYqbwg+1VoAZDb5 54sA== X-Gm-Message-State: AOJu0Yw+3oRJyHbvr8CAWMIbOm8ALlrXGR3teKg/5rdsZHnNSdee+iU7 WKTl3Ec3FB44PfUug1m/ozgtKQ69lwIEz+7zJ1wWrGH3K3ySnKlTXazs0a/NssirCJq/WtXcODj GOdrh X-Gm-Gg: ASbGncuzkhYsNfJYZ1p/OIQtvPUzbmr1FW1mgxMa5m8fHya5BF8chL1XGBRy8om5HAW hNT6FrNezNluqc7lf/cymY3oXnm+oNwyL2DK/2R7MC01rEN1kNTnRM1zleHvbp6w1pVJ9xkiZYp aiW8DXrx58pB9SSPtEWIn7I2oEaBH7DwqJu/vl42KO7LrAR3y1q/RJ+yTsO7bmKBmSsd+T1gqpJ FZV07//eSjkkeR5HodwfB5T65ntqzSolMrIzFhoRdwGvC/5GdlwRx78zLsJF+L/6pV4IA88PZae n4qP1I7ecn1zsgYNNQELOsTqVZvuyTAUHsOw4INBmH76t4lW1Yim1vE/Y+DnxQKMliY= X-Google-Smtp-Source: AGHT+IEP5weTA9lYRUWvac9OZPElw8rZVoWde3YML9FuBKQ3hKjUCj61HEYec5CnNc434BOKk7xUmA== X-Received: by 2002:a05:6a00:3c90:b0:736:2a73:6756 with SMTP id d2e1a72fcca58-7490da07100mr18027642b3a.21.1750687120824; Mon, 23 Jun 2025 06:58:40 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps Date: Mon, 23 Jun 2025 13:57:45 +0000 Message-Id: <20250623135749.691137-6-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687291229116600 Factor out a new function, create_its_idmaps(), from the current build_iort code. Add proper comments to it clarifying how the ID ranges that go directly to the ITS Group node are computed based on the ones that go to the SMMU node. Suggested-by: Eric Auger Signed-off-by: Gustavo Romero --- hw/arm/virt-acpi-build.c | 64 +++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e9cd3fb351..40a782a498 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -266,6 +266,42 @@ static int iort_idmap_compare(gconstpointer a, gconstp= ointer b) return idmap_a->input_base - idmap_b->input_base; } =20 +/* Compute ID ranges (RIDs) from RC that do directly to the ITS Group node= */ +static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps) +{ + AcpiIortIdMapping *idmap; + AcpiIortIdMapping next_range =3D {0}; + + /* + * Based on the RID ranges that go to the SMMU, determine the bypassed= RID + * ranges, i.e., the ones that go directly to the ITS Group node, by + * subtracting the SMMU-bound ranges from the full RID range, 0x0000= =E2=80=930xFFFF. + */ + for (int i =3D 0; i < smmu_idmaps->len; i++) { + idmap =3D &g_array_index(smmu_idmaps, AcpiIortIdMapping, i); + + if (next_range.input_base < idmap->input_base) { + next_range.id_count =3D idmap->input_base - next_range.input_b= ase; + g_array_append_val(its_idmaps, next_range); + } + + next_range.input_base =3D idmap->input_base + idmap->id_count; + } + + /* + * Append the last RC -> ITS ID mapping. + * + * RIDs are 16-bit, according to the PCI Express 2.0 Base Specificatio= n, rev + * 0.9, section 2.2.6.2, "Transaction Descriptor - Transaction ID Fiel= d", + * hence, the end of the range is 0x10000. + */ + if (next_range.input_base < 0x10000) { + next_range.id_count =3D 0x10000 - next_range.input_base; + g_array_append_val(its_idmaps, next_range); + } +} + + /* * Input Output Remapping Table (IORT) * Conforms to "IO Remapping Table System Software on ARM Platforms", @@ -276,7 +312,6 @@ build_iort(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) { int i, nb_nodes, rc_mapping_count; size_t node_size, smmu_offset =3D 0; - AcpiIortIdMapping *idmap; uint32_t id =3D 0; GArray *smmu_idmaps =3D g_array_new(false, true, sizeof(AcpiIortIdMapp= ing)); GArray *its_idmaps =3D g_array_new(false, true, sizeof(AcpiIortIdMappi= ng)); @@ -287,34 +322,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) acpi_table_begin(&table, table_data); =20 if (vms->iommu =3D=3D VIRT_IOMMU_SMMUV3) { - AcpiIortIdMapping next_range =3D {0}; - object_child_foreach_recursive(object_get_root(), iort_host_bridges, smmu_idmaps); =20 /* Sort the smmu idmap by input_base */ g_array_sort(smmu_idmaps, iort_idmap_compare); =20 - /* - * Split the whole RIDs by mapping from RC to SMMU, - * build the ID mapping from RC to ITS directly. - */ - for (i =3D 0; i < smmu_idmaps->len; i++) { - idmap =3D &g_array_index(smmu_idmaps, AcpiIortIdMapping, i); - - if (next_range.input_base < idmap->input_base) { - next_range.id_count =3D idmap->input_base - next_range.inp= ut_base; - g_array_append_val(its_idmaps, next_range); - } - - next_range.input_base =3D idmap->input_base + idmap->id_count; - } - - /* Append the last RC -> ITS ID mapping */ - if (next_range.input_base < 0x10000) { - next_range.id_count =3D 0x10000 - next_range.input_base; - g_array_append_val(its_idmaps, next_range); - } + /* + * Knowing the ID ranges from the RC to the SMMU, it's possible to + * determine the ID ranges from RC that go directly to ITS. + */ + create_its_idmaps(its_idmaps, smmu_idmaps); =20 nb_nodes =3D 3; /* RC, ITS, SMMUv3 */ rc_mapping_count =3D smmu_idmaps->len + its_idmaps->len; --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687204; cv=none; d=zohomail.com; s=zohoarc; b=kiXkPgDNECz82zQkmlQSaEoO+S1IV1UcCOGtpOVRQkWfYOq7fhG2x3odDaWjYc9rypap9Wr1aWvNtN40vsN9OV0RTbuOR/j975OXckbowf/skDiHGCS/37OMoRgod0uQO2/fDLHe6TT8B6lUx4QJiewmVv6uZd9rD+ImeLVmHRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687204; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ad2Ktqpr9QplRBLnhaKfV79oFe1du+hxPOeNvvhDj1A=; b=J9oxoyv5P5U+wxZ7Yp1ZyOig+l0Dlm2zKDEramoVkJk1z+mimOzXfVQomtFGGBJNnqH1c32NkzV/nFVRu9jgQC7HjK4pM5a4E1GyKd/2AnScuU1jxpWSwvqbL93nqbwnjRN0xN4043ExyOWFw1LpsoVIEZvh+P+E7V1ToeT2W+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687203968643.2556062756715; Mon, 23 Jun 2025 07:00:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThhc-0008WO-1Q; Mon, 23 Jun 2025 09:59:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThhC-0008HD-4g for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:51 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThh8-0007Ia-1x for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:49 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7406c6dd2b1so3233670b3a.0 for ; Mon, 23 Jun 2025 06:58:45 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687124; x=1751291924; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ad2Ktqpr9QplRBLnhaKfV79oFe1du+hxPOeNvvhDj1A=; b=JS5c5B86BIYZmNM6yvij/Ze8pzHgJdf22ZvxggSKMNfzlATmnadziJUcPuujNtFaVW 0QHqVeS4JWnsJYdOkXmBXsAvFR47fmVju7/Iw7A6c+vbG0kecYjUfzQwCLpFITfP19i9 19yfKqQjK+5RAKrSgkC12K5YsPIYVmtsk1fozSni9Rvw5qvFnZuuNUBcywzsAyLr3acl IBj+cPBNmKmhRU3zZqsVNNLWBALEg5l05kfC6PI6W8oRvTQlw08RU9d1KxVkVOYClDBR qSJ6ywLZmBl0RC3ds8Zs9P6gn52WPlhhQg9XxgqQvaqVVV6h2gbWzN95dmscb7ZMMSCn 34Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687124; x=1751291924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ad2Ktqpr9QplRBLnhaKfV79oFe1du+hxPOeNvvhDj1A=; b=rLqqx7QCis5EGlc6FDUavtMtJZ70F1OOfEo6fAUkbQ5STRjO6W9CjKhR0RWoMV8BKB 7ukVaC7vRS9aL6UGl+eucWjVtC+ILjVw8ONWK4h9JnHVPG9t8stNv6pS6Is8y83gfMOh Y/MpU2OfV1qpL72DrsqwfXhDmsog9HSrN9/2CL3NHbzb+lg0JmeKTQMRIqX3WhxpVJAg AGfNPLo8YQ+pSIB2Dy0TjJ1r12CToEpLYuPuoDmUzUC6ErHTQlhsU/uASDhEPpPe6SH5 zq6/IlbhHLogampAcATa20jOnQVs26b0QrOrE7PpwToyQp4Cuaxz1j2CC2YX3pj9ODqV PgQg== X-Gm-Message-State: AOJu0Yylei2iBZ5z+NnhyxeCKhOjiPvjwgQb6Kr5bKoU/nlDdrEmkHBW HVbxLGrgJmerhumibFJ6dlj1vw2npby3uXOVKfjHeTjfDq4U0UzjYPZ1rmfAy9m9KSUvO6JLZ4z EyMJd X-Gm-Gg: ASbGncupi4FYDlhrOkiBuwJ2pUEVyZTt9/+DzdESo1tr2PO9bAHOoxRiMYLzW+zBCs+ AW6+fyrkIedu3Qdn4oYuqsu+hR7dCwAj+yaL9gUIYy7EuKJnrs3s23xckrcu5ofdCORjyfo1tXM 4IMeUnZ+T8PfsnhJvu8RdoX/q2a+l8552T3HGU5YL7iKJ4Kg4JLKuOy5SMQVLJP2RNTYwqwu/Dz OgStJz5/GRJU4pm9P5QStO5vZzwymbAROt9GEpAsYtyqP5Kok2evBWemipkeJz/4b/AGs39AZ1D ja9nkX3ScUxr7aGTPgFphSYHTf3pifXFaYyy2CLj1blf1h1+0VEkDlO3dbxad11t2SA= X-Google-Smtp-Source: AGHT+IE+A2RXkl1fsGxBWrMkhEYdvlQZUcrsUy1N77xAoHF9Tti6WGIFDvE++UYLoNNJyoOBrxVgQg== X-Received: by 2002:a05:6a20:a106:b0:21c:fa68:9da6 with SMTP id adf61e73a8af0-220291cdb15mr18609786637.8.1750687124354; Mon, 23 Jun 2025 06:58:44 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64 Date: Mon, 23 Jun 2025 13:57:46 +0000 Message-Id: <20250623135749.691137-7-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687205120116600 From: Philippe Mathieu-Daud=C3=A9 Arm64 GIC ITS (Interrupt Translation Service) is an optional piece of hardware introduced in GICv3 and, being optional, it can be disabled in QEMU aarch64 VMs that support it using machine option "its=3Doff", like, for instance: "-M virt,its=3Doff". In ACPI, the ITS is advertised, if present, in the MADT (aka APIC) table, while the ID mappings from the Root Complex (RC) and from the SMMU nodes to the ITS Group nodes are described in the IORT table. This new test verifies that when the "its=3Doff" option is passed to the machine the ITS-related data is correctly pruned from the ACPI tables. The new blobs for this test will be added in a following commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Gustavo Romero Reviewed-by: Eric Auger --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ tests/qtest/bios-tables-test.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..a88198d5c2 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/APIC.its_off", +"tests/data/acpi/aarch64/virt/IORT.its_off", diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 0b2bdf9d0d..4dbc07ec5e 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -2146,6 +2146,25 @@ static void test_acpi_aarch64_virt_tcg_topology(void) free_test_data(&data); } =20 +static void test_acpi_aarch64_virt_tcg_its_off(void) +{ + test_data data =3D { + .machine =3D "virt", + .arch =3D "aarch64", + .variant =3D ".its_off", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", + .cd =3D "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.= qcow2", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * 1024 * 1024, + }; + + test_acpi_one("-cpu cortex-a57 " + "-M gic-version=3D3,iommu=3Dsmmuv3,its=3Doff", &data); + free_test_data(&data); +} + static void test_acpi_q35_viot(void) { test_data data =3D { @@ -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_m= emhp); --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687320; cv=none; d=zohomail.com; s=zohoarc; b=VreE6uXPM3sctnW7H8/MttKvKdWQ3OKSUAqptDXYGnlrgEpRX7f1kIMqKC5yKfDQ7ItQdoPL/TTvIo8EEgWN+plravuJa1d1wF51yE4gm/bn6aPGOjhWO5LzvLxMyYmEYnPAvpez1QEaVe70HrDhJvn8a6DyZqMq/4GhEjqSy1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687320; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BjZboSZZUhHnL3j3LLICgav2KEwJ5awXyYH+Nvj74ZU=; b=md9EHTj07MATFgcjDkYIOAkrdTkDWoWbyv0HytvwU75+Ltf5krzeuiBez/CkkDideGcxvSTowAiZXSNSbp7Q3Nwf2ADAfLaJYAuSZLHSe2dMeyqC2QIRepaovu/z8M2D1bj+oAJWgiBTdL1ZdyIB4Gd120TBhBB/42dqgPH8HyA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17506873205161010.2607549206979; Mon, 23 Jun 2025 07:02:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThhX-0008QK-D0; Mon, 23 Jun 2025 09:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThhF-0008KU-PK for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:54 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThhB-0007J1-UE for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:53 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-b0db0b6a677so3810319a12.2 for ; Mon, 23 Jun 2025 06:58:49 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687128; x=1751291928; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BjZboSZZUhHnL3j3LLICgav2KEwJ5awXyYH+Nvj74ZU=; b=ouaxc+C1DFwroO+JGxwF8v95hxqvKddsbEPxs5atISnbZU2b52VZkQHU1dx5HWPOH4 RuhN644KfhhigdiyR7ytdYMKtmxxJd8I+dA7GnAgr7seuyqlt2eowJAXir+IPqdgvblI p3LXgzsDdFfD++FzX/CwBF/sgyp9qzxPIk12mA0YljpBRDohhOYfqIbvnDDBK+UuSaDj cG2k+vcDdQUTm16g9inQnVcbO9+enr+ikJGBtcvyExB6wyQvnurYcgOx6RjwkHDIM/Ln bdV8oQ6HP4kNKKEUcaYRdrVUDsgfjH/zJajcgYvJvOYxoH+9wv8Jx0NB/+XPgcK2eETU 2sDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687128; x=1751291928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BjZboSZZUhHnL3j3LLICgav2KEwJ5awXyYH+Nvj74ZU=; b=IAxn0qNdNb1pY1qmQtAv502AqQB1I45aRSZ49najXCW83rFLCJlvkz4/rU4PRvTroV lY+iCUHZ7J+IaNpWbor0Jhtq2ajShJTg7p1kPAwobCW6TIDLWX22SJt3dOSG4I6FlBR+ 6M0NBMAuHq55ph89hRMJUqhd/51k6JwCimGOurPP2CVvq+gJBzMtp8ud2NToPmfWjEKI 2ZbxJ6Z42XynoFvRLcdibEcHjyI8w+TQTcex1olq5+o0ZwQgYSmz8haSrvNJaHrknavY ZXmYlGkLRCQoniOaBDdhFmsha03SsATO8Ye0WrAGNueK2WZPaKoubZAJrqkYUtQfV1kp 9Sxg== X-Gm-Message-State: AOJu0Yw0a6lm7n0YwRdqwpi2hrTiaOn7QHBpc36Lv7wAT5wsC8he/ao/ v+sVBrZXIBr5KXhAOMZfOPG9hARWkeWloUDalZdd1DRW7tlxUrvDQVu8MWRYOrjovVXeOYaLaKT epGQr X-Gm-Gg: ASbGncv/T3/B9plXZ9ANdkGlC0smqA5WzRdzr3RQnK3vmAM/bF5yPjdJa5b4Ovi5B+i eN8IpVy6/JEyMOnKxdqsdLwVRqDPaaWhlw/fkLbFz+O7iw3TVh8aP4m0H9JhnvC8KFswmC5Z6+B pGnH6G/ewgXfph5SVhqNjSeRhDFG/NAcpC6z32mzgF3zST0uuOa0CLUZH1nryYdeM59kEAWKeSC NMWdTQkc1foj7IjcHYCYM12KL7Tbzsv1o4uUPPJDWmEf/pqJpetDiS0KtUR5oqlrPa6ZKnPbUVf U1/sJCEJLqZI1OpU/OJxC+C4wbCNC7a6SxdZTDY4tQ+eWYO9f8bQcjoXdyCb/B3k0Xw= X-Google-Smtp-Source: AGHT+IHsoedkmJQ0n/a5C+RtaBEy4+v5P4ksQGHxVeJT1rsse9x+CVH2+Kh/iM3iAYio9fHd4l9gag== X-Received: by 2002:a05:6a21:b94:b0:1f5:6f95:2544 with SMTP id adf61e73a8af0-22026f00f14mr16060884637.33.1750687127987; Mon, 23 Jun 2025 06:58:47 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 7/9] qtest/bios-tables-test: Add blobs for its=off test on aarch64 Date: Mon, 23 Jun 2025 13:57:47 +0000 Message-Id: <20250623135749.691137-8-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=gustavo.romero@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687321533116600 Content-Type: text/plain; charset="utf-8" Add blobs for test_acpi_aarch64_virt_tcg_its_off(), which introduces a new variant, .its_off, that requires variations of the MADT and IORT tables. MADT (aka APIC) diff: +[000h 0000 4] Signature : "APIC" [Multiple APIC De= scription Table (MADT)] +[004h 0004 4] Table Length : 000000B8 +[008h 0008 1] Revision : 04 +[009h 0009 1] Checksum : C1 +[00Ah 0010 6] Oem ID : "BOCHS " +[010h 0016 8] Oem Table ID : "BXPC " +[018h 0024 4] Oem Revision : 00000001 +[01Ch 0028 4] Asl Compiler ID : "BXPC" +[020h 0032 4] Asl Compiler Revision : 00000001 + +[024h 0036 4] Local Apic Address : 00000000 +[028h 0040 4] Flags (decoded below) : 00000000 + PC-AT Compatibility : 0 + +[02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distr= ibutor] +[02Dh 0045 1] Length : 18 +[02Eh 0046 2] Reserved : 0000 +[030h 0048 4] Local GIC Hardware ID : 00000000 +[034h 0052 8] Base Address : 0000000008000000 +[03Ch 0060 4] Interrupt Base : 00000000 +[040h 0064 1] Version : 03 +[041h 0065 3] Reserved : 000000 + +[044h 0068 1] Subtable Type : 0B [Generic Interrupt Contr= oller] +[045h 0069 1] Length : 50 +[046h 0070 2] Reserved : 0000 +[048h 0072 4] CPU Interface Number : 00000000 +[04Ch 0076 4] Processor UID : 00000000 +[050h 0080 4] Flags (decoded below) : 00000001 + Processor Enabled : 1 + Performance Interrupt Trigger Mode : 0 + Virtual GIC Interrupt Trigger Mode : 0 +[054h 0084 4] Parking Protocol Version : 00000000 +[058h 0088 4] Performance Interrupt : 00000017 +[05Ch 0092 8] Parked Address : 0000000000000000 +[064h 0100 8] Base Address : 0000000000000000 +[06Ch 0108 8] Virtual GIC Base Address : 0000000000000000 +[074h 0116 8] Hypervisor GIC Base Address : 0000000000000000 +[07Ch 0124 4] Virtual GIC Interrupt : 00000000 +[080h 0128 8] Redistributor Base Address : 0000000000000000 +[088h 0136 8] ARM MPIDR : 0000000000000000 +[090h 0144 1] Efficiency Class : 00 +[091h 0145 1] Reserved : 00 +[092h 0146 2] SPE Overflow Interrupt : 0000 + +[094h 0148 1] Subtable Type : 0E [Generic Interrupt Redis= tributor] +[095h 0149 1] Length : 10 +[096h 0150 2] Reserved : 0000 +[098h 0152 8] Base Address : 00000000080A0000 +[0A0h 0160 4] Length : 00F60000 + +[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Trans= lator] +[0A5h 0165 1] Length : 14 +[0A6h 0166 2] Reserved : 0000 +[0A8h 0168 4] Translation ID : 00000000 +[0ACh 0172 8] Base Address : 0000000008080000 +[0B4h 0180 4] Reserved : 00000000 IORT diff: +[000h 0000 4] Signature : "IORT" [IO Remapping Tab= le] +[004h 0004 4] Table Length : 000000EC +[008h 0008 1] Revision : 03 +[009h 0009 1] Checksum : 57 +[00Ah 0010 6] Oem ID : "BOCHS " +[010h 0016 8] Oem Table ID : "BXPC " +[018h 0024 4] Oem Revision : 00000001 +[01Ch 0028 4] Asl Compiler ID : "BXPC" +[020h 0032 4] Asl Compiler Revision : 00000001 + +[024h 0036 4] Node Count : 00000003 +[028h 0040 4] Node Offset : 00000030 +[02Ch 0044 4] Reserved : 00000000 + +[030h 0048 1] Type : 00 +[031h 0049 2] Length : 0018 +[033h 0051 1] Revision : 01 +[034h 0052 4] Reserved : 00000000 +[038h 0056 4] Mapping Count : 00000000 +[03Ch 0060 4] Mapping Offset : 00000000 + +[040h 0064 4] ItsCount : 00000001 +[044h 0068 4] Identifiers : 00000000 + +[048h 0072 1] Type : 04 +[049h 0073 2] Length : 0058 +[04Bh 0075 1] Revision : 04 +[04Ch 0076 4] Reserved : 00000001 +[050h 0080 4] Mapping Count : 00000001 +[054h 0084 4] Mapping Offset : 00000044 + +[058h 0088 8] Base Address : 0000000009050000 +[060h 0096 4] Flags (decoded below) : 00000001 + COHACC Override : 1 + HTTU Override : 0 + Proximity Domain Valid : 0 +[064h 0100 4] Reserved : 00000000 +[068h 0104 8] VATOS Address : 0000000000000000 +[070h 0112 4] Model : 00000000 +[074h 0116 4] Event GSIV : 0000006A +[078h 0120 4] PRI GSIV : 0000006B +[07Ch 0124 4] GERR GSIV : 0000006D +[080h 0128 4] Sync GSIV : 0000006C +[084h 0132 4] Proximity Domain : 00000000 +[088h 0136 4] Device ID Mapping Index : 00000000 + +[08Ch 0140 4] Input base : 00000000 +[090h 0144 4] ID Count : 0000FFFF +[094h 0148 4] Output Base : 00000000 +[098h 0152 4] Output Reference : 00000030 +[09Ch 0156 4] Flags (decoded below) : 00000000 + Single Mapping : 0 + +[0A0h 0160 1] Type : 02 +[0A1h 0161 2] Length : 004C +[0A3h 0163 1] Revision : 03 +[0A4h 0164 4] Reserved : 00000002 +[0A8h 0168 4] Mapping Count : 00000002 +[0ACh 0172 4] Mapping Offset : 00000024 + +[0B0h 0176 8] Memory Properties : [IORT Memory Access Propert= ies] +[0B0h 0176 4] Cache Coherency : 00000001 +[0B4h 0180 1] Hints (decoded below) : 00 + Transient : 0 + Write Allocate : 0 + Read Allocate : 0 + Override : 0 +[0B5h 0181 2] Reserved : 0000 +[0B7h 0183 1] Memory Flags (decoded below) : 03 + Coherency : 1 + Device Attribute : 1 +[0B8h 0184 4] ATS Attribute : 00000000 +[0BCh 0188 4] PCI Segment Number : 00000000 +[0C0h 0192 1] Memory Size Limit : 40 +[0C1h 0193 3] Reserved : 000000 + +[0C4h 0196 4] Input base : 00000000 +[0C8h 0200 4] ID Count : 000000FF +[0CCh 0204 4] Output Base : 00000000 +[0D0h 0208 4] Output Reference : 00000048 +[0D4h 0212 4] Flags (decoded below) : 00000000 + Single Mapping : 0 + +[0D8h 0216 4] Input base : 00000100 +[0DCh 0220 4] ID Count : 0000FEFF +[0E0h 0224 4] Output Base : 00000100 +[0E4h 0228 4] Output Reference : 00000030 +[0E8h 0232 4] Flags (decoded below) : 00000000 + Single Mapping : 0 Signed-off-by: Gustavo Romero Reviewed-by: Eric Auger --- tests/data/acpi/aarch64/virt/APIC.its_off | Bin 0 -> 184 bytes tests/data/acpi/aarch64/virt/IORT.its_off | Bin 0 -> 236 bytes tests/qtest/bios-tables-test-allowed-diff.h | 2 -- 3 files changed, 2 deletions(-) create mode 100644 tests/data/acpi/aarch64/virt/APIC.its_off create mode 100644 tests/data/acpi/aarch64/virt/IORT.its_off diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aa= rch64/virt/APIC.its_off new file mode 100644 index 0000000000000000000000000000000000000000..37d82e970b1331cb5b259f0bd2d= 3654bacb2d623 GIT binary patch literal 184 zcmZ<^@O0k6z`($A(8=3DG~BUr&HBEVSz2pEB4AU24G0Uik$i-7~iVg@p}17JJ`2AFzr Zgb>LrJ^_#xE~p*f82CkCMsUFG1ppOZ2>}2A literal 0 HcmV?d00001 diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aa= rch64/virt/IORT.its_off new file mode 100644 index 0000000000000000000000000000000000000000..0fceb820d509e852ca0849baf56= 8a8e93e426738 GIT binary patch literal 236 zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=3DRgMkDCNC*yK9F_TjFfcO#g+N#Zh@s|zoCF3AP#UU@ R!2`+%Dg6Hr$N|zYvjDIZ5CH%H literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index a88198d5c2..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,3 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/APIC.its_off", -"tests/data/acpi/aarch64/virt/IORT.its_off", --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687326; cv=none; d=zohomail.com; s=zohoarc; b=FwZLk2EpuHRYqAGd9FQVT+l8aKajztHZLZ6d0mDJBzYXvnCVuX3wfQxeWqPKSD6b+AeWePEOBCp/YYT87P2AewziTOY+ErtwtE55Zizyrll+mVaOV81CdcxM0DICznFCFuHMbPYEVpHcYB/YENUdx6RLX/JpsQI3pVKgR1jQtcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687326; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IOV46Ps4a8FdPp4RmxE7rRFywBE4TgcqqV4mGLREwqI=; b=CUDUCt/GHcgG6T3HfpKlw8bzQbH/fRegzmZwc1irwZ4157XlSmw1qWsGHiaRfn5Q7rdUSVZE2KZeceb18PtLOb82XAZnWMoqIxW4YAgqwi3ezSzqGobqCKl10JqQcgCTnkfoZAtKrdl2hxlnKnJZnheFT62wrv5xA6VBP7rn70A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687325955763.8859627547436; Mon, 23 Jun 2025 07:02:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThhf-0000Bi-6O; Mon, 23 Jun 2025 09:59:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThhK-0008NC-2X for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:59:03 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThhH-0007Jp-6p for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:57 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7406c6dd2b1so3233828b3a.0 for ; Mon, 23 Jun 2025 06:58:53 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687132; x=1751291932; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IOV46Ps4a8FdPp4RmxE7rRFywBE4TgcqqV4mGLREwqI=; b=ZxThlQyg1ZSim0yRiNdGMgsonDQz6NI+QoIn+eYdyN5ckVhc5WsKJF8Sbp4YUDMgNP iKwae4B/R9uGzLKVBS0QTXMPu3f49ghw3od36MF9amVsBaKK7uvITT+EfseL5ncIPKkF lt0AJ2T22ItfTQCXsrpacplYLcnq72ZEyyxs9OxYHPPY4jHMCDa+SGEvZXT5lRXhysV+ yLG+MAPMbEdzDs74Gmv2ohogQMf2uNrSiHMs3Buvx6hdsp1GFjJ8AszBBKGxfBcaZzyv hfClgEZ0SNS4UDSAG8lUg9tgBpGLnoT7UM6HDTxMvRn5sVD3uuYFdldXVvqToj1tYrpH 0gFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687132; x=1751291932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IOV46Ps4a8FdPp4RmxE7rRFywBE4TgcqqV4mGLREwqI=; b=u4LsO98OQgemtqylZ7fWphmIYtrd2+x2vCIdKPxyWoDcSyqKnb8ZPBQ731sJ6f6sHd y794SBgQm8WTvRd3lPjvjS/6vfh/5yk3ekiv/J5M+hKTM96WxdTDjbTZmVz5xT9wwXMI uiqERgOaExfF7YZ/AITEyL5v27jJ2/0GGTGejDsqObz5ZT/allXWQ3PjvrREkSb9faLK WrIGfWztx8wMa132+ZnIsphHhlxhkCXpsR1vstXEPE/DtDkCrvWVZ073SjsdV9zZRJyl HOAAhwOQgvmO+GIMFlyVkguqRXxfLTMdeVaw85KrFwbA8mwxYJsnO5wlJLpEBfawAAWJ ECkQ== X-Gm-Message-State: AOJu0YzwS+Du8zOXSSrjXfeGi6+At8fY6iSRZ/q7BxSYw5RtxlKyBzP9 fQ9Eo41eo3fq/q9hpIG5tntf3F6BwxCGhq5TNfMVGdByF+6M0AuyE+iElHTQOUAzprHGn3r9eFg 2vLve X-Gm-Gg: ASbGncubG/wFFq0JqTe7ZCnJ1U6Zlt3odcEEwhiUiwY6L2u9Xul0N1RqrGjXgeqZu6t ivIhUex662LBb9+fYtaLKohKG7kJZ4zbKYbWh5SRs+nT8P3TfxFy+U7t41kwzhTraRLhp2R2lMq HgNbR/mvjNDcmjxIUdn62DJAjfMX/3CP0s7uhxdZjGY07FZhrF2RSB2H7L9Qoleyi9USkZewUKQ neVNbBw//0WzKe7zZTKSXtJpHHfYiBLZSVwFVc6eyBQE0ZQD9Cvuk3tU0DIUtUdhi5rkXVPAFsz 0GkpgQ5ZeAP0Fb6g2g0yrgIp0xp8WSJLwIQeBnxbJrudl7eyn1NutCpBqoQUCou1tTI= X-Google-Smtp-Source: AGHT+IFJNmxnYgubIONa8S0ID6ICpLttZdIWCbRmzjTTncyS+bivCcrNi3m2sJ4YPmh1McRRCoCaXQ== X-Received: by 2002:a05:6a21:3387:b0:218:183b:ccaa with SMTP id adf61e73a8af0-220292ec76fmr18167176637.17.1750687131541; Mon, 23 Jun 2025 06:58:51 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Date: Mon, 23 Jun 2025 13:57:48 +0000 Message-Id: <20250623135749.691137-9-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687327802116600 Currently, the ITS Group nodes in the IORT table and the GIC ITS Struct in the MADT table are always generated, even if GIC ITS is not available on the machine. This commit fixes it by not generating the ITS Group nodes, not mapping any other node to them, and not advertising the GIC ITS in the MADT table, when GIC ITS is not available on the machine. Since the fix changes the MADT and IORT tables, add the blobs for the "its=3Doff" test to the allow list and update them in the next commit. Reported-by: Udo Steinberg Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2886 Signed-off-by: Gustavo Romero Co-authored-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger --- hw/arm/virt-acpi-build.c | 128 ++++++++++++-------- tests/qtest/bios-tables-test-allowed-diff.h | 2 + 2 files changed, 80 insertions(+), 50 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 40a782a498..17ae46804a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -328,17 +328,27 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) /* Sort the smmu idmap by input_base */ g_array_sort(smmu_idmaps, iort_idmap_compare); =20 - /* - * Knowing the ID ranges from the RC to the SMMU, it's possible to - * determine the ID ranges from RC that go directly to ITS. - */ - create_its_idmaps(its_idmaps, smmu_idmaps); - - nb_nodes =3D 3; /* RC, ITS, SMMUv3 */ - rc_mapping_count =3D smmu_idmaps->len + its_idmaps->len; + nb_nodes =3D 2; /* RC and SMMUv3 */ + rc_mapping_count =3D smmu_idmaps->len; + + if (vms->its) { + /* + * Knowing the ID ranges from the RC to the SMMU, it's possibl= e to + * determine the ID ranges from RC that go directly to ITS. + */ + create_its_idmaps(its_idmaps, smmu_idmaps); + + nb_nodes++; /* ITS */ + rc_mapping_count +=3D its_idmaps->len; + } } else { - nb_nodes =3D 2; /* RC, ITS */ - rc_mapping_count =3D 1; + if (vms->its) { + nb_nodes =3D 2; /* RC and ITS */ + rc_mapping_count =3D 1; /* Direct map to ITS */ + } else { + nb_nodes =3D 1; /* RC only */ + rc_mapping_count =3D 0; /* No output mapping */ + } } /* Number of IORT Nodes */ build_append_int_noprefix(table_data, nb_nodes, 4); @@ -347,31 +357,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4); build_append_int_noprefix(table_data, 0, 4); /* Reserved */ =20 - /* Table 12 ITS Group Format */ - build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */ - node_size =3D 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier = */; - build_append_int_noprefix(table_data, node_size, 2); /* Length */ - build_append_int_noprefix(table_data, 1, 1); /* Revision */ - build_append_int_noprefix(table_data, id++, 4); /* Identifier */ - build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings = */ - build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array = */ - build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */ - /* GIC ITS Identifier Array */ - build_append_int_noprefix(table_data, 0 /* MADT translation_id */, 4); + if (vms->its) { + /* Table 12 ITS Group Format */ + build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Ty= pe */ + node_size =3D 20 /* fixed header size */ + 4 /* 1 GIC ITS Identif= ier */; + 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 mappi= ngs */ + build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Ar= ray */ + 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); + } =20 if (vms->iommu =3D=3D VIRT_IOMMU_SMMUV3) { int irq =3D vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE; - + int num_id_mappings, offset_to_id_array; + + if (vms->its) { + num_id_mappings =3D 1; /* ITS Group node */ + offset_to_id_array =3D SMMU_V3_ENTRY_SIZE; /* Just after the h= eader */ + } else { + num_id_mappings =3D 0; /* No ID mappings */ + offset_to_id_array =3D 0; /* No ID mappings array */ + } smmu_offset =3D table_data->len - table.table_offset; /* Table 9 SMMUv3 Format */ build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type = */ - node_size =3D SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE; + node_size =3D SMMU_V3_ENTRY_SIZE + + (ID_MAPPING_ENTRY_SIZE * num_id_mappings); build_append_int_noprefix(table_data, node_size, 2); /* Length */ build_append_int_noprefix(table_data, 4, 1); /* Revision */ build_append_int_noprefix(table_data, id++, 4); /* Identifier */ - build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappi= ngs */ + /* Number of ID mappings */ + build_append_int_noprefix(table_data, num_id_mappings, 4); /* Reference to ID Array */ - build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4); + build_append_int_noprefix(table_data, offset_to_id_array, 4); /* Base address */ build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base,= 8); /* Flags */ @@ -387,9 +409,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vir= tMachineState *vms) build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */ /* DeviceID mapping index (ignored since interrupts are GSIV based= ) */ build_append_int_noprefix(table_data, 0, 4); - - /* Output IORT node is the ITS Group node (the first node) */ - build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET); + /* Array of ID mappings */ + if (num_id_mappings) { + /* Output IORT node is the ITS Group node (the first node). */ + build_iort_id_mapping(table_data, 0, 0x10000, IORT_NODE_OFFSET= ); + } } =20 /* Table 17 Root Complex Node */ @@ -430,7 +454,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) * * N.B.: The mapping from SMMUv3 to ITS Group node (SMMUv3 -> ITS)= is * defined in the SMMUv3 table, where all SMMUv3 IDs are mapped to= the - * ITS Group node. + * ITS Group node, if ITS is available. */ for (i =3D 0; i < smmu_idmaps->len; i++) { range =3D &g_array_index(smmu_idmaps, AcpiIortIdMapping, i); @@ -439,15 +463,17 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) range->id_count, smmu_offset); } =20 - /* - * Map bypassed (don't go throught the SMMU) RIDs (input) to ITS G= roup - * node directly: RC -> ITS. - */ - for (i =3D 0; i < its_idmaps->len; i++) { - range =3D &g_array_index(its_idmaps, AcpiIortIdMapping, i); - /* Output IORT node is the ITS Group node (the first node). */ - build_iort_id_mapping(table_data, range->input_base, - range->id_count, IORT_NODE_OFFSET); + if (vms->its) { + /* + * Map bypassed (don't go throught the SMMU) RIDs (input) to I= TS Group + * node directly: RC -> ITS. + */ + for (i =3D 0; i < its_idmaps->len; i++) { + range =3D &g_array_index(its_idmaps, AcpiIortIdMapping, i); + /* Output IORT node is the ITS Group node (the first node)= . */ + build_iort_id_mapping(table_data, range->input_base, + range->id_count, IORT_NODE_OFFSET); + } } } else { /* @@ -768,18 +794,20 @@ build_madt(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) memmap[VIRT_HIGH_GIC_REDIST2].si= ze); } =20 - /* - * ACPI spec, Revision 6.0 Errata A - * (original 6.0 definition has invalid Length) - * 5.2.12.18 GIC ITS Structure - */ - build_append_int_noprefix(table_data, 0xF, 1); /* Type */ - build_append_int_noprefix(table_data, 20, 1); /* Length */ - build_append_int_noprefix(table_data, 0, 2); /* Reserved */ - build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID */ - /* Physical Base Address */ - build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].base, 8= ); - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ + if (vms->its) { + /* + * ACPI spec, Revision 6.0 Errata A + * (original 6.0 definition has invalid Length) + * 5.2.12.18 GIC ITS Structure + */ + build_append_int_noprefix(table_data, 0xF, 1); /* Type */ + build_append_int_noprefix(table_data, 20, 1); /* Length */ + build_append_int_noprefix(table_data, 0, 2); /* Reserved */ + build_append_int_noprefix(table_data, 0, 4); /* GIC ITS ID = */ + /* Physical Base Address */ + build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].bas= e, 8); + build_append_int_noprefix(table_data, 0, 4); /* Reserved */ + } } else { const uint16_t spi_base =3D vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BA= SE; =20 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8b..a88198d5c2 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/aarch64/virt/APIC.its_off", +"tests/data/acpi/aarch64/virt/IORT.its_off", --=20 2.34.1 From nobody Sat Nov 15 14:52:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750687190; cv=none; d=zohomail.com; s=zohoarc; b=iqeLhETKLrJGfvdPV8IdwZyZkP2AHH7NFYcSzz+28hOq6LV7swneoXuSA5fudMGDoUgC/xrNHai+bdI4NmVf4atq726ycdeNo/+wa4n6gJGCVdPlv87DDhfuxJuS47ZGu+u0VXQqZTybSf0CFQ99L1LexUJSifQnBnCon4lXsl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750687190; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p0/yq+vfIvmjKZWamcj479Q+dBed8z1l1/92Ss/Ji20=; b=EAh5JWJtpxknYhmizHoHrQgAIlNLy/nvrvOPnJmvVfFR4EpB/XPAC/JqWVHszKaDHf+ZzyDZgTqnyh0LXhX1MfvH1B9pEsuO67x6K2mhBj9FRhCeyqIg/K18VmmpDayvZlctNsnzNX3tji5+HE3w9lSf8jEtKH7n/Se5J5JQqlk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750687190632202.84148932346716; Mon, 23 Jun 2025 06:59:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uThhd-00009H-Fi; Mon, 23 Jun 2025 09:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uThhN-0008Oj-Qy for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:59:03 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uThhJ-0007Kc-02 for qemu-devel@nongnu.org; Mon, 23 Jun 2025 09:58:59 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7424ccbef4eso3244769b3a.2 for ; Mon, 23 Jun 2025 06:58:56 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b31f119eb64sm8063490a12.31.2025.06.23.06.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jun 2025 06:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750687135; x=1751291935; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p0/yq+vfIvmjKZWamcj479Q+dBed8z1l1/92Ss/Ji20=; b=shBL9ks6fkfkSvfoavDk7S7qmZStuCiUgz4NVJzL1IiuzLPO27hBY+MLJ46Jpo1SmG IfHYn+xPfnTdbhn0peI5wWflsqTdo5fg6LAnt2ZWwjySnhG1Ab8+n10fAMknTXY1OiPA /cdPLVHXJqI+9S+DyfqlNASniu+GEvhJav5GyOsNe6yKWiA9GWn0WAB4p2KhMGd7C7vT 3Fy68mCy65h5n7qkPZMSGzy46jvR4atu7MEhHs3Fz3cWdfeZgQ2ozOsDyvOl7pDXsADd kdat245jRpf9SIuRRBT4PCzfxdIMI9mUTbGSr34lA7iCi70F6jDFWcovJD8gx2nIo3lY MR+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750687135; x=1751291935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p0/yq+vfIvmjKZWamcj479Q+dBed8z1l1/92Ss/Ji20=; b=etP/MmA8fsDS07rZGLpvVW14pfZTqUNHxYYty8II9WRds62grHwwGenzAcsd0IgGiT aRR3uZmc+fQZC45b3CUPMbxbF0g+bXCjxcsXOcncS2ULcp08S9SxayklU6771yO/rpiu JF27sZFP+SDSc/GXIWtEdCfSLLhZ+LoA6PlRm10aNd0NSzaMGnp9v72qyT9z1AlQaJMq tf3C3RYk+fWZiXVQow7LATxeZFLZineL4TSkzC6fo0gL6RFoFy9Wj1ahpSBCzEF9HDXN EslLkIwiIgoPSiqItJxoedlBB7O7oXpsbZh6KyfMj6b8NzC7QjnKxiRW+wwzWohbu0OG c/6Q== X-Gm-Message-State: AOJu0Yya/Ghi+WVvDr54KNO6otLmqZ/YfAhZufJm8tf3HiyamtwVC1Pj sra90cBLhn1Wm67c5wuZlFWxzeoN+uD6y5KkYJ/xHenTdKf/u5o4so+BUn97AbzOO5ceIwnbOml oxl25 X-Gm-Gg: ASbGncuTrnO+6TsgeOx1erUCrtfjkpRai6/eiHr9E9ol/MzKogzkSgsVVSmz4coR4zU QADs/VN3nprY2YqfdbTIzLtpqj0JqwhAeMp2btCN3belQvDnN9+ohKnR4OrVodz5eSZvVq5JLTz QY1n3tQs2ej+eTO2K0reUfzxEf6XUufIk88CO1vHsgANeFyMm5PX0AKubrZL/l5nHlkxjeKh2qy f7+sg0+UzMv2pkd3q+2yK16CK/Qv8Qqawc+mJYQnwHNKZ6Zu1TEQJnkwSX1jM1UlpQy9nZOa3Lt Ma2cE1itlWcs0oOIq6xQNiy9O4zRZ39dGvoAT5NvP7MP2NndvPG4GWN0NO3aHKGAvS4= X-Google-Smtp-Source: AGHT+IGfeqwrsXo740la5bI4Chzx6ivjVa1Jc9qENUHzqibSYW4I/e+PGd2+PkHxcKTEBk52Zzub6g== X-Received: by 2002:a05:6a21:648f:b0:21f:31d9:593b with SMTP id adf61e73a8af0-22026ff5037mr18853654637.37.1750687135181; Mon, 23 Jun 2025 06:58:55 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, eric.auger@redhat.com, philmd@linaro.org, mst@redhat.com Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, gustavo.romero@linaro.org, udo@hypervisor.org, ajones@ventanamicro.com, peter.maydell@linaro.org, imammedo@redhat.com, anisinha@redhat.com Subject: [PATCH v5 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64 Date: Mon, 23 Jun 2025 13:57:49 +0000 Message-Id: <20250623135749.691137-10-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250623135749.691137-1-gustavo.romero@linaro.org> References: <20250623135749.691137-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750687192891116600 Content-Type: text/plain; charset="utf-8" Update blobs for the its=3Doff test on aarch64 after fix. Basically, all structs related to ITS are gone in MADT and IORT tables after the fix (previously ITS was not properly disabled when "its=3Doff" option was passed to the machine). MADT diff: [000h 0000 4] Signature : "APIC" [Multiple APIC De= scription Table (MADT)] -[004h 0004 4] Table Length : 000000B8 +[004h 0004 4] Table Length : 000000A4 [008h 0008 1] Revision : 04 -[009h 0009 1] Checksum : C1 +[009h 0009 1] Checksum : 08 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 4] Local Apic Address : 00000000 [028h 0040 4] Flags (decoded below) : 00000000 PC-AT Compatibility : 0 [02Ch 0044 1] Subtable Type : 0C [Generic Interrupt Distr= ibutor] [02Dh 0045 1] Length : 18 [02Eh 0046 2] Reserved : 0000 [030h 0048 4] Local GIC Hardware ID : 00000000 [034h 0052 8] Base Address : 0000000008000000 [03Ch 0060 4] Interrupt Base : 00000000 @@ -48,37 +48,29 @@ [064h 0100 8] Base Address : 0000000000000000 [06Ch 0108 8] Virtual GIC Base Address : 0000000000000000 [074h 0116 8] Hypervisor GIC Base Address : 0000000000000000 [07Ch 0124 4] Virtual GIC Interrupt : 00000000 [080h 0128 8] Redistributor Base Address : 0000000000000000 [088h 0136 8] ARM MPIDR : 0000000000000000 [090h 0144 1] Efficiency Class : 00 [091h 0145 1] Reserved : 00 [092h 0146 2] SPE Overflow Interrupt : 0000 [094h 0148 1] Subtable Type : 0E [Generic Interrupt Redis= tributor] [095h 0149 1] Length : 10 [096h 0150 2] Reserved : 0000 [098h 0152 8] Base Address : 00000000080A0000 [0A0h 0160 4] Length : 00F60000 -[0A4h 0164 1] Subtable Type : 0F [Generic Interrupt Trans= lator] -[0A5h 0165 1] Length : 14 -[0A6h 0166 2] Reserved : 0000 -[0A8h 0168 4] Translation ID : 00000000 -[0ACh 0172 8] Base Address : 0000000008080000 -[0B4h 0180 4] Reserved : 00000000 IORT diff: [000h 0000 4] Signature : "IORT" [IO Remapping Tab= le] -[004h 0004 4] Table Length : 000000EC +[004h 0004 4] Table Length : 000000AC [008h 0008 1] Revision : 03 -[009h 0009 1] Checksum : 57 +[009h 0009 1] Checksum : 97 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 -[024h 0036 4] Node Count : 00000003 +[024h 0036 4] Node Count : 00000002 [028h 0040 4] Node Offset : 00000030 [02Ch 0044 4] Reserved : 00000000 -[030h 0048 1] Type : 00 -[031h 0049 2] Length : 0018 -[033h 0051 1] Revision : 01 +[030h 0048 1] Type : 04 +[031h 0049 2] Length : 0044 +[033h 0051 1] Revision : 04 [034h 0052 4] Reserved : 00000000 [038h 0056 4] Mapping Count : 00000000 [03Ch 0060 4] Mapping Offset : 00000000 -[040h 0064 4] ItsCount : 00000001 -[044h 0068 4] Identifiers : 00000000 - -[048h 0072 1] Type : 04 -[049h 0073 2] Length : 0058 -[04Bh 0075 1] Revision : 04 -[04Ch 0076 4] Reserved : 00000001 -[050h 0080 4] Mapping Count : 00000001 -[054h 0084 4] Mapping Offset : 00000044 - -[058h 0088 8] Base Address : 0000000009050000 -[060h 0096 4] Flags (decoded below) : 00000001 +[040h 0064 8] Base Address : 0000000009050000 +[048h 0072 4] Flags (decoded below) : 00000001 COHACC Override : 1 HTTU Override : 0 Proximity Domain Valid : 0 -[064h 0100 4] Reserved : 00000000 -[068h 0104 8] VATOS Address : 0000000000000000 -[070h 0112 4] Model : 00000000 -[074h 0116 4] Event GSIV : 0000006A -[078h 0120 4] PRI GSIV : 0000006B -[07Ch 0124 4] GERR GSIV : 0000006D -[080h 0128 4] Sync GSIV : 0000006C -[084h 0132 4] Proximity Domain : 00000000 -[088h 0136 4] Device ID Mapping Index : 00000000 - -[08Ch 0140 4] Input base : 00000000 -[090h 0144 4] ID Count : 0000FFFF -[094h 0148 4] Output Base : 00000000 -[098h 0152 4] Output Reference : 00000030 -[09Ch 0156 4] Flags (decoded below) : 00000000 - Single Mapping : 0 - -[0A0h 0160 1] Type : 02 -[0A1h 0161 2] Length : 004C -[0A3h 0163 1] Revision : 03 -[0A4h 0164 4] Reserved : 00000002 -[0A8h 0168 4] Mapping Count : 00000002 -[0ACh 0172 4] Mapping Offset : 00000024 - -[0B0h 0176 8] Memory Properties : [IORT Memory Access Propert= ies] -[0B0h 0176 4] Cache Coherency : 00000001 -[0B4h 0180 1] Hints (decoded below) : 00 +[04Ch 0076 4] Reserved : 00000000 +[050h 0080 8] VATOS Address : 0000000000000000 +[058h 0088 4] Model : 00000000 +[05Ch 0092 4] Event GSIV : 0000006A +[060h 0096 4] PRI GSIV : 0000006B +[064h 0100 4] GERR GSIV : 0000006D +[068h 0104 4] Sync GSIV : 0000006C +[06Ch 0108 4] Proximity Domain : 00000000 +[070h 0112 4] Device ID Mapping Index : 00000000 + +[074h 0116 1] Type : 02 +[075h 0117 2] Length : 0038 +[077h 0119 1] Revision : 03 +[078h 0120 4] Reserved : 00000001 +[07Ch 0124 4] Mapping Count : 00000001 +[080h 0128 4] Mapping Offset : 00000024 + +[084h 0132 8] Memory Properties : [IORT Memory Access Propert= ies] +[084h 0132 4] Cache Coherency : 00000001 +[088h 0136 1] Hints (decoded below) : 00 Transient : 0 Write Allocate : 0 Read Allocate : 0 Override : 0 -[0B5h 0181 2] Reserved : 0000 -[0B7h 0183 1] Memory Flags (decoded below) : 03 +[089h 0137 2] Reserved : 0000 +[08Bh 0139 1] Memory Flags (decoded below) : 03 Coherency : 1 Device Attribute : 1 -[0B8h 0184 4] ATS Attribute : 00000000 -[0BCh 0188 4] PCI Segment Number : 00000000 -[0C0h 0192 1] Memory Size Limit : 40 -[0C1h 0193 3] Reserved : 000000 - -[0C4h 0196 4] Input base : 00000000 -[0C8h 0200 4] ID Count : 000000FF -[0CCh 0204 4] Output Base : 00000000 -[0D0h 0208 4] Output Reference : 00000048 -[0D4h 0212 4] Flags (decoded below) : 00000000 - Single Mapping : 0 - -[0D8h 0216 4] Input base : 00000100 -[0DCh 0220 4] ID Count : 0000FEFF -[0E0h 0224 4] Output Base : 00000100 -[0E4h 0228 4] Output Reference : 00000030 -[0E8h 0232 4] Flags (decoded below) : 00000000 +[08Ch 0140 4] ATS Attribute : 00000000 +[090h 0144 4] PCI Segment Number : 00000000 +[094h 0148 1] Memory Size Limit : 40 +[095h 0149 3] Reserved : 000000 + +[098h 0152 4] Input base : 00000000 +[09Ch 0156 4] ID Count : 000000FF +[0A0h 0160 4] Output Base : 00000000 +[0A4h 0164 4] Output Reference : 00000030 +[0A8h 0168 4] Flags (decoded below) : 00000000 Single Mapping : 0 Signed-off-by: Gustavo Romero Reviewed-by: Eric Auger --- tests/data/acpi/aarch64/virt/APIC.its_off | Bin 184 -> 164 bytes tests/data/acpi/aarch64/virt/IORT.its_off | Bin 236 -> 172 bytes tests/qtest/bios-tables-test-allowed-diff.h | 2 -- 3 files changed, 2 deletions(-) diff --git a/tests/data/acpi/aarch64/virt/APIC.its_off b/tests/data/acpi/aa= rch64/virt/APIC.its_off index 37d82e970b1331cb5b259f0bd2d3654bacb2d623..6130cb7d07103b326feb4dcd703= 4f85808bebadf 100644 GIT binary patch delta 18 ZcmdnNxP+0*F~HM#2?GNI3&%vRSpY2+1Zw~Q delta 39 jcmZ3&xPy_)F~HM#2Ll5G%fX3UvqbnsfJ`vp;DE6JqX7kf diff --git a/tests/data/acpi/aarch64/virt/IORT.its_off b/tests/data/acpi/aa= rch64/virt/IORT.its_off index 0fceb820d509e852ca0849baf568a8e93e426738..c10da4e61dd00e7eb062558a273= 5d49ca0b20620 100644 GIT binary patch delta 69 zcmaFExQ3C-(?2L=3D4FdxM^Yn>aQj$zSmH`lh0E-I)3xowECx)7HGFdP%GXmL+6IZHp Hz*GSMclZc% literal 236 zcmebD4+?q1z`(#9?&R<65v<@85#X!<1dKp25F11@1F-=3DRgMkDCNC*yK9F_TjFfcO#g+N#Zh@s|zoCF3AP#UU@ R!2`+%Dg6Hr$N|zYvjDIZ5CH%H diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index a88198d5c2..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,3 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/aarch64/virt/APIC.its_off", -"tests/data/acpi/aarch64/virt/IORT.its_off", --=20 2.34.1