On 8/16/23 09:41, Heinrich Schuchardt wrote:
On 8/16/23 03:22, Simon Glass wrote:
Hi Heinrich,

I thought I would try booting Windows on U-Boot but it does not get
very far. Have you tried that? I note a ew odd things below. Is there
a validation suite for it?

https://github.com/sjg20/u-boot/tree/efi2

qemu-x86_64_defconfig does not build with your tree (commit
d4caae6bce9082d0a770047e8f3d3a68b7084740, sjg/efi2):

   BINMAN  .binman_stamp
Wrote map file './rom.map' to show errors
binman: Node '/binman/rom/u-boot-spl-with-ucode-ptr': Offset 0xfffd8000
(4294803456) overlaps with previous entry '/binman/rom/u-boot' ending at
0xfffd84e8 (4294804712)
make: *** [Makefile:1115: .binman_stamp] Error 1

ImagePos    Offset      Size  Name
<none>    00000000  00100000  rom
<none>     fff00000  000d84e8  u-boot
<none>      00000000  000d79a0  u-boot-nodtb
<none>      000d79a0  00000b48  u-boot-dtb
<none>     fffd8000  00015f60  u-boot-spl-with-ucode-ptr
<none>     fffd84e8  00000b48  u-boot-dtb
<none>     fffd9030  000004c6  fdtmap
<none>     fffd94f6  00000000  private-files
<none>     fffedf60  00000b48  u-boot-dtb-with-ucode2
<none>     fffff800  00000070  x86-start16-spl
<none>     fffffff0  00000005  x86-reset16-spl
<none>     fffffff8  00000008  image-header


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

This does not work with EDK II either.

I was able to start the installer with:

qemu-system-x86_64 \
-M q35,smm=on,accel=kvm -smp 8 -m 4G -gdb tcp::1234 \
-serial mon:stdio \
-vga std \
-device qemu-xhci \
-device usb-kbd \
-device usb-mouse \
-global driver=cfi.pflash01,property=secure,value=on \
-drive
if=pflash,format=raw,unit=0,file=OVMF_CODE_4M.secboot.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.ms.fd \
-drive file=root.img,if=virtio,format=raw \
-drive file=Win11_22H2_EnglishInternational_x64v2.iso,media=cdrom

The Windows installer does not work without SMM but returns to the EFI
shell. This might be what you have seen.

U-Boot's qemu-x86_64_defconfig does not start with
-M q35,smm=on,accel=kvm

Instead of using KVM you could specify -cpu Skylake-Client-v4 which is
supported by the Windows 11. But of course this is very slow.

Please, retry with:
qemu-system-x86_64 \
-machine pc-i440fx-2.5,smm=on -cpu Skylake-Client-v4 \
-vga std \

Can we get support for -M q35 into U-Boot? Cf.
https://wiki.qemu.org/Features/Q35. This would allow us to actually
compare EDK II and U-Boot when running with the same settings.

Why wouldn't U-Boot support kvm on an AMD Ryzen 5 2500U?

With KVM I either get:
"int_exception_handler() Exception 13 while executing option rom"
or the code hangs in cpu_call64.

Best regards

Heinrich



Scanning bootdev 'virtio-blk#0.bootdev':
efi_install_multiple_protocol_interfaces_int() EFI: Call:
efi_locate_device_path(protocol, &dp, &old_handle)
efi_locate_device_path()   EFI: Entry efi_locate_device_path(Device
Path, 00000000becf6848, 00000000becf6840)
efi_locate_device_path()     EFI: Call:
efi_locate_handle_buffer(BY_PROTOCOL, protocol, NULL, &no_handles,
&handles)
efi_locate_handle_buffer()       EFI: Entry
efi_locate_handle_buffer(2, Device Path, 0000000000000000,
00000000becf67b8, 00000000becf67b0)
efi_locate_handle_buffer()       EFI: Exit: efi_locate_handle_buffer: 0
efi_locate_device_path()     EFI: 0 returned by
efi_locate_handle_buffer(BY_PROTOCOL, protocol, NULL, &no_handles,
&handles)
efi_locate_device_path()   EFI: Exit: efi_locate_device_path: 14
efi_install_multiple_protocol_interfaces_int() EFI: 14 returned by


^ This seems unhappy because it is a virtio device?

Before a device path protocol is installed we check that the same device
path has not been installed before (lib/efi_loader/efi_boottime.c:2685).

EFI_NOT_FOUND signals that we are good to continue.

Best regards

Heinrich

Reply via email to