* [BUGFIX] kexec, x86, Fix incorrect jump back address if not preserve context
@ 2011-07-14 1:34 Huang Ying
0 siblings, 0 replies; only message in thread
From: Huang Ying @ 2011-07-14 1:34 UTC (permalink / raw)
To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Eric W. Biederman,
Vivek Goyal
Cc: linux-kernel, Huang Ying
In kexec jump support, jump back address passed to the kexeced kernel
via function calling ABI, that is, the function call return address is
the jump back entry. And jump back entry == 0 should be used to
signal that jump back or preserve context is not enabled in original
kernel. But in original implementation, the stack position used for
function call return address is not cleared if preserve context is
disabled. The patch fixes this issue.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Reported-and-tested-by: Yin Kangkai <kangkai.yin@intel.com>
---
arch/x86/kernel/relocate_kernel_32.S | 2 ++
arch/x86/kernel/relocate_kernel_64.S | 2 ++
2 files changed, 4 insertions(+)
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -97,6 +97,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address as 0 if not preserve context */
+ pushl $0
/* store the start address on the stack */
pushl %edx
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -100,6 +100,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address as 0 if not preserve context */
+ pushq $0
/* store the start address on the stack */
pushq %rdx
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-14 1:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 1:34 [BUGFIX] kexec, x86, Fix incorrect jump back address if not preserve context Huang Ying
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®