Re: [PATCH] x86/mm/fault: Streamline the fault error_code decoder some more
From: Linus Torvalds
Date: Thu Dec 06 2018 - 15:40:08 EST
On Thu, Dec 6, 2018 at 12:28 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> "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.
If you care about the bits in the error code, then just look at the number.
And if you care about what the numbers mean, it doesn't matter how it's encoded.
I don't think you should mix up the two concepts.
> 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.
Yeah, the "from user mode" case is generally really something horribly
bad (reserved bits being set or us screwing up LDT's etc), so yeah,
maybe a better model is indeed to point that out explicitly, the same
way the "user/kernel doesn't match U/S bit" is pointed out.
Linus