xen64: deal with extra words Xen pushes onto exception frames
authorJeremy Fitzhardinge <jeremy@goop.org>
Tue, 8 Jul 2008 22:07:00 +0000 (15:07 -0700)
committerIngo Molnar <mingo@elte.hu>
Wed, 16 Jul 2008 09:02:31 +0000 (11:02 +0200)
Xen pushes two extra words containing the values of rcx and r11.  This
pvop hook copies the words back into their appropriate registers, and
cleans them off the stack.  This leaves the stack in native form, so
the normal handler can run unchanged.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/xen/enlighten.c
arch/x86/xen/xen-asm_64.S
arch/x86/xen/xen-ops.h

index f5e96f7a4c5c77c0268a6d706b12702dd7e6f69f..9d94483b3b5e9c1877438c091a2a637b67b1460d 100644 (file)
@@ -1091,7 +1091,7 @@ static const struct pv_irq_ops xen_irq_ops __initdata = {
        .safe_halt = xen_safe_halt,
        .halt = xen_halt,
 #ifdef CONFIG_X86_64
-       .adjust_exception_frame = paravirt_nop,
+       .adjust_exception_frame = xen_adjust_exception_frame,
 #endif
 };
 
index 4ec10827370be4b5cb06376b41c57b669367b3d2..b147b495daef5ee5d2ec1da7071f4295abaf17f6 100644 (file)
@@ -133,6 +133,11 @@ check_events:
        ret
 #endif
 
+ENTRY(xen_adjust_exception_frame)
+       mov 8+0(%rsp),%rcx
+       mov 8+8(%rsp),%r11
+       ret $16
+
 ENTRY(xen_iret)
        pushq $0
        jmp hypercall_page + __HYPERVISOR_iret * 32
index aca4a7803e2c2c24b1105c93c5354836895f31fc..c4800a2c5a4127e3012cb626cd6c2e0ed3201d52 100644 (file)
@@ -67,7 +67,9 @@ DECL_ASM(void, xen_irq_disable_direct, void);
 DECL_ASM(unsigned long, xen_save_fl_direct, void);
 DECL_ASM(void, xen_restore_fl_direct, unsigned long);
 
+/* These are not functions, and cannot be called normally */
 void xen_iret(void);
 void xen_sysexit(void);
+void xen_adjust_exception_frame(void);
 
 #endif /* XEN_OPS_H */