From patchwork Thu Apr 17 16:54:29 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: 881869 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp421388wrs; Thu, 17 Apr 2025 09:55:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXK7RGglJptojGnRg6khOhig7/7b8zminwkj4oSXAZXnB0R+1+929EKeiSCWiQiuRqgnFztmA==@linaro.org X-Google-Smtp-Source: AGHT+IE9ZdC1DQAVJ6c6SC4JrnAEcHY2ljvUnEVyh48mhOvWP2fPYw7ntsklRdPT+yHcTYui/3uj X-Received: by 2002:a05:6214:19c8:b0:6e8:ee68:b4a1 with SMTP id 6a1803df08f44-6f2b2f22a1fmr107988796d6.8.1744908957935; Thu, 17 Apr 2025 09:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744908957; cv=none; d=google.com; s=arc-20240605; b=EngqdSbf6BTOiO3nUxghhx9Ty6OjsP205avSaKqGhdQo7GrkQnB9MrB7Yag6FpIqZQ GDxd16LGnUv/w70iY7wxBKRxBvZuU99ctIJnEgF3kTSTDJJRWn5PGEshzbRGE1Yb62y0 P8g+boTPVIRzTQBsOzSb9ffi5PiGB7LpgLSy96v31W9tapqhBTtClZl9dMcEdta7Cc3J BVqLD1fr0tOWwgdWmPqsDB0LK7y6+EZCHhBnu/GoiIz7WOCXWSiAsxp7dJpJN0fCqYyJ gQ3m695mELNfnbOp4OCextJ2JkhjAGspDTBXYiwppEZGgC/jr3uQdb5z5Z6DuRVVWJHh 9AMQ== 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=uJ8iU5RvZsXIn9yVLIzKm4nuSmrz0M49050hDPScekQ=; fh=648YH0ympC0GO1R9X4VUyDuabGl/p48Phw6ajjzDgmU=; b=eH08GGannCBhfPGvCbSRhmsozxn0kmI30/fEwBwBeMhBpx+nWe+kgfjKpQF4jqDT33 P1G0dMWWszal0cZolBvGtxF33Zx6TJJUxhwNNEIqRFYXPdp3ss8a+enUhbIibuGKePFy B/0CwVQtxvYmcmWNPn7TvdqwSoCrV6gjTEYZ94TefdFayKzlHV3U0bYbbEKSlmtixKf5 Llj7QVS0x19Aua1BPhLNddYotvMeqFIG6/Gr3EvvxPsc7jcQdgcr+y+O6whxR2iRT0Vp j/Z5edQMt1/wPqVwDAYI5X19TMzblBfnho0G1tfFuQ1PFL7I6hP6ITGs868iK8NTeLMY /LXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WTbpOeZe; 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 6a1803df08f44-6f2c2b0245asi1958326d6.67.2025.04.17.09.55.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Apr 2025 09:55:57 -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=WTbpOeZe; 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 1u5SWC-00006J-Ms; Thu, 17 Apr 2025 12:55:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u5SW1-0008TC-Vm for qemu-devel@nongnu.org; Thu, 17 Apr 2025 12:55:07 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u5SVz-0003g9-VR for qemu-devel@nongnu.org; Thu, 17 Apr 2025 12:55:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43d0618746bso8157325e9.2 for ; Thu, 17 Apr 2025 09:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744908901; x=1745513701; 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=uJ8iU5RvZsXIn9yVLIzKm4nuSmrz0M49050hDPScekQ=; b=WTbpOeZeFEPiXsKhhvpEqWClLhA2KigLGvdYUIbKsfxNw9ZO6ETDashq9yQZkzrOY7 mwO56ZbGxN++NrNlj7qBJbMH/7DV3HM+gXbsY5R9sWkMJT4ig3vIRKx8CLn4SSTnUteY S+BiKubiezZ05peE3UHBSWeyrHWTFOgRR7B+enJfaKvVnqq6s4ib32w7MvHEXtqJjC2Q HJAb70UAiVC8Ie3EQ4ffS0bbaGqn2IU8gLL9mKTSOSiOYoGVP2cSapgrDuB6SZ6aUerM x41VkNId52L1/+9cr8ue1UCfpggXccKrU3waOXJAhaCsCp0bt9F9UNBG1kr/y4xCaR6O zpDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744908901; x=1745513701; 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=uJ8iU5RvZsXIn9yVLIzKm4nuSmrz0M49050hDPScekQ=; b=WFevZzlUbYHYTLydkT4QEkmuLbZVduDijNnofGZOPPqzNuyxsiSP+m+9Age5f2N8rr 5PSUoaYmPLxyxJbzAajFL870peNjBjAmTM5e7VpiENSr/jqHPSOh14lfN20M4sstfm6c ngfcLon/WhDvq/qU1kEld97b7yWaU5EfyUdWRIE5X8Gy9TP36UaIJX+35qL90Rj3qXsA mr6zAtfHC84YxiK9AGlyq/B/YLozBY3Tz3U8F1F32YQEqBhaVzGhoUvZP09HTNR79G8j 4OQzBlV5g1+b38pZzOSazpBX1Qwwe8FkdwjMaCN71FZg+qdh3eR2vVql88WgZztadfEx /DkA== X-Gm-Message-State: AOJu0Yy3Loub9HBCFDXHlNmbBfNEsNjs3ZsBG9pvObZpx98f33lQkyNq GLg2y1xPjMzEG9nmUg9/fxhPq9fCGvVUyDHrbsS4fvWIukHHypVJA7boPBGvLJWFijbJcwJsJPW X X-Gm-Gg: ASbGnctgycjZadiea+2GDEVag5cHWUmbtBpnfukE5E7Y4DNOsluHGOZz4xfEcNr/2I1 PdAZvgkoF++ZcR/Fbb0ZqGHrii/2znNZXEjLj37Ff0JABJULR58DIO3GW24of4n0CQ7odVSlYQ+ semRGraSQoxr6H95iqfM9Q1AvBNSiUTD5cQMt4ntEZPUmR11jTaz6zMiHsZ3fnz4xQL0QE4xhc9 lItt1PnoXXWywsUK4RK5xJqOG11v2l+E9j1ibMCaKsqCxtXcOaP8XZNRXZf1FvmCqfuf2H4jfJw woOo4WkpIBASklNPzKTs2y8TvCmt3Tnmixr4InCQ1lFZD9UmFAEwAXFhMHBGOtF0gZ5IO7xE2aX AwowAyWDLpWWmrpglJCiSyzdb6A== X-Received: by 2002:a05:600c:1c04:b0:43c:fb36:d296 with SMTP id 5b1f17b1804b1-4405d6ab656mr47922255e9.25.1744908901121; Thu, 17 Apr 2025 09:55:01 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b4f2444sm62438605e9.17.2025.04.17.09.55.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 17 Apr 2025 09:55:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Yanan Wang , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Zhao Liu , Marcel Apfelbaum , =?utf-8?q?Daniel_P=2E_Berran?= =?utf-8?q?g=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Eduardo Habkost , Richard Henderson , Pierrick Bouvier Subject: [PATCH 6/7] accel: Make AccelCPUClass structure target-agnostic Date: Thu, 17 Apr 2025 18:54:29 +0200 Message-ID: <20250417165430.58213-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250417165430.58213-1-philmd@linaro.org> References: <20250417165430.58213-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Move the target-agnostic parts of "accel/accel-cpu-target.h" to "accel/accel-cpu.h". Doing so we need to include missing "hw/core/cpu.h" header in "accel/accel-cpu.h" otherwise we get: include/accel/accel-cpu-target.h:39:28: error: unknown type name 'CPUClass' 39 | void (*cpu_class_init)(CPUClass *cc); | ^ Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé --- include/accel/accel-cpu-target.h | 12 +----------- include/accel/accel-cpu.h | 23 +++++++++++++++++++++++ accel/accel-target.c | 1 - 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 include/accel/accel-cpu.h diff --git a/include/accel/accel-cpu-target.h b/include/accel/accel-cpu-target.h index 37dde7fae3e..6feb344e29b 100644 --- a/include/accel/accel-cpu-target.h +++ b/include/accel/accel-cpu-target.h @@ -21,21 +21,11 @@ */ #include "qom/object.h" +#include "accel/accel-cpu.h" #include "cpu.h" #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU) -typedef struct AccelCPUClass AccelCPUClass; DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) -typedef struct AccelCPUClass { - /*< private >*/ - ObjectClass parent_class; - /*< public >*/ - - void (*cpu_class_init)(CPUClass *cc); - void (*cpu_instance_init)(CPUState *cpu); - bool (*cpu_target_realize)(CPUState *cpu, Error **errp); -} AccelCPUClass; - #endif /* ACCEL_CPU_H */ diff --git a/include/accel/accel-cpu.h b/include/accel/accel-cpu.h new file mode 100644 index 00000000000..9e7eede7c3c --- /dev/null +++ b/include/accel/accel-cpu.h @@ -0,0 +1,23 @@ +/* + * Accelerator interface, specializes CPUClass + * + * Copyright 2021 SUSE LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef ACCEL_CPU_H +#define ACCEL_CPU_H + +#include "qom/object.h" +#include "hw/core/cpu.h" + +typedef struct AccelCPUClass { + ObjectClass parent_class; + + void (*cpu_class_init)(CPUClass *cc); + void (*cpu_instance_init)(CPUState *cpu); + bool (*cpu_target_realize)(CPUState *cpu, Error **errp); +} AccelCPUClass; + +#endif /* ACCEL_CPU_H */ diff --git a/accel/accel-target.c b/accel/accel-target.c index 6fa5c3ef04e..769a90230bf 100644 --- a/accel/accel-target.c +++ b/accel/accel-target.c @@ -27,7 +27,6 @@ #include "qemu/accel.h" #include "qemu/target_info.h" -#include "cpu.h" #include "accel/accel-cpu-target.h" #include "accel-internal.h"