Browse Source

Kernel: Oops, actually enable CR4.PGE (page table global bit)

Turns out we were setting the wrong bit here. Now we will actually keep
kernel memory mappings in the TLB across context switches.
Andreas Kling 5 years ago
parent
commit
3623e35978
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Kernel/VM/MemoryManager.cpp

+ 1 - 1
Kernel/VM/MemoryManager.cpp

@@ -168,7 +168,7 @@ void MemoryManager::initialize_paging()
     // Turn on CR4.PGE so the CPU will respect the G bit in page tables.
     // Turn on CR4.PGE so the CPU will respect the G bit in page tables.
     asm volatile(
     asm volatile(
         "mov %cr4, %eax\n"
         "mov %cr4, %eax\n"
-        "orl $0x10, %eax\n"
+        "orl $0x40, %eax\n"
         "mov %eax, %cr4\n");
         "mov %eax, %cr4\n");
 
 
     asm volatile("movl %%eax, %%cr3" ::"a"(kernel_page_directory().cr3()));
     asm volatile("movl %%eax, %%cr3" ::"a"(kernel_page_directory().cr3()));