mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
disable performance monitoring counter
This commit is contained in:
parent
e3de05cb4c
commit
57feac36e4
1 changed files with 4 additions and 2 deletions
|
@ -451,7 +451,7 @@ int cpu_detection(void) {
|
|||
kprintf("Syscall instruction: %s\n", (cpu_info.feature3 & CPU_FEATURE_SYSCALL) ? "available" : "unavailable");
|
||||
}
|
||||
|
||||
//TODO: add check for SMEP and SMAP
|
||||
//TODO: add check for SMEP, PCE and SMAP
|
||||
|
||||
// be sure that AM, NE and MP is enabled
|
||||
cr0 = read_cr0();
|
||||
|
@ -476,7 +476,9 @@ int cpu_detection(void) {
|
|||
cr4 |= CR4_MCE; // enable machine check exceptions
|
||||
//if (has_vmx())
|
||||
// cr4 |= CR4_VMXE;
|
||||
cr4 &= ~CR4_TSD; // => every privilege level is able to use rdtsc
|
||||
cr4 &= ~(CR4_PCE|CR4_TSD); // disable performance monitoring counter
|
||||
// clear TSD => every privilege level is able
|
||||
// to use rdtsc
|
||||
write_cr4(cr4);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue