Skip to content

Commit 847f0ad

Browse files
Alexander Grafavikivity
authored andcommitted
KVM: Implement dummy values for MSR_PERF_STATUS
Darwin relies on this and ceases to work without. Signed-off-by: Alexander Graf <alex@csgraf.de> Signed-off-by: Avi Kivity <avi@qumranet.com>
1 parent 14af3f3 commit 847f0ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ static u32 msrs_to_save[] = {
426426
MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
427427
#endif
428428
MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
429+
MSR_IA32_PERF_STATUS,
429430
};
430431

431432
static unsigned num_msrs_to_save;
@@ -653,7 +654,6 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
653654
case MSR_IA32_MC0_MISC+12:
654655
case MSR_IA32_MC0_MISC+16:
655656
case MSR_IA32_UCODE_REV:
656-
case MSR_IA32_PERF_STATUS:
657657
case MSR_IA32_EBL_CR_POWERON:
658658
/* MTRR registers */
659659
case 0xfe:
@@ -669,6 +669,12 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
669669
case MSR_IA32_MISC_ENABLE:
670670
data = vcpu->arch.ia32_misc_enable_msr;
671671
break;
672+
case MSR_IA32_PERF_STATUS:
673+
/* TSC increment by tick */
674+
data = 1000ULL;
675+
/* CPU multiplier */
676+
data |= (((uint64_t)4ULL) << 40);
677+
break;
672678
case MSR_EFER:
673679
data = vcpu->arch.shadow_efer;
674680
break;

0 commit comments

Comments
 (0)