From nobody Sat May 30 17:44:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1779808733; cv=none; d=zohomail.com; s=zohoarc; b=FUkbWEFwk3MzEFeOFF3wjyDfr8uy/QWGlZoelYTWZXZGGZyl3vJwDLQyBSWjKShAeh24zqPTijGeKbwBHlKt0g4fH4ISKrRtiEBpX9NKW8MVkoGlnz5WR0TGa9SJnAB+2Ts3Ir6lBLyBVz0W3/fXszZpoBx6UfRYIaGs7i2PSbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779808733; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ce62S3udliLiLQHSuUUmSL5npolTfaaGB+C/mMt/HY0=; b=hH5sBmB3Ten0B2S5wvQXGQs+yb4s8WwjOKRu7slZOslJ/EAXf0riS3EJah9WU4O/WWCB1qLMLTJsWolH8bWdlMaEs6lRxliwj5slo0yJ+E4Zs3KMUhJplTPFfkL+30MMZ6d1GdV8l3yf2z2UsVv3Tw5U2uoPilGSZowrnyp8/mc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779808732982551.9354991854383; Tue, 26 May 2026 08:18:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wRtXh-0002K4-VZ; Tue, 26 May 2026 11:18:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wRtXg-0002JB-Gv for qemu-devel@nongnu.org; Tue, 26 May 2026 11:18:04 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wRtXd-0007UR-W6 for qemu-devel@nongnu.org; Tue, 26 May 2026 11:18:04 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-45ed9336049so541450f8f.0 for ; Tue, 26 May 2026 08:18:01 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49042ce923asm111485275e9.35.2026.05.26.08.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2026 08:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779808680; x=1780413480; 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=Ce62S3udliLiLQHSuUUmSL5npolTfaaGB+C/mMt/HY0=; b=zGGikwuZBMGLtuGv1w0FPac6CeKDTIYYdrz/tS17XSH+z05EJkBYRM0HdmqFRfLD7V SssNX2W1Qq1xhj5O94mcZftWmwngvrHDPWMzSsag7hMROXWpEai8lF9xxH7CTE4Z7yBe f3lPd8VvS1Zw8fhyWIQu9FRvYzSLbuDOId6N+sWGWYAKP4CLOiQU3LIeCxhf38xTX3Da gFupDVO6RUU8CdKwo+JVH0DTAA1G4KNkNWf4XJQz/noPJVSkUwXlopsYGGmETTCbSsex vdKf2K51BapMMH1kQePPLTwzerKTSIts7Tx7jLnI7WBIxSp10FwoSq6MSOWaJEqFSKhY j4lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779808680; x=1780413480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ce62S3udliLiLQHSuUUmSL5npolTfaaGB+C/mMt/HY0=; b=Dw0LJazpZkOc5RTudFxNEJdECypR8LbJx79Su0YslC0s7ih2tHM9a+RBrUvaAWls6t KCOYB24v7iNz28nmirrGLhtI8sYiJzdsKg9riTdTrLzgU2XsvwHuc9Z5pg5bfaW/TLFT G97xMzC1rhA96ZLS1oUc0wGGt5cbsgbVDITbm/vliZGVq+qUmyp9WgB3dRX/+7YGd2bP Uz9uBnMOwJInSxOyXuWUypSG0Ke5znG+jZfzdvYNbckZFepmO74pSGPlYG6jP2hF8rMS eR1in/vvVv5BUKnojlULUjEu4BIFrXflv1wF4xe79kH558AK9MP1EpAkv2EeEur+ErrL 60ZQ== X-Gm-Message-State: AOJu0YzpU5MCAOMQWBr9L0QB/VRZU8pLZ6udodtwcqJoDs4uSWjuxlIO dfysssOyCkw2k/rAzo/CR56Zxv2WOYd/M3NxRgSSKh5FIPZTa0SZR3XlHR6M/tiPhmgwlzeUBR9 5PT/S X-Gm-Gg: Acq92OHrfzQJOnmtvXJA9RKT1gIYklo+ekHidXZlZsCPAQ4nBFlaBKdRGhwhNptruv1 8IGOqNVkC70OI7xoHWLmMga2npdUGl6Dh0ajqJAhKEP/l3DWpcNjHFaETSD8hRjouflHQJ6HUuy 9htygRuThFMhdRKQh+pNKvRcfWTkbJOtgpg3a/Uv4eHWLnCuVuFstmoxL09QktYrKV7HN0ACzUC dAnI7pq8jwGXbrxu5cQk0lxXyu84CHcNBqjnq7iSDTP4UlGn8a/U6OFCcuFLGPE2zNv2gS53DMX x4XOY3uVx0l0YCB4VROc/yjt6DRwZ1xqUItug0GTC2M/la6etGKY/3iArDtcI3W746dDtI3bLsi CvkcueTlYnimtCzJPyffP2fw78Ohy7ym5tDP1/91RrNXOWj7IfM6mhS2HMpfVhcP7zdB5cbgCAL 9XahcTzVDLA01+ojNqA5grnvewuJIRSjFxUcbp+BrHqXKuFurpeEjjijVeBxjbF4Un6+EjLuw6L SMcdCHwKOUHTBfGWee6IObIZaBTSZ2y2tNBKSCFgHtqL/aTI2Cg X-Received: by 2002:a05:600c:4592:b0:490:6237:5212 with SMTP id 5b1f17b1804b1-4906237533fmr147168715e9.9.1779808680219; Tue, 26 May 2026 08:18:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Laurent Vivier , Helge Deller , Pierrick Bouvier Subject: [PATCH 1/2] linux-user: Move init_main_thread() prototype to user-internals.h Date: Tue, 26 May 2026 16:17:56 +0100 Message-ID: <20260526151757.2371476-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260526151757.2371476-1-peter.maydell@linaro.org> References: <20260526151757.2371476-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1779808735605158501 Content-Type: text/plain; charset="utf-8" The init_main_thread() prototype is needed only by code internal to linux-user/, so it doesn't need to be in qemu.h (which is also pulled in by various files outside linux-user/). Move the prototype to user-internals.h, and give it a documentation comment. Signed-off-by: Peter Maydell Reviewed-by: Helge Deller --- linux-user/qemu.h | 2 -- linux-user/user-internals.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 7f98fb2607..474489f046 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -371,6 +371,4 @@ void *lock_user_string(abi_ulong guest_addr); /* Clone cpu state */ CPUArchState *cpu_copy(CPUArchState *env); =20 -void init_main_thread(CPUState *cs, struct image_info *info); - #endif /* QEMU_H */ diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 21daf422b7..fbfd12237f 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -194,6 +194,21 @@ static inline void begin_parallel_context(CPUState *cs) } } =20 +/** + * init_main_thread: Set CPU state for main thread + * @cs: CPU context to set + * @info: information about the image being loaded + * + * This function must be provided by the per-target code. It should + * set the initial CPU state based on the information about the + * starting binary in @image_info. This will be at a minimum setting + * the initial guest program counter and stack pointer; it should + * also set up any other guest register values where the Linux ABI + * defines that they start set to some other value than what the + * guest CPU architecture gives you out of reset. + */ +void init_main_thread(CPUState *cs, struct image_info *info); + /* * Include target-specific struct and function definitions; * they may need access to the target-independent structures --=20 2.43.0 From nobody Sat May 30 17:44:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1779808759; cv=none; d=zohomail.com; s=zohoarc; b=hT6CGdPHBRUKFJtMu6oURdalAhkKnJrEyFK19SufTm7HgwoDreDnkW+MMDDkLu65gobqUSZrNXnkhVa0nCxbbZuCm7yslC2M5IXPp6KjHlQ6+6PkfL0R215pEySEI/LzKuL0YZORHpFyiPuuCET46YCVxELYxuZIyH2S6oxpTmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779808759; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C2TCsy+hHJVh+03YKTLTLgv29mF+MOATXr2TeMxBsFk=; b=i96kpcgpHZbWRXq7qANhpCJTVxcEMX+QDmxvixNvEWPScsLJ0wqqJtw5raPFm2Vf5C6/1OpJ7NBoNyJpnq4VjP6bUA4nA9aJ4BF8Yo1xhgvGmsL39pQIFo3OAhbOfOwSwJnFXqLEWFNUdZAxPYC2epwiGfH44oQAtbtBYv74INU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779808759728769.7469077906575; Tue, 26 May 2026 08:19:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wRtXi-0002K7-HX; Tue, 26 May 2026 11:18:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wRtXh-0002Jf-Az for qemu-devel@nongnu.org; Tue, 26 May 2026 11:18:05 -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 1wRtXf-0007V3-LQ for qemu-devel@nongnu.org; Tue, 26 May 2026 11:18:05 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-43d75312379so9073276f8f.1 for ; Tue, 26 May 2026 08:18:03 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49042ce923asm111485275e9.35.2026.05.26.08.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2026 08:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779808682; x=1780413482; 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=C2TCsy+hHJVh+03YKTLTLgv29mF+MOATXr2TeMxBsFk=; b=qROaeM6xSDY2Vbm01nbLYWiJFKG451Ts1CwWcxNqWmyIfPHa8fuYWZVob3jUWTM5XC BsyQMXmHD6x8NcHAmwCNewKUvNyBajjTXDj3+DTk81gtHTSy1BwJSTjVr7qm5QviaIJW RCLJQvju9SGCMuZsrZaMr3gmNiH7nVLm9nMVhFNRBS8wf4HBpKn1K6ByXsHMFpXsUaFI h0ouQazOdt5c6B8XN3QaTuxqBwaV+uin6EIsMAYgWoUwoy0GHoIW5HzR+7xiAplxw6Nj mX21TyhkoiaakQN75GZvnc2r0tbtdxrT4jc8g6WYG6ujuGQtAzywkMzhLdgllG6yaofH JwXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779808682; x=1780413482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C2TCsy+hHJVh+03YKTLTLgv29mF+MOATXr2TeMxBsFk=; b=m+2ZBV2gY/SN0LsSood+v2oagnX2bU9C5mUYaNWi2GPT3iXS6zb8eHxsT4ZMJUIWxW oNzclkjY3GOi98SPyn99fXDioLsJTeZRbHaUe/PR3HNM8WocDhh0YjY8u0bMnmleMwl1 WbwySCYv4JdUh5O5x2ShYkX+btEoW2bkKbb/CKf1NuGXmqlLSDpd3K1hGPzX9TVpHTC8 +WQZLhgdC15aXu6/0tBQVegGB21sWEHOIixKxR+mAGJdAasvEL9TGE+dz85Q2PN8XHx2 KxzJSfxs9Ufsk8qFrkPJAMt5IrCMcB4xetU3M4qmdz0vlxGwKQMsxHVKcBCrPwDGdjbU w00w== X-Gm-Message-State: AOJu0Yy9G0IAERfqCdJq0r524pv1Tl5XZ24FS0ubRubSMcdNZfZez9Xa K1ggxAY354YVwskah9XDCzCxv2bQDlg/0XbmLjOm3QHfK3HjBC4dVhusgQstwFtJ4S8mI1LDyMC WJuZp X-Gm-Gg: Acq92OHtIGb9qKwd7bRlk4THIgU7uw+EEJ4Ag68DSDHJuKZ8DGhBm2GBjGbOxo3Jf/p lGch/bFn6K4daPBWwTLGKcYTZAZAi/0MRPDETf9YFhJ1jaw57kXH4JDsVlaYIFkOr5X16hGRZTk qC/GeEObleQVfp1L9MBYFqncPr59WelF8QqNIDU+kYftUbtJHw4bZ2cxJcb7tLCMTFpTXomBm9W umGrzU/9917TQf4GnEoKsnvKK3YCK2B8gsK8Qu2qSWY/P4ysWRh4/eSEDV8bUQWn+zmfMWV5VcX FPtX8s9rzoLQUXXbmJD2lxA/b+Tf45bk9GvNQIJUZPU22qEza48nBiB4x7b+LiRGXmCMBEgXjp+ 9tGBph537EkhBiJ//lmEyAZvoFPR4SkIn//oCPdR9rwdHgwQ6DMMyMwVN/yU6Ln7x4OAQCc8i2M MniymWdD2/j1gMprRnkv2Hno1J4p2N03JIWKmuSK/R6Cu5Vl0JBWBIHe5jiLM4bkEm2DiVsv69E njL4zVYLzTESZLtufgpgERlWdvg2mE= X-Received: by 2002:a05:600c:2a8b:b0:489:1abb:5559 with SMTP id 5b1f17b1804b1-4904226d9camr169071215e9.5.1779808682135; Tue, 26 May 2026 08:18:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Laurent Vivier , Helge Deller , Pierrick Bouvier Subject: [PATCH 2/2] linux-user: Move cpu_copy() to user-internals.h Date: Tue, 26 May 2026 16:17:57 +0100 Message-ID: <20260526151757.2371476-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260526151757.2371476-1-peter.maydell@linaro.org> References: <20260526151757.2371476-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1779808762803154100 Content-Type: text/plain; charset="utf-8" We only use cpu_copy() inside linux-user, so we don't need to have the prototype in qemu.h available to code outside linux-user; move it to user-internals.h. Signed-off-by: Peter Maydell Reviewed-by: Helge Deller --- linux-user/qemu.h | 3 --- linux-user/user-internals.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 474489f046..07fe801628 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -368,7 +368,4 @@ void *lock_user_string(abi_ulong guest_addr); #define unlock_user_struct(host_ptr, guest_addr, copy) \ unlock_user(host_ptr, guest_addr, (copy) ? sizeof(*host_ptr) : 0) =20 -/* Clone cpu state */ -CPUArchState *cpu_copy(CPUArchState *env); - #endif /* QEMU_H */ diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index fbfd12237f..0380d44fe9 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -209,6 +209,9 @@ static inline void begin_parallel_context(CPUState *cs) */ void init_main_thread(CPUState *cs, struct image_info *info); =20 +/* Clone cpu state */ +CPUArchState *cpu_copy(CPUArchState *env); + /* * Include target-specific struct and function definitions; * they may need access to the target-independent structures --=20 2.43.0