From patchwork Mon Sep 18 16:02:42 2023 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: 724161 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1773635wro; Mon, 18 Sep 2023 09:05:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnrLieXGv0x48+Gl9i0tFjtgT68G+iSVZP8No6VO1o0Q0ntbH6B6fLBt+7AJFoOmvL8dt2 X-Received: by 2002:a05:620a:254e:b0:76c:8d5f:5954 with SMTP id s14-20020a05620a254e00b0076c8d5f5954mr11151850qko.70.1695053137729; Mon, 18 Sep 2023 09:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695053137; cv=none; d=google.com; s=arc-20160816; b=eEAqg5M5tcOTgnG+xImKJxUpX9istNb6Hd7/mzF/GbK7u9DHtWKbwp9pn8MCfTAwPC C0bGwZYWZj4WpRkyq0rfmGr5MDCLyknFj8YVxQ3gYBoRMdG42EYQ8N8kYk2LSrkicQBE 0I7GQw6SiMWPoW1lsV5FM+s+/vBLiEvmd2p524DwjOpGYMXp32BjaF3vRz6T2JK6zLKA uAe1obeg9Zll8ylxa0R4/59HEH1zSLs4iUydH4VdhPJLaXYShqPwdOcVK7hEFQC4dJvp X7+TrUBlYDx3GlYUP8jQO2YB2q4HGs0w+qhEy/bLzXhRvpjaEVuvwvBqAMYw39jcq8R7 YrZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=hSVRQGIJEmce1VSEx8yaDe0o7AipRr5BDfgLzGOyz48=; fh=AIYNAcrfQPdTp+tiOBYg2bCy2NfWRbXD73JV9SLWbpM=; b=0/Nv1Uqtsz6YwytZxwv5T+N5/9h44nkb8pDhyL1W2/yScp9gHpFTOj3lYGqULpT/K3 6E3hUjoL3gRrbJVwMXMq1gLcsj97onF6U7e5542+ItpIVp4yeEMZ8CXttcRVytElyTFE Bc03LxhpSFKMt98Z0j5g186W3yESMrx60XHn6P7gouGFS+nC9WYK/491R4J6mZLhaH4P Z6yA2ONJ3B8HW6osoVWlvdTbn19Qv0KDx45LRdbI+nleb2Sb5rykcEE13pLm9o2kIUwj aPwUuAsE2Rwm3tMA2pDB4cDOzvQP/4sistdtt/mfiyg2inIo4renAJ3wKFLbBqI7AKYT shDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q5JpHh6j; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id to22-20020a05620a4c9600b0076db3a9093esi6028685qkn.49.2023.09.18.09.05.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2023 09:05:37 -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=q5JpHh6j; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiGjU-0007b1-JG; Mon, 18 Sep 2023 12:04:20 -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 1qiGj0-0006iI-MQ for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:03:57 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiGiy-00046H-Mp for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:03:50 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52c88a03f99so5428106a12.2 for ; Mon, 18 Sep 2023 09:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695053026; x=1695657826; 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=hSVRQGIJEmce1VSEx8yaDe0o7AipRr5BDfgLzGOyz48=; b=q5JpHh6jFxRapS8v4pDR+SdPvLayRfPxeIuuCgXAKHE5I0DPrcjNVK0ScOuLy+XZms CwQb+Ar0eqR/qyJoiRXY/Es7CxUI5PLyje4olYe3M45sflLYTT5g98zPqxDfeSryxmwj xCkh2gf5uJAmOs4xpR3/DD52euSp/0OlLG5F1fVW+U6AlJzXdjq7Ub3AthRC2+njDAgb 3gB9hXjStr9AuLEDmpYm8KiCeutAcxxu+Lgu7g4FmLCXgKwRNCRHX+OcG4dK87lW5HHs trVFzt/f13vY1nXJKDJsiy0KLSi7Pzlz8hMB0LQfZev9qLjIx+MrvJRdH8wfyirRLdgG AIAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695053026; x=1695657826; 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=hSVRQGIJEmce1VSEx8yaDe0o7AipRr5BDfgLzGOyz48=; b=p6XfSfStP+zo6/LVT0qS1vCoBTs4uYkft/5WedhBgUiLJSXZy1xjoixTYabYwdi0oq tLo+//10p2tpUjOGYvwknGoDtBhnwGsEasUDVC/7M5IEWervAdubh8LtP7ANGTM+XrKP xaB2Dvt6Hm3TIZkKGwNjVKGhA7fgpWPqQqRr/ArzRPPC1YW6k+8FfyXJfkvuZCkFic2t vC0p2NzxF84GAsAIT6DSNRMQYa0UFmLlWDBGVgfcXkhk8mUJdW8aweR8lq3/IL3nbqfk tvqvUw1OhNLr0w32GZIRhPdRS9HhQ6JtmQ8pKkBMAp5bpCIDQvVYcIkX6UaHE3yYZ1dM nctA== X-Gm-Message-State: AOJu0YxQ5gOicbnysNJPbNLidb73wHI7H1Nq3AJKUTa9Xz0OtZsKCDEE NrxASyFKzKfWrHr/PC6wpFARENN2WK7xfLxrIJGBQnTA X-Received: by 2002:a17:906:74d5:b0:9a1:8ee9:cc0b with SMTP id z21-20020a17090674d500b009a18ee9cc0bmr8829825ejl.21.1695053026100; Mon, 18 Sep 2023 09:03:46 -0700 (PDT) Received: from localhost.localdomain (static-212-193-78-212.thenetworkfactory.nl. [212.78.193.212]) by smtp.gmail.com with ESMTPSA id g5-20020a170906394500b0099bc038eb2bsm6614676eje.58.2023.09.18.09.03.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 09:03:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Paolo Bonzini , Max Filippov , David Hildenbrand , Peter Xu , Anton Johansson , Peter Maydell , kvm@vger.kernel.org, Marek Vasut , David Gibson , Brian Cain , Yoshinori Sato , "Edgar E . Iglesias" , Claudio Fontana , Daniel Henrique Barboza , Artyom Tarasenko , Marcelo Tosatti , qemu-ppc@nongnu.org, Liu Zhiwei , Aurelien Jarno , Ilya Leoshkevich , Daniel Henrique Barboza , Bastian Koppelmann , =?utf-8?q?C=C3=A9dric_?= =?utf-8?q?Le_Goater?= , Alistair Francis , Alessandro Di Federico , Song Gao , Marcel Apfelbaum , Chris Wulff , "Michael S. Tsirkin" , Alistair Francis , Fabiano Rosas , qemu-s390x@nongnu.org, Yanan Wang , Luc Michel , Weiwei Li , Bin Meng , Stafford Horne , Xiaojuan Yang , "Daniel P . Berrange" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Jiaxun Yang , Richard Henderson , Aleksandar Rikalo , Bernhard Beschow , Mark Cave-Ayland , qemu-riscv@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Greg Kurz , Michael Rolnik , Eduardo Habkost , Markus Armbruster , Palmer Dabbelt Subject: [PATCH 09/22] target/arm: Create timers *after* accelerator vCPU is realized Date: Mon, 18 Sep 2023 18:02:42 +0200 Message-ID: <20230918160257.30127-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918160257.30127-1-philmd@linaro.org> References: <20230918160257.30127-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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=unavailable 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 Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized *after* the vCPU is realized. Doing so allows further generic API simplification (in few commits). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/cpu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index fc3772025c..46d3f70d63 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1748,7 +1748,15 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) return; } } +#endif + cpu_exec_realizefn(cs, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + return; + } + +#ifndef CONFIG_USER_ONLY { uint64_t scale; @@ -1776,12 +1784,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) } #endif - cpu_exec_realizefn(cs, &local_err); - if (local_err != NULL) { - error_propagate(errp, local_err); - return; - } - arm_cpu_finalize_features(cpu, &local_err); if (local_err != NULL) { error_propagate(errp, local_err);