BUG: kernel driver (nv_pat.c) fails to build against recent kernels when NV_ENABLE_BUILTIN_PAT_SUPPORT is set

Two functions in kernel/nvidia/nv_pat.c, nv_disable_caches() and nv_enable_caches(), attempt to invoke __flush_tlb() from <asm/tlbflush.h>. However, that macro was removed almost two years ago by x86/tlb: Move __flush_tlb() out of line · torvalds/linux@2faf153 · GitHub .

This code path is only enabled when NV_ENABLE_BUILTIN_PAT_SUPPORT is true, which will only happen on x86_64, and only when the kernel was built without CONFIG_X86_PAT, and either with CONFIG_PARAVIRT or without CONFIG_XEN. (cf. NV_XEN_SUPPORT_FULLY_VIRTUALIZED_KERNEL in the driver’s kernel/common/inc/nv-linux.h). I guess this configuration is not part of NVidia’s otherwise undoubtedly comprehensive CI test coverage.

This defect appears to be present in all 470.x and 495.x drivers.