Skip to content

Commit

Permalink
i386/skinit: don't allocate TPM event log low
Browse files Browse the repository at this point in the history
Do allocation in the same way as it's done for TXT (preferring high
addresses), otherwise Xens load Dom0 kernel over the TPM even log and
Linux ends up panicking when it detects conflict with e820 map in
Xen-specific code (why wouldn't Xen check it?  who knows).

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
  • Loading branch information
SergiiDmytruk committed Apr 1, 2024
1 parent 13bf69f commit aa68e91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions grub-core/loader/i386/skinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ grub_skinit_boot_prepare (struct grub_relocator *rel,
if (slb == NULL)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "SLB module is missing");

err = grub_relocator_alloc_chunk_align (rel, &ch, 0x1000000,
0xffffffff - GRUB_SLAUNCH_TPM_EVT_LOG_SIZE,
GRUB_SLAUNCH_TPM_EVT_LOG_SIZE, GRUB_PAGE_SIZE,
GRUB_RELOCATOR_PREFERENCE_NONE, 1);
err = grub_relocator_alloc_chunk_align_safe (rel, &ch, 0x1000000,
UP_TO_TOP32(GRUB_SLAUNCH_TPM_EVT_LOG_SIZE),
GRUB_SLAUNCH_TPM_EVT_LOG_SIZE, GRUB_PAGE_SIZE,
GRUB_RELOCATOR_PREFERENCE_HIGH, 1);

if (err != GRUB_ERR_NONE)
return grub_error (err, "cannot alloc memory for TPM event log");
Expand Down

0 comments on commit aa68e91

Please sign in to comment.