diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-29 11:32:20 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-30 16:02:54 +0200 |
commit | dd489240a21afc3ff3962aba5d987229536cae63 (patch) | |
tree | cc724510e7c36d47cf128b5e3d5dc757d938851d /include/linux/kvm_host.h | |
parent | c847fe8895fded71d0b9a0ba58d3828320fd1824 (diff) |
KVM: document memory barriers for kvm->vcpus/kvm->online_vcpus
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bd1097a95704..81089cf1f0c1 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -427,6 +427,10 @@ struct kvm { static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) { + /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case + * the caller has read kvm->online_vcpus before (as is the case + * for kvm_for_each_vcpu, for example). + */ smp_rmb(); return kvm->vcpus[i]; } |