summaryrefslogtreecommitdiff
path: root/purgatory/arch
diff options
context:
space:
mode:
Diffstat (limited to 'purgatory/arch')
-rw-r--r--purgatory/arch/x86_64/purgatory-x86_64.c11
-rw-r--r--purgatory/arch/x86_64/setup-x86_64.S3
2 files changed, 13 insertions, 1 deletions
diff --git a/purgatory/arch/x86_64/purgatory-x86_64.c b/purgatory/arch/x86_64/purgatory-x86_64.c
index 1513508..c25a9c2 100644
--- a/purgatory/arch/x86_64/purgatory-x86_64.c
+++ b/purgatory/arch/x86_64/purgatory-x86_64.c
@@ -6,6 +6,7 @@
uint8_t reset_vga = 0;
uint8_t legacy_pic = 0;
uint8_t panic_kernel = 0;
+unsigned long jump_back_entry = 0;
char *cmdline_end = NULL;
void setup_arch(void)
@@ -14,8 +15,16 @@ void setup_arch(void)
if (legacy_pic) x86_setup_legacy_pic();
}
+void x86_setup_jump_back_entry(void)
+{
+ if (cmdline_end)
+ sprintf(cmdline_end, " kexec_jump_back_entry=0x%lx",
+ jump_back_entry);
+}
+
/* This function can be used to execute after the SHA256 verification. */
void post_verification_setup_arch(void)
{
- if (panic_kernel) crashdump_backup_memory();
+ if (panic_kernel) crashdump_backup_memory();
+ if (jump_back_entry) x86_setup_jump_back_entry();
}
diff --git a/purgatory/arch/x86_64/setup-x86_64.S b/purgatory/arch/x86_64/setup-x86_64.S
index d3b5993..74997fa 100644
--- a/purgatory/arch/x86_64/setup-x86_64.S
+++ b/purgatory/arch/x86_64/setup-x86_64.S
@@ -41,6 +41,9 @@ purgatory_start:
/* In 64bit mode the code segment is meaningless */
+ movq 0(%rsp), %rax
+ movq %rax, jump_back_entry
+
/* Setup a stack */
movq $lstack_end, %rsp