Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2DC9C83F1A for ; Wed, 23 Jul 2025 13:57:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ueZxn-0004ob-46; Wed, 23 Jul 2025 09:56:55 -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 1ueZtA-0002qM-Qk for qemu-arm@nongnu.org; Wed, 23 Jul 2025 09:52:16 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ueZt8-0002ou-8k for qemu-arm@nongnu.org; Wed, 23 Jul 2025 09:52:07 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-45611a6a706so36134905e9.1 for ; Wed, 23 Jul 2025 06:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1753278724; x=1753883524; 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=sErIHNuJGiieHnnNTlL18cbjNP1n0Jf/eJ1sooLpLjw=; b=xm7z/JsADWjEQDpEBhuQpOUmA2SbWJeEa/gBol++/EowxFirh9Au6w0v247ifhqU9B RCB9afHVG6IGrd5e99JkuS67KbfBU/JKPvqw0YvGBLMjnqHFhRAKCtKqy/bq7AsCYx0k Uyq9LEznP7gYXN8x/mOBZIfhPn2KNLKG2V4USGQTOP3xfnDo6bod+f7tlX0v7mda2r8m gLbtAO9d3ipbxz4VNd634uOQcDx9XlAeYoHouRJ8rx/xt7o8YOHRFTMRp5zKWbmRCBsX lEFrfYBI+iNhP3tFGIB4gHrMYFBhpwXUUDtUjXqL4k6powwEOPI2yymytj0BZOgW2ztj /a1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753278724; x=1753883524; 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=sErIHNuJGiieHnnNTlL18cbjNP1n0Jf/eJ1sooLpLjw=; b=fD/XTmYiDZmfQSC4hm+gF74+9eMhq4jPhuR1vCtkg5nusFGLCbpqa0Y+kNFsOIpxcM sqr9aMtz/m58YqT9PIXMAgLQWJkngRpFcf1e/Veu0VBotJQO4/ScLGFO2pRt1+MVrs04 Cpmrvozghi0tu+YWezBSZQMEVlPLEbWbq8Ap34jEIZrmShnhUHDlVr+No0q6koblo+ph 5PJgaI3iGxbX0Lcp6EbYO6xyt46r3Ow5am52SZTPtzgW1+NV1EhIc1O7YkTjT4w0QM6F oxwmZDRCZrztQtevAhHwr0UEkbWE6l+ht9GLujlPp1zZSsk3yXD0V/6EGxK+d+KKjUZ1 t5dg== X-Gm-Message-State: AOJu0YwTVuk/6OuRhAWvJLyI2MNUus6vzHWKkXxRjHTP2L0h22kdnDh/ iW6RbaXf0jf93eabir0kihm+0KcwBcz/5y5Gb1+Xh0AzngwUGyPt0rb5P36ahNIeQjE= X-Gm-Gg: ASbGncvSm5yTpkXmCTJ/RiUO97LPGgkf/oWKbK4yeKk5c3ShYZk1pJLGF4hyhVo8zq+ pzJW5feQEBXtDzxtRPFLGb0QTonsTLKd3nouZ6LPMCPyIJG9ertFiZi0V9uUi5aO0EIsWaAzao8 XV600xldum0pAU8vA/XHEFX4GeibkJrn8aQsgHxtYx5o1Hhxp1710tB9RyO6xpTUQF7KYmQwJ/3 Cf306LUXQG7IYI0cjqHa7k2v68Ifr7iHv1GSzmtM4ZJHx3Mx6DLdDwlwv9ObDCYKGKC+pzoww6f YrR5eyjLpSppdCuyGnByLFhFC+yTsJbuVFAbNc0T6tRzrybDFw7ZNRodOEXF0nj3NQJzk+oFftN aHAlN53Y63+eaX5qlQVFDJ8t8PnJqAoMxldV++c39qSuNT9BF98lWnx7TLgEwKqZbsmlVCqE7 X-Google-Smtp-Source: AGHT+IF2jLSlL/5bD5PGYKMnCSdo/K8e84jAX+hhADjVLT//YWG4YzDSSig2sL12YCHZyVOjxUOlSw== X-Received: by 2002:a05:600c:4509:b0:456:133f:a02d with SMTP id 5b1f17b1804b1-45868d2dd64mr27706105e9.17.1753278723806; Wed, 23 Jul 2025 06:52:03 -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-3b61ca5c9edsm16632337f8f.88.2025.07.23.06.52.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Jul 2025 06:52:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Mohamed Mediouni , Phil Dennis-Jordan , Roman Bolshakov , Peter Maydell , Paolo Bonzini , Alexander Graf , Mads Ynddal , Cameron Esfahani , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v4 1/4] accel: Introduce AccelOpsClass::cpu_target_realize() hook Date: Wed, 23 Jul 2025 15:51:53 +0200 Message-ID: <20250723135156.85426-2-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250723135156.85426-1-philmd@linaro.org> References: <20250723135156.85426-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Allow accelerators to set vCPU properties before its realization. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/accel/accel-cpu-ops.h | 1 + accel/accel-common.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/accel/accel-cpu-ops.h b/include/accel/accel-cpu-ops.h index 0674764914f..9c07a903ea0 100644 --- a/include/accel/accel-cpu-ops.h +++ b/include/accel/accel-cpu-ops.h @@ -34,6 +34,7 @@ struct AccelOpsClass { /* initialization function called when accel is chosen */ void (*ops_init)(AccelClass *ac); + bool (*cpu_target_realize)(CPUState *cpu, Error **errp); bool (*cpus_are_resettable)(void); void (*cpu_reset_hold)(CPUState *cpu); diff --git a/accel/accel-common.c b/accel/accel-common.c index 850c5ab4b8e..eecb2a292af 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -106,6 +106,11 @@ bool accel_cpu_common_realize(CPUState *cpu, Error **errp) if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) { return false; } + if (acc->ops + && acc->ops->cpu_target_realize + && !acc->ops->cpu_target_realize(cpu, errp)) { + return false; + } return true; } -- 2.49.0