Skip to content

Commit c8a0cce

Browse files
seehearfeeljfvogel
authored andcommitted
LoongArch: uprobes: Remove redundant code about resume_era
commit 12614f794274f63fbdfe76771b2b332077d63848 upstream. arch_uprobe_skip_sstep() returns true if instruction was emulated, that is to say, there is no need to single step for the emulated instructions. regs->csr_era will point to the destination address directly after the exception, so the resume_era related code is redundant, just remove them. Cc: [email protected] Fixes: 19bc6cb ("LoongArch: Add uprobes support") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 12f69c4e309845ad2823b3a095019526a529578f) Signed-off-by: Jack Vogel <[email protected]>
1 parent 3bbd77e commit c8a0cce

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

arch/loongarch/include/asm/uprobes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ typedef u32 uprobe_opcode_t;
1515
#define UPROBE_XOLBP_INSN __emit_break(BRK_UPROBE_XOLBP)
1616

1717
struct arch_uprobe {
18-
unsigned long resume_era;
1918
u32 insn[2];
2019
u32 ixol[2];
2120
bool simulate;

arch/loongarch/kernel/uprobes.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
5252

5353
WARN_ON_ONCE(current->thread.trap_nr != UPROBE_TRAP_NR);
5454
current->thread.trap_nr = utask->autask.saved_trap_nr;
55-
56-
if (auprobe->simulate)
57-
instruction_pointer_set(regs, auprobe->resume_era);
58-
else
59-
instruction_pointer_set(regs, utask->vaddr + LOONGARCH_INSN_SIZE);
55+
instruction_pointer_set(regs, utask->vaddr + LOONGARCH_INSN_SIZE);
6056

6157
return 0;
6258
}
@@ -86,7 +82,6 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
8682

8783
insn.word = auprobe->insn[0];
8884
arch_simulate_insn(insn, regs);
89-
auprobe->resume_era = regs->csr_era;
9085

9186
return true;
9287
}

0 commit comments

Comments
 (0)