Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 097a0788 authored by Glauber Costa's avatar Glauber Costa Committed by Ingo Molnar
Browse files

x86: set bp field in pt_regs properly



Save rbp twice: One is for marking the stack frame, as usual (already
there), and the other, to fill pt_regs properly. This is because bx
comes right before the last saved register in that structure, and not
bp. If the base pointer were in the place bx is today, this would not
be needed.

Signed-off-by: default avatarGlauber Costa <gcosta@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2c44e668
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -667,6 +667,13 @@ END(stub_rt_sigreturn)
	SAVE_ARGS
	SAVE_ARGS
	leaq -ARGOFFSET(%rsp),%rdi	# arg1 for handler
	leaq -ARGOFFSET(%rsp),%rdi	# arg1 for handler
	pushq %rbp
	pushq %rbp
	/*
	 * Save rbp twice: One is for marking the stack frame, as usual, and the
	 * other, to fill pt_regs properly. This is because bx comes right
	 * before the last saved register in that structure, and not bp. If the
	 * base pointer were in the place bx is today, this would not be needed.
	 */
	movq %rbp, -8(%rsp)
	CFI_ADJUST_CFA_OFFSET	8
	CFI_ADJUST_CFA_OFFSET	8
	CFI_REL_OFFSET		rbp, 0
	CFI_REL_OFFSET		rbp, 0
	movq %rsp,%rbp
	movq %rsp,%rbp