|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 7/7] x86/kexec: Zero GPRs before entering
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 <kevin.lampis@xxxxxxxxxx>
---
Changes in v3:
- No changes
Changes in v2:
- Move the 32bit lines to the correct place
- Reword the patch subject line
- Fix indentation
---
xen/arch/x86/x86_64/kexec_reloc.S | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/xen/arch/x86/x86_64/kexec_reloc.S
b/xen/arch/x86/x86_64/kexec_reloc.S
index 0f163862b858..ed1cf15e6c94 100644
--- a/xen/arch/x86/x86_64/kexec_reloc.S
+++ b/xen/arch/x86/x86_64/kexec_reloc.S
@@ -111,6 +111,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
@@ -127,6 +141,7 @@ FUNC(kexec_reloc, PAGE_SIZE)
lea compatibility_mode(%rip), %rax
push $0x10
push %rax
+
lretq
END(kexec_reloc)
@@ -204,6 +219,11 @@ FUNC_LOCAL(compatibility_mode)
xorl %eax, %eax
movl %eax, %cr4
+ xor %edi, %edi
+ xor %ebx, %ebx
+ xor %ecx, %ecx
+ xor %edx, %edx
+
/* Jump to the image entry point. */
jmp *%ebp
END(compatibility_mode)
--
2.52.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |