+ /*
+ * memslots_have_rmaps is set and read in different lock contexts,
+ * so protect it with smp_load/store.
+ */
+ smp_store_release(&kvm->arch.memslots_have_rmaps, true);
+ mutex_unlock(&kvm->slots_arch_lock);
+ return 0;
+}
+
bool kvm_memslots_have_rmaps(struct kvm *kvm)
{
- return kvm->arch.memslots_have_rmaps;
+ /*
+ * memslots_have_rmaps is set and read in different lock contexts,
+ * so protect it with smp_load/store.
+ */
+ return smp_load_acquire(&kvm->arch.memslots_have_rmaps);
}