summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJames Marks - Sun Microsystems <James.Marks@Sun.COM>2009-01-26 10:04:40 -0800
committerJames Marks - Sun Microsystems <James.Marks@Sun.COM>2009-01-26 10:04:40 -0800
commit7de586ca593f9f1fdbc4ce80f111133e9aa5cbef (patch)
treef09d1b19fa5a8c7ba94d9775b78487c9274af7f0 /usr/src
parent4432feae5fd55150d54ce309a84a0a321b4d5449 (diff)
downloadillumos-gate-7de586ca593f9f1fdbc4ce80f111133e9aa5cbef.tar.gz
6794962 cpu DR incorrectly rejects some attempts to remove vcpus
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/sun4v/io/dr_cpu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/uts/sun4v/io/dr_cpu.c b/usr/src/uts/sun4v/io/dr_cpu.c
index 01be49cc11..e66a1bfd82 100644
--- a/usr/src/uts/sun4v/io/dr_cpu.c
+++ b/usr/src/uts/sun4v/io/dr_cpu.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -826,7 +826,7 @@ dr_cpu_check_psrset(uint32_t *cpuids, dr_cpu_res_t *res, int nres)
* cpupart_t counts only online cpus, so it is safe
* to remove an offline cpu without testing ncpus.
*/
- if (cp->cpu_flags & CPU_OFFLINE)
+ if (cpu_is_offline(cp))
continue;
if (--psrset[set_idx].ncpus == 0) {
@@ -1174,6 +1174,15 @@ dr_cpu_unconfigure(processorid_t cpuid, int *status, boolean_t force)
/* set the force flag correctly */
cpu_flags = (force) ? CPU_FORCED : 0;
+ /*
+ * Before we take the CPU offline, we first enable interrupts.
+ * Otherwise, cpu_offline() might reject the request. Note:
+ * if the offline subsequently fails, the target cpu will be
+ * left with interrupts enabled. This is consistent with the
+ * behavior of psradm(1M) and p_online(2).
+ */
+ cpu_intr_enable(cp);
+
if ((rv = cpu_offline(cp, cpu_flags)) != 0) {
DR_DBG_CPU("failed to offline CPU %d (%d)\n",
cpuid, rv);