Skip to contentSkip to conversation

x86: Fixes for distro booting

PATCH In review Simon Glass 5 participants 27 messages Jul 30, 2023 – Aug 9, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover x86: Fixes for distro booting

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#1 lore raw

PATCH v2 1/9 x86: spl: Drop unwanted debug()

This was left over from some previous debugging. Drop it.

---

(no changes since v1)

 arch/x86/lib/spl.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/lib/spl.c +0 -1
index b6812bb8ca2b..55c061570864 100644
@@ -137,7 +137,6 @@ static int x86_spl_init(void)
 	}
 
 #ifndef CONFIG_SYS_COREBOOT
-	log_debug("bss\n");
 	debug("BSS clear from %lx to %lx len %lx\n", (ulong)&__bss_start,
 	      (ulong)&__bss_end, (ulong)&__bss_end - (ulong)&__bss_start);
 	memset(&__bss_start, 0, (ulong)&__bss_end - (ulong)&__bss_start);
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#2 lore raw

PATCH v2 2/9 video: Tidy up Makefile rule for video

In reply to Simon Glass

Drop the duplication and add a single rule which can handle SPL as well.

---

Changes in v2:
Use SPL_ instead of SPL_TPL_

 drivers/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/Makefile +2 -2
index 3bc6d279d7cb..46ef9046687a 100644
@@ -39,6 +39,8 @@ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
 obj-$(CONFIG_$(SPL_)NVME) += nvme/
 obj-$(CONFIG_XEN) += xen/
 obj-$(CONFIG_$(SPL_)FPGA) += fpga/
+obj-$(CONFIG_$(SPL_)VIDEO) += video/
+
 obj-y += bus/
 
 ifndef CONFIG_TPL_BUILD
@@ -64,7 +66,6 @@ obj-$(CONFIG_SPL_USB_HOST) += usb/host/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
-obj-$(CONFIG_SPL_VIDEO) +=video/
 
 endif
 endif
@@ -99,7 +100,6 @@ obj-y += rtc/
 obj-y += scsi/
 obj-y += sound/
 obj-y += spmi/
-obj-y += video/
 obj-y += watchdog/
 obj-$(CONFIG_QE) += qe/
 obj-$(CONFIG_U_QE) += qe/
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#4 lore raw

PATCH v2 3/9 x86: Run QEMU machine setup in SPL

In reply to Simon Glass

Call the hardware-init function from QEMU from SPL. This allows the video BIOS to operate correctly.

Create an x86-wide qemu.h header to avoid having to #ifdef the header in spl.c

---

Changes in v2:
- Drop unnecessary IS_ENABLED(CONFIG_X86)

 arch/x86/cpu/qemu/qemu.c    |  2 +-
 arch/x86/include/asm/qemu.h | 14 ++++++++++++++
 arch/x86/lib/spl.c          |  3 +++
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/include/asm/qemu.h
arch/x86/cpu/qemu/qemu.c +1 -1
index 274978c023b6..70414556086c 100644
@@ -48,7 +48,7 @@ static void enable_pm_ich9(void)
 	pci_write_config32(ICH9_PM, PMBA, CONFIG_ACPI_PM1_BASE | 1);
 }
 
-static void qemu_chipset_init(void)
+void qemu_chipset_init(void)
 {
 	u16 device, xbcs;
 	int pam, i;
arch/x86/include/asm/qemu.h new file +14 -0
new file mode 100644
index 000000000000..f1e95ffd7a4d
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Generic QEMU header
+ *
+ * Copyright 2023 Google LLC
+ */
+
+#ifndef __QEMU_H
+#define __QEMU_H
+
+/* set up the chipset for QEMU so that video can be used */
+void qemu_chipset_init(void);
+
+#endif
arch/x86/lib/spl.c +3 -0
index 55c061570864..f99df08fbece 100644
@@ -27,6 +27,7 @@
 #include <asm/mtrr.h>
 #include <asm/pci.h>
 #include <asm/processor.h>
+#include <asm/qemu.h>
 #include <asm/spl.h>
 #include <asm-generic/sections.h>
 
@@ -291,6 +292,8 @@ void spl_board_init(void)
 #ifndef CONFIG_TPL
 	preloader_console_init();
 #endif
+	if (IS_ENABLED(CONFIG_QEMU))
+		qemu_chipset_init();
 
 	if (CONFIG_IS_ENABLED(VIDEO)) {
 		struct udevice *dev;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#5 lore raw

PATCH v2 4/9 Revert "x86: Switch QEMU over to use the bochs driver"

In reply to Simon Glass

Unfortunately the bochs driver does not currently work with distros. It causes a hang sometime between grub menu selection and the OS displaying something.

This reproduces reliably.

This reverts commit b8956425d525c3c25fd218f252f89a5e44df6a9f.

---

Changes in v2:
- Add a note that this reproduces reliably

 arch/x86/cpu/qemu/Kconfig     | 2 +-
 configs/qemu-x86_64_defconfig | 4 ++++
 configs/qemu-x86_defconfig    | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)
arch/x86/cpu/qemu/Kconfig +1 -1
index aa329b0dab29..f8f2f6473088 100644
@@ -12,7 +12,7 @@ config QEMU
 	imply SYS_NS16550
 	imply USB
 	imply USB_EHCI_HCD
-	imply VIDEO_BOCHS
+	imply VIDEO_VESA
 
 if QEMU
 
configs/qemu-x86_64_defconfig +4 -0
index 9cf38a5c6952..c6f30674a8fc 100644
@@ -84,6 +84,10 @@ CONFIG_SPL_DM_RTC=y
 CONFIG_SYS_NS16550_PORT_MAPPED=y
 CONFIG_SPI=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SPL_VIDEO=y
+CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_GENERATE_ACPI_TABLE=y
configs/qemu-x86_defconfig +3 -0
index 95a6ff9ae799..56788cd185fd 100644
@@ -53,6 +53,9 @@ CONFIG_NVME_PCI=y
 CONFIG_SYS_NS16550_PORT_MAPPED=y
 CONFIG_SPI=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
+CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
+CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_GENERATE_ACPI_TABLE=y
 # CONFIG_GZIP is not set
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#6 lore raw

PATCH v2 5/9 board_f: Fix corruption of relocaddr

In reply to Simon Glass

When the video framebuffer comes from the bloblist, we should not change relocaddr to this address, since it interfers with the normal memory allocation.

This fixes a boot loop in qemu-x86_64

Fixes 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to u-boot")

---

Changes in v2:
- Add a Kconfig as the suggested conditional did not work

 common/board_f.c      | 3 ++-
 drivers/video/Kconfig | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
common/board_f.c +2 -1
index 7d2c380e91e2..5173d0a0c2d5 100644
@@ -419,7 +419,8 @@ static int reserve_video(void)
 		if (!ho)
 			return log_msg_ret("blf", -ENOENT);
 		video_reserve_from_bloblist(ho);
-		gd->relocaddr = ho->fb;
+		if (IS_ENABLED(CONFIG_VIDEO_RESERVE_SPL))
+			gd->relocaddr = ho->fb;
 	} else if (CONFIG_IS_ENABLED(VIDEO)) {
 		ulong addr;
 		int ret;
drivers/video/Kconfig +8 -0
index b41dc60cec59..e0e07ed0cda5 100644
@@ -1106,6 +1106,14 @@ config SPL_VIDEO_REMOVE
 	  if this  option is enabled video driver will be removed at the end of
 	  SPL stage, beforeloading the next stage.
 
+config VIDEO_RESERVE_SPL
+	bool
+	help
+	  This adjusts reserve_video() to redirect memory reservation when it
+	  sees a video handoff blob (BLOBLISTT_U_BOOT_VIDEO). This avoids the
+	  memory used for video being allocated to U-Boot, thus having some
+	  data structures overwrite the framebuffer.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#7 lore raw

Re: [PATCH v2 5/9] board_f: Fix corruption of relocaddr

Hi Simon,

Thanks for the patch.

Quoted 6 lines · Simon Glass

When the video framebuffer comes from the bloblist, we should not change relocaddr to this address, since it interfers with the normal memory allocation.

This fixes a boot loop in qemu-x86_64

Quoted 7 lines
Fixes 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to u-boot")

---

Changes in v2:
- Add a Kconfig as the suggested conditional did not work

Overall this approach looks fine too but just curious to know, what is the ho->fb and gd->relocaddr in your case, so that we could understand your scenario better and maybe devise a more generic condition as a later-on patch since you mentioned that shared condition did not work for you.

Quoted 10 lines
 common/board_f.c      | 3 ++-
 drivers/video/Kconfig | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
common/board_f.c +0 -0
index 7d2c380e91e2..5173d0a0c2d5 100644

common/board_f.c static int reserve_video(void) · line 426

Quoted 9 lines
common/board_f.c +2 -1
@@ -419,7 +419,8 @@ static int reserve_video(void)
 		if (!ho)
 			return log_msg_ret("blf", -ENOENT);
 		video_reserve_from_bloblist(ho);
-		gd->relocaddr = ho->fb;
+		if (IS_ENABLED(CONFIG_VIDEO_RESERVE_SPL))
+			gd->relocaddr = ho->fb;
 	} else if (CONFIG_IS_ENABLED(VIDEO)) {
 		ulong addr;
 		int ret;

Ok, so as I understand in your case you have enabled CONFIG_SPL_VIDEO but not calling reserve_video in SPL stage ?

Quoted 5 lines
drivers/video/Kconfig +0 -0
index b41dc60cec59..e0e07ed0cda5 100644

drivers/video/Kconfig config SPL_VIDEO_REMOVE · line 1114

Quoted 9 lines
drivers/video/Kconfig +6 -0
@@ -1106,6 +1106,14 @@ config SPL_VIDEO_REMOVE
 	  if this  option is enabled video driver will be removed at the end of
 	  SPL stage, beforeloading the next stage.
 
+config VIDEO_RESERVE_SPL
+	bool
+	help
+	  This adjusts reserve_video() to redirect memory reservation when it
+	  sees a video handoff blob (BLOBLISTT_U_BOOT_VIDEO). This avoids the
+	  memory used for video being allocated to U-Boot, thus having some

{some minor suggestion for correction on above text}
avoids the memory used for framebuffer from being allocated to u-boot, thus preventing any further memory reservations done by u-boot from overwriting the framebuffer ?

I think as mentioned earlier, overall this approach looks ok to me too, maybe later on we can add some conditions to check validity of passed framebuffer address and move the relocaddr pointer more intelligently.

Regards
Devarsh

Quoted 5 lines
drivers/video/Kconfig +2 -0
+	  data structures overwrite the framebuffer.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
#8 lore raw

Re: [PATCH v2 5/9] board_f: Fix corruption of relocaddr

Hi Devarsh,

Quoted 17 lines · Devarsh Thakkar

Hi Simon,

Thanks for the patch.

Quoted 11 lines · Simon Glass

When the video framebuffer comes from the bloblist, we should not change relocaddr to this address, since it interfers with the normal memory allocation.

This fixes a boot loop in qemu-x86_64

Fixes 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to u-boot")

---

Quoted 7 lines
Quoted 2 lines

Changes in v2:
- Add a Kconfig as the suggested conditional did not work

Overall this approach looks fine too but just curious to know, what is the ho->fb and gd->relocaddr in your case, so that we could understand your scenario better and maybe devise a more generic condition as a later-on patch since you mentioned that shared condition did not work for you.

Well, bear in mind that you are not filling in the video handoff struct fully, so I need to disable it for qemu-x86_64.

Here is the trace. You can try it yourself with qemu-x86_64.

qemu-system-x86_64 -m 8G -smp 4 -bios /tmp/b/qemu-x86_64/u-boot.rom -drive id=fdisk,file=root.img,if=virtio,driver=raw -serial mon:stdio

U-Boot SPL 2023.10-rc1-00119-g53cf4476d95-dirty (Jul 31 2023 - 09:51:11 -0600)
Video: 1024x768x32
Trying to boot from SPI
Jumping to 64-bit U-Boot: Note many features are missing
initcall: 0000000001133cdd
initcall: 000000000118c88a
initcall: 000000000113c550
initcall: 000000000113e006
initcall_run_list() initcall: 000000000113441a initcall_run_list() initcall: 000000000113c75a initcall_run_list() initcall: 000000000113ac52 initcall_run_list() initcall: 0000000001133cfe initcall_run_list() initcall: 00000000011112d8 initcall_run_list() initcall: 0000000001133d01 initcall_run_list() initcall: 0000000001134444 initcall_run_list() initcall: 000000000118f81e initcall_run_list() initcall: 000000000115c528 initcall_run_list() initcall: 00000000011337ff initcall_run_list() initcall: 000000000114f33b initcall_run_list() initcall: 000000000118d8b7

U-Boot 2023.10-rc1-00119-g53cf4476d95-dirty (Jul 31 2023 - 09:51:11 -0600)

initcall_run_list() initcall: 000000000113382b display_text_info() U-Boot code: 01110000 -> 011C87B0 BSS: -> 011D2524 initcall_run_list() initcall: 0000000001111d3c initcall_run_list() initcall: 0000000001133872 initcall_run_list() initcall: 0000000001133943
CPU: QEMU Virtual CPU version 2.5+
initcall_run_list() initcall: 0000000001134480 initcall_run_list() initcall: 0000000001133a01
DRAM: initcall_run_list() initcall: 0000000001111332
initcall_run_list() initcall: 0000000001133d07

     setup_dest_addr() Monitor len: 000C2524
     setup_dest_addr() Ram size: 200000000
     setup_dest_addr() Ram top: C0000000

initcall_run_list() initcall: 0000000001133deb
initcall_run_list() initcall: 0000000001133e00
initcall_run_list() initcall: 0000000001133e03
gd->relocaddr=c0000000, ho->fb=d0000000
### ERROR ### Please RESET the board ###
QEMU: Terminated

The tree for this is basically u-boot-dm/bryd-working, just before this patch:

53cf4476d95 (HEAD) Revert "x86: Switch QEMU over to use the bochs driver" 5f78655f29d x86: Run QEMU machine setup in SPL
2952bc2f091 video: Tidy up Makefile rule for video cd48d152138 x86: spl: Drop unwanted debug()
a4ce5665d55 Revert "efi debug"
530d87910dc efi debug
a36d59ba99a (x86/master, x86-public/master) Merge tag 'efi-2023-10-rc2' of
https://source.denx.de/u-boot/custodians/u-boot-efi

Quoted 15 lines
Quoted 15 lines

 common/board_f.c      | 3 ++-
 drivers/video/Kconfig | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
common/board_f.c +0 -1
index 7d2c380e91e2..5173d0a0c2d5 100644
@@ -419,7 +419,8 @@ static int reserve_video(void)
              if (!ho)
                      return log_msg_ret("blf", -ENOENT);
              video_reserve_from_bloblist(ho);
-             gd->relocaddr = ho->fb;
Quoted 8 lines

common/board_f.c static int reserve_video(void) · line 426

Quoted 5 lines
common/board_f.c +2 -0
+             if (IS_ENABLED(CONFIG_VIDEO_RESERVE_SPL))
+                     gd->relocaddr = ho->fb;
      } else if (CONFIG_IS_ENABLED(VIDEO)) {
              ulong addr;
              int ret;

Ok, so as I understand in your case you have enabled CONFIG_SPL_VIDEO but not calling reserve_video in SPL stage ?

Yes, see below.

Quoted 20 lines
Quoted 6 lines
drivers/video/Kconfig +0 -0
index b41dc60cec59..e0e07ed0cda5 100644

drivers/video/Kconfig config SPL_VIDEO_REMOVE · line 1114

Quoted 9 lines
drivers/video/Kconfig +6 -0
@@ -1106,6 +1106,14 @@ config SPL_VIDEO_REMOVE
        if this  option is enabled video driver will be removed at the end of
        SPL stage, beforeloading the next stage.
 
+config VIDEO_RESERVE_SPL
+     bool
+     help
+       This adjusts reserve_video() to redirect memory reservation when it
+       sees a video handoff blob (BLOBLISTT_U_BOOT_VIDEO). This avoids the
+       memory used for video being allocated to U-Boot, thus having some

{some minor suggestion for correction on above text}
avoids the memory used for framebuffer from being allocated to u-boot, thus preventing any further memory reservations done by u-boot from overwriting the framebuffer ?

Quoted 3 lines

I think as mentioned earlier, overall this approach looks ok to me too, maybe later on we can add some conditions to check validity of passed framebuffer address and move the relocaddr pointer more intelligently.

The problem is really that by pre-allocating the display in SPL we need to excluded it from the reservations done by U-Boot proper. It should not be done again. For that to work, we may need to tell U-Boot proper that it should start its reservations at a certain address, e.g. the bottom of the framebuffer.

Also. could you send a patch to fully fill in the video handoff? At present it is missing some fields.

Regards,
Simon

#9 lore raw

PATCH v2 6/9 x86: Correct copying of BIOS mode information

In reply to Simon Glass

This is copying beyond the end of the destination buffer. Correct the code by using the size of the vesa_mode_info struct. We don't need to copy the rest of the bytes in the buffer.

This long-standing bug prevents virtio bootdevs working correctly on qemu-x86 at present.

Fixes 0ca2426beae ("x86: Add support for running option ROMs natively")

---

Changes in v2:
- Use sizeof(struct vesa_mode_info) instead

 arch/x86/lib/bios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/bios.c +1 -1
index e29cae78e509..f146bbd54227 100644
@@ -204,7 +204,7 @@ static u8 vbe_get_mode_info(struct vesa_state *mi)
 
 	realmode_interrupt(0x10, VESA_GET_MODE_INFO, 0x0000, mi->video_mode,
 			   0x0000, buffer_seg, buffer_adr);
-	memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_state));
+	memcpy(mi->mode_info_block, buffer, sizeof(struct vesa_mode_info));
 	mi->valid = true;
 
 	return 0;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#10 lore raw

