stand/efi: Call md_copymodules based on __LP64__ to fix 32-bit arm

When I refactored everything, I neglected to pass in the proper is64
value on 32-bit platforms. This corrects that. This prevented armv7 and
armv6 platforms from booting due to misaligned data in the kernel.  The
only platform we support 32-bit booting in armv[67], which I apparently
neglected to test before commiting my refactoring.

Tested by:		skibo
Fixes:			5d1531d9d4
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D37095
This commit is contained in:
Warner Losh 2022-10-22 19:09:10 -06:00
parent 2cb90a7b2e
commit e0c3f66b4d

View File

@ -316,6 +316,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
vm_offset_t size;
char *rootdevname;
int howto;
bool is64;
#if defined(LOADER_FDT_SUPPORT)
vm_offset_t dtbp;
int dtb_size;
@ -335,6 +336,11 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
#endif
};
#endif
#ifdef __LP64__
is64 = true;
#else
is64 = false;
#endif
howto = bi_getboothowto(args);
@ -413,7 +419,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
#endif
bi_load_efi_data(kfp, exit_bs);
size = md_copymodules(0, true);
size = md_copymodules(0, is64);
kernend = roundup(addr + size, PAGE_SIZE);
*kernendp = kernend;
@ -438,7 +444,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
#endif
/* Copy module list and metadata. */
(void)md_copymodules(addr, true);
(void)md_copymodules(addr, is64);
return (0);
}