x86_64: pmap: enable kernel-mode write-protection
This commit is contained in:
+13
-1
@@ -24,12 +24,13 @@ gigabyte_pages:
|
||||
1: mov $0x1, %rax
|
||||
jmp 3f
|
||||
|
||||
2: mov $0x0, %rax
|
||||
2: mov $0x0, %rax
|
||||
|
||||
3: pop %rbx
|
||||
pop %rbp
|
||||
ret
|
||||
|
||||
|
||||
.global enable_nx
|
||||
.type enable_nx, @function
|
||||
|
||||
@@ -40,3 +41,14 @@ enable_nx:
|
||||
wrmsr
|
||||
|
||||
ret
|
||||
|
||||
|
||||
.global enable_wp
|
||||
.type enable_wp, @function
|
||||
|
||||
enable_wp:
|
||||
mov %cr0, %rax
|
||||
or $0x10000, %rax
|
||||
mov %rax, %cr0
|
||||
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user