aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2010-09-09 06:06:46 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:27 -0400
commit7b91409822ed37f2a58974e49498bdbe92ddd93c (patch)
tree82b049d7840556e576dd33409ae2499c25bd9074 /arch/x86/kvm/x86.c
parentb9a52c4b78ec254ee00cce47d75efd89b09f13dd (diff)
KVM: x86: Emulate MSR_EBC_FREQUENCY_ID
Some operating systems store data about the host processor at the time of installation, and when booted on a more uptodate cpu tries to read MSR_EBC_FREQUENCY_ID. This has been found with XP. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f47db2588a41..9d434777154d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1651,6 +1651,20 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
1651 case 0xcd: /* fsb frequency */ 1651 case 0xcd: /* fsb frequency */
1652 data = 3; 1652 data = 3;
1653 break; 1653 break;
1654 /*
1655 * MSR_EBC_FREQUENCY_ID
1656 * Conservative value valid for even the basic CPU models.
1657 * Models 0,1: 000 in bits 23:21 indicating a bus speed of
1658 * 100MHz, model 2 000 in bits 18:16 indicating 100MHz,
1659 * and 266MHz for model 3, or 4. Set Core Clock
1660 * Frequency to System Bus Frequency Ratio to 1 (bits
1661 * 31:24) even though these are only valid for CPU
1662 * models > 2, however guests may end up dividing or
1663 * multiplying by zero otherwise.
1664 */
1665 case MSR_EBC_FREQUENCY_ID:
1666 data = 1 << 24;
1667 break;
1654 case MSR_IA32_APICBASE: 1668 case MSR_IA32_APICBASE:
1655 data = kvm_get_apic_base(vcpu); 1669 data = kvm_get_apic_base(vcpu);
1656 break; 1670 break;