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 <sean.j.christopher...@intel.com> Cc: "Peter Zijlstra (Intel)" <pet...@infradead.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Andy Lutomirski <l...@kernel.org> Cc: x...@kernel.org