[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWNGgYtFDQCBOH77dec3RctjsrMQaDuYaA4Ym5Zdo5SVQ@mail.gmail.com>
Date: Thu, 6 Dec 2018 12:28:16 -0800
From: Andy Lutomirski <luto@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Lutomirski <luto@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
"Christopherson, Sean J" <sean.j.christopherson@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
LKML <linux-kernel@...r.kernel.org>,
Rik van Riel <riel@...riel.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>
Subject: Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder
some more
On Thu, Dec 6, 2018 at 12:24 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Thu, Dec 6, 2018 at 11:07 AM Andy Lutomirski <luto@...nel.org> wrote:
> >
> > How do you like the attached patch?
>
> I agree with whoever thought it's odd that "read" is in lower case
> when everything else is in upper case.
"read" isn't an actual bit in the error code, so I thought it would be
polite to make it look a little bit different. That's not a big deal,
though.
>
> And honestly, I'd just siggest making the err_text simply have the
> real user/kernel difference in it too, using something like
>
> pr_alert("#PF error: 0x%04lx%s from %s mode\n", error_code, err_txt,
> user_mode(regs) ? "user" : "kernel" );
>
> The "oh, PF_USER and user_mode differs, so let's point that out
> explicitly" thing is a good thing regardless.
Sure. Although it's extremely odd for us to OOPS from user mode, so
maybe the OOPS code in general should print a big fat warning, and
we'll just otherwise assume it was from kernel mode. (In your tree
right now, we print the wrong value for CS for OOPSes from user mode,
which is extra confusing. That's fixed in -tip.)
--Andy
Powered by blists - more mailing lists