From patchwork Mon Mar 8 13:51:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 395436 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1863670ejz; Mon, 8 Mar 2021 06:28:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8oMUWF8G0IPTl3LSUYe/G+qp8mM1KBvjXHpxLCwYSVUkM05jpXCGl4YBjZrZCX4tLGlQ5 X-Received: by 2002:aca:3007:: with SMTP id w7mr8115928oiw.154.1615213734584; Mon, 08 Mar 2021 06:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213734; cv=none; d=google.com; s=arc-20160816; b=SwWIVJD43glT6LKcEvnoVFWLFrxbG00xLM9qU7hKTm6nudy1cFCNWEc+qn6qsg/ZS5 fN4EmCmXK1IcWuB5UOwVfe6OJZrLRQEiQd1G2k/rzVKK8vhOZL+fTXB1B3xV8CM4A6Zv XvPTLyyUwSKH6UKLPPvMchZvpIQ3D04Aj0cyYTz9B624U/qJh4A0IShDgu7mGe92wG9g pnDJ7bM9aBwyvZFytG1bQRvPp77Np0/76ebrFb+Q/mhVbi86MWEnb7j14dcLILVPdXf3 t5XVyqnILP+D23EWjwame5FHcT228OkDnD6tfGhI84tZl9I0bVtlCF0KDxntpQbpCT9E Njqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=V68ytxbgmqYFZZPfjTqpoCec0EKffKJjoQ6qIdSpZexXCciFkYATaBKez+TvLdoJUB XThl9N9oRkgoDnzQwWovYbSuKYxviaIqCdnG+/Dv0sEAmRId2VUAbiW2rfWTHp/D+OI7 eETx8Z4CgcUWjGpa9VfGk6CsREM27QKe1wD/thWSy7OqfDcoSXrsA5wjuUsYdvUpegEf IJnFXK6nZq6IsWGmyYlVuNFvlgmft7LkExKGxpj2JJQPcwY/NswscKpi6AiRQkRSF849 76Tj0tbsCOkoIwHsctWUk9ETsAoeWKL9iyy7X3e68u0f7X6AvG+b1WA05qzhyc9srj0r 2P8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xxV1L6f+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n9si10021318oib.233.2021.03.08.06.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:28:54 -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=fail header.i=@linaro.org header.s=google header.b=xxV1L6f+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGsP-0007d0-Nc for patch@linaro.org; Mon, 08 Mar 2021 09:28:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGIC-0006dc-09 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:28 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:45244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI7-0001GO-20 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:27 -0500 Received: by mail-wr1-x435.google.com with SMTP id e10so11493570wro.12 for ; Mon, 08 Mar 2021 05:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=xxV1L6f+Lv5a9baKHjvRRjoxFbkvWdJ6X/5/uFwUSVU+mEJCEbAg/fonTfH0vtfowZ a9TU6aRzgOTB9SoODZpWFv3V79ButsPcZXyF12tpVYthOcHWzjXo8PW0kYjItJgywB2o 7ruldkd8gU5Ex+YgtCOsWPsxZXnA85vEdcHgOxb8G+9MoP2fkCVod1XSstrtmptbQXwB E+DJueGlps0mqDUMrqrdaaeYA+oi7TZNx7wOcEnGBl3dzE6bO6uN2TILxR7dVzGZ2iZ3 5z5xlruA0bXq23fjdmOcrJr+QrICpbRYn+SMSBN3lBG9HahRnsAzbTiiqcj4uidLcGV3 xJzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=DOjnB0bIWyfnVUV/yCeSp5cQUPFyY+bbESZc3yvlQVgqC9M1xRDIUrnxM/KxlvG752 QWgzejIX+53JvnLdLoFqNnZq/2ZCrnL7idECt88OQpvdJ8w/9A+5qO/zx6pD+yOQTJX3 HqwYuAPSgkUmAxMZhMD69i/0v8584uRI3zA9v8i3osAPyZX8XXhw5lgnldmLcIixTzV8 lVcmxknYSn2LFDzKahAJctto10bjK9ii3kWI5B1KePowimkCyHGF3SMYjsVQYx9KbjXE ZtJbvPWHkjX5qLitvLvnSomASM+ivCypeFlRV61B9gj4pBBSXvdVjiG8NaGbuImgcwSg kP7A== X-Gm-Message-State: AOAM533tT+UaTkRUaQXHPHDL3+3jNgSBEhzwWJEhw+75mw3bb65FPA6P EQw0c/Gilg3xKojKDouCfhQeew== X-Received: by 2002:adf:ec83:: with SMTP id z3mr22730679wrn.59.1615211481357; Mon, 08 Mar 2021 05:51:21 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s9sm4589633wmh.31.2021.03.08.05.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 339591FF9D; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/18] docs: move generic-loader documentation into the main manual Date: Mon, 8 Mar 2021 13:51:00 +0000 Message-Id: <20210308135104.24903-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We might as well surface this useful information in the manual so users can find it easily. It is a fairly simple conversion to rst with the only textual fixes being QemuOps to QemuOpts. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20210303173642.3805-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/generic-loader.txt b/docs/generic-loader.txt deleted file mode 100644 index a9603a2af7..0000000000 --- a/docs/generic-loader.txt +++ /dev/null @@ -1,92 +0,0 @@ -Copyright (c) 2016 Xilinx Inc. - -This work is licensed under the terms of the GNU GPL, version 2 or later. See -the COPYING file in the top-level directory. - - -The 'loader' device allows the user to load multiple images or values into -QEMU at startup. - -Loading Data into Memory Values -------------------------------- -The loader device allows memory values to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,data=,data-len= - [,data-be=][,cpu-num=] - - - The address to store the data in. - - The value to be written to the address. The maximum size of - the data is 8 bytes. - - The length of the data in bytes. This argument must be - included if the data argument is. - - Set to true if the data to be stored on the guest should be - written as big endian data. The default is to write little - endian data. - - 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. - -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 number -with a '0x'. - -An example of loading value 0x8000000e to address 0xfd1a0104 is: - -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 - -Setting a CPU's Program Counter -------------------------------- -The loader device allows the CPU's PC to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,cpu-num= - - - The value to use as the CPU's PC. - - The number of the CPU whose PC should be set to the - specified value. - -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 number -with a '0x'. - -An example of setting CPU 0's PC to 0x8000 is: - -device loader,addr=0x8000,cpu-num=0 - -Loading Files -------------- -The loader device also allows files to be loaded into memory. It can load ELF, -U-Boot, and Intel HEX executable formats as well as raw images. The syntax is -shown below: - - -device loader,file=[,addr=][,cpu-num=][,force-raw=] - - - A file to be loaded into memory - - The memory address where the file should be loaded. This is - required for raw images and ignored for non-raw files. - - 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. - - Setting force-raw=on forces the file to be treated as a raw - image. This can be used to load supported executable formats - as if they were raw. - -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 number -with a '0x'. - -An example of loading an ELF file which CPU0 will boot is shown below: - -device loader,file=./images/boot.elf,cpu-num=0 - -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/docs/system/generic-loader.rst b/docs/system/generic-loader.rst new file mode 100644 index 0000000000..6bf8a4eb48 --- /dev/null +++ b/docs/system/generic-loader.rst @@ -0,0 +1,117 @@ +.. + Copyright (c) 2016, Xilinx Inc. + +This work is licensed under the terms of the GNU GPL, version 2 or later. See +the COPYING file in the top-level directory. + +Generic Loader +-------------- + +The 'loader' device allows the user to load multiple images or values into +QEMU at startup. + +Loading Data into Memory Values +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The loader device allows memory values to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,data=,data-len= \ + [,data-be=][,cpu-num=] + +```` + The address to store the data in. + +```` + The value to be written to the address. The maximum size of the data + is 8 bytes. + +```` + The length of the data in bytes. This argument must be included if + the data argument is. + +```` + Set to true if the data to be stored on the guest should be written + as big endian data. The default is to write little endian data. + +```` + 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. + +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 number +with a '0x'. + +An example of loading value 0x8000000e to address 0xfd1a0104 is:: + + -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 + +Setting a CPU's Program Counter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The loader device allows the CPU's PC to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,cpu-num= + +```` + The value to use as the CPU's PC. + +```` + The number of the CPU whose PC should be set to the specified value. + +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 number +with a '0x'. + +An example of setting CPU 0's PC to 0x8000 is:: + + -device loader,addr=0x8000,cpu-num=0 + +Loading Files +^^^^^^^^^^^^^ + +The loader device also allows files to be loaded into memory. It can load ELF, +U-Boot, and Intel HEX executable formats as well as raw images. The syntax is +shown below: + + -device loader,file=[,addr=][,cpu-num=][,force-raw=] + +```` + A file to be loaded into memory + +```` + The memory address where the file should be loaded. This is required + for raw images and ignored for non-raw files. + +```` + 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. - Setting force-raw=on forces the file + to be treated as a raw image. This can be used to load supported + executable formats as if they were raw. + +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 number +with a '0x'. + +An example of loading an ELF file which CPU0 will boot is shown below:: + + -device loader,file=./images/boot.elf,cpu-num=0 + +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/docs/system/index.rst b/docs/system/index.rst index 625b494372..cee1c83540 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -25,6 +25,7 @@ Contents: usb ivshmem linuxboot + generic-loader vnc-security tls gdb diff --git a/MAINTAINERS b/MAINTAINERS index 0134cad491..7a37599427 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2016,7 +2016,7 @@ M: Alistair Francis S: Maintained F: hw/core/generic-loader.c F: include/hw/core/generic-loader.h -F: docs/generic-loader.txt +F: docs/system/generic-loader.rst Guest Loader M: Alex Bennée