PATCH v2 7/9 video: Add a Kconfig option for SPL video handoff

In reply to Simon Glass

At present this feature is enabled in SPL if a bloblist is available. Some platforms may not want to use this, so add an option to allow the feature to be disabled.

Note that the feature unfortunately only fills in part of the video-handoff information, so causes failures on x86 platforms. For now, disable it there.

---

(no changes since v1)

 common/board_f.c             |  3 +--
 drivers/video/Kconfig        | 10 ++++++++++
 drivers/video/video-uclass.c |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)
common/board_f.c +1 -2
index 5173d0a0c2d5..42a7c536f61d 100644
@@ -411,8 +411,7 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-	if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
-	    CONFIG_IS_ENABLED(BLOBLIST)) {
+	if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) {
 		struct video_handoff *ho;
 
 		ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
drivers/video/Kconfig +10 -0
index e0e07ed0cda5..443104c294ed 100644
@@ -1011,6 +1011,16 @@ config SPL_VIDEO
 if SPL_VIDEO
 source "drivers/video/tidss/Kconfig"
 
+config SPL_VIDEO_HANDOFF
+	bool "Pass the video frame-buffer through to U-Boot proper"
+	depends on SPL_BLOBLIST
+	default y if !X86
+	help
+	  Enable this to set up video-handoff information in SPL which can be
+	  picked up in U-Boot proper. This includes the frame buffer and
+	  various other pieces of information. With this enabled, SPL can set
+	  up video and avoid re-initing it later.
+
 config SPL_VIDEO_LOGO
 	bool "Show the U-Boot logo on the display at SPL"
 	default y if !SPL_SPLASH_SCREEN
drivers/video/video-uclass.c +1 -1
index 949595f1bc69..86262a3435c2 100644
@@ -141,7 +141,7 @@ int video_reserve(ulong *addrp)
 	debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
 	      gd->video_top);
 
