From patchwork Wed Jun 22 14:50:52 2022 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: 583854 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2775139mab; Wed, 22 Jun 2022 07:53:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1stm/tbpSXnh005naXco7CF1J+kL/MHzcs0wkfUdGeI52exZgVjeMT4BlgU47Lbrz8XKm/E X-Received: by 2002:a05:622a:15d4:b0:305:913:c3e with SMTP id d20-20020a05622a15d400b0030509130c3emr3213481qty.516.1655909585545; Wed, 22 Jun 2022 07:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655909585; cv=none; d=google.com; s=arc-20160816; b=zy7k8WR9DzCV++fydrQsIMPMnfhgwqw3eIyDhY6Xaz0Ek45OwSaJR+HSgrmBsGN9yV ZwMQLn/kUGG+CwJQDXXUrglVDtjB5mxFGK9eLAIFZt2fN0RPEikDidcbluGpTqTqD/Og oT0Zfop/hqWz4E0qNts9JzeK+a08cFos9eKuP/jAmPhCEjiwmBK2jYr1jEiFp0rdgCmw WYPWBhCJsf7Ww20B4abgC+rTVXaUQwm2QRjveFBj3qYSUoviNQmSuMMKRw4Rir5zTB8R +grOuzFZO/d6A+iEjIpwS1VuYZl7UWXQL5CbWEI9LonLh/9xBq2oyQuHuVOo17OmRX2l 9b5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=AMocS6L1qwHpmbFESWio4zzDBe8eQUr43gocqOuiXc8=; b=hHIwKBB2HQsZRemksBTI20LbLGlI+Begvz7nB5P4dakASG7V+r2adCPfYa4pRHSGVN Z+jI0Cb7hZvNaYBLsJtXQMIfw2VCUOegHk0BekDg2PQRmHbfhiWK11tmzpNd59TZ/afn Gfu07TmyiQEaGzJFCwRs9/nUVaMeDJ+FvQFSZoOvE5qQ5PO9jPGpApe87YuUuVlskZkN ca0yxlN1yvuhsqu4E2vTZzLEaUKjtNHPKLHgc40ycLSOzJn7YlRzwoEdUI+ZeBmGacSj RRd+0qqewqWKL3rkbj0NYr7yMi65DM9p7ytDZrh/C2lbNe6X5I1qPj+uq1PyHLFPisgJ O5gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zHjnIGeb; 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=pass (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 j20-20020a05620a411400b006a79dfeaa8fsi14278797qko.674.2022.06.22.07.53.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Jun 2022 07:53:05 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=zHjnIGeb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o41j7-0007cG-5F for patch@linaro.org; Wed, 22 Jun 2022 10:53:05 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Cc: Cédric 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 -DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, - "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) -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() #endif -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_ALL) +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. +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. ERST @@ -3725,6 +3757,25 @@ SRST kernel on boot. ERST +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=,data=,data-len=[,data-be=][,cpu-num=]`` + +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=[,kernel=,[bootargs=]][,initrd=]`` + +ERST + DEFHEADING() DEFHEADING(Debug/Expert options:) @@ -4175,13 +4226,6 @@ SRST To list all the data directories, use ``-L help``. 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("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 |