The high-level description, along with the set of hardware things that get mapped into both kernel/app page tables are basically identical. Creating that list of things was painful, at least for me while I was getting KAISER working. If I were in their position I definitely would have leveraged the list of things that we found in the Linux work. I hope they were able to do that.
Some minor differences in the implementations: In Linux, we allocate the two top-level page tables next to each other so we can just flip a bit to switch, and in the OpenBSD commit they seem to be allocating them separately and then storing the two pointers in a per-cpu data structure. Both are fine ways to do it.
I don't see anything like the Linux "espfix" mechanism. Guess there isn't one.
The BTS/PEBS buffers seem missing. This hardware may just not be supported.
Could you elaborate on "we allocate the two top-level page tables next to each other so we can just flip a bit to switch"?
We can still do this with KPTI because despite having two page tables, the kernel still continues to map all of userspace.
BTW, the bit flipping is pretty much
// Allocate 8k which is also 8k aligned: pgd = alloc_pages(PAGE_SIZE*2);
That allocates something which might go from (physical address) 0x12340000->12360000. The first top-level pagetable is at 0x12340000 (for the kernel) and the second is at 0x12341000 (for running userspace).
So, when you leave the kernel you just set a bit in your CR3 register (well, you do it in assembly, but here it is logically in C):
write_cr3(read_cr3() | 0x1000); // 0x12340000 -> 0x12341000
When you come back in to the kernel you clear the bit:
write_cr3(read_cr3() & ~0x1000); // 0x12341000 -> 0x12340000
(I'm not saying those advantages might outweigh the disadvantages, just speculating on the pros and cons!)
I asked an honest question, made no statements to which I can imagine people disagreeing with, and went out of my way to make sure it couldn't be taken in a bad way...
It would be like telling a mugging victim: "Hey, at least now you can justify buying a new purse!"