Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 693704 | Differences between
and this patch

Collapse All | Expand All

(-)a/kernel/Makefile (+3 lines)
Lines 108-119 COMPILE_TESTS = \ Link Here
108
	acquire_console_sem \
108
	acquire_console_sem \
109
	console_lock \
109
	console_lock \
110
	kmem_cache_create \
110
	kmem_cache_create \
111
	kmem_cache_create_usercopy \
111
	outer_flush_all \
112
	outer_flush_all \
112
	on_each_cpu \
113
	on_each_cpu \
113
	smp_call_function \
114
	smp_call_function \
114
	nvmap_support \
115
	nvmap_support \
115
	acpi_evaluate_integer \
116
	acpi_evaluate_integer \
116
	ioremap_cache \
117
	ioremap_cache \
118
	ioremap_nocache \
117
	ioremap_wc \
119
	ioremap_wc \
118
	proc_dir_entry \
120
	proc_dir_entry \
119
	INIT_WORK \
121
	INIT_WORK \
Lines 122-127 COMPILE_TESTS = \ Link Here
122
	pci_domain_nr \
124
	pci_domain_nr \
123
	pci_dma_mapping_error \
125
	pci_dma_mapping_error \
124
	file_operations \
126
	file_operations \
127
	proc_ops \
125
	sg_alloc_table \
128
	sg_alloc_table \
126
	sg_init_table \
129
	sg_init_table \
127
	pci_get_domain_bus_and_slot \
130
	pci_get_domain_bus_and_slot \
(-)a/kernel/conftest.sh (+41 lines)
Lines 914-919 compile_test() { Link Here
914
            fi
914
            fi
915
        ;;
915
        ;;
916
916
917
        kmem_cache_create_usercopy)
918
            #
919
            # Determine if the kmem_cache_create_usercopy function exists.
920
            #
921
            # This function was added by:
922
            #   2017-06-10  8eb8284b412906181357c2b0110d879d5af95e52
923
            CODE="
924
            #include <linux/slab.h>
925
            void kmem_cache_create_usercopy(void) {
926
                kmem_cache_create_usercopy();
927
            }"
928
929
            compile_check_conftest "$CODE" "NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT" "" "functions"
930
        ;;
931
917
        smp_call_function)
932
        smp_call_function)
918
            #
933
            #
919
            # Determine if the smp_call_function() function is
934
            # Determine if the smp_call_function() function is
Lines 1188-1193 compile_test() { Link Here
1188
            compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
1203
            compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
1189
        ;;
1204
        ;;
1190
1205
1206
        ioremap_nocache)
1207
            #
1208
            # Determine if the ioremap_nocache() function is present.
1209
            #
1210
            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
1211
            # devm_ioremap_nocache") in v5.6 (2020-01-06)
1212
            #
1213
            CODE="
1214
            #include <asm/io.h>
1215
            void conftest_ioremap_nocache(void) {
1216
                ioremap_nocache();
1217
            }"
1218
1219
            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
1220
        ;;
1221
1191
        ioremap_wc)
1222
        ioremap_wc)
1192
            #
1223
            #
1193
            # Determine if the ioremap_wc() function is present.
1224
            # Determine if the ioremap_wc() function is present.
Lines 1371-1376 compile_test() { Link Here
1371
            compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
1402
            compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
1372
        ;;
1403
        ;;
1373
1404
1405
        proc_ops)
1406
            CODE="
1407
            #include <linux/proc_fs.h>
1408
            int conftest_proc_ops(void) {
1409
                return offsetof(struct proc_ops, proc_open);
1410
            }"
1411
1412
            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
1413
        ;;
1414
1374
        sg_init_table)
1415
        sg_init_table)
1375
            #
1416
            #
1376
            # Determine if the sg_init_table() function is present.
1417
            # Determine if the sg_init_table() function is present.
(-)a/kernel/dkms.conf (-1 / +7 lines)
Lines 1-7 Link Here
1
if [ -x /usr/bin/nproc ]; then
2
  num_cpu_cores=$(nproc)
3
else
4
  num_cpu_cores=1
5
fi
6
1
PACKAGE_NAME="nvidia"
7
PACKAGE_NAME="nvidia"
2
PACKAGE_VERSION="340.108"
8
PACKAGE_VERSION="340.108"
3
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
9
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
4
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
10
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
5
MAKE[0]="make module KERNEL_UNAME=${kernelver}"
11
MAKE[0]="make -j$num_cpu_cores module KERNEL_UNAME=${kernelver}"
6
CLEAN="make clean"
12
CLEAN="make clean"
7
AUTOINSTALL="yes"
13
AUTOINSTALL="yes"
(-)a/kernel/nv-drm.c (+54 lines)
Lines 50-55 Link Here
50
#if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
50
#if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
51
#define nv_drm_pci_init drm_legacy_pci_init
51
#define nv_drm_pci_init drm_legacy_pci_init
52
#define nv_drm_pci_exit drm_legacy_pci_exit
52
#define nv_drm_pci_exit drm_legacy_pci_exit
53
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
54
int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
55
{
56
	struct pci_dev *pdev = NULL;
57
	const struct pci_device_id *pid;
58
	int i;
59
60
	DRM_DEBUG("\n");
61
62
	if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
63
		return -EINVAL;
64
65
	/* If not using KMS, fall back to stealth mode manual scanning. */
66
	INIT_LIST_HEAD(&driver->legacy_dev_list);
67
	for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
68
		pid = &pdriver->id_table[i];
69
70
		/* Loop around setting up a DRM device for each PCI device
71
		 * matching our ID and device class.  If we had the internal
72
		 * function that pci_get_subsys and pci_get_class used, we'd
73
		 * be able to just pass pid in instead of doing a two-stage
74
		 * thing.
75
		 */
76
		pdev = NULL;
77
		while ((pdev =
78
			pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
79
				       pid->subdevice, pdev)) != NULL) {
80
			if ((pdev->class & pid->class_mask) != pid->class)
81
				continue;
82
83
			/* stealth mode requires a manual probe */
84
			pci_dev_get(pdev);
85
			drm_get_pci_dev(pdev, pid, driver);
86
		}
87
	}
88
	return 0;
89
}
90
91
void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
92
{
93
	struct drm_device *dev, *tmp;
94
	DRM_DEBUG("\n");
95
96
	if (!(driver->driver_features & DRIVER_LEGACY)) {
97
		WARN_ON(1);
98
	} else {
99
		list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
100
					 legacy_dev_list) {
101
			list_del(&dev->legacy_dev_list);
102
			drm_put_dev(dev);
103
		}
104
	}
105
	DRM_INFO("Module unloaded\n");
106
}
53
#else
107
#else
54
#define nv_drm_pci_init drm_pci_init
108
#define nv_drm_pci_init drm_pci_init
55
#define nv_drm_pci_exit drm_pci_exit
109
#define nv_drm_pci_exit drm_pci_exit
(-)a/kernel/nv-linux.h (+49 lines)
Lines 688-698 extern nv_spinlock_t km_lock; Link Here
688
        VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
688
        VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
689
    }
689
    }
690
690
691
#if defined(NV_IOREMAP_NOCACHE_PRESENT)
691
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
692
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
692
    { \
693
    { \
693
        (ptr) = ioremap_nocache(physaddr, size); \
694
        (ptr) = ioremap_nocache(physaddr, size); \
694
        VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
695
        VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
695
    }
696
    }
697
#else
698
#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
699
    NV_IOREMAP(ptr, physaddr, size)
700
#endif
696
701
697
#if defined(NV_IOREMAP_CACHE_PRESENT)
702
#if defined(NV_IOREMAP_CACHE_PRESENT)
698
#define NV_IOREMAP_CACHE(ptr, physaddr, size)            \
703
#define NV_IOREMAP_CACHE(ptr, physaddr, size)            \
Lines 774-779 extern nv_spinlock_t km_lock; Link Here
774
#error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!"
779
#error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!"
775
#endif
780
#endif
776
781
782
#if defined(NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT)
783
#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
784
    {                                                               \
785
        kmem_cache = kmem_cache_create_usercopy(name, sizeof(type), \
786
                        0, 0, 0, sizeof(type), NULL);               \
787
    }
788
#else
789
#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
790
        NV_KMEM_CACHE_CREATE(kmem_cache, name, type)
791
#endif
792
777
#define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type)              \
793
#define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type)              \
778
    {                                                           \
794
    {                                                           \
779
        (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL);       \
795
        (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL);       \
Lines 1971-1976 extern NvU32 nv_assign_gpu_count; Link Here
1971
    })
1987
    })
1972
#endif
1988
#endif
1973
1989
1990
#if defined(NV_HAVE_PROC_OPS)
1991
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
1992
   ({                                                                    \
1993
        struct proc_dir_entry *__entry;                                  \
1994
        int mode = (S_IFREG | S_IRUGO);                                  \
1995
        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
1996
        if (fops->proc_write != 0)                                       \
1997
            mode |= S_IWUSR;                                             \
1998
        __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
1999
            __data);                                                     \
2000
        __entry;                                                         \
2001
    })
2002
#else
1974
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
2003
#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
1975
   ({                                                                    \
2004
   ({                                                                    \
1976
        struct proc_dir_entry *__entry;                                  \
2005
        struct proc_dir_entry *__entry;                                  \
Lines 1982-1987 extern NvU32 nv_assign_gpu_count; Link Here
1982
            __data);                                                     \
2011
            __data);                                                     \
1983
        __entry;                                                         \
2012
        __entry;                                                         \
1984
    })
2013
    })
2014
#endif
1985
2015
1986
/*
2016
/*
1987
 * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
2017
 * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
Lines 2023-2028 extern NvU32 nv_assign_gpu_count; Link Here
2023
    remove_proc_entry(entry->name, entry->parent);
2053
    remove_proc_entry(entry->name, entry->parent);
2024
#endif
2054
#endif
2025
2055
2056
#if defined(NV_HAVE_PROC_OPS)
2057
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
2058
    static int nv_procfs_open_##__name(                                       \
2059
        struct inode *inode,                                                  \
2060
        struct file *filep                                                    \
2061
    )                                                                         \
2062
    {                                                                         \
2063
        return single_open(filep, nv_procfs_read_##__name,                    \
2064
            NV_PDE_DATA(inode));                                              \
2065
    }                                                                         \
2066
                                                                              \
2067
    static const struct proc_ops nv_procfs_##__name##_fops = {                \
2068
        .proc_open       = nv_procfs_open_##__name,                           \
2069
        .proc_read       = seq_read,                                          \
2070
        .proc_lseek      = seq_lseek,                                         \
2071
        .proc_release    = single_release,                                    \
2072
    };
2073
#else
2026
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
2074
#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
2027
    static int nv_procfs_open_##__name(                                       \
2075
    static int nv_procfs_open_##__name(                                       \
2028
        struct inode *inode,                                                  \
2076
        struct inode *inode,                                                  \
Lines 2040-2045 extern NvU32 nv_assign_gpu_count; Link Here
2040
        .llseek     = seq_lseek,                                              \
2088
        .llseek     = seq_lseek,                                              \
2041
        .release    = single_release,                                         \
2089
        .release    = single_release,                                         \
2042
    };
2090
    };
2091
#endif
2043
2092
2044
#endif  /* CONFIG_PROC_FS */
2093
#endif  /* CONFIG_PROC_FS */
2045
2094
(-)a/kernel/nv-procfs.c (+20 lines)
Lines 409-414 done: Link Here
409
    return ((status < 0) ? status : (int)count);
409
    return ((status < 0) ? status : (int)count);
410
}
410
}
411
411
412
#if defined(NV_HAVE_PROC_OPS)
413
static struct proc_ops nv_procfs_registry_fops = {
414
    .proc_open    = nv_procfs_open_registry,
415
    .proc_read    = seq_read,
416
    .proc_write   = nv_procfs_write_file,
417
    .proc_lseek   = seq_lseek,
418
    .proc_release = nv_procfs_close_registry,
419
};
420
#else
412
static struct file_operations nv_procfs_registry_fops = {
421
static struct file_operations nv_procfs_registry_fops = {
413
    .owner   = THIS_MODULE,
422
    .owner   = THIS_MODULE,
414
    .open    = nv_procfs_open_registry,
423
    .open    = nv_procfs_open_registry,
Lines 417-422 static struct file_operations nv_procfs_registry_fops = { Link Here
417
    .llseek  = seq_lseek,
426
    .llseek  = seq_lseek,
418
    .release = nv_procfs_close_registry,
427
    .release = nv_procfs_close_registry,
419
};
428
};
429
#endif
420
430
421
static int
431
static int
422
nv_procfs_read_unbind_lock(
432
nv_procfs_read_unbind_lock(
Lines 538-543 done: Link Here
538
    return rc;
548
    return rc;
539
}
549
}
540
550
551
#if defined(NV_HAVE_PROC_OPS)
552
static struct proc_ops nv_procfs_unbind_lock_fops = {
553
    .proc_open    = nv_procfs_open_unbind_lock,
554
    .proc_read    = seq_read,
555
    .proc_write   = nv_procfs_write_file,
556
    .proc_lseek   = seq_lseek,
557
    .proc_release = nv_procfs_close_unbind_lock,
558
};
559
#else
541
static struct file_operations nv_procfs_unbind_lock_fops = {
560
static struct file_operations nv_procfs_unbind_lock_fops = {
542
    .owner   = THIS_MODULE,
561
    .owner   = THIS_MODULE,
543
    .open    = nv_procfs_open_unbind_lock,
562
    .open    = nv_procfs_open_unbind_lock,
Lines 546-551 static struct file_operations nv_procfs_unbind_lock_fops = { Link Here
546
    .llseek  = seq_lseek,
565
    .llseek  = seq_lseek,
547
    .release = nv_procfs_close_unbind_lock,
566
    .release = nv_procfs_close_unbind_lock,
548
};
567
};
568
#endif
549
569
550
static int
570
static int
551
nv_procfs_read_text_file(
571
nv_procfs_read_text_file(
(-)a/kernel/nv-time.h (-2 / +7 lines)
Lines 28-34 Link Here
28
#include <linux/ktime.h>
28
#include <linux/ktime.h>
29
#endif
29
#endif
30
30
31
static inline void nv_gettimeofday(struct timeval *tv)
31
struct nv_timeval {
32
    __kernel_long_t      tv_sec;
33
    __kernel_suseconds_t tv_usec;
34
};
35
36
static inline void nv_gettimeofday(struct nv_timeval *tv)
32
{
37
{
33
#ifdef NV_DO_GETTIMEOFDAY_PRESENT
38
#ifdef NV_DO_GETTIMEOFDAY_PRESENT
34
    do_gettimeofday(tv);
39
    do_gettimeofday(tv);
Lines 37-43 static inline void nv_gettimeofday(struct timeval *tv) Link Here
37
42
38
    ktime_get_real_ts64(&now);
43
    ktime_get_real_ts64(&now);
39
44
40
    *tv = (struct timeval) {
45
    *tv = (struct nv_timeval) {
41
        .tv_sec = now.tv_sec,
46
        .tv_sec = now.tv_sec,
42
        .tv_usec = now.tv_nsec/1000,
47
        .tv_usec = now.tv_nsec/1000,
43
    };
48
    };
(-)a/kernel/nv.c (-1 / +1 lines)
Lines 752-758 int __init nvidia_init_module(void) Link Here
752
    NV_SPIN_LOCK_INIT(&km_lock);
752
    NV_SPIN_LOCK_INIT(&km_lock);
753
#endif
753
#endif
754
754
755
    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
755
    NV_KMEM_CACHE_CREATE_USERCOPY(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
756
    if (nv_stack_t_cache == NULL)
756
    if (nv_stack_t_cache == NULL)
757
    {
757
    {
758
        nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
758
        nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
(-)a/kernel/os-interface.c (-4 / +4 lines)
Lines 439-445 RM_STATUS NV_API_CALL os_get_current_time( Link Here
439
    NvU32 *useconds
439
    NvU32 *useconds
440
)
440
)
441
{
441
{
442
    struct timeval tm;
442
    struct nv_timeval tm;
443
443
444
    nv_gettimeofday(&tm);
444
    nv_gettimeofday(&tm);
445
445
Lines 474-480 RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds) Link Here
474
    unsigned long usec;
474
    unsigned long usec;
475
475
476
#ifdef NV_CHECK_DELAY_ACCURACY
476
#ifdef NV_CHECK_DELAY_ACCURACY
477
    struct timeval tm1, tm2;
477
    struct nv_timeval tm1, tm2;
478
478
479
    nv_gettimeofday(&tm1);
479
    nv_gettimeofday(&tm1);
480
#endif
480
#endif
Lines 514-522 RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds) Link Here
514
    unsigned long MicroSeconds;
514
    unsigned long MicroSeconds;
515
    unsigned long jiffies;
515
    unsigned long jiffies;
516
    unsigned long mdelay_safe_msec;
516
    unsigned long mdelay_safe_msec;
517
    struct timeval tm_end, tm_aux;
517
    struct nv_timeval tm_end, tm_aux;
518
#ifdef NV_CHECK_DELAY_ACCURACY
518
#ifdef NV_CHECK_DELAY_ACCURACY
519
    struct timeval tm_start;
519
    struct nv_timeval tm_start;
520
#endif
520
#endif
521
521
522
    nv_gettimeofday(&tm_aux);
522
    nv_gettimeofday(&tm_aux);
(-)a/kernel/uvm/Makefile (+1 lines)
Lines 207-212 ccflags-y += $(EXTRA_CFLAGS) Link Here
207
207
208
RM_MODULE_SYMVERS:= $(RM_OUT_DIR)/Module.symvers
208
RM_MODULE_SYMVERS:= $(RM_OUT_DIR)/Module.symvers
209
UVM_MODULE_SYMVERS:= $(obj)/Module.symvers
209
UVM_MODULE_SYMVERS:= $(obj)/Module.symvers
210
KBUILD_EXTRA_SYMBOLS:= $(UVM_MODULE_SYMVERS)
210
211
211
module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
212
module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
212
213
(-)a/kernel/uvm/nvidia_uvm_lite.c (-5 / +24 lines)
Lines 131-138 static Link Here
131
RM_STATUS _preexisting_error_on_channel(UvmGpuMigrationTracking *pMigTracker,
131
RM_STATUS _preexisting_error_on_channel(UvmGpuMigrationTracking *pMigTracker,
132
                                         UvmCommitRecord *pRecord);
132
                                         UvmCommitRecord *pRecord);
133
133
134
static void _set_timeout_in_usec(struct timeval *src,
134
static void _set_timeout_in_usec(struct nv_timeval *src,
135
                                 struct timeval *result,
135
                                 struct nv_timeval *result,
136
                                 unsigned long timeoutInUsec)
136
                                 unsigned long timeoutInUsec)
137
{
137
{
138
    if (!src || !result)
138
    if (!src || !result)
Lines 820-826 done: Link Here
820
}
820
}
821
821
822
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
822
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
823
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
824
vm_fault_t _fault(struct vm_fault *vmf)
825
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
826
int _fault(struct vm_fault *vmf)
827
#else
823
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
828
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
829
#endif
824
{
830
{
825
#if defined(NV_VM_FAULT_HAS_ADDRESS)
831
#if defined(NV_VM_FAULT_HAS_ADDRESS)
826
    unsigned long vaddr = vmf->address;
832
    unsigned long vaddr = vmf->address;
Lines 828-835 int _fault(struct vm_area_struct *vma, struct vm_fault *vmf) Link Here
828
    unsigned long vaddr = (unsigned long)vmf->virtual_address;
834
    unsigned long vaddr = (unsigned long)vmf->virtual_address;
829
#endif
835
#endif
830
    struct page *page = NULL;
836
    struct page *page = NULL;
837
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
838
    vm_fault_t retval;
839
#else
831
    int retval;
840
    int retval;
832
841
842
#endif
843
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
844
   struct vm_area_struct *vma = vmf->vma;
845
#endif
833
    retval = _fault_common(vma, vaddr, &page, vmf->flags);
846
    retval = _fault_common(vma, vaddr, &page, vmf->flags);
834
847
835
    vmf->page = page;
848
    vmf->page = page;
Lines 868-874 static struct vm_operations_struct uvmlite_vma_ops = Link Here
868
// it's dealing with anonymous mapping (see handle_pte_fault).
881
// it's dealing with anonymous mapping (see handle_pte_fault).
869
//
882
//
870
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
883
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
884
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
885
vm_fault_t _sigbus_fault(struct vm_fault *vmf)
886
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
887
int _sigbus_fault(struct vm_fault *vmf)
888
#else
871
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
889
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
890
#endif
872
{
891
{
873
    vmf->page = NULL;
892
    vmf->page = NULL;
874
    return VM_FAULT_SIGBUS;
893
    return VM_FAULT_SIGBUS;
Lines 1992-2000 void umvlite_destroy_per_process_gpu_resources(UvmGpuUuid *gpuUuidStruct) Link Here
1992
static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
2011
static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
1993
                                    NvBool *pIsEccErrorSet)
2012
                                    NvBool *pIsEccErrorSet)
1994
{
2013
{
1995
    struct timeval eccErrorStartTime = {0};
2014
    struct nv_timeval eccErrorStartTime = {0};
1996
    struct timeval eccErrorCurrentTime = {0};
2015
    struct nv_timeval eccErrorCurrentTime = {0};
1997
    struct timeval eccTimeout = {0};
2016
    struct nv_timeval eccTimeout = {0};
1998
    NvBool bEccErrorTimeout = NV_FALSE;
2017
    NvBool bEccErrorTimeout = NV_FALSE;
1999
    NvBool bEccIncomingError = NV_FALSE;
2018
    NvBool bEccIncomingError = NV_FALSE;
2000
    unsigned rmInterruptSet = 0;
2019
    unsigned rmInterruptSet = 0;

Return to bug 693704