2023-02-20 07:35:38

by Sangmoon Kim

[permalink] [raw]
Subject: [PATCH] arm64: pass ESR_ELx to die() of cfi_handler

Commit 0f2cb928a154 ("arm64: consistently pass ESR_ELx to die()") caused
all callers to pass the ESR_ELx value to die().

For consistency, this patch also adds esr to die() call of cfi_handler.
Also, when CFI error occurs, die handlers can use ESR_ELx value.

Signed-off-by: Sangmoon Kim <[email protected]>
---
arch/arm64/kernel/traps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 0ccc063daccb..4a623e2e982b 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -990,7 +990,7 @@ static int cfi_handler(struct pt_regs *regs, unsigned long esr)

switch (report_cfi_failure(regs, regs->pc, &target, type)) {
case BUG_TRAP_TYPE_BUG:
- die("Oops - CFI", regs, 0);
+ die("Oops - CFI", regs, esr);
break;

case BUG_TRAP_TYPE_WARN:
--
2.17.1



2023-02-20 10:05:08

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH] arm64: pass ESR_ELx to die() of cfi_handler

On Mon, Feb 20, 2023 at 04:34:41PM +0900, Sangmoon Kim wrote:
> Commit 0f2cb928a154 ("arm64: consistently pass ESR_ELx to die()") caused
> all callers to pass the ESR_ELx value to die().
>
> For consistency, this patch also adds esr to die() call of cfi_handler.
> Also, when CFI error occurs, die handlers can use ESR_ELx value.
>
> Signed-off-by: Sangmoon Kim <[email protected]>

Consistently reporting the ESR value makes sense to me, so:

Acked-by: Mark Rutland <[email protected]>

Mark.

> ---
> arch/arm64/kernel/traps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 0ccc063daccb..4a623e2e982b 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -990,7 +990,7 @@ static int cfi_handler(struct pt_regs *regs, unsigned long esr)
>
> switch (report_cfi_failure(regs, regs->pc, &target, type)) {
> case BUG_TRAP_TYPE_BUG:
> - die("Oops - CFI", regs, 0);
> + die("Oops - CFI", regs, esr);
> break;
>
> case BUG_TRAP_TYPE_WARN:
> --
> 2.17.1
>

2023-02-20 12:39:34

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] arm64: pass ESR_ELx to die() of cfi_handler

On Mon, Feb 20, 2023 at 04:34:41PM +0900, Sangmoon Kim wrote:
> Commit 0f2cb928a154 ("arm64: consistently pass ESR_ELx to die()") caused
> all callers to pass the ESR_ELx value to die().
>
> For consistency, this patch also adds esr to die() call of cfi_handler.
> Also, when CFI error occurs, die handlers can use ESR_ELx value.

Reviewed-by: Mark Brown <[email protected]>


Attachments:
(No filename) (377.00 B)
signature.asc (488.00 B)
Download all attachments

2023-02-22 17:07:24

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64: pass ESR_ELx to die() of cfi_handler

On Mon, 20 Feb 2023 16:34:41 +0900, Sangmoon Kim wrote:
> Commit 0f2cb928a154 ("arm64: consistently pass ESR_ELx to die()") caused
> all callers to pass the ESR_ELx value to die().
>
> For consistency, this patch also adds esr to die() call of cfi_handler.
> Also, when CFI error occurs, die handlers can use ESR_ELx value.
>
>
> [...]

Applied to arm64 (for-next/core), thanks!

[1/1] arm64: pass ESR_ELx to die() of cfi_handler
https://git.kernel.org/arm64/c/b61b82f81e09

--
Catalin