Skip to content

x86/mm: page fault handling cleanups

Dave Hansen lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 3 repliesIn review
  2. v1 RFC8 patches 16 repliesSuperseded

Changes in v2 from the cover letter

* Take "space_" out of do_kern/user_addr_fault()
* Make "bad fault" comment in do_kern_addr_fault() less scary
* Add clarifying comment for the conditions under which do_kern_addr_fault() is called.
* Remove mention of hw_error_code in search_exception_tables() comment.
* Clarify that the exception tables spell out individual instructions, not larger sections of code.
* Use PAGE_MASK in is_vsyscall_vaddr()
* Add some additional reasoning behind the code move when moving the vsyscall handling to user address space handler
* Remove hard-coded ~0xfff and replace with PAGE_MASK

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8x86/mm: clarify hardware vs. software "error_code"arch/x86/mm/fault.c+52 -250 replies
2/8x86/mm: break out kernel address space handlingarch/x86/mm/fault.c+62 -390 replies
3/8x86/mm: break out user address space handlingarch/x86/mm/fault.c+28 -192 replies
4/8x86/mm: add clarifying comments for user addr spacearch/x86/mm/fault.c+8 -00 replies
5/8x86/mm: fix exception table commentsarch/x86/mm/fault.c+15 -130 replies
6/8x86/mm: add vsyscall address helperarch/x86/mm/fault.c+10 -10 replies
7/8x86/mm/vsyscall: consider vsyscall page part of user address spacearch/x86/mm/fault.c+25 -130 replies
8/8x86/mm: remove spurious fault pkey checkarch/x86/mm/fault.c+7 -60 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeter Zijlstra (Intel)
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 0/8] [v2] x86/mm: page fault handling cleanups

Changes from v1:
* Take "space_" out of do_kern/user_addr_fault()
* Make "bad fault" comment in do_kern_addr_fault() less scary
* Add clarifying comment for the conditions under which do_kern_addr_fault() is called.
* Remove mention of hw_error_code in search_exception_tables() comment.
* Clarify that the exception tables spell out individual instructions, not larger sections of code.
* Use PAGE_MASK in is_vsyscall_vaddr()
* Add some additional reasoning behind the code move when moving the vsyscall handling to user address space handler
* Remove hard-coded ~0xfff and replace with PAGE_MASK

---

I went trying to clean up the spurious protection key checks. But, I got distracted by some other warts in the code. I hope this makes things more comprehendable with some improved structure, commenting and naming.

We come out the other side of it with a new warning in for pkey faults in the kernel portion of the address space, and removal of some dead pkeys code, but no other functional changes.

There is a potential impact from moving the vsyscall emulation. But, this does pass the x86 selftests without any fuss.

Cc Sean Christopherson <[email protected]>
Cc "Peter Zijlstra (Intel)" <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Jann Horn <[email protected]>