diff options
author | Huang Ying <ying.huang@intel.com> | 2009-12-09 15:04:57 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2009-12-10 10:17:30 +1100 |
commit | 0f89d6658e077b043b6481af6a04715bf49472b8 (patch) | |
tree | 18bb3a914ed2072b3931611fd7ec8fe6a7a0bcb1 /purgatory | |
parent | 523cc35be9ba3cae86b145de5b540c5b7e3bb43f (diff) |
kexec jump support for x86_64
x86_64 specific support, including crash memory range and purgatory setup.
Corresponding kernel support has been merged already.
Together with the kexec jump features in Linux kernel, kexec jump can
be used for following:
- A simple hibernation implementation without ACPI support. You can
kexec a hibernating kernel, save the memory image of original system
and shutdown the system. When resuming, you restore the memory image
of original system via ordinary kexec load then jump back.
- Kernel/system debug through making system snapshot. You can make
system snapshot with kexec/kdump, jump back, do some thing and make
another system snapshot.
- Cooperative multi-kernel/system. With kexec jump, you can switch
between several kernels/systems quickly without boot process except
the first time. This appears like swap a whole kernel/system out/in.
- A general method to call program in physical mode (paging turning
off). This can be used to invoke BIOS code under Linux.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r-- | purgatory/arch/x86_64/purgatory-x86_64.c | 11 | ||||
-rw-r--r-- | purgatory/arch/x86_64/setup-x86_64.S | 3 |
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 |