Re: [PATCH v2 1/6] riscv/mm/fault: simplify code for do_page_fault()

Palmer Dabbelt
2023-03-15T05:09:12Z

On Tue, 14 Mar 2023 22:02:37 PDT (-0700), willy@infradead.org wrote:
> On Tue, Mar 14, 2023 at 08:03:54PM -0700, Palmer Dabbelt wrote:
>> To make the code more hierarchical and readable, we fold vma related
>> judgments into __do_page_fault(). And to simplify the code, move the
>> tsk->thread.bad_cause's setting into bad_area(). No functional change
>> intended.
>
> I think this is exaactly the wrong thing to be doing. Please _stop_
> using custom internal VM_FAULT flags, not adding new uses!

I'm fine with that. The rest of the patch set was to chunk out a few to
avoid them stepping on generic stuff, but we don't really need that in
RISC-V land (aside from this, which is sort of a mixed bag WRT whether
this is simpler or not). That's sort of why I held off on merging this
in the first place.

That said, the follow-on patches do clean up some mixing between generic
and arch codes for other ports. I'm not sure if those can manifest as a
real bug or not.