summaryrefslogtreecommitdiff
path: root/linux-wistron-nx.patch
blob: 84cb93680c4bce7cbab814aeae3d40b69e26edb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- linux-3.10/drivers/input/misc/wistron_btns.c.orig	2013-11-16 09:05:55.612742472 +0100
+++ linux-3.10/drivers/input/misc/wistron_btns.c	2013-11-16 09:24:37.356028732 +0100
@@ -33,6 +33,7 @@
 #include <linux/types.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
+#include <linux/set_memory.h>
 
 /* How often we poll keys - msecs */
 #define POLL_INTERVAL_DEFAULT	500 /* when idle */
@@ -124,6 +125,7 @@
 	if (entry_point >= 0xF0000) {
 		bios_code_map_base = base;
 		bios_entry_point = bios_code_map_base + (entry_point & 0xFFFF);
+		set_memory_x((unsigned long)bios_code_map_base, 0x10000 >> PAGE_SHIFT);
 	} else {
 		iounmap(base);
 		bios_code_map_base = ioremap(entry_point & ~0x3FFF, 0x4000);
@@ -134,6 +136,7 @@
 			goto err;
 		}
 		bios_entry_point = bios_code_map_base + (entry_point & 0x3FFF);
+		set_memory_x((unsigned long)bios_code_map_base, 0x4000 >> PAGE_SHIFT);
 	}
 	/* The Windows driver maps 0x10000 bytes, we keep only one page... */
 	bios_data_map_base = ioremap(0x400, 0xc00);
--- linux-5.4/arch/x86/mm/pat/set_memory.c~	2019-11-25 01:32:01.000000000 +0100
+++ linux-5.4/arch/x86/mm/pat/set_memory.c	2019-11-27 06:38:21.886578313 +0100
@@ -1885,6 +1885,7 @@ int set_memory_x(unsigned long addr, int
 
 	return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_NX), 0);
 }
+EXPORT_SYMBOL(set_memory_x);
 
 int set_memory_nx(unsigned long addr, int numpages)
 {