powerpc64: Print current MSR on printtrap()

Summary:
Print current MSR on printtrap(). Currently, printtrap just prints srr1, which
contains part of the MSR prior to the exception. I find useful to dump the
current value of the MSR, since it changes when there is an interruption.

With this patch, this is the new printtrap model:

handled user trap:

    exception       = 0x700 (program)
    srr0            = 0x100008a0 (0x100008a0)
    srr1            = 0x800000000002f032
    current msr     = 0x8000000000009032
    lr              = 0x1000089c (0x1000089c)
    curthread       = 0x7a50000
	pid = 714, comm = ttrap2

Submitted by:	Breno Leitao
Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D14600
This commit is contained in:
jhibbits 2018-04-08 16:55:28 +00:00
parent d2fa342f26
commit 2dbc3fb187

View File

@ -507,6 +507,7 @@ printtrap(u_int vector, struct trapframe *frame, int isfatal, int user)
printf(" srr0 = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n",
frame->srr0, frame->srr0 - (register_t)(__startkernel - KERNBASE));
printf(" srr1 = 0x%lx\n", (u_long)frame->srr1);
printf(" current msr = 0x%" PRIxPTR "\n", mfmsr());
printf(" lr = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n",
frame->lr, frame->lr - (register_t)(__startkernel - KERNBASE));
printf(" curthread = %p\n", curthread);