Skip to content

Kernel 7.0.0: nv-mmap.c:960:24: error: ‘VMA_LOCK_OFFSET’ undeclared #1113

@Geremia

Description

@Geremia

NVIDIA Open GPU Kernel Modules Version

595.45.04, from: https://download.nvidia.com/XFree86/Linux-x86_64/595.45.04/NVIDIA-Linux-x86_64-595.45.04.run

Operating System and Version

Slackware-current Linux (x86_64)

Kernel Release

I'm running 6.18.22, but building for 7.0.0.

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • I am running on a stable kernel release.

Build Command

NV_EXCLUDE_KERNEL_MODULES=nvidia-drm make -j64 SYSSRC=/lib/modules/7.0.0/build module

Terminal output/Build Log

nvidia/nv-imp.c: In function ‘nv_imp_get_import_data’:
nvidia/nv-imp.c:133:5: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  133 | #if IMP_SUPPORT_FUNCTIONS_PRESENT
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c:133:1: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  133 | #if IMP_SUPPORT_FUNCTIONS_PRESENT
      | ^~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c: In function ‘nv_imp_enable_disable_rfl’:
nvidia/nv-imp.c:171:5: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  171 | #if IMP_SUPPORT_FUNCTIONS_PRESENT
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c:171:1: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  171 | #if IMP_SUPPORT_FUNCTIONS_PRESENT
      | ^~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c: In function ‘nv_imp_icc_get’:
nvidia/nv-imp.c:230:5: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  230 | #if ICC_SUPPORT_FUNCTIONS_PRESENT && NV_SUPPORTS_PLATFORM_DEVICE
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c: In function ‘nv_imp_icc_put’:
nvidia/nv-imp.c:305:5: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  305 | #if ICC_SUPPORT_FUNCTIONS_PRESENT
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-imp.c: In function ‘nv_imp_icc_set_bw’:
nvidia/nv-imp.c:364:5: warning: this use of ‘defined’ may not be portable [-Wexpansion-to-defined]
  364 | #if ICC_SUPPORT_FUNCTIONS_PRESENT && NV_SUPPORTS_PLATFORM_DEVICE
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  nvidia-uvm/uvm_range_allocator.o
  CC [M]  nvidia-uvm/uvm_va_range.o
  CC [M]  nvidia-uvm/uvm_va_range_device_p2p.o
  CC [M]  nvidia-uvm/uvm_va_policy.o
  CC [M]  nvidia-uvm/uvm_va_block.o
  CC [M]  nvidia-uvm/uvm_range_group.o
  CC [M]  nvidia-uvm/uvm_gpu_replayable_faults.o
  CC [M]  nvidia-uvm/uvm_gpu_non_replayable_faults.o
  CC [M]  nvidia-uvm/uvm_gpu_access_counters.o
  CC [M]  nvidia-uvm/uvm_perf_events.o
  CC [M]  nvidia-uvm/uvm_perf_module.o
  CC [M]  nvidia-uvm/uvm_mmu.o
  CC [M]  nvidia-uvm/uvm_pte_batch.o
  CC [M]  nvidia-uvm/uvm_tlb_batch.o
  CC [M]  nvidia-uvm/uvm_push.o
  CC [M]  nvidia-uvm/uvm_pushbuffer.o
nvidia/nv-vm.c:412:11: warning: no previous prototype for ‘nv_init_page_pools’ [-Wmissing-prototypes]
  412 | NV_STATUS nv_init_page_pools(void) { return NV_OK; }
      |           ^~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:413:6: warning: no previous prototype for ‘nv_destroy_page_pools’ [-Wmissing-prototypes]
  413 | void nv_destroy_page_pools(void) {}
      |      ^~~~~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:414:14: warning: no previous prototype for ‘nv_mem_pool_alloc_pages’ [-Wmissing-prototypes]
  414 | unsigned int nv_mem_pool_alloc_pages(nv_page_pool_t *mem_pool, nv_alloc_t *at) { return 0; }
      |              ^~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:415:11: warning: no previous prototype for ‘nv_mem_pool_free_pages’ [-Wmissing-prototypes]
  415 | NV_STATUS nv_mem_pool_free_pages(nv_page_pool_t *mem_pool, nv_alloc_t *at) { return NV_OK; }
      |           ^~~~~~~~~~~~~~~~~~~~~~
  CC [M]  nvidia-uvm/uvm_tracker.o
  CC [M]  nvidia-uvm/uvm_thread_context.o
nvidia/nv-mmap.c: In function ‘nv_vma_enter_locked’:
nvidia/nv-mmap.c:960:24: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
  960 |     NvU32 tgt_refcnt = VMA_LOCK_OFFSET;
      |                        ^~~~~~~~~~~~~~~
      |                        VGA_CRTC_OFFSET
nvidia/nv-mmap.c:960:24: note: each undeclared identifier is reported only once for each function it appears in
nvidia/nv-mmap.c: In function ‘nv_vma_start_write’:
nvidia/nv-mmap.c:1012:9: error: too many arguments to function ‘__is_vma_write_locked’; expected 1, have 2
 1012 |     if (__is_vma_write_locked(vma, &mm_lock_seq))
      |         ^~~~~~~~~~~~~~~~~~~~~      ~~~~~~~~~~~~
In file included from /usr/src/linux-7.0.0/arch/x86/include/asm/uaccess.h:12,
                 from /usr/src/linux-7.0.0/include/linux/uaccess.h:13,
                 from /usr/src/linux-7.0.0/include/linux/sched/task.h:13,
                 from /usr/src/linux-7.0.0/include/linux/sched/signal.h:9,
                 from ././common/inc/nv-lock.h:33,
                 from ././common/inc/nv-linux.h:32,
                 from nvidia/nv-mmap.c:27:
/usr/src/linux-7.0.0/include/linux/mmap_lock.h:282:20: note: declared here
  282 | static inline bool __is_vma_write_locked(struct vm_area_struct *vma)
      |                    ^~~~~~~~~~~~~~~~~~~~~
  CC [M]  nvidia-uvm/uvm_turing.o
  CC [M]  nvidia-uvm/uvm_turing_ce.o
  CC [M]  nvidia-uvm/uvm_turing_access_counter_buffer.o
  CC [M]  nvidia-uvm/uvm_turing_fault_buffer.o
  CC [M]  nvidia-uvm/uvm_turing_mmu.o
nvidia/nv-mmap.c:1021:42: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
 1021 |         detached = refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt);
      |                                          ^~~~~~~~~~~~~~~
      |                                          VGA_CRTC_OFFSET
  CC [M]  nvidia-uvm/uvm_turing_host.o
  CC [M]  nvidia-uvm/uvm_turing_sec2.o
  CC [M]  nvidia-uvm/uvm_ampere.o
  CC [M]  nvidia-uvm/uvm_ampere_ce.o
  CC [M]  nvidia-uvm/uvm_ampere_host.o
make[4]: *** [/usr/src/linux-7.0.0/scripts/Makefile.build:289: nvidia/nv-mmap.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [/usr/src/linux-7.0.0/Makefile:2105: .] Error 2
make[2]: *** [/usr/src/linux-7.0.0/Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/tmp/SBo/NVIDIA-Linux-x86_64-595.45.04/kernel'
make[1]: *** [Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-7.0.0'
make: *** [Makefile:138: modules] Error 2

More Info

These are the offending lines:

#if !NV_CAN_CALL_VMA_START_WRITE
static NvBool nv_vma_enter_locked(struct vm_area_struct *vma, NvBool detaching)
{
NvU32 tgt_refcnt = VMA_LOCK_OFFSET;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions