[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1196594327723-git-send-email-avi@qumranet.com>
Date: Sun, 2 Dec 2007 13:18:43 +0200
From: Avi Kivity <avi@...ranet.com>
To: stable@...nel.org
Cc: linux-kernel@...r.kernel.org, kvm-devel@...ts.sourceforge.net,
Marko Kohtala <marko.kohtala@...il.com>,
Avi Kivity <avi@...ranet.com>
Subject: [PATCH 06/10] KVM: Fix hang on uniprocessor
From: Marko Kohtala <marko.kohtala@...il.com>
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@...il.com>
Signed-off-by: Avi Kivity <avi@...ranet.com>
---
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 cd05579..b514dfb 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
--
1.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists