So in case the page table got reused in the meantime, we should just back off and be fine, right?
The shared page table is mapped with a PUD entry, and we don't check whether the PUD entry changed here.
Could we simply put a PUD check in there sensibly?
A PUD check would only work if we are guaranteed that the page table will not get freed in the meantime, otherwise we might be walking garbage, trying to interpret garbage as PMDs etc.
That would require RCU freeing of page tables, which we are not guaranteed to have IIRC.
The easiest approach is probably to simply never reuse shared page tables.
If there is consensus on that I can try to see if I can make it fly easily.