From patchwork Thu Mar 30 21:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1763525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=D8lBcW6l; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Pncbj2hBmz1yY8 for ; Fri, 31 Mar 2023 08:52:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2395F85F18; Thu, 30 Mar 2023 23:52:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="D8lBcW6l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6AE9C85B34; Thu, 30 Mar 2023 23:33:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AA1FE85D9D for ; Thu, 30 Mar 2023 23:32:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102c.google.com with SMTP id l7so18531807pjg.5 for ; Thu, 30 Mar 2023 14:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680211970; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=djtSnK+Es9iUS/7CdGIdXwa3/wZtB00zmuOSnN2LoG4=; b=D8lBcW6l6MHQGsB3CI4p3uuvn3OU44dV++720O34K3pNoNcjYyEB8mLTp9hV36r0cy KALrJkUpj+zQ28ZPpWGLwevXrPXzWxMMjHu+lx/e5HJtb/P93nuycGFwTeTkP7Mz7fxW zTbbDNcQ8t8uc4IbfJt3hgOBiPhSBiCoAJRBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680211970; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=djtSnK+Es9iUS/7CdGIdXwa3/wZtB00zmuOSnN2LoG4=; b=8L1zaHEIXGYwuWlfVBVQoSC7ouSs2gYpVpVbzAUlDrcPmnh5d6q8gHqVnECXBWJhBF VP3bRzKagK4Y3hcVMdz2fpQNvOL5ycrixJbmUFxWwe9Q2CK24h8u9X+Yu80KHJ/LaYnj G4qAcZdI8VwAqYV+dI8TVTUaHku35wPt5ZiNnkqP6R98YsrlcJCWFibNe+dLsQhl9Utj zQi+d/blV/7TcWgZxWUicrdGA9u0FcFECNodu2Lz+xGKY5LhcJ8XHCpQiukFAJ5Ov3QY SwJ/WTPx0wX7sng6HI3p3ux2prKWm0fIHjoZcoGPyqv588fV42v/cvXBskB/zavO6jGO bkCw== X-Gm-Message-State: AO0yUKUhj6B/lPyZX6nbwtYldUsXtBsgPmNXe+2V7F5lxjhloPfA7As+ WqycEQ4o7QYCV/lyvzO1cg5DiNVmwnoKlcKQF5A= X-Google-Smtp-Source: AK7set+4YoEM8SSXa7HD5ohR/gbEzF8/BlsECiGKq3RGq/qGuZoutYCZgfTyEKkqwCk9UYjHs5EONg== X-Received: by 2002:a17:90a:9485:b0:23c:feb9:2cea with SMTP id s5-20020a17090a948500b0023cfeb92ceamr27664690pjo.42.1680211969903; Thu, 30 Mar 2023 14:32:49 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id q6-20020a170902b10600b001a282714f97sm144413plr.275.2023.03.30.14.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 14:32:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Heinrich Schuchardt , Simon Glass , AKASHI Takahiro , Anatolij Gustschin , Andre Przywara , Andrew Scull , Ashok Reddy Soma , Balamanikandan Gunasundar , =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= , Dzmitry Sankouski , Enric Balletbo i Serra , Fabio Estevam , George McCollister , Ilias Apalodimas , Jaehoon Chung , Jason Liu , John Keeping , Jose Marinho , Marcel Ziswiler , Mario Six , Mark Kettenis , Masahisa Kojima , Michal Simek , Michal Suchanek , Nikhil M Jain , Oleksii Bidnichenko , Ovidiu Panait , =?utf-8?q?Pali_Roh=C3=A1r?= , Paul Barker , Philippe Reynes , =?utf-8?q?Pierre-Cl=C3=A9?= =?utf-8?q?ment_Tosi?= , Rasmus Villemoes , Sean Anderson , Stefan Herbrechtsmeier , Stefan Roese , Sughosh Ganu , Ye Li Subject: [PATCH 00/38] x86: Use qemu-x86_64 to boot EFI installers Date: Fri, 31 Mar 2023 10:31:49 +1300 Message-Id: <20230330213227.2142353-1-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 23:51:39 +0200 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 This series adds various minor features so that qemu-x86_64 can boot the Ubuntu 2022.04 installer using a virtio device: qemu-system-x86_64 -M pc -drive format=raw,file=root.img -bios /tmp/b/qemu-x86_64/u-boot.rom -drive if=virtio,file=ubuntu-22.04.2-desktop-amd64.iso -smp 4 -m 4G -serial mon:stdio The main changes include: - Enable video in SPL while running in 32-bit mode - Drop the duplicate ACPI tables with EFI - Support PCI autoconfig in SPL - Support FAT on a CDROM filesystem - Improved bootstd rules around device tree and efi_set_bootdev() There are also quite a number of minor tweaks and fixes to make things easier to use. This series is based on an older version of the SPL-video series from Nikhil M Jain. It is available at u-boot-dm/bryc-working Simon Glass (38): x86: Tidy up availability of string functions x86: Allow listing MTRRs in SPL bios_emulator: Add Kconfig and adjust Makefile for SPL bios_emulator: Drop VIDEO_IO_OFFSET x86: Tidy up EFI code in interrupt_init() x86: Set high bits of the mtrr base registrer x86: Add a comment for board_init_f_r_trampoline() x86: Show the CPU physical address size with bdinfo x86: Correct get_sp() implementation for 64-bit x86: Show an error when a BINS exception occurs acpi: Add a comment to set the acpi tables bdinfo: Show the RAM top and approximate stack pointer part: Allow setting the partition-table type qfw: Show the file address if available log: Tidy up an ambiguous comment. video: Allow building video drivers for SPL qfw: Set the address of the ACPI tables efi: Show all known UUIDs with CONFIG_CMD_EFIDEBUG x86: Improve the trampoline in 64-bit mode Show the malloc base with the bdinfo command nvme: Provide more useful debugging messages pci: Support autoconfig in SPL pci: Allow the video BIOS to work in SPL with QEMU pci: Tidy up logging and reporting for video BIOS x86: Allow video-BIOS code to be built for SPL x86: Pass video settings from SPL to U-Boot proper x86: Init video in SPL if enabled pci: Adjust video BIOS debugging to be SPL-friendly pci: Mask the ROM address in case it is already enabled x86: Enable display for QEMU 64-bit x86: Allow logging to be used in SPL reliably fs: fat: Shrink the size of a few strings fs: fat: Support reading from a larger block size x86: Enable useful options for qemu-86_64 x86: Record the start and end of the tables sandbox: Correct header order in board file sandbox: Install ACPI tables on startup efi: Use the installed ACPI tables arch/sandbox/include/asm/global_data.h | 4 + arch/x86/cpu/i386/interrupt.c | 17 +-- arch/x86/cpu/mtrr.c | 62 +++++++- arch/x86/cpu/start64.S | 19 +++ arch/x86/include/asm/global_data.h | 4 + arch/x86/include/asm/mtrr.h | 20 +++ arch/x86/include/asm/string.h | 6 +- arch/x86/include/asm/u-boot-x86.h | 21 ++- arch/x86/lib/Makefile | 9 +- arch/x86/lib/bdinfo.c | 5 + arch/x86/lib/bios.c | 5 +- arch/x86/lib/bootm.c | 2 +- arch/x86/lib/spl.c | 26 +++- arch/x86/lib/tables.c | 4 +- board/google/Kconfig | 7 - board/sandbox/sandbox.c | 22 ++- cmd/Kconfig | 8 ++ cmd/acpi.c | 24 +++- cmd/bdinfo.c | 6 + cmd/part.c | 34 +++++ cmd/qfw.c | 2 +- cmd/x86/mtrr.c | 60 +------- common/board_f.c | 12 +- common/board_r.c | 7 +- common/log.c | 2 +- configs/qemu-x86_64_defconfig | 14 ++ disk/part.c | 16 +++ doc/usage/cmd/acpi.rst | 29 +++- doc/usage/cmd/part.rst | 74 ++++++++++ doc/usage/cmd/qfw.rst | 28 ++-- drivers/Kconfig | 2 + drivers/Makefile | 5 +- drivers/bios_emulator/Kconfig | 10 ++ drivers/bios_emulator/biosemui.h | 18 +-- drivers/bios_emulator/x86emu/sys.c | 1 + drivers/misc/qfw.c | 12 ++ drivers/nvme/nvme.c | 36 +++-- drivers/pci/Kconfig | 8 ++ drivers/pci/pci-uclass.c | 10 +- drivers/pci/pci_rom.c | 165 +++++++++++++++++----- fs/fat/Kconfig | 13 ++ fs/fat/fat.c | 117 ++++++++++++--- fs/fat/fat_write.c | 22 ++- include/asm-generic/global_data.h | 11 ++ include/bloblist.h | 1 + include/configs/conga-qeval20-qa3-e3845.h | 2 - include/configs/dfi-bt700.h | 2 - include/configs/minnowmax.h | 2 - include/configs/som-db5800-som-6867.h | 2 - include/configs/theadorable-x86-common.h | 2 - include/configs/x86-chromebook.h | 2 - include/part.h | 9 ++ include/pci_ids.h | 1 + include/video.h | 24 ++++ lib/efi_loader/efi_acpi.c | 33 +++-- lib/uuid.c | 2 +- test/dm/acpi.c | 38 +++++ 57 files changed, 866 insertions(+), 233 deletions(-) create mode 100644 drivers/bios_emulator/Kconfig