Commit 86a1b7f0 authored by Marko Kohtala's avatar Marko Kohtala Committed by Greg Kroah-Hartman

KVM: Fix hang on uniprocessor

This is not in mainline, as it was fixed differently in that tree.

first_cpu(cpus) returns the only CPU when NR_CPUS is 1 regardless of
the cpus mask. Therefore we avoid a kernel hang in
KVM_SET_MEMORY_REGION ioctl on uniprocessor by not entering the loop at
all.
Signed-off-by: default avatarMarko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e124b024
...@@ -273,6 +273,11 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) ...@@ -273,6 +273,11 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
} }
} }
/* Uniprocessor kernel does not respect cpus in first_cpu. So
* do not go there if we have nothing to do. */
if (cpus_empty(cpus))
return;
/* /*
* We really want smp_call_function_mask() here. But that's not * We really want smp_call_function_mask() here. But that's not
* available, so ipi all cpus in parallel and wait for them * available, so ipi all cpus in parallel and wait for them
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment