The nouveau page table has dual page tables with special states for tracking small vs large pages at the bottom level. However the current code isn't designed with the higher level large page support in mind.
The nouveau_uvmm/gpuvm code can cause unrefs to get delayed, so things like ref SPT, map SPT, unmap SPT, ref LPT, map LPT, unref SPT can happen. unrefs can end up quite delayed and it shouldn't matter as unref should just affect reference counts. However at least the SPT unref path was overwriting the LPT value when all SPT were unreffed even if an LPT was referenced in between. This series refactors the code to use a union, then increases the size as I think even with the current code there was enough ref counts for SPTE. The last patch adds LPTE tracking. Dave.
