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

[Xen-devel] [PATCH] linux-2.6.18/x86: adjust unwind info for special HYPERVISOR_iret stack layout


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Fri, 23 Nov 2012 14:18:57 +0000
  • Delivery-date: Fri, 23 Nov 2012 14:20:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/arch/i386/kernel/head-xen.S
+++ b/arch/i386/kernel/head-xen.S
@@ -70,7 +70,13 @@ ENTRY(startup_32)
 .org HYPERCALL_PAGE_OFFSET
 ENTRY(hypercall_page)
        CFI_STARTPROC
-.skip 0x1000
+       .skip __HYPERVISOR_iret * 32
+       CFI_REMEMBER_STATE
+       .skip 1 /* push %eax */
+       CFI_ADJUST_CFA_OFFSET   8
+       CFI_REL_OFFSET  eax,0
+       CFI_RESTORE_STATE
+       .balign 0x1000,0
        CFI_ENDPROC
 
 /*
--- a/arch/x86_64/kernel/head-xen.S
+++ b/arch/x86_64/kernel/head-xen.S
@@ -23,6 +23,7 @@
 #include <asm/msr.h>
 #include <asm/cache.h>
 #include <asm/dwarf2.h>
+#include <xen/interface/xen.h>
 #include <xen/interface/elfnote.h>
 #include <xen/interface/features.h>
 
@@ -80,6 +81,7 @@ NEXT_PAGE(level1_fixmap_pgt)
 
 NEXT_PAGE(hypercall_page)
        CFI_STARTPROC
+       i = 0
        .rept 0x1000 / 0x20
        .skip 1 /* push %rcx */
        CFI_ADJUST_CFA_OFFSET   8
@@ -87,15 +89,25 @@ NEXT_PAGE(hypercall_page)
        .skip 2 /* push %r11 */
        CFI_ADJUST_CFA_OFFSET   8
        CFI_REL_OFFSET  r11,0
+       .if i == __HYPERVISOR_iret
+       .skip 1 /* push %rax */
+       CFI_ADJUST_CFA_OFFSET   8
+       CFI_REL_OFFSET  rax,0
+       .endif
        .skip 5 /* mov $#,%eax */
        .skip 2 /* syscall */
+       .if i == __HYPERVISOR_iret
+       CFI_ADJUST_CFA_OFFSET   -3*8
+       .else
        .skip 2 /* pop %r11 */
        CFI_ADJUST_CFA_OFFSET -8
        CFI_RESTORE r11
        .skip 1 /* pop %rcx */
        CFI_ADJUST_CFA_OFFSET -8
        CFI_RESTORE rcx
-       .align 0x20,0 /* ret */
+       .endif
+       .balign 0x20,0 /* ret */
+       i = i + 1
        .endr
        CFI_ENDPROC
 



Attachment: xen-x86-unwind-hypervisor_iret.patch
Description: Text document

_______________________________________________
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®.