Booting Windows 11

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-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
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?
efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf2040) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820000000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed1f850) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) Scanning bootdev 'virtio-blk#1.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 efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf0040) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed24f20) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdced040) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(1,0x80c,0x8)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed1fa10) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdceb040) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed2b080) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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_set_blk_dev_to_system_partition() No EFI system partition efi_set_blk_dev_to_system_partition() No EFI system partition efi_var_to_file() Failed to persist EFI variables efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/MAC(525400123456,1)' 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 efi_load_image() EFI: Entry efi_load_image(0, 00000000becfb110, /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)/efi\boot\bootx64.efi, 0000000001000000, 904560, 00000000becf6820) efi_load_image() EFI: Exit: efi_load_image: 0 efi_start_image() EFI: Entry efi_start_image(00000000bed3d820, 00000000becf67e0, 00000000becf67e8) efi_start_image() EFI: Call: efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf6730, 0000000000000000, 0000000000000000, 0x2) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_start_image() EFI: 0 returned by efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_start_image() EFI: Jumping into 0x00000000bdbaf090 efi_start_image() EFI: Call: image_obj->entry(image_handle, &systab) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf66c8, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed2b050, Device Path, 00000000becf6670, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_allocate_pages_ext() EFI: Entry efi_allocate_pages_ext(2, 2, 0x1, 00000000becf66d8) efi_allocate_pages_ext() EFI: - type address efi_allocate_pages_ext() EFI: - address 102000 efi_allocate_pages_ext() EFI: - returning memory 102000 efi_allocate_pages_ext() EFI: Exit: efi_allocate_pages_ext: 0
Here it hangs for about 10 seconds, then reboots.
Regards, Simon

Hi Simon,
On Tue, Aug 15, 2023 at 07:22:56PM -0600, 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-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
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?
efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf2040) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820000000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed1f850) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) Scanning bootdev 'virtio-blk#1.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 efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf0040) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed24f20) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdced040) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(1,0x80c,0x8)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed1fa10) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdceb040) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed2b080) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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_set_blk_dev_to_system_partition() No EFI system partition efi_set_blk_dev_to_system_partition() No EFI system partition efi_var_to_file() Failed to persist EFI variables efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/MAC(525400123456,1)' 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 efi_load_image() EFI: Entry efi_load_image(0, 00000000becfb110,
/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)/efi\boot\bootx64.efi, 0000000001000000, 904560, 00000000becf6820) efi_load_image() EFI: Exit: efi_load_image: 0 efi_start_image() EFI: Entry efi_start_image(00000000bed3d820, 00000000becf67e0, 00000000becf67e8) efi_start_image() EFI: Call: efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf6730, 0000000000000000, 0000000000000000, 0x2) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_start_image() EFI: 0 returned by efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_start_image() EFI: Jumping into 0x00000000bdbaf090 efi_start_image() EFI: Call: image_obj->entry(image_handle, &systab) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf66c8, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed2b050, Device Path, 00000000becf6670, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_allocate_pages_ext() EFI: Entry efi_allocate_pages_ext(2, 2, 0x1, 00000000becf66d8) efi_allocate_pages_ext() EFI: - type address efi_allocate_pages_ext() EFI: - address 102000 efi_allocate_pages_ext() EFI: - returning memory 102000 efi_allocate_pages_ext() EFI: Exit: efi_allocate_pages_ext: 0
Here it hangs for about 10 seconds, then reboots.
How are you launching QEMU? IIRC by default the VM spawns in EL1 and sets the PSCI conduit to HVC. But Windows issues an SMC unconditionally and blows up. Can you try with virtualization=on?
Regards /Ilias
Regards, Simon

Hi Ilias,
On Wed, 16 Aug 2023 at 01:11, Ilias Apalodimas ilias.apalodimas@linaro.org wrote:
Hi Simon,
On Tue, Aug 15, 2023 at 07:22:56PM -0600, 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-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
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?
efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf2040) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820000000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed1f850) efi_install_protocol_interface() EFI: handle 00000000bed1f820 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) Scanning bootdev 'virtio-blk#1.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 efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Device Path, 0, 00000000bdcf0040) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6948, Block IO, 0, 00000000bed24f20) efi_install_protocol_interface() EFI: handle 00000000bed24ef0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdced040) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(1,0x80c,0x8)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed1fa10) efi_install_protocol_interface() EFI: handle 00000000bed1f9e0 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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, 00000000becf6818, 00000000becf6810) 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, 00000000becf6788, 00000000becf6780) 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: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_locate_device_path(protocol, &dp, &old_handle) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Device Path, 0, 00000000bdceb040) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)' efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_multiple_protocol_interfaces_int() EFI: Call: efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) efi_install_protocol_interface() EFI: Entry efi_install_protocol_interface(00000000becf6918, Block IO, 0, 00000000bed2b080) efi_install_protocol_interface() EFI: handle 00000000bed2b050 efi_install_protocol_interface() EFI: Exit: efi_install_protocol_interface: 0 efi_install_multiple_protocol_interfaces_int() EFI: 0 returned by efi_install_protocol_interface(handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) 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_set_blk_dev_to_system_partition() No EFI system partition efi_set_blk_dev_to_system_partition() No EFI system partition efi_var_to_file() Failed to persist EFI variables efi_add_protocol() EFI: installed device path '/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/MAC(525400123456,1)' 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 efi_load_image() EFI: Entry efi_load_image(0, 00000000becfb110,
/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5400000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8200000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600820001000000)/CDROM(2,0x814,0x0)/efi\boot\bootx64.efi, 0000000001000000, 904560, 00000000becf6820) efi_load_image() EFI: Exit: efi_load_image: 0 efi_start_image() EFI: Entry efi_start_image(00000000bed3d820, 00000000becf67e0, 00000000becf67e8) efi_start_image() EFI: Call: efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf6730, 0000000000000000, 0000000000000000, 0x2) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_start_image() EFI: 0 returned by efi_open_protocol(image_handle, &efi_guid_loaded_image, &info, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) efi_start_image() EFI: Jumping into 0x00000000bdbaf090 efi_start_image() EFI: Call: image_obj->entry(image_handle, &systab) efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed3d820, Loaded Image, 00000000becf66c8, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_open_protocol() EFI: Entry efi_open_protocol(00000000bed2b050, Device Path, 00000000becf6670, 00000000becfb110, 0000000000000000, 0x1) efi_open_protocol() EFI: Exit: efi_open_protocol: 0 efi_allocate_pages_ext() EFI: Entry efi_allocate_pages_ext(2, 2, 0x1, 00000000becf66d8) efi_allocate_pages_ext() EFI: - type address efi_allocate_pages_ext() EFI: - address 102000 efi_allocate_pages_ext() EFI: - returning memory 102000 efi_allocate_pages_ext() EFI: Exit: efi_allocate_pages_ext: 0
Here it hangs for about 10 seconds, then reboots.
How are you launching QEMU? IIRC by default the VM spawns in EL1 and sets the PSCI conduit to HVC. But Windows issues an SMC unconditionally and blows up. Can you try with virtualization=on?
I actually haven't tried on ARM yet. I see instructions on booting Windows on rpi but have not tried with QEMU. I wonder if that would be easier than x86? Are there instructions anywhere?
Regards, Simon

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?
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?
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

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?
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

Hi Heinrich,
On Wed, 16 Aug 2023 at 04:50, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
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?
Thanks for all the helpful info. I know very little about this so am happy that you do!
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
I am building with
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.
OK
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
For me I get an error:
$ dpkg -l ovmf Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-========================-============-============================================= ii ovmf 2022.02-3ubuntu0.22.04.1 all UEFI firmware for 64-bit x86 virtual machines
$ 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=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=//vid/software/devel/u-boot/efi/OVMF_VARS.ms.fd -drive file=root.img,if=virtio,format=raw -drive file=/vid/software/win/Win11_22H2_English_x64v2.iso,media=cdrom qemu-system-x86_64: Gdk: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed !!!! X64 Exception Type - 06(#UD - Invalid Opcode) CPU Apic ID - 00000000 !!!! RIP - 0000000000030000, CS - 0000000000000038, RFLAGS - 0000000000010246 RAX - 0000000000000000, RCX - 0000000000000000, RDX - 0000000000000000 RBX - FFFFFFFFFFFFFFFF, RSP - 000000007EEC1E18, RBP - 0000000000000001 RSI - 000000007E8EC818, RDI - 000000007EED9830 R8 - 0000000000000000, R9 - 0000000003041001, R10 - 000000000000003A R11 - 000000007E8E9680, R12 - 000000007E8E9018, R13 - 000000007EEC1EA0 R14 - 000000007EED72F0, R15 - 0000000000000000 DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030 GS - 0000000000000030, SS - 0000000000000030 CR0 - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000007EC01000 CR4 - 0000000000000668, CR8 - 0000000000000000 DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000 DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400 GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000 IDTR - 000000007E4E6018 0000000000000FFF, TR - 0000000000000000 FXSAVE_STATE - 000000007EEC1A70 !!!! Can't find image information. !!!!
The Windows installer does not work without SMM but returns to the EFI shell. This might be what you have seen.
OK.
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 \
That does the same thing for me with qemu-x86_64 (eventually reboots). I tried using Q35 too:
qemu-system-x86_64 -M smm=on -cpu Skylake-Client-v4 -vga std -m 4G -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,file=/vid/software/win/Win11_22H2_English_x64v2.iso,if=none -device ich9-ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0
Trying the same idea with the OVMF stuff hangs with nothing on the display:
qemu-system-x86_64 -M pc-i440fx-2.5,smm=on -cpu Skylake-Client-v4 -vga std -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=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=//vid/software/devel/u-boot/efi/OVMF_VARS.ms.fd -drive file=root.img,if=virtio,format=raw -drive file=/vid/software/win/Win11_22H2_English_x64v2.iso,media=cdrom
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.
Yes but you need to change CONFIG_DEVICE_TREE to "qemu-x86_q35"
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.
Yes, that is a bug I mentioned to Bin as well. It happens when jumping into 64-bit mode. However, it works fine with booting from coreboot, so it is probably something missing in the CPU init. I have not dug into that yet.
I pushed a new tree to my github/efi2 with the Q35 changes so that you can try that.
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.
OK, thanks.
Regards, Simon

Hello Simon,
these are the EFI configuration tables that EDK II is publishing:
Configuration tables: ee4e5898-3914-4259-9d6e-dc7bd79403cf 05ad34ba-6f02-4214-952e-4da0398e2bb9 7739f24c-93d7-11d4-9a3a-0090273fc14d 4c19049f-4137-4dd3-9c10-8b97a83ffdfa 49152e77-1ada-4764-b7a2-7afefed95e8b 060cc026-4c0d-4dda-8f41-595fef00a502 SMBIOS eb9d2d30-2d88-11d3-9a16-0090273fc14d ACPI 2.0 dcfa911d-26eb-469f-a220-38b7dc461220 d719b2cb-3d3a-4596-a3bc-dad00e67656f
Here is the translation for the GUIDs:
Configuration tables: EFI_LZMA_COMPRESSED (not standardized) EFI_DXE_SERVICES (not standardized) EFI_HOB_LIST (PI specification) EFI_MEMORY_TYPE (not standardized) EfiDebugImageInfoTable (UEFI specification) EFI_MEM_STATUS_CODE_REC (not standardized) SMBIOS (UEFI specification) EFI_GUID_EFI_ACPI1 (UEFI specification, deprecated) ACPI 2.0 (UEFI specification) EfiMemoryAttributesTable (UEFI specification) EFI_IMAGE_SECURITY_DATABASE (not defined as table in UEFI spec)
At least the Memory Attributes Table is used with some security profiles of Windows. The lack of one of the tables might be stopping the installation progress.
The EFI_DEBUG_IMAGE_INFO_TABLE points to SMM images and I needed smm=on to run the Windows installer on EDK II.
The Windows 11 installer does not comprise a virtio block device driver. Some Fedora people have packages a driver that you could load into the installer but I guess it is easier to supply an emulated NVMe or SCSI driver as installation target.
Best regards
Heinrich
participants (3)
-
Heinrich Schuchardt
-
Ilias Apalodimas
-
Simon Glass