Skip to content

Commit

Permalink
Debugging dlstub
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Dmytruk <[email protected]>
  • Loading branch information
SergiiDmytruk committed Jan 24, 2025
1 parent 0492064 commit 8284858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grub-core/loader/multiboot_mbi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,5 +1273,5 @@ grub_multiboot2_perform_slaunch (grub_uint32_t mbi_target,
grub_dprintf ("slaunch", "BROKEN dl_entry!");

/* If this returns, something failed miserably */
return GRUB_ERR_BAD_DEVICE;
return grub_error (GRUB_ERR_BAD_DEVICE, N_("Failed to start D-RTM"));
}
6 changes: 6 additions & 0 deletions grub-core/loader/slaunch/dlstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ void dl_entry (grub_uint64_t dl_ctx)

if (slparams->boot_type == GRUB_SL_BOOT_TYPE_LINUX || slparams->boot_type == GRUB_SL_BOOT_TYPE_MB2)
{
grub_dprintf ("slaunch", "Linux/MB2?");
if (slparams->platform_type == SLP_INTEL_TXT)
{
grub_dprintf ("slaunch", "Intel");
/* Configure relocator GETSEC[SENTER] call. */
state.eax = GRUB_SMX_LEAF_SENTER;
state.ebx = slparams->dce_base;
Expand All @@ -117,13 +119,17 @@ void dl_entry (grub_uint64_t dl_ctx)
}
else if (slparams->platform_type == SLP_AMD_SKINIT)
{
grub_dprintf ("slaunch", "AMD");
/* Configure relocator GETSEC[SENTER] call. */
state.eax = slparams->dce_base;
}

grub_relocator32_boot (slparams->relocator, state, 0);
grub_dprintf ("slaunch", "relocator has failed?");
}
else if (slparams->boot_type == GRUB_SL_BOOT_TYPE_EFI)
{
grub_dprintf ("slaunch", "EFI?");
dl_trampoline (slparams->dce_base, slparams->dce_size, slparams->platform_type);
}
else
Expand Down

0 comments on commit 8284858

Please sign in to comment.