From nobody Sat Nov 15 14:51:53 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=1751140806; cv=none; d=zohomail.com; s=zohoarc; b=Fr1VQ5Z4UtryQZkWpjsvE+Rgb1EIgjSZGXAQLB+wDxolhaMNfM8hcEHf/se8jzym+pfK6o9q7YG9ZFlRVmSOHXBxqeuBjoIsJxo7q2vXoEbpgobPPqC3G1OIHA0k/w64pl09VYc7KUVbL+qrGs1LmNvp2886lRO5Y/7d8NfQHbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140806; 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=OLZLDV2Xfo06O6N3oI8FXv3Yq16kpOc9RcopExeY5TvpzdFVhXzZtHfaqhLynBacHkOjza1asXzFMmQXP5uzJUoEO07JkhUhIMlRGHOYkO7fjbnqZvxpVtvaEBJbeYEfTLoZ+kYuOaMp2RF48IZFvDErOyu/HFDnn1LRIDdtTHc= 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 1751140806345789.4992385874363; Sat, 28 Jun 2025 13:00:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbgV-0003GJ-BE; Sat, 28 Jun 2025 15:57:59 -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 1uVbgM-0003EU-4Q for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:51 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgJ-0000Id-Kk for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:49 -0400 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7d44e3a0169so40496885a.0 for ; Sat, 28 Jun 2025 12:57:47 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140666; x=1751745466; 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=tF7RHhC/RS8hnD+6+xt0/uOPS0rKwICUPEPmWsvLMLskMWj38MRdoaWho3bxbjmSTB x5igAi4BGHyL+r6C2S1yOsDZ0T9WsV9LF0D15wvbXQC5sWiiDExIYHAelOjYriRQ7MQT 8m4SX0+5T4VONW8Pgt90V1e6DsCjl1SnVJyrteLqo1XclxcKftV1y3x9jDFLXGidgA+e +3x8rTezY7dXl+MdgvH5DuwfI5uEcZ7fDHPzzI6N8e5ypi7jNq4D//KuJw0lOQ+SwVQI um4Ir7XAfz5eyiCBr5yU8vcTGvbrBd7Kv9TEwyBCmwwgcwOKqXNtu1WahzIW/OI0g7WB ma4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140666; x=1751745466; 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=Dx8nTSGjtSXl8HWWfySLY5vsMuVE44YEXhU0KZfNpsZAmPjZgBvewNVsT+lNy4X4je vpP/ewBoQ63QMr92GEfKlF3syygkeDoCSQzvS4tGhW9NcCa96VBP9jTxxjKOAnb8F31A fuzHp4HdUw4mCVYwPXg05T4fFET5iXx8+TnGjwyDlZVv+zbAKSzstSDdupjRiE4q4Klq L8Ucvnm4/D9oq8EBSMz3ZRKjmZa655Oi6M5pE0U8/3ljRIXolBFOiUIhAfKR6+1/u3fJ xTD4vHtRW6XPc3S/4uKDRHtEcQrbd3FGDbzrh70Anl5uU+hUjBAu4hUmqby5b0s3qUJR f4Iw== X-Gm-Message-State: AOJu0YxMi7hE6UKxKwwMYVjcCYTCCmn4yl9vR0ZHKr7SEtUiKiWvy9Qs 1aUUJYq0OU9okppMlfIqLzDhgLpnFaVUclLmZ7o8ofsmNILyXPdv6leaw7bLuijAeOS3ZmUmiBE fRPiY X-Gm-Gg: ASbGncsBgAB4KBbhE3DkBi/6y/9DyuJUfUniCxb6kyf0mFXzIckxVsBWL15p9YNjjKC rz9DWZPZzcKactIfc3BrweGNFzJ7CdVhg663Z7bgOsxa8mvLxOg8F4WXDlQR0c+ZTsyETQsDahM Chy6g5eT191xyIAjaA3BiLq4E1/2B/NMDW+2LMh4HBSCJ//YsYy8zLMLcPEXKyGUCIjW4YNilrA a9EaltcQyU7JDN66L/vUtQyo0/KQm2ciru9pfPnlG0dCSnd+/vHQ1odfthZc3zrRp3gWGhr/S6B XozpzR9BwCHgQvkWAnVJTDOsNJtZRI5NSTbg2Xj7q7iFQJ2xkzYngFLNyOhUscwlkD8= X-Google-Smtp-Source: AGHT+IHCWt0MySBOW4/eJZhAhJfGUH28azA8GKy0+5uc6bNcCs5wVCA/bZ7gMZcibFl5b6UaTvifHQ== X-Received: by 2002:a05:620a:bd4:b0:7d0:9ffd:423e with SMTP id af79cd13be357-7d44398da20mr1062133685a.13.1751140666380; Sat, 28 Jun 2025 12:57:46 -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 v6 1/9] hw/intc/gicv3_its: Do not check its_class_name() Date: Sat, 28 Jun 2025 19:57:14 +0000 Message-Id: <20250628195722.977078-2-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::736; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x736.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: 1751140808866116600 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:51:53 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=1751140810; cv=none; d=zohomail.com; s=zohoarc; b=HsRwXzPwKK+QgYdCCoxLTRkLiRUtsAUVpLfieu1HBpCW4PQ0pavcCik2QlC8oLMbYUIZJ6FAWcQYLsVYpNzVS6X3ZkhvS8PW9LPVnrw9c5kfftst9+tQyUCxt1g31zCBgsDOtF6RALO3e96/ssZSAjwRCj9wuwhELEkdby4tRuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140810; 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=Sh9BBAUKCRRchEMhh1wAwvgv0ZLAu/7PDYQAsn4UYuo=; b=IpeyFrKgTPQHvpTRWOGstC62DkbIUVvoR3yz9o1K7h4KtEP1HE1358LfLZRBL1DfwAeBWMki+mH8vP4XC7L1JCPcaq/ZJp5qKhPA4OH5mD4WK8oy/ETD5ST4FUjQuWBSJ3tB4Doj4Df35FX8Ry9dXluFmo9p3gPQtTufrF+7GcU= 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 1751140810530252.8163579774806; Sat, 28 Jun 2025 13:00:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbgX-0003Gc-6K; Sat, 28 Jun 2025 15:58:01 -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 1uVbgQ-0003F7-4V for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:54 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgN-0000Ja-L7 for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:53 -0400 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7d3f5796755so313449885a.1 for ; Sat, 28 Jun 2025 12:57:51 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140670; x=1751745470; 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=Sh9BBAUKCRRchEMhh1wAwvgv0ZLAu/7PDYQAsn4UYuo=; b=xtji0o9g2QIap+pTOo3RrOD/dUObhvUSznHsvHdeWMuvybGL7sFklEwubHwvTE3tt0 DEfV1YqrvvHSCJ1MCzns6nmpU1nAM4G/aNJ/xUuuqW3zDDIUlnY8FcibZ6zoBSm4mPmH 4mLIoYcYmYziNTQUNbzSg8AGQ7Ax5cMLSXCQsqPczhBn80O5pOOBShHut7el4ONfE5TV VYdnS8zc3vuN6W7ksDQj7M1DeeGaZMrN4KMDoKxCjfSbihDcOMem9wH0p4ERLJiaXSct +vlf7ru4BXe0/RxOmPgytyny+1GISSBe1ED6/NLpsFEEccp7NjTrAy3F2uid0yx1IXHG +YaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140670; x=1751745470; 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=Sh9BBAUKCRRchEMhh1wAwvgv0ZLAu/7PDYQAsn4UYuo=; b=dWSCXl2I8Uf+D9I8T8KV2F7SsBgUrXp4UB30o4FTpUR4mdIJk3bW+vV413X6cFmSaD 76YfzEutju/RdmWubKdxtdL2f7SiE7RUucwnYkdRtBzIHc33MOVzYLN0feIUKZL435GU 9omslCmto62FTmj91Me2Tml9ZwsLgrLEauOwMPLmyUDpre/8IEVcTWNmL2EvR9y55J1k iY4PlDe/FuOL4GwqmAig/sIVktVBDiLVjaJySVqTLH7ViXyJTKEtNdF02S/l1dZrOD3V CaomOUSqx9amrCq8Dq7yT3XoQE6KzO+IbzEOMayPRlu5hff2bMn7c/w7atAspX0u9w3i yvtg== X-Gm-Message-State: AOJu0YwADLePxeZrw4wGVopQxgr35R2lgzpoxvnEDnkYxBpMqB3WoAOa VTLqDkG5Qfg64zjRqi8wvBoZ1wCJLsDsO5T2Yhhz4OfYpGF908JKEvH7Ey0BRhoYiaD+Z+7+qas laYJ2 X-Gm-Gg: ASbGncvd5J8NQpKLk1V7nzqM9mmN7XJopqWu08bpZTXQwcUcj/CVwo7AbQKJ7QDFkY5 5Z51G3DsKIru6rXUTegPTbgGUiPnMnv3LrRxKaiTvbkp2kusE9TInbWfOlC8G4KovnLQK5hJ6Xh 2sdbzg/NTIk6ogByfuyrAO2u2B0gC7dzW9K9z77KQ2zb7bUG/ECCi4fCoZi555sQ95PbWYPcpDi UUDHxs1V7XRSkwApSIShwdmn+5wBay3kQFyWCIa0nTgG/Fx/r9yPTYIRcZGIJWbbUEmSoNQVkkY Vim69FXRtQYRO7Eaxrv7io0jbOFYErQIm0NffNYIjb3ekPzy5pN09KgwSiX4yvfN7ENP5JOVvvp EEw== X-Google-Smtp-Source: AGHT+IEokQlorS1v4Gz7zCFH/PUm0ODxAYiyCE6aFtz1gJB0afwNAjlfXOvvrvcQgadQe/yJmqRJ0Q== X-Received: by 2002:a05:620a:4541:b0:7c5:4b18:c4c3 with SMTP id af79cd13be357-7d443979161mr1158238485a.30.1751140670338; Sat, 28 Jun 2025 12:57:50 -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 v6 2/9] hw/arm/virt: Simplify logic for setting instance's 'tcg_its' variable Date: Sat, 28 Jun 2025 19:57:15 +0000 Message-Id: <20250628195722.977078-3-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::734; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x734.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: 1751140812848116600 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 99fde5836c..6d9256a525 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3342,12 +3342,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:51:53 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=1751140787; cv=none; d=zohomail.com; s=zohoarc; b=lXLVyTE/kqzE9PNt/1deYxXjbEv6sZcr7JWJEZOF5Wj1i36xYBMdP7FkW7skQFz7YNg4zs4orzvxVkfoavm/AGmqb2LgvjGyG2usYANqI+bhelxj12maqEtLBej3GvqSHp0x2ajQH4oOMLDD3swDu0kBYRb4Ue0feq+xeNFbTrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140787; 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=N8RNDG58fu6VATaaftZTVcVDja/cJV1L/ku3KjsPqaI=; b=BnzZf8LuM0on6sTLb+FE9EWqubtXrcKUENmYuv5rPGu7S6BDvjyf5W+H2l2VOe41cJhsduYI46wmf3s72w2KYc7KXq4wETmeZ38Vgn7w4wF+Xmv62ICN2yR7pyR7r69wujbw87TT7AgSC4J23OvpU8ULdos7JB9u/SxF8rfKuIg= 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 1751140787723595.8736304205992; Sat, 28 Jun 2025 12:59:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbgZ-0003Hc-J7; Sat, 28 Jun 2025 15:58:04 -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 1uVbgS-0003G2-SX for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:58 -0400 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgR-0000KP-GZ for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:57:56 -0400 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7d41cd4114aso558986685a.2 for ; Sat, 28 Jun 2025 12:57:55 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140674; x=1751745474; 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=N8RNDG58fu6VATaaftZTVcVDja/cJV1L/ku3KjsPqaI=; b=LJPw4U0qZNt2wInZ7TZ/vLBYrzQshgE8sMdehw+RkXq/u/EsAIG4GBk+CjZZp8jliq Mx0mvSngDavIe/hnsaLb4Clii1281Ixkki2rkMPbKwvbLi1xaSgv5PNpFTpzCvIhJzeq 7xcEbhWub8ltNb2r39C1UITGshc6BLUFX2HDShLL0rkh28t0V6lrt35PNjkCdTcLoA/9 T7eQOHCf4w2Vj6aW1sYCYADxPG1OfmeeDthledwWC1tbzgOhrKS0BBrte2WmwaQBqEhQ ZIFSbn8FYOXlXBdr3+earcBjieBwJtlspHmnYJ5VPknWuYsSH+dWoWxG/MnsN3EQ5ttQ TITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140674; x=1751745474; 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=N8RNDG58fu6VATaaftZTVcVDja/cJV1L/ku3KjsPqaI=; b=pC+S1bZtyGE4r35WKBmQGIV+zRqGYX/Ucwu9AkXoezcSC00Dc0YNg16Ac+31AOIbjF Y6tvapOnUGv5tmmBy0YbBQuodrFE0d6iQJeBVKd3WKDzpwD1oehJeoL/cxVfOIb4RMe1 HmfP2JDIXEgd2And/f2Cb3DMBRvzIVZD8zA93P8+hFf+erjohjXIczrpmjJjqcpPUae+ Fssz4m1XXyTbrYyGOoS9Vx3qjRRFZkfkiFbKg2gD1hoW3OYZr7lR8m0B0TwRJonhgmAf G7NeCBENfMuJO+MoEzZ93L2wYislviGAQogDYFowh5W99Rwnyannpdu8UpxStNETjmP/ mqQg== X-Gm-Message-State: AOJu0YzGcorSiwbJ14229HJ8UVzdiUXqpr8N5Y+MM74TFJ+jZVy5qWCM tEFAAoEQORQ4pC7WL2umC97ly3zuv//gyvCwaboM9/3MwBqybZMcANtleHz7YqqhLldC0OsWGPg 0PhwS X-Gm-Gg: ASbGnctUA3OnY7mtCwu2GVYTybrhxC+2ohDLx6BqBSQhwOZaS20ukbUZwJ31aa/Yi6Z SmONIug1Wr2UgzGMpUy/8XMrUefGKLsEvFAyktMHBX/rL60foqsgo3Y1dHpWKUWsGfkgq1Muoa2 E/hu0T1Z+kAvCZBqEB1T0ZBn3kll/nj6i0TMXC7qcsbbPSr4Hsi2PF5np+ZqPeiMDrOyrDUxjr7 UP4KLl3kdmOYmGqQbzafe/MHuth5Ceinqz1PJh0YWsIiRvQTYqJFenO0OKWTCYNv7yOHX1iijzu N4RGCPgSJ6UgW2HT3kt/fHh20LR6AjsLqpp1MdlIxNd2cvRQj31rBd/rqTQxx0fwHj4= X-Google-Smtp-Source: AGHT+IGmfJpIieB66+GPziD/5Xt1TwlHhJgbB0RykGlKeLuCWkL+IVFNwDP6UPT92V+kq9drrhJXXA== X-Received: by 2002:a05:620a:25cf:b0:7c5:9fd3:a90b with SMTP id af79cd13be357-7d4439a6782mr1350631385a.47.1751140674015; Sat, 28 Jun 2025 12:57:54 -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 v6 3/9] hw/arm/virt: Simplify create_its() Date: Sat, 28 Jun 2025 19:57:16 +0000 Message-Id: <20250628195722.977078-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::72b; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x72b.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: 1751140788466116600 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 6d9256a525..ae419e8671 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:51:53 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=1751140736; cv=none; d=zohomail.com; s=zohoarc; b=Yc6clfxeHMkUqfOBgfNpPQfJN3/xswsMS0R1/EWj4wQ6zwEaZWlMS8WeJHPJnaR0w3hKE7VMof2kF4S+wSgIpvRuounSgjQ3avrl17BJvvIHJvVzZuN7uLozmNE1I3Ma/atLm33YYAbG5BjaZ438j30WXZfAf/TlDYPRn2wvZLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140736; 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=8eAh8MiuuyXhzXsKk9pEAPJvTRcVqDS192gJR9vUnNw=; b=MrT+IkADYQAcY9Cbfimk4FxlVIeF0EZVXv6biA2YG3lySUnzwlTb0L7jXlnKw4u8Oo1YBEYtK9b+br9qaH0hp0L/lr4oWYIxWSUp1LLIbEZXYQxxICTzUN8YzxABEatWMwBuJFirYOnUA3qaa3SYKNVL9KB2CPXnkhMxMqi/YE8= 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 1751140736004457.49872840648027; Sat, 28 Jun 2025 12:58:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbgg-0003JE-OV; Sat, 28 Jun 2025 15:58: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 1uVbgW-0003Gh-P4 for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:01 -0400 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgV-0000L2-9l for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:00 -0400 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6fada2dd785so11569366d6.2 for ; Sat, 28 Jun 2025 12:57:58 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140677; x=1751745477; 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=8eAh8MiuuyXhzXsKk9pEAPJvTRcVqDS192gJR9vUnNw=; b=vynyTJnhesdfkw4RIv6OOyHaWIeLgw64XLlaenvmy2pZbLCXNr6teCX3dhVMfPOspI 3/JDYx1P0PQXhbjaNw2VV5okz3SHoaMQFCVqyKzbHgrFT6DyJ523S/hc/Esk4jg4gbhU cTZniXdEATcXok4AEge/t/wq1dhOi9leHus54cPkUWOjzKipTEr6akFjKZnaiuNOEgiE GjrC7W04ab5s4NMZbKE0KYDKx+tC2znB6U19izcizMYvvYtPJfbx0XNxm551Pvd+7s5P F2e6hzr4UHAnILvvkrCvaVlKTD2WTQ0JuGUn/Hs7ctLiGChWG0xjm3fHn8YlxaumpCw4 AXOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140677; x=1751745477; 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=8eAh8MiuuyXhzXsKk9pEAPJvTRcVqDS192gJR9vUnNw=; b=Sc6jLp2aJCkzWiTuwT/7YJvJlXmpChrKbtXnqrnrEw5eE3iQQ+HOefqSSjaf4N+Ttk KOR1tZEbIS/ImRv/qiKoRDPxsA1HV+msR+qTnrVFmuTuH/A7FqtNjQ34OJbwtqjfZ+zL E1q17WLX4OkCgZSm2xm7lRMFT6heJHSUYdBmiY+uUdmIz928N7/EVyjOuznwRakKlvml hzvXVFzmmBuuszg1bPYWJPyzpCDv16FtIr0BARyh4Jvmc25f6duzC7GtwM9BZnvSyOHr 5dPriJ2OODQMptvePFt+GRM+DuZ4LcHbTQ/jhwwikkXl0Z40qHMe/yRul+GcRmUWg/DW jPxw== X-Gm-Message-State: AOJu0YzyDpQlnW+eodKW1h+905cUYBPCgWYLPMaPpjvEnXx/1VgiDwFo qnJuXhCwb11IH4PPtqZaUx7QUQVsID+MBIF+es8goLrrtXMDKpaGUzserHkaCD6a2QECmIy+7Zn wfw5X X-Gm-Gg: ASbGncs5yZ+DilPdQ3Nq9ORnNraCBamkz0d73T0bgvqJK1jjOh+289oUSDL51/lQC8M jUlPulj8778jVpYQfaV5RlCvZB3GH/jINeJ2pLXMgqhWb5FlGV+6KxGhrZLqAXhCZbqD2uCeco2 ZOsHqkdGM1OxvUMBdJ8PNaCFKdpS4Ex/eJEU3NEcHtTBOdAy/m9VmOc+P01sqivDwHw6dVQxpgH bSaxHk5Mti5qSXuGInXRSZqE/l9Y2RmHcf/nZ76TSIvj7VTZJThXvv4K9QKUgkJeaBOElGdF07R Y/fiZ0e9uLshN1Su0skz0/dtB0vI2/a3KmiwirLiBZD+lRIpRDPgbA1IoHxr6/NNVHo= X-Google-Smtp-Source: AGHT+IHJP6tbB95365DUQekapZW9P5PxX4fgVY0oZtXDgrSxSVBZgNQE0vxs+xjxa4g3bEGlcGAvfw== X-Received: by 2002:ad4:5ae7:0:b0:6fb:5559:b3d1 with SMTP id 6a1803df08f44-6ffed7a54ebmr109996836d6.1.1751140677531; Sat, 28 Jun 2025 12:57:57 -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 v6 4/9] hw/arm/virt-acpi-build: Improve comment in build_iort Date: Sat, 28 Jun 2025 19:57:17 +0000 Message-Id: <20250628195722.977078-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::f33; envelope-from=gustavo.romero@linaro.org; helo=mail-qv1-xf33.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: 1751140738117116600 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:51:53 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=1751140756; cv=none; d=zohomail.com; s=zohoarc; b=kfKUmPEJClpq84uTVrYnTO2MGzKVq9baBmF3TKaKQcrFfJkvEk28/tYJePixKikCAftMdNcLQernU+X/JeLd1t1n2PmUpNs76jsAtvstvoQ+RmyG6iUp4snEo1eUDmBhlPs5FgYF5wwESZCN+1I48LYnaNATP7ngKmdJQGHgquQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140756; 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=IZ0q9jw4G9PIRZS2vkZv4PVRsiR5/vYw1c9H/9K2wA4=; b=ZvOPMoKuPkxvnIgxykguLNlHO9QzDNqXBTgpHhih7V9QgXrnD8MMpuks/Z86dLckQLEObRElpIt3Zka/bB6M91BTMNQWocWeIbcseZ/OpXIKd14HXEeRvv3Vo9X19ItYVNXH/dwHXB57aV5o6i0gtgAVrcmnUqh29+cRKCm65PE= 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 1751140756002321.7827925916205; Sat, 28 Jun 2025 12:59:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbhC-0003bd-U6; Sat, 28 Jun 2025 15:58:43 -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 1uVbga-0003Hw-3L for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:04 -0400 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgY-0000Lz-C6 for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:03 -0400 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-7c5f720c717so440672185a.0 for ; Sat, 28 Jun 2025 12:58:02 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140681; x=1751745481; 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=IZ0q9jw4G9PIRZS2vkZv4PVRsiR5/vYw1c9H/9K2wA4=; b=Baqn0cdHMS7wIq5hvdY3FazYk55DXymUoc5SGggUcOl7qlg9pJtVAc09ntxlUkxgpa AlfFyUZmJZoEfZZscx84dYU5hJ6ea9jHMYcABuM/9rdr5sO2KplBgVAAcFhmgtekPfsW Cn9p2WEuzGDN5MJn2SROgwE6SMCUONFcx7uQRlUQdl5qhvGBEHZM/KjqPou62O5EXBEe 6dras35G75sH30ENUklZjwItJoc8oSNm0c45sTiS8Jl99zCWZNEI+XYYurzmPKTBGnOb XVodVJqBAejz+gGafqMLxrbF1ER0KKSaHk3utNZ3zxLPcGiM+sX/BBSTJyMiUZf7hpFq sQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140681; x=1751745481; 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=IZ0q9jw4G9PIRZS2vkZv4PVRsiR5/vYw1c9H/9K2wA4=; b=fjT5ko5rukwxJ8uIJ3eMiwZP7Qebl6fxAHx2r+DueUJLUALY9WgLMwy5LHnwdsf8Dd 3Sg6Szo8+3e3ECOAsu9V+Rs3ITUUM4azW3XpwAExXLK+hOVPVrRR4qUYgU3zXV/O0S82 I5bjRMSJ0TBReoQ2Ag4olG64rAKuk99imGJw/L+oZ3DGWte5QPHc5ONjAJIuoWZCmW4p OOkwJbI5KFjCWSVvCDfHm+8Bi88Qt6yVMbsL66V3EkPHbAjUt3dfPwO6S/kiVu077FU/ GaEPG7x04Y/xaTI6nANlTRxZfLTG5XxHwRpEDmu8OTJsVF2XoxcPrzjgbjjjCXiAFHPW BnIA== X-Gm-Message-State: AOJu0YzAP0r9J8R57LnuN9mKNcYQAwO2V6/eEj/ttieLGPPxtcdQcxeo IHoet/jN2ZS0preXxGt3jLhbeZmW+XWDGQYdWaXI27hqzqXqnmaXagEZ7blk/auk7aX72mmyvKR 7s6Tr X-Gm-Gg: ASbGncviVec29N4/wex/eE3W+qq/7c+oUcROnHc02HNa99WPSsajKaXBP5/v1vHZlm4 A6QdZWVIRTQ50YmVtNqD6cWQ2cZ2lhJ2uzs9L4N1Pu1udMsXxs2ekPzUwwRAwlkPeq9brhwTjZR K/OsHAQVl09t/WgD3fVHmL3f9X4lhhOxhLle77Bzn/Ztop7wS7m/Wb10swmObhAhZWr2AZaYPjd tsIZv6Cdh2IrrHANSdtRd+y6lGel6kVp26MgS1a6qe2KXnw0JTze1+WRSRfFX5+Z1xbOdDZBqC5 pilb9Pj4Y6n7Qea91wh9NgFMzhj8Wxd6+NDeCYanMcE2S2tcVC/pScTZa9z3IbpTEnw= X-Google-Smtp-Source: AGHT+IG4kQzHVpMljhTiLVw6pgmFfn032FrbS3dfRfKmC+Zy+u7kIBaDPSgF2cKt5yrgUCiiivbGXA== X-Received: by 2002:a05:620a:1714:b0:7d3:f8b8:b1ce with SMTP id af79cd13be357-7d4441b3c5cmr1022339285a.27.1751140681150; Sat, 28 Jun 2025 12:58:01 -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 v6 5/9] hw/arm/virt-acpi-build: Factor out create_its_idmaps Date: Sat, 28 Jun 2025 19:57:18 +0000 Message-Id: <20250628195722.977078-6-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::730; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x730.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: 1751140758093116600 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 are directed to the SMMU node. Suggested-by: Eric Auger Signed-off-by: Gustavo Romero --- hw/arm/virt-acpi-build.c | 65 ++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e9cd3fb351..068383f982 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -266,6 +266,43 @@ 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 are directed to the ITS Group nod= e */ +static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps) +{ + AcpiIortIdMapping *idmap; + AcpiIortIdMapping next_range =3D {0}; + + /* + * Based on the RID ranges that are directed to the SMMU, determine the + * bypassed RID ranges, i.e., the ones that are directed to the ITS Gr= oup + * node and do not pass through the SMMU, 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 +313,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 +323,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 are directed to the 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:51:53 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=1751140777; cv=none; d=zohomail.com; s=zohoarc; b=VTQKYhPghFu6kgnmiaoOuZECoXZrE3Jox6gzMi2kWrnbZjI0oqbonjGdSrCoYs4LJDsg3HUm1hJ3XhyLO8yFKD24w62+XxezgavKG0i4OIQe2HATBuw9pgR4cjcevkVzWxYH+S9Q7pqBwuDBTz+WNijckYavzajok4AoTtvlxX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140777; 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=lB7c3Kr8+0cTXK0lkJO2kLrKNcdVcOOBVGzv/SMQzE4=; b=gkG5JsJ7rv46ZlmanAz9A8sD49DTPC6SQC5X4xTJjRN1hosdD9SAQX4uWgoc8R/moEdifUHfABCI9bji/8PjjrZuumnn9Xv1TpN7WkPZW6yIzk9XxX33EakyQv79jdlhZDs67x3x6JewIu7MKpuOait3m6iBBCO0Jqu3NFZChAY= 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 175114077726731.60697514670028; Sat, 28 Jun 2025 12:59:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbgu-0003La-5f; Sat, 28 Jun 2025 15:58:25 -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 1uVbge-0003JF-Fw for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:09 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgb-0000Mj-St for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:08 -0400 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7d3cc0017fdso95385385a.3 for ; Sat, 28 Jun 2025 12:58:05 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140685; x=1751745485; 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=lB7c3Kr8+0cTXK0lkJO2kLrKNcdVcOOBVGzv/SMQzE4=; b=OI0jXfhZSqCvpNd60AQ6c3GJVtcYj39qNckzK/LHeGBNoUNH0zMgbjVwvV91b/C09T 6f/YH5crkH+qCWXUBu0V7l2M799UsBdibQjImLmS/7/yTbFGOJ06b+bCurBZ7+oUOHQS 3M3jiu2vif3UKkt21mu12mUa90EKgcb3tq09pLJ/q9SlftAc+KO1FoYQZyv5Erst6lxs vR4dM0U50Fb4CBXv+UmgNgnzzzAK5MstBG9h8W60N47JUOV9dlf32rnwr1oN7ozw+dN3 w3gpR8Ok2aukVMtBrIiUECaqMBTdOOLsaZPjdUFCozN7JbUAypRJzA58iOS3f3vC8QbS VZOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140685; x=1751745485; 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=lB7c3Kr8+0cTXK0lkJO2kLrKNcdVcOOBVGzv/SMQzE4=; b=LE8i1o7RJ5Cr3UphFEX+8yjqIemthGB6BlN3jzPnzUwLYLK7sFtBcH4Yw7UxiVfxu4 LTXxvZH6uc2idjYMZDrCnCuk2X9CncBHb+JwfxTf3pEAazIR0kbQkJZs+6s312C6mkwb DaSOrbu0XSj6n1YTZH6k2ZCQhaejJlmsw5xhWZ18mbOegnuvA4K7WALkDS4Ffzr/RqR4 lPW3a0nEc0Q1cd+O72qAx/YiWqOBkDeKC7dxFQ5qEx8ukaKj4G1jwrm+ezBgrZkw6eCb KJGerugoDhpD+9QBoi/l7J1WJCXr2mvoFXSGk5S8cumifvwG4C9rXTADf55Ge1g1sykx V6oQ== X-Gm-Message-State: AOJu0Yy8fNPbQ9lyJhQpYy0zhL5oOUwr+hiqrJGOxmTQlO7PP122E8Ag GUMVhqcbbwkZC4bFhqVNYg3f1OZm7YP1SMJse1yJZF3TS2JUbH8M8T0raAKhQ4N5wYqELadpoZY vfsxR X-Gm-Gg: ASbGnctkbNCtAb6PSKg/MrufAjARqx13CZ8eebsuvbRtbsdQi9DwAji/GaAo3HDP3BF YYJSwr/u9yIwsl54hPr353GV9KhHrvXRxSQ8Xkas1laR/jjvAZbD+0dJJJZkWaECJLbHKOkkCpS byAScP6RhNlAdT/NSjm4VPqX/UG8BQNEK7D865c70t72b8HhjKRAbq3XbGRI2r0bCNV/atzCu2n xq1vZqevhMpvwsMrVYY4BJSKg9+rTTYPNxuW/Sbjmld59RJJab1E99L7EHBvtU+eCR4E0aSJTo5 txOVJ8zoMCGljmOP8uX8qda5Xw6hLofVNQ3oMhGlPKRm/1RWi1EB8Ihf4t4OXAY9Gu+hJuZuVOg 9lw== X-Google-Smtp-Source: AGHT+IHnu3i6MW3fE35Bkn4EIlOIi/1uoVXmPZ+BBcRxKbR1IdEgKhrKFsVr1ba8qeD9LxLpJtKZgw== X-Received: by 2002:a05:620a:410e:b0:7d4:492a:31fe with SMTP id af79cd13be357-7d4492a3caamr850917385a.52.1751140684680; Sat, 28 Jun 2025 12:58:04 -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 v6 6/9] qtest/bios-tables-test: Add test for when ITS is off on aarch64 Date: Sat, 28 Jun 2025 19:57:19 +0000 Message-Id: <20250628195722.977078-7-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::72f; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x72f.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: 1751140778317116600 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:51:53 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=1751140756; cv=none; d=zohomail.com; s=zohoarc; b=gsfqMVY1bVVxyCvFIxLXzLsGnqeYfTQTPyPRO2FAIhTA5Mmz8K/6IROEnS8kcBzjat56HTm/fvmW2GvXqQ7tQzbO/v7W8lMwp3o3+kw5A2sd+FtRSofelvlxpMUFDfzsQUV1nfav0VSMUKNnYWWr/xjAxpKh5EMNAoeHdQmoQb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140756; 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=S7g9XFWnfzGYdtG9eO30qdCLeubFFbQCho6PAR5JyHc=; b=TppXdap8cKp77dvzxpkgl/cvseGNW0suTNHpJZ3fbPRqZo8LiKsOc4Dk5Xu8uZ/CU0yyd/8fYkUckzJzDjHSdK3PCNpkDrHVSmP+9KgKklWZRVmxoz8v150q8Nrj42ob/xTbJdBFKmhm/tIL1RBr/OhL3kx4PP7fcVcVi7Ab0zQ= 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 1751140756160748.6050407124918; Sat, 28 Jun 2025 12:59:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbhE-0003d9-2p; Sat, 28 Jun 2025 15:58:45 -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 1uVbgh-0003K3-JC for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:12 -0400 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgf-0000NM-Ph for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:11 -0400 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7d3862646eeso51802285a.2 for ; Sat, 28 Jun 2025 12:58:09 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140688; x=1751745488; 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=S7g9XFWnfzGYdtG9eO30qdCLeubFFbQCho6PAR5JyHc=; b=XUCfQOpZ0rtZY02PwRrWrHWpNJluBtl7tXbyKS3VTT8uvkTNx7tEWV9lea9BVBWrYj yrjzEfgHQGXh7CRaD24GX1Y9PZU3/RxgpicZSLvEfScmveuy3btnQAREOQVykXShF7xb P4NlRDiSq27Wl8xGNPLVrZBZUGGRHSiX+MP0+0D4WXrr9aIRchGmyVYRDKuc7O5r4Nid UGnS51aEk4tO3L3CudOi7e3/3Qr4YGa1CPtMSxZn9zJVjgy1ui9DwdQ28RedW3Zb+wwg K8rJgAp138K7140o+AUr+V5dSrvxmZGT/lUsdFwt1TIMK1AKXFYV41qan+4kAxzneUXZ Zz4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140688; x=1751745488; 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=S7g9XFWnfzGYdtG9eO30qdCLeubFFbQCho6PAR5JyHc=; b=l9ORGybMIVJ4wf37pJxp4TM5i4BGFcDtMIQK+fchqtLeRpdpmirW7T9sVX7hpd8FkP zn/MarcreFzFRtA8AhXu5n2cWkBi/LUthuv8oavPCl5itwXidSyQWTJchrwoOHt/W0Re 2pG9nuIg/d5H8/LJ1HeSh+VqB+sMv9QfgMpCLIX0W4jEB63N6Aklr6GY3nRJI7tLy8nO Z+YVwf6K5/pBzrKaMCpnfBukVz3tTdYX6QnR3YNGh/aiZQFfvB2G8ZB7/JbS6Tp8Gn4X sy1tVayYmHBa08LVKfiOlYYlfznT6aXcux0vpiAVW4NZzQKelnwtd+3xbe1gcLZZ4osx G4Lw== X-Gm-Message-State: AOJu0YyUBF7NOU8jckpH/ZeoMoYDYNArTzyxyocnzG8qwsLx4b3W1juv D9RmqKIH5kA94n57+n/a6desR9NcWT0peMWgUx9+e6GDvw+UBljdNOn8THJmlM9tHYVr8CHL1K6 4093D X-Gm-Gg: ASbGnctNRDZ5qwPhMKB1ZGoHoJfIxnBExTB9xYofDplBftcFMOJOpKp1CNq/zVxjEuS SfACw/E5n5h8JG/aw4AKE78Bw+84+4ZJFKGLsWNtjfJzaptUmB8rG2Ginl7hSBAQEkN+6vJevA0 di1YUwkT5mErokn5Lec+yR0PxcpCHNPVAO0mSFtLtlqnjwDIChqCr354qmyzc38Oo+cLwj3mq2r GfrAKsYcIhyDJTmBMwDn64C/C6MKPMRaQ2QjAHrBBMnyTuVlG4/EDYgnfESuC8GH3HbY5vh+dti 9X0pDlOSI3XVZOmUibxmKMTD/LE9VjiG9BbFpczDprokCsl4I8QuDmoVuu/d2kh56idm+J3OXAM Iaw== X-Google-Smtp-Source: AGHT+IHe1m1XqWlgEp+9JBx8+oms0rvN8AjXGw7eSC36Y2hq77Fxg7DXo8ZtFCENwBpqTjrxm1dW+A== X-Received: by 2002:a05:620a:408b:b0:7d3:9ede:3c2c with SMTP id af79cd13be357-7d4439e277bmr1079265985a.26.1751140688239; Sat, 28 Jun 2025 12:58:08 -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 v6 7/9] qtest/bios-tables-test: Add blobs for its=off test on aarch64 Date: Sat, 28 Jun 2025 19:57:20 +0000 Message-Id: <20250628195722.977078-8-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::733; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x733.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: 1751140758149116600 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:51:53 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=1751140796; cv=none; d=zohomail.com; s=zohoarc; b=FKKNYY6jpG0Ltg/YIUk/bvtFwq5R52FfGUwFRDSmHKT8/XUMqC9TdtrCObobGZ9PoL6SOMX4T3tChRYNZkaHje90A999+zdO1fcgeIIbyAEGRNl0exBPGukgySCQo6o+HHTLmPmNso/LCTZNQHMVQPGOwSOHpNTqmv2ZNtYmL6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140796; 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=9iUI8g8Bil+9iragaiojyrpbmKiosSki/uPno5KCz/w=; b=fJnDZy7XFDlcZYxzHb5kd/7pfw8a5isa2MdbBSnKBY4CLgk3DhsadkcznsCQMCFsS0iXe6oVSrSTYZdQtqZbmq3v+9xU+FsKP3SjWBlE7KNbfulTnREsn6ApIiLkMdGet9YFAspDOwrHkT0q3ITAmSfa5Ojgt+Kcy9+D0CaO1So= 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 1751140796799150.7812699902645; Sat, 28 Jun 2025 12:59:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbhQ-0003y8-5u; Sat, 28 Jun 2025 15:58:56 -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 1uVbgn-0003LE-1b for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:18 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgj-0000OB-A5 for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:16 -0400 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7d402c901cbso296703185a.3 for ; Sat, 28 Jun 2025 12:58:12 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140692; x=1751745492; 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=9iUI8g8Bil+9iragaiojyrpbmKiosSki/uPno5KCz/w=; b=wTUtHG2VmnSHH9KlvB4oWh18IZbPgdG0G6UoRy8e/aeD9V/XTnWRjyYNO7RbJSlh2j A0uRln0/z+03OKhSXVrFGRphLlhT08ARS4WtDAErCUfLB9eFKLucEVhKtTpDI8iUEAhm yl5lN+38PdCZkjuC5iJI7sIOnYcpRVVJRcTdoSR77mV4OnLHPTnEfMuNlPimX58/IHxA jqXNwGhdESTaeTadmQflyhS5NxIf+qES3wCWu0NsT2jkhh8OEe+bmM5gg5b322yR4Bgh 1O8XL49TKyhqcEdByhd+0la6ZuheIKgSQZnbT2CWHlIMpWtEUlNQtXoypa9/lBZ14nUq MV8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140692; x=1751745492; 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=9iUI8g8Bil+9iragaiojyrpbmKiosSki/uPno5KCz/w=; b=sy+nKbzjjCCxWeaoG2twtBd4NGCF5zwej76GM1P6XGBoVckZnX6a+kzvAI4wZS2qyO 8sxQi0tTlG+cBz2P0i/GDn56bN1SUMylhftFRN4Ln+fzCdfTkzHNOqW+srSedy6/VV52 wcTSR/X91oZrcCAStNS61eNCt9b9Z3DS23cZiue0dAhb5r+ZQyofVrHtI7SYd39C/EbV WE9UdaJSkI1urWPNmYI/1H4aPEhF4AJWHBaoHADSnrCR/1wLHRL6dUmdMaGnOQqrOwr/ yCyC0zmY+8NXCcrqCO5nbpbyqREhVtaySUGl2JhEI7LvZQLofR83zxaSgZsu3OSbhPc6 QmWw== X-Gm-Message-State: AOJu0YwZGGE+C+Myfu5UdWw/2VMD7ixK08mzxo+91u7blb3Vkx9fmGGp GwozdKYY4wtWIbYXcjXh26JFnxJUJkhmAUSZOM7KUBFRkqSI5948MzSM1zbIMYKy2jVjxqgU6Oi K+9Je X-Gm-Gg: ASbGncs/9shEgzdQXKWoeuBgr5T0TMOch52oXdUpXzM65vnbEhcJrdySIpl0YID9SjX SNLuILd/7YVZhsB5ISAa/AnihDMoaf/IUWcb8pFmeUCQL+mYBYPoHQqctqt6+VPjSfoqgJKxjLL puyMOXwttPtHTSlLngMm/xBNPL5ybdE0ktalyBjDhmgzO+89Lkyt6uP4R5Gokh1qWANfwE7jTTa t3GhElKFFq5Ur3kTcF/t80p1NrTNoEjIAz+X0Iw0LL2RSVOYVlWsJmJKp1gmZhOV6xbzM6raNqr 4BjkP8HxgjLYRcvnjVmejEG0Eo8IXa5khHU1mZH8CSL9Cl1BeDF+Eis4UtgInpO33T0= X-Google-Smtp-Source: AGHT+IG9bFzhgOx2iMfHeVmdUd8snmtBbOXOSZrU48jiPfGnUJmlnE7WLfbqzMUtExNZSSorlyjJug== X-Received: by 2002:a05:620a:4054:b0:7d4:3b16:1b85 with SMTP id af79cd13be357-7d4439a5fbemr1069895485a.46.1751140691820; Sat, 28 Jun 2025 12:58:11 -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 v6 8/9] hw/arm/virt-acpi-build: Fix ACPI IORT and MADT tables when its=off Date: Sat, 28 Jun 2025 19:57:21 +0000 Message-Id: <20250628195722.977078-9-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::72e; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x72e.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: 1751140798971116600 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. This commit also renames the smmu_idmaps and its_idmaps variables in build_iort() to rc_smmu_idmaps and rc_its_idmaps, respectively, to make it clearer which nodes are involved in the mappings associated with these variables. 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 --- hw/arm/virt-acpi-build.c | 142 ++++++++++++-------- tests/qtest/bios-tables-test-allowed-diff.h | 2 + 2 files changed, 90 insertions(+), 54 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 068383f982..eff0d698df 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -267,7 +267,7 @@ static int iort_idmap_compare(gconstpointer a, gconstpo= inter b) } =20 /* Compute ID ranges (RIDs) from RC that are directed to the ITS Group nod= e */ -static void create_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps) +static void create_rc_its_idmaps(GArray *its_idmaps, GArray *smmu_idmaps) { AcpiIortIdMapping *idmap; AcpiIortIdMapping next_range =3D {0}; @@ -314,8 +314,8 @@ 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; 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)); + GArray *rc_smmu_idmaps =3D g_array_new(false, true, sizeof(AcpiIortIdM= apping)); + GArray *rc_its_idmaps =3D g_array_new(false, true, sizeof(AcpiIortIdMa= pping)); =20 AcpiTable table =3D { .sig =3D "IORT", .rev =3D 3, .oem_id =3D vms->oe= m_id, .oem_table_id =3D vms->oem_table_id }; @@ -324,22 +324,38 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *vms) =20 if (vms->iommu =3D=3D VIRT_IOMMU_SMMUV3) { object_child_foreach_recursive(object_get_root(), - iort_host_bridges, smmu_idmaps); + iort_host_bridges, rc_smmu_idmaps); =20 /* Sort the smmu idmap by input_base */ - g_array_sort(smmu_idmaps, iort_idmap_compare); + g_array_sort(rc_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 are directed to the ITS. */ - create_its_idmaps(its_idmaps, smmu_idmaps); + create_rc_its_idmaps(rc_its_idmaps, rc_smmu_idmaps); =20 - 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 rc_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_rc_its_idmaps(rc_its_idmaps, rc_smmu_idmaps); + + nb_nodes++; /* ITS */ + rc_mapping_count +=3D rc_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); @@ -348,31 +364,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 smmu_mapping_count, offset_to_id_array; + + if (vms->its) { + smmu_mapping_count =3D 1; /* ITS Group node */ + offset_to_id_array =3D SMMU_V3_ENTRY_SIZE; /* Just after the h= eader */ + } else { + smmu_mapping_count =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 * smmu_mapping_count); 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, smmu_mapping_count, 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 */ @@ -388,9 +416,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 (smmu_mapping_count) { + /* 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 */ @@ -431,24 +461,26 @@ build_iort(GArray *table_data, BIOSLinker *linker, Vi= rtMachineState *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); + for (i =3D 0; i < rc_smmu_idmaps->len; i++) { + range =3D &g_array_index(rc_smmu_idmaps, AcpiIortIdMapping, i); /* Output IORT node is the SMMUv3 node. */ build_iort_id_mapping(table_data, range->input_base, 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 < rc_its_idmaps->len; i++) { + range =3D &g_array_index(rc_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 { /* @@ -460,8 +492,8 @@ build_iort(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) } =20 acpi_table_end(linker, &table); - g_array_free(smmu_idmaps, true); - g_array_free(its_idmaps, true); + g_array_free(rc_smmu_idmaps, true); + g_array_free(rc_its_idmaps, true); } =20 /* @@ -769,18 +801,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:51:53 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=1751140759; cv=none; d=zohomail.com; s=zohoarc; b=UShN2TTyTc4468vXS7XGauroTpjPrdmunsgZOUzZWv8B7JK4jytmrR1nch6f09RRkweiqUZNDqcGMxmzkVL1wM1+s9EXPbfgi1Uw0r03OumTqjVKTYkj/AnlduboveV79k8yZg3m1l2GwgVGj937fI4H0c3nTuSDw4iJ6gCxHlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751140759; 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=+F6nN8jVuJ9x9ikMI93e1pxkuyZDDe/xC+x/t6zowT4=; b=RvIs9Am5a1LQt6kcZYYvEGeX+K6aBg/1HMVRZSubKoOdoh95PbE0DedhVN/l+O4dmm2bWk5AhTG72XGybdXPpZUEHTS1xoU6ThdDJ7JImveMAJDk9l9y5o35oUImYJjXOpb3/rHPZh20xVSUfmmI1NsBWiaPzGyfcevA7tbkMTQ= 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 1751140759410748.642060418572; Sat, 28 Jun 2025 12:59:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uVbh3-0003TD-Ki; Sat, 28 Jun 2025 15:58:35 -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 1uVbgo-0003LL-JH for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:18 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uVbgm-0000P8-QL for qemu-devel@nongnu.org; Sat, 28 Jun 2025 15:58:18 -0400 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7d3dd14a7edso141983785a.2 for ; Sat, 28 Jun 2025 12:58:16 -0700 (PDT) Received: from gromero0.. ([186.215.58.88]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d443136907sm334395585a.14.2025.06.28.12.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 12:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751140695; x=1751745495; 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=+F6nN8jVuJ9x9ikMI93e1pxkuyZDDe/xC+x/t6zowT4=; b=QvJQIi0LYlts4Idm5czlUjI22CIbKklXFkl2UUjWAsHnsAhyVlo6zw/RyotC3ZJ4dH /mJu3uTge0xa3oBvYoRhInyLcb6KUaJsqdBPbj0YYM7Kg2cH7zeCxxJVg7Vg5yBpBg0H vDQMZcv6ATA5nwLi7e9zAmegnfBVRCKRJU1aTC5D92ldidYuVjJINkrduzUldeTiyWFZ nfH4qxjgPnBAhbd8lFuGxCWHug3w8idi+1wFwYb2kiewhlfoyctgW1/boDDmUfGCyQYh 9XBBlxN7u84D3PyETOvkcxHFrek/XHiHHxRGSzJLUqN5E77eQYIqmVhIvP3GeP5dhcai asnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751140695; x=1751745495; 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=+F6nN8jVuJ9x9ikMI93e1pxkuyZDDe/xC+x/t6zowT4=; b=QyQmiBQkbWKuWOG7tnb/uoO1FlhiBTNpBru8RHEEfsEUg7WiNfmr6DPYOAWW1eJwk2 zeU+f32T8Naqf5ucjukBVujJ2pKjy2wb2+t94F+lQjMZIxJX7C+0lDuZf15uMc2wRJp3 +7HAM0gLjv7aiDPQ74gk9KUHJggaW9sAule5rbT+PMQOwTmvwc3fxTDAKb0Ug0boKIfO 7yNYFu3/x53tqG/icgZ/8V9VCCA41VcEzwaSaF1Uv+vC2U2sumaF/2hUqAZyETefwcoF son8oq3yCMhg96UYtFdCi37GN+qUxk+mdVYVl7QUZ/7bf5CnZ6nD+3B0JWTU7jP7aN4j yRKg== X-Gm-Message-State: AOJu0YznFU6Q298R4UMz7N8SLU11X3uObQsB7cNVwk16cBO0kDLsQjzY jk1FzmrdsCnXnzLRFRWgB/8922LqMYz4NPw48g6YEiqLp3s3hzV7A9Ht+ZNOtr5WXUtg4rJYEZR /crxj X-Gm-Gg: ASbGnct2OHYKCt1qPqa5X5yYoHfu0zgl1e57/iXmedFcRXqN6+ao2B5LfFhfqlGKBbt UlT66Zd/2LlkY/DSIhsh/bYZdGdTeCMfQFCmKzKe7VLBofVPQXnJN879NlUXvJLuACUhzjIZvi1 k739DlDpx0SIKOQVZkds5rcQuzj6hc4FFk07KmMr01T/Vg6Ppwj6GMMy5Zx5YKitdtNWlbkwAPL YogbzARz4WqNBNAvlu7xiHCZ15Ia6kCfUxAxO9/13xdOXWPSE+uVKgrrKcOKFamwevC9r8nKwR1 xQgst6FgSxtnihniGrfd7PjkobQYLRQwZl4gos5+4TuMVKDMDNzfJesGm2pJF2rwTcE= X-Google-Smtp-Source: AGHT+IEM2K2QwZG0uMnpZVZqVPWCYCy4HGDusOH2tzw4wWfbrvz1DcFZ29qe2fqn5sFPZU6Ra8On5Q== X-Received: by 2002:a05:620a:444d:b0:7d4:4596:d6a5 with SMTP id af79cd13be357-7d44596dcabmr1050929385a.55.1751140695521; Sat, 28 Jun 2025 12:58:15 -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 v6 9/9] qtest/bios-tables-test: Update blobs for its=off test on aarch64 Date: Sat, 28 Jun 2025 19:57:22 +0000 Message-Id: <20250628195722.977078-10-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250628195722.977078-1-gustavo.romero@linaro.org> References: <20250628195722.977078-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::731; envelope-from=gustavo.romero@linaro.org; helo=mail-qk1-x731.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: 1751140760196116600 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