|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 7/7] x86/kexec: Zero general purpose registers
Purgatory zeros these general purpose registers before jumping to the
new kernel. When doing kexec on an EFI kernel there is no purgatory so
we need to zero the registers here instead. This change shouldn't affect
the functionality of legacy kexec.
Signed-off-by: Kevin Lampis <klampis@xxxxxxxxxx>
---
xen/arch/x86/x86_64/kexec_reloc.S | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/xen/arch/x86/x86_64/kexec_reloc.S
b/xen/arch/x86/x86_64/kexec_reloc.S
index 6a2c839b83..be9e487f7a 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -78,6 +78,20 @@ FUNC(kexec_reloc, PAGE_SIZE)
testq $KEXEC_RELOC_FLAG_COMPAT, %r8
jnz .L_call_32_bit
+ xor %edi, %edi
+ xor %eax, %eax
+ xor %ebx, %ebx
+ xor %ecx, %ecx
+ xor %edx, %edx
+ xor %r8d, %r8d
+ xor %r9d, %r9d
+ xor %r10d, %r10d
+ xor %r11d, %r11d
+ xor %r12d, %r12d
+ xor %r13d, %r13d
+ xor %r14d, %r14d
+ xor %r15d, %r15d
+
/* Jump to the image entry point */
jmp *%rbp
@@ -94,6 +108,13 @@ FUNC(kexec_reloc, PAGE_SIZE)
lea compatibility_mode(%rip), %rax
push $0x10
push %rax
+
+ xor %edi, %edi
+ xor %eax, %eax
+ xor %ebx, %ebx
+ xor %ecx, %ecx
+ xor %edx, %edx
+
lretq
END(kexec_reloc)
--
2.52.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |