Change i386 switch_to to be unwinder friendly The dwarf2 unwinder would always get stuck in context_switch() in the inline assembly switch_to() macro which is putting data on the stack without properly dwarf2 annotating it. Move the flags save/restore to C code to avoid that. Signed-off-by: Andi Kleen Index: linux/include/asm-x86/system_32.h =================================================================== --- linux.orig/include/asm-x86/system_32.h +++ linux/include/asm-x86/system_32.h @@ -18,20 +18,20 @@ extern struct task_struct * FASTCALL(__s */ #define switch_to(prev,next,last) do { \ unsigned long esi,edi; \ - asm volatile("pushfl\n\t" /* Save flags */ \ - "pushl %%ebp\n\t" \ + unsigned long flags = native_save_fl(); \ + asm volatile("pushl %%ebp\n\t" \ "movl %%esp,%0\n\t" /* save ESP */ \ "movl %5,%%esp\n\t" /* restore ESP */ \ "movl $1f,%1\n\t" /* save EIP */ \ "pushl %6\n\t" /* restore EIP */ \ "jmp __switch_to\n" \ "1:\t" \ - "popl %%ebp\n\t" \ - "popfl" \ + "popl %%ebp\n" \ :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ "=a" (last),"=S" (esi),"=D" (edi) \ :"m" (next->thread.esp),"m" (next->thread.eip), \ "2" (prev), "d" (next)); \ + native_restore_fl(flags); \ } while (0) #define _set_base(addr,base) do { unsigned long __pr; \