arm64: probes: Move magic BRK values into brk-imm.h

kprobes and uprobes reserve some BRK immediates for installing their
probes. Define these along with the other reservations in brk-imm.h
and rename the ESR definitions to be consistent with the others that we
already have.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
Will Deacon
2019-02-26 15:06:42 +00:00
parent fb610f2a20
commit 453b7740eb
7 changed files with 11 additions and 12 deletions

View File

@@ -317,7 +317,7 @@ static int call_break_hook(struct pt_regs *regs, unsigned int esr)
rcu_read_lock();
list_for_each_entry_rcu(hook, list, node) {
unsigned int comment = esr & BRK64_ESR_MASK;
unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
if ((comment & ~hook->mask) == hook->imm)
fn = hook->fn;

View File

@@ -470,7 +470,7 @@ kprobe_breakpoint_handler(struct pt_regs *regs, unsigned int esr)
}
static struct break_hook kprobes_break_hook = {
.imm = BRK64_ESR_KPROBES,
.imm = KPROBES_BRK_IMM,
.fn = kprobe_breakpoint_handler,
};

View File

@@ -191,7 +191,7 @@ static int uprobe_single_step_handler(struct pt_regs *regs,
/* uprobe breakpoint handler hook */
static struct break_hook uprobes_break_hook = {
.imm = BRK64_ESR_UPROBES,
.imm = UPROBES_BRK_IMM,
.fn = uprobe_breakpoint_handler,
};

View File

@@ -1024,7 +1024,7 @@ int __init early_brk64(unsigned long addr, unsigned int esr,
struct pt_regs *regs)
{
#ifdef CONFIG_KASAN_SW_TAGS
unsigned int comment = esr & BRK64_ESR_MASK;
unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
if ((comment & ~KASAN_BRK_MASK) == KASAN_BRK_IMM)
return kasan_handler(regs, esr) != DBG_HOOK_HANDLED;