diff options
author | Qing He <qing.he@intel.com> | 2007-07-12 05:33:56 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:17 -0400 |
commit | dad3795d2baa4e02cbfd161d9089c73dea16b4ba (patch) | |
tree | 56bedc042a5ba0a2b92eecc4e488b0328a35db54 /drivers/kvm/vmx.c | |
parent | cd0d91379776cb6850c7b11c0a8843ca75967558 (diff) |
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/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 80628f69916d..7fa62c780ce4 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1253,7 +1253,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) | |||
1253 | vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val(); | 1253 | vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val(); |
1254 | vcpu->cr8 = 0; | 1254 | vcpu->cr8 = 0; |
1255 | vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; | 1255 | vcpu->apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; |
1256 | if (vcpu == &vcpu->kvm->vcpus[0]) | 1256 | if (vcpu->vcpu_id == 0) |
1257 | vcpu->apic_base |= MSR_IA32_APICBASE_BSP; | 1257 | vcpu->apic_base |= MSR_IA32_APICBASE_BSP; |
1258 | 1258 | ||
1259 | fx_init(vcpu); | 1259 | fx_init(vcpu); |