From nobody Mon Feb 9 08:42:17 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=1764084033; cv=none; d=zohomail.com; s=zohoarc; b=kxa2qcUTNXaxut2Yv6jTwo2rqymDsokPwF+/sSePTEZWhC4/VropnHY2rRnYk6lIZlC1OLiAP8N0+bh1lHwMoopycvZOEWU/v9j4Sv9Ji7FKrR8F/BZ7dcgnRPmXI3LE2GV+Oi6r6eHAcCWQenhvzejkbEPkrQvWPZXInMcEByY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764084033; 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=DWwkc7P1P2x5hJJOffakgpCfxVVLmumC32Dz9Go0Kvc=; b=kabs+WkXbwtAf076db7lUTZRMntDaEAFhMheH1A1bVww5qYnN3OiIk0tWOIk6t9FyPXo6gR+mGNSt2hSO1KnQBrbQXmbrAYvNxbSH8ldPIpXrWZDqINWhIhJZW2l3gwgPQWbzLlSR27lTOlOcAgfuqjVm2yyR1LZtCymSQiDVC8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764084033589913.7823399336681; Tue, 25 Nov 2025 07:20:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vNu5H-0006qn-Ou; Tue, 25 Nov 2025 09:31:59 -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 1vNu56-0006io-Hm for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:51 -0500 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 1vNu54-0004f2-Al for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:48 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-42b3c965ca9so3143713f8f.1 for ; Tue, 25 Nov 2025 06:31:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fb919bsm34485434f8f.34.2025.11.25.06.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 06:31:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764081105; x=1764685905; 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=DWwkc7P1P2x5hJJOffakgpCfxVVLmumC32Dz9Go0Kvc=; b=Nwy3W/ofhXfbBE+ZxxW6pntOdV9BUv3ZcwDIzdHNn+JCQBMrEWK9Ht/vgnCoWPlZEO SDWytvzmNDyU7y6PDCuOT/5FZy0USLEaqTfe9q0xVPQtUVipmtobRo3UApp3SK2LxbFD PGhl7kEGDrnmZAv02P3Cb8KoCoR0QgL10XfKZkzJm3GvhleWtfJosQvjrH/Vta9L7fzr 6OQdRimalVKdnXFEx4zUVbfUjIuTGgSQ5/6gXFFLQyKaGXicwmPyJLk0s+rtbLZOs7Sa VEcQt44/rjKrymVi6yY2xFnrGXaIbVALT2AsZhjID4Zeml0AdGC2CMFuvWD9yzW2e7Zo XIHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764081105; x=1764685905; 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=DWwkc7P1P2x5hJJOffakgpCfxVVLmumC32Dz9Go0Kvc=; b=dd0XAa2fwBcnA7v64Y5TD3CZHppniQDtotMXWSsDhX591c6MvAVYFc86P0tBzD5pNc Cy1hEd7LGcaFEOrrcHiv3/5R82fTtR3O1OQj3swVOWYU0QsxuRbKYcys5rAmPygERgiW skgLgTLrdpc9iH7YLdKZGeTCSdyUwNTDmUXQlZ8+YBuqZXkXlwwu+mM8/+jk005nDCQM jRWJNJy5QLOLitYiEI+5l7FRuekYV3bMQmXgce9Q0SIqj+XDEkZznx2umklMnRD3fitb knpAVO4Pmoljt6BlTABS3AoCkQ/pGOfXQLkVxpoBjziL50wfHZt2cBPXBVsx5cthW5j0 bi4A== X-Gm-Message-State: AOJu0YwIWh+qRuSPNX1ssDgsmZGe++R0/3WpJamvBMVzahius/hvIWhO LZZhGo64TvhXQMUy8c50yY1Pp78y3uP+WeiswHB9dRFYIQX5ti4vDG7jWzKwMf7FlIc7ckWqhvD a3ljq X-Gm-Gg: ASbGncsVrZXXD2WPL92x6UmK2mk8gqY2YaRzf/eSnOKpbqK+KyKalDPQ9hdDnwZFZfx LVYzbjUskFBU8a0Qa7l8IpBkyxa8dnqsYJBcKV+ufVcMpSeaJuf8yghAdZmS3ffCgr8R98xpPcS RdRi/EG4vPN4Kj2/mJWtm071W9YtiISVHmsmO8LV62y+o7gbj0TeorTd14Z2IfjcWDpxfVsYQOF gNe04FhsQI2O7dIJSxkPD8v4XGOJCc2LXBEMq38Qcz/RqzUCdjb7KwG1hY0DVtpGR9+Gmn+Caji bKyI90Lg33ZxydOywMbqhDYUcdWYwJtah/xkJH9+ch5WdG0jNzqDsLDQv74LUTFUMNuuJj1PRQr 58Dr8Sz8K3LP76XZuF1qt2K2CfAnrBhk0a91RfNYe1lRCTr6s6LSrJBXbO1bF1TbGABAM7UafEr BuB50x5G4RoEu7LYEn X-Google-Smtp-Source: AGHT+IFWQJttGqRDvjOAqcvmJlWMtA3gb0QNckwIaXDg+zrQ3b3ZcKareLkul4DMZUai1T4h2lqzvg== X-Received: by 2002:a05:6000:228a:b0:42b:3e20:f1b2 with SMTP id ffacd0b85a97d-42cc1cd9221mr17788880f8f.4.1764081104841; Tue, 25 Nov 2025 06:31:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Alistair Francis Subject: [PATCH 1/3] docs/system/generic-loader: Clarify behaviour of cpu-num Date: Tue, 25 Nov 2025 14:31:39 +0000 Message-ID: <20251125143141.216056-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251125143141.216056-1-peter.maydell@linaro.org> References: <20251125143141.216056-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764084037902019200 Content-Type: text/plain; charset="utf-8" The cpu-num suboption to the generic loader has two effects when it is used with -device loader,file=3D: * it specifies which CPU to load the data through * it specifies which CPU gets its PC set to the file's entry point Our documentation is not very clear about what happens if you don't pass this suboption. The default is that we pick the first CPU to load the data, but we don't set the PC for any CPU, so the "If not specified, the default is CPU 0" is confusing: it applies for loading but not for the PC setting. Clarify the text to make it clearer that the option has two effects and the default behaviour is different for the two effects. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- docs/system/generic-loader.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst index 4f9fb005f1d..3ac39cfbbe2 100644 --- a/docs/system/generic-loader.rst +++ b/docs/system/generic-loader.rst @@ -87,12 +87,17 @@ shown below: =20 ```` This specifies the CPU that should be used. This is an - optional argument and will cause the CPU's PC to be set to the - memory address where the raw file is loaded or the entry point - specified in the executable format header. This option should only - be used for the boot image. This will also cause the image to be - written to the specified CPU's address space. If not specified, the - default is CPU 0. + optional argument with two effects: + + * this CPU's address space is used to load the data + * this CPU's PC will be set to the address where the raw file is loaded + or the entry point specified in the executable format header + + If this option is not specified, then the data will be loaded via + the address space of the first CPU, and no CPU will have its PC set. + + Since it sets the starting PC, this option should only be used for the b= oot + image. =20 ```` Setting 'force-raw=3Don' forces the file to be treated as a raw image. --=20 2.43.0 From nobody Mon Feb 9 08:42:17 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=1764081184; cv=none; d=zohomail.com; s=zohoarc; b=gSN4VpvHtMvkDjcDwo5wfSEC2UOt5TzZc0Au+iku/BVzL7DHJefwGAIX+eCcVB/Sg8j5HGqm6vh/4SJQvUos0Hwy5juFlq+YLpbDOBLDxDJij6UzzBliMx1uUT1XWU9UMmQzeLLxADzLAOVWESLzFvTpbvslbqRrl20tz19ikak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764081184; 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=lzGaz+mT8MwL6xqiiVWVptUVAp4I0FWW6NwifF8v9es=; b=EsCv23B447uQtlwG4IFPQ4Kc/wp9odK7KwvU8K79qG98pw2RB13d4zosbd523tsTSsPKiOy0cLCGYVS3nbFLjZVgke/utym4wA/5Wcj9ps4drLzfGhPxfVmomDi84py+qBCYPz5tLWMSW024YjUMn3y8WouM1YoBPWoXUyisyDA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764081184360897.2664678761715; Tue, 25 Nov 2025 06:33:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vNu5G-0006oS-4H; Tue, 25 Nov 2025 09:31:58 -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 1vNu57-0006ix-8e for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:51 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vNu55-0004fB-JA for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:48 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-42b39d51dcfso3364909f8f.2 for ; Tue, 25 Nov 2025 06:31:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fb919bsm34485434f8f.34.2025.11.25.06.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 06:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764081106; x=1764685906; 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=lzGaz+mT8MwL6xqiiVWVptUVAp4I0FWW6NwifF8v9es=; b=XNA46vbfxlmpG6rOC0nMvoW92oEqqHwLQoPpL37tSqI7IdrwFybAUIagFQ+LPIuZjq IJrY2lm9YN27EoaX7omue64ujQoPUv9N8gANDEpMJf3CKJcCXlEdZbgiiOWqaOp8VA3I T3X6bmUBeKKmo1dPvuluACKvElpY+qvkhE0+k6MCJtIpZvV7z0dHqQuOE7JiMfHx0Z44 f3NoI8MWDxaNx/iYdWsH9TMtNTrsSiaH3jFtN3RH/T56aSSk3ydhzHhE/idKJ9hLX3IZ hfZ8wb2BePh+VtLTeHRadw+3zoSW3/7/OyDQI2dPtDMxXoNFfjTzdUAUjPQ1ASNZyk7g 9WXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764081106; x=1764685906; 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=lzGaz+mT8MwL6xqiiVWVptUVAp4I0FWW6NwifF8v9es=; b=l8AkXfFQk4MzRvVMVsRYGhfX5QzhmTaD1SbWS0+NyG3pPUqUNJpJiM2bQyaTZ1iZKw DTCriipOtH9XlShLWauTbzcHtOn57zU7OmcMaD8H1y1YSxwKPoNSFOT/nv98+4DAaamP SqTK6Pel20qbgt4KK1GcQcjDW/kR/IcdctA8KlsPHXMNVcCuSWcI74cVachxa9fvPPdZ o1XNvfAfduyAtL0nCYEmWVNFtk7rDMt/gc8WNP3zkjtnDoq5xt3k7e/P06zkTfPh6rNC x+iN2ZYtRfFfz2TI2WvuNxlVqqgnNSDFLnXOz92OTMhlIGV1+FUwY5kdoh2MMRMD9DlT hknA== X-Gm-Message-State: AOJu0YwhHhpQBcugMkkIaxYtnkoAhU+3CCw5xTx3DdfBqd5+EbFRntqy yTCWuRPmtvhtVhBvCNYxOgaKX6pXqgs6YnzRjHEVtr10VCatsofjMKE3MYM7EU9hMCwHTLlALhf GfIWn X-Gm-Gg: ASbGncsLxFbkJXet3bjJdamC+LxHIKhxHpID22fYuEtLoRxZHDPY2za54+Y+gEoY6VH QiVaAb5vNOuMtL58cz8LNKz1u2omW0LmYSLbAaTa0USgVv+X4Y5M2H8MMhhFRMNGH9ai/S9qMZy wycPDGaubzqFBVJtajKCEeT2RYWIedk/OgbJi6ZBuhE74sD2mvvx361Tm+Xa+tIL1OYJGGWPqp8 4i4bYzsRgae7eyf4S8eQtQ1mKuJXNUzWM5gi26XBGsWcnp8D2oCcFUAyBrtx86tiB1GRRs7nRI4 BQpgo2eifNlBHnKkiYzqvR+1wCVWllkb/Z3F7j20aa0uYjZ7t40r/xfhDNMhn+tQYyxPfDpTD19 OH9Kuf9cXCraFE8RQyLv+d0nm8LDiv2rJO9cNKDE5EioF6NXKzZN0rYRe0uUEFGjfuXU7luvNyv HiNg== X-Google-Smtp-Source: AGHT+IFJQ4l3D+PWQ1ipxYohx7BNVhYy888VbttWHpMd9NtNsie+COgIy00+sfvMChywHIxElQoQYw== X-Received: by 2002:a05:6000:2506:b0:42b:3e60:189d with SMTP id ffacd0b85a97d-42cc1cbe230mr17075912f8f.24.1764081105768; Tue, 25 Nov 2025 06:31:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Alistair Francis Subject: [PATCH 2/3] docs/system/generic-loader: Don't mention QemuOpts implementation detail Date: Tue, 25 Nov 2025 14:31:40 +0000 Message-ID: <20251125143141.216056-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251125143141.216056-1-peter.maydell@linaro.org> References: <20251125143141.216056-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764081186140019200 Content-Type: text/plain; charset="utf-8" We currently say "All values are parsed using the standard QemuOpts parsing". This doesn't tell the user anything useful because we don't mention QemuOpts anywhere else in the docs. What we're really trying to tell the user is what we mention afterwards: that the values are decimal, and you need an 0x prefix for hex. How we achieve it is an implementation detail the user doesn't need to know. Drop the explicit mention of QemuOpts; this in passing removes a typo "QemuOps" that we made in one place. Put the informative note more closely associated with the suboption which is the one that users might most reasonably assume to default to hex. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- docs/system/generic-loader.rst | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst index 3ac39cfbbe2..d5416711e93 100644 --- a/docs/system/generic-loader.rst +++ b/docs/system/generic-loader.rst @@ -21,6 +21,10 @@ can be done by following the syntax below:: ```` The address to store the data in. =20 + Note that as usual with QEMU numeric option values, the default is to + treat the argument as decimal. To specify a value in hex, prefix it + with '0x'. + ```` The value to be written to the address. The maximum size of the data is 8 bytes. @@ -37,10 +41,6 @@ can be done by following the syntax below:: The number of the CPU's address space where the data should be loaded. If not specified the address space of the first CPU is used. =20 -All values are parsed using the standard QemuOps parsing. This allows the = user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the nu= mber -with a '0x'. =20 An example of loading value 0x8000000e to address 0xfd1a0104 is:: =20 @@ -57,14 +57,13 @@ can be done by following the syntax below:: ```` The value to use as the CPU's PC. =20 + Note that as usual with QEMU numeric option values, the default is to + treat the argument as decimal. To specify a value in hex, prefix it + with '0x'. + ```` The number of the CPU whose PC should be set to the specified value. =20 -All values are parsed using the standard QemuOpts parsing. This allows the= user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the nu= mber -with a '0x'. - An example of setting CPU 0's PC to 0x8000 is:: =20 -device loader,addr=3D0x8000,cpu-num=3D0 @@ -85,6 +84,10 @@ shown below: The memory address where the file should be loaded. This is required for raw images and ignored for non-raw files. =20 + Note that as usual with QEMU numeric option values, the default is to + treat the argument as decimal. To specify a value in hex, prefix it + with '0x'. + ```` This specifies the CPU that should be used. This is an optional argument with two effects: @@ -104,10 +107,6 @@ shown below: This can be used to load supported executable formats as if they were raw. =20 -All values are parsed using the standard QemuOpts parsing. This allows the= user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the nu= mber -with a '0x'. =20 An example of loading an ELF file which CPU0 will boot is shown below:: =20 --=20 2.43.0 From nobody Mon Feb 9 08:42:17 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=1764081151; cv=none; d=zohomail.com; s=zohoarc; b=FtQoSrcBg7uYj4akoDj4xEOI8285uCkJDTvwabuy60tbEEBz7t2nE0HKjMHi9rzmmrnN2MZm3phS/VG79nUojq1gct1Xc1E2c8yyct/8RP3tyrELzN7w2mbrOsPjk0Zkl4jyQKIZy/F6u+gJQAOGs1rdQLgYERIQMN63TnWsObs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764081151; 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=OzOPFznIgpbTG4xZi/XjCVhfc7BxnDRa1QWSADv6GTo=; b=YJCGi9jUdZEYFKK5kRVpWMrPOn/Di1ZcWJEYKOg3qLio3gZeObIspZr+RJ+IAriMxhfSAlH5gwzCvezvNSPBvLIdi9rSK39KrRRhZpWWImdIgrfIjeF51eQOeGQbiahxFGrCqr3COEhLP9bp6b6IpbwhCueA/rknJYH3NgURnzc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176408115104576.52634833997536; Tue, 25 Nov 2025 06:32:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vNu5H-0006qe-P9; Tue, 25 Nov 2025 09:31:59 -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 1vNu57-0006iy-O0 for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:51 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vNu56-0004fK-4N for qemu-devel@nongnu.org; Tue, 25 Nov 2025 09:31:49 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-42b3c5defb2so3687832f8f.2 for ; Tue, 25 Nov 2025 06:31:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fb919bsm34485434f8f.34.2025.11.25.06.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 06:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764081107; x=1764685907; 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=OzOPFznIgpbTG4xZi/XjCVhfc7BxnDRa1QWSADv6GTo=; b=Oeo0zjleF/qyiSmryIdbWnTIpDB47W4uMI/ZQF3yTkdfAeTpEYSMlcl5dBJMr7gV3D /iixofViboWNZJ/8jkFd6n1Nic5DzQv56mH7Vg4ix5lBjb/CpjG6qcMI95Ygb2i41vPz SSrwQQY/E5+dtBscuHDHn2YbXtBktXAMmw2z7olDGbm+Iw/wuLV9Z5GDYo9egbwS8kGt RO/UoIaWwAcB3SIVHuuNW/gt7288ZODElRUKsbjb6zlLxWdrxOQW0uXW6SDdE1Guy+Zt PM4BNlcvk+2SniDXA2SdVzi8joF5w3g47LMaz0ZiwLUoJaBNkzLsAyjEVFQBAfBxN7WN LjBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764081107; x=1764685907; 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=OzOPFznIgpbTG4xZi/XjCVhfc7BxnDRa1QWSADv6GTo=; b=QShT4zmuyhmqbBZSmEa4SQ1XuC/I0xx0rfBUdSd+cR6sVZa6R+1JgV4tHQAjQZrcax 9H6PgPvBuoiKdHqLrN48cq/X0zNOtp2puk6SdSPdyF7PYYNKgf35/SJvV1bh8Rfo65AS aveCGyPj9hTFRnXyiJrCLAS61SqtK4TApKXc214S4Ip+p6ODoCfOL8K+FjXKALWc8REl RqJndSziEC+LAn6SbUcYqkOpMHgu7cxOSxcFDL4QnfxM6xDPN2DSy6VIe5tq0smJC+pS hOl4a9x2BpUeTIG7LAsIN2BmPqEyG+wDZjAKYWK0Z93Dma8adn1OwR82GpUG+faleMDX 0UhA== X-Gm-Message-State: AOJu0Ywhmm0wPUPJnyW0XMfStCOfz5GYcx/lj8BwZLG3CvjzRdQM/lTb DrBYzdki9kaoIf/umekj+AxVZUg5MowOqWlwTMtDLbNq7bbX4n/UvdsmjVncEBqXSPnvdXJlKQ/ sAjCU X-Gm-Gg: ASbGncsHqT1PAlcGNcPhKAVoFjMGmgbMEC3k+QXrHQi1cOq41onkLwi0EqUo2oLrC5k n4uftI8XbcB2Yx6Dys79DUG2g9r9OdHcSvF9iZw3sI4x1x+O8dZsvK7yJ0cOmHTPli1iKXAEXAC NgId7DTvCeMOICqE9pdJXJDc9rhoNTjgf0pdI0SaPQ/kmwMxqKI7LLUf6k5US2iEUR88u3/AqBQ b9QAnd9bl3r0c+ENgIpTr0bXw1gQnkUm4nzF+JtCeHrqC8lUvDEQbP3GNDymhDdtyLxLvy+dcRz 9yB+y3IG/H7RY0pIjJ969AlOqBX28sEZRa7WsdiKY1og3MrYIfwC/c6ARzrEOv60q3gBX67xc9K jIal3NgXPC2wKYpJ0mtw2IhR3ceQCVqgaeol7nyLISexWrkvX4H04ZNj3tQt56ka47R32U6eMRx lHNFqtBXmwvC3Z X-Google-Smtp-Source: AGHT+IFOP/L/oyvSCRSDQejLlx4K6ylIaC8MzzUeFYRFKJEyIH/6YQN96ChdVoVAI0mo2lGdXu0MpQ== X-Received: by 2002:a05:6000:228a:b0:42b:3e60:18ba with SMTP id ffacd0b85a97d-42cc1ac9ca3mr16735919f8f.8.1764081106642; Tue, 25 Nov 2025 06:31:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Alistair Francis Subject: [PATCH 3/3] docs/system/generic-loader: move TODO to source code Date: Tue, 25 Nov 2025 14:31:41 +0000 Message-ID: <20251125143141.216056-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251125143141.216056-1-peter.maydell@linaro.org> References: <20251125143141.216056-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764081151977019200 Content-Type: text/plain; charset="utf-8" Currently we have a "Restrictions and ToDos" section at the bottom of the document which notes that there's no way to specify a CPU to load a file through that doesn't also set that CPU's PC. This is written as a developer-facing note. Move this to a TODO comment in the source code, and provide a shorter user-facing statement of the current restriction under the specific sub-option that it applies to. Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e --- docs/system/generic-loader.rst | 14 +++----------- hw/core/generic-loader.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst index d5416711e93..0df9b66976a 100644 --- a/docs/system/generic-loader.rst +++ b/docs/system/generic-loader.rst @@ -99,6 +99,9 @@ shown below: If this option is not specified, then the data will be loaded via the address space of the first CPU, and no CPU will have its PC set. =20 + Note that there is currently no way to specify the address space to + load the data without also causing that CPU's PC to be set. + Since it sets the starting PC, this option should only be used for the b= oot image. =20 @@ -111,14 +114,3 @@ shown below: An example of loading an ELF file which CPU0 will boot is shown below:: =20 -device loader,file=3D./images/boot.elf,cpu-num=3D0 - -Restrictions and ToDos -^^^^^^^^^^^^^^^^^^^^^^ - -At the moment it is just assumed that if you specify a cpu-num then -you want to set the PC as well. This might not always be the case. In -future the internal state 'set_pc' (which exists in the generic loader -now) should be exposed to the user so that they can choose if the PC -is set or not. - - diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index 433efb73872..508c090872a 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -30,6 +30,24 @@ * separate backend. */ =20 +/* + * TODO: currently the "load a file" functionality provides no way + * for the user to specify which CPU address space to load the data + * into without also causing that CPU's PC to be set to the start + * address of the file. + * + * We could fix this by having a new suboption set-pc (default: true) + * so the user can say + * -device loader,file=3D,cpu-num=3D + * for the current "use this address space and set the PC" behaviour + * or + * -device loader,file=3D,cpu-num=3D,set-pc=3Doff + * to just pick the address space and not set the PC. + * + * Using set-pc without file=3D should be handled as an error; otherwise + * it can feed through to what we set s->set_pc to. + */ + #include "qemu/osdep.h" #include "system/dma.h" #include "system/reset.h" --=20 2.43.0