Skip to content

Commit

Permalink
AMDSL: Add SKINIT reserved section and ensure SKL is 64KB long
Browse files Browse the repository at this point in the history
A section of size 0x740 must the carved out just after the measured
portion of the SKL for the signature header, signature and public key.
The .fill directive ensures we have enough space in there and the
signing process does not crash into other sections.

In addition, adding ". = 0xFFF4" is a preliminary approach to ensure that
SKL is 64KB long. The extra missing 0xC bytes are produced by the .got.plt
section. A cleaner approach might be to use ALIGN() linker directives.

Signed-off-by: Jagannathan Raman <[email protected]>
  • Loading branch information
jraman567 authored and rossphilipson committed Jun 10, 2024
1 parent b27a656 commit b93a793
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions head.S
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ gdt:
.Lgdt_end:
ENDDATA(gdt)

.section .skinit_reserved, "a", @progbits
GLOBAL(skinit_reserved)
.fill 0x740, 1, 0x00

#ifdef __x86_64__
/* 64bit Pagetables, identity map of the first 4G of RAM. */
.section .bss.page_data, "aw", @nobits
Expand Down
8 changes: 8 additions & 0 deletions link.lds
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ SECTIONS

_end_of_measured = .;

. = ALIGN(16);

.skinit_reserved : {
*(.skinit_reserved)
}

.bss : {
. = ALIGN(4096);
_bss = .;
Expand All @@ -73,6 +79,8 @@ SECTIONS
*(.bootloader_data)
}

. = 0xFFF4;

_end = .;

/* This section is expected to be empty. */
Expand Down

0 comments on commit b93a793

Please sign in to comment.