Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F36DC00528 for ; Sun, 30 Jul 2023 17:33:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D16186724; Sun, 30 Jul 2023 19:33:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=web.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=web.de header.i=smoch@web.de header.b="TzpagzB1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BDCA386607; Sun, 30 Jul 2023 19:33:25 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5E7BE867E9 for ; Sun, 30 Jul 2023 19:33:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=web.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=smoch@web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1690738400; x=1691343200; i=smoch@web.de; bh=W4dmF0aCI/Ven/NhYvqY7VuBS7Iv9du/Bedpex5qQQE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=TzpagzB15v0TVIljkFfyXdUZJUp7Tptg4nfTLw8XKRycWQC2rHZKyfshj9N72oqk0Mh2Pnl tWI1i2U/65Oqozz29i3vrNIyHKnS9x5ijU5Ou9IF9EOwnkcXGuk2lnOkx/jelMsjlqukxAvW5 IAyq0BFePE66/FC5sSYbuJnTHVTqj7AksfaJ9tFuZWU9A6vCEpYJIriFqYYFwO3sprkNp3z4G I2pwYwLLvcs0XYWSXEn4BSxK3W8HdZ0Im0IY+J39L9jg/TEIztd/HTEjS0/NDuDeOxn6LNspa DHDasaHpOa/7fXKnn8qsfz/SDwdw6Ta6PQUBUEonXv+CdsGZKEgQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [10.9.8.2] ([93.241.254.39]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N4vNe-1ph1pb2IFA-010lfn; Sun, 30 Jul 2023 19:33:19 +0200 Message-ID: Date: Sun, 30 Jul 2023 19:33:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [PATCH v2 9/9] x86: Update qemu documentation Content-Language: en-US To: Simon Glass , U-Boot Mailing List Cc: Bin Meng , Dario Binacchi , Patrice Chotard , Patrick Delaunay References: <20230730171619.915576-1-sjg@chromium.org> <20230730171619.915576-9-sjg@chromium.org> From: Soeren Moch In-Reply-To: <20230730171619.915576-9-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:DhMfN02oVx/JGFop5Ta+HDju9vmJmAIj0D43C21CoHtUzyO1lYG UxaHdESHpQDjcCWZuF4dEk4w1HIbwSdvLhGkDkWg71B7ubkjoTb2SxlB2NN9u4jEcBG/hM8 ANheiMuGJcvz6FiNjOL/YIAB8PsFZ2IUioypwfxvL/qHyZDvrXZnfq1mbuevsHrGdgkDuOo 9gppZxPZh3dIFl4rX/Nig== UI-OutboundReport: notjunk:1;M01:P0:IYNaBJzUKkM=;t6ZBU7M5TAWDbxStEkIkd/7rS+/ 0DwYEGEacTEoqDVXBswACzv2UdpAnBrqsHv0Iamo7P4dBiSXZfvbJdJpFD7twFz46kV5jzHsh Hom+hqk/FO359m18NQCS2HiGaKFrxXRcrw2kc4NC4zcqQwJmfNksUDTK03O1nQDzXiMooxw0n i2Ln8/hCpM6TWgWfWCOs9N1v0+cnqc2P+p/NW36yNsnqz/79OmeXQDxTU2tNTLvynlVuHE894 S8kITiUQ6PzGVxOU6gRHdqliKKNGOXwBxeAW+vMQip5JYiBbABGUagmaCyj8PTBTY8tW4eg0E TMw/3tDCEBZcBFUi01mhVnWd+419AsUA7C2WIgeBTN94Do+TMpADdB7UZz0i/3sTrYNaIOtT7 9b3YwFPmjSlIrf+/nIv8rCiedxJXc47NH664+W+ASk9tqTqFlqROGDHwt3mvhYBjWDc8vhg13 wzpX0qgqTvpDPtjXMqXP+A4MMJTceWDrAfg9eH1PQo55T6eg1unZNh+M3GWicNLH1BDWHzSHY O4lPLQ2CXQxqgGMCMHooZNeCHEb20araoqzByEvOrSY8eR6V0jBRsG3XN0LBwF5OzqfVJd5EQ mCprZtWoGZpwt+m0X+A1jXr5aaPSNAM7U0VlKdZ50EFpNVrvWIll1LReRRYXwnBhDyA73kxhf 93yQm5etSteGCkG8dd2JvqbaERfoxAqNyVHf+DMUHS8YWXjRxip4MfyURU/NTRMNBtFKnQwe6 Agvnmqb6c9CmYqhEsuwe3ZO6dOLq5E8c2YbO92/avUMXrSUiBY9VeKNydy4DmBX1Lc3Y8vyP2 1UuwJzM4jyGghWd2JthxjdlHKgTVKueq6O7U/Qp8DpiMoBP4EtUI8ZkF+59BCzUYR1Um8mR60 hD+eMGbOZ1bnW+6tZh3PqxyPt7RsLrcdjV6Omt3ztUtaHMDj6WXtN5E7aDZSScD28KIOBDOXM 72339A== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 30.07.23 19:16, Simon Glass wrote: > Add some hints and observations related to booting distros on QEMU on x8= 6. > > Signed-off-by: Simon Glass Simon, you cc'd me on this patch (both versions), but I never used u-boot on x86. What do you expect from my side here? Thanks, Soeren > --- > > (no changes since v1) > > doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++-- > 1 file changed, 84 insertions(+), 4 deletions(-) > > diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu= -x86.rst > index e7dd4e994d38..15f56b6bc706 100644 > --- a/doc/board/emulation/qemu-x86.rst > +++ b/doc/board/emulation/qemu-x86.rst > @@ -113,7 +113,87 @@ sure the specified CPU supports 64-bit like '-cpu c= ore2duo'. Conversely > '-cpu pentium' won't work for obvious reasons that the processor only > supports 32-bit. > > -Note 64-bit support is very preliminary at this point. Lots of features > -are missing in the 64-bit world. One notable feature is the VGA console > -support which is currently missing, so that you must specify '-nographi= c' > -to get 64-bit U-Boot up and running. > +Booting distros > +--------------- > + > +It is possible to install and boot a standard Linux distribution using > +qemu-x86_64 by setting up a root disk:: > + > + qemu-img create root.img 10G > + > +then using the installer to install. For example, with Ubuntu 2023.04:: > + > + qemu-system-x86_64 -m 8G -smp 4 -bios /tmp/b/qemu-x86_64/u-boot.rom = \ > + -drive file=3Droot.img,if=3Dvirtio,driver=3Draw \ > + -drive file=3Dubuntu-23.04-desktop-amd64.iso,if=3Dvirtio,driver=3D= raw > + > +You can also add `-serial mon:stdio` if you want the serial console to = show as > +well as the video. > + > +The output will be something like this:: > + > + U-Boot SPL 2023.07 (Jul 23 2023 - 08:00:12 -0600) > + Trying to boot from SPI > + Jumping to 64-bit U-Boot: Note many features are missing > + > + > + U-Boot 2023.07 (Jul 23 2023 - 08:00:12 -0600) > + > + CPU: QEMU Virtual CPU version 2.5+ > + DRAM: 8 GiB > + Core: 20 devices, 13 uclasses, devicetree: separate > + Loading Environment from nowhere... OK > + Model: QEMU x86 (I440FX) > + Net: e1000: 52:54:00:12:34:56 > + eth0: e1000#0 > + Hit any key to stop autoboot: 0 > + Scanning for bootflows in all bootdevs > + Seq Method State Uclass Part Name = Filename > + --- ----------- ------ -------- ---- ------------------------ = ---------------- > + Scanning global bootmeth 'efi_mgr': > + Hunting with: nvme > + Hunting with: qfw > + Hunting with: scsi > + scanning bus for devices... > + Hunting with: virtio > + Scanning bootdev 'qfw_pio.bootdev': > + fatal: no kernel available > + Scanning bootdev 'virtio-blk#0.bootdev': > + Scanning bootdev 'virtio-blk#1.bootdev': > + 0 efi ready virtio 2 virtio-blk#1.bootdev.part = efi/boot/bootx64.efi > + ** Booting bootflow 'virtio-blk#1.bootdev.part_2' with efi > + EFI using ACPI tables at f0060 > + efi_install_fdt() WARNING: Can't have ACPI table and device tre= e - ignoring DT. > + efi_run_image() Booting /efi\boot\bootx64.efi > + error: file `/boot/' not found. > + > +Standard boot looks through various available devices and finds the vir= tio > +disks, then boots from the first one. After a second or so the grub men= u appears > +and you can work through the installer flow normally. > + > +Note that standard boot will not find 32-bit distros, since it looks fo= r a > +different filename. > + > +Current limitations > +------------------- > + > +Only qemu-x86-64 can be used for booting distros, since qemu-x86 (the 3= 2-bit > +version of U-Boot) seems to have an EFI bug leading to the boot handing= after > +Linux is selected from grub, e.g. with `debian-12.1.0-i386-netinst.iso`= :: > + > + ** Booting bootflow 'virtio-blk#1.bootdev.part_2' with efi > + EFI using ACPI tables at f0180 > + efi_install_fdt() WARNING: Can't have ACPI table and device tre= e - ignoring DT. > + efi_run_image() Booting /efi\boot\bootia32.efi > + Failed to open efi\boot\root=3D/dev/sdb3 - Not Found > + Failed to load image =ED=81=80=E7=B7=83: Not Found > + start_image() returned Not Found, falling back to default loader > + Welcome to GRUB! > + > +The bochs video driver also seems to cause problems before the OS is ab= le to > +show a display. > + > +Finally, the use of `-M accel=3Dkvm` is intended to use the native CPU'= s > +virtual-machine features to accelerate operation, but this causes U-Boo= t to hang > +when jumping 64-bit mode, at least on AMD machines. This may be a bug i= n U-Boot > +or something else.