Skip to content

Commit f6dfae5

Browse files
SergiiDmytrukkrystian-hebel
authored andcommitted
i386/skinit: don't allocate TPM event log low
Do allocation in the same way as it's done for TXT (preferring high addresses), otherwise Xen loads 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 <[email protected]>
1 parent 99b6c86 commit f6dfae5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

grub-core/loader/i386/skinit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ grub_skinit_boot_prepare (struct grub_relocator *rel,
106106
if (slb == NULL)
107107
return grub_error (GRUB_ERR_BAD_ARGUMENT, "SLB module is missing");
108108

109-
err = grub_relocator_alloc_chunk_align (rel, &ch, 0x1000000,
110-
0xffffffff - GRUB_SLAUNCH_TPM_EVT_LOG_SIZE,
111-
GRUB_SLAUNCH_TPM_EVT_LOG_SIZE, GRUB_PAGE_SIZE,
112-
GRUB_RELOCATOR_PREFERENCE_NONE, 1);
109+
err = grub_relocator_alloc_chunk_align_safe (rel, &ch, 0x1000000,
110+
UP_TO_TOP32(GRUB_SLAUNCH_TPM_EVT_LOG_SIZE),
111+
GRUB_SLAUNCH_TPM_EVT_LOG_SIZE, GRUB_PAGE_SIZE,
112+
GRUB_RELOCATOR_PREFERENCE_HIGH, 1);
113113

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

0 commit comments

Comments
 (0)