Skip to content

Commit 2e765c0

Browse files
ardbiesheuvelIngo Molnar
authored and
Ingo Molnar
committed
x86/boot: Grab kernel_info offset from zoffset header directly
Instead of parsing zoffset.h and poking the kernel_info offset value into the header from the build tool, just grab the value directly in the asm file that describes this header. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230915171623.655440-11-ardb@google.com
1 parent b618d31 commit 2e765c0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

arch/x86/boot/header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr
526526

527527
init_size: .long INIT_SIZE # kernel initialization size
528528
handover_offset: .long 0 # Filled in by build.c
529-
kernel_info_offset: .long 0 # Filled in by build.c
529+
kernel_info_offset: .long ZO_kernel_info
530530

531531
# End of setup header #####################################################
532532

arch/x86/boot/tools/build.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static unsigned long efi32_stub_entry;
5959
static unsigned long efi64_stub_entry;
6060
static unsigned long efi_pe_entry;
6161
static unsigned long efi32_pe_entry;
62-
static unsigned long kernel_info;
6362
static unsigned long _end;
6463

6564
/*----------------------------------------------------------------------*/
@@ -337,7 +336,6 @@ static void parse_zoffset(char *fname)
337336
PARSE_ZOFS(p, efi64_stub_entry);
338337
PARSE_ZOFS(p, efi_pe_entry);
339338
PARSE_ZOFS(p, efi32_pe_entry);
340-
PARSE_ZOFS(p, kernel_info);
341339
PARSE_ZOFS(p, _end);
342340

343341
p = strchr(p, '\n');
@@ -419,8 +417,6 @@ int main(int argc, char ** argv)
419417
update_pecoff_text(setup_sectors * 512, i + (sys_size * 16));
420418

421419
efi_stub_entry_update();
422-
/* Update kernel_info offset. */
423-
put_unaligned_le32(kernel_info, &buf[0x268]);
424420

425421
crc = partial_crc32(buf, i, crc);
426422
if (fwrite(buf, 1, i, dest) != i)

0 commit comments

Comments
 (0)