Patch removes all checks for pti/pcid/invpcid from the context switch path. I verified this by looking at the generated code. The invpcid_works1 trick required inline attribute for pmap_activate_sw_pcid_pti() to work.
The change requires moving of the pti and pcid_enabled initialization before ifunc resolution.
Trap.c change is mostly unrelated and just puts the PTI trap check into the same style as the SMAP trap check, also removing excessive new line from the panic message.