Re: [PATCH v6 2/4] x86/traps: Print address on #GP

From: Andy Lutomirski
Date: Wed Dec 11 2019 - 13:17:40 EST


On Wed, Dec 11, 2019 at 9:29 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Wed, Dec 11, 2019 at 09:22:30AM -0800, Andy Lutomirski wrote:
> > Could we spare a few extra bytes to make this more readable? I can never keep track of which number is the oops count, which is the cpu, and which is the error code. How about:
> >
> > OOPS 1: general protection blah blah blah (CPU 0)
> >
> > and put in the next couple lines â#GP(0)â.
>
> Well, right now it is:
>
> [ 2.470492] general protection fault, probably for non-canonical address 0xdfff000000000001: 0000 [#1] PREEMPT SMP
> [ 2.471615] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc1+ #6
>
> and the CPU is on the second line, the error code is before the number -
> [#1] - in that case.
>
> If we pull the number in front, we can do:
>
> [ 2.470492] [#1] general protection fault, probably for non-canonical address 0xdfff000000000001: 0000 PREEMPT SMP
> [ 2.471615] [#1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc1+ #6
>
> and this way you know that the error code is there, after the first
> line's description.

Hmm, I like that.

>
> I guess we can do:
>
> [ 2.470492] [#1] general protection fault, probably for non-canonical address 0xdfff000000000001 Error Code: 0000 PREEMPT SMP
>
> to make it even more explicit...

I like this too.

>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette



--
Andy Lutomirski
AMA Capital Management, LLC