From: Varadarajan Narayanan Date: Wed, 26 Mar 2025 05:46:53 +0000 (+0530) Subject: efi_loader: Handle GD_FLG_SKIP_RELOC X-Git-Tag: v2025.07-rc1~80^2~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=742aa8b0396dfeb39e60c88988b7db3d9694a09d;p=pandora-u-boot.git efi_loader: Handle GD_FLG_SKIP_RELOC If the EFI runtime services pointers are relocated even though relocation is skipped, it corrupts some other data resulting in some unexpected behaviour. In this specific case, it overwrote some page table entries resulting in the device memory address range's mappings getting removed. Eventually, after the completion of efi_runtime_relocate(), when a driver tries to access its device's registers it crashes since the mappings are absent. Signed-off-by: Varadarajan Narayanan Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- diff --git a/common/board_r.c b/common/board_r.c index 8d69db1875d..f12e0c848e7 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -169,7 +169,8 @@ static int initr_reloc_global_data(void) */ efi_save_gd(); - efi_runtime_relocate(gd->relocaddr, NULL); + if (!(gd->flags & GD_FLG_SKIP_RELOC)) + efi_runtime_relocate(gd->relocaddr, NULL); #endif /*