Thread (9 messages) flat view 9 messages, 5 authors, 2018-10-04

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

From: Breno Leitao <leitao@debian.org>
Date: 2018-08-07 18:41:55

Hi,

On 08/07/2018 02:15 PM, Christophe LEROY wrote:
Le 07/08/2018 à 15:35, Breno Leitao a écrit :
quoted
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.
That was my initial approach, but this code seems to run on 32 bits system,
and I do not want to change the whole 'reason' bit width without having a 32
bits to test, at least.

Also, it is a bit weird doing something as:

	printk("....(msr 0x%lx)....", reason);

I personally think that the follow code is much more readable:

	printk(".... (msr 0x%lx)...", regs->msr);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help