@@ -13,19 +13,6 @@ NVIDIA_UVM_OBJECTS =
1313include $(src)/nvidia-uvm/nvidia-uvm-sources.Kbuild
1414NVIDIA_UVM_OBJECTS += $(patsubst %.c,%.o,$(NVIDIA_UVM_SOURCES))
1515
16- # Some linux kernel functions rely on being built with optimizations on and
17- # to work around this we put wrappers for them in a separate file that's built
18- # with optimizations on in debug builds and skipped in other builds.
19- # Notably gcc 4.4 supports per function optimization attributes that would be
20- # easier to use, but is too recent to rely on for now.
21- NVIDIA_UVM_DEBUG_OPTIMIZED_SOURCE := nvidia-uvm/uvm_debug_optimized.c
22- NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT := $(patsubst %.c,%.o,$(NVIDIA_UVM_DEBUG_OPTIMIZED_SOURCE))
23-
24- ifneq ($(UVM_BUILD_TYPE),debug)
25- # Only build the wrappers on debug builds
26- NVIDIA_UVM_OBJECTS := $(filter-out $(NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT), $(NVIDIA_UVM_OBJECTS))
27- endif
28-
2916obj-m += nvidia-uvm.o
3017nvidia-uvm-y := $(NVIDIA_UVM_OBJECTS)
3118
@@ -36,15 +23,14 @@ NVIDIA_UVM_KO = nvidia-uvm/nvidia-uvm.ko
3623#
3724
3825ifeq ($(UVM_BUILD_TYPE),debug)
39- NVIDIA_UVM_CFLAGS += -DDEBUG -O1 -g
40- else
41- ifeq ($(UVM_BUILD_TYPE),develop)
42- # -DDEBUG is required, in order to allow pr_devel() print statements to
43- # work:
44- NVIDIA_UVM_CFLAGS += -DDEBUG
45- NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_DEVELOP
46- endif
47- NVIDIA_UVM_CFLAGS += -O2
26+ NVIDIA_UVM_CFLAGS += -DDEBUG -g
27+ endif
28+
29+ ifeq ($(UVM_BUILD_TYPE),develop)
30+ # -DDEBUG is required, in order to allow pr_devel() print statements to
31+ # work:
32+ NVIDIA_UVM_CFLAGS += -DDEBUG
33+ NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_DEVELOP
4834endif
4935
5036NVIDIA_UVM_CFLAGS += -DNVIDIA_UVM_ENABLED
@@ -56,11 +42,6 @@ NVIDIA_UVM_CFLAGS += -I$(src)/nvidia-uvm
5642
5743$(call ASSIGN_PER_OBJ_CFLAGS, $(NVIDIA_UVM_OBJECTS), $(NVIDIA_UVM_CFLAGS))
5844
59- ifeq ($(UVM_BUILD_TYPE),debug)
60- # Force optimizations on for the wrappers
61- $(call ASSIGN_PER_OBJ_CFLAGS, $(NVIDIA_UVM_DEBUG_OPTIMIZED_OBJECT), $(NVIDIA_UVM_CFLAGS) -O2)
62- endif
63-
6445#
6546# Register the conftests needed by nvidia-uvm.ko
6647#
@@ -88,6 +69,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_sva_bind_device_has_drvdata_arg
8869NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_fault_to_errno
8970NV_CONFTEST_FUNCTION_COMPILE_TESTS += find_next_bit_wrap
9071NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_is_dma_domain
72+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += folio_test_swapcache
9173
9274NV_CONFTEST_TYPE_COMPILE_TESTS += backing_dev_info
9375NV_CONFTEST_TYPE_COMPILE_TESTS += mm_context_t
0 commit comments