From patchwork Wed Mar 10 15:59:58 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: 396754 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp502320jai; Wed, 10 Mar 2021 08:11:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1JCdrNj074j2HrHQiN2l2+NsSMyZT1pq4rXv82BRw1CecorzjwpeaflzMcVsdpbej49c8 X-Received: by 2002:ab0:3b91:: with SMTP id p17mr2176181uaw.132.1615392664583; Wed, 10 Mar 2021 08:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615392664; cv=none; d=google.com; s=arc-20160816; b=mdsEv+POhbNwf7GVUglD6sEE1anljy86bzpAU8IMkUlcTJjV969ih/6xsCcvudjjub 2UkkZa45eYuYRYWPGJtt/hs46r9WG5ydeKdovbWNCpwd4OnWvlIdrkYTXcc27oI9zyDA qdQfTYNlOCLlagmu4BNFotz48rVWXY0CbsYBl+kOeMxzQtJVbTva+5LSgmZdfkkkJLN6 FB1AbUDj2Xmsk49jFKz/OFsuBuTYePqO1QCEaxKH1cFTP8wHJmDy79AFUMP8RAqsy00/ ZJujJ0S9lfnttRLkrt9hafYjyZuyJfYjEVEnmnz3clJp3jgmKFh6K1aHd5pqnHGXNboX U/BQ== 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=QWLT5npZT/1XtAT2j85s6yvmSq9P5dA67bq/iWP9KuA=; b=PTRlgmekFMW+Y+NvwwIqJ71rtBSHXFZyiIfN8/EyGx8tl7F3tc3//42jabYTwFcNTS UZhkUaaYWDWqfmE4yRSD6Lw7htBqvva6iLwD8CT9lE9BZGoNSmN+7tJUQzHgj7nhhodB YKWm7g8ujgrqaCQeWzBR5NR7aSl8+c92YpCIwPSeTOFqRTsonqLhTyhhpcHNIh5zo9/p 3Gc+10pcx2BEMdQolQgzAyMkQxa4rvAG1ZjMb3Eb3RkXHwl3Qc4GgBIpdUJ8Uehclttn ti5cDBzQISb8RKwYvb/NGD4C4EMF9ctnCTvMBtmRZAt6g8mtRA9IRV6x7lZT1ZcezNbN 8wEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=f6kxNRqf; 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 t14si2970121vsn.78.2021.03.10.08.11.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Mar 2021 08:11:04 -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=f6kxNRqf; 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]:42910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK1QN-0004ly-Mo for patch@linaro.org; Wed, 10 Mar 2021 11:11:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK1G8-0004hZ-8x for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:00:30 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:45689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lK1G5-0002m6-0H for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:00:28 -0500 Received: by mail-ed1-x532.google.com with SMTP id dm26so28730185edb.12 for ; Wed, 10 Mar 2021 08:00:24 -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=QWLT5npZT/1XtAT2j85s6yvmSq9P5dA67bq/iWP9KuA=; b=f6kxNRqfAGRKwQyH1kGg0EeO5+pIE3oL7L+Mq3czoZm5sysIeiQxVtbhr1bN0EWvbh DiQHWB6SR+HJRdb0QwZ1EeR16yGH5N6Q2yAyvlNw1zLeKOEeCw/yglakzxSOibxWnqg8 /lIfhZhHS8aP0LmFUOFwirFvuDySTU4xpMrVDy7F7RDkr/t4qzYLXmL1KwK4YY1HHN7h rwtsoHVcuiE/qLOOPhcmjy6hqzbrruklvoxHB+oASco4CLop1QsZa1oPQuIJ6mBDMZOO IJgkPzUH5X7cpOsEjh7ofO+rIWqXb23iwex8CWtNa7Pl4Omb0y9ktiSfk91ssiTBoRdP u7Xg== 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=QWLT5npZT/1XtAT2j85s6yvmSq9P5dA67bq/iWP9KuA=; b=Py+OsD8Whsu/ciVXMfJk9FWV2prLvijVD5McF5oMIVkxtIMVb7GCPuUi4zCOrnyLmV nXfguEcpl1358GaW58Zj5fVXktpz0okSCCt3Ybsa4/W/ZD1uI5C/gFztxmYw2rXTqu+W fE63QOwbgpEHDFf1E/8raqfPIt9cE9xtmkjuQrqkVEyrGUESpbicJtuz5S8vzxkR7QYO Ms9ufIdJEPGRVctT8y4SzIAIHRunnJP/gCpM69T7TFVtKLV3DVPW8E0z7UKqoaBcuzJA pNZFVvqrBZnenSwGtizkgeLitDn/HCFX6oJdfBZAXidb4ibtL3o0EjTaeKE+L+FfIn9F +1iA== X-Gm-Message-State: AOAM530A5af14luJV5qU791RUsUSbzpYWDXxD5BApZR9kuN2yXCofGFp YKiSLpYJa5voO4Qu4G3JkrRi38G69OsDpg== X-Received: by 2002:a05:6402:512:: with SMTP id m18mr4049176edv.372.1615392018646; Wed, 10 Mar 2021 08:00:18 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l61sm11371890edl.37.2021.03.10.08.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 08:00:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A3C651FF9A; Wed, 10 Mar 2021 16:00:03 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 11/15] docs: move generic-loader documentation into the main manual Date: Wed, 10 Mar 2021 15:59:58 +0000 Message-Id: <20210310160002.11659-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310160002.11659-1-alex.bennee@linaro.org> References: <20210310160002.11659-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.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 38644691dc..a1170bad5a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2020,7 +2020,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