From patchwork Fri Apr 25 15:28:40 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: 884416 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp4030975wrs; Fri, 25 Apr 2025 08:42:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWT/R9+UyItco1BL2MS1ir8OErj3F4mF/jt5EgCSVlAfkR/jRrp5SgPx/4PjWZq41U78iAiA==@linaro.org X-Google-Smtp-Source: AGHT+IE+JF6+wCyL4MhRBc5+bfLQu2ChsyyzVY5T/8Wp/XfgrpCaK3oyXDrjkcIMUY2K7LMK9rkm X-Received: by 2002:a05:6102:161e:b0:4c3:64c0:8b14 with SMTP id ada2fe7eead31-4d3c73f1c0amr6109747137.3.1745595727471; Fri, 25 Apr 2025 08:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745595727; cv=none; d=google.com; s=arc-20240605; b=aIjcKourbNDo2SHRLUphFFe5jTjSTctjhnwWz1QiBN+O1lTdFZ6D2dvUg3+s3vhu+8 ia8fLs23H+CaV4jH1Tp5sa5rVHcTzsxVkHggg+eIRprsccfIPjvnZf6SkCmtfca1yW0/ N6Eyzz9M2cenoTZwlQFU/Ju1U6dG6huS9RpHe3WtI/ADly8FgMfwr0ZyTRBSb/VMRBU+ wLgKPCfRHbhXIF6aDuvO1TEaozylqmK9Yq1rR95hBr5F76t0k8x6DaMlGKFz3A2+ktWf R8S5dC0eRxtjXVLc441kXM9JsgQXGbvErGPz4OglvSC1TBh+cf31xuOAPPFZHIUXiz1a MFGg== 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=6fRMkD1jN0vYS+nWz550ADZSuDTJFtt+Q3jzZlSl7HM=; fh=i/pWNGcx7KiR3ewgypxpPkuORYlkCnVXLqKVm9/UgNc=; b=iWn9F5kcHro9Gsw2Q7CC9de/l8g1UzETzWIzMDC1qOo0Q8+qWVmdIehE90qifENEnf aFLclFsNOHs232VjMdITVl0npKFgSH4hd0Vf0l3lDkjaFIDmbIdf4YU1jhG0mM45r2VM uP2bEbx5ZXGlDTw4AidNW3TLRQm7pSTbyGvG0Mxnx3famqQGT2tvdtg/GU6RC6+CQ/3U X2J1wqINoowAmjw4rLZj6kvoq7wZdrMpGMKpBIDWDbwsV5XsZHipyh7aN93XmC8QjxUr GR1BehK/VQRVoz5toeQ5CEJ0Ph8cclk/zWnt2dLKkr1jOjijHiCXEVpNwvZpH7qtjgE/ bTag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AYWHyyar; 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 a1e0cc1a2514c-877aed0551fsi1190562241.16.2025.04.25.08.42.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Apr 2025 08:42:07 -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=AYWHyyar; 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 1u8L3s-0003tt-7a; Fri, 25 Apr 2025 11:33: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 1u8L3L-0002wN-7K for qemu-devel@nongnu.org; Fri, 25 Apr 2025 11:33:32 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u8L3J-0004JH-5V for qemu-devel@nongnu.org; Fri, 25 Apr 2025 11:33:22 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-39ee5ac4321so2397225f8f.1 for ; Fri, 25 Apr 2025 08:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745595199; x=1746199999; 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=6fRMkD1jN0vYS+nWz550ADZSuDTJFtt+Q3jzZlSl7HM=; b=AYWHyyarFwWfxeyfm2G1if8+08WcxcwaHRKFwpF8nAEPcD0PRqW9PSCiNHErLdlasn dqTqO6BEQiIdWCo6ZvAownqCdIhWJr/ulvujHWCg9PTAxfk7sCiCa02Y/Qug2ZG7WtkA WUqmOJcuxhugtb11vSqJVvCNrI/c+jhuqLV1A/anaEc/KZ3O2vHITZkCh8e5vRhA+Dfp GalpChTBxVIh1lQ7ikA2aiYcUjuBpuWscc8Q5jYXBw22uggZQVBfn4S+XfBDPbrZW4Jr yKjVDl674J63zQzNfTBdRfQGvUpZK/GmrYDL+3cghRXn70oL47EwrXTaOdo6A0YpPMYo Y4Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745595199; x=1746199999; 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=6fRMkD1jN0vYS+nWz550ADZSuDTJFtt+Q3jzZlSl7HM=; b=FWhEig/cXxbh+0aWHdCC0W3fCOe/MHv2GWJi4I1D7rqLLFrMF/nwQy82mUyeEmGE+W ogByDNQeSI72Or02v/c/QTmYjN9wV8/1+FEnYdFNtoxuxUhIMRTAgKZhYW8RKxoT7f9x UJlwEXMc+3atJxyGaQvyOvl5ElrhlHrqA5SUMAY7SxeYa88HYi/s4E1kd2whxGjIUZvZ y9cyLmyS+0b0A1yqlApcSWnhTEo9uH75NdC+34bsQ/3vOW9lsfxl9cv8W/Geef6LmBvx RrHr1tdNK1jwdx2vNZIXHx4F36voZgG8F3SAn89d51O2sVNfKFfDKPakBwT0WTr5bDE2 a9JA== X-Gm-Message-State: AOJu0Yz5nL8JGXF4eAfRCKHrxUNdyjZJ2czIkhGNxkSXNPxIXDYgxD34 Kr+ynVFBG+ONYTrlOIorf7cex6KchyaWu1EVB39ZATstpyHYMaOGRtmI9OG7OQlEO+PXTGBjH1d T X-Gm-Gg: ASbGncsE+x8lJB1cFvHbUZmiKubQ4XrusKoDj99CV8xoSuEN5HxklK03QLI+CpJcDqe Vjwtf/PUT6mqg2DnIPkK0mD89F888bLExkD0MfYJZM/+5EwBALCRPlNXJXrqv4eZZabBNg5RKIU Sq15qIa04EWE4896W4tIuIYO3FGMQUs6KvmgMANuy2FLNtkMFZlPqypnSvSd5T8JNldQa/fKEMi 574jteiiJQQUfIrnf3m9r8A0po2hmqheHnY4ztTmIuWMmaNtncln7uQwVvvph6KrLvP4l/ZnzQc NlzjK36Ecu4Z0ojQY+pxIgLwKZSIfBGWoLxu/Mtl/KtmpJKMmZrD2Gq1o9XUme8G/gNicx8Mk2R sXR1iqN3uH0Y9TDU= X-Received: by 2002:a5d:64aa:0:b0:394:ef93:9afc with SMTP id ffacd0b85a97d-3a074e2e9a8mr2392935f8f.18.1745595199084; Fri, 25 Apr 2025 08:33:19 -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-440a52f8800sm28682025e9.3.2025.04.25.08.33.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 25 Apr 2025 08:33:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PULL 56/58] accel: Make AccelCPUClass structure target-agnostic Date: Fri, 25 Apr 2025 17:28:40 +0200 Message-ID: <20250425152843.69638-57-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250425152843.69638-1-philmd@linaro.org> References: <20250425152843.69638-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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é Message-Id: <20250417165430.58213-7-philmd@linaro.org> --- MAINTAINERS | 2 +- include/accel/accel-cpu-target.h | 12 +----------- include/accel/accel-cpu.h | 23 +++++++++++++++++++++++ accel/accel-target.c | 1 - 4 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 include/accel/accel-cpu.h diff --git a/MAINTAINERS b/MAINTAINERS index 07711cfd381..59d97128199 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -499,7 +499,7 @@ F: include/qemu/accel.h F: include/qemu/target-info*.h F: include/system/accel-*.h F: include/system/cpus.h -F: include/accel/accel-cpu-target.h +F: include/accel/accel-cpu*.h F: accel/accel-*.? F: accel/Makefile.objs F: accel/stubs/Makefile.objs 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 7f3bbf31a8b..82a29e61476 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"