From patchwork Thu Apr 3 20:40:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 877956 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3469107wrs; Thu, 3 Apr 2025 13:44:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXrNQ1OmY6VibZ75dzKySW0NR8oNsCixUMaXXV+JDVL1m9yUGVPHaGak+FHkU6mvaqydMxruQ==@linaro.org X-Google-Smtp-Source: AGHT+IEK1r2y5IhDQx1cO61O7kHVCND9NKnun47vvMgHeA1TtuG91MfWTnp/7LIPoCI84TwOOupi X-Received: by 2002:a05:620a:2596:b0:7c5:94ec:5114 with SMTP id af79cd13be357-7c774a3bf73mr116887585a.18.1743713066099; Thu, 03 Apr 2025 13:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743713066; cv=none; d=google.com; s=arc-20240605; b=AgNFq/L1KElA2cWIktLZ1nD1Hzc2PXVVXbpAw7I52hGybnq1cI+Uqqr2XMDksrCsl9 UnyjCTdVpWY4bS9MTxdeS2irXnf/KBphODvOE5t4NjLLv2Ea87dBNjan0gbI2gbCxk44 mWALZNF3ksctXIq60+gRxsWdMtnldFd+AHgaH276v8YTgOiiUj1jeC7glu3zZdjoYeLb N+JAo15K/5pJIhr+wOUunetMhivyoCJQrw+8EIdOAMLQnA3BU7Ksqlgv8n7pvR6iMKwP RwHNY4GbKgO7f+H2hJXkXhFXWbjTY5Jakq37py5ZkdfvAV0a0TuAERetbMdG+PKLX2DY 4AJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wgBNy0vxL5goVE1RO7+eU01X51ted55h8TOUfbLYmNA=; fh=MyqIMCjZFHy0NzBnvXc8KFcCapThoPogDzLe5J0FgH4=; b=J7YkXFpMROSUSNi/0pdOxQQrWgxuMi141dXLwyqMo6Aa5M+dVTR2qHIjo2F5fiOCkx c70ba6LFGUXFRPSZTo9jjeZfIj/9W72puxqUL0uQvlzGLFK9FM1x/Xm9T17a6tAbh5Us l2SSZYajFNDiVlqNAkGdCeTaEugZF2FTFGwjk2ZEc6ii5isuwSo1MZLT2ckGO7IqnHhL wFTPzQMS268/Fdzm80Dh0+Cb7GJVEo83R6C3sTj8s/7/bIi4Mvb0ke+T43GCCKn7H1Vl /ZqkclqRSZRXN4zA9kKFyaQH4x278voniZMZ38H8bXVROh8job1ynWmXmLgcypdT644s hWtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H30ZVGJK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c76eac171fsi182625285a.522.2025.04.03.13.44.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Apr 2025 13:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H30ZVGJK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0RMy-0000TA-6y; Thu, 03 Apr 2025 16:41:00 -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 1u0RMv-0000Sm-5D for qemu-devel@nongnu.org; Thu, 03 Apr 2025 16:40:57 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0RMt-00053m-Bv for qemu-devel@nongnu.org; Thu, 03 Apr 2025 16:40:56 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-39149bccb69so1182100f8f.2 for ; Thu, 03 Apr 2025 13:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743712853; x=1744317653; 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=wgBNy0vxL5goVE1RO7+eU01X51ted55h8TOUfbLYmNA=; b=H30ZVGJKBcaaq2FOoqIwv/af32jtCU0el+/5zMVoqK1CvVmSoOZ/rxZDV7qXe/HJwV uTDpOZbQgmgimhkgNUbwsDxbgaHYkbxjCwWmEtPfTk5JB0SCSht0SX9F8xH3t6CbW1bz Uh57RKKWHIs+y0LqtVuAa3cLYjVYb2x1BI2pT3mUpElwKgxKvLX5vmBkGIOQpdYkxY7H 5inTP/9ZPyvKiNc8BhRwqR/796/vNZ7bePhMHPIfbcfdxqSVTg58inXEQnVs9poCUKeb ILlBUZAH9On7zsbXT0k0wKQqh+uvRduU8OqXP2C3Yo9eT6prVEWyjm1PdwguQC1SszAF Cn2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743712853; x=1744317653; 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=wgBNy0vxL5goVE1RO7+eU01X51ted55h8TOUfbLYmNA=; b=o0BFs1+5VDD6RKBDZkGqQu5EnQtO8iDjvgRYuHcJIrmzSpx0tG8FxYDQF4FBqD/tC0 xw7ttwlSM1CUi/bX7ttgRFm5cCXtmXUEgpL0a9g3Zd9yx+buqsrod7SaTV4unzi/H6Ic ADiDk292vz20ikuSTISl6w+EvsnqGscqko81oj7JbhUF8lNUbeOkD/iRuM5iEoiUHaJk w1MFrcy6pD5PE4b+rDWeIZ44T6jjiEx5lf8cN900ArXLNSM5X2Gjukkjky4v2cJruw+b wqNn+voyUEpJO0YyOLxIPdZBos6Smuv3KZlODpnoMAFS4Se1PnbHUErAqHXQw+R1onFj V0bg== X-Gm-Message-State: AOJu0Yx9Z4wLmLlLp9qZzeB0pxUkOn1AMHPrBOCd8V02j/GlSmN6lf4G O4HDrV14KEc8n2F0GrMKCDR7Q+u07H9Qm5wi1lvILcApq9zy0MaWZkwPrt9/C73aJi91Y9U3ytq H X-Gm-Gg: ASbGncuEDOgz0Qqz3VI3tekCzf0TPKTsgMAoRAYDRZOtUcknJk4qb+YNLiuNxBFc3qZ milSewcAQ/K7rU2c280mGa7t9pL1mp+mexoL0vgqJ7fd4C3Uq1a4lnXSngnk2V0nlcXWWfhq/Y+ VCDRGlpLBF8wxIFAeYzQfTpDVuiHsQUIl3h9/r35Ops4ifATpMwOiH8A2AtAO+SknXFrLsZIvN9 qhhyGaQEb98P2vWekNfF/Ut1DYgNv44UHkudbhsiTxM81qoIhKuW4iUeQPh4U54eDAaTgBAeyag Sk0pJxh6wi0gxTuDT+Fx2uLFZuyoxi35JyoFwS61Gsdu9QcwhbX94/aaf6JxoVMiNOVwDg9dGzj Z4/ojz2/5Ztg7eeUlDCEw4gqV X-Received: by 2002:a5d:6dab:0:b0:391:31c8:ba59 with SMTP id ffacd0b85a97d-39cb357afeamr595947f8f.4.1743712853197; Thu, 03 Apr 2025 13:40:53 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d92dsm2701086f8f.71.2025.04.03.13.40.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 13:40:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Andrew Jones , =?utf-8?q?Alex_Benn=C3=A9e?= , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Udo Steinberg , Shannon Zhao , Gustavo Romero , Igor Mammedov , Peter Maydell , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH-for-10.1 v3 4/9] hw/arm/virt-acpi: Factor its_enabled() helper out Date: Thu, 3 Apr 2025 22:40:24 +0200 Message-ID: <20250403204029.47958-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403204029.47958-1-philmd@linaro.org> References: <20250403204029.47958-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org GIC ITS is checked for the MADT and IORT tables. Factor the checks out to the its_enabled() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gustavo Romero Reviewed-by: Richard Henderson --- hw/arm/virt-acpi-build.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 9b7fc99f170..1c389ef5cdb 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -208,6 +208,13 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) #define ROOT_COMPLEX_ENTRY_SIZE 36 #define IORT_NODE_OFFSET 48 +static bool its_enabled(VirtMachineState *vms) +{ + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); + + return !vmc->no_its; +} + /* * Append an ID mapping entry as described by "Table 4 ID mapping format" in * "IO Remapping Table System Software on ARM Platforms", Chapter 3. @@ -670,7 +677,6 @@ static void build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) { int i; - VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); const MemMapEntry *memmap = vms->memmap; AcpiTable table = { .sig = "APIC", .rev = 4, .oem_id = vms->oem_id, .oem_table_id = vms->oem_table_id }; @@ -741,7 +747,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) memmap[VIRT_HIGH_GIC_REDIST2].size); } - if (!vmc->no_its) { + if (its_enabled(vms)) { /* * ACPI spec, Revision 6.0 Errata A * (original 6.0 definition has invalid Length) @@ -973,7 +979,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) vms->oem_table_id); } - if (!vmc->no_its) { + if (its_enabled(vms)) { acpi_add_table(table_offsets, tables_blob); build_iort(tables_blob, tables->linker, vms); }