From nobody Tue May 21 13:28:41 2024 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=1655909614; cv=none; d=zohomail.com; s=zohoarc; b=Pf/pA/ob7cUiP10iGkFt7nCNUNFlOHqpiFxabD7wOl9s+dyUSgUygOHxfrcBpKmPLTJNl8uAI2N0tvKDZHqcf0qrF6x4/5P/Favb5oszm8kZmnX1nEG8yQehMzzTUNVf4wTv7XNQNeAOVVoV1mangoJj9xUps6tDNeJ5N2Zajsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655909614; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=AMocS6L1qwHpmbFESWio4zzDBe8eQUr43gocqOuiXc8=; b=Bnb4bP4w4w0XRi1oYEK0oeR0d0LhRY7UFBNUiPx4kXnsPuDfFITLPUlD184kKUGD/g4chE1s/zJ552mWSsqOY9eMN8TK/FtjSgVCCeosYp4g5bkmAf8Byrh+6hzpu9ukytlJxbF2+62CCHWGcXNsyOP2fBcxTSiEajhUi6/oePg= 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 1655909614490781.3144619477782; Wed, 22 Jun 2022 07:53:34 -0700 (PDT) Received: from localhost ([::1]:37982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o41jZ-0000Nv-4l for importer@patchew.org; Wed, 22 Jun 2022 10:53:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o41hj-0006yH-83 for qemu-devel@nongnu.org; Wed, 22 Jun 2022 10:51:39 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o41hh-0001Ez-CO for qemu-devel@nongnu.org; Wed, 22 Jun 2022 10:51:38 -0400 Received: by mail-wr1-x436.google.com with SMTP id o8so23796425wro.3 for ; Wed, 22 Jun 2022 07:51:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f6-20020a1c6a06000000b003a0231af43csm3151064wmc.48.2022.06.22.07.51.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 07:51:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BD1421FFB7; Wed, 22 Jun 2022 15:51:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AMocS6L1qwHpmbFESWio4zzDBe8eQUr43gocqOuiXc8=; b=zHjnIGebfGPXlJz8q551msoxX/3inlRyYvFi+HF0s11jW6zURzvtX9jDbpXxnH+t0K hZyD4gIfjgwrW6qxSA35b6Z8vqjjuc3VU97tmAy4xBoxdY8txos+UqK/YjazEV7Jv3pA GEYCugLp817IbeMqs7iidfNDIgnpClJaLqQWtwzmTj0av25DKO1pD23V1Hmt9X1GMvqA lEo+VhO++6K/CYF+LX+I6bwzzx6ighDR7QeiCU6UShLnZ9AJgnZxEQJIUQih5JjAEGZ9 PU4mEcREaPFoHYgMmlKhifw/xA8G2oBlpziqAXe+luEhRhVfLtBVqq+tjxwGcxPbYV/T FIbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AMocS6L1qwHpmbFESWio4zzDBe8eQUr43gocqOuiXc8=; b=vtHslXkBO+UggjYVzRDUzHGEsCg71/TgVb8s2YluvMgMymiTGYD806NP/SUe50yT9i 92A/zBTiinaiH7yvf4IyDRtWoYUY71X4AupkXiFrHPEUJCo+dKpfbP/FjKiP02gQQf7R +K2hKPG2Kbwrry4vEAacoXFJPGZmpK4YDom/+mTESMi4vs+fPTG4dkaV2WsdiNes2Wv4 3se4YCxR+sx2Vu1HHnn4Bag8ZKCmu7Hegd9wiJZUJeqbJ44ejvXUrX6kJlpnKKkCrms3 Hh+0UsFALxU8cNuErADZb3ORFtmQc/u0bYgGsBItm2TSWULFLONHKsujJCPXwGDrNnIY U0cQ== X-Gm-Message-State: AJIora/tKkan1M1ZdCJFlMrkYa7hDQ4TuQl8CJlhV1p4JD4YntYfx8Si pc6cUkgh7EHGzgyQePgUXgPgRg== X-Google-Smtp-Source: AGRyM1uLMuchfeGz0uL0pygPBhUnOtRcqCYsV9ogIKPbWCK1jnDaCKi99HVN6oc2gr3zvzchVNQi1w== X-Received: by 2002:a5d:64ab:0:b0:219:ab70:c4ea with SMTP id m11-20020a5d64ab000000b00219ab70c4eamr3593378wrp.479.1655909495528; Wed, 22 Jun 2022 07:51:35 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [RFC PATCH] qemu-options: bring the kernel and image options together Date: Wed, 22 Jun 2022 15:50:52 +0100 Message-Id: <20220622145052.4012981-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1655909615079100001 How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate. Signed-off-by: Alex Benn=C3=A9e Cc: C=C3=A9dric Le Goater --- qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 18 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 377d22fbd8..9b0242f0ef 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1585,13 +1585,6 @@ SRST Use file as SecureDigital card image. ERST =20 -DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, - "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_AL= L) -SRST -``-pflash file`` - Use file as a parallel flash image. -ERST - DEF("snapshot", 0, QEMU_OPTION_snapshot, "-snapshot write to temporary files instead of disk image files\= n", QEMU_ARCH_ALL) @@ -3680,12 +3673,51 @@ DEFHEADING() =20 #endif =20 -DEFHEADING(Linux/Multiboot boot specific:) +DEFHEADING(Boot Image or Kernel specific:) +SRST +There are broadly 4 ways you can boot a system with QEMU. + + - specify a firmware and let it control finding a kernel + - specify a firmware and pass a hint to the kernel to boot + - direct kernel image boot + - manually load files into the guests address space + +The last method is useful for quickly testing kernels but as there is +no firmware to pass configuration information to the kernel it must +either be built for the exact configuration or be handed a DTB blob +which tells the kernel what drivers it needs. + +ERST + +SRST + +For x86 machines ``-bios`` will generally do the right thing with +whatever it is given. For non-x86 machines the more strict ``-pflash`` +option needs an image that is sized for the flash device for the given +machine type. + +ERST + +DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ + "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) +SRST +``-bios file`` + Set the filename for the BIOS. +ERST + +DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, + "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_AL= L) +SRST +``-pflash file`` + Use file as a parallel flash image. +ERST + SRST -When using these options, you can use a given Linux or Multiboot kernel -without installing it in the disk image. It can be useful for easier -testing of various kernels. =20 +The kernel options were designed to work with Linux kernels although +other things (like hypervisors) can be packaged up as a kernel +executable image. The exact format of a executable image is usually +architecture specific. =20 ERST =20 @@ -3725,6 +3757,25 @@ SRST kernel on boot. ERST =20 +SRST + +Finally you can also manually load images directly into the address +space of the guest. This is most useful for developers who already +know the layout of their guest and take care to ensure something sane +will happen when the reset vector executes. + +The generic loader can be invoked by using the loader device: + +``-device loader,addr=3D,data=3D,data-len=3D[,data-b= e=3D][,cpu-num=3D]`` + +there is also the guest loader which operates in a similar way but +tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where +the guest image is: + +``-device guest-loader,addr=3D[,kernel=3D,[bootargs=3D]][,initrd=3D]`` + +ERST + DEFHEADING() =20 DEFHEADING(Debug/Expert options:) @@ -4175,13 +4226,6 @@ SRST To list all the data directories, use ``-L help``. ERST =20 -DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ - "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) -SRST -``-bios file`` - Set the filename for the BIOS. -ERST - DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC | --=20 2.30.2