Browse Source

Kernel: Do not disable userland access to the RDTSC instruction

Access to RDTSC is occasionally restricted to give malware one less
option to accurately time attacks (side-channels, etc.).

However, QEMU requires access to the timestamp counter for the exact
same reason (which is accurately timing its CPU ticks), so lets just
enable it for now.
Tim Schumacher 3 years ago
parent
commit
7d3f71a648
1 changed files with 0 additions and 4 deletions
  1. 0 4
      Kernel/Arch/x86/common/Processor.cpp

+ 0 - 4
Kernel/Arch/x86/common/Processor.cpp

@@ -551,10 +551,6 @@ UNMAP_AFTER_INIT void Processor::cpu_setup()
         write_cr4(read_cr4() | 0x800);
         write_cr4(read_cr4() | 0x800);
     }
     }
 
 
-    if (has_feature(CPUFeature::TSC)) {
-        write_cr4(read_cr4() | 0x4);
-    }
-
     if (has_feature(CPUFeature::XSAVE)) {
     if (has_feature(CPUFeature::XSAVE)) {
         // Turn on CR4.OSXSAVE
         // Turn on CR4.OSXSAVE
         write_cr4(read_cr4() | 0x40000);
         write_cr4(read_cr4() | 0x40000);