Re: [linux-yocto] [PATCH v5.2] arm64: Remove unneeded rcu_read_lock from debug handlers

2019-10-13 Thread Bruce Ashfield
merged.

Bruce

In message: [PATCH v5.2] arm64: Remove unneeded rcu_read_lock from debug 
handlers
on 09/10/2019 Kevin Hao wrote:

> From: Masami Hiramatsu 
> 
> commit 760d8ed069c4e32a92e2ba251a3b0d9a87a3e771 upstream
> 
> Remove rcu_read_lock()/rcu_read_unlock() from debug exception
> handlers since we are sure those are not preemptible and
> interrupts are off.
> 
> Acked-by: Paul E. McKenney 
> Signed-off-by: Masami Hiramatsu 
> Signed-off-by: Will Deacon 
> Signed-off-by: Kevin Hao 
> ---
> 
> This fixes a call trace when running the kgdb testcase.
> 
>  arch/arm64/kernel/debug-monitors.c | 14 --
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/kernel/debug-monitors.c 
> b/arch/arm64/kernel/debug-monitors.c
> index f8719bd30850..48222a4760c2 100644
> --- a/arch/arm64/kernel/debug-monitors.c
> +++ b/arch/arm64/kernel/debug-monitors.c
> @@ -207,16 +207,16 @@ static int call_step_hook(struct pt_regs *regs, 
> unsigned int esr)
>  
>   list = user_mode(regs) ? _step_hook : _step_hook;
>  
> - rcu_read_lock();
> -
> + /*
> +  * Since single-step exception disables interrupt, this function is
> +  * entirely not preemptible, and we can use rcu list safely here.
> +  */
>   list_for_each_entry_rcu(hook, list, node)   {
>   retval = hook->fn(regs, esr);
>   if (retval == DBG_HOOK_HANDLED)
>   break;
>   }
>  
> - rcu_read_unlock();
> -
>   return retval;
>  }
>  NOKPROBE_SYMBOL(call_step_hook);
> @@ -305,14 +305,16 @@ static int call_break_hook(struct pt_regs *regs, 
> unsigned int esr)
>  
>   list = user_mode(regs) ? _break_hook : _break_hook;
>  
> - rcu_read_lock();
> + /*
> +  * Since brk exception disables interrupt, this function is
> +  * entirely not preemptible, and we can use rcu list safely here.
> +  */
>   list_for_each_entry_rcu(hook, list, node) {
>   unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
>  
>   if ((comment & ~hook->mask) == hook->imm)
>   fn = hook->fn;
>   }
> - rcu_read_unlock();
>  
>   return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
>  }
> -- 
> 2.14.4
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH v5.2] arm64: Remove unneeded rcu_read_lock from debug handlers

2019-10-13 Thread Bruce Ashfield
merged.

Bruce

In message: [PATCH v5.2] arm64: Remove unneeded rcu_read_lock from debug 
handlers
on 09/10/2019 Kevin Hao wrote:

> From: Masami Hiramatsu 
> 
> commit 760d8ed069c4e32a92e2ba251a3b0d9a87a3e771 upstream
> 
> Remove rcu_read_lock()/rcu_read_unlock() from debug exception
> handlers since we are sure those are not preemptible and
> interrupts are off.
> 
> Acked-by: Paul E. McKenney 
> Signed-off-by: Masami Hiramatsu 
> Signed-off-by: Will Deacon 
> Signed-off-by: Kevin Hao 
> ---
> 
> This fixes a call trace when running the kgdb testcase.
> 
>  arch/arm64/kernel/debug-monitors.c | 14 --
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/kernel/debug-monitors.c 
> b/arch/arm64/kernel/debug-monitors.c
> index f8719bd30850..48222a4760c2 100644
> --- a/arch/arm64/kernel/debug-monitors.c
> +++ b/arch/arm64/kernel/debug-monitors.c
> @@ -207,16 +207,16 @@ static int call_step_hook(struct pt_regs *regs, 
> unsigned int esr)
>  
>   list = user_mode(regs) ? _step_hook : _step_hook;
>  
> - rcu_read_lock();
> -
> + /*
> +  * Since single-step exception disables interrupt, this function is
> +  * entirely not preemptible, and we can use rcu list safely here.
> +  */
>   list_for_each_entry_rcu(hook, list, node)   {
>   retval = hook->fn(regs, esr);
>   if (retval == DBG_HOOK_HANDLED)
>   break;
>   }
>  
> - rcu_read_unlock();
> -
>   return retval;
>  }
>  NOKPROBE_SYMBOL(call_step_hook);
> @@ -305,14 +305,16 @@ static int call_break_hook(struct pt_regs *regs, 
> unsigned int esr)
>  
>   list = user_mode(regs) ? _break_hook : _break_hook;
>  
> - rcu_read_lock();
> + /*
> +  * Since brk exception disables interrupt, this function is
> +  * entirely not preemptible, and we can use rcu list safely here.
> +  */
>   list_for_each_entry_rcu(hook, list, node) {
>   unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
>  
>   if ((comment & ~hook->mask) == hook->imm)
>   fn = hook->fn;
>   }
> - rcu_read_unlock();
>  
>   return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
>  }
> -- 
> 2.14.4
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto