Lines 21-30
Link Here
|
21 |
#endif |
21 |
#endif |
22 |
|
22 |
|
23 |
#if defined(KERNEL_2_4) && (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) |
23 |
#if defined(KERNEL_2_4) && (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) |
24 |
// weak linking? |
|
|
25 |
extern int i2c_add_adapter (struct i2c_adapter *) __attribute__ ((weak)); |
24 |
extern int i2c_add_adapter (struct i2c_adapter *) __attribute__ ((weak)); |
26 |
extern int i2c_del_adapter (struct i2c_adapter *) __attribute__ ((weak)); |
25 |
extern int i2c_del_adapter (struct i2c_adapter *) __attribute__ ((weak)); |
27 |
#endif // defined(KERNEL_2_4) && (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) |
26 |
#endif |
28 |
|
27 |
|
29 |
/* |
28 |
/* |
30 |
* our global state; one per device |
29 |
* our global state; one per device |
Lines 40-49
Link Here
|
40 |
static struct pm_dev *apm_nv_dev[NV_MAX_DEVICES] = { 0 }; |
39 |
static struct pm_dev *apm_nv_dev[NV_MAX_DEVICES] = { 0 }; |
41 |
#endif |
40 |
#endif |
42 |
|
41 |
|
43 |
int nv_pat_enabled = 0; |
42 |
int nv_pat_mode = NV_PAT_MODE_DISABLED; |
44 |
|
|
|
45 |
static int nv_disable_pat = 0; |
46 |
NV_MODULE_PARAMETER(nv_disable_pat); |
47 |
|
43 |
|
48 |
#if defined(NVCPU_X86) || defined(NVCPU_X86_64) |
44 |
#if defined(NVCPU_X86) || defined(NVCPU_X86_64) |
49 |
NvU64 __nv_supported_pte_mask = ~_PAGE_NX; |
45 |
NvU64 __nv_supported_pte_mask = ~_PAGE_NX; |
Lines 499-505
Link Here
|
499 |
nv_state_t *nv; |
495 |
nv_state_t *nv; |
500 |
nv_linux_state_t *nvl; |
496 |
nv_linux_state_t *nvl; |
501 |
|
497 |
|
502 |
proc_nvidia = create_proc_entry("nvidia", d_flags, proc_root_driver); |
498 |
proc_nvidia = create_proc_entry("driver/nvidia", d_flags, NULL); |
503 |
if (!proc_nvidia) |
499 |
if (!proc_nvidia) |
504 |
goto failed; |
500 |
goto failed; |
505 |
|
501 |
|
Lines 751-767
Link Here
|
751 |
static int __nv_enable_pat_support (void); |
747 |
static int __nv_enable_pat_support (void); |
752 |
static void __nv_disable_pat_support (void); |
748 |
static void __nv_disable_pat_support (void); |
753 |
|
749 |
|
754 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
750 |
#if defined(NV_ENABLE_PAT_SUPPORT) |
755 |
/* |
751 |
/* |
756 |
* Private PAT support for use by the NVIDIA driver. This is an |
752 |
* Private PAT support for use by the NVIDIA driver. This is used |
757 |
* interim solution until the kernel offers PAT support. |
753 |
* on kernels that do not modify the PAT to include a write-combining |
|
|
754 |
* entry. |
758 |
*/ |
755 |
*/ |
759 |
static int __check_pat_support (void); |
756 |
static int __check_pat_support (void); |
760 |
static void __nv_setup_pat_entries (void *); |
757 |
static void __nv_setup_pat_entries (void *); |
761 |
static void __nv_restore_pat_entries (void *); |
758 |
static void __nv_restore_pat_entries (void *); |
762 |
|
759 |
|
763 |
#define NV_READ_PAT_ENTRIES(pat1, pat2) rdmsr(IA32_CR_PAT, (pat1), (pat2)) |
760 |
#define NV_READ_PAT_ENTRIES(pat1, pat2) rdmsr(0x277, (pat1), (pat2)) |
764 |
#define NV_WRITE_PAT_ENTRIES(pat1, pat2) wrmsr(IA32_CR_PAT, (pat1), (pat2)) |
761 |
#define NV_WRITE_PAT_ENTRIES(pat1, pat2) wrmsr(0x277, (pat1), (pat2)) |
765 |
#define NV_PAT_ENTRY(pat, index) (((pat) & (0xff<<((index)*8)))>>((index)*8)) |
762 |
#define NV_PAT_ENTRY(pat, index) (((pat) & (0xff<<((index)*8)))>>((index)*8)) |
766 |
|
763 |
|
767 |
static inline void __nv_disable_caches(unsigned long *cr4) |
764 |
static inline void __nv_disable_caches(unsigned long *cr4) |
Lines 786-792
Link Here
|
786 |
static int __check_pat_support() |
783 |
static int __check_pat_support() |
787 |
{ |
784 |
{ |
788 |
unsigned int pat1, pat2, i; |
785 |
unsigned int pat1, pat2, i; |
789 |
|
786 |
U008 PAT_WC_index; |
790 |
if (!test_bit(X86_FEATURE_PAT, (volatile unsigned long *)&boot_cpu_data.x86_capability)) |
787 |
if (!test_bit(X86_FEATURE_PAT, (volatile unsigned long *)&boot_cpu_data.x86_capability)) |
791 |
{ |
788 |
{ |
792 |
nv_printf(NV_DBG_ERRORS, |
789 |
nv_printf(NV_DBG_ERRORS, |
Lines 795-818
Link Here
|
795 |
} |
792 |
} |
796 |
|
793 |
|
797 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
794 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
|
|
795 |
PAT_WC_index = 0xf; |
798 |
|
796 |
|
799 |
for (i = 0; i < 4; i++) |
797 |
for (i = 0; i < 4; i++) |
800 |
{ |
798 |
{ |
801 |
// we plan to mark PAT entry 1 as WC. if it's already marked such, |
799 |
if (NV_PAT_ENTRY(pat1, i) == 0x01) |
802 |
// that's fine, since it would be no different than us setting it. |
800 |
{ |
803 |
if ((i != 1) && NV_PAT_ENTRY(pat1, i) == 1) |
801 |
PAT_WC_index = i; |
804 |
{ |
802 |
break; |
805 |
nv_printf(NV_DBG_ERRORS, "NVRM: PAT index %d already configured for Write-Combining!\n", i); |
803 |
} |
806 |
nv_printf(NV_DBG_ERRORS, "NVRM: Aborting, due to PAT already being configured\n"); |
804 |
if (NV_PAT_ENTRY(pat2, i) == 0x01) |
807 |
return 0; |
805 |
{ |
808 |
} |
806 |
PAT_WC_index = i + 4; |
809 |
|
807 |
break; |
810 |
if (NV_PAT_ENTRY(pat2, i) == 1) |
808 |
} |
811 |
{ |
809 |
} |
812 |
nv_printf(NV_DBG_ERRORS, "NVRM: PAT index %d already configured for Write-Combining!\n", i + 4); |
810 |
|
813 |
nv_printf(NV_DBG_ERRORS, "NVRM: Aborting, due to PAT already being configured\n"); |
811 |
if (PAT_WC_index == 1) |
814 |
return 0; |
812 |
nv_pat_mode = NV_PAT_MODE_KERNEL; |
815 |
} |
813 |
else if (PAT_WC_index != 0xf) |
|
|
814 |
{ |
815 |
nv_printf(NV_DBG_ERRORS, |
816 |
"NVRM: PAT configuration unsupported, falling back to MTRRs.\n"); |
817 |
return 0; |
816 |
} |
818 |
} |
817 |
|
819 |
|
818 |
return 1; |
820 |
return 1; |
Lines 867-885
Link Here
|
867 |
NV_RESTORE_FLAGS(eflags); |
869 |
NV_RESTORE_FLAGS(eflags); |
868 |
} |
870 |
} |
869 |
|
871 |
|
870 |
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ |
872 |
#endif |
871 |
|
873 |
|
872 |
static int __nv_enable_pat_support() |
874 |
static int __nv_enable_pat_support() |
873 |
{ |
875 |
{ |
874 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
876 |
#if defined(NV_ENABLE_PAT_SUPPORT) |
875 |
unsigned long pat1, pat2; |
877 |
unsigned long pat1, pat2; |
876 |
|
878 |
|
877 |
if (nv_pat_enabled) |
879 |
if (nv_pat_mode != NV_PAT_MODE_DISABLED) |
878 |
return 1; |
880 |
return 1; |
879 |
|
881 |
|
880 |
if (!__check_pat_support()) |
882 |
if (!__check_pat_support()) |
881 |
return 0; |
883 |
return 0; |
882 |
|
884 |
|
|
|
885 |
if (nv_pat_mode != NV_PAT_MODE_DISABLED) |
886 |
return 1; |
887 |
|
883 |
NV_READ_PAT_ENTRIES(orig_pat1, orig_pat2); |
888 |
NV_READ_PAT_ENTRIES(orig_pat1, orig_pat2); |
884 |
nv_printf(NV_DBG_SETUP, "saved orig pats as 0x%lx 0x%lx\n", orig_pat1, orig_pat2); |
889 |
nv_printf(NV_DBG_SETUP, "saved orig pats as 0x%lx 0x%lx\n", orig_pat1, orig_pat2); |
885 |
|
890 |
|
Lines 889-919
Link Here
|
889 |
return 0; |
894 |
return 0; |
890 |
} |
895 |
} |
891 |
|
896 |
|
892 |
nv_pat_enabled = 1; |
897 |
nv_pat_mode = NV_PAT_MODE_BUILTIN; |
893 |
|
898 |
|
894 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
899 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
895 |
nv_printf(NV_DBG_SETUP, "changed pats to 0x%lx 0x%lx\n", pat1, pat2); |
900 |
nv_printf(NV_DBG_SETUP, "changed pats to 0x%lx 0x%lx\n", pat1, pat2); |
896 |
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ |
901 |
#endif |
897 |
|
902 |
|
898 |
return 1; |
903 |
return 1; |
899 |
} |
904 |
} |
900 |
|
905 |
|
901 |
static void __nv_disable_pat_support() |
906 |
static void __nv_disable_pat_support() |
902 |
{ |
907 |
{ |
903 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
908 |
#if defined(NV_ENABLE_PAT_SUPPORT) |
904 |
unsigned long pat1, pat2; |
909 |
unsigned long pat1, pat2; |
905 |
|
910 |
|
906 |
if (!nv_pat_enabled) |
911 |
if (!nv_pat_mode != NV_PAT_MODE_BUILTIN) |
907 |
return; |
912 |
return; |
908 |
|
913 |
|
909 |
if (nv_execute_on_all_cpus(__nv_restore_pat_entries, NULL) != 0) |
914 |
if (nv_execute_on_all_cpus(__nv_restore_pat_entries, NULL) != 0) |
910 |
return; |
915 |
return; |
911 |
|
916 |
|
912 |
nv_pat_enabled = 0; |
917 |
nv_pat_mode = NV_PAT_MODE_DISABLED; |
913 |
|
918 |
|
914 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
919 |
NV_READ_PAT_ENTRIES(pat1, pat2); |
915 |
nv_printf(NV_DBG_SETUP, "restored orig pats as 0x%lx 0x%lx\n", pat1, pat2); |
920 |
nv_printf(NV_DBG_SETUP, "restored orig pats as 0x%lx 0x%lx\n", pat1, pat2); |
916 |
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ |
921 |
#endif |
917 |
} |
922 |
} |
918 |
|
923 |
|
919 |
#if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) |
924 |
#if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) |
Lines 1130-1136
Link Here
|
1130 |
break; |
1135 |
break; |
1131 |
default: |
1136 |
default: |
1132 |
expected = pgprot_val(PAGE_KERNEL_NOCACHE); |
1137 |
expected = pgprot_val(PAGE_KERNEL_NOCACHE); |
1133 |
if ((flags & ~_PAGE_NX) == (expected & ~_PAGE_NX)) |
1138 |
if ((flags & ~(_PAGE_NX | _PAGE_PWT)) == (expected & ~(_PAGE_NX | _PAGE_PWT))) |
1134 |
retval = 0; |
1139 |
retval = 0; |
1135 |
break; |
1140 |
break; |
1136 |
} |
1141 |
} |
Lines 1161-1167
Link Here
|
1161 |
#endif |
1166 |
#endif |
1162 |
} |
1167 |
} |
1163 |
|
1168 |
|
1164 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) |
1169 |
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) |
1165 |
static int |
1170 |
static int |
1166 |
nv_kern_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
1171 |
nv_kern_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
1167 |
{ |
1172 |
{ |
Lines 1194-1200
Link Here
|
1194 |
.priority = 0 |
1199 |
.priority = 0 |
1195 |
}; |
1200 |
}; |
1196 |
|
1201 |
|
1197 |
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) */ |
1202 |
#endif |
1198 |
|
1203 |
|
1199 |
|
1204 |
|
1200 |
/*** |
1205 |
/*** |
Lines 1203-1209
Link Here
|
1203 |
|
1208 |
|
1204 |
static int __init nvidia_init_module(void) |
1209 |
static int __init nvidia_init_module(void) |
1205 |
{ |
1210 |
{ |
1206 |
int rc; |
1211 |
int rc, disable_pat = 0; |
1207 |
U032 i, count, data; |
1212 |
U032 i, count, data; |
1208 |
nv_state_t *nv = NV_STATE_PTR(&nv_ctl_device); |
1213 |
nv_state_t *nv = NV_STATE_PTR(&nv_ctl_device); |
1209 |
|
1214 |
|
Lines 1320-1337
Link Here
|
1320 |
goto failed; |
1325 |
goto failed; |
1321 |
} |
1326 |
} |
1322 |
|
1327 |
|
1323 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) |
|
|
1324 |
if (!nv_disable_pat) |
1325 |
{ |
1326 |
if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0) |
1327 |
{ |
1328 |
rc = -EIO; |
1329 |
nv_printf(NV_DBG_ERRORS, "NVRM: CPU hotplug notifier registration failed!\n"); |
1330 |
goto failed; |
1331 |
} |
1332 |
} |
1333 |
#endif |
1334 |
|
1335 |
#if defined(NV_SG_MAP_BUFFERS) |
1328 |
#if defined(NV_SG_MAP_BUFFERS) |
1336 |
rm_read_registry_dword(NV_STATE_PTR(&nv_ctl_device), "NVreg", "RemapLimit", &nv_remap_limit); |
1329 |
rm_read_registry_dword(NV_STATE_PTR(&nv_ctl_device), "NVreg", "RemapLimit", &nv_remap_limit); |
1337 |
|
1330 |
|
Lines 1407-1421
Link Here
|
1407 |
|
1400 |
|
1408 |
nvos_proc_add_warning_file("README", __README_warning); |
1401 |
nvos_proc_add_warning_file("README", __README_warning); |
1409 |
|
1402 |
|
1410 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
1403 |
rc = rm_read_registry_dword(nv, "NVreg", "UsePageAttributeTable", &data); |
1411 |
if (!nv_disable_pat) |
1404 |
if ((rc == 0) && ((int)data != ~0)) |
|
|
1405 |
{ |
1406 |
disable_pat = (data == 0); |
1407 |
} |
1408 |
if (!disable_pat) |
1409 |
{ |
1412 |
__nv_enable_pat_support(); |
1410 |
__nv_enable_pat_support(); |
|
|
1411 |
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) |
1412 |
if (nv_pat_mode == NV_PAT_MODE_BUILTIN) |
1413 |
{ |
1414 |
if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0) |
1415 |
{ |
1416 |
__nv_disable_pat_support(); |
1417 |
rc = -EIO; |
1418 |
nv_printf(NV_DBG_ERRORS, |
1419 |
"NVRM: CPU hotplug notifier registration failed!\n"); |
1420 |
goto failed; |
1421 |
} |
1422 |
} |
1423 |
#endif |
1424 |
} |
1413 |
else |
1425 |
else |
1414 |
{ |
1426 |
{ |
1415 |
nv_printf(NV_DBG_ERRORS, |
1427 |
nv_printf(NV_DBG_ERRORS, |
1416 |
"NVRM: builtin PAT support disabled, falling back to MTRRs.\n"); |
1428 |
"NVRM: builtin PAT support disabled, falling back to MTRRs.\n"); |
1417 |
} |
1429 |
} |
1418 |
#endif |
|
|
1419 |
|
1430 |
|
1420 |
#if (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) && defined(KERNEL_2_4) |
1431 |
#if (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) && defined(KERNEL_2_4) |
1421 |
// attempt to load the i2c modules for linux kernel |
1432 |
// attempt to load the i2c modules for linux kernel |
Lines 1555-1569
Link Here
|
1555 |
rm_unregister_ioctl_conversions(); |
1566 |
rm_unregister_ioctl_conversions(); |
1556 |
#endif |
1567 |
#endif |
1557 |
|
1568 |
|
1558 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
1569 |
if (nv_pat_mode == NV_PAT_MODE_BUILTIN) |
1559 |
if (nv_pat_enabled) |
|
|
1560 |
{ |
1570 |
{ |
1561 |
__nv_disable_pat_support(); |
1571 |
__nv_disable_pat_support(); |
1562 |
#if defined(CONFIG_HOTPLUG_CPU) |
1572 |
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) |
1563 |
unregister_hotcpu_notifier(&nv_hotcpu_nfb); |
1573 |
unregister_hotcpu_notifier(&nv_hotcpu_nfb); |
1564 |
#endif |
1574 |
#endif |
1565 |
} |
1575 |
} |
1566 |
#endif |
|
|
1567 |
|
1576 |
|
1568 |
#if defined(NV_ENABLE_MEM_TRACKING) |
1577 |
#if defined(NV_ENABLE_MEM_TRACKING) |
1569 |
#if defined(VM_CHECKER) |
1578 |
#if defined(VM_CHECKER) |
Lines 1680-1686
Link Here
|
1680 |
} |
1689 |
} |
1681 |
} |
1690 |
} |
1682 |
} |
1691 |
} |
1683 |
|
1692 |
#if !defined(NV_VM_INSERT_PAGE_PRESENT) |
|
|
1693 |
static |
1684 |
struct page *nv_kern_vma_nopage( |
1694 |
struct page *nv_kern_vma_nopage( |
1685 |
struct vm_area_struct *vma, |
1695 |
struct vm_area_struct *vma, |
1686 |
unsigned long address, |
1696 |
unsigned long address, |
Lines 1691-1712
Link Here
|
1691 |
#endif |
1701 |
#endif |
1692 |
) |
1702 |
) |
1693 |
{ |
1703 |
{ |
1694 |
#if !defined(NV_VM_INSERT_PAGE_PRESENT) |
|
|
1695 |
struct page *page; |
1704 |
struct page *page; |
1696 |
|
1705 |
|
1697 |
page = pfn_to_page(vma->vm_pgoff); |
1706 |
page = pfn_to_page(vma->vm_pgoff); |
1698 |
get_page(page); |
1707 |
get_page(page); |
1699 |
|
1708 |
|
1700 |
return page; |
1709 |
return page; |
1701 |
#else |
|
|
1702 |
return NOPAGE_SIGBUS; |
1703 |
#endif |
1704 |
} |
1710 |
} |
|
|
1711 |
#endif |
1705 |
|
1712 |
|
1706 |
struct vm_operations_struct nv_vm_ops = { |
1713 |
struct vm_operations_struct nv_vm_ops = { |
1707 |
.open = nv_kern_vma_open, |
1714 |
.open = nv_kern_vma_open, |
1708 |
.close = nv_kern_vma_release, /* "close" */ |
1715 |
.close = nv_kern_vma_release, /* "close" */ |
|
|
1716 |
#if !defined(NV_VM_INSERT_PAGE_PRESENT) |
1709 |
.nopage = nv_kern_vma_nopage, |
1717 |
.nopage = nv_kern_vma_nopage, |
|
|
1718 |
#endif |
1710 |
}; |
1719 |
}; |
1711 |
|
1720 |
|
1712 |
static nv_file_private_t * |
1721 |
static nv_file_private_t * |
Lines 1985-1996
Link Here
|
1985 |
*prot = pgprot_noncached(*prot); |
1994 |
*prot = pgprot_noncached(*prot); |
1986 |
break; |
1995 |
break; |
1987 |
case NV_MEMORY_WRITECOMBINED: |
1996 |
case NV_MEMORY_WRITECOMBINED: |
1988 |
if (nv_pat_enabled && |
1997 |
#if defined(NV_ENABLE_PAT_SUPPORT) |
|
|
1998 |
if ((nv_pat_mode != NV_PAT_MODE_DISABLED) && |
1989 |
(memory_type != NV_MEMORY_TYPE_REGISTERS)) |
1999 |
(memory_type != NV_MEMORY_TYPE_REGISTERS)) |
1990 |
{ |
2000 |
{ |
1991 |
*prot = pgprot_writecombined(*prot); |
2001 |
pgprot_val(*prot) &= ~(_PAGE_PSE | _PAGE_PCD | _PAGE_PWT); |
|
|
2002 |
*prot = __pgprot(pgprot_val(*prot) | _PAGE_PWT); |
1992 |
break; |
2003 |
break; |
1993 |
} |
2004 |
} |
|
|
2005 |
#endif |
1994 |
/* |
2006 |
/* |
1995 |
* If PAT support is unavailable and the memory space isn't |
2007 |
* If PAT support is unavailable and the memory space isn't |
1996 |
* NV_MEMORY_TYPE_AGP, we need to return an error code to |
2008 |
* NV_MEMORY_TYPE_AGP, we need to return an error code to |
Lines 2010-2016
Link Here
|
2010 |
break; |
2022 |
break; |
2011 |
return 1; |
2023 |
return 1; |
2012 |
case NV_MEMORY_CACHED: |
2024 |
case NV_MEMORY_CACHED: |
2013 |
//case NV_MEMORY_WRITEBACK: |
|
|
2014 |
/* |
2025 |
/* |
2015 |
* RAM is cached on Linux by default, we can assume there's |
2026 |
* RAM is cached on Linux by default, we can assume there's |
2016 |
* nothing to be done here. This is not the case for the |
2027 |
* nothing to be done here. This is not the case for the |
Lines 2027-2034
Link Here
|
2027 |
*/ |
2038 |
*/ |
2028 |
if (memory_type == NV_MEMORY_TYPE_SYSTEM) |
2039 |
if (memory_type == NV_MEMORY_TYPE_SYSTEM) |
2029 |
break; |
2040 |
break; |
2030 |
//case NV_MEMORY_WRITETHRU: |
|
|
2031 |
//case NV_MEMORY_WRITEPROTECT: |
2032 |
default: |
2041 |
default: |
2033 |
nv_printf(NV_DBG_ERRORS, |
2042 |
nv_printf(NV_DBG_ERRORS, |
2034 |
"NVRM: VM: memory type %d not supported for memory space %d!\n", |
2043 |
"NVRM: VM: memory type %d not supported for memory space %d!\n", |
Lines 3239-3253
Link Here
|
3239 |
down_read(&mm->mmap_sem); |
3248 |
down_read(&mm->mmap_sem); |
3240 |
} |
3249 |
} |
3241 |
else |
3250 |
else |
3242 |
{ |
|
|
3243 |
#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) |
3244 |
/* nv_printf(NV_DBG_ERRORS, |
3245 |
"NVRM: can't translate KVA in nv_get_phys_address()!\n"); */ |
3246 |
return 0; |
3247 |
#else |
3248 |
mm = NULL; |
3251 |
mm = NULL; |
3249 |
#endif |
|
|
3250 |
} |
3251 |
|
3252 |
|
3252 |
pgd = NV_PGD_OFFSET(address, kern, mm); |
3253 |
pgd = NV_PGD_OFFSET(address, kern, mm); |
3253 |
if (!NV_PGD_PRESENT(pgd)) |
3254 |
if (!NV_PGD_PRESENT(pgd)) |
Lines 3483-3490
Link Here
|
3483 |
|
3484 |
|
3484 |
nv_init_lock(nvl->rm_lock); |
3485 |
nv_init_lock(nvl->rm_lock); |
3485 |
|
3486 |
|
3486 |
sema_init(&nvl->ldata_lock, 1); |
3487 |
NV_INIT_MUTEX(&nvl->ldata_lock); |
3487 |
sema_init(&nvl->at_lock, 1); |
3488 |
NV_INIT_MUTEX(&nvl->at_lock); |
|
|
3489 |
|
3488 |
NV_ATOMIC_SET(nvl->usage_count, 0); |
3490 |
NV_ATOMIC_SET(nvl->usage_count, 0); |
3489 |
|
3491 |
|
3490 |
nvl->rm_lock_cpu = -1; |
3492 |
nvl->rm_lock_cpu = -1; |