From f1fa5dcf799749330b7bd6cdee34de6a17ea3fd4 Mon Sep 17 00:00:00 2001 From: mishra Date: Tue, 2 Oct 2007 16:47:20 -0700 Subject: 6489446 pbind gives wrong message when run on system processes 6608065 bug 6292092 mis-merged fix of bug 6317341 --- usr/src/uts/common/os/softint.c | 25 +++++++++++++++++++++++-- usr/src/uts/common/syscall/processor_bind.c | 3 ++- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/os/softint.c b/usr/src/uts/common/os/softint.c index 47d384e724..9728dd93cc 100644 --- a/usr/src/uts/common/os/softint.c +++ b/usr/src/uts/common/os/softint.c @@ -168,6 +168,7 @@ static void (*kdi_softcall_func)(void); extern void siron_poke_cpu(cpuset_t); extern void siron(void); +extern void kdi_siron(void); void softcall_init(void) @@ -220,8 +221,15 @@ softcall_choose_cpu() */ cp = cplist; do { + /* + * Don't select this CPU if : + * - in cpuset already + * - CPU is not accepting interrupts + * - CPU is being offlined + */ if (CPU_IN_SET(*softcall_cpuset, cp->cpu_id) || - (cp->cpu_flags & CPU_ENABLE) == 0) + (cp->cpu_flags & CPU_ENABLE) == 0 || + (cp == cpu_inmotion)) continue; /* if CPU is not busy */ @@ -351,7 +359,7 @@ kdi_softcall(void (*func)(void)) kdi_softcall_func = func; if (softhead == NULL) - siron(); + kdi_siron(); } /* @@ -374,6 +382,19 @@ softint(void) caddr_t arg; int cpu_id = CPU->cpu_id; + /* + * Don't process softcall queue if current CPU is quiesced or + * offlined. This can happen when a CPU is running pause + * thread but softcall already sent a xcall. + */ + if (CPU->cpu_flags & (CPU_QUIESCED|CPU_OFFLINE)) { + if (softcall_cpuset != NULL && + CPU_IN_SET(*softcall_cpuset, cpu_id)) { + CPUSET_DEL(*softcall_cpuset, cpu_id); + goto out; + } + } + mutex_enter(&softcall_lock); if (softcall_state & (SOFT_STEAL|SOFT_PEND)) { diff --git a/usr/src/uts/common/syscall/processor_bind.c b/usr/src/uts/common/syscall/processor_bind.c index bd416e43e6..129129d7d1 100644 --- a/usr/src/uts/common/syscall/processor_bind.c +++ b/usr/src/uts/common/syscall/processor_bind.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -61,6 +61,7 @@ cpu_bind_process(proc_t *pp, processorid_t bind, processorid_t *obind, /* skip kernel processes */ if (pp->p_flag & SSYS) { *obind = PBIND_NONE; + *error = EPERM; return (0); } -- cgit v1.2.3