I was mistaken about when ASM_CALL_CONSTRAINT is applicable. It is not
applicable for plain pushes/pops, so remove it from the flags logic.
Clarify the description of ASM_CALL_CONSTRAINT to be explicit about unwinding
using framepointers.
Fixes: 0754534b8a38 ("x86/elf: Improve code generation in elf_core_save_regs()")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
/*
* This output constraint should be used for any inline asm which has a "call"
- * instruction. Otherwise the asm may be inserted before the frame pointer
- * gets set up by the containing function.
+ * instruction, which forces the frame pointer to be set up prior to the asm
+ * block. This matters when unwinding using frame pointers, where the asm's
+ * function can get skipped over.
*/
#ifdef CONFIG_FRAME_POINTER
register unsigned long current_stack_pointer asm("rsp");
/* orig_rax not filled in for now */
asm ( "lea (%%rip), %0" : "=r" (core_regs->rip) );
asm ( "mov %%cs, %0" : "=m" (core_regs->cs) );
- asm ( "pushfq; popq %0" : "=m" (core_regs->rflags) ASM_CALL_CONSTRAINT );
+ asm ( "pushfq; popq %0" : "=m" (core_regs->rflags) );
asm ( "movq %%rsp, %0" : "=m" (core_regs->rsp) );
asm ( "mov %%ss, %0" : "=m" (core_regs->ss) );
rdmsrl(MSR_FS_BASE, core_regs->thread_fs);