From patchwork Tue Jan 28 14:21:46 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: 860411 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp376498wrx; Tue, 28 Jan 2025 06:24:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8lQ6CeelAr8JvPg/FDM+I7YXNNWi1Prcew+a/Un5ojdWziMqkV4/vc/88vfC08irhwXkB0A==@linaro.org X-Google-Smtp-Source: AGHT+IGd8Tf22WPC6omYZ+v4bbetSescp5gSTTITvQut2mVF1DPJfz07bDxn+OTTYhobtiU3ffa3 X-Received: by 2002:a05:620a:152:b0:7be:82e5:5693 with SMTP id af79cd13be357-7be82e5585amr3670200585a.20.1738074284825; Tue, 28 Jan 2025 06:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738074284; cv=none; d=google.com; s=arc-20240605; b=cHG+yJdxBjNV6Ke0jOqabJQDeAxtLUEJ9f6fhR3LxRGSj+eNY1sJb7iWmyVN8j/VyJ 3lxM4qQauo4X7o0Wu/UdRGSvb5Ui7nMqLaRxFiC+NbR71c7b8iTGwPaZtuQeXoYUKf4j /4/wjty3hygrIagjj8lNP9yC4ZwPOkOyqjOSLpx3MyGXWlubu6zdNJWyizkALTTWrgTa R456nZNN2x5YP1875DIgw2dti+uIdq63i+8KE6oo+4oeiHniQbSgffXl0jC4Fvaz/Ue3 ogvEJPtQCLWDQ8rF75DYTNqwALmfvY0nOiQ2JOX1espfH/DIh0jhuGsvt8wCk+0ZYo/s 8WAw== 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=cztkPvSxh9km+ESKvRBcfElc50oeVn4euS866OSUDwg=; fh=U6T2d4RqSCGJNf6LOIblgdoe4xaHu2Qwae+meUOhpik=; b=gpQvmfwxb+4AzVygwbyIi/K2c08g0D1yLYsgTYPacAJvgVat7pUqzdUCR88iM/+sKq AQOUh3NwAwK0di4QGGgvZK/8MH3pxRZBKZJtSohpdZC/Bekto9RLZQdTdPYbZrgchvUd 2X0djgbxLLp2wIe2xR65cWTepTxcMDMcDOxPV6OUuFwkn7C4/uj2SeYjCXqB+DVU8zZm QP0KfDoJNKqY6MDOCDCQ0NCWc+rJm3+wdTG56dbtvh+FOJj56/G5/aldS+/M1UwFHL+m BwBc4VE+np7NwLnI7QJ7Nla3SUZ11hTr3un1UsQ0WbZK2m0eZGvdZMVBSj9oUmJiul+C wnUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/hrKUbD"; 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-7be9aeee20asi1423341885a.432.2025.01.28.06.24.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 06:24:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/hrKUbD"; 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 1tcmTo-0007nZ-0X; Tue, 28 Jan 2025 09:22:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcmTl-0007mP-I2 for qemu-devel@nongnu.org; Tue, 28 Jan 2025 09:22:13 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcmTj-0002KR-TK for qemu-devel@nongnu.org; Tue, 28 Jan 2025 09:22:13 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so58378195e9.3 for ; Tue, 28 Jan 2025 06:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738074130; x=1738678930; 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=cztkPvSxh9km+ESKvRBcfElc50oeVn4euS866OSUDwg=; b=g/hrKUbDRZ7AVGBmJVLbpPOwjUuHc3ttkacePEjqXPWvPziZUc8zZdekcZrmhR4mZw dNCTNGOpBAg0JEMuhDXn3M8mNNnAtdnc9tiSD5ud5KwPFArKD7HjWXcjkQHyOHC5jUR3 oPCBYZb27Xmqy3829TYn0gH3Paw4hpsGMovdoZW1h/qzPfSDhb/pUQvDo/Sk88Qx7yT1 Y0eHJtf3jSHo1L3Si2sBa0tK+8k6k4pX1ing+GZNVwi9pCKfK/BxkIdJoh3txTVHu0+W 1lEeEJJdaGEYyLartzDQftwlrfCFE7CBs7lSSeWOkc0J7/p3JPvzdIlZfEYODlHqI2Jl 9svA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738074130; x=1738678930; 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=cztkPvSxh9km+ESKvRBcfElc50oeVn4euS866OSUDwg=; b=t/BA7hFqbYNiUwA4bJog8IskAS1v5r19fFKcKQ2uj6O2bcbRC3mzV60pMFirLMqRDE 94xNLKB2NswT/k59y0Bi4/iQ+n0ZXKg3pzOrEGW5AZaqDRD5wYMfZHVLdlQXNo4Z/yrh 7Yvq5noKZRN61OFCsTXEMEbHJIeN2Itd0j3XOctLZKvrIDu9v2yS33FVz7DjYdiBrJhD qyOt0eXj6oXIw4kjl4HiJKDYBzt3W7XPJyv2wctSnp1HV+hq5gjk/OEA2efHJXrWiQlk elA6GL/ScmJcbAMhXMzHPCxcNx2ugSNF3G/kM4K42DJ/UTKfvjJNbnOeIfsdc6cDImvJ 1gpQ== X-Gm-Message-State: AOJu0Yyw/UDRjSXc8hXo1J+PFLa3ODGAR1CpLEXzEsbdxUy6FjrLxwXb ITgNACQ/nCSVLYifiapn9b8KcxN8tBDpbpgqfiden9s+SDRCJHPNqcl5t0weanevZLmpkh/nb6x UrdA= X-Gm-Gg: ASbGnctDOkH2a898Q77CasXZEnc9FtJisBVXWCHVSU5aLt4qMS7yf+iuuq8i1d2bOoG udGfHiWEcAXE2j40cgVaXPxN6l6m5Jqv3TuPDzZ1tdwbSfLqHYMK3iAzSxZjQ46KVOooHWFDLOQ Vq3ZMX3TUKSZVRs0w9k8+VKcB+rrNk/05jzpSGvlnq9OxHzPtqQkkGWEir9lgqcVpoNWr/RqNtQ 1oDWsF3ApEOjMLwQ57CRgETdMqNS8O+WSVwpdMQp1nImZrM184hBfLitVNUz5ALSdOL91NkW1sD yPsJb1EM87leZ1EYC+ArMe0THOjDI3F3Lgc6xm9inujmwgyu/pG2cunCr/wg/w46sQ== X-Received: by 2002:a05:600c:4589:b0:436:f960:3428 with SMTP id 5b1f17b1804b1-4389144fbd4mr437166445e9.29.1738074130042; Tue, 28 Jan 2025 06:22:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa57csm178828725e9.4.2025.01.28.06.22.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jan 2025 06:22:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Yanan Wang , Eduardo Habkost , Harsh Prateek Bora , kvm@vger.kernel.org, Zhao Liu , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Markus Armbruster , Igor Mammedov , Marcel Apfelbaum , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson Subject: [RFC PATCH 3/9] cpus: Remove cpu from global queue after UNREALIZE completed Date: Tue, 28 Jan 2025 15:21:46 +0100 Message-ID: <20250128142152.9889-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250128142152.9889-1-philmd@linaro.org> References: <20250128142152.9889-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Previous commit removed the restriction on completing the full QDev UNREALIZE step before removing vCPUs from global queue, it is now safe to call cpu_list_remove() after accel_cpu_common_unrealize(). Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 667688332c9..11592e2583f 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -172,12 +172,9 @@ void cpu_exec_unrealizefn(CPUState *cpu) } #endif - cpu_list_remove(cpu); - /* - * Now that the vCPU has been removed from the RCU list, we can call - * accel_cpu_common_unrealize, which may free fields using call_rcu. - */ accel_cpu_common_unrealize(cpu); + + cpu_list_remove(cpu); } /*