|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: ARM EFI: should bootinfo memory banks be reset before retrying ExitBootServices ?
On 11/16/26 17:11, Pierre Gondois wrote: Hello, Hello Pierre, I can reproduce this on QEMU, and the change you suggest fixes it. My Setup:- QEMU 11.1.3: -M virt,virtualization=on,acpi=off -cpu cortex-a57 -smp 4 -m 4G - Firmware: qemu-efi-aarch64 2026.08+ds-3- Xen: staging 3b65ff9f372fb85 (debug, early printk on PL011), xen.efi started directly from the UEFI shell Without the change, the first ExitBootServices() call fails, efi_exit_boot() retries, and every RAM bank is added a second time, and Xen hits the BUG in bootmem_region_add(): (XEN) RAM: 0000000040000000 - 000000004668ffff (XEN) RAM: 0000000040000000 - 000000004668ffff (XEN) RAM: 0000000046800000 - 000000004688ffff (XEN) RAM: 0000000046800000 - 000000004688ffff ... (XEN) Xen BUG at common/page_alloc.c:308 ... (XEN) Xen call trace: (XEN) [<00000a00002cb498>] page_alloc.c#bootmem_region_add+0xd8/0xec (PC) (XEN) [<00000a00002cb694>] init_boot_pages+0x44/0x1b0 (LR) (XEN) [<00000a00002cb694>] init_boot_pages+0x44/0x1b0 (XEN) [<00000a00002c54f0>] bootinfo.c#dt_unreserved_regions+0x70/0xac (XEN) [<00000a00002c5c50>] populate_boot_allocator+0x124/0x1c8 (XEN) [<00000a00002e2c84>] setup_mm+0x60/0x84 (XEN) [<00000a00002e337c>] start_xen+0x118/0x988(XEN) [<00000a00002001a4>] arch/arm/arm64/head.S#primary_switched+0x4/0x24 ...With your change applied, each bank is listed once and Xen boots through to dom0: ... (XEN) Checking for initrd in /chosen (XEN) RAM: 0000000040000000 - 000000004668ffff (XEN) RAM: 0000000046800000 - 000000004688ffff (XEN) RAM: 0000000046930000 - 0000000047a4ffff (XEN) RAM: 0000000047ff4000 - 000000013fffffff (XEN) (XEN) MODULE[0]: 0000000045b58000 - 0000000045ccafff Xen (XEN) MODULE[1]: 0000000045cf1000 - 0000000045df3fff Device Tree (XEN) MODULE[2]: 000000013dd4d000 - 000000013fffdf13 Ramdisk (XEN) MODULE[3]: 0000000041bf4000 - 0000000043ffffbf Kernel ...I see in the x86 that the e820_raw.nr_map in efi_arch_process_memory_map() is reset for each loop iteration. On Arm the bank is appended to the previous iteration. So, I guess resetting the banks is the right call? Pierre, are you planning to send this fix as a patch to the mailinglist? If so, please add my: Tested-by: Julian Vetter <julian.vetter@xxxxxxxxxx> Otherwise I'm happy to post the patch with your Suggested-by. Thank you, Julian Regards, Pierre [1] https://github.com/tianocore/edk2/pull/12704 [2] https://github.com/tianocore/edk2/pull/13261#issuecomment-6774136145
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |