From patchwork Fri Jun 6 16:44:00 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: 894470 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615108wrb; Fri, 6 Jun 2025 09:47:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlmsyZqf52FKGiDFGjS6rIc68y4eKVb3ChlKsExsy3fpjcfMRb7kSuO2FlRVwFHKy6mdCzQA==@linaro.org X-Google-Smtp-Source: AGHT+IHdRf5GiYy7ZekelFHA60ro55LZ5XozFHzuG9MLMTFsJh9ro+W+4ombbWVr6sN+deOBaLF8 X-Received: by 2002:ad4:5bc8:0:b0:6fb:1c3:f527 with SMTP id 6a1803df08f44-6fb08f9856bmr64167626d6.39.1749228451754; Fri, 06 Jun 2025 09:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228451; cv=none; d=google.com; s=arc-20240605; b=BErmpIMpvSIsyTTMQMI2ryAkFu+/koY6PWtJwKdTIopOseNjZuTyRXDsvUX4nkg2bn QIoUUjyfeKXkxo2Ypz2fW4yVPOjvOWtmt7yVGZ7RSBnnNSuLzc1kk4o4JyN6SQVW7T23 HObgyGKtpTIAwJx3wwF89IX9k6SaFrZlkQ5w9u4APpN3IawSp3YJyfKyMBOjcuGmHil+ AKKcJGKSSjKX7MvTGIsxgVJf2Kxq2QwtvLwe2d25pnWpUXrCIhoIuwN5UygFX2jT2ru1 FDy4Sn+jQ0V67GOIs+HsjqmTdrSae+RfKbg1oItQiZ6JDksuZtK7lNH221eNkMgLDcYm stLA== 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=xncKsFHoKiGF9zIgTrjiHDIYawtS38KWgNsBt6WFVxY=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=euLQ98ZgcZIPGps6+bY88dWUIJPF+7Fot4GBq49gUx7XlWBIVUPUVmet+XJAe2pC86 gBGXfZH2vMnsATbpu4b8wTw/tNzpyvToQFySEqoPvVZuK30zXuDZIocgbpYU2rsbh++I pSGq9VwcGQGjAKw2O1lfCj4DwVDCRH/2lIpFTvRwSKjgl0MLPtj+g8wM+NTYtoJFYQZ4 qEbZtDUMvr9v7idQBGa+8QAyCodEvS5aWcwhFB+E5MsLmMh10hSzikrG46w6WlUNn4My JpFQ/G34gYIO1J4ID8FyB/9xH2ebB68eL+JFT3eNI4XTZnBRyYa7MzyifQcvYNgODpEF FNxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HXf6s17R; 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-6fb09b16be8si18590906d6.149.2025.06.06.09.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:31 -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=HXf6s17R; 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 1uNaBH-0004bv-FZ; Fri, 06 Jun 2025 12:44:35 -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 1uNaBF-0004bO-PW for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:33 -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 1uNaBE-00037y-9y for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:33 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-451ebd3d149so15384975e9.2 for ; Fri, 06 Jun 2025 09:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228270; x=1749833070; 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=xncKsFHoKiGF9zIgTrjiHDIYawtS38KWgNsBt6WFVxY=; b=HXf6s17RHu9+jhRY3KIGpTjtqQZPorQmREls4ISU2+kacWeBvToKBh8ZCc9TlGlO77 p7zaENBYyxWVegHRzzsw1/e+8ohG6ZUp1m/flTXmS5e9EF6CO1szL44Zfhn0RFJl6Z3A qxVm4zkghxa3d+O9/FH/wK5bTxLHsKLRpDKdHGm3g6tasuTHgHat24v3nuG0JW8aLm54 YIfGUR8nAF3f0+cGGfCgyZj+oUgxcF8nr23jUiBDEYWT5MRv2v4t+nvlrTS9Q6XVO7B8 rKmHHMH0eH/gChimFlbzTceDRdCRyo8L/6LbViPF2LMz5rXAFyVyvNuXHNLQb4ua4UWA ze/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228270; x=1749833070; 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=xncKsFHoKiGF9zIgTrjiHDIYawtS38KWgNsBt6WFVxY=; b=mkuRctxhiDIYqOmNV+SVF8q+ZsIYLfhNzMxPSuzU1zx4pTCpBDFNmYakvTTwhEqyzG WVnLJwMq4an7g0j/76mIHCvh01MhW9awJdf+UmXpugp9jO7k+Gxmj0nQIduYqvXPt0Hq ButKyrOEL6GZugVkCJuz/03+FftKdOZLxqXEGiSFyfQ3MFX1CW6OffABstmVyO8Onm7q 5oZh+UucZxZPD6tVUfgBn93FiIa0RGGXiDoDpKIE55GOce2iQ00mvlHPT3ycLP89yLrk x5KWlSZ3i5ajgYirDLhpKc07sfVlTjroq62EDiaH1P+M/2zhnzw0etIEnCC+BRjs0jnh gmvg== X-Gm-Message-State: AOJu0YwBbOOxcAQnaVR0h0yMNid03yRcysb7PJXQ8qF76U7gMNjbxCCQ hvh6bnjikAPbcuuVfz3gt6viEGPeOhRo2CVdMKL8Jg+j3EEHRvColSem+IdPbes7GFJo8qOCkMl vTHWbT8Nkww== X-Gm-Gg: ASbGncsU5UQ8cksZymGD3ImcY69ZITsAUXEb3DsEVY+ruVgSvjoctUdj0SaUgRUvclm BPcyrzT0MpWKMMKL8vMCBIwAy5SuR+eetiXnDTqa8CWLi7U+cxk+j4vTjjWYL2zcBNfuWEMvZX9 Y/2y0osZtmDZAy2kaYk1HRsfjTKDNBgxw/FkrRdlp9S9WcoD+khAWOVvC1dY15CtqKqBWwB/Dme GBPIXQ3VxjDfmWc7STRpgCMq36YlTivO9H9GgKS+nP5lFEcDa2jWykPPMV/iezyusmywATK0LKW lew4BhLz6yXrjDXn27c8olqwz7QF7eCEFSLor3nar7Swb60zkpWud6+oWXUypUsviD8Ait9A8Sp dQ3Hke5BlWgQEQZvmWwUc1K3JXnMbIOc9YwuJ8tj1Tz7kaDfN X-Received: by 2002:a05:600c:1c1b:b0:44b:1f5b:8c85 with SMTP id 5b1f17b1804b1-4520139c741mr45039555e9.13.1749228270392; Fri, 06 Jun 2025 09:44:30 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4521370961csm29805915e9.22.2025.06.06.09.44.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:44:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension Date: Fri, 6 Jun 2025 18:44:00 +0200 Message-ID: <20250606164418.98655-2-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9a6cd085a37..d55ce2c0f4e 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine) exit(1); } - if (vms->virt && (kvm_enabled() || hvf_enabled())) { + if (vms->virt && !tcg_enabled() && !qtest_enabled()) { error_report("mach-virt: %s does not support providing " "Virtualization extensions to the guest CPU", current_accel_name()); From patchwork Fri Jun 6 16:44:01 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: 894458 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614079wrb; Fri, 6 Jun 2025 09:45:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVeC24Zau7ajWQWVTdCfZ7pE1dszilejqOCvqCq2MCv6A76vSmvL34L8j/fg2Mvk6LNJko1Sg==@linaro.org X-Google-Smtp-Source: AGHT+IHD+8PBOYUb2INCZMaRJKz/uvd5PwwvxRH6Qt2r157YpflyYJSA9AbUE5OgmnrRXCO9q7XV X-Received: by 2002:a05:620a:1a23:b0:7c5:50dd:5071 with SMTP id af79cd13be357-7d2298958f2mr720241485a.22.1749228315469; Fri, 06 Jun 2025 09:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228315; cv=none; d=google.com; s=arc-20240605; b=STtoCM6IZJaCxIc9dF9zsw/2/bmk9bjggC3rF4qEpNXB3AY5KIfmu8dB4ZUnkNDWtZ B/XucPLB7hU4WhORW4GIRS4n+92MIj8wEv2vLHd/DMxoF0f9RQeKz88XjCWiRxvNgtrc H5G/LxiEHyF1CbdamRyJKPbqfSVSKmn44VkARPVq5qO8A4aEhozzGLIe6mMt515p1Wz2 P9hFqho3DmOv/L6R4RbnBCoC1YSwm9niVcCEW2epgd9nH7vU8x654MIwpwznKyJILI1T GFolKskBg/YFizDSNuFCvgykBnSQyDGYZk1ULiYxuKGrJQd5i5IpBZvAV2vELRmkZZih uYjw== 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=u7VQXQKp4F78pUbtbCAb+X5WWO3G+XUjvRGKunsuffg=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=EeLYrCxVgsHcZ2BF7OI1GK8Nfq+m8WR8p3c+l1xzulLve13jtNhjIH4zhlCQ4qK6dk JsG2aHYtnd5tNSo6g9jBJeg637OQ3jP/RXQxl9awP0WvznqVhX0r99OggXBJElTe/hnw 2VV/1yBEmS8rAYWcEfyvdapRqwSXac0PV33FFaOKyCNIY4wTPfIm5rSSXJzsIwV1DNCy O5H3cNQ0ipgvVZu4Uf9HnWkFt5+Z9VQD984HXe7k5fROajH4PRSWf6tQVQbptIYk5/pO 9Lz7PbvHnJQaFyltMbIEOQSkJzgRb8nfVP4AIhA1l7UxM3YueJyMpi8VCXauPxS9n5fe 6Nmg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hC6/cauA"; 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-7d25a532d92si206230185a.138.2025.06.06.09.45.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:45:15 -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="hC6/cauA"; 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 1uNaBO-0004cT-Tj; Fri, 06 Jun 2025 12:44:42 -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 1uNaBO-0004cJ-3n for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:42 -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 1uNaBL-000391-P2 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:41 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-450cd6b511cso16138525e9.2 for ; Fri, 06 Jun 2025 09:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228278; x=1749833078; 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=u7VQXQKp4F78pUbtbCAb+X5WWO3G+XUjvRGKunsuffg=; b=hC6/cauASZE1iB0zRzypvoNtfFWAkmm0QkKmKNsO0/T3uoIiz0l4bRT+TRlx6WywKv G4LpFY+0GMtVkJtciY+iZ+tXWvHS+sxIhH44ghF4vugCS7DKCMVaNORluWvO+Mf99sr8 QIKXxjL5KgWZAEavuc8b5dn1SBXaIMZUSUqWHqZVzEcvdGOk8yUifCXW3jQDz9GHucCU OK40UkxcvSlqNQ7kj8gNSym/KLflg++Gd/nLjhi3/GGevEkXcp/8w3pLJ1amBqgDDzFN X3w7NM0zuGcHXyZ9I5BfcJWJRulvNWEzK0k80Pp0FlBFloxHbnONr3WeuwbGdGqQslbw B4OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228278; x=1749833078; 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=u7VQXQKp4F78pUbtbCAb+X5WWO3G+XUjvRGKunsuffg=; b=g/X7ci88PfZ2R4s6x0JOggctN3xLuD26ZAEk2covRZtjZSijYk2RV+fEs8yH2/dC9L xvwvj/M0fAzKPo5sgwE8XUe0y9Ubk54YHjUrr71eoA29PMHqijqqudghQ2JHCTxlRNY5 SUH6o83JszGk+hfN0EDmtgjm2hGE31YtlV9yKBb/CJWR5Rl3E+33jUkVznPtW57WpNyj Kfz3OJgi3ffJbHz/7CJIjzn1f+nbCX8NJj481DXcpBoxQALJNRPnoK4R86AUuce6yUDV BWgH4fcIWA74y/rblPzAy/iLA4MBNRULBS+j0Jb1yzKEy1/aNs6iBttEbLRtIuEnf2Ms acNA== X-Gm-Message-State: AOJu0YzQ7knnzYCfTCzKvVnHA6N5DzpGNDagU45dwEyTanT97F9It2Az 2rD2zEzyon+87+WBHpJJzqOh5e9VbF64opYUmy3/sNhY9ABeNea6jtfQI2qNkfPyHmLbd2siq+q yaZ76AGWszQ== X-Gm-Gg: ASbGnctui19xVV1Fm4nYwYS+8wZoBq03VslROimJHzLcvXH1c0N6/5wZ4iiCs1Pm7dN OyJbq2jsdXgjByB3wh/oUgiWNk1xrAOVC+23AVHviWpoMmhchdfu4IXLAIOJ2Q8j4dPBFo2wQjv WZQsq2j9dwTQxe4LlCQDb2mxKFYvEKRRwo0za53rXZt8gGGC0ZxHEls+aCpewDqTSmrq4KyMzG1 0NiVJhMIUty3qtMlNK1RAcSh75Kq0X1ajkk3A7gwOAQq0aQBe1xgqWrVezX2Vckw4ZTxrwYstwY kCdA5xNTYx7gYxZ2OreylXOJB5hwbt8QjzV90kwy6EBMUbqr8XK3CF7JB/CBunF2snm68MjOOph w1uLK01FWE1bazTlyHAicbWXdwvBVNLiYQTpch2L0IupBCqEI X-Received: by 2002:a05:600c:4712:b0:44b:eb56:1d48 with SMTP id 5b1f17b1804b1-45201417ff5mr48369655e9.4.1749228277642; Fri, 06 Jun 2025 09:44:37 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229ddf6sm2352584f8f.2.2025.06.06.09.44.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:44:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 02/19] system/cpus: Only kick running vCPUs Date: Fri, 6 Jun 2025 18:44:01 +0200 Message-ID: <20250606164418.98655-3-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 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-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 As an optimization, avoid kicking stopped vCPUs. Signed-off-by: Philippe Mathieu-Daudé --- system/cpus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/cpus.c b/system/cpus.c index d16b0dff989..4835e5ced48 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -494,6 +494,11 @@ void cpus_kick_thread(CPUState *cpu) void qemu_cpu_kick(CPUState *cpu) { qemu_cond_broadcast(cpu->halt_cond); + + if (!cpu_can_run(cpu)) { + return; + } + if (cpus_accel->kick_vcpu_thread) { cpus_accel->kick_vcpu_thread(cpu); } else { /* default */ From patchwork Fri Jun 6 16:44:02 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: 894472 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615474wrb; Fri, 6 Jun 2025 09:48:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcP4p30LbrFtGyltTprHecTjC7JxPcB5/Js5OPMpJ3o52OsfAkiUaRuOUebCvg+pnWyGHwFQ==@linaro.org X-Google-Smtp-Source: AGHT+IGW9H0YxW7/e0JcdCecdhl0OKFOSWLZZPkRSZN5dcffLavkT6NtRkCuiatswoj4GSI3/9vQ X-Received: by 2002:a05:620a:3729:b0:7c5:9a09:cb73 with SMTP id af79cd13be357-7d22987fb07mr585336785a.23.1749228504952; Fri, 06 Jun 2025 09:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228504; cv=none; d=google.com; s=arc-20240605; b=EKCHZpUSomlf7zzoPq9BP0l+fZZy9J94M84UXSLbfIKMf63npqFRTWE/VbcRnJIG5Z RF3RfqiTxmadvyRnd/pAIEjXL3wY+tJcTkolHM5lpe0P3El4ruOrR54oFwJjw8D6Indb Cjmlr+hjUVGYq6dVGL6fuC4L4naDSIUGqRetcqlq5Kx2+2OUgl6kq4gf3LpuFOjU/FBh yGHsy76Oe2ErObf1LLfK4etxVmABsu83tgMO/1iL4nbwyV7k6iZHFYdtr29gC9lN4Zpg 6IiiS/YrOqEGpL1/lZYqdJunJgJT2FSyePka///R+G6znCESr4AuFWTSMiDk0e57Furv Clbg== 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=aUp6HMosko5+RmwM4ev7KubdCI/J9zGOgFIy4jTzBlM=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=ddMWk2Kn7WDiwez2WqzGwtrYIo8etqyHK6/KDlUnOPZM1d9ofV0+QMbA7t8jQO5V/n 3uZaRafOunqaMvt7tQCqFxCAS9Z5JAMEmTTTt+iu7I6iTyb+Pi8DOgXFppC7oa422s46 Hg7uQW4t21gy1HLp3e5yl0TMvTLoQMz24MIPMzoX+T12SPbLa/64sPabyPbqmhR0ARow nCCplxaub91+11KZfZxAvJBxyOVOeD61WZeg64G06x65N2VNyR3L35oFLQbW3uDUU+iP 45yZ9bCOBDT+4rNqJUEe+Pu28cP4S9wR3hUVQset7rPGdgForQAd7Qh6qxJYguHUoQDo xf/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qD9yirwm; 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-7d25a5ece3fsi204967485a.204.2025.06.06.09.48.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:48:24 -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=qD9yirwm; 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 1uNaBW-0004dZ-8X; Fri, 06 Jun 2025 12:44:50 -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 1uNaBU-0004d6-N2 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:48 -0400 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 1uNaBT-00039w-2a for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:48 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a0ac853894so2065663f8f.3 for ; Fri, 06 Jun 2025 09:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228285; x=1749833085; 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=aUp6HMosko5+RmwM4ev7KubdCI/J9zGOgFIy4jTzBlM=; b=qD9yirwmj4TVcKhAn0p60hkJ/dX9w3BSjwR75fQ5aOiibX8QfTR9/9YkHvp8iFZ8O+ MN6z0+jrVUzSA0OZ5eJRoSsDxr3IJj6RSozezFq+1n/64Pl8rALHfGNlD6b9SAfyS3/l BBAuMFpE4YNp7ty7ULcY7L5+0EM8OjEQ9oJamSMLjy1MYERgDp6BfH0L6kBIJH+JffeQ /JOIHtAfzdVKrr7DCAXM3oiTL2RBZiQ7FCErl20jR/eZvXcV/kzpmpDjUPyzgKQanHuU u6f8SDmY2PpdPmFT2EDZlRTqymZOHlaqpmmLAr3400NBC1VNJ/Lzj5We2KLgUd64z/RW 3vtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228285; x=1749833085; 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=aUp6HMosko5+RmwM4ev7KubdCI/J9zGOgFIy4jTzBlM=; b=gu5xYOBhA/EwSaC2lY0SwkXvWP8XqixUv3/JwMXaOBC6Gg97EQf/lAdMwBuPVwIuHW 6IyrQJfMknQWONVxzk8NldLs/YnUU5A2KyYt9FNh7Y+fYpk30QLk77xtv8g4nvqQxizf fXOApb+RDBGClVaWmcwud5AJfDFpYicQGngDa4qHAcT06YYSMKYo0M3zkRep9EhNPAc1 41HVRT7T8PhjaNHkEISdXWBEn1p90DEghFjcGsk733XH7ayMuKLqN5c7POdX/o2D6j8M K4lNLe2DAR29DKHj+v6DX/LBPPVXcHbV6oVCgXxk6fpchoBprUBnSfVoDo6CY8p0vMlB wE6w== X-Gm-Message-State: AOJu0YzXIJpbuH9OY20qiJ1X4H1YZP53l7STfKecUy8W0QMRBfWgOkGL EfCKzA8CWxmXRm+AES6+i7cYw0oFDpWh948NUN1K+AHR5PzXfmZhkw9J34rw2uZCRF37A0ivOPi eAwIDU8E7iQ== X-Gm-Gg: ASbGnctZHEHI6rR5ZXtom6l9RPJUU9BwncOeNB9rcaVdvj0B+Z+uBsz94H2qr2D0OkS OEmeakFmoSTq0EhCoycrDPOheny5IHtiqaRCCqFTbPy656vJpsSMFpX79hL+ADyiG//4bobQt6z /JzJg64LCFf908IcGQGI/M8M+xiuNWzqyl173AGRhhQYDiGkb3vXzghY9taLap67vSr+ZLLA+0l fMJxqtcfv3YjOxGxzowqGG6EvMhCigPohEpGjDEXXZ6UU43Ebt+MHA/whqjVERpD26IpCa9EzuQ kyE/463rneKA6hn88Rj1hWhTpLX4c6XrF2aqmxM75MoXHRulRMcd7yqR7a43FTAn8CMORXv6pEh SFQgZHWtuRJDjBCLn5zaSMCLDH9qwyqLtnA9UohELJS3Sb2Dm X-Received: by 2002:a05:6000:2c10:b0:3a4:e6e7:3acd with SMTP id ffacd0b85a97d-3a531ca7d4dmr3344706f8f.18.1749228285001; Fri, 06 Jun 2025 09:44:45 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229de70sm2304909f8f.5.2025.06.06.09.44.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:44:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 03/19] accel: Keep reference to AccelOpsClass in AccelClass Date: Fri, 6 Jun 2025 18:44:02 +0200 Message-ID: <20250606164418.98655-4-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-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 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 Allow dereferencing AccelOpsClass outside of accel/accel-system.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- include/qemu/accel.h | 2 ++ include/system/accel-ops.h | 3 ++- accel/accel-system.c | 3 ++- accel/tcg/tcg-accel-ops.c | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index fbd3d897fef..23c62cbeb07 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -37,6 +37,8 @@ typedef struct AccelClass { /*< public >*/ const char *name; + AccelOpsClass *ops; + int (*init_machine)(MachineState *ms); bool (*cpu_common_realize)(CPUState *cpu, Error **errp); void (*cpu_common_unrealize)(CPUState *cpu); diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 4c99d25aeff..44b37592d02 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -10,6 +10,7 @@ #ifndef ACCEL_OPS_H #define ACCEL_OPS_H +#include "qemu/accel.h" #include "exec/vaddr.h" #include "qom/object.h" @@ -31,7 +32,7 @@ struct AccelOpsClass { /*< public >*/ /* initialization function called when accel is chosen */ - void (*ops_init)(AccelOpsClass *ops); + void (*ops_init)(AccelClass *ac); bool (*cpus_are_resettable)(void); void (*cpu_reset_hold)(CPUState *cpu); diff --git a/accel/accel-system.c b/accel/accel-system.c index a0f562ae9ff..64bc991b1ce 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -85,8 +85,9 @@ void accel_init_ops_interfaces(AccelClass *ac) * non-NULL create_vcpu_thread operation. */ ops = ACCEL_OPS_CLASS(oc); + ac->ops = ops; if (ops->ops_init) { - ops->ops_init(ops); + ops->ops_init(ac); } cpus_register_accel(ops); } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index b24d6a75625..da2e22a7dff 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -198,8 +198,10 @@ static inline void tcg_remove_all_breakpoints(CPUState *cpu) cpu_watchpoint_remove_all(cpu, BP_GDB); } -static void tcg_accel_ops_init(AccelOpsClass *ops) +static void tcg_accel_ops_init(AccelClass *ac) { + AccelOpsClass *ops = ac->ops; + if (qemu_tcg_mttcg_enabled()) { ops->create_vcpu_thread = mttcg_start_vcpu_thread; ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; From patchwork Fri Jun 6 16:44:03 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: 894457 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614052wrb; Fri, 6 Jun 2025 09:45:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9Av9ddnSWep1peLeNGQEn+x1K7PuArsoKct+tKSWFztSAw9VMixzZJ0hOBpQ4N4ku+FfkkQ==@linaro.org X-Google-Smtp-Source: AGHT+IFVZK5IoEH3Yqghh1nKhhTrlrgM1Y+Ugx5Zc4AovLZAeIENJ0GjZzYsK1CwDxP7vYRjvNZp X-Received: by 2002:a05:622a:4293:b0:497:6a94:dba0 with SMTP id d75a77b69052e-4a5b9d325f1mr58379571cf.25.1749228313107; Fri, 06 Jun 2025 09:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228313; cv=none; d=google.com; s=arc-20240605; b=Nb0OZmTHnSIvNCpRtSd1Y/9R5X1VVQdHeXvO21Xke6KERnFNmnFtJaOLfDXTyoR4dk DVemC4PriiJZ6zWYwA2z3VdRgx3+J1Nqo4zzjF6syf7q5BWss7SeQubb8l5A4xN/dYdp jm3tQhrMJki4IHqU/k97u/eK8t/wBCmgfmuwxBSliQulS/o8x/pJTqckZo9fkNg7Dgd+ HCZbtBmuIBMEPRq3V1/9lq27cKw60jdlyqrSPUIcleNxfTBKg3fMFEWISYKNCx7CKm64 N9KPHLvtGX8kQ078oK+gWDExBewf8+/XVCIWqJZHeGaXYv5VrlU95CuUwNWfKDwX9fgz 81tA== 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=YiFuAm3OZkIEGknbm0ayReT0Cz2T98Om3bMRx4Pxr2U=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=ZsYkPul4uKnJrpotrfDHVllwW6ErUYYSqOK70lKgZTAMeXBc2HmAgcw9egI0NU4Wt0 puZmmwvFvvFHzyHt0SelP+wxjNcewhL7NJ2pjpOweqRCMv4AsxyTctLPOveMyLFxgJWU S/8Hu/13ZOrRkJroqa2+Mk2L3YX8s1L402FFuT7qoiGQKigZ+ioM96HKSUZsXUtNKnDT uBWlelO5qcV8RsasfhsMJ+koRD6ck6niBHranwfCOHbU2SNH7Zn4wLD/7k7alrkdUU+3 /6MH80QzhCwTVeV4hH+sMUVXy4AGSLmXpTO+tczfmtW6NWXV+LwqDX9fG04S68CtJVNi u5FQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HTYrAL3f; 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 d75a77b69052e-4a61985f0b4si21061081cf.179.2025.06.06.09.45.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:45:13 -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=HTYrAL3f; 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 1uNaBd-0004eG-Qe; Fri, 06 Jun 2025 12:44:57 -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 1uNaBc-0004e4-Dv for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:56 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaBa-0003AQ-BE for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:44:56 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a375888297so1491059f8f.1 for ; Fri, 06 Jun 2025 09:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228292; x=1749833092; 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=YiFuAm3OZkIEGknbm0ayReT0Cz2T98Om3bMRx4Pxr2U=; b=HTYrAL3fb4fBBqaMj4MLPp6DdkvLllCaX8Fj1+ocz0IeEVAK2CqAiT99O0CRuM/Yug vrK4BQaAOhdQ1AjmuE70H0eKWwIKBJldwW8VN7muY7T5PeQQgcN1M7+iOs96AHU6osoL UKmRvMLrYdnAOW570YMmu9IAzveX0L8zTonEIEhBTqUhmjlBQ6RAw+RCMhVdDkQj4Y+e 6rJdw0KmzQf9Y/gCD8HdmSee01u5Qls36+YFaArvDT5N8lf2qlJhDRXTVvYJK9WpCu0I yuOnJzItkUrrZkw7tekfMTaM+UQ3yfT2aHO113iJi393E6jccWNwOYdZX5rZLkp3omHW zRXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228292; x=1749833092; 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=YiFuAm3OZkIEGknbm0ayReT0Cz2T98Om3bMRx4Pxr2U=; b=umRlTaoSF7CyK0qoRly17PK9UYtl7AdRe0vJGGRbWMSd86Mvqbtdxr5RYnfqe8i+Mm ms1p83WwsXpYjUTgi4wuPVstJsG7OpVQKpFDrfmhhlRqp/n+uFDBzKrWoL4YSMRjKfX0 KI1LOOoIB2HYw7edrHtQi4MZ2D4m31+5pelJmYn0QzzS+XU73OnuOcO7hSHIfABQAwo3 GAonHDGIrXQZsXRLB8r0JUxnJjJVp+p6aMZ8ckzTYp/QXPRPmbiC4jqiY48rxr8VhIo8 O/4/2oJ4b3w0ROxR3FWarFGW9XZSVAH+BjPSvnN/sKxosjaySZwKF7Au2tMXxrYxon/S CTfA== X-Gm-Message-State: AOJu0Yx33V0GyMFTYFlczH7o2jdFcqGij9ixOI8rGD5Rh3DV/7Vjjv6S tmufeDeGGfo1OaS0H+va1aP2QJE74KOTS2QocdOcU3BY51yoW45nTelUrTlKJxQHHMc3YxLxvAh s9Wk5cBGSqA== X-Gm-Gg: ASbGncsjA532a/5QmDDinsFUHnEqjgjdZ065eYi5McsXTprm6x/jeF0Wx3dAfBXGIp6 0wf/tawKfV3u0IFXKoqgldf/ya5rZQSmaWWoNqHduKSpi7hIrwHyVnV9sDA2gMzI0iVi6i+Vr/A wtIOvS1KAOaDE05Ozs6CYBqb5q9KvTqVAxeaGis5dDQADq6Od/zes3LsTGwlTvYG2aFpYWdpBQe oLPmg4X57j7PKWczHtyEwb9us44ZtmMr6fNOuQtxwwcPRmAhGKDChWLGrmDVOJDKYwBY/rLWTlC 1NTItOc6QIyan02zW2o2QLx5ggmgUxGBN4ylEqT+e7MF7ACnk1ovlAgWeOsG8EEVkvQ3jZQllK7 bkP3x8wUfllJ2TbISQLFAKZyJIw+jEXMZtmrUQDs6bDish4ZY X-Received: by 2002:a5d:5f88:0:b0:3a4:d79a:3599 with SMTP id ffacd0b85a97d-3a53131de7amr4116329f8f.11.1749228292257; Fri, 06 Jun 2025 09:44:52 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229d9ddsm2360075f8f.4.2025.06.06.09.44.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:44:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 04/19] accel: Propagate AccelState to AccelClass::init_machine() Date: Fri, 6 Jun 2025 18:44:03 +0200 Message-ID: <20250606164418.98655-5-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 In order to avoid init_machine() to call current_accel(), pass AccelState along. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- include/qemu/accel.h | 2 +- accel/accel-system.c | 2 +- accel/hvf/hvf-accel-ops.c | 2 +- accel/kvm/kvm-all.c | 2 +- accel/qtest/qtest.c | 2 +- accel/tcg/tcg-all.c | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- target/i386/nvmm/nvmm-all.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 23c62cbeb07..c660c5f4b11 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -39,7 +39,7 @@ typedef struct AccelClass { const char *name; AccelOpsClass *ops; - int (*init_machine)(MachineState *ms); + int (*init_machine)(MachineState *ms, AccelState *as); bool (*cpu_common_realize)(CPUState *cpu, Error **errp); void (*cpu_common_unrealize)(CPUState *cpu); diff --git a/accel/accel-system.c b/accel/accel-system.c index 64bc991b1ce..68d2f28388b 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -37,7 +37,7 @@ int accel_init_machine(AccelState *accel, MachineState *ms) int ret; ms->accelerator = accel; *(acc->allowed) = true; - ret = acc->init_machine(ms); + ret = acc->init_machine(ms, accel); if (ret < 0) { ms->accelerator = NULL; *(acc->allowed) = false; diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index b8b6116bc84..3dd9de26dbb 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -315,7 +315,7 @@ static void dummy_signal(int sig) bool hvf_allowed; -static int hvf_accel_init(MachineState *ms) +static int hvf_accel_init(MachineState *ms, AccelState *as) { int x; hv_return_t ret; diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index a31778341c2..5b28b15ccec 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2567,7 +2567,7 @@ static int kvm_setup_dirty_ring(KVMState *s) return 0; } -static int kvm_init(MachineState *ms) +static int kvm_init(MachineState *ms, AccelState *as) { MachineClass *mc = MACHINE_GET_CLASS(ms); static const char upgrade_note[] = diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 92bed9264ce..c5a53ecb6dd 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -37,7 +37,7 @@ static void qtest_set_virtual_clock(int64_t count) qatomic_set_i64(&qtest_clock_counter, count); } -static int qtest_init_accel(MachineState *ms) +static int qtest_init_accel(MachineState *ms, AccelState *as) { return 0; } diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 6e5dc333d59..6c5979861cf 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -80,7 +80,7 @@ static void tcg_accel_instance_init(Object *obj) bool one_insn_per_tb; -static int tcg_init_machine(MachineState *ms) +static int tcg_init_machine(MachineState *ms, AccelState *as) { TCGState *s = TCG_STATE(current_accel()); unsigned max_threads = 1; diff --git a/bsd-user/main.c b/bsd-user/main.c index 7c0a059c3ba..ad2032a8b01 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -474,7 +474,7 @@ int main(int argc, char **argv) opt_one_insn_per_tb, &error_abort); object_property_set_int(OBJECT(accel), "tb-size", opt_tb_size, &error_abort); - ac->init_machine(NULL); + ac->init_machine(NULL, accel); } /* diff --git a/linux-user/main.c b/linux-user/main.c index 5ac5b55dc65..2441e6edc71 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -820,7 +820,7 @@ int main(int argc, char **argv, char **envp) opt_one_insn_per_tb, &error_abort); object_property_set_int(OBJECT(accel), "tb-size", opt_tb_size, &error_abort); - ac->init_machine(NULL); + ac->init_machine(NULL, accel); } /* diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index f1c6120ccf1..887534d4ca6 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -1153,7 +1153,7 @@ static struct RAMBlockNotifier nvmm_ram_notifier = { /* -------------------------------------------------------------------------- */ static int -nvmm_accel_init(MachineState *ms) +nvmm_accel_init(MachineState *ms, AccelState *as) { int ret, err; diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index cf6d3e4cdd4..238c3b95c6f 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2505,7 +2505,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visitor *v, * Partition support */ -static int whpx_accel_init(MachineState *ms) +static int whpx_accel_init(MachineState *ms, AccelState *as) { struct whpx_state *whpx; int ret; From patchwork Fri Jun 6 16:44:04 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: 894460 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614227wrb; Fri, 6 Jun 2025 09:45:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMMO3ekO0kdIBPYOidHdK3uf0N70m9Hhq7UGAlM+R0ma+2MpMXi+9m/G9F6IVhIsjSzNTxJg==@linaro.org X-Google-Smtp-Source: AGHT+IEayD9RXDQ5/1ORUTm7ri1qw5cYbIXNALTRrhblgrCy8cTFqogh9cCVKA5hGyxGQ5lZrfr7 X-Received: by 2002:ac8:6f08:0:b0:4a4:3d43:6e55 with SMTP id d75a77b69052e-4a5b9e00684mr76082521cf.2.1749228332812; Fri, 06 Jun 2025 09:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228332; cv=none; d=google.com; s=arc-20240605; b=HGmEaSxA+MmWPDt36taN5MWmKNcSep9QiQylyBdDX92LOp4gc4UiulMZeossGFIHLC le9bAV7kTRRTUN3GAxt9om20jmOxBsyqI810Q4U41yDIjk8pr5fPPyIm74lUyKaQVVC/ LVmqw4kp2I9NkoJngbn6FwybLCTpm1ONOMqKgLnJ5S/FEwS2NgPIH5QUseUED+QvyXXz vA9VrTi+YIIo8eLym9bSuuCGLll6oZc+dIfNko95OmPqUeHU+1t4WSdPEmDVS5wg2UOu CWrURChxXcNqJRm+jdNiTZ9xSwIgfJCRLV9KMRa+qGs8nmD6kt9TkjPpK8BUrO2JdsFJ hbaw== 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=/gEDjW5HxfekGeOmD2/G2kge4npJYt8IQAdDV18MsLw=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=DTjeAjF++cenX2W1XFTloMWmEYG6HQIHJZgAlVcy5JpuoXT12lVUXaJU4SG1DzyUqF ShD8Nw93ZIkc7MKYiVAJ/Z9JIizHGqIiLXV0ZWZFtte04P9vsa9EKjtjunwD6d9cEEO9 hWOjXm7h68+xbu7zpgasuDpYxCyj6hE4gGM/Rko62IV09R6trNQ3nbLfFKpL5nul0Aqy Z3tp0sHcco1yWGnGquEhoJIzSobpTaUOF2EbZOMXkQ7ACfognRNt+qf51wV78q53Dvjm jzRt9ys4UUiCP14eF7eXlBrIeVpNt246Bi/mAqWi3Acyh5sbntu6QATCbGKERvksIDMM wHpw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hJ7wu2ia; 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 d75a77b69052e-4a699ac291asi18179881cf.251.2025.06.06.09.45.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:45:32 -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=hJ7wu2ia; 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 1uNaBk-0004hM-BP; Fri, 06 Jun 2025 12:45:04 -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 1uNaBj-0004fw-67 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:03 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaBh-0003BC-LX for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:02 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-451d6ade159so20489345e9.1 for ; Fri, 06 Jun 2025 09:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228300; x=1749833100; 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=/gEDjW5HxfekGeOmD2/G2kge4npJYt8IQAdDV18MsLw=; b=hJ7wu2iaEP2t9rCQq/e2VbEO8mD4lxcLaHD21ubtZsTGSGYGOb2iTkFNFMXtmDIdpq RxzEpDSSOL7WDGjOQC4fIX/s/AxOjmDv2wPYlebXBNcFT+DmKjxCA7+aRs3ZMKeLIs5t /RJyC6qDxOlhBRdTb/xAyDo/UDqq+GG/XPBbd/yidDlwJk57UUGsjXM5TaRExwHdfCYA O8RaWVM9Cr6De1XY9TZDjdyBnh2A3W7zwcGUHefXFSlCpRymcuaa7v+I0xB6rL0xcmcn ObDWraPDrV/7nHu6sh9XW66fsMdxBckIxdYyfiYwUtI7V75uBhJ08GpvX6R8vZh5LqQH mOAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228300; x=1749833100; 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=/gEDjW5HxfekGeOmD2/G2kge4npJYt8IQAdDV18MsLw=; b=QvxhroxHWf+uImmIv06WoKPPXT0dHALg/3Qlp4jDR520zam6Bgn6v+ivfYZu1eXcuj l3Y99jex6/RcHnW2Hf+pFBJSnZ07D49br+DjSZ5DH5NqMKmtZ6waLvdyaEADeFVvKOCr FDizRN3B9wCAuROfuoy9F5qTCMrHT1XC1kt9YowIXYuWmD1U0wnCmp+jqrCG2iDKAp/Y WYFeNFvw4Y6B9mr8wPN0O2ZmGmuTNh9ZNdj4K7Pzzol4aJRQew64NC4Tu+/I8w2t+bGm +GVDUPrPPwqC6DT3kZmJWCjJwBSaCSznYvi+1QaxRGc1UxdjCkK4WPQxuM9dOojVbJay /CtA== X-Gm-Message-State: AOJu0Yyx1X5PgaGnR3TDHb9LZBYL7d1BJ0hEjpccaewrqGaHYpfud+Kd dZOZxsF3BxZupwrJY1MRAfNvKHt4m/VzcDI+ar0b2s1uGwDuuAtuR6aF+vuigwMJWC4sq7Y8ymY f5mq1wuOTAg== X-Gm-Gg: ASbGncvXF0HQynX4YWU4QOK5CbS8TQxr6FxboTP8mkxto7seJ1AtoNfZs9DNmCvcHe2 2El8mV6KdOgiXgkK0SjVcggJ0Uyq9EmEwOc+sZ91vr+MD2MwwyLGp0+uNgahM9aDUAGXLB1CRe7 7zulMcJ4MK7El9leCS3yLQnw183J3mqgr295nyTb2t4cWp/ZU0m9SNja5zvUodcSCDgg8JxSFK8 zxi35RkT8vU+EgdRMwuzfM0gzgGeFfO4p7iei4uIe7tsuRnT9dH50okTQlsgE2zZxJJ/e/so8cs kqNkCOQThuSfj6dAnwv90USIf2c1vYAuZpqyaJ8lVtl6xwmlQooYvKwWZNoTL75EfS/II9NoRxg 16ZI6rD7z0Icd5dp5VMRceNQSyynaX1ljHfwjGfD41Ic0TY9t X-Received: by 2002:a5d:4acc:0:b0:3a5:3a3b:6a3a with SMTP id ffacd0b85a97d-3a53a3b6a81mr238000f8f.54.1749228299690; Fri, 06 Jun 2025 09:44:59 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452730d1636sm26638875e9.38.2025.06.06.09.44.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:44:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 05/19] accel/kvm: Prefer local AccelState over global MachineState::accel Date: Fri, 6 Jun 2025 18:44:04 +0200 Message-ID: <20250606164418.98655-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/kvm/kvm-all.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 5b28b15ccec..551a462926d 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2582,15 +2582,13 @@ static int kvm_init(MachineState *ms, AccelState *as) { /* end of list */ } }, *nc = num_cpus; int soft_vcpus_limit, hard_vcpus_limit; - KVMState *s; + KVMState *s = KVM_STATE(as); const KVMCapabilityInfo *missing_cap; int ret; int type; qemu_mutex_init(&kml_slots_lock); - s = KVM_STATE(ms->accelerator); - /* * On systems where the kernel can support different base page * sizes, host page size may be different from TARGET_PAGE_SIZE, From patchwork Fri Jun 6 16:44:05 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: 894459 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614151wrb; Fri, 6 Jun 2025 09:45:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1QU06WGxB4bQMFyEgenq791YkNWs4IpmMF2RDisC3Q0Na+H0Tbg2yJfki+4jhCxS6bG3V9g==@linaro.org X-Google-Smtp-Source: AGHT+IEGmW3BtZxNneV41KX/Fe6IaWwUM7xptRZ1CYPcUE3+ahWnwo0oIg1dX+1WrrzLnFkbCQjO X-Received: by 2002:a05:6102:3fa2:b0:4dc:81b7:f031 with SMTP id ada2fe7eead31-4e7726a04b3mr4453136137.0.1749228325484; Fri, 06 Jun 2025 09:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228325; cv=none; d=google.com; s=arc-20240605; b=CanS04LTxOAC8/1yzS8qbYKJd+IFgK5wjAHG0PrkZDyZujt+FJ/wkQu1dLkc6ebdaR GMUhiX63noz53be8hl9shrZyGjT1Uqu4m/CE4+6LrtAdsuXFHES2MhPDRQMLDMTr+WVS lzNK43JovLTwN7z+FfEhh91ilghdr9gH54fVv/RcjDOXaQNe/AouyN4CmbA9H20D7SKw 5c5LTts2TtbLvCaXp12hPNkBMaFUI82rNHBIKrNxH0UvUnwcRfA8dU/rpvzgzjacJAaV s+3gsswceMVrupA+AMW0I/7TB480PiFIJIxsNwhR0urT6nzksm7IrTnRFO6C4FMnNzzJ m9Wg== 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=o7y7S/WReThht8x9oOE0nYIkVcJDi5oe728aOgkzFNA=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=AYFBQMZPSDODXKFrieavrSFhTLfWJkvJ1jFHmdAJ50sk0cI5lVlRIC6md1XZUO39SI j7pX9ebsnVw/uMZg2yET2Mkf3iDY05+ZWNUWJUc8qrOhZ22FAHw02dOJ5mBetj/mYnzg DL8o0Fept53r/NgTgFvDvip9Q6OsK7kJDcPE5rETKWW/zHIQ1UAg+L2h0zWTOAuSwIfN FwibdoVnnuju13LT502K3hUQ5CAuLdPiZjj6a8+fXsR+8QG5NmOpflYjhXILeewfPvhK yeY2pApbzPti+q/8f7aBSuqgIP/miMALlUhcEsBRodsIk8pyR7s0Vq5x6NK2fhDAzLak yCQA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YB1kiLwh; 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 ada2fe7eead31-4e77399504bsi865533137.298.2025.06.06.09.45.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:45:25 -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=YB1kiLwh; 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 1uNaBs-0004pV-1S; Fri, 06 Jun 2025 12:45:19 -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 1uNaBq-0004p5-2n for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:10 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaBo-0003NA-Ib for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:09 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so29892305e9.1 for ; Fri, 06 Jun 2025 09:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228306; x=1749833106; 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=o7y7S/WReThht8x9oOE0nYIkVcJDi5oe728aOgkzFNA=; b=YB1kiLwhwUQBz5ezGN/UKSyzbf/qY1MIOSvyngk0hSsLqQO75ReXWFk7XRmvZKNLQK nd22KMlKtvbLIjo6Vok8Xpdc020j/ahfZcHAb/iB5AjDXvFe9LemS66AhzE1a7f7mlVj jc08mwisiAc4mLG7dv3dpqVp+RdYeu0v8EDtgyK6/c6oG3Kp1l7v2aPXPHBBrjU8DewL SwHr3VACR2ouO2yKvIyL9sDrxxj9mWgKKXWAPyGdPc6rJ4Q6Fqn4ia7xUCO/kD1vhtax TpKT64ieHlJtNVoCjWrBg+86NQ4WDjpi70hkK6+RJ9hijPrZnP00ZU4UAQfVO44GbT5y QroQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228306; x=1749833106; 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=o7y7S/WReThht8x9oOE0nYIkVcJDi5oe728aOgkzFNA=; b=KKAeTUKSRUbiiJoHetTreSb/n046wlmLjOrtPDrIN7yyey7mEhLkufAMc272bOmOvI 4PTgG36CmI4DjQPdXZ40Y+V7OFclOH8nC++T/zQ0mZmXfSazE9v8671F5Jtkeu8YyfdG vgjIvq/ClyghNX98IosOAbxMQSXnySVasdhbOEdiJBDwp6J8fWHNYS393Gt1JoIFAK9n Kcl3D7nl+G4f8eghZ9Pc0MA5dw8jipvgU4ru0LQSEYhZ4KMP0weMK3wTNVbM9wbuSNw7 WVZoOaUOzgH6O4aYGL2BcaKPW2cNNSdXoN6qKbJI8ZGedyuTgU+IN/c4P4gKyEQEw1/w +S+Q== X-Gm-Message-State: AOJu0YwBUI98KETgV5yZKirnbd62+AUZngbn0vC+rU4H0041X+F5iqna fHaNT0kB9wRu46HvvFmbU676grV1mdome7H8M+fgWC032jIS5VtNreuIJEBDBSOfsGIuoCKW6Du h9tbxbZKgRA== X-Gm-Gg: ASbGnctMwXcNiV/2D2PY0boadqR2cMH4PMzRikA1YiN0qHYUWuc49Tip+nmtpB4QZaV 49gDRa+W1m6OMXzJvjQ8ZOi66VzdFbr8/VBvyKTA7bnIArlCbNewBH48w2IBleVcdsXrXDwFyqL XlFJBfcM5BTIaQJtHn9apt3pNvbHCxX/ZeR6PZNV4xHQXTfTVNhIKOtdL9x8nodbQQ+1KixXMNy DnaXb549fgkI/O9tGsPP9GtaVS5C1AuxM4vI4InRSVMb5ujpAUlcZiLMLKFh3ZbVYq/AkM91EDu tDJslB18U9SHBRc52+L0RHmkxYMjgRnEnQiGjsdb/Bj8TBELU+71tfKhK95B5of4cLj2KI/Qj0D lInkKXFF/XUOAUuEnaZi+9oyEBN1u+F0qPsy+cg== X-Received: by 2002:adf:b304:0:b0:3a5:39a8:199c with SMTP id ffacd0b85a97d-3a539a819d3mr628116f8f.53.1749228306563; Fri, 06 Jun 2025 09:45:06 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4526e05636dsm28158215e9.4.2025.06.06.09.45.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 06/19] accel/hvf: Fix TYPE_HVF_ACCEL instance size Date: Fri, 6 Jun 2025 18:44:05 +0200 Message-ID: <20250606164418.98655-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/system/hvf_int.h | 1 + accel/hvf/hvf-accel-ops.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index 8c8b84012d9..d774e58df91 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -44,6 +44,7 @@ typedef struct hvf_vcpu_caps { struct HVFState { AccelState parent; + hvf_slot slots[32]; int num_slots; diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 3dd9de26dbb..808ecea3816 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -366,6 +366,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data) static const TypeInfo hvf_accel_type = { .name = TYPE_HVF_ACCEL, .parent = TYPE_ACCEL, + .instance_size = sizeof(HVFState), .class_init = hvf_accel_class_init, }; From patchwork Fri Jun 6 16:44:06 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: 894473 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615481wrb; Fri, 6 Jun 2025 09:48:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjmKoS4mt9bcBF5OT69EuqJIMPAoSko33EwibAIJFup7+cE5QW9eIP/aSsTpVN5Vjr+/+yGw==@linaro.org X-Google-Smtp-Source: AGHT+IF2VJYpozjf4vMGxHxX9l7MABOwwFlMkfXv6uW1momHlOI2i+Ka1MYhKkTePe1RZoYCDFDm X-Received: by 2002:a05:622a:d1:b0:4a6:ef74:fe45 with SMTP id d75a77b69052e-4a6ef7504b0mr71291cf.42.1749228505716; Fri, 06 Jun 2025 09:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228505; cv=none; d=google.com; s=arc-20240605; b=gtwAut5AB3LQqgJZ+wGPoaUr5qJl1rgkWYbVO2HV59aYSZ2Pup9iTvSTFeQwMUo/B3 +HgDottrbsqY8RR4w+y8fgVVsgd+RoBEWbpLoBFfEIz3nQNcroVZIznlb7d89GvvZ2F+ GWeFfx6IWVUBBOlmNpcxVhwM46oOOKxH9zkPLAQUpKpX6lzH3KYO+wUDDDrY3fuLbd+v AaHDuAWZ6VC0atQ1uUL8ZYqntVmpNYVamkTOnKHDvGXo03ClD6a+dsUpfKkwwursq+BQ JjE/79vgSjNhTQ6mFWM89DVKdgGZyPBa17LAzFPcPtMxOXVALUxb+vdFWyBuJRaUnWNF ovBw== 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=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=fdFFrxnClhfbsyI3YTzrlBD4XJFvfROEURZfMjlr2bIBQyf51RbI1YmfMs0tLyieWf JiKvE6IANCYaA9mf++Di4j7AF/fy8jTljOcmgWP6XoUxxJ4FmCic0vJ25TkpA6GyXDMZ ZpS5uDUEnya6FFKSWCh7eVbpZ6mYgd+TtO2aPgCBhJ4dFbBYj+28GFqRXcIKqNrq+C2x jxbpfTvlwGFQY5J+B5bqyYsflxd4XZ21G6lS30pc+IJS7/yXy/isrPFqswVXN9OtZP8m KJKx0EnF3f2LY9AN0+kMzjoc+b4KNlenTo/Iyb4OjYR/bjDqa6tL1yz6wrsNMPZARQyk 1bkQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GCoQGPp+; 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 d75a77b69052e-4a611169f9fsi19995441cf.58.2025.06.06.09.48.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:48:25 -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=GCoQGPp+; 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 1uNaC2-0004xB-AT; Fri, 06 Jun 2025 12:45:22 -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 1uNaBz-0004tQ-LU for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:21 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaBx-0003Nu-7g for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:18 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-451d7b50815so20351675e9.2 for ; Fri, 06 Jun 2025 09:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228314; x=1749833114; 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=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; b=GCoQGPp+QGNlneZQg8feSdT0IO5VTZqr0KjMrK1CWQ2f1Y8aaO9BqBy0lgGMUIONXb G2o3hyevlV2UCUHBZteNKEfYi4lVNjBHPXSwjUW7sVZwG1s+lWtYvrOYell6EshLDiSn Hpw+7N3BHorE7Zw5FUqqThKpLQYlwOEW3bIpJzNTSq5UJVq/Kx6eHI6o9Lj1fPCSIQuP m7uCYP1FeSHh9hync7vfnFyuJUqpR94owtIS6UplegRatqc9PQ6gy6ygNGfCgRDehAAT jvNySmcHoC7tqtyemt8Q6xXScdTPtmV6rKdNBJSYTZlsoaFrXtoD0Id+zLEDn8QhUk8y ouwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228314; x=1749833114; 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=za4OfKA+ZM6zV60/HKnwP61V+8x3zdpeOiThEah6L0g=; b=EMVDKXoK09EysVHVa4WDr0yO0WPj5I5C/ahdcPrtuAAYcBcpIrwC/Rsb9uqAI4sp+X 3J3/irpMViUy/Q9WoKC71Po/YjRZ3y1UoFcC8NJpaHD0bQHh9fV0HC2PHLA5BiomOQ4w UDh1D3O8OqN6HOkzPYTihdHXxnC4oG1gvgiXZkSToymmWdN5nUHnc1jyINRhcOWHCp9l qPo2HaZ7/Jm0Rbd/V3YNQdZbg6A6zdSj8dHX8PLVvDoEvgseUGAngmbMPA+jYEMKg/CA k3H2Xe04vIzp3Jrwg2CmuremxhLcOwCy6MmdL7bUUcwWIRSDdwCib5l9D43IUzCVintO 8fVg== X-Gm-Message-State: AOJu0YzEw5r0WC2Cbmd5lxIGIpHcXOwCSLizaeySeuj98CiIZCX3QpWm W64SYn/NSJfZUHA2HMWkJVzkIx9XJ9r43ZNri0k8l4LeQwyYAu4JN89nKvyPvrn0jgYXUipy0Qh KgAYw0UZoBw== X-Gm-Gg: ASbGncu3J1t9JkNQfWErNiey83JcGNsbKQKdBSc2PaWTbQ7OGXDJZy9o+iBHEDNce0S Gn17fuVxsRcsjaKtePePLD0Gxy1I/Ls0GHmEctVQE+JPeDc4uABHiBs0iF0oppzleJ/QNVKgvs9 75Flvd+nM9JCfmaa4CNmTZ86TfLBM3/ux1+veUEM3kTrvGNzmS0olRl3mVf3udnKQqy2x8xlmvt 0M6/K0OvI6yyqYMckBKCtgpRTwjZXJ6+KsT94tbENqwusxrMu4HTIlsydbbA6fLMfwDnLN9LmIl E/TvR8l7JQ+3jjw6h27wj5m2PEwWH1AACAXBZ9iJ5FTMQvOqxHdotc6sZuLIHfzkIe0VHcup5Vf Ah8dqf1hrIsjFBV2B5HXy+M0vyqAIXOLRPwvWPg== X-Received: by 2002:a05:600c:1c90:b0:450:d01e:78ee with SMTP id 5b1f17b1804b1-4520140b8b5mr42932815e9.24.1749228313673; Fri, 06 Jun 2025 09:45:13 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229dea7sm2431121f8f.12.2025.06.06.09.45.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 07/19] accel/hvf: Re-use QOM allocated state Date: Fri, 6 Jun 2025 18:44:06 +0200 Message-ID: <20250606164418.98655-8-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/hvf/hvf-accel-ops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 808ecea3816..f4a983d1328 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -319,7 +319,7 @@ static int hvf_accel_init(MachineState *ms, AccelState *as) { int x; hv_return_t ret; - HVFState *s; + HVFState *s = HVF_STATE(as); int pa_range = 36; MachineClass *mc = MACHINE_GET_CLASS(ms); @@ -333,8 +333,6 @@ static int hvf_accel_init(MachineState *ms, AccelState *as) ret = hvf_arch_vm_create(ms, (uint32_t)pa_range); assert_hvf_ok(ret); - s = g_new0(HVFState, 1); - s->num_slots = ARRAY_SIZE(s->slots); for (x = 0; x < s->num_slots; ++x) { s->slots[x].size = 0; From patchwork Fri Jun 6 16:44:07 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: 894468 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615085wrb; Fri, 6 Jun 2025 09:47:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWC3AIwGEfqyQu44jmRBN4MDckPVaQkncaukUVyIGjg1Nac9ZWatVf8E6V7gL9juCtBhiGxiA==@linaro.org X-Google-Smtp-Source: AGHT+IHHap5sxHSAZZnSBclIfVRjYFCVz/gi27TQCUszdjP2sZ73ocposJ40Q004XpeLWNPNQ54f X-Received: by 2002:a05:620a:24c9:b0:7c5:3d60:7f8d with SMTP id af79cd13be357-7d22987a511mr638293985a.19.1749228449074; Fri, 06 Jun 2025 09:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228449; cv=none; d=google.com; s=arc-20240605; b=Es1FECfuLcQ6BtV++akO4ASg8N1NPTkOm4EiOBHrA1PtAP4pr45YMUzZq0yPpXR1Pt AJTWxX69uUcNfP//bv/A5vE5lWm9e2Ua2/QsRz/rnkM04bKTTsSMTdw1iK/OF5yOwSXa m/d5Ot4s0JOsdCeoQLpk5NluR+xXzzMJSYeqaBnH5knALcrpppcu37B/d0LlQX15Ltea 5hPCNxCAkPxB0UoD96rMYb1NyHCgetHKGOluReGHYfSjLuWARmVTIE7MGEaJyMKApNwN iPKlI0C5q+ExhwYZYdgCCllWRU2pXI2oiHwMC+MR9B3stJfcObrQ6UXy+CmGDaR1mF9v NAzA== 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=3rGEJzRlC4Fsxdbk2GIFasmygNDXfJQlCwnu7QAb7e0=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=Wd9LnLQh3ZVqu2M93ZGlt45QeEgpbhSUgdlUKFa2O7tKW8GNU8zQ/ex5cUYSnTIEUX 7uniLFh+ojVkMlQTzKe+/cEqvpkOI2S2ipoiLZ8Vyh2U075TXNqN6lIJV5VDMLQZpNT8 LJjYKvD2JNWMHlN7zAHTB9+lpXWOdD4iUNIsLjKgMQq/ttkn2TOgyfVEC7H8Caz18X/r nVylFTh2Q8gVCHaRQFFxmpi4+u3ETpYq3ce7/EewUzmCRy765gLk3ccf4hWRcKoUfUMv BeeQNNpMzRHeKnRDfsYl+QyV9HtUCmspYa//OyMmNHOmdqBsOoPIieTRMKytt8MwvJvb c2vQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AiaO9F+y; 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-7d25a62752esi202590285a.516.2025.06.06.09.47.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:29 -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=AiaO9F+y; 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 1uNaC7-0004zq-Ac; Fri, 06 Jun 2025 12:45:27 -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 1uNaC4-0004xz-RO for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:24 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaC3-0003P0-Bp for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:24 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a507e88b0aso2118269f8f.1 for ; Fri, 06 Jun 2025 09:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228321; x=1749833121; 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=3rGEJzRlC4Fsxdbk2GIFasmygNDXfJQlCwnu7QAb7e0=; b=AiaO9F+yxOuBXKFwiw0grjQPPOWRiGZ1N+nMrlQLtoUgjzhZqBNxog4FgYGYXO+gcc EidGG1+kOaUDbwQ3Q00LTqWVFAM1SpRKMZrRzdi4Xi6tQRjGRAe+tQ7fJcSYLpKBRk2G Un3ZDqQChxmKuNaYagpXMIIcWLO7/WG5pTzCEsoQiJ3jrPk3PdIntKLpUlEc6ll5jF2u AZNBR/StrP+9ee1qq3cstWlq1T+YxHCpC2Dr81k1XVC6TzjrlfGvasOyMIv+rH1ojlRi uLJdcVYkn+ywjxBqbZdMwY7tgpMojEKKe3HKW5v/BQB0RJh3QQl57LxVc9ZBt54YaqFZ MKtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228321; x=1749833121; 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=3rGEJzRlC4Fsxdbk2GIFasmygNDXfJQlCwnu7QAb7e0=; b=ZkhXnwRfGBlZL5TYqtXfgwDYX2IHuS75aIxZMfITTNK5J2hd5CLGMt3omi0QWaHygI 9n02e9We19va357dhTfnVMTfbzHUQmyBv9yj5xu8mCPDdjy3hvvm3d6tnXCNf/ssv1LD ULHJeqfa9nx48xGwZI2Viv89bOzQgUc3OQSYBbsKPc01N/DMhepcCQ1LHQMye03SYxOt jA8F+/m11LNkhz19Pepjiodr9/I+KVrsIvf5yQk5jVNUhJa9EDzydQi6+K4cNJPvwt4q 3S+PQ5pgDgs3GPb4qXtZNTavFgr5flu5ElaxnHG5Cw/eoa3EaQCiPI47M2TPlog5qkT2 lzpQ== X-Gm-Message-State: AOJu0YwwpqJUat/9Qiz0Gm/12WMKkOV5TV8eCW+vp/Ga5MvLVrDajlFT 7fFAnAaqlJEMrdOVlp+K9YcXDaZA9KYbWa+ojGhDjlOXoilsEQMNPx1RkzeOpsXnk2/BZWkQjNc paj49BcDtHg== X-Gm-Gg: ASbGncsoJSc+cY6UcmiQZnzoRakmPVNud2KRIjxczqgdLFRfiAiZ8uEzNoHjjMxNUN2 zNNWjLv4JIdzspD8pwmAG2Lla4foEy24Qfn76o6m9WBZrOCP+iPNR0+FXdtzJXrcYSdG4sobyPb N2YTPUumrE2U2Hg8cflMblFlGcFCj7+7ih1xY8uIpYs7NvxqT6xjZlicXBb3+lXo5RqJ1upSEWp kBnBqi5lurqvie91/639LXYcytJxRBtLhmbF7dssLvyBaZzExE7cJAA/nBa2FYw42PTt9MXUuKG hoBF/rf2TFkaZ5lMQavJdQXx0datA+jpi4GSm4JdPVU5guLRw0qfmJjj6QkOJ/8FEfGZ6HbYiDV wNYi48FOepn/tFSjdwnSSfyfZ0hcxVPu3Vr0+dA== X-Received: by 2002:a05:6000:4305:b0:3a4:e1e1:7779 with SMTP id ffacd0b85a97d-3a5318a070emr3112474f8f.32.1749228321601; Fri, 06 Jun 2025 09:45:21 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-451f82878acsm35550495e9.0.2025.06.06.09.45.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 08/19] accel/tcg: Prefer local AccelState over global current_accel() Date: Fri, 6 Jun 2025 18:44:07 +0200 Message-ID: <20250606164418.98655-9-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/tcg-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 6c5979861cf..4b1238ed345 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -82,7 +82,7 @@ bool one_insn_per_tb; static int tcg_init_machine(MachineState *ms, AccelState *as) { - TCGState *s = TCG_STATE(current_accel()); + TCGState *s = TCG_STATE(as); unsigned max_threads = 1; #ifndef CONFIG_USER_ONLY From patchwork Fri Jun 6 16:44:08 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: 894461 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614629wrb; Fri, 6 Jun 2025 09:46:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV13HhGvxAl8efIUHMGi2/N5yrvYImDl/N4s8Hv5MqV1pSsJ0tsd4/hrA6HcObnwtRNCzmCog==@linaro.org X-Google-Smtp-Source: AGHT+IGMRYyC1m6E1jhkwVzzaX2IaKamm+CUxcN98jH7m4wH7t3UpMRPztvHPp6IJ4+KSssN7EA/ X-Received: by 2002:a05:6214:4106:b0:6fa:cb97:9722 with SMTP id 6a1803df08f44-6fb0903b447mr67803346d6.34.1749228379594; Fri, 06 Jun 2025 09:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228379; cv=none; d=google.com; s=arc-20240605; b=TkZ/0470onUP/di8YATEXYKFurH+jKdWPlTVKp5MQafYY6zG4cxB9rQ+wFEXzbeOK+ YUd6ozZZmYTte+sU6u2ZJK9CFpLMbWzzgt3uXSWgrkzakZGxpBMlFbFpnMHbm3bd5x0L 5s4Xfs07cdLlDXrNqHhFf0EPgIIOTxfUc0Y20WGgkmX/2V/hpkCXRWjvq7OCDy3V+GUq yCLiMBbcS1MsYMoQY42GB+nimcItIm4COn4Z/EyULanFztbmhfz7sNUxBtWzzxMsQZdj UhnfzG8XP+8PAEiQcdJt775K+NmmTJw4Kfyamfp+efkJ89FM8mXImc1qNG44UVpNJNZK pnYw== 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=mEZ1hQ5Ve/n40v+7Xdzb9ewpikW8Poa4vyefkyKHER0=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=FiDR+6QNZNeqsobtSa3X5+Fo9jEr4hC5I6TkGrWrZmYQOZIzycjA7GuROBw81DQtrK PP6B1DNq653kqRB0TMhpdPtBNvonNApSikX4r/euPG5bSCI0nBEzGKizCDUoQMfccuCb A65l1GfGGqw5ynzhtcM9qKEPivOaohSfTVcUue1XO73jC88ABBvyqhzuapix2x6tUbND f3fvOOAA2sxBBsccaE0X+1akoGBGA+RA7DGRYoRvcXo3Kl6zG0jbxIAYxqm5Y6lMeUPo BlJaeeQTAVBQMLqEyzsV2idrQWSYo3U8nieGpuhom2FCFLtlSZFSmhdS2xvVks2+CLne oN3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vT2oaioR; 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-6fb09b2fbcfsi19075796d6.420.2025.06.06.09.46.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:46:19 -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=vT2oaioR; 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 1uNaCG-0005AK-GK; Fri, 06 Jun 2025 12:45:36 -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 1uNaCC-00055C-8A for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:33 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCA-0003Pf-Ls for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:31 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-450cfb79177so12673355e9.0 for ; Fri, 06 Jun 2025 09:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228329; x=1749833129; 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=mEZ1hQ5Ve/n40v+7Xdzb9ewpikW8Poa4vyefkyKHER0=; b=vT2oaioRsFG1IBc2zoOjg1xHYbQ5+q9dKHkysw/FEp2C6za58VTtIL+vezMZlDBkl6 L9rIkNcBB8ZpIUcAsZ1uirZpwfwnwy6RJs80jS22DBKVGJyhMoQF8IxXLf2jt7VFcjpP za/I8yPz/rnY/6HrnkUmHmdlNfLtp0BkdVajmfYier5LwytWGrJLSLaBRExRimyISFxh /R2KpSW5/j0tFQw/MprnnH8dPsYSEF4h3bQ/ud2sGeeqz+SIQtk8PXW5c1NSFW1wa9Q7 gOVOWjtjbEdPh/GjJ35/SP36iuZMemurHhh7wCKwMFr/LjQr2SdWzPk3QYYndbW2aOQ4 InqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228329; x=1749833129; 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=mEZ1hQ5Ve/n40v+7Xdzb9ewpikW8Poa4vyefkyKHER0=; b=vwQbOimsve0KqcuDZ2ZEiq09prXmY5zBf4vvsaganCb0hsXHo2nOZKbmnlxAwB/2qH CYAgpCKP21fgZZiUSnTjb1bcGKb+QT8zRxGQjaZ/aJWZ2w3pfUZr2Hq6S+WMSme8MbSQ Gy+S6JY/PKAkrc5l4NxsITrectoX3/I+R366BqHLOmiGRxEHKvO7DRePeyIwhMlBLZWq iNCZAV7CuHgRZweK3TBDNCTj2bsr3AQAxrrNjQiuEaf4ld/N1w4hypO4NQ89LO18xWs8 d32fIy8hWP1SKxNI9z8q3mg9xc3kAzPkQgyq9AOfhB7+ix1jpgnuMry+mL/Z+2Lr22XZ qJfw== X-Gm-Message-State: AOJu0YyyxoWaM3XEFf7VCaj6wn5TuHKlfH4TK7c0A9cIQcs/BFYN1UW1 VoG065IW/ykOq9oERW96qlwEXbOpmpFlhww852qng5CgIUIGYyRkljGVEhWh3QHGiAgOT82x5Ca x6WSUVh+u/g== X-Gm-Gg: ASbGncvgN9dTV7nKK2gIg2AR9Qdb1KXj+8dmpelDXt8CNUfLCmmDPGq727OSecftzDH 5+HvUQhL5MGuhGTJ1OzFZOc89ermFO0lY1/mIyfvKrVqAjDfTqfXvrDJPXSU6LLuks0sQCWKFsV M7fVo6aQSlsfOICw74nPnNbyl24qLBQU0Fr0dgUgo3eiCG4Y+4uUzW4vh7cZzHrjif6Urk03Qww RYFlhtH/fZk5z8eLsfHva1SViYpbXv7hmvTTDZl7fW0uiy8yUKbvWCvzp5O2+xEmeweaErYhHK2 bbCKQ7Dx0uHiW0y3jYLSz+ScVzKGV3IOyXOjuPeYJAavRIbULCBazgHcxOMlV8lcWIj+Nl7h6Mp pESQ4h0B0oEWr6ypxnK1gURSjpt2dp2pbiKmLBQ== X-Received: by 2002:a05:600c:8b48:b0:43d:9d5:474d with SMTP id 5b1f17b1804b1-452013141b3mr50523815e9.0.1749228328771; Fri, 06 Jun 2025 09:45:28 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229df09sm2376630f8f.6.2025.06.06.09.45.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 09/19] accel: Factor accel_cpu_realize() out Date: Fri, 6 Jun 2025 18:44:08 +0200 Message-ID: <20250606164418.98655-10-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 Factor accel_cpu_realize() out of accel_cpu_common_realize() for re-use. Signed-off-by: Philippe Mathieu-Daudé --- accel/accel-internal.h | 2 ++ include/qemu/accel.h | 2 ++ accel/accel-common.c | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/accel/accel-internal.h b/accel/accel-internal.h index d3a4422cbf7..b541377c349 100644 --- a/accel/accel-internal.h +++ b/accel/accel-internal.h @@ -14,4 +14,6 @@ void accel_init_ops_interfaces(AccelClass *ac); +bool accel_cpu_realize(AccelState *accel, CPUState *cpu, Error **errp); + #endif /* ACCEL_SYSTEM_H */ diff --git a/include/qemu/accel.h b/include/qemu/accel.h index c660c5f4b11..3c9aaf9523c 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -91,6 +91,8 @@ void accel_setup_post(MachineState *ms); */ void accel_cpu_instance_init(CPUState *cpu); +bool accel_cpu_realize(AccelState *accel, CPUState *cpu, Error **errp); + /** * accel_cpu_common_realize: * @cpu: The CPU that needs to call accel-specific cpu realization. diff --git a/accel/accel-common.c b/accel/accel-common.c index 4894b98d64a..4f3b42e7112 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -88,10 +88,14 @@ void accel_cpu_instance_init(CPUState *cpu) } } -bool accel_cpu_common_realize(CPUState *cpu, Error **errp) +bool accel_cpu_realize(AccelState *accel, CPUState *cpu, Error **errp) { - AccelState *accel = current_accel(); - AccelClass *acc = ACCEL_GET_CLASS(accel); + AccelClass *acc; + + if (!accel) { + accel = current_accel(); + } + acc = ACCEL_GET_CLASS(accel); /* target specific realization */ if (cpu->cc->accel_cpu @@ -108,6 +112,11 @@ bool accel_cpu_common_realize(CPUState *cpu, Error **errp) return true; } +bool accel_cpu_common_realize(CPUState *cpu, Error **errp) +{ + return accel_cpu_realize(NULL, cpu, errp); +} + void accel_cpu_common_unrealize(CPUState *cpu) { AccelState *accel = current_accel(); From patchwork Fri Jun 6 16:44:09 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: 894464 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614928wrb; Fri, 6 Jun 2025 09:47:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVm05BjEMX1BCTqpy0dmzC+X8TQqm3vYUwNqLFLHMndFhyHrT1MLZYZRfrXdr5IF+7Sun9iyQ==@linaro.org X-Google-Smtp-Source: AGHT+IHkup2oQnBWAGNcKuTQX+dffYm08IwLOhifjtRw1CJeDeKpFVlRsJfQC9YWBH1Awrtln3Pb X-Received: by 2002:a05:622a:4c8a:b0:49a:4fc0:56ff with SMTP id d75a77b69052e-4a653b29194mr49311901cf.12.1749228422953; Fri, 06 Jun 2025 09:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228422; cv=none; d=google.com; s=arc-20240605; b=C1wQ9ulGDEr1V3HJzNcY+MUQ6chALvfzTMguUos2MJVqf9rfrOv9EXpO/EGKvkNqyJ 8lDSuXHGF7KIB4pnDy9FmRXU7hfbld7CVFRSwlvmqV3oYk6jjLJ4KAB/8jqoGfMmYNXZ PESihLy+VkfOY+5X3MxskrbXUvbn6bNZKNha/uOdSgFDMIqPE5ZabimKyECgqnM9/cjw QZJYu6Xp3YTLhle8d3CHZZWK5SAMCCNa/+xalbZgH/FH0UADGlUd9sUcLGlWVpTlALwb 4BztKr28H1xiDPuk28emqchrLk1x9FZlAycl6ebVt11fP1/2P6nvMA5q0Mn40Z/+qXNs /2hg== 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=d/XNfWiSbWGdYBzuDNRVlb7gdtXynRKks1ss0p+cqNk=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=I18j/0PevwzVjagNDxPbtN16mZdpjjFIXEABnBjWbKTyiYHFqJ4IG4+93+J6b5bKO8 EEO0xGm5MHGLDDLqjt4c06PAnXK5I7Wp+541/wTZiEvTZJ1C2wtLcA7OZjSoB8O/BmgW 4C0iBKUNPQVWGOAld2X+OFj6thSyG2fCIVM2xKo9K77uShhaSql27bOz1cKY8339ZjJF OVcjHbUyfPJxZamb5GiQSIn1L8D0UEJnU883iGVGO+e0jsHDWPjL046U4dDx9svLD2BB 3p7Atxl3u2Qt0Ghr+L5WsdoRem93RAXcnBii/J0oEMypdZqbznUWRvzuI2DDrfujoxVy 4hww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zq13RdC1; 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 d75a77b69052e-4a619892085si20434561cf.431.2025.06.06.09.47.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:02 -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=Zq13RdC1; 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 1uNaCe-0005lu-L9; Fri, 06 Jun 2025 12:46:01 -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 1uNaCL-0005TM-3G for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:47 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCJ-0003QF-AF for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:40 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-450cf0120cdso21939685e9.2 for ; Fri, 06 Jun 2025 09:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228337; x=1749833137; 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=d/XNfWiSbWGdYBzuDNRVlb7gdtXynRKks1ss0p+cqNk=; b=Zq13RdC1hr+mbjJh0YMy8dt/RcaAIX/A//QgJhzb/OqYzfw+miOk/yEZAUG9fKpR+E 2CB1ITzXf8hM/w/LVCW8nLmcBlNOVQgSYoSyyZ8PaJ+5wFeLguTkuUS+nYNe9eT5aaZm uEMeTsE+OO89u/htXaBz9Qbrz7qnXLfPBgiO6VNc6H+58Z2oeiLrK3P1f8/SGtEw0MRt uTYqv4AB3c8XkGtLfP57xA54LHzlfFkyKahI/3yqB4zywA9j/lHJg1xzMXCSna1bFz5U dWMMbJ85xzQIL6CFuluqU/IljkrLMoz2ANkGdiMflYf/sJ0yA7uspSG1o4L+On6x+tYN wMzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228337; x=1749833137; 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=d/XNfWiSbWGdYBzuDNRVlb7gdtXynRKks1ss0p+cqNk=; b=UJVU1FG9AnZaZLswz2p92njpdZP0d4uLmmBBklSvAoW3UHs0NsdOQGNyiQUOhDw2np LfrDeDgmL8o752SiSwq2OFJOrxtV1048k80oKEB0RptsmpPKIDnyiHHP+rhS40SRUO/y 2iNSHyRdre5QjvMCveZPLyvDves+kEdo2J+yD29AjXjIpMMJqjM8J7d2DIMdX2xyKfuu h48azFCPlxdOx0TAJrYyiImH7hC+HdD7ctfOmqc4gec4pWXsMoc1Ano/aU9f+79T9scO qRVuy8pD9ktyhYvrL5V5d9crEFhbcr2+slyOhI0tFFyDXSQGl7wsg8y1oeDidWPWwAmY 0/GA== X-Gm-Message-State: AOJu0YzNpGr4kaADEyE8glH5LR6R9IhiU4uR/HkbAbx6ZJbh7dytBeYG 20Yt400xpxXMRMt35EfVjzlQcOhavu3tfONHKyaD+GsGlam/spIOqM/g2xxxGJeRixDzOgWeWqN N8ECntp9BwQ== X-Gm-Gg: ASbGncsnu3ec75CWQFk3A8o06zHWgYHx+2hF5rIUcNtyxD7rrhMlqdu6DO4RRalBxck qj0JZjX9eY0o3NDDv6BR5OEAHYos+kAdnAq8IbcZdvsRyy+r8n7dLtOz9Aqa2XEWSl8Iy87MeGo 3ycMooT4xhaLGLjYIwv0tD/We0xhZaLMLZeSNjJKz6IHria+vvONrntfYBt9/PMycYBspRmt8nH IsAZbO5nA/63MyxlKzsMZ/jfBK8YuxE1R4+Xuhu41q5F0kSe0+jopdJOcaQfRP7CdsBJRSz/WbZ z4ihGYIj+lMynFebRBFim71fpe9TGr/f4eKQlEH78+f5EHCuYb8qjbVWULKSM1MsOrZwFPMyoRa DQGJwEF4IyjWJW0L+nbMRG1bFC0YsRML2yRsJZxgC3XBDEt/c X-Received: by 2002:a05:600c:1e09:b0:442:ccf0:41e6 with SMTP id 5b1f17b1804b1-45201340872mr50661325e9.3.1749228336787; Fri, 06 Jun 2025 09:45:36 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452fba4621csm17499185e9.13.2025.06.06.09.45.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 10/19] accel/dummy: Factor dummy_thread_precreate() out Date: Fri, 6 Jun 2025 18:44:09 +0200 Message-ID: <20250606164418.98655-11-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Initialize the semaphore before creating the thread, factor out as dummy_thread_precreate(). Signed-off-by: Philippe Mathieu-Daudé --- include/system/cpus.h | 1 + accel/dummy-cpus.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/system/cpus.h b/include/system/cpus.h index 3226c765d01..bfaa339dd73 100644 --- a/include/system/cpus.h +++ b/include/system/cpus.h @@ -8,6 +8,7 @@ void cpus_register_accel(const AccelOpsClass *i); const AccelOpsClass *cpus_get_accel(void); /* accel/dummy-cpus.c */ +void dummy_thread_precreate(CPUState *cpu); /* Create a dummy vcpu for AccelOpsClass->create_vcpu_thread */ void dummy_start_vcpu_thread(CPUState *); diff --git a/accel/dummy-cpus.c b/accel/dummy-cpus.c index 867276144fa..7c34e6c0fc5 100644 --- a/accel/dummy-cpus.c +++ b/accel/dummy-cpus.c @@ -64,15 +64,21 @@ static void *dummy_cpu_thread_fn(void *arg) return NULL; } +void dummy_thread_precreate(CPUState *cpu) +{ +#ifdef _WIN32 + qemu_sem_init(&cpu->sem, 0); +#endif +} + void dummy_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; + dummy_thread_precreate(cpu); + snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); -#ifdef _WIN32 - qemu_sem_init(&cpu->sem, 0); -#endif } From patchwork Fri Jun 6 16:44:10 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: 894471 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615116wrb; Fri, 6 Jun 2025 09:47:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdrIIl1szwwTYT+Oyl5ttNPpIfYd70F0ScldIxp/BO439wFBYKypxuSMChicrVqMQZDzqCPA==@linaro.org X-Google-Smtp-Source: AGHT+IEpkldjXvkaTol4EKXu2Kbq5fiJXbCMm9TGzlTHj4EoEr+ij1wx5wfbiLX36efzDPVWhkAq X-Received: by 2002:a05:620a:3948:b0:7ce:e916:c953 with SMTP id af79cd13be357-7d229fa66c9mr620927985a.5.1749228453088; Fri, 06 Jun 2025 09:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228453; cv=none; d=google.com; s=arc-20240605; b=Kq+J/fxZ/3lNTDGG+DFRDQ/JmkNlcmmNM4E4VumcJpcgm8HlQvjzbXq1kVAZYPbxvk aKqHK8QInPjo38myXK3WKP7cewjR2yWeRSSCRcTtqPEuxcuW/sPagl3lb5H2HiQFy9ZJ 0JLi29jK2ln+a5NWG6VjgLKZ4rvH0IJx/7O8M2gwfigqLo8yUbxE/SAIbd/DIdc3y6vv vIjOZm4iR750rFQaQG0iEiI9rXAUONKl7QP/+mXmGSu92aSVamkdRmES+cvSJRnSzW48 l8DcWt1WdM10GCYMy523UOu/gFfI/ivJbyzzuBb9SoAe31SuET64xoRqN6OFlemRVbVZ siCQ== 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=JIuklLgT7yxDr5xUfy1gGIRFVc8VIMyOClNRwci8w2E=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=VGjBqvUDDoqxHCJ3KitccVkN8+VAx/EDvQyVW8PspsnW6QEkwZwmx0bGHcyw2geLnh KuHQjkGa67wY6MsrdYGLbuK4KiR8wmrXhOhiH9DoTJvp2mYprL+BijJCyOnN238rGLvc 4APu+Mu9Ozv0b9ctA/LgHsegOQwJ/pQGZL2/UOA5rSeJZrPGdAGyaJgUVbBo8hQ9anmH ve8HfOkf8/k5XIXQsUyOd7XsF+GEVlsTX+7KqCuBOtLN6Y+8Lew9YDkj2QhPTf2e3+pv s4R1m8aP5AVF9dI0kPYZa1kBHlzno9dE12Lky34S9AdHUtvH2TvfLCQwzh15cI0Vr2Ir ZeYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c/Xcs4xj"; 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-7d25a5336cfsi206693385a.140.2025.06.06.09.47.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:33 -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="c/Xcs4xj"; 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 1uNaCi-0005xv-0t; Fri, 06 Jun 2025 12:46:04 -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 1uNaCR-0005XD-VZ for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:49 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCP-0003Qd-NJ for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:47 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-442fda876a6so19365765e9.0 for ; Fri, 06 Jun 2025 09:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228344; x=1749833144; 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=JIuklLgT7yxDr5xUfy1gGIRFVc8VIMyOClNRwci8w2E=; b=c/Xcs4xjeEG/V/CEggSm4wtZHaosVaCBDWRKYS/d5cN/BchFpR54Cfqo32eLcdtcH8 Ocb7I35iciCwoz4X96aoYFLpXScMThPaXD8HSU9bFZkvU6/6NMFpImRxcSawNshGcl/k ORg8REzC6RFGWpn16hnTYNk0d6g26+DOgQFkIEdCPkK0RXp/U6mJqh6OJvBqFtiANWkg SeswCruf+1Lhi4jhUxCm0yke5lP21gxXsG/c0vRivQfeEGF1Rpb97Pzd9b+T64UOkg0N GrdrddTDU/YeyT9phq44g6sXCKjlkI8jWXw9jhGAI8BvIvK36l7Q9CrAS6V7eIbpOwS9 TsGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228344; x=1749833144; 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=JIuklLgT7yxDr5xUfy1gGIRFVc8VIMyOClNRwci8w2E=; b=Kl59q0+LM/yJjKJ5zg95z0L2GpaIK3oXFcWRXx3BqTq2+KZWLDValFkw60XwiPLcmO riEZ0MSPjm8ZhBrbEV1FAExn3JAT+sbTem3Kg4QStVNYZAxde60zpc4Gzt8Q/aAWFTi0 gQF/BqRoQ7qnkx1Ksf+E5yKSz1Bbn4GJUHIghfGmj0f4GEvRKSOO1Kq/hSfAVsGctxla J9vJddwkQeeouNs/AfPP3tdL7erAB6/qawhBlR5RLk1OXWIE5mcmN1DVAt3wyKS9GQrQ hqJZ5qwDP37du0Pcy8wTMNC+DeVbEhtaVJEDk1mmCPwqKNG04gA8a/OWsBWGO4yr1HN+ CP8g== X-Gm-Message-State: AOJu0YzFlGsUDJFV0sznHXzCb0gJWCbgaXnQmZVwQPoAmGMP/gMJ5XH1 2IFwj16RTYx5gFT5kcC5bJd+G9TAt902AqWPK4yMSz0Iku6QeJYeWnnFZ8NzZrif+UDDYK/3hcT bjUEhrvUalg== X-Gm-Gg: ASbGncv0/hbvRk/KETXmBwtQzMhBX0IqBtf30/hr3+6n8Dum33rYaN5lQdR2rIbUMze yAeg9fFKq2u/Z6TzjPqPnLdAjI/DuOzU1SSWE/c9n5whPWgoqme+2npqBlXrNlVNJ5L4lLgQOBV doFeMwuikzpgCmp1EjNZ7SRy1gqwRQOPvqzzPgqK3vYLrdLK2NVr3WEgNv0VmJ/rWkamJYkH28F K0vwxNUImuDDkwH8UpLx56UtLTf1xz/a0gQJdTU5oUBizKXM/naFIKJWKTlCJcD6z2Z7TLFXm5x MRrjKbM+kgcW+aztD/C75MnubE2pyylMBkONyguXkrGa7CZvzIRzQLoziQ5r9gT460Vo3kt6VeV 9xRNMAsAO70Ew9Yb/FI2Sb9fIr0pxu9eDvlMx5Q== X-Received: by 2002:a05:600c:5492:b0:442:ccfa:1461 with SMTP id 5b1f17b1804b1-45201357413mr44755445e9.13.1749228343874; Fri, 06 Jun 2025 09:45:43 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4526e163113sm27660095e9.18.2025.06.06.09.45.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 11/19] accel/dummy: Factor tcg_vcpu_thread_precreate() out Date: Fri, 6 Jun 2025 18:44:10 +0200 Message-ID: <20250606164418.98655-12-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Factor tcg_vcpu_thread_precreate() out for re-use. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-accel-ops.h | 1 + accel/tcg/tcg-accel-ops-mttcg.c | 3 +-- accel/tcg/tcg-accel-ops-rr.c | 3 +-- accel/tcg/tcg-accel-ops.c | 7 +++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index 6feeb3f3e9b..129af89c3e7 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -14,6 +14,7 @@ #include "system/cpus.h" +void tcg_vcpu_thread_precreate(CPUState *cpu); void tcg_cpu_destroy(CPUState *cpu); int tcg_cpu_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c index dfcee30947e..462be7596b9 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -133,8 +133,7 @@ void mttcg_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - g_assert(tcg_enabled()); - tcg_cpu_init_cflags(cpu, current_machine->smp.max_cpus > 1); + tcg_vcpu_thread_precreate(cpu); /* create a thread per vCPU with TCG (MTTCG) */ snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG", diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 6eec5c9eee9..fc33a13e4e8 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -311,8 +311,7 @@ void rr_start_vcpu_thread(CPUState *cpu) static QemuCond *single_tcg_halt_cond; static QemuThread *single_tcg_cpu_thread; - g_assert(tcg_enabled()); - tcg_cpu_init_cflags(cpu, false); + tcg_vcpu_thread_precreate(cpu); if (!single_tcg_cpu_thread) { single_tcg_halt_cond = cpu->halt_cond; diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index da2e22a7dff..e58e1c3738f 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -41,6 +41,7 @@ #include "gdbstub/enums.h" #include "hw/core/cpu.h" +#include "hw/boards.h" #include "tcg-accel-ops.h" #include "tcg-accel-ops-mttcg.h" @@ -68,6 +69,12 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel) tcg_cflags_set(cpu, cflags); } +void tcg_vcpu_thread_precreate(CPUState *cpu) +{ + g_assert(tcg_enabled()); + tcg_cpu_init_cflags(cpu, current_machine->smp.max_cpus > 1); +} + void tcg_cpu_destroy(CPUState *cpu) { cpu_thread_signal_destroyed(cpu); From patchwork Fri Jun 6 16:44:11 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: 894465 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614929wrb; Fri, 6 Jun 2025 09:47:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUHSVHB174Dut1//yUw60bLY7dRnwKhmwXGcz7VivK3tA3JZfazKc+8WGu5aAEG26ZS/2X19g==@linaro.org X-Google-Smtp-Source: AGHT+IGmSWszxWw9Lzx8x77HCakVq+JRPgEy7OaWAigW5XayGP370ANGTC05LQFd+GwygceEnL91 X-Received: by 2002:a05:620a:191a:b0:7d0:984a:d1b4 with SMTP id af79cd13be357-7d22995cecbmr468613285a.17.1749228423003; Fri, 06 Jun 2025 09:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228422; cv=none; d=google.com; s=arc-20240605; b=h6JkSn0N3O2UEMgqKlMvUe/ZyE5dBEsNF+t/PBzMS7OSs6PzyCsqyrBB/7bYM/aj3h +39K+8EU99+xh5n6fUqlDCql0fI18Acakt7pCepOCIi0LDben19vHvjUmWjeM7g+BR2e rBJJKY33+2yVIyKGoFIEd3iKziRAx6mQjspsP6JBHtAira35psKb5Y9ggAOxhFXc2HFZ wLPxj8PvZOIMtgnCWpTzePC22tbcDn/V5QB5xLVJPOtkAE1mMBwnVY6p+s6yreRht1zy GhGglVxzc9Kzork3xle1/LNYHKiU8vf+D7r5E2R0MdyYJEV8JaPqhHpVa4E7UgmJfh8m xUMw== 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=UaqgBc+8IPd+F+DKqw2/dlO2PgT1d6b4+qh/jcNGS0o=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=i5ebyXLcbatYs8TOGB+8GIWlOpjsSSDb7n4LElo2UITVrIVK8fNy0CrnU/cBFuQ3xP DJFj0JfdnATQo5Pp+z3cSt+CejD8MS+yQeLmOs6jsbRnFc1kwQBCqgnlED2/LnzocUXR TzIDiEQBALv5cavfFe06N1YNGfEOEOPDLXcGnAUCJ/lKJ8UrwUaYVcrz1FVdFXPox472 Y6qYeUx2q44jU/ol8il5awwsxoHu9PVgIEitDH6G/v4hvtHWblOv7FYPAblbo2fqRK7A f8cVX+bzJ3IG2tT/3itbaY5Om08SSIxaxMtU/H9dI8UYlymyGKXRkMaU1FEJAvEL7zk9 mBtg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ztDm1INr; 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-7d24b3cb5fdsi203233285a.80.2025.06.06.09.47.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:02 -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=ztDm1INr; 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 1uNaCh-0005xA-V2; Fri, 06 Jun 2025 12:46:04 -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 1uNaCZ-0005YT-My for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:57 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCX-0003RC-Ll for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:45:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a522224582so1435798f8f.3 for ; Fri, 06 Jun 2025 09:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228351; x=1749833151; 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=UaqgBc+8IPd+F+DKqw2/dlO2PgT1d6b4+qh/jcNGS0o=; b=ztDm1INrsjBP4xUKGJhwETQGgiILgQ5uD+cVjqufE1UqGW7May8UivU2CgGFMxT6CK iW/qCOafAJlNu7QBB9jWISRgCrAyDJOn2Vej5CZxPp1XhpUsf1xLTJNkhQWnbgdsKBFH YfpvQjfm1cmA5PIwnAfAmKyp9dOceOLUmwhXYoGsCuseHhqwTxkUjAtGdKuHkEvVTPiF brjNskbZ2DLOL/hig57eUTG6SBUAwT32HjDpK17XIdaFUbAp2sMBeM2tRszsXrnqEYVI zU/ZGeNWqOtPbe2za+To/z6lx7ZAk0e432BnnOKFK6nDKC1WZZPDxR5TAwEk8aSaPJ9w nYMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228351; x=1749833151; 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=UaqgBc+8IPd+F+DKqw2/dlO2PgT1d6b4+qh/jcNGS0o=; b=JrCiuB2eWP6GqCechsbaAcYZkuHkvpCep3ZY1cZXlzZOPMgL0zrecPbmta5U2H0oko ftFdPHf1UZRFAloWmTJsQu0I5ORXZZjHaoneqrJ6i1ft2lz1xkSxXfJaDxWAiHclSTZX xtb+DpIch0MZ44MbQhqcdU2kls4TU8Uauds+kyxR5lOAaT/D+kAQUOGjtVNU4Elb2rNW kJ2wlX2IY9HID/3gRYbJIK3kT/CabmMyWoEhkJXFPnCCRv0frxXypbAOSjmbsn14uP68 IXokIBaC5MkR2xIBXPc8joMOoJU2vlTPFq+OOHGCZueod2Ffz0HrDgA7bKPZcumifETw mV1A== X-Gm-Message-State: AOJu0YyIFiVltjumqosUO2pNVQjt5hGMX37Z0A3JDeYtIPFd3m+GWxLM vszPXuy4HlVbGm4qQlA6wmJ/zRMfvmR56EkOt0wLpGSgmLKex9tU0NdbZ/dqCZ2zto3O5eOX3QJ RGDHAxcXydg== X-Gm-Gg: ASbGncv4dCT/yMIpa+eufhWWcDDGDOeL+2odoD56sY6GIdC0a9DDUSDMF7juRIQtUwq Ni1sw64WM9/IJ+R3PZ9h+Q/jCcMPYFZWCf39NgxlQ9H72LnO5gCuowJvxvmBNFx25TLpQvCUUvR IiLNlhrcyjGR2tLlUXx+wBulwbXa3FnmCPRx7hxW5k8L8A+l+2l4HJPVFpQ5vaRckm+rI7jrHqt 9tMBhDX3kF8gLXxnfR8xMgww4Jq3Ie1EJd42z8xonim3bczffbRWa0HcwzojUl4ElDaR50ruRHm Gdb9UycrmTzKrEfHju6U/APiier6yEGL+Rf98HENw5aPBSW+hYsORzwK1ObjItvGOCtq/L1H5Uu chW0JxhPJryh6X2ip7o8TR/+BQzGWMx1xkj6efg== X-Received: by 2002:a05:6000:2c11:b0:3a4:e393:11e2 with SMTP id ffacd0b85a97d-3a5318a9b08mr3551108f8f.34.1749228351303; Fri, 06 Jun 2025 09:45:51 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244fd02sm2330320f8f.75.2025.06.06.09.45.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 12/19] accel: Factor accel_create_vcpu_thread() out Date: Fri, 6 Jun 2025 18:44:11 +0200 Message-ID: <20250606164418.98655-13-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 Factor accel_create_vcpu_thread() out of system/cpus.c to be able to access accel/ internal definitions. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/accel.h | 2 ++ accel/accel-common.c | 20 ++++++++++++++++++++ system/cpus.c | 4 +--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 3c9aaf9523c..a351eebe567 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -93,6 +93,8 @@ void accel_cpu_instance_init(CPUState *cpu); bool accel_cpu_realize(AccelState *accel, CPUState *cpu, Error **errp); +void accel_create_vcpu_thread(AccelState *accel, CPUState *cpu); + /** * accel_cpu_common_realize: * @cpu: The CPU that needs to call accel-specific cpu realization. diff --git a/accel/accel-common.c b/accel/accel-common.c index 4f3b42e7112..6bd4ef47c2c 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "qemu/target-info.h" +#include "system/accel-ops.h" #include "accel/accel-cpu.h" #include "accel-internal.h" @@ -88,6 +89,25 @@ void accel_cpu_instance_init(CPUState *cpu) } } +void accel_create_vcpu_thread(AccelState *accel, CPUState *cpu) +{ + AccelClass *ac; + + if (!accel) { + accel = current_accel(); + } + ac = ACCEL_GET_CLASS(accel); + + /* accelerators all implement the AccelOpsClass */ + g_assert(ac->ops); + + if (ac->ops->create_vcpu_thread != NULL) { + ac->ops->create_vcpu_thread(cpu); + } else { + g_assert_not_reached(); + } +} + bool accel_cpu_realize(AccelState *accel, CPUState *cpu, Error **errp) { AccelClass *acc; diff --git a/system/cpus.c b/system/cpus.c index 4835e5ced48..b6dff01c7ea 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -709,9 +709,7 @@ void qemu_init_vcpu(CPUState *cpu) cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory); } - /* accelerators all implement the AccelOpsClass */ - g_assert(cpus_accel != NULL && cpus_accel->create_vcpu_thread != NULL); - cpus_accel->create_vcpu_thread(cpu); + accel_create_vcpu_thread(NULL, cpu); while (!cpu->created) { qemu_cond_wait(&qemu_cpu_cond, &bql); From patchwork Fri Jun 6 16:44:12 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: 894466 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614934wrb; Fri, 6 Jun 2025 09:47:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWrS40K3nNbeoTASA3ul33kZXazrMtOz2W5iDNt2bPs0I0zhFH74PpAHdlqzC2Knqi3hV4qvQ==@linaro.org X-Google-Smtp-Source: AGHT+IFeBCoVtjwdlYUioX75GnBSSF0VEzH5epNID5GFOwI87ZIZH9WuZ5iE2VFRqQvCeClxVSSD X-Received: by 2002:a05:622a:2291:b0:4a3:d015:38be with SMTP id d75a77b69052e-4a5b9e3d64fmr60357351cf.25.1749228424757; Fri, 06 Jun 2025 09:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228424; cv=none; d=google.com; s=arc-20240605; b=cDgtqfDz3bYiWxmIn2KAzRvFDNt0dMlcW4crqJR41deTB9G8d3mU9DbZyFDgTtLgmB qxcuzTuy0tKtfGDXZRDn5xJbfEkFjLTBOdUhz06bHttvhdgejjn8VLG5IXeeC90JJgUQ Tyo9q9Sh2GciQfg8R/cWzebqOzQV9RIFh64aQJGrcZvKQNdcUusrKCjgn4zQ7CRDulg8 zTTSF+Nvzfhdgh1B+J0abex8IPCOv3E3RChec1MXYWrd72i8SVB3TQNDt5Rm5mV2sKtX UYfMlitsX70PuN1WYzIeWYetEsTDuqFEKIgzRHzokKmVRzZffE4QJT8BV4GIIRgHJn64 uWxw== 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=pwxS6tGZTBGZ4r+Yv78QnnlZaFN0K0U25unYT1xV8tg=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=UsxmytcluV9D2yiKmDRIM+zCuC6Kac0NA4fn1XyS3ZmD1gfLzw7ANC2MSIWrGSoKVW esVXqRrgBrR4KhCqbqhGNOrVep/2ElxUSdcJP6QbmdkdqXQjlcBvA8RBv6A43qANXfXY Q2s+czFctk5uEQ1MbIcQTGn0wv0r2POjCI7b9f09yMcPFsaJc7I3hgp3OamTuAykfa72 jmCa93H1UbRe06WtnJcbxrKbwTJE70C3DLHiXgsTbNRwQBfWMSfBLAMQwwMRNTmeO5AN xB+2mSTeRh1gCsPMfPgkQ3HliKtaaC/i8FePDwZzio7xHi2m9xqAWHOt7+hZjfKtLlB/ edgg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X+l92fH4; 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 d75a77b69052e-4a61988b795si19617881cf.301.2025.06.06.09.47.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:04 -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=X+l92fH4; 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 1uNaD8-0006RF-8m; Fri, 06 Jun 2025 12:46:30 -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 1uNaCh-0005xE-0L for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:03 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCf-0003Rd-1m for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3a366843fa6so1230461f8f.1 for ; Fri, 06 Jun 2025 09:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228359; x=1749833159; 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=pwxS6tGZTBGZ4r+Yv78QnnlZaFN0K0U25unYT1xV8tg=; b=X+l92fH4QjokPYM3ltqPbj9NGQWusb3ojs+8gziS5UKk6g8YA7xaNeLR63vyh9EDDs 5DOHWl7bBh0HS85XFla+h23kHI/0ckvU0YSKk4QP2cMhsla9ILFFXxsnA6fxaTSuld+Y kX7MIu82ArKfZzFmi3mzMcYpWFSQyhKPvm+2maYRTaWMemaeplp1zBW97vwA3jXV4lPg sWtAO1FR8GozqBZRn2WMEsKhpXkgzacMuyID6D+3s2lE4CjrAUdiIaI4KtVZqQ5cV9r6 UJ9N7hxjAEuFV6z+cNaSoAwHVWmUid1cJfnPjZmpcqTfa+8BNSif3jklDNqz2Js+Z43K uIxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228359; x=1749833159; 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=pwxS6tGZTBGZ4r+Yv78QnnlZaFN0K0U25unYT1xV8tg=; b=g6qGdKNePVXCG5/tc09JWHrAj6SHYL1cxVBGqBUbg1XchRAWcmoc7NqJ57YDHAKDO/ Ti6aOWeG+Ij8OyfK4gaYKas+J57+SBIWhP5nXyJvkX/JbpBIFQiHFxK3mPZHHWHocgJ3 tEH/dmrd5pebeHJGnKRGUANkcEU/X8lo/tyyi59zhRLx0mDpKgtkwZTVNDn9bhmIHs2v IOsWHbSo27BWuKAhPiJxWa1bi4OPLT4ZlK8NxJDEiHtEvMC4XLKjzdw0PZHUn9RVGi7Y Zg3KM3KBP/KOzlluo3FL+ThWqcrFrFeN78VdklmgUEP3/EtV7mpw0xeHrrEzaG15osaf U29w== X-Gm-Message-State: AOJu0Yw2131KFVjYxuisIfr1NTKPyhU5zqT45dxLVZmpfcxeoDiFQX4b b7NjWdFCuddaD6yXf/FaJUnzmheQFEFjUSqBMy65cUV1QR6laVIRFwf/I0lS8Ibyp/gHKJb8QFb 4nZYCOYQm6w== X-Gm-Gg: ASbGncvmrTZ+15Y5V4+u2gf1y1pXo2FflAEXx/juqZLcmva6pFKP5uJPCuZdW6LYt12 geMHBwC1CE4KhYEiSeNczAPTON7bqIAShQblc9PTrF5wRmuPMNBejr0vpjJMFdkOqoHiZftXfPq Ivv1TUiEXwPScWIBXi/VPj+CMIRToovQTx5btUxnADOvjs+9R8G9DBhaJEJeUgjjMTInWt7U8qR rPx5zVN+jrP50jgPT2UPHLQ5NL5SRVBYhjNRidtNkzxTAlcPGr1ZGIox12Go7k3DAgU+DLpXH5b KN5X04gSyrWtoH6kZUE+agN/xEji1RW9pApODNfDFO1D+d4w8DtVzoFNXeF2AcnqW+Ui0GQTjwA xPCIvuzfFxpVm6dHgRy+2pk8J0hzX7vGxUy08+g== X-Received: by 2002:a05:6000:1a86:b0:3a4:f723:3e73 with SMTP id ffacd0b85a97d-3a531caa50cmr3448182f8f.16.1749228358894; Fri, 06 Jun 2025 09:45:58 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244d66dsm2362103f8f.70.2025.06.06.09.45.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:45:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 13/19] accel: Introduce AccelOpsClass::cpu_thread_routine handler Date: Fri, 6 Jun 2025 18:44:12 +0200 Message-ID: <20250606164418.98655-14-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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 In order to have a generic function creating threads, introduce the thread_precreate() and cpu_thread_routine() handlers. Signed-off-by: Philippe Mathieu-Daudé --- include/system/accel-ops.h | 2 ++ accel/accel-common.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 44b37592d02..a6535a07343 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -37,6 +37,8 @@ struct AccelOpsClass { bool (*cpus_are_resettable)(void); void (*cpu_reset_hold)(CPUState *cpu); + void *(*cpu_thread_routine)(void *); + void (*thread_precreate)(CPUState *cpu); void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ void (*kick_vcpu_thread)(CPUState *cpu); bool (*cpu_thread_is_idle)(CPUState *cpu); diff --git a/accel/accel-common.c b/accel/accel-common.c index 6bd4ef47c2c..39eb2b2c1be 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -11,6 +11,7 @@ #include "qemu/accel.h" #include "qemu/target-info.h" #include "system/accel-ops.h" +#include "system/cpus.h" #include "accel/accel-cpu.h" #include "accel-internal.h" @@ -104,7 +105,20 @@ void accel_create_vcpu_thread(AccelState *accel, CPUState *cpu) if (ac->ops->create_vcpu_thread != NULL) { ac->ops->create_vcpu_thread(cpu); } else { - g_assert_not_reached(); + char thread_name[VCPU_THREAD_NAME_SIZE]; + + assert(ac->name); + assert(ac->ops->cpu_thread_routine); + + if (ac->ops->thread_precreate) { + ac->ops->thread_precreate(cpu); + } + + snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/%s", + cpu->cpu_index, ac->name); + qemu_thread_create(cpu->thread, thread_name, + ac->ops->cpu_thread_routine, + cpu, QEMU_THREAD_JOINABLE); } } From patchwork Fri Jun 6 16:44:13 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: 894462 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614728wrb; Fri, 6 Jun 2025 09:46:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQS3VH0wM4TSrghHybGKln2sEcW4tUkyCLUIb2GSQicS1FCUP854aQvFSSoXlk4gCwrjn0PQ==@linaro.org X-Google-Smtp-Source: AGHT+IGg8IbEoVCiDAGNZH8Eu12/MA8X/+ka7i48t/Q2G7mZZHCCFhZ1RhCxs0LOaLr+Q/ID07/L X-Received: by 2002:a05:620a:192a:b0:7d2:27ca:3b1 with SMTP id af79cd13be357-7d2298ec101mr748983985a.54.1749228396184; Fri, 06 Jun 2025 09:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228396; cv=none; d=google.com; s=arc-20240605; b=VJu+ESm+aBS4PGLtic1M12+PBE0QxizdHvziG6RAHBGlUCiy4aaK+NEoAiqmwciQan DMUr4Ntkm6m/kUBHsZAHj15D6BiggZMf5IBFrIB6N5VyXS0fz4P39IxhTs3YiwuMOkiS lFbJsKbua/mlqmkWuoHVzietQ5xghA9MPHQl7yF+0uWYTiSkr2vJB78UbQRjsExO3nR4 yZpUEo0GIAC3bX6GdlFGEeYD6PhcH49GIfbNQj5Eqa2t1eeBC2lC+CqxK3rDmPfvC7Uw OxIQQh9iS2+4BNTwcv2bqbYdt4t3LFn8+Y6fJSVa0FMF9UV3BemRT0Cg1GBB6JK6RDwU g2Sg== 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=hNDNfI0qG9TUFAdzgUh03+hHn2rhRAOW0ter/WGtavA=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=GOBcFlDELK8B0Sda3lytCqvNcfEVomhKXLt0doEG6Y8DkTWIURvbx98MygacwsF+5q jcycSkeZTrknMn5iq3Kew/8k7Tr0n9dc5b9Jetf9zaexrDFMrAGpjnxJkKq0/MW3M+x9 pIJd+MVyNYCl5rTMetOXM/59jsi0qiFqYfGYSeXX5V5NRoTNnLnEWAaDbgIMzSrGf8Fv LAV4Hg5z0R+elO2ndw7IltN6jjYDBORYf+csI8Ac83jMzqeN5pjq1gRlD+BnU16A3mG7 9P9IKLM8En1IWmv8sL0ZdlLYJWU5gi2Qp/JvOvSCLRi54tc7Lw8TGgfBeT29DpbQmLRJ D2zA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h48OmWAT; 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-6fb09b2fa9bsi19283326d6.387.2025.06.06.09.46.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:46:36 -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=h48OmWAT; 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 1uNaD9-0006aP-TO; Fri, 06 Jun 2025 12:46:32 -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 1uNaCo-0006Bh-3O for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:12 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCm-0003SC-EY for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:09 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3a35c894313so1946011f8f.2 for ; Fri, 06 Jun 2025 09:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228366; x=1749833166; 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=hNDNfI0qG9TUFAdzgUh03+hHn2rhRAOW0ter/WGtavA=; b=h48OmWATQoOfb1lCMtfKQhArpGp0k7bJw3bRZGaJzo9Fx3L/G5v3AAjIvUze+60kcH UMGdDP3nwg5PD9MOaQ5mU+mBmb0LCDFj6TATlyXNQwkxh7bsg+rWj9b2DlcK9Ovt3HiA T4AeF+kjEh5o0Blvv52zde+KIPlfbzr0LnoaGxIFxBNn4EubRb7bz5tIQwtzAAlKDvQF YyFhyUtk5fwPj88lcoQhMu/SSYCSNrgQovpUojFnxfbdyizBQv/+8jM2RwdadlGUc8nJ 6FwlFHYXjc9JnnZM1nQCTPSc7lax+3vptw7QIqV8PFO8xO8dBsN1soMFO2Vt2SnNjFM6 nHsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228366; x=1749833166; 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=hNDNfI0qG9TUFAdzgUh03+hHn2rhRAOW0ter/WGtavA=; b=VpjEHvIfkhKgWKgYJf2BgMwK7EM5HrA284KZ1eu3Y55JxK1sXyDKu2Bvw38Bzjqh31 mJbw/4Aii9T8wgaSEnzL072PVgNRKORsU/iiQfGBGsfR+QeSbOJ/fGr6hFg+JiVkDQis UxrjLLx1SV0cmGRKidfltF8CH6rNE0k7TxB0+aqEJwOV0Qzcf99+PADmD6/nDhKX3U8F s50egIpE8wAX8cK5IsMT6ZqC5ETnnC88vCrJHcSSNHBKvdqRlmYufdVV4WSrx5Ikajhn lXVqTnvWN2YmSPcFKu213cxwYNZheemXdTWxhOD2BJW6iAkmDOisC6y8BGy22Vxfr036 NGwQ== X-Gm-Message-State: AOJu0Yx7OY2YPh3buKdxE+0wuB2dX/p7cY3mzKm2fmerwMfpXtlnUPBr Ypjha93Y9SumkC61JT8B0Kr3L0V5fG/hnjb+6MJg2lkLw8KBJqGXuHyokjMECu9wT9Kie0N7UIM 1XcYVRkyFbw== X-Gm-Gg: ASbGncsMwmcpPb0oSXvyTwT1rletFN5VYf7M5JdDWdA5VDvQxws//OhQibHOClW1mff A01lQAT0bKl9z8qSKK/h1Pg4vqubD5DTrGzIgZu0OfCFJHQwRX+gOurJmiMXAhFD2zQm6YR7XNm +M74ZNwTu7J+LFHqCjHFmymbDnG8rMQDC2esFOV8dUxPQvvnIxqBrWItKTob7Y3dKDN6IhgJOHA 4CcgobSOx/Ss4Ohb11bY3DGpYusWh05GbQb9g0QK7qYjlkCitfzddBA7Q06kt4LkNkWFpdNDp57 hqGsBIy83Cx9jmd1EX7BSLe79KR6ELZN4wwaOfxZgIGjPl4O1WRWfCCrGu3R9x7NFwQfbviey0F xfTDPvdUVUFT8b1w9Mxpp0KwIttIkMxV+rs+MXiEXFCL4u1HX X-Received: by 2002:a05:6000:24c7:b0:3a4:f71e:d2e with SMTP id ffacd0b85a97d-3a531ce8887mr3630177f8f.56.1749228366439; Fri, 06 Jun 2025 09:46:06 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4521370936esm30071185e9.20.2025.06.06.09.46.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 14/19] accel/dummy: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:13 +0200 Message-ID: <20250606164418.98655-15-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- include/system/cpus.h | 4 +--- accel/dummy-cpus.c | 14 +------------- accel/qtest/qtest.c | 3 ++- accel/xen/xen-all.c | 3 ++- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/include/system/cpus.h b/include/system/cpus.h index bfaa339dd73..e7ca9f4d684 100644 --- a/include/system/cpus.h +++ b/include/system/cpus.h @@ -9,9 +9,7 @@ const AccelOpsClass *cpus_get_accel(void); /* accel/dummy-cpus.c */ void dummy_thread_precreate(CPUState *cpu); - -/* Create a dummy vcpu for AccelOpsClass->create_vcpu_thread */ -void dummy_start_vcpu_thread(CPUState *); +void *dummy_cpu_thread_routine(void *arg); /* interface available for cpus accelerator threads */ diff --git a/accel/dummy-cpus.c b/accel/dummy-cpus.c index 7c34e6c0fc5..c6756252550 100644 --- a/accel/dummy-cpus.c +++ b/accel/dummy-cpus.c @@ -18,7 +18,7 @@ #include "qemu/main-loop.h" #include "hw/core/cpu.h" -static void *dummy_cpu_thread_fn(void *arg) +void *dummy_cpu_thread_routine(void *arg) { CPUState *cpu = arg; @@ -70,15 +70,3 @@ void dummy_thread_precreate(CPUState *cpu) qemu_sem_init(&cpu->sem, 0); #endif } - -void dummy_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - dummy_thread_precreate(cpu); - - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", - cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu, - QEMU_THREAD_JOINABLE); -} diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index c5a53ecb6dd..6930cc4cf3e 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -63,7 +63,8 @@ static void qtest_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->thread_precreate = dummy_thread_precreate; + ops->cpu_thread_routine = dummy_cpu_thread_routine; ops->get_virtual_clock = qtest_get_virtual_clock; ops->set_virtual_clock = qtest_set_virtual_clock; }; diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index de52a8f882a..3bd91889925 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -151,7 +151,8 @@ static void xen_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->thread_precreate = dummy_thread_precreate; + ops->cpu_thread_routine = dummy_cpu_thread_routine; } static const TypeInfo xen_accel_ops_type = { From patchwork Fri Jun 6 16:44:14 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: 894463 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614761wrb; Fri, 6 Jun 2025 09:46:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOEzqznN9PCeBjUNwnhe7K/lDB2K7AWbz2ebeifbZfr6eqHnT7EqUuschwmsUlB9kkjx2nQg==@linaro.org X-Google-Smtp-Source: AGHT+IFv38bYv8cNq0z1Pjdhi03T7/465ACqyzWFaAvR7LHkc5/SEq/gbSAVGP4OKZhK6Gj/lL4t X-Received: by 2002:a05:622a:4d85:b0:494:993d:ec2f with SMTP id d75a77b69052e-4a5b9e18965mr66611091cf.12.1749228400772; Fri, 06 Jun 2025 09:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228400; cv=none; d=google.com; s=arc-20240605; b=Z4tq/ZyV09GGNQvW6nC/4RIKD9khVco0ff9CDbRHjdGPWFzHPjTdeU+innpmEa6aFH G+fY+Y7JjFnbEqZQ7sJwlHOA7ue/FIrJ8qT8Jsg+ghmtcD0KLOCZTDWnUGRa2WTuGwmr ayjnM00DJW2Sch5j3VKVBwBeTaJHgfI10aWabj2C7OMk+o6gKMk7wZsgsYQ/xGGsmCVN 1A2VdtqSVNCjOAawUVAdPX2f5TIiQxY9jMlbId7joCTnn98KDhfxVNv5sJYY4wnPJr2P 2KTVEFbnZJR9koeJvnXxQY01Pm8PnaS4IaxHCG7hUH4QHZTF/NvH2f0T3b0gPphTopyk 0pUw== 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=u4qlPyVP19TOs/IkzQVFEBQPCs8QxMwe6aQWLV0wFtw=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=DWzvQDuFGsU6knLXza/6vB+GZvwnDv64H6V+5hWkvG7OYBiVTSamXKFLWUpuEYbOZL I7K5kk635LM0cZc7PnaJAMRpRLDbSwydvIZsCSKmLIHNLYYrstqyI9PdiFFYURTXtwtj jDB3gaMeQMb3M619Ekj/S9/r5Lz9U+52fOFn0/6s4Kz5en64dokfqHFX/eMcGsudeise tYBn9WGF5mvmW9M379BCrUlhBlbcDj4LQeCIp1kFAnM+GXrdIrskiXqfiPZpJgGldWUY 9W5T+gh+Re+WW0llEzpVuQV1m+B/1QELxhc7UmrGHIEKG/ugJOaUKqfhzediox6c2nnI zsMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N4Ye0nXQ; 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 d75a77b69052e-4a61116b1d0si20164401cf.61.2025.06.06.09.46.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:46:40 -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=N4Ye0nXQ; 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 1uNaDB-0006fG-Gl; Fri, 06 Jun 2025 12:46:36 -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 1uNaCw-0006Hx-5B for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:20 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaCt-0003Sa-M2 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:17 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-451d3f72391so29934005e9.3 for ; Fri, 06 Jun 2025 09:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228374; x=1749833174; 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=u4qlPyVP19TOs/IkzQVFEBQPCs8QxMwe6aQWLV0wFtw=; b=N4Ye0nXQeR035nDvUHQWs+lGh5qx7PKXKvu03yT3NMCoFc5y54QlUH7btIQ1T10leF NV7uUO4c1D8dqvZwYmnjfSGw/waL4fLNMySw0qsr6Szlmd/y749khoDWFIUYaCMKPHu5 LqnOhszswPC52dVRt/fp32f2TEi44lzgj1oMuSiRbwD8uxnzuJanYsbnilNv25l55gsa tfkw6hNayefNPUvU+hVqzkCkKqN2H1Kago8qruZoY2+KIObh7w83IeQtfpZ1urBddcI4 SeL5Mf4yah2JA314GnJFlqcKGlcpzVs9iDofrX3zKfZsMCODr8G+NYVZzbo+DFt59SzL NYgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228374; x=1749833174; 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=u4qlPyVP19TOs/IkzQVFEBQPCs8QxMwe6aQWLV0wFtw=; b=YjfHHvaYDLRR9QcXEBZgkp3tY5qiCQ+/FyiU7+tVjGJjWdmdnkVdk9vJyPtOExlukj CgbcmXfTTuzxBqzGln9jCsCwefeCBqnj5RFu01+++AZ0o9zXK2yKCAD1mgugWPvTP/hy 0VgBI5/rQEpsIepKWJEhyy5z8IeQHcAhbXI3mwDyQb5VZr90U+Euflz/iu2T1GopJdmV 7OUQZF7ZRZLaw00fV/9IZ0DIRM0g06SgF/EHz9l+JOFlVAlyw1/Ugk1WcKRgjiW6vDLO VXalsaYpnNQN0urvmikNzcCur1+ImhtBQX6cKstg5gV0Q/3eZwYScCWpsHlILobGO/Db 96/g== X-Gm-Message-State: AOJu0YwTWTWEXoYAdCZp+KZxpCgRaAyjaHsg/uE4AftEbv07E7wJhOGb Q031RztmNAhlLXGeR12RRJWts4CSY6C+3wphKXyGEPxA5BimhwSNCI8g7s2nYWhd5Fv1syQSx9X aTA9St/h/tA== X-Gm-Gg: ASbGncv06l+m6QrMsDKj1RwQqPG6oPIlyZ084cRCfLpwaYP4+g50emuWQx7uW5A1kE6 5+GP2lIO5dUx5k+T5/tGM1E9llONH0+8QTGHk4R5zUMlCooOzhwrUtY0zrSpPSJPq/voG4qYbGQ Dux7aZQkPGLnRLz95qJIhAXRiirKY4AoBx3iqOFvVePSkflCNolLWV0iqQ4XnFrkIR1niUuHHDx w2MfAeP2TiYqwBFpByNaBZrYAfHJwz7JHYsaoaekxIxRUmn/S9cj4JpBwzTnDm9HRj6BtrNrrI4 0/fgrPKo1AnLa/LOFo2Q0uaYZMdqhldcXvA/YscGQ90OLSqE7jLz6m5CYtNTWxA5TehICtTSlu2 TLXKhxL69sbSNcLElhV5IGhdyVBAmnxKfLs7LG9JBg3CaVSb+ X-Received: by 2002:a05:600c:3ba1:b0:44a:b478:1387 with SMTP id 5b1f17b1804b1-4520147ea0amr46702795e9.17.1749228373574; Fri, 06 Jun 2025 09:46:13 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452137281b0sm30312505e9.29.2025.06.06.09.46.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 15/19] accel/tcg: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:14 +0200 Message-ID: <20250606164418.98655-16-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-accel-ops-mttcg.h | 3 +-- accel/tcg/tcg-accel-ops-mttcg.c | 16 +--------------- accel/tcg/tcg-accel-ops.c | 3 ++- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/accel/tcg/tcg-accel-ops-mttcg.h b/accel/tcg/tcg-accel-ops-mttcg.h index 8ffa7a9a9fe..8bf2452c886 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.h +++ b/accel/tcg/tcg-accel-ops-mttcg.h @@ -13,7 +13,6 @@ /* kick MTTCG vCPU thread */ void mttcg_kick_vcpu_thread(CPUState *cpu); -/* start an mttcg vCPU thread */ -void mttcg_start_vcpu_thread(CPUState *cpu); +void *mttcg_cpu_thread_routine(void *arg); #endif /* TCG_ACCEL_OPS_MTTCG_H */ diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c index 462be7596b9..96ce065eb59 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -61,7 +61,7 @@ static void mttcg_force_rcu(Notifier *notify, void *data) * current CPUState for a given thread. */ -static void *mttcg_cpu_thread_fn(void *arg) +void *mttcg_cpu_thread_routine(void *arg) { MttcgForceRcuNotifier force_rcu; CPUState *cpu = arg; @@ -128,17 +128,3 @@ void mttcg_kick_vcpu_thread(CPUState *cpu) { cpu_exit(cpu); } - -void mttcg_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - tcg_vcpu_thread_precreate(cpu); - - /* create a thread per vCPU with TCG (MTTCG) */ - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG", - cpu->cpu_index); - - qemu_thread_create(cpu->thread, thread_name, mttcg_cpu_thread_fn, - cpu, QEMU_THREAD_JOINABLE); -} diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index e58e1c3738f..954e85dc13c 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -210,7 +210,7 @@ static void tcg_accel_ops_init(AccelClass *ac) AccelOpsClass *ops = ac->ops; if (qemu_tcg_mttcg_enabled()) { - ops->create_vcpu_thread = mttcg_start_vcpu_thread; + ops->cpu_thread_routine = mttcg_cpu_thread_routine; ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; ops->handle_interrupt = tcg_handle_interrupt; } else { @@ -226,6 +226,7 @@ static void tcg_accel_ops_init(AccelClass *ac) } } + ops->thread_precreate = tcg_vcpu_thread_precreate; ops->cpu_reset_hold = tcg_cpu_reset_hold; ops->supports_guest_debug = tcg_supports_guest_debug; ops->insert_breakpoint = tcg_insert_breakpoint; From patchwork Fri Jun 6 16:44:15 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: 894467 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp614980wrb; Fri, 6 Jun 2025 09:47:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWtDgVU6slbjvsD0bthGcwTgUByifXR4v7e2yWSn5M1b/0yy1S3SeRQyNyMZUkNW0tkP4TzwA==@linaro.org X-Google-Smtp-Source: AGHT+IHC2Ty4HejGd5JK1+Hp6HMLn6TdDmf8TjJYlKUesEoUatPYGCy1Q59Bc6O3kS3tkZAr+x0E X-Received: by 2002:a05:6214:300f:b0:6f4:c602:806e with SMTP id 6a1803df08f44-6fb08f54928mr63282206d6.13.1749228431126; Fri, 06 Jun 2025 09:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228431; cv=none; d=google.com; s=arc-20240605; b=lNJsWoP0H09PcKoQS4ZzFz6iDv+KRY/BwO5Rgh/LW+LyCRdIgDa09WzlUIbxuPvbcv arorh8BNOOceuIonCUaHRtN7bWULcm2xKYBBNzIYtn4vZtu9/Z6tKhX6iaAXg39SktPG OlfBoWEdEj9rAZxuMuNz5wfUR6OsrizuWqFTFxgyJ8BwsbDGpw/QSJY+GFpEFWvbPWDx 4K1sBmVZ0ZkX/FilV4S5d6QvzVLxHwGK7uQAd+Xy723tNEJqovIPf55kXYADNeXKIXHv d3b8kug2o5pMrGDHTPPU/tGKUmwWQnFtGD/JHHWS2vQ3sI/DSp/3yPNok6aJDJ5yjs3b c1TQ== 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=GbtuoNgudglhJLlyI30gSCpvbQM9+V/yqMDBe9lx7qs=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=BTSLOzsTcmj49CAoxy066aufvI+K9t1a8DZhOA8zjIGoXP95p4D1FLbO3rrtqPlLqA 760yk7NyUcvEwMgFZyAHBLvG5XiARvjS79qVMj3vp7ZbysSfvq4enxV4VYIsf2K7ykCh fvbs7duA6waTW8oNYm+CDfbnUcydZWlfAWTHqbbTZjCLUgO9SquQhGeh5G2HUL+ZurNE 4gnsDkXooCCPGz6Q8fXpYE7cxp0dlDpTmktIe02uGUDDzeTuFrNSX5YZzLTOh3oBScRu EYsHe+hs0eciwsRxNiKKwWAJWDyBP8oLq410Z6GZd6/5w+0xmXxU2LJxJQPk9tU8oq0x /9Mw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVuujyKd; 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-6fb09ab0933si20074226d6.27.2025.06.06.09.47.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:11 -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=hVuujyKd; 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 1uNaDd-00078t-RI; Fri, 06 Jun 2025 12:47:02 -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 1uNaD2-0006PG-Hh for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:29 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaD0-0003T8-V6 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:24 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-450cfb6a794so16131195e9.1 for ; Fri, 06 Jun 2025 09:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228381; x=1749833181; 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=GbtuoNgudglhJLlyI30gSCpvbQM9+V/yqMDBe9lx7qs=; b=hVuujyKdyyIAP6ytRfpgU3VDmYoxca4MIxiAMEqr1ka+iOnzItZhU+jA1hNWN8wIU4 B+FCqdIYWKddSsHYTEqQL8HfEwxZwXdutfwMgOq7fZS4HFshYBXx/GcP5ZdzzOEBODkp KtZAhZL1iIHGmSn9abOsmcY5I58vW8Vci3suvjyeeTBn48BLy8jy3VfwjIN3yD6QbOIJ t5npfDard+QjYSbJ76Uqn8INmr0IF7i2dgZIF8lbC7CuakgpDSq6J0jVkulz/ddih0hy 3KaJ95gaKZZhYm6POBK/+RKCAgwJQIWS4m9YbfolhHjlux8GWXJ8Q+C5T1yQGuPbYfBL ebtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228381; x=1749833181; 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=GbtuoNgudglhJLlyI30gSCpvbQM9+V/yqMDBe9lx7qs=; b=VGKWk/Vo4qYWKu63o5MqBLKvM2Ym6AI2Fevv4Xb0Ixr9lVhE+CkgTlnGdJvsQlhMn/ +VJS/VBjSw1yOJgvFTIAJbqzUL6kCoLc9szaSLNuSeY0HlKPx2jLj7Gc7OOpDS2s2k2V CD2x3QMsUV5yYwgzzIBO56WF2YMBVELJd09r3KcF742J+KnJlV6+QZUebQMVPVEmx6a9 e2DdjwLkZcnjtnOymXQbG23n4CjbzZl1CBM1OkEdHiPjscnvlo00ZtTji4Tnz+k1iqDH dnjChvMHPJysLB7uxP1VHf0V2ar6cYw352gZQRCu6UCyxeLy1p8brB8TNGrZKPTIbsHk wRsg== X-Gm-Message-State: AOJu0YyIoaTX7BerTat95gsrk3L0teTyULM0Z9ysr2bUt4J8NyzqEg8M 80XrqllCekJzlnzkjRXlW3BsXFvgyEwXsCm1oNIP/y7d7rGHMDAUhwPF7h5hvTOJAQ4Z4FtMuG1 GUm1vvbiZYw== X-Gm-Gg: ASbGncsMNv4Ylz8zfdPyXcOuKU4kZORh5VvVlayjHizgcxHRCSYdejj3X2UeXshefsb AljeTemZu9A4m7RVRnUadfbCcGD9JThpjfHB0AxJQXKjqKj+JjqhrlVMuMvWamJk0lB49jZauph KOVYHIaTMqZzcvRked/PdaLdABdZJfnd8R85DwwFZlzIfHOUc9V9MwxnxmM/B+rtPfiNgREgE0Y NYbe7bnYUlbhLrNnufft52QFdG5Gl1tMo1xC3b+L9QgNmSAk9MjBep3bLxI070rkOjjwlfcnQG0 0pQdo0Z/DUjK7U7bSslPhQ66hasKITDVpKY/ziNjmRQZBCiIuCxV6CxWbcDmZjByWwqim5Ph7w7 3Y0o9s9ziH5zgW+LWEuP8HTAm5PY1WN8EhBCJdw6y2hpG1GMh X-Received: by 2002:a05:600c:8b11:b0:450:c210:a01b with SMTP id 5b1f17b1804b1-4520136993amr46814795e9.17.1749228381060; Fri, 06 Jun 2025 09:46:21 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a532464e7fsm2341760f8f.96.2025.06.06.09.46.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 16/19] accel/hvf: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:15 +0200 Message-ID: <20250606164418.98655-17-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- accel/hvf/hvf-accel-ops.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index f4a983d1328..d9b533820c5 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -458,22 +458,6 @@ static void *hvf_cpu_thread_fn(void *arg) return NULL; } -static void hvf_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - /* - * HVF currently does not support TCG, and only runs in - * unrestricted-guest mode. - */ - assert(hvf_enabled()); - - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HVF", - cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, hvf_cpu_thread_fn, - cpu, QEMU_THREAD_JOINABLE); -} - static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len) { struct hvf_sw_breakpoint *bp; @@ -580,7 +564,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = hvf_start_vcpu_thread; + ops->cpu_thread_routine = hvf_cpu_thread_fn, ops->kick_vcpu_thread = hvf_kick_vcpu_thread; ops->synchronize_post_reset = hvf_cpu_synchronize_post_reset; From patchwork Fri Jun 6 16:44:16 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: 894475 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615537wrb; Fri, 6 Jun 2025 09:48:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUhzSx22zIZzPangicNWauDggeNTpT4GVNlswNSu4kgVaWhQoloP37IJW3FSOT3xzwjKNjRlg==@linaro.org X-Google-Smtp-Source: AGHT+IHIsNGQiByLvzrT97Kk6OfBVa1iUpE6tadEIiuO6TaU5X9ItrvELnB/c5/lSaanqqZQqaHD X-Received: by 2002:a05:622a:424b:b0:476:add4:d2cf with SMTP id d75a77b69052e-4a5b9a333c5mr75947951cf.16.1749228502762; Fri, 06 Jun 2025 09:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228502; cv=none; d=google.com; s=arc-20240605; b=VxMuQ28MC88PRdXf/K2eek9OeOxWFg/toQvCFz1j6zmvp9I9EAtLXJ8g+d+w1bAbry Fl6VzV7HDZ0CdvDxZSa+yqpLlG63W1nvPPnxUiO0k/+JFXGBd1xKf1oqdl3uSaYi7/19 rFWumwcLbt9DaTbxiSmIonlA1ikECfAj8Jj7AetkGGmozWPmrem0yohZdFQ4TBy4AyVy aSYuXScjEfb85bXFiI11+kNmY6ri070OZINkZsYavShP4zlAfrSHrej49zwM6SPQpz8K T+mozwwDSVLqq9C8dtv7AFMjHsGk4EfF6vbt1pRk2MCw3XsJ/bBOWzGHYsKU0nE/QpCQ EbGA== 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=eW26fCg8e+Q3GYcnecMlFtDKq9fMUnTMjzlwEj1wdjA=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=lE6i0dGmP3zRmDd/dF+rdDWvMkZpjarBB2fF072kFBuMqdRB89tRRld4yf7K6yMJwR w6xui/BnPX8gqjBWHriBSoqjy7hmqv3wv+G13hAuV2/qjm6xSdjHF3SKIn4CCLjJHUSW 0K7LV5uV26GY6V/Uzv8heIJV8DZLnqk74pM533G1soYojJHFSDLDRXIo7aiRqDYya0zt lFmeZ96sJ2KgxpxPPtH6zKIiOhvoW6KXcp5ypF7NEP1jvXAD7ew/Y3ONgj1GB0cQh0yp wpKPiyoJAwke+pZ6oZphIDeVW8kKSl8F1QNY2/RCyUaRhqiSKkWgRyUD4oiJ+06xvG9L 8NGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sTaNhiP1; 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-7d25a61d707si208849985a.425.2025.06.06.09.48.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:48:22 -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=sTaNhiP1; 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 1uNaDh-0007cR-IJ; Fri, 06 Jun 2025 12:47:05 -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 1uNaDA-0006h2-RH for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:33 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaD9-0003TS-5L for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:32 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so28320925e9.1 for ; Fri, 06 Jun 2025 09:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228389; x=1749833189; 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=eW26fCg8e+Q3GYcnecMlFtDKq9fMUnTMjzlwEj1wdjA=; b=sTaNhiP1t1wyZwI4e6Yz+dcEyAkc+6pDsug32zFhoFKCnoWOmBwv2AqFVGZBYPsQKc VZUrXu/Nmk4Zhyk0ee9lzTlH70QoUozEOhafY25mD7MO44bga2Hgw/qSp4hnMVSGgBcz je99eEv5eQG8UlYFrSau2o8Ht7VefXRVypF3Qt03BO8kUyrICv6soud57Tuj/BADWYH/ VikAAjDv4ksSeJ3S8yh0AjHvJ6QQRelM/ZyHWpGKZqJOSDJ3n/kUHdujdzgq+wkUfOln Gb7cD1/oSMuIwIZnGiw6cKMS6rBtuyKguBipHRYBql17a8HMM15SA4JoFwW7kJl/ZZYa fW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228389; x=1749833189; 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=eW26fCg8e+Q3GYcnecMlFtDKq9fMUnTMjzlwEj1wdjA=; b=t7VnXefRIRsL/Ixhy13FTdi8Y8b8vgBXqjO9mLrAI/sRaMs7CRcfuIvqmoZ58m64/Z MTpSxTxqjRO4J6Q7R2+p1QXgrXJ/Cp435j1UIypxktyeq7E8aKfNez9sxvg8R+pDPQKX ePNHKKPhlAlBxshnBI1uVDJ+5npjRLUi63ddN6qwVatJJkkbiPrW1n92xEM62ZBKJC1w BiXAuNJtAbdD4v7OIp3AFsqw3jbEr+OkXolOZjKCICDP1iBN/0nVXWZVRL7dB5seqFcZ z5gsJES1HQqf2u/6ldtTKcQNrDBAm9LxzA0wdCnosJCWCKc9wujtdv6qEmncCMsQT04b 2Rwg== X-Gm-Message-State: AOJu0YzMCTSUk/zrDQIh2bKN1tFkQ0UT4l0v1m9Qc9z65Cogkm15LyRa Ykb8TbAoegeAaILIsDqxx/F4CLinzSUHS6TwRUL9eW26WitJgTzKNAfP3hBVkCj87yd+7yvF/Jb p+8a+CuzlnQ== X-Gm-Gg: ASbGncsptRgS4wKq8bIIjzuMNfMaqnci0/BST0+MeNWgcZFENV3zn56nrCS6Llw+6H7 aq1YACPCRWTw0rQ7TOSq1YCSAmVFTOxsyzpID8Z7yq+emPJjt+oLNkHKHicnLGEtfKUK/yte9Cd vSiYvDQL/LsOCP474Yhw+clXiWQrvb6La2FOvimuR1BHUKxWf2DVj2iPV4o+gsbOj2qwof/mRA9 1vPFfp9LFr062Xabb+Scm9073sSe1fcmcylp/706pNOgA9gxdiBvNQRlMig7OqVU0X9rQCsSSW6 VrsiwoJbTTr+RzTIKEUjlsbhgOtUXycVDkHlflN7KGpihsAsYh6SmlOiLrrFNeg4fIwkuIgdRf1 D1D3o2XeB4nCUNM+BUpwLGTGwSX1bllDlVZpvzQ== X-Received: by 2002:a05:600c:6209:b0:441:b698:3431 with SMTP id 5b1f17b1804b1-4520141a7f4mr37452095e9.28.1749228389139; Fri, 06 Jun 2025 09:46:29 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452730c66a1sm26841725e9.27.2025.06.06.09.46.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 17/19] accel/kvm: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:16 +0200 Message-ID: <20250606164418.98655-18-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index e5c15449aa6..39334997fb1 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -63,16 +63,6 @@ static void *kvm_vcpu_thread_fn(void *arg) return NULL; } -static void kvm_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM", - cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, kvm_vcpu_thread_fn, - cpu, QEMU_THREAD_JOINABLE); -} - static bool kvm_vcpu_thread_is_idle(CPUState *cpu) { return !kvm_halt_in_kernel(); @@ -94,7 +84,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = kvm_start_vcpu_thread; + ops->cpu_thread_routine = kvm_vcpu_thread_fn; ops->cpu_thread_is_idle = kvm_vcpu_thread_is_idle; ops->cpus_are_resettable = kvm_cpus_are_resettable; ops->synchronize_post_reset = kvm_cpu_synchronize_post_reset; From patchwork Fri Jun 6 16:44:17 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: 894474 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615485wrb; Fri, 6 Jun 2025 09:48:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVV42YX23p2YOmw+OBDttlN8N9WTCAcfLuL5elH6FkKan4kMDTc9LpnXQVGkn1OZnwVpNjqBw==@linaro.org X-Google-Smtp-Source: AGHT+IEepgx4yoasLmJCwhMMIRtJ6ZBAJqWbN2XhM+7aBGZvR1FOwZALjtaWp7Uo5jC9xDO632CO X-Received: by 2002:a05:620a:460c:b0:7ce:bd8b:2d08 with SMTP id af79cd13be357-7d229862b2cmr586933985a.10.1749228505929; Fri, 06 Jun 2025 09:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228505; cv=none; d=google.com; s=arc-20240605; b=ZZPky5VgT2Jj1pcQqR8jFdGI3Xq7YX681uoNtmDebuYkUaYUoxfEcjllRBZS8qWFrR 9Xpg1fSyfaNAlrUs95IdqiYBqSO1GQqndWGC8zM8wd6TODQokbGTcP7p3tI+aEy409mI XeorPfsg9ekCmFWzclX3jM4ov+6nrhT29uDCmrohLum6dbSe4bZNK7yKCwhlThClCbmV f5BYyY9KjIsgcZev8Jxtxm2183m8eOWROSmQy1SJXqpMdBDXbGE2s/4AtIxJUwfUWS7D H0P18KNvz6yWWLhyfMdVNtqC1BXfmLYvWS8dj5tjU2G/aTxX0kBVC7KsM+ng8HDhZnfJ jmOw== 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=bscCZhJPor6p9xOGYxKsyHkSJQbAuOk7LsWMwFm7sCY=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=bbFWT/M9H/asuo8y2HdMa5jo7QOKcLrUIxRcqVNUsTQazEhp0hvO3fX7fAP3SUiDHW OespTv1JNVi+2RrWPHnDFnWiIEn26VEw8Ny/FHJePHWYK/s1Hay8GWLAhOiCJX/+Tqxy 7ygYFSevR6KwRREZ1PZ+ZNmzEdzKXpteKyMsHj871+SgRG3To4JiNLGcZC2ZyNmEAHE9 PPlt6N8GA3gU5lu5G/jIjlCeKzRQZ/MWu57ri/lmzNXmFRE/imHpah3hUz3DKgMXROhd vyINbsz8ZfeIIUCUKupMdIpZOXB+z6JpWtGsbo59sFpkaTaw8aNMDu4qaoYX4vhracpG /pfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="II/Sxjs2"; 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-7d25a627618si205845285a.510.2025.06.06.09.48.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:48:25 -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="II/Sxjs2"; 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 1uNaDg-0007SU-0A; Fri, 06 Jun 2025 12:47:04 -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 1uNaDJ-00072S-DK for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:48 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNaDH-0003Tv-2M for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:40 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-451d6ade159so20498785e9.1 for ; Fri, 06 Jun 2025 09:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228397; x=1749833197; 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=bscCZhJPor6p9xOGYxKsyHkSJQbAuOk7LsWMwFm7sCY=; b=II/Sxjs2GBolN5lwLhYzFLIJkxWKUqwdXU03MlPZ7Ekhc1HXrtN+Uh2R5oSOCgm3bP db7kbnmvAqFcPFaM1l+WZ0s6UcCSwg/vARbvWi4KYmq4HAs/ixoS3fvnugNCmGmA4wbd yK+j0ZFeGhrfnrwvmmt5unXBUlzOlYYuQq6yN1rJkXgN+ehePUvrsdsKtXpNReOAhrQH oKwlkUP33h0+5QRLLlCzlp6uRaQ1o6SVOOW1iT7Lv6pFv+5Me3neuTarp2hnwizSbGUA IMfUvEJAQyrsGsUhShNGlk8cOUvO6YFrNgq5oluQIGnQYk239npc8vpV8Q1sG+Azpn0F Lxiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228397; x=1749833197; 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=bscCZhJPor6p9xOGYxKsyHkSJQbAuOk7LsWMwFm7sCY=; b=rM9x5jSsqGZFNjlT4nG6pYwZe5B9kHTCyzX38zY+FTZKOFuKVVhY61kkw0ztIszJ/b pkH1O4YlWCcM+x9BT2SaFCT2ZpUBEsy0Zk2vj/vXNC6zES+d7/AZ+3CwNDG82VvI4s18 P5YI3OpQZTquzc7GuhESUDuGFkvmzs4h0XjHkHiY5dMwJ4T5QnAYvsdof7Ykp42bMgQ8 ijNKz1dVndXKWVo6EZNjWTFBXC3t587NQwKGv4DuG2dYYKPv5tep7c9l+KGjnKia6oLK UAjLavuE/ZrGFT9N2JoW/ai/Fc9+Tydzo5MmNhgLV8K+geTsXP8eCjFFBT/FzZtMDrDk A6iw== X-Gm-Message-State: AOJu0Yx0ymsSIzomi2UPoeY3ljGqcB0TUd2Z6E9ld3FyZPt+UUJOwIkJ 38Qqi4m5apwQ/YuNLIstpqjcgYG3fhdwGYlZffJb0vjkOydWBIOVFIfv5IPQFnlH8DGOQbzA3YF HXR/915V+0A== X-Gm-Gg: ASbGncvwydSGSaNKN23rmCfH0/I+kvFbN4nVawUu1KxOilZtviLUdIY8WcXE2M/zAm/ EbugkRGgkx1BOGN5Oq7MCiHCORB3VSHraVLelSq/dGk4HaKTpU5tOy0yMSgZcFDe010SOQAu/RP QaM97RLcmKOGGTmcVKHDadKU3IFLO3IXeu/29oSVn85fTIrjJ1b4vhHty5bSG+PSZP9vtI3tBp6 O8CFPNhalz/OI5itkN0aSQip42a2CsC4FfCdsWapfpYkbVXQA7sy4F5EVLAmj5jENkdcDbUDa7z xanW7yMWSbucnBflh8HVMEkXjIZ6Xjcr7EQXqYSf+UmBkcNwfDHF2eFvy9duVVTz7+qCX/DKmHL qzSUdMyZ+P0q0kd7KjJnKdBYrR5PUC/p4jh9vXg== X-Received: by 2002:a05:600c:1c1b:b0:44b:1f5b:8c85 with SMTP id 5b1f17b1804b1-4520139c741mr45100795e9.13.1749228396991; Fri, 06 Jun 2025 09:46:36 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452137277afsm30506935e9.30.2025.06.06.09.46.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 18/19] accel/nvmm: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:17 +0200 Message-ID: <20250606164418.98655-19-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/nvmm-accel-ops.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-accel-ops.c index 21443078b72..bef6f61b776 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -61,16 +61,6 @@ static void *qemu_nvmm_cpu_thread_fn(void *arg) return NULL; } -static void nvmm_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/NVMM", - cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, qemu_nvmm_cpu_thread_fn, - cpu, QEMU_THREAD_JOINABLE); -} - /* * Abort the call to run the virtual processor by another thread, and to * return the control to that thread. @@ -85,7 +75,7 @@ static void nvmm_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = nvmm_start_vcpu_thread; + ops->cpu_thread_routine = qemu_nvmm_cpu_thread_fn; ops->kick_vcpu_thread = nvmm_kick_vcpu_thread; ops->synchronize_post_reset = nvmm_cpu_synchronize_post_reset; From patchwork Fri Jun 6 16:44:18 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: 894469 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp615106wrb; Fri, 6 Jun 2025 09:47:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWA0VWGTICKZ1U/+WK2UgXESDG8BdgGfr6ROb0KWJVqcPmZ448JVUG4GQlw5Ldtl6SOXeIpsg==@linaro.org X-Google-Smtp-Source: AGHT+IG6clPHcMQPeypEkNaCzVqBmxHqYmM3rTK/lank2rJWdqNDLblQCuhbjmlak+Eq6YdYdyOL X-Received: by 2002:ad4:5ce8:0:b0:6fa:cdc9:8afa with SMTP id 6a1803df08f44-6fb08f54be2mr63612946d6.17.1749228451519; Fri, 06 Jun 2025 09:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749228451; cv=none; d=google.com; s=arc-20240605; b=Nr/l1jRSgdP2dpxbSgsySXjFSCGt2iysTkcEABP95DqI2F3VwGQ3Fiitz0dd+qaycF NGjmGdJDa92FFZMr/0bsEfs2GKZol0ezMkCHjrRoNSmM9WqcgrQdVqW/AQD4fH/alQM7 MVtq1D7KAd/JLxlqXcW0Gp1BqZY69Rs8kxEuoO+4bDn1YjjlBc1pkOBTiHGoDQEVN8Ym zHTUq7YkYREW5WZrOsk3CkiPJHQpBcOTnFk70J7RzJ7vqUvAT8oJE7xITcXleue9LR9E yeHwmONFnee1/HwlFQ3vk+YFG4STXXnaj3Dzo3p9JoRsv3JA/TkEN9qjNVdLmLcTxj32 G1BQ== 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=Y7Q0I9KRKGwfpnxMkCGWptv5CW/tc1a4iSXRbv+1UdA=; fh=t8eU813ECvXfe9r8ZA9SxVxC1Zyy8joF+mf6kT3Em/U=; b=cIVrIXZUUYNyu/3e/e5yp2kbpbnTpHaQy4ejNu+lzoAHfJ+fNQJpmSc8HyMAbKEou9 fNd6Pzp77Jv9UZbL+xtDXTKfnVhdtE8Vs0g6GTtJ7F4T/fps9WOF6S8cDDgHT1UqayQQ KUIRA2+KQ2Of9cBl241IXfHVD/RjEV8C4XAFf/H6mdx/6cNN8p49rxoviexh+caPWGG3 aDKQLSbxncF3m3Zh1M8y9od06YDAHJOd1x/Es4DrLTmFDUOtTY+qnoD9EQkjfxh5FvlJ vqDVA38qczuICBG8izJ3Cf2UiHL4wY0Eea5Lnxptshicu5y4wN96g91pyg3CusgtfC7p 9kMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L7lUVX3Z; 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-6fb09ab08f5si19077426d6.95.2025.06.06.09.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jun 2025 09:47:31 -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=L7lUVX3Z; 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 1uNaDk-0007y9-Dx; Fri, 06 Jun 2025 12:47:08 -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 1uNaDQ-00073K-Q3 for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:54 -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 1uNaDO-0003UX-Lv for qemu-devel@nongnu.org; Fri, 06 Jun 2025 12:46:47 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-442e9c00bf4so18926015e9.3 for ; Fri, 06 Jun 2025 09:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749228404; x=1749833204; 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=Y7Q0I9KRKGwfpnxMkCGWptv5CW/tc1a4iSXRbv+1UdA=; b=L7lUVX3ZhJksjJsHmMc2UrRbMibCQBP3lWjrOAHTqvZnj/xTf5j82GfgW4NEbwEMUO QxkTbGaQ6sXOhtZ9tR7+NHSZyWuzx2R7e5shxWX+j9w7317IDi6uP6LE3+dV/Nz6hZRr SlfRDYpU0FdoY8dmQFizH1gmxFHZqX7pKffQIi0OAHKt1C5QdftsjPcaxiJ9eFx6pMxT NxGWK06wp2ueQwBz/34AEFu7Q6HRv7l4y7BkbzMOOUD5Bj/qykYCP3jmiVIxBchcaw7E kJk1J1NDYROJdoN1ta8DXAPvhSm6s6beexhaILXgTcYcyBCPpqEnuKY3xQR8BqghBfRF qvgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749228404; x=1749833204; 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=Y7Q0I9KRKGwfpnxMkCGWptv5CW/tc1a4iSXRbv+1UdA=; b=LeKNqWTNWWp8D9Kmtc6K8TS4fbfq2GZ4XYvbP3pytkZbkwWpl2X/4SgGxgJKy8oyMp UmcJ1vJbxRY7vAd0UfxSgtoPgWxdiCHrpCidny7svZGCv4uC8hyE6XTEWTuPIUM7DRpa NvSEgss/nxwp7HV/2mTtQMmH6kyu7HsjbuYa6VW3XGZn9092Hm7dfnTj+iTTP8GOsCJq +JGlpDc/Gd8LYaH6aforR9JE/hjMepIzopDyT9VJ3iJJEY0Cru0yUS075IyNBevia/ky ObL3LmUl4DaqsUYEPtQFJgh1bD0MzNiDf/BBfJ0pWc9wGnZFNmWekB+PDYu/ahxsm9Bw 3Z7Q== X-Gm-Message-State: AOJu0YzuASd8e/VOCT62ANYUa8ADbDaW2E7TcZjPO7KaheM4bdoLzwdK RGz9pF17pGlrxU6YAr/wghUcBFA7o6V04UxuMsGczZRUKTidLPRG/ktZtLAk7CHgIhrn7+7evMF r+QZMtB/NjQ== X-Gm-Gg: ASbGnculagMwedq3g6yAT3dgWnlgTBSbtnCMnaY/EqsMKKeo5XnvHN90OFMjJ6mLIYZ DO7Au4PjLRIz0RDbb05kwAmRWHJ8Ir7Bx4QqY7J9sibU1nlWm+vLYIHfrut7ZuMa915T9MoRzsv v0zSvfKoRzJFIWjhMAjjSWA8SoULMd9sANxFohR+EkbbB5ScQyO8tV0zhf1oQpFgweNnZUgpgJ6 Gl6SHkD61I3hN0A1Uq3zVMtizeSATw5limLNwgr2LbpOL1Cc1QF2PeY2+EvWiMjLuPGWYd7+eUq iVxKYP6lgJqt8lQom+Rh3E5iRpdik9MYVH2Xqda+c2eJahuRzn1tT3Ifl7EjUWp3SB3Z3eHCdDY 22XTgY476i+8XMIKHmCI3WmxaQHNSidsQo9IMd+ZrWInfcjpQ X-Received: by 2002:a05:600c:4507:b0:43d:fa5d:9315 with SMTP id 5b1f17b1804b1-452014b56dbmr41284545e9.33.1749228403960; Fri, 06 Jun 2025 09:46:43 -0700 (PDT) Received: from localhost.localdomain (59.red-95-127-62.dynamicip.rima-tde.net. [95.127.62.59]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45209ce5045sm29896375e9.16.2025.06.06.09.46.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Jun 2025 09:46:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH 19/19] accel/whpx: Convert to AccelOpsClass::cpu_thread_routine Date: Fri, 6 Jun 2025 18:44:18 +0200 Message-ID: <20250606164418.98655-20-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606164418.98655-1-philmd@linaro.org> References: <20250606164418.98655-1-philmd@linaro.org> MIME-Version: 1.0 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-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 By converting to AccelOpsClass::cpu_thread_routine we can let the common accel_create_vcpu_thread() create the thread. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/whpx/whpx-accel-ops.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index b8bebe403c9..c1b27d1b89d 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -61,16 +61,6 @@ static void *whpx_cpu_thread_fn(void *arg) return NULL; } -static void whpx_start_vcpu_thread(CPUState *cpu) -{ - char thread_name[VCPU_THREAD_NAME_SIZE]; - - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/WHPX", - cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, whpx_cpu_thread_fn, - cpu, QEMU_THREAD_JOINABLE); -} - static void whpx_kick_vcpu_thread(CPUState *cpu) { if (!qemu_cpu_is_self(cpu)) { @@ -87,7 +77,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - ops->create_vcpu_thread = whpx_start_vcpu_thread; + ops->cpu_thread_routine = whpx_cpu_thread_fn; ops->kick_vcpu_thread = whpx_kick_vcpu_thread; ops->cpu_thread_is_idle = whpx_vcpu_thread_is_idle;