From patchwork Thu Mar 6 15:46:55 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: 870864 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp335886wri; Thu, 6 Mar 2025 08:00:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUhuXynIRUC74JiM0QSw4Ji0wxwt6TwpPDCNFQaltJGRFV7oMEoDmQFiJM727qR2eyPMUyXoQ==@linaro.org X-Google-Smtp-Source: AGHT+IFRAOuMJuGAVHpYI4WYNvra6SeTGvw8gElEgzv2RuQS42/HyxxEPoCqOpcN8WN52HpcVF8k X-Received: by 2002:ac8:5f47:0:b0:474:fee1:7903 with SMTP id d75a77b69052e-4750b4481e1mr133708781cf.13.1741276800136; Thu, 06 Mar 2025 08:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741276800; cv=none; d=google.com; s=arc-20240605; b=Dk5N3v5Pmc3osRoPvb4FXEJcq1kLXoNepHL8LHVf2+S5U7V1Iz3toWPNU5hmIydxUc /i3O6NMsPu6EWnXf2853RUe6/1FP4dC9tieU2kF79EqY2zmWe1p+jQuBXsMKISSySFou VgT7Q02e2aJ1mA3S5/jCvIXN39MEhfraFXo9pmZY9VxUfAWByxcXaBt9LaBwLPtjppR3 bP3lmTVW5ZETBSIK/+54mC6auHY5QNDSHtcSC5pwlydNfKM2AuZiX7hx/osdI3qscp1P evKPsLPMHiyYCnZCWJJhk9vyfCNRX76BK6L3li1V+KI1r3O9El+i0YKoubiAk9KKc2UY +s/w== 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:to:from :dkim-signature; bh=JBB3Tbxqc4/M0bxYWwDzYqPlVpodl+6MXJuHVeJUQgs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ABaK+G8q+Bh1hBJyXrxAaaalQXXMYiFDDHoOgZG2RrwsYUELz4IJpVLKoLMwCJ0Htx bESxiz4PS0HhUiK+ojj4wgUV9NmMpSl3Qkbb1pkxlVP3K6ZsmqHrj36Xw5XjAR+vRnzo ri/FCdui22Ymibtj5kW3EITJfKnOxEevRv48tDu97aUXylQkioGorlgAQ0k0o7i337w0 ixuN1s3FgmpD/lnB3kztAbez7J6iop+CBf1Ub2kDHEM8liyvU95npIob6JdiSktHW8qo b53bUxFN1LiYlFOqcAbFTilXv2v6I4Nm95WY4Tz+4ZpGYWGF+dcwMlv2ebUPV6N7yK2p LkFg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G+XA9Hdr; 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 d75a77b69052e-4751db4279csi14357621cf.550.2025.03.06.07.59.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Mar 2025 08:00:00 -0800 (PST) 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=G+XA9Hdr; 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 1tqDTr-0001cs-VO; Thu, 06 Mar 2025 10:49:52 -0500 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 1tqDSj-0008Ga-UW for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:42 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqDSh-0006JP-9h for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:41 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43bbc8b7c65so9799555e9.0 for ; Thu, 06 Mar 2025 07:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741276117; x=1741880917; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JBB3Tbxqc4/M0bxYWwDzYqPlVpodl+6MXJuHVeJUQgs=; b=G+XA9HdrPUUxWNjjWtG4mVsTJnQqWuYIB7g+bCw5tyFgduz6cKYu/rqRjKYuvhw4Wf 3xav7ipEKQoCQZzjPQxIbPWL/uj5KpIgsNVJrh0NM4lAJ0VEZN7n/JSDj2miBeDw2k7q hc5NC5QuSRj8SDXe5ApJ7q2BLT7AppnTJBNX45XbSpUf9nVz8k6QaWKEIPItB6/miejA WDPAzocWVtM4YuWMH595+Tmxtxh+0WD+hOF3SOEHiNCL019utmyZRc4S1xW95CWttxm3 Ps83CBe68/7GO5/duTD5Sd9a4IF/5VU+zkLwB7iLimOEnnZHD3zMR9PNbmSx2CJdfNth ZEEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741276117; x=1741880917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JBB3Tbxqc4/M0bxYWwDzYqPlVpodl+6MXJuHVeJUQgs=; b=vq9BdZe9Iz1QRwWMq4QgBlIj7eG2wAbeHWIMOOUm3dZZC5gV4KN4ncj6FB4qtvgZx9 PM0prd+xE5jCmGMmacyOr7ztUFIYT5eb69+Z5VRc0wHuM9iSa+tGUIddYfOMEzfTTI11 QpXyba7ukoB9bH2ZYtw+YOi2e1w8Av2SM2wjUihZXzLnEfu4LZnH6XyldRUC/ZBXRk8s SCNX26TUcz5zbTOBnsIm+nKYDO6VEZGVGLe/8JtaSvFQHi+NV9Ie7CRWaacrQLm8RxG4 st8/fPr+FFJAEBbb78HnqDyHmsVt5BhVVsZ77Jn35aEDE86dxoLHOEiJp34Pg8fy12KM bSMg== X-Gm-Message-State: AOJu0YwvQvw52Z/Pq2/ZUtnMjV2f1AYP5vhfmE1frLIr8IHXsd3xXI7L +P3RchzHSPdSriO+qx+LvOgIedrphCAoea3fDeLVzy8tYAWJykq/+lujHo2qlmN5eldnp1rgNXp JTXU= X-Gm-Gg: ASbGnct/nrrk67RZllFyB2cgmiD65Ls+mifxN/yeP7oVIkt65ScCBULhu+8IItYD0N+ w48oY1b/5iSw++Dw3Fi4758Jm0GGpDVdG55zJ5KMqjYHaqhisZSnYsQvKf4azg6oeBeAvuaSy1F uoC3M2xHjUn1cut5FdyvQooSoYEdYNC+76NttD4lihd1rptoiY1KIxeccUT2ONQQ3GFN6n5JLGJ K0XiaRf1k67zPbGX3o5xSkb5p2Qm+IXeEi39m3c4vCE+hqA/HZ7zLgvMwGDsZmNeMB4jbWCNzZV ffDym2aJJTqksS23wUFl1IHCpnNqxQXWPjHMK0Zu6P4V3gP7Ezwzpb2Kr0+//xAFZiIo/8e2X8m 1ksjqcxPCreiYEJHQwmI= X-Received: by 2002:a05:600c:1988:b0:439:9e13:2df4 with SMTP id 5b1f17b1804b1-43bd29bcc56mr62552685e9.21.1741276116977; Thu, 06 Mar 2025 07:48:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4352ed7sm53288995e9.26.2025.03.06.07.48.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Mar 2025 07:48:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/54] accel: Forward-declare AccelOpsClass in 'qemu/typedefs.h' Date: Thu, 6 Mar 2025 16:46:55 +0100 Message-ID: <20250306154737.70886-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250306154737.70886-1-philmd@linaro.org> References: <20250306154737.70886-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 The heavily imported "system/cpus.h" header includes "accel-ops.h" to get AccelOpsClass type declaration. Reduce headers pressure by forward declaring it in "qemu/typedefs.h", where we already declare the AccelCPUState type. Reduce "system/cpus.h" inclusions by only including "system/accel-ops.h" when necessary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-14-philmd@linaro.org> --- include/qemu/typedefs.h | 1 + include/system/accel-ops.h | 1 - include/system/cpus.h | 2 -- accel/accel-system.c | 1 + accel/hvf/hvf-accel-ops.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/qtest/qtest.c | 1 + accel/tcg/cpu-exec-common.c | 1 - accel/tcg/cpu-exec.c | 1 - accel/tcg/monitor.c | 1 - accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/translate-all.c | 1 - accel/xen/xen-all.c | 1 + cpu-common.c | 1 - cpu-target.c | 1 + gdbstub/system.c | 1 + system/cpus.c | 1 + target/i386/nvmm/nvmm-accel-ops.c | 1 + target/i386/whpx/whpx-accel-ops.c | 1 + 19 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 3d84efcac47..465cc501773 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -22,6 +22,7 @@ * Please keep this list in case-insensitive alphabetical order. */ typedef struct AccelCPUState AccelCPUState; +typedef struct AccelOpsClass AccelOpsClass; typedef struct AccelState AccelState; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 137fb96d444..4c99d25aeff 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -17,7 +17,6 @@ #define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX #define ACCEL_OPS_NAME(name) (name "-" TYPE_ACCEL_OPS) -typedef struct AccelOpsClass AccelOpsClass; DECLARE_CLASS_CHECKERS(AccelOpsClass, ACCEL_OPS, TYPE_ACCEL_OPS) /** diff --git a/include/system/cpus.h b/include/system/cpus.h index 1cffeaaf5c4..3226c765d01 100644 --- a/include/system/cpus.h +++ b/include/system/cpus.h @@ -1,8 +1,6 @@ #ifndef QEMU_CPUS_H #define QEMU_CPUS_H -#include "system/accel-ops.h" - /* register accel-specific operations */ void cpus_register_accel(const AccelOpsClass *i); diff --git a/accel/accel-system.c b/accel/accel-system.c index a7596aef59d..5df49fbe831 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "hw/boards.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "qemu/error-report.h" #include "accel-system.h" diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 945ba720513..12fc30c2761 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -54,6 +54,7 @@ #include "exec/exec-all.h" #include "gdbstub/enums.h" #include "hw/boards.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "system/hvf.h" #include "system/hvf_int.h" diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index a81e8f3b03b..54ea60909e2 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" +#include "system/accel-ops.h" #include "system/kvm.h" #include "system/kvm_int.h" #include "system/runstate.h" diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index ad7e3441a5a..7fae80f6a1b 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -18,6 +18,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/accel.h" +#include "system/accel-ops.h" #include "system/qtest.h" #include "system/cpus.h" #include "qemu/guest-random.h" diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index 100746d555a..c5c513f1e4a 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -19,7 +19,6 @@ #include "qemu/osdep.h" #include "exec/log.h" -#include "system/cpus.h" #include "system/tcg.h" #include "qemu/plugin.h" #include "internal-common.h" diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 3a3c45f52ed..ef3d967e3af 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -33,7 +33,6 @@ #include "qemu/rcu.h" #include "exec/log.h" #include "qemu/main-loop.h" -#include "system/cpus.h" #include "exec/cpu-all.h" #include "system/cpu-timers.h" #include "exec/replay-core.h" diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index ae1dbeb79f8..eeb38a4d9ce 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -13,7 +13,6 @@ #include "qapi/type-helpers.h" #include "qapi/qapi-commands-machine.h" #include "monitor/monitor.h" -#include "system/cpus.h" #include "system/cpu-timers.h" #include "system/tcg.h" #include "tcg/tcg.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 6e3f1fa92b2..132c5d14613 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "system/accel-ops.h" #include "system/tcg.h" #include "system/replay.h" #include "system/cpu-timers.h" diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 786e2f6f1a7..0914d6e98b2 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -54,7 +54,6 @@ #include "qemu/cacheinfo.h" #include "qemu/timer.h" #include "exec/log.h" -#include "system/cpus.h" #include "system/cpu-timers.h" #include "system/tcg.h" #include "qapi/error.h" diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 852e9fbe5fe..7aa28b9ab93 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -18,6 +18,7 @@ #include "hw/xen/xen_igd.h" #include "chardev/char.h" #include "qemu/accel.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "system/xen.h" #include "system/runstate.h" diff --git a/cpu-common.c b/cpu-common.c index 4248b2d727e..f5dcc2d136b 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -21,7 +21,6 @@ #include "qemu/main-loop.h" #include "exec/cpu-common.h" #include "hw/core/cpu.h" -#include "system/cpus.h" #include "qemu/lockable.h" #include "trace/trace-root.h" diff --git a/cpu-target.c b/cpu-target.c index f97f3a14751..20933bde7d4 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -35,6 +35,7 @@ #include "exec/address-spaces.h" #include "exec/memory.h" #endif +#include "system/accel-ops.h" #include "system/cpus.h" #include "system/tcg.h" #include "exec/tswap.h" diff --git a/gdbstub/system.c b/gdbstub/system.c index 7f047a285c8..416c1dbe1e9 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -19,6 +19,7 @@ #include "gdbstub/commands.h" #include "exec/hwaddr.h" #include "exec/tb-flush.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "system/runstate.h" #include "system/replay.h" diff --git a/system/cpus.c b/system/cpus.c index 37e5892c240..2cc5f887ab5 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -31,6 +31,7 @@ #include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" #include "exec/gdbstub.h" +#include "system/accel-ops.h" #include "system/hw_accel.h" #include "exec/cpu-common.h" #include "qemu/thread.h" diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-accel-ops.c index e7b56662fee..4e4e63de78e 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "system/kvm_int.h" #include "qemu/main-loop.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "qemu/guest-random.h" diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index ab2e014c9ea..81fdd06e487 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -11,6 +11,7 @@ #include "qemu/osdep.h" #include "system/kvm_int.h" #include "qemu/main-loop.h" +#include "system/accel-ops.h" #include "system/cpus.h" #include "qemu/guest-random.h"