Skip to contentSkip to conversation

linux-2.6.18/x86-64: fix HYPERVISOR_iret unwind annotation

PATCH In review Jan Beulich 2 participants 2 messages Mar 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18/x86-64: fix HYPERVISOR_iret unwind annotation

Minimally for %rax this needs to reflect that the value is no longer
saved: Since the whole hypercall page is covered by a single FDE, subsequent entries would otherwise retain the state of %rax being saved on the stack, yet the offset it's being saved at is out of bounds for the "normal" hypercall stubs.

Breaking up the single FDE into per stub ones would increase the size of the resulting .eh_frame section, which is already quite big for this simple a piece of code.

arch/x86_64/kernel/head-xen.S +3 -0
@@ -98,6 +98,9 @@ NEXT_PAGE(hypercall_page)
 	.skip 2 /* syscall */
 	.if i == __HYPERVISOR_iret
 	CFI_ADJUST_CFA_OFFSET	-3*8
+	CFI_SAME_VALUE	rax
+	CFI_SAME_VALUE	r11
+	CFI_SAME_VALUE	rcx
 	.else
 	.skip 2 /* pop %r11 */
 	CFI_ADJUST_CFA_OFFSET -8
include/asm-x86_64/dwarf2.h +2 -0
@@ -28,6 +28,7 @@
 #define CFI_REMEMBER_STATE .cfi_remember_state
 #define CFI_RESTORE_STATE .cfi_restore_state
 #define CFI_UNDEFINED .cfi_undefined
+#define CFI_SAME_VALUE .cfi_same_value
 
 #else
 
@@ -45,6 +46,7 @@
 #define CFI_REMEMBER_STATE	#
 #define CFI_RESTORE_STATE	#
 #define CFI_UNDEFINED	#
+#define CFI_SAME_VALUE		#
 
 #endif
 

x86-64: fix HYPERVISOR_iret unwind annotation

Minimally for %rax this needs to reflect that the value is no longer
saved: Since the whole hypercall page is covered by a single FDE, subsequent entries would otherwise retain the state of %rax being saved on the stack, yet the offset it's being saved at is out of bounds for the "normal" hypercall stubs.

Breaking up the single FDE into per stub ones would increase the size of the resulting .eh_frame section, which is already quite big for this simple a piece of code.

arch/x86_64/kernel/head-xen.S +3 -0
@@ -98,6 +98,9 @@ NEXT_PAGE(hypercall_page)
 	.skip 2 /* syscall */
 	.if i == __HYPERVISOR_iret
 	CFI_ADJUST_CFA_OFFSET	-3*8
+	CFI_SAME_VALUE	rax
+	CFI_SAME_VALUE	r11
+	CFI_SAME_VALUE	rcx
 	.else
 	.skip 2 /* pop %r11 */
 	CFI_ADJUST_CFA_OFFSET -8
include/asm-x86_64/dwarf2.h +2 -0
@@ -28,6 +28,7 @@
 #define CFI_REMEMBER_STATE .cfi_remember_state
 #define CFI_RESTORE_STATE .cfi_restore_state
 #define CFI_UNDEFINED .cfi_undefined
+#define CFI_SAME_VALUE .cfi_same_value
 
 #else
 
@@ -45,6 +46,7 @@
 #define CFI_REMEMBER_STATE	#
 #define CFI_RESTORE_STATE	#
 #define CFI_UNDEFINED	#
+#define CFI_SAME_VALUE		#
 
 #endif
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jan Beulich

Minimally for %rax this needs to reflect that the value is no longer
saved: Since the whole hypercall page is covered by a single FDE, subsequent entries would otherwise retain the state of %rax being saved on the stack, yet the offset it's being saved at is out of bounds for the "normal" hypercall stubs.

Breaking up the single FDE into per stub ones would increase the size of the resulting .eh_frame section, which is already quite big for this simple a piece of code.

Quoted 37 lines
arch/x86_64/kernel/head-xen.S +0 -0
@@ -98,6 +98,9 @@ NEXT_PAGE(hypercall_page)

.skip 2 /* syscall */
.if i == __HYPERVISOR_iret
CFI_ADJUST_CFA_OFFSET -3*8
+ CFI_SAME_VALUE rax
+ CFI_SAME_VALUE r11
+ CFI_SAME_VALUE rcx
.else
.skip 2 /* pop %r11 */
CFI_ADJUST_CFA_OFFSET -8

include/asm-x86_64/dwarf2.h +2 -0
@@ -28,6 +28,7 @@
 #define CFI_REMEMBER_STATE .cfi_remember_state
 #define CFI_RESTORE_STATE .cfi_restore_state
 #define CFI_UNDEFINED .cfi_undefined
+#define CFI_SAME_VALUE .cfi_same_value
 
 #else
 
@@ -45,6 +46,7 @@
 #define CFI_REMEMBER_STATE #
 #define CFI_RESTORE_STATE #
 #define CFI_UNDEFINED #
+#define CFI_SAME_VALUE  #
 
 #endif
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel