[PATCH v2] powerpc/tm: Print 64-bits MSR

Christophe LEROY christophe.leroy at c-s.fr
Wed Aug 8 03:15:11 AEST 2018



Le 07/08/2018 à 15:35, Breno Leitao a écrit :
> On a kernel TM Bad thing program exception, the Machine State Register
> (MSR) is not being properly displayed. The exception code dumps a 32-bits
> value but MSR is a 64 bits register for all platforms that have HTM
> enabled.
> 
> This patch dumps the MSR value as a 64-bits value instead of 32 bits. In
> order to do so, the 'reason' variable could not be used, since it trimmed
> MSR to 32-bits (int).

reason is not always regs->msr, see get_reason(), allthough in your case 
it is.

I think it would be better to change 'reason' to 'unsigned long' instead 
of replacing it by regs->msr for the printk.

Christophe


> 
> Signed-off-by: Breno Leitao <leitao at debian.org>
> ---
>   arch/powerpc/kernel/traps.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 0e17dcb48720..cd561fd89532 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -1402,7 +1402,7 @@ void program_check_exception(struct pt_regs *regs)
>   			goto bail;
>   		} else {
>   			printk(KERN_EMERG "Unexpected TM Bad Thing exception "
> -			       "at %lx (msr 0x%x)\n", regs->nip, reason);
> +			       "at %lx (msr 0x%lx)\n", regs->nip, regs->msr);
>   			die("Unrecoverable exception", regs, SIGABRT);
>   		}
>   	}
> 


More information about the Linuxppc-dev mailing list