aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-09 08:56:26 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:32:51 -0400
commitc5af89b68abb26eea5e745f33228f4d672f115e5 (patch)
treeaad12571ebedea7b869adbeec27e614c498715f4 /arch/x86/kvm/svm.c
parentd555c333aa544b222fe077adcd5dfea024b2c913 (diff)
KVM: Introduce kvm_vcpu_is_bsp() function.
Use it instead of open code "vcpu_id zero is BSP" assumption. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 7749b0692cb2..28b981409a8f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -642,7 +642,7 @@ static int svm_vcpu_reset(struct kvm_vcpu *vcpu)
642 642
643 init_vmcb(svm); 643 init_vmcb(svm);
644 644
645 if (vcpu->vcpu_id != 0) { 645 if (!kvm_vcpu_is_bsp(vcpu)) {
646 kvm_rip_write(vcpu, 0); 646 kvm_rip_write(vcpu, 0);
647 svm->vmcb->save.cs.base = svm->vcpu.arch.sipi_vector << 12; 647 svm->vmcb->save.cs.base = svm->vcpu.arch.sipi_vector << 12;
648 svm->vmcb->save.cs.selector = svm->vcpu.arch.sipi_vector << 8; 648 svm->vmcb->save.cs.selector = svm->vcpu.arch.sipi_vector << 8;
@@ -706,7 +706,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
706 fx_init(&svm->vcpu); 706 fx_init(&svm->vcpu);
707 svm->vcpu.fpu_active = 1; 707 svm->vcpu.fpu_active = 1;
708 svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; 708 svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
709 if (svm->vcpu.vcpu_id == 0) 709 if (kvm_vcpu_is_bsp(&svm->vcpu))
710 svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP; 710 svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP;
711 711
712 return &svm->vcpu; 712 return &svm->vcpu;