Skip to content

Commit 18906ff

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: die(): pass 'err' as long
Recently, we reworked a lot of code to consistentlt pass ESR_ELx as a 64-bit quantity. However, we missed that this can be passed into die() and __die() as the 'err' parameter where it is truncated to a 32-bit int. As notify_die() already takes 'err' as a long, this patch changes die() and __die() to also take 'err' as a long, ensuring that the full value of ESR_ELx is retained. At the same time, die() is updated to consistently log 'err' as a zero-padded 64-bit quantity. Subsequent patches will pass the ESR_ELx value to die() for a number of exceptions. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Alexandru Elisei <alexandru.elisei@arm.com> Cc: Amit Daniel Kachhap <amit.kachhap@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20220913101732.3925290-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b502c87 commit 18906ff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/arm64/include/asm/system_misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
struct pt_regs;
2020

21-
void die(const char *msg, struct pt_regs *regs, int err);
21+
void die(const char *msg, struct pt_regs *regs, long err);
2222

2323
struct siginfo;
2424
void arm64_notify_die(const char *str, struct pt_regs *regs,

arch/arm64/kernel/traps.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ static void dump_kernel_instr(const char *lvl, struct pt_regs *regs)
180180

181181
#define S_SMP " SMP"
182182

183-
static int __die(const char *str, int err, struct pt_regs *regs)
183+
static int __die(const char *str, long err, struct pt_regs *regs)
184184
{
185185
static int die_counter;
186186
int ret;
187187

188-
pr_emerg("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
188+
pr_emerg("Internal error: %s: %016lx [#%d]" S_PREEMPT S_SMP "\n",
189189
str, err, ++die_counter);
190190

191191
/* trap and error numbers are mostly meaningless on ARM */
@@ -206,7 +206,7 @@ static DEFINE_RAW_SPINLOCK(die_lock);
206206
/*
207207
* This function is protected against re-entrancy.
208208
*/
209-
void die(const char *str, struct pt_regs *regs, int err)
209+
void die(const char *str, struct pt_regs *regs, long err)
210210
{
211211
int ret;
212212
unsigned long flags;

0 commit comments

Comments
 (0)