diff options
author | Marko Kohtala <marko.kohtala@gmail.com> | 2007-12-02 13:18:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-14 09:50:56 -0800 |
commit | 86a1b7f0192d2f66a302a681fd76ce701f711953 (patch) | |
tree | 3764395bb5d36e4eacd236da89272b83bbcd0ec1 | |
parent | e124b02477867e05ba4bc12a1a22b17a537028a8 (diff) |
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: Marko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/kvm/kvm_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index cd0557954e5..b514dfbb675 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -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 * available, so ipi all cpus in parallel and wait for them |