Index: stand/efi/loader/main.c =================================================================== --- stand/efi/loader/main.c +++ stand/efi/loader/main.c @@ -408,6 +408,17 @@ return (false); } +/* + * Ensure that preloaded files have 16 byte alignment. This is required + * for early loading of microcode updates. + */ +static uint64_t +efi_loadaddr(u_int type __unused, void *data __unused, uint64_t addr) +{ + + return (roundup2(addr, 16)); +} + static int parse_args(int argc, CHAR16 *argv[]) { @@ -544,6 +555,7 @@ archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; + archsw.arch_loadaddr = efi_loadaddr; #ifdef EFI_ZFS_BOOT /* Note this needs to be set before ZFS init. */ archsw.arch_zfs_probe = efi_zfs_probe; Index: stand/i386/loader/main.c =================================================================== --- stand/i386/loader/main.c +++ stand/i386/loader/main.c @@ -69,6 +69,7 @@ static void extract_currdev(void); static int isa_inb(int port); static void isa_outb(int port, int value); +static uint64_t i386_loadaddr(u_int type, void *data, uint64_t addr); void exit(int code); #ifdef LOADER_GELI_SUPPORT #include "geliboot.h" @@ -166,6 +167,7 @@ archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; + archsw.arch_loadaddr = i386_loadaddr; #ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = i386_zfs_probe; @@ -385,6 +387,17 @@ outb(port, value); } +/* + * Ensure that preloaded files have 16 byte alignment. This is required + * for early loading of microcode updates. + */ +static uint64_t +i386_loadaddr(u_int type __unused, void *data __unused, uint64_t addr) +{ + + return (roundup2(addr, 16)); +} + #ifdef LOADER_ZFS_SUPPORT static void i386_zfs_probe(void)