From 2b01dbdaa07af097e72d1ab008447ee1f3b6bd9b Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 28 Sep 2005 07:03:03 +0000 Subject: Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde --- sys/alpha/alpha/trap.c | 2 -- sys/alpha/osf1/osf1_ioctl.c | 4 ---- sys/alpha/osf1/osf1_misc.c | 4 ---- sys/alpha/osf1/osf1_signal.c | 30 ++++++------------------------ 4 files changed, 6 insertions(+), 34 deletions(-) (limited to 'sys/alpha') diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index 6a4f540..dc800ef 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -1046,14 +1046,12 @@ unaligned_fixup(va, opcode, reg, td) * If we're supposed to be noisy, squawk now. */ if (doprint) { - mtx_lock(&Giant); uprintf( "pid %d (%s): unaligned access: va=0x%lx pc=0x%lx ra=0x%lx op=", p->p_pid, p->p_comm, va, td->td_frame->tf_regs[FRAME_PC], td->td_frame->tf_regs[FRAME_RA]); uprintf(type,opcode); uprintf("\n"); - mtx_unlock(&Giant); } /* diff --git a/sys/alpha/osf1/osf1_ioctl.c b/sys/alpha/osf1/osf1_ioctl.c index c45646f..09d970d 100644 --- a/sys/alpha/osf1/osf1_ioctl.c +++ b/sys/alpha/osf1/osf1_ioctl.c @@ -33,8 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include #include @@ -112,11 +110,9 @@ osf1_ioctl(td, uap) break; } #ifdef IOCTL_DEBUG - mtx_lock(&Giant); uprintf( "OSF/1 IOCTL: group = %c, cmd = %d, len = %d, dir = %s\n", group, cmd, len, dirstr); - mtx_unlock(&Giant); #endif a.fd = uap->fd; diff --git a/sys/alpha/osf1/osf1_misc.c b/sys/alpha/osf1/osf1_misc.c index eacf78a..63ce5ee 100644 --- a/sys/alpha/osf1/osf1_misc.c +++ b/sys/alpha/osf1/osf1_misc.c @@ -209,10 +209,8 @@ osf1_getsysinfo(td, uap) rpb_size = (unsigned long)&hwrpb->rpb_tbhint - (unsigned long)hwrpb; if(uap->nbytes < rpb_size){ - mtx_lock(&Giant); uprintf("nbytes = %ld, sizeof(struct rpb) = %ld\n", uap->nbytes, rpb_size); - mtx_unlock(&Giant); error = EINVAL; } else { @@ -256,9 +254,7 @@ osf1_setsysinfo(td, uap) break; } default: - mtx_lock(&Giant); uprintf("osf1_setsysinfo called with op=%ld\n", uap->op); - mtx_unlock(&Giant); /*error = EINVAL;*/ } return (error); diff --git a/sys/alpha/osf1/osf1_signal.c b/sys/alpha/osf1/osf1_signal.c index f275195..355cb1c 100644 --- a/sys/alpha/osf1/osf1_signal.c +++ b/sys/alpha/osf1/osf1_signal.c @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #endif #include -#include -#include #include #include #include @@ -147,12 +145,9 @@ osf1_to_bsd_sigaction(osa, bsa) { bsa->sa_handler = osa->osa_handler; - if (osf1_sigdbg) { - mtx_lock(&Giant); + if (osf1_sigdbg) uprintf("%s(%d): handler @0x%lx \n", __FILE__, __LINE__, (unsigned long)osa->osa_handler); - mtx_unlock(&Giant); - } osf1_to_bsd_sigset(&osa->osa_mask, &bsa->sa_mask); bsa->sa_flags = 0; if ((osa->osa_flags & OSF1_SA_ONSTACK) != 0) @@ -230,12 +225,9 @@ osf1_sigaction(td, uap) struct sigaction *nbsap; int error; - if (osf1_sigdbg && uap->sigtramp) { - mtx_lock(&Giant); + if (osf1_sigdbg && uap->sigtramp) uprintf("osf1_sigaction: trampoline handler at %p\n", uap->sigtramp); - mtx_unlock(&Giant); - } td->td_md.osf_sigtramp = uap->sigtramp; if (uap->nsa != NULL) { if ((error = copyin(uap->nsa, &osa, sizeof(osa))) != 0) @@ -323,10 +315,8 @@ osf1_signal(td, uap) #endif error = kern_sigaction(td, signum, &nbsa, &obsa, 0); if (error != 0) { - mtx_lock(&Giant); DPRINTF("signal: sigaction failed: %d\n", error); - mtx_unlock(&Giant); td->td_retval[0] = -1; return (error); } @@ -362,11 +352,8 @@ osf1_signal(td, uap) SIGEMPTYSET(sa.sa_mask); sa.sa_flags = 0; error = kern_sigaction(td, signum, &sa, NULL, 0); - if (error != 0) { - mtx_lock(&Giant); + if (error != 0) DPRINTF(("sigignore: sigaction failed\n")); - mtx_unlock(&Giant); - } return (error); } @@ -557,11 +544,8 @@ osf1_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) /* * Set up the registers to return to sigcode. */ - if (osf1_sigdbg) { - mtx_lock(&Giant); + if (osf1_sigdbg) uprintf("attempting to call osf1 sigtramp\n"); - mtx_unlock(&Giant); - } frame->tf_regs[FRAME_PC] = (u_int64_t)td->td_md.osf_sigtramp; frame->tf_regs[FRAME_A0] = sig; frame->tf_regs[FRAME_A1] = code; @@ -643,9 +627,7 @@ osf1_osigstack(td, uap) } */ *uap; { -/* mtx_lock(&Giant); - uprintf("osf1_osigstack: oss = %p, nss = %p",uap->oss, uap->nss); - uprintf(" stack ptr = %p\n",p->p_sigacts->ps_sigstk.ss_sp); - mtx_unlock(&Giant); */ +/* uprintf("osf1_osigstack: oss = %p, nss = %p",uap->oss, uap->nss); + uprintf(" stack ptr = %p\n",p->p_sigacts->ps_sigstk.ss_sp);*/ return(osigstack(td, (struct osigstack_args *)uap)); } -- cgit v1.1