Re: [RFC][PATCH 1/8] x86/mm: clarify hardware vs. software "error_code"
From: Andy Lutomirski
Date: Fri Sep 07 2018 - 18:48:23 EST
> On Sep 7, 2018, at 12:48 PM, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> wrote:
>
>
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> We pass around a variable called "error_code" all around the page
> fault code. Sounds simple enough, especially since "error_code" looks
> like it exactly matches the values that the hardware gives us on the
> stack to report the page fault error code (PFEC in SDM parlance).
>
> But, that's not how it works.
>
> For part of the page fault handler, "error_code" does exactly match
> PFEC. But, during later parts, it diverges and starts to mean
> something a bit different.
>
> Give it two names for its two jobs.
How hard would it be to just remove sw_error_code instead? It seems like it adds little value and much confusion.
Iâm also unconvinced that the warning is terribly useful. Weâre going to oops when this happens anyway.
Iâll rebase my diagnostic patch on top of this series after it settles.