aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/x86_64/entry.S
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-07-04 16:27:44 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-07-04 16:27:44 +0100
commit355b0469a8d017b80d9ce1078c90fe628c8b3bbe (patch)
tree9a24bfe6fe9a73ea9635cd06ed0880f63a56720a /xen/arch/x86/x86_64/entry.S
parentb12217e1416a2f4ebabfa78b5d0a578d0d879d04 (diff)
downloadxen-355b0469a8d017b80d9ce1078c90fe628c8b3bbe.tar.gz
xen-355b0469a8d017b80d9ce1078c90fe628c8b3bbe.tar.bz2
xen-355b0469a8d017b80d9ce1078c90fe628c8b3bbe.zip
x86: MCA support.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'xen/arch/x86/x86_64/entry.S')
-rw-r--r--xen/arch/x86/x86_64/entry.S35
1 files changed, 32 insertions, 3 deletions
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 6c14d233c2..d6491ce2ed 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -205,6 +205,8 @@ test_all_events:
leaq irq_stat(%rip),%rcx
testl $~0,(%rcx,%rax,1)
jnz process_softirqs
+ testb $1,VCPU_mce_pending(%rbx)
+ jnz process_mce
testb $1,VCPU_nmi_pending(%rbx)
jnz process_nmi
test_guest_events:
@@ -231,15 +233,34 @@ process_softirqs:
ALIGN
/* %rbx: struct vcpu */
+process_mce:
+ cmpw $VCPU_TRAP_MCE,VCPU_trap_priority(%rbx)
+ jae test_guest_events
+ sti
+ movb $0,VCPU_mce_pending(%rbx)
+ call set_guest_machinecheck_trapbounce
+ test %eax,%eax
+ jz test_all_events
+ movw VCPU_trap_priority(%rbx),%dx # safe priority for the
+ movw %dx,VCPU_old_trap_priority(%rbx) # iret hypercall
+ movw $VCPU_TRAP_MCE,VCPU_trap_priority(%rbx)
+ jmp process_trap
+
+ ALIGN
+/* %rbx: struct vcpu */
process_nmi:
- testb $1,VCPU_nmi_masked(%rbx)
- jnz test_guest_events
+ cmpw $VCPU_TRAP_NMI,VCPU_trap_priority(%rbx)
+ jae test_guest_events
sti
movb $0,VCPU_nmi_pending(%rbx)
call set_guest_nmi_trapbounce
test %eax,%eax
jz test_all_events
- movb $1,VCPU_nmi_masked(%rbx)
+ movw VCPU_trap_priority(%rbx),%dx # safe priority for the
+ movw %dx,VCPU_old_trap_priority(%rbx) # iret hypercall
+ movw $VCPU_TRAP_NMI,VCPU_trap_priority(%rbx)
+ /* FALLTHROUGH */
+process_trap:
leaq VCPU_trap_bounce(%rbx),%rdx
call create_bounce_frame
jmp test_all_events
@@ -671,6 +692,10 @@ ENTRY(hypercall_table)
.quad do_sysctl /* 35 */
.quad do_domctl
.quad do_kexec_op
+ .rept __HYPERVISOR_arch_0-((.-hypercall_table)/8)
+ .quad do_ni_hypercall
+ .endr
+ .quad do_mca /* 48 */
.rept NR_hypercalls-((.-hypercall_table)/8)
.quad do_ni_hypercall
.endr
@@ -715,6 +740,10 @@ ENTRY(hypercall_args_table)
.byte 1 /* do_domctl */
.byte 2 /* do_kexec */
.byte 1 /* do_xsm_op */
+ .rept __HYPERVISOR_arch_0-(.-hypercall_args_table)
+ .byte 0 /* do_ni_hypercall */
+ .endr
+ .byte 1 /* do_mca */ /* 48 */
.rept NR_hypercalls-(.-hypercall_args_table)
.byte 0 /* do_ni_hypercall */
.endr