aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-06-13 12:43:19 -0400
committerAvi Kivity <avi@qumranet.com>2007-07-16 05:05:47 -0400
commit94cea1bb9d050c3200b36420cc03ba744dfd4338 (patch)
tree7709ef3d5bd40be22ff27bb99dbbe374ef88c86c /drivers
parenta3870c47891629dae1765358fbaba3c49460f47a (diff)
KVM: Initialize the BSP bit in the APIC_BASE msr correctly
Needs to be set on vcpu 0 only. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/kvm/svm.c6
-rw-r--r--drivers/kvm/vmx.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 68841ef671b9..62ec38c7027b 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -589,9 +589,9 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
589 589
590 fx_init(vcpu); 590 fx_init(vcpu);
591 vcpu->fpu_active = 1; 591 vcpu->fpu_active = 1;
592 vcpu->apic_base = 0xfee00000 | 592 vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
593 /*for vcpu 0*/ MSR_IA32_APICBASE_BSP | 593 if (vcpu == &vcpu->kvm->vcpus[0])
594 MSR_IA32_APICBASE_ENABLE; 594 vcpu->apic_base |= MSR_IA32_APICBASE_BSP;
595 595
596 return 0; 596 return 0;
597 597
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b909b5455675..0b2aace70aec 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1238,9 +1238,9 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
1238 memset(vcpu->regs, 0, sizeof(vcpu->regs)); 1238 memset(vcpu->regs, 0, sizeof(vcpu->regs));
1239 vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val(); 1239 vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val();
1240 vcpu->cr8 = 0; 1240 vcpu->cr8 = 0;
1241 vcpu->apic_base = 0xfee00000 | 1241 vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
1242 /*for vcpu 0*/ MSR_IA32_APICBASE_BSP | 1242 if (vcpu == &vcpu->kvm->vcpus[0])
1243 MSR_IA32_APICBASE_ENABLE; 1243 vcpu->apic_base |= MSR_IA32_APICBASE_BSP;
1244 1244
1245 fx_init(vcpu); 1245 fx_init(vcpu);
1246 1246