From patchwork Tue Jan 28 14:21:49 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: 860408 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp376173wrx; Tue, 28 Jan 2025 06:23:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXZKFAnT8QgJXpOnZAPqaK3sn/+IBHUj9t4jbCi55qjBWSTPCW7BHqCD1ZSyV9ZGTvWxPN28A==@linaro.org X-Google-Smtp-Source: AGHT+IFIXdNPPCPG266vOiRU4Ut+cDm9jwB4lf6WLI82/5+TX03usk8nK/yTNZMeOv+Lbc4EQUzB X-Received: by 2002:a05:620a:3947:b0:7b6:c540:9530 with SMTP id af79cd13be357-7be6320c460mr7925457985a.25.1738074238432; Tue, 28 Jan 2025 06:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738074238; cv=none; d=google.com; s=arc-20240605; b=AyZiNMUeg2ADMgWlNliAh3xO17SWAkg8Bz5a+Pk6IXk8gHgKOELGXZYWvozDmJadqb x62XdW8HvLxxX8EkVPErfMwVSL2PV4atV5WDHaLeDMPqqc9baiZDMOJf5aADK8eAN2L9 p90Y1By2+aQHK8DY0Z1I3kfo80rl3IKSEvOhpTRaTV41Ndp6HSchzwGk9nMoAy+KUNA4 VqIe7pIWDr1ly/PupjLkmE8y9Eq8792Tj4nFVkrHbtPBU43peHG2wxDeolM3Ur95fjSD ehR2Z94ZNtOCF4VPmx8j05u5xKryvRAYvadiNWhGSjkKDLUhE0sQV6fadKFBOdDeAVI/ oJag== 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=Tw046dW5+uhhYJLaed8H1nN+PEtNbdWPjJLIYS364MM=; fh=U6T2d4RqSCGJNf6LOIblgdoe4xaHu2Qwae+meUOhpik=; b=LxMRFbwJRPsOoYNIgJohjOazjP21S89W01VlyPFZAMXkXVIlAmFohQj4xECyCGw1ey jmr7lckcOBfqM6GoQyuKcBWlRrDwEQV8giyqxS/IDrSs7507TSH+y7iB9MS8QZ2wj4wi VBOqDWprjnmkAJmzRLZtqDTPbSQxEVu3uEj38zVe4zFOsJ+Txlq/q14hg7LXBIwprSzR zQ/hF3BBhTOyuqfP8BSCwB4irlNszqTX6czmdbKrrERPUp2YDXUTqKBbub/Slz/DiXms Qgz53eCKjzaamRtxbqIqfAZr/+RMZupzwjUnH7SnONXnTosdmLnTZT5GEG0lZdZXlOYj +ifA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YKno2KaP; 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 af79cd13be357-7be9ae84b8esi1209438185a.85.2025.01.28.06.23.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 06:23:58 -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=YKno2KaP; 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 1tcmUK-0008Mw-RI; Tue, 28 Jan 2025 09:22:48 -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 1tcmU0-00085l-NA for qemu-devel@nongnu.org; Tue, 28 Jan 2025 09:22:32 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcmTz-0002MH-3H for qemu-devel@nongnu.org; Tue, 28 Jan 2025 09:22:28 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-386329da1d9so2946761f8f.1 for ; Tue, 28 Jan 2025 06:22:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738074145; x=1738678945; 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=Tw046dW5+uhhYJLaed8H1nN+PEtNbdWPjJLIYS364MM=; b=YKno2KaP2dzwxTaB/PiXXuz+K/eXiPdccvmP5hSAxH1W5+BaYZckgTNiYgtREK3+QR CG2aRMqxBLjGcRAIcy/FM8e/+g+0knSti3rPq2CcKDiOokosZJ4H1bAOTvkPa1o8BQ+h 27690LMDUIt1+hVVBgyCVNbQ9KSpmaQndpP2bZFDl0WbgemVMM5TUo05bShR1FoLnoB8 n+/JILks46I06DWwF7VOfsEwSPUKHOynfWXWu9KR/B9lq49FxC5ao6pewTWKWhBCFzqU j6g1iu8V1V/ukBIS8fbHeQ3MbXuIiVu6KBDFjgAsDXBtvJsaHR81PepaAsIeMBBhktaB Ecug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738074145; x=1738678945; 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=Tw046dW5+uhhYJLaed8H1nN+PEtNbdWPjJLIYS364MM=; b=QN2Eb9T9pcbm1hoLnx3SSLcX7yQB71DVNN0ADFEyiFq6huy0Nf4DNJYOW2KKqAs3t1 L/tz10/PazGkFezFCCQ7NkhfKerKwHxoOYjppF+6hGMLMqhr/DOR+gc4wr3Jn8urb4Ks gzK5vvm0qbgikcGePN8vK+2X5HBvRWj/TAJ7/lMoET/edbmC04RyZ9FXw1SN7qtTYfbS 2CjKOqKdPoewvDZy7N7w8Jy/ZCZbzFU37wAvEAp1Vn7lIoWTqjFAIrJLE4doRZCFO8dq Gx4VxSn4iU3omUFHzp7XxhFI3pcmuYlDNjjkyDKlglvKssBoD0GZzeav5dYqdcHPyCFs MjwA== X-Gm-Message-State: AOJu0YyxUpYyqb96W0q8JPh298n0KhMJChwv/c6Or70WAGpcJH0tXmUu yyzqruKBuBVYvosGxxRoax5gAnFwy8tsXwPiE4hFM1DsTi8s0c81Ro8uv5wdQgk7e9+r/eDEHyV JnxI= X-Gm-Gg: ASbGncvWaq/Gv0fxPhXRkoX//UZKODyLs7CngiP/qrk+zbMDYuKHmEpl6gcO7hNIZnH k4f/RSc6V+3GhfP1CcCO5/UvFRw3SHvNqbCfaNJ48e0TYJRW0YnmCg4zRjjJ8iPLd65OmFMqR+h 3WAZGpml3fzv9ILAueFfX+nW8Q0fBsDM/DQbLGOi0OuIpAkClz4bOsNhvJf+PHy4IGeOHqxSlME pJsep1APKE+dNVp8Zx0BTLQyDTCS2u+Q23Ia+Yi+i1Q/kGV4THsNOHGQNK3mTqGxiOLP9/pVyIP ihAm5eDPot0qqQznhC9IYnlKxGiYcmSe9L5w1KLxoJysf86uxKZXv3BfK94na/AeIg== X-Received: by 2002:a5d:47ac:0:b0:38b:e919:4053 with SMTP id ffacd0b85a97d-38bf57a993dmr44371093f8f.44.1738074144814; Tue, 28 Jan 2025 06:22:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bad92sm14282474f8f.61.2025.01.28.06.22.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 06:22:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Yanan Wang , Eduardo Habkost , Harsh Prateek Bora , kvm@vger.kernel.org, Zhao Liu , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Markus Armbruster , Igor Mammedov , Marcel Apfelbaum , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson Subject: [PATCH 6/9] cpus: Call hotplug handlers in DeviceWire() Date: Tue, 28 Jan 2025 15:21:49 +0100 Message-ID: <20250128142152.9889-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128142152.9889-1-philmd@linaro.org> References: <20250128142152.9889-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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 To call the hotplug handlers with REALIZED vCPU, we can use the DeviceWire handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/core/cpu-common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 9ee44a00277..8a02ac146f6 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -211,16 +211,17 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) } } - if (dev->hotplugged) { - cpu_synchronize_post_init(cpu); - cpu_resume(cpu); - } - /* NOTE: latest generic point where the cpu is fully realized */ } static void cpu_common_wire(DeviceState *dev) { + CPUState *cpu = CPU(dev); + + if (dev->hotplugged) { + cpu_synchronize_post_init(cpu); + cpu_resume(cpu); + } } static void cpu_common_unwire(DeviceState *dev)