aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
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 /include/linux/kvm_host.h
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 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a29ea030dd8e..a5bd429e9bd3 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -131,6 +131,7 @@ 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 struct kvm_vcpu *bsp_vcpu;
134 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; 135 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
135 struct list_head vm_list; 136 struct list_head vm_list;
136 struct mutex lock; 137 struct mutex lock;
@@ -549,4 +550,8 @@ static inline void kvm_irqfd_release(struct kvm *kvm) {}
549 550
550#endif /* CONFIG_HAVE_KVM_EVENTFD */ 551#endif /* CONFIG_HAVE_KVM_EVENTFD */
551 552
553static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
554{
555 return vcpu->kvm->bsp_vcpu == vcpu;
556}
552#endif 557#endif