Repository Analysis

NVIDIA/open-gpu-kernel-modules

NVIDIA Linux open GPU kernel module source

6.0 Low AI signal View on GitHub
6.0
Adjusted Score
6.0
Raw Score
100%
Time Factor
2026-05-27
Last Push
17,048
Stars
C
Language
1,491,799
Lines of Code
3337
Files
11187
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 4MEDIUM 26LOW 11157

Pattern Findings

11187 matches across 10 categories. Click a row to expand file-level details.

Over-Commented Block11107 hits · 8712 pts
SeverityFileLineSnippet
LOWnv-compiler.sh1#!/bin/sh
LOWkernel-open/conftest.sh41 # sufficient to check for CONFIG_XEN, but the introduction of
LOWkernel-open/conftest.sh61 while read LINE; do
LOWkernel-open/conftest.sh181 # Older kernels perform this check and set this flag in Kbuild, and since
LOWkernel-open/conftest.sh221 #include <linux/kconfig.h>
LOWkernel-open/conftest.sh501 # Determine if the set_memory_uc() function is present.
LOWkernel-open/conftest.sh521 ;;
LOWkernel-open/conftest.sh581
LOWkernel-open/conftest.sh601 }"
LOWkernel-open/conftest.sh621 #include <linux/percpu.h>
LOWkernel-open/conftest.sh741 ;;
LOWkernel-open/conftest.sh781 # Determine if mdev_get_type_group_id() function is present or not
LOWkernel-open/conftest.sh801 # Determine if vfio_device_mig_state enum is present or not
LOWkernel-open/conftest.sh881 # Determine if the struct mdev_parent_ops type is present.
LOWkernel-open/conftest.sh901 #
LOWkernel-open/conftest.sh921 # Removed by commit 062e720cd20 ("vfio/mdev: remove
LOWkernel-open/conftest.sh941 CODE="
LOWkernel-open/conftest.sh1041 # Determine if 'vfio_device_ops' struct has 'dma_unmap' field.
LOWkernel-open/conftest.sh1081 #include <linux/pci.h>
LOWkernel-open/conftest.sh1141 compile_check_conftest "$CODE" "NV_IRQ_BYPASS_PRODUCER_HAS_TOKEN" "" "types"
LOWkernel-open/conftest.sh1281 #if defined(NV_LINUX_VFIO_PCI_CORE_H_PRESENT)
LOWkernel-open/conftest.sh1381 compile_check_conftest "$CODE" "NV_GET_DEV_PAGEMAP_HAS_PGMAP_ARG" "" "types"
LOWkernel-open/conftest.sh1541 drm_driver_has_legacy_dev_list)
LOWkernel-open/conftest.sh1581
LOWkernel-open/conftest.sh1601
LOWkernel-open/conftest.sh1621 CODE="
LOWkernel-open/conftest.sh1801 #
LOWkernel-open/conftest.sh1981 # Determine if FOLL_LONGTERM enum is present or not
LOWkernel-open/conftest.sh2101
LOWkernel-open/conftest.sh2181 # Determine if vma.vm_ops.fault takes (vma, vmf), or just (vmf)
LOWkernel-open/conftest.sh2261 rm -f conftest$$.o
LOWkernel-open/conftest.sh2301 else
LOWkernel-open/conftest.sh2401 drm_helper_mode_fill_fb_struct(NULL, NULL, NULL, NULL);
LOWkernel-open/conftest.sh2421 #
LOWkernel-open/conftest.sh2461 #
LOWkernel-open/conftest.sh2481 #
LOWkernel-open/conftest.sh2561 ;;
LOWkernel-open/conftest.sh2581 #include <drm/drm_blend.h>
LOWkernel-open/conftest.sh2621 drm_connector_for_each_possible_encoder)
LOWkernel-open/conftest.sh2701 # Added by commit d56c0d45f0e2 ("proc: decouple proc from VFS
LOWkernel-open/conftest.sh2841 pci_enable_atomic_ops_to_root)
LOWkernel-open/conftest.sh2961 # pci_channel_state was removed by commit 16d79cd4e23b ("PCI: Use
LOWkernel-open/conftest.sh3001 #if defined(NV_LINUX_CC_PLATFORM_H_PRESENT)
LOWkernel-open/conftest.sh3081 drm_crtc_atomic_check_has_atomic_state_arg)
LOWkernel-open/conftest.sh3121 # argument of 'struct dma_buf_map' type.
LOWkernel-open/conftest.sh3161 #
LOWkernel-open/conftest.sh3181 # by commit 233eb0bf3b94 ("mm: remove follow_pfn")
LOWkernel-open/conftest.sh3261 #
LOWkernel-open/conftest.sh3321
LOWkernel-open/conftest.sh3381 #
LOWkernel-open/conftest.sh3581 # Determine if the migrate_device_range() function is present
LOWkernel-open/conftest.sh3601 #
LOWkernel-open/conftest.sh3621 #
LOWkernel-open/conftest.sh3661 (void)foo.no_vblank;
LOWkernel-open/conftest.sh3721 #
LOWkernel-open/conftest.sh3821 # Added by commit 1224451bb6f93 ("PM / devfreq: Register devfreq as a cooling device
LOWkernel-open/conftest.sh3881
LOWkernel-open/conftest.sh3901
LOWkernel-open/conftest.sh3961 #
LOWkernel-open/conftest.sh3981 # Note: the include directive for <linux/types> in this conftest is
11047 more matches not shown…
AI Slop Vocabulary19 hits · 57 pts
SeverityFileLineSnippet
MEDIUMkernel-open/nvidia/nv-dma.c722 // ops can be NULL on 5.0+ kernels, meaning we can utilize direct dma.
MEDIUMkernel-open/nvidia-uvm/uvm_ce_test.c1104 // CPU decryption(s), but it is more robust against test changes to force
MEDIUMkernel-open/nvidia-uvm/uvm_gpu.h1119 // Bug 4577236 outlines the issue. Essentially normal eviction of coherent
MEDIUMkernel-open/nvidia-uvm/uvm_sec2_test.c463 // CPU decryption(s), but it is more robust against test changes to force
MEDIUMkernel-open/nvidia-uvm/uvm_gpu_semaphore.c806 // recent addition to the kernel, just leverage smp_mb__after_atomic() that
MEDIUMsrc/common/nvswitch/kernel/lr10/clock_lr10.c138 // Unfortunately, we don't have a full robust infrastructure for detecting the
MEDIUMsrc/nvidia/src/libraries/containers/eheap/eheap_old.c195 // Form the list of free mem structures. Just need to utilize the next field of EMEMBLOCK.
MEDIUMsrc/nvidia/src/kernel/mem_mgr/gpu_vaspace.c696 // RM would need internal CE support (e.g. leverage ECC scrubber)
MEDIUMsrc/nvidia/src/kernel/gpu/mem_mgr/sem_surf.c1093 // it to ensure using it in the future (E.g., for robust channel error
MEDIUMsrc/nvidia/src/kernel/gpu/mem_mgr/sem_surf.c1255 // it to ensure using it in the future (E.g., for robust channel error
MEDIUM…ia/src/kernel/gpu/mem_mgr/arch/maxwell/mem_mgr_gm107.c2080 // I.e. refactor and leverage the code performing these tasks
MEDIUMsrc/nvidia/src/kernel/gpu/spdm/arch/hopper/spdm_gh100.c832 // If we haven't established the session yet, we need to utilize polling
MEDIUMsrc/nvidia/src/kernel/gpu/mmu/gmmu_walk.c910 // debug print - to remove when the code is robust enough
MEDIUMsrc/nvidia/src/kernel/gpu/mig_mgr/kernel_mig_manager.c6650 //TODO: Remove below code once a more robust SRT is available to test for this condition
MEDIUM…nvidia/src/kernel/gpu/ce/arch/hopper/kernel_ce_gh100.c948 // In the self hosted case, utilize table entries
MEDIUM…nvidia/src/kernel/gpu/rc/kernel_rc_watchdog_callback.c186 // Do nothing if robust channels are not enabled
MEDIUM…nvidia/src/kernel/gpu/rc/kernel_rc_watchdog_callback.c242 // Handle robust channel testing, if necessary.
MEDIUMsrc/nvidia/src/kernel/gpu/rc/kernel_rc.c88 // Force uncached pushbuffers for robust channel.
MEDIUMsrc/nvidia/src/kernel/gpu/rc/kernel_rc.c93 // with the robust channel, and ended up requesting sizeof(RC + pushbuffer)
Verbosity Indicators32 hits · 48 pts
SeverityFileLineSnippet
LOWkernel-open/nvidia-uvm/uvm_gpu.c775 // procfs_files are created before gpu_init_isr, we need to check if the
LOWkernel-open/nvidia-uvm/uvm_va_block.c6362 // Step 1: Make the 2M entry invalid. We can't directly transition from a
LOWkernel-open/nvidia-uvm/uvm_va_block.c6388 // Step 2: Switch the 2M entry from invalid to a PDE. This activates the
LOW…c/common/nvlink/kernel/nvlink/core/nvlink_initialize.c65 // Step 1: Perform INITPHASE1 on all endpoints
LOW…c/common/nvlink/kernel/nvlink/core/nvlink_initialize.c319 // Step 1: Perform INITPHASE1 on all endpoints
LOW…c/common/nvlink/kernel/nvlink/core/nvlink_initialize.c379 // Step 3: Enable Common mode on all Tx's
LOW…c/common/nvlink/kernel/nvlink/core/nvlink_initialize.c405 // Step 4: call INITPHASE5
LOW…c/common/nvlink/kernel/nvlink/core/nvlink_initialize.c431 // Step 5: Put the links in SAFE mode
LOWsrc/common/displayport/src/dp_connectorimpl.cpp1815 // we need to check if we have enough BW for the stream on FRL link.
LOWsrc/common/displayport/src/dp_connectorimpl.cpp4322 // Step 1: Setup PCON for later operation
LOWsrc/common/displayport/src/dp_connectorimpl.cpp4354 // Step 2: Assess FRL Link capability.
LOWsrc/common/displayport/src/dp_connectorimpl.cpp4436 // Step 3: Assess DP Link capability.
LOWsrc/common/displayport/src/dp_configcaps.cpp2500 // Step 1: Configure FRL Link (FRL BW, BW mask / Concurrent)
LOWsrc/common/nvswitch/kernel/lr10/lr10.c6193 // Step 0 :
LOWsrc/common/nvswitch/kernel/lr10/lr10.c6242 // Step 1 : Perform surgical reset
LOWsrc/common/nvswitch/kernel/lr10/lr10.c6313 // Step 2 : Assert NPORT Reset after Control & Drain routine.
LOWsrc/common/nvswitch/kernel/lr10/lr10.c6377 // Step 3 : Restore link state
LOWsrc/common/nvswitch/kernel/cci/cables/cci_common.c1451 * The purpose of this function is to provide a trace
LOWsrc/nvidia/arch/nvalloc/unix/src/unix_intr.c248 // Step 1: Check if we can service nonstall interrupts outside the GPUs lock. Otherwise
LOWsrc/nvidia/arch/nvalloc/unix/src/unix_intr.c284 // Step 2: Service nonstall interrupts and check if there are any stall interrupts
LOW…nel/gpu/mem_mgr/arch/hopper/virt_mem_allocator_gh100.c74 // Step 1:
LOW…nel/gpu/mem_mgr/arch/hopper/virt_mem_allocator_gh100.c84 // Step 2:
LOW…nel/gpu/mem_mgr/arch/hopper/virt_mem_allocator_gh100.c103 // Step 3:
LOW…nvidia/src/kernel/gpu/mmu/arch/volta/kern_gmmu_gv100.c348 // Step 1: Unregister(vas) --> UnsetPageDirectory(vas)
LOW…nvidia/src/kernel/gpu/mmu/arch/volta/kern_gmmu_gv100.c349 // Step 2: FreeSubcontext(vas)
LOW…nvidia/src/kernel/gpu/ce/arch/ampere/kernel_ce_ga100.c524 // So, we need to check if the FBHUB PCEs have already been assigned.
LOWsrc/nvidia/src/kernel/gpu/rc/kernel_rc_watchdog.c258 // Step 1: check for conflicting requests, and bail out without changing
LOWsrc/nvidia/src/kernel/gpu/rc/kernel_rc_watchdog.c290 // Step 2: if client state has changed, adjust the per-GPU/RC refcount:
LOWsrc/nvidia/src/kernel/gpu/rc/kernel_rc_watchdog.c318 // Step 3: record client state:
LOWsrc/nvidia/src/kernel/gpu/rc/kernel_rc_watchdog.c324 // Step 4: if per-GPU/RC refcount has changed from 0 to 1, then change the
LOWsrc/nvidia/src/kernel/rmapi/alloc_free.c1008 // so we need to check if Device has the same OBJGPU.
LOWsrc/nvidia/src/kernel/rmapi/nv_gpu_ops.c3588 // is that it is indeed supported, we need to check if the link has
Synthetic Comment Markers4 hits · 30 pts
SeverityFileLineSnippet
HIGHsrc/nvidia/src/kernel/gpu/nvlink/kernel_nvlink.c3025 // For the transfer direction pLocalGpu->pRemoteGpu, update the new key for Tx or Rx as requested
HIGHsrc/nvidia/src/kernel/gpu/nvlink/kernel_nvlink.c3030 // For the transfer direction pRemoteGpu->pLocalGpu, update the new key for Tx or Rx as requested
HIGHsrc/nvidia/src/kernel/gpu/mig_mgr/kernel_mig_manager.c5971 // set GPCs as requested
HIGHsrc/nvidia-modeset/src/nvkms-evo.c9163 // as requested.
Redundant / Tautological Comments12 hits · 18 pts
SeverityFileLineSnippet
LOWkernel-open/conftest.sh180 # Check if gcc supports asm goto and set CC_HAVE_ASM_GOTO if it does.
LOWkernel-open/conftest.sh351 # Check if any of the linuxkpi or drm kernel module files contain
LOWkernel-open/conftest.sh416 # Print the value of given configuration option, if defined
LOWkernel-open/conftest.sh709 # Check if vfio_info_add_capability() has cap_type_id parameter.
LOWkernel-open/conftest.sh3346 # Check if add_memory_driver_managed() has mhp_flags arg.
LOWkernel-open/conftest.sh3364 # Check if remove_memory() has nid parameter.
LOWkernel-open/conftest.sh4110 # Check if iommu_sva_bind_device() has drvdata parameter.
LOWkernel-open/conftest.sh4188 # Check if memory_failure_queue() has trapno parameter.
LOWkernel-open/conftest.sh4206 # Check if memory_failure() flag MF_SW_SIMULATED is defined.
LOWkernel-open/conftest.sh5238 # Check if the selected compiler can create object files
LOWkernel-open/conftest.sh5384 # Check if the target kernel is a Xen kernel. If so, exit, since
LOWkernel-open/conftest.sh5416 # Check if the target kernel has the PREEMPT_RT patch set applied. If
Self-Referential Comments6 hits · 18 pts
SeverityFileLineSnippet
MEDIUMnouveau/extract-firmware-nouveau.py429# Create a 32-bit generic ELF header with no program header, and 'shnum'
MEDIUMnouveau/extract-firmware-nouveau.py445# Create a 32-bit ELF section header, where 'sh_name' is the offset of the
MEDIUMnouveau/extract-firmware-nouveau.py467# Create a 64-bit .shstrtab ELF section header.
MEDIUMnouveau/extract-firmware-nouveau.py558 # Create the ELF header
MEDIUMnouveau/extract-firmware-nouveau.py666# Create a symlink, deleting the existing file/link if necessary
MEDIUMnouveau/extract-firmware-nouveau.py727# Create a text file that can be inserted as-is to the WHENCE file of the
Slop Phrases3 hits · 4 pts
SeverityFileLineSnippet
LOWkernel-open/pahole.sh42# make sure to exclude c++ when generating encoding BTF.
LOWkernel-open/common/inc/rs_access.h54// When adding a new access right, don't forget to update
LOWsrc/common/sdk/nvidia/inc/rs_access.h51// When adding a new access right, don't forget to update
Hyper-Verbose Identifiers2 hits · 2 pts
SeverityFileLineSnippet
LOWnouveau/extract-firmware-nouveau.py473def elf_section_header_shstrtab(sh_name, shnum, sh_size):
LOWsrc/nvidia/arch/nvalloc/unix/src/rmobjexportimport.c65// generated by function RmGenerateObjExportHandle().
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWsrc/nvidia/inc/kernel/core/bin_data.h158// Example usage:
Excessive Try-Catch Wrapping1 hit · 1 pts
SeverityFileLineSnippet
MEDIUMnouveau/extract-firmware-nouveau.py1006 print(f"Error: {e}", file=sys.stderr)