Skip to content

Commit

Permalink
KVM: Initialize the BSP bit in the APIC_BASE msr correctly
Browse files Browse the repository at this point in the history
Needs to be set on vcpu 0 only.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Jul 16, 2007
1 parent a3870c4 commit 94cea1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)

fx_init(vcpu);
vcpu->fpu_active = 1;
vcpu->apic_base = 0xfee00000 |
/*for vcpu 0*/ MSR_IA32_APICBASE_BSP |
MSR_IA32_APICBASE_ENABLE;
vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
if (vcpu == &vcpu->kvm->vcpus[0])
vcpu->apic_base |= MSR_IA32_APICBASE_BSP;

return 0;

Expand Down
6 changes: 3 additions & 3 deletions drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,9 +1238,9 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
memset(vcpu->regs, 0, sizeof(vcpu->regs));
vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val();
vcpu->cr8 = 0;
vcpu->apic_base = 0xfee00000 |
/*for vcpu 0*/ MSR_IA32_APICBASE_BSP |
MSR_IA32_APICBASE_ENABLE;
vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
if (vcpu == &vcpu->kvm->vcpus[0])
vcpu->apic_base |= MSR_IA32_APICBASE_BSP;

fx_init(vcpu);

Expand Down

0 comments on commit 94cea1b

Please sign in to comment.