x86_64: pmap: enable NX protection during bootstrap

This commit is contained in:
2023-02-09 21:38:06 +00:00
parent ddb00acd31
commit d960909d1b
3 changed files with 14 additions and 0 deletions

View File

@@ -29,3 +29,14 @@ gigabyte_pages:
3: pop %rbx
pop %rbp
ret
.global enable_nx
.type enable_nx, @function
enable_nx:
mov $0xC0000080, %ecx
rdmsr
or $0x800, %eax
wrmsr
ret