This keeps at least gcc 10 from generating a separate function instance
in common/kexec.o alongside the inlining of the function in its sole
caller. I also think putting the address of the actual code storing the
registers is a better indication to consumers than that of an otherwise
unreferenced function.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
asm volatile("movq %%rsi,%0" : "=m"(core_regs->rsi));
asm volatile("movq %%rdi,%0" : "=m"(core_regs->rdi));
/* orig_rax not filled in for now */
- core_regs->rip = (unsigned long)elf_core_save_regs;
+ asm ( "call 0f; 0: popq %0" : "=m" (core_regs->rip) );
core_regs->cs = read_sreg(cs);
asm volatile("pushfq; popq %0" :"=m"(core_regs->rflags));
asm volatile("movq %%rsp,%0" : "=m"(core_regs->rsp));