diff --git a/src/cpu.c b/src/cpu.c index 3f538ddf3..d4cfd9026 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -104,10 +104,10 @@ uint64_t mtrr_fix16k_a000_msr = 0; uint64_t mtrr_fix4k_msr[8] = {0, 0, 0, 0, 0, 0, 0, 0}; uint64_t pat_msr = 0; uint64_t mtrr_deftype_msr = 0; +uint64_t msr_ia32_pmc[4] = {0, 0, 0, 0}; uint64_t ecx17_msr = 0; uint64_t ecx79_msr = 0; uint64_t ecx8x_msr[4] = {0, 0, 0, 0}; -uint64_t ecxc2_msr = 0; uint64_t ecx116_msr = 0; uint64_t ecx11x_msr[4] = {0, 0, 0, 0}; uint64_t ecx11e_msr = 0; @@ -1989,6 +1989,10 @@ void cpu_RDMSR() EAX = ecx8x_msr[ECX - 0x88] & 0xffffffff; EDX = ecx8x_msr[ECX - 0x88] >> 32; break; + case 0xC1 ... 0xC4: + EAX = msr_ia32_pmc[ECX - 0xC1] & 0xffffffff; + EDX = msr_ia32_pmc[ECX - 0xC1] >> 32; + break; case 0xC2: EAX = ecxc2_msr & 0xffffffff; EDX = ecxc2_msr >> 32; @@ -2188,8 +2192,8 @@ void cpu_WRMSR() case 0x88 ... 0x8B: ecx8x_msr[ECX - 0x88] = EAX | ((uint64_t)EDX << 32); break; - case 0xC2: - ecxc2_msr = EAX | ((uint64_t)EDX << 32); + case 0xC1 ... 0xC4: + msr_ia32_pmc[ECX - 0xC1] = EAX | ((uint64_t)EDX << 32); break; case 0xFE: mtrr_cap_msr = EAX | ((uint64_t)EDX << 32);