Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1477582

Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well

From Catalin Marinas <catalin.marinas@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well
Date 2016-09-06 18:20 +0200
Message-ID <sergm-4jl-49@gated-at.bofh.it> (permalink)
References <s1AAN-cO-3@gated-at.bofh.it> <s1AAO-cO-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 02, 2016 at 11:00:07AM +0530, Pratyush Anand wrote:
> --- a/arch/arm64/kernel/debug-monitors.c
> +++ b/arch/arm64/kernel/debug-monitors.c
> @@ -246,6 +246,8 @@ static void send_user_sigtrap(int si_code)
>  static int single_step_handler(unsigned long addr, unsigned int esr,
>  			       struct pt_regs *regs)
>  {
> +	bool handler_found = false;
> +
>  	/*
>  	 * If we are stepping a pending breakpoint, call the hw_breakpoint
>  	 * handler first.
> @@ -253,7 +255,14 @@ static int single_step_handler(unsigned long addr, unsigned int esr,
>  	if (!reinstall_suspended_bps(regs))
>  		return 0;
>  
> -	if (user_mode(regs)) {
> +#ifdef	CONFIG_KPROBES
> +	if (kprobe_single_step_handler(regs, esr) == DBG_HOOK_HANDLED)
> +		handler_found = true;
> +#endif
> +	if (!handler_found && call_step_hook(regs, esr) == DBG_HOOK_HANDLED)
> +		handler_found = true;
> +
> +	if (!handler_found && user_mode(regs)) {
>  		send_user_sigtrap(TRAP_HWBKPT);

Could we register kprobe_single_step_handler() via register_set_hook()
and only invoke call_step_hook() above?

-- 
Catalin

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Catalin Marinas <catalin.marinas@arm.com> - 2016-09-06 18:20 +0200
  Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well David Long <dave.long@linaro.org> - 2016-09-06 23:40 +0200
    Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Pratyush Anand <panand@redhat.com> - 2016-09-07 06:50 +0200
    Re: [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Catalin Marinas <catalin.marinas@arm.com> - 2016-09-07 15:50 +0200

csiph-web