aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_64/entry.S
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-06-21 15:10:04 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-06-21 15:10:04 +0100
commit814685710454a2061ac4e5941d3eb6acda5ea6b1 (patch)
tree37ae2f7b7c9ac9ff855cb63f1bd0f7ad4213a15e /xen/arch/x86/x86_64/entry.S
parentd8b6ccfe2d40d2964feb992bf2026957c54e982a (diff)
downloadxen-814685710454a2061ac4e5941d3eb6acda5ea6b1.tar.gz
xen-814685710454a2061ac4e5941d3eb6acda5ea6b1.tar.bz2
xen-814685710454a2061ac4e5941d3eb6acda5ea6b1.zip
x86: machine check exception handling
Properly handle MCE (connecting the exisiting, but so far unused vendor specific handlers). HVM guests don't own CR4.MCE (and hence can't suppress the exception) anymore, preventing silent machine shutdown. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/x86_64/entry.S')
-rw-r--r--xen/arch/x86/x86_64/entry.S40
1 files changed, 21 insertions, 19 deletions
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 2d47c3a305..3c586ae52d 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -505,11 +505,6 @@ ENTRY(page_fault)
movl $TRAP_page_fault,4(%rsp)
jmp handle_exception
-ENTRY(machine_check)
- pushq $0
- movl $TRAP_machine_check,4(%rsp)
- jmp handle_exception
-
ENTRY(spurious_interrupt_bug)
pushq $0
movl $TRAP_spurious_int,4(%rsp)
@@ -527,31 +522,38 @@ ENTRY(early_page_fault)
call do_early_page_fault
jmp restore_all_xen
-ENTRY(nmi)
- pushq $0
+handle_ist_exception:
SAVE_ALL
testb $3,UREGS_cs(%rsp)
- jz nmi_in_hypervisor_mode
+ jz 1f
/* Interrupted guest context. Copy the context to stack bottom. */
- GET_GUEST_REGS(%rbx)
+ GET_GUEST_REGS(%rdi)
+ movq %rsp,%rsi
movl $UREGS_kernel_sizeof/8,%ecx
-1: popq %rax
- movq %rax,(%rbx)
- addq $8,%rbx
- loop 1b
- subq $UREGS_kernel_sizeof,%rbx
- movq %rbx,%rsp
-nmi_in_hypervisor_mode:
- movq %rsp,%rdi
- call do_nmi
+ movq %rdi,%rsp
+ rep movsq
+1: movq %rsp,%rdi
+ movl UREGS_entry_vector(%rsp),%eax
+ leaq exception_table(%rip),%rdx
+ callq *(%rdx,%rax,8)
jmp ret_from_intr
+ENTRY(nmi)
+ pushq $0
+ movl $TRAP_nmi,4(%rsp)
+ jmp handle_ist_exception
+
+ENTRY(machine_check)
+ pushq $0
+ movl $TRAP_machine_check,4(%rsp)
+ jmp handle_ist_exception
+
.data
ENTRY(exception_table)
.quad do_divide_error
.quad do_debug
- .quad 0 # nmi
+ .quad do_nmi
.quad do_int3
.quad do_overflow
.quad do_bounds