aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-09 15:56:26 +0300
committerAvi Kivity <avi@redhat.com>2009-09-10 08:32:51 +0300
commitc5af89b68abb26eea5e745f33228f4d672f115e5 (patch)
treeaad12571ebedea7b869adbeec27e614c498715f4 /include/linux/kvm_host.h
parentKVM: MMU: s/shadow_pte/spte/ (diff)
downloadlinux-dev-c5af89b68abb26eea5e745f33228f4d672f115e5.tar.xz
linux-dev-c5af89b68abb26eea5e745f33228f4d672f115e5.zip
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 {
int nmemslots;
struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
KVM_PRIVATE_MEM_SLOTS];
+ struct kvm_vcpu *bsp_vcpu;
struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
struct list_head vm_list;
struct mutex lock;
@@ -549,4 +550,8 @@ static inline void kvm_irqfd_release(struct kvm *kvm) {}
#endif /* CONFIG_HAVE_KVM_EVENTFD */
+static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
+{
+ return vcpu->kvm->bsp_vcpu == vcpu;
+}
#endif