diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-06-09 08:56:28 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:32:52 -0400 |
commit | 73880c80aa9c8dc353cd0ad26579023213cd5314 (patch) | |
tree | d5bee5c87c3468feb941cc898e342f52c0adce19 /include/linux/kvm_host.h | |
parent | 1ed0ce000a6c20c36ec649e32fc24393ef418ed8 (diff) |
KVM: Break dependency between vcpu index in vcpus array and vcpu_id.
Archs are free to use vcpu_id as they see fit. For x86 it is used as
vcpu's apic id. New ioctl is added to configure boot vcpu id that was
assumed to be 0 till now.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a5bd429e9bd3..d3fdf1a738c9 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -131,8 +131,12 @@ struct kvm { | |||
131 | int nmemslots; | 131 | int nmemslots; |
132 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 132 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
133 | KVM_PRIVATE_MEM_SLOTS]; | 133 | KVM_PRIVATE_MEM_SLOTS]; |
134 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
135 | u32 bsp_vcpu_id; | ||
134 | struct kvm_vcpu *bsp_vcpu; | 136 | struct kvm_vcpu *bsp_vcpu; |
137 | #endif | ||
135 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; | 138 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
139 | atomic_t online_vcpus; | ||
136 | struct list_head vm_list; | 140 | struct list_head vm_list; |
137 | struct mutex lock; | 141 | struct mutex lock; |
138 | struct kvm_io_bus mmio_bus; | 142 | struct kvm_io_bus mmio_bus; |
@@ -550,8 +554,10 @@ static inline void kvm_irqfd_release(struct kvm *kvm) {} | |||
550 | 554 | ||
551 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ | 555 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ |
552 | 556 | ||
557 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
553 | static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) | 558 | static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) |
554 | { | 559 | { |
555 | return vcpu->kvm->bsp_vcpu == vcpu; | 560 | return vcpu->kvm->bsp_vcpu == vcpu; |
556 | } | 561 | } |
557 | #endif | 562 | #endif |
563 | #endif | ||