NVIDIA / NVIDIA/open-gpu-kernel-modules

Broken build when `CONFIG_X86_PAT` is not defined

Open
#391 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build-problem NV-Triaged
Dominant language
C
Stars
17.4k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

NVIDIA Open GPU Kernel Modules Version

7c345b838b8a63126ed425781400c1ae8a7a4a1d

Operating System and Version

Ubuntu 22.04.1 LTS

Kernel Release

v5.16.0, custom configured

Build Command

make SYSSRC="/path/to/custom/kernel"

Terminal output/Build Log
$ make SYSSRC="/path/to/custom/kernel"
...
/cache/build/default-deepsea1-6/julia-computing-1/xtrx-julia/software/nvidia-driver/kernel-open/nvidia/nv-pat.c: In function ‘nv_disable_caches’:
/cache/build/default-deepsea1-6/julia-computing-1/xtrx-julia/software/nvidia-driver/kernel-open/nvidia/nv-pat.c:66:5: error: implicit declaration of function ‘__flush_tlb’; did you mean ‘__flush_tlb_all’? [-Werror=implicit-function-declaration]
   66 |     __flush_tlb();
      |     ^~~~~~~~~~~
      |     __flush_tlb_all
More Info

When compiling against a linux kernel without CONFIG_X86_PAT, this conditional enables code that uses __flush_tlb(). This function was, if I am reading the kernel source correctly, removed in Linux 5.8. This codepath should be updated to no longer use the outdated function on newer Linux kernel versions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in kernel-open/nvidia/nv-pat.c around the CONFIG_X86_PAT conditional and the nv_disable_caches call shown in the build log. Compare the referenced Linux 5.8 change with the custom kernel headers, then build with CONFIG_X86_PAT unset using the reported make command. Done means this configuration no longer fails on the outdated __flush_tlb declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.