diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index 3ff76f88e220492c6fd428d3328c6820633a9664..6c5d3b22ac61df5bf9fb9b31061d6e41c2f14c86 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -450,7 +450,7 @@ bool unwind_next_frame(struct unwind_state *state) break; case ORC_REG_SP_INDIRECT: - sp = state->sp; + sp = state->sp + orc->sp_offset; indirect = true; break; @@ -500,9 +500,6 @@ bool unwind_next_frame(struct unwind_state *state) if (indirect) { if (!deref_stack_reg(state, sp, &sp)) goto err; - - if (orc->sp_reg == ORC_REG_SP_INDIRECT) - sp += orc->sp_offset; } /* Find IP, SP and possibly regs: */ diff --git a/tools/objtool/orc_dump.c b/tools/objtool/orc_dump.c index ba28830aace2e97288806ece734f89b5ee68abf3..faa444270ee3ab297933504b703e4628321087ae 100644 --- a/tools/objtool/orc_dump.c +++ b/tools/objtool/orc_dump.c @@ -64,7 +64,7 @@ static void print_reg(unsigned int reg, int offset) if (reg == ORC_REG_BP_INDIRECT) printf("(bp%+d)", offset); else if (reg == ORC_REG_SP_INDIRECT) - printf("(sp)%+d", offset); + printf("(sp%+d)", offset); else if (reg == ORC_REG_UNDEFINED) printf("(und)"); else