Files
nvdriver/kernel-open/Kbuild
Eric Hartford c553930fd7 wave 1: kernel/ARM64/Clang/DKMS compat, IOMMU/PCI lifecycle, and RMAPI/UVM isolation
Proactive 100% parity Wave 1 (REA-grounded vs stock 580.178.04):
- Kernel/build compat: Kbuild header probes for timer_delete_sync, vm_flags_set,
  vma_flags_set_word; remove broken UTS_UBUNTU_RELEASE_ABI guard on
  pci_resize_resource; guard x86 set_memory_uc/wb under CONFIG_X86; remove
  illegal ARM64 dma_sync_single_* on coherent DMA; gate nvidia_rs_drm on
  CONFIG_DRM; default LD=ld.lld/OBJCOPY=llvm-objcopy under LLVM=1; fix dkms.conf
  (KDIR support, all 4 modules, 0.2.0) and install.sh (all 4 modules, non-0000
  PCI domains, KREL override).
- IOMMU & PCI lifecycle: switch gsp_route error notifier to per-device DMA
  (nv_rs_rmapi_os_page_dma); add PCI .shutdown (pci_clear_master + udelay(1))
  and AER .err_handler; keep freed rmapi_allocs on list until users==0 for
  hot-unplug DMA teardown; drain nv_rs_uvm_cpu_dma_ht on exit; lock BAR0 fill
  under p->access; raise MAX_BRIDGE_GPUS to 32.
- Security & isolation (REA _nv000655rm / _nv000663rm): enforce cross-process
  share policy on NV_ESC_RM_DUP_OBJECT & NV_ESC_RM_SHARE; refcount shared memory
  backings on release (eliminating dup UAF); scope UVM ManagedFaultMapper by
  faulting GPU & SysmemPageTree.owner; pass real task_tgid_vnr into Caller.pid.
2026-12-01 16:16:09 +00:00

43 lines
2.6 KiB
Makefile

# Diagnostic module only. Deliberately does not produce NVIDIA driver names.
# exclude_bars arrived in 6.19 and was backported earlier (6.18 stable). Key off
# the declaration, the same way PCI_IRQ_INTX is keyed off the macro.
NV_RS_PCI_H := $(srctree)/include/linux/pci.h
ifeq ($(shell grep -A2 -E 'pci_resize_resource' $(NV_RS_PCI_H) 2>/dev/null | grep -q exclude_bars && echo y),y)
ccflags-y += -DNV_RS_PCI_RESIZE_EXCLUDE_BARS
endif
NV_RS_TIMER_H := $(srctree)/include/linux/timer.h
ifeq ($(shell grep -q 'timer_delete_sync' $(NV_RS_TIMER_H) 2>/dev/null && echo y),y)
ccflags-y += -DNV_RS_HAVE_TIMER_DELETE_SYNC
endif
NV_RS_MM_H := $(srctree)/include/linux/mm.h
ifeq ($(shell grep -q 'vm_flags_set' $(NV_RS_MM_H) 2>/dev/null && echo y),y)
ccflags-y += -DNV_RS_HAVE_VM_FLAGS_SET
endif
ifeq ($(shell grep -q 'vma_flags_set_word' $(NV_RS_MM_H) 2>/dev/null && echo y),y)
ccflags-y += -DNV_RS_HAVE_VMA_FLAGS_SET_WORD
endif
obj-m += nvidia_rs.o nvidia_rs_modeset.o nvidia_rs_peermem.o
ifneq ($(CONFIG_DRM),)
obj-m += nvidia_rs_drm.o
endif
nvidia_rs_modeset-y := nvidia-modeset/nvidia_rs_modeset.o
nvidia_rs_drm-y := nvidia-drm/nvidia_rs_drm.o
nvidia_rs_peermem-y := nvidia-peermem/nvidia_rs_peermem.o
nvidia_rs-y := nvidia/diagnostic.o nvidia/rmapi_node.o nvidia/uvm_node.o nvidia/uvm_iface_exports.o nvidia/modeset_iface_exports.o nvidia/pci_driver.o nvidia/gpu_owner.o nvidia/pci_adapter.o nvidia/ga10x_adapter.o nvidia/dma_adapter.o nvidia/dmabuf_p2p.o nvidia/hwmon_adapter.o nvidia/irq_adapter.o nvidia/clock_adapter.o nvidia/clock_store_adapter.o nvidia/registry_adapter.o nvidia/software_manager_adapter.o nvidia/nano_timer_adapter.o nvidia/event_work_adapter.o nvidia/scheduling_adapter.o nvidia/thread_adapter.o nvidia/thread_state_adapter.o nvidia/memory_copy.o nvidia/rom_buffer.o nvidia/rom_fw_adapter.o nvidia/rom_acpi_adapter.o nvidia/rust-core.o
# Record Kbuild command metadata for modpost, as with shipped binary objects.
# Kernels with CONFIG_DEBUG_INFO_BTF encode the linked module with pahole, which
# cannot recode rustc's DWARF: it fails with "tag__recode_dwarf_type: couldn't
# find ... (inlined_subroutine)". Strip the Rust object's debug info there; code,
# relocations and the exported interface are unchanged. Without BTF keep it, so
# CONFIG_DEBUG_INFO kernels still have the Rust frames for kgdb.
ifeq ($(CONFIG_DEBUG_INFO_BTF),y)
quiet_cmd_rustcopy = RUSTOBJ $@
cmd_rustcopy = $(OBJCOPY) --strip-debug $< $@
else
quiet_cmd_rustcopy = RUSTOBJ $@
cmd_rustcopy = cp $< $@
endif
targets += nvidia/rust-core.o
$(obj)/nvidia/rust-core.o: $(src)/nvidia/nv-rust.o_binary FORCE
$(call if_changed,rustcopy)