summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/amd64/machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64/amd64/machdep.c')
-rw-r--r--sys/arch/amd64/amd64/machdep.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 72de150..76c1a5f 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -481,14 +481,13 @@ void
cpu_halt_others(void)
{
struct cpu_info *curcpu, *ci;
- uint32_t ncpu;
+ uint32_t ncpu = cpu_count();
- if (rdmsr(IA32_GS_BASE) == 0) {
- __ASMV("cli; hlt");
+ if (rdmsr(IA32_GS_BASE) == 0 || ncpu <= 1) {
+ return;
}
curcpu = this_cpu();
- ncpu = cpu_count();
for (int i = 0; i < ncpu; ++i) {
if ((ci = cpu_get(i)) == NULL)