From patchwork Mon Jan 6 20:02:52 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: 13927801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85E48E77198 for ; Mon, 6 Jan 2025 20:03:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.865900.1277193 (Exim 4.92) (envelope-from ) id 1tUtJg-0002sn-AN; Mon, 06 Jan 2025 20:03:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 865900.1277193; Mon, 06 Jan 2025 20:03:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tUtJg-0002sg-7M; Mon, 06 Jan 2025 20:03:12 +0000 Received: by outflank-mailman (input) for mailman id 865900; Mon, 06 Jan 2025 20:03:11 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tUtJe-0002s4-VR for xen-devel@lists.xenproject.org; Mon, 06 Jan 2025 20:03:10 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 40584bf3-cc69-11ef-a0df-8be0dac302b0; Mon, 06 Jan 2025 21:03:09 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so9136527f8f.0 for ; Mon, 06 Jan 2025 12:03:09 -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-43665cd9c29sm559552815e9.14.2025.01.06.12.03.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Jan 2025 12:03:08 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 40584bf3-cc69-11ef-a0df-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736193789; x=1736798589; darn=lists.xenproject.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=Gw/8miEe/PnaBFePSWTnOg3qI2ZvVUjrjdrVrAxgzBI=; b=GpJJjrGhEDpawdBPjjACmpCUFkHH8FrwXHA1FDOcG1DfCYoQvJ7sd7OsxDyLC/NOCK 3i0AtcqPDWHQffFFaTDxmmcMhaTVQfarHruEW5tZAtVGovP6qy9tHMnFWTvgmgiJlSND F82UOzjdOC3Ugdj+m13ayr5SG2HkwEmkXyk8e24A8umZBLfFWIQ0ZDermyxMet+HuAhV cqc7sWecdDJ5SSkt5njszm8OMzvRR+fbajtxA1Ehi54RCG27B9IZ2EeRR5vq7K9ndoeR F+yQaD2DEpSFLbv+fa8Mb5RVhZeWEmrW+LeIVbRwceig6c8CzdxsJMScDsW+plcNcHuZ /lWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736193789; x=1736798589; 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=Gw/8miEe/PnaBFePSWTnOg3qI2ZvVUjrjdrVrAxgzBI=; b=rmE8ZhVvPQgif4MkjHcddxr5N26o/JNL6PP0fiGKtyMjQujAUM8n2asEI00EmOwU4m d6V/8JG/2BYagCp2Ze99ix0FOOmZKAOjJp2sOkb+evhMTrCpyVZvwK9Z2doC33Q+1Esm Dqc4yoYSlpU4j6W950SbDRf7lGUhQv2FdazkgkDXuC2TFM2TRavcFMa+/9ID2mO6p3WH zgQaMdNuDL7nLOH9pOwICpb+GrzLBqT56BOSx5PJTFMdT+Q2LKxmKbO3Jur7cKd3QAor 6OaNo2pCQ9EujXWn7AWPnoVmq03IonUFNXuwV0bWUort1my9wTaEMFJSdfMI1d93K9PH m4Jw== X-Forwarded-Encrypted: i=1; AJvYcCVdD9R58Aaq0lgng7AFlXgOKVr6U6nQgqmx9OUd4nHzo49RrrqzAqgdl2wjCwufutH6bwlJ9sYQ+Ow=@lists.xenproject.org X-Gm-Message-State: AOJu0YzvaU9FywNO88ub3tWHClZIxecD9wKJYoZIRizxOINaOz1BiDko 0wkOFaW76dqtiK6unDEwfA4gvsVVfsTjj96nqsQKLvt8zv2mU3wNs2Stct7CCkc= X-Gm-Gg: ASbGncvUgxOsbFNz4qUnfRVLXqMiH2ja6u7aEFSnYpAMk797Au2U2Xo7gBCQIeXOsLy D9iorM633cnwXMqGO9Q7QgOGmPLBOlf2AzPGGlpqxJ2xuLLzTDUagwYTa0OgxEclf0EUfyDxvkv LXm+sRwoNK8OkCRw7DH5qi6iytixU19htgn08D6I61xwuluo0UpYzUtEgKuEIwsX0Z899fQJv36 n2nHXH8TaFxaXx6niqSbkvdcogNNK7SMR72MJ4HCnYsby11oI36YDbL6hAA9weX+9/NEHU4Nx4V LUVz3w4Onj5B/hsxRoPmRgptkbNbUoU= X-Google-Smtp-Source: AGHT+IE81N1RplBD8FCsdoj95sqyVSqitqWpe38bLlQuumoNL1lLDdZMOpwBwgd43Npz//MFxfo/tw== X-Received: by 2002:a5d:64ac:0:b0:38a:4df5:a08 with SMTP id ffacd0b85a97d-38a7923b959mr440924f8f.22.1736193788891; Mon, 06 Jan 2025 12:03:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?b?RnLDqWQ=?= =?utf-8?b?w6lyaWMgQmFycmF0?= , Stefano Stabellini , Ilya Leoshkevich , Cameron Esfahani , Paolo Bonzini , kvm@vger.kernel.org, Alexander Graf , Paul Durrant , David Hildenbrand , Halil Pasic , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , xen-devel@lists.xenproject.org, qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_?= =?utf-8?q?Le_Goater?= , Yanan Wang , Reinoud Zandijk , Peter Maydell , qemu-s390x@nongnu.org, Riku Voipio , Anthony PERARD , Alistair Francis , Sunil Muthuswamy , Christian Borntraeger , Nicholas Piggin , Richard Henderson , Marcelo Tosatti , Thomas Huth , Roman Bolshakov , "Edgar E . Iglesias" , Zhao Liu , Phil Dennis-Jordan , David Woodhouse , Harsh Prateek Bora , Nina Schoetterl-Glausch , "Edgar E. Iglesias" , Eduardo Habkost , qemu-ppc@nongnu.org, Daniel Henrique Barboza , "Michael S. Tsirkin" , Anton Johansson Subject: [RFC PATCH 1/7] cpus: Restrict CPU_FOREACH_SAFE() to user emulation Date: Mon, 6 Jan 2025 21:02:52 +0100 Message-ID: <20250106200258.37008-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106200258.37008-1-philmd@linaro.org> References: <20250106200258.37008-1-philmd@linaro.org> MIME-Version: 1.0 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- include/hw/core/cpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c3ca0babcb3..48d90f50a71 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -594,8 +594,11 @@ extern CPUTailQ cpus_queue; #define first_cpu QTAILQ_FIRST_RCU(&cpus_queue) #define CPU_NEXT(cpu) QTAILQ_NEXT_RCU(cpu, node) #define CPU_FOREACH(cpu) QTAILQ_FOREACH_RCU(cpu, &cpus_queue, node) + +#if defined(CONFIG_USER_ONLY) #define CPU_FOREACH_SAFE(cpu, next_cpu) \ QTAILQ_FOREACH_SAFE_RCU(cpu, &cpus_queue, node, next_cpu) +#endif extern __thread CPUState *current_cpu;