diff mbox series

[v4,4/4] arm64: kprobe: clarify the comment of steppable hint instructions

Message ID 1594368010-4419-5-git-send-email-amit.kachhap@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: add Armv8.3 pointer authentication enhancements | expand

Commit Message

Amit Daniel Kachhap July 10, 2020, 8 a.m. UTC
The existing comment about steppable hint instruction is not complete
and only describes NOP instructions as steppable. As the function
aarch64_insn_is_steppable_hint allows all white-listed instruction
to be probed so the comment is updated to reflect this.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
---
Changes since v3:
 * New patch.

 arch/arm64/kernel/probes/decode-insn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Dave Martin July 29, 2020, 10:44 a.m. UTC | #1
On Fri, Jul 10, 2020 at 01:30:10PM +0530, Amit Daniel Kachhap wrote:
> The existing comment about steppable hint instruction is not complete
> and only describes NOP instructions as steppable. As the function
> aarch64_insn_is_steppable_hint allows all white-listed instruction
> to be probed so the comment is updated to reflect this.
> 
> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>

Reviewed-by: Dave Martin <Dave.Martin@arm.com>

> ---
> Changes since v3:
>  * New patch.
> 
>  arch/arm64/kernel/probes/decode-insn.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/probes/decode-insn.c b/arch/arm64/kernel/probes/decode-insn.c
> index 263d5fba4c8a..3912a37cb117 100644
> --- a/arch/arm64/kernel/probes/decode-insn.c
> +++ b/arch/arm64/kernel/probes/decode-insn.c
> @@ -42,8 +42,10 @@ static bool __kprobes aarch64_insn_is_steppable(u32 insn)
>  			     != AARCH64_INSN_SPCLREG_DAIF;
>  
>  		/*
> -		 * The HINT instruction is is problematic when single-stepping,
> -		 * except for the NOP case.
> +		 * The HINT instruction is steppable only if it is in whitelist
> +		 * and the rest of other such instructions are blocked for
> +		 * single stepping as they may cause exception or other
> +		 * unintended behaviour.
>  		 */
>  		if (aarch64_insn_is_hint(insn))
>  			return aarch64_insn_is_steppable_hint(insn);
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox series

Patch

diff --git a/arch/arm64/kernel/probes/decode-insn.c b/arch/arm64/kernel/probes/decode-insn.c
index 263d5fba4c8a..3912a37cb117 100644
--- a/arch/arm64/kernel/probes/decode-insn.c
+++ b/arch/arm64/kernel/probes/decode-insn.c
@@ -42,8 +42,10 @@  static bool __kprobes aarch64_insn_is_steppable(u32 insn)
 			     != AARCH64_INSN_SPCLREG_DAIF;
 
 		/*
-		 * The HINT instruction is is problematic when single-stepping,
-		 * except for the NOP case.
+		 * The HINT instruction is steppable only if it is in whitelist
+		 * and the rest of other such instructions are blocked for
+		 * single stepping as they may cause exception or other
+		 * unintended behaviour.
 		 */
 		if (aarch64_insn_is_hint(insn))
 			return aarch64_insn_is_steppable_hint(insn);