summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorQing He <qing.he@intel.com>2007-07-12 12:33:56 +0300
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:17 +0200
commitdad3795d2baa4e02cbfd161d9089c73dea16b4ba (patch)
tree56bedc042a5ba0a2b92eecc4e488b0328a35db54 /drivers/kvm/svm.c
parentcd0d91379776cb6850c7b11c0a8843ca75967558 (diff)
downloadop-kernel-dev-dad3795d2baa4e02cbfd161d9089c73dea16b4ba.zip
op-kernel-dev-dad3795d2baa4e02cbfd161d9089c73dea16b4ba.tar.gz
KVM: SMP: Add vcpu_id field in struct vcpu
This patch adds a `vcpu_id' field in `struct vcpu', so we can differentiate BSP and APs without pointer comparison or arithmetic. Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index bc818cc..52a11cc 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -591,7 +591,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
fx_init(vcpu);
vcpu->fpu_active = 1;
vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
- if (vcpu == &vcpu->kvm->vcpus[0])
+ if (vcpu->vcpu_id == 0)
vcpu->apic_base |= MSR_IA32_APICBASE_BSP;
return 0;
OpenPOWER on IntegriCloud