-	if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+	if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(VIDEO_HANDOFF)) {
 		struct video_handoff *ho;
 
 		ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Reviewed-by on v2 7/9
#11 lore raw

Re: [PATCH v2 7/9] video: Add a Kconfig option for SPL video handoff

Quoted 10 lines · Simon Glass

At present this feature is enabled in SPL if a bloblist is available. Some platforms may not want to use this, so add an option to allow the feature to be disabled.

Note that the feature unfortunately only fills in part of the video-handoff information, so causes failures on x86 platforms. For now, disable it there.

Quoted 9 lines

---

(no changes since v1)

 common/board_f.c             |  3 +--
 drivers/video/Kconfig        | 10 ++++++++++
 drivers/video/video-uclass.c |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)
#12 lore raw

PATCH v2 8/9 x86: Enable useful options for qemu-86

In reply to Simon Glass

This build can be used to boot 32-bit standard-distro builds. Enable some more options, so that all possible EFI UUIDs are decoded, we can search memory for tables, support the full set of standard-boot features, have full logging along with debug UART and can boot from CDROM media.

This mirrors a similar patch for qemu-x86_64

---

(no changes since v1)

 configs/qemu-x86_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
configs/qemu-x86_defconfig +9 -0
index 56788cd185fd..ff9df677ef4c 100644
@@ -5,10 +5,14 @@ CONFIG_NR_DRAM_BANKS=8
 CONFIG_ENV_SIZE=0x40000
 CONFIG_MAX_CPUS=2
 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx"
+CONFIG_DEBUG_UART_BASE=0x3f8
+CONFIG_DEBUG_UART_CLOCK=1843200
+CONFIG_DEBUG_UART=y
 CONFIG_SMP=y
 CONFIG_GENERATE_PIRQ_TABLE=y
 CONFIG_GENERATE_MP_TABLE=y
 CONFIG_FIT=y
+CONFIG_BOOTSTD_FULL=y
 CONFIG_BOOTSTD_DEFAULTS=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
@@ -16,6 +20,8 @@ CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_LOG=y
+CONFIG_LOGF_FUNC=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_LAST_STAGE_INIT=y
 CONFIG_PCI_INIT_R=y
@@ -23,11 +29,13 @@ CONFIG_SYS_PBSIZE=532
 CONFIG_CMD_CPU=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
+CONFIG_CMD_MEM_SEARCH=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_BOOTFILESIZE=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_QFW=y
 CONFIG_CMD_BOOTSTAGE=y
@@ -57,5 +65,6 @@ CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
 CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_FAT_BLK_XLATE=y
 CONFIG_GENERATE_ACPI_TABLE=y
 # CONFIG_GZIP is not set
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Reviewed-by on v2 8/9
#13 lore raw

Re: [PATCH v2 8/9] x86: Enable useful options for qemu-86

Quoted 59 lines · Simon Glass

This build can be used to boot 32-bit standard-distro builds. Enable some more options, so that all possible EFI UUIDs are decoded, we can search memory for tables, support the full set of standard-boot features, have full logging along with debug UART and can boot from CDROM media.

This mirrors a similar patch for qemu-x86_64

---

(no changes since v1)

 configs/qemu-x86_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
configs/qemu-x86_defconfig +8 -0
index 56788cd185fd..ff9df677ef4c 100644
@@ -5,10 +5,14 @@ CONFIG_NR_DRAM_BANKS=8
 CONFIG_ENV_SIZE=0x40000
 CONFIG_MAX_CPUS=2
 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx"
+CONFIG_DEBUG_UART_BASE=0x3f8
+CONFIG_DEBUG_UART_CLOCK=1843200
+CONFIG_DEBUG_UART=y
 CONFIG_SMP=y
 CONFIG_GENERATE_PIRQ_TABLE=y
 CONFIG_GENERATE_MP_TABLE=y
 CONFIG_FIT=y
+CONFIG_BOOTSTD_FULL=y
 CONFIG_BOOTSTD_DEFAULTS=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
@@ -16,6 +20,8 @@ CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_LOG=y
+CONFIG_LOGF_FUNC=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_LAST_STAGE_INIT=y
 CONFIG_PCI_INIT_R=y
@@ -23,11 +29,13 @@ CONFIG_SYS_PBSIZE=532
 CONFIG_CMD_CPU=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
+CONFIG_CMD_MEM_SEARCH=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_BOOTFILESIZE=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_QFW=y
 CONFIG_CMD_BOOTSTAGE=y

configs/qemu-x86_defconfig CONFIG_FRAMEBUFFER_SET_VESA_MODE=y · line 68

Quoted 4 lines
configs/qemu-x86_defconfig +1 -0
@@ -57,5 +65,6 @@ CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
 CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_FAT_BLK_XLATE=y

I will drop this when applying.

configs/qemu-x86_defconfig CONFIG_FRAMEBUFFER_SET_VESA_MODE=y

Quoted 3 lines
configs/qemu-x86_defconfig +0 -1
 CONFIG_GENERATE_ACPI_TABLE=y
 # CONFIG_GZIP is not set
--

Otherwise,

#14 lore raw

PATCH v2 9/9 x86: Update qemu documentation

In reply to Simon Glass

Add some hints and observations related to booting distros on QEMU on x86.

---

(no changes since v1)

 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 1 file changed, 84 insertions(+), 4 deletions(-)
doc/board/emulation/qemu-x86.rst +84 -4
index e7dd4e994d38..15f56b6bc706 100644
@@ -113,7 +113,87 @@ sure the specified CPU supports 64-bit like '-cpu core2duo'. 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 '-nographic'
-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=root.img,if=virtio,driver=raw \
+     -drive file=ubuntu-23.04-desktop-amd64.iso,if=virtio,driver=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 tree - 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 virtio
+disks, then boots from the first one. After a second or so the grub menu appears
+and you can work through the installer flow normally.
+
+Note that standard boot will not find 32-bit distros, since it looks for a
+different filename.
+
+Current limitations
+-------------------
+
+Only qemu-x86-64 can be used for booting distros, since qemu-x86 (the 32-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 tree - ignoring DT.
+          efi_run_image() Booting /efi\boot\bootia32.efi
+   Failed to open efi\boot\root=/dev/sdb3 - Not Found
+   Failed to load image 큀緃: 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 able to
+show a display.
+
+Finally, the use of `-M accel=kvm` is intended to use the native CPU's
+virtual-machine features to accelerate operation, but this causes U-Boot to hang
+when jumping 64-bit mode, at least on AMD machines. This may be a bug in U-Boot
+or something else.
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#15 lore raw

Re: [PATCH v2 9/9] x86: Update qemu documentation

Quoted 3 lines · Simon Glass

Add some hints and observations related to booting distros on QEMU on x86.

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

Quoted 103 lines

---

(no changes since v1)

  doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
  1 file changed, 84 insertions(+), 4 deletions(-)
doc/board/emulation/qemu-x86.rst +84 -4
index e7dd4e994d38..15f56b6bc706 100644
@@ -113,7 +113,87 @@ sure the specified CPU supports 64-bit like '-cpu core2duo'. 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 '-nographic'
-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=root.img,if=virtio,driver=raw \
+     -drive file=ubuntu-23.04-desktop-amd64.iso,if=virtio,driver=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 tree - 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 virtio
+disks, then boots from the first one. After a second or so the grub menu appears
+and you can work through the installer flow normally.
+
+Note that standard boot will not find 32-bit distros, since it looks for a
+different filename.
+
+Current limitations
+-------------------
+
+Only qemu-x86-64 can be used for booting distros, since qemu-x86 (the 32-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 tree - ignoring DT.
+          efi_run_image() Booting /efi\boot\bootia32.efi
+   Failed to open efi\boot\root=/dev/sdb3 - Not Found
+   Failed to load image 큀緃: 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 able to
+show a display.
+
+Finally, the use of `-M accel=kvm` is intended to use the native CPU's
+virtual-machine features to accelerate operation, but this causes U-Boot to hang
+when jumping 64-bit mode, at least on AMD machines. This may be a bug in U-Boot
+or something else.
#16 lore raw

Re: [PATCH v2 9/9] x86: Update qemu documentation

Hi Soeren,

Quoted 9 lines · Soeren Moch
Quoted 3 lines · Simon Glass

Add some hints and observations related to booting distros on QEMU on x86.

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?

This is automatic with get_maintainers.pl but I am not sure why it added you.

Regards,
Simon

Quoted 103 lines
Quoted 102 lines

(no changes since v1)

  doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
  1 file changed, 84 insertions(+), 4 deletions(-)
doc/board/emulation/qemu-x86.rst +84 -4
index e7dd4e994d38..15f56b6bc706 100644
@@ -113,7 +113,87 @@ sure the specified CPU supports 64-bit like '-cpu core2duo'. 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 '-nographic'
-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=root.img,if=virtio,driver=raw \
+     -drive file=ubuntu-23.04-desktop-amd64.iso,if=virtio,driver=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 tree - 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 virtio
+disks, then boots from the first one. After a second or so the grub menu appears
+and you can work through the installer flow normally.
+
+Note that standard boot will not find 32-bit distros, since it looks for a
+different filename.
+
+Current limitations
+-------------------
+
+Only qemu-x86-64 can be used for booting distros, since qemu-x86 (the 32-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 tree - ignoring DT.
+          efi_run_image() Booting /efi\boot\bootia32.efi
+   Failed to open efi\boot\root=/dev/sdb3 - Not Found
+   Failed to load image 큀緃: 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 able to
+show a display.
+
+Finally, the use of `-M accel=kvm` is intended to use the native CPU's
+virtual-machine features to accelerate operation, but this causes U-Boot to hang
+when jumping 64-bit mode, at least on AMD machines. This may be a bug in U-Boot
+or something else.
#18 lore raw
In reply to Simon Glass
Quoted 23 lines · Simon Glass

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

Quoted 15 lines
 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h

series applied to u-boot-x86, thanks!

#19 lore raw

Hi Bin,

Quoted 41 lines · Bin Meng
Quoted 23 lines · Simon Glass

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

Quoted 15 lines
 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Quoted 1 line

series applied to u-boot-x86, thanks!

Are you planning to send another x86 pull request soon? You could drop the board_f patch and let Tom deal with it.

Regards,
Simon

#20 lore raw

Hi Simon,

Quoted 45 lines · Simon Glass

Hi Bin,

Quoted 41 lines · Bin Meng
Quoted 38 lines · Simon Glass

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Quoted 4 lines
Quoted 1 line

series applied to u-boot-x86, thanks!

Are you planning to send another x86 pull request soon? You could drop the board_f patch and let Tom deal with it.

Yes, I plan to send another PR soon.

Regards,
Bin

#21 lore raw

Hi Bin,

Any word on this, please? I would like to get distros running in qemu and after that we still need to resolve the board_f problem upstream.

Regards,
Simon

Quoted 58 lines · Bin Meng

Hi Simon,

Quoted 45 lines · Simon Glass

Hi Bin,

Quoted 41 lines · Bin Meng
Quoted 38 lines · Simon Glass

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Quoted 4 lines
Quoted 1 line

series applied to u-boot-x86, thanks!

Are you planning to send another x86 pull request soon? You could drop the board_f patch and let Tom deal with it.

Yes, I plan to send another PR soon.

Regards,
Bin

#22 lore raw

Hi Simon,

Quoted 6 lines · Simon Glass

Hi Bin,

Any word on this, please? I would like to get distros running in qemu and after that we still need to resolve the board_f problem upstream.

Sorry it took so long. I've prepared the branch and am waiting for CI to complete before I can send the PR.

Regards,
Bin

#23 lore raw
Quoted 5 lines · Bin Meng

Hi Simon,

Quoted 1 line · Simon Glass
Quoted 8 lines
Quoted 5 lines

Hi Bin,

Any word on this, please? I would like to get distros running in qemu and after that we still need to resolve the board_f problem upstream.

Sorry it took so long. I've prepared the branch and am waiting for CI to complete before I can send the PR.

Thank you Bin.

#24 lore raw
In reply to Simon Glass

I'm not x86 maintainer and I'm not going to check these x86, so please do not send me these emails. How many times I have to repeat it?

Quoted 40 lines · On Sunday 30 July 2023 11:15:58 Simon Glass wrote:

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#25 lore raw

Hi Pali,

Quoted 3 lines · Pali Rohár

I'm not x86 maintainer and I'm not going to check these x86, so please do not send me these emails. How many times I have to repeat it?

You committed to board_f.c and that is affected by two patches in this series.

Quoted 39 lines · On Sunday 30 July 2023 11:15:58 Simon Glass wrote:
Quoted 37 lines

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Quoted 3 lines
Quoted 3 lines

--
2.41.0.487.g6d72f3e995-goog

Regards,
Simon

#26 lore raw

I'm not x86 maintainer and I'm not going to check these x86, so please do not send me these emails. How many times I have to repeat it?

Quoted 54 lines · On Sunday 06 August 2023 08:39:46 Simon Glass wrote:

Hi Pali,

Quoted 3 lines · Pali Rohár

I'm not x86 maintainer and I'm not going to check these x86, so please do not send me these emails. How many times I have to repeat it?

You committed to board_f.c and that is affected by two patches in this series.

Quoted 39 lines · On Sunday 30 July 2023 11:15:58 Simon Glass wrote:
Quoted 37 lines

This series collects together various fixes found whn testing out booting of distros using QEMU on x86. Together they improve functionality, but it is not perfect yet. Some notes are included as to the current state.

Changes in v2:
Use SPL_ instead of SPL_TPL_
- Drop unnecessary IS_ENABLED(CONFIG_X86)
- Add a note that this reproduces reliably
- Add a Kconfig as the suggested conditional did not work
- Use sizeof(struct vesa_mode_info) instead

Simon Glass (9):
x86: spl: Drop unwanted debug()
video: Tidy up Makefile rule for video
x86: Run QEMU machine setup in SPL
Revert "x86: Switch QEMU over to use the bochs driver"
board_f: Fix corruption of relocaddr
x86: Correct copying of BIOS mode information
video: Add a Kconfig option for SPL video handoff
x86: Enable useful options for qemu-86
x86: Update qemu documentation

 arch/x86/cpu/qemu/Kconfig        |  2 +-
 arch/x86/cpu/qemu/qemu.c         |  2 +-
 arch/x86/include/asm/qemu.h      | 14 +++++
 arch/x86/lib/bios.c              |  2 +-
 arch/x86/lib/spl.c               |  4 +-
 common/board_f.c                 |  6 +--
 configs/qemu-x86_64_defconfig    |  4 ++
 configs/qemu-x86_defconfig       | 12 +++++
 doc/board/emulation/qemu-x86.rst | 88 ++++++++++++++++++++++++++++++--
 drivers/Makefile                 |  4 +-
 drivers/video/Kconfig            | 18 +++++++
 drivers/video/video-uclass.c     |  2 +-
 12 files changed, 144 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/include/asm/qemu.h
Quoted 3 lines
Quoted 3 lines

--
2.41.0.487.g6d72f3e995-goog

Regards,
Simon