[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] x86_64: Fix double fault stack setup



x86_64: Fix double fault stack setup.

Dont forget to push error_code and entry_vector onto the stack for a double
fault.  If it is missed, the register information printed looks like

(XEN) CPU:    0
(XEN) RIP:    0246:[<000000000000e008>] ???
(XEN) RFLAGS: ffff82c480287eb8
(XEN) rax: 0000000000000282   rbx: ffff82c480242dd0   rcx: 0000000000000282
(XEN) rdx: 0000000000000000   rsi: 0000000000000282   rdi: 0000000000000031
(XEN) rbp: 0000000000000031   rsp: 0000000000000000   r8:  ffff83007ee52488
(XEN) r9:  ffff83007ee61088   r10: 0000000000000007   r11: ffff82c480116460
(XEN) r12: 0000000000000000   r13: ffff82c4802c37e0   r14: 00026501a9ced0b8
(XEN) r15: ffff82c4802c37c0    cs: 0000000000000246    ss: 0000000000000000

which incorrectly displays cs, rip, rflags and rsp; the useful pieces of
information when trying to identify the cause of a double fault.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

diff -r 69c3ae25bb1d xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -595,6 +595,8 @@ ENTRY(spurious_interrupt_bug)
         jmp   handle_exception
 
 ENTRY(double_fault)
+        pushq $0
+        movl $TRAP_double_fault,4(%rsp)
         SAVE_ALL
         movq  %rsp,%rdi
         call  do_double_fault

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

Attachment: x86_64-double-fault-stack.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.