2015-07-03 08:28:07 +01:00
|
|
|
--- a/kernel/nv-pat.c 2015-07-03 08:39:35.417031728 +0200
|
|
|
|
+++ b/kernel/nv-pat.c 2015-07-03 08:42:15.631838988 +0200
|
|
|
|
@@ -35,8 +35,13 @@
|
|
|
|
unsigned long cr0 = read_cr0();
|
|
|
|
write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
|
|
|
|
wbinvd();
|
2015-08-13 13:08:01 +01:00
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
|
2015-07-03 08:28:07 +01:00
|
|
|
*cr4 = read_cr4();
|
|
|
|
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
|
|
|
|
+#else
|
|
|
|
+ *cr4 = __read_cr4();
|
|
|
|
+ if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
|
|
|
|
+#endif
|
|
|
|
__flush_tlb();
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -46,7 +51,11 @@
|
|
|
|
wbinvd();
|
|
|
|
__flush_tlb();
|
|
|
|
write_cr0((cr0 & 0x9fffffff));
|
2015-08-13 13:08:01 +01:00
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
|
2015-07-03 08:28:07 +01:00
|
|
|
if (cr4 & 0x80) write_cr4(cr4);
|
|
|
|
+#else
|
|
|
|
+ if (cr4 & 0x80) __write_cr4(cr4);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static int nv_determine_pat_mode(void)
|