From patchwork Mon Mar 8 13:51:01 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: 395429 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1845800ejz; Mon, 8 Mar 2021 06:07:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiwYqBnnwdxRDmz7dNsFpFY29Cc0qx6/HaQFo8SIOfhNX1hut6+d/+vmQI7Ygp2li0twPd X-Received: by 2002:a6b:4f09:: with SMTP id d9mr5942892iob.60.1615212436485; Mon, 08 Mar 2021 06:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212436; cv=none; d=google.com; s=arc-20160816; b=Kws+2V/GrLOtT2dasBT0yVYAwwagUzoNv3MjOHCW2yiQ3xFGaLQ6g6WOWoaWqh1Jd8 aH/CZBBcR02W7IZS1iVka3iO8V04r/4bIQr76lNHLWtWZwJx7AMLkt3qtq7JuiZAs9iN jMkAFGtZqmZm78DjjVGO+JLS0E2qpkUG0GqhCelokFUQQlL95bR/SExnrCgwkVt2sT5j 1DSrK/Zj4zckWJHc1yPRUsB3qFkwTkTiccloKwqGxGxJ0BAbQsLt/I/7NPmamn8XTmxJ iTchQQfuOkbDT/b0a9Spv3DQ2eFnDEkongELqlOL4L4eOeubGH2FmXGnmUWx/6mwHJ2Z JQxQ== 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=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=BFpfdIouIUP72Oj5FjQO/wu5NmbntZ+aXWf5u52LtJfHgTKttCYZG72fPb576dJ0Q/ OV2/xMh6G4UZuQaVuVqO9fYeEPMtNhO2hYoymVKxZyemgcy/iD6CzL63LIbPl+780C2+ S9sUkZ4+uUNKszFc6LNf7dPTG+LqFirS6qgG6ZdL+qHqSjW3/xwzcSFzaHXqgcz9GEwY NHGw9ogXBdjeey6DHbIF43RAbHbwYSsJc8bf8apArF5kXMBCd6vBQOXwrlzEtx1lO3dT 35YUlCHDc9oTUC8UVvPAx4/r7us6CRUhE/mPU86eBqlC2m7P/N5ODHq6+AXv3kYQ2aEi KuPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eGtMdgxh; 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 h13si11570407iow.73.2021.03.08.06.07.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:07:16 -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=eGtMdgxh; 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]:57460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGXT-0001M8-Gh for patch@linaro.org; Mon, 08 Mar 2021 09:07:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO5-0007JT-Re for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO3-0003vb-VJ for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: by mail-wr1-x42f.google.com with SMTP id u14so11573173wri.3 for ; Mon, 08 Mar 2021 05:57:31 -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=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=eGtMdgxhkh/REo354iMrO/HadqCk26xEkTQGhn10jgukuD5v6/rBS71VTlIiakcdLA Ta9dCU64K+ygKrjAzLxHkB4gPYQA4fnzYoP30VLc6kx7VLZnY7LQG4rHXM0E1H+zIrld mb8JfoBX1fvZeZUeycjkPON68Fe//MDCKB6jV+/DoPUdPgAiIPJxfykBRJZTvE8YdxuN kN2zJM5JON2nqPQKVOOm8vW30G+4GxoloC422ZKg1fAohyCSbuIbSDlM06mToDk/9YrT xT972naNqdmEbKwUj+6eNK2ytT0nxNx9F7/fkdfiRQqaAvwhKmJ47XZq6DWSkTKhqTjM QKhg== 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=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=EVYv0lFQDH/aNxew/Xv/8/SnvkR6dmxJ51uIV7uSwI0bZ4nZQXx//sfO4j7AVJwdFJ bVjJLCa6mBaSEFL+mHpQZ1/DdEaAAiczg1ePqk385MY5FBwuuO23qLlKCEoH4zqO5EfK GUTgV+oreGdFi0zqGLTeji4uyBzOPPMBqkHw/om4sZ90M0wa5m/usfYKt/46b0+CPtq4 41b57SIO2sjADxLxXSQ2RBWDWbpNAffo6q7iEgsCNXVCj81xc1cgh/h/XejC5UtDU0SV 7Zd3UYhLgN8TgruItH70U4sFWrGpYL77WIOAo48lswfbfSPepIGDtpuMmfW7nThZMdOb mA0g== X-Gm-Message-State: AOAM531bsfA3jdrfI8CzgRYx9d9bkGKx8IYBY1NbnbFWN3RiuF6HfOTK nXUsnIRnd7JqqX0l5mJp8Gb/duyYla9cnQ== X-Received: by 2002:a5d:4b06:: with SMTP id v6mr12797505wrq.41.1615211850396; Mon, 08 Mar 2021 05:57:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i26sm21238747wmb.18.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4CA101FF9E; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 15/18] docs: add some documentation for the guest-loader Date: Mon, 8 Mar 2021 13:51:01 +0000 Message-Id: <20210308135104.24903-16-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::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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 , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20210303173642.3805-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/system/guest-loader.rst b/docs/system/guest-loader.rst new file mode 100644 index 0000000000..37d03cbd89 --- /dev/null +++ b/docs/system/guest-loader.rst @@ -0,0 +1,54 @@ +.. + Copyright (c) 2020, Linaro + +Guest Loader +------------ + +The guest loader is similar to the `generic-loader` although it is +aimed at a particular use case of loading hypervisor guests. This is +useful for debugging hypervisors without having to jump through the +hoops of firmware and boot-loaders. + +The guest loader does two things: + + - load blobs (kernels and initial ram disks) into memory + - sets platform FDT data so hypervisors can find and boot them + +This is what is typically done by a boot-loader like grub using it's +multi-boot capability. A typical example would look like: + +.. parsed-literal:: + + |qemu_system| -kernel ~/xen.git/xen/xen \ + -append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \ + -device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \ + -device guest-loader,addr=0x47000000,initrd=rootfs.cpio + +In the above example the Xen hypervisor is loaded by the -kernel +parameter and passed it's boot arguments via -append. The Dom0 guest +is loaded into the areas of memory. Each blob will get +`/chosen/module@` entry in the FDT to indicate it's location and +size. Additional information can be passed with by using additional +arguments. + +Currently the only supported machines which use FDT data to boot are +the ARM and RiscV `virt` machines. + +Arguments +^^^^^^^^^ + +The full syntax of the guest-loader is:: + + -device guest-loader,addr=[,kernel=,[bootargs=]][,initrd=] + +``addr=`` + This is mandatory and indicates the start address of the blob. + +``kernel|initrd=`` + Indicates the filename of the kernel or initrd blob. Both blobs will + have the "multiboot,module" compatibility string as well as + "multiboot,kernel" or "multiboot,ramdisk" as appropriate. + +``bootargs=`` + This is an optional field for kernel blobs which will pass command + like via the `/chosen/module@/bootargs` node. diff --git a/docs/system/index.rst b/docs/system/index.rst index cee1c83540..6ad9c93806 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -26,6 +26,7 @@ Contents: ivshmem linuxboot generic-loader + guest-loader vnc-security tls gdb diff --git a/MAINTAINERS b/MAINTAINERS index 7a37599427..6bebd5279b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2022,6 +2022,7 @@ Guest Loader M: Alex Bennée S: Maintained F: hw/core/guest-loader.c +F: docs/system/guest-loader.rst Intel Hexadecimal Object File Loader M: Su Hang