From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 00:36:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43EEC106566C; Sun, 19 Sep 2010 00:36:27 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33CF48FC14; Sun, 19 Sep 2010 00:36:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J0aRpp083214; Sun, 19 Sep 2010 00:36:27 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J0aRoI083212; Sun, 19 Sep 2010 00:36:27 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201009190036.o8J0aRoI083212@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 19 Sep 2010 00:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212832 - head/usr.bin/script X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 00:36:27 -0000 Author: obrien Date: Sun Sep 19 00:36:26 2010 New Revision: 212832 URL: http://svn.freebsd.org/changeset/base/212832 Log: Fix the grammar after I added a second environmental variable. Submitted by: wxs Modified: head/usr.bin/script/script.1 Modified: head/usr.bin/script/script.1 ============================================================================== --- head/usr.bin/script/script.1 Sat Sep 18 23:38:21 2010 (r212831) +++ head/usr.bin/script/script.1 Sun Sep 19 00:36:26 2010 (r212832) @@ -114,7 +114,7 @@ The utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. .Sh ENVIRONMENT -The following environment variable is utilized by +The following environment variables are utilized by .Nm : .Bl -tag -width SHELL .It Ev SCRIPT From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 01:05:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB5C3106566B; Sun, 19 Sep 2010 01:05:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AEDE8FC12; Sun, 19 Sep 2010 01:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J15JuR084026; Sun, 19 Sep 2010 01:05:19 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J15JRv084024; Sun, 19 Sep 2010 01:05:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201009190105.o8J15JRv084024@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Sep 2010 01:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212833 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 01:05:19 -0000 Author: rmacklem Date: Sun Sep 19 01:05:19 2010 New Revision: 212833 URL: http://svn.freebsd.org/changeset/base/212833 Log: Fix the experimental NFSv4 server so that it performs local VOP_ADVLOCK() unlock operations correctly. It was passing in F_SETLK instead of F_UNLCK as the operation for the unlock case. This only affected operation when local locking (vfs.newnfs.enable_locallocks=1) was enabled. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Sep 19 00:36:26 2010 (r212832) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Sep 19 01:05:19 2010 (r212833) @@ -2825,7 +2825,7 @@ nfsvno_advlock(struct vnode *vp, int fty struct flock fl; u_int64_t tlen; - if (!nfsrv_dolocallocks) + if (nfsrv_dolocallocks == 0) return (0); fl.l_whence = SEEK_SET; fl.l_type = ftype; @@ -2850,8 +2850,12 @@ nfsvno_advlock(struct vnode *vp, int fty fl.l_sysid = (int)nfsv4_sysid; NFSVOPUNLOCK(vp, 0, td); - error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl, - (F_POSIX | F_REMOTE)); + if (ftype == F_UNLCK) + error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl, + (F_POSIX | F_REMOTE)); + else + error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl, + (F_POSIX | F_REMOTE)); NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 01:18:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 825CA106564A; Sun, 19 Sep 2010 01:18:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 721A98FC0C; Sun, 19 Sep 2010 01:18:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J1I3sp084312; Sun, 19 Sep 2010 01:18:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J1I3wD084310; Sun, 19 Sep 2010 01:18:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201009190118.o8J1I3wD084310@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Sep 2010 01:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212834 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 01:18:03 -0000 Author: rmacklem Date: Sun Sep 19 01:18:03 2010 New Revision: 212834 URL: http://svn.freebsd.org/changeset/base/212834 Log: Fix nfsrv_freeallnfslocks() in the experimental NFSv4 server so that it frees local locks correctly upon close. In order for nfsrv_localunlock() to work correctly, the lock can no longer be in the lockowner's stateid list. As such, nfsrv_freenfslock() has to be called before nfsrv_localunlock(), to get rid of the lock structure on the lockowner's stateid list. This only affected operation when local locks (vfs.newnfs.enable_locallocks=1) are enabled, which is not the default at this time. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Sep 19 01:05:19 2010 (r212833) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Sep 19 01:18:03 2010 (r212834) @@ -1137,6 +1137,7 @@ nfsrv_freeallnfslocks(struct nfsstate *s struct nfslockfile *lfp = NULL; int gottvp = 0; vnode_t tvp = NULL; + uint64_t first, end; lop = LIST_FIRST(&stp->ls_lock); while (lop != LIST_END(&stp->ls_lock)) { @@ -1167,14 +1168,16 @@ nfsrv_freeallnfslocks(struct nfsstate *s if (tvp != NULL) { if (cansleep == 0) panic("allnfs2"); - nfsrv_localunlock(tvp, lfp, lop->lo_first, - lop->lo_end, p); + first = lop->lo_first; + end = lop->lo_end; + nfsrv_freenfslock(lop); + nfsrv_localunlock(tvp, lfp, first, end, p); LIST_FOREACH_SAFE(rlp, &lfp->lf_rollback, rlck_list, nrlp) free(rlp, M_NFSDROLLBACK); LIST_INIT(&lfp->lf_rollback); - } - nfsrv_freenfslock(lop); + } else + nfsrv_freenfslock(lop); lop = nlop; } if (vp == NULL && tvp != NULL) From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 05:19:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6486106566B; Sun, 19 Sep 2010 05:19:47 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62CB8FC0A; Sun, 19 Sep 2010 05:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J5Jl4I090111; Sun, 19 Sep 2010 05:19:47 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J5JlOx090109; Sun, 19 Sep 2010 05:19:47 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009190519.o8J5JlOx090109@svn.freebsd.org> From: David Xu Date: Sun, 19 Sep 2010 05:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212837 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 05:19:48 -0000 Author: davidxu Date: Sun Sep 19 05:19:47 2010 New Revision: 212837 URL: http://svn.freebsd.org/changeset/base/212837 Log: Fix a race condition when finding stack unwinding functions. Modified: head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sun Sep 19 02:07:30 2010 (r212836) +++ head/lib/libthr/thread/thr_exit.c Sun Sep 19 05:19:47 2010 (r212837) @@ -70,18 +70,31 @@ static void thread_uw_init(void) { static int inited = 0; + Dl_info dlinfo; void *handle; + void *forcedunwind, *resume, *getcfa; if (inited) - return; - inited = 1; + return; handle = RTLD_DEFAULT; - if ((uwl_forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind")) == NULL|| - (uwl_resume = dlsym(handle, "_Unwind_Resume")) == NULL || - (uwl_getcfa = dlsym(handle, "_Unwind_GetCFA")) == NULL) { - uwl_forcedunwind = NULL; - return; + if ((forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind")) != NULL) { + if (dladdr(forcedunwind, &dlinfo)) { + if ((handle = dlopen(dlinfo.dli_fname, RTLD_LAZY)) != NULL) { + forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind"); + resume = dlsym(handle, "_Unwind_Resume"); + getcfa = dlsym(handle, "_Unwind_GetCFA"); + if (forcedunwind != NULL && resume != NULL && + getcfa != NULL) { + uwl_forcedunwind = forcedunwind; + uwl_resume = resume; + uwl_getcfa = getcfa; + } else { + dlclose(handle); + } + } + } } + inited = 1; } void From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 05:42:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C98E71065672; Sun, 19 Sep 2010 05:42:29 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0A68FC1B; Sun, 19 Sep 2010 05:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J5gTbN090590; Sun, 19 Sep 2010 05:42:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J5gTjE090588; Sun, 19 Sep 2010 05:42:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009190542.o8J5gTjE090588@svn.freebsd.org> From: David Xu Date: Sun, 19 Sep 2010 05:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212838 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 05:42:29 -0000 Author: davidxu Date: Sun Sep 19 05:42:29 2010 New Revision: 212838 URL: http://svn.freebsd.org/changeset/base/212838 Log: - _Unwind_Resume function is not used, remove it. - Use a store barrier to make sure uwl_forcedunwind is lastest thing other threads can see. - Add some comments. Modified: head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sun Sep 19 05:19:47 2010 (r212837) +++ head/lib/libthr/thread/thr_exit.c Sun Sep 19 05:42:29 2010 (r212838) @@ -63,7 +63,6 @@ static _Unwind_Reason_Code thread_unwind /* unwind library pointers */ static _Unwind_Reason_Code (*uwl_forcedunwind)(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); -static void (*uwl_resume)(struct _Unwind_Exception *exc); static _Unwind_Word (*uwl_getcfa)(struct _Unwind_Context *); static void @@ -72,22 +71,24 @@ thread_uw_init(void) static int inited = 0; Dl_info dlinfo; void *handle; - void *forcedunwind, *resume, *getcfa; + void *forcedunwind, *getcfa; if (inited) return; handle = RTLD_DEFAULT; if ((forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind")) != NULL) { if (dladdr(forcedunwind, &dlinfo)) { + /* + * Make sure the address is always valid by holding the library, + * also assume functions are in same library. + */ if ((handle = dlopen(dlinfo.dli_fname, RTLD_LAZY)) != NULL) { forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind"); - resume = dlsym(handle, "_Unwind_Resume"); getcfa = dlsym(handle, "_Unwind_GetCFA"); - if (forcedunwind != NULL && resume != NULL && - getcfa != NULL) { - uwl_forcedunwind = forcedunwind; - uwl_resume = resume; + if (forcedunwind != NULL && getcfa != NULL) { uwl_getcfa = getcfa; + atomic_store_rel_ptr((volatile void *)&uwl_forcedunwind, + (uintptr_t)forcedunwind); } else { dlclose(handle); } @@ -97,12 +98,6 @@ thread_uw_init(void) inited = 1; } -void -_Unwind_Resume(struct _Unwind_Exception *ex) -{ - (*uwl_resume)(ex); -} - _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *ex, _Unwind_Stop_Fn stop_func, void *stop_arg) @@ -118,7 +113,6 @@ _Unwind_GetCFA(struct _Unwind_Context *c #else #pragma weak _Unwind_GetCFA #pragma weak _Unwind_ForcedUnwind -#pragma weak _Unwind_Resume #endif /* PIC */ static void From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 08:01:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD906106564A; Sun, 19 Sep 2010 08:01:51 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 66CE58FC14; Sun, 19 Sep 2010 08:01:51 +0000 (UTC) Received: by qyk4 with SMTP id 4so3941293qyk.13 for ; Sun, 19 Sep 2010 01:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=t/yyu4+4RjUbaZP6G0w61Iplr8QG9BDutPYUgM15u1U=; b=xO+TdIwWWfpU1sK0bHb3EJgLWsmsJNZjpdlnHb+pgT8WtJMx5UZfgAzR5FSMx+eJFO vcuOX54NExh1vfB5FAtlI7dVD4ijwZOMnck0NgXgn9FPCcKfWxBL2KF6FwSFJkyfo5eV 33qkzOaxmvqlxiENr0G7QFIxiiR9zj+tBLvxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Dsc0ritLD+GytiNESfaEVTDO0MU631GmLfyjxrAF7geGn2IloUAXj9Ja57Wt1X6ew0 eWHxLvTbaQYgocVsvCKso7Su4Bfge1mPsilKn+uFc8MrVcDXRsNQBwMgtYnt13NfzQ5F uca+S+UyY7GT9/R29OYoBIDa5wh0Bjebe5VeA= MIME-Version: 1.0 Received: by 10.229.95.73 with SMTP id c9mr5122902qcn.111.1284883310400; Sun, 19 Sep 2010 01:01:50 -0700 (PDT) Received: by 10.229.19.206 with HTTP; Sun, 19 Sep 2010 01:01:50 -0700 (PDT) In-Reply-To: <201009182338.o8INcLF8081790@svn.freebsd.org> References: <201009182338.o8INcLF8081790@svn.freebsd.org> Date: Sun, 19 Sep 2010 12:01:50 +0400 Message-ID: From: pluknet To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212831 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 08:01:52 -0000 On 19 September 2010 03:38, Rui Paulo wrote: > Author: rpaulo > Date: Sat Sep 18 23:38:21 2010 > New Revision: 212831 > URL: http://svn.freebsd.org/changeset/base/212831 > > Log: > =A0Ignore EINTR when calling waitpid. > > Modified: > =A0head/lib/libproc/proc_util.c > > Modified: head/lib/libproc/proc_util.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libproc/proc_util.c =A0 =A0 =A0 =A0Sat Sep 18 22:37:47 2010 = =A0 =A0 =A0 =A0(r212830) > +++ head/lib/libproc/proc_util.c =A0 =A0 =A0 =A0Sat Sep 18 23:38:21 2010 = =A0 =A0 =A0 =A0(r212831) > @@ -145,7 +145,8 @@ proc_wstatus(struct proc_handle *phdl) > =A0 =A0 =A0 =A0if (phdl =3D=3D NULL) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > =A0 =A0 =A0 =A0if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("waitpid"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (errno !=3D EINTR) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("waitpid"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (WIFSTOPPED(status)) Hi. After this change the waitpid() error handling still doesn't ignore EINTR (well, only warn() ignores EINTR now), but it rather returns with -1. Is it intentional? I though something more like this was meant in svn log: while (waitpid(...) < 0) if (errno !=3D EINTR) { warn("waitpid"); return (-1); } --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 08:18:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 642C5106566C; Sun, 19 Sep 2010 08:18:56 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 524758FC15; Sun, 19 Sep 2010 08:18:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J8IuaI094052; Sun, 19 Sep 2010 08:18:56 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J8IuZR094047; Sun, 19 Sep 2010 08:18:56 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201009190818.o8J8IuZR094047@svn.freebsd.org> From: Brian Somers Date: Sun, 19 Sep 2010 08:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212839 - in head: sbin/growfs tools/regression/sbin tools/regression/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 08:18:56 -0000 Author: brian Date: Sun Sep 19 08:18:56 2010 New Revision: 212839 URL: http://svn.freebsd.org/changeset/base/212839 Log: Revise r197763 which fixes filesystem corruption when extending into un-zeroed storage. The original patch was questioned by Kirk as it forces the filesystem to do excessive work initialising inodes on first use, and was never MFC'd. This change mimics the newfs(8) approach of zeroing two blocks of inodes for each new cylinder group. Reviewed by: mckusick MFC after: 3 weeks Added: head/tools/regression/sbin/ head/tools/regression/sbin/Makefile (contents, props changed) head/tools/regression/sbin/growfs/ head/tools/regression/sbin/growfs/Makefile (contents, props changed) head/tools/regression/sbin/growfs/regress.t (contents, props changed) Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun Sep 19 05:42:29 2010 (r212838) +++ head/sbin/growfs/growfs.c Sun Sep 19 08:18:56 2010 (r212839) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC("initcg") - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, "panic: cannot allocate I/O buffer"); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -396,17 +396,12 @@ initcg(int cylno, time_t utime, int fso, dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); cs = &fscs[cylno]; memset(&acg, 0, sblock.fs_cgsize); - /* - * Note that we do not set cg_initediblk at all. - * In this extension of a previous filesystem - * we have no inodes initialized for the cylinder - * group at all. The first access to that cylinder - * group will do the correct initialization. - */ acg.cg_time = utime; acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? + sblock.fs_ipg : 2 * INOPB(&sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -419,6 +414,7 @@ initcg(int cylno, time_t utime, int fso, acg.cg_time = 0; acg.cg_old_niblk = acg.cg_niblk; acg.cg_niblk = 0; + acg.cg_initediblk = 0; acg.cg_old_btotoff = start; acg.cg_old_boff = acg.cg_old_btotoff + sblock.fs_old_cpg * sizeof(int32_t); @@ -538,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, &acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), - sblock.fs_bsize, (char *)&acg, fso, Nflag); - DBG_DUMP_CG(&sblock, - "new cg", - &acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(&sblock, "new cg", &acg); DBG_LEAVE; return; Added: head/tools/regression/sbin/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/Makefile Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= growfs + +.include Added: head/tools/regression/sbin/growfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/growfs/Makefile Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +all test: + prove -vmw regress.t + +clean: Added: head/tools/regression/sbin/growfs/regress.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/growfs/regress.t Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,91 @@ +#! /usr/bin/perl +# +# $FreeBSD$ + +use strict; +use warnings; +use Test::More tests => 19; +use Fcntl qw(:DEFAULT :seek); + +use constant BLK => 512; +use constant BLKS_PER_MB => 2048; + +my $unit; +END { system "mdconfig -du$unit" if defined $unit }; + +sub setsize { + my ($partszMB, $unitszMB) = @_; + + open my $fd, "|-", "disklabel -R md$unit /dev/stdin" or die; + print $fd "a: ", ($partszMB * BLKS_PER_MB), " 0 4.2BSD 1024 8192\n"; + print $fd "c: ", ($unitszMB * BLKS_PER_MB), " 0 unused 0 0\n"; + close $fd; +} + +sub fill { + my ($start, $size, $content) = @_; + + my $content512 = $content x (int(512 / length $content) + 1); + substr($content512, 512) = ""; + sysopen my $fd, "/dev/md$unit", O_RDWR or die "/dev/md$unit: $!"; + seek($fd, $start * BLK, SEEK_SET); + while ($size) { + syswrite($fd, $content512) == 512 or die "write: $!"; + $size--; + } +} + +SKIP: { + skip "Cannot test without UID 0", 19 if $<; + + chomp(my $md = `mdconfig -s40m`); + like($md, qr/^md\d+$/, "Created $md with size 40m") or die; + $unit = substr $md, 2; + + for my $type (1..2) { + + initialise: { + ok(setsize(10, 40), "Sized ${md}a to 10m"); + system "newfs -O $type -U ${md}a >/dev/null"; + is($?, 0, "Initialised the filesystem on ${md}a as UFS$type"); + chomp(my @out = `fsck -tufs -y ${md}a`); + ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . + scalar(@out) . " lines of output"); + } + + extend20_zeroed: { + ok(setsize(20, 40), "Sized ${md}a to 20m"); + diag "Filling the extent with zeros"; + fill(10 * BLKS_PER_MB, 10 * BLKS_PER_MB, chr(0)); + my $out = `growfs -y ${md}a`; + is($?, 0, "Extended the filesystem on ${md}a") or print $out; + + my ($unallocated) = $out =~ m{\d+ sectors cannot be allocated}; + fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) + if $unallocated; + + chomp(my @out = `fsck -tufs -y ${md}a`); + ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . + scalar(@out) . " lines of output"); + } + + extend30_garbaged: { + ok(setsize(30, 40), "Sized ${md}a to 30m"); + diag "Filling the extent with garbage"; + fill(20 * BLKS_PER_MB, 10 * BLKS_PER_MB, chr(0xaa) . chr(0x55)); + my $out = `growfs -y ${md}a`; + is($?, 0, "Extended the filesystem on ${md}a") or print $out; + + my ($unallocated) = $out =~ m{\d+ sectors cannot be allocated}; + fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) + if $unallocated; + + chomp(my @out = `fsck -tufs -y ${md}a`); + ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . + scalar(@out) . " lines of output"); + } + } + + system "mdconfig -du$unit"; + undef $unit; +} From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 08:55:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58FE106564A; Sun, 19 Sep 2010 08:55:36 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57F28FC08; Sun, 19 Sep 2010 08:55:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J8taQf094999; Sun, 19 Sep 2010 08:55:36 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J8taEk094997; Sun, 19 Sep 2010 08:55:36 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009190855.o8J8taEk094997@svn.freebsd.org> From: David Xu Date: Sun, 19 Sep 2010 08:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212840 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 08:55:36 -0000 Author: davidxu Date: Sun Sep 19 08:55:36 2010 New Revision: 212840 URL: http://svn.freebsd.org/changeset/base/212840 Log: Fix typo. Modified: head/lib/libthr/thread/thr_join.c Modified: head/lib/libthr/thread/thr_join.c ============================================================================== --- head/lib/libthr/thread/thr_join.c Sun Sep 19 08:18:56 2010 (r212839) +++ head/lib/libthr/thread/thr_join.c Sun Sep 19 08:55:36 2010 (r212840) @@ -48,7 +48,7 @@ static void backout_join(void *arg) THR_THREAD_LOCK(curthread, pthread); pthread->joiner = NULL; - THR_THREAD_LOCK(curthread, pthread); + THR_THREAD_UNLOCK(curthread, pthread); } int From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 09:03:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED41106566B; Sun, 19 Sep 2010 09:03:11 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6B18FC17; Sun, 19 Sep 2010 09:03:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J93B7X095214; Sun, 19 Sep 2010 09:03:11 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J93BTx095209; Sun, 19 Sep 2010 09:03:11 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009190903.o8J93BTx095209@svn.freebsd.org> From: David Xu Date: Sun, 19 Sep 2010 09:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212841 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 09:03:12 -0000 Author: davidxu Date: Sun Sep 19 09:03:11 2010 New Revision: 212841 URL: http://svn.freebsd.org/changeset/base/212841 Log: Because atfork lock is held while forking, a thread cancellation triggered by atfork handler is unsafe, use intenal flag no_cancel to disable it. Modified: head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sun Sep 19 08:55:36 2010 (r212840) +++ head/lib/libthr/thread/thr_exit.c Sun Sep 19 09:03:11 2010 (r212841) @@ -206,7 +206,7 @@ _pthread_exit_mask(void *status, sigset_ /* Flag this thread as exiting. */ curthread->cancelling = 1; - curthread->cancel_enable = 0; + curthread->no_cancel = 1; curthread->cancel_async = 0; curthread->cancel_point = 0; if (mask != NULL) Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Sun Sep 19 08:55:36 2010 (r212840) +++ head/lib/libthr/thread/thr_fork.c Sun Sep 19 09:03:11 2010 (r212841) @@ -137,7 +137,7 @@ _fork(void) struct pthread *curthread; struct pthread_atfork *af; pid_t ret; - int errsave; + int errsave, cancelsave; int was_threaded; int rtld_locks[MAX_RTLD_LOCKS]; @@ -145,7 +145,8 @@ _fork(void) return (__sys_fork()); curthread = _get_curthread(); - + cancelsave = curthread->no_cancel; + curthread->no_cancel = 1; _thr_rwl_rdlock(&_thr_atfork_lock); /* Run down atfork prepare handlers. */ @@ -223,6 +224,7 @@ _fork(void) af->child(); } _thr_rwlock_unlock(&_thr_atfork_lock); + curthread->no_cancel = cancelsave; } else { /* Parent process */ errsave = errno; @@ -244,6 +246,9 @@ _fork(void) } _thr_rwlock_unlock(&_thr_atfork_lock); + curthread->no_cancel = cancelsave; + /* test async cancel */ + _thr_testcancel(curthread); } errno = errsave; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sun Sep 19 08:55:36 2010 (r212840) +++ head/lib/libthr/thread/thr_private.h Sun Sep 19 09:03:11 2010 (r212841) @@ -356,9 +356,9 @@ struct pthread { struct pthread_attr attr; #define SHOULD_CANCEL(thr) \ - ((thr)->cancel_pending && \ + ((thr)->cancel_pending && (thr)->cancel_enable && \ ((thr)->cancel_point || (thr)->cancel_async) && \ - (thr)->cancel_enable && (thr)->cancelling == 0) + (thr)->no_cancel == 0) /* Cancellation is enabled */ int cancel_enable; @@ -369,8 +369,8 @@ struct pthread { /* Thread is at cancellation point */ int cancel_point; - /* Cancellation should be synchoronized */ - int cancel_defer; + /* Cancellation is temporarily disabled */ + int no_cancel; /* Asynchronouse cancellation is enabled */ int cancel_async; Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Sun Sep 19 08:55:36 2010 (r212840) +++ head/lib/libthr/thread/thr_sig.c Sun Sep 19 09:03:11 2010 (r212841) @@ -187,7 +187,6 @@ handle_signal(struct sigaction *actp, in struct pthread *curthread = _get_curthread(); ucontext_t uc2; __siginfohandler_t *sigfunc; - int cancel_defer; int cancel_point; int cancel_async; int cancel_enable; @@ -213,12 +212,10 @@ handle_signal(struct sigaction *actp, in * cancellation is pending, to avoid this problem while thread is in * deferring mode, cancellation is temporarily disabled. */ - cancel_defer = curthread->cancel_defer; cancel_point = curthread->cancel_point; cancel_async = curthread->cancel_async; cancel_enable = curthread->cancel_enable; curthread->cancel_point = 0; - curthread->cancel_defer = 0; if (!cancel_async) curthread->cancel_enable = 0; @@ -245,7 +242,6 @@ handle_signal(struct sigaction *actp, in err = errno; curthread->in_sigsuspend = in_sigsuspend; - curthread->cancel_defer = cancel_defer; curthread->cancel_point = cancel_point; curthread->cancel_enable = cancel_enable; @@ -275,7 +271,7 @@ check_cancel(struct pthread *curthread, { if (__predict_true(!curthread->cancel_pending || !curthread->cancel_enable || - curthread->cancelling)) + curthread->no_cancel)) return; if (curthread->cancel_async) { From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 09:18:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE5E106566C; Sun, 19 Sep 2010 09:18:07 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9D48FC19; Sun, 19 Sep 2010 09:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J9I7op095577; Sun, 19 Sep 2010 09:18:07 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J9I7PD095575; Sun, 19 Sep 2010 09:18:07 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009190918.o8J9I7PD095575@svn.freebsd.org> From: Juli Mallett Date: Sun, 19 Sep 2010 09:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212842 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 09:18:07 -0000 Author: jmallett Date: Sun Sep 19 09:18:07 2010 New Revision: 212842 URL: http://svn.freebsd.org/changeset/base/212842 Log: Don't use memory that can't be direct-mapped on !n64. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Sun Sep 19 09:03:11 2010 (r212841) +++ head/sys/mips/cavium/octeon_machdep.c Sun Sep 19 09:18:07 2010 (r212842) @@ -286,6 +286,18 @@ octeon_memory_init(void) if (addr == -1) break; + /* + * The SDK needs to be able to easily map any memory that might + * come to it e.g. in the form of an mbuf. Because on !n64 we + * can't direct-map some addresses and we don't want to manage + * temporary mappings within the SDK, don't feed memory that + * can't be direct-mapped to the kernel. + */ +#if !defined(__mips_n64) + if (!MIPS_DIRECT_MAPPABLE(addr + (1 << 20) - 1)) + continue; +#endif + physmem += btoc(1 << 20); if (i > 0 && phys_avail[i - 1] == addr) { From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 09:18:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BBD10658E8; Sun, 19 Sep 2010 09:18:28 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4EF48FC1C; Sun, 19 Sep 2010 09:18:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J9IRPJ095624; Sun, 19 Sep 2010 09:18:27 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J9IRAQ095621; Sun, 19 Sep 2010 09:18:27 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009190918.o8J9IRAQ095621@svn.freebsd.org> From: Juli Mallett Date: Sun, 19 Sep 2010 09:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212843 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 09:18:28 -0000 Author: jmallett Date: Sun Sep 19 09:18:27 2010 New Revision: 212843 URL: http://svn.freebsd.org/changeset/base/212843 Log: Fix to specify generic bus_add_child. Modified: head/sys/mips/cavium/obio.c head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/obio.c ============================================================================== --- head/sys/mips/cavium/obio.c Sun Sep 19 09:18:07 2010 (r212842) +++ head/sys/mips/cavium/obio.c Sun Sep 19 09:18:27 2010 (r212843) @@ -192,6 +192,8 @@ static device_method_t obio_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_add_child, bus_generic_add_child), + {0, 0}, }; Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Sun Sep 19 09:18:07 2010 (r212842) +++ head/sys/mips/cavium/octopci.c Sun Sep 19 09:18:27 2010 (r212843) @@ -384,6 +384,8 @@ static device_method_t octopci_methods[] DEVMETHOD(bus_deactivate_resource,bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_add_child, bus_generic_add_child), + /* pcib interface */ DEVMETHOD(pcib_maxslots, octopci_maxslots), DEVMETHOD(pcib_read_config, octopci_read_config), From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 09:19:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C2A91065672; Sun, 19 Sep 2010 09:19:39 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9178FC32; Sun, 19 Sep 2010 09:19:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8J9JdUI095688; Sun, 19 Sep 2010 09:19:39 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8J9Jd2I095682; Sun, 19 Sep 2010 09:19:39 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009190919.o8J9Jd2I095682@svn.freebsd.org> From: Juli Mallett Date: Sun, 19 Sep 2010 09:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212844 - head/sys/contrib/octeon-sdk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 09:19:39 -0000 Author: jmallett Date: Sun Sep 19 09:19:38 2010 New Revision: 212844 URL: http://svn.freebsd.org/changeset/base/212844 Log: Add preliminary support for the Lanner MR-955. It boots multi-user but there seem to be problems both with the on-board Ethernet interfaces and the em(4) interfaces on PCI under FreeBSD. Thanks to Lanner for providing access to hardware. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-spi.c head/sys/contrib/octeon-sdk/cvmx-helper.c head/sys/contrib/octeon-sdk/cvmx-spi.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 19 09:19:38 2010 (r212844) @@ -182,7 +182,11 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_ITB101 = 10005, CVMX_BOARD_TYPE_CUST_NTE102 = 10006, CVMX_BOARD_TYPE_CUST_AGS103 = 10007, +#if !defined(OCTEON_VENDOR_LANNER) CVMX_BOARD_TYPE_CUST_GST104 = 10008, +#else + CVMX_BOARD_TYPE_CUST_LANNER_MR955= 10008, +#endif CVMX_BOARD_TYPE_CUST_GCT105 = 10009, CVMX_BOARD_TYPE_CUST_AGS106 = 10010, CVMX_BOARD_TYPE_CUST_SGM107 = 10011, @@ -257,7 +261,11 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_ITB101) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NTE102) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS103) +#if !defined(OCTEON_VENDOR_LANNER) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GST104) +#else + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR955) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT105) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS106) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_SGM107) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sun Sep 19 09:19:38 2010 (r212844) @@ -114,6 +114,9 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_EBT5800: case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: +#endif /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -616,6 +619,12 @@ int __cvmx_helper_board_interface_probe( if (interface == 1) return 0; break; +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + if (interface == 1) + return 12; + break; +#endif } #ifdef CVMX_BUILD_FOR_UBOOT if (CVMX_HELPER_INTERFACE_MODE_SPI == cvmx_helper_interface_get_mode(interface) && getenv("disable_spi")) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Sun Sep 19 09:19:38 2010 (r212844) @@ -82,6 +82,21 @@ int __cvmx_helper_spi_probe(int interfac { num_ports = 10; } +#if defined(OCTEON_VENDOR_LANNER) + else if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_LANNER_MR955) + { + cvmx_pko_reg_crc_enable_t enable; + if (interface == 1) { + num_ports = 12; + } else { + /* XXX This is not entirely true. */ + num_ports = 0; + } + enable.u64 = cvmx_read_csr(CVMX_PKO_REG_CRC_ENABLE); + enable.s.enable &= 0xffff << (16 - (interface*16)); + cvmx_write_csr(CVMX_PKO_REG_CRC_ENABLE, enable.u64); + } +#endif else { cvmx_pko_reg_crc_enable_t enable; Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper.c Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper.c Sun Sep 19 09:19:38 2010 (r212844) @@ -101,6 +101,15 @@ static CVMX_SHARED cvmx_helper_link_info */ int cvmx_helper_get_number_of_interfaces(void) { + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + return 2; +#endif + default: + break; + } + if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX)) return 4; else Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-spi.c Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-spi.c Sun Sep 19 09:19:38 2010 (r212844) @@ -515,7 +515,11 @@ int cvmx_spi_training_cb(int interface, // Wait for the training sequence to complete cvmx_dprintf ("SPI%d: Waiting for training\n", interface); cvmx_wait (1000 * MS); +#if !defined(OCTEON_VENDOR_LANNER) timeout_time = cvmx_get_cycle() + 1000ull * MS * 600; /* Wait a really long time here */ +#else + timeout_time = cvmx_get_cycle() + 1000ull * MS * 10; +#endif /* The HRM says we must wait for 34 + 16 * MAXDIST training sequences. We'll be pessimistic and wait for a lot more */ rx_training_needed = 500; From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 09:47:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 157A0106566C; Sun, 19 Sep 2010 09:47:21 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id E08998FC1B; Sun, 19 Sep 2010 09:47:20 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id CB82E11B851; Sun, 19 Sep 2010 04:47:19 -0500 (CDT) Received: from 10.0.10.3 (221.163.108.93.rev.vodafone.pt [93.108.163.221]) by lavabit.com with ESMTP id 41VM947P2XGD; Sun, 19 Sep 2010 04:47:19 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: Date: Sun, 19 Sep 2010 10:47:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201009182338.o8INcLF8081790@svn.freebsd.org> To: pluknet X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212831 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 09:47:21 -0000 On 19 Sep 2010, at 09:01, pluknet wrote: > On 19 September 2010 03:38, Rui Paulo wrote: >> Author: rpaulo >> Date: Sat Sep 18 23:38:21 2010 >> New Revision: 212831 >> URL: http://svn.freebsd.org/changeset/base/212831 >>=20 >> Log: >> Ignore EINTR when calling waitpid. >>=20 >> Modified: >> head/lib/libproc/proc_util.c >>=20 >> Modified: head/lib/libproc/proc_util.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libproc/proc_util.c Sat Sep 18 22:37:47 2010 = (r212830) >> +++ head/lib/libproc/proc_util.c Sat Sep 18 23:38:21 2010 = (r212831) >> @@ -145,7 +145,8 @@ proc_wstatus(struct proc_handle *phdl) >> if (phdl =3D=3D NULL) >> return (-1); >> if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { >> - warn("waitpid"); >> + if (errno !=3D EINTR) >> + warn("waitpid"); >> return (-1); >> } >> if (WIFSTOPPED(status)) >=20 > Hi. >=20 > After this change the waitpid() error handling still doesn't > ignore EINTR (well, only warn() ignores EINTR now), > but it rather returns with -1. Is it intentional? > I though something more like this was meant in svn log: >=20 > while (waitpid(...) < 0) > if (errno !=3D EINTR) { > warn("waitpid"); > return (-1); > } Maybe the log was badly worded, but the code is right. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 10:45:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E510106564A; Sun, 19 Sep 2010 10:45:54 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF368FC13; Sun, 19 Sep 2010 10:45:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JAjr4q098982; Sun, 19 Sep 2010 10:45:53 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JAjrud098980; Sun, 19 Sep 2010 10:45:53 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201009191045.o8JAjrud098980@svn.freebsd.org> From: Brian Somers Date: Sun, 19 Sep 2010 10:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212845 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 10:45:54 -0000 Author: brian Date: Sun Sep 19 10:45:53 2010 New Revision: 212845 URL: http://svn.freebsd.org/changeset/base/212845 Log: Support attaching version 4 metadata Reviewed by: pjd Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sun Sep 19 09:19:38 2010 (r212844) +++ head/sys/geom/eli/g_eli.h Sun Sep 19 10:45:53 2010 (r212845) @@ -228,8 +228,9 @@ eli_metadata_decode_v0(const u_char *dat return (EINVAL); return (0); } + static __inline int -eli_metadata_decode_v1v2v3(const u_char *data, struct g_eli_metadata *md) +eli_metadata_decode_v1v2v3v4(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; const u_char *p; @@ -266,7 +267,8 @@ eli_metadata_decode(const u_char *data, case 1: case 2: case 3: - error = eli_metadata_decode_v1v2v3(data, md); + case 4: + error = eli_metadata_decode_v1v2v3v4(data, md); break; default: error = EINVAL; From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 10:51:28 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE43A106566B; Sun, 19 Sep 2010 10:51:28 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 330748FC0A; Sun, 19 Sep 2010 10:51:28 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 25921A6A8E5; Sun, 19 Sep 2010 18:51:26 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id O0S082CB36nL; Sun, 19 Sep 2010 18:51:18 +0800 (CST) Received: from delta.delphij.net (c-76-102-48-203.hsd1.ca.comcast.net [76.102.48.203]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id BF91EA6A8DC; Sun, 19 Sep 2010 18:51:16 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=hWjobpvnYMwMLcUbZwTJ3Cnt/fghrlkPhimnpABEmMVg0eKyfUp8+0TQCHjdH6GW1 +TFzUdqqvHp2ljxYecSRA== Message-ID: <4C95EB21.1030304@delphij.net> Date: Sun, 19 Sep 2010 03:51:13 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.12) Gecko/20100909 Thunderbird/3.0.7 ThunderBrowse/3.3.2 MIME-Version: 1.0 To: Warner Losh References: <201009130144.o8D1i7jr045217@svn.freebsd.org> In-Reply-To: <201009130144.o8D1i7jr045217@svn.freebsd.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r212517 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 10:51:28 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/09/12 18:44, Warner Losh wrote: > Author: imp > Date: Mon Sep 13 01:44:07 2010 > New Revision: 212517 > URL: http://svn.freebsd.org/changeset/base/212517 > > Log: > Include FreeBSD svn tag The file was completely the same with libz vendor version now (except your addition of $FreeBSD$ tag). Plus: [delphij@delta] /usr/src/lib/libz> svn pl minigzip.c Properties on 'minigzip.c': fbsd:nokeywords Or, do we require $FreeBSD$ tags for every files? > Modified: > head/lib/libz/minigzip.c > Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJMleshAAoJEATO+BI/yjfB9U4IAIodWHl2YHawJfru3Tpd4GQW MVuHGjPGyV8rkB/ABntFZ4u+nDxwn9gah2f4CXfKnQx5+49QMaie4ubQEbAzFvZF a/hanbix4keiJIsHXBfm+r3NStMUtw9rgDjs+j73j0qNjkya62FlvbMF6Q7FeWsw Z5LTrH7bNBhfLqAkbVcyvqHqajsjAh025UQ/2Z9in38f3P+8FTSWBXWeunHNfsAr q+F8lEftrFH9+PIweBV18D0RReSTE9XKq448lJeeKQN9n26Zjgari7j+FEsWlzQj WyZK/YOQNMOUCQQB/FWmBHOlHh0qaOSitWyYvMzIilfNR3ercQpT8oIZOLc91j8= =EZjg -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 10:51:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 734F51065703; Sun, 19 Sep 2010 10:51:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47F568FC12; Sun, 19 Sep 2010 10:51:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JAptxa099149; Sun, 19 Sep 2010 10:51:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JAptS7099147; Sun, 19 Sep 2010 10:51:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009191051.o8JAptS7099147@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 19 Sep 2010 10:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212846 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 10:51:55 -0000 Author: pjd Date: Sun Sep 19 10:51:55 2010 New Revision: 212846 URL: http://svn.freebsd.org/changeset/base/212846 Log: Fix indent. Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sun Sep 19 10:45:53 2010 (r212845) +++ head/sbin/geom/class/eli/geli.8 Sun Sep 19 10:51:55 2010 (r212846) @@ -217,7 +217,7 @@ The metadata can be recovered with the subcommand described below. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar aalgo" +.Bl -tag -width ".Fl a Ar newkeyfile" .It Fl a Ar aalgo Enable data integrity verification (authentication) using the given algorithm. This will reduce size of available storage and also reduce speed. @@ -302,7 +302,7 @@ provider's name with an suffix. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar algo" +.Bl -tag -width ".Fl a Ar keyfile" .It Fl d If specified, a decrypted provider will be detached automatically on last close. This can help with short memory - user does not have to remember to detach the @@ -332,7 +332,7 @@ Detach the given providers, which means and clear the keys from memory. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar algo" +.Bl -tag -width ".Fl f" .It Fl f Force detach - detach even if the provider is open. .It Fl l @@ -347,7 +347,7 @@ Attach the given providers with random, The command can be used to encrypt swap partitions or temporary file systems. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar aalgo" +.Bl -tag -width ".Fl a Ar sectorsize" .It Fl a Ar aalgo Enable data integrity verification (authentication). For more information, see the description of the @@ -402,7 +402,7 @@ When a provider is attached, the user do an old passphrase/keyfile. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar algo" +.Bl -tag -width ".Fl a Ar iterations" .It Fl i Ar iterations Number of iterations to use with PKCS#5v2. If 0 is given, PKCS#5v2 will not be used. @@ -432,7 +432,7 @@ will not be detached even if all keys wi It can be even rescued with the .Cm setkey subcommand. -.Bl -tag -width ".Fl a Ar algo" +.Bl -tag -width ".Fl a Ar keyno" .It Fl a Destroy all keys (does not need .Fl f @@ -456,7 +456,7 @@ backup, your data is gone for good. In case the provider was attached with the .Fl r flag, the keys will not be destroyed, only the provider will be detached. -.Bl -tag -width ".Fl a Ar algo" +.Bl -tag -width ".Fl a" .It Fl a If specified, all currently attached providers will be killed. .El From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 10:54:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A58D106564A; Sun, 19 Sep 2010 10:54:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77AB78FC12; Sun, 19 Sep 2010 10:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JAswtJ099279; Sun, 19 Sep 2010 10:54:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JAswIL099270; Sun, 19 Sep 2010 10:54:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201009191054.o8JAswIL099270@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Sep 2010 10:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212847 - in head/lib/clang: libllvmarmasmparser libllvmarminfo libllvmbitreader libllvminstcombine libllvmmipsinfo libllvmpowerpcinfo libllvmx86asmparser libllvmx86info X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 10:54:58 -0000 Author: dim Date: Sun Sep 19 10:54:58 2010 New Revision: 212847 URL: http://svn.freebsd.org/changeset/base/212847 Log: In all Makefiles under lib/clang, consistently use tabs instead of spaces after the '=' sign in macro assignments. Approved-by: rpaulo (mentor) Modified: head/lib/clang/libllvmarmasmparser/Makefile head/lib/clang/libllvmarminfo/Makefile head/lib/clang/libllvmbitreader/Makefile head/lib/clang/libllvminstcombine/Makefile head/lib/clang/libllvmmipsinfo/Makefile head/lib/clang/libllvmpowerpcinfo/Makefile head/lib/clang/libllvmx86asmparser/Makefile head/lib/clang/libllvmx86info/Makefile Modified: head/lib/clang/libllvmarmasmparser/Makefile ============================================================================== --- head/lib/clang/libllvmarmasmparser/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmarmasmparser/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -7,7 +7,7 @@ INCDIR= lib/Target/ARM SRCS= ARMAsmParser.cpp \ ARMAsmLexer.cpp -TGHDRS= ARMGenInstrNames \ +TGHDRS= ARMGenInstrNames \ ARMGenRegisterInfo.h \ ARMGenRegisterNames Modified: head/lib/clang/libllvmarminfo/Makefile ============================================================================== --- head/lib/clang/libllvmarminfo/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmarminfo/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -6,7 +6,7 @@ SRCDIR= lib/Target/ARM/TargetInfo/ INCDIR= lib/Target/ARM SRCS= ARMTargetInfo.cpp -TGHDRS= ARMGenInstrNames \ +TGHDRS= ARMGenInstrNames \ ARMGenRegisterNames .include "../clang.lib.mk" Modified: head/lib/clang/libllvmbitreader/Makefile ============================================================================== --- head/lib/clang/libllvmbitreader/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmbitreader/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -6,6 +6,6 @@ SRCDIR= lib/Bitcode/Reader SRCS= BitReader.cpp \ BitcodeReader.cpp -TGHDRS= Intrinsics +TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvminstcombine/Makefile ============================================================================== --- head/lib/clang/libllvminstcombine/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvminstcombine/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -17,6 +17,6 @@ SRCS= InstCombineAddSub.cpp \ InstCombineVectorOps.cpp \ InstructionCombining.cpp -TGHDRS= Intrinsics +TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmmipsinfo/Makefile ============================================================================== --- head/lib/clang/libllvmmipsinfo/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmmipsinfo/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -6,7 +6,7 @@ SRCDIR= lib/Target/Mips/TargetInfo/ INCDIR= lib/Target/Mips SRCS= MipsTargetInfo.cpp -TGHDRS= MipsGenRegisterNames \ +TGHDRS= MipsGenRegisterNames \ MipsGenInstrNames .include "../clang.lib.mk" Modified: head/lib/clang/libllvmpowerpcinfo/Makefile ============================================================================== --- head/lib/clang/libllvmpowerpcinfo/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmpowerpcinfo/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -6,7 +6,7 @@ SRCDIR= lib/Target/PowerPC/TargetInfo/ INCDIR= lib/Target/PowerPC SRCS= PowerPCTargetInfo.cpp -TGHDRS= PPCGenRegisterNames \ +TGHDRS= PPCGenRegisterNames \ PPCGenInstrNames .include "../clang.lib.mk" Modified: head/lib/clang/libllvmx86asmparser/Makefile ============================================================================== --- head/lib/clang/libllvmx86asmparser/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmx86asmparser/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -7,7 +7,7 @@ INCDIR= lib/Target/X86 SRCS= X86AsmLexer.cpp \ X86AsmParser.cpp -TGHDRS= X86GenAsmMatcher \ +TGHDRS= X86GenAsmMatcher \ X86GenInstrNames \ X86GenRegisterNames Modified: head/lib/clang/libllvmx86info/Makefile ============================================================================== --- head/lib/clang/libllvmx86info/Makefile Sun Sep 19 10:51:55 2010 (r212846) +++ head/lib/clang/libllvmx86info/Makefile Sun Sep 19 10:54:58 2010 (r212847) @@ -6,7 +6,7 @@ SRCDIR= lib/Target/X86/TargetInfo/ INCDIR= lib/Target/X86 SRCS= X86TargetInfo.cpp -TGHDRS= X86GenInstrNames \ +TGHDRS= X86GenInstrNames \ X86GenRegisterNames .include "../clang.lib.mk" From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 11:42:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42CBA106564A; Sun, 19 Sep 2010 11:42:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17B158FC13; Sun, 19 Sep 2010 11:42:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JBgG3p000546; Sun, 19 Sep 2010 11:42:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JBgGbx000543; Sun, 19 Sep 2010 11:42:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009191142.o8JBgGbx000543@svn.freebsd.org> From: Michael Tuexen Date: Sun, 19 Sep 2010 11:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212850 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 11:42:17 -0000 Author: tuexen Date: Sun Sep 19 11:42:16 2010 New Revision: 212850 URL: http://svn.freebsd.org/changeset/base/212850 Log: Fix a locking issue which shows up when the code is used on Mac OS X. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Sun Sep 19 11:22:22 2010 (r212849) +++ head/sys/netinet/sctp_auth.c Sun Sep 19 11:42:16 2010 (r212850) @@ -614,7 +614,7 @@ sctp_auth_key_release(struct sctp_tcb *s if ((skey->refcount <= 1) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, - key_id, 0, SCTP_SO_NOT_LOCKED); + key_id, 0, SCTP_SO_LOCKED); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, stcb, key_id, skey->refcount); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Sep 19 11:22:22 2010 (r212849) +++ head/sys/netinet/sctp_pcb.c Sun Sep 19 11:42:16 2010 (r212850) @@ -4822,7 +4822,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, /* Still an open socket - report */ sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, SCTP_NOTIFY_DATAGRAM_UNSENT, - (void *)sp, 0); + (void *)sp, SCTP_SO_LOCKED); } if (sp->data) { sctp_m_freem(sp->data); @@ -4894,7 +4894,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (so) { /* Still a socket? */ sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, 0); + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); @@ -4929,7 +4929,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (so) { /* Still a socket? */ sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_SENT, chk, 0); + SCTP_NOTIFY_DATAGRAM_SENT, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 11:57:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1CE4106566C; Sun, 19 Sep 2010 11:57:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C10BB8FC12; Sun, 19 Sep 2010 11:57:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JBvLuL000976; Sun, 19 Sep 2010 11:57:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JBvLeT000974; Sun, 19 Sep 2010 11:57:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009191157.o8JBvLeT000974@svn.freebsd.org> From: Michael Tuexen Date: Sun, 19 Sep 2010 11:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212851 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 11:57:21 -0000 Author: tuexen Date: Sun Sep 19 11:57:21 2010 New Revision: 212851 URL: http://svn.freebsd.org/changeset/base/212851 Log: Allow the initial congestion window to be configure to one MTU. Improve the description. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Sep 19 11:42:16 2010 (r212850) +++ head/sys/netinet/sctp_sysctl.h Sun Sep 19 11:57:21 2010 (r212851) @@ -499,8 +499,8 @@ struct sctp_sysctl { #define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN /* Initial congestion window in MTU */ -#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTU" -#define SCTPCTL_INITIAL_CWND_MIN 2 +#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" +#define SCTPCTL_INITIAL_CWND_MIN 1 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 12:01:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D9610656B1; Sun, 19 Sep 2010 12:01:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6432B8FC35; Sun, 19 Sep 2010 12:01:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JC1ogH001120; Sun, 19 Sep 2010 12:01:50 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JC1oaa001118; Sun, 19 Sep 2010 12:01:50 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201009191201.o8JC1oaa001118@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 19 Sep 2010 12:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212852 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 12:01:50 -0000 Author: tijl Date: Sun Sep 19 12:01:50 2010 New Revision: 212852 URL: http://svn.freebsd.org/changeset/base/212852 Log: Indicate that POSIX semaphores are always supported. Reported by: avilla Reviewed by: davidxu Approved by: kib (mentor) Modified: head/sys/sys/unistd.h Modified: head/sys/sys/unistd.h ============================================================================== --- head/sys/sys/unistd.h Sun Sep 19 11:57:21 2010 (r212851) +++ head/sys/sys/unistd.h Sun Sep 19 12:01:50 2010 (r212852) @@ -68,7 +68,7 @@ #define _POSIX_PRIORITY_SCHEDULING 200112L #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L -#define _POSIX_SEMAPHORES -1 +#define _POSIX_SEMAPHORES 200112L #define _POSIX_SHARED_MEMORY_OBJECTS 200112L #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_SYNCHRONIZED_IO -1 From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 12:39:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062F41065672; Sun, 19 Sep 2010 12:39:05 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B2F8FC08; Sun, 19 Sep 2010 12:39:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JCd4ao001914; Sun, 19 Sep 2010 12:39:04 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JCd4gG001912; Sun, 19 Sep 2010 12:39:04 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201009191239.o8JCd4gG001912@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 19 Sep 2010 12:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212853 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 12:39:05 -0000 Author: bschmidt Date: Sun Sep 19 12:39:04 2010 New Revision: 212853 URL: http://svn.freebsd.org/changeset/base/212853 Log: Group functions used for initial calibration. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:01:50 2010 (r212852) +++ head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:39:04 2010 (r212853) @@ -135,8 +135,6 @@ static void iwn_rx_done(struct iwn_softc static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); #endif -static void iwn5000_rx_calib_results(struct iwn_softc *, - struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn4965_tx_done(struct iwn_softc *, struct iwn_rx_desc *, @@ -220,8 +218,10 @@ static void iwn5000_ampdu_tx_start(struc struct ieee80211_node *, uint8_t, uint16_t); static void iwn5000_ampdu_tx_stop(struct iwn_softc *, uint8_t, uint16_t); #endif -static int iwn5000_query_calibration(struct iwn_softc *); static int iwn5000_send_calibration(struct iwn_softc *); +static int iwn5000_query_calibration(struct iwn_softc *); +static void iwn5000_rx_calib_results(struct iwn_softc *, + struct iwn_rx_desc *, struct iwn_rx_data *); static int iwn5000_send_wimax_coex(struct iwn_softc *); static int iwn4965_post_alive(struct iwn_softc *); static int iwn5000_post_alive(struct iwn_softc *); @@ -2196,64 +2196,6 @@ iwn_rx_compressed_ba(struct iwn_softc *s #endif /* - * Process a CALIBRATION_RESULT notification sent by the initialization - * firmware on response to a CMD_CALIB_CONFIG command (5000 only.) - */ -static void -iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, - struct iwn_rx_data *data) -{ - struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); - int len, idx = -1; - - /* Runtime firmware should not send such a notification. */ - if (sc->sc_flags & IWN_FLAG_CALIB_DONE) - return; - - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - len = (le32toh(desc->len) & 0x3fff) - 4; - - switch (calib->code) { - case IWN5000_PHY_CALIB_DC: - if (sc->hw_type == IWN_HW_REV_TYPE_5150 || - sc->hw_type == IWN_HW_REV_TYPE_6050) - idx = 0; - break; - case IWN5000_PHY_CALIB_LO: - idx = 1; - break; - case IWN5000_PHY_CALIB_TX_IQ: - idx = 2; - break; - case IWN5000_PHY_CALIB_TX_IQ_PERIODIC: - if (sc->hw_type < IWN_HW_REV_TYPE_6000 && - sc->hw_type != IWN_HW_REV_TYPE_5150) - idx = 3; - break; - case IWN5000_PHY_CALIB_BASE_BAND: - idx = 4; - break; - } - if (idx == -1) /* Ignore other results. */ - return; - - /* Save calibration result. */ - if (sc->calibcmd[idx].buf != NULL) - free(sc->calibcmd[idx].buf, M_DEVBUF); - sc->calibcmd[idx].buf = malloc(len, M_DEVBUF, M_NOWAIT); - if (sc->calibcmd[idx].buf == NULL) { - DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "not enough memory for calibration result %d\n", - calib->code); - return; - } - DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "saving calibration result code=%d len=%d\n", calib->code, len); - sc->calibcmd[idx].len = len; - memcpy(sc->calibcmd[idx].buf, calib, len); -} - -/* * Process an RX_STATISTICS or BEACON_STATISTICS firmware notification. * The latter is sent by the firmware after each received beacon. */ @@ -5239,6 +5181,33 @@ iwn5000_ampdu_tx_stop(struct iwn_softc * #endif /* + * Send calibration results to the runtime firmware. These results were + * obtained on first boot from the initialization firmware. + */ +static int +iwn5000_send_calibration(struct iwn_softc *sc) +{ + int idx, error; + + for (idx = 0; idx < 5; idx++) { + if (sc->calibcmd[idx].buf == NULL) + continue; /* No results available. */ + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "send calibration result idx=%d len=%d\n", + idx, sc->calibcmd[idx].len); + error = iwn_cmd(sc, IWN_CMD_PHY_CALIB, sc->calibcmd[idx].buf, + sc->calibcmd[idx].len, 0); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not send calibration result, error %d\n", + __func__, error); + return error; + } + } + return 0; +} + +/* * Query calibration tables from the initialization firmware. We do this * only once at first boot. Called from a process context. */ @@ -5266,30 +5235,61 @@ iwn5000_query_calibration(struct iwn_sof } /* - * Send calibration results to the runtime firmware. These results were - * obtained on first boot from the initialization firmware. + * Process a CALIBRATION_RESULT notification sent by the initialization + * firmware on response to a CMD_CALIB_CONFIG command (5000 only.) */ -static int -iwn5000_send_calibration(struct iwn_softc *sc) +static void +iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, + struct iwn_rx_data *data) { - int idx, error; + struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); + int len, idx = -1; - for (idx = 0; idx < 5; idx++) { - if (sc->calibcmd[idx].buf == NULL) - continue; /* No results available. */ + /* Runtime firmware should not send such a notification. */ + if (sc->sc_flags & IWN_FLAG_CALIB_DONE) + return; + + bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); + len = (le32toh(desc->len) & 0x3fff) - 4; + + switch (calib->code) { + case IWN5000_PHY_CALIB_DC: + if (sc->hw_type == IWN_HW_REV_TYPE_5150 || + sc->hw_type == IWN_HW_REV_TYPE_6050) + idx = 0; + break; + case IWN5000_PHY_CALIB_LO: + idx = 1; + break; + case IWN5000_PHY_CALIB_TX_IQ: + idx = 2; + break; + case IWN5000_PHY_CALIB_TX_IQ_PERIODIC: + if (sc->hw_type < IWN_HW_REV_TYPE_6000 && + sc->hw_type != IWN_HW_REV_TYPE_5150) + idx = 3; + break; + case IWN5000_PHY_CALIB_BASE_BAND: + idx = 4; + break; + } + if (idx == -1) /* Ignore other results. */ + return; + + /* Save calibration result. */ + if (sc->calibcmd[idx].buf != NULL) + free(sc->calibcmd[idx].buf, M_DEVBUF); + sc->calibcmd[idx].buf = malloc(len, M_DEVBUF, M_NOWAIT); + if (sc->calibcmd[idx].buf == NULL) { DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "send calibration result idx=%d len=%d\n", - idx, sc->calibcmd[idx].len); - error = iwn_cmd(sc, IWN_CMD_PHY_CALIB, sc->calibcmd[idx].buf, - sc->calibcmd[idx].len, 0); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: could not send calibration result, error %d\n", - __func__, error); - return error; - } + "not enough memory for calibration result %d\n", + calib->code); + return; } - return 0; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "saving calibration result code=%d len=%d\n", calib->code, len); + sc->calibcmd[idx].len = len; + memcpy(sc->calibcmd[idx].buf, calib, len); } static int From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 12:47:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F98106564A; Sun, 19 Sep 2010 12:47:41 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60FFB8FC15; Sun, 19 Sep 2010 12:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JClfsH002185; Sun, 19 Sep 2010 12:47:41 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JClfu9002182; Sun, 19 Sep 2010 12:47:41 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201009191247.o8JClfu9002182@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 19 Sep 2010 12:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212854 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 12:47:41 -0000 Author: bschmidt Date: Sun Sep 19 12:47:41 2010 New Revision: 212854 URL: http://svn.freebsd.org/changeset/base/212854 Log: Rewrite parts of the calibration code which is run while bringing up the device: - unobscure some of the code by moving it into its own functions - get rid of some magic numbers - create similar structure as the reference driver has, this should make further syncs easier Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:39:04 2010 (r212853) +++ head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:47:41 2010 (r212854) @@ -218,9 +218,13 @@ static void iwn5000_ampdu_tx_start(struc struct ieee80211_node *, uint8_t, uint16_t); static void iwn5000_ampdu_tx_stop(struct iwn_softc *, uint8_t, uint16_t); #endif -static int iwn5000_send_calibration(struct iwn_softc *); -static int iwn5000_query_calibration(struct iwn_softc *); -static void iwn5000_rx_calib_results(struct iwn_softc *, +static int iwn5000_send_calib_results(struct iwn_softc *); +static int iwn5000_save_calib_result(struct iwn_softc *, + struct iwn_phy_calib *, int, int); +static void iwn5000_free_calib_results(struct iwn_softc *); +static int iwn5000_chrystal_calib(struct iwn_softc *); +static int iwn5000_send_calib_query(struct iwn_softc *); +static int iwn5000_rx_calib_result(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static int iwn5000_send_wimax_coex(struct iwn_softc *); static int iwn4965_post_alive(struct iwn_softc *); @@ -705,6 +709,9 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn5000fw"; sc->txchainmask = IWN_ANT_B; sc->rxchainmask = IWN_ANT_AB; + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_TX_IQ_PERIODIC | + IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_5150: sc->sc_hal = &iwn5000_hal; @@ -712,6 +719,8 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn5150fw"; sc->txchainmask = IWN_ANT_A; sc->rxchainmask = IWN_ANT_AB; + sc->calib_init = IWN_CALIB_DC | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_5300: case IWN_HW_REV_TYPE_5350: @@ -720,6 +729,9 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn5000fw"; sc->txchainmask = IWN_ANT_ABC; sc->rxchainmask = IWN_ANT_ABC; + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_TX_IQ_PERIODIC | + IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_1000: sc->sc_hal = &iwn5000_hal; @@ -727,6 +739,9 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn1000fw"; sc->txchainmask = IWN_ANT_A; sc->rxchainmask = IWN_ANT_AB; + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_TX_IQ_PERIODIC | + IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_6000: sc->sc_hal = &iwn5000_hal; @@ -744,6 +759,8 @@ iwn_hal_attach(struct iwn_softc *sc) sc->rxchainmask = IWN_ANT_ABC; break; } + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_6050: sc->sc_hal = &iwn5000_hal; @@ -751,6 +768,8 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn6050fw"; sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_AB; + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_DC | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; break; case IWN_HW_REV_TYPE_6005: sc->sc_hal = &iwn5000_hal; @@ -758,6 +777,8 @@ iwn_hal_attach(struct iwn_softc *sc) sc->fwname = "iwn6005fw"; sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_AB; + sc->calib_init = IWN_CALIB_XTAL | IWN_CALIB_LO | + IWN_CALIB_TX_IQ | IWN_CALIB_BASE_BAND; break; default: device_printf(sc->sc_dev, "adapter type %d not supported\n", @@ -842,6 +863,8 @@ iwn_cleanup(device_t dev) ieee80211_ifdetach(ic); } + iwn5000_free_calib_results(sc); + /* Free DMA resources. */ iwn_free_rx_ring(sc, &sc->rxq); if (sc->sc_hal != NULL) @@ -1697,12 +1720,6 @@ iwn5000_read_eeprom(struct iwn_softc *sc sc->temp_off = temp - (volt / -5); DPRINTF(sc, IWN_DEBUG_CALIBRATE, "temp=%d volt=%d offset=%dK\n", temp, volt, sc->temp_off); - } else { - /* Read crystal calibration. */ - iwn_read_prom_data(sc, base + IWN5000_EEPROM_CRYSTAL, - &sc->eeprom_crystal, sizeof (uint32_t)); - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "crystal calibration 0x%08x\n", - le32toh(sc->eeprom_crystal)); } } @@ -2550,7 +2567,7 @@ iwn_notif_intr(struct iwn_softc *sc) break; } case IWN5000_CALIBRATION_RESULT: - iwn5000_rx_calib_results(sc, desc, data); + iwn5000_rx_calib_result(sc, desc, data); break; case IWN5000_CALIBRATION_DONE: @@ -5182,25 +5199,37 @@ iwn5000_ampdu_tx_stop(struct iwn_softc * /* * Send calibration results to the runtime firmware. These results were - * obtained on first boot from the initialization firmware. + * obtained on first boot from the initialization firmware, or by reading + * the EEPROM for crystal calibration. */ static int -iwn5000_send_calibration(struct iwn_softc *sc) +iwn5000_send_calib_results(struct iwn_softc *sc) { + struct iwn_calib_info *calib_result; int idx, error; - for (idx = 0; idx < 5; idx++) { - if (sc->calibcmd[idx].buf == NULL) - continue; /* No results available. */ + for (idx = 0; idx < IWN_CALIB_NUM; idx++) { + calib_result = &sc->calib_results[idx]; + + /* No support for this type of calibration. */ + if ((sc->calib_init & (1 << idx)) == 0) + continue; + + /* No calibration result available. */ + if (calib_result->buf == NULL) + continue; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "send calibration result idx=%d len=%d\n", - idx, sc->calibcmd[idx].len); - error = iwn_cmd(sc, IWN_CMD_PHY_CALIB, sc->calibcmd[idx].buf, - sc->calibcmd[idx].len, 0); + "%s: send calibration result idx=%d, len=%d\n", + __func__, idx, calib_result->len); + + error = iwn_cmd(sc, IWN_CMD_PHY_CALIB, calib_result->buf, + calib_result->len, 0); if (error != 0) { device_printf(sc->sc_dev, - "%s: could not send calibration result, error %d\n", - __func__, error); + "%s: could not send calibration result " + "idx=%d, error=%d\n", + __func__, idx, error); return error; } } @@ -5208,22 +5237,101 @@ iwn5000_send_calibration(struct iwn_soft } /* - * Query calibration tables from the initialization firmware. We do this - * only once at first boot. Called from a process context. + * Save calibration result at the given index. The index determines + * in which order the results are sent to the runtime firmware. */ static int -iwn5000_query_calibration(struct iwn_softc *sc) +iwn5000_save_calib_result(struct iwn_softc *sc, struct iwn_phy_calib *calib, + int len, int idx) { + struct iwn_calib_info *calib_result = &sc->calib_results[idx]; + + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: saving calibration result code=%d, idx=%d, len=%d\n", + __func__, calib->code, idx, len); + + if (calib_result->buf != NULL) + free(calib_result->buf, M_DEVBUF); + + calib_result->buf = malloc(len, M_DEVBUF, M_NOWAIT); + if (calib_result->buf == NULL) { + device_printf(sc->sc_dev, + "%s: not enough memory for calibration result " + "code=%d, len=%d\n", __func__, calib->code, len); + return ENOMEM; + } + + calib_result->len = len; + memcpy(calib_result->buf, calib, len); + return 0; +} + +static void +iwn5000_free_calib_results(struct iwn_softc *sc) +{ + struct iwn_calib_info *calib_result; + int idx; + + for (idx = 0; idx < IWN_CALIB_NUM; idx++) { + calib_result = &sc->calib_results[idx]; + + if (calib_result->buf != NULL) + free(calib_result->buf, M_DEVBUF); + + calib_result->buf = NULL; + calib_result->len = 0; + } +} + +/* + * Obtain the crystal calibration result from the EEPROM. + */ +static int +iwn5000_chrystal_calib(struct iwn_softc *sc) +{ + struct iwn5000_phy_calib_crystal cmd; + uint32_t base, crystal; + uint16_t val; + + /* Read crystal calibration. */ + iwn_read_prom_data(sc, IWN5000_EEPROM_CAL, &val, 2); + base = le16toh(val); + iwn_read_prom_data(sc, base + IWN5000_EEPROM_CRYSTAL, &crystal, + sizeof(uint32_t)); + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: crystal calibration=0x%08x\n", + __func__, le32toh(crystal)); + + memset(&cmd, 0, sizeof cmd); + cmd.code = IWN5000_PHY_CALIB_CRYSTAL; + cmd.ngroups = 1; + cmd.isvalid = 1; + cmd.cap_pin[0] = le32toh(crystal) & 0xff; + cmd.cap_pin[1] = (le32toh(crystal) >> 16) & 0xff; + + return iwn5000_save_calib_result(sc, (struct iwn_phy_calib *)&cmd, + sizeof cmd, IWN_CALIB_IDX_XTAL); +} + +/* + * Query calibration results from the initialization firmware. We do this + * only once at first boot. + */ +static int +iwn5000_send_calib_query(struct iwn_softc *sc) +{ +#define CALIB_INIT_CFG 0xffffffff; struct iwn5000_calib_config cmd; int error; memset(&cmd, 0, sizeof cmd); - cmd.ucode.once.enable = 0xffffffff; - cmd.ucode.once.start = 0xffffffff; - cmd.ucode.once.send = 0xffffffff; - cmd.ucode.flags = 0xffffffff; - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: sending calibration query\n", + cmd.ucode.once.enable = CALIB_INIT_CFG; + cmd.ucode.once.start = CALIB_INIT_CFG; + cmd.ucode.once.send = CALIB_INIT_CFG; + cmd.ucode.flags = CALIB_INIT_CFG; + + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: query calibration results\n", __func__); + error = iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof cmd, 0); if (error != 0) return error; @@ -5231,65 +5339,56 @@ iwn5000_query_calibration(struct iwn_sof /* Wait at most two seconds for calibration to complete. */ if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) error = msleep(sc, &sc->sc_mtx, PCATCH, "iwninit", 2 * hz); + return error; +#undef CALIB_INIT_CFG } /* * Process a CALIBRATION_RESULT notification sent by the initialization - * firmware on response to a CMD_CALIB_CONFIG command (5000 only.) + * firmware on response to a CMD_CALIB_CONFIG command. */ -static void -iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, +static int +iwn5000_rx_calib_result(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { +#define FRAME_SIZE_MASK 0x3fff struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); - int len, idx = -1; - - /* Runtime firmware should not send such a notification. */ - if (sc->sc_flags & IWN_FLAG_CALIB_DONE) - return; + int len, idx; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - len = (le32toh(desc->len) & 0x3fff) - 4; + len = (le32toh(desc->len) & FRAME_SIZE_MASK); + /* Remove length filed itself. */ + len -= 4; + + /* + * Determine the order in which the results will be send to the + * runtime firmware. + */ switch (calib->code) { case IWN5000_PHY_CALIB_DC: - if (sc->hw_type == IWN_HW_REV_TYPE_5150 || - sc->hw_type == IWN_HW_REV_TYPE_6050) - idx = 0; + idx = IWN_CALIB_IDX_DC; break; case IWN5000_PHY_CALIB_LO: - idx = 1; + idx = IWN_CALIB_IDX_LO; break; case IWN5000_PHY_CALIB_TX_IQ: - idx = 2; + idx = IWN_CALIB_IDX_TX_IQ; break; case IWN5000_PHY_CALIB_TX_IQ_PERIODIC: - if (sc->hw_type < IWN_HW_REV_TYPE_6000 && - sc->hw_type != IWN_HW_REV_TYPE_5150) - idx = 3; + idx = IWN_CALIB_IDX_TX_IQ_PERIODIC; break; case IWN5000_PHY_CALIB_BASE_BAND: - idx = 4; + idx = IWN_CALIB_IDX_BASE_BAND; break; - } - if (idx == -1) /* Ignore other results. */ - return; - - /* Save calibration result. */ - if (sc->calibcmd[idx].buf != NULL) - free(sc->calibcmd[idx].buf, M_DEVBUF); - sc->calibcmd[idx].buf = malloc(len, M_DEVBUF, M_NOWAIT); - if (sc->calibcmd[idx].buf == NULL) { + default: DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "not enough memory for calibration result %d\n", - calib->code); - return; + "%s: unknown calibration code=%d\n", __func__, calib->code); + return EINVAL; } - DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "saving calibration result code=%d len=%d\n", calib->code, len); - sc->calibcmd[idx].len = len; - memcpy(sc->calibcmd[idx].buf, calib, len); + return iwn5000_save_calib_result(sc, calib, len, idx); +#undef FRAME_SIZE_MASK } static int @@ -5435,36 +5534,40 @@ iwn5000_post_alive(struct iwn_softc *sc) __func__, error); return error; } - if (sc->hw_type != IWN_HW_REV_TYPE_5150) { - struct iwn5000_phy_calib_crystal cmd; - /* Perform crystal calibration. */ - memset(&cmd, 0, sizeof cmd); - cmd.code = IWN5000_PHY_CALIB_CRYSTAL; - cmd.ngroups = 1; - cmd.isvalid = 1; - cmd.cap_pin[0] = le32toh(sc->eeprom_crystal) & 0xff; - cmd.cap_pin[1] = (le32toh(sc->eeprom_crystal) >> 16) & 0xff; - DPRINTF(sc, IWN_DEBUG_CALIBRATE, - "sending crystal calibration %d, %d\n", - cmd.cap_pin[0], cmd.cap_pin[1]); - error = iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 0); + if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) { + /* + * Start calibration by setting and sending the chrystal + * calibration first, this must be done before we are able + * to query the other calibration results. + */ + error = iwn5000_chrystal_calib(sc); if (error != 0) { device_printf(sc->sc_dev, - "%s: crystal calibration failed, error %d\n", - __func__, error); + "%s: could not set chrystal calibration, " + "error=%d\n", __func__, error); return error; } - } - if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) { - /* Query calibration from the initialization firmware. */ - error = iwn5000_query_calibration(sc); + error = iwn5000_send_calib_results(sc); if (error != 0) { device_printf(sc->sc_dev, - "%s: could not query calibration, error %d\n", + "%s: could not send chrystal calibration, " + "error=%d\n", __func__, error); + return error; + } + + /* + * Query other calibration results from the initialization + * firmware. + */ + error = iwn5000_send_calib_query(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not query calibration, error=%d\n", __func__, error); return error; } + /* * We have the calibration results now, reboot with the * runtime firmware (call ourselves recursively!) @@ -5472,8 +5575,11 @@ iwn5000_post_alive(struct iwn_softc *sc) iwn_hw_stop(sc); error = iwn_hw_init(sc); } else { - /* Send calibration results to runtime firmware. */ - error = iwn5000_send_calibration(sc); + /* + * Send calibration results obtained from the initialization + * firmware to the runtime firmware. + */ + error = iwn5000_send_calib_results(sc); } return error; } Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun Sep 19 12:39:04 2010 (r212853) +++ head/sys/dev/iwn/if_iwnvar.h Sun Sep 19 12:47:41 2010 (r212854) @@ -263,9 +263,23 @@ struct iwn_softc { int calib_cnt; struct iwn_calib_state calib; + u_int calib_init; +#define IWN_CALIB_XTAL (1 << IWN_CALIB_IDX_XTAL) +#define IWN_CALIB_DC (1 << IWN_CALIB_IDX_DC) +#define IWN_CALIB_LO (1 << IWN_CALIB_IDX_LO) +#define IWN_CALIB_TX_IQ (1 << IWN_CALIB_IDX_TX_IQ) +#define IWN_CALIB_TX_IQ_PERIODIC (1 << IWN_CALIB_IDX_TX_IQ_PERIODIC) +#define IWN_CALIB_BASE_BAND (1 << IWN_CALIB_IDX_BASE_BAND) +#define IWN_CALIB_NUM 6 + struct iwn_calib_info calib_results[IWN_CALIB_NUM]; +#define IWN_CALIB_IDX_XTAL 0 +#define IWN_CALIB_IDX_DC 1 +#define IWN_CALIB_IDX_LO 2 +#define IWN_CALIB_IDX_TX_IQ 3 +#define IWN_CALIB_IDX_TX_IQ_PERIODIC 4 +#define IWN_CALIB_IDX_BASE_BAND 5 struct iwn_fw_info fw; - struct iwn_calib_info calibcmd[5]; uint32_t errptr; struct iwn_rx_stat last_rx_stat; @@ -284,7 +298,6 @@ struct iwn_softc { uint16_t rfcfg; uint8_t calib_ver; char eeprom_domain[4]; - uint32_t eeprom_crystal; int16_t eeprom_voltage; int8_t maxpwr2GHz; int8_t maxpwr5GHz; From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 12:52:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F72106564A; Sun, 19 Sep 2010 12:52:23 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B24858FC12; Sun, 19 Sep 2010 12:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JCqN8F002335; Sun, 19 Sep 2010 12:52:23 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JCqNK6002333; Sun, 19 Sep 2010 12:52:23 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201009191252.o8JCqNK6002333@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 19 Sep 2010 12:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212855 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 12:52:23 -0000 Author: bschmidt Date: Sun Sep 19 12:52:23 2010 New Revision: 212855 URL: http://svn.freebsd.org/changeset/base/212855 Log: Fix typo in previous commit. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:47:41 2010 (r212854) +++ head/sys/dev/iwn/if_iwn.c Sun Sep 19 12:52:23 2010 (r212855) @@ -5359,7 +5359,7 @@ iwn5000_rx_calib_result(struct iwn_softc bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); len = (le32toh(desc->len) & FRAME_SIZE_MASK); - /* Remove length filed itself. */ + /* Remove length field itself. */ len -= 4; /* From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 12:54:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D3CB1065670; Sun, 19 Sep 2010 12:54:18 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B9048FC15; Sun, 19 Sep 2010 12:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JCsInw002425; Sun, 19 Sep 2010 12:54:18 GMT (envelope-from anchie@svn.freebsd.org) Received: (from anchie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JCsIlw002422; Sun, 19 Sep 2010 12:54:18 GMT (envelope-from anchie@svn.freebsd.org) Message-Id: <201009191254.o8JCsIlw002422@svn.freebsd.org> From: Ana Kukec Date: Sun, 19 Sep 2010 12:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212856 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 12:54:18 -0000 Author: anchie Date: Sun Sep 19 12:54:18 2010 New Revision: 212856 URL: http://svn.freebsd.org/changeset/base/212856 Log: Manual page for the kernel side Secure Neighbor Discovery support. Reviewed by: brueffer Approved by: bz (mentor) Added: head/share/man/man4/send.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Sep 19 12:52:23 2010 (r212855) +++ head/share/man/man4/Makefile Sun Sep 19 12:54:18 2010 (r212856) @@ -357,6 +357,7 @@ MAN= aac.4 \ sctp.4 \ sdhci.4 \ sem.4 \ + send.4 \ ses.4 \ sf.4 \ sge.4 \ Added: head/share/man/man4/send.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/send.4 Sun Sep 19 12:54:18 2010 (r212856) @@ -0,0 +1,218 @@ +.\"- +.\" Copyright (c) 2010 Ana Kukec +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 19, 2010 +.Dt SEND 4 +.Os +.Sh NAME +.Nm send +.Nd "Kernel side support for Secure Neighbor Discovery (SeND)" +.Sh SYNOPSIS +.In sys/socket.h +.In netinet/in.h +.In netinet6/send.h +.Ft int +.Fn socket PF_INET6 SOCK_RAW IPPROTO_SEND +.Pp +To enable +.Ns Nm +support, load the kernel side SeND as a module. +To load it at boot time, add the following line to +.Xr loader.conf 5 : +.Bd -literal -offset indent +send_load="YES" +.Ed +.Sh DESCRIPTION +IPv6 nodes use the Neighbor Discovery Protocol (NDP) to discover other nodes +on the link, to determine their link-layer addresses to find routers, and +to maintain reachability information about the paths to active members. +NDP is vulnerable to various attacks [RFC3756]. +Secure Neighbor Discovery is a set of extensions to NDP that counter threats +to NDP [RFC3971]. +.Pp +Kernel side support for SeND consists of a kernel module with hooks that +divert relevant packets (Neighbor Solicitations, Neighbor Advertisements, +Router Solicitations, Router Advertisements and Redirects) from the NDP stack, +send them to user space on a dedicated socket and reinject them back for +further processing. +Hooks are triggered only if the +.Nm +module is loaded. +.Pp +The native SeND socket is similar to a raw IP socket, but with its own, +internal pseudo-protocol (IPPROTO_SEND). +Struct sockaddr_send is defined in +.In netinet6/send.h . +It defines the total length of the structure, the address family, packet's +incoming or outgoing direction from the interface's point of view, and the +interface index. +.Pp +.Bd -literal +struct sockaddr_send { + unsigned char send_len; /* total length */ + sa_family_t send_family; /* address family */ + int send_direction; + int send_ifidx; + char send_zero[8]; +}; +.Ed +.Pp +The address family is always +.Va AF_INET6 . +The +.Va send_direction +variable denotes the direction of the packet from the interface's +point of view and has either the value +.Dv SND_IN +or +.Dv SND_OUT . +The +.Va send_ifidx +variable is the interface index of the receiving or sending interface. +The +.Va send_zero +variable is padding and must always be zero. +.Pp +In case that no user space application is connected to the send socket, +processing continues normally as if the module was not loaded. +.Sh INPUT HOOK +The input hook is named after the input path of the incoming or outgoing +NDP packets, on the way from the wire, through the nd6 stack, to user +space. +Relevant packets are identified by adding an mbuf_tag +(see +.Xr mbuf_tags 9 ) +to the +.Xr mbuf 9 , +if the +.Nm +module is loaded. +It is then passed on to the kernel-userland interface +for either cryptographic protection or validation by the SeND application. +The hook takes an argument that describes the direction of the packet, both +in case of incoming and outgoing packets. +.Dv SND_IN +is the direction of the incoming packets that are usually protected +by the SeND options and then sent to user space for cryptographic validation. +.Dv SND_OUT +is the outgoing direction. +It describes both reply and locally +originated outgoing packets that are sent to user space for the addition +of SeND options. +.Sh INCOMING PACKETS +The incoming ND packet from the wire: +.Bd -literal + kernelspace ( userspace + ) + incoming SeND/ND packet ( + | ) + v ( SND_IN ) ( + icmp6_input() -> send_input_hook ---> send socket ----+ + : ) | + : # # ( | + normal : # # ) v + processing : # send.ko # ( SeND application + path : # # ) | + : # # ( | + v ) | + icmp6/nd6_??_input() <- protocol switch <--- send socket <---+ + | structure (IPPPROTO_SEND) ) + | ( SND_IN ) ( + v ) + continue normal ND processing ( +.Ed +.Sh OUTGOING PACKETS +Outgoing ND packet (reply or locally triggered): +.Bd -literal + kernelspace ( userspace + ) + nd6_na_input() ( + +PACKET_TAG_ND_OUTGOING ) + | ) + | outgoing packet ( + | | ) + | v ( + | icmp6_redirect_output() ) + | nd6_ns_output() ( + | nd6_na_output() ) + | +PACKET_TAG_ND_OUTGOING ( + | | ) + | +-----------<- rip6_output() <----------)----- rtsol/rtadvd/.. + | | +PACKET_TAG_ND_OUTGOING ( + | v ) + | ip6_output() ( + | | ) + +-------->-+ ( + | ) + v ( SND_OUT ) ( + nd6_output_lle() -> send_input_hook ---> send socket ----+ + -PACKET_TAG_ND_OUTGOING ) | + : # # ( | + normal : # # ) v + processing : # send.ko # ( SeND application + path : # # ) | + : # # ( | + v ) | + (*ifp->if_output)() <- protocol switch <--- send socket <---+ + | structure (IPPPROTO_SEND) ) + | ( SND_OUT ) ( + v ) + continue with normal packet output ( +.Ed +.Sh ERRORS +A socket operation may fail with one of the following errors returned: +.Bl -tag -width Er +.It Bq Er EEXIST +Another user space SeND application is bound to the socket. +.It Bq Er ENOBUFS +Shortage of space to receive the incoming (SeND-protected) or outgoing +(SeND-validated) packet from the SeND application. +.It Bq Er ENOSYS +A packet received from user space and passed to the NDP stack for further +processing is neither Neighbor Solicitation, Neighbor Advertisement, +Router Solicitation, Router Advertisement nor Redirect. +.It Bq Er ENOENT +Occurs if interface output routines fail to send the packet out of the +interface. +.El +.Sh SEE ALSO +.Xr recvfrom 2 +.Xr sendto 2 +.Xr socket 2 +.Xr loader.conf 5 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Ana Kukec Aq anchie@FreeBSD.org , +University of Zagreb +.Sh BUGS +Due to the lack of NDP locking, it is currently not possible to unload the +.Nm +module. From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 14:21:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83632106566C; Sun, 19 Sep 2010 14:21:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 735F08FC08; Sun, 19 Sep 2010 14:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JELdTj004588; Sun, 19 Sep 2010 14:21:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JELdNY004586; Sun, 19 Sep 2010 14:21:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201009191421.o8JELdNY004586@svn.freebsd.org> From: Ed Schouten Date: Sun, 19 Sep 2010 14:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 14:21:39 -0000 Author: ed Date: Sun Sep 19 14:21:39 2010 New Revision: 212860 URL: http://svn.freebsd.org/changeset/base/212860 Log: Ignore DCD handling on /dev/console entirely. This makes /dev/console more fail-safe and prevents a potential console lock-up during boot. Discussed on: stable@ Tested by: koitsu@ MFC after: 1 week Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Sep 19 13:49:02 2010 (r212859) +++ head/sys/kern/tty.c Sun Sep 19 14:21:39 2010 (r212860) @@ -282,7 +282,8 @@ ttydev_open(struct cdev *dev, int oflags /* Wait for Carrier Detect. */ if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) == 0 && - (tp->t_termios.c_cflag & CLOCAL) == 0) { + (tp->t_termios.c_cflag & CLOCAL) == 0 && + dev != dev_console) { while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) == 0) { error = tty_wait(tp, &tp->t_dcdwait); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 14:30:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28F21065670; Sun, 19 Sep 2010 14:30:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 448288FC1A; Sun, 19 Sep 2010 14:30:50 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8JEUl9g068047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Sep 2010 17:30:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8JEUl6I043750; Sun, 19 Sep 2010 17:30:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8JEUlAr043749; Sun, 19 Sep 2010 17:30:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Sep 2010 17:30:47 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20100919143047.GB2389@deviant.kiev.zoral.com.ua> References: <201009191421.o8JELdNY004586@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BKMA2OjimIttCqMD" Content-Disposition: inline In-Reply-To: <201009191421.o8JELdNY004586@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 14:30:51 -0000 --BKMA2OjimIttCqMD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 19, 2010 at 02:21:39PM +0000, Ed Schouten wrote: > Author: ed > Date: Sun Sep 19 14:21:39 2010 > New Revision: 212860 > URL: http://svn.freebsd.org/changeset/base/212860 >=20 > Log: > Ignore DCD handling on /dev/console entirely. > =20 > This makes /dev/console more fail-safe and prevents a potential console > lock-up during boot. > =20 > Discussed on: stable@ > Tested by: koitsu@ > MFC after: 1 week >=20 > Modified: > head/sys/kern/tty.c >=20 > Modified: head/sys/kern/tty.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/tty.c Sun Sep 19 13:49:02 2010 (r212859) > +++ head/sys/kern/tty.c Sun Sep 19 14:21:39 2010 (r212860) > @@ -282,7 +282,8 @@ ttydev_open(struct cdev *dev, int oflags > =20 > /* Wait for Carrier Detect. */ > if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) =3D=3D 0 && > - (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0) { > + (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0 && > + dev !=3D dev_console) { > while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) =3D=3D 0) { > error =3D tty_wait(tp, &tp->t_dcdwait); > if (error !=3D 0) Shouldn't you always report CLOCAL for console then ? --BKMA2OjimIttCqMD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyWHpYACgkQC3+MBN1Mb4gzhQCg7k1qEYnTi0AHaBEysuKkvBzo xgEAnj21FwfS0AVskjI0/DY/5HntZmTu =zoAg -----END PGP SIGNATURE----- --BKMA2OjimIttCqMD-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 14:40:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CBEE1065670; Sun, 19 Sep 2010 14:40:38 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325BF8FC13; Sun, 19 Sep 2010 14:40:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JEecAf005009; Sun, 19 Sep 2010 14:40:38 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JEech5005004; Sun, 19 Sep 2010 14:40:38 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <201009191440.o8JEech5005004@svn.freebsd.org> From: Norikatsu Shigemura Date: Sun, 19 Sep 2010 14:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212861 - in head/sys: amd64/conf boot/forth conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 14:40:38 -0000 Author: nork Date: Sun Sep 19 14:40:37 2010 New Revision: 212861 URL: http://svn.freebsd.org/changeset/base/212861 Log: Add support 'device tpm' for amd64. Add tpm(4)'s default setting to /boot/defaults/loader.conf. Add 'device tpm' to NOTES for amd64 and i386. Discussed with: takawata Approved by: imp (mentor) Modified: head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sun Sep 19 14:21:39 2010 (r212860) +++ head/sys/amd64/conf/NOTES Sun Sep 19 14:40:37 2010 (r212861) @@ -421,6 +421,7 @@ options SAFE_RNDTEST # enable rndtest s # vpd: Vital Product Data kernel interface # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card +# tpm: Trusted Platform Module # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. @@ -436,6 +437,7 @@ device smbios device vpd device asmc #device si +device tpm # # Laptop/Notebook options: Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sun Sep 19 14:21:39 2010 (r212860) +++ head/sys/boot/forth/loader.conf Sun Sep 19 14:40:37 2010 (r212861) @@ -473,6 +473,7 @@ vkbd_load="NO" # Virtual AT keyboard i vpd_load="NO" # Vital Product Data kernel interface vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor +tpm_load="NO" # Trusted Platform Module ############################################################## ### ACPI settings ########################################## Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Sep 19 14:21:39 2010 (r212860) +++ head/sys/conf/files.amd64 Sun Sep 19 14:40:37 2010 (r212861) @@ -229,6 +229,9 @@ dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc +dev/tpm/tpm.c optional tpm +dev/tpm/tpm_acpi.c optional tpm acpi +dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi isa/syscons_isa.c optional sc Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Sep 19 14:21:39 2010 (r212860) +++ head/sys/i386/conf/NOTES Sun Sep 19 14:40:37 2010 (r212861) @@ -751,6 +751,7 @@ device glxsb # AMD Geode LX Security B # spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver +# tpm: Trusted Platform Module # Notes on APM # The flags takes the following meaning for apm0: @@ -789,6 +790,7 @@ hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc #device si +device tpm # # Laptop/Notebook options: From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 15:06:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B0A1065672; Sun, 19 Sep 2010 15:06:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 692AC8FC0A; Sun, 19 Sep 2010 15:06:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8JF0L6d045218; Sun, 19 Sep 2010 09:00:23 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 19 Sep 2010 09:00:28 -0600 (MDT) Message-Id: <20100919.090028.242248466057853766.imp@bsdimp.com> To: d@delphij.net, delphij@delphij.net From: "M. Warner Losh" In-Reply-To: <4C95EB21.1030304@delphij.net> References: <201009130144.o8D1i7jr045217@svn.freebsd.org> <4C95EB21.1030304@delphij.net> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212517 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 15:06:21 -0000 In message: <4C95EB21.1030304@delphij.net> Xin LI writes: : -----BEGIN PGP SIGNED MESSAGE----- : Hash: SHA256 : : On 2010/09/12 18:44, Warner Losh wrote: : > Author: imp : > Date: Mon Sep 13 01:44:07 2010 : > New Revision: 212517 : > URL: http://svn.freebsd.org/changeset/base/212517 : > : > Log: : > Include FreeBSD svn tag : : The file was completely the same with libz vendor version now (except : your addition of $FreeBSD$ tag). Plus: : : [delphij@delta] /usr/src/lib/libz> svn pl minigzip.c : Properties on 'minigzip.c': : fbsd:nokeywords : : Or, do we require $FreeBSD$ tags for every files? Well, we usually do. However, this may have been a mistake on my part while cleaning up a tree before I deleted it. If the omission was intentional, then it was a mistake on my part, and should be backed out. Should I do the honors, or will that mess something else up? Warner From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 15:06:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC6B10657B0; Sun, 19 Sep 2010 15:06:30 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id A46258FC12; Sun, 19 Sep 2010 15:06:29 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id AAA042A28D28; Sun, 19 Sep 2010 17:06:28 +0200 (CEST) Date: Sun, 19 Sep 2010 17:06:28 +0200 From: Ed Schouten To: Kostik Belousov Message-ID: <20100919150628.GN56986@hoeg.nl> References: <201009191421.o8JELdNY004586@svn.freebsd.org> <20100919143047.GB2389@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HPvEMLO7QB7Fh5r+" Content-Disposition: inline In-Reply-To: <20100919143047.GB2389@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 15:06:30 -0000 --HPvEMLO7QB7Fh5r+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kostik Belousov wrote: > Shouldn't you always report CLOCAL for console then ? Hmmm... That would be a lot more elegant, also for callout devices. The change I just committed, doesn't take a loss of SER_DCD into account after opening the device. Any comments on the following patch? %%% Index: sys/kern/tty.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/kern/tty.c (revision 212860) +++ sys/kern/tty.c (working copy) @@ -263,12 +263,14 @@ =20 if (!tty_opened(tp)) { /* Set proper termios flags. */ - if (TTY_CALLOUT(tp, dev)) { + if (TTY_CALLOUT(tp, dev)) tp->t_termios =3D tp->t_termios_init_out; - } else { + else tp->t_termios =3D tp->t_termios_init_in; - } ttydevsw_param(tp, &tp->t_termios); + /* Prevent modem control on callout devices and /dev/console. */ + if (TTY_CALLOUT(tp, dev) || dev =3D=3D dev_console) + tp->t_termios.c_cflag |=3D CLOCAL; =20 ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); =20 @@ -281,9 +283,8 @@ } =20 /* Wait for Carrier Detect. */ - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) =3D=3D 0 && - (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0 && - dev !=3D dev_console) { + if ((oflags & O_NONBLOCK) =3D=3D 0 && + (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0) { while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) =3D=3D 0) { error =3D tty_wait(tp, &tp->t_dcdwait); if (error !=3D 0) %%% --=20 Ed Schouten WWW: http://80386.nl/ --HPvEMLO7QB7Fh5r+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkyWJvQACgkQ52SDGA2eCwVNxgCeOOk0PdC1GeNPwxLCmNsaXJoc 4ngAnijmnHSg0Aj3Yrvhi+BdkAVgffRq =hMVG -----END PGP SIGNATURE----- --HPvEMLO7QB7Fh5r+-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 15:36:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1451A106566B; Sun, 19 Sep 2010 15:36:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A102E8FC1B; Sun, 19 Sep 2010 15:36:39 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8JFaOuZ072163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8JFaONx044060; Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8JFaOGL044059; Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Sep 2010 18:36:24 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20100919153624.GD2389@deviant.kiev.zoral.com.ua> References: <201009191421.o8JELdNY004586@svn.freebsd.org> <20100919143047.GB2389@deviant.kiev.zoral.com.ua> <20100919150628.GN56986@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rln2GmQ7CFmDhc9B" Content-Disposition: inline In-Reply-To: <20100919150628.GN56986@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 15:36:40 -0000 --Rln2GmQ7CFmDhc9B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 19, 2010 at 05:06:28PM +0200, Ed Schouten wrote: > * Kostik Belousov wrote: > > Shouldn't you always report CLOCAL for console then ? >=20 > Hmmm... That would be a lot more elegant, also for callout devices. The > change I just committed, doesn't take a loss of SER_DCD into account > after opening the device. >=20 > Any comments on the following patch? It looks very similar to what I proposed. Thanks. >=20 > %%% > Index: sys/kern/tty.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/kern/tty.c (revision 212860) > +++ sys/kern/tty.c (working copy) > @@ -263,12 +263,14 @@ > =20 > if (!tty_opened(tp)) { > /* Set proper termios flags. */ > - if (TTY_CALLOUT(tp, dev)) { > + if (TTY_CALLOUT(tp, dev)) > tp->t_termios =3D tp->t_termios_init_out; > - } else { > + else > tp->t_termios =3D tp->t_termios_init_in; > - } > ttydevsw_param(tp, &tp->t_termios); > + /* Prevent modem control on callout devices and /dev/console. */ > + if (TTY_CALLOUT(tp, dev) || dev =3D=3D dev_console) > + tp->t_termios.c_cflag |=3D CLOCAL; > =20 > ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); > =20 > @@ -281,9 +283,8 @@ > } > =20 > /* Wait for Carrier Detect. */ > - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) =3D=3D 0 && > - (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0 && > - dev !=3D dev_console) { > + if ((oflags & O_NONBLOCK) =3D=3D 0 && > + (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0) { > while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) =3D=3D 0) { > error =3D tty_wait(tp, &tp->t_dcdwait); > if (error !=3D 0) > %%% >=20 > --=20 > Ed Schouten > WWW: http://80386.nl/ --Rln2GmQ7CFmDhc9B Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyWLfcACgkQC3+MBN1Mb4i0nwCeP+3QoGQfJ+PaCcY7vm64OVft pGcAnjXKaxDGDazl3bmpPSTyVeQxOwN5 =TpEh -----END PGP SIGNATURE----- --Rln2GmQ7CFmDhc9B-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 16:35:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3E64106566B; Sun, 19 Sep 2010 16:35:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3DA08FC0A; Sun, 19 Sep 2010 16:35:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JGZgV1008284; Sun, 19 Sep 2010 16:35:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JGZgF3008282; Sun, 19 Sep 2010 16:35:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201009191635.o8JGZgF3008282@svn.freebsd.org> From: Ed Schouten Date: Sun, 19 Sep 2010 16:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212867 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 16:35:43 -0000 Author: ed Date: Sun Sep 19 16:35:42 2010 New Revision: 212867 URL: http://svn.freebsd.org/changeset/base/212867 Log: Just make callout devices and /dev/console force CLOCAL on open(). Instead of adding custom checks to wait for DCD on open(), just modify the termios structure to set CLOCAL. This means SIGHUP is no longer generated when losing DCD as well. Reviewed by: kib@ MFC after: 1 week Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Sep 19 16:15:42 2010 (r212866) +++ head/sys/kern/tty.c Sun Sep 19 16:35:42 2010 (r212867) @@ -263,12 +263,14 @@ ttydev_open(struct cdev *dev, int oflags if (!tty_opened(tp)) { /* Set proper termios flags. */ - if (TTY_CALLOUT(tp, dev)) { + if (TTY_CALLOUT(tp, dev)) tp->t_termios = tp->t_termios_init_out; - } else { + else tp->t_termios = tp->t_termios_init_in; - } ttydevsw_param(tp, &tp->t_termios); + /* Prevent modem control on callout devices and /dev/console. */ + if (TTY_CALLOUT(tp, dev) || dev == dev_console) + tp->t_termios.c_cflag |= CLOCAL; ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); @@ -281,9 +283,8 @@ ttydev_open(struct cdev *dev, int oflags } /* Wait for Carrier Detect. */ - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) == 0 && - (tp->t_termios.c_cflag & CLOCAL) == 0 && - dev != dev_console) { + if ((oflags & O_NONBLOCK) == 0 && + (tp->t_termios.c_cflag & CLOCAL) == 0) { while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) == 0) { error = tty_wait(tp, &tp->t_dcdwait); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 17:43:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A6FB1065675; Sun, 19 Sep 2010 17:43:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C718FC26; Sun, 19 Sep 2010 17:43:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JHhM6P009892; Sun, 19 Sep 2010 17:43:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JHhMpT009889; Sun, 19 Sep 2010 17:43:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201009191743.o8JHhMpT009889@svn.freebsd.org> From: Alan Cox Date: Sun, 19 Sep 2010 17:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212868 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 17:43:22 -0000 Author: alc Date: Sun Sep 19 17:43:22 2010 New Revision: 212868 URL: http://svn.freebsd.org/changeset/base/212868 Log: Make refinements to r212824. In particular, don't make vm_map_unlock_nodefer() part of the synchronization interface for maps. Add comments to vm_map_unlock_and_wait() and vm_map_wakeup() describing how they should be used. In particular, describe the deferred deallocations issue with vm_map_unlock_and_wait(). Redo the implementation of vm_map_unlock_and_wait() so that it passes along the caller's file and line information, just like the other map locking primitives. Reviewed by: kib X-MFC after: r212824 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Sep 19 16:35:42 2010 (r212867) +++ head/sys/vm/vm_map.c Sun Sep 19 17:43:22 2010 (r212868) @@ -470,16 +470,6 @@ vm_map_process_deferred(void) } void -_vm_map_unlock_nodefer(vm_map_t map, const char *file, int line) -{ - - if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); - else - _sx_xunlock(&map->lock, file, line); -} - -void _vm_map_unlock(vm_map_t map, const char *file, int line) { @@ -637,19 +627,37 @@ _vm_map_assert_locked_read(vm_map_t map, #endif /* - * vm_map_unlock_and_wait: + * _vm_map_unlock_and_wait: + * + * Atomically releases the lock on the specified map and puts the calling + * thread to sleep. The calling thread will remain asleep until either + * vm_map_wakeup() is performed on the map or the specified timeout is + * exceeded. + * + * WARNING! This function does not perform deferred deallocations of + * objects and map entries. Therefore, the calling thread is expected to + * reacquire the map lock after reawakening and later perform an ordinary + * unlock operation, such as vm_map_unlock(), before completing its + * operation on the map. */ int -vm_map_unlock_and_wait(vm_map_t map, int timo) +_vm_map_unlock_and_wait(vm_map_t map, int timo, const char *file, int line) { mtx_lock(&map_sleep_mtx); - vm_map_unlock_nodefer(map); - return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", timo)); + if (map->system_map) + _mtx_unlock_flags(&map->system_mtx, 0, file, line); + else + _sx_xunlock(&map->lock, file, line); + return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", + timo)); } /* * vm_map_wakeup: + * + * Awaken any threads that have slept on the map using + * vm_map_unlock_and_wait(). */ void vm_map_wakeup(vm_map_t map) @@ -657,8 +665,8 @@ vm_map_wakeup(vm_map_t map) /* * Acquire and release map_sleep_mtx to prevent a wakeup() - * from being performed (and lost) between the vm_map_unlock() - * and the msleep() in vm_map_unlock_and_wait(). + * from being performed (and lost) between the map unlock + * and the msleep() in _vm_map_unlock_and_wait(). */ mtx_lock(&map_sleep_mtx); mtx_unlock(&map_sleep_mtx); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Sep 19 16:35:42 2010 (r212867) +++ head/sys/vm/vm_map.h Sun Sep 19 17:43:22 2010 (r212868) @@ -266,7 +266,7 @@ vmspace_pmap(struct vmspace *vmspace) void _vm_map_lock(vm_map_t map, const char *file, int line); void _vm_map_unlock(vm_map_t map, const char *file, int line); -void _vm_map_unlock_nodefer(vm_map_t map, const char *file, int line); +int _vm_map_unlock_and_wait(vm_map_t map, int timo, const char *file, int line); void _vm_map_lock_read(vm_map_t map, const char *file, int line); void _vm_map_unlock_read(vm_map_t map, const char *file, int line); int _vm_map_trylock(vm_map_t map, const char *file, int line); @@ -274,13 +274,12 @@ int _vm_map_trylock_read(vm_map_t map, c int _vm_map_lock_upgrade(vm_map_t map, const char *file, int line); void _vm_map_lock_downgrade(vm_map_t map, const char *file, int line); int vm_map_locked(vm_map_t map); -int vm_map_unlock_and_wait(vm_map_t map, int timo); void vm_map_wakeup(vm_map_t map); #define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE) -#define vm_map_unlock_nodefer(map) \ - _vm_map_unlock_nodefer(map, LOCK_FILE, LOCK_LINE) +#define vm_map_unlock_and_wait(map, timo) \ + _vm_map_unlock_and_wait(map, timo, LOCK_FILE, LOCK_LINE) #define vm_map_lock_read(map) _vm_map_lock_read(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock_read(map) _vm_map_unlock_read(map, LOCK_FILE, LOCK_LINE) #define vm_map_trylock(map) _vm_map_trylock(map, LOCK_FILE, LOCK_LINE) From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 18:21:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD7791065675; Sun, 19 Sep 2010 18:21:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 4F57B8FC1C; Sun, 19 Sep 2010 18:21:58 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8JILVel016446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Sep 2010 04:21:42 +1000 Date: Mon, 20 Sep 2010 04:21:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ed Schouten In-Reply-To: <20100919150628.GN56986@hoeg.nl> Message-ID: <20100920021713.Y950@delplex.bde.org> References: <201009191421.o8JELdNY004586@svn.freebsd.org> <20100919143047.GB2389@deviant.kiev.zoral.com.ua> <20100919150628.GN56986@hoeg.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 18:21:59 -0000 On Sun, 19 Sep 2010, Ed Schouten wrote: > * Kostik Belousov wrote: >> Shouldn't you always report CLOCAL for console then ? > > Hmmm... That would be a lot more elegant, also for callout devices. The > change I just committed, doesn't take a loss of SER_DCD into account > after opening the device. This should be handled like it was by non-broken serial device drivers: - CLOCAL defaults to on for the console only - CLOCAL is also locked on for the console only - otherwise, CLOCAL is not specially handled. If the user wants to default and lock it differently, then he changes these defaults in the initial and lock state devices - locking the speed for the console only is even more important - locking of other termios state (parity and stop bits...) is also important, but has never been done by default AFAIK. This can be fixed by programming the lock state device at boot time using rc.d/serial or directly, but this is unobvious and painful. > Any comments on the following patch? > > %%% > Index: sys/kern/tty.c > =================================================================== > --- sys/kern/tty.c (revision 212860) > +++ sys/kern/tty.c (working copy) > @@ -263,12 +263,14 @@ > > if (!tty_opened(tp)) { > /* Set proper termios flags. */ > - if (TTY_CALLOUT(tp, dev)) { > + if (TTY_CALLOUT(tp, dev)) > tp->t_termios = tp->t_termios_init_out; > - } else { > + else > tp->t_termios = tp->t_termios_init_in; > - } > ttydevsw_param(tp, &tp->t_termios); > + /* Prevent modem control on callout devices and /dev/console. */ > + if (TTY_CALLOUT(tp, dev) || dev == dev_console) > + tp->t_termios.c_cflag |= CLOCAL; This seems to just break the user's defaults set in the initial state devices. The uart driver even refuses to honor the users changes of CLOCAL, HUPCL and the speed for consoles at tcsetattr() time. Normally it is a mistake for the user to change these, but if he has reprogrammed the lock state device so that changes are possible, then the changes should be honored. Not honoring the changes in the driver is equivalent to having a lock on parts of the lock device, with bugs in reads of the locked device (parts of it that are effectively locked can be changed, but such changes don't work). CLOCAL doesn't seem to be set in the lock device anywhere, but it is set for the initial state device for consoles. This is enough for open() (since changing it in the initial state device should require the same privilege as changing it in the lock device. But users should be especially careful in changing it for the console, since for the console its setting should start as locked on, and this locking becomes negatively useful if the initial state is changed to off so that the full setting becomes locked off). Defaulting to CLOCAL for the callout device is wrong. Callout devices should only ignore carrier in open(). Then open() normally succeeds without carrier, and any off-to-on transition of carrier has little effect. But on-to-off transitions of carrier should be handled, according to the user's setting of CLOCAL, and this setting should not normally be locked (unlike in the callin case where locking it may be good). If the device is actually local, then hanging up is not very useful, but callout devices aren't really needed for that case either (I use them out of habit, but almost the same behaviour can be obtained using callin devices with CLOCAL set in their initial state and unset after open()). > > ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); > > @@ -281,9 +283,8 @@ > } > > /* Wait for Carrier Detect. */ > - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) == 0 && > - (tp->t_termios.c_cflag & CLOCAL) == 0 && > - dev != dev_console) { > + if ((oflags & O_NONBLOCK) == 0 && > + (tp->t_termios.c_cflag & CLOCAL) == 0) { > while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) == 0) { > error = tty_wait(tp, &tp->t_dcdwait); > if (error != 0) > %%% It has always intentionally not been done like this, so that CLOCAL works normally for callout devices except for open. CLOCAL is in effect forced to be temporarily ignored during open. This is called "SOFT_CARRIER" in the sio driver: from a lost comment: % /* % * Handle initial DCD. Callout devices get a fake initial % * DCD (trapdoor DCD). If we are callout, then any sleeping % * callin opens get woken up and resume sleeping on "siobi" % * instead of "siodcd". % */ % /* % * XXX `mynor & CALLOUT_MASK' should be % * `tp->t_cflag & (SOFT_CARRIER | TRAPDOOR_CARRIER) where % * TRAPDOOR_CARRIER is the default initial state for callout % * devices and SOFT_CARRIER is like CLOCAL except it hides % * the true carrier. % */ I never got around to de-magicing this by putting SOFT_CARRIER in t_cflag and somehow making the callout'ness more programmable using TRAPDOOR_CARRIER. Most systems never needed both the callin and callout devices, and it would have been nice to able to create a callout device on demand for occasional use (no devfs please, but without creating a new device it is hard to find a context for the existing callin device users (blocked in open) to sleep in). Now, even fewer systems need both. Linux axed callout devices about 15 years ago. Serial modem connections were still useful then, so I think this mainly moved the complications to userland where they are larger. Other termios flags defaults lossage: >From the detached sio driver: % /* % * We don't use all the flags from since they % * are only relevant for logins. It's important to have echo off % * initially so that the line doesn't start blathering before the % * echo flag can be turned off. % */ % com->it_in.c_iflag = 0; % com->it_in.c_oflag = 0; % com->it_in.c_cflag = TTYDEF_CFLAG; % com->it_in.c_lflag = 0; (We should actually use the "raw" flags, which aren't quite all 0's -- see cfmakeraw().) >From -current: % static void % tty_init_termios(struct tty *tp) % { % struct termios *t = &tp->t_termios_init_in; % % t->c_cflag = TTYDEF_CFLAG; % t->c_iflag = TTYDEF_IFLAG; % t->c_lflag = TTYDEF_LFLAG; % t->c_oflag = TTYDEF_OFLAG; Even the comment saying why these defaults are unusable in the kernel has been detached. An intermediate stage lost the comment but avoided the problem with echos by using TTYDEF_LFLAG for consoles only and TTYDEF_LFLAG_NOECHO otherwise. Now, TTYDEF_LFLAG_NOECHO is still defined, but is no longer used. Bad defaults for all the flags can be fixed by reprogramming at boot time, except possibly if an echo war makes the system unbootable, but this is just as painful as for the missing console lock device initialization. I have many sloppy test scripts that depend on the default state being raw. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 19:42:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2108E1065674; Sun, 19 Sep 2010 19:42:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10B968FC0A; Sun, 19 Sep 2010 19:42:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8JJg4sk013377; Sun, 19 Sep 2010 19:42:04 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8JJg4QO013375; Sun, 19 Sep 2010 19:42:04 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201009191942.o8JJg4QO013375@svn.freebsd.org> From: Alan Cox Date: Sun, 19 Sep 2010 19:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212873 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 19:42:05 -0000 Author: alc Date: Sun Sep 19 19:42:04 2010 New Revision: 212873 URL: http://svn.freebsd.org/changeset/base/212873 Log: Allow a POSIX shared memory object that is opened for read but not for write to nonetheless be mapped PROT_WRITE and MAP_PRIVATE, i.e., copy-on-write. (This is a regression in the new implementation of POSIX shared memory objects that is used by HEAD and RELENG_8. This bug does not exist in RELENG_7's user-level, file-based implementation.) PR: 150260 MFC after: 3 weeks Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Sep 19 19:18:35 2010 (r212872) +++ head/sys/vm/vm_mmap.c Sun Sep 19 19:42:04 2010 (r212873) @@ -1373,7 +1373,8 @@ vm_mmap_shm(struct thread *td, vm_size_t { int error; - if ((*maxprotp & VM_PROT_WRITE) == 0 && + if ((*flagsp & MAP_SHARED) != 0 && + (*maxprotp & VM_PROT_WRITE) == 0 && (prot & PROT_WRITE) != 0) return (EACCES); #ifdef MAC From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 04:20:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC5F1065670; Mon, 20 Sep 2010 04:20:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40DCA8FC1A; Mon, 20 Sep 2010 04:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8K4KtCZ026516; Mon, 20 Sep 2010 04:20:55 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8K4KtKn026514; Mon, 20 Sep 2010 04:20:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201009200420.o8K4KtKn026514@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 20 Sep 2010 04:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 04:20:56 -0000 Author: marcel Date: Mon Sep 20 04:20:55 2010 New Revision: 212886 URL: http://svn.freebsd.org/changeset/base/212886 Log: Unbreak the build on strong-aligned architectures (arm, ia64). Casting from (char *) to (struct ufs1_dinode *) changes the alignment requirement of the pointer and GCC does not know that the pointer is adequately aligned (due to malloc(3)), and warns about it. Cast to (void *) first to by-pass the check. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun Sep 19 21:56:41 2010 (r212885) +++ head/sbin/growfs/growfs.c Mon Sep 20 04:20:55 2010 (r212886) @@ -452,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 06:56:01 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC05D1065675; Mon, 20 Sep 2010 06:56:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 6C62C8FC15; Mon, 20 Sep 2010 06:56:01 +0000 (UTC) Received: from besplex.bde.org (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8K6tvnH003125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Sep 2010 16:55:59 +1000 Date: Mon, 20 Sep 2010 16:55:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: <201009200420.o8K4KtKn026514@svn.freebsd.org> Message-ID: <20100920163758.A788@besplex.bde.org> References: <201009200420.o8K4KtKn026514@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 06:56:02 -0000 On Mon, 20 Sep 2010, Marcel Moolenaar wrote: > Log: > Unbreak the build on strong-aligned architectures (arm, ia64). > Casting from (char *) to (struct ufs1_dinode *) changes the > alignment requirement of the pointer and GCC does not know that > the pointer is adequately aligned (due to malloc(3)), and warns > about it. Cast to (void *) first to by-pass the check. A previous version in which the pointer (iobuf) the correct type to begin with was better. It used to have type void *, but now has type caddr_t (whose existence is a bug), in order to abuse caddr_t by assuming that it is char * to do pointer arithmetic on it in 1 place (iobuf + sblock.fs_cgsize). The 7 other places where iobuf is used only assume that caddr_t is a pointer (or perhaps a [u]intptr_t). growfs has no other instances of caddr_t. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 11:53:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD5BC1065670; Mon, 20 Sep 2010 11:53:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB8BD8FC19; Mon, 20 Sep 2010 11:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KBrvWZ050731; Mon, 20 Sep 2010 11:53:57 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KBrvVr050728; Mon, 20 Sep 2010 11:53:57 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009201153.o8KBrvVr050728@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 20 Sep 2010 11:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212896 - in head/sys/mips/rmi: . dev/nlge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 11:53:57 -0000 Author: jchandra Date: Mon Sep 20 11:53:57 2010 New Revision: 212896 URL: http://svn.freebsd.org/changeset/base/212896 Log: Add 64 bit support to nlge, and additional fixes - 64 bit fixes for ifnlge.c - Use m_nextpkt to save mbuf vaddr on 64 bit, we cannot store the 64 bit vaddr in the 40bit freeback field. - remove unused code and unnecessary variables. - use xlr_io_mmio macro instead of adding io base address - rewrite GPIO related code to fixup nlge using xlr_write_reg and DELAY - support for engg boards major num 11 and 12 - add xlr_paddr_lw() to load 32bit value from physical address, fix inline assembly - style fixes Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/rmi_mips_exts.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Sep 20 11:18:20 2010 (r212895) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Sep 20 11:53:57 2010 (r212896) @@ -381,8 +381,6 @@ nlna_attach(device_t dev) #ifdef DEBUG dump_board_info(&xlr_board_info); #endif - block_info->baseaddr += DEFAULT_XLR_IO_BASE; - /* Initialize nlna state in softc structure */ sc = nlna_sc_init(dev, block_info); @@ -621,21 +619,15 @@ nlge_msgring_handler(int bucket, int siz { struct nlna_softc *na_sc; struct nlge_softc *sc; - struct ifnet *ifp; + struct ifnet *ifp; + struct mbuf *m; vm_paddr_t phys_addr; - unsigned long addr; uint32_t length; int ctrl; - int cpu; int tx_error; int port; - int vcpu; int is_p2p; - cpu = xlr_core_id(); - vcpu = (cpu << 2) + xlr_thr_id(); - - addr = 0; is_p2p = 0; tx_error = 0; length = (msg->msg0 >> 40) & 0x3fff; @@ -667,7 +659,13 @@ nlge_msgring_handler(int bucket, int siz if (is_p2p) { release_tx_desc(phys_addr); } else { - m_freem((struct mbuf *)(uintptr_t)phys_addr); +#ifdef __mips64 + m = (struct mbuf *)(uintptr_t)xlr_paddr_ld(phys_addr); + m->m_nextpkt = NULL; +#else + m = (struct mbuf *)(uintptr_t)phys_addr; +#endif + m_freem(m); } NLGE_LOCK(sc); if (ifp->if_drv_flags & IFF_DRV_OACTIVE){ @@ -687,7 +685,7 @@ nlge_msgring_handler(int bucket, int siz nlge_rx(sc, phys_addr, length); nlna_submit_rx_free_desc(na_sc, 1); /* return free descr to NA */ } else { - printf("[%s]: unrecognized ctrl=%d!\n", __FUNCTION__, ctrl); + printf("[%s]: unrecognized ctrl=%d!\n", __func__, ctrl); } } @@ -801,8 +799,8 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ m = (struct mbuf *)(intptr_t)tm; if (mag != 0xf00bad) { /* somebody else's packet. Error - FIXME in intialization */ - printf("cpu %d: *ERROR* Not my packet paddr %llx\n", - xlr_core_id(), (uint64_t) paddr); + printf("cpu %d: *ERROR* Not my packet paddr %jx\n", + xlr_core_id(), (uintmax_t)paddr); return; } @@ -882,7 +880,7 @@ nlna_sc_init(device_t dev, struct xlr_gm sc = device_get_softc(dev); memset(sc, 0, sizeof(*sc)); sc->nlna_dev = dev; - sc->base = (xlr_reg_t *) blk->baseaddr; + sc->base = xlr_io_mmio(blk->baseaddr); sc->rfrbucket = blk->station_rfr; sc->station_id = blk->station_id; sc->na_type = blk->type; @@ -1302,10 +1300,7 @@ nlna_reset_ports(struct nlna_softc *sc, /* Refer Section 13.9.3 in the PRM for the reset sequence */ for (i = 0; i < sc->num_ports; i++) { - uint32_t base = (uint32_t)DEFAULT_XLR_IO_BASE; - - base += blk->gmac_port[i].base_addr; - addr = (xlr_reg_t *) base; + addr = xlr_io_mmio(blk->gmac_port[i].base_addr); /* 1. Reset RxEnable in MAC_CONFIG */ switch (sc->mac_type) { @@ -1359,10 +1354,7 @@ nlna_disable_ports(struct nlna_softc *sc blk = device_get_ivars(sc->nlna_dev); for (i = 0; i < sc->num_ports; i++) { - uint32_t base = (uint32_t)DEFAULT_XLR_IO_BASE; - - base += blk->gmac_port[i].base_addr; - addr = (xlr_reg_t *) base; + addr = xlr_io_mmio(blk->gmac_port[i].base_addr); nlge_port_disable(i, addr, blk->gmac_port[i].type); } } @@ -1473,7 +1465,6 @@ static void nlge_sgmii_init(struct nlge_softc *sc) { xlr_reg_t *mmio_gpio; - int i; int phy; if (sc->port_type != XLR_SGMII) @@ -1491,12 +1482,26 @@ nlge_sgmii_init(struct nlge_softc *sc) nlge_mii_write_internal(sc->serdes_addr, 26, 9, 0x0000); nlge_mii_write_internal(sc->serdes_addr, 26,10, 0x0000); - for(i=0;i<10000000;i++){} /* delay */ /* program GPIO values for serdes init parameters */ - mmio_gpio = (xlr_reg_t *) (DEFAULT_XLR_IO_BASE + XLR_IO_GPIO_OFFSET); - mmio_gpio[0x20] = 0x7e6802; - mmio_gpio[0x10] = 0x7104; - for(i=0;i<100000000;i++){} + DELAY(100); + mmio_gpio = xlr_io_mmio(XLR_IO_GPIO_OFFSET); + xlr_write_reg(mmio_gpio, 0x20, 0x7e6802); + xlr_write_reg(mmio_gpio, 0x10, 0x7104); + DELAY(100); + + /* + * This kludge is needed to setup serdes (?) clock correctly on some + * XLS boards + */ + if ((xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI || + xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XII) && + xlr_boot1_info.board_minor_version == 4) { + /* use 125 Mhz instead of 156.25Mhz ref clock */ + DELAY(100); + xlr_write_reg(mmio_gpio, 0x10, 0x7103); + xlr_write_reg(mmio_gpio, 0x21, 0x7103); + DELAY(100); + } /* enable autoneg - more magic */ phy = sc->phy_addr % 4 + 27; @@ -1888,14 +1893,14 @@ prepare_fmn_message(struct nlge_softc *s struct mbuf *m; struct nlge_tx_desc *p2p; uint64_t *cur_p2d; + uint64_t fbpaddr; vm_offset_t buf; vm_paddr_t paddr; - int msg_sz, p2p_sz, is_p2p; - int len, frag_sz; + int msg_sz, p2p_sz, len, frag_sz; /* Num entries per FMN msg is 4 for XLR/XLS */ const int FMN_SZ = sizeof(*fmn_msg) / sizeof(uint64_t); - msg_sz = p2p_sz = is_p2p = 0; + msg_sz = p2p_sz = 0; p2p = NULL; cur_p2d = &fmn_msg->msg0; @@ -1916,10 +1921,9 @@ prepare_fmn_message(struct nlge_softc *s p2p->frag[XLR_MAX_TX_FRAGS] = (uint64_t)(vm_offset_t)p2p; cur_p2d = &p2p->frag[0]; - is_p2p = 1; } else if (msg_sz == (FMN_SZ - 2 + XLR_MAX_TX_FRAGS)) { uma_zfree(nl_tx_desc_zone, p2p); - return 1; + return (1); } paddr = vtophys(buf); frag_sz = PAGE_SIZE - (buf & PAGE_MASK); @@ -1928,7 +1932,7 @@ prepare_fmn_message(struct nlge_softc *s *cur_p2d++ = (127ULL << 54) | ((uint64_t)frag_sz << 40) | paddr; msg_sz++; - if (is_p2p) + if (p2p != NULL) p2p_sz++; len -= frag_sz; buf += frag_sz; @@ -1938,15 +1942,28 @@ prepare_fmn_message(struct nlge_softc *s if (msg_sz == 0) { printf("Zero-length mbuf chain ??\n"); *n_entries = msg_sz ; - return 0; + return (0); } - cur_p2d[-1] |= (1ULL << 63); /* set eop in most-recent p2d */ - *cur_p2d = (1ULL << 63) | ((uint64_t)fb_stn_id << 54) | - (vm_offset_t) mbuf_chain; /* XXX: fix 64 bit */ + /* set eop in most-recent p2d */ + cur_p2d[-1] |= (1ULL << 63); + +#ifdef __mips64 + /* + * On n64, we cannot store our mbuf pointer(64 bit) in the freeback + * message (40bit available), so we put the mbuf in m_nextpkt and + * use the physical addr of that in freeback message. + */ + mbuf_chain->m_nextpkt = mbuf_chain; + fbpaddr = vtophys(&mbuf_chain->m_nextpkt); +#else + /* Careful, don't sign extend when going to 64bit */ + fbpaddr = (uint64_t)(uintptr_t)mbuf_chain; +#endif + *cur_p2d = (1ULL << 63) | ((uint64_t)fb_stn_id << 54) | fbpaddr; *tx_desc = p2p; - if (is_p2p) { + if (p2p != NULL) { paddr = vtophys(p2p); p2p_sz++; fmn_msg->msg3 = (1ULL << 62) | ((uint64_t)fb_stn_id << 54) | @@ -1965,9 +1982,7 @@ send_fmn_msg_tx(struct nlge_softc *sc, s { uint32_t msgrng_flags; int ret; -#ifdef INVARIANTS int i = 0; -#endif do { msgrng_flags = msgrng_access_enable(); @@ -1979,7 +1994,7 @@ send_fmn_msg_tx(struct nlge_softc *sc, s i++; } while (i < 100000); - KASSERT(i < 100000, ("Too many credit fails in tx path\n")); + device_printf(sc->nlge_dev, "Too many credit fails in tx path\n"); return (1); } @@ -2012,7 +2027,7 @@ get_buf(void) if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_adj(m_new, XLR_CACHELINE_SIZE - ((unsigned int)m_new->m_data & 0x1f)); + m_adj(m_new, XLR_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); md = (uint64_t *)m_new->m_data; md[0] = (intptr_t)m_new; /* Back Ptr */ md[1] = 0xf00bad; @@ -2107,16 +2122,12 @@ nlge_set_port_attribs(struct nlge_softc { sc->instance = port_info->instance % 4; /* TBD: will not work for SPI-4 */ sc->port_type = port_info->type; - sc->base = (xlr_reg_t *) (port_info->base_addr + - (uint32_t)DEFAULT_XLR_IO_BASE); - sc->mii_base = (xlr_reg_t *) (port_info->mii_addr + - (uint32_t)DEFAULT_XLR_IO_BASE); + sc->base = xlr_io_mmio(port_info->base_addr); + sc->mii_base = xlr_io_mmio(port_info->mii_addr); if (port_info->pcs_addr != 0) - sc->pcs_addr = (xlr_reg_t *) (port_info->pcs_addr + - (uint32_t)DEFAULT_XLR_IO_BASE); + sc->pcs_addr = xlr_io_mmio(port_info->pcs_addr); if (port_info->serdes_addr != 0) - sc->serdes_addr = (xlr_reg_t *) (port_info->serdes_addr + - (uint32_t)DEFAULT_XLR_IO_BASE); + sc->serdes_addr = xlr_io_mmio(port_info->serdes_addr); sc->phy_addr = port_info->phy_addr; PDEBUG("Port%d: base=%p, mii_base=%p, phy_addr=%d\n", sc->id, sc->base, Modified: head/sys/mips/rmi/rmi_mips_exts.h ============================================================================== --- head/sys/mips/rmi/rmi_mips_exts.h Mon Sep 20 11:18:20 2010 (r212895) +++ head/sys/mips/rmi/rmi_mips_exts.h Mon Sep 20 11:53:57 2010 (r212896) @@ -418,6 +418,14 @@ xlr_ldaddwu(unsigned int value, unsigned } #if defined(__mips_n64) +static __inline uint32_t +xlr_paddr_lw(uint64_t paddr) +{ + + paddr |= 0x9800000000000000ULL; + return (*(uint32_t *)(uintptr_t)paddr); +} + static __inline uint64_t xlr_paddr_ld(uint64_t paddr) { @@ -427,6 +435,23 @@ xlr_paddr_ld(uint64_t paddr) } #elif defined(__mips_n32) +static __inline uint32_t +xlr_paddr_lw(uint32_t paddr) +{ + uint32_t val; + + paddr |= 0x9800000000000000ULL; + __asm__ __volatile__( + ".set push \n\t" + ".set mips64 \n\t" + "lw %0, 0(%1) \n\t" + ".set pop \n" + : "=r"(val) + : "r"(paddr)); + + return (val); +} + static __inline uint64_t xlr_paddr_ld(uint64_t paddr) { @@ -443,8 +468,33 @@ xlr_paddr_ld(uint64_t paddr) return (val); } -#else + +#else /* o32 compilation */ static __inline uint32_t +xlr_paddr_lw(uint64_t paddr) +{ + uint32_t addrh, addrl; + uint32_t val; + + addrh = 0x98000000 | (paddr >> 32); + addrl = paddr & 0xffffffff; + + __asm__ __volatile__( + ".set push \n\t" + ".set mips64 \n\t" + "dsll32 %1, %1, 0 \n\t" + "dsll32 %2, %2, 0 \n\t" /* get rid of the */ + "dsrl32 %2, %2, 0 \n\t" /* sign extend */ + "or %0, %1, %2 \n\t" + "lw %0, 0(%0) \n\t" + ".set pop \n" + : "=&r"(val) + : "r"(addrh), "r"(addrl)); + + return (val); +} + +static __inline uint64_t xlr_paddr_ld(uint64_t paddr) { uint32_t addrh, addrl; @@ -454,15 +504,15 @@ xlr_paddr_ld(uint64_t paddr) addrl = paddr & 0xffffffff; __asm__ __volatile__( - ".set push \n\t" - ".set mips64 \n\t" - "dsll32 %2, %2, 0 \n\t" - "dsll32 %3, %3, 0 \n\t" /* get rid of the */ - "dsrl32 %3, %3, 0 \n\t" /* sign extend */ - "or %2, %2, %3 \n\t" - "lw %0, 0(%2) \n\t" - "lw %1, 4(%2) \n\t" - ".set pop \n" + ".set push \n\t" + ".set mips64 \n\t" + "dsll32 %2, %2, 0 \n\t" + "dsll32 %3, %3, 0 \n\t" /* get rid of the */ + "dsrl32 %3, %3, 0 \n\t" /* sign extend */ + "or %0, %2, %3 \n\t" + "lw %1, 4(%0) \n\t" + "lw %0, 0(%0) \n\t" + ".set pop \n" : "=&r"(valh), "=r"(vall) : "r"(addrh), "r"(addrl)); @@ -485,7 +535,13 @@ static __inline void xlr_restore_kx(uint32_t sr) { } -#else + +#else /* !defined(__mips_n64) && !defined(__mips_n32) */ +/* + * o32 compilation, we will disable interrupts and enable + * the KX bit so that we can use XKPHYS to access any 40bit + * physical address + */ static __inline uint32_t xlr_enable_kx(void) { @@ -501,7 +557,7 @@ xlr_restore_kx(uint32_t sr) mips_wr_status(sr); } -#endif +#endif /* defined(__mips_n64) || defined(__mips_n32) */ /* for cpuid to hardware thread id mapping */ extern uint32_t xlr_hw_thread_mask; From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 12:19:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B4D71065670; Mon, 20 Sep 2010 12:19:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1468FC14; Mon, 20 Sep 2010 12:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KCJBFm051530; Mon, 20 Sep 2010 12:19:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KCJBrp051528; Mon, 20 Sep 2010 12:19:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009201219.o8KCJBrp051528@svn.freebsd.org> From: Michael Tuexen Date: Mon, 20 Sep 2010 12:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212897 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 12:19:11 -0000 Author: tuexen Date: Mon Sep 20 12:19:11 2010 New Revision: 212897 URL: http://svn.freebsd.org/changeset/base/212897 Log: Fix a locking issue which resulted in aborted associations due to a corrupted nr-mapping array. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Sep 20 11:53:57 2010 (r212896) +++ head/sys/netinet/sctp_indata.c Mon Sep 20 12:19:11 2010 (r212897) @@ -1776,6 +1776,10 @@ sctp_process_a_data_chunk(struct sctp_tc if (control == NULL) { goto failed_express_del; } + SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); + if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + asoc->highest_tsn_inside_nr_map = tsn; + } sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); @@ -1791,10 +1795,6 @@ sctp_process_a_data_chunk(struct sctp_tc } control = NULL; - SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { - asoc->highest_tsn_inside_nr_map = tsn; - } goto finish_express_del; } failed_express_del: From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 12:23:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA22C1065670; Mon, 20 Sep 2010 12:23:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9F548FC14; Mon, 20 Sep 2010 12:23:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KCNAxf051676; Mon, 20 Sep 2010 12:23:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KCNAJZ051674; Mon, 20 Sep 2010 12:23:10 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201009201223.o8KCNAJZ051674@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 20 Sep 2010 12:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212898 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 12:23:11 -0000 Author: glebius Date: Mon Sep 20 12:23:10 2010 New Revision: 212898 URL: http://svn.freebsd.org/changeset/base/212898 Log: Do not convert some meaningful error value to EINVAL. Reviewed by: will Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Mon Sep 20 12:19:11 2010 (r212897) +++ head/sys/netinet/ip_carp.c Mon Sep 20 12:23:10 2010 (r212898) @@ -2358,13 +2358,13 @@ carp_mod_load(void) printf("carp: error %d attaching to PF_INET6\n", proto_reg[CARP_INET6]); carp_mod_cleanup(); - return (EINVAL); + return (proto_reg[CARP_INET6]); } err = ip6proto_register(IPPROTO_CARP); if (err) { printf("carp: error %d registering with INET6\n", err); carp_mod_cleanup(); - return (EINVAL); + return (err); } #endif #ifdef INET @@ -2374,13 +2374,13 @@ carp_mod_load(void) printf("carp: error %d attaching to PF_INET\n", proto_reg[CARP_INET]); carp_mod_cleanup(); - return (EINVAL); + return (proto_reg[CARP_INET]); } err = ipproto_register(IPPROTO_CARP); if (err) { printf("carp: error %d registering with INET\n", err); carp_mod_cleanup(); - return (EINVAL); + return (err); } #endif return 0; From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 12:44:31 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2C371065670; Mon, 20 Sep 2010 12:44:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 234CB8FC19; Mon, 20 Sep 2010 12:44:30 +0000 (UTC) Received: from besplex.bde.org (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8KCiNJg029760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Sep 2010 22:44:28 +1000 Date: Mon, 20 Sep 2010 22:44:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <201009191635.o8JGZgF3008282@svn.freebsd.org> Message-ID: <20100920224337.E63497@besplex.bde.org> References: <201009191635.o8JGZgF3008282@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212867 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 12:44:31 -0000 On Sun, 19 Sep 2010, Ed Schouten wrote: > Log: > Just make callout devices and /dev/console force CLOCAL on open(). > > Instead of adding custom checks to wait for DCD on open(), just modify > the termios structure to set CLOCAL. This means SIGHUP is no longer > generated when losing DCD as well. > > Reviewed by: kib@ > MFC after: 1 week Er, my review explained how wrong this is. Please back it out. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 13:23:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB7281065698; Mon, 20 Sep 2010 13:23:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB72E8FC2A; Mon, 20 Sep 2010 13:23:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KDNhWP053071; Mon, 20 Sep 2010 13:23:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KDNhFT053068; Mon, 20 Sep 2010 13:23:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009201323.o8KDNhFT053068@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 20 Sep 2010 13:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212899 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 13:23:44 -0000 Author: pjd Date: Mon Sep 20 13:23:43 2010 New Revision: 212899 URL: http://svn.freebsd.org/changeset/base/212899 Log: Add __dead2 to functions that we know they are going to exit. MFC after: 3 days Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Sep 20 12:23:10 2010 (r212898) +++ head/sbin/hastd/primary.c Mon Sep 20 13:23:43 2010 (r212899) @@ -258,7 +258,7 @@ cleanup(struct hast_resource *res) errno = rerrno; } -static void +static __dead2 void primary_exit(int exitcode, const char *fmt, ...) { va_list ap; @@ -271,7 +271,7 @@ primary_exit(int exitcode, const char *f exit(exitcode); } -static void +static __dead2 void primary_exitx(int exitcode, const char *fmt, ...) { va_list ap; Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Mon Sep 20 12:23:10 2010 (r212898) +++ head/sbin/hastd/secondary.c Mon Sep 20 13:23:43 2010 (r212899) @@ -519,7 +519,7 @@ end: return (hio->hio_error); } -static void +static __dead2 void secondary_exit(int exitcode, const char *fmt, ...) { va_list ap; From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 14:58:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6AC1065670; Mon, 20 Sep 2010 14:58:08 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 921B88FC23; Mon, 20 Sep 2010 14:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KEw8mQ055729; Mon, 20 Sep 2010 14:58:08 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KEw8LA055727; Mon, 20 Sep 2010 14:58:08 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201009201458.o8KEw8LA055727@svn.freebsd.org> From: Colin Percival Date: Mon, 20 Sep 2010 14:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212901 - head/contrib/bzip2 releng/6.4 releng/6.4/contrib/bzip2 releng/6.4/sys/conf releng/7.1 releng/7.1/contrib/bzip2 releng/7.1/sys/conf releng/7.3 releng/7.3/contrib/bzip2 releng/7... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 14:58:08 -0000 Author: cperciva Date: Mon Sep 20 14:58:08 2010 New Revision: 212901 URL: http://svn.freebsd.org/changeset/base/212901 Log: Fix an integer overflow in RLE length parsing when decompressing corrupt bzip2 data. Approved by: so (cperciva) Security: FreeBSD-SA-10:08.bzip2 Modified: head/contrib/bzip2/decompress.c Changes in other areas also in this revision: Modified: releng/6.4/UPDATING releng/6.4/contrib/bzip2/decompress.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bzip2/decompress.c releng/7.1/sys/conf/newvers.sh releng/7.3/UPDATING releng/7.3/contrib/bzip2/decompress.c releng/7.3/sys/conf/newvers.sh releng/8.0/UPDATING releng/8.0/contrib/bzip2/decompress.c releng/8.0/sys/conf/newvers.sh releng/8.1/UPDATING releng/8.1/contrib/bzip2/decompress.c releng/8.1/sys/conf/newvers.sh stable/6/contrib/bzip2/decompress.c stable/7/contrib/bzip2/decompress.c stable/8/contrib/bzip2/decompress.c Modified: head/contrib/bzip2/decompress.c ============================================================================== --- head/contrib/bzip2/decompress.c Mon Sep 20 13:48:07 2010 (r212900) +++ head/contrib/bzip2/decompress.c Mon Sep 20 14:58:08 2010 (r212901) @@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s ) es = -1; N = 1; do { + /* Check that N doesn't get too big, so that es doesn't + go negative. The maximum value that can be + RUNA/RUNB encoded is equal to the block size (post + the initial RLE), viz, 900k, so bounding N at 2 + million should guard against overflow without + rejecting any legitimate inputs. */ + if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR); if (nextSym == BZ_RUNA) es = es + (0+1) * N; else if (nextSym == BZ_RUNB) es = es + (1+1) * N; N = N * 2; From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 16:04:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779F71065695; Mon, 20 Sep 2010 16:04:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6562F8FC22; Mon, 20 Sep 2010 16:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KG4iHG057611; Mon, 20 Sep 2010 16:04:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KG4iUx057606; Mon, 20 Sep 2010 16:04:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009201604.o8KG4iUx057606@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Sep 2010 16:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212902 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 16:04:44 -0000 Author: jhb Date: Mon Sep 20 16:04:44 2010 New Revision: 212902 URL: http://svn.freebsd.org/changeset/base/212902 Log: Tweak the stats exported by the e1000 drivers: - Add a single sysctl procedure to all three drivers to read an arbitrary register (the register is passed as arg2). Use it to replace existing routines in igb(4) that used a separate routine for each register, and to add support for missing stats in em(4) and lem(4). - Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats section as they are driver stats, not MAC counters. - Simplify the code that creates per-queue stats in igb(4) to use a single loop and remove duplicated code. - Properly read all 64 bits of the 'good octets received/transmitted' in em(4) and lem(4). - Actually read the interrupt count registers in em(4), and drop the 'host to card' sysctl stats from em(4) as they are not implemented in any of the hardware this driver supports. - Restore several stats to em(4) that were lost in the earlier stats conversion including per-queue stats. - Export several MAC stats in em(4) that were exported in igb(4) but not in em(4). - Export stats in lem(4) using individual sysctls as in em(4) and igb(4). Reviewed by: jfv MFC after: 1 week Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Sep 20 14:58:08 2010 (r212901) +++ head/sys/dev/e1000/if_em.c Mon Sep 20 16:04:44 2010 (r212902) @@ -4844,8 +4844,10 @@ em_update_stats_counters(struct adapter /* For the 64-bit byte counters the low dword must be read first. */ /* Both registers clear on the read of the high dword */ - adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCH); - adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCH); + adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GORCH) << 32); + adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GOTCH) << 32); adapter->stats.rnbc += E1000_READ_REG(&adapter->hw, E1000_RNBC); adapter->stats.ruc += E1000_READ_REG(&adapter->hw, E1000_RUC); @@ -4867,6 +4869,18 @@ em_update_stats_counters(struct adapter adapter->stats.mptc += E1000_READ_REG(&adapter->hw, E1000_MPTC); adapter->stats.bptc += E1000_READ_REG(&adapter->hw, E1000_BPTC); + /* Interrupt Counts */ + + adapter->stats.iac += E1000_READ_REG(&adapter->hw, E1000_IAC); + adapter->stats.icrxptc += E1000_READ_REG(&adapter->hw, E1000_ICRXPTC); + adapter->stats.icrxatc += E1000_READ_REG(&adapter->hw, E1000_ICRXATC); + adapter->stats.ictxptc += E1000_READ_REG(&adapter->hw, E1000_ICTXPTC); + adapter->stats.ictxatc += E1000_READ_REG(&adapter->hw, E1000_ICTXATC); + adapter->stats.ictxqec += E1000_READ_REG(&adapter->hw, E1000_ICTXQEC); + adapter->stats.ictxqmtc += E1000_READ_REG(&adapter->hw, E1000_ICTXQMTC); + adapter->stats.icrxdmtc += E1000_READ_REG(&adapter->hw, E1000_ICRXDMTC); + adapter->stats.icrxoc += E1000_READ_REG(&adapter->hw, E1000_ICRXOC); + if (adapter->hw.mac.type >= e1000_82543) { adapter->stats.algnerrc += E1000_READ_REG(&adapter->hw, E1000_ALGNERRC); @@ -4896,6 +4910,17 @@ em_update_stats_counters(struct adapter adapter->stats.latecol + adapter->watchdog_events; } +/* Export a single 32-bit register via a read-only sysctl. */ +static int +em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter; + u_int val; + + adapter = oidp->oid_arg1; + val = E1000_READ_REG(&adapter->hw, oidp->oid_arg2); + return (sysctl_handle_int(oidp, &val, 0, req)); +} /* * Add sysctl variables, one per statistic, to the system. @@ -4903,17 +4928,22 @@ em_update_stats_counters(struct adapter static void em_add_hw_stats(struct adapter *adapter) { - device_t dev = adapter->dev; + struct tx_ring *txr = adapter->tx_rings; + struct rx_ring *rxr = adapter->rx_rings; + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); struct sysctl_oid *tree = device_get_sysctl_tree(dev); struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); struct e1000_hw_stats *stats = &adapter->stats; - struct sysctl_oid *stat_node, *int_node, *host_node; - struct sysctl_oid_list *stat_list, *int_list, *host_list; + struct sysctl_oid *stat_node, *queue_node, *int_node; + struct sysctl_oid_list *stat_list, *queue_list, *int_list; +#define QUEUE_NAME_LEN 32 + char namebuf[QUEUE_NAME_LEN]; + /* Driver Statistics */ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", CTLFLAG_RD, &adapter->link_irq, 0, @@ -4930,7 +4960,21 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); - + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_overruns", + CTLFLAG_RD, &adapter->rx_overruns, + "RX overruns"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_timeouts", + CTLFLAG_RD, &adapter->watchdog_events, + "Watchdog timeouts"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", + CTLFLAG_RD, adapter, E1000_CTRL, + em_sysctl_reg_handler, "IU", + "Device Control Register"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", + CTLFLAG_RD, adapter, E1000_RCTL, + em_sysctl_reg_handler, "IU", + "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", CTLFLAG_RD, &adapter->hw.fc.high_water, 0, "Flow Control High Watermark"); @@ -4938,7 +4982,41 @@ em_add_hw_stats(struct adapter *adapter) CTLFLAG_RD, &adapter->hw.fc.low_water, 0, "Flow Control Low Watermark"); - /* MAC stats get the own sub node */ + for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD, NULL, "Queue Name"); + queue_list = SYSCTL_CHILDREN(queue_node); + + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", + CTLFLAG_RD, adapter, E1000_TDH(txr->me), + em_sysctl_reg_handler, "IU", + "Transmit Descriptor Head"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", + CTLFLAG_RD, adapter, E1000_TDT(txr->me), + em_sysctl_reg_handler, "IU", + "Transmit Descriptor Tail"); + SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq", + CTLFLAG_RD, &txr->tx_irq, + "Queue MSI-X Transmit Interrupts"); + SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "no_desc_avail", + CTLFLAG_RD, &txr->no_desc_avail, + "Queue No Descriptor Available"); + + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", + CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + em_sysctl_reg_handler, "IU", + "Receive Descriptor Head"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", + CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + em_sysctl_reg_handler, "IU", + "Receive Descriptor Tail"); + SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq", + CTLFLAG_RD, &rxr->rx_irq, + "Queue MSI-X Receive Interrupts"); + } + + /* MAC stats get their own sub node */ stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", CTLFLAG_RD, NULL, "Statistics"); @@ -4947,6 +5025,18 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll", CTLFLAG_RD, &stats->ecol, "Excessive collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll", + CTLFLAG_RD, &stats->scc, + "Single collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll", + CTLFLAG_RD, &stats->mcc, + "Multiple collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll", + CTLFLAG_RD, &stats->latecol, + "Late collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count", + CTLFLAG_RD, &stats->colc, + "Collision Count"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors", CTLFLAG_RD, &adapter->stats.symerrs, "Symbol Errors"); @@ -4962,11 +5052,18 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", CTLFLAG_RD, &adapter->stats.rnbc, "Receive No Buffers"); - /* RLEC is inaccurate on some hardware, calculate our own. */ -/* SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_len_errs", */ -/* CTLFLAG_RD, adapter->stats.roc + adapter->stats.ruc, */ -/* "Receive Length Errors"); */ - + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_undersize", + CTLFLAG_RD, &adapter->stats.ruc, + "Receive Undersize"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", + CTLFLAG_RD, &adapter->stats.rfc, + "Fragmented Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", + CTLFLAG_RD, &adapter->stats.roc, + "Oversized Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_jabber", + CTLFLAG_RD, &adapter->stats.rjc, + "Recevied Jabber"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_errs", CTLFLAG_RD, &adapter->stats.rxerrc, "Receive Errors"); @@ -4980,12 +5077,6 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &adapter->stats.cexterr, "Collision/Carrier extension errors"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_overruns", - CTLFLAG_RD, &adapter->rx_overruns, - "RX overruns"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "watchdog_timeouts", - CTLFLAG_RD, &adapter->watchdog_events, - "Watchdog timeouts"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", CTLFLAG_RD, &adapter->stats.xonrxc, "XON Received"); @@ -5035,9 +5126,9 @@ em_add_hw_stats(struct adapter *adapter) "Good Octets Received"); /* Packet Transmission Stats */ - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &adapter->stats.gotc, - "Good Octest Transmitted"); + "Good Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &adapter->stats.tpt, "Total Packets Transmitted"); @@ -5117,63 +5208,6 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_overrun", CTLFLAG_RD, &adapter->stats.icrxoc, "Interrupt Cause Receiver Overrun Count"); - - /* Host to Card Stats */ - - host_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "host", - CTLFLAG_RD, NULL, - "Host to Card Statistics"); - - host_list = SYSCTL_CHILDREN(host_node); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt", - CTLFLAG_RD, &adapter->stats.cbtmpc, - "Circuit Breaker Tx Packet Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "host_tx_pkt_discard", - CTLFLAG_RD, &adapter->stats.htdpmc, - "Host Transmit Discarded Packets"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_pkt", - CTLFLAG_RD, &adapter->stats.rpthc, - "Rx Packets To Host"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkts", - CTLFLAG_RD, &adapter->stats.cbrmpc, - "Circuit Breaker Rx Packet Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkt_drop", - CTLFLAG_RD, &adapter->stats.cbrdpc, - "Circuit Breaker Rx Dropped Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_pkt", - CTLFLAG_RD, &adapter->stats.hgptc, - "Host Good Packets Tx Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt_drop", - CTLFLAG_RD, &adapter->stats.htcbdpc, - "Host Tx Circuit Breaker Dropped Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_good_bytes", - CTLFLAG_RD, &adapter->stats.hgorc, - "Host Good Octets Received Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_bytes", - CTLFLAG_RD, &adapter->stats.hgotc, - "Host Good Octets Transmit Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "length_errors", - CTLFLAG_RD, &adapter->stats.lenerrs, - "Length Errors"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "serdes_violation_pkt", - CTLFLAG_RD, &adapter->stats.scvpc, - "SerDes/SGMII Code Violation Pkt Count"); - - SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "header_redir_missed", - CTLFLAG_RD, &adapter->stats.hrmpc, - "Header Redirection Missed Packet Count"); - } /********************************************************************** Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Sep 20 14:58:08 2010 (r212901) +++ head/sys/dev/e1000/if_igb.c Mon Sep 20 16:04:44 2010 (r212902) @@ -4823,9 +4823,9 @@ igb_update_stats_counters(struct adapter /* Both registers clear on the read of the high dword */ stats->gorc += E1000_READ_REG(hw, E1000_GORCL) + - ((u64)E1000_READ_REG(hw, E1000_GORCH) << 32); + ((u64)E1000_READ_REG(hw, E1000_GORCH) << 32); stats->gotc += E1000_READ_REG(hw, E1000_GOTCL) + - ((u64)E1000_READ_REG(hw, E1000_GOTCH) << 32) ; + ((u64)E1000_READ_REG(hw, E1000_GOTCH) << 32); stats->rnbc += E1000_READ_REG(hw, E1000_RNBC); stats->ruc += E1000_READ_REG(hw, E1000_RUC); @@ -4956,77 +4956,16 @@ igb_update_vf_stats_counters(struct adap stats->last_mprc, stats->mprc); } - -/** igb_sysctl_tdh_handler - Handler function - * Retrieves the TDH value from the hardware - */ -static int -igb_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS) -{ - int error; - - struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1); - if (!txr) return 0; - - unsigned val = E1000_READ_REG(&txr->adapter->hw, E1000_TDH(txr->me)); - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr) - return error; - return 0; -} - -/** igb_sysctl_tdt_handler - Handler function - * Retrieves the TDT value from the hardware - */ -static int -igb_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS) -{ - int error; - - struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1); - if (!txr) return 0; - - unsigned val = E1000_READ_REG(&txr->adapter->hw, E1000_TDT(txr->me)); - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr) - return error; - return 0; -} - -/** igb_sysctl_rdh_handler - Handler function - * Retrieves the RDH value from the hardware - */ -static int -igb_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS) -{ - int error; - - struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1); - if (!rxr) return 0; - - unsigned val = E1000_READ_REG(&rxr->adapter->hw, E1000_RDH(rxr->me)); - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr) - return error; - return 0; -} - -/** igb_sysctl_rdt_handler - Handler function - * Retrieves the RDT value from the hardware - */ -static int -igb_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS) +/* Export a single 32-bit register via a read-only sysctl. */ +static int +igb_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) { - int error; - - struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1); - if (!rxr) return 0; + struct adapter *adapter; + u_int val; - unsigned val = E1000_READ_REG(&rxr->adapter->hw, E1000_RDT(rxr->me)); - error = sysctl_handle_int(oidp, &val, 0, req); - if (error || !req->newptr) - return error; - return 0; + adapter = oidp->oid_arg1; + val = E1000_READ_REG(&adapter->hw, oidp->oid_arg2); + return (sysctl_handle_int(oidp, &val, 0, req)); } /* @@ -5035,7 +4974,6 @@ igb_sysctl_rdt_handler(SYSCTL_HANDLER_AR static void igb_add_hw_stats(struct adapter *adapter) { - device_t dev = adapter->dev; struct tx_ring *txr = adapter->tx_rings; @@ -5062,6 +5000,12 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_overruns", + CTLFLAG_RD, &adapter->rx_overruns, + "RX overruns"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_timeouts", + CTLFLAG_RD, &adapter->watchdog_events, + "Watchdog timeouts"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "device_control", CTLFLAG_RD, &adapter->device_control, @@ -5088,19 +5032,21 @@ igb_add_hw_stats(struct adapter *adapter CTLFLAG_RD, &adapter->hw.fc.low_water, 0, "Flow Control Low Watermark"); - for (int i = 0; i < adapter->num_queues; i++, txr++) { + for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { + struct lro_ctrl *lro = &rxr->lro; + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, txr, sizeof(txr), - igb_sysctl_tdh_handler, "IU", + CTLFLAG_RD, adapter, E1000_TDH(txr->me), + igb_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, txr, sizeof(txr), - igb_sysctl_tdt_handler, "IU", + CTLFLAG_RD, adapter, E1000_TDT(txr->me), + igb_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", CTLFLAG_RD, &txr->no_desc_avail, @@ -5108,28 +5054,14 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &txr->tx_packets, "Queue Packets Transmitted"); - } - - for (int i = 0; i < adapter->num_queues; i++, rxr++) { - snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); - queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Queue Name"); - queue_list = SYSCTL_CHILDREN(queue_node); - - struct lro_ctrl *lro = &rxr->lro; - - snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); - queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Queue Name"); - queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, rxr, sizeof(rxr), - igb_sysctl_rdh_handler, "IU", + CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + igb_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, rxr, sizeof(rxr), - igb_sysctl_rdt_handler, "IU", + CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + igb_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets", CTLFLAG_RD, &rxr->rx_packets, @@ -5145,7 +5077,7 @@ igb_add_hw_stats(struct adapter *adapter "LRO Flushed"); } - /* MAC stats get the own sub node */ + /* MAC stats get their own sub node */ stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", CTLFLAG_RD, NULL, "MAC Statistics"); @@ -5165,9 +5097,9 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", CTLFLAG_RD, &stats->gorc, "Good Octets Received"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, - "Good Octest Transmitted"); + "Good Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_recvd", CTLFLAG_RD, &stats->mprc, "Multicast Packets Received"); @@ -5229,12 +5161,6 @@ igb_add_hw_stats(struct adapter *adapter SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", CTLFLAG_RD, &stats->cexterr, "Collision/Carrier extension errors"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_overruns", - CTLFLAG_RD, &adapter->rx_overruns, - "RX overruns"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "watchdog_timeouts", - CTLFLAG_RD, &adapter->watchdog_events, - "Watchdog timeouts"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", CTLFLAG_RD, &stats->xonrxc, "XON Received"); @@ -5283,9 +5209,9 @@ igb_add_hw_stats(struct adapter *adapter "Good Octets Received"); /* Packet Transmission Stats */ - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", CTLFLAG_RD, &stats->gotc, - "Good Octest Transmitted"); + "Good Octets Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", CTLFLAG_RD, &stats->tpt, "Total Packets Transmitted"); Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Mon Sep 20 14:58:08 2010 (r212901) +++ head/sys/dev/e1000/if_lem.c Mon Sep 20 16:04:44 2010 (r212902) @@ -84,11 +84,6 @@ #include "if_lem.h" /********************************************************************* - * Set this to one to display debug statistics - *********************************************************************/ -int lem_display_debug_stats = 0; - -/********************************************************************* * Legacy Em Driver version: *********************************************************************/ char lem_driver_version[] = "1.0.1"; @@ -196,6 +191,7 @@ static void lem_disable_intr(struct adap static void lem_free_transmit_structures(struct adapter *); static void lem_free_receive_structures(struct adapter *); static void lem_update_stats_counters(struct adapter *); +static void lem_add_hw_stats(struct adapter *adapter); static void lem_txeof(struct adapter *); static void lem_tx_purge(struct adapter *); static int lem_allocate_receive_structures(struct adapter *); @@ -211,7 +207,6 @@ static void lem_transmit_checksum_setup( static void lem_set_promisc(struct adapter *); static void lem_disable_promisc(struct adapter *); static void lem_set_multi(struct adapter *); -static void lem_print_hw_stats(struct adapter *); static void lem_update_link_status(struct adapter *); static int lem_get_buf(struct adapter *, int); #if __FreeBSD_version >= 700029 @@ -228,11 +223,9 @@ static void lem_82547_move_tail(void *); static int lem_dma_malloc(struct adapter *, bus_size_t, struct em_dma_alloc *, int); static void lem_dma_free(struct adapter *, struct em_dma_alloc *); -static void lem_print_debug_info(struct adapter *); +static int lem_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void lem_print_nvm_info(struct adapter *); static int lem_is_valid_ether_addr(u8 *); -static int lem_sysctl_stats(SYSCTL_HANDLER_ARGS); -static int lem_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static u32 lem_fill_descriptors (bus_addr_t address, u32 length, PDESC_ARRAY desc_array); static int lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS); @@ -417,13 +410,8 @@ lem_attach(device_t dev) /* SYSCTL stuff */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - lem_sysctl_debug_info, "I", "Debug Information"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - lem_sysctl_stats, "I", "Statistics"); + OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, + lem_sysctl_nvm_info, "I", "NVM Information"); callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); callout_init_mtx(&adapter->tx_fifo_timer, &adapter->tx_mtx, 0); @@ -658,6 +646,8 @@ lem_attach(device_t dev) lem_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); #endif + lem_add_hw_stats(adapter); + /* Non-AMT based hardware can now take control from firmware */ if (adapter->has_manage && !adapter->has_amt) lem_get_hw_control(adapter); @@ -2017,7 +2007,6 @@ static void lem_local_timer(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp = adapter->ifp; EM_CORE_LOCK_ASSERT(adapter); @@ -2026,9 +2015,6 @@ lem_local_timer(void *arg) lem_update_link_status(adapter); lem_update_stats_counters(adapter); - if (lem_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) - lem_print_hw_stats(adapter); - lem_smartspeed(adapter); /* @@ -4268,8 +4254,10 @@ lem_update_stats_counters(struct adapter /* For the 64-bit byte counters the low dword must be read first. */ /* Both registers clear on the read of the high dword */ - adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCH); - adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCH); + adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GORCH) << 32); + adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GOTCH) << 32); adapter->stats.rnbc += E1000_READ_REG(&adapter->hw, E1000_RNBC); adapter->stats.ruc += E1000_READ_REG(&adapter->hw, E1000_RUC); @@ -4320,109 +4308,247 @@ lem_update_stats_counters(struct adapter adapter->stats.latecol + adapter->watchdog_events; } - -/********************************************************************** - * - * This routine is called only when lem_display_debug_stats is enabled. - * This routine provides a way to take a look at important statistics - * maintained by the driver and hardware. - * - **********************************************************************/ -static void -lem_print_debug_info(struct adapter *adapter) +/* Export a single 32-bit register via a read-only sysctl. */ +static int +lem_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) { - device_t dev = adapter->dev; - u8 *hw_addr = adapter->hw.hw_addr; + struct adapter *adapter; + u_int val; - device_printf(dev, "Adapter hardware address = %p \n", hw_addr); - device_printf(dev, "CTRL = 0x%x RCTL = 0x%x \n", - E1000_READ_REG(&adapter->hw, E1000_CTRL), - E1000_READ_REG(&adapter->hw, E1000_RCTL)); - device_printf(dev, "Packet buffer = Tx=%dk Rx=%dk \n", - ((E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff0000) >> 16),\ - (E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff) ); - device_printf(dev, "Flow control watermarks high = %d low = %d\n", - adapter->hw.fc.high_water, - adapter->hw.fc.low_water); - device_printf(dev, "tx_int_delay = %d, tx_abs_int_delay = %d\n", - E1000_READ_REG(&adapter->hw, E1000_TIDV), - E1000_READ_REG(&adapter->hw, E1000_TADV)); - device_printf(dev, "rx_int_delay = %d, rx_abs_int_delay = %d\n", - E1000_READ_REG(&adapter->hw, E1000_RDTR), - E1000_READ_REG(&adapter->hw, E1000_RADV)); - device_printf(dev, "fifo workaround = %lld, fifo_reset_count = %lld\n", - (long long)adapter->tx_fifo_wrk_cnt, - (long long)adapter->tx_fifo_reset_cnt); - device_printf(dev, "hw tdh = %d, hw tdt = %d\n", - E1000_READ_REG(&adapter->hw, E1000_TDH(0)), - E1000_READ_REG(&adapter->hw, E1000_TDT(0))); - device_printf(dev, "hw rdh = %d, hw rdt = %d\n", - E1000_READ_REG(&adapter->hw, E1000_RDH(0)), - E1000_READ_REG(&adapter->hw, E1000_RDT(0))); - device_printf(dev, "Num Tx descriptors avail = %d\n", - adapter->num_tx_desc_avail); - device_printf(dev, "Tx Descriptors not avail1 = %ld\n", - adapter->no_tx_desc_avail1); - device_printf(dev, "Tx Descriptors not avail2 = %ld\n", - adapter->no_tx_desc_avail2); - device_printf(dev, "Std mbuf failed = %ld\n", - adapter->mbuf_alloc_failed); - device_printf(dev, "Std mbuf cluster failed = %ld\n", - adapter->mbuf_cluster_failed); - device_printf(dev, "Driver dropped packets = %ld\n", - adapter->dropped_pkts); - device_printf(dev, "Driver tx dma failure in encap = %ld\n", - adapter->no_tx_dma_setup); + adapter = oidp->oid_arg1; + val = E1000_READ_REG(&adapter->hw, oidp->oid_arg2); + return (sysctl_handle_int(oidp, &val, 0, req)); } +/* + * Add sysctl variables, one per statistic, to the system. + */ static void -lem_print_hw_stats(struct adapter *adapter) +lem_add_hw_stats(struct adapter *adapter) { device_t dev = adapter->dev; - device_printf(dev, "Excessive collisions = %lld\n", - (long long)adapter->stats.ecol); -#if (DEBUG_HW > 0) /* Dont output these errors normally */ - device_printf(dev, "Symbol errors = %lld\n", - (long long)adapter->stats.symerrs); -#endif - device_printf(dev, "Sequence errors = %lld\n", - (long long)adapter->stats.sec); - device_printf(dev, "Defer count = %lld\n", - (long long)adapter->stats.dc); - device_printf(dev, "Missed Packets = %lld\n", - (long long)adapter->stats.mpc); - device_printf(dev, "Receive No Buffers = %lld\n", - (long long)adapter->stats.rnbc); - /* RLEC is inaccurate on some hardware, calculate our own. */ - device_printf(dev, "Receive Length Errors = %lld\n", - ((long long)adapter->stats.roc + (long long)adapter->stats.ruc)); - device_printf(dev, "Receive errors = %lld\n", - (long long)adapter->stats.rxerrc); - device_printf(dev, "Crc errors = %lld\n", - (long long)adapter->stats.crcerrs); - device_printf(dev, "Alignment errors = %lld\n", - (long long)adapter->stats.algnerrc); - device_printf(dev, "Collision/Carrier extension errors = %lld\n", - (long long)adapter->stats.cexterr); - device_printf(dev, "RX overruns = %ld\n", adapter->rx_overruns); - device_printf(dev, "watchdog timeouts = %ld\n", - adapter->watchdog_events); - device_printf(dev, "RX MSIX IRQ = %ld TX MSIX IRQ = %ld" - " LINK MSIX IRQ = %ld\n", adapter->rx_irq, - adapter->tx_irq , adapter->link_irq); - device_printf(dev, "XON Rcvd = %lld\n", - (long long)adapter->stats.xonrxc); - device_printf(dev, "XON Xmtd = %lld\n", - (long long)adapter->stats.xontxc); - device_printf(dev, "XOFF Rcvd = %lld\n", - (long long)adapter->stats.xoffrxc); - device_printf(dev, "XOFF Xmtd = %lld\n", - (long long)adapter->stats.xofftxc); - device_printf(dev, "Good Packets Rcvd = %lld\n", - (long long)adapter->stats.gprc); - device_printf(dev, "Good Packets Xmtd = %lld\n", - (long long)adapter->stats.gptc); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct e1000_hw_stats *stats = &adapter->stats; + + struct sysctl_oid *stat_node; + struct sysctl_oid_list *stat_list; + + /* Driver Statistics */ + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_alloc_fail", + CTLFLAG_RD, &adapter->mbuf_alloc_failed, + "Std mbuf failed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "cluster_alloc_fail", + CTLFLAG_RD, &adapter->mbuf_cluster_failed, + "Std mbuf cluster failed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", + CTLFLAG_RD, &adapter->dropped_pkts, + "Driver dropped packets"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", + CTLFLAG_RD, &adapter->no_tx_dma_setup, + "Driver tx dma failure in xmit"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_desc_fail1", + CTLFLAG_RD, &adapter->no_tx_desc_avail1, + "Not enough tx descriptors failure in xmit"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_desc_fail2", + CTLFLAG_RD, &adapter->no_tx_desc_avail2, + "Not enough tx descriptors failure in xmit"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_overruns", + CTLFLAG_RD, &adapter->rx_overruns, + "RX overruns"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_timeouts", + CTLFLAG_RD, &adapter->watchdog_events, + "Watchdog timeouts"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", + CTLFLAG_RD, adapter, E1000_CTRL, + lem_sysctl_reg_handler, "IU", + "Device Control Register"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", + CTLFLAG_RD, adapter, E1000_RCTL, + lem_sysctl_reg_handler, "IU", + "Receiver Control Register"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", + CTLFLAG_RD, &adapter->hw.fc.high_water, 0, + "Flow Control High Watermark"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_low_water", + CTLFLAG_RD, &adapter->hw.fc.low_water, 0, + "Flow Control Low Watermark"); + SYSCTL_ADD_QUAD(ctx, child, OID_AUTO, "fifo_workaround", + CTLFLAG_RD, &adapter->tx_fifo_wrk_cnt, + "TX FIFO workaround events"); + SYSCTL_ADD_QUAD(ctx, child, OID_AUTO, "fifo_reset", + CTLFLAG_RD, &adapter->tx_fifo_reset_cnt, + "TX FIFO resets"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_head", + CTLFLAG_RD, adapter, E1000_TDH(0), + lem_sysctl_reg_handler, "IU", + "Transmit Descriptor Head"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_tail", + CTLFLAG_RD, adapter, E1000_TDT(0), + lem_sysctl_reg_handler, "IU", + "Transmit Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_head", + CTLFLAG_RD, adapter, E1000_RDH(0), + lem_sysctl_reg_handler, "IU", + "Receive Descriptor Head"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_tail", + CTLFLAG_RD, adapter, E1000_RDT(0), + lem_sysctl_reg_handler, "IU", + "Receive Descriptor Tail"); + + + /* MAC stats get their own sub node */ + + stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", + CTLFLAG_RD, NULL, "Statistics"); + stat_list = SYSCTL_CHILDREN(stat_node); + + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll", + CTLFLAG_RD, &stats->ecol, + "Excessive collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll", + CTLFLAG_RD, &stats->scc, + "Single collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll", + CTLFLAG_RD, &stats->mcc, + "Multiple collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll", + CTLFLAG_RD, &stats->latecol, + "Late collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count", + CTLFLAG_RD, &stats->colc, + "Collision Count"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors", + CTLFLAG_RD, &adapter->stats.symerrs, + "Symbol Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "sequence_errors", + CTLFLAG_RD, &adapter->stats.sec, + "Sequence Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "defer_count", + CTLFLAG_RD, &adapter->stats.dc, + "Defer Count"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", + CTLFLAG_RD, &adapter->stats.mpc, + "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", + CTLFLAG_RD, &adapter->stats.rnbc, + "Receive No Buffers"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_undersize", + CTLFLAG_RD, &adapter->stats.ruc, + "Receive Undersize"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", + CTLFLAG_RD, &adapter->stats.rfc, + "Fragmented Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", + CTLFLAG_RD, &adapter->stats.roc, + "Oversized Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_jabber", + CTLFLAG_RD, &adapter->stats.rjc, + "Recevied Jabber"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_errs", + CTLFLAG_RD, &adapter->stats.rxerrc, + "Receive Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "crc_errs", + CTLFLAG_RD, &adapter->stats.crcerrs, + "CRC errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", + CTLFLAG_RD, &adapter->stats.algnerrc, + "Alignment Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", + CTLFLAG_RD, &adapter->stats.cexterr, + "Collision/Carrier extension errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", + CTLFLAG_RD, &adapter->stats.xonrxc, + "XON Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_txd", + CTLFLAG_RD, &adapter->stats.xontxc, + "XON Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_recvd", + CTLFLAG_RD, &adapter->stats.xoffrxc, + "XOFF Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", + CTLFLAG_RD, &adapter->stats.xofftxc, + "XOFF Transmitted"); + + /* Packet Reception Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", + CTLFLAG_RD, &adapter->stats.tpr, + "Total Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", + CTLFLAG_RD, &adapter->stats.gprc, + "Good Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.bprc, + "Broadcast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.mprc, + "Multicast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", + CTLFLAG_RD, &adapter->stats.prc64, + "64 byte frames received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", + CTLFLAG_RD, &adapter->stats.prc127, + "65-127 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_128_255", + CTLFLAG_RD, &adapter->stats.prc255, + "128-255 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_256_511", + CTLFLAG_RD, &adapter->stats.prc511, + "256-511 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.prc1023, + "512-1023 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.prc1522, + "1023-1522 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", + CTLFLAG_RD, &adapter->stats.gorc, + "Good Octets Received"); + + /* Packet Transmission Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd", + CTLFLAG_RD, &adapter->stats.gotc, + "Good Octets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", + CTLFLAG_RD, &adapter->stats.tpt, + "Total Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", + CTLFLAG_RD, &adapter->stats.gptc, + "Good Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.bptc, + "Broadcast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.mptc, + "Multicast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", + CTLFLAG_RD, &adapter->stats.ptc64, + "64 byte frames transmitted "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", + CTLFLAG_RD, &adapter->stats.ptc127, + "65-127 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_128_255", + CTLFLAG_RD, &adapter->stats.ptc255, + "128-255 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_256_511", + CTLFLAG_RD, &adapter->stats.ptc511, + "256-511 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.ptc1023, + "512-1023 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.ptc1522, + "1024-1522 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_txd", + CTLFLAG_RD, &adapter->stats.tsctc, + "TSO Contexts Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_ctx_fail", + CTLFLAG_RD, &adapter->stats.tsctfc, + "TSO Contexts Failed"); } /********************************************************************** @@ -4432,28 +4558,9 @@ lem_print_hw_stats(struct adapter *adapt * 32 words, stuff that matters is in that extent. * **********************************************************************/ -static void -lem_print_nvm_info(struct adapter *adapter) -{ - u16 eeprom_data; - int i, j, row = 0; - - /* Its a bit crude, but it gets the job done */ - printf("\nInterface EEPROM Dump:\n"); - printf("Offset\n0x0000 "); - for (i = 0, j = 0; i < 32; i++, j++) { - if (j == 8) { /* Make the offset block */ - j = 0; ++row; - printf("\n0x00%x0 ",row); - } - e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); - printf("%04x ", eeprom_data); - } - printf("\n"); -} static int -lem_sysctl_debug_info(SYSCTL_HANDLER_ARGS) +lem_sysctl_nvm_info(SYSCTL_HANDLER_ARGS) { struct adapter *adapter; int error; @@ -4465,16 +4572,12 @@ lem_sysctl_debug_info(SYSCTL_HANDLER_ARG if (error || !req->newptr) return (error); - if (result == 1) { - adapter = (struct adapter *)arg1; - lem_print_debug_info(adapter); - } /* * This value will cause a hex dump of the * first 32 16-bit words of the EEPROM to * the screen. */ - if (result == 2) { + if (result == 1) { adapter = (struct adapter *)arg1; lem_print_nvm_info(adapter); } @@ -4482,26 +4585,24 @@ lem_sysctl_debug_info(SYSCTL_HANDLER_ARG return (error); } - -static int -lem_sysctl_stats(SYSCTL_HANDLER_ARGS) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 16:10:08 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB9510656B6; Mon, 20 Sep 2010 16:10:08 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout030.mac.com (asmtpout030.mac.com [17.148.16.105]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8AD8FC16; Mon, 20 Sep 2010 16:10:08 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp030.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L9100LRWZK8CX00@asmtp030.mac.com>; Mon, 20 Sep 2010 09:09:45 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1009200075 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.0.10011,1.0.148,0.0.0000 definitions=2010-09-20_11:2010-09-20, 2010-09-20, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: <20100920163758.A788@besplex.bde.org> Date: Mon, 20 Sep 2010 09:09:43 -0700 Message-id: <11C42F9D-7201-4804-8923-430F28E58C57@mac.com> References: <201009200420.o8K4KtKn026514@svn.freebsd.org> <20100920163758.A788@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , src-committers@FreeBSD.org Subject: Re: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 16:10:08 -0000 On Sep 19, 2010, at 11:55 PM, Bruce Evans wrote: > On Mon, 20 Sep 2010, Marcel Moolenaar wrote: > >> Log: >> Unbreak the build on strong-aligned architectures (arm, ia64). >> Casting from (char *) to (struct ufs1_dinode *) changes the >> alignment requirement of the pointer and GCC does not know that >> the pointer is adequately aligned (due to malloc(3)), and warns >> about it. Cast to (void *) first to by-pass the check. > > A previous version in which the pointer (iobuf) the correct type to > begin with was better. It used to have type void *, but now has type > caddr_t (whose existence is a bug), in order to abuse caddr_t by > assuming that it is char * to do pointer arithmetic on it in 1 place > (iobuf + sblock.fs_cgsize). The 7 other places where iobuf is used > only assume that caddr_t is a pointer (or perhaps a [u]intptr_t). > > growfs has no other instances of caddr_t. My first instinct was to retype iobuf as (void *), but saw the pointer arithmetic and decided against it. If we had a macro that one can use to add X number of bytes to a pointer to any, I would have used that. Other macros to add X number of short, int, long, could be handy too, but that may not be as useful as for bytes. Would it be useful to add a macro like (don't mind the name): #define ADDBYTESTOPOINTER(ptr, cnt) \ ((__typeof(ptr))(void *)((uintptr_t)(void *)(ptr) + (cnt))) ? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 16:43:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 839191065675; Mon, 20 Sep 2010 16:43:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3718FC17; Mon, 20 Sep 2010 16:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KGhJZE058849; Mon, 20 Sep 2010 16:43:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KGhJ95058838; Mon, 20 Sep 2010 16:43:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201009201643.o8KGhJ95058838@svn.freebsd.org> From: Dimitry Andric Date: Mon, 20 Sep 2010 16:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212904 - in head: contrib/llvm contrib/llvm/autoconf contrib/llvm/autoconf/m4 contrib/llvm/bindings/ada/llvm contrib/llvm/bindings/ocaml/llvm contrib/llvm/include/llvm contrib/llvm/inc... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 16:43:19 -0000 Author: dim Date: Mon Sep 20 16:43:17 2010 New Revision: 212904 URL: http://svn.freebsd.org/changeset/base/212904 Log: Upgrade our Clang in base to r114020, from upstream's release_28 branch. Approved-by: rpaulo (mentor) Added: head/contrib/llvm/include/llvm/ADT/NullablePtr.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/ADT/NullablePtr.h head/contrib/llvm/include/llvm/Analysis/RegionInfo.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Analysis/RegionInfo.h head/contrib/llvm/include/llvm/Analysis/RegionIterator.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Analysis/RegionIterator.h head/contrib/llvm/include/llvm/Analysis/RegionPrinter.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Analysis/RegionPrinter.h head/contrib/llvm/include/llvm/Assembly/AssemblyAnnotationWriter.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Assembly/AssemblyAnnotationWriter.h head/contrib/llvm/include/llvm/CompilerDriver/AutoGenerated.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/CompilerDriver/AutoGenerated.h head/contrib/llvm/include/llvm/CompilerDriver/Main.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/CompilerDriver/Main.h head/contrib/llvm/include/llvm/Config/llvm-config.h.cmake - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Config/llvm-config.h.cmake head/contrib/llvm/include/llvm/Config/llvm-config.h.in - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Config/llvm-config.h.in head/contrib/llvm/include/llvm/MC/ELFObjectWriter.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/MC/ELFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCDwarf.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/MC/MCDwarf.h head/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/MC/MCELFSymbolFlags.h head/contrib/llvm/include/llvm/PassRegistry.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/PassRegistry.h head/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Support/CrashRecoveryContext.h head/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h - copied unchanged from r212799, vendor/llvm/dist/include/llvm/Transforms/Utils/ValueMapper.h head/contrib/llvm/lib/Analysis/RegionInfo.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Analysis/RegionInfo.cpp head/contrib/llvm/lib/Analysis/RegionPrinter.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Analysis/RegionPrinter.cpp head/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Analysis/TypeBasedAliasAnalysis.cpp head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/LocalStackSlotAllocation.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/RenderMachineFunction.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/RenderMachineFunction.cpp head/contrib/llvm/lib/CodeGen/RenderMachineFunction.h - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/RenderMachineFunction.h head/contrib/llvm/lib/CodeGen/SplitKit.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/Splitter.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/Splitter.cpp head/contrib/llvm/lib/CodeGen/Splitter.h - copied unchanged from r212799, vendor/llvm/dist/lib/CodeGen/Splitter.h head/contrib/llvm/lib/MC/ELFObjectWriter.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCDisassembler/ - copied from r212799, vendor/llvm/dist/lib/MC/MCDisassembler/ head/contrib/llvm/lib/MC/MCDwarf.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/Support/CrashRecoveryContext.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Support/CrashRecoveryContext.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMGlobalMerge.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/ARM/ARMGlobalMerge.cpp head/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/ARM/ARMMCInstLower.cpp head/contrib/llvm/lib/Target/ARM/ARMMCInstLower.h - copied unchanged from r212799, vendor/llvm/dist/lib/Target/ARM/ARMMCInstLower.h head/contrib/llvm/lib/Target/X86/AsmPrinter/X86InstComments.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86InstComments.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86InstComments.h - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86InstComments.h head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.h - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/X86InstrFMA.td - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86InstrFMA.td head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.h - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86MCInstLower.h head/contrib/llvm/lib/Target/X86/X86ShuffleDecode.h - copied unchanged from r212799, vendor/llvm/dist/lib/Target/X86/X86ShuffleDecode.h head/contrib/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp head/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/Transforms/Scalar/LowerAtomic.cpp head/contrib/llvm/lib/VMCore/PassRegistry.cpp - copied unchanged from r212799, vendor/llvm/dist/lib/VMCore/PassRegistry.cpp head/contrib/llvm/runtime/libprofile/libprofile.exports - copied unchanged from r212799, vendor/llvm/dist/runtime/libprofile/libprofile.exports head/contrib/llvm/tools/bugpoint-passes/ - copied from r212799, vendor/llvm/dist/tools/bugpoint-passes/ head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h - copied unchanged from r212799, vendor/clang/dist/include/clang/AST/OperationKinds.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h - copied, changed from r212799, vendor/clang/dist/include/clang/Analysis/Analyses/FormatString.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PseudoConstantAnalysis.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Analysis/Analyses/PseudoConstantAnalysis.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFGStmtMap.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Analysis/CFGStmtMap.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/CheckerHelpers.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Checker/PathSensitive/CheckerHelpers.h head/contrib/llvm/tools/clang/include/clang/FrontendTool/ - copied from r212799, vendor/clang/dist/include/clang/FrontendTool/ head/contrib/llvm/tools/clang/include/clang/Lex/CodeCompletionHandler.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Lex/CodeCompletionHandler.h head/contrib/llvm/tools/clang/include/clang/Parse/ParseAST.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Parse/ParseAST.h head/contrib/llvm/tools/clang/include/clang/Sema/AnalysisBasedWarnings.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/AnalysisBasedWarnings.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CXXFieldCollector.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/CXXFieldCollector.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/DelayedDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/Designator.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Designator.h head/contrib/llvm/tools/clang/include/clang/Sema/IdentifierResolver.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/IdentifierResolver.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Lookup.h head/contrib/llvm/tools/clang/include/clang/Sema/ObjCMethodList.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/ObjCMethodList.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Ownership.h head/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/ParsedTemplate.h head/contrib/llvm/tools/clang/include/clang/Sema/PrettyDeclStackTrace.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/PrettyDeclStackTrace.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/SemaInternal.h head/contrib/llvm/tools/clang/include/clang/Sema/Template.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/Template.h head/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h - copied unchanged from r212799, vendor/clang/dist/include/clang/Sema/TemplateDeduction.h head/contrib/llvm/tools/clang/include/clang/Serialization/ - copied from r212799, vendor/clang/dist/include/clang/Serialization/ head/contrib/llvm/tools/clang/lib/AST/CXXABI.h - copied unchanged from r212799, vendor/clang/dist/lib/AST/CXXABI.h head/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp - copied unchanged from r212799, vendor/clang/dist/lib/AST/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp - copied unchanged from r212799, vendor/clang/dist/lib/AST/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFGStmtMap.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Analysis/CFGStmtMap.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatStringParsing.h - copied unchanged from r212799, vendor/clang/dist/lib/Analysis/FormatStringParsing.h head/contrib/llvm/tools/clang/lib/Analysis/PseudoConstantAnalysis.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp head/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp head/contrib/llvm/tools/clang/lib/Checker/AnalysisManager.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Checker/AnalysisManager.cpp head/contrib/llvm/tools/clang/lib/Checker/CheckerHelpers.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Checker/CheckerHelpers.cpp head/contrib/llvm/tools/clang/lib/Checker/UnreachableCodeChecker.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Checker/UnreachableCodeChecker.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ - copied from r212799, vendor/clang/dist/lib/FrontendTool/ head/contrib/llvm/tools/clang/lib/Headers/avxintrin.h - copied unchanged from r212799, vendor/clang/dist/lib/Headers/avxintrin.h head/contrib/llvm/tools/clang/lib/Headers/immintrin.h - copied unchanged from r212799, vendor/clang/dist/lib/Headers/immintrin.h head/contrib/llvm/tools/clang/lib/Headers/x86intrin.h - copied unchanged from r212799, vendor/clang/dist/lib/Headers/x86intrin.h head/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Parse/ParseAST.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp - copied unchanged from r212799, vendor/clang/dist/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Serialization/ - copied from r212799, vendor/clang/dist/lib/Serialization/ head/contrib/llvm/tools/clang/tools/driver/Info.plist.in - copied unchanged from r212799, vendor/clang/dist/tools/driver/Info.plist.in head/contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp - copied unchanged from r212799, vendor/clang/dist/tools/libclang/CIndexCXX.cpp head/contrib/llvm/tools/clang/tools/libclang/CXType.cpp - copied unchanged from r212799, vendor/clang/dist/tools/libclang/CXType.cpp head/contrib/llvm/tools/clang/tools/libclang/CXType.h - copied unchanged from r212799, vendor/clang/dist/tools/libclang/CXType.h head/contrib/llvm/tools/llvm-diff/ - copied from r212799, vendor/llvm/dist/tools/llvm-diff/ head/contrib/llvm/tools/llvmc/examples/ - copied from r212799, vendor/llvm/dist/tools/llvmc/examples/ head/contrib/llvm/tools/llvmc/src/ - copied from r212799, vendor/llvm/dist/tools/llvmc/src/ head/contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c - copied unchanged from r212799, vendor/llvm/dist/utils/lit/lit/ExampleTests/required-and-missing.c head/contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c - copied unchanged from r212799, vendor/llvm/dist/utils/lit/lit/ExampleTests/required-and-present.c head/contrib/llvm/utils/llvm-lit/ - copied from r212799, vendor/llvm/dist/utils/llvm-lit/ head/lib/clang/include/ARMGenAsmMatcher.inc (contents, props changed) head/lib/clang/include/ARMGenFastISel.inc (contents, props changed) head/lib/clang/include/X86GenDisassemblerTables.inc (contents, props changed) head/lib/clang/include/X86GenEDInfo.inc (contents, props changed) head/lib/clang/include/clang/AST/AttrImpl.inc (contents, props changed) head/lib/clang/include/clang/Serialization/ head/lib/clang/include/clang/Serialization/AttrPCHRead.inc (contents, props changed) head/lib/clang/include/clang/Serialization/AttrPCHWrite.inc (contents, props changed) head/lib/clang/include/llvm/Config/llvm-config.h (contents, props changed) head/lib/clang/libclangfrontendtool/ head/lib/clang/libclangfrontendtool/Makefile (contents, props changed) head/lib/clang/libclangindex/ head/lib/clang/libclangindex/Makefile (contents, props changed) head/lib/clang/libclangserialization/ head/lib/clang/libclangserialization/Makefile (contents, props changed) head/lib/clang/libllvmx86disassembler/ head/lib/clang/libllvmx86disassembler/Makefile (contents, props changed) Deleted: head/contrib/llvm/autoconf/m4/bison.m4 head/contrib/llvm/autoconf/m4/cxx_bidi_iterator.m4 head/contrib/llvm/autoconf/m4/cxx_fwd_iterator.m4 head/contrib/llvm/autoconf/m4/cxx_namespaces.m4 head/contrib/llvm/autoconf/m4/cxx_std_iterator.m4 head/contrib/llvm/autoconf/m4/flex.m4 head/contrib/llvm/include/llvm/ADT/iterator.cmake head/contrib/llvm/include/llvm/ADT/iterator.h.in head/contrib/llvm/include/llvm/Assembly/AsmAnnotationWriter.h head/contrib/llvm/include/llvm/CompilerDriver/ForceLinkage.h head/contrib/llvm/include/llvm/CompilerDriver/ForceLinkageMacros.h head/contrib/llvm/include/llvm/CompilerDriver/Plugin.h head/contrib/llvm/include/llvm/MC/MCParser/AsmParser.h head/contrib/llvm/include/llvm/Support/DataTypes.h.cmake head/contrib/llvm/include/llvm/Support/DataTypes.h.in head/contrib/llvm/include/llvm/Support/SlowOperationInformer.h head/contrib/llvm/include/llvm/Transforms/Utils/SSI.h head/contrib/llvm/lib/CodeGen/OptimizeExts.cpp head/contrib/llvm/lib/CompilerDriver/Plugin.cpp head/contrib/llvm/lib/Support/SlowOperationInformer.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h head/contrib/llvm/lib/Target/MSIL/ head/contrib/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.h head/contrib/llvm/lib/Target/X86/X86FloatingPointRegKill.cpp head/contrib/llvm/lib/Transforms/Scalar/ABCD.cpp head/contrib/llvm/lib/Transforms/Utils/SSI.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.h head/contrib/llvm/mklib head/contrib/llvm/runtime/libprofile/BlockProfiling.c head/contrib/llvm/runtime/libprofile/FunctionProfiling.c head/contrib/llvm/runtime/libprofile/exported_symbols.lst head/contrib/llvm/tools/bugpoint/TestPasses.cpp head/contrib/llvm/tools/clang/VER head/contrib/llvm/tools/clang/include/clang/AST/DeclNodes.def head/contrib/llvm/tools/clang/include/clang/AST/StmtNodes.def head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHBitCodes.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHDeserializationListener.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHReader.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHWriter.h head/contrib/llvm/tools/clang/include/clang/Index/Utils.h head/contrib/llvm/tools/clang/include/clang/Parse/Action.h head/contrib/llvm/tools/clang/include/clang/Parse/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Parse/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Parse/Designator.h head/contrib/llvm/tools/clang/include/clang/Parse/Ownership.h head/contrib/llvm/tools/clang/include/clang/Parse/Scope.h head/contrib/llvm/tools/clang/include/clang/Parse/Template.h head/contrib/llvm/tools/clang/include/clang/Sema/ParseAST.h head/contrib/llvm/tools/clang/lib/Checker/CallInliner.cpp head/contrib/llvm/tools/clang/lib/Frontend/GeneratePCH.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHReader.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriter.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriterStmt.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintParserCallbacks.cpp head/contrib/llvm/tools/clang/lib/Headers/arm_neon.h head/contrib/llvm/tools/clang/lib/Headers/arm_neon.td head/contrib/llvm/tools/clang/lib/Index/ResolveLocation.cpp head/contrib/llvm/tools/clang/lib/Parse/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Parse/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Parse/MinimalAction.cpp head/contrib/llvm/tools/clang/lib/Runtime/ head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.h head/contrib/llvm/tools/clang/lib/Sema/CXXFieldCollector.h head/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.h head/contrib/llvm/tools/clang/lib/Sema/Lookup.h head/contrib/llvm/tools/clang/lib/Sema/ParseAST.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.h head/contrib/llvm/tools/clang/lib/Sema/SemaInit.h head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.h head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.h head/contrib/llvm/tools/clang/tools/CIndex/ head/contrib/llvm/tools/clang/tools/index-test/ head/contrib/llvm/tools/clang/tools/libclang/CXTypes.cpp head/contrib/llvm/tools/clang/utils/pch-test.pl head/contrib/llvm/tools/edis/EDDisassembler.cpp head/contrib/llvm/tools/edis/EDDisassembler.h head/contrib/llvm/tools/edis/EDInfo.td head/contrib/llvm/tools/edis/EDInst.cpp head/contrib/llvm/tools/edis/EDInst.h head/contrib/llvm/tools/edis/EDOperand.cpp head/contrib/llvm/tools/edis/EDOperand.h head/contrib/llvm/tools/edis/EDToken.cpp head/contrib/llvm/tools/edis/EDToken.h head/contrib/llvm/tools/llvmc/driver/Main.cpp head/contrib/llvm/tools/llvmc/driver/Makefile head/contrib/llvm/tools/llvmc/example/Hello/Hello.cpp head/contrib/llvm/tools/llvmc/example/Hello/Makefile head/contrib/llvm/tools/llvmc/example/Simple/Makefile head/contrib/llvm/tools/llvmc/example/Simple/PluginMain.cpp head/contrib/llvm/tools/llvmc/example/Simple/Simple.td head/contrib/llvm/tools/llvmc/example/Skeleton/Makefile head/contrib/llvm/tools/llvmc/example/Skeleton/README head/contrib/llvm/tools/llvmc/example/Skeleton/driver/Main.cpp head/contrib/llvm/tools/llvmc/example/Skeleton/driver/Makefile head/contrib/llvm/tools/llvmc/example/Skeleton/plugins/Makefile head/contrib/llvm/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile head/contrib/llvm/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td head/contrib/llvm/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp head/contrib/llvm/tools/llvmc/example/mcc16/Makefile head/contrib/llvm/tools/llvmc/example/mcc16/README head/contrib/llvm/tools/llvmc/example/mcc16/driver/Main.cpp head/contrib/llvm/tools/llvmc/example/mcc16/driver/Makefile head/contrib/llvm/tools/llvmc/example/mcc16/plugins/Makefile head/contrib/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile head/contrib/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td head/contrib/llvm/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp head/contrib/llvm/tools/llvmc/plugins/Base/Base.td.in head/contrib/llvm/tools/llvmc/plugins/Base/Hooks.cpp head/contrib/llvm/tools/llvmc/plugins/Base/Makefile head/contrib/llvm/tools/llvmc/plugins/Base/PluginMain.cpp head/contrib/llvm/tools/llvmc/plugins/Clang/Clang.td head/contrib/llvm/tools/llvmc/plugins/Clang/Makefile head/contrib/llvm/tools/llvmc/plugins/Clang/PluginMain.cpp head/contrib/llvm/tools/llvmc/plugins/Makefile head/contrib/llvm/utils/RegressionFinder.pl head/contrib/llvm/utils/mkpatch head/contrib/llvm/utils/userloc.pl head/contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp Modified: head/contrib/llvm/CMakeLists.txt head/contrib/llvm/CREDITS.TXT head/contrib/llvm/Makefile head/contrib/llvm/Makefile.config.in head/contrib/llvm/Makefile.rules head/contrib/llvm/README.txt head/contrib/llvm/autoconf/configure.ac head/contrib/llvm/autoconf/m4/link_options.m4 head/contrib/llvm/bindings/ada/llvm/llvm.ads head/contrib/llvm/bindings/ocaml/llvm/llvm.ml head/contrib/llvm/bindings/ocaml/llvm/llvm.mli head/contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c head/contrib/llvm/configure head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/EnhancedDisassembly.h head/contrib/llvm/include/llvm-c/ExecutionEngine.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm-c/lto.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/DenseSet.h head/contrib/llvm/include/llvm/ADT/DepthFirstIterator.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h head/contrib/llvm/include/llvm/ADT/STLExtras.h head/contrib/llvm/include/llvm/ADT/ScopedHashTable.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/StringMap.h head/contrib/llvm/include/llvm/ADT/StringRef.h head/contrib/llvm/include/llvm/ADT/StringSet.h head/contrib/llvm/include/llvm/ADT/StringSwitch.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/ValueMap.h head/contrib/llvm/include/llvm/ADT/ilist.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h head/contrib/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h head/contrib/llvm/include/llvm/Analysis/DebugInfo.h head/contrib/llvm/include/llvm/Analysis/Dominators.h head/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h head/contrib/llvm/include/llvm/Analysis/IntervalPartition.h head/contrib/llvm/include/llvm/Analysis/LazyValueInfo.h head/contrib/llvm/include/llvm/Analysis/LibCallAliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/LibCallSemantics.h head/contrib/llvm/include/llvm/Analysis/LoopDependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/LoopPass.h head/contrib/llvm/include/llvm/Analysis/Passes.h head/contrib/llvm/include/llvm/Analysis/PointerTracking.h head/contrib/llvm/include/llvm/Analysis/PostDominators.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/AutoUpgrade.h head/contrib/llvm/include/llvm/Bitcode/Archive.h head/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h head/contrib/llvm/include/llvm/CallGraphSCCPass.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveStackAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveVariables.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineFunctionPass.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/ProcessImplicitDefs.h head/contrib/llvm/include/llvm/CodeGen/SchedulerRegistry.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.h head/contrib/llvm/include/llvm/CompilerDriver/Action.h head/contrib/llvm/include/llvm/CompilerDriver/BuiltinOptions.h head/contrib/llvm/include/llvm/CompilerDriver/Common.td head/contrib/llvm/include/llvm/CompilerDriver/CompilationGraph.h head/contrib/llvm/include/llvm/CompilerDriver/Error.h head/contrib/llvm/include/llvm/CompilerDriver/Main.inc head/contrib/llvm/include/llvm/CompilerDriver/Tool.h head/contrib/llvm/include/llvm/Config/config.h.cmake head/contrib/llvm/include/llvm/Config/config.h.in head/contrib/llvm/include/llvm/Constants.h head/contrib/llvm/include/llvm/DerivedTypes.h head/contrib/llvm/include/llvm/ExecutionEngine/JITMemoryManager.h head/contrib/llvm/include/llvm/GlobalValue.h head/contrib/llvm/include/llvm/Instruction.h head/contrib/llvm/include/llvm/Instructions.h head/contrib/llvm/include/llvm/IntrinsicInst.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/IntrinsicsARM.td head/contrib/llvm/include/llvm/IntrinsicsPowerPC.td head/contrib/llvm/include/llvm/IntrinsicsX86.td head/contrib/llvm/include/llvm/LLVMContext.h head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/LinkAllVMCore.h head/contrib/llvm/include/llvm/Linker.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCAssembler.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCObjectWriter.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h head/contrib/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h head/contrib/llvm/include/llvm/MC/MCSectionELF.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/Metadata.h head/contrib/llvm/include/llvm/Module.h head/contrib/llvm/include/llvm/Pass.h head/contrib/llvm/include/llvm/PassAnalysisSupport.h head/contrib/llvm/include/llvm/PassManager.h head/contrib/llvm/include/llvm/PassManagers.h head/contrib/llvm/include/llvm/PassSupport.h head/contrib/llvm/include/llvm/Support/COFF.h head/contrib/llvm/include/llvm/Support/CallSite.h head/contrib/llvm/include/llvm/Support/Casting.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/Compiler.h head/contrib/llvm/include/llvm/Support/ConstantRange.h head/contrib/llvm/include/llvm/Support/DataFlow.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/ErrorHandling.h head/contrib/llvm/include/llvm/Support/GraphWriter.h head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/IRReader.h head/contrib/llvm/include/llvm/Support/MachO.h head/contrib/llvm/include/llvm/Support/MathExtras.h head/contrib/llvm/include/llvm/Support/PassNameParser.h head/contrib/llvm/include/llvm/Support/PatternMatch.h head/contrib/llvm/include/llvm/Support/PrettyStackTrace.h head/contrib/llvm/include/llvm/Support/Regex.h head/contrib/llvm/include/llvm/Support/Registry.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Support/StandardPasses.h head/contrib/llvm/include/llvm/Support/SystemUtils.h head/contrib/llvm/include/llvm/Support/TypeBuilder.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/System/Memory.h head/contrib/llvm/include/llvm/System/Path.h head/contrib/llvm/include/llvm/System/Process.h head/contrib/llvm/include/llvm/System/Program.h head/contrib/llvm/include/llvm/System/Signals.h head/contrib/llvm/include/llvm/System/ThreadLocal.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetAsmParser.h head/contrib/llvm/include/llvm/Target/TargetCallingConv.td head/contrib/llvm/include/llvm/Target/TargetData.h head/contrib/llvm/include/llvm/Target/TargetInstrDesc.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOpcodes.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetRegistry.h head/contrib/llvm/include/llvm/Target/TargetSelect.h head/contrib/llvm/include/llvm/Transforms/IPO.h head/contrib/llvm/include/llvm/Transforms/IPO/InlinerPass.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h head/contrib/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h head/contrib/llvm/include/llvm/Type.h head/contrib/llvm/include/llvm/Use.h head/contrib/llvm/include/llvm/Value.h head/contrib/llvm/include/llvm/ValueSymbolTable.h head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasAnalysisCounter.cpp head/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp head/contrib/llvm/lib/Analysis/AliasDebugger.cpp head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/CFGPrinter.cpp head/contrib/llvm/lib/Analysis/CMakeLists.txt head/contrib/llvm/lib/Analysis/CaptureTracking.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DbgInfoPrinter.cpp head/contrib/llvm/lib/Analysis/DebugInfo.cpp head/contrib/llvm/lib/Analysis/DomPrinter.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp head/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstCount.cpp head/contrib/llvm/lib/Analysis/IntervalPartition.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/LibCallAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/LibCallSemantics.cpp head/contrib/llvm/lib/Analysis/Lint.cpp head/contrib/llvm/lib/Analysis/LiveValues.cpp head/contrib/llvm/lib/Analysis/LoopDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/LoopPass.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp head/contrib/llvm/lib/Analysis/PointerTracking.cpp head/contrib/llvm/lib/Analysis/PostDominators.cpp head/contrib/llvm/lib/Analysis/ProfileEstimatorPass.cpp head/contrib/llvm/lib/Analysis/ProfileInfo.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp head/contrib/llvm/lib/Analysis/ProfileVerifierPass.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/AsmParser/Parser.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/Analysis.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/CMakeLists.txt head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CodePlacementOpt.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ELF.h head/contrib/llvm/lib/CodeGen/ELFCodeEmitter.cpp head/contrib/llvm/lib/CodeGen/ELFWriter.cpp head/contrib/llvm/lib/CodeGen/ELFWriter.h head/contrib/llvm/lib/CodeGen/GCMetadata.cpp head/contrib/llvm/lib/CodeGen/GCStrategy.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/LowerSubregs.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineDominators.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp head/contrib/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp head/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp head/contrib/llvm/lib/CodeGen/PBQP/HeuristicBase.h head/contrib/llvm/lib/CodeGen/PBQP/HeuristicSolver.h head/contrib/llvm/lib/CodeGen/PBQP/Heuristics/Briggs.h head/contrib/llvm/lib/CodeGen/PBQP/Solution.h head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/PHIElimination.h head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/PreAllocSplitting.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.h head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp head/contrib/llvm/lib/CodeGen/Spiller.cpp head/contrib/llvm/lib/CodeGen/Spiller.h head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.h head/contrib/llvm/lib/CodeGen/VirtRegRewriter.cpp head/contrib/llvm/lib/CompilerDriver/Action.cpp head/contrib/llvm/lib/CompilerDriver/BuiltinOptions.cpp head/contrib/llvm/lib/CompilerDriver/CompilationGraph.cpp head/contrib/llvm/lib/CompilerDriver/Main.cpp head/contrib/llvm/lib/CompilerDriver/Makefile head/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/Intercept.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.h head/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/MC/CMakeLists.txt head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/TargetAsmParser.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/MC/Makefile head/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/CMakeLists.txt head/contrib/llvm/lib/Support/ConstantRange.cpp head/contrib/llvm/lib/Support/ErrorHandling.cpp head/contrib/llvm/lib/Support/FoldingSet.cpp head/contrib/llvm/lib/Support/PrettyStackTrace.cpp head/contrib/llvm/lib/Support/SmallVector.cpp head/contrib/llvm/lib/Support/Statistic.cpp head/contrib/llvm/lib/Support/StringRef.cpp head/contrib/llvm/lib/Support/SystemUtils.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/System/DynamicLibrary.cpp head/contrib/llvm/lib/System/Path.cpp head/contrib/llvm/lib/System/RWMutex.cpp head/contrib/llvm/lib/System/ThreadLocal.cpp head/contrib/llvm/lib/System/Unix/Path.inc head/contrib/llvm/lib/System/Unix/Signals.inc head/contrib/llvm/lib/System/Unix/ThreadLocal.inc head/contrib/llvm/lib/System/Win32/Path.inc head/contrib/llvm/lib/System/Win32/Signals.inc head/contrib/llvm/lib/System/Win32/ThreadLocal.inc head/contrib/llvm/lib/Target/ARM/ARM.h head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAddressingModes.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/Makefile head/contrib/llvm/lib/Target/ARM/NEONMoveFix.cpp head/contrib/llvm/lib/Target/ARM/NEONPreAllocPass.cpp head/contrib/llvm/lib/Target/ARM/README.txt head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp head/contrib/llvm/lib/Target/Alpha/AlphaBranchSelector.cpp head/contrib/llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaLLRP.cpp head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h head/contrib/llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h head/contrib/llvm/lib/Target/CBackend/CBackend.cpp head/contrib/llvm/lib/Target/CellSPU/SPUCallingConv.td head/contrib/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.td head/contrib/llvm/lib/Target/CellSPU/SPUOperands.td head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp head/contrib/llvm/lib/Target/MBlaze/MBlaze.td head/contrib/llvm/lib/Target/MBlaze/MBlazeCallingConv.td head/contrib/llvm/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelDAGToDAG.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrFPU.td head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrFSL.td head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrFormats.td head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeIntrinsics.td head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeSchedule.td head/contrib/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/Mangler.cpp head/contrib/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSchedule.td head/contrib/llvm/lib/Target/PIC16/CMakeLists.txt head/contrib/llvm/lib/Target/PIC16/PIC16.h head/contrib/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp head/contrib/llvm/lib/Target/PIC16/PIC16ISelLowering.h head/contrib/llvm/lib/Target/PIC16/PIC16InstrInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16InstrInfo.h head/contrib/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h head/contrib/llvm/lib/Target/PIC16/PIC16RegisterInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16RegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td head/contrib/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/README.txt head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/FPMover.cpp head/contrib/llvm/lib/Target/Sparc/Sparc.td head/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/TargetData.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetRegisterInfo.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.h head/contrib/llvm/lib/Target/X86/AsmPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86IntelInstPrinter.h head/contrib/llvm/lib/Target/X86/CMakeLists.txt head/contrib/llvm/lib/Target/X86/README-FPStack.txt head/contrib/llvm/lib/Target/X86/README-SSE.txt head/contrib/llvm/lib/Target/X86/README.txt head/contrib/llvm/lib/Target/X86/SSEDomainFix.cpp head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmBackend.cpp head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86Instr64bit.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/CMakeLists.txt head/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Transforms/Hello/Hello.cpp head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp head/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp head/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/Internalize.cpp head/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp head/contrib/llvm/lib/Transforms/IPO/LowerSetJmp.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp head/contrib/llvm/lib/Transforms/IPO/PartialSpecialization.cpp head/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp head/contrib/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/IPO/StructRetPromotion.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp head/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp head/contrib/llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp head/contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt head/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp head/contrib/llvm/lib/Transforms/Scalar/ConstantProp.cpp head/contrib/llvm/lib/Transforms/Scalar/DCE.cpp head/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/GEPSplitter.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/Sink.cpp head/contrib/llvm/lib/Transforms/Scalar/TailDuplication.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BasicInliner.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/CMakeLists.txt head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/InstructionNamer.cpp head/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp head/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp head/contrib/llvm/lib/Transforms/Utils/Mem2Reg.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp head/contrib/llvm/lib/VMCore/AsmWriter.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/CMakeLists.txt head/contrib/llvm/lib/VMCore/ConstantFold.cpp head/contrib/llvm/lib/VMCore/Constants.cpp head/contrib/llvm/lib/VMCore/ConstantsContext.h head/contrib/llvm/lib/VMCore/Core.cpp head/contrib/llvm/lib/VMCore/Dominators.cpp head/contrib/llvm/lib/VMCore/Globals.cpp head/contrib/llvm/lib/VMCore/InlineAsm.cpp head/contrib/llvm/lib/VMCore/Instruction.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/LLVMContext.cpp head/contrib/llvm/lib/VMCore/LLVMContextImpl.cpp head/contrib/llvm/lib/VMCore/LLVMContextImpl.h head/contrib/llvm/lib/VMCore/Metadata.cpp head/contrib/llvm/lib/VMCore/Module.cpp head/contrib/llvm/lib/VMCore/Pass.cpp head/contrib/llvm/lib/VMCore/PassManager.cpp head/contrib/llvm/lib/VMCore/PrintModulePass.cpp head/contrib/llvm/lib/VMCore/Type.cpp head/contrib/llvm/lib/VMCore/TypesContext.h head/contrib/llvm/lib/VMCore/Use.cpp head/contrib/llvm/lib/VMCore/Value.cpp head/contrib/llvm/lib/VMCore/ValueSymbolTable.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/runtime/libprofile/Makefile head/contrib/llvm/tools/CMakeLists.txt head/contrib/llvm/tools/Makefile head/contrib/llvm/tools/bugpoint/BugDriver.cpp head/contrib/llvm/tools/bugpoint/BugDriver.h head/contrib/llvm/tools/bugpoint/CMakeLists.txt head/contrib/llvm/tools/bugpoint/CrashDebugger.cpp head/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/bugpoint/FindBugs.cpp head/contrib/llvm/tools/bugpoint/Miscompilation.cpp head/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp head/contrib/llvm/tools/bugpoint/ToolRunner.cpp head/contrib/llvm/tools/bugpoint/bugpoint.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h head/contrib/llvm/tools/clang/include/clang/AST/Attr.h head/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h head/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h head/contrib/llvm/tools/clang/include/clang/AST/DeclGroup.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/FullExpr.h head/contrib/llvm/tools/clang/include/clang/AST/Makefile head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h head/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/AST/TypeOrdering.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/LiveVariables.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h head/contrib/llvm/tools/clang/include/clang/Analysis/FlowSensitive/DataflowSolver.h head/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h head/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGStmtVisitor.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h head/contrib/llvm/tools/clang/include/clang/Basic/Makefile head/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Checker/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/AnalysisManager.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Checker.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/ConstraintManager.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Environment.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRExprEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRState.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRSubEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRTransferFuncs.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRWorkList.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/SymbolManager.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/ValueManager.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/HostInfo.h head/contrib/llvm/tools/clang/include/clang/Driver/Job.h head/contrib/llvm/tools/clang/include/clang/Driver/OptParser.td head/contrib/llvm/tools/clang/include/clang/Driver/OptTable.h head/contrib/llvm/tools/clang/include/clang/Driver/Option.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Tool.h head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h head/contrib/llvm/tools/clang/include/clang/Frontend/DeclXML.def head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DocumentXML.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOutputOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/StmtXML.def head/contrib/llvm/tools/clang/include/clang/Frontend/TypeXML.def head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Index/TranslationUnit.h head/contrib/llvm/tools/clang/include/clang/Lex/ExternalPreprocessorSource.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Makefile head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FixItRewriter.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h head/contrib/llvm/tools/clang/lib/AST/ASTConsumer.cpp head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp head/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclGroup.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/FullExpr.cpp head/contrib/llvm/tools/clang/lib/AST/Makefile head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/Makefile head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/Makefile head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Checker/AdjustedReturnValueChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/AggExprVisitor.cpp head/contrib/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/Checker/ArrayBoundChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicStore.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicValueFactory.cpp head/contrib/llvm/tools/clang/lib/Checker/BugReporter.cpp head/contrib/llvm/tools/clang/lib/Checker/BugReporterVisitors.cpp head/contrib/llvm/tools/clang/lib/Checker/CFRefCount.cpp head/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Checker/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/CastSizeChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/CheckDeadStores.cpp head/contrib/llvm/tools/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/Checker/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Checker/DivZeroChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/Environment.cpp head/contrib/llvm/tools/clang/lib/Checker/FixedAddressChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/FlatStore.cpp head/contrib/llvm/tools/clang/lib/Checker/GRCXXExprEngine.cpp head/contrib/llvm/tools/clang/lib/Checker/GRCoreEngine.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngine.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngineExperimentalChecks.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngineExperimentalChecks.h head/contrib/llvm/tools/clang/lib/Checker/GRState.cpp head/contrib/llvm/tools/clang/lib/Checker/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/LLVMConventionsChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/Makefile head/contrib/llvm/tools/clang/lib/Checker/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/MemRegion.cpp head/contrib/llvm/tools/clang/lib/Checker/OSAtomicChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/PointerArithChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/PointerSubChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/RangeConstraintManager.cpp head/contrib/llvm/tools/clang/lib/Checker/RegionStore.cpp head/contrib/llvm/tools/clang/lib/Checker/ReturnPointerRangeChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/ReturnUndefChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/SVals.cpp head/contrib/llvm/tools/clang/lib/Checker/SValuator.cpp head/contrib/llvm/tools/clang/lib/Checker/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/Checker/SimpleConstraintManager.h head/contrib/llvm/tools/clang/lib/Checker/SimpleSValuator.cpp head/contrib/llvm/tools/clang/lib/Checker/StackAddrLeakChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/Store.cpp head/contrib/llvm/tools/clang/lib/Checker/StreamChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/Checker/UndefBranchChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/UndefinedAssignmentChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/UnixAPIChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/VLASizeChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/ValueManager.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.h head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGTemporaries.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/Makefile head/contrib/llvm/tools/clang/lib/CodeGen/Mangle.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/InputInfo.h head/contrib/llvm/tools/clang/lib/Driver/Job.cpp head/contrib/llvm/tools/clang/lib/Driver/Makefile head/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp head/contrib/llvm/tools/clang/lib/Driver/Option.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp head/contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/Makefile head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/StmtXML.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticsClient.cpp head/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Headers/Makefile head/contrib/llvm/tools/clang/lib/Headers/altivec.h head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/mmintrin.h head/contrib/llvm/tools/clang/lib/Headers/nmmintrin.h head/contrib/llvm/tools/clang/lib/Headers/smmintrin.h head/contrib/llvm/tools/clang/lib/Headers/stddef.h head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h head/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Index/Entity.cpp head/contrib/llvm/tools/clang/lib/Index/Makefile head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp head/contrib/llvm/tools/clang/lib/Lex/Makefile head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Makefile head/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Parse/Makefile head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Rewrite/DeltaTree.cpp head/contrib/llvm/tools/clang/lib/Rewrite/FixItRewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Makefile head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp head/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/Makefile head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp head/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.h head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt head/contrib/llvm/tools/clang/tools/c-index-test/Makefile head/contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c head/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt head/contrib/llvm/tools/clang/tools/driver/Makefile head/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndex.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp head/contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt head/contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp head/contrib/llvm/tools/clang/tools/libclang/CXCursor.h head/contrib/llvm/tools/clang/tools/libclang/Makefile head/contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports head/contrib/llvm/tools/clang/tools/libclang/libclang.exports head/contrib/llvm/tools/edis/CMakeLists.txt head/contrib/llvm/tools/edis/EDMain.cpp head/contrib/llvm/tools/edis/Makefile head/contrib/llvm/tools/gold/README.txt head/contrib/llvm/tools/gold/gold-plugin.cpp head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/lli/lli.cpp head/contrib/llvm/tools/llvm-as/llvm-as.cpp head/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp head/contrib/llvm/tools/llvm-config/CMakeLists.txt head/contrib/llvm/tools/llvm-dis/llvm-dis.cpp head/contrib/llvm/tools/llvm-extract/llvm-extract.cpp head/contrib/llvm/tools/llvm-ld/llvm-ld.cpp head/contrib/llvm/tools/llvm-link/llvm-link.cpp head/contrib/llvm/tools/llvm-mc/CMakeLists.txt head/contrib/llvm/tools/llvm-mc/Disassembler.cpp head/contrib/llvm/tools/llvm-mc/Disassembler.h head/contrib/llvm/tools/llvm-mc/Makefile head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvm-prof/llvm-prof.cpp head/contrib/llvm/tools/llvm-shlib/Makefile head/contrib/llvm/tools/llvmc/CMakeLists.txt head/contrib/llvm/tools/llvmc/Makefile head/contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst head/contrib/llvm/tools/lto/LTOCodeGenerator.cpp head/contrib/llvm/tools/lto/LTOCodeGenerator.h head/contrib/llvm/tools/lto/LTOModule.cpp head/contrib/llvm/tools/lto/LTOModule.h head/contrib/llvm/tools/lto/Makefile head/contrib/llvm/tools/lto/lto.cpp head/contrib/llvm/tools/lto/lto.exports head/contrib/llvm/tools/opt/AnalysisWrappers.cpp head/contrib/llvm/tools/opt/GraphPrinters.cpp head/contrib/llvm/tools/opt/PrintSCC.cpp head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/FileCheck/FileCheck.cpp head/contrib/llvm/utils/FileUpdate/FileUpdate.cpp head/contrib/llvm/utils/Makefile head/contrib/llvm/utils/TableGen/ARMDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/CallingConvEmitter.cpp head/contrib/llvm/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/utils/TableGen/ClangAttrEmitter.h head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelEmitter.h head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/EDEmitter.h head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp head/contrib/llvm/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/utils/TableGen/Record.cpp head/contrib/llvm/utils/TableGen/Record.h head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/buildit/GNUmakefile head/contrib/llvm/utils/buildit/build_llvm head/contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg head/contrib/llvm/utils/lit/lit/TestFormats.py head/contrib/llvm/utils/lit/lit/TestRunner.py head/contrib/llvm/utils/lit/lit/TestingConfig.py head/contrib/llvm/utils/lit/lit/lit.py head/contrib/llvm/utils/llvm.grm head/contrib/llvm/utils/llvmdo head/contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp head/contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp head/contrib/llvm/utils/vim/llvm.vim head/contrib/llvm/utils/vim/vimrc head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangbasic/Makefile head/lib/clang/libclangchecker/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmarmasmparser/Makefile head/lib/clang/libllvmarmasmprinter/Makefile head/lib/clang/libllvmarmcodegen/Makefile head/lib/clang/libllvmbitreader/Makefile head/lib/clang/libllvmbitwriter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmsystem/Makefile head/lib/clang/libllvmtarget/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86asmprinter/Makefile head/lib/clang/libllvmx86codegen/Makefile head/usr.bin/clang/clang/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/CMakeLists.txt ============================================================================== --- head/contrib/llvm/CMakeLists.txt Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/CMakeLists.txt Mon Sep 20 16:43:17 2010 (r212904) @@ -1,10 +1,20 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. project(LLVM) -cmake_minimum_required(VERSION 2.6.1) +cmake_minimum_required(VERSION 2.8) + +# Add path for custom modules +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + +set(PACKAGE_VERSION "2.8") +include(VersionFromVCS) +add_version_info_from_vcs(PACKAGE_VERSION) set(PACKAGE_NAME llvm) -set(PACKAGE_VERSION 2.8svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu") @@ -53,7 +63,6 @@ set(LLVM_ALL_TARGETS CppBackend Mips MBlaze - MSIL MSP430 PIC16 PowerPC @@ -124,13 +133,6 @@ configure_file( set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm) -# Add path for custom modules -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${LLVM_MAIN_SRC_DIR}/cmake" - "${LLVM_MAIN_SRC_DIR}/cmake/modules" - ) - include(AddLLVMDefinitions) if(WIN32) @@ -214,14 +216,8 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) if( MSVC ) - # List of valid CRTs for MSVC - set(MSVC_CRT - MD - MDd - MT - MTd) + include(ChooseMSVCCRT) - set(LLVM_USE_CRT "" CACHE STRING "Specify VC++ CRT to use for debug/release configurations.") add_llvm_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE ) @@ -231,15 +227,6 @@ if( MSVC ) # Suppress 'new behavior: elements of array 'array' will be default initialized' add_llvm_definitions( -wd4351 ) - if (NOT ${LLVM_USE_CRT} STREQUAL "") - list(FIND MSVC_CRT ${LLVM_USE_CRT} idx) - if (idx LESS 0) - message(FATAL_ERROR "Invalid value for LLVM_USE_CRT: ${LLVM_USE_CRT}. Valid options are one of: ${MSVC_CRT}") - endif (idx LESS 0) - add_llvm_definitions("/${LLVM_USE_CRT}") - message(STATUS "Using VC++ CRT: ${LLVM_USE_CRT}") - endif (NOT ${LLVM_USE_CRT} STREQUAL "") - # Enable warnings if (LLVM_ENABLE_WARNINGS) add_llvm_definitions( /W4 /Wall ) @@ -308,6 +295,7 @@ add_subdirectory(lib/Analysis) add_subdirectory(lib/Analysis/IPA) add_subdirectory(lib/MC) add_subdirectory(lib/MC/MCParser) +add_subdirectory(lib/MC/MCDisassembler) add_subdirectory(test) add_subdirectory(utils/FileCheck) @@ -372,6 +360,8 @@ add_subdirectory(tools) option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF) add_subdirectory(examples) +add_subdirectory(cmake/modules) + install(DIRECTORY include/ DESTINATION include FILES_MATCHING Modified: head/contrib/llvm/CREDITS.TXT ============================================================================== --- head/contrib/llvm/CREDITS.TXT Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/CREDITS.TXT Mon Sep 20 16:43:17 2010 (r212904) @@ -134,6 +134,11 @@ N: Gabor Greif E: ggreif@gmail.com D: Improvements for space efficiency +N: James Grosbach +E: grosbach@apple.com +D: SjLj exception handling support +D: General fixes and improvements for the ARM back-end + N: Lang Hames E: lhames@gmail.com D: PBQP-based register allocator @@ -247,6 +252,12 @@ N: Scott Michel E: scottm@aero.org D: Added STI Cell SPU backend. +N: Takumi Nakamura +E: geek4civic@gmail.com +E: chapuni@hf.rim.or.jp +D: Cygwin and MinGW support. +S: Yokohama, Japan + N: Edward O'Callaghan E: eocallaghan@auroraux.org W: http://www.auroraux.org @@ -277,6 +288,11 @@ N: Sandeep Patel E: deeppatel1987@gmail.com D: ARM calling conventions rewrite, hard float support +N: Wesley Peck +E: peckw@wesleypeck.com +W: http://wesleypeck.com/ +D: MicroBlaze backend + N: Vladimir Prus W: http://vladimir_prus.blogspot.com E: ghost@cs.msu.su @@ -288,7 +304,10 @@ D: MSIL backend N: Duncan Sands E: baldrick@free.fr -D: Ada front-end, exception handling improvements +D: Ada support in llvm-gcc +D: Dragonegg plugin +D: Exception handling improvements +D: Type legalizer rewrite N: Ruchira Sasanka E: sasanka@uiuc.edu @@ -306,6 +325,10 @@ N: Anand Shukla E: ashukla@cs.uiuc.edu D: The `paths' pass +N: Michael J. Spencer +E: bigcheesegs@gmail.com +D: Shepherding Windows COFF support into MC. + N: Reid Spencer E: rspencer@reidspencer.com W: http://reidspencer.com/ @@ -329,14 +352,9 @@ E: xerxes@zafena.se D: Cmake dependency chain and various bug fixes N: Bill Wendling -E: isanbard@gmail.com +E: wendling@apple.com D: Bunches of stuff N: Bob Wilson E: bob.wilson@acm.org D: Advanced SIMD (NEON) support in the ARM backend - -N: Wesley Peck -E: peckw@wesleypeck.com -W: http://wesleypeck.com/ -D: MicroBlaze backend Modified: head/contrib/llvm/Makefile ============================================================================== --- head/contrib/llvm/Makefile Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/Makefile Mon Sep 20 16:43:17 2010 (r212904) @@ -64,7 +64,8 @@ endif ifeq ($(MAKECMDGOALS),install-clang) DIRS := tools/clang/tools/driver tools/clang/lib/Headers \ - tools/clang/runtime tools/clang/docs + tools/clang/runtime tools/clang/docs \ + tools/lto OPTIONAL_DIRS := NO_INSTALL = 1 endif @@ -78,7 +79,8 @@ ifeq ($(MAKECMDGOALS),install-clang-c) endif ifeq ($(MAKECMDGOALS),clang-only) - DIRS := $(filter-out tools runtime docs unittests, $(DIRS)) tools/clang + DIRS := $(filter-out tools runtime docs unittests, $(DIRS)) \ + tools/clang tools/lto OPTIONAL_DIRS := endif @@ -110,7 +112,8 @@ cross-compile-build-tools: --host=$(BUILD_TRIPLE) --target=$(BUILD_TRIPLE); \ cd .. ; \ fi; \ - ($(MAKE) -C BuildTools \ + (unset SDKROOT; \ + $(MAKE) -C BuildTools \ BUILD_DIRS_ONLY=1 \ UNIVERSAL= \ ENABLE_OPTIMIZED=$(ENABLE_OPTIMIZED) \ @@ -167,7 +170,7 @@ FilesToConfig := \ include/llvm/Config/AsmParsers.def \ include/llvm/Config/Disassemblers.def \ include/llvm/System/DataTypes.h \ - tools/llvmc/plugins/Base/Base.td + tools/llvmc/src/Base.td FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig)) all-local:: $(FilesToConfigPATH) @@ -192,9 +195,6 @@ endif check-llvm2cpp: $(Verb)$(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1 -check-one: - $(Verb)$(MAKE) -C test check-one TESTONE=$(TESTONE) - srpm: $(LLVM_OBJ_ROOT)/llvm.spec rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec Modified: head/contrib/llvm/Makefile.config.in ============================================================================== --- head/contrib/llvm/Makefile.config.in Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/Makefile.config.in Mon Sep 20 16:43:17 2010 (r212904) @@ -39,14 +39,18 @@ ifndef PROJECT_NAME PROJECT_NAME := $(LLVMPackageName) endif -PROJ_OBJ_DIR := $(shell $(PWD)) -PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD)) +# The macro below is expanded when 'realpath' is not built-in. +# Built-in 'realpath' is available on GNU Make 3.81. +realpath = $(shell cd $(1); $(PWD)) + +PROJ_OBJ_DIR := $(call realpath, .) +PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) ifeq ($(PROJECT_NAME),llvm) -LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD)) -LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD)) -PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD)) -PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@) +LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@) +PROJ_SRC_ROOT := $(LLVM_SRC_ROOT) +PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := @prefix@ PROJ_prefix := $(prefix) PROJ_VERSION := $(LLVMVersion) @@ -66,7 +70,7 @@ endif ifndef LLVM_OBJ_ROOT $(error Projects must define LLVM_OBJ_ROOT) endif -PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := $(PROJ_INSTALL_ROOT) PROJ_prefix := $(prefix) ifndef PROJ_VERSION Modified: head/contrib/llvm/Makefile.rules ============================================================================== --- head/contrib/llvm/Makefile.rules Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/Makefile.rules Mon Sep 20 16:43:17 2010 (r212904) @@ -196,105 +196,15 @@ install-local:: all-local install-bytecode:: install-bytecode-local ############################################################################### -# LLVMC: Provide rules for compiling llvmc plugins +# LLVMC: Provide rules for compiling llvmc-based driver ############################################################################### -ifdef LLVMC_PLUGIN - -LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN)) -CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN) -REQUIRES_EH := 1 - -ifeq ($(ENABLE_LLVMC_DYNAMIC),1) - LD.Flags += -lCompilerDriver -endif - -# Build a dynamic library if the user runs `make` directly from the plugin -# directory. -ifndef LLVMC_BUILTIN_PLUGIN - LOADABLE_MODULE = 1 -endif - -# TableGen stuff... -ifneq ($(BUILT_SOURCES),) - LLVMC_BUILD_AUTOGENERATED_INC=1 -endif - -endif # LLVMC_PLUGIN - ifdef LLVMC_BASED_DRIVER TOOLNAME = $(LLVMC_BASED_DRIVER) -REQUIRES_EH := 1 - -ifeq ($(ENABLE_LLVMC_DYNAMIC),1) - LD.Flags += -lCompilerDriver -else - LLVMLIBS = CompilerDriver.a - LINK_COMPONENTS = support system -endif - -# Preprocessor magic that generates references to static variables in built-in -# plugins. -ifneq ($(LLVMC_BUILTIN_PLUGINS),) - -USEDLIBS += $(patsubst %,plugin_llvmc_%.a,$(LLVMC_BUILTIN_PLUGINS)) - -LLVMC_BUILTIN_PLUGIN_1 = $(word 1, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_2 = $(word 2, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_3 = $(word 3, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_4 = $(word 4, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_5 = $(word 5, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_6 = $(word 6, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_7 = $(word 7, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_8 = $(word 8, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_9 = $(word 9, $(LLVMC_BUILTIN_PLUGINS)) -LLVMC_BUILTIN_PLUGIN_10 = $(word 10, $(LLVMC_BUILTIN_PLUGINS)) - - -ifneq ($(LLVMC_BUILTIN_PLUGIN_1),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_1=$(LLVMC_BUILTIN_PLUGIN_1) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_2),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_2=$(LLVMC_BUILTIN_PLUGIN_2) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_3),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_3=$(LLVMC_BUILTIN_PLUGIN_3) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_4),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_4=$(LLVMC_BUILTIN_PLUGIN_4) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_5),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_5) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_6),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_6) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_7),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_7) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_8),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_8) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_9),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_9) -endif - -ifneq ($(LLVMC_BUILTIN_PLUGIN_10),) -CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_10) -endif - - -endif +LLVMLIBS = CompilerDriver.a +LINK_COMPONENTS = support system endif # LLVMC_BASED_DRIVER @@ -501,6 +411,26 @@ LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildM LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples #-------------------------------------------------------------------- +# Locations of shared libraries +#-------------------------------------------------------------------- + +SharedPrefix := lib +SharedLibDir := $(LibDir) +LLVMSharedLibDir := $(LLVMLibDir) + +# Win32.DLL prefers to be located on the "PATH" of binaries. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + SharedLibDir := $(ToolDir) + LLVMSharedLibDir := $(LLVMToolDir) + + ifeq ($(HOST_OS),Cygwin) + SharedPrefix := cyg + else + SharedPrefix := + endif +endif + +#-------------------------------------------------------------------- # LLVM Capable Compiler #-------------------------------------------------------------------- @@ -573,12 +503,7 @@ ifeq ($(HOST_OS),Darwin) SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION) endif else - ifeq ($(HOST_OS),Cygwin) - SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \ - -Wl,--enable-auto-import -Wl,--enable-auto-image-base - else - SharedLinkOptions=-shared - endif + SharedLinkOptions=-shared endif ifeq ($(TARGET_OS),Darwin) @@ -588,11 +513,13 @@ ifeq ($(TARGET_OS),Darwin) endif ifdef SHARED_LIBRARY +ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) ifneq ($(HOST_OS),Darwin) LD.Flags += $(RPATH) -Wl,'$$ORIGIN' else ifneq ($(DARWIN_MAJVERS),4) - LD.Flags += $(RPATH) -Wl,$(LibDir) + LD.Flags += $(RPATH) -Wl,$(SharedLibDir) +endif endif endif endif @@ -621,8 +548,8 @@ ifndef KEEP_SYMBOLS endif # Adjust linker flags for building an executable -ifneq ($(HOST_OS),Darwin) -ifneq ($(DARWIN_MAJVERS),4) +ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +ifneq ($(HOST_OS), Darwin) ifdef TOOLNAME LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' ifdef EXAMPLE_TOOL @@ -631,12 +558,12 @@ ifdef TOOLNAME LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC) endif endif -endif else ifneq ($(DARWIN_MAJVERS),4) LD.Flags += $(RPATH) -Wl,@executable_path/../lib endif endif +endif #---------------------------------------------------------- @@ -963,6 +890,13 @@ LLVMUsedLibs := $(patsubst %.a.o, lib LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs)) endif +# Win32.DLL may refer to other components. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + ifdef LOADABLE_MODULE + LINK_COMPONENTS := all + endif +endif + ifndef IS_CLEANING_TARGET ifdef LINK_COMPONENTS @@ -975,12 +909,28 @@ $(LLVM_CONFIG): $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG) ifeq ($(ENABLE_SHARED), 1) +# We can take the "auto-import" feature to get rid of using dllimport. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \ + -L $(SharedLibDir) +endif LLVMLibsOptions += -lLLVM-$(LLVMVersion) -LLVMLibsPaths += $(LibDir)/libLLVM-$(LLVMVersion)$(SHLIBEXT) +LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT) else -LLVMLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS)) -LLVMLibsPaths += $(LLVM_CONFIG) \ - $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS)) + +ifndef NO_LLVM_CONFIG +LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error) +ifeq ($(LLVMConfigLibs),Error) +$(error llvm-config --libs failed) +endif +LLVMLibsOptions += $(LLVMConfigLibs) +LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error) +ifeq ($(LLVMConfigLibfiles),Error) +$(error llvm-config --libfiles failed) +endif +LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles) +endif + endif endif endif @@ -1011,12 +961,25 @@ $(NativeExportsFile): $(EXPORTED_SYMBOL_ clean-local:: -$(Verb) $(RM) -f $(NativeExportsFile) else +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +# GNU ld Win32 accepts .DEF files that contain "DATA" entries. +NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def)) +$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir + $(Echo) Generating $(notdir $@) + $(Verb) $(ECHO) "EXPORTS" > $@ + $(Verb) $(CAT) $< >> $@ +clean-local:: + -$(Verb) $(RM) -f $(NativeExportsFile) +else +# Default behavior: just use the exports file verbatim. NativeExportsFile := $(EXPORTED_SYMBOL_FILE) endif endif +endif # Now add the linker command-line options to use the native export file. +# Darwin ifeq ($(HOST_OS),Darwin) LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile) endif @@ -1026,6 +989,12 @@ ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile) endif +# Windows +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +# LLVMLibsOptions is invalidated at processing tools/llvm-shlib. +SharedLinkOptions += $(NativeExportsFile) +endif + endif ############################################################################### @@ -1100,10 +1069,10 @@ ifdef LIBRARYNAME LIBRARYNAME := $(strip $(LIBRARYNAME)) ifdef LOADABLE_MODULE LibName.A := $(LibDir)/$(LIBRARYNAME).a -LibName.SO := $(LibDir)/$(LIBRARYNAME)$(SHLIBEXT) +LibName.SO := $(SharedLibDir)/$(LIBRARYNAME)$(SHLIBEXT) else LibName.A := $(LibDir)/lib$(LIBRARYNAME).a -LibName.SO := $(LibDir)/lib$(LIBRARYNAME)$(SHLIBEXT) +LibName.SO := $(SharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) endif LibName.O := $(LibDir)/$(LIBRARYNAME).o LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca @@ -1128,14 +1097,14 @@ SharedLibKindMessage := "Loadable Module else SharedLibKindMessage := "Shared Library" endif -$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir +$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \ - $(LIBRARYNAME)$(SHLIBEXT) + $(notdir $@) $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \ $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS) else -$(LibName.SO): $(ObjectsO) $(LibDir)/.dir - $(Echo) Linking $(BuildMode) Shared Library $(basename $@) +$(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir + $(Echo) Linking $(BuildMode) Shared Library $(notdir $@) $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) endif @@ -1151,21 +1120,23 @@ uninstall-local:: $(Echo) Uninstall circumvented with NO_INSTALL else -ifdef LOADABLE_MODULE -DestSharedLib = $(DESTDIR)$(PROJ_libdir)/$(LIBRARYNAME)$(SHLIBEXT) +# Win32.DLL prefers to be located on the "PATH" of binaries. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +DestSharedLibDir := $(DESTDIR)$(PROJ_bindir) else -DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) +DestSharedLibDir := $(DESTDIR)$(PROJ_libdir) endif +DestSharedLib := $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) install-local:: $(DestSharedLib) -$(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir) +$(DestSharedLib): $(LibName.SO) $(DestSharedLibDir) $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib) $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib) uninstall-local:: $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib) - -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).* + -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).* endif endif @@ -1341,10 +1312,33 @@ endif endif ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD)) +ifneq ($(ARCH), Mips) LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map endif endif +endif + +#--------------------------------------------------------- +# Tool Version Info Support +#--------------------------------------------------------- +ifeq ($(HOST_OS),Darwin) +ifdef TOOL_INFO_PLIST + +LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST) + +$(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST) + +$(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir + $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..." + $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \ + -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \ + -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \ + -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \ + $< > $@ + +endif +endif #--------------------------------------------------------- # Provide targets for building the tools @@ -1377,7 +1371,7 @@ $(ToolAliasBuildPath): $(ToolBuildPath) $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg) $(Verb) $(RM) -f $(ToolAliasBuildPath) $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath) - $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLNAME) \ + $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \ $(StripWarnMsg) endif @@ -1626,7 +1620,7 @@ ifdef TARGET TABLEGEN_INC_FILES_COMMON = 1 endif -ifdef LLVMC_BUILD_AUTOGENERATED_INC +ifdef LLVMC_BASED_DRIVER TABLEGEN_INC_FILES_COMMON = 1 endif @@ -1750,20 +1744,26 @@ clean-local:: endif # TARGET -ifdef LLVMC_BUILD_AUTOGENERATED_INC +ifdef LLVMC_BASED_DRIVER + +TDSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \ + $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td))) + +TDCommon := $(strip $(wildcard \ + $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)) -LLVMCPluginSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \ - $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td))) +TDFiles := $(TDSrc) $(TDCommon) -TDFiles := $(LLVMCPluginSrc) \ - $(strip $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)) +$(INCTMPFiles) : $(TBLGEN) $(TDFiles) -$(ObjDir)/AutoGenerated.inc.tmp: $(LLVMCPluginSrc) $(ObjDir)/.dir \ - $(TBLGEN) $(TD_COMMON) - $(Echo) "Building LLVMC configuration library with tblgen" +$(ObjDir)/%.inc.tmp: %.td $(ObjDir)/.dir + $(Echo) "Building LLVMC compilation graph description with tblgen" $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $< -endif # LLVMC_BUILD_AUTOGENERATED_INC +clean-local:: + -$(Verb) $(RM) -f $(INCFiles) + +endif # LLVMC_BASED_DRIVER ############################################################################### # OTHER RULES: Other rules needed @@ -1840,11 +1840,13 @@ check:: $(EchoCmd) No test directory ; \ fi -check-lit:: +check-lit:: check + +check-dg:: $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \ if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \ $(EchoCmd) Running test suite ; \ - $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-lit ; \ + $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \ else \ $(EchoCmd) No Makefile in test directory ; \ fi ; \ Modified: head/contrib/llvm/README.txt ============================================================================== --- head/contrib/llvm/README.txt Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/README.txt Mon Sep 20 16:43:17 2010 (r212904) @@ -1,4 +1,4 @@ -Low Level Virtual Machine (LLVM) +\Low Level Virtual Machine (LLVM) ================================ This directory and its subdirectories contain source code for the Low Level @@ -13,3 +13,4 @@ assistance with LLVM. If you're writing a package for LLVM, see docs/Packaging.html for our suggestions. + Modified: head/contrib/llvm/autoconf/configure.ac ============================================================================== --- head/contrib/llvm/autoconf/configure.ac Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/autoconf/configure.ac Mon Sep 20 16:43:17 2010 (r212904) @@ -31,7 +31,7 @@ dnl=== dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.8svn]],[llvmbugs@cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.8rc]],[llvmbugs@cs.uiuc.edu]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. @@ -101,7 +101,6 @@ for i in `ls ${srcdir}/projects` do if test -d ${srcdir}/projects/${i} ; then case ${i} in - CVS) ;; sample) AC_CONFIG_SUBDIRS([projects/sample]) ;; privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;; llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;; @@ -299,7 +298,7 @@ dnl Set the LINKALL and NOLINKALL Makefi AC_SUBST(LINKALL,$llvm_cv_link_all_option) AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option) -dnl Set the "LLVM_ON_*" variables based on llvm_cvs_platform_type +dnl Set the "LLVM_ON_*" variables based on llvm_cv_platform_type dnl This is used by lib/System to determine the basic kind of implementation dnl to use. case $llvm_cv_platform_type in @@ -369,13 +368,13 @@ else AC_SUBST(LLVM_CROSS_COMPILING, [0]) fi -dnl Check to see if there's a "CVS" (or .svn or .git) directory indicating -dnl that this build is being done from a checkout. This sets up several -dnl defaults for the command line switches. When we build with a CVS directory, +dnl Check to see if there's a .svn or .git directory indicating that this +dnl build is being done from a checkout. This sets up several defaults for +dnl the command line switches. When we build with a checkout directory, dnl we get a debug with assertions turned on. Without, we assume a source dnl release and we get an optimized build without assertions. dnl See --enable-optimized and --enable-assertions below -if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then +if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then cvsbuild="yes" optimize="no" AC_SUBST(CVSBUILD,[[CVSBUILD=1]]) @@ -392,7 +391,7 @@ dnl===---------------------------------- dnl --enable-optimized : check whether they want to do an optimized build: AC_ARG_ENABLE(optimized, AS_HELP_STRING( - --enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize) + --enable-optimized,[Compile with optimizations enabled (default is YES)]),,enableval="yes") if test ${enableval} = "no" ; then AC_SUBST(ENABLE_OPTIMIZED,[[]]) else @@ -410,7 +409,7 @@ fi dnl --enable-assertions : check whether they want to turn on assertions or not: AC_ARG_ENABLE(assertions,AS_HELP_STRING( - --enable-assertions,[Compile with assertion checks enabled (default is YES)]),, enableval="yes") + --enable-assertions,[Compile with assertion checks enabled (default is NO)]),, enableval="no") if test ${enableval} = "yes" ; then AC_SUBST(DISABLE_ASSERTIONS,[[]]) else @@ -544,13 +543,13 @@ TARGETS_TO_BUILD="" AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets], [Build specific host targets: all or target1,target2,... Valid targets are: host, x86, x86_64, sparc, powerpc, alpha, arm, mips, spu, pic16, - xcore, msp430, systemz, blackfin, cbe, msil, and cpp (default=all)]),, + xcore, msp430, systemz, blackfin, cbe, and cpp (default=all)]),, enableval=all) if test "$enableval" = host-only ; then enableval=host fi case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend MBlaze" ;; + all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze" ;; *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do case "$a_target" in x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; @@ -567,7 +566,6 @@ case "$enableval" in systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;; blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;; cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; - msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;; cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;; mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;; host) case "$llvm_cv_target_arch" in @@ -598,9 +596,17 @@ AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BU # If so, define LLVM_NATIVE_ARCH to that LLVM target. for a_target in $TARGETS_TO_BUILD; do if test "$a_target" = "$LLVM_NATIVE_ARCH"; then - LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target" - AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCHTARGET, + AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH, $LLVM_NATIVE_ARCH, [LLVM architecture name for the native architecture, if available]) + LLVM_NATIVE_TARGET="LLVMInitialize${LLVM_NATIVE_ARCH}Target" + LLVM_NATIVE_TARGETINFO="LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo" + LLVM_NATIVE_ASMPRINTER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter" + AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET, + [LLVM name for the native Target init function, if available]) + AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO, + [LLVM name for the native TargetInfo init function, if available]) + AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPRINTER, $LLVM_NATIVE_ASMPRINTER, + [LLVM name for the native AsmPrinter init function, if available]) fi done @@ -857,35 +863,6 @@ AC_ARG_ENABLE(libffi,AS_HELP_STRING( esac], llvm_cv_enable_libffi=no) -dnl Only Windows needs dynamic libCompilerDriver to support plugins. -if test "$llvm_cv_os_type" = "Win32" ; then - llvmc_dynamic="yes" -else - llvmc_dynamic="no" -fi - -dnl --enable-llvmc-dynamic : should LLVMC link libCompilerDriver dynamically? -AC_ARG_ENABLE(llvmc-dynamic,AS_HELP_STRING( ---enable-llvmc-dynamic, -[Link LLVMC dynamically (default is NO, unless on Win32)]),, -enableval=$llvmc_dynamic) -if test ${enableval} = "yes" && test "$ENABLE_PIC" -eq 1 ; then - AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[ENABLE_LLVMC_DYNAMIC=1]]) -else - AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[]]) -fi - -dnl --enable-llvmc-dynamic-plugins : should LLVMC support dynamic plugins? -AC_ARG_ENABLE(llvmc-dynamic-plugins,AS_HELP_STRING( ---enable-llvmc-dynamic-plugins, -[Enable dynamic LLVMC plugins (default is YES)]),, -enableval=yes) -if test ${enableval} = "yes" ; then - AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[ENABLE_LLVMC_DYNAMIC_PLUGINS=1]]) -else - AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[]]) -fi - dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 4: Check for programs we need and that they are the right version @@ -1011,6 +988,13 @@ fi dnl Find the install program AC_PROG_INSTALL +dnl Prepend src dir to install path dir if it's a relative path +dnl This is a hack for installs that take place in something other +dnl than the top level. +case "$INSTALL" in + [[\\/$]]* | ?:[[\\/]]* ) ;; + *) INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;; +esac dnl Checks for documentation and testing tools that we can do without. If these dnl are not found then they are set to "true" which always succeeds but does @@ -1033,6 +1017,9 @@ AC_PATH_PROGS(OCAMLDEP, [ocamldep]) AC_PATH_PROGS(OCAMLDOC, [ocamldoc]) AC_PATH_PROGS(GAS, [gas as]) +dnl Get the version of the linker in use. +AC_LINK_GET_VERSION + dnl Determine whether the linker supports the -R option. AC_LINK_USE_R @@ -1345,6 +1332,9 @@ fi dnl atomic builtins are required for threading support. AC_MSG_CHECKING(for GCC atomic builtins) +dnl Since we'll be using these atomic builtins in C++ files we should test +dnl the C++ compiler. +AC_LANG_PUSH([C++]) AC_LINK_IFELSE( AC_LANG_SOURCE( [[int main() { @@ -1356,13 +1346,13 @@ AC_LINK_IFELSE( return 0; } ]]), + AC_LANG_POP([C++]) AC_MSG_RESULT(yes) AC_DEFINE(LLVM_MULTITHREADED, 1, Build multithreading support into LLVM), AC_MSG_RESULT(no) AC_DEFINE(LLVM_MULTITHREADED, 0, Build multithreading support into LLVM) AC_MSG_WARN([LLVM will be built thread-unsafe because atomic builtins are missing])) - dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 9: Additional checks, variables, etc. @@ -1549,7 +1539,11 @@ dnl WARNING: dnl If you add or remove an dnl you MUST also update Makefile.rules so that the variable FilesToConfig dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the dnl files can be updated automatically when their *.in sources change. -AC_CONFIG_HEADERS([include/llvm/Config/config.h]) +AC_CONFIG_HEADERS([include/llvm/Config/config.h include/llvm/Config/llvm-config.h]) +AH_TOP([#ifndef CONFIG_H +#define CONFIG_H]) +AH_BOTTOM([#endif]) + AC_CONFIG_FILES([include/llvm/Config/Targets.def]) AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def]) AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def]) @@ -1563,7 +1557,7 @@ dnl Configure the RPM spec file for LLVM AC_CONFIG_FILES([llvm.spec]) dnl Configure llvmc's Base plugin -AC_CONFIG_FILES([tools/llvmc/plugins/Base/Base.td]) +AC_CONFIG_FILES([tools/llvmc/src/Base.td]) dnl Do the first stage of configuration for llvm-config.in. AC_CONFIG_FILES([tools/llvm-config/llvm-config.in]) Modified: head/contrib/llvm/autoconf/m4/link_options.m4 ============================================================================== --- head/contrib/llvm/autoconf/m4/link_options.m4 Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/autoconf/m4/link_options.m4 Mon Sep 20 16:43:17 2010 (r212904) @@ -1,4 +1,25 @@ # +# Get the linker version string. +# +# This macro is specific to LLVM. +# +AC_DEFUN([AC_LINK_GET_VERSION], + [AC_CACHE_CHECK([for linker version],[llvm_cv_link_version], + [ + version_string="$(ld -v 2>&1 | head -1)" + + # Check for ld64. + if (echo "$version_string" | grep -q "ld64"); then + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") + else + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") + fi + ]) + AC_DEFINE_UNQUOTED([HOST_LINK_VERSION],"$llvm_cv_link_version", + [Linker version detected at compile time.]) +]) + +# # Determine if the system can handle the -R option being passed to the linker. # # This macro is specific to LLVM. Modified: head/contrib/llvm/bindings/ada/llvm/llvm.ads ============================================================================== --- head/contrib/llvm/bindings/ada/llvm/llvm.ads Mon Sep 20 16:18:39 2010 (r212903) +++ head/contrib/llvm/bindings/ada/llvm/llvm.ads Mon Sep 20 16:43:17 2010 (r212904) @@ -317,25 +317,27 @@ package llvm is LLVMGhostLinkage, LLVMCommonLinkage, LLVMLinkerPrivateLinkage, - LLVMLinkerPrivateWeakLinkage); + LLVMLinkerPrivateWeakLinkage, + LinkerPrivateWeakDefAutoLinkage); for LLVMLinkage use - (LLVMExternalLinkage => 0, - LLVMAvailableExternallyLinkage => 1, - LLVMLinkOnceAnyLinkage => 2, - LLVMLinkOnceODRLinkage => 3, - LLVMWeakAnyLinkage => 4, - LLVMWeakODRLinkage => 5, - LLVMAppendingLinkage => 6, - LLVMInternalLinkage => 7, - LLVMPrivateLinkage => 8, - LLVMDLLImportLinkage => 9, - LLVMDLLExportLinkage => 10, - LLVMExternalWeakLinkage => 11, - LLVMGhostLinkage => 12, - LLVMCommonLinkage => 13, - LLVMLinkerPrivateLinkage => 14, - LLVMLinkerPrivateWeakLinkage => 15); + (LLVMExternalLinkage => 0, + LLVMAvailableExternallyLinkage => 1, + LLVMLinkOnceAnyLinkage => 2, + LLVMLinkOnceODRLinkage => 3, + LLVMWeakAnyLinkage => 4, + LLVMWeakODRLinkage => 5, + LLVMAppendingLinkage => 6, + LLVMInternalLinkage => 7, + LLVMPrivateLinkage => 8, + LLVMDLLImportLinkage => 9, + LLVMDLLExportLinkage => 10, + LLVMExternalWeakLinkage => 11, + LLVMGhostLinkage => 12, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 17:10:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF71106566B; Mon, 20 Sep 2010 17:10:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B34D8FC0C; Mon, 20 Sep 2010 17:10:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KHA7M1059887; Mon, 20 Sep 2010 17:10:07 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KHA7aO059883; Mon, 20 Sep 2010 17:10:07 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201009201710.o8KHA7aO059883@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 20 Sep 2010 17:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212906 - in head: lib/libc/posix1e sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 17:10:07 -0000 Author: trasz Date: Mon Sep 20 17:10:06 2010 New Revision: 212906 URL: http://svn.freebsd.org/changeset/base/212906 Log: First step at adopting FreeBSD to support PSARC/2010/029. This makes acl_is_trivial_np(3) properly recognize the new trivial ACLs. From the user point of view, that means "ls -l" no longer shows plus signs for all the files when running ZFS v28. Modified: head/lib/libc/posix1e/acl_strip.c head/sys/kern/subr_acl_nfs4.c head/sys/sys/acl.h Modified: head/lib/libc/posix1e/acl_strip.c ============================================================================== --- head/lib/libc/posix1e/acl_strip.c Mon Sep 20 17:03:10 2010 (r212905) +++ head/lib/libc/posix1e/acl_strip.c Mon Sep 20 17:10:06 2010 (r212906) @@ -31,19 +31,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "acl_support.h" /* - * These two routines from sys/kern/subr_acl_nfs4.c are used by both kernel + * These three routines from sys/kern/subr_acl_nfs4.c are used by both kernel * and libc. */ +void acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode); void acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id); void acl_nfs4_sync_mode_from_acl(mode_t *_mode, const struct acl *aclp); static acl_t -_nfs4_acl_strip_np(const acl_t aclp, int recalculate_mask) +_nfs4_acl_strip_np(const acl_t aclp, int canonical_six) { acl_t newacl; mode_t mode = 0; @@ -57,7 +59,10 @@ _nfs4_acl_strip_np(const acl_t aclp, int _acl_brand_as(newacl, ACL_BRAND_NFS4); acl_nfs4_sync_mode_from_acl(&mode, &(aclp->ats_acl)); - acl_nfs4_sync_acl_from_mode(&(newacl->ats_acl), mode, -1); + if (canonical_six) + acl_nfs4_sync_acl_from_mode(&(newacl->ats_acl), mode, -1); + else + acl_nfs4_trivial_from_mode(&(newacl->ats_acl), mode); return (newacl); } @@ -136,7 +141,7 @@ acl_strip_np(const acl_t aclp, int recal { switch (_acl_brand(aclp)) { case ACL_BRAND_NFS4: - return (_nfs4_acl_strip_np(aclp, recalculate_mask)); + return (_nfs4_acl_strip_np(aclp, 1)); case ACL_BRAND_POSIX: return (_posix1e_acl_strip_np(aclp, recalculate_mask)); @@ -185,10 +190,25 @@ acl_is_trivial_np(const acl_t aclp, int } /* - * Calculate trivial ACL - using acl_strip_np - and compare + * Calculate trivial ACL - using acl_strip_np(3) - and compare * with the original. */ - tmpacl = acl_strip_np(aclp, 0); + tmpacl = _nfs4_acl_strip_np(aclp, 0); + if (tmpacl == NULL) + return (-1); + + differs = _acl_differs(aclp, tmpacl); + acl_free(tmpacl); + + if (differs == 0) { + *trivialp = 1; + return (0); + } + + /* + * Try again with an old-style, "canonical six" trivial ACL. + */ + tmpacl = _nfs4_acl_strip_np(aclp, 1); if (tmpacl == NULL) return (-1); Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Mon Sep 20 17:03:10 2010 (r212905) +++ head/sys/kern/subr_acl_nfs4.c Mon Sep 20 17:10:06 2010 (r212906) @@ -349,6 +349,83 @@ _acl_duplicate_entry(struct acl *aclp, i return (&(aclp->acl_entry[entry_index + 1])); } +/* + * Calculate trivial ACL in a manner compatible with PSARC/2010/029. + * Note that this results in an ACL different from (but semantically + * equal to) the "canonical six" trivial ACL computed using algorithm + * described in draft-ietf-nfsv4-minorversion1-03.txt, 3.16.6.2. + */ +void +acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode) +{ + acl_perm_t user_allow_first = 0, user_deny = 0, group_deny = 0; + acl_perm_t user_allow, group_allow, everyone_allow; + + KASSERT(aclp->acl_cnt == 0, ("aclp->acl_cnt == 0")); + + user_allow = group_allow = everyone_allow = ACL_READ_ACL | + ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS | ACL_SYNCHRONIZE; + user_allow |= ACL_WRITE_ACL | ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES | + ACL_WRITE_NAMED_ATTRS; + + if (mode & S_IRUSR) + user_allow |= ACL_READ_DATA; + if (mode & S_IWUSR) + user_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXUSR) + user_allow |= ACL_EXECUTE; + + if (mode & S_IRGRP) + group_allow |= ACL_READ_DATA; + if (mode & S_IWGRP) + group_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXGRP) + group_allow |= ACL_EXECUTE; + + if (mode & S_IROTH) + everyone_allow |= ACL_READ_DATA; + if (mode & S_IWOTH) + everyone_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXOTH) + everyone_allow |= ACL_EXECUTE; + + user_deny = ((group_allow | everyone_allow) & ~user_allow); + group_deny = everyone_allow & ~group_allow; + user_allow_first = group_deny & ~user_deny; + +#if 1 + /* + * This is a workaround for what looks like a bug in ZFS - trivial + * ACL for mode 0077 should look like this: + * + * owner@:rwxp----------:------:deny + * owner@:------aARWcCos:------:allow + * group@:rwxp--a-R-c--s:------:allow + * everyone@:rwxp--a-R-c--s:------:allow + * + * Instead, ZFS makes it like this: + * + * owner@:rwx-----------:------:deny + * owner@:------aARWcCos:------:allow + * group@:rwxp--a-R-c--s:------:allow + * everyone@:rwxp--a-R-c--s:------:allow + */ + user_allow_first &= ~ACL_APPEND_DATA; + user_deny &= ~ACL_APPEND_DATA; + group_deny &= ~ACL_APPEND_DATA; +#endif + + if (user_allow_first != 0) + _acl_append(aclp, ACL_USER_OBJ, user_allow_first, ACL_ENTRY_TYPE_ALLOW); + if (user_deny != 0) + _acl_append(aclp, ACL_USER_OBJ, user_deny, ACL_ENTRY_TYPE_DENY); + if (group_deny != 0) + _acl_append(aclp, ACL_GROUP_OBJ, group_deny, ACL_ENTRY_TYPE_DENY); + _acl_append(aclp, ACL_USER_OBJ, user_allow, ACL_ENTRY_TYPE_ALLOW); + _acl_append(aclp, ACL_GROUP_OBJ, group_allow, ACL_ENTRY_TYPE_ALLOW); + _acl_append(aclp, ACL_EVERYONE, everyone_allow, ACL_ENTRY_TYPE_ALLOW); +} + void acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id) { Modified: head/sys/sys/acl.h ============================================================================== --- head/sys/sys/acl.h Mon Sep 20 17:03:10 2010 (r212905) +++ head/sys/sys/acl.h Mon Sep 20 17:10:06 2010 (r212906) @@ -285,6 +285,8 @@ mode_t acl_posix1e_newfilemode(mode_t struct acl *acl_alloc(int flags); void acl_free(struct acl *aclp); +void acl_nfs4_trivial_from_mode(struct acl *aclp, + mode_t mode); void acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id); void acl_nfs4_sync_mode_from_acl(mode_t *mode, From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 19:42:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14C97106566B; Mon, 20 Sep 2010 19:42:15 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 043898FC1A; Mon, 20 Sep 2010 19:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KJgEIG065224; Mon, 20 Sep 2010 19:42:14 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KJgECl065222; Mon, 20 Sep 2010 19:42:14 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201009201942.o8KJgECl065222@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 20 Sep 2010 19:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212926 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 19:42:15 -0000 Author: mdf Date: Mon Sep 20 19:42:14 2010 New Revision: 212926 URL: http://svn.freebsd.org/changeset/base/212926 Log: Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as it is indirectly a d_close method. Prompted by: kib Reviewed by: mav MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_pass.c Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Mon Sep 20 19:36:53 2010 (r212925) +++ head/sys/cam/scsi/scsi_pass.c Mon Sep 20 19:42:14 2010 (r212926) @@ -169,7 +169,11 @@ passcleanup(struct cam_periph *periph) xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); - destroy_dev(softc->dev); + /* + * passcleanup() is indirectly a d_close method via passclose, + * so using destroy_dev(9) directly can result in deadlock. + */ + destroy_dev_sched(softc->dev); cam_periph_lock(periph); free(softc, M_DEVBUF); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 19:42:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C1A0106566B; Mon, 20 Sep 2010 19:42:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B6A48FC16; Mon, 20 Sep 2010 19:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KJgq7E065277; Mon, 20 Sep 2010 19:42:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KJgqL4065274; Mon, 20 Sep 2010 19:42:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201009201942.o8KJgqL4065274@svn.freebsd.org> From: Xin LI Date: Mon, 20 Sep 2010 19:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212927 - head/usr.bin/grep/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 19:42:52 -0000 Author: delphij Date: Mon Sep 20 19:42:52 2010 New Revision: 212927 URL: http://svn.freebsd.org/changeset/base/212927 Log: Add Simplified Chinese messages for BSD grep. Added: head/usr.bin/grep/nls/zh_CN.UTF-8.msg (contents, props changed) Modified: head/usr.bin/grep/nls/Makefile.inc Modified: head/usr.bin/grep/nls/Makefile.inc ============================================================================== --- head/usr.bin/grep/nls/Makefile.inc Mon Sep 20 19:42:14 2010 (r212926) +++ head/usr.bin/grep/nls/Makefile.inc Mon Sep 20 19:42:52 2010 (r212927) @@ -10,6 +10,7 @@ NLS+= ja_JP.UTF-8 NLS+= pt_BR.ISO8859-1 NLS+= ru_RU.KOI8-R NLS+= uk_UA.UTF-8 +NLS+= zh_CN.UTF-8 NLSSRCDIR= ${.CURDIR}/nls .for lang in ${NLS} Added: head/usr.bin/grep/nls/zh_CN.UTF-8.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/grep/nls/zh_CN.UTF-8.msg Mon Sep 20 19:42:52 2010 (r212927) @@ -0,0 +1,13 @@ +$ $FreeBSD$ +$ +$set 1 +$quote " +1 "(æ ‡ć‡†èŸ“ć…„)" +2 "èŻ»ć– bzip2 ćŽ‹çŒ©æ–‡ä»¶æ—¶ć‡ș错" +3 "选éĄč %s æ— æł•èŻ†ćˆ«" +4 "ç”šæł•ïŒš %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A èĄŒæ•°] [-B èĄŒæ•°] [-C[èĄŒæ•°]]\n" +5 "\t[-e æšĄćŒ] [-f 文件] [--binary-files=ć€Œ] [--color=䜕时]\n" +6 "\t[--context[=èĄŒæ•°]] [--directories=ćŠšäœœ] [--label] [--line-buffered]\n" +7 "\t[--null] [æšĄćŒ] [æ–‡ä»¶ć ...]\n" +8 "äșŒèż›ćˆ¶æ–‡ä»¶ %s ćŒ…ć«æšĄćŒ\n" +9 "%s (BSD grep) %s\n" From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 19:51:36 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F342310656A3; Mon, 20 Sep 2010 19:51:35 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 878EE8FC14; Mon, 20 Sep 2010 19:51:35 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id DED172A28D3B; Mon, 20 Sep 2010 21:51:34 +0200 (CEST) Date: Mon, 20 Sep 2010 21:51:34 +0200 From: Ed Schouten To: Bruce Evans Message-ID: <20100920195134.GS56986@hoeg.nl> References: <201009191635.o8JGZgF3008282@svn.freebsd.org> <20100920224337.E63497@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qBOV/12gVmFoc0GF" Content-Disposition: inline In-Reply-To: <20100920224337.E63497@besplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212867 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 19:51:36 -0000 --qBOV/12gVmFoc0GF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Bruce Evans wrote: > Er, my review explained how wrong this is. Please back it out. So basically you want to have it in its current form, with the only difference that CLOCAL is not enforced for callout devices, but still want callout devices to skip waiting for DCD? If so, I can change that if you like. About the default flags for serial devices. I really have no idea how to sanely address the issue you're raising. Isn't it a good thing that right now we initialize all termios structures similarly? It makes the system far more predictive than pushing that logic into the driver. Also, I don't think "breaking historical behaviour" should always be considered a bug, which is often something you seem to imply. Look, I am more than willing to get things improved in the TTY layer, but please, just create a patch. In the same (probably even less) time you've written your email, you could have simply crafted a patch and sent it to me. That way it is practically impossible for us to miscommunicate and it saves me a lot of time. --=20 Ed Schouten WWW: http://80386.nl/ --qBOV/12gVmFoc0GF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkyXu0YACgkQ52SDGA2eCwVGCgCdHlt/ZDJPoszLQu8+R9aEk6Ph Fn0An3HR7ZE7FIE+GGzRSFJe/6LPUHKG =MdUK -----END PGP SIGNATURE----- --qBOV/12gVmFoc0GF-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 20:41:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0F231065674; Mon, 20 Sep 2010 20:41:59 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 907318FC08; Mon, 20 Sep 2010 20:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KKfxvd066974; Mon, 20 Sep 2010 20:41:59 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KKfxUQ066972; Mon, 20 Sep 2010 20:41:59 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201009202041.o8KKfxUQ066972@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 20 Sep 2010 20:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212931 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 20:41:59 -0000 Author: mdf Date: Mon Sep 20 20:41:59 2010 New Revision: 212931 URL: http://svn.freebsd.org/changeset/base/212931 Log: Replace an XXX comment with the appropriate code. Submitted by: alc Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Sep 20 19:59:08 2010 (r212930) +++ head/sys/vm/vm_kern.c Mon Sep 20 20:41:59 2010 (r212931) @@ -354,11 +354,7 @@ kmem_back(vm_map_t map, vm_offset_t addr vm_page_t m; int pflags; - /* - * XXX the map must be locked for write on entry, but there's - * no easy way to assert that. - */ - + KASSERT(vm_map_locked(map), ("kmem_back: map %p is not locked", map)); offset = addr - VM_MIN_KERNEL_ADDRESS; vm_object_reference(kmem_object); vm_map_insert(map, kmem_object, offset, addr, addr + size, From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 21:22:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C60106564A; Mon, 20 Sep 2010 21:22:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB878FC14; Mon, 20 Sep 2010 21:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KLMFgU067996; Mon, 20 Sep 2010 21:22:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KLMFFA067994; Mon, 20 Sep 2010 21:22:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009202122.o8KLMFFA067994@svn.freebsd.org> From: Andriy Gapon Date: Mon, 20 Sep 2010 21:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212932 - head/tools/tools/umastat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 21:22:16 -0000 Author: avg Date: Mon Sep 20 21:22:15 2010 New Revision: 212932 URL: http://svn.freebsd.org/changeset/base/212932 Log: tools/umastat: fix build on amd64 And perhaps other 64-bit platforms. Submitted by: Fabian Keil MFC after: 1 week Modified: head/tools/tools/umastat/umastat.c Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Mon Sep 20 20:41:59 2010 (r212931) +++ head/tools/tools/umastat/umastat.c Mon Sep 20 21:22:15 2010 (r212932) @@ -230,7 +230,7 @@ uma_print_bucketlist(kvm_t *kvm, struct } printf("\n"); - printf("%s}; // total cnt %llu, total entries %llu\n", spaces, + printf("%s}; // total cnt %ju, total entries %ju\n", spaces, total_cnt, total_entries); } @@ -242,8 +242,8 @@ uma_print_cache(kvm_t *kvm, struct uma_c int ret; printf("%s%s[%d] = {\n", spaces, name, cpu); - printf("%s uc_frees = %llu;\n", spaces, cache->uc_frees); - printf("%s uc_allocs = %llu;\n", spaces, cache->uc_allocs); + printf("%s uc_frees = %ju;\n", spaces, cache->uc_frees); + printf("%s uc_allocs = %ju;\n", spaces, cache->uc_allocs); if (cache->uc_freebucket != NULL) { ret = kread(kvm, cache->uc_freebucket, &ub, sizeof(ub), 0); @@ -412,20 +412,20 @@ main(int argc, char *argv[]) } printf(" Zone {\n"); printf(" uz_name = \"%s\";\n", name); - printf(" uz_allocs = %llu;\n", + printf(" uz_allocs = %ju;\n", uzp_userspace->uz_allocs); - printf(" uz_frees = %llu;\n", + printf(" uz_frees = %ju;\n", uzp_userspace->uz_frees); - printf(" uz_fails = %llu;\n", + printf(" uz_fails = %ju;\n", uzp_userspace->uz_fails); printf(" uz_fills = %u;\n", uzp_userspace->uz_fills); printf(" uz_count = %u;\n", uzp_userspace->uz_count); - uma_print_bucketlist(kvm, (struct bucketlist *) + uma_print_bucketlist(kvm, (void *) &uzp_userspace->uz_full_bucket, "uz_full_bucket", " "); - uma_print_bucketlist(kvm, (struct bucketlist *) + uma_print_bucketlist(kvm, (void *) &uzp_userspace->uz_free_bucket, "uz_free_bucket", " "); From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 21:58:48 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61F05106566B; Mon, 20 Sep 2010 21:58:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id F01218FC08; Mon, 20 Sep 2010 21:58:47 +0000 (UTC) Received: from besplex.bde.org (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8KLwcWF031872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Sep 2010 07:58:40 +1000 Date: Tue, 21 Sep 2010 07:58:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <20100920195134.GS56986@hoeg.nl> Message-ID: <20100921064714.N31073@besplex.bde.org> References: <201009191635.o8JGZgF3008282@svn.freebsd.org> <20100920224337.E63497@besplex.bde.org> <20100920195134.GS56986@hoeg.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r212867 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 21:58:48 -0000 On Mon, 20 Sep 2010, Ed Schouten wrote: > * Bruce Evans wrote: >> Er, my review explained how wrong this is. Please back it out. > > So basically you want to have it in its current form, with the only > difference that CLOCAL is not enforced for callout devices, but still > want callout devices to skip waiting for DCD? If so, I can change that > if you like. It would also be good to fix the original problem with missing locking for consoles. % Index: tty.c % =================================================================== % RCS file: /home/ncvs/src/sys/kern/tty.c,v % retrieving revision 1.338 % retrieving revision 1.340 % diff -u -2 -r1.338 -r1.340 % --- tty.c 6 Aug 2010 09:42:15 -0000 1.338 % +++ tty.c 19 Sep 2010 16:35:42 -0000 1.340 % ... % @@ -264,10 +264,12 @@ % if (!tty_opened(tp)) { % /* Set proper termios flags. */ % - if (TTY_CALLOUT(tp, dev)) { % + if (TTY_CALLOUT(tp, dev)) % tp->t_termios = tp->t_termios_init_out; % - } else { % + else % tp->t_termios = tp->t_termios_init_in; % - } Good to fix the style bug. % ttydevsw_param(tp, &tp->t_termios); % + /* Prevent modem control on callout devices and /dev/console. */ % + if (TTY_CALLOUT(tp, dev) || dev == dev_console) % + tp->t_termios.c_cflag |= CLOCAL; This enforces CLOCAL for both the callout devices and consoles. This shouldn't be done here for either. Set it in the lock and initial state device for consoles and don't change anything for callout devices. % % ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); % @@ -282,5 +284,5 @@ % % /* Wait for Carrier Detect. */ % - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) == 0 && % + if ((oflags & O_NONBLOCK) == 0 && % (tp->t_termios.c_cflag & CLOCAL) == 0) { % while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) == 0) { This simplification depends on the previous erroneous enforcement. > About the default flags for serial devices. I really have no idea how to > sanely address the issue you're raising. Isn't it a good thing that > right now we initialize all termios structures similarly? It makes the > system far more predictive than pushing that logic into the driver. It's good for the initialization to be centralized, but console initialization must be special. It already is special, and requires special logic in the driver, since only the driver knows the speed and line state that are already being used and must be preserved. Presumably it overwrites the settings of tty_init_termios() soon after that returns. RELENG_7 had this more or less correctly centralized, with the speed and an "echo" (really consoleness) flag passed to ttyinitmode(), and another function ttyconsolemode() for the additional special setting of consoles (this should have handled the speed and "echo" too). The special settings are almost exactly the defaulting and locking of CLOCAL: % void % ttyconsolemode(struct tty *tp, int speed) % { % % if (speed == 0) % speed = TTYDEF_SPEED; % ttyinitmode(tp, 1, speed); % tp->t_init_in.c_cflag |= CLOCAL; Default CLOCAL for t_init_in (whole t_init_in will be copied to t_init_out). % tp->t_lock_out.c_cflag = tp->t_lock_in.c_cflag = CLOCAL; Lock CLOCAL for both (won't copy whole lock termios). % tp->t_lock_out.c_ispeed = tp->t_lock_out.c_ospeed = % tp->t_lock_in.c_ispeed = tp->t_lock_in.c_ospeed = speed; Lock the speeds too. % tp->t_init_out = tp->t_init_in; % tp->t_termios = tp->t_init_in; Actually silly to copy the whole t_init_in twice after just changing CLOCAL in it (we have just called ttyinitmode() which copied everything else). % ttsetwater(tp); Must change the watermarks whenever the speed changed, but ttyinitmode() should have called this since it changed the speed. Missing: setting and locking of other termios state (especially in cflag) critical to the continued operation of the console (also the debugger on a possibly-non-console port). % } Having predicitiveness/orthogonality is perhaps the main reason why CLOCAL was not forced or even defaulted to for callout devices. > Also, I don't think "breaking historical behaviour" should always be > considered a bug, which is often something you seem to imply. It is when the historical behaviour was carefully designed. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 22:05:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 352B4106566B; Mon, 20 Sep 2010 22:05:00 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2278F8FC15; Mon, 20 Sep 2010 22:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KM50rP069071; Mon, 20 Sep 2010 22:05:00 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KM4xOu069067; Mon, 20 Sep 2010 22:04:59 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201009202204.o8KM4xOu069067@svn.freebsd.org> From: Brian Somers Date: Mon, 20 Sep 2010 22:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212934 - in head: sbin/geom/class/eli tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 22:05:00 -0000 Author: brian Date: Mon Sep 20 22:04:59 2010 New Revision: 212934 URL: http://svn.freebsd.org/changeset/base/212934 Log: Add a geli resize subcommand to resize encrypted filesystems prior to growing the filesystem. Refuse to attach providers where the metadata provider size is wrong. This makes post-boot attaches behave consistently with pre-boot attaches. Also refuse to restore metadata to a provider of the wrong size without the new -f switch. The new -f switch forces the metadata restoration despite the provider size, and updates the provider size in the restored metadata to the correct value. Helped by: pjd Reviewed by: pjd Added: head/tools/regression/geom_eli/resize.t (contents, props changed) Modified: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Mon Sep 20 21:38:52 2010 (r212933) +++ head/sbin/geom/class/eli/geli.8 Mon Sep 20 22:04:59 2010 (r212934) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2008 +.Dd September 20, 2010 .Dt GELI 8 .Os .Sh NAME @@ -111,10 +111,15 @@ utility: .Ar file .Nm .Cm restore -.Op Fl v +.Op Fl fv .Ar file .Ar prov .Nm +.Cm resize +.Op Fl v +.Fl s Ar oldsize +.Ar prov +.Nm .Cm clear .Op Fl v .Ar prov ... @@ -464,6 +469,34 @@ If specified, all currently attached pro Backup metadata from the given provider to the given file. .It Cm restore Restore metadata from the given file to the given provider. +.Bl -tag -width ".Fl f" +.It Fl f +Metadata contains the size of the provider to ensure that the correct +partition or slice is attached. +If an attempt is made to restore metadata to a provider that has a different +size, +.Nm +will refuse to restore the data unless the +.Fl f +switch is used. +If the partition or slice has been grown, the +.Cm resize +subcommand should be used rather than attempting to relocate the metadata +through +.Cm backup +and +.Cm restore . +.El +.It Cm resize +Inform +.Nm +that the provider has been resized. +The old metadata block is relocated to the correct position at the end of the +provider and the provider size is updated. +.Bl -tag -width ".Fl s Ar oldsize" +.It Fl s Ar oldsize +The size of the provider before it was resized. +.El .It Cm clear Clear metadata from the given providers. .It Cm dump @@ -665,6 +698,17 @@ geli: Cannot read metadata from /dev/da0 # geli attach /dev/da0 Enter passphrase: .Ed +.Pp +If an encrypted filesystem is extended, it is necessary to relocate and +update the metadata: +.Bd -literal -offset indent +# gpart create -s GPT ada0 +# gpart add -s 1g -t freebsd-ufs -i 1 ada0 +# geli init -K keyfile -P ada0p1 +# gpart resize -s 2g -i 1 ada0 +# geli resize -s 1g ada0p1 +# geli attach -k keyfile -p ada0p1 +.Ed .Sh DATA AUTHENTICATION .Nm can verify data integrity when an authentication algorithm is specified. Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Mon Sep 20 21:38:52 2010 (r212933) +++ head/sbin/geom/class/eli/geom_eli.c Mon Sep 20 22:04:59 2010 (r212934) @@ -66,6 +66,7 @@ static void eli_delkey(struct gctl_req * static void eli_kill(struct gctl_req *req); static void eli_backup(struct gctl_req *req); static void eli_restore(struct gctl_req *req); +static void eli_resize(struct gctl_req *req); static void eli_clear(struct gctl_req *req); static void eli_dump(struct gctl_req *req); @@ -86,7 +87,8 @@ static int eli_backup_create(struct gctl * delkey [-afv] [-n keyno] prov * kill [-av] [prov ...] * backup [-v] prov file - * restore [-v] file prov + * restore [-fv] file prov + * resize [-v] -s oldsize prov * clear [-v] prov ... * dump [-v] prov ... */ @@ -197,8 +199,19 @@ struct g_command class_commands[] = { { "backup", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] prov file" }, - { "restore", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, - "[-v] file prov" + { "restore", G_FLAG_VERBOSE, eli_main, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-fv] file prov" + }, + { "resize", G_FLAG_VERBOSE, eli_main, + { + { 's', "oldsize", NULL, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-v] -s oldsize prov" }, { "clear", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] prov ..." @@ -264,6 +277,8 @@ eli_main(struct gctl_req *req, unsigned eli_backup(req); else if (strcmp(name, "restore") == 0) eli_restore(req); + else if (strcmp(name, "resize") == 0) + eli_resize(req); else if (strcmp(name, "dump") == 0) eli_dump(req); else if (strcmp(name, "clear") == 0) @@ -683,6 +698,7 @@ eli_attach(struct gctl_req *req) struct g_eli_metadata md; unsigned char key[G_ELI_USERKEYLEN]; const char *prov; + off_t mediasize; int nargs; nargs = gctl_get_int(req, "nargs"); @@ -695,6 +711,12 @@ eli_attach(struct gctl_req *req) if (eli_metadata_read(req, prov, &md) == -1) return; + mediasize = g_get_mediasize(prov); + if (md.md_provsize != (uint64_t)mediasize) { + gctl_error(req, "Provider size mismatch."); + return; + } + if (eli_genkey(req, &md, key, 0) == NULL) { bzero(key, sizeof(key)); return; @@ -1212,6 +1234,17 @@ eli_restore(struct gctl_req *req) gctl_error(req, "MD5 hash mismatch: not a geli backup file?"); goto out; } + /* Check if the provider size has changed since we did the backup. */ + if (md.md_provsize != (uint64_t)mediasize) { + if (gctl_get_int(req, "force")) { + md.md_provsize = mediasize; + eli_metadata_encode(&md, sector); + } else { + gctl_error(req, "Provider size mismatch: " + "wrong backup file?"); + goto out; + } + } /* Write metadata from the provider. */ if (pwrite(provfd, sector, secsize, mediasize - secsize) != (ssize_t)secsize) { @@ -1230,6 +1263,111 @@ out: } static void +eli_resize(struct gctl_req *req) +{ + struct g_eli_metadata md; + const char *prov; + unsigned char *sector; + unsigned secsize; + off_t mediasize, oldsize; + int nargs, provfd; + + nargs = gctl_get_int(req, "nargs"); + if (nargs != 1) { + gctl_error(req, "Invalid number of arguments."); + return; + } + prov = gctl_get_ascii(req, "arg0"); + + provfd = -1; + sector = NULL; + secsize = 0; + + provfd = open(prov, O_RDWR); + if (provfd == -1 && errno == ENOENT && prov[0] != '/') { + char devprov[MAXPATHLEN]; + + snprintf(devprov, sizeof(devprov), "%s%s", _PATH_DEV, prov); + provfd = open(devprov, O_RDWR); + } + if (provfd == -1) { + gctl_error(req, "Cannot open %s: %s.", prov, strerror(errno)); + goto out; + } + + mediasize = g_get_mediasize(prov); + secsize = g_get_sectorsize(prov); + if (mediasize == 0 || secsize == 0) { + gctl_error(req, "Cannot get information about %s: %s.", prov, + strerror(errno)); + goto out; + } + + sector = malloc(secsize); + if (sector == NULL) { + gctl_error(req, "Cannot allocate memory."); + goto out; + } + + oldsize = gctl_get_intmax(req, "oldsize"); + if (oldsize < 0 || oldsize > mediasize) { + gctl_error(req, "Invalid oldsize: Out of range."); + goto out; + } + + /* Read metadata from the 'oldsize' offset. */ + if (pread(provfd, sector, secsize, oldsize - secsize) != + (ssize_t)secsize) { + gctl_error(req, "Cannot read old metadata: %s.", + strerror(errno)); + goto out; + } + + /* Check if this sector contains geli metadata. */ + if (eli_metadata_decode(sector, &md) != 0) { + gctl_error(req, "MD5 hash mismatch: no metadata for oldsize."); + goto out; + } + + /* + * If the old metadata doesn't have a correct provider size, refuse + * to resize. + */ + if (md.md_provsize != (uint64_t)oldsize) { + gctl_error(req, "Provider size mismatch at oldsize."); + goto out; + } + + /* + * Update the old metadata with the current provider size and write + * it back to the correct place on the provider. + */ + md.md_provsize = mediasize; + eli_metadata_encode(&md, sector); + if (pwrite(provfd, sector, secsize, mediasize - secsize) != + (ssize_t)secsize) { + gctl_error(req, "Cannot write metadata: %s.", strerror(errno)); + goto out; + } + + /* Now trash the old metadata. */ + arc4rand(sector, secsize); + if (pwrite(provfd, sector, secsize, oldsize - secsize) != + (ssize_t)secsize) { + gctl_error(req, "Failed to clobber old metadata: %s.", + strerror(errno)); + goto out; + } +out: + if (provfd > 0) + close(provfd); + if (sector != NULL) { + bzero(sector, secsize); + free(sector); + } +} + +static void eli_clear(struct gctl_req *req) { const char *name; Added: head/tools/regression/geom_eli/resize.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_eli/resize.t Mon Sep 20 22:04:59 2010 (r212934) @@ -0,0 +1,149 @@ +#! /bin/sh +# +# $FreeBSD$ + +echo 1..27 + +BLK=512 +BLKS_PER_MB=2048 + +md=$(mdconfig -s40m) || exit 1 +unit=${md#md} +i=1 + +setsize() { + partszMB=$1 unitszMB=$2 + + { + echo a: $(($partszMB * $BLKS_PER_MB)) 0 4.2BSD 1024 8192 + echo c: $(($unitszMB * $BLKS_PER_MB)) 0 unused 0 0 + } | disklabel -R $md /dev/stdin +} + +# Initialise + +kldload geom_eli >/dev/null 2>&1 + +setsize 10 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 10m" +i=$((i + 1)) + +echo secret >tmp.key +geli init -Bnone -PKtmp.key ${md}a || echo -n "not " +echo ok $i - "Initialised geli on ${md}a" +i=$((i + 1)) +geli attach -pk tmp.key ${md}a || echo -n "not " +echo ok $i - "Attached ${md}a as ${md}a.eli" +i=$((i + 1)) + +newfs -U ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Initialised the filesystem on ${md}a.eli" +i=$((i + 1)) +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Doing a backup, resize & restore must be forced (with -f) as geli +# verifies that the provider size in the metadata matches the consumer. + +geli backup ${md}a tmp.meta || echo -n "not " +echo ok $i - "Backed up ${md}a metadata" +i=$((i + 1)) + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 20 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 20m" +i=$((i + 1)) +geli attach -pktmp.key ${md}a && echo -n "not " +echo ok $i - "Attaching ${md}a fails after resizing the consumer" +i=$((i + 1)) + +geli restore tmp.meta ${md}a && echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli fails without -f" +i=$((i + 1)) +geli restore -f tmp.meta ${md}a || echo -n "not " +echo ok $i - "Restoring metadata on ${md}a.eli can be forced" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a is now possible" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + + +# Now do the resize properly + +geli detach ${md}a.eli || echo -n "not " +echo ok $i - "Detached ${md}a.eli" +i=$((i + 1)) + +setsize 30 40 || echo -n "not " +echo ok $i - "Sized ${md}a to 30m" +i=$((i + 1)) + +geli resize -s20m ${md}a || echo -n "not " +echo ok $i - "Resizing works ok" +i=$((i + 1)) +geli resize -s20m ${md}a && echo -n "not " +echo ok $i - "Resizing doesn't work a 2nd time (no old metadata)" +i=$((i + 1)) + +geli attach -pktmp.key ${md}a || echo -n "not " +echo ok $i - "Attaching ${md}a works ok" +i=$((i + 1)) + +growfs -y ${md}a.eli >/dev/null || echo -n "not " +echo ok $i - "Extended the filesystem on ${md}a.eli" +i=$((i + 1)) + +out=$(fsck -tufs -y ${md}a.eli) +echo "$out" | fgrep -q MODIFIED && echo -n "not " +echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ + "lines of output" +i=$((i + 1)) + +geli detach ${md}a.eli + + +# Verify that the man page example works, changing ada0 to $md, +# 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none +# to geli init. + +gpart create -s GPT md0 || echo -n "not " +echo ok $i - "Installed an MBR on md0" +i=$((i + 1)) +gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " +echo ok $i - "Added a 20m partition in slot 1" +i=$((i + 1)) +geli init -B none -K tmp.key -P ${md}p1 || echo -n "not " +echo ok $i - "Initialised geli on ${md}p1" +i=$((i + 1)) +gpart resize -s 30m -i 1 $md || echo -n "not " +echo ok $i - "Resized partition ${md}p1 to 30m" +i=$((i + 1)) +geli resize -s 20m ${md}p1 || echo -n "not " +echo ok $i - "Resized geli on ${md}p1 to 30m" +i=$((i + 1)) +geli attach -k tmp.key -p ${md}p1 || echo -n "not " +echo ok $i - "Attached ${md}p1.eli" +i=$((i + 1)) + +geli detach ${md}p1.eli +mdconfig -du$unit + +rm tmp.* From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 22:39:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9CC106564A; Mon, 20 Sep 2010 22:39:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id E29018FC08; Mon, 20 Sep 2010 22:39:38 +0000 (UTC) Received: by pwi8 with SMTP id 8so1753428pwi.13 for ; Mon, 20 Sep 2010 15:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LKaYMz+CeyANyVvoUU1hYetOd6Il4c6MfZy1n/dniYI=; b=SQZ3vihEApd1mR/FV75JAjGEDlC8mUc6EBeNWtkmZCnOSEEhojmbzi7VD1tWfayIjy QvLYNF3ACvbZ0qNdy6ymI70aNPmFyS79kykxbslyGjFqYJMz5hI0McErmt3EjWhJCwJB kqEKXOR3MYJdrGpNJGc93gNEKJ3xXNCiRLjbM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dTK5Q4HLimnzjDyAgJ57ApIB7H9oPIQkhhOcyA154zDegPt0g4fkcOICsmAj8LIRaW s1eF8roI2ujlMpmcRWTMrHZKLPlvKnpq9YfNBlGyJvxlZa7L1lfktiw9VQfAJ6Tx/3/5 ZvMy2X/axoiI52E8b8piJh0SIXOHUsi8C40hw= MIME-Version: 1.0 Received: by 10.142.120.9 with SMTP id s9mr8321519wfc.89.1285022378394; Mon, 20 Sep 2010 15:39:38 -0700 (PDT) Received: by 10.142.66.9 with HTTP; Mon, 20 Sep 2010 15:39:38 -0700 (PDT) In-Reply-To: <201009202122.o8KLMFFA067994@svn.freebsd.org> References: <201009202122.o8KLMFFA067994@svn.freebsd.org> Date: Tue, 21 Sep 2010 02:39:38 +0400 Message-ID: From: pluknet To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212932 - head/tools/tools/umastat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 22:39:39 -0000 On 21 September 2010 01:22, Andriy Gapon wrote: > Author: avg > Date: Mon Sep 20 21:22:15 2010 > New Revision: 212932 > URL: http://svn.freebsd.org/changeset/base/212932 > > Log: > =A0tools/umastat: fix build on amd64 Hi. Now my PR 146119 being in GNATS queue for five month can be partially close= d. Thanks. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Mon Sep 20 23:36:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B18D4106566B; Mon, 20 Sep 2010 23:36:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0CA98FC1D; Mon, 20 Sep 2010 23:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8KNasqI071510; Mon, 20 Sep 2010 23:36:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8KNaskL071508; Mon, 20 Sep 2010 23:36:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009202336.o8KNaskL071508@svn.freebsd.org> From: Warner Losh Date: Mon, 20 Sep 2010 23:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212938 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2010 23:36:54 -0000 Author: imp Date: Mon Sep 20 23:36:54 2010 New Revision: 212938 URL: http://svn.freebsd.org/changeset/base/212938 Log: Support new variable NANO_LABEL. When set to a non-null string, nanobsd will build a system that uses this label (via /dev/ufs/${NANO_LABEL}sX) in preference to NANO_DRIVE (well, it forces NANO_DRIVE to be ufs/${NANO_LABEL}). This allows images that will boot off usb stick or CF card easily well. There is no change if you don't set this variable. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon Sep 20 23:17:26 2010 (r212937) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Sep 20 23:36:54 2010 (r212938) @@ -135,9 +135,16 @@ NANO_MD_BACKING="file" # Progress Print level PPLEVEL=3 +# Set NANO_LABEL to non-blank to form the basis for using /dev/ufs/label +# in preference to /dev/${NANO_DRIVE} +# Root partition will be ${NANO_LABEL}s{1,2} +# /cfg partition will be ${NANO_LABEL}s3 +# /data partition will be ${NANO_LABEL}s4 +NANO_LABEL="" + ####################################################################### # Architecture to build. Corresponds to TARGET_ARCH in a buildworld. -# Unfortunately, there's no way to set TARGET at this time, and it +# Unfortunately, there's no way to set TARGET at this time, and it # conflates the two, so architectures where TARGET != TARGET_ARCH do # not work. This defaults to the arch of the current machine. @@ -361,16 +368,26 @@ prune_usr() ( done ) +newfs_part ( ) ( + local dev mnt lbl + dev=$1 + mnt=$2 + lbl=$3 + echo newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} + newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} + mount ${dev} ${mnt} +) + populate_slice ( ) ( - local dev dir mnt + local dev dir mnt lbl dev=$1 dir=$2 mnt=$3 + lbl=$4 test -z $2 && dir=/var/empty - test -d $d || dir=/var/empty + test -d $dir || dir=/var/empty echo "Creating ${dev} with ${dir} (mounting on ${mnt})" - newfs ${NANO_NEWFS} ${dev} - mount ${dev} ${mnt} + newfs_part $dev $mnt $lbl cd ${dir} find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} df -i ${mnt} @@ -378,11 +395,11 @@ populate_slice ( ) ( ) populate_cfg_slice ( ) ( - populate_slice "$1" "$2" "$3" + populate_slice "$1" "$2" "$3" "$4" ) populate_data_slice ( ) ( - populate_slice "$1" "$2" "$3" + populate_slice "$1" "$2" "$3" "$4" ) create_i386_diskimage ( ) ( @@ -484,13 +501,8 @@ create_i386_diskimage ( ) ( bsdlabel ${MD}s1 # Create first image - # XXX: should use populate_slice for easier override - newfs ${NANO_NEWFS} /dev/${MD}s1a + populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1" mount /dev/${MD}s1a ${MNT} - df -i ${MNT} - echo "Copying worlddir..." - ( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} ) - df -i ${MNT} echo "Generating mtree..." ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du @@ -506,14 +518,17 @@ create_i386_diskimage ( ) ( sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f done umount ${MNT} + if [ ! -z ${NANO_LABEL} ]; then + tunefs -L ${NANO_LABEL}"s2" /dev/${MD}s2a + fi fi # Create Config slice - populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} + populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} "s3" # Create Data slice, if any. if [ $NANO_DATASIZE -ne 0 ] ; then - populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} + populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} "s4" fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then @@ -612,7 +627,7 @@ cust_comconsole () ( sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys # Tell loader to use serial console early. - echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config + echo " -h" > ${NANO_WORLDDIR}/boot.config ) ####################################################################### @@ -820,6 +835,11 @@ else NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" fi +# Override user's NANO_DRIVE if they specified a NANO_LABEL +if [ ! -z "${NANO_LABEL}" ]; then + NANO_DRIVE=ufs/${NANO_LABEL} +fi + export MAKEOBJDIRPREFIX export NANO_ARCH @@ -844,6 +864,7 @@ export NANO_TOOLS export NANO_WORLDDIR export NANO_BOOT0CFG export NANO_BOOTLOADER +export NANO_LABEL ####################################################################### # And then it is as simple as that... From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 04:47:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B41B106566B; Tue, 21 Sep 2010 04:47:38 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id A96598FC0C; Tue, 21 Sep 2010 04:47:37 +0000 (UTC) Received: by wwc33 with SMTP id 33so523356wwc.31 for ; Mon, 20 Sep 2010 21:47:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.141.138 with SMTP id m10mr2710833wbu.20.1285044456515; Mon, 20 Sep 2010 21:47:36 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.227.157.85 with HTTP; Mon, 20 Sep 2010 21:47:36 -0700 (PDT) In-Reply-To: <201006241632.o5OGWKBb040575@svn.freebsd.org> References: <201006241632.o5OGWKBb040575@svn.freebsd.org> Date: Tue, 21 Sep 2010 16:47:36 +1200 X-Google-Sender-Auth: qTPbZYVT53zOv3vFzp6U3k4jMZA Message-ID: From: Andrew Thompson To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209510 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 04:47:38 -0000 On 25 June 2010 04:32, Warner Losh wrote: > Author: imp > Date: Thu Jun 24 16:32:20 2010 > New Revision: 209510 > URL: http://svn.freebsd.org/changeset/base/209510 > > Log: > =A0Merge from tbemd: > > =A0change the name of the object tree from ${TARGET} to > =A0${TARGET}.${TARGET_ARCH} so we can do both big and little endian > =A0builds in the same tree. This seems to have broken the VCS string in vers.c, does this look ok? Index: sys/conf/newvers.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/conf/newvers.sh (revision 212945) +++ sys/conf/newvers.sh (working copy) @@ -91,7 +91,7 @@ case "$d" in */sys/*) SRCDIR=3D${d##*obj} if [ -n "$MACHINE" ]; then - SRCDIR=3D${SRCDIR##/$MACHINE} + SRCDIR=3D${SRCDIR##/$MACHINE.$MACHINE_ARCH} fi SRCDIR=3D${SRCDIR%%/sys/*} From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 05:05:44 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0374106566C; Tue, 21 Sep 2010 05:05:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8D68FC14; Tue, 21 Sep 2010 05:05:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8L501FT070603; Mon, 20 Sep 2010 23:00:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 20 Sep 2010 23:00:06 -0600 (MDT) Message-Id: <20100920.230006.634347869592887498.imp@bsdimp.com> To: thompsa@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <201006241632.o5OGWKBb040575@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209510 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:05:44 -0000 In message: Andrew Thompson writes: : On 25 June 2010 04:32, Warner Losh wrote: : > Author: imp : > Date: Thu Jun 24 16:32:20 2010 : > New Revision: 209510 : > URL: http://svn.freebsd.org/changeset/base/209510 : > : > Log: : > =A0Merge from tbemd: : > : > =A0change the name of the object tree from ${TARGET} to : > =A0${TARGET}.${TARGET_ARCH} so we can do both big and little endian= : > =A0builds in the same tree. : = : This seems to have broken the VCS string in vers.c, does this look ok= ? : = : Index: sys/conf/newvers.sh : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D : --- sys/conf/newvers.sh (revision 212945) : +++ sys/conf/newvers.sh (working copy) : @@ -91,7 +91,7 @@ case "$d" in : */sys/*) : SRCDIR=3D${d##*obj} : if [ -n "$MACHINE" ]; then : - SRCDIR=3D${SRCDIR##/$MACHINE} : + SRCDIR=3D${SRCDIR##/$MACHINE.$MACHINE_ARCH} : fi : SRCDIR=3D${SRCDIR%%/sys/*} Sure. 3 months to notice... I think this may be because I don't have these lines anymore in my newvers.sh... Warner From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 05:36:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A009106566C; Tue, 21 Sep 2010 05:36:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 398588FC21; Tue, 21 Sep 2010 05:36:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L5aVfV080515; Tue, 21 Sep 2010 05:36:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L5aVM6080513; Tue, 21 Sep 2010 05:36:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009210536.o8L5aVM6080513@svn.freebsd.org> From: Andriy Gapon Date: Tue, 21 Sep 2010 05:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212949 - head/tools/tools/umastat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:36:31 -0000 Author: avg Date: Tue Sep 21 05:36:30 2010 New Revision: 212949 URL: http://svn.freebsd.org/changeset/base/212949 Log: tools/umastat: more cleanups PR: misc/146119 Submitted by: pluknet MFC after: 1 week Modified: head/tools/tools/umastat/umastat.c Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Tue Sep 21 04:39:13 2010 (r212948) +++ head/tools/tools/umastat/umastat.c Tue Sep 21 05:36:30 2010 (r212949) @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -196,7 +197,7 @@ uma_print_keg_align(struct uma_keg *ukp, LIST_HEAD(bucketlist, uma_bucket); static void -uma_print_bucket(struct uma_bucket *ubp, const char *spaces) +uma_print_bucket(struct uma_bucket *ubp, const char *spaces __unused) { printf("{ ub_cnt = %d, ub_entries = %d }", ubp->ub_cnt, @@ -286,6 +287,7 @@ main(int argc, char *argv[]) size_t uzp_userspace_len; char *memf, *nlistf; int ch; + char errbuf[_POSIX2_LINE_MAX]; memf = nlistf = NULL; while ((ch = getopt(argc, argv, "M:N:")) != -1) { @@ -308,9 +310,9 @@ main(int argc, char *argv[]) if (nlistf != NULL && memf == NULL) usage(); - kvm = kvm_open(nlistf, memf, NULL, 0, "umastat"); + kvm = kvm_openfiles(nlistf, memf, NULL, 0, errbuf); if (kvm == NULL) - err(-1, "kvm_open"); + errx(-1, "kvm_openfiles: %s", errbuf); if (kvm_nlist(kvm, namelist) != 0) err(-1, "kvm_nlist"); From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 05:39:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2A1106566C; Tue, 21 Sep 2010 05:39:17 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 380608FC20; Tue, 21 Sep 2010 05:39:15 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA25557; Tue, 21 Sep 2010 08:39:13 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OxvZQ-000Nl2-Uy; Tue, 21 Sep 2010 08:39:12 +0300 Message-ID: <4C984500.6080807@freebsd.org> Date: Tue, 21 Sep 2010 08:39:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: pluknet References: <201009202122.o8KLMFFA067994@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212932 - head/tools/tools/umastat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:39:17 -0000 on 21/09/2010 01:39 pluknet said the following: > On 21 September 2010 01:22, Andriy Gapon wrote: >> Author: avg >> Date: Mon Sep 20 21:22:15 2010 >> New Revision: 212932 >> URL: http://svn.freebsd.org/changeset/base/212932 >> >> Log: >> tools/umastat: fix build on amd64 > > Hi. > > Now my PR 146119 being in GNATS queue for five month can be partially closed. Committed the rest of your patch. Sorry for not spotting the PR earlier. Thanks! -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 05:54:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E96F9106566C; Tue, 21 Sep 2010 05:54:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D890A8FC18; Tue, 21 Sep 2010 05:54:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L5saCN080915; Tue, 21 Sep 2010 05:54:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L5samY080913; Tue, 21 Sep 2010 05:54:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009210554.o8L5samY080913@svn.freebsd.org> From: Andriy Gapon Date: Tue, 21 Sep 2010 05:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212950 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:54:37 -0000 Author: avg Date: Tue Sep 21 05:54:36 2010 New Revision: 212950 URL: http://svn.freebsd.org/changeset/base/212950 Log: zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions in another place MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 21 05:36:30 2010 (r212949) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 21 05:54:36 2010 (r212950) @@ -510,14 +510,11 @@ again: dirbytes = 0; } if (error == 0) { - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); + va = zfs_map_page(m, &sf); error = dmu_read(os, zp->z_id, start + off, bytes, (void *)(va + off), DMU_READ_PREFETCH); - sf_buf_free(sf); - sched_unpin(); + zfs_unmap_page(sf); } VM_OBJECT_LOCK(obj); if (error == 0) From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 05:58:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41E21065670; Tue, 21 Sep 2010 05:58:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E370D8FC22; Tue, 21 Sep 2010 05:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L5wjk6081070; Tue, 21 Sep 2010 05:58:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L5wjv9081068; Tue, 21 Sep 2010 05:58:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009210558.o8L5wjv9081068@svn.freebsd.org> From: Andriy Gapon Date: Tue, 21 Sep 2010 05:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212951 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 05:58:46 -0000 Author: avg Date: Tue Sep 21 05:58:45 2010 New Revision: 212951 URL: http://svn.freebsd.org/changeset/base/212951 Log: zfs_map_page/zfs_unmap_page: do not use sched_pin() and SFB_CPUPRIVATE zfs_map_page/zfs_unmap_page are mostly called around potential I/O paths and it seems to be a not very good idea to do cpu pinning there. Suggested by: kib MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 21 05:54:36 2010 (r212950) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Sep 21 05:58:45 2010 (r212951) @@ -358,8 +358,7 @@ static caddr_t zfs_map_page(vm_page_t pp, struct sf_buf **sfp) { - sched_pin(); - *sfp = sf_buf_alloc(pp, SFB_CPUPRIVATE); + *sfp = sf_buf_alloc(pp, 0); return ((caddr_t)sf_buf_kva(*sfp)); } @@ -368,7 +367,6 @@ zfs_unmap_page(struct sf_buf *sf) { sf_buf_free(sf); - sched_unpin(); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 06:47:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D41106564A; Tue, 21 Sep 2010 06:47:05 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40DFC8FC21; Tue, 21 Sep 2010 06:47:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L6l5RM082196; Tue, 21 Sep 2010 06:47:05 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L6l55H082194; Tue, 21 Sep 2010 06:47:05 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009210647.o8L6l55H082194@svn.freebsd.org> From: David Xu Date: Tue, 21 Sep 2010 06:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212952 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 06:47:05 -0000 Author: davidxu Date: Tue Sep 21 06:47:04 2010 New Revision: 212952 URL: http://svn.freebsd.org/changeset/base/212952 Log: If we are at cancellation point, always work as deferred mode despite whether asynchronous mode is turned on or not, this always gives us a chance to decide whether thread should be canceled or not in cancellation points. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Tue Sep 21 05:58:45 2010 (r212951) +++ head/lib/libthr/thread/thr_sig.c Tue Sep 21 06:47:04 2010 (r212952) @@ -270,46 +270,44 @@ static void check_cancel(struct pthread *curthread, ucontext_t *ucp) { - if (__predict_true(!curthread->cancel_pending || !curthread->cancel_enable || - curthread->no_cancel)) + if (__predict_true(!curthread->cancel_pending || + !curthread->cancel_enable || curthread->no_cancel)) return; - if (curthread->cancel_async) { + /* + * Otherwise, we are in defer mode, and we are at + * cancel point, tell kernel to not block the current + * thread on next cancelable system call. + * + * There are three cases we should call thr_wake() to + * turn on TDP_WAKEUP or send SIGCANCEL in kernel: + * 1) we are going to call a cancelable system call, + * non-zero cancel_point means we are already in + * cancelable state, next system call is cancelable. + * 2) because _thr_ast() may be called by + * THR_CRITICAL_LEAVE() which is used by rtld rwlock + * and any libthr internal locks, when rtld rwlock + * is used, it is mostly caused my an unresolved PLT. + * those routines may clear the TDP_WAKEUP flag by + * invoking some system calls, in those cases, we + * also should reenable the flag. + * 3) thread is in sigsuspend(), and the syscall insists + * on getting a signal before it agrees to return. + */ + if (curthread->cancel_point) { + if (curthread->in_sigsuspend && ucp) { + SIGADDSET(ucp->uc_sigmask, SIGCANCEL); + curthread->unblock_sigcancel = 1; + _thr_send_sig(curthread, SIGCANCEL); + } else + thr_wake(curthread->tid); + } else if (curthread->cancel_async) { /* - * asynchronous cancellation mode, act upon + * asynchronous cancellation mode, act upon * immediately. - */ + */ _pthread_exit_mask(PTHREAD_CANCELED, ucp? &ucp->uc_sigmask : NULL); - } else { - /* - * Otherwise, we are in defer mode, and we are at - * cancel point, tell kernel to not block the current - * thread on next cancelable system call. - * - * There are three cases we should call thr_wake() to - * turn on TDP_WAKEUP or send SIGCANCEL in kernel: - * 1) we are going to call a cancelable system call, - * non-zero cancel_point means we are already in - * cancelable state, next system call is cancelable. - * 2) because _thr_ast() may be called by - * THR_CRITICAL_LEAVE() which is used by rtld rwlock - * and any libthr internal locks, when rtld rwlock - * is used, it is mostly caused my an unresolved PLT. - * those routines may clear the TDP_WAKEUP flag by - * invoking some system calls, in those cases, we - * also should reenable the flag. - * 3) thread is in sigsuspend(), and the syscall insists - * on getting a signal before it agrees to return. - */ - if (curthread->cancel_point) { - if (curthread->in_sigsuspend && ucp) { - SIGADDSET(ucp->uc_sigmask, SIGCANCEL); - curthread->unblock_sigcancel = 1; - _thr_send_sig(curthread, SIGCANCEL); - } else - thr_wake(curthread->tid); - } } } From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 07:03:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6BD6106564A; Tue, 21 Sep 2010 07:03:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A637D8FC26; Tue, 21 Sep 2010 07:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L73rph082726; Tue, 21 Sep 2010 07:03:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L73rZc082724; Tue, 21 Sep 2010 07:03:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201009210703.o8L73rZc082724@svn.freebsd.org> From: Andrew Thompson Date: Tue, 21 Sep 2010 07:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212954 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 07:03:53 -0000 Author: thompsa Date: Tue Sep 21 07:03:53 2010 New Revision: 212954 URL: http://svn.freebsd.org/changeset/base/212954 Log: Fix the path to the sys dir when cross compiling after r209510. Reviewed by: imp Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Sep 21 07:01:00 2010 (r212953) +++ head/sys/conf/newvers.sh Tue Sep 21 07:03:53 2010 (r212954) @@ -91,7 +91,7 @@ case "$d" in */sys/*) SRCDIR=${d##*obj} if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} + SRCDIR=${SRCDIR##/$MACHINE.$MACHINE_ARCH} fi SRCDIR=${SRCDIR%%/sys/*} From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 07:58:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 297501065670; Tue, 21 Sep 2010 07:58:48 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1886E8FC16; Tue, 21 Sep 2010 07:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L7wlbe084145; Tue, 21 Sep 2010 07:58:47 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L7wlce084142; Tue, 21 Sep 2010 07:58:47 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009210758.o8L7wlce084142@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 21 Sep 2010 07:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212957 - in head/sys/mips/rmi: . dev/nlge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 07:58:48 -0000 Author: jchandra Date: Tue Sep 21 07:58:47 2010 New Revision: 212957 URL: http://svn.freebsd.org/changeset/base/212957 Log: n32 fixes for nlge. Use correct define (__mips_n64) for n64 compilation and use correct parameter type for xlr_paddr_lw() in n32. Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/rmi_mips_exts.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Sep 21 07:44:40 2010 (r212956) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Sep 21 07:58:47 2010 (r212957) @@ -659,7 +659,7 @@ nlge_msgring_handler(int bucket, int siz if (is_p2p) { release_tx_desc(phys_addr); } else { -#ifdef __mips64 +#ifdef __mips_n64 m = (struct mbuf *)(uintptr_t)xlr_paddr_ld(phys_addr); m->m_nextpkt = NULL; #else @@ -1912,7 +1912,7 @@ prepare_fmn_message(struct nlge_softc *s if (msg_sz == (FMN_SZ - 1)) { p2p = uma_zalloc(nl_tx_desc_zone, M_NOWAIT); if (p2p == NULL) { - return 2; + return (2); } /* * Save the virtual address in the descriptor, @@ -1948,7 +1948,7 @@ prepare_fmn_message(struct nlge_softc *s /* set eop in most-recent p2d */ cur_p2d[-1] |= (1ULL << 63); -#ifdef __mips64 +#ifdef __mips_n64 /* * On n64, we cannot store our mbuf pointer(64 bit) in the freeback * message (40bit available), so we put the mbuf in m_nextpkt and Modified: head/sys/mips/rmi/rmi_mips_exts.h ============================================================================== --- head/sys/mips/rmi/rmi_mips_exts.h Tue Sep 21 07:44:40 2010 (r212956) +++ head/sys/mips/rmi/rmi_mips_exts.h Tue Sep 21 07:58:47 2010 (r212957) @@ -436,7 +436,7 @@ xlr_paddr_ld(uint64_t paddr) #elif defined(__mips_n32) static __inline uint32_t -xlr_paddr_lw(uint32_t paddr) +xlr_paddr_lw(uint64_t paddr) { uint32_t val; From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 08:02:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81C641065670; Tue, 21 Sep 2010 08:02:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718158FC0C; Tue, 21 Sep 2010 08:02:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L822O6084294; Tue, 21 Sep 2010 08:02:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L822H2084292; Tue, 21 Sep 2010 08:02:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009210802.o8L822H2084292@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Sep 2010 08:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212958 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 08:02:02 -0000 Author: mav Date: Tue Sep 21 08:02:02 2010 New Revision: 212958 URL: http://svn.freebsd.org/changeset/base/212958 Log: Until hardclock() and respectively tc_windup() called first time, system is running on "dummy" time counter. But to function properly in one-shot mode, event timer management code requires working time counter. Slow moving "dummy" time counter delays first hardclock() call by few seconds on my systems, even though timer interrupts were correctly kicking kernel. That causes few seconds delay during boot with one-shot mode enabled. To break this loop, explicitly call tc_windup() first time during initialization process to let it switch to some real time counter. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Tue Sep 21 07:58:47 2010 (r212957) +++ head/sys/kern/kern_tc.c Tue Sep 21 08:02:02 2010 (r212958) @@ -805,6 +805,7 @@ inittimecounter(void *dummy) /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); + tc_windup(); } SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 08:25:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE93610656EF; Tue, 21 Sep 2010 08:25:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6838FC15; Tue, 21 Sep 2010 08:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L8P0th084861; Tue, 21 Sep 2010 08:25:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L8P0L0084859; Tue, 21 Sep 2010 08:25:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201009210825.o8L8P0L0084859@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 Sep 2010 08:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 08:25:01 -0000 Author: ed Date: Tue Sep 21 08:25:00 2010 New Revision: 212959 URL: http://svn.freebsd.org/changeset/base/212959 Log: Add a notice to the man page that batteries should be installed. Modified: head/sbin/mount_unionfs/mount_unionfs.8 Modified: head/sbin/mount_unionfs/mount_unionfs.8 ============================================================================== --- head/sbin/mount_unionfs/mount_unionfs.8 Tue Sep 21 08:02:02 2010 (r212958) +++ head/sbin/mount_unionfs/mount_unionfs.8 Tue Sep 21 08:25:00 2010 (r212959) @@ -353,6 +353,7 @@ USE AT YOUR OWN RISK. BEWARE OF DOG. SLIPPERY WHEN WET. +BATTERIES NOT INCLUDED. .Pp This code also needs an owner in order to be less dangerous - serious hackers can apply by sending mail to From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 10:22:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 811FF1065670; Tue, 21 Sep 2010 10:22:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 704DF8FC1E; Tue, 21 Sep 2010 10:22:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LAMTqS087770; Tue, 21 Sep 2010 10:22:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LAMT1R087767; Tue, 21 Sep 2010 10:22:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009211022.o8LAMT1R087767@svn.freebsd.org> From: Rui Paulo Date: Tue, 21 Sep 2010 10:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212961 - in head/crypto/openssl/crypto: . rc5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 10:22:29 -0000 Author: rpaulo Date: Tue Sep 21 10:22:29 2010 New Revision: 212961 URL: http://svn.freebsd.org/changeset/base/212961 Log: Bring in OpenSSL checkin 19821: Make inline assembler clang-friendly [from HEAD]. openssl/crypto/md32_common.h 1.45.2.1 -> 1.45.2.2 openssl/crypto/rc5/rc5_locl.h 1.8 -> 1.8.8.1 Approved by: simon Modified: head/crypto/openssl/crypto/md32_common.h head/crypto/openssl/crypto/rc5/rc5_locl.h Modified: head/crypto/openssl/crypto/md32_common.h ============================================================================== --- head/crypto/openssl/crypto/md32_common.h Tue Sep 21 09:33:44 2010 (r212960) +++ head/crypto/openssl/crypto/md32_common.h Tue Sep 21 10:22:29 2010 (r212961) @@ -165,7 +165,7 @@ asm ( \ "roll %1,%0" \ : "=r"(ret) \ - : "I"(n), "0"(a) \ + : "I"(n), "0"((unsigned int)(a)) \ : "cc"); \ ret; \ }) @@ -383,6 +383,7 @@ int HASH_FINAL (unsigned char *md, HASH_ } #ifndef MD32_REG_T +#if defined(__alpha) || defined(__sparcv9) || defined(__mips) #define MD32_REG_T long /* * This comment was originaly written for MD5, which is why it @@ -400,9 +401,15 @@ int HASH_FINAL (unsigned char *md, HASH_ * Well, to be honest it should say that this *prevents* * performance degradation. * - * Apparently there're LP64 compilers that generate better - * code if A-D are declared int. Most notably GCC-x86_64 - * generates better code. + */ +#else +/* + * Above is not absolute and there are LP64 compilers that + * generate better code if MD32_REG_T is defined int. The above + * pre-processor condition reflects the circumstances under which + * the conclusion was made and is subject to further extension. * */ +#define MD32_REG_T int +#endif #endif Modified: head/crypto/openssl/crypto/rc5/rc5_locl.h ============================================================================== --- head/crypto/openssl/crypto/rc5/rc5_locl.h Tue Sep 21 09:33:44 2010 (r212960) +++ head/crypto/openssl/crypto/rc5/rc5_locl.h Tue Sep 21 10:22:29 2010 (r212961) @@ -154,14 +154,14 @@ # define ROTATE_l32(a,n) ({ register unsigned int ret; \ asm ("roll %%cl,%0" \ : "=r"(ret) \ - : "c"(n),"0"(a) \ + : "c"(n),"0"((unsigned int)(a)) \ : "cc"); \ ret; \ }) # define ROTATE_r32(a,n) ({ register unsigned int ret; \ asm ("rorl %%cl,%0" \ : "=r"(ret) \ - : "c"(n),"0"(a) \ + : "c"(n),"0"((unsigned int)(a)) \ : "cc"); \ ret; \ }) From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 10:24:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BDFC1065694; Tue, 21 Sep 2010 10:24:29 +0000 (UTC) (envelope-from prvs=18736308cf=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2BD8FC22; Tue, 21 Sep 2010 10:24:28 +0000 (UTC) Received: from pd6ml2no-ssvc.prod.shaw.ca ([10.0.153.163]) by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 21 Sep 2010 04:09:26 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=Mj7okGGiyvljez8nourwAOSCyIXzraNcHEi86Qy5a+Y= c=1 sm=1 a=nwdpmwd4ttUA:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=PO7r1zJSAAAA:8 a=MMwg4So0AAAA:8 a=6I5d2MoRAAAA:8 a=W9iI6s1Q80laVmV6a0wA:9 a=L7jCreETJnLBE5ugy_8A:7 a=7Scn8inXKID6XUUMbpi4eBYh2kMA:4 a=CjuIK1q_8ugA:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd6ml2no-dmz.prod.shaw.ca with ESMTP; 21 Sep 2010 04:09:25 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 5DB51C433C1_C988455B; Tue, 21 Sep 2010 10:09:25 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id EE735C460F8_C988450F; Tue, 21 Sep 2010 10:09:20 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o8LA9KFr096704; Tue, 21 Sep 2010 03:09:20 -0700 (PDT) (envelope-from brian@Awfulhak.org) Date: Tue, 21 Sep 2010 03:09:16 -0700 From: Brian Somers To: Bruce Evans Message-ID: <20100921030916.3ee375c6@dev.lan.Awfulhak.org> In-Reply-To: <20100920163758.A788@besplex.bde.org> References: <201009200420.o8K4KtKn026514@svn.freebsd.org> <20100920163758.A788@besplex.bde.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , src-committers@FreeBSD.org Subject: Re: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 10:24:29 -0000 On Mon, 20 Sep 2010 16:55:57 +1000 (EST) Bruce Evans wrote: > On Mon, 20 Sep 2010, Marcel Moolenaar wrote: > > > Log: > > Unbreak the build on strong-aligned architectures (arm, ia64). > > Casting from (char *) to (struct ufs1_dinode *) changes the > > alignment requirement of the pointer and GCC does not know that > > the pointer is adequately aligned (due to malloc(3)), and warns > > about it. Cast to (void *) first to by-pass the check. > > A previous version in which the pointer (iobuf) the correct type to > begin with was better. It used to have type void *, but now has type > caddr_t (whose existence is a bug), in order to abuse caddr_t by > assuming that it is char * to do pointer arithmetic on it in 1 place > (iobuf + sblock.fs_cgsize). The 7 other places where iobuf is used > only assume that caddr_t is a pointer (or perhaps a [u]intptr_t). > > growfs has no other instances of caddr_t. Maybe iobuf ought to go back to being a void * with casting where the arithmetic happens. If it's changed, newfs/mkfs.c should probably change too. Is there some subtle difference that makes the casting ok in newfs/mkfs.c: dp1 = (struct ufs1_dinode *)(&iobuf[start]); and not ok in growfs/growfs.c r212885: dp1 = (struct ufs1_dinode *)iobuf; or is it just ignored because WARNS is 3 for newfs and is defaulted to 6 for growfs? -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 11:50:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C392106564A; Tue, 21 Sep 2010 11:50:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 877408FC17; Tue, 21 Sep 2010 11:50:02 +0000 (UTC) Received: from besplex.bde.org (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8LBns85019041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Sep 2010 21:49:55 +1000 Date: Tue, 21 Sep 2010 21:49:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brian Somers In-Reply-To: <20100921030916.3ee375c6@dev.lan.Awfulhak.org> Message-ID: <20100921213906.D14718@besplex.bde.org> References: <201009200420.o8K4KtKn026514@svn.freebsd.org> <20100920163758.A788@besplex.bde.org> <20100921030916.3ee375c6@dev.lan.Awfulhak.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , Bruce Evans , src-committers@FreeBSD.org Subject: Re: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 11:50:03 -0000 On Tue, 21 Sep 2010, Brian Somers wrote: > On Mon, 20 Sep 2010 16:55:57 +1000 (EST) Bruce Evans wrote: >> On Mon, 20 Sep 2010, Marcel Moolenaar wrote: >> >>> Log: >>> Unbreak the build on strong-aligned architectures (arm, ia64). >>> Casting from (char *) to (struct ufs1_dinode *) changes the >>> alignment requirement of the pointer and GCC does not know that >>> the pointer is adequately aligned (due to malloc(3)), and warns >>> about it. Cast to (void *) first to by-pass the check. >> >> A previous version in which the pointer (iobuf) the correct type to >> begin with was better. It used to have type void *, but now has type >> ... > > Maybe iobuf ought to go back to being a void * with casting where the > arithmetic happens. If it's changed, newfs/mkfs.c should probably change > too. > > Is there some subtle difference that makes the casting ok in newfs/mkfs.c: > > dp1 = (struct ufs1_dinode *)(&iobuf[start]); > > and not ok in growfs/growfs.c r212885: > > dp1 = (struct ufs1_dinode *)iobuf; > > or is it just ignored because WARNS is 3 for newfs and is defaulted to 6 for growfs? Just because of WARNS. The `caddr_t iobuf;' in newfs is really old and should be fixed someday. It is the only caddr_t remaining in newfs. In Lite2, newfs also uses caddr_t for its now-dead mfs parts, including for its replacements for the malloc() family which were errors in theory even at the time of Lite2 and which are now errors in practice. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:07:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 409871065673; Tue, 21 Sep 2010 15:07:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED2D68FC12; Tue, 21 Sep 2010 15:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LF7iCm097678; Tue, 21 Sep 2010 15:07:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LF7iVv097676; Tue, 21 Sep 2010 15:07:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009211507.o8LF7iVv097676@svn.freebsd.org> From: Andriy Gapon Date: Tue, 21 Sep 2010 15:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:07:45 -0000 Author: avg Date: Tue Sep 21 15:07:44 2010 New Revision: 212964 URL: http://svn.freebsd.org/changeset/base/212964 Log: kdb_backtrace: stack(9)-based code to print backtrace without any backend The idea is to add KDB and KDB_TRACE options to GENERIC kernels on stable branches, so that at least the minimal information is produced for non-specific panics like traps on page faults. The GENERICs in stable branches seem to already include STACK option. Reviewed by: attilio MFC after: 2 weeks Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Tue Sep 21 12:57:43 2010 (r212963) +++ head/sys/kern/subr_kdb.c Tue Sep 21 15:07:44 2010 (r212964) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" +#include "opt_stack.h" #include #include @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -300,6 +302,15 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace:\n"); + stack_save(&st); + stack_print(&st); + } +#endif } /* From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:17:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B9B61065670; Tue, 21 Sep 2010 15:17:03 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDFE8FC12; Tue, 21 Sep 2010 15:17:02 +0000 (UTC) Received: by gxk8 with SMTP id 8so2091545gxk.13 for ; Tue, 21 Sep 2010 08:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=V2xc3q4X5C6vy8U1zbtLAnR8IigBbSsdBkoRvDQjmfM=; b=x62LCCJi6/KoB5I9SaeybeRTJWkRCOGfcD2vKgPnJLi2NnDbjeA64ZxOu5+VwX5upw goBLBoyIgq2umXcR4Wf+ZfFgkgevmlwSpJfWPXXaB9qv+kv/IG7kggnK5DS3bIRdeqhT i4H4RSYnnYkaJcseSm4sqkxOqgLGTR/kkRLsk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=J1CcG5bFpkhry1V93jDHU3t0CvYKlVVcH9DkUWisAbOEUW7zTcklTJ32nEfDelpd2r TL0ZDfgXKmGUwrY1KB648Up51WAUfgPHdael5ULitVoo4wNqqjgz7BtNLeCC0TkyLXjd d/uWnyw/nSxGvrVE+5Jcr5vqKNwiy00V06BUc= MIME-Version: 1.0 Received: by 10.100.42.13 with SMTP id p13mr11241781anp.54.1285082221776; Tue, 21 Sep 2010 08:17:01 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.187.71 with HTTP; Tue, 21 Sep 2010 08:17:01 -0700 (PDT) In-Reply-To: <201009211507.o8LF7iVv097676@svn.freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> Date: Tue, 21 Sep 2010 08:17:01 -0700 X-Google-Sender-Auth: UQ1TutHYuhLihrRa0T4fJl2xZYk Message-ID: From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:17:03 -0000 On Tue, Sep 21, 2010 at 8:07 AM, Andriy Gapon wrote: > Author: avg > Date: Tue Sep 21 15:07:44 2010 > New Revision: 212964 > URL: http://svn.freebsd.org/changeset/base/212964 > > Log: > =A0kdb_backtrace: stack(9)-based code to print backtrace without any back= end > > =A0The idea is to add KDB and KDB_TRACE options to GENERIC kernels on > =A0stable branches, so that at least the minimal information is produced > =A0for non-specific panics like traps on page faults. > =A0The GENERICs in stable branches seem to already include STACK option. > > =A0Reviewed by: =A0attilio > =A0MFC after: =A0 =A02 weeks > > Modified: > =A0head/sys/kern/subr_kdb.c > > Modified: head/sys/kern/subr_kdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_kdb.c =A0 =A0Tue Sep 21 12:57:43 2010 =A0 =A0 =A0 = =A0(r212963) > +++ head/sys/kern/subr_kdb.c =A0 =A0Tue Sep 21 15:07:44 2010 =A0 =A0 =A0 = =A0(r212964) > @@ -28,6 +28,7 @@ > =A0__FBSDID("$FreeBSD$"); > > =A0#include "opt_kdb.h" > +#include "opt_stack.h" > > =A0#include > =A0#include > @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); > =A0#include > =A0#include > =A0#include > +#include > =A0#include > > =A0#include > @@ -300,6 +302,15 @@ kdb_backtrace(void) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("KDB: stack backtrace:\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0kdb_dbbe->dbbe_trace(); > =A0 =A0 =A0 =A0} > +#ifdef STACK > + =A0 =A0 =A0 else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct stack st; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("KDB: stack backtrace:\n"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 stack_save(&st); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 stack_print(&st); I'd recommend using stack_print_ddb(), as that avoids any locking which may hang depending on how the kernel panic'd. Thanks, matthew > + =A0 =A0 =A0 } > +#endif > =A0} > > =A0/* > From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:27:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A45FC1065672; Tue, 21 Sep 2010 15:27:38 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5696E8FC12; Tue, 21 Sep 2010 15:27:37 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA09128; Tue, 21 Sep 2010 18:27:35 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C98CEE7.6060802@freebsd.org> Date: Tue, 21 Sep 2010 18:27:35 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: mdf@freebsd.org References: <201009211507.o8LF7iVv097676@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:27:38 -0000 on 21/09/2010 18:17 mdf@FreeBSD.org said the following: > On Tue, Sep 21, 2010 at 8:07 AM, Andriy Gapon wrote: >> Author: avg >> Date: Tue Sep 21 15:07:44 2010 >> New Revision: 212964 >> URL: http://svn.freebsd.org/changeset/base/212964 >> >> Log: >> kdb_backtrace: stack(9)-based code to print backtrace without any backend >> >> The idea is to add KDB and KDB_TRACE options to GENERIC kernels on >> stable branches, so that at least the minimal information is produced >> for non-specific panics like traps on page faults. >> The GENERICs in stable branches seem to already include STACK option. >> >> Reviewed by: attilio >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/subr_kdb.c >> >> Modified: head/sys/kern/subr_kdb.c >> ============================================================================== >> --- head/sys/kern/subr_kdb.c Tue Sep 21 12:57:43 2010 (r212963) >> +++ head/sys/kern/subr_kdb.c Tue Sep 21 15:07:44 2010 (r212964) >> @@ -28,6 +28,7 @@ >> __FBSDID("$FreeBSD$"); >> >> #include "opt_kdb.h" >> +#include "opt_stack.h" >> >> #include >> #include >> @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> >> #include >> @@ -300,6 +302,15 @@ kdb_backtrace(void) >> printf("KDB: stack backtrace:\n"); >> kdb_dbbe->dbbe_trace(); >> } >> +#ifdef STACK >> + else { >> + struct stack st; >> + >> + printf("KDB: stack backtrace:\n"); >> + stack_save(&st); >> + stack_print(&st); > > I'd recommend using stack_print_ddb(), as that avoids any locking > which may hang depending on how the kernel panic'd. It seems that stack_print_ddb() depends on DDB? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:40:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12E501065673; Tue, 21 Sep 2010 15:40:51 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 114308FC1B; Tue, 21 Sep 2010 15:40:49 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA09398; Tue, 21 Sep 2010 18:40:48 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C98D200.4040909@freebsd.org> Date: Tue, 21 Sep 2010 18:40:48 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: mdf@freebsd.org References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98CEE7.6060802@freebsd.org> In-Reply-To: <4C98CEE7.6060802@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:40:52 -0000 on 21/09/2010 18:27 Andriy Gapon said the following: > on 21/09/2010 18:17 mdf@FreeBSD.org said the following: >> >> I'd recommend using stack_print_ddb(), as that avoids any locking >> which may hang depending on how the kernel panic'd. > > It seems that stack_print_ddb() depends on DDB? But the point about locking is very good. How do you suggest we can deal with it? A dirty hack would be to check panicstr in linker_search_symbol_name and avoid locking, but I don't like that at all. Perhaps, some code in subr_stack.c could be taken outside DDB ifdef? Thank you! -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:48:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D4E106567A; Tue, 21 Sep 2010 15:48:23 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 288108FC26; Tue, 21 Sep 2010 15:48:22 +0000 (UTC) Received: by qwg5 with SMTP id 5so4961379qwg.13 for ; Tue, 21 Sep 2010 08:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=ls+dToSLXVfuAz7a+c2dZYvjxWv5dxXwEoW5UkbnFpM=; b=fatzqq8ZLXE+Q2eMLeq6ZKrlM9h4ECazy21MQWA8gvlRszHULFMz6Vsu4LQpdlA43B Yr/JQLtYFXaxSOuRoSKQqFrRVbkTDiQTEQYR+S8Y9mLW+K5EnPE6KnqUjVd5UW/Bl6Lx EQFZZZ5q3M5yZ+wH37zkMeRqNNTcgX1tQ/3Ps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=eHqGBpBjjs8Vn2f3EhtbPePrXzKU9E6HMgnpAifPI6S+TXLf7p5MuHbey7MX//qYxm QW4iI5zGJm+sFuW2lyCPl5/mlqfLooxejCsXbQKTTdw0Q50/mGpNb8ia3dCyy1HW7a6N 4wvcDOy62hNXJnqA7LcK+bmgGAz12bW13uDWk= MIME-Version: 1.0 Received: by 10.224.19.205 with SMTP id c13mr697474qab.63.1285084101966; Tue, 21 Sep 2010 08:48:21 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.235.143 with HTTP; Tue, 21 Sep 2010 08:48:21 -0700 (PDT) In-Reply-To: <4C98D200.4040909@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98CEE7.6060802@freebsd.org> <4C98D200.4040909@freebsd.org> Date: Tue, 21 Sep 2010 17:48:21 +0200 X-Google-Sender-Auth: Z0xkzM2JKhf6IagNM-lheL6zy94 Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:48:24 -0000 2010/9/21 Andriy Gapon : > on 21/09/2010 18:27 Andriy Gapon said the following: >> on 21/09/2010 18:17 mdf@FreeBSD.org said the following: >>> >>> I'd recommend using stack_print_ddb(), as that avoids any locking >>> which may hang depending on how the kernel panic'd. >> >> It seems that stack_print_ddb() depends on DDB? > > But the point about locking is very good. > How do you suggest we can deal with it? > > A dirty hack would be to check panicstr in linker_search_symbol_name and avoid > locking, but I don't like that at all. > Perhaps, some code in subr_stack.c could be taken outside DDB ifdef? It heavilly depends on DDB, I'd say to just leave as the code is now. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 15:52:07 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A35D8106564A; Tue, 21 Sep 2010 15:52:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7AE8FC16; Tue, 21 Sep 2010 15:52:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8LFhn6E078851; Tue, 21 Sep 2010 09:43:50 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 21 Sep 2010 09:43:57 -0600 (MDT) Message-Id: <20100921.094357.999284355964747902.imp@bsdimp.com> To: thompsa@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20100920.230006.634347869592887498.imp@bsdimp.com> References: <201006241632.o5OGWKBb040575@svn.freebsd.org> <20100920.230006.634347869592887498.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209510 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 15:52:07 -0000 In message: <20100920.230006.634347869592887498.imp@bsdimp.com> "M. Warner Losh" writes: : In message: : Andrew Thompson writes: : : On 25 June 2010 04:32, Warner Losh wrote: : : > Author: imp : : > Date: Thu Jun 24 16:32:20 2010 : : > New Revision: 209510 : : > URL: http://svn.freebsd.org/changeset/base/209510 : : > : : > Log: : : > =A0Merge from tbemd: : : > : : > =A0change the name of the object tree from ${TARGET} to : : > =A0${TARGET}.${TARGET_ARCH} so we can do both big and little endi= an : : > =A0builds in the same tree. : : = : : This seems to have broken the VCS string in vers.c, does this look = ok? : : = : : Index: sys/conf/newvers.sh : : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D : : --- sys/conf/newvers.sh (revision 212945) : : +++ sys/conf/newvers.sh (working copy) : : @@ -91,7 +91,7 @@ case "$d" in : : */sys/*) : : SRCDIR=3D${d##*obj} : : if [ -n "$MACHINE" ]; then : : - SRCDIR=3D${SRCDIR##/$MACHINE} : : + SRCDIR=3D${SRCDIR##/$MACHINE.$MACHINE_ARCH} : : fi : : SRCDIR=3D${SRCDIR%%/sys/*} : = : Sure. 3 months to notice... : = : I think this may be because I don't have these lines anymore in my : newvers.sh... I guess what I was trying to say was that this change shouldn't be a problem. However, I've completely gutted that section of newvers.sh, since it isn't necessary, and have been running with it since before BSDcan. Maybe I'll just commit it... Warner From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:14:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170761065670; Tue, 21 Sep 2010 16:14:57 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C0BC28FC19; Tue, 21 Sep 2010 16:14:55 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA10128; Tue, 21 Sep 2010 19:14:53 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C98D9FD.4050809@freebsd.org> Date: Tue, 21 Sep 2010 19:14:53 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: mdf@freebsd.org References: <201009211507.o8LF7iVv097676@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:14:57 -0000 on 21/09/2010 18:17 mdf@FreeBSD.org said the following: > I'd recommend using stack_print_ddb(), as that avoids any locking > which may hang depending on how the kernel panic'd. How does the following look to you? I hope I haven't freed too much from under DDB. The patch compiles fine with STACK && !DDB. --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -924,7 +924,6 @@ linker_debug_search_symbol_name return (0); } -#ifdef DDB /* * DDB Helpers. DDB has to look across multiple files with their own symbol * tables and string tables. @@ -933,12 +932,14 @@ linker_debug_search_symbol_name * DDB to hang because somebody's got the lock held. We'll take the chance * that the files list is inconsistant instead. */ +#ifdef DDB int linker_ddb_lookup(const char *symstr, c_linker_sym_t *sym) { return (linker_debug_lookup(symstr, sym)); } +#endif int linker_ddb_search_symbol(caddr_t value, c_linker_sym_t *sym, long *diffp) @@ -961,7 +962,6 @@ linker_ddb_search_symbol_name return (linker_debug_search_symbol_name(value, buf, buflen, offset)); } -#endif /* * stack(9) helper for non-debugging environemnts. Unlike DDB helpers, we do --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -308,7 +308,7 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); stack_save(&st); - stack_print(&st); + stack_print_ddb(&st); } #endif } --- a/sys/kern/subr_stack.c +++ b/sys/kern/subr_stack.c @@ -44,9 +44,7 @@ static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset); -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); -#endif struct stack * stack_create(void) @@ -125,7 +123,6 @@ stack_print_short(struct stack *st) printf("\n"); } -#ifdef DDB void stack_print_ddb(struct stack *st) { @@ -141,6 +138,7 @@ stack_print_ddb(struct stack *st) } } +#ifdef DDB void stack_print_short_ddb(struct stack *st) { @@ -255,7 +253,6 @@ stack_symbol return (0); } -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset) { @@ -275,4 +272,3 @@ stack_symbol_ddb *name = "??"; return (ENOENT); } -#endif -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:17:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 380DA106564A; Tue, 21 Sep 2010 16:17:38 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED278FC24; Tue, 21 Sep 2010 16:17:37 +0000 (UTC) Received: by qwg5 with SMTP id 5so4987246qwg.13 for ; Tue, 21 Sep 2010 09:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=sEnPv864vnyqFtEdjtVgt2qesbm0VPQFARjdSqQu7Zg=; b=QqJ09GDNBEiy2xIRAZYdxmGa5mJyf0Th93Fgb0+CZoK+IiQoPrQp/2Xr6QWkHBrTsh HygBgOeGkdWmYBAqRB+beeAv79AOd1xTaRhwOCXacBCO7bRmi4mywlB3H+d+cydxiJz1 gkihjYhvs6dZowZ5UjwTmxkCqHZdbW61MEMfI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=hjKDsnFH/mSY02XAbGCSwnsmp1DI9U7Upzb/xcd8FPuNj6XEOJTd4IH/YygRDK5TJl yK4vnGg4LyKrtcYYuW3eifNYgtmEVr20eSGZnxmVHjodsxd5BVY3FF2mJg5yDu3GSLxi 5QkXQsTC8R5EdvguIbWw4WLLz26R7jqqgO6pE= MIME-Version: 1.0 Received: by 10.224.124.80 with SMTP id t16mr7178133qar.204.1285085856558; Tue, 21 Sep 2010 09:17:36 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.235.143 with HTTP; Tue, 21 Sep 2010 09:17:36 -0700 (PDT) In-Reply-To: <4C98D9FD.4050809@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D9FD.4050809@freebsd.org> Date: Tue, 21 Sep 2010 18:17:36 +0200 X-Google-Sender-Auth: Qw8BU2TFWbNAveweTT9p3jJPCQw Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:17:38 -0000 2010/9/21 Andriy Gapon : > on 21/09/2010 18:17 mdf@FreeBSD.org said the following: >> I'd recommend using stack_print_ddb(), as that avoids any locking >> which may hang depending on how the kernel panic'd. > > How does the following look to you? > I hope I haven't freed too much from under DDB. > The patch compiles fine with STACK && !DDB. In general, if you really want to go with that route, I'd rename the functions with _unlocked() prefix (there is actually no need to tell they are _ddb specific) and maybe add _ddb() wrappers, you can have more opinions. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:24:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FE77106564A; Tue, 21 Sep 2010 16:24:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3358FC0C; Tue, 21 Sep 2010 16:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LGOqFt099339; Tue, 21 Sep 2010 16:24:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LGOpZc099335; Tue, 21 Sep 2010 16:24:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201009211624.o8LGOpZc099335@svn.freebsd.org> From: Alan Cox Date: Tue, 21 Sep 2010 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212965 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:24:52 -0000 Author: alc Date: Tue Sep 21 16:24:51 2010 New Revision: 212965 URL: http://svn.freebsd.org/changeset/base/212965 Log: Fix exec_imgact_shell()'s handling of two error cases: (1) Previously, if the first line of a script exceeded MAXSHELLCMDLEN characters, then exec_imgact_shell() silently truncated the line and passed on the truncated interpreter name or argument. Now, exec_imgact_shell() will fail and return ENOEXEC, which is the commonly used errno among Unix variants for this type of error. (2) Previously, exec_imgact_shell()'s check on the length of the interpreter's name was ineffective. In other words, exec_imgact_shell() could not possibly fail and return ENAMETOOLONG. The reason being that the length of the interpreter name had to exceed MAXSHELLCMDLEN characters in order that ENAMETOOLONG be returned. But, the search for the end of the interpreter name stops after at most MAXSHELLCMDLEN - 2 characters are scanned. (In the end, this particular error is eventually discovered outside of exec_imgact_shell() and ENAMETOOLONG is returned. So, the real effect of this second change is that the error is detected earlier, in exec_imgact_shell().) Update the definition of MAXINTERP to the actual limit on the size of the interpreter name that has been in effect since r142453 (from 2005). In collaboration with: kib Modified: head/lib/libc/sys/execve.2 head/sys/kern/imgact_shell.c head/sys/sys/param.h Modified: head/lib/libc/sys/execve.2 ============================================================================== --- head/lib/libc/sys/execve.2 Tue Sep 21 15:07:44 2010 (r212964) +++ head/lib/libc/sys/execve.2 Tue Sep 21 16:24:51 2010 (r212965) @@ -28,7 +28,7 @@ .\" @(#)execve.2 8.5 (Berkeley) 6/1/94 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd September 21, 2010 .Dt EXECVE 2 .Os .Sh NAME @@ -256,9 +256,11 @@ A component of the path prefix is not a .It Bq Er ENAMETOOLONG A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. -.It Bq Er ENAMETOOLONG -When invoking an interpreted script, the interpreter name -exceeds +.It Bq Er ENOEXEC +When invoking an interpreted script, the length of the first line, +inclusive of the +.Sy \&#! +prefix and terminating newline, exceeds .Dv MAXSHELLCMDLEN characters. .It Bq Er ENOENT Modified: head/sys/kern/imgact_shell.c ============================================================================== --- head/sys/kern/imgact_shell.c Tue Sep 21 15:07:44 2010 (r212964) +++ head/sys/kern/imgact_shell.c Tue Sep 21 16:24:51 2010 (r212965) @@ -46,13 +46,18 @@ __FBSDID("$FreeBSD$"); /* * At the time of this writing, MAXSHELLCMDLEN == PAGE_SIZE. This is * significant because the caller has only mapped in one page of the - * file we're reading. This code should be changed to know how to - * read in the second page, but I'm not doing that just yet... + * file we're reading. */ #if MAXSHELLCMDLEN > PAGE_SIZE #error "MAXSHELLCMDLEN is larger than a single page!" #endif +/* + * MAXSHELLCMDLEN must be at least MAXINTERP plus the size of the `#!' + * prefix and terminating newline. + */ +CTASSERT(MAXSHELLCMDLEN >= MAXINTERP + 3); + /** * Shell interpreter image activator. An interpreter name beginning at * imgp->args->begin_argv is the minimal successful exit requirement. @@ -98,20 +103,20 @@ exec_shell_imgact(imgp) const char *image_header = imgp->image_header; const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; int error, offset; - size_t length, clength; + size_t length; struct vattr vattr; struct sbuf *sname; /* a shell script? */ - if (((const short *) image_header)[0] != SHELLMAGIC) - return(-1); + if (((const short *)image_header)[0] != SHELLMAGIC) + return (-1); /* * Don't allow a shell script to be the shell for a shell * script. :-) */ if (imgp->interpreted) - return(ENOEXEC); + return (ENOEXEC); imgp->interpreted = 1; @@ -127,12 +132,9 @@ exec_shell_imgact(imgp) /* * Copy shell name and arguments from image_header into a string - * buffer. Remember that the caller has mapped only the - * first page of the file into memory. + * buffer. */ - clength = (vattr.va_size > PAGE_SIZE) ? PAGE_SIZE : vattr.va_size; - - maxp = &image_header[clength]; + maxp = &image_header[MIN(vattr.va_size, MAXSHELLCMDLEN)]; ihp = &image_header[2]; /* @@ -149,7 +151,7 @@ exec_shell_imgact(imgp) interpe = ihp; if (interpb == interpe) return (ENOEXEC); - if ((interpe - interpb) >= MAXSHELLCMDLEN) + if (interpe - interpb >= MAXINTERP) return (ENAMETOOLONG); /* @@ -163,6 +165,8 @@ exec_shell_imgact(imgp) while (ihp < maxp && ((*ihp != '\n') && (*ihp != '\0'))) ihp++; opte = ihp; + if (opte == maxp) + return (ENOEXEC); while (--ihp > optb && ((*ihp == ' ') || (*ihp == '\t'))) opte = ihp; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Sep 21 15:07:44 2010 (r212964) +++ head/sys/sys/param.h Tue Sep 21 16:24:51 2010 (r212965) @@ -73,7 +73,7 @@ #include #define MAXCOMLEN 19 /* max command name remembered */ -#define MAXINTERP 32 /* max interpreter file name length */ +#define MAXINTERP PATH_MAX /* max interpreter file name length */ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:31:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A46B1065672; Tue, 21 Sep 2010 16:31:05 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id ABD978FC17; Tue, 21 Sep 2010 16:31:04 +0000 (UTC) Received: by gxk8 with SMTP id 8so2122247gxk.13 for ; Tue, 21 Sep 2010 09:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=iQ5Nz+FkyG5J4py/5KlnYON7ZTqt/yIwCYaEH0KD0HU=; b=dwpUet8Xj2bCKgvN7ZMMFRCa5Q6xgPpgcw8KnE8OgTqs3AGuDPGeFkyuYPGt466NxU gSs8VQqkSvtMVHJpaq7As5/SkNieOoiGQdPojXfZKZKQlhmdIs1s/z7ty9og8IlIYJmn 0j0ueDcxm14rvlKKotMqvfPuuAjNQDqqat158= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=VYdz8sfQl2ca+WbujWNf52AV1omNWzQvqzyX57aEtBp7Eq/OwKvItZEqN/156+1QgJ ABIl2sEjzyXho/ulNGOBuMizwBUGxQ/HyP6ykc3vr2cUpSVPEkqzVmIuIp38JkwT18Zq GLT2fiBVRT6p22ED8OKvfk/VU2D7+Q07kodQ4= MIME-Version: 1.0 Received: by 10.90.95.14 with SMTP id s14mr6148150agb.161.1285086662059; Tue, 21 Sep 2010 09:31:02 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.187.71 with HTTP; Tue, 21 Sep 2010 09:31:01 -0700 (PDT) In-Reply-To: <4C98D200.4040909@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98CEE7.6060802@freebsd.org> <4C98D200.4040909@freebsd.org> Date: Tue, 21 Sep 2010 09:31:01 -0700 X-Google-Sender-Auth: wQNN5cZynoYNuE0IR25Aj5e-N44 Message-ID: From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:31:05 -0000 On Tue, Sep 21, 2010 at 8:40 AM, Andriy Gapon wrote: > on 21/09/2010 18:27 Andriy Gapon said the following: >> on 21/09/2010 18:17 mdf@FreeBSD.org said the following: >>> >>> I'd recommend using stack_print_ddb(), as that avoids any locking >>> which may hang depending on how the kernel panic'd. >> >> It seems that stack_print_ddb() depends on DDB? > > But the point about locking is very good. > How do you suggest we can deal with it? > > A dirty hack would be to check panicstr in linker_search_symbol_name and avoid > locking, but I don't like that at all. > Perhaps, some code in subr_stack.c could be taken outside DDB ifdef? I keep forgetting, but actually _mtx_lock_sleep() will just return if panicstr is set. _mtx_assert() is similarly guarded, so actually it should be mostly okay. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:36:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E66106566C; Tue, 21 Sep 2010 16:36:56 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 236BD8FC08; Tue, 21 Sep 2010 16:36:54 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA10746; Tue, 21 Sep 2010 19:36:53 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C98DF25.9040100@freebsd.org> Date: Tue, 21 Sep 2010 19:36:53 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: mdf@freebsd.org References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98CEE7.6060802@freebsd.org> <4C98D200.4040909@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:36:56 -0000 on 21/09/2010 19:31 mdf@FreeBSD.org said the following: > I keep forgetting, but actually _mtx_lock_sleep() will just return if > panicstr is set. _mtx_assert() is similarly guarded, so actually it > should be mostly okay. But this doesn't seem to be the case for sx lock which is wrapped under KLD_LOCK() ? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:39:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 450C8106566B; Tue, 21 Sep 2010 16:39:25 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id D27838FC18; Tue, 21 Sep 2010 16:39:24 +0000 (UTC) Received: by iwn34 with SMTP id 34so6290787iwn.13 for ; Tue, 21 Sep 2010 09:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=iS54kzfIqBUJsHBxBHUNE8PMibdZlpIJn7H+KMWpncc=; b=lij3ZEZH/lg/yKo4GJM4OJiYP5mIP4BgCk/SBzFyUOOfsrmABd3JrpB6NlBWZA+cP7 cPFrlBK9rSMBszObyWxxAKu3/O2N+AFFFIEpdocfKjQJ/PiyrejBp0p0h6txNmfKu3hL G7rA23cmqSciiQ9+I/i2VUkaJx+RJwH17L/qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=svfNcT03iegdHQKEG5gbl4C0Xljjy+vY1+DZz62rdwnDdj8PyZh2fbcSU/yJaWaDHB FRnNP3QA7oWivLJ7bcARxQLyZBL4wWTJNlGGfZfyRH891ioXMDbfnxKklOSgsFXqLF7i QHWZcG/hMVwOvqH1BGIUfPTNuoIGP6zqNx+Ns= MIME-Version: 1.0 Received: by 10.231.14.69 with SMTP id f5mr12171599iba.116.1285087164009; Tue, 21 Sep 2010 09:39:24 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.187.71 with HTTP; Tue, 21 Sep 2010 09:39:23 -0700 (PDT) In-Reply-To: <4C98DF25.9040100@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98CEE7.6060802@freebsd.org> <4C98D200.4040909@freebsd.org> <4C98DF25.9040100@freebsd.org> Date: Tue, 21 Sep 2010 09:39:23 -0700 X-Google-Sender-Auth: ZaQ2kyv0dIdaqyR_6NR_dbVx1gc Message-ID: From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:39:25 -0000 On Tue, Sep 21, 2010 at 9:36 AM, Andriy Gapon wrote: > on 21/09/2010 19:31 mdf@FreeBSD.org said the following: >> I keep forgetting, but actually _mtx_lock_sleep() will just return if >> panicstr is set. =A0_mtx_assert() is similarly guarded, so actually it >> should be mostly okay. > > But this doesn't seem to be the case for sx lock which is wrapped under K= LD_LOCK() ? Right, that was it. I knew I hit a problem on 7 in the past. The right thing is probably to guard the sx_[sx]lock_hard primitives and sx_assert in the same way. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:49:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38B331065670; Tue, 21 Sep 2010 16:49:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6D38FC22; Tue, 21 Sep 2010 16:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LGn3YF099972; Tue, 21 Sep 2010 16:49:03 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LGn2lE099969; Tue, 21 Sep 2010 16:49:02 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201009211649.o8LGn2lE099969@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 21 Sep 2010 16:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212966 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:49:03 -0000 Author: jh Date: Tue Sep 21 16:49:02 2010 New Revision: 212966 URL: http://svn.freebsd.org/changeset/base/212966 Log: Modify devfs_fqpn() for future use in devfs path reference counting code: - Accept devfs_mount and devfs_dirent as the arguments instead of a vnode. This generalizes the function so that it can be used from contexts where vnode references are not available. - Accept NULL cnp argument. No '/' will be appended, if a NULL cnp is provided. - Make the function global and add its prototype to devfs.h. Reviewed by: kib Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Tue Sep 21 16:24:51 2010 (r212965) +++ head/sys/fs/devfs/devfs.h Tue Sep 21 16:49:02 2010 (r212966) @@ -122,6 +122,8 @@ struct devfs_rule { MALLOC_DECLARE(M_DEVFS); #endif +struct componentname; + struct devfs_dirent { struct cdev_priv *de_cdp; int de_inode; @@ -178,6 +180,8 @@ void devfs_rules_cleanup (struct devfs_m int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td); int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, struct vnode **vpp); +char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, + struct componentname *); void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags); void devfs_dirent_free(struct devfs_dirent *de); void devfs_populate (struct devfs_mount *dm); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Sep 21 16:24:51 2010 (r212965) +++ head/sys/fs/devfs/devfs_vnops.c Tue Sep 21 16:49:02 2010 (r212966) @@ -299,29 +299,34 @@ finished: } /* - * Construct the fully qualified path name relative to the mountpoint + * Construct the fully qualified path name relative to the mountpoint. + * If a NULL cnp is provided, no '/' is appended to the resulting path. */ -static char * -devfs_fqpn(char *buf, struct vnode *dvp, struct componentname *cnp) +char * +devfs_fqpn(char *buf, struct devfs_mount *dmp, struct devfs_dirent *dd, + struct componentname *cnp) { int i; - struct devfs_dirent *de, *dd; - struct devfs_mount *dmp; + struct devfs_dirent *de; + + sx_assert(&dmp->dm_lock, SA_LOCKED); - dmp = VFSTODEVFS(dvp->v_mount); - dd = dvp->v_data; i = SPECNAMELEN; buf[i] = '\0'; - i -= cnp->cn_namelen; + if (cnp != NULL) + i -= cnp->cn_namelen; if (i < 0) return (NULL); - bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); + if (cnp != NULL) + bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); de = dd; while (de != dmp->dm_rootdir) { - i--; - if (i < 0) - return (NULL); - buf[i] = '/'; + if (cnp != NULL || i < SPECNAMELEN) { + i--; + if (i < 0) + return (NULL); + buf[i] = '/'; + } i -= de->de_dirent->d_namlen; if (i < 0) return (NULL); @@ -878,7 +883,7 @@ devfs_lookupx(struct vop_lookup_args *ap * OK, we didn't have an entry for the name we were asked for * so we try to see if anybody can create it on demand. */ - pname = devfs_fqpn(specname, dvp, cnp); + pname = devfs_fqpn(specname, dmp, dd, cnp); if (pname == NULL) break; From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:50:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3060D106564A; Tue, 21 Sep 2010 16:50:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FB198FC1C; Tue, 21 Sep 2010 16:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LGoPsp000145; Tue, 21 Sep 2010 16:50:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LGoP8R000143; Tue, 21 Sep 2010 16:50:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009211650.o8LGoP8R000143@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Sep 2010 16:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212967 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:50:25 -0000 Author: mav Date: Tue Sep 21 16:50:24 2010 New Revision: 212967 URL: http://svn.freebsd.org/changeset/base/212967 Log: Remember last kern.eventtimer.periodic value, explicitly set by user. If timer capabilities forcing us to change periodicity mode, try to restore it back later, as soon as new choosen timer capable to do it. Without this, timer change like HPET->RTC->HPET always results in enabling periodic mode. Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Sep 21 16:49:02 2010 (r212966) +++ head/sys/kern/kern_clocksource.c Tue Sep 21 16:50:24 2010 (r212967) @@ -117,7 +117,8 @@ SYSCTL_INT(_kern_eventtimer, OID_AUTO, i 0, "Run periodic events when idle"); static int periodic = 0; /* Periodic or one-shot mode. */ -TUNABLE_INT("kern.eventtimer.periodic", &periodic); +static int want_periodic = 0; /* What mode to prefer. */ +TUNABLE_INT("kern.eventtimer.periodic", &want_periodic); struct pcpu_state { struct mtx et_hw_mtx; /* Per-CPU timer mutex. */ @@ -587,6 +588,7 @@ cpu_initclocks_bsp(void) #ifdef SMP callout_new_inserted = cpu_new_callout; #endif + periodic = want_periodic; /* Grab requested timer or the best of present. */ if (timername[0]) timer = et_find(timername, 0, 0); @@ -841,6 +843,7 @@ sysctl_kern_eventtimer_timer(SYSCTL_HAND cpu_disable_deep_sleep++; if (timer->et_flags & ET_FLAGS_C3STOP) cpu_disable_deep_sleep--; + periodic = want_periodic; timer = et; et_init(timer, timercb, NULL, NULL); configtimer(1); @@ -865,7 +868,7 @@ sysctl_kern_eventtimer_periodic(SYSCTL_H return (error); ET_LOCK(); configtimer(0); - periodic = val; + periodic = want_periodic = val; configtimer(1); ET_UNLOCK(); return (error); From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:50:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F4E510657C3; Tue, 21 Sep 2010 16:50:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF7D38FC17; Tue, 21 Sep 2010 16:50:42 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 96B7246BA6; Tue, 21 Sep 2010 12:50:42 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 662518A04E; Tue, 21 Sep 2010 12:50:41 -0400 (EDT) From: John Baldwin To: mdf@freebsd.org Date: Tue, 21 Sep 2010 12:50:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D200.4040909@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009211250.40704.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 21 Sep 2010 12:50:41 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:50:43 -0000 On Tuesday, September 21, 2010 12:31:01 pm mdf@freebsd.org wrote: > On Tue, Sep 21, 2010 at 8:40 AM, Andriy Gapon wrote: > > on 21/09/2010 18:27 Andriy Gapon said the following: > >> on 21/09/2010 18:17 mdf@FreeBSD.org said the following: > >>> > >>> I'd recommend using stack_print_ddb(), as that avoids any locking > >>> which may hang depending on how the kernel panic'd. > >> > >> It seems that stack_print_ddb() depends on DDB? > > > > But the point about locking is very good. > > How do you suggest we can deal with it? > > > > A dirty hack would be to check panicstr in linker_search_symbol_name and avoid > > locking, but I don't like that at all. > > Perhaps, some code in subr_stack.c could be taken outside DDB ifdef? > > I keep forgetting, but actually _mtx_lock_sleep() will just return if > panicstr is set. _mtx_assert() is similarly guarded, so actually it > should be mostly okay. Err, I don't think _mtx_lock_sleep() is guarded in that fashion? I have an old patch to do that but have never committed it. If we want that we should probably change rwlocks and sxlocks to have also not block when panicstr is set. --- //depot/vendor/freebsd/src/sys/kern/kern_mutex.c 2010-05-11 18:31:25.000000000 0000 +++ //depot/projects/smpng/sys/kern/kern_mutex.c 2010-06-01 20:12:02.000000000 0000 @@ -348,6 +348,15 @@ return; } + /* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds the lock we need. + */ + if (panicstr != NULL && curthread->td_flags & TDF_INPANIC) + return; + lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime); if (LOCK_LOG_TEST(&m->lock_object, opts)) @@ -664,6 +673,15 @@ } /* + * If we failed to unlock this lock and we are a thread that has + * called panic(), it may be due to the bypass in _mtx_lock_sleep() + * above. In that case, just return and leave the lock alone to + * avoid changing the state. + */ + if (panicstr != NULL && curthread->td_flags & TDF_INPANIC) + return; + + /* * We have to lock the chain before the turnstile so this turnstile * can be removed from the hash list if it is empty. */ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 16:54:02 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D421065670; Tue, 21 Sep 2010 16:54:02 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 9941B8FC21; Tue, 21 Sep 2010 16:54:02 +0000 (UTC) Received: from [192.168.1.2] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o8LGs1qT029510; Tue, 21 Sep 2010 09:54:01 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C98E324.8090803@feral.com> Date: Tue, 21 Sep 2010 09:53:56 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D200.4040909@freebsd.org> <201009211250.40704.jhb@freebsd.org> In-Reply-To: <201009211250.40704.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Tue, 21 Sep 2010 09:54:01 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, mdf@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 16:54:02 -0000 > Err, I don't think _mtx_lock_sleep() is guarded in that fashion? I have an > old patch to do that but have never committed it. If we want that we should > probably change rwlocks and sxlocks to have also not block when panicstr is > set. Seems to me you are backing into interesting territory here- getting a bit more like Solaris. If you *do* do this, then you really *do* need to stop all other CPUs when you panic, or else it's likely you'll double panic more often than not. From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:02:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDB42106566C; Tue, 21 Sep 2010 17:02:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8B7888FC1A; Tue, 21 Sep 2010 17:02:23 +0000 (UTC) Received: by bwz15 with SMTP id 15so6775453bwz.13 for ; Tue, 21 Sep 2010 10:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=7IalIQiTB+SqEY6HGvk4q76XYswJ4k8qDvf9+528opQ=; b=CwhSt8h3QB3eAam15mzlb4iBKNpWBVXTsNk6GCBS2NA3xaIHOJdvMVRNF9Qq89K8r6 PMtXzons49JZOxIPz+1cTrlCcCAxEkJT9rrfjEk1Jy31BgM5h9sde40mzc9z3iHKGA56 4Qa1IjNSWabpJH1DL/k8cl8kxoVDPofjZELMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=LDMvcB0boK1l8wqpaMjvWzIoOcMhvBdP+tGjr6GkJ5lTr3L+hLxozs4LyTTTS/YfED dwX9FvToasljw4Lp52wZiNR1s4Enp+NkbHp+1fojwTLTUXL8FbU4JdgaJCct9LlcT4T9 raGvXAheqBCqusmN4g05GLmHC9DoM6jlThVQo= Received: by 10.204.175.77 with SMTP id w13mr7877705bkz.202.1285088543124; Tue, 21 Sep 2010 10:02:23 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id y19sm7764033bkw.18.2010.09.21.10.02.19 (version=SSLv3 cipher=RC4-MD5); Tue, 21 Sep 2010 10:02:21 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C98E514.7090107@FreeBSD.org> Date: Tue, 21 Sep 2010 20:02:12 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Matthew Jacob References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D200.4040909@freebsd.org> <201009211250.40704.jhb@freebsd.org> <4C98E324.8090803@feral.com> In-Reply-To: <4C98E324.8090803@feral.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: mdf@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:02:25 -0000 Matthew Jacob wrote: > >> Err, I don't think _mtx_lock_sleep() is guarded in that fashion? I >> have an >> old patch to do that but have never committed it. If we want that we >> should >> probably change rwlocks and sxlocks to have also not block when >> panicstr is >> set. > > Seems to me you are backing into interesting territory here- getting a > bit more like Solaris. > > If you *do* do this, then you really *do* need to stop all other CPUs > when you panic, or else it's likely you'll double panic more often than > not. May be it is not so bad idea to get more coherent memory snapshot? -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:05:12 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7891065670; Tue, 21 Sep 2010 17:05:12 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 62D0F8FC08; Tue, 21 Sep 2010 17:05:12 +0000 (UTC) Received: from [192.168.1.2] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o8LH5A99029608; Tue, 21 Sep 2010 10:05:10 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C98E5C1.70708@feral.com> Date: Tue, 21 Sep 2010 10:05:05 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Alexander Motin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D200.4040909@freebsd.org> <201009211250.40704.jhb@freebsd.org> <4C98E324.8090803@feral.com> <4C98E514.7090107@FreeBSD.org> In-Reply-To: <4C98E514.7090107@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Tue, 21 Sep 2010 10:05:11 -0700 (PDT) Cc: mdf@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:05:12 -0000 Absolutely. I have patches for RELENG_7, but have had trouble moving it to head. >> Seems to me you are backing into interesting territory here- getting a >> bit more like Solaris. >> >> If you *do* do this, then you really *do* need to stop all other CPUs >> when you panic, or else it's likely you'll double panic more often than >> not. > May be it is not so bad idea to get more coherent memory snapshot? > From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:25:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13CC3106566C; Tue, 21 Sep 2010 17:25:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 029E98FC08; Tue, 21 Sep 2010 17:25:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LHPFje001100; Tue, 21 Sep 2010 17:25:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LHPFvi001098; Tue, 21 Sep 2010 17:25:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009211725.o8LHPFvi001098@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 21 Sep 2010 17:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212968 - head/sys/dev/ae X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:25:16 -0000 Author: yongari Date: Tue Sep 21 17:25:15 2010 New Revision: 212968 URL: http://svn.freebsd.org/changeset/base/212968 Log: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Tue Sep 21 16:50:24 2010 (r212967) +++ head/sys/dev/ae/if_ae.c Tue Sep 21 17:25:15 2010 (r212968) @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc) AE_LOCK_ASSERT(sc); ifp = sc->ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return (0); mii = device_get_softc(sc->miibus); ae_stop(sc); @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT | AE_ISR_PHY_LINKDOWN)) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + AE_UNLOCK(sc); + return; } if ((val & AE_ISR_TX_EVENT) != 0) ae_tx_intr(sc); @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc) if_printf(ifp, "watchdog timeout - resetting.\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->tq, &sc->tx_task); @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, else if (ifp->if_mtu != ifr->ifr_mtu) { AE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + } AE_UNLOCK(sc); } break; From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:31:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E3DB106564A; Tue, 21 Sep 2010 17:31:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D62F8FC1D; Tue, 21 Sep 2010 17:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LHVEp7001265; Tue, 21 Sep 2010 17:31:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LHVEKT001263; Tue, 21 Sep 2010 17:31:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009211731.o8LHVEKT001263@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 21 Sep 2010 17:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212969 - head/sys/dev/et X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:31:15 -0000 Author: yongari Date: Tue Sep 21 17:31:14 2010 New Revision: 212969 URL: http://svn.freebsd.org/changeset/base/212969 Log: Make sure to clear IFF_DRV_RUNNING to reinitialize controller. While I'm here update if_oerrors counter when driver encounters watchdog timeout. Modified: head/sys/dev/et/if_et.c Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Sep 21 17:25:15 2010 (r212968) +++ head/sys/dev/et/if_et.c Tue Sep 21 17:31:14 2010 (r212969) @@ -1320,6 +1320,8 @@ et_watchdog(struct et_softc *sc) if_printf(sc->ifp, "watchdog timed out\n"); + sc->ifp->if_oerrors++; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; et_init_locked(sc); et_start_locked(sc->ifp); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:37:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249DD1065670; Tue, 21 Sep 2010 17:37:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13D4F8FC14; Tue, 21 Sep 2010 17:37:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LHbSVt001430; Tue, 21 Sep 2010 17:37:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LHbSbI001428; Tue, 21 Sep 2010 17:37:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009211737.o8LHbSbI001428@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Sep 2010 17:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212970 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:37:29 -0000 Author: mav Date: Tue Sep 21 17:37:28 2010 New Revision: 212970 URL: http://svn.freebsd.org/changeset/base/212970 Log: If new callout scheduled to another CPU and we are using global timer, there is high probability that timer is already programmed by some other CPU. Especially by one that registered this callout, and so active now. Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Sep 21 17:31:14 2010 (r212969) +++ head/sys/kern/kern_clocksource.c Tue Sep 21 17:37:28 2010 (r212970) @@ -785,14 +785,18 @@ cpu_new_callout(int cpu, int ticks) } /* * If timer is periodic - just update next event time for target CPU. + * If timer is global - there is chance it is already programmed. */ - if (periodic) { + if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) { state->nextevent = state->nexthard; tmp = hardperiod; bintime_mul(&tmp, ticks - 1); bintime_add(&state->nextevent, &tmp); - ET_HW_UNLOCK(state); - return; + if (periodic || + bintime_cmp(&state->nextevent, &nexttick, >=)) { + ET_HW_UNLOCK(state); + return; + } } /* * Otherwise we have to wake that CPU up, as we can't get present From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:38:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC38010656A5; Tue, 21 Sep 2010 17:38:41 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 58C5B8FC25; Tue, 21 Sep 2010 17:38:41 +0000 (UTC) Received: by iwn34 with SMTP id 34so6322645iwn.13 for ; Tue, 21 Sep 2010 10:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=U7S3vy8S9gEmALgq6XSFvWLqrgbz7/jwWLBHg1BElXo=; b=TWHszlaRkK7SpKr2ueMK3ImgnOga4BuoIPUbIrgRJZ3vNWUlhf+h72VlWnVpC2H2YD HHjJrkcbXS/Er3i76qq51KJ3JbEqN445Q7BxER/1G8ppoGJcKg+oj/0ufdzCTbtOLCqY pVh1UjVp1dh8cW+/KDBfS7v/3zftVqMmSHV3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=L/x2ko9UaxFYOSv2jH0PLmD5jk8Z3EJMGP12PdPoy2WxjDB6pHLplg8+XJraMI4otG Eg4fhVeFQUQpRLiuzd1l6ibsTaecThHLJJ7cNLQOEpp1zWedtwCHXvN+dngfafUzyyU0 nrtrSJBo0Ck6BAIgwDi5L7u8wIKtVTOXmPFxQ= MIME-Version: 1.0 Received: by 10.231.184.156 with SMTP id ck28mr10375567ibb.168.1285090716913; Tue, 21 Sep 2010 10:38:36 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.187.71 with HTTP; Tue, 21 Sep 2010 10:38:36 -0700 (PDT) In-Reply-To: <201009211250.40704.jhb@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C98D200.4040909@freebsd.org> <201009211250.40704.jhb@freebsd.org> Date: Tue, 21 Sep 2010 10:38:36 -0700 X-Google-Sender-Auth: faHs1tBdIilmf2hw9A8SvZ-h2AI Message-ID: From: mdf@FreeBSD.org To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:38:41 -0000 On Tue, Sep 21, 2010 at 9:50 AM, John Baldwin wrote: > On Tuesday, September 21, 2010 12:31:01 pm mdf@freebsd.org wrote: >> On Tue, Sep 21, 2010 at 8:40 AM, Andriy Gapon wrote: >> > on 21/09/2010 18:27 Andriy Gapon said the following: >> >> on 21/09/2010 18:17 mdf@FreeBSD.org said the following: >> >>> >> >>> I'd recommend using stack_print_ddb(), as that avoids any locking >> >>> which may hang depending on how the kernel panic'd. >> >> >> >> It seems that stack_print_ddb() depends on DDB? >> > >> > But the point about locking is very good. >> > How do you suggest we can deal with it? >> > >> > A dirty hack would be to check panicstr in linker_search_symbol_name a= nd avoid >> > locking, but I don't like that at all. >> > Perhaps, some code in subr_stack.c could be taken outside DDB ifdef? >> >> I keep forgetting, but actually _mtx_lock_sleep() will just return if >> panicstr is set. =A0_mtx_assert() is similarly guarded, so actually it >> should be mostly okay. > > Err, I don't think _mtx_lock_sleep() is guarded in that fashion? =A0I hav= e an > old patch to do that but have never committed it. =A0If we want that we s= hould > probably change rwlocks and sxlocks to have also not block when panicstr = is > set. D'oh! Once again I was looking at Isilon source but not CURRENT. We had patches for mtx (back on 6.1) and haven't updated them for sx/rw for 7. We're also running with local patches to stop CPUs in panic() that Mr Jacob has a copy of. Regarding the original issue, then, I think in the short term using a safe stack_print() would be the correct thing. Changing the locking and stop_cpus logic will not happen in the next week. :-) Thanks, matthew > > --- //depot/vendor/freebsd/src/sys/kern/kern_mutex.c =A0 =A02010-05-11 18= :31:25.000000000 0000 > +++ //depot/projects/smpng/sys/kern/kern_mutex.c =A0 =A0 =A0 =A02010-06-0= 1 20:12:02.000000000 0000 > @@ -348,6 +348,15 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; > =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* If we have already panic'd and this is the thread that= called > + =A0 =A0 =A0 =A0* panic(), then don't block on any mutexes but silently = succeed. > + =A0 =A0 =A0 =A0* Otherwise, the kernel will deadlock since the schedule= r isn't > + =A0 =A0 =A0 =A0* going to run the thread that holds the lock we need. > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 if (panicstr !=3D NULL && curthread->td_flags & TDF_INPANIC= ) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + > =A0 =A0 =A0 =A0lock_profile_obtain_lock_failed(&m->lock_object, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&contested, &waittime); > =A0 =A0 =A0 =A0if (LOCK_LOG_TEST(&m->lock_object, opts)) > @@ -664,6 +673,15 @@ > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0/* > + =A0 =A0 =A0 =A0* If we failed to unlock this lock and we are a thread t= hat has > + =A0 =A0 =A0 =A0* called panic(), it may be due to the bypass in _mtx_lo= ck_sleep() > + =A0 =A0 =A0 =A0* above. =A0In that case, just return and leave the lock= alone to > + =A0 =A0 =A0 =A0* avoid changing the state. > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 if (panicstr !=3D NULL && curthread->td_flags & TDF_INPANIC= ) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + > + =A0 =A0 =A0 /* > =A0 =A0 =A0 =A0 * We have to lock the chain before the turnstile so this = turnstile > =A0 =A0 =A0 =A0 * can be removed from the hash list if it is empty. > =A0 =A0 =A0 =A0 */ > > -- > John Baldwin > From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:42:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 909AB1065674; Tue, 21 Sep 2010 17:42:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FA578FC15; Tue, 21 Sep 2010 17:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LHgJAa001557; Tue, 21 Sep 2010 17:42:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LHgJCA001555; Tue, 21 Sep 2010 17:42:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009211742.o8LHgJCA001555@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 21 Sep 2010 17:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212971 - head/sys/dev/sf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:42:19 -0000 Author: yongari Date: Tue Sep 21 17:42:19 2010 New Revision: 212971 URL: http://svn.freebsd.org/changeset/base/212971 Log: Remove unnecessary controller reinitialization. StarFire controller does not require controller reinitialization to program perfect filters. While here, make driver immediately exit from interrupt/polling handler if driver reinitialized controller. PR: kern/87506 Modified: head/sys/dev/sf/if_sf.c Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Tue Sep 21 17:37:28 2010 (r212970) +++ head/sys/dev/sf/if_sf.c Tue Sep 21 17:42:19 2010 (r212971) @@ -1826,7 +1826,10 @@ sf_poll(struct ifnet *ifp, enum poll_cmd else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); + SF_UNLOCK(sc); + return (rx_npkts); } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1894,8 +1897,10 @@ sf_intr(void *arg) else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); - break; + SF_UNLOCK(sc); + return; } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1984,6 +1989,8 @@ sf_init_locked(struct sf_softc *sc) SF_LOCK_ASSERT(sc); ifp = sc->sf_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sf_miibus); sf_stop(sc); @@ -2547,6 +2554,7 @@ sf_watchdog(struct sf_softc *sc) if_printf(ifp, "watchdog timeout, %d Tx descs are active\n", sc->sf_cdata.sf_tx_cnt); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:48:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9A31065698; Tue, 21 Sep 2010 17:48:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF3B8FC24; Tue, 21 Sep 2010 17:48:34 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C3A5F46B60; Tue, 21 Sep 2010 13:48:33 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 973478A04E; Tue, 21 Sep 2010 13:48:32 -0400 (EDT) From: John Baldwin To: Matthew Jacob Date: Tue, 21 Sep 2010 13:47:28 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <201009211250.40704.jhb@freebsd.org> <4C98E324.8090803@feral.com> In-Reply-To: <4C98E324.8090803@feral.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009211347.28800.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 21 Sep 2010 13:48:32 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:48:34 -0000 On Tuesday, September 21, 2010 12:53:56 pm Matthew Jacob wrote: > > > Err, I don't think _mtx_lock_sleep() is guarded in that fashion? I have an > > old patch to do that but have never committed it. If we want that we should > > probably change rwlocks and sxlocks to have also not block when panicstr is > > set. > > Seems to me you are backing into interesting territory here- getting a > bit more like Solaris. > > If you *do* do this, then you really *do* need to stop all other CPUs > when you panic, or else it's likely you'll double panic more often than not. Yes, I don't dispute this. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:52:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77011106566C; Tue, 21 Sep 2010 17:52:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA638FC17; Tue, 21 Sep 2010 17:52:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LHqWeC001803; Tue, 21 Sep 2010 17:52:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LHqWVv001801; Tue, 21 Sep 2010 17:52:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009211752.o8LHqWVv001801@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 21 Sep 2010 17:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212972 - head/sys/dev/stge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:52:33 -0000 Author: yongari Date: Tue Sep 21 17:52:32 2010 New Revision: 212972 URL: http://svn.freebsd.org/changeset/base/212972 Log: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: head/sys/dev/stge/if_stge.c Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Tue Sep 21 17:42:19 2010 (r212971) +++ head/sys/dev/stge/if_stge.c Tue Sep 21 17:52:32 2010 (r212972) @@ -1377,6 +1377,7 @@ stge_watchdog(struct stge_softc *sc) ifp = sc->sc_ifp; if_printf(sc->sc_ifp, "device timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) stge_start_locked(ifp); @@ -1405,7 +1406,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; STGE_LOCK(sc); - stge_init_locked(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + stge_init_locked(sc); + } STGE_UNLOCK(sc); } break; @@ -1639,8 +1643,10 @@ stge_intr(void *arg) } force_init: - if (reinit != 0) + if (reinit != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + } /* Re-enable interrupts. */ CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable); @@ -1936,11 +1942,16 @@ stge_poll(struct ifnet *ifp, enum poll_c if ((status & IS_HostError) != 0) { device_printf(sc->sc_dev, "Host interface error, resetting...\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + break; } if ((status & IS_TxComplete) != 0) { - if (stge_tx_error(sc) != 0) + if (stge_tx_error(sc) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + break; + } } } @@ -2121,6 +2132,8 @@ stge_init_locked(struct stge_softc *sc) STGE_LOCK_ASSERT(sc); ifp = sc->sc_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sc_miibus); /* From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 17:59:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26651106567A; Tue, 21 Sep 2010 17:59:36 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id DF5358FC0A; Tue, 21 Sep 2010 17:59:35 +0000 (UTC) Received: from [192.168.1.2] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o8LHxYeG029954; Tue, 21 Sep 2010 10:59:34 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C98F281.2080806@feral.com> Date: Tue, 21 Sep 2010 10:59:29 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <201009211250.40704.jhb@freebsd.org> <4C98E324.8090803@feral.com> <201009211347.28800.jhb@freebsd.org> In-Reply-To: <201009211347.28800.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Tue, 21 Sep 2010 10:59:35 -0700 (PDT) Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 17:59:36 -0000 FWIW, I think that this would be a *good* thing. One of the problems with panic is that you can't really reset the state of the world, so most kernel services are not reliable. Unfortunately, mechanisms for preserving forensics for debug require some kernel services. >> Seems to me you are backing into interesting territory here- getting a >> bit more like Solaris. >> >> If you *do* do this, then you really *do* need to stop all other CPUs >> when you panic, or else it's likely you'll double panic more often than not. > Yes, I don't dispute this. > From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 19:01:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72DA11065672 for ; Tue, 21 Sep 2010 19:01:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 001138FC1F for ; Tue, 21 Sep 2010 19:01:03 +0000 (UTC) Received: (qmail 7879 invoked by uid 399); 21 Sep 2010 19:01:03 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 21 Sep 2010 19:01:03 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C9900EF.2090908@FreeBSD.org> Date: Tue, 21 Sep 2010 12:01:03 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Ed Schouten References: <201009210825.o8L8P0L0084859@svn.freebsd.org> In-Reply-To: <201009210825.o8L8P0L0084859@svn.freebsd.org> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 19:01:04 -0000 You forgot to bump .Dd On 9/21/2010 1:25 AM, Ed Schouten wrote: > Author: ed > Date: Tue Sep 21 08:25:00 2010 > New Revision: 212959 > URL: http://svn.freebsd.org/changeset/base/212959 > > Log: > Add a notice to the man page that batteries should be installed. > > Modified: > head/sbin/mount_unionfs/mount_unionfs.8 > > Modified: head/sbin/mount_unionfs/mount_unionfs.8 > ============================================================================== > --- head/sbin/mount_unionfs/mount_unionfs.8 Tue Sep 21 08:02:02 2010 (r212958) > +++ head/sbin/mount_unionfs/mount_unionfs.8 Tue Sep 21 08:25:00 2010 (r212959) > @@ -353,6 +353,7 @@ USE AT YOUR > OWN RISK. > BEWARE OF DOG. > SLIPPERY WHEN WET. > +BATTERIES NOT INCLUDED. > .Pp > This code also needs an owner in order to be less dangerous - serious > hackers can apply by sending mail to > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 19:12:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80EE1065695; Tue, 21 Sep 2010 19:12:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A75D08FC1D; Tue, 21 Sep 2010 19:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LJCMUd004210; Tue, 21 Sep 2010 19:12:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LJCM4t004208; Tue, 21 Sep 2010 19:12:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009211912.o8LJCM4t004208@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Sep 2010 19:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212974 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 19:12:22 -0000 Author: jhb Date: Tue Sep 21 19:12:22 2010 New Revision: 212974 URL: http://svn.freebsd.org/changeset/base/212974 Log: Comment nit, set TDF_NEEDRESCHED after the comment describing why it is done rather than before. MFC after: 1 week Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Sep 21 18:25:33 2010 (r212973) +++ head/sys/kern/sched_ule.c Tue Sep 21 19:12:22 2010 (r212974) @@ -2404,12 +2404,12 @@ sched_affinity(struct thread *td) } if (!TD_IS_RUNNING(td)) return; - td->td_flags |= TDF_NEEDRESCHED; /* * Force a switch before returning to userspace. If the * target thread is not running locally send an ipi to force * the issue. */ + td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) ipi_cpu(ts->ts_cpu, IPI_PREEMPT); #endif From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 20:23:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94618106566C; Tue, 21 Sep 2010 20:23:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8366F8FC0A; Tue, 21 Sep 2010 20:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LKNJD4005884; Tue, 21 Sep 2010 20:23:19 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LKNJI3005882; Tue, 21 Sep 2010 20:23:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009212023.o8LKNJI3005882@svn.freebsd.org> From: Rui Paulo Date: Tue, 21 Sep 2010 20:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212976 - head/lib/libc/i386/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 20:23:19 -0000 Author: rpaulo Date: Tue Sep 21 20:23:19 2010 New Revision: 212976 URL: http://svn.freebsd.org/changeset/base/212976 Log: Workaround LLVM bug #4434: Reorder inline assembly arguments temp2, temp, value and texp to follow the st(0), st(1), etc. style. Also mark the temp2 variable as volatile to workaround another clang bug. This allows clang to buildworld FreeBSD/i386. Submitted by: dim Modified: head/lib/libc/i386/gen/ldexp.c Modified: head/lib/libc/i386/gen/ldexp.c ============================================================================== --- head/lib/libc/i386/gen/ldexp.c Tue Sep 21 20:21:56 2010 (r212975) +++ head/lib/libc/i386/gen/ldexp.c Tue Sep 21 20:23:19 2010 (r212976) @@ -51,12 +51,16 @@ __FBSDID("$FreeBSD$"); double ldexp (double value, int exp) { - double temp, texp, temp2; + double temp, texp; +#ifdef __clang__ + volatile +#endif + double temp2; texp = exp; #ifdef __GNUC__ __asm ("fscale " - : "=u" (temp2), "=t" (temp) - : "0" (texp), "1" (value)); + : "=t" (temp), "=u" (temp2) + : "0" (value), "1" (texp)); #else #error unknown asm #endif From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 20:29:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64756106564A; Tue, 21 Sep 2010 20:29:57 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEAE8FC08; Tue, 21 Sep 2010 20:29:57 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id 4FEDC11B888; Tue, 21 Sep 2010 15:29:56 -0500 (CDT) Received: from 10.0.10.3 (221.163.108.93.rev.vodafone.pt [93.108.163.221]) by lavabit.com with ESMTP id PSNOMQEKKT72; Tue, 21 Sep 2010 15:29:56 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201009212023.o8LKNJI3005882@svn.freebsd.org> Date: Tue, 21 Sep 2010 21:29:53 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201009212023.o8LKNJI3005882@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212976 - head/lib/libc/i386/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 20:29:57 -0000 On 21 Sep 2010, at 21:23, Rui Paulo wrote: > Author: rpaulo > Date: Tue Sep 21 20:23:19 2010 > New Revision: 212976 > URL: http://svn.freebsd.org/changeset/base/212976 > > Log: > Workaround LLVM bug #4434: > > Reorder inline assembly arguments temp2, temp, value and texp to follow > the st(0), st(1), etc. style. > Also mark the temp2 variable as volatile to workaround another clang > bug. > This allows clang to buildworld FreeBSD/i386. There's no binary change when using gcc. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 21:07:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C507B1065672; Tue, 21 Sep 2010 21:07:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3D0E8FC0C; Tue, 21 Sep 2010 21:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LL7kju006977; Tue, 21 Sep 2010 21:07:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LL7kRr006975; Tue, 21 Sep 2010 21:07:46 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201009212107.o8LL7kRr006975@svn.freebsd.org> From: Christian Brueffer Date: Tue, 21 Sep 2010 21:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212978 - head/cddl/usr.sbin/plockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 21:07:46 -0000 Author: brueffer Date: Tue Sep 21 21:07:46 2010 New Revision: 212978 URL: http://svn.freebsd.org/changeset/base/212978 Log: Minor grammar fixes. Modified: head/cddl/usr.sbin/plockstat/plockstat.1 Modified: head/cddl/usr.sbin/plockstat/plockstat.1 ============================================================================== --- head/cddl/usr.sbin/plockstat/plockstat.1 Tue Sep 21 20:51:40 2010 (r212977) +++ head/cddl/usr.sbin/plockstat/plockstat.1 Tue Sep 21 21:07:46 2010 (r212978) @@ -68,7 +68,7 @@ Print all statistics. .It Fl C Print commulative statistics (the default). .It Fl H -Print an histogram. +Print a histogram. .It Fl V Print the DTrace script about to be used to stderr. .It Fl n Ar count @@ -91,5 +91,5 @@ man page for more details. .Sh HISTORY The .Nm -utility comes from the OpenSolaris and was first imported into +utility comes from OpenSolaris and was first imported into .Fx 9.0 . From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 21:41:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1541065670; Tue, 21 Sep 2010 21:41:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53038FC0A; Tue, 21 Sep 2010 21:41:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LLfjsZ007650; Tue, 21 Sep 2010 21:41:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LLfjHX007646; Tue, 21 Sep 2010 21:41:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201009212141.o8LLfjHX007646@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Sep 2010 21:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212979 - in head: gnu/lib/libobjc sys/boot/i386/boot2 sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 21:41:46 -0000 Author: dim Date: Tue Sep 21 21:41:45 2010 New Revision: 212979 URL: http://svn.freebsd.org/changeset/base/212979 Log: When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2 and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile flags are sometimes passed via this variable, for example during the build32 stage on amd64. This caused the 32-bit libobjc build on amd64 to fail. Instead, only replace the first instance of clang (if any, including optional path) with gcc, and leave the arguments alone. Approved-by: rpaulo (mentor) Modified: head/gnu/lib/libobjc/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/pc98/boot2/Makefile Modified: head/gnu/lib/libobjc/Makefile ============================================================================== --- head/gnu/lib/libobjc/Makefile Tue Sep 21 21:07:46 2010 (r212978) +++ head/gnu/lib/libobjc/Makefile Tue Sep 21 21:41:45 2010 (r212979) @@ -16,9 +16,7 @@ SRCS= archive.c class.c encoding.c gc.c selector.c sendmsg.c thr.c thr-objc.c exception.c # XXX: clang cannot compile libobjc yet -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} INCS= encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \ sarray.h thr.h typedstream.h NXConstStr.h Object.h Protocol.h Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Sep 21 21:07:46 2010 (r212978) +++ head/sys/boot/i386/boot2/Makefile Tue Sep 21 21:41:45 2010 (r212979) @@ -3,9 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Tue Sep 21 21:07:46 2010 (r212978) +++ head/sys/boot/pc98/boot2/Makefile Tue Sep 21 21:41:45 2010 (r212979) @@ -3,9 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -.if ${CC:T:Mclang} == "clang" -CC=gcc -.endif +CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 From owner-svn-src-head@FreeBSD.ORG Tue Sep 21 22:42:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A121065673; Tue, 21 Sep 2010 22:42:14 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB9A48FC1B; Tue, 21 Sep 2010 22:42:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8LMgE0K008919; Tue, 21 Sep 2010 22:42:14 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8LMgEha008915; Tue, 21 Sep 2010 22:42:14 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201009212242.o8LMgEha008915@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Tue, 21 Sep 2010 22:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212980 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 22:42:14 -0000 Author: sanpei Date: Tue Sep 21 22:42:14 2010 New Revision: 212980 URL: http://svn.freebsd.org/changeset/base/212980 Log: Add new device ids. Buffalo (Melco Inc.) LUA3-U2-AGT Logitec LAN-GTJ/U2A(usb/119981) PR: usb/119981 and me Submitted by: "Y.Okabe" , hiroo at oikumene.gcd.org Reviewed by: thompsa MFC after: 3 days Modified: head/share/man/man4/axe.4 head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/axe.4 ============================================================================== --- head/share/man/man4/axe.4 Tue Sep 21 21:41:45 2010 (r212979) +++ head/share/man/man4/axe.4 Tue Sep 21 22:42:14 2010 (r212980) @@ -169,6 +169,10 @@ AX88178: .It Belkin F5D5055 .It +Logitec LAN-GTJ/U2A +.It +Buffalo (Melco Inc.) LUA3-U2-AGT +.It Planex Communications GU1000T .It Sitecom Europe LN-028 Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Tue Sep 21 21:41:45 2010 (r212979) +++ head/sys/dev/usb/net/if_axe.c Tue Sep 21 22:42:14 2010 (r212980) @@ -155,7 +155,9 @@ static const struct usb_device_id axe_de AXE_DEV(JVC, MP_PRX1, 0), AXE_DEV(LINKSYS2, USB200M, 0), AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178), + AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178), AXE_DEV(MELCO, LUAU2KTX, 0), + AXE_DEV(MELCO, LUA3U2AGT, AXE_FLAG_178), AXE_DEV(NETGEAR, FA120, 0), AXE_DEV(OQO, ETHER01PLUS, AXE_FLAG_772), AXE_DEV(PLANEX3, GU1000T, AXE_FLAG_178), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 21 21:41:45 2010 (r212979) +++ head/sys/dev/usb/usbdevs Tue Sep 21 22:42:14 2010 (r212980) @@ -2063,6 +2063,7 @@ product LOGITECH QUICKCAMPRO2 0xd001 Qui /* Logitec Corp. products */ product LOGITEC LDR_H443SU2 0x0033 DVD Multi-plus unit LDR-H443SU2 product LOGITEC LDR_H443U2 0x00b3 DVD Multi-plus unit LDR-H443U2 +product LOGITEC LAN_GTJU2A 0x0160 LAN-GTJ/U2A Ethernet product LOGITEC RT2870_1 0x0162 RT2870 product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 @@ -2101,6 +2102,7 @@ product MELCO LUAU2KTX 0x003d LUA-U2-KT product MELCO KG54YB 0x005e WLI-U2-KG54-YB WLAN product MELCO KG54 0x0066 WLI-U2-KG54 WLAN product MELCO KG54AI 0x0067 WLI-U2-KG54-AI WLAN +product MELCO LUA3U2AGT 0x006e LUA3-U2-AGT product MELCO NINWIFI 0x008b Nintendo Wi-Fi product MELCO PCOPRS1 0x00b3 PC-OP-RS1 RemoteStation product MELCO SG54HP 0x00d8 WLI-U2-SG54HP From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 02:14:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 586341065670; Wed, 22 Sep 2010 02:14:24 +0000 (UTC) Date: Wed, 22 Sep 2010 02:14:24 +0000 From: Alexey Dokuchaev To: Doug Barton Message-ID: <20100922021424.GA44486@FreeBSD.org> References: <201009210825.o8L8P0L0084859@svn.freebsd.org> <4C9900EF.2090908@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4C9900EF.2090908@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 02:14:24 -0000 On Tue, Sep 21, 2010 at 12:01:03PM -0700, Doug Barton wrote: > You forgot to bump .Dd I thought it is required when manpages undergoes substantial or at least functional changes. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 02:16:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32CAA1065670 for ; Wed, 22 Sep 2010 02:16:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id AF7F58FC16 for ; Wed, 22 Sep 2010 02:16:28 +0000 (UTC) Received: (qmail 8578 invoked by uid 399); 22 Sep 2010 02:16:27 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Sep 2010 02:16:27 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C9966FC.8030406@FreeBSD.org> Date: Tue, 21 Sep 2010 19:16:28 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Alexey Dokuchaev References: <201009210825.o8L8P0L0084859@svn.freebsd.org> <4C9900EF.2090908@FreeBSD.org> <20100922021424.GA44486@FreeBSD.org> In-Reply-To: <20100922021424.GA44486@FreeBSD.org> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 02:16:29 -0000 On 9/21/2010 7:14 PM, Alexey Dokuchaev wrote: > On Tue, Sep 21, 2010 at 12:01:03PM -0700, Doug Barton wrote: >> You forgot to bump .Dd > > I thought it is required when manpages undergoes substantial or at least > functional changes. Seriously? You people are so humor-deficient that you didn't recognize that as a joke without me putting a smiley on it? Or maybe I'm the one who's missing a joke here .... Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 02:19:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BBE7106564A; Wed, 22 Sep 2010 02:19:40 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6758FC15; Wed, 22 Sep 2010 02:19:40 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o8M2JdUY085461; Tue, 21 Sep 2010 19:19:39 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o8M2Jd51085460; Tue, 21 Sep 2010 19:19:39 -0700 (PDT) (envelope-from sgk) Date: Tue, 21 Sep 2010 19:19:39 -0700 From: Steve Kargl To: Doug Barton Message-ID: <20100922021939.GA85446@troutmask.apl.washington.edu> References: <201009210825.o8L8P0L0084859@svn.freebsd.org> <4C9900EF.2090908@FreeBSD.org> <20100922021424.GA44486@FreeBSD.org> <4C9966FC.8030406@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C9966FC.8030406@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, Ed Schouten , svn-src-all@freebsd.org Subject: Re: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 02:19:40 -0000 On Tue, Sep 21, 2010 at 07:16:28PM -0700, Doug Barton wrote: > On 9/21/2010 7:14 PM, Alexey Dokuchaev wrote: > >On Tue, Sep 21, 2010 at 12:01:03PM -0700, Doug Barton wrote: > >>You forgot to bump .Dd > > > >I thought it is required when manpages undergoes substantial or at least > >functional changes. > > Seriously? You people are so humor-deficient that you didn't recognize > that as a joke without me putting a smiley on it? Or maybe I'm the one > who's missing a joke here .... > Perhaps, you should review your last month or so of posts to list. Note no smiley! -- Steve From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 02:26:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ED611065670; Wed, 22 Sep 2010 02:26:07 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 735EA8FC16; Wed, 22 Sep 2010 02:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M2Q77V013718; Wed, 22 Sep 2010 02:26:07 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M2Q789013713; Wed, 22 Sep 2010 02:26:07 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009220226.o8M2Q789013713@svn.freebsd.org> From: Neel Natu Date: Wed, 22 Sep 2010 02:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212989 - in head/sys/mips: include mips sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 02:26:07 -0000 Author: neel Date: Wed Sep 22 02:26:07 2010 New Revision: 212989 URL: http://svn.freebsd.org/changeset/base/212989 Log: Enforce that 'pmap_kenter()' is only used to establish cacheable mappings. Mappings with other cacheability attributes can be established, if needed, by using 'pmap_kenter_attr()'. Suggested by: jchandra, imp Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Wed Sep 22 01:39:55 2010 (r212988) +++ head/sys/mips/include/pmap.h Wed Sep 22 02:26:07 2010 (r212989) @@ -154,6 +154,7 @@ void pmap_unmapdev(vm_offset_t, vm_size_ vm_offset_t pmap_steal_memory(vm_size_t size); int page_is_managed(vm_offset_t pa); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Sep 22 01:39:55 2010 (r212988) +++ head/sys/mips/mips/pmap.c Wed Sep 22 02:26:07 2010 (r212989) @@ -828,7 +828,7 @@ retry: /* * add a wired page to the kva */ -static void +void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) { pt_entry_t *pte; @@ -849,14 +849,11 @@ pmap_kenter_attr(vm_offset_t va, vm_padd void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { - int attr; - if (is_cacheable_mem(pa)) - attr = PTE_C_CACHE; - else - attr = PTE_C_UNCACHED; + KASSERT(is_cacheable_mem(pa), + ("pmap_kenter: memory at 0x%lx is not cacheable", (u_long)pa)); - pmap_kenter_attr(va, pa, attr); + pmap_kenter_attr(va, pa, PTE_C_CACHE); } /* Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Wed Sep 22 01:39:55 2010 (r212988) +++ head/sys/mips/sibyte/sb_zbpci.c Wed Sep 22 02:26:07 2010 (r212989) @@ -349,7 +349,7 @@ zbpci_config_space_va(int bus, int slot, pa_page = pa & ~(PAGE_SIZE - 1); if (zbpci_config_space[cpu].paddr != pa_page) { pmap_kremove(va_page); - pmap_kenter(va_page, pa_page); + pmap_kenter_attr(va_page, pa_page, PTE_C_UNCACHED); zbpci_config_space[cpu].paddr = pa_page; } return (va_page + (pa - pa_page)); From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 02:35:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE31B1065670 for ; Wed, 22 Sep 2010 02:35:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4746D8FC1B for ; Wed, 22 Sep 2010 02:35:55 +0000 (UTC) Received: (qmail 31820 invoked by uid 399); 22 Sep 2010 02:35:55 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Sep 2010 02:35:55 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C996B8B.4@FreeBSD.org> Date: Tue, 21 Sep 2010 19:35:55 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Steve Kargl References: <201009210825.o8L8P0L0084859@svn.freebsd.org> <4C9900EF.2090908@FreeBSD.org> <20100922021424.GA44486@FreeBSD.org> <4C9966FC.8030406@FreeBSD.org> <20100922021939.GA85446@troutmask.apl.washington.edu> In-Reply-To: <20100922021939.GA85446@troutmask.apl.washington.edu> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, Ed Schouten , svn-src-all@freebsd.org Subject: Re: svn commit: r212959 - head/sbin/mount_unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 02:35:56 -0000 On 9/21/2010 7:19 PM, Steve Kargl wrote: > On Tue, Sep 21, 2010 at 07:16:28PM -0700, Doug Barton wrote: >> On 9/21/2010 7:14 PM, Alexey Dokuchaev wrote: >>> On Tue, Sep 21, 2010 at 12:01:03PM -0700, Doug Barton wrote: >>>> You forgot to bump .Dd >>> >>> I thought it is required when manpages undergoes substantial or at least >>> functional changes. >> >> Seriously? You people are so humor-deficient that you didn't recognize >> that as a joke without me putting a smiley on it? Or maybe I'm the one >> who's missing a joke here .... >> > > Perhaps, you should review your last month or so of posts > to list. Note no smiley! Yeah, had that discussion already, apologized for the behavior that I actually agreed was over the top, now time to move on. :) :) :) Doug :) :) :) -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 04:48:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F71B1065672; Wed, 22 Sep 2010 04:48:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F32B28FC19; Wed, 22 Sep 2010 04:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M4mdxn016740; Wed, 22 Sep 2010 04:48:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M4mdXs016738; Wed, 22 Sep 2010 04:48:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009220448.o8M4mdXs016738@svn.freebsd.org> From: Warner Losh Date: Wed, 22 Sep 2010 04:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212990 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 04:48:40 -0000 Author: imp Date: Wed Sep 22 04:48:39 2010 New Revision: 212990 URL: http://svn.freebsd.org/changeset/base/212990 Log: Make the labels match the device name that's mounted, not just the slice they are on. When NANO_LABEL is not defined, the fstab generates entries that specify /dev/ad0s1a. When NANO_LABEL is defined, it generates /dev/usb/${NANO_LABEL}s1a. The prior code created the file system with a label of ${NANO_LABEL}s1, leading to problems on boot. Pointy hat to: imp@ Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Wed Sep 22 02:26:07 2010 (r212989) +++ head/tools/tools/nanobsd/nanobsd.sh Wed Sep 22 04:48:39 2010 (r212990) @@ -501,7 +501,7 @@ create_i386_diskimage ( ) ( bsdlabel ${MD}s1 # Create first image - populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1" + populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1a" mount /dev/${MD}s1a ${MNT} echo "Generating mtree..." ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree @@ -518,8 +518,10 @@ create_i386_diskimage ( ) ( sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f done umount ${MNT} + # Override the label from the first partition so we + # don't confuse glabel with duplicates. if [ ! -z ${NANO_LABEL} ]; then - tunefs -L ${NANO_LABEL}"s2" /dev/${MD}s2a + tunefs -L ${NANO_LABEL}"s2a" /dev/${MD}s2a fi fi From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 05:17:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58B7E106566C; Wed, 22 Sep 2010 05:17:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487D38FC18; Wed, 22 Sep 2010 05:17:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M5HJ8v017363; Wed, 22 Sep 2010 05:17:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M5HJHn017361; Wed, 22 Sep 2010 05:17:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009220517.o8M5HJHn017361@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Sep 2010 05:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212991 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 05:17:19 -0000 Author: mav Date: Wed Sep 22 05:17:18 2010 New Revision: 212991 URL: http://svn.freebsd.org/changeset/base/212991 Log: Decrease poll interval from 1000 to 100us. This significantly reduces kernel dump time, especially with minidump. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Sep 22 04:48:39 2010 (r212990) +++ head/sys/cam/cam_xpt.c Wed Sep 22 05:17:18 2010 (r212991) @@ -2914,7 +2914,7 @@ xpt_polled_action(union ccb *start_ccb) struct cam_ed *dev; - timeout = start_ccb->ccb_h.timeout; + timeout = start_ccb->ccb_h.timeout * 10; sim = start_ccb->ccb_h.path->bus->sim; devq = sim->devq; dev = start_ccb->ccb_h.path->device; @@ -2930,7 +2930,7 @@ xpt_polled_action(union ccb *start_ccb) while(((devq != NULL && devq->send_openings <= 0) || dev->ccbq.dev_openings < 0) && (--timeout > 0)) { - DELAY(1000); + DELAY(100); (*(sim->sim_poll))(sim); camisr_runqueue(&sim->sim_doneq); } @@ -2946,7 +2946,7 @@ xpt_polled_action(union ccb *start_ccb) if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; - DELAY(1000); + DELAY(100); } if (timeout == 0) { /* From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 05:32:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0841106566C; Wed, 22 Sep 2010 05:32:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D075E8FC19; Wed, 22 Sep 2010 05:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M5Wbbq017694; Wed, 22 Sep 2010 05:32:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M5WbGb017692; Wed, 22 Sep 2010 05:32:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009220532.o8M5WbGb017692@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Sep 2010 05:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212992 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 05:32:38 -0000 Author: mav Date: Wed Sep 22 05:32:37 2010 New Revision: 212992 URL: http://svn.freebsd.org/changeset/base/212992 Log: If kernel built with DEVICE_POLLING, keep one CPU always in active state to handle it. Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Wed Sep 22 05:17:18 2010 (r212991) +++ head/sys/kern/kern_clocksource.c Wed Sep 22 05:32:37 2010 (r212992) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); /* XEN has own timer routines now. */ #ifndef XEN +#include "opt_device_polling.h" #include "opt_kdtrace.h" #include @@ -721,7 +722,11 @@ cpu_idleclock(void) struct pcpu_state *state; if (idletick || busy || - (periodic && (timer->et_flags & ET_FLAGS_PERCPU))) + (periodic && (timer->et_flags & ET_FLAGS_PERCPU)) +#ifdef DEVICE_POLLING + || curcpu == CPU_FIRST() +#endif + ) return; state = DPCPU_PTR(timerstate); if (periodic) From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 06:10:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78BA51065672; Wed, 22 Sep 2010 06:10:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E3508FC0C; Wed, 22 Sep 2010 06:10:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M6AMwT018457; Wed, 22 Sep 2010 06:10:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M6AMYs018455; Wed, 22 Sep 2010 06:10:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009220610.o8M6AMYs018455@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Sep 2010 06:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212993 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 06:10:22 -0000 Author: avg Date: Wed Sep 22 06:10:22 2010 New Revision: 212993 URL: http://svn.freebsd.org/changeset/base/212993 Log: acpi_attach: do not explicitly install default handlers for default address spaces There has been no need to do that starting with ACPICA 20040427 as AcpiEnableSubsystem() installs the handlers automatically. Additionaly, explicitly calling AcpiInstallAddressSpaceHandler before AcpiEnableSubsystem is not supported by ACPICA and leads to too early execution of _REG methods in some DSDTs, which may result in problems. Big thanks to Robert Moore of ACPICA/Intel for explaining the above. Reported by: Daniel Bilik Tested by: Daniel Bilik Reviewed by: jkim Suggested by: "Moore, Robert" MFC after: 1 week Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Sep 22 05:32:37 2010 (r212992) +++ head/sys/dev/acpica/acpi.c Wed Sep 22 06:10:22 2010 (r212993) @@ -494,29 +494,6 @@ acpi_attach(device_t dev) acpi_enable_pcie(); #endif - /* Install the default address space handlers. */ - status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT, - ACPI_ADR_SPACE_SYSTEM_MEMORY, ACPI_DEFAULT_HANDLER, NULL, NULL); - if (ACPI_FAILURE(status)) { - device_printf(dev, "Could not initialise SystemMemory handler: %s\n", - AcpiFormatException(status)); - goto out; - } - status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT, - ACPI_ADR_SPACE_SYSTEM_IO, ACPI_DEFAULT_HANDLER, NULL, NULL); - if (ACPI_FAILURE(status)) { - device_printf(dev, "Could not initialise SystemIO handler: %s\n", - AcpiFormatException(status)); - goto out; - } - status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT, - ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); - if (ACPI_FAILURE(status)) { - device_printf(dev, "could not initialise PciConfig handler: %s\n", - AcpiFormatException(status)); - goto out; - } - /* * Note that some systems (specifically, those with namespace evaluation * issues that require the avoidance of parts of the namespace) must From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 06:45:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20FB6106566C; Wed, 22 Sep 2010 06:45:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10A618FC13; Wed, 22 Sep 2010 06:45:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8M6j7Ai019196; Wed, 22 Sep 2010 06:45:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8M6j70m019192; Wed, 22 Sep 2010 06:45:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009220645.o8M6j70m019192@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Sep 2010 06:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212994 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 06:45:08 -0000 Author: avg Date: Wed Sep 22 06:45:07 2010 New Revision: 212994 URL: http://svn.freebsd.org/changeset/base/212994 Log: kdb_backtrace: use stack_print_ddb instead of stack_print This is a followup to r212964. stack_print call chain obtains linker sx lock and thus potentially may lead to a deadlock depending on a kind of a panic. stack_print_ddb doesn't acquire any locks and it doesn't use any facilities of ddb backend. Using stack_print_ddb outside of DDB ifdef required taking a number of helper functions from under it as well. It is a good idea to rename linker_ddb_* and stack_*_ddb functions to have 'unlocked' component in their name instead of 'ddb', because those functions do not use any DDB services, but instead they provide unlocked access to linker symbol information. The latter was previously needed only for DDB, hence the 'ddb' name component. Alternative is to ditch unlocked versions altogether after implementing proper panic handling: 1. stop other cpus upon a panic 2. make all non-spinlock lock operations (mutex, sx, rwlock) be a no-op when panicstr != NULL Suggested by: mdf Discussed with: attilio MFC after: 2 weeks Modified: head/sys/kern/kern_linker.c head/sys/kern/subr_kdb.c head/sys/kern/subr_stack.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Sep 22 06:10:22 2010 (r212993) +++ head/sys/kern/kern_linker.c Wed Sep 22 06:45:07 2010 (r212994) @@ -924,7 +924,6 @@ linker_debug_search_symbol_name(caddr_t return (0); } -#ifdef DDB /* * DDB Helpers. DDB has to look across multiple files with their own symbol * tables and string tables. @@ -933,12 +932,14 @@ linker_debug_search_symbol_name(caddr_t * DDB to hang because somebody's got the lock held. We'll take the chance * that the files list is inconsistant instead. */ +#ifdef DDB int linker_ddb_lookup(const char *symstr, c_linker_sym_t *sym) { return (linker_debug_lookup(symstr, sym)); } +#endif int linker_ddb_search_symbol(caddr_t value, c_linker_sym_t *sym, long *diffp) @@ -961,7 +962,6 @@ linker_ddb_search_symbol_name(caddr_t va return (linker_debug_search_symbol_name(value, buf, buflen, offset)); } -#endif /* * stack(9) helper for non-debugging environemnts. Unlike DDB helpers, we do Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Wed Sep 22 06:10:22 2010 (r212993) +++ head/sys/kern/subr_kdb.c Wed Sep 22 06:45:07 2010 (r212994) @@ -308,7 +308,7 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); stack_save(&st); - stack_print(&st); + stack_print_ddb(&st); } #endif } Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Wed Sep 22 06:10:22 2010 (r212993) +++ head/sys/kern/subr_stack.c Wed Sep 22 06:45:07 2010 (r212994) @@ -44,9 +44,7 @@ static MALLOC_DEFINE(M_STACK, "stack", " static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset); -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); -#endif struct stack * stack_create(void) @@ -125,7 +123,6 @@ stack_print_short(struct stack *st) printf("\n"); } -#ifdef DDB void stack_print_ddb(struct stack *st) { @@ -141,6 +138,7 @@ stack_print_ddb(struct stack *st) } } +#ifdef DDB void stack_print_short_ddb(struct stack *st) { @@ -255,7 +253,6 @@ stack_symbol(vm_offset_t pc, char *nameb return (0); } -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset) { @@ -275,4 +272,3 @@ stack_symbol_ddb(vm_offset_t pc, const c *name = "??"; return (ENOENT); } -#endif From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 11:32:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 803E31065670; Wed, 22 Sep 2010 11:32:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB098FC0C; Wed, 22 Sep 2010 11:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MBWMn7029535; Wed, 22 Sep 2010 11:32:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MBWMru029533; Wed, 22 Sep 2010 11:32:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009221132.o8MBWMru029533@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Sep 2010 11:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212997 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 11:32:22 -0000 Author: mav Date: Wed Sep 22 11:32:22 2010 New Revision: 212997 URL: http://svn.freebsd.org/changeset/base/212997 Log: Quick fix for unmotivated C2 state usage during boot, introduced at r212541. That caused LAPIC timer failure and huge delays during boot on some systems. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Sep 22 10:55:33 2010 (r212996) +++ head/sys/dev/acpica/acpi_cpu.c Wed Sep 22 11:32:22 2010 (r212997) @@ -894,7 +894,7 @@ acpi_cpu_idle() cx_next_idx = 0; #ifndef __ia64__ if (cpu_disable_deep_sleep) - i = sc->cpu_non_c3; + i = min(sc->cpu_cx_lowest, sc->cpu_non_c3); else #endif i = sc->cpu_cx_lowest; From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 12:52:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B311065670; Wed, 22 Sep 2010 12:52:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2B198FC1B; Wed, 22 Sep 2010 12:52:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MCqCB7031145; Wed, 22 Sep 2010 12:52:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MCqCcw031143; Wed, 22 Sep 2010 12:52:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009221252.o8MCqCcw031143@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Sep 2010 12:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212998 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 12:52:13 -0000 Author: kib Date: Wed Sep 22 12:52:12 2010 New Revision: 212998 URL: http://svn.freebsd.org/changeset/base/212998 Log: For sparc64 relocations that directly put bits of the symbol value into the location, apply elf_relocaddr to the symbol value to have right values for the symbols from dpcpu segment. PR: kern/147769 Discussed with: avg Tested by: marius MFC after: 2 weeks Modified: head/sys/sparc64/sparc64/elf_machdep.c Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Wed Sep 22 11:32:22 2010 (r212997) +++ head/sys/sparc64/sparc64/elf_machdep.c Wed Sep 22 12:52:12 2010 (r212998) @@ -155,6 +155,7 @@ elf64_dump_thread(struct thread *td __un #define _RF_G 0x10000000 /* GOT offset */ #define _RF_B 0x08000000 /* Load address relative */ #define _RF_U 0x04000000 /* Unaligned */ +#define _RF_X 0x02000000 /* Bare symbols, needs proc */ #define _RF_SZ(s) (((s) & 0xff) << 8) /* memory target size */ #define _RF_RS(s) ( (s) & 0xff) /* right shift */ static const int reloc_target_flags[] = { @@ -167,10 +168,10 @@ static const int reloc_target_flags[] = _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* DISP_32 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP_30 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP_22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* HI22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 13 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* LO10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* HI22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 13 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* LO10 */ _RF_G| _RF_SZ(32) | _RF_RS(0), /* GOT10 */ _RF_G| _RF_SZ(32) | _RF_RS(0), /* GOT13 */ _RF_G| _RF_SZ(32) | _RF_RS(10), /* GOT22 */ @@ -189,29 +190,29 @@ static const int reloc_target_flags[] = _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* PCPLT32 */ _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(10), /* PCPLT22 */ _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* PCPLT10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 11 */ - _RF_S|_RF_A| _RF_SZ(64) | _RF_RS(0), /* 64 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 11 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(64) | _RF_RS(0), /* 64 */ _RF_S|_RF_A|/*extra*/ _RF_SZ(32) | _RF_RS(0), /* OLO10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(42), /* HH22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(32), /* HM10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* LM22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(42), /* HH22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(32), /* HM10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* LM22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(42), /* PC_HH22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(32), /* PC_HM10 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(10), /* PC_LM22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP16 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP19 */ _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* GLOB_JMP */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 7 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 5 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 6 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 7 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 5 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 6 */ _RF_S|_RF_A|_RF_P| _RF_SZ(64) | _RF_RS(0), /* DISP64 */ _RF_A| _RF_SZ(64) | _RF_RS(0), /* PLT64 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* HIX22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* LOX10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(22), /* H44 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(12), /* M44 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* L44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* HIX22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* LOX10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(22), /* H44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(12), /* M44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* L44 */ _RF_S|_RF_A| _RF_SZ(64) | _RF_RS(0), /* REGISTER */ _RF_S|_RF_A| _RF_U| _RF_SZ(64) | _RF_RS(0), /* UA64 */ _RF_S|_RF_A| _RF_U| _RF_SZ(16) | _RF_RS(0), /* UA16 */ @@ -238,6 +239,7 @@ static const char *reloc_names[] = { #define RELOC_BASE_RELATIVE(t) ((reloc_target_flags[t] & _RF_B) != 0) #define RELOC_UNALIGNED(t) ((reloc_target_flags[t] & _RF_U) != 0) #define RELOC_USE_ADDEND(t) ((reloc_target_flags[t] & _RF_A) != 0) +#define RELOC_BARE_SYMBOL(t) ((reloc_target_flags[t] & _RF_X) != 0) #define RELOC_TARGET_SIZE(t) ((reloc_target_flags[t] >> 8) & 0xff) #define RELOC_VALUE_RIGHTSHIFT(t) (reloc_target_flags[t] & 0xff) @@ -334,6 +336,8 @@ elf_reloc(linker_file_t lf, Elf_Addr rel if (addr == 0) return (-1); value += addr; + if (RELOC_BARE_SYMBOL(rtype)) + value = elf_relocaddr(lf, value); } if (rtype == R_SPARC_OLO10) From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 13:57:32 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71B37106564A; Wed, 22 Sep 2010 13:57:32 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 43F338FC1D; Wed, 22 Sep 2010 13:57:30 +0000 (UTC) Received: from mail-gw14.york.ac.uk ([144.32.129.164]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 763535398 for avg@FreeBSD.org;876ec0c1947c60a; Wed, 22 Sep 2010 14:46:42 +0100 Received: from buffy-128.york.ac.uk ([144.32.128.160]:22111 helo=buffy.york.ac.uk) by mail-gw14.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1OyPej-0002ys-9z; Wed, 22 Sep 2010 14:46:41 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id o8MDkevO064391; Wed, 22 Sep 2010 14:46:40 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id o8MDkeD3064390; Wed, 22 Sep 2010 14:46:40 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Andriy Gapon In-Reply-To: <201009211507.o8LF7iVv097676@svn.freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Wed, 22 Sep 2010 14:46:40 +0100 Message-ID: <1285163200.64197.10.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 13:57:32 -0000 On Tue, 2010-09-21 at 15:07 +0000, Andriy Gapon wrote: > Author: avg > Date: Tue Sep 21 15:07:44 2010 > New Revision: 212964 > URL: http://svn.freebsd.org/changeset/base/212964 >=20 > Log: > kdb_backtrace: stack(9)-based code to print backtrace without any backe= nd > =20 > The idea is to add KDB and KDB_TRACE options to GENERIC kernels on > stable branches, so that at least the minimal information is produced > for non-specific panics like traps on page faults. > The GENERICs in stable branches seem to already include STACK option. Ignoring the rest of the discussion about locking, I think this is a step in the right direction. However, what I feel we should be strongly considering is for textdumps to be enabled by default on release media. As more groups choose to use the kernels from the release media (PC-BSD, FreeNAS, etc) and put them into places where end users are never expected to recompile kernels, having textdumps enabled by default in RELEASE kernels becomes a bigger and bigger priority. Groups like PC-BSD don't necessarily have the time or skills to do the needed kernel debugging (and nor should they have to, it's not their purpose), so anything we can do in releases to make sure we have enough info to resolve panics seen by their users is a big bonus. Is there any real reason why we shouldn't go down this route? Thanks, Gavin --=20 Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 14:43:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9629C106564A; Wed, 22 Sep 2010 14:43:18 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 469EA8FC18; Wed, 22 Sep 2010 14:43:16 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA02473; Wed, 22 Sep 2010 17:43:15 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C9A1602.4020204@freebsd.org> Date: Wed, 22 Sep 2010 17:43:14 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Gavin Atkinson References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <1285163200.64197.10.camel@buffy.york.ac.uk> In-Reply-To: <1285163200.64197.10.camel@buffy.york.ac.uk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 14:43:18 -0000 on 22/09/2010 16:46 Gavin Atkinson said the following: > Ignoring the rest of the discussion about locking, I think this is a > step in the right direction. However, what I feel we should be strongly > considering is for textdumps to be enabled by default on release media. > > As more groups choose to use the kernels from the release media (PC-BSD, > FreeNAS, etc) and put them into places where end users are never > expected to recompile kernels, having textdumps enabled by default in > RELEASE kernels becomes a bigger and bigger priority. Groups like > PC-BSD don't necessarily have the time or skills to do the needed kernel > debugging (and nor should they have to, it's not their purpose), so > anything we can do in releases to make sure we have enough info to > resolve panics seen by their users is a big bonus. > > Is there any real reason why we shouldn't go down this route? textdumps need DDB. textdumps also need dumpdev which is not enabled by default in /etc/defaults/rc.conf, but that's easier to fix for any individual user or a FreeBSD "distribution". I originally suggested to include DDB in the stable GENERICs. But that has a number of consequences: 1. With DDB a panic results in a system going to ddb prompt instead of rebooting, unless KDB_UNATTENDED is also specified. System not rebooting on panic may be a POLA violation and an inconvenience. However, a user can change this using debug.debugger_on_panic=0 sysctl. Although, sysctl time might be too late in some cases, not sure. 2. Adding KDB_UNATTENDED to GENERIC may have unexpected effect for users that include GENERIC in their kernel config and then extend/trim it with local directives. So another possible POLA violation. Again, fixable by debug.debugger_on_panic=1 with all the howevers and althoughs. For me personally, the significant benefits outweigh possible minor/temporary inconveniences and surprises, but this opinion is not shared by all developers. Really besides the point, but such FreeBSD "distributions" like FreeNAS and PC-BSD can really use their own kernel config, they don't have to use the same GENERICs. P.S. I think that it would have been better if you followed up to my proposal on arch@. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 15:10:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B11B21065672; Wed, 22 Sep 2010 15:10:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A05F18FC1A; Wed, 22 Sep 2010 15:10:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MFA3qr033949; Wed, 22 Sep 2010 15:10:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MFA35F033947; Wed, 22 Sep 2010 15:10:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009221510.o8MFA35F033947@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Sep 2010 15:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212999 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 15:10:03 -0000 Author: jhb Date: Wed Sep 22 15:10:03 2010 New Revision: 212999 URL: http://svn.freebsd.org/changeset/base/212999 Log: Copy td_rqindex during fork instead of zero'ing it to match the comments. I do not believe there is any functional change. Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Sep 22 12:52:12 2010 (r212998) +++ head/sys/sys/proc.h Wed Sep 22 15:10:03 2010 (r212999) @@ -263,7 +263,7 @@ struct thread { int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ -#define td_endzero td_base_pri +#define td_endzero td_rqindex /* Copied during fork1() or thread_sched_upcall(). */ #define td_startcopy td_endzero From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 15:23:42 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57910106566C; Wed, 22 Sep 2010 15:23:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from gse-mta-27.emailfiltering.com (gse-mta-27-tx.emailfiltering.com [194.116.198.158]) by mx1.freebsd.org (Postfix) with ESMTP id EA8FF8FC12; Wed, 22 Sep 2010 15:23:40 +0000 (UTC) Received: from mail-gw5.york.ac.uk ([144.32.129.29]) by gse-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 753660736 for avg@FreeBSD.org;792989edab745909; Wed, 22 Sep 2010 16:23:39 +0100 Received: from buffy-128.york.ac.uk ([144.32.128.160]:40427 helo=buffy.york.ac.uk) by mail-gw5.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1OyRAY-0007xB-2C; Wed, 22 Sep 2010 16:23:38 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id o8MFNbpo064768; Wed, 22 Sep 2010 16:23:37 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id o8MFNb4v064767; Wed, 22 Sep 2010 16:23:37 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Andriy Gapon In-Reply-To: <4C9A1602.4020204@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <1285163200.64197.10.camel@buffy.york.ac.uk> <4C9A1602.4020204@freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Wed, 22 Sep 2010 16:23:37 +0100 Message-ID: <1285169017.64197.29.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 15:23:42 -0000 On Wed, 2010-09-22 at 17:43 +0300, Andriy Gapon wrote: > on 22/09/2010 16:46 Gavin Atkinson said the following: > > Ignoring the rest of the discussion about locking, I think this is a > > step in the right direction. However, what I feel we should be strongl= y > > considering is for textdumps to be enabled by default on release media. > >=20 > > As more groups choose to use the kernels from the release media (PC-BSD= , > > FreeNAS, etc) and put them into places where end users are never > > expected to recompile kernels, having textdumps enabled by default in > > RELEASE kernels becomes a bigger and bigger priority. Groups like > > PC-BSD don't necessarily have the time or skills to do the needed kerne= l > > debugging (and nor should they have to, it's not their purpose), so > > anything we can do in releases to make sure we have enough info to > > resolve panics seen by their users is a big bonus. > >=20 > > Is there any real reason why we shouldn't go down this route? >=20 > textdumps need DDB. > textdumps also need dumpdev which is not enabled by default in > /etc/defaults/rc.conf, but that's easier to fix for any individual user o= r a > FreeBSD "distribution". Indeed, I was happy to see dumpdev enabled on 7.x, and disappointed to see it disabled on 8.x. > I originally suggested to include DDB in the stable GENERICs. > But that has a number of consequences: > 1. With DDB a panic results in a system going to ddb prompt instead of re= booting, > unless KDB_UNATTENDED is also specified. System not rebooting on panic m= ay be a > POLA violation and an inconvenience. However, a user can change this usi= ng > debug.debugger_on_panic=3D0 sysctl. Although, sysctl time might be too l= ate in some > cases, not sure. Indeed, if we went down this route we would have to make sure that the existing behaviour of rebooting is preserved. We'd also have to ensure Ctrl-Alt-Escape doesn't drop to the debugger on release media. > For me personally, the significant benefits outweigh possible minor/tempo= rary > inconveniences and surprises, but this opinion is not shared by all devel= opers. I (and I suspect any of the other people on the PR database frontline) would probably support this :) > Really besides the point, but such FreeBSD "distributions" like FreeNAS a= nd PC-BSD > can really use their own kernel config, they don't have to use the same G= ENERICs. Indeed, although in some ways they shouldn't have to. Having textdumps enabled by default would also be a huge win for us, of course. > P.S. I think that it would have been better if you followed up to my prop= osal on > arch@. I'm not subscribed to -arch at the moment, I probably should be. I guess you're talking about the thread in June? I wish I'd seen that at the time, I'm 100% in favour of it. Gavin --=20 Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 15:25:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0A61065672; Wed, 22 Sep 2010 15:25:57 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1803D8FC18; Wed, 22 Sep 2010 15:25:55 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA03219; Wed, 22 Sep 2010 18:25:54 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C9A2002.9070807@freebsd.org> Date: Wed, 22 Sep 2010 18:25:54 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Gavin Atkinson References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <1285163200.64197.10.camel@buffy.york.ac.uk> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> In-Reply-To: <1285169017.64197.29.camel@buffy.york.ac.uk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 15:25:57 -0000 on 22/09/2010 18:23 Gavin Atkinson said the following: > I'm not subscribed to -arch at the moment, I probably should be. I > guess you're talking about the thread in June? I wish I'd seen that at > the time, I'm 100% in favour of it. No, a thread in September, third decade of it :) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 16:48:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 454FD106566C; Wed, 22 Sep 2010 16:48:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346168FC0A; Wed, 22 Sep 2010 16:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MGmPFB036169; Wed, 22 Sep 2010 16:48:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MGmPMq036167; Wed, 22 Sep 2010 16:48:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009221648.o8MGmPMq036167@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Sep 2010 16:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213000 - head/sys/dev/stge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 16:48:25 -0000 Author: yongari Date: Wed Sep 22 16:48:24 2010 New Revision: 213000 URL: http://svn.freebsd.org/changeset/base/213000 Log: Fix build breakage introduced in r212972. Modified: head/sys/dev/stge/if_stge.c Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Wed Sep 22 15:10:03 2010 (r212999) +++ head/sys/dev/stge/if_stge.c Wed Sep 22 16:48:24 2010 (r213000) @@ -1944,13 +1944,11 @@ stge_poll(struct ifnet *ifp, enum poll_c "Host interface error, resetting...\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); - break; } if ((status & IS_TxComplete) != 0) { if (stge_tx_error(sc) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); - break; } } } From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 16:54:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194F01065670; Wed, 22 Sep 2010 16:54:23 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1B658FC15; Wed, 22 Sep 2010 16:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MGsMA3036471; Wed, 22 Sep 2010 16:54:22 GMT (envelope-from sunpoet@svn.freebsd.org) Received: (from sunpoet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MGsMRR036468; Wed, 22 Sep 2010 16:54:22 GMT (envelope-from sunpoet@svn.freebsd.org) Message-Id: <201009221654.o8MGsMRR036468@svn.freebsd.org> From: Sunpoet Po-Chuan Hsieh Date: Wed, 22 Sep 2010 16:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213001 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 16:54:23 -0000 Author: sunpoet (ports committer) Date: Wed Sep 22 16:54:22 2010 New Revision: 213001 URL: http://svn.freebsd.org/changeset/base/213001 Log: Add myself as a ports committer Approved by: pgollucci (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Sep 22 16:48:24 2010 (r213000) +++ head/share/misc/committers-ports.dot Wed Sep 22 16:54:22 2010 (r213001) @@ -154,6 +154,7 @@ skreuzer [label="Steven Kreuzer\nskreuze sobomax[label="Maxim Sobolev\nsobomax@FreeBSD.org\n2000/05/17"] stas [label="Stanislav Sedov\nstas@FreeBSD.org\n2006/09/18"] stefan [label="Stefan Walter\nstefan@FreeBSD.org\n2006/05/07"] +sunpoet [label="Po-Chuan Hsieh\nsunpoet@FreeBSD.org\n2010/09/21"] swills [label="Steve Wills\nswills@FreeBSD.org\n2010/09/03"] tabthorpe [label="Thomas Abthorpe\ntabthorpe@FreeBSD.org\n2007/08/20"] tdb [label="Tim Bishop\ntdb@FreeBSD.org\n2005/11/30"] @@ -332,6 +333,7 @@ pav -> mnag pgj -> ashish pgj -> jacula +pgollucci -> sunpoet pgollucci -> swills philip -> koitsu Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 22 16:48:24 2010 (r213000) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 22 16:54:22 2010 (r213001) @@ -105,6 +105,7 @@ 03/27 Josef El-Rayes born in Linz, Austria, 1982 03/28 Sean C. Farley born in Indianapolis, Indiana, United States, 1970 03/29 Thierry Thomas born in Luxeuil les Bains, France, 1961 +03/30 Po-Chuan Hsieh born in Taipei, Taiwan, Republic of China, 1978 04/01 Matthew Jacob born in San Francisco, California, United States, 1958 04/01 Bill Fenner born in Bellefonte, Pennsylvania, United States, 1971 04/01 Peter Edwards born in Dublin, Ireland, 1973 From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 18:38:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D493D1065670; Wed, 22 Sep 2010 18:38:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C511B8FC0A; Wed, 22 Sep 2010 18:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MIc2nD038994; Wed, 22 Sep 2010 18:38:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MIc2Dh038992; Wed, 22 Sep 2010 18:38:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221838.o8MIc2Dh038992@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 18:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213003 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 18:38:02 -0000 Author: pjd Date: Wed Sep 22 18:38:02 2010 New Revision: 213003 URL: http://svn.freebsd.org/changeset/base/213003 Log: Sort includes. MFC after: 3 days Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Wed Sep 22 18:00:34 2010 (r213002) +++ head/sbin/hastd/control.c Wed Sep 22 18:38:02 2010 (r213003) @@ -32,11 +32,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 18:39:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D348F106564A; Wed, 22 Sep 2010 18:39:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C39EB8FC1F; Wed, 22 Sep 2010 18:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MIdh8x039059; Wed, 22 Sep 2010 18:39:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MIdhQB039057; Wed, 22 Sep 2010 18:39:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221839.o8MIdhQB039057@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 18:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213004 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 18:39:43 -0000 Author: pjd Date: Wed Sep 22 18:39:43 2010 New Revision: 213004 URL: http://svn.freebsd.org/changeset/base/213004 Log: If we are unable to receive control message is most likely because the main process died. Instead of entering infinite loop, terminate. MFC after: 3 days Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Wed Sep 22 18:38:02 2010 (r213003) +++ head/sbin/hastd/control.c Wed Sep 22 18:39:43 2010 (r213004) @@ -387,7 +387,8 @@ ctrl_thread(void *arg) pthread_exit(NULL); pjdlog_errno(LOG_ERR, "Unable to receive control message"); - continue; + kill(getpid(), SIGTERM); + pthread_exit(NULL); } cmd = nv_get_uint8(nvin, "cmd"); if (cmd == 0) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 18:46:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11FAE106564A; Wed, 22 Sep 2010 18:46:18 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 029838FC14; Wed, 22 Sep 2010 18:46:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MIkHvL039262; Wed, 22 Sep 2010 18:46:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MIkH2e039260; Wed, 22 Sep 2010 18:46:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201009221846.o8MIkH2e039260@svn.freebsd.org> From: Doug Barton Date: Wed, 22 Sep 2010 18:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213005 - head/usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 18:46:18 -0000 Author: dougb Date: Wed Sep 22 18:46:17 2010 New Revision: 213005 URL: http://svn.freebsd.org/changeset/base/213005 Log: Eliminate the --disable-ipv6 string which while technically correct in terms of the arguments that configure was called with is misleading because if IPv6 support is present on the system it will be present in BIND. Modified: head/usr.sbin/named/Makefile Modified: head/usr.sbin/named/Makefile ============================================================================== --- head/usr.sbin/named/Makefile Wed Sep 22 18:39:43 2010 (r213004) +++ head/usr.sbin/named/Makefile Wed Sep 22 18:46:17 2010 (r213005) @@ -9,7 +9,7 @@ SRCDIR= ${BIND_DIR}/bin/named PROG= named -CONFIGARGS='--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' +CONFIGARGS='--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' # Optional features .if ${MK_BIND_LARGE_FILE} == "yes" From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 18:57:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76C0A10656CB; Wed, 22 Sep 2010 18:57:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0E18FC13; Wed, 22 Sep 2010 18:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MIv6L2039507; Wed, 22 Sep 2010 18:57:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MIv6ei039503; Wed, 22 Sep 2010 18:57:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221857.o8MIv6ei039503@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 18:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213006 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 18:57:06 -0000 Author: pjd Date: Wed Sep 22 18:57:06 2010 New Revision: 213006 URL: http://svn.freebsd.org/changeset/base/213006 Log: Fix descriptor leaks: when child exits, we have to close control and event socket pairs. We did that only in one case out of three. MFC after: 3 days Modified: head/sbin/hastd/control.c head/sbin/hastd/control.h head/sbin/hastd/hastd.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Wed Sep 22 18:46:17 2010 (r213005) +++ head/sbin/hastd/control.c Wed Sep 22 18:57:06 2010 (r213006) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "hast.h" #include "hastd.h" @@ -51,6 +52,17 @@ __FBSDID("$FreeBSD$"); #include "control.h" +void +child_cleanup(struct hast_resource *res) +{ + + proto_close(res->hr_ctrl); + res->hr_ctrl = NULL; + proto_close(res->hr_event); + res->hr_event = NULL; + res->hr_workerpid = 0; +} + static void control_set_role_common(struct hastd_config *cfg, struct nv *nvout, uint8_t role, struct hast_resource *res, const char *name, unsigned int no) @@ -109,7 +121,7 @@ control_set_role_common(struct hastd_con pjdlog_debug(1, "Worker process %u stopped.", (unsigned int)res->hr_workerpid); } - res->hr_workerpid = 0; + child_cleanup(res); } /* Start worker process if we are changing to primary. */ Modified: head/sbin/hastd/control.h ============================================================================== --- head/sbin/hastd/control.h Wed Sep 22 18:46:17 2010 (r213005) +++ head/sbin/hastd/control.h Wed Sep 22 18:57:06 2010 (r213006) @@ -38,6 +38,8 @@ struct hastd_config; struct hast_resource; +void child_cleanup(struct hast_resource *res); + void control_set_role(struct hast_resource *res, uint8_t role); void control_handle(struct hastd_config *cfg); Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Sep 22 18:46:17 2010 (r213005) +++ head/sbin/hastd/hastd.c Wed Sep 22 18:57:06 2010 (r213006) @@ -158,13 +158,7 @@ child_exit(void) pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); child_exit_log(pid, status); - proto_close(res->hr_ctrl); - res->hr_ctrl = NULL; - if (res->hr_event != NULL) { - proto_close(res->hr_event); - res->hr_event = NULL; - } - res->hr_workerpid = 0; + child_cleanup(res); if (res->hr_role == HAST_ROLE_PRIMARY) { /* * Restart child process if it was killed by signal @@ -553,7 +547,7 @@ listen_accept(void) } else { child_exit_log(res->hr_workerpid, status); } - res->hr_workerpid = 0; + child_cleanup(res); } else if (res->hr_remotein != NULL) { char oaddr[256]; From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:03:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD33F1065697; Wed, 22 Sep 2010 19:03:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37F48FC1E; Wed, 22 Sep 2010 19:03:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MJ3B3Z039691; Wed, 22 Sep 2010 19:03:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MJ3B2m039688; Wed, 22 Sep 2010 19:03:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221903.o8MJ3B2m039688@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 19:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213007 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:03:12 -0000 Author: pjd Date: Wed Sep 22 19:03:11 2010 New Revision: 213007 URL: http://svn.freebsd.org/changeset/base/213007 Log: Fix possible deadlock where worker process sends an event to the main process while the main process sends control message to the worker process, but worker process hasn't started control thread yet, because it waits for reply from the main process. The fix is to start the control thread before sending any events. Reported and fix suggested by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Sep 22 18:57:06 2010 (r213006) +++ head/sbin/hastd/primary.c Wed Sep 22 19:03:11 2010 (r213007) @@ -807,10 +807,20 @@ hastd_primary(struct hast_resource *res) proto_send(res->hr_event, NULL, 0); init_local(res); - if (real_remote(res) && init_remote(res, NULL, NULL)) - sync_start(); init_ggate(res); init_environment(res); + /* + * Create the control thread before sending any event to the parent, + * as we can deadlock when parent sends control request to worker, + * but worker has no control thread started yet, so parent waits. + * In the meantime worker sends an event to the parent, but parent + * is unable to handle the event, because it waits for control + * request response. + */ + error = pthread_create(&td, NULL, ctrl_thread, res); + assert(error == 0); + if (real_remote(res) && init_remote(res, NULL, NULL)) + sync_start(); error = pthread_create(&td, NULL, ggate_recv_thread, res); assert(error == 0); error = pthread_create(&td, NULL, local_send_thread, res); @@ -823,8 +833,6 @@ hastd_primary(struct hast_resource *res) assert(error == 0); error = pthread_create(&td, NULL, sync_thread, res); assert(error == 0); - error = pthread_create(&td, NULL, ctrl_thread, res); - assert(error == 0); (void)guard_thread(res); } Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Wed Sep 22 18:57:06 2010 (r213006) +++ head/sbin/hastd/secondary.c Wed Sep 22 19:03:11 2010 (r213007) @@ -393,17 +393,27 @@ hastd_secondary(struct hast_resource *re pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); init_local(res); - init_remote(res, nvin); init_environment(); + + /* + * Create the control thread before sending any event to the parent, + * as we can deadlock when parent sends control request to worker, + * but worker has no control thread started yet, so parent waits. + * In the meantime worker sends an event to the parent, but parent + * is unable to handle the event, because it waits for control + * request response. + */ + error = pthread_create(&td, NULL, ctrl_thread, res); + assert(error == 0); + + init_remote(res, nvin); event_send(res, EVENT_CONNECT); error = pthread_create(&td, NULL, recv_thread, res); assert(error == 0); error = pthread_create(&td, NULL, disk_thread, res); assert(error == 0); - error = pthread_create(&td, NULL, send_thread, res); - assert(error == 0); - (void)ctrl_thread(res); + (void)send_thread(res); } static void From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:05:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1072410656A7; Wed, 22 Sep 2010 19:05:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 015348FC1B; Wed, 22 Sep 2010 19:05:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MJ5shX039780; Wed, 22 Sep 2010 19:05:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MJ5sog039778; Wed, 22 Sep 2010 19:05:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221905.o8MJ5sog039778@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 19:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213008 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:05:55 -0000 Author: pjd Date: Wed Sep 22 19:05:54 2010 New Revision: 213008 URL: http://svn.freebsd.org/changeset/base/213008 Log: Assert that descriptor numbers are sane. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Sep 22 19:03:11 2010 (r213007) +++ head/sbin/hastd/hastd.c Wed Sep 22 19:05:54 2010 (r213008) @@ -650,18 +650,22 @@ main_loop(void) /* Setup descriptors for select(2). */ FD_ZERO(&rfds); maxfd = fd = proto_descriptor(cfg->hc_controlconn); + assert(fd >= 0); FD_SET(fd, &rfds); fd = proto_descriptor(cfg->hc_listenconn); + assert(fd >= 0); FD_SET(fd, &rfds); maxfd = fd > maxfd ? fd : maxfd; TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { if (res->hr_event == NULL) continue; fd = proto_descriptor(res->hr_event); + assert(fd >= 0); FD_SET(fd, &rfds); maxfd = fd > maxfd ? fd : maxfd; } + assert(maxfd + 1 <= (int)FD_SETSIZE); ret = select(maxfd + 1, &rfds, NULL, NULL, &timeout); if (ret == 0) hook_check(false); From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:08:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF379106564A; Wed, 22 Sep 2010 19:08:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF5918FC16; Wed, 22 Sep 2010 19:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MJ8Br4039858; Wed, 22 Sep 2010 19:08:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MJ8BTQ039853; Wed, 22 Sep 2010 19:08:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009221908.o8MJ8BTQ039853@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 22 Sep 2010 19:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213009 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:08:11 -0000 Author: pjd Date: Wed Sep 22 19:08:11 2010 New Revision: 213009 URL: http://svn.freebsd.org/changeset/base/213009 Log: Switch to sigprocmask(2) API also in the main process and secondary process. This way the primary process inherits signal mask from the main process, which fixes a race where signal is delivered to the primary process before configuring signal mask. Reported by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hastd.c head/sbin/hastd/hastd.h head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Sep 22 19:05:54 2010 (r213008) +++ head/sbin/hastd/hastd.c Wed Sep 22 19:08:11 2010 (r213009) @@ -63,10 +63,6 @@ __FBSDID("$FreeBSD$"); const char *cfgpath = HAST_CONFIG; /* Hastd configuration. */ static struct hastd_config *cfg; -/* Was SIGCHLD signal received? */ -bool sigchld_received = false; -/* Was SIGHUP signal received? */ -bool sighup_received = false; /* Was SIGINT or SIGTERM signal received? */ bool sigexit_received = false; /* PID file handle. */ @@ -83,26 +79,6 @@ usage(void) } static void -sighandler(int sig) -{ - - switch (sig) { - case SIGINT: - case SIGTERM: - sigexit_received = true; - break; - case SIGCHLD: - sigchld_received = true; - break; - case SIGHUP: - sighup_received = true; - break; - default: - assert(!"invalid condition"); - } -} - -static void g_gate_load(void) { @@ -625,26 +601,41 @@ static void main_loop(void) { struct hast_resource *res; - struct timeval timeout; - int fd, maxfd, ret; + struct timeval seltimeout; + struct timespec sigtimeout; + int fd, maxfd, ret, signo; + sigset_t mask; fd_set rfds; - timeout.tv_sec = REPORT_INTERVAL; - timeout.tv_usec = 0; + seltimeout.tv_sec = REPORT_INTERVAL; + seltimeout.tv_usec = 0; + sigtimeout.tv_sec = 0; + sigtimeout.tv_nsec = 0; + + PJDLOG_VERIFY(sigemptyset(&mask) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGHUP) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGCHLD) == 0); for (;;) { - if (sigexit_received) { - sigexit_received = false; - terminate_workers(); - exit(EX_OK); - } - if (sigchld_received) { - sigchld_received = false; - child_exit(); - } - if (sighup_received) { - sighup_received = false; - hastd_reload(); + while ((signo = sigtimedwait(&mask, NULL, &sigtimeout)) != -1) { + switch (signo) { + case SIGINT: + case SIGTERM: + sigexit_received = true; + terminate_workers(); + exit(EX_OK); + break; + case SIGCHLD: + child_exit(); + break; + case SIGHUP: + hastd_reload(); + break; + default: + assert(!"invalid condition"); + } } /* Setup descriptors for select(2). */ @@ -666,7 +657,7 @@ main_loop(void) } assert(maxfd + 1 <= (int)FD_SETSIZE); - ret = select(maxfd + 1, &rfds, NULL, NULL, &timeout); + ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout); if (ret == 0) hook_check(false); else if (ret == -1) { @@ -701,6 +692,7 @@ main(int argc, char *argv[]) pid_t otherpid; bool foreground; int debuglevel; + sigset_t mask; g_gate_load(); @@ -751,10 +743,12 @@ main(int argc, char *argv[]) cfg = yy_config_parse(cfgpath, true); assert(cfg != NULL); - signal(SIGINT, sighandler); - signal(SIGTERM, sighandler); - signal(SIGHUP, sighandler); - signal(SIGCHLD, sighandler); + PJDLOG_VERIFY(sigemptyset(&mask) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGHUP) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); + PJDLOG_VERIFY(sigaddset(&mask, SIGCHLD) == 0); + PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Listen on control address. */ if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) < 0) { Modified: head/sbin/hastd/hastd.h ============================================================================== --- head/sbin/hastd/hastd.h Wed Sep 22 19:05:54 2010 (r213008) +++ head/sbin/hastd/hastd.h Wed Sep 22 19:08:11 2010 (r213009) @@ -40,7 +40,7 @@ #include "hast.h" extern const char *cfgpath; -extern bool sigchld_received, sigexit_received, sighup_received; +extern bool sigexit_received; extern struct pidfh *pfh; void hastd_primary(struct hast_resource *res); Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Sep 22 19:05:54 2010 (r213008) +++ head/sbin/hastd/primary.c Wed Sep 22 19:08:11 2010 (r213009) @@ -313,7 +313,6 @@ init_environment(struct hast_resource *r { struct hio *hio; unsigned int ii, ncomps; - sigset_t mask; /* * In the future it might be per-resource value. @@ -420,15 +419,6 @@ init_environment(struct hast_resource *r hio->hio_ggio.gctl_error = 0; TAILQ_INSERT_HEAD(&hio_free_list, hio, hio_free_next); } - - /* - * Turn on signals handling. - */ - PJDLOG_VERIFY(sigemptyset(&mask) == 0); - PJDLOG_VERIFY(sigaddset(&mask, SIGHUP) == 0); - PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0); - PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); - PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); } static void @@ -800,9 +790,6 @@ hastd_primary(struct hast_resource *res) setproctitle("%s (primary)", res->hr_name); - signal(SIGHUP, SIG_DFL); - signal(SIGCHLD, SIG_DFL); - /* Declare that we are sender. */ proto_send(res->hr_event, NULL, 0); Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Wed Sep 22 19:05:54 2010 (r213008) +++ head/sbin/hastd/secondary.c Wed Sep 22 19:08:11 2010 (r213009) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -334,6 +335,7 @@ init_remote(struct hast_resource *res, s void hastd_secondary(struct hast_resource *res, struct nv *nvin) { + sigset_t mask; pthread_t td; pid_t pid; int error; @@ -380,8 +382,8 @@ hastd_secondary(struct hast_resource *re setproctitle("%s (secondary)", res->hr_name); - signal(SIGHUP, SIG_DFL); - signal(SIGCHLD, SIG_DFL); + PJDLOG_VERIFY(sigemptyset(&mask) == 0); + PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Declare that we are sender. */ proto_send(res->hr_event, NULL, 0); From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:26:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD2D106564A; Wed, 22 Sep 2010 19:26:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EC558FC08; Wed, 22 Sep 2010 19:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MJQfmY040330; Wed, 22 Sep 2010 19:26:41 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MJQf0e040328; Wed, 22 Sep 2010 19:26:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009221926.o8MJQf0e040328@svn.freebsd.org> From: Ed Maste Date: Wed, 22 Sep 2010 19:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213012 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:26:41 -0000 Author: emaste Date: Wed Sep 22 19:26:41 2010 New Revision: 213012 URL: http://svn.freebsd.org/changeset/base/213012 Log: Correct sort order. Modified: head/bin/ps/extern.h Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Wed Sep 22 19:12:22 2010 (r213011) +++ head/bin/ps/extern.h Wed Sep 22 19:26:41 2010 (r213012) @@ -80,8 +80,8 @@ int s_uname(KINFO *); void showkey(void); void started(KINFO *, VARENT *); void state(KINFO *, VARENT *); -void tdnam(KINFO *, VARENT *); void tdev(KINFO *, VARENT *); +void tdnam(KINFO *, VARENT *); void tname(KINFO *, VARENT *); void ucomm(KINFO *, VARENT *); void uname(KINFO *, VARENT *); From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:41:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22334106566C; Wed, 22 Sep 2010 19:41:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131478FC16; Wed, 22 Sep 2010 19:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MJf1ok040689; Wed, 22 Sep 2010 19:41:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MJf1LD040687; Wed, 22 Sep 2010 19:41:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009221941.o8MJf1LD040687@svn.freebsd.org> From: Ed Maste Date: Wed, 22 Sep 2010 19:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213013 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:41:02 -0000 Author: emaste Date: Wed Sep 22 19:41:01 2010 New Revision: 213013 URL: http://svn.freebsd.org/changeset/base/213013 Log: Move test for zero bufp or size before rseq and wseq calculation. This avoids spinning in an infinite loop for some (possibly corrupt?) core files at work. Modified: head/gnu/usr.bin/gdb/kgdb/main.c Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Wed Sep 22 19:26:41 2010 (r213012) +++ head/gnu/usr.bin/gdb/kgdb/main.c Wed Sep 22 19:41:01 2010 (r213013) @@ -222,11 +222,13 @@ kgdb_dmesg(void) return; bufp = kgdb_parse("msgbufp->msg_ptr"); size = (int)kgdb_parse("msgbufp->msg_size"); + if (bufp == 0 || size == 0) + return; rseq = (int)kgdb_parse("msgbufp->msg_rseq"); wseq = (int)kgdb_parse("msgbufp->msg_wseq"); rseq = MSGBUF_SEQ_TO_POS(size, rseq); wseq = MSGBUF_SEQ_TO_POS(size, wseq); - if (bufp == 0 || size == 0 || rseq == wseq) + if (rseq == wseq) return; printf("\nUnread portion of the kernel message buffer:\n"); From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 19:58:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBC01065704; Wed, 22 Sep 2010 19:58:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7F79E8FC0C; Wed, 22 Sep 2010 19:58:38 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3273546B46; Wed, 22 Sep 2010 15:58:38 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C21658A03C; Wed, 22 Sep 2010 15:58:36 -0400 (EDT) From: John Baldwin To: Gavin Atkinson Date: Wed, 22 Sep 2010 15:58:27 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> In-Reply-To: <1285169017.64197.29.camel@buffy.york.ac.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009221558.27393.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 22 Sep 2010 15:58:36 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 19:58:38 -0000 On Wednesday, September 22, 2010 11:23:37 am Gavin Atkinson wrote: > On Wed, 2010-09-22 at 17:43 +0300, Andriy Gapon wrote: > > on 22/09/2010 16:46 Gavin Atkinson said the following: > > > Ignoring the rest of the discussion about locking, I think this is a > > > step in the right direction. However, what I feel we should be strongly > > > considering is for textdumps to be enabled by default on release media. > > > > > > As more groups choose to use the kernels from the release media (PC-BSD, > > > FreeNAS, etc) and put them into places where end users are never > > > expected to recompile kernels, having textdumps enabled by default in > > > RELEASE kernels becomes a bigger and bigger priority. Groups like > > > PC-BSD don't necessarily have the time or skills to do the needed kernel > > > debugging (and nor should they have to, it's not their purpose), so > > > anything we can do in releases to make sure we have enough info to > > > resolve panics seen by their users is a big bonus. > > > > > > Is there any real reason why we shouldn't go down this route? > > > > textdumps need DDB. > > textdumps also need dumpdev which is not enabled by default in > > /etc/defaults/rc.conf, but that's easier to fix for any individual user or a > > FreeBSD "distribution". > > Indeed, I was happy to see dumpdev enabled on 7.x, and disappointed to > see it disabled on 8.x. Agreed. FWIW, I actually think that this is the only change needed as crashinfo is enabled by default in 8.x and later. We already include symbols in kernels by default now, so just setting dumpdev will give you the same info you generally can get from a textdump in the form of a simple /var/crash/core.txt.N file. The other benefit of full crashdumps + crashinfo as compared to textdumps is that a developer can request further information in a PR followup (fire up kgdb and enter command 'X' and reply with the output). With a textdump any info not collected by the textdump is lost once the machine reboots after the crash. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:02:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E38EA10656C6; Wed, 22 Sep 2010 21:02:35 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 65B798FC1D; Wed, 22 Sep 2010 21:02:33 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA08450; Thu, 23 Sep 2010 00:02:32 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OyWSW-0001vk-1v; Thu, 23 Sep 2010 00:02:32 +0300 Message-ID: <4C9A6EE6.5050301@freebsd.org> Date: Thu, 23 Sep 2010 00:02:30 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> In-Reply-To: <201009221558.27393.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:02:36 -0000 on 22/09/2010 22:58 John Baldwin said the following: > Agreed. FWIW, I actually think that this is the only change needed as > crashinfo is enabled by default in 8.x and later. We already include symbols > in kernels by default now, so just setting dumpdev will give you the same > info you generally can get from a textdump in the form of a simple > /var/crash/core.txt.N file. > > The other benefit of full crashdumps + crashinfo as compared to textdumps is > that a developer can request further information in a PR followup (fire up > kgdb and enter command 'X' and reply with the output). With a textdump any > info not collected by the textdump is lost once the machine reboots after the > crash. Agree++ But what was the reason that dumpdev="AUTO" was reverted? I remember that POLA was quoted at the time. I am not sure what the astonishment actually was - perhaps 'AUTO' was not smart enough and destroyed somebody's data? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:02:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A85810656C7; Wed, 22 Sep 2010 21:02:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1508FC1D; Wed, 22 Sep 2010 21:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ML2hkq043383; Wed, 22 Sep 2010 21:02:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ML2hDD043380; Wed, 22 Sep 2010 21:02:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009222102.o8ML2hDD043380@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Sep 2010 21:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213028 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:02:43 -0000 Author: jhb Date: Wed Sep 22 21:02:43 2010 New Revision: 213028 URL: http://svn.freebsd.org/changeset/base/213028 Log: - Expand scope of tun/tap softc locks to cover more softc fields and driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls. Submitted by: Marcin Cieslak saper of saper|info (3) MFC after: 2 weeks Modified: head/sys/net/if_tap.c head/sys/net/if_tun.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Wed Sep 22 20:27:59 2010 (r213027) +++ head/sys/net/if_tap.c Wed Sep 22 21:02:43 2010 (r213028) @@ -132,7 +132,7 @@ static struct filterops tap_write_filter static struct cdevsw tap_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, + .d_flags = D_PSEUDO | D_NEEDMINOR, .d_open = tapopen, .d_close = tapclose, .d_read = tapread, @@ -209,7 +209,6 @@ static void tap_destroy(struct tap_softc *tp) { struct ifnet *ifp = tp->tap_ifp; - int s; /* Unlocked read. */ KASSERT(!(tp->tap_flags & TAP_OPEN), @@ -217,10 +216,8 @@ tap_destroy(struct tap_softc *tp) knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); - s = splimp(); ether_ifdetach(ifp); if_free_type(ifp, IFT_ETHER); - splx(s); mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); @@ -398,7 +395,7 @@ tapcreate(struct cdev *dev) struct tap_softc *tp = NULL; unsigned short macaddr_hi; uint32_t macaddr_mid; - int unit, s; + int unit; char *name = NULL; u_char eaddr[6]; @@ -442,22 +439,20 @@ tapcreate(struct cdev *dev) ifp->if_ioctl = tapifioctl; ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); - ifp->if_snd.ifq_maxlen = ifqmaxlen; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; ifp->if_capenable |= IFCAP_LINKSTATE; dev->si_drv1 = tp; tp->tap_dev = dev; - s = splimp(); ether_ifattach(ifp, eaddr); - splx(s); mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init_mtx(&tp->tap_rsel.si_note, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, &tp->tap_mtx); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -474,7 +469,7 @@ tapopen(struct cdev *dev, int flag, int { struct tap_softc *tp = NULL; struct ifnet *ifp = NULL; - int error, s; + int error; if (tapuopen == 0) { error = priv_check(td, PRIV_NET_TAP); @@ -497,15 +492,13 @@ tapopen(struct cdev *dev, int flag, int tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; ifp = tp->tap_ifp; - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (tapuponopen) ifp->if_flags |= IFF_UP; if_link_state_change(ifp, LINK_STATE_UP); - splx(s); + mtx_unlock(&tp->tap_mtx); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -524,9 +517,9 @@ tapclose(struct cdev *dev, int foo, int struct ifaddr *ifa; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s; /* junk all pending output */ + mtx_lock(&tp->tap_mtx); IF_DRAIN(&ifp->if_snd); /* @@ -534,28 +527,26 @@ tapclose(struct cdev *dev, int foo, int * interface, if we are in VMnet mode. just close the device. */ - mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && (ifp->if_flags & IFF_UP)) { mtx_unlock(&tp->tap_mtx); - s = splimp(); if_down(ifp); + mtx_lock(&tp->tap_mtx); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tap_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { rtinit(ifa, (int)RTM_DELETE, 0); } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_lock(&tp->tap_mtx); } - splx(s); - } else - mtx_unlock(&tp->tap_mtx); + } if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); - mtx_lock(&tp->tap_mtx); tp->tap_flags &= ~TAP_OPEN; tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); @@ -580,8 +571,10 @@ tapifinit(void *xtp) TAPDEBUG("initializing %s\n", ifp->if_xname); + mtx_lock(&tp->tap_mtx); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + mtx_unlock(&tp->tap_mtx); /* attempt to start output */ tapifstart(ifp); @@ -599,7 +592,7 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int s, dummy; + int dummy; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -612,7 +605,6 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; case SIOCGIFSTATUS: - s = splimp(); ifs = (struct ifstat *)data; dummy = strlen(ifs->ascii); mtx_lock(&tp->tap_mtx); @@ -621,14 +613,10 @@ tapifioctl(struct ifnet *ifp, u_long cmd sizeof(ifs->ascii) - dummy, "\tOpened by PID %d\n", tp->tap_pid); mtx_unlock(&tp->tap_mtx); - splx(s); break; default: - s = splimp(); - dummy = ether_ioctl(ifp, cmd, data); - splx(s); - return (dummy); + return (ether_ioctl(ifp, cmd, data)); /* NOT REACHED */ } @@ -645,7 +633,6 @@ static void tapifstart(struct ifnet *ifp) { struct tap_softc *tp = ifp->if_softc; - int s; TAPDEBUG("%s starting\n", ifp->if_xname); @@ -657,32 +644,28 @@ tapifstart(struct ifnet *ifp) mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && ((tp->tap_flags & TAP_READY) != TAP_READY)) { - struct mbuf *m = NULL; - - mtx_unlock(&tp->tap_mtx); + struct mbuf *m; /* Unlocked read. */ TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, tp->tap_flags); - s = splimp(); - do { + for (;;) { IF_DEQUEUE(&ifp->if_snd, m); - if (m != NULL) + if (m != NULL) { m_freem(m); - ifp->if_oerrors ++; - } while (m != NULL); - splx(s); + ifp->if_oerrors++; + } else + break; + } + mtx_unlock(&tp->tap_mtx); return; } - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if (ifp->if_snd.ifq_len != 0) { - mtx_lock(&tp->tap_mtx); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { if (tp->tap_flags & TAP_RWAIT) { tp->tap_flags &= ~TAP_RWAIT; wakeup(tp); @@ -691,16 +674,16 @@ tapifstart(struct ifnet *ifp) if ((tp->tap_flags & TAP_ASYNC) && (tp->tap_sigio != NULL)) { mtx_unlock(&tp->tap_mtx); pgsigio(&tp->tap_sigio, SIGIO, 0); - } else - mtx_unlock(&tp->tap_mtx); + mtx_lock(&tp->tap_mtx); + } selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); ifp->if_opackets ++; /* obytes are counted in ether_output */ } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - splx(s); + mtx_unlock(&tp->tap_mtx); } /* tapifstart */ @@ -715,7 +698,6 @@ tapioctl(struct cdev *dev, u_long cmd, c struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct tapinfo *tapp = NULL; - int s; int f; #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -724,19 +706,21 @@ tapioctl(struct cdev *dev, u_long cmd, c switch (cmd) { case TAPSIFINFO: - s = splimp(); tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); ifp->if_mtu = tapp->mtu; ifp->if_type = tapp->type; ifp->if_baudrate = tapp->baudrate; - splx(s); + mtx_unlock(&tp->tap_mtx); break; case TAPGIFINFO: tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); tapp->mtu = ifp->if_mtu; tapp->type = ifp->if_type; tapp->baudrate = ifp->if_baudrate; + mtx_unlock(&tp->tap_mtx); break; case TAPSDEBUG: @@ -757,26 +741,26 @@ tapioctl(struct cdev *dev, u_long cmd, c break; case FIOASYNC: - s = splimp(); mtx_lock(&tp->tap_mtx); if (*(int *)data) tp->tap_flags |= TAP_ASYNC; else tp->tap_flags &= ~TAP_ASYNC; mtx_unlock(&tp->tap_mtx); - splx(s); break; case FIONREAD: - s = splimp(); - if (ifp->if_snd.ifq_head) { - struct mbuf *mb = ifp->if_snd.ifq_head; + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { + struct mbuf *mb; - for(*(int *)data = 0;mb != NULL;mb = mb->m_next) + IFQ_LOCK(&ifp->if_snd); + IFQ_POLL_NOLOCK(&ifp->if_snd, mb); + for (*(int *)data = 0; mb != NULL; + mb = mb->m_next) *(int *)data += mb->m_len; + IFQ_UNLOCK(&ifp->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: @@ -797,10 +781,6 @@ tapioctl(struct cdev *dev, u_long cmd, c /* VMware/VMnet port ioctl's */ - case SIOCGIFFLAGS: /* get ifnet flags */ - bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags)); - break; - #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) case _IO('V', 0): @@ -814,9 +794,9 @@ tapioctl(struct cdev *dev, u_long cmd, c f &= ~IFF_CANTCHANGE; f |= IFF_UP; - s = splimp(); + mtx_lock(&tp->tap_mtx); ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE); - splx(s); + mtx_unlock(&tp->tap_mtx); break; case OSIOCGIFADDR: /* get MAC address of the remote side */ @@ -851,7 +831,7 @@ tapread(struct cdev *dev, struct uio *ui struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct mbuf *m = NULL; - int error = 0, len, s; + int error = 0, len; TAPDEBUG("%s reading, minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -867,26 +847,27 @@ tapread(struct cdev *dev, struct uio *ui } tp->tap_flags &= ~TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); /* sleep until we get a packet */ do { - s = splimp(); IF_DEQUEUE(&ifp->if_snd, m); - splx(s); if (m == NULL) { - if (flag & O_NONBLOCK) + if (flag & O_NONBLOCK) { + mtx_unlock(&tp->tap_mtx); return (EWOULDBLOCK); + } - mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); - error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0); - if (error) + error = mtx_sleep(tp, &tp->tap_mtx, PCATCH | (PZERO + 1), + "taprd", 0); + if (error) { + mtx_unlock(&tp->tap_mtx); return (error); + } } } while (m == NULL); + mtx_unlock(&tp->tap_mtx); /* feed packet to bpf */ BPF_MTAP(ifp, m); @@ -982,14 +963,14 @@ tappoll(struct cdev *dev, int events, st { struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s, revents = 0; + int revents = 0; TAPDEBUG("%s polling, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - s = splimp(); if (events & (POLLIN | POLLRDNORM)) { - if (ifp->if_snd.ifq_len > 0) { + IFQ_LOCK(&ifp->if_snd); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { TAPDEBUG("%s have data in queue. len = %d, " \ "minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, dev2unit(dev)); @@ -1001,12 +982,12 @@ tappoll(struct cdev *dev, int events, st selrecord(td, &tp->tap_rsel); } + IFQ_UNLOCK(&ifp->if_snd); } if (events & (POLLOUT | POLLWRNORM)) revents |= (events & (POLLOUT | POLLWRNORM)); - splx(s); return (revents); } /* tappoll */ @@ -1019,11 +1000,9 @@ tappoll(struct cdev *dev, int events, st static int tapkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); switch (kn->kn_filter) { case EVFILT_READ: TAPDEBUG("%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1040,13 +1019,11 @@ tapkqfilter(struct cdev *dev, struct kno default: TAPDEBUG("%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - splx(s); return (EINVAL); /* NOT REACHED */ } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tap_rsel.si_note, kn, 0); return (0); @@ -1061,12 +1038,11 @@ tapkqfilter(struct cdev *dev, struct kno static int tapkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tap_softc *tp = dev->si_drv1; + int ret; + struct tap_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tap_dev; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TAPDEBUG("%s have data in queue. len = %d, minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, dev2unit(dev)); @@ -1076,7 +1052,6 @@ tapkqread(struct knote *kn, long hint) ifp->if_xname, dev2unit(dev)); ret = 0; } - splx(s); return (ret); } /* tapkqread */ @@ -1090,13 +1065,10 @@ tapkqread(struct knote *kn, long hint) static int tapkqwrite(struct knote *kn, long hint) { - int s; - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } /* tapkqwrite */ @@ -1105,7 +1077,7 @@ tapkqwrite(struct knote *kn, long hint) static void tapkqdetach(struct knote *kn) { - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; knlist_remove(&tp->tap_rsel.si_note, kn, 0); } /* tapkqdetach */ Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Wed Sep 22 20:27:59 2010 (r213027) +++ head/sys/net/if_tun.c Wed Sep 22 21:02:43 2010 (r213028) @@ -165,7 +165,7 @@ static struct filterops tun_write_filter static struct cdevsw tun_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, + .d_flags = D_PSEUDO | D_NEEDMINOR, .d_open = tunopen, .d_close = tunclose, .d_read = tunread, @@ -344,13 +344,13 @@ tunstart(struct ifnet *ifp) tp->tun_flags &= ~TUN_RWAIT; wakeup(tp); } + selwakeuppri(&tp->tun_rsel, PZERO + 1); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) { mtx_unlock(&tp->tun_mtx); pgsigio(&tp->tun_sigio, SIGIO, 0); } else mtx_unlock(&tp->tun_mtx); - selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); } /* XXX: should return an error code so it can fail. */ @@ -385,7 +385,7 @@ tuncreate(const char *name, struct cdev IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); - knlist_init_mtx(&sc->tun_rsel.si_note, NULL); + knlist_init_mtx(&sc->tun_rsel.si_note, &sc->tun_mtx); ifp->if_capabilities |= IFCAP_LINKSTATE; ifp->if_capenable |= IFCAP_LINKSTATE; @@ -426,10 +426,10 @@ tunopen(struct cdev *dev, int flag, int tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; - mtx_unlock(&tp->tun_mtx); ifp = TUN2IFP(tp); if_link_state_change(ifp, LINK_STATE_UP); TUNDEBUG(ifp, "open\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -443,7 +443,6 @@ tunclose(struct cdev *dev, int foo, int { struct tun_softc *tp; struct ifnet *ifp; - int s; tp = dev->si_drv1; ifp = TUN2IFP(tp); @@ -451,27 +450,25 @@ tunclose(struct cdev *dev, int foo, int mtx_lock(&tp->tun_mtx); tp->tun_flags &= ~TUN_OPEN; tp->tun_pid = 0; - mtx_unlock(&tp->tun_mtx); /* * junk all pending output */ CURVNET_SET(ifp->if_vnet); - s = splimp(); IFQ_PURGE(&ifp->if_snd); - splx(s); if (ifp->if_flags & IFF_UP) { - s = splimp(); + mtx_unlock(&tp->tun_mtx); if_down(ifp); - splx(s); + mtx_lock(&tp->tun_mtx); } /* Delete all addresses and routes which reference this interface. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; - s = splimp(); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tun_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { /* deal w/IPv4 PtP destination; unlocked read */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -482,16 +479,14 @@ tunclose(struct cdev *dev, int foo, int } } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - splx(s); + mtx_lock(&tp->tun_mtx); } if_link_state_change(ifp, LINK_STATE_DOWN); CURVNET_RESTORE(); - mtx_lock(&tp->tun_mtx); funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); cv_broadcast(&tp->tun_cv); @@ -510,6 +505,7 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "tuninit\n"); + mtx_lock(&tp->tun_mtx); ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); @@ -521,18 +517,17 @@ tuninit(struct ifnet *ifp) struct sockaddr_in *si; si = (struct sockaddr_in *)ifa->ifa_addr; - mtx_lock(&tp->tun_mtx); if (si->sin_addr.s_addr) tp->tun_flags |= TUN_IASET; si = (struct sockaddr_in *)ifa->ifa_dstaddr; if (si && si->sin_addr.s_addr) tp->tun_flags |= TUN_DSTADDR; - mtx_unlock(&tp->tun_mtx); } } if_addr_runlock(ifp); #endif + mtx_unlock(&tp->tun_mtx); return (error); } @@ -545,9 +540,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd struct ifreq *ifr = (struct ifreq *)data; struct tun_softc *tp = ifp->if_softc; struct ifstat *ifs; - int error = 0, s; + int error = 0; - s = splimp(); switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -576,7 +570,6 @@ tunifioctl(struct ifnet *ifp, u_long cmd default: error = EINVAL; } - splx(s); return (error); } @@ -682,7 +675,6 @@ tunoutput( static int tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { - int s; int error; struct tun_softc *tp = dev->si_drv1; struct tuninfo *tunp; @@ -697,15 +689,19 @@ tunioctl(struct cdev *dev, u_long cmd, c if (error) return (error); } + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_mtu = tunp->mtu; TUN2IFP(tp)->if_type = tunp->type; TUN2IFP(tp)->if_baudrate = tunp->baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNGIFINFO: tunp = (struct tuninfo *)data; + mtx_lock(&tp->tun_mtx); tunp->mtu = TUN2IFP(tp)->if_mtu; tunp->type = TUN2IFP(tp)->if_type; tunp->baudrate = TUN2IFP(tp)->if_baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNSDEBUG: tundebug = *(int *)data; @@ -732,7 +728,6 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case TUNGIFHEAD: - /* Could be unlocked read? */ mtx_lock(&tp->tun_mtx); *(int *)data = (tp->tun_flags & TUN_IFHEAD) ? 1 : 0; mtx_unlock(&tp->tun_mtx); @@ -745,9 +740,11 @@ tunioctl(struct cdev *dev, u_long cmd, c switch (*(int *)data & ~IFF_MULTICAST) { case IFF_POINTOPOINT: case IFF_BROADCAST: + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_flags &= ~(IFF_BROADCAST|IFF_POINTOPOINT|IFF_MULTICAST); TUN2IFP(tp)->if_flags |= *(int *)data; + mtx_unlock(&tp->tun_mtx); break; default: return(EINVAL); @@ -769,17 +766,15 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case FIONREAD: - s = splimp(); if (!IFQ_IS_EMPTY(&TUN2IFP(tp)->if_snd)) { struct mbuf *mb; IFQ_LOCK(&TUN2IFP(tp)->if_snd); IFQ_POLL_NOLOCK(&TUN2IFP(tp)->if_snd, mb); - for( *(int *)data = 0; mb != 0; mb = mb->m_next) + for (*(int *)data = 0; mb != NULL; mb = mb->m_next) *(int *)data += mb->m_len; IFQ_UNLOCK(&TUN2IFP(tp)->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: return (fsetown(*(int *)data, &tp->tun_sigio)); @@ -813,7 +808,7 @@ tunread(struct cdev *dev, struct uio *ui struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - int error=0, len, s; + int error=0, len; TUNDEBUG (ifp, "read\n"); mtx_lock(&tp->tun_mtx); @@ -824,27 +819,24 @@ tunread(struct cdev *dev, struct uio *ui } tp->tun_flags &= ~TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - s = splimp(); do { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { if (flag & O_NONBLOCK) { - splx(s); + mtx_unlock(&tp->tun_mtx); return (EWOULDBLOCK); } - mtx_lock(&tp->tun_mtx); tp->tun_flags |= TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - if ((error = tsleep(tp, PCATCH | (PZERO + 1), - "tunread", 0)) != 0) { - splx(s); + error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1), + "tunread", 0); + if (error != 0) { + mtx_unlock(&tp->tun_mtx); return (error); } } } while (m == NULL); - splx(s); + mtx_unlock(&tp->tun_mtx); while (m && uio->uio_resid > 0 && error == 0) { len = min(uio->uio_resid, m->m_len); @@ -957,13 +949,11 @@ tunwrite(struct cdev *dev, struct uio *u static int tunpoll(struct cdev *dev, int events, struct thread *td) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); int revents = 0; struct mbuf *m; - s = splimp(); TUNDEBUG(ifp, "tunpoll\n"); if (events & (POLLIN | POLLRDNORM)) { @@ -981,7 +971,6 @@ tunpoll(struct cdev *dev, int events, st if (events & (POLLOUT | POLLWRNORM)) revents |= events & (POLLOUT | POLLWRNORM); - splx(s); return (revents); } @@ -991,11 +980,9 @@ tunpoll(struct cdev *dev, int events, st static int tunkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); switch(kn->kn_filter) { case EVFILT_READ: TUNDEBUG(ifp, "%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1012,12 +999,10 @@ tunkqfilter(struct cdev *dev, struct kno default: TUNDEBUG(ifp, "%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - splx(s); return(EINVAL); } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tun_rsel.si_note, kn, 0); return (0); @@ -1029,12 +1014,11 @@ tunkqfilter(struct cdev *dev, struct kno static int tunkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tun_softc *tp = dev->si_drv1; + int ret; + struct tun_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tun_dev; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TUNDEBUG(ifp, "%s have data in the queue. Len = %d, minor = %#x\n", @@ -1046,7 +1030,6 @@ tunkqread(struct knote *kn, long hint) dev2unit(dev)); ret = 0; } - splx(s); return (ret); } @@ -1057,13 +1040,10 @@ tunkqread(struct knote *kn, long hint) static int tunkqwrite(struct knote *kn, long hint) { - int s; - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } @@ -1071,7 +1051,7 @@ tunkqwrite(struct knote *kn, long hint) static void tunkqdetach(struct knote *kn) { - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; knlist_remove(&tp->tun_rsel.si_note, kn, 0); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:10:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53A361065674; Wed, 22 Sep 2010 21:10:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43D888FC15; Wed, 22 Sep 2010 21:10:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MLAkEV043728; Wed, 22 Sep 2010 21:10:46 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MLAkm0043726; Wed, 22 Sep 2010 21:10:46 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201009222110.o8MLAkm0043726@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 22 Sep 2010 21:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213032 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:10:46 -0000 Author: edwin Date: Wed Sep 22 21:10:45 2010 New Revision: 213032 URL: http://svn.freebsd.org/changeset/base/213032 Log: Fix location of the Battle of the Plains of Abraham PR: 150504 Submitted by: Douglas Berry MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Wed Sep 22 21:06:43 2010 (r213031) +++ head/usr.bin/calendar/calendars/calendar.history Wed Sep 22 21:10:45 2010 (r213032) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham near Quebec City, 1788 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:14:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCBB1065696; Wed, 22 Sep 2010 21:14:19 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FDB08FC26; Wed, 22 Sep 2010 21:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MLEJYU043981; Wed, 22 Sep 2010 21:14:19 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MLEJ5H043979; Wed, 22 Sep 2010 21:14:19 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201009222114.o8MLEJ5H043979@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 22 Sep 2010 21:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213033 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:14:19 -0000 Author: edwin Date: Wed Sep 22 21:14:18 2010 New Revision: 213033 URL: http://svn.freebsd.org/changeset/base/213033 Log: And now the 2nd part of the patch: Also fix the year. PR: 150504 Submitted by: Douglas Berry Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Wed Sep 22 21:10:45 2010 (r213032) +++ head/usr.bin/calendar/calendars/calendar.history Wed Sep 22 21:14:18 2010 (r213033) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at the Plains of Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham, just outside the walls of Quebec City, 1759 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:22:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98DB31065673; Wed, 22 Sep 2010 21:22:20 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmailB.acsu.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 62C398FC0A; Wed, 22 Sep 2010 21:22:19 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 00F015A47; Wed, 22 Sep 2010 17:15:34 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id D2B585A2D; Wed, 22 Sep 2010 17:15:28 -0400 (EDT) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id BBB0E5966; Wed, 22 Sep 2010 17:15:28 -0400 (EDT) Received: from ken-smiths-macbook-pro.local (cpe-76-180-182-44.buffalo.res.rr.com [76.180.182.44]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id 46C945B0038; Wed, 22 Sep 2010 17:15:28 -0400 (EDT) Message-ID: <4C9A71ED.6020406@buffalo.edu> Date: Wed, 22 Sep 2010 17:15:25 -0400 From: Ken Smith User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Andriy Gapon References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> In-Reply-To: <4C9A6EE6.5050301@freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-PM-EL-Spam-Prob: XX: 27% Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:22:20 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 9/22/10 5:02 PM, Andriy Gapon wrote: > on 22/09/2010 22:58 John Baldwin said the following: > >> Agreed. FWIW, I actually think that this is the only change needed as >> crashinfo is enabled by default in 8.x and later. We already include symbols >> in kernels by default now, so just setting dumpdev will give you the same >> info you generally can get from a textdump in the form of a simple >> /var/crash/core.txt.N file. >> >> The other benefit of full crashdumps + crashinfo as compared to textdumps is >> that a developer can request further information in a PR followup (fire up >> kgdb and enter command 'X' and reply with the output). With a textdump any >> info not collected by the textdump is lost once the machine reboots after the >> crash. > > Agree++ > But what was the reason that dumpdev="AUTO" was reverted? > I remember that POLA was quoted at the time. > I am not sure what the astonishment actually was - perhaps 'AUTO' was not smart > enough and destroyed somebody's data? > Not everybody would notice /var getting full of crash dumps. Picture a server farm where for the most part the machines are all just plain on auto-pilot. If one or several develop a problem that causes panic's /var can become full and possibly cause the machine to stop doing something important (between panic's...). I wasn't around when the initial decision for what to have it set to was made but this was the reason for me starting to do it again when I realized I forgot to at least once, and hence the reference to POLA. Crash dumps are good for individual workstations. Crash dumps are good for servers *if* the admin knows they're having a problem and is actively working on that server to resolve the issue. But they're no so good and can cause nasty side-effects if they're happening on a machine not being watched over closely. That's the reason for the change in setting when a -stable branch gets started. - -- Ken Smith - - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyace0ACgkQ/G14VSmup/bfKwCdGWyWxuG91GSss6q3MUFAPi2r 6iwAmgLxxEXEODYubhfOFGkzwNx9r/Au =IIBd -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:53:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9E13106566C; Wed, 22 Sep 2010 21:53:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 99C628FC08; Wed, 22 Sep 2010 21:53:48 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 48C0D46B46; Wed, 22 Sep 2010 17:53:48 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 415F58A04E; Wed, 22 Sep 2010 17:53:47 -0400 (EDT) From: John Baldwin To: Ken Smith Date: Wed, 22 Sep 2010 17:53:21 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A6EE6.5050301@freebsd.org> <4C9A71ED.6020406@buffalo.edu> In-Reply-To: <4C9A71ED.6020406@buffalo.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009221753.21408.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 22 Sep 2010 17:53:47 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:53:48 -0000 On Wednesday, September 22, 2010 5:15:25 pm Ken Smith wrote: > On 9/22/10 5:02 PM, Andriy Gapon wrote: > > on 22/09/2010 22:58 John Baldwin said the following: > > > >> Agreed. FWIW, I actually think that this is the only change needed as > >> crashinfo is enabled by default in 8.x and later. We already include symbols > >> in kernels by default now, so just setting dumpdev will give you the same > >> info you generally can get from a textdump in the form of a simple > >> /var/crash/core.txt.N file. > >> > >> The other benefit of full crashdumps + crashinfo as compared to textdumps is > >> that a developer can request further information in a PR followup (fire up > >> kgdb and enter command 'X' and reply with the output). With a textdump any > >> info not collected by the textdump is lost once the machine reboots after the > >> crash. > > > > Agree++ > > But what was the reason that dumpdev="AUTO" was reverted? > > I remember that POLA was quoted at the time. > > I am not sure what the astonishment actually was - perhaps 'AUTO' was not smart > > enough and destroyed somebody's data? > > > > > Not everybody would notice /var getting full of crash dumps. > Picture a server farm where for the most part the machines > are all just plain on auto-pilot. If one or several develop > a problem that causes panic's /var can become full and possibly > cause the machine to stop doing something important (between > panic's...). I wasn't around when the initial decision for > what to have it set to was made but this was the reason for > me starting to do it again when I realized I forgot to at > least once, and hence the reference to POLA. > > Crash dumps are good for individual workstations. Crash > dumps are good for servers *if* the admin knows they're > having a problem and is actively working on that server > to resolve the issue. But they're no so good and can > cause nasty side-effects if they're happening on a machine > not being watched over closely. That's the reason for > the change in setting when a -stable branch gets started. FWIW, the Y! version of crashinfo auto-deletes crash dumps based on the available disk space for precisely this reason. With that addition crashinfo works quite well on a very large server farm. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 21:57:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7909F1065670; Wed, 22 Sep 2010 21:57:03 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from queueout02-winn.ispmail.ntl.com (queueout02-winn.ispmail.ntl.com [81.103.221.56]) by mx1.freebsd.org (Postfix) with ESMTP id 199768FC13; Wed, 22 Sep 2010 21:57:01 +0000 (UTC) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100922212445.ZFKO3075.mtaout03-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net>; Wed, 22 Sep 2010 22:24:45 +0100 Received: from [86.31.87.130] (helo=unknown) by know-smtpout-4.server.virginmedia.net with esmtp (Exim 4.63) (envelope-from ) id 1OyWo1-0002NQ-80; Wed, 22 Sep 2010 22:24:45 +0100 Date: Wed, 22 Sep 2010 22:24:41 +0100 From: Bruce Cran To: Andriy Gapon Message-ID: <20100922222441.00002f27@unknown> In-Reply-To: <4C9A6EE6.5050301@freebsd.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=3ENABmdyEd/Fm7fR7+mZIuMDn6+IErAeEhlfWBImZFk= c=1 sm=0 a=eMkYoSNlslsA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=mLnWKSbTkEf9j1wKOzIA:9 a=y6gBx-ZuQ5kXiikVPmfYdMhZ_6IA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 21:57:03 -0000 On Thu, 23 Sep 2010 00:02:30 +0300 Andriy Gapon wrote: > But what was the reason that dumpdev="AUTO" was reverted? > I remember that POLA was quoted at the time. > I am not sure what the astonishment actually was - perhaps 'AUTO' was > not smart enough and destroyed somebody's data? > The problem with "AUTO" is that it takes time to do the dump unless using textdumps; it also has the potential of failing and leaving the system unusable until someone resets it. I believe the argument was that for production servers you want the system to be up and running again as soon as possible after a crash. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Wed Sep 22 23:41:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F4B5106566C; Wed, 22 Sep 2010 23:41:03 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2B8C8FC1D; Wed, 22 Sep 2010 23:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8MNf2Q5047636; Wed, 22 Sep 2010 23:41:02 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8MNf25m047634; Wed, 22 Sep 2010 23:41:02 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201009222341.o8MNf25m047634@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 22 Sep 2010 23:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213042 - head/lib/libbluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2010 23:41:03 -0000 Author: emax Date: Wed Sep 22 23:41:02 2010 New Revision: 213042 URL: http://svn.freebsd.org/changeset/base/213042 Log: Add the following Linux BlueZ compatibility macros: htobs(), htobl(), btohs() and btohl() PR: kern/136386 Submitted by: Monty Hall < kungfu_disciple at sbcglobal dot net > MFC after: 1 week Modified: head/lib/libbluetooth/bluetooth.h Modified: head/lib/libbluetooth/bluetooth.h ============================================================================== --- head/lib/libbluetooth/bluetooth.h Wed Sep 22 22:17:39 2010 (r213041) +++ head/lib/libbluetooth/bluetooth.h Wed Sep 22 23:41:02 2010 (r213042) @@ -59,6 +59,10 @@ __BEGIN_DECLS #define bacpy(dst, src) memcpy((dst), (src), sizeof(bdaddr_t)) #define ba2str(ba, str) bt_ntoa((ba), (str)) #define str2ba(str, ba) (bt_aton((str), (ba)) == 1? 0 : -1) +#define htobs(d) htole16(d) +#define htobl(d) htole32(d) +#define btohs(d) le16toh(d) +#define btohl(d) le32toh(d) /* * Interface to the outside world From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 01:24:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C065B1065673; Thu, 23 Sep 2010 01:24:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFCF08FC12; Thu, 23 Sep 2010 01:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8N1OXF8050005; Thu, 23 Sep 2010 01:24:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8N1OXQT050003; Thu, 23 Sep 2010 01:24:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201009230124.o8N1OXQT050003@svn.freebsd.org> From: Xin LI Date: Thu, 23 Sep 2010 01:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213044 - head/usr.bin/gzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 01:24:33 -0000 Author: delphij Date: Thu Sep 23 01:24:33 2010 New Revision: 213044 URL: http://svn.freebsd.org/changeset/base/213044 Log: In the past gunzip(1) write()'s after each inflate return. This is not optimal from a performance standpoint since the write buffer is not necessarily be filled up when the inflate rountine reached the end of input buffer and it's not the end of file. This problem gets uncovered by trying to pipe gunzip -c output to a GEOM device directly, which enforces the writes be multiple of sector size. Sponsored by: iXsystems, Inc. Reported by: jpaetzel MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Thu Sep 23 01:19:31 2010 (r213043) +++ head/usr.bin/gzip/gzip.c Thu Sep 23 01:24:33 2010 (r213044) @@ -916,6 +916,8 @@ gz_uncompress(int in, int out, char *pre switch (error) { /* Z_BUF_ERROR goes with Z_FINISH... */ case Z_BUF_ERROR: + if (z.avail_out > 0 && !done_reading) + continue; case Z_STREAM_END: case Z_OK: break; From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 05:17:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263BC1065670; Thu, 23 Sep 2010 05:17:37 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15D9E8FC0C; Thu, 23 Sep 2010 05:17:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8N5Ha3T054810; Thu, 23 Sep 2010 05:17:36 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8N5Hapb054808; Thu, 23 Sep 2010 05:17:36 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009230517.o8N5Hapb054808@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 23 Sep 2010 05:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213047 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 05:17:37 -0000 Author: jchandra Date: Thu Sep 23 05:17:36 2010 New Revision: 213047 URL: http://svn.freebsd.org/changeset/base/213047 Log: Add missing byteswap, works on big endian systems now (tested on Netlogic XLS MIPS processor). Submitted by: Sreekanth M. S. Reviewed by: mav Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Sep 23 01:38:52 2010 (r213046) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Sep 23 05:17:36 2010 (r213047) @@ -649,7 +649,7 @@ ata_siiprb_end_transaction(struct ata_re /* update progress */ if (!(request->status & ATA_S_ERROR) && !(request->flags & ATA_R_TIMEOUT)) { if (request->flags & ATA_R_READ) - request->donecount = prb->transfer_count; + request->donecount = le32toh(prb->transfer_count); else request->donecount = request->bytecount; } From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 05:24:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAF461065695; Thu, 23 Sep 2010 05:24:50 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BADE68FC08; Thu, 23 Sep 2010 05:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8N5OoVE055001; Thu, 23 Sep 2010 05:24:50 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8N5Oo9R054999; Thu, 23 Sep 2010 05:24:50 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009230524.o8N5Oo9R054999@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 23 Sep 2010 05:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213048 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 05:24:50 -0000 Author: jchandra Date: Thu Sep 23 05:24:50 2010 New Revision: 213048 URL: http://svn.freebsd.org/changeset/base/213048 Log: Add MIPS platform, this will make bsdlabel(8) work on MIPS (when invoked without a -m option. -m mips is still not supported) Modified: head/sys/sys/disklabel.h Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Thu Sep 23 05:17:36 2010 (r213047) +++ head/sys/sys/disklabel.h Thu Sep 23 05:24:50 2010 (r213048) @@ -52,7 +52,7 @@ /* XXX these should be defined per controller (or drive) elsewhere, not here! */ #if defined(__i386__) || defined(__amd64__) || defined(__arm__) || \ - defined(__ia64__) || defined(__powerpc__) + defined(__ia64__) || defined(__powerpc__) || defined(__mips__) #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #endif From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 10:03:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C908D106564A; Thu, 23 Sep 2010 10:03:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B7F8FC16; Thu, 23 Sep 2010 10:03:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NA33IQ060959; Thu, 23 Sep 2010 10:03:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NA33Yt060957; Thu, 23 Sep 2010 10:03:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009231003.o8NA33Yt060957@svn.freebsd.org> From: Marius Strobl Date: Thu, 23 Sep 2010 10:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213053 - head/usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 10:03:03 -0000 Author: marius Date: Thu Sep 23 10:03:03 2010 New Revision: 213053 URL: http://svn.freebsd.org/changeset/base/213053 Log: Remove an explicit assignment of the CFLAGS variable intended for debugging purposes only. MFC after: 3 days Modified: head/usr.bin/tftp/Makefile Modified: head/usr.bin/tftp/Makefile ============================================================================== --- head/usr.bin/tftp/Makefile Thu Sep 23 09:56:02 2010 (r213052) +++ head/usr.bin/tftp/Makefile Thu Sep 23 10:03:03 2010 (r213053) @@ -1,7 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -CFLAGS=-g -Wall WARNS= 3 PROG= tftp SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 10:43:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331D2106566B; Thu, 23 Sep 2010 10:43:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C098FC1A; Thu, 23 Sep 2010 10:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NAhc6R061835; Thu, 23 Sep 2010 10:43:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NAhcY5061833; Thu, 23 Sep 2010 10:43:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231043.o8NAhcY5061833@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 10:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213055 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 10:43:38 -0000 Author: pjd Date: Thu Sep 23 10:43:37 2010 New Revision: 213055 URL: http://svn.freebsd.org/changeset/base/213055 Log: When trashing metadata, flush after each write. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_ctl.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Thu Sep 23 10:20:28 2010 (r213054) +++ head/sys/geom/eli/g_eli_ctl.c Thu Sep 23 10:43:37 2010 (r213055) @@ -739,6 +739,13 @@ g_eli_kill_one(struct g_eli_softc *sc) if (error == 0) error = err; } + err = g_io_flush(cp); + if (err != 0) { + G_ELI_DEBUG(0, "Cannot flush %s (error=%d).", + pp->name, err); + if (error == 0) + error = err; + } } free(sector, M_ELI); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 10:50:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E36151065674; Thu, 23 Sep 2010 10:50:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89C58FC1B; Thu, 23 Sep 2010 10:50:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NAoHob062018; Thu, 23 Sep 2010 10:50:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NAoHTd062016; Thu, 23 Sep 2010 10:50:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231050.o8NAoHTd062016@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 10:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213056 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 10:50:18 -0000 Author: pjd Date: Thu Sep 23 10:50:17 2010 New Revision: 213056 URL: http://svn.freebsd.org/changeset/base/213056 Log: Simplify code a bit by using g_*() API from libgeom. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:43:37 2010 (r213055) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:50:17 2010 (r213056) @@ -1268,7 +1268,7 @@ eli_resize(struct gctl_req *req) struct g_eli_metadata md; const char *prov; unsigned char *sector; - unsigned secsize; + ssize_t secsize; off_t mediasize, oldsize; int nargs, provfd; @@ -1283,21 +1283,15 @@ eli_resize(struct gctl_req *req) sector = NULL; secsize = 0; - provfd = open(prov, O_RDWR); - if (provfd == -1 && errno == ENOENT && prov[0] != '/') { - char devprov[MAXPATHLEN]; - - snprintf(devprov, sizeof(devprov), "%s%s", _PATH_DEV, prov); - provfd = open(devprov, O_RDWR); - } + provfd = g_open(prov, 1); if (provfd == -1) { gctl_error(req, "Cannot open %s: %s.", prov, strerror(errno)); goto out; } - mediasize = g_get_mediasize(prov); - secsize = g_get_sectorsize(prov); - if (mediasize == 0 || secsize == 0) { + mediasize = g_mediasize(provfd); + secsize = g_sectorsize(provfd); + if (mediasize == -1 || secsize == -1) { gctl_error(req, "Cannot get information about %s: %s.", prov, strerror(errno)); goto out; @@ -1316,8 +1310,7 @@ eli_resize(struct gctl_req *req) } /* Read metadata from the 'oldsize' offset. */ - if (pread(provfd, sector, secsize, oldsize - secsize) != - (ssize_t)secsize) { + if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { gctl_error(req, "Cannot read old metadata: %s.", strerror(errno)); goto out; @@ -1344,23 +1337,21 @@ eli_resize(struct gctl_req *req) */ md.md_provsize = mediasize; eli_metadata_encode(&md, sector); - if (pwrite(provfd, sector, secsize, mediasize - secsize) != - (ssize_t)secsize) { + if (pwrite(provfd, sector, secsize, mediasize - secsize) != secsize) { gctl_error(req, "Cannot write metadata: %s.", strerror(errno)); goto out; } /* Now trash the old metadata. */ arc4rand(sector, secsize); - if (pwrite(provfd, sector, secsize, oldsize - secsize) != - (ssize_t)secsize) { + if (pwrite(provfd, sector, secsize, oldsize - secsize) != secsize) { gctl_error(req, "Failed to clobber old metadata: %s.", strerror(errno)); goto out; } out: - if (provfd > 0) - close(provfd); + if (provfd >= 0) + (void)g_close(provfd); if (sector != NULL) { bzero(sector, secsize); free(sector); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 10:55:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34C1F1065697; Thu, 23 Sep 2010 10:55:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09CA18FC19; Thu, 23 Sep 2010 10:55:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NAtjlK062156; Thu, 23 Sep 2010 10:55:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NAtjqE062154; Thu, 23 Sep 2010 10:55:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231055.o8NAtjqE062154@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 10:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213057 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 10:55:46 -0000 Author: pjd Date: Thu Sep 23 10:55:45 2010 New Revision: 213057 URL: http://svn.freebsd.org/changeset/base/213057 Log: - Make use of g_*() API. - Flush cache after writing metadata. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:50:17 2010 (r213056) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:55:45 2010 (r213057) @@ -1176,7 +1176,7 @@ eli_restore(struct gctl_req *req) struct g_eli_metadata md; const char *file, *prov; unsigned char *sector; - unsigned secsize; + ssize_t secsize; off_t mediasize; int nargs, filefd, provfd; @@ -1197,21 +1197,15 @@ eli_restore(struct gctl_req *req) gctl_error(req, "Cannot open %s: %s.", file, strerror(errno)); goto out; } - provfd = open(prov, O_WRONLY); - if (provfd == -1 && errno == ENOENT && prov[0] != '/') { - char devprov[MAXPATHLEN]; - - snprintf(devprov, sizeof(devprov), "%s%s", _PATH_DEV, prov); - provfd = open(devprov, O_WRONLY); - } + provfd = g_open(prov, 1); if (provfd == -1) { gctl_error(req, "Cannot open %s: %s.", prov, strerror(errno)); goto out; } - mediasize = g_get_mediasize(prov); - secsize = g_get_sectorsize(prov); - if (mediasize == 0 || secsize == 0) { + mediasize = g_mediasize(provfd); + secsize = g_sectorsize(provfd); + if (mediasize == -1 || secsize == -1) { gctl_error(req, "Cannot get informations about %s: %s.", prov, strerror(errno)); goto out; @@ -1224,7 +1218,7 @@ eli_restore(struct gctl_req *req) } /* Read metadata from the backup file. */ - if (read(filefd, sector, secsize) != (ssize_t)secsize) { + if (read(filefd, sector, secsize) != secsize) { gctl_error(req, "Cannot read from %s: %s.", file, strerror(errno)); goto out; @@ -1246,16 +1240,16 @@ eli_restore(struct gctl_req *req) } } /* Write metadata from the provider. */ - if (pwrite(provfd, sector, secsize, mediasize - secsize) != - (ssize_t)secsize) { + if (pwrite(provfd, sector, secsize, mediasize - secsize) != secsize) { gctl_error(req, "Cannot write metadata: %s.", strerror(errno)); goto out; } + (void)g_flush(provfd); out: - if (provfd > 0) - close(provfd); - if (filefd > 0) - close(filefd); + if (provfd >= 0) + (void)g_close(provfd); + if (filefd >= 0) + (void)close(filefd); if (sector != NULL) { bzero(sector, secsize); free(sector); @@ -1341,6 +1335,7 @@ eli_resize(struct gctl_req *req) gctl_error(req, "Cannot write metadata: %s.", strerror(errno)); goto out; } + (void)g_flush(provfd); /* Now trash the old metadata. */ arc4rand(sector, secsize); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 10:58:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A68201065673; Thu, 23 Sep 2010 10:58:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964EA8FC21; Thu, 23 Sep 2010 10:58:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NAwD1Y066674; Thu, 23 Sep 2010 10:58:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NAwDUo066672; Thu, 23 Sep 2010 10:58:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231058.o8NAwDUo066672@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 10:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213058 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 10:58:13 -0000 Author: pjd Date: Thu Sep 23 10:58:13 2010 New Revision: 213058 URL: http://svn.freebsd.org/changeset/base/213058 Log: Because we first write metadata into new place and then trash old place we don't want situation where old size is equal to new size, as we will trash newly written metadata. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:55:45 2010 (r213057) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:58:13 2010 (r213058) @@ -1302,6 +1302,10 @@ eli_resize(struct gctl_req *req) gctl_error(req, "Invalid oldsize: Out of range."); goto out; } + if (oldsize == mediasize) { + gctl_error(req, "Size hasn't changed."); + goto out; + } /* Read metadata from the 'oldsize' offset. */ if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:04:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31342106564A; Thu, 23 Sep 2010 11:04:51 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 063798FC08; Thu, 23 Sep 2010 11:04:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NB4oZF066862; Thu, 23 Sep 2010 11:04:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NB4oXl066860; Thu, 23 Sep 2010 11:04:50 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231104.o8NB4oXl066860@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213059 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:04:51 -0000 Author: pjd Date: Thu Sep 23 11:04:50 2010 New Revision: 213059 URL: http://svn.freebsd.org/changeset/base/213059 Log: - Use g_*() API when doing backups. - fsync() created filed. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:58:13 2010 (r213058) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 11:04:50 2010 (r213059) @@ -1081,8 +1081,8 @@ static int eli_backup_create(struct gctl_req *req, const char *prov, const char *file) { struct g_eli_metadata md; - unsigned secsize; unsigned char *sector; + ssize_t secsize; off_t mediasize; int filefd, provfd, ret; @@ -1091,13 +1091,7 @@ eli_backup_create(struct gctl_req *req, sector = NULL; secsize = 0; - provfd = open(prov, O_RDONLY); - if (provfd == -1 && errno == ENOENT && prov[0] != '/') { - char devprov[MAXPATHLEN]; - - snprintf(devprov, sizeof(devprov), "%s%s", _PATH_DEV, prov); - provfd = open(devprov, O_RDONLY); - } + provfd = g_open(prov, 0); if (provfd == -1) { gctl_error(req, "Cannot open %s: %s.", prov, strerror(errno)); goto out; @@ -1108,9 +1102,9 @@ eli_backup_create(struct gctl_req *req, goto out; } - mediasize = g_get_mediasize(prov); - secsize = g_get_sectorsize(prov); - if (mediasize == 0 || secsize == 0) { + mediasize = g_mediasize(provfd); + secsize = g_sectorsize(provfd); + if (mediasize == -1 || secsize == -1) { gctl_error(req, "Cannot get informations about %s: %s.", prov, strerror(errno)); goto out; @@ -1123,8 +1117,7 @@ eli_backup_create(struct gctl_req *req, } /* Read metadata from the provider. */ - if (pread(provfd, sector, secsize, mediasize - secsize) != - (ssize_t)secsize) { + if (pread(provfd, sector, secsize, mediasize - secsize) != secsize) { gctl_error(req, "Cannot read metadata: %s.", strerror(errno)); goto out; } @@ -1134,18 +1127,19 @@ eli_backup_create(struct gctl_req *req, goto out; } /* Write metadata to the destination file. */ - if (write(filefd, sector, secsize) != (ssize_t)secsize) { + if (write(filefd, sector, secsize) != secsize) { gctl_error(req, "Cannot write to %s: %s.", file, strerror(errno)); goto out; } + (void)fsync(filefd); /* Success. */ ret = 0; out: - if (provfd > 0) - close(provfd); - if (filefd > 0) - close(filefd); + if (provfd >= 0) + (void)g_close(provfd); + if (filefd >= 0) + (void)close(filefd); if (sector != NULL) { bzero(sector, secsize); free(sector); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:18:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE3C8106564A; Thu, 23 Sep 2010 11:18:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 937048FC17; Thu, 23 Sep 2010 11:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBI2PQ067149; Thu, 23 Sep 2010 11:18:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBI25C067147; Thu, 23 Sep 2010 11:18:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231118.o8NBI25C067147@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213060 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:18:02 -0000 Author: pjd Date: Thu Sep 23 11:18:02 2010 New Revision: 213060 URL: http://svn.freebsd.org/changeset/base/213060 Log: - When trashing metadata, repeat overwrite kern.geom.eli.overwrites times. - Flush write cache after each write. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 11:04:50 2010 (r213059) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 11:18:02 2010 (r213060) @@ -27,6 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include #include #include @@ -1015,11 +1018,54 @@ eli_delkey(struct gctl_req *req) eli_delkey_detached(req, prov); } +static int +eli_trash_metadata(struct gctl_req *req, const char *prov, int fd, off_t offset) +{ + unsigned int overwrites; + unsigned char *sector; + ssize_t size; + int error; + + size = sizeof(overwrites); + if (sysctlbyname("kern.geom.eli.overwrites", &overwrites, &size, + NULL, 0) == -1 || overwrites == 0) { + overwrites = G_ELI_OVERWRITES; + } + + size = g_sectorsize(fd); + if (size <= 0) { + gctl_error(req, "Cannot obtain provider sector size %s: %s.", + prov, strerror(errno)); + return (-1); + } + sector = malloc(size); + if (sector == NULL) { + gctl_error(req, "Cannot allocate %zd bytes of memory.", size); + return (-1); + } + + error = 0; + do { + arc4rand(sector, size); + if (pwrite(fd, sector, size, offset) != size) { + if (error == 0) + error = errno; + } + (void)g_flush(fd); + } while (--overwrites > 0); + if (error != 0) { + gctl_error(req, "Cannot trash metadata on provider %s: %s.", + prov, strerror(error)); + return (-1); + } + return (0); +} + static void eli_kill_detached(struct gctl_req *req, const char *prov) { - struct g_eli_metadata md; - int error; + off_t offset; + int fd; /* * NOTE: Maybe we should verify if this is geli provider first, @@ -1036,12 +1082,22 @@ eli_kill_detached(struct gctl_req *req, } #endif - arc4rand((unsigned char *)&md, sizeof(md)); - error = g_metadata_store(prov, (unsigned char *)&md, sizeof(md)); - if (error != 0) { - gctl_error(req, "Cannot write metadata to %s: %s.", prov, - strerror(error)); + fd = g_open(prov, 1); + if (fd == -1) { + gctl_error(req, "Cannot open provider %s: %s.", prov, + strerror(errno)); + return; } + offset = g_mediasize(fd) - g_sectorsize(fd); + if (offset <= 0) { + gctl_error(req, + "Cannot obtain media size or sector size for provider %s: %s.", + prov, strerror(errno)); + (void)g_close(fd); + return; + } + (void)eli_trash_metadata(req, prov, fd, offset); + (void)g_close(fd); } static void @@ -1336,12 +1392,8 @@ eli_resize(struct gctl_req *req) (void)g_flush(provfd); /* Now trash the old metadata. */ - arc4rand(sector, secsize); - if (pwrite(provfd, sector, secsize, oldsize - secsize) != secsize) { - gctl_error(req, "Failed to clobber old metadata: %s.", - strerror(errno)); + if (eli_trash_metadata(req, prov, provfd, oldsize - secsize) == -1) goto out; - } out: if (provfd >= 0) (void)g_close(provfd); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:19:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A08410656A5; Thu, 23 Sep 2010 11:19:04 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89BFB8FC15; Thu, 23 Sep 2010 11:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBJ4Lu067202; Thu, 23 Sep 2010 11:19:04 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBJ4MZ067199; Thu, 23 Sep 2010 11:19:04 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201009231119.o8NBJ4MZ067199@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 23 Sep 2010 11:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213061 - head/share/dict X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:19:04 -0000 Author: gavin Date: Thu Sep 23 11:19:03 2010 New Revision: 213061 URL: http://svn.freebsd.org/changeset/base/213061 Log: Various changes from various sources: - Add "children" [1] - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2] - Add "near", "antidisestablishmentarianism" and "Persephone" [2] - "Transvaal" should be capitalized [2] - Correct spelling of "structurelessness" and "Athena" [2] - Add missing atomic elements [3] - Add various words from "word of the day" lists [3] PR: conf/149756 [1] Submitted by: Nick Johnson [1] Obtained from: NetBSD [2], OpenBSD [3] MFC after: 1 week Modified: head/share/dict/web2 Modified: head/share/dict/web2 ============================================================================== --- head/share/dict/web2 Thu Sep 23 11:18:02 2010 (r213060) +++ head/share/dict/web2 Thu Sep 23 11:19:03 2010 (r213061) @@ -1545,9 +1545,11 @@ ackman acknow acknowledge acknowledgeable +acknowledgement acknowledged acknowledgedly acknowledger +acknowledgment aclastic acle acleidian @@ -3875,6 +3877,7 @@ agee Agelacrinites Agelacrinitidae Agelaius +agelast Agelaus ageless agelessness @@ -3995,6 +3998,7 @@ agist agistator agistment agistor +agita agitable agitant agitate @@ -4298,7 +4302,6 @@ Ahriman Ahrimanian ahsan Aht -Ahtena ahu ahuatle ahuehuete @@ -10059,6 +10062,7 @@ antidiphtheric antidiphtherin antidiphtheritic antidisciplinarian +antidisestablishmentarianism antidivine antidivorce antidogmatic @@ -15091,6 +15095,7 @@ atheizer athelia atheling athematic +Athena Athenaea athenaeum athenee @@ -15891,6 +15896,7 @@ australopithecine Australopithecus Australorp Austrasian +Austria Austrian Austrianize Austric @@ -21543,6 +21549,7 @@ betinge betipple betire betis +betise betitle betocsin betoil @@ -21833,6 +21840,7 @@ bibble bibbler bibbons bibcock +bibelot bibenzyl bibi Bibio @@ -24298,6 +24306,7 @@ bohereen bohireen boho bohor +bohrium bohunk boid Boidae @@ -24606,6 +24615,7 @@ boo boob boobery boobily +booboisie boobook booby boobyalla @@ -25158,6 +25168,7 @@ bouldery boule boulevard boulevardize +bouleversement boultel boulter boulterer @@ -28540,6 +28551,7 @@ caesaropopism Caesarotomy Caesarship caesious +caesium caesura caesural caesuric @@ -34554,6 +34566,7 @@ childlike childlikeness childly childness +children childrenite childridden childship @@ -41256,6 +41269,7 @@ congenitally congenitalness conger congeree +congeries congest congested congestible @@ -57000,6 +57014,7 @@ dopebook doper dopester dopey +doppelganger doppelkummel Dopper dopper @@ -58202,6 +58217,7 @@ dubitatingly dubitation dubitative dubitatively +dubnium Duboisia duboisin duboisine @@ -58916,6 +58932,7 @@ dysphagic dysphasia dysphasic dysphemia +dysphemism dysphonia dysphonic dysphoria @@ -60001,6 +60018,7 @@ eimer Eimeria einkorn Einsteinian +einsteinium Eireannach Eirene eiresione @@ -65389,6 +65407,7 @@ eudaimonia eudaimonism eudaimonist Eudemian +eudemonia Eudendrium Eudeve eudiagnostic @@ -69151,6 +69170,7 @@ fermentum fermerer fermery fermila +fermium fermorite fern fernandinite @@ -81692,6 +81712,7 @@ hagworm hah Hahnemannian Hahnemannism +hahnium Haiathalah Haida Haidan @@ -82659,6 +82680,7 @@ Hasmonaean hasp hassar hassel +hassium hassle hassock hassocky @@ -82789,6 +82811,7 @@ haunching haunchless haunchy haunt +haunted haunter hauntingly haunty @@ -87139,6 +87162,7 @@ homuncular homunculus homy Hon +honcho honda hondo Honduran @@ -100289,6 +100313,7 @@ jokish jokist jokul joky +joliotium joll jolleyman jollier @@ -101349,6 +101374,7 @@ katun katurai Katy katydid +katzenjammer Kauravas kauri kava @@ -103074,6 +103100,7 @@ kuphar kupper Kuranko kurbash +kurchatovium kurchicine kurchine Kurd @@ -104905,6 +104932,7 @@ lawny lawproof Lawrence lawrencite +lawrencium Lawrie lawrightman Lawson @@ -106402,6 +106430,7 @@ Lide lidflower lidgate lidless +lido lie liebenerite Liebfraumilch @@ -113272,6 +113301,7 @@ Meissa Meistersinger meith Meithei +meitnerium meizoseismal meizoseismic mejorana @@ -113727,6 +113757,7 @@ mendacity Mendaite Mende mendee +mendelevium Mendelian Mendelianism Mendelianist @@ -114041,6 +114072,7 @@ Mercurochrome mercurophen mercurous Mercury +mercury mercy mercyproof merdivorous @@ -122875,6 +122907,7 @@ neanthropic neap neaped Neapolitan +near nearable nearabout nearabouts @@ -124385,6 +124418,7 @@ nielled niellist niello Niels +nielsbohrium niepa Nierembergia Niersteiner @@ -124792,6 +124826,7 @@ nobble nobbler nobbut nobby +nobelium nobiliary nobilify nobilitate @@ -143301,6 +143336,7 @@ perseitol perseity persentiscency Persephassa +Persephone Persepolitan perseverance perseverant @@ -159783,6 +159819,7 @@ pukeweed Pukhtun pukish pukishness +pukka pukras puku puky @@ -171928,6 +171965,7 @@ ruther rutherford rutherfordine rutherfordite +rutherfordium ruthful ruthfully ruthfulness @@ -176365,6 +176403,7 @@ Seabee seaberry seaboard seaborderer +seaborgium seabound seacannie seacatch @@ -176892,6 +176931,7 @@ segregational segregationist segregative segregator +segue Sehyo seiche Seid @@ -182226,6 +182266,7 @@ situational situla situlae situs +sitzmark Sium Siusi Siuslaw @@ -191095,6 +191136,7 @@ structuration structure structured structureless +structurelessness structurely structurist strudel @@ -191193,7 +191235,6 @@ stuccoworker stuccoyer stuck stuckling -stucturelessness stud studbook studder @@ -206200,7 +206241,7 @@ transuranian transuranic transuranium transuterine -transvaal +Transvaal Transvaaler Transvaalian transvaluate From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:19:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E83BB1065696; Thu, 23 Sep 2010 11:19:48 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D83288FC2E; Thu, 23 Sep 2010 11:19:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBJmwG067253; Thu, 23 Sep 2010 11:19:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBJmWh067250; Thu, 23 Sep 2010 11:19:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231119.o8NBJmWh067250@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213062 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:19:49 -0000 Author: pjd Date: Thu Sep 23 11:19:48 2010 New Revision: 213062 URL: http://svn.freebsd.org/changeset/base/213062 Log: Define default overwrite count, so that userland can use it. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Sep 23 11:19:03 2010 (r213061) +++ head/sys/geom/eli/g_eli.c Thu Sep 23 11:19:48 2010 (r213062) @@ -69,7 +69,7 @@ TUNABLE_INT("kern.geom.eli.visible_passp SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RW, &g_eli_visible_passphrase, 0, "Turn on echo when entering the passphrase (for debug purposes only!!)"); -u_int g_eli_overwrites = 5; +u_int g_eli_overwrites = G_ELI_OVERWRITES; TUNABLE_INT("kern.geom.eli.overwrites", &g_eli_overwrites); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RW, &g_eli_overwrites, 0, "Number of times on-disk keys should be overwritten when destroying them"); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Thu Sep 23 11:19:03 2010 (r213061) +++ head/sys/geom/eli/g_eli.h Thu Sep 23 11:19:48 2010 (r213062) @@ -97,6 +97,7 @@ #define G_ELI_DATAIVKEYLEN (G_ELI_DATAKEYLEN + G_ELI_IVKEYLEN) /* Data-Key, IV-Key, HMAC_SHA512(Derived-Key, Data-Key+IV-Key) */ #define G_ELI_MKEYLEN (G_ELI_DATAIVKEYLEN + SHA512_MDLEN) +#define G_ELI_OVERWRITES 5 #ifdef _KERNEL extern u_int g_eli_debug; From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:23:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30DD9106566B; Thu, 23 Sep 2010 11:23:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20A748FC1D; Thu, 23 Sep 2010 11:23:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBNBYm067376; Thu, 23 Sep 2010 11:23:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBNBjo067374; Thu, 23 Sep 2010 11:23:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231123.o8NBNBjo067374@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213063 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:23:11 -0000 Author: pjd Date: Thu Sep 23 11:23:10 2010 New Revision: 213063 URL: http://svn.freebsd.org/changeset/base/213063 Log: Make the code similar to the code in g_eli_integrity.c. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:19:48 2010 (r213062) +++ head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:23:10 2010 (r213063) @@ -175,8 +175,9 @@ g_eli_crypto_run(struct g_eli_worker *wr struct cryptodesc *crd; struct uio *uio; struct iovec *iov; - u_int i, nsec, add, secsize; + u_int i, nsec, secsize; int err, error; + off_t dstoff; size_t size; u_char *p, *data; @@ -219,7 +220,7 @@ g_eli_crypto_run(struct g_eli_worker *wr } error = 0; - for (i = 0, add = 0; i < nsec; i++, add += secsize) { + for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = (struct cryptop *)p; p += sizeof(*crp); crd = (struct cryptodesc *)p; p += sizeof(*crd); uio = (struct uio *)p; p += sizeof(*uio); @@ -256,7 +257,7 @@ g_eli_crypto_run(struct g_eli_worker *wr crd->crd_alg = sc->sc_ealgo; crd->crd_key = sc->sc_ekey; crd->crd_klen = sc->sc_ekeylen; - g_eli_crypto_ivgen(sc, bp->bio_offset + add, crd->crd_iv, + g_eli_crypto_ivgen(sc, dstoff, crd->crd_iv, sizeof(crd->crd_iv)); crd->crd_next = NULL; From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:26:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93A5A106564A; Thu, 23 Sep 2010 11:26:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832718FC1C; Thu, 23 Sep 2010 11:26:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBQcde067478; Thu, 23 Sep 2010 11:26:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBQcNK067475; Thu, 23 Sep 2010 11:26:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231126.o8NBQcNK067475@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213064 - head/sys/crypto/aesni X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:26:38 -0000 Author: pjd Date: Thu Sep 23 11:26:38 2010 New Revision: 213064 URL: http://svn.freebsd.org/changeset/base/213064 Log: Simplify code a bit. MFC after: 1 week Modified: head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Thu Sep 23 11:23:10 2010 (r213063) +++ head/sys/crypto/aesni/aesni.c Thu Sep 23 11:26:38 2010 (r213064) @@ -69,14 +69,12 @@ aesni_identify(driver_t *drv, device_t p static int aesni_probe(device_t dev) { - char capp[32]; if ((cpu_feature2 & CPUID2_AESNI) == 0) { device_printf(dev, "No AESNI support.\n"); return (EINVAL); } - strlcpy(capp, "AES-CBC", sizeof(capp)); - device_set_desc_copy(dev, capp); + device_set_desc_copy(dev, "AES-CBC"); return (0); } Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:23:10 2010 (r213063) +++ head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:26:38 2010 (r213064) @@ -147,15 +147,13 @@ aesni_cipher_process(struct aesni_sessio int error, allocated; buf = aesni_cipher_alloc(enccrd, crp, &allocated); - if (buf == NULL) { - error = ENOMEM; - goto out; - } + if (buf == NULL) + return (ENOMEM); td = curthread; error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); if (error != 0) - goto out1; + goto out; if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) @@ -184,11 +182,10 @@ aesni_cipher_process(struct aesni_sessio crypto_copydata(crp->crp_flags, crp->crp_buf, enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN, AES_BLOCK_LEN, ses->iv); - out1: + out: if (allocated) { bzero(buf, enccrd->crd_len); free(buf, M_AESNI); } - out: return (error); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:33:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9896D106566C; Thu, 23 Sep 2010 11:33:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 886AD8FC1A; Thu, 23 Sep 2010 11:33:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBXTSB067649; Thu, 23 Sep 2010 11:33:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBXTs7067647; Thu, 23 Sep 2010 11:33:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231133.o8NBXTs7067647@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213065 - head/sys/opencrypto X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:33:29 -0000 Author: pjd Date: Thu Sep 23 11:33:29 2010 New Revision: 213065 URL: http://svn.freebsd.org/changeset/base/213065 Log: Remove redundant space. MFC after: 1 week Modified: head/sys/opencrypto/xform.c Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Thu Sep 23 11:26:38 2010 (r213064) +++ head/sys/opencrypto/xform.c Thu Sep 23 11:33:29 2010 (r213065) @@ -226,7 +226,7 @@ struct auth_hash auth_hash_hmac_ripemd_1 }; struct auth_hash auth_hash_key_md5 = { - CRYPTO_MD5_KPDK, "Keyed MD5", + CRYPTO_MD5_KPDK, "Keyed MD5", 0, MD5_KPDK_HASH_LEN, 0, sizeof(MD5_CTX), (void (*)(void *)) MD5Init, MD5Update_int, (void (*)(u_int8_t *, void *)) MD5Final From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:46:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C4B61065675; Thu, 23 Sep 2010 11:46:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21AA18FC12; Thu, 23 Sep 2010 11:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBkslk067955; Thu, 23 Sep 2010 11:46:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBksYt067953; Thu, 23 Sep 2010 11:46:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231146.o8NBksYt067953@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213066 - head/sys/crypto/aesni X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:46:54 -0000 Author: pjd Date: Thu Sep 23 11:46:53 2010 New Revision: 213066 URL: http://svn.freebsd.org/changeset/base/213066 Log: Add support for CRD_F_KEY_EXPLICIT flag. MFC after: 1 week Modified: head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:33:29 2010 (r213065) +++ head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:46:53 2010 (r213066) @@ -105,13 +105,12 @@ aesni_decrypt_ecb(int rounds, const void } } -int -aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) +static int +aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, + int keylen) { - struct thread *td; - int error; - switch (encini->cri_klen) { + switch (keylen) { case 128: ses->rounds = AES128_ROUNDS; break; @@ -124,18 +123,28 @@ aesni_cipher_setup(struct aesni_session default: return (EINVAL); } + + aesni_set_enckey(key, ses->enc_schedule, ses->rounds); + aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, ses->rounds); + arc4rand(ses->iv, sizeof(ses->iv), 0); - td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); - if (error == 0) { - aesni_set_enckey(encini->cri_key, ses->enc_schedule, - ses->rounds); - aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, - ses->rounds); - arc4rand(ses->iv, sizeof(ses->iv), 0); - fpu_kern_leave(td, &ses->fpu_ctx); - } - return (error); + return (0); +} + +int +aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) +{ + struct thread *td; + int error; + + td = curthread; + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (error == 0) { + error = aesni_cipher_setup_common(ses, encini->cri_key, + encini->cri_klen); + fpu_kern_leave(td, &ses->fpu_ctx); + } + return (error); } int @@ -154,6 +163,13 @@ aesni_cipher_process(struct aesni_sessio error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); if (error != 0) goto out; + + if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { + error = aesni_cipher_setup_common(ses, enccrd->crd_key, + enccrd->crd_klen); + if (error != 0) + goto out; + } if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:49:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97108106566B; Thu, 23 Sep 2010 11:49:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85ACF8FC0C; Thu, 23 Sep 2010 11:49:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBnlCf068056; Thu, 23 Sep 2010 11:49:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBnlOV068050; Thu, 23 Sep 2010 11:49:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231149.o8NBnlOV068050@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213067 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:49:47 -0000 Author: pjd Date: Thu Sep 23 11:49:47 2010 New Revision: 213067 URL: http://svn.freebsd.org/changeset/base/213067 Log: Implement switching of data encryption key every 2^20 blocks. This ensures the same encryption key won't be used for more than 2^20 blocks (sectors). This will be the default now. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_key.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Sep 23 11:46:53 2010 (r213066) +++ head/sys/geom/eli/g_eli.c Thu Sep 23 11:49:47 2010 (r213067) @@ -375,6 +375,34 @@ g_eli_worker(void *arg) } /* + * Select encryption key. If G_ELI_FLAG_SINGLE_KEY is present we only have one + * key available for all the data. If the flag is not present select the key + * based on data offset. + */ +uint8_t * +g_eli_crypto_key(struct g_eli_softc *sc, off_t offset, size_t blocksize) +{ + u_int nkey; + + if (sc->sc_nekeys == 1) + return (sc->sc_ekeys[0]); + + KASSERT(sc->sc_nekeys > 1, ("%s: sc_nekeys=%u", __func__, + sc->sc_nekeys)); + KASSERT((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) == 0, + ("%s: SINGLE_KEY flag set, but sc_nekeys=%u", __func__, + sc->sc_nekeys)); + + /* We switch key every 2^G_ELI_KEY_SHIFT blocks. */ + nkey = (offset >> G_ELI_KEY_SHIFT) / blocksize; + + KASSERT(nkey < sc->sc_nekeys, ("%s: nkey=%u >= sc_nekeys=%u", __func__, + nkey, sc->sc_nekeys)); + + return (sc->sc_ekeys[nkey]); +} + +/* * Here we generate IV. It is unique for every sector. */ void @@ -548,13 +576,10 @@ g_eli_create(struct gctl_req *req, struc /* Backward compatibility. */ if (md->md_version < 4) sc->sc_flags |= G_ELI_FLAG_NATIVE_BYTE_ORDER; + if (md->md_version < 5) + sc->sc_flags |= G_ELI_FLAG_SINGLE_KEY; sc->sc_ealgo = md->md_ealgo; sc->sc_nkey = nkey; - /* - * Remember the keys in our softc structure. - */ - g_eli_mkey_propagate(sc, mkey); - sc->sc_ekeylen = md->md_keylen; if (sc->sc_flags & G_ELI_FLAG_AUTH) { sc->sc_akeylen = sizeof(sc->sc_akey) * 8; @@ -584,14 +609,6 @@ g_eli_create(struct gctl_req *req, struc sizeof(sc->sc_akey)); } - /* - * Precalculate SHA256 for IV generation. - * This is expensive operation and we can do it only once now or for - * every access to sector, so now will be much better. - */ - SHA256_Init(&sc->sc_ivctx); - SHA256_Update(&sc->sc_ivctx, sc->sc_ivkey, sizeof(sc->sc_ivkey)); - gp->softc = sc; sc->sc_geom = gp; @@ -633,12 +650,37 @@ g_eli_create(struct gctl_req *req, struc goto failed; } + sc->sc_sectorsize = md->md_sectorsize; + sc->sc_mediasize = bpp->mediasize; + if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) + sc->sc_mediasize -= bpp->sectorsize; + if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) + sc->sc_mediasize -= (sc->sc_mediasize % sc->sc_sectorsize); + else { + sc->sc_mediasize /= sc->sc_bytes_per_sector; + sc->sc_mediasize *= sc->sc_sectorsize; + } + + /* + * Remember the keys in our softc structure. + */ + g_eli_mkey_propagate(sc, mkey); + sc->sc_ekeylen = md->md_keylen; + + /* + * Precalculate SHA256 for IV generation. + * This is expensive operation and we can do it only once now or for + * every access to sector, so now will be much better. + */ + SHA256_Init(&sc->sc_ivctx); + SHA256_Update(&sc->sc_ivctx, sc->sc_ivkey, sizeof(sc->sc_ivkey)); + LIST_INIT(&sc->sc_workers); bzero(&crie, sizeof(crie)); crie.cri_alg = sc->sc_ealgo; crie.cri_klen = sc->sc_ekeylen; - crie.cri_key = sc->sc_ekey; + crie.cri_key = sc->sc_ekeys[0]; if (sc->sc_flags & G_ELI_FLAG_AUTH) { bzero(&cria, sizeof(cria)); cria.cri_alg = sc->sc_aalgo; @@ -715,16 +757,8 @@ g_eli_create(struct gctl_req *req, struc * Create decrypted provider. */ pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); - pp->sectorsize = md->md_sectorsize; - pp->mediasize = bpp->mediasize; - if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) - pp->mediasize -= bpp->sectorsize; - if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) - pp->mediasize -= (pp->mediasize % pp->sectorsize); - else { - pp->mediasize /= sc->sc_bytes_per_sector; - pp->mediasize *= pp->sectorsize; - } + pp->mediasize = sc->sc_mediasize; + pp->sectorsize = sc->sc_sectorsize; g_error_provider(pp, 0); @@ -755,6 +789,11 @@ failed: } g_destroy_consumer(cp); g_destroy_geom(gp); + if (sc->sc_ekeys != NULL) { + bzero(sc->sc_ekeys, + sc->sc_nekeys * (sizeof(uint8_t *) + G_ELI_DATAKEYLEN)); + free(sc->sc_ekeys, M_ELI); + } bzero(sc, sizeof(*sc)); free(sc, M_ELI); return (NULL); @@ -794,6 +833,9 @@ g_eli_destroy(struct g_eli_softc *sc, bo } mtx_destroy(&sc->sc_queue_mtx); gp->softc = NULL; + bzero(sc->sc_ekeys, + sc->sc_nekeys * (sizeof(uint8_t *) + G_ELI_DATAKEYLEN)); + free(sc->sc_ekeys, M_ELI); bzero(sc, sizeof(*sc)); free(sc, M_ELI); @@ -1042,6 +1084,7 @@ g_eli_dumpconf(struct sbuf *sb, const ch sbuf_printf(sb, name); \ } \ } while (0) + ADD_FLAG(G_ELI_FLAG_SINGLE_KEY, "SINGLE-KEY"); ADD_FLAG(G_ELI_FLAG_NATIVE_BYTE_ORDER, "NATIVE-BYTE-ORDER"); ADD_FLAG(G_ELI_FLAG_ONETIME, "ONETIME"); ADD_FLAG(G_ELI_FLAG_BOOT, "BOOT"); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Thu Sep 23 11:46:53 2010 (r213066) +++ head/sys/geom/eli/g_eli.h Thu Sep 23 11:49:47 2010 (r213067) @@ -60,8 +60,9 @@ * 3 - Added 'configure' subcommand. * 4 - IV is generated from offset converted to little-endian * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions). + * 5 - Added multiple encrypton keys. */ -#define G_ELI_VERSION 4 +#define G_ELI_VERSION 5 /* ON DISK FLAGS. */ /* Use random, onetime keys. */ @@ -83,6 +84,8 @@ #define G_ELI_FLAG_DESTROY 0x00020000 /* Provider uses native byte-order for IV generation. */ #define G_ELI_FLAG_NATIVE_BYTE_ORDER 0x00040000 +/* Provider uses single encryption key. */ +#define G_ELI_FLAG_SINGLE_KEY 0x00080000 #define SHA512_MDLEN 64 #define G_ELI_AUTH_SECKEYLEN SHA256_DIGEST_LENGTH @@ -98,6 +101,8 @@ /* Data-Key, IV-Key, HMAC_SHA512(Derived-Key, Data-Key+IV-Key) */ #define G_ELI_MKEYLEN (G_ELI_DATAIVKEYLEN + SHA512_MDLEN) #define G_ELI_OVERWRITES 5 +/* Switch data encryption key every 2^20 blocks. */ +#define G_ELI_KEY_SHIFT 20 #ifdef _KERNEL extern u_int g_eli_debug; @@ -139,27 +144,30 @@ struct g_eli_worker { }; struct g_eli_softc { - struct g_geom *sc_geom; - u_int sc_crypto; - uint8_t sc_mkey[G_ELI_DATAIVKEYLEN]; - uint8_t sc_ekey[G_ELI_DATAKEYLEN]; - u_int sc_ealgo; - u_int sc_ekeylen; - uint8_t sc_akey[G_ELI_AUTHKEYLEN]; - u_int sc_aalgo; - u_int sc_akeylen; - u_int sc_alen; - SHA256_CTX sc_akeyctx; - uint8_t sc_ivkey[G_ELI_IVKEYLEN]; - SHA256_CTX sc_ivctx; - int sc_nkey; - uint32_t sc_flags; - u_int sc_bytes_per_sector; - u_int sc_data_per_sector; + struct g_geom *sc_geom; + u_int sc_crypto; + uint8_t sc_mkey[G_ELI_DATAIVKEYLEN]; + uint8_t **sc_ekeys; + u_int sc_nekeys; + u_int sc_ealgo; + u_int sc_ekeylen; + uint8_t sc_akey[G_ELI_AUTHKEYLEN]; + u_int sc_aalgo; + u_int sc_akeylen; + u_int sc_alen; + SHA256_CTX sc_akeyctx; + uint8_t sc_ivkey[G_ELI_IVKEYLEN]; + SHA256_CTX sc_ivctx; + int sc_nkey; + uint32_t sc_flags; + off_t sc_mediasize; + size_t sc_sectorsize; + u_int sc_bytes_per_sector; + u_int sc_data_per_sector; /* Only for software cryptography. */ struct bio_queue_head sc_queue; - struct mtx sc_queue_mtx; + struct mtx sc_queue_mtx; LIST_HEAD(, g_eli_worker) sc_workers; }; #define sc_name sc_geom->name @@ -231,7 +239,7 @@ eli_metadata_decode_v0(const u_char *dat } static __inline int -eli_metadata_decode_v1v2v3v4(const u_char *data, struct g_eli_metadata *md) +eli_metadata_decode_v1v2v3v4v5(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; const u_char *p; @@ -269,7 +277,8 @@ eli_metadata_decode(const u_char *data, case 2: case 3: case 4: - error = eli_metadata_decode_v1v2v3v4(data, md); + case 5: + error = eli_metadata_decode_v1v2v3v4v5(data, md); break; default: error = EINVAL; @@ -461,6 +470,8 @@ void g_eli_config(struct gctl_req *req, void g_eli_read_done(struct bio *bp); void g_eli_write_done(struct bio *bp); int g_eli_crypto_rerun(struct cryptop *crp); +uint8_t *g_eli_crypto_key(struct g_eli_softc *sc, off_t offset, + size_t blocksize); void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, size_t size); Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 11:46:53 2010 (r213066) +++ head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 11:49:47 2010 (r213067) @@ -507,7 +507,7 @@ g_eli_auth_run(struct g_eli_worker *wr, if (bp->bio_cmd == BIO_WRITE) crde->crd_flags |= CRD_F_ENCRYPT; crde->crd_alg = sc->sc_ealgo; - crde->crd_key = sc->sc_ekey; + crde->crd_key = g_eli_crypto_key(sc, dstoff, encr_secsize); crde->crd_klen = sc->sc_ekeylen; g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, sizeof(crde->crd_iv)); Modified: head/sys/geom/eli/g_eli_key.c ============================================================================== --- head/sys/geom/eli/g_eli_key.c Thu Sep 23 11:46:53 2010 (r213066) +++ head/sys/geom/eli/g_eli_key.c Thu Sep 23 11:49:47 2010 (r213067) @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef _KERNEL +MALLOC_DECLARE(M_ELI); +#endif /* * Verify if the given 'key' is correct. @@ -178,6 +181,46 @@ g_eli_mkey_encrypt(unsigned algo, const } #ifdef _KERNEL +static void +g_eli_ekeys_generate(struct g_eli_softc *sc) +{ + uint8_t *keys; + u_int kno; + off_t mediasize; + size_t blocksize; + struct { + char magic[4]; + uint8_t keyno[8]; + } __packed hmacdata; + + KASSERT((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) == 0, + ("%s: G_ELI_FLAG_SINGLE_KEY flag present", __func__)); + + if ((sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { + struct g_provider *pp; + + pp = LIST_FIRST(&sc->sc_geom->consumer)->provider; + mediasize = pp->mediasize; + blocksize = pp->sectorsize; + } else { + mediasize = sc->sc_mediasize; + blocksize = sc->sc_sectorsize; + } + sc->sc_nekeys = ((mediasize - 1) >> G_ELI_KEY_SHIFT) / blocksize + 1; + sc->sc_ekeys = + malloc(sc->sc_nekeys * (sizeof(uint8_t *) + G_ELI_DATAKEYLEN), + M_ELI, M_WAITOK); + keys = (uint8_t *)(sc->sc_ekeys + sc->sc_nekeys); + bcopy("ekey", hmacdata.magic, 4); + for (kno = 0; kno < sc->sc_nekeys; kno++, keys += G_ELI_DATAKEYLEN) { + sc->sc_ekeys[kno] = keys; + le64enc(hmacdata.keyno, (uint64_t)kno); + g_eli_crypto_hmac(sc->sc_mkey, G_ELI_MAXKEYLEN, + (uint8_t *)&hmacdata, sizeof(hmacdata), + sc->sc_ekeys[kno], 0); + } +} + /* * When doing encryption only, copy IV key and encryption key. * When doing encryption and authentication, copy IV key, generate encryption @@ -193,16 +236,33 @@ g_eli_mkey_propagate(struct g_eli_softc bcopy(mkey, sc->sc_ivkey, sizeof(sc->sc_ivkey)); mkey += sizeof(sc->sc_ivkey); - if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) { - bcopy(mkey, sc->sc_ekey, sizeof(sc->sc_ekey)); + /* + * The authentication key is: akey = HMAC_SHA512(Master-Key, 0x11) + */ + if ((sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { + g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x11", 1, + sc->sc_akey, 0); } else { - /* - * The encryption key is: ekey = HMAC_SHA512(Master-Key, 0x10) - * The authentication key is: akey = HMAC_SHA512(Master-Key, 0x11) - */ - g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x10", 1, sc->sc_ekey, 0); - g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x11", 1, sc->sc_akey, 0); + arc4rand(sc->sc_akey, sizeof(sc->sc_akey), 0); } + if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) != 0) { + sc->sc_nekeys = 1; + sc->sc_ekeys = malloc(sc->sc_nekeys * + (sizeof(uint8_t *) + G_ELI_DATAKEYLEN), M_ELI, M_WAITOK); + sc->sc_ekeys[0] = (uint8_t *)(sc->sc_ekeys + sc->sc_nekeys); + if ((sc->sc_flags & G_ELI_FLAG_AUTH) == 0) + bcopy(mkey, sc->sc_ekeys[0], G_ELI_DATAKEYLEN); + else { + /* + * The encryption key is: ekey = HMAC_SHA512(Master-Key, 0x10) + */ + g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x10", 1, + sc->sc_ekeys[0], 0); + } + } else { + /* Generate all encryption keys. */ + g_eli_ekeys_generate(sc); + } } #endif Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:46:53 2010 (r213066) +++ head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:49:47 2010 (r213067) @@ -252,10 +252,12 @@ g_eli_crypto_run(struct g_eli_worker *wr crd->crd_skip = 0; crd->crd_len = secsize; crd->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; + if (sc->sc_nekeys > 1) + crd->crd_flags |= CRD_F_KEY_EXPLICIT; if (bp->bio_cmd == BIO_WRITE) crd->crd_flags |= CRD_F_ENCRYPT; crd->crd_alg = sc->sc_ealgo; - crd->crd_key = sc->sc_ekey; + crd->crd_key = g_eli_crypto_key(sc, dstoff, secsize); crd->crd_klen = sc->sc_ekeylen; g_eli_crypto_ivgen(sc, dstoff, crd->crd_iv, sizeof(crd->crd_iv)); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:52:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 189FA106564A; Thu, 23 Sep 2010 11:52:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0757B8FC15; Thu, 23 Sep 2010 11:52:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBqXpB068161; Thu, 23 Sep 2010 11:52:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBqWBa068155; Thu, 23 Sep 2010 11:52:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231152.o8NBqWBa068155@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213068 - head/sys/opencrypto X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:52:33 -0000 Author: pjd Date: Thu Sep 23 11:52:32 2010 New Revision: 213068 URL: http://svn.freebsd.org/changeset/base/213068 Log: Add support for AES-XTS. Obtained from: OpenBSD MFC after: 1 week Modified: head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform.h Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Sep 23 11:49:47 2010 (r213067) +++ head/sys/opencrypto/cryptodev.c Thu Sep 23 11:52:32 2010 (r213068) @@ -419,6 +419,9 @@ cryptof_ioctl( case CRYPTO_AES_CBC: txform = &enc_xform_rijndael128; break; + case CRYPTO_AES_XTS: + txform = &enc_xform_aes_xts; + break; case CRYPTO_NULL_CBC: txform = &enc_xform_null; break; Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Thu Sep 23 11:49:47 2010 (r213067) +++ head/sys/opencrypto/cryptodev.h Thu Sep 23 11:52:32 2010 (r213068) @@ -123,7 +123,8 @@ #define CRYPTO_SHA2_384_HMAC 19 #define CRYPTO_SHA2_512_HMAC 20 #define CRYPTO_CAMELLIA_CBC 21 -#define CRYPTO_ALGORITHM_MAX 21 /* Keep updated - see below */ +#define CRYPTO_AES_XTS 22 +#define CRYPTO_ALGORITHM_MAX 22 /* Keep updated - see below */ /* Algorithm flags */ #define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */ Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Thu Sep 23 11:49:47 2010 (r213067) +++ head/sys/opencrypto/cryptosoft.c Thu Sep 23 11:52:32 2010 (r213068) @@ -114,8 +114,16 @@ swcr_encdec(struct cryptodesc *crd, stru if (error) return (error); } + ivp = iv; + /* + * xforms that provide a reinit method perform all IV + * handling themselves. + */ + if (exf->reinit) + exf->reinit(sw->sw_kschedule, iv); + if (flags & CRYPTO_F_IMBUF) { struct mbuf *m = (struct mbuf *) buf; @@ -135,7 +143,15 @@ swcr_encdec(struct cryptodesc *crd, stru m_copydata(m, k, blks, blk); /* Actual encryption/decryption */ - if (crd->crd_flags & CRD_F_ENCRYPT) { + if (exf->reinit) { + if (crd->crd_flags & CRD_F_ENCRYPT) { + exf->encrypt(sw->sw_kschedule, + blk); + } else { + exf->decrypt(sw->sw_kschedule, + blk); + } + } else if (crd->crd_flags & CRD_F_ENCRYPT) { /* XOR with previous block */ for (j = 0; j < blks; j++) blk[j] ^= ivp[j]; @@ -205,7 +221,15 @@ swcr_encdec(struct cryptodesc *crd, stru idat = mtod(m, unsigned char *) + k; while (m->m_len >= k + blks && i > 0) { - if (crd->crd_flags & CRD_F_ENCRYPT) { + if (exf->reinit) { + if (crd->crd_flags & CRD_F_ENCRYPT) { + exf->encrypt(sw->sw_kschedule, + idat); + } else { + exf->decrypt(sw->sw_kschedule, + idat); + } + } else if (crd->crd_flags & CRD_F_ENCRYPT) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) idat[j] ^= ivp[j]; @@ -261,7 +285,15 @@ swcr_encdec(struct cryptodesc *crd, stru cuio_copydata(uio, k, blks, blk); /* Actual encryption/decryption */ - if (crd->crd_flags & CRD_F_ENCRYPT) { + if (exf->reinit) { + if (crd->crd_flags & CRD_F_ENCRYPT) { + exf->encrypt(sw->sw_kschedule, + blk); + } else { + exf->decrypt(sw->sw_kschedule, + blk); + } + } else if (crd->crd_flags & CRD_F_ENCRYPT) { /* XOR with previous block */ for (j = 0; j < blks; j++) blk[j] ^= ivp[j]; @@ -319,7 +351,15 @@ swcr_encdec(struct cryptodesc *crd, stru idat = (char *)iov->iov_base + k; while (iov->iov_len >= k + blks && i > 0) { - if (crd->crd_flags & CRD_F_ENCRYPT) { + if (exf->reinit) { + if (crd->crd_flags & CRD_F_ENCRYPT) { + exf->encrypt(sw->sw_kschedule, + idat); + } else { + exf->decrypt(sw->sw_kschedule, + idat); + } + } else if (crd->crd_flags & CRD_F_ENCRYPT) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) idat[j] ^= ivp[j]; @@ -360,7 +400,15 @@ swcr_encdec(struct cryptodesc *crd, stru return 0; /* Done with iovec encryption/decryption */ } else { /* contiguous buffer */ - if (crd->crd_flags & CRD_F_ENCRYPT) { + if (exf->reinit) { + for (i = crd->crd_skip; + i < crd->crd_skip + crd->crd_len; i += blks) { + if (crd->crd_flags & CRD_F_ENCRYPT) + exf->encrypt(sw->sw_kschedule, buf + i); + else + exf->decrypt(sw->sw_kschedule, buf + i); + } + } else if (crd->crd_flags & CRD_F_ENCRYPT) { for (i = crd->crd_skip; i < crd->crd_skip + crd->crd_len; i += blks) { /* XOR with the IV/previous block, as appropriate. */ @@ -687,6 +735,9 @@ swcr_newsession(device_t dev, u_int32_t case CRYPTO_RIJNDAEL128_CBC: txf = &enc_xform_rijndael128; goto enccommon; + case CRYPTO_AES_XTS: + txf = &enc_xform_aes_xts; + goto enccommon; case CRYPTO_CAMELLIA_CBC: txf = &enc_xform_camellia; goto enccommon; @@ -845,6 +896,7 @@ swcr_freesession(device_t dev, u_int64_t case CRYPTO_CAST_CBC: case CRYPTO_SKIPJACK_CBC: case CRYPTO_RIJNDAEL128_CBC: + case CRYPTO_AES_XTS: case CRYPTO_CAMELLIA_CBC: case CRYPTO_NULL_CBC: txf = swd->sw_exf; @@ -958,6 +1010,7 @@ swcr_process(device_t dev, struct crypto case CRYPTO_CAST_CBC: case CRYPTO_SKIPJACK_CBC: case CRYPTO_RIJNDAEL128_CBC: + case CRYPTO_AES_XTS: case CRYPTO_CAMELLIA_CBC: if ((crp->crp_etype = swcr_encdec(crd, sw, crp->crp_buf, crp->crp_flags)) != 0) @@ -1050,6 +1103,7 @@ swcr_attach(device_t dev) REGISTER(CRYPTO_MD5); REGISTER(CRYPTO_SHA1); REGISTER(CRYPTO_RIJNDAEL128_CBC); + REGISTER(CRYPTO_AES_XTS); REGISTER(CRYPTO_CAMELLIA_CBC); REGISTER(CRYPTO_DEFLATE_COMP); #undef REGISTER Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Thu Sep 23 11:49:47 2010 (r213067) +++ head/sys/opencrypto/xform.c Thu Sep 23 11:52:32 2010 (r213068) @@ -64,40 +64,48 @@ __FBSDID("$FreeBSD$"); #include #include -static void null_encrypt(caddr_t, u_int8_t *); -static void null_decrypt(caddr_t, u_int8_t *); -static int null_setkey(u_int8_t **, u_int8_t *, int); -static void null_zerokey(u_int8_t **); - +static int null_setkey(u_int8_t **, u_int8_t *, int); static int des1_setkey(u_int8_t **, u_int8_t *, int); static int des3_setkey(u_int8_t **, u_int8_t *, int); static int blf_setkey(u_int8_t **, u_int8_t *, int); static int cast5_setkey(u_int8_t **, u_int8_t *, int); static int skipjack_setkey(u_int8_t **, u_int8_t *, int); static int rijndael128_setkey(u_int8_t **, u_int8_t *, int); +static int aes_xts_setkey(u_int8_t **, u_int8_t *, int); static int cml_setkey(u_int8_t **, u_int8_t *, int); + +static void null_encrypt(caddr_t, u_int8_t *); static void des1_encrypt(caddr_t, u_int8_t *); static void des3_encrypt(caddr_t, u_int8_t *); static void blf_encrypt(caddr_t, u_int8_t *); static void cast5_encrypt(caddr_t, u_int8_t *); static void skipjack_encrypt(caddr_t, u_int8_t *); static void rijndael128_encrypt(caddr_t, u_int8_t *); +static void aes_xts_encrypt(caddr_t, u_int8_t *); static void cml_encrypt(caddr_t, u_int8_t *); + +static void null_decrypt(caddr_t, u_int8_t *); static void des1_decrypt(caddr_t, u_int8_t *); static void des3_decrypt(caddr_t, u_int8_t *); static void blf_decrypt(caddr_t, u_int8_t *); static void cast5_decrypt(caddr_t, u_int8_t *); static void skipjack_decrypt(caddr_t, u_int8_t *); static void rijndael128_decrypt(caddr_t, u_int8_t *); +static void aes_xts_decrypt(caddr_t, u_int8_t *); static void cml_decrypt(caddr_t, u_int8_t *); + +static void null_zerokey(u_int8_t **); static void des1_zerokey(u_int8_t **); static void des3_zerokey(u_int8_t **); static void blf_zerokey(u_int8_t **); static void cast5_zerokey(u_int8_t **); static void skipjack_zerokey(u_int8_t **); static void rijndael128_zerokey(u_int8_t **); +static void aes_xts_zerokey(u_int8_t **); static void cml_zerokey(u_int8_t **); +static void aes_xts_reinit(caddr_t, u_int8_t *); + static void null_init(void *); static int null_update(void *, u_int8_t *, u_int16_t); static void null_final(u_int8_t *, void *); @@ -124,6 +132,7 @@ struct enc_xform enc_xform_null = { null_decrypt, null_setkey, null_zerokey, + NULL }; struct enc_xform enc_xform_des = { @@ -133,6 +142,7 @@ struct enc_xform enc_xform_des = { des1_decrypt, des1_setkey, des1_zerokey, + NULL }; struct enc_xform enc_xform_3des = { @@ -141,7 +151,8 @@ struct enc_xform enc_xform_3des = { des3_encrypt, des3_decrypt, des3_setkey, - des3_zerokey + des3_zerokey, + NULL }; struct enc_xform enc_xform_blf = { @@ -150,7 +161,8 @@ struct enc_xform enc_xform_blf = { blf_encrypt, blf_decrypt, blf_setkey, - blf_zerokey + blf_zerokey, + NULL }; struct enc_xform enc_xform_cast5 = { @@ -159,7 +171,8 @@ struct enc_xform enc_xform_cast5 = { cast5_encrypt, cast5_decrypt, cast5_setkey, - cast5_zerokey + cast5_zerokey, + NULL }; struct enc_xform enc_xform_skipjack = { @@ -168,7 +181,8 @@ struct enc_xform enc_xform_skipjack = { skipjack_encrypt, skipjack_decrypt, skipjack_setkey, - skipjack_zerokey + skipjack_zerokey, + NULL }; struct enc_xform enc_xform_rijndael128 = { @@ -178,6 +192,17 @@ struct enc_xform enc_xform_rijndael128 = rijndael128_decrypt, rijndael128_setkey, rijndael128_zerokey, + NULL +}; + +struct enc_xform enc_xform_aes_xts = { + CRYPTO_AES_XTS, "AES-XTS", + RIJNDAEL128_BLOCK_LEN, 32, 64, + aes_xts_encrypt, + aes_xts_decrypt, + aes_xts_setkey, + aes_xts_zerokey, + aes_xts_reinit }; struct enc_xform enc_xform_arc4 = { @@ -187,6 +212,7 @@ struct enc_xform enc_xform_arc4 = { NULL, NULL, NULL, + NULL }; struct enc_xform enc_xform_camellia = { @@ -196,6 +222,7 @@ struct enc_xform enc_xform_camellia = { cml_decrypt, cml_setkey, cml_zerokey, + NULL }; /* Authentication instances */ @@ -547,6 +574,107 @@ rijndael128_zerokey(u_int8_t **sched) *sched = NULL; } +#define AES_XTS_BLOCKSIZE 16 +#define AES_XTS_IVSIZE 8 +#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */ + +struct aes_xts_ctx { + rijndael_ctx key1; + rijndael_ctx key2; + u_int8_t tweak[AES_XTS_BLOCKSIZE]; +}; + +void +aes_xts_reinit(caddr_t key, u_int8_t *iv) +{ + struct aes_xts_ctx *ctx = (struct aes_xts_ctx *)key; + u_int64_t blocknum; + u_int i; + + /* + * Prepare tweak as E_k2(IV). IV is specified as LE representation + * of a 64-bit block number which we allow to be passed in directly. + */ + bcopy(iv, &blocknum, AES_XTS_IVSIZE); + for (i = 0; i < AES_XTS_IVSIZE; i++) { + ctx->tweak[i] = blocknum & 0xff; + blocknum >>= 8; + } + /* Last 64 bits of IV are always zero */ + bzero(ctx->tweak + AES_XTS_IVSIZE, AES_XTS_IVSIZE); + + rijndael_encrypt(&ctx->key2, ctx->tweak, ctx->tweak); +} + +static void +aes_xts_crypt(struct aes_xts_ctx *ctx, u_int8_t *data, u_int do_encrypt) +{ + u_int8_t block[AES_XTS_BLOCKSIZE]; + u_int i, carry_in, carry_out; + + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) + block[i] = data[i] ^ ctx->tweak[i]; + + if (do_encrypt) + rijndael_encrypt(&ctx->key1, block, data); + else + rijndael_decrypt(&ctx->key1, block, data); + + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) + data[i] ^= ctx->tweak[i]; + + /* Exponentiate tweak */ + carry_in = 0; + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) { + carry_out = ctx->tweak[i] & 0x80; + ctx->tweak[i] = (ctx->tweak[i] << 1) | (carry_in ? 1 : 0); + carry_in = carry_out; + } + if (carry_in) + ctx->tweak[0] ^= AES_XTS_ALPHA; + bzero(block, sizeof(block)); +} + +void +aes_xts_encrypt(caddr_t key, u_int8_t *data) +{ + aes_xts_crypt((struct aes_xts_ctx *)key, data, 1); +} + +void +aes_xts_decrypt(caddr_t key, u_int8_t *data) +{ + aes_xts_crypt((struct aes_xts_ctx *)key, data, 0); +} + +int +aes_xts_setkey(u_int8_t **sched, u_int8_t *key, int len) +{ + struct aes_xts_ctx *ctx; + + if (len != 32 && len != 64) + return EINVAL; + + *sched = malloc(sizeof(struct aes_xts_ctx), M_CRYPTO_DATA, + M_NOWAIT | M_ZERO); + if (*sched == NULL) + return ENOMEM; + ctx = (struct aes_xts_ctx *)*sched; + + rijndael_set_key(&ctx->key1, key, len * 4); + rijndael_set_key(&ctx->key2, key + (len / 2), len * 4); + + return 0; +} + +void +aes_xts_zerokey(u_int8_t **sched) +{ + bzero(*sched, sizeof(struct aes_xts_ctx)); + free(*sched, M_CRYPTO_DATA); + *sched = NULL; +} + static void cml_encrypt(caddr_t key, u_int8_t *blk) { Modified: head/sys/opencrypto/xform.h ============================================================================== --- head/sys/opencrypto/xform.h Thu Sep 23 11:49:47 2010 (r213067) +++ head/sys/opencrypto/xform.h Thu Sep 23 11:52:32 2010 (r213068) @@ -54,6 +54,7 @@ struct enc_xform { void (*decrypt) (caddr_t, u_int8_t *); int (*setkey) (u_int8_t **, u_int8_t *, int len); void (*zerokey) (u_int8_t **); + void (*reinit) (caddr_t, u_int8_t *); }; struct comp_algo { @@ -80,6 +81,7 @@ extern struct enc_xform enc_xform_blf; extern struct enc_xform enc_xform_cast5; extern struct enc_xform enc_xform_skipjack; extern struct enc_xform enc_xform_rijndael128; +extern struct enc_xform enc_xform_aes_xts; extern struct enc_xform enc_xform_arc4; extern struct enc_xform enc_xform_camellia; From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:57:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600FE106566B; Thu, 23 Sep 2010 11:57:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9EC8FC08; Thu, 23 Sep 2010 11:57:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBvPw0068298; Thu, 23 Sep 2010 11:57:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBvPwv068294; Thu, 23 Sep 2010 11:57:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231157.o8NBvPwv068294@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213069 - head/sys/crypto/aesni X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:57:25 -0000 Author: pjd Date: Thu Sep 23 11:57:25 2010 New Revision: 213069 URL: http://svn.freebsd.org/changeset/base/213069 Log: Add support for CRYPTO_AES_XTS. MFC after: 1 week Modified: head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni.h head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Thu Sep 23 11:52:32 2010 (r213068) +++ head/sys/crypto/aesni/aesni.c Thu Sep 23 11:57:25 2010 (r213069) @@ -74,7 +74,7 @@ aesni_probe(device_t dev) device_printf(dev, "No AESNI support.\n"); return (EINVAL); } - device_set_desc_copy(dev, "AES-CBC"); + device_set_desc_copy(dev, "AES-CBC,AES-XTS"); return (0); } @@ -94,6 +94,7 @@ aesni_attach(device_t dev) rw_init(&sc->lock, "aesni_lock"); crypto_register(sc->cid, CRYPTO_AES_CBC, 0, 0); + crypto_register(sc->cid, CRYPTO_AES_XTS, 0, 0); return (0); } @@ -140,6 +141,7 @@ aesni_newsession(device_t dev, uint32_t for (; cri != NULL; cri = cri->cri_next) { switch (cri->cri_alg) { case CRYPTO_AES_CBC: + case CRYPTO_AES_XTS: if (encini != NULL) return (EINVAL); encini = cri; @@ -172,6 +174,7 @@ aesni_newsession(device_t dev, uint32_t ses->used = 1; TAILQ_INSERT_TAIL(&sc->sessions, ses, next); rw_wunlock(&sc->lock); + ses->algo = encini->cri_alg; error = aesni_cipher_setup(ses, encini); if (error != 0) { @@ -243,6 +246,7 @@ aesni_process(device_t dev, struct crypt for (crd = crp->crp_desc; crd != NULL; crd = crd->crd_next) { switch (crd->crd_alg) { case CRYPTO_AES_CBC: + case CRYPTO_AES_XTS: if (enccrd != NULL) { error = EINVAL; goto out; Modified: head/sys/crypto/aesni/aesni.h ============================================================================== --- head/sys/crypto/aesni/aesni.h Thu Sep 23 11:52:32 2010 (r213068) +++ head/sys/crypto/aesni/aesni.h Thu Sep 23 11:57:25 2010 (r213069) @@ -55,7 +55,9 @@ struct aesni_session { uint8_t enc_schedule[AES_SCHED_LEN] __aligned(16); uint8_t dec_schedule[AES_SCHED_LEN] __aligned(16); + uint8_t xts_schedule[AES_SCHED_LEN] __aligned(16); uint8_t iv[AES_BLOCK_LEN]; + int algo; int rounds; /* uint8_t *ses_ictx; */ /* uint8_t *ses_octx; */ Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:52:32 2010 (r213068) +++ head/sys/crypto/aesni/aesni_wrap.c Thu Sep 23 11:57:25 2010 (r213069) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010 Konstantin Belousov + * Copyright (c) 2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -105,28 +106,138 @@ aesni_decrypt_ecb(int rounds, const void } } +#define AES_XTS_BLOCKSIZE 16 +#define AES_XTS_IVSIZE 8 +#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */ + +static void +aesni_crypt_xts_block(int rounds, const void *key_schedule, uint8_t *tweak, + const uint8_t *from, uint8_t *to, int do_encrypt) +{ + uint8_t block[AES_XTS_BLOCKSIZE]; + u_int i, carry_in, carry_out; + + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) + block[i] = from[i] ^ tweak[i]; + + if (do_encrypt) + aesni_enc(rounds - 1, key_schedule, block, to, NULL); + else + aesni_dec(rounds - 1, key_schedule, block, to, NULL); + + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) + to[i] ^= tweak[i]; + + /* Exponentiate tweak. */ + carry_in = 0; + for (i = 0; i < AES_XTS_BLOCKSIZE; i++) { + carry_out = tweak[i] & 0x80; + tweak[i] = (tweak[i] << 1) | (carry_in ? 1 : 0); + carry_in = carry_out; + } + if (carry_in) + tweak[0] ^= AES_XTS_ALPHA; + bzero(block, sizeof(block)); +} + +static void +aesni_crypt_xts(int rounds, const void *data_schedule, + const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, + const uint8_t iv[AES_BLOCK_LEN], int do_encrypt) +{ + uint8_t tweak[AES_XTS_BLOCKSIZE]; + uint64_t blocknum; + size_t i; + + /* + * Prepare tweak as E_k2(IV). IV is specified as LE representation + * of a 64-bit block number which we allow to be passed in directly. + */ + bcopy(iv, &blocknum, AES_XTS_IVSIZE); + for (i = 0; i < AES_XTS_IVSIZE; i++) { + tweak[i] = blocknum & 0xff; + blocknum >>= 8; + } + /* Last 64 bits of IV are always zero. */ + bzero(tweak + AES_XTS_IVSIZE, AES_XTS_IVSIZE); + aesni_enc(rounds - 1, tweak_schedule, tweak, tweak, NULL); + + len /= AES_XTS_BLOCKSIZE; + for (i = 0; i < len; i++) { + aesni_crypt_xts_block(rounds, data_schedule, tweak, from, to, + do_encrypt); + from += AES_XTS_BLOCKSIZE; + to += AES_XTS_BLOCKSIZE; + } + + bzero(tweak, sizeof(tweak)); +} + +static void +aesni_encrypt_xts(int rounds, const void *data_schedule, + const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, + const uint8_t iv[AES_BLOCK_LEN]) +{ + + aesni_crypt_xts(rounds, data_schedule, tweak_schedule, len, from, to, + iv, 1); +} + +static void +aesni_decrypt_xts(int rounds, const void *data_schedule, + const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, + const uint8_t iv[AES_BLOCK_LEN]) +{ + + aesni_crypt_xts(rounds, data_schedule, tweak_schedule, len, from, to, + iv, 0); +} + static int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, int keylen) { - switch (keylen) { - case 128: - ses->rounds = AES128_ROUNDS; - break; - case 192: - ses->rounds = AES192_ROUNDS; + switch (ses->algo) { + case CRYPTO_AES_CBC: + switch (keylen) { + case 128: + ses->rounds = AES128_ROUNDS; + break; + case 192: + ses->rounds = AES192_ROUNDS; + break; + case 256: + ses->rounds = AES256_ROUNDS; + break; + default: + return (EINVAL); + } break; - case 256: - ses->rounds = AES256_ROUNDS; + case CRYPTO_AES_XTS: + switch (keylen) { + case 256: + ses->rounds = AES128_ROUNDS; + break; + case 512: + ses->rounds = AES256_ROUNDS; + break; + default: + return (EINVAL); + } break; default: return (EINVAL); } - + aesni_set_enckey(key, ses->enc_schedule, ses->rounds); aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, ses->rounds); - arc4rand(ses->iv, sizeof(ses->iv), 0); + if (ses->algo == CRYPTO_AES_XTS) + arc4rand(ses->iv, sizeof(ses->iv), 0); + else /* if (ses->algo == CRYPTO_AES_XTS) */ { + aesni_set_enckey(key + keylen / 16, ses->xts_schedule, + ses->rounds); + } return (0); } @@ -137,14 +248,14 @@ aesni_cipher_setup(struct aesni_session struct thread *td; int error; - td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); - if (error == 0) { + td = curthread; + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (error == 0) { error = aesni_cipher_setup_common(ses, encini->cri_key, encini->cri_klen); - fpu_kern_leave(td, &ses->fpu_ctx); - } - return (error); + fpu_kern_leave(td, &ses->fpu_ctx); + } + return (error); } int @@ -163,7 +274,7 @@ aesni_cipher_process(struct aesni_sessio error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); if (error != 0) goto out; - + if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { error = aesni_cipher_setup_common(ses, enccrd->crd_key, enccrd->crd_klen); @@ -174,21 +285,31 @@ aesni_cipher_process(struct aesni_sessio if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); - if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); - - aesni_encrypt_cbc(ses->rounds, ses->enc_schedule, - enccrd->crd_len, buf, buf, ses->iv); + if (ses->algo == CRYPTO_AES_CBC) { + aesni_encrypt_cbc(ses->rounds, ses->enc_schedule, + enccrd->crd_len, buf, buf, ses->iv); + } else /* if (ses->algo == CRYPTO_AES_XTS) */ { + aesni_encrypt_xts(ses->rounds, ses->enc_schedule, + ses->xts_schedule, enccrd->crd_len, buf, buf, + ses->iv); + } } else { if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); else crypto_copydata(crp->crp_flags, crp->crp_buf, enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); - aesni_decrypt_cbc(ses->rounds, ses->dec_schedule, - enccrd->crd_len, buf, ses->iv); + if (ses->algo == CRYPTO_AES_CBC) { + aesni_decrypt_cbc(ses->rounds, ses->dec_schedule, + enccrd->crd_len, buf, ses->iv); + } else /* if (ses->algo == CRYPTO_AES_XTS) */ { + aesni_decrypt_xts(ses->rounds, ses->enc_schedule, + ses->xts_schedule, enccrd->crd_len, buf, buf, + ses->iv); + } } fpu_kern_leave(td, &ses->fpu_ctx); if (allocated) From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 11:58:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FFCE106564A; Thu, 23 Sep 2010 11:58:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF668FC13; Thu, 23 Sep 2010 11:58:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NBwbOc068359; Thu, 23 Sep 2010 11:58:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NBwbDA068353; Thu, 23 Sep 2010 11:58:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231158.o8NBwbDA068353@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 11:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213070 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:58:37 -0000 Author: pjd Date: Thu Sep 23 11:58:36 2010 New Revision: 213070 URL: http://svn.freebsd.org/changeset/base/213070 Log: Add support for AES-XTS. This will be the default now. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_crypto.c head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Sep 23 11:57:25 2010 (r213069) +++ head/sys/geom/eli/g_eli.c Thu Sep 23 11:58:36 2010 (r213070) @@ -409,18 +409,31 @@ void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, size_t size) { - u_char off[8], hash[SHA256_DIGEST_LENGTH]; - SHA256_CTX ctx; + uint8_t off[8]; if ((sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER) != 0) bcopy(&offset, off, sizeof(off)); else le64enc(off, (uint64_t)offset); - /* Copy precalculated SHA256 context for IV-Key. */ - bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); - SHA256_Update(&ctx, off, sizeof(off)); - SHA256_Final(hash, &ctx); - bcopy(hash, iv, size); + + switch (sc->sc_ealgo) { + case CRYPTO_AES_XTS: + bcopy(off, iv, sizeof(off)); + bzero(iv + sizeof(off), size - sizeof(off)); + break; + default: + { + u_char hash[SHA256_DIGEST_LENGTH]; + SHA256_CTX ctx; + + /* Copy precalculated SHA256 context for IV-Key. */ + bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); + SHA256_Update(&ctx, off, sizeof(off)); + SHA256_Final(hash, &ctx); + bcopy(hash, iv, MIN(sizeof(hash), size)); + break; + } + } } int @@ -672,14 +685,23 @@ g_eli_create(struct gctl_req *req, struc * This is expensive operation and we can do it only once now or for * every access to sector, so now will be much better. */ - SHA256_Init(&sc->sc_ivctx); - SHA256_Update(&sc->sc_ivctx, sc->sc_ivkey, sizeof(sc->sc_ivkey)); + switch (sc->sc_ealgo) { + case CRYPTO_AES_XTS: + break; + default: + SHA256_Init(&sc->sc_ivctx); + SHA256_Update(&sc->sc_ivctx, sc->sc_ivkey, + sizeof(sc->sc_ivkey)); + break; + } LIST_INIT(&sc->sc_workers); bzero(&crie, sizeof(crie)); crie.cri_alg = sc->sc_ealgo; crie.cri_klen = sc->sc_ekeylen; + if (sc->sc_ealgo == CRYPTO_AES_XTS) + crie.cri_klen <<= 1; crie.cri_key = sc->sc_ekeys[0]; if (sc->sc_flags & G_ELI_FLAG_AUTH) { bzero(&cria, sizeof(cria)); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Thu Sep 23 11:57:25 2010 (r213069) +++ head/sys/geom/eli/g_eli.h Thu Sep 23 11:58:36 2010 (r213070) @@ -60,7 +60,7 @@ * 3 - Added 'configure' subcommand. * 4 - IV is generated from offset converted to little-endian * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions). - * 5 - Added multiple encrypton keys. + * 5 - Added multiple encrypton keys and AES-XTS support. */ #define G_ELI_VERSION 5 @@ -294,14 +294,26 @@ g_eli_str2ealgo(const char *name) if (strcasecmp("null", name) == 0) return (CRYPTO_NULL_CBC); + else if (strcasecmp("null-cbc", name) == 0) + return (CRYPTO_NULL_CBC); else if (strcasecmp("aes", name) == 0) + return (CRYPTO_AES_XTS); + else if (strcasecmp("aes-cbc", name) == 0) return (CRYPTO_AES_CBC); + else if (strcasecmp("aes-xts", name) == 0) + return (CRYPTO_AES_XTS); else if (strcasecmp("blowfish", name) == 0) return (CRYPTO_BLF_CBC); + else if (strcasecmp("blowfish-cbc", name) == 0) + return (CRYPTO_BLF_CBC); else if (strcasecmp("camellia", name) == 0) return (CRYPTO_CAMELLIA_CBC); + else if (strcasecmp("camellia-cbc", name) == 0) + return (CRYPTO_CAMELLIA_CBC); else if (strcasecmp("3des", name) == 0) return (CRYPTO_3DES_CBC); + else if (strcasecmp("3des-cbc", name) == 0) + return (CRYPTO_3DES_CBC); return (CRYPTO_ALGORITHM_MIN - 1); } @@ -333,6 +345,8 @@ g_eli_algo2str(u_int algo) return ("NULL"); case CRYPTO_AES_CBC: return ("AES-CBC"); + case CRYPTO_AES_XTS: + return ("AES-XTS"); case CRYPTO_BLF_CBC: return ("Blowfish-CBC"); case CRYPTO_CAMELLIA_CBC: @@ -418,6 +432,16 @@ g_eli_keylen(u_int algo, u_int keylen) default: return (0); } + case CRYPTO_AES_XTS: + switch (keylen) { + case 0: + return (128); + case 128: + case 256: + return (keylen); + default: + return (0); + } case CRYPTO_BLF_CBC: if (keylen == 0) return (128); Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Thu Sep 23 11:57:25 2010 (r213069) +++ head/sys/geom/eli/g_eli_crypto.c Thu Sep 23 11:58:36 2010 (r213070) @@ -69,6 +69,9 @@ g_eli_crypto_cipher(u_int algo, int enc, u_char *p; int error; + KASSERT(algo != CRYPTO_AES_XTS, + ("%s: CRYPTO_AES_XTS unexpected here", __func__)); + bzero(&cri, sizeof(cri)); cri.cri_alg = algo; cri.cri_key = __DECONST(void *, key); @@ -136,6 +139,8 @@ g_eli_crypto_cipher(u_int algo, int enc, u_char iv[keysize]; int outsize; + assert(algo != CRYPTO_AES_XTS); + switch (algo) { case CRYPTO_NULL_CBC: type = EVP_enc_null(); @@ -212,6 +217,10 @@ g_eli_crypto_encrypt(u_int algo, u_char const u_char *key, size_t keysize) { + /* We prefer AES-CBC for metadata protection. */ + if (algo == CRYPTO_AES_XTS) + algo = CRYPTO_AES_CBC; + return (g_eli_crypto_cipher(algo, 1, data, datasize, key, keysize)); } @@ -220,6 +229,10 @@ g_eli_crypto_decrypt(u_int algo, u_char const u_char *key, size_t keysize) { + /* We prefer AES-CBC for metadata protection. */ + if (algo == CRYPTO_AES_XTS) + algo = CRYPTO_AES_CBC; + return (g_eli_crypto_cipher(algo, 0, data, datasize, key, keysize)); } Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 11:57:25 2010 (r213069) +++ head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 11:58:36 2010 (r213070) @@ -509,6 +509,8 @@ g_eli_auth_run(struct g_eli_worker *wr, crde->crd_alg = sc->sc_ealgo; crde->crd_key = g_eli_crypto_key(sc, dstoff, encr_secsize); crde->crd_klen = sc->sc_ekeylen; + if (sc->sc_ealgo == CRYPTO_AES_XTS) + crde->crd_klen <<= 1; g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, sizeof(crde->crd_iv)); Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:57:25 2010 (r213069) +++ head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 11:58:36 2010 (r213070) @@ -259,6 +259,8 @@ g_eli_crypto_run(struct g_eli_worker *wr crd->crd_alg = sc->sc_ealgo; crd->crd_key = g_eli_crypto_key(sc, dstoff, secsize); crd->crd_klen = sc->sc_ekeylen; + if (sc->sc_ealgo == CRYPTO_AES_XTS) + crd->crd_klen <<= 1; g_eli_crypto_ivgen(sc, dstoff, crd->crd_iv, sizeof(crd->crd_iv)); crd->crd_next = NULL; From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 12:00:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E47D11065675; Thu, 23 Sep 2010 12:00:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A0E8FC21; Thu, 23 Sep 2010 12:00:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NC0ema068467; Thu, 23 Sep 2010 12:00:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NC0elw068465; Thu, 23 Sep 2010 12:00:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231200.o8NC0elw068465@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 12:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213071 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 12:00:41 -0000 Author: pjd Date: Thu Sep 23 12:00:40 2010 New Revision: 213071 URL: http://svn.freebsd.org/changeset/base/213071 Log: Document AES-XTS. MFC after: 1 week Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Thu Sep 23 11:58:36 2010 (r213070) +++ head/sbin/geom/class/eli/geli.8 Thu Sep 23 12:00:40 2010 (r213071) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2005-2008 Pawel Jakub Dawidek +.\" Copyright (c) 2005-2010 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2010 +.Dd September 23, 2010 .Dt GELI 8 .Os .Sh NAME @@ -151,11 +151,12 @@ framework, so when there is crypto hardw will make use of it automatically. .It Supports many cryptographic algorithms (currently -.Nm AES , -.Nm Blowfish , -.Nm Camellia +.Nm AES-XTS , +.Nm AES-CBC , +.Nm Blowfish-CBC , +.Nm Camellia-CBC and -.Nm 3DES ) . +.Nm 3DES-CBC ) . .It Can optionally perform data authentication (integrity verification) utilizing one of the following algorithms: @@ -257,13 +258,14 @@ as the .It Fl e Ar ealgo Encryption algorithm to use. Currently supported algorithms are: -.Nm AES , -.Nm Blowfish , -.Nm Camellia +.Nm AES-XTS , +.Nm AES-CBC , +.Nm Blowfish-CBC , +.Nm Camellia-CBC and -.Nm 3DES . +.Nm 3DES-CBC . The default and recommended algorithm is -.Nm AES . +.Nm AES-XTS . .It Fl i Ar iterations Number of iterations to use with PKCS#5v2. If this option is not specified, @@ -283,13 +285,13 @@ Here is how more than one file with a ke Key length to use with the given cryptographic algorithm. If not given, the default key length for the given algorithm is used, which is: 128 for -.Nm AES , -128 for -.Nm Blowfish , -128 for -.Nm Camellia +.Nm AES-XTS , +.Nm AES-CBC , +.Nm Blowfish-CBC +and +.Nm Camellia-CBC and 192 for -.Nm 3DES . +.Nm 3DES-CBC . .It Fl P Do not use passphrase as the key component. .It Fl s Ar sectorsize @@ -709,6 +711,21 @@ update the metadata: # geli resize -s 1g ada0p1 # geli attach -k keyfile -p ada0p1 .Ed +.Sh ENCRYPTION MODES +.Nm +supports two encryption modes: +.Nm XTS , +which was standarized as +.Nm IEE P1619 +and +.Nm CBC +with unpredictable IV. +The +.Nm CBC +mode used by +.Nm +is very similar to the mode +.Nm ESSIV . .Sh DATA AUTHENTICATION .Nm can verify data integrity when an authentication algorithm is specified. From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 12:02:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 225C0106566B; Thu, 23 Sep 2010 12:02:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11B678FC17; Thu, 23 Sep 2010 12:02:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NC28x1068541; Thu, 23 Sep 2010 12:02:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NC285E068533; Thu, 23 Sep 2010 12:02:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231202.o8NC285E068533@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 12:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213072 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 12:02:09 -0000 Author: pjd Date: Thu Sep 23 12:02:08 2010 New Revision: 213072 URL: http://svn.freebsd.org/changeset/base/213072 Log: Update copyright years. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_crypto.c head/sys/geom/eli/g_eli_ctl.c head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_key.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2006 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli.h Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2006 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli_crypto.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli_ctl.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli_integrity.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2006 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli_key.c ============================================================================== --- head/sys/geom/eli/g_eli_key.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli_key.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 12:00:40 2010 (r213071) +++ head/sys/geom/eli/g_eli_privacy.c Thu Sep 23 12:02:08 2010 (r213072) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2006 Pawel Jakub Dawidek + * Copyright (c) 2005-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 12:02:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 934AF10656C2; Thu, 23 Sep 2010 12:02:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82ACF8FC17; Thu, 23 Sep 2010 12:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NC2gRI068596; Thu, 23 Sep 2010 12:02:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NC2gIn068594; Thu, 23 Sep 2010 12:02:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231202.o8NC2gIn068594@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 12:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213073 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 12:02:42 -0000 Author: pjd Date: Thu Sep 23 12:02:42 2010 New Revision: 213073 URL: http://svn.freebsd.org/changeset/base/213073 Log: Update copyright years. MFC after: 1 week Modified: head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 12:02:08 2010 (r213072) +++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 12:02:42 2010 (r213073) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2008 Pawel Jakub Dawidek + * Copyright (c) 2004-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 12:04:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2223E10656A5; Thu, 23 Sep 2010 12:04:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10CD38FC25; Thu, 23 Sep 2010 12:04:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NC4CLr068745; Thu, 23 Sep 2010 12:04:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NC4ChR068742; Thu, 23 Sep 2010 12:04:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009231204.o8NC4ChR068742@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 23 Sep 2010 12:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213074 - head/sbin/geom/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 12:04:13 -0000 Author: pjd Date: Thu Sep 23 12:04:12 2010 New Revision: 213074 URL: http://svn.freebsd.org/changeset/base/213074 Log: - Simplify code by using g_*() API. - Don't use u_char and u_int in userland. - Change 'unsigned' to 'unsigned int'. - Update copyright years. MFC after: 1 week Modified: head/sbin/geom/misc/subr.c head/sbin/geom/misc/subr.h Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Thu Sep 23 12:02:42 2010 (r213073) +++ head/sbin/geom/misc/subr.c Thu Sep 23 12:04:12 2010 (r213074) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Pawel Jakub Dawidek + * Copyright (c) 2004-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,30 +54,20 @@ struct std_metadata { }; static void -std_metadata_decode(const u_char *data, struct std_metadata *md) +std_metadata_decode(const unsigned char *data, struct std_metadata *md) { bcopy(data, md->md_magic, sizeof(md->md_magic)); md->md_version = le32dec(data + 16); } -static void -pathgen(const char *name, char *path, size_t size) -{ - - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) != 0) - snprintf(path, size, "%s%s", _PATH_DEV, name); - else - strlcpy(path, name, size); -} - /* * Greatest Common Divisor. */ -static unsigned -gcd(unsigned a, unsigned b) +static unsigned int +gcd(unsigned int a, unsigned int b) { - u_int c; + unsigned int c; while (b != 0) { c = a; @@ -90,8 +80,8 @@ gcd(unsigned a, unsigned b) /* * Least Common Multiple. */ -unsigned -g_lcm(unsigned a, unsigned b) +unsigned int +g_lcm(unsigned int a, unsigned int b) { return ((a * b) / gcd(a, b)); @@ -129,7 +119,7 @@ bitcount32(uint32_t x) * */ int -g_parse_lba(const char *lbastr, unsigned sectorsize, off_t *sectors) +g_parse_lba(const char *lbastr, unsigned int sectorsize, off_t *sectors) { off_t number, mult, unit; char *s; @@ -200,76 +190,69 @@ done: off_t g_get_mediasize(const char *name) { - char path[MAXPATHLEN]; off_t mediasize; int fd; - pathgen(name, path, sizeof(path)); - fd = open(path, O_RDONLY); + fd = g_open(name, 0); if (fd == -1) return (0); - if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) { - close(fd); - return (0); - } - close(fd); + mediasize = g_mediasize(fd); + if (mediasize == -1) + mediasize = 0; + (void)g_close(fd); return (mediasize); } -unsigned +unsigned int g_get_sectorsize(const char *name) { - char path[MAXPATHLEN]; - unsigned sectorsize; + ssize_t sectorsize; int fd; - pathgen(name, path, sizeof(path)); - fd = open(path, O_RDONLY); + fd = g_open(name, 0); if (fd == -1) return (0); - if (ioctl(fd, DIOCGSECTORSIZE, §orsize) < 0) { - close(fd); - return (0); - } - close(fd); - return (sectorsize); + sectorsize = g_sectorsize(fd); + if (sectorsize == -1) + sectorsize = 0; + (void)g_close(fd); + return ((unsigned int)sectorsize); } int -g_metadata_read(const char *name, u_char *md, size_t size, const char *magic) +g_metadata_read(const char *name, unsigned char *md, size_t size, + const char *magic) { struct std_metadata stdmd; - char path[MAXPATHLEN]; - unsigned sectorsize; + unsigned char *sector; + ssize_t sectorsize; off_t mediasize; - u_char *sector; int error, fd; - pathgen(name, path, sizeof(path)); sector = NULL; error = 0; - fd = open(path, O_RDONLY); + fd = g_open(name, 0); if (fd == -1) return (errno); - mediasize = g_get_mediasize(name); - if (mediasize == 0) { + mediasize = g_mediasize(fd); + if (mediasize == -1) { error = errno; goto out; } - sectorsize = g_get_sectorsize(name); - if (sectorsize == 0) { + sectorsize = g_sectorsize(fd); + if (sectorsize == -1) { error = errno; goto out; } - assert(sectorsize >= size); + assert(sectorsize >= (ssize_t)size); sector = malloc(sectorsize); if (sector == NULL) { error = ENOMEM; goto out; } if (pread(fd, sector, sectorsize, mediasize - sectorsize) != - (ssize_t)sectorsize) { + sectorsize) { error = errno; goto out; } @@ -284,37 +267,35 @@ g_metadata_read(const char *name, u_char out: if (sector != NULL) free(sector); - close(fd); + g_close(fd); return (error); } int -g_metadata_store(const char *name, u_char *md, size_t size) +g_metadata_store(const char *name, const unsigned char *md, size_t size) { - char path[MAXPATHLEN]; - unsigned sectorsize; + unsigned char *sector; + ssize_t sectorsize; off_t mediasize; - u_char *sector; int error, fd; - pathgen(name, path, sizeof(path)); sector = NULL; error = 0; - fd = open(path, O_WRONLY); + fd = g_open(name, 1); if (fd == -1) return (errno); - mediasize = g_get_mediasize(name); - if (mediasize == 0) { + mediasize = g_mediasize(fd); + if (mediasize == -1) { error = errno; goto out; } - sectorsize = g_get_sectorsize(name); - if (sectorsize == 0) { + sectorsize = g_sectorsize(fd); + if (sectorsize == -1) { error = errno; goto out; } - assert(sectorsize >= size); + assert(sectorsize >= (ssize_t)size); sector = malloc(sectorsize); if (sector == NULL) { error = ENOMEM; @@ -322,15 +303,15 @@ g_metadata_store(const char *name, u_cha } bcopy(md, sector, size); if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) != - (ssize_t)sectorsize) { + sectorsize) { error = errno; goto out; } - (void)ioctl(fd, DIOCGFLUSH, NULL); + (void)g_flush(fd); out: if (sector != NULL) free(sector); - close(fd); + (void)g_close(fd); return (error); } @@ -338,25 +319,23 @@ int g_metadata_clear(const char *name, const char *magic) { struct std_metadata md; - char path[MAXPATHLEN]; - unsigned sectorsize; + unsigned char *sector; + ssize_t sectorsize; off_t mediasize; - u_char *sector; int error, fd; - pathgen(name, path, sizeof(path)); sector = NULL; error = 0; - fd = open(path, O_RDWR); + fd = g_open(name, 1); if (fd == -1) return (errno); - mediasize = g_get_mediasize(name); + mediasize = g_mediasize(fd); if (mediasize == 0) { error = errno; goto out; } - sectorsize = g_get_sectorsize(name); + sectorsize = g_sectorsize(fd); if (sectorsize == 0) { error = errno; goto out; @@ -368,7 +347,7 @@ g_metadata_clear(const char *name, const } if (magic != NULL) { if (pread(fd, sector, sectorsize, mediasize - sectorsize) != - (ssize_t)sectorsize) { + sectorsize) { error = errno; goto out; } @@ -380,15 +359,15 @@ g_metadata_clear(const char *name, const } bzero(sector, sectorsize); if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) != - (ssize_t)sectorsize) { + sectorsize) { error = errno; goto out; } - (void)ioctl(fd, DIOCGFLUSH, NULL); + (void)g_flush(fd); out: if (sector != NULL) free(sector); - close(fd); + g_close(fd); return (error); } @@ -412,8 +391,8 @@ gctl_get_param(struct gctl_req *req, siz { struct gctl_req_arg *argp; char param[256]; + unsigned int i; void *p; - unsigned i; vsnprintf(param, sizeof(param), pfmt, ap); for (i = 0; i < req->narg; i++) { @@ -486,7 +465,7 @@ gctl_change_param(struct gctl_req *req, const void *value) { struct gctl_req_arg *ap; - unsigned i; + unsigned int i; if (req == NULL || req->error != NULL) return (EDOOFUS); Modified: head/sbin/geom/misc/subr.h ============================================================================== --- head/sbin/geom/misc/subr.h Thu Sep 23 12:02:42 2010 (r213073) +++ head/sbin/geom/misc/subr.h Thu Sep 23 12:04:12 2010 (r213074) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Pawel Jakub Dawidek + * Copyright (c) 2004-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,16 +30,16 @@ #define _SUBR_H_ #include -unsigned g_lcm(unsigned a, unsigned b); +unsigned int g_lcm(unsigned int a, unsigned int b); uint32_t bitcount32(uint32_t x); -int g_parse_lba(const char *lbastr, unsigned sectorsize, off_t *sectors); +int g_parse_lba(const char *lbastr, unsigned int sectorsize, off_t *sectors); off_t g_get_mediasize(const char *name); -unsigned g_get_sectorsize(const char *name); +unsigned int g_get_sectorsize(const char *name); -int g_metadata_read(const char *name, u_char *md, size_t size, +int g_metadata_read(const char *name, unsigned char *md, size_t size, const char *magic); -int g_metadata_store(const char *name, u_char *md, size_t size); +int g_metadata_store(const char *name, const unsigned char *md, size_t size); int g_metadata_clear(const char *name, const char *magic); void gctl_error(struct gctl_req *req, const char *error, ...) __printflike(2, 3); From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 14:06:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75187106564A; Thu, 23 Sep 2010 14:06:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644C78FC12; Thu, 23 Sep 2010 14:06:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NE6FsE071317; Thu, 23 Sep 2010 14:06:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NE6FuZ071314; Thu, 23 Sep 2010 14:06:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009231406.o8NE6FuZ071314@svn.freebsd.org> From: Marius Strobl Date: Thu, 23 Sep 2010 14:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213075 - in head: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 14:06:15 -0000 Author: marius Date: Thu Sep 23 14:06:15 2010 New Revision: 213075 URL: http://svn.freebsd.org/changeset/base/213075 Log: Try to adhere to style.Makefile(5). MFC after: 3 days Modified: head/libexec/tftpd/Makefile head/usr.bin/tftp/Makefile Modified: head/libexec/tftpd/Makefile ============================================================================== --- head/libexec/tftpd/Makefile Thu Sep 23 12:04:12 2010 (r213074) +++ head/libexec/tftpd/Makefile Thu Sep 23 14:06:15 2010 (r213075) @@ -2,13 +2,11 @@ # $FreeBSD$ PROG= tftpd -SRCS= tftpd.c tftp-io.c tftp-utils.c tftp-file.c tftp-transfer.c tftp-options.c +MAN= tftpd.8 +SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c +SRCS+= tftpd.c WARNS= 3 WFORMAT=0 -MAN= tftpd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/tftp -I${.CURDIR}/../../libexec/tftpd -.PATH: ${.CURDIR}/../../usr.bin/tftp -COPTFLAGS = -O LDFLAGS= -lwrap .include Modified: head/usr.bin/tftp/Makefile ============================================================================== --- head/usr.bin/tftp/Makefile Thu Sep 23 12:04:12 2010 (r213074) +++ head/usr.bin/tftp/Makefile Thu Sep 23 14:06:15 2010 (r213075) @@ -1,12 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -WARNS= 3 +.PATH: ${.CURDIR}/../../libexec/tftpd + PROG= tftp -SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c +SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c +SRCS+= tftp-utils.c tftp.c +WARNS= 3 +CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap -CFLAGS+=-I${.CURDIR}/../../libexec/tftpd -I${.CURDIR}/../../usr.bin/tftp -.PATH: ${.CURDIR}/../../libexec/tftpd .include From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 14:25:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B0E106566C; Thu, 23 Sep 2010 14:25:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C6A338FC1C; Thu, 23 Sep 2010 14:25:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7337346C0A; Thu, 23 Sep 2010 10:25:56 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 43E8F8A04F; Thu, 23 Sep 2010 10:25:55 -0400 (EDT) From: John Baldwin To: Bruce Cran Date: Thu, 23 Sep 2010 09:53:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> In-Reply-To: <20100922222441.00002f27@unknown> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009230953.56201.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 23 Sep 2010 10:25:55 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 14:25:57 -0000 On Wednesday, September 22, 2010 5:24:41 pm Bruce Cran wrote: > On Thu, 23 Sep 2010 00:02:30 +0300 > Andriy Gapon wrote: > > > But what was the reason that dumpdev="AUTO" was reverted? > > I remember that POLA was quoted at the time. > > I am not sure what the astonishment actually was - perhaps 'AUTO' was > > not smart enough and destroyed somebody's data? > > > > The problem with "AUTO" is that it takes time to do the dump unless > using textdumps; it also has the potential of failing and leaving the > system unusable until someone resets it. I believe the argument was > that for production servers you want the system to be up and running > again as soon as possible after a crash. minidumps have made the time issue less of a concern on large-memory systems (full dumps do indeed take a long time on modern systems). I think textdumps are just as likely to fail as regular dumps though since they both use the same code for writing out the dump, they just write different bits to the dump area. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 14:31:20 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BE5106567A; Thu, 23 Sep 2010 14:31:20 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id BA5388FC1A; Thu, 23 Sep 2010 14:31:19 +0000 (UTC) Received: from [192.168.1.2] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o8NEVFvh035307; Thu, 23 Sep 2010 07:31:15 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4C9B64B1.4090907@feral.com> Date: Thu, 23 Sep 2010 07:31:13 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <201009230953.56201.jhb@freebsd.org> In-Reply-To: <201009230953.56201.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Thu, 23 Sep 2010 07:31:15 -0700 (PDT) Cc: Bruce Cran , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andriy Gapon , Gavin Atkinson , svn-src-head@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 14:31:20 -0000 There are a lot of accelerations that can be applied here- so much so that Panasas elected to stick with minidumps rather than go to text dumps, even though there is a fairly hard time limit that a blade can be down before more drastic error recovery mechanisms for the shelf kick in. It turns out that the big issue here was more the savecore time coming back up rather than the time of dumping. > minidumps have made the time issue less of a concern on large-memory systems > (full dumps do indeed take a long time on modern systems). I think textdumps > are just as likely to fail as regular dumps though since they both use the > same code for writing out the dump, they just write different bits to the dump > area. > From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 14:49:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B112E106566B; Thu, 23 Sep 2010 14:49:02 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3431B8FC0A; Thu, 23 Sep 2010 14:49:00 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA26161; Thu, 23 Sep 2010 17:48:59 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C9B68DB.9010401@freebsd.org> Date: Thu, 23 Sep 2010 17:48:59 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <201009230953.56201.jhb@freebsd.org> In-Reply-To: <201009230953.56201.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 14:49:02 -0000 on 23/09/2010 16:53 John Baldwin said the following: > minidumps have made the time issue less of a concern on large-memory systems > (full dumps do indeed take a long time on modern systems). I think textdumps > are just as likely to fail as regular dumps though since they both use the > same code for writing out the dump, they just write different bits to the dump > area. Well, minidumps are not always very small. And there's still that issue of other CPUs still running during panic->dumping and thus (mini-)dump maps getting changed (larger) after dump size calculations which results in an aborted dump. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 14:59:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E02891065696; Thu, 23 Sep 2010 14:59:10 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 96B018FC22; Thu, 23 Sep 2010 14:59:10 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id B9FED2F3D; Thu, 23 Sep 2010 10:59:09 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 2A6A029A6; Thu, 23 Sep 2010 10:58:08 -0400 (EDT) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 033D92E95; Thu, 23 Sep 2010 10:58:08 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id E1B3C207A9; Thu, 23 Sep 2010 10:58:07 -0400 (EDT) From: Ken Smith To: Bruce Cran In-Reply-To: <20100922222441.00002f27@unknown> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-3A6k1mQFOC+28WuonU2M" Date: Thu, 23 Sep 2010 10:58:07 -0400 Message-ID: <1285253887.95760.33.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Andriy Gapon , Gavin Atkinson , svn-src-head@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 14:59:11 -0000 --=-3A6k1mQFOC+28WuonU2M Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2010-09-22 at 22:24 +0100, Bruce Cran wrote: > On Thu, 23 Sep 2010 00:02:30 +0300 > Andriy Gapon wrote: >=20 > > But what was the reason that dumpdev=3D"AUTO" was reverted? > > I remember that POLA was quoted at the time. > > I am not sure what the astonishment actually was - perhaps 'AUTO' was > > not smart enough and destroyed somebody's data? > >=20 >=20 > The problem with "AUTO" is that it takes time to do the dump unless > using textdumps; it also has the potential of failing and leaving the > system unusable until someone resets it. I believe the argument was > that for production servers you want the system to be up and running > again as soon as possible after a crash.=20 >=20 I'm (extremely!) sympathetic with people wanting to make it easier to get debugging information in PRs and that sort of thing. But just so you know - unless I hear otherwise I'll be continuing to try to remember to flip it off as the stable branches get created. The issues talked about so far all contribute to the reason for that. But one of the more basic gut reactions to it all is that the users want to be interested in helping with the debugging (even if just providing the requested info) for any sort of crash information to be useful. And at the point we shift something from -current to -stable the percentage of people actively interested in participating in that sort of stuff flip. The bulk of people using -current know it's risky and they do it out of some interest in debugging stuff. The *bulk* of people using -stable are less interested or flat out not interested. And have no clue what crash dumps are, may be challenged to notice partition-getting-full issues, etc. I'm open to having my mind changed about this if there is enough push-back. Just saying I'm not there yet. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-3A6k1mQFOC+28WuonU2M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkybau8ACgkQ/G14VSmup/adhwCdEPdurdcRqfpLCuMKzQX8TuP5 BecAn25cOvpqh1t9VMh2prMpV0LHXDek =vGKa -----END PGP SIGNATURE----- --=-3A6k1mQFOC+28WuonU2M-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 17:12:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567F21065673; Thu, 23 Sep 2010 17:12:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45C398FC20; Thu, 23 Sep 2010 17:12:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NHClBF075384; Thu, 23 Sep 2010 17:12:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NHClB9075382; Thu, 23 Sep 2010 17:12:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009231712.o8NHClB9075382@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Sep 2010 17:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213077 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 17:12:47 -0000 Author: imp Date: Thu Sep 23 17:12:47 2010 New Revision: 213077 URL: http://svn.freebsd.org/changeset/base/213077 Log: Simplify how we find the kernel source. Rather than depending on sys, or some variation in the path, the new version assumes that $0 is newvers.sh path, and that dirname $0/.. is the same as $S aka $SYSDIR. It also removes knowledge of ${MACHINE} and ${MACHINE_ARCH}, which is also good. # I've had this in my tree for about 6 months now, which is why I # didn't notice that I broke it in r209510 and that was fixed in # r212954. This should finally resolve the issues people had with # r204824 as well as address the issues that motivated r204824. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Sep 23 15:10:28 2010 (r213076) +++ head/sys/conf/newvers.sh Thu Sep 23 17:12:47 2010 (r213077) @@ -38,13 +38,14 @@ if [ "X${BRANCH_OVERRIDE}" != "X" ]; the fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" +SYSDIR=$(dirname $0)/.. if [ "X${PARAMFILE}" != "X" ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ ${PARAMFILE}) else RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - $(dirname $0)/../sys/param.h) + ${SYSDIR}/sys/param.h) fi @@ -87,51 +88,43 @@ touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` -case "$d" in -*/sys/*) - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE.$MACHINE_ARCH} +for dir in /bin /usr/bin /usr/local/bin; do + if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then + svnversion=${dir}/svnversion + break + fi + if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break fi - SRCDIR=${SRCDIR%%/sys/*} +done - for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then - svnversion=${dir}/svnversion - break - fi - if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" - break - fi - done +if [ -n "$svnversion" ] ; then + echo "$svnversion" + svn=" r`cd ${SYSDIR} && $svnversion`" +fi - if [ -n "$svnversion" ] ; then - svn=" r`cd ${SRCDIR}/sys && $svnversion`" - fi - if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then +if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then svn=" r${svn}" - git="=${git}" + git="+${git}" else - svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi - if $git_cmd --work-tree=${SRCDIR} diff-index \ - --name-only HEAD | read dummy; then - git="${git}-dirty" + git=" ${git}" fi fi - ;; -esac + if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi +fi cat << EOF > vers.c $COPYRIGHT From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 17:30:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23061106566B; Thu, 23 Sep 2010 17:30:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5F288FC0A; Thu, 23 Sep 2010 17:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NHTxBK075758; Thu, 23 Sep 2010 17:29:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NHTxSQ075756; Thu, 23 Sep 2010 17:29:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009231729.o8NHTxSQ075756@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Sep 2010 17:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213078 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 17:30:00 -0000 Author: imp Date: Thu Sep 23 17:29:59 2010 New Revision: 213078 URL: http://svn.freebsd.org/changeset/base/213078 Log: Clean up stray line in 213077 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Sep 23 17:12:47 2010 (r213077) +++ head/sys/conf/newvers.sh Thu Sep 23 17:29:59 2010 (r213078) @@ -48,7 +48,6 @@ else ${SYSDIR}/sys/param.h) fi - b=share/examples/etc/bsd-style-copyright year=`date '+%Y'` # look for copyright template From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 17:47:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9972F1065693; Thu, 23 Sep 2010 17:47:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 891A58FC12; Thu, 23 Sep 2010 17:47:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NHlkdk076197; Thu, 23 Sep 2010 17:47:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NHlk3x076195; Thu, 23 Sep 2010 17:47:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009231747.o8NHlk3x076195@svn.freebsd.org> From: Ed Maste Date: Thu, 23 Sep 2010 17:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213080 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 17:47:46 -0000 Author: emaste Date: Thu Sep 23 17:47:46 2010 New Revision: 213080 URL: http://svn.freebsd.org/changeset/base/213080 Log: Remove unnecessary weak reference that was apparently copied from the version of this function in lib/libc/inet/inet_pton.c MFC after: 1 week Modified: head/sys/rpc/inet_pton.c Modified: head/sys/rpc/inet_pton.c ============================================================================== --- head/sys/rpc/inet_pton.c Thu Sep 23 17:37:57 2010 (r213079) +++ head/sys/rpc/inet_pton.c Thu Sep 23 17:47:46 2010 (r213080) @@ -218,11 +218,4 @@ inet_pton6(const char *src, u_char *dst) return (1); } -/* - * Weak aliases for applications that use certain private entry points, - * and fail to include . - */ -#undef inet_pton -__weak_reference(__inet_pton, inet_pton); - /*! \file */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 18:00:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB41106566B; Thu, 23 Sep 2010 18:00:03 +0000 (UTC) (envelope-from gavin@ury.york.ac.uk) Received: from gse-mta-27.emailfiltering.com (gse-mta-27-tx.emailfiltering.com [194.116.198.158]) by mx1.freebsd.org (Postfix) with ESMTP id 1DCD98FC14; Thu, 23 Sep 2010 18:00:01 +0000 (UTC) Received: from mail-gw5.york.ac.uk ([144.32.129.29]) by gse-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 755133664 for kensmith@buffalo.edu; 31e5c2905fa20a47; Thu, 23 Sep 2010 18:59:55 +0100 Received: from ury.york.ac.uk ([144.32.108.81]:38213) by mail-gw5.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Oyq5J-0006Zx-TJ; Thu, 23 Sep 2010 18:59:53 +0100 Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1Oyq5J-0007cT-Ls; Thu, 23 Sep 2010 18:59:53 +0100 Date: Thu, 23 Sep 2010 18:59:53 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Ken Smith In-Reply-To: <1285253887.95760.33.camel@bauer.cse.buffalo.edu> Message-ID: References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Cc: Bruce Cran , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Andriy Gapon , svn-src-head@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 18:00:03 -0000 On Thu, 23 Sep 2010, Ken Smith wrote: > The issues talked about so far all contribute to the reason for that. > But one of the more basic gut reactions to it all is that the users > want to be interested in helping with the debugging (even if just > providing the requested info) for any sort of crash information > to be useful. And at the point we shift something from -current > to -stable the percentage of people actively interested in participating > in that sort of stuff flip. The bulk of people using -current > know it's risky and they do it out of some interest in debugging > stuff. The *bulk* of people using -stable are less interested or > flat out not interested. And have no clue what crash dumps are, > may be challenged to notice partition-getting-full issues, etc. I'm not sure I buy this argument, I'm afraid. Part of the advantage of having all this done automatically on the as-shipped release media is that end users don't have to be interested in debugging - crashinfo(8) does most of the work for them. There's no easy way to actually determine figures, but even if say only 10-15% of crashes can be diagnosed and corrected just from the output of crashinfo(8) then that's a huge win for the project as a whole. I'm guessing 10-15% is not unrealistic. I appreciate the issue about filling partitions is a valid one. Would a possible compromise be that on release media, crashinfo(8) or similar will default to only keeping the most recent coredump or similar? Given /var now defaults to 4GB, Defaulting to keeping a single core is probably acceptable. Gavin From owner-svn-src-head@FreeBSD.ORG Thu Sep 23 18:55:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3AD31065789; Thu, 23 Sep 2010 18:55:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3C678FC2A; Thu, 23 Sep 2010 18:55:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8NItsSB077662; Thu, 23 Sep 2010 18:55:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NIts49077660; Thu, 23 Sep 2010 18:55:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009231855.o8NIts49077660@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 23 Sep 2010 18:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213081 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 18:55:55 -0000 Author: yongari Date: Thu Sep 23 18:55:54 2010 New Revision: 213081 URL: http://svn.freebsd.org/changeset/base/213081 Log: Always show asic/chip revision in device attach phase. There are too many bge(4) controllers there and model name does not necessarily match asic/chip revision. Relying on VPD string made it hard to identify exact asic/chip revision so the first step to debug bge(4) was getting exact asic/chip information with verbose boot which may not be available on production server. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Sep 23 17:47:46 2010 (r213080) +++ head/sys/dev/bge/if_bge.c Thu Sep 23 18:55:54 2010 (r213081) @@ -2644,12 +2644,11 @@ bge_attach(device_t dev) goto fail; } - if (bootverbose) - device_printf(dev, - "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n", - sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev, - (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" : - ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI")); + device_printf(dev, + "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n", + sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev, + (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" : + ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI")); BGE_LOCK_INIT(sc, device_get_nameunit(dev)); From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 00:14:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CE8106566C; Fri, 24 Sep 2010 00:14:24 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 669C48FC20; Fri, 24 Sep 2010 00:14:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O0EOM8084406; Fri, 24 Sep 2010 00:14:24 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O0EOA8084403; Fri, 24 Sep 2010 00:14:24 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009240014.o8O0EOA8084403@svn.freebsd.org> From: Juli Mallett Date: Fri, 24 Sep 2010 00:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213089 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 00:14:24 -0000 Author: jmallett Date: Fri Sep 24 00:14:24 2010 New Revision: 213089 URL: http://svn.freebsd.org/changeset/base/213089 Log: Flesh out PCI bus support some: o) Reset and configure the bus from scratch rather than expecting U-Boot to do it for us. Values and configuration from Linux, U-Boot and comments in the Cavium Simple Executive sources. o) Do a resource assignment and bus numbering pass in the absence of a PCI BIOS or firmware that will do it for us. XXX This has to be the third or fourth instance of this in FreeBSD and it would be nice to have it become part of the PCI bus driver itself, like it is on Linux. o) Fix interrupt mapping for and adjust bus configuration for the Lanner MR-955, based on information provided by Lanner. Modified: head/sys/mips/cavium/octopci.c head/sys/mips/cavium/octopcireg.h Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Thu Sep 23 23:05:31 2010 (r213088) +++ head/sys/mips/cavium/octopci.c Fri Sep 24 00:14:24 2010 (r213089) @@ -61,13 +61,19 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +#define NPI_WRITE(addr, value) cvmx_write64_uint32((addr) ^ 4, (value)) +#define NPI_READ(addr) cvmx_read64_uint32((addr) ^ 4) + struct octopci_softc { device_t sc_dev; unsigned sc_domain; unsigned sc_bus; + unsigned sc_io_next; struct rman sc_io; + + unsigned sc_mem1_next; struct rman sc_mem1; }; @@ -86,6 +92,9 @@ static void octopci_write_config(device_ uint32_t, int); static int octopci_route_interrupt(device_t, device_t, int); +static void octopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned); +static unsigned octopci_init_device(device_t, unsigned, unsigned, unsigned, unsigned); +static unsigned octopci_init_bus(device_t, unsigned); static uint64_t octopci_cs_addr(unsigned, unsigned, unsigned, unsigned); static void @@ -108,13 +117,205 @@ static int octopci_attach(device_t dev) { struct octopci_softc *sc; + cvmx_npi_mem_access_subid_t npi_mem_access_subid; + cvmx_npi_pci_int_arb_cfg_t npi_pci_int_arb_cfg; + cvmx_npi_ctl_status_t npi_ctl_status; + cvmx_pci_ctl_status_2_t pci_ctl_status_2; + cvmx_pci_cfg56_t pci_cfg56; + cvmx_pci_cfg22_t pci_cfg22; + cvmx_pci_cfg16_t pci_cfg16; + cvmx_pci_cfg19_t pci_cfg19; + cvmx_pci_cfg01_t pci_cfg01; + unsigned subbus; + unsigned i; int error; /* - * XXX - * We currently rely on U-Boot to set up the PCI in host state. We - * should properly initialize the PCI bus here. + * Reset the PCI bus. + */ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x1); + cvmx_read_csr(CVMX_CIU_SOFT_PRST); + + DELAY(2000); + + npi_ctl_status.u64 = 0; + npi_ctl_status.s.max_word = 1; + npi_ctl_status.s.timer = 1; + cvmx_write_csr(CVMX_NPI_CTL_STATUS, npi_ctl_status.u64); + + /* + * Set host mode. + */ + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + /* 32-bit PCI-X */ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x0); + break; +#endif + default: + /* 64-bit PCI-X */ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x4); + break; + } + cvmx_read_csr(CVMX_CIU_SOFT_PRST); + + DELAY(2000); + + /* + * Enable BARs and configure big BAR mode. + */ + pci_ctl_status_2.u32 = 0; + pci_ctl_status_2.s.bb1_hole = 5; /* 256MB hole in BAR1 */ + pci_ctl_status_2.s.bb1_siz = 1; /* BAR1 is 2GB */ + pci_ctl_status_2.s.bb_ca = 1; /* Bypass cache for big BAR */ + pci_ctl_status_2.s.bb_es = 1; /* Do big BAR byte-swapping */ + pci_ctl_status_2.s.bb1 = 1; /* BAR1 is big */ + pci_ctl_status_2.s.bb0 = 1; /* BAR0 is big */ + pci_ctl_status_2.s.bar2pres = 1; /* BAR2 present */ + pci_ctl_status_2.s.pmo_amod = 1; /* Round-robin priority */ + pci_ctl_status_2.s.tsr_hwm = 1; + pci_ctl_status_2.s.bar2_enb = 1; /* Enable BAR2 */ + pci_ctl_status_2.s.bar2_esx = 1; /* Do BAR2 byte-swapping */ + pci_ctl_status_2.s.bar2_cax = 1; /* Bypass cache for BAR2 */ + + NPI_WRITE(CVMX_NPI_PCI_CTL_STATUS_2, pci_ctl_status_2.u32); + + DELAY(2000); + + pci_ctl_status_2.u32 = NPI_READ(CVMX_NPI_PCI_CTL_STATUS_2); + + device_printf(dev, "%u-bit PCI%s bus.\n", + pci_ctl_status_2.s.ap_64ad ? 64 : 32, + pci_ctl_status_2.s.ap_pcix ? "-X" : ""); + + /* + * Set up transaction splitting, etc., parameters. + */ + pci_cfg19.u32 = 0; + pci_cfg19.s.mrbcm = 1; + if (pci_ctl_status_2.s.ap_pcix) { + pci_cfg19.s.mdrrmc = 0; + pci_cfg19.s.tdomc = 4; + } else { + pci_cfg19.s.mdrrmc = 2; + pci_cfg19.s.tdomc = 1; + } + NPI_WRITE(CVMX_NPI_PCI_CFG19, pci_cfg19.u32); + NPI_READ(CVMX_NPI_PCI_CFG19); + + /* + * Set up PCI error handling and memory access. */ + pci_cfg01.u32 = 0; + pci_cfg01.s.fbbe = 1; + pci_cfg01.s.see = 1; + pci_cfg01.s.pee = 1; + pci_cfg01.s.me = 1; + pci_cfg01.s.msae = 1; + if (pci_ctl_status_2.s.ap_pcix) { + pci_cfg01.s.fbb = 0; + } else { + pci_cfg01.s.fbb = 1; + } + NPI_WRITE(CVMX_NPI_PCI_CFG01, pci_cfg01.u32); + NPI_READ(CVMX_NPI_PCI_CFG01); + + /* + * Enable the Octeon bus arbiter. + */ + npi_pci_int_arb_cfg.u64 = 0; + npi_pci_int_arb_cfg.s.en = 1; + cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, npi_pci_int_arb_cfg.u64); + + /* + * Disable master latency timer. + */ + pci_cfg16.u32 = 0; + pci_cfg16.s.mltd = 1; + NPI_WRITE(CVMX_NPI_PCI_CFG16, pci_cfg16.u32); + NPI_READ(CVMX_NPI_PCI_CFG16); + + /* + * Configure master arbiter. + */ + pci_cfg22.u32 = 0; + pci_cfg22.s.flush = 1; + pci_cfg22.s.mrv = 255; + NPI_WRITE(CVMX_NPI_PCI_CFG22, pci_cfg22.u32); + NPI_READ(CVMX_NPI_PCI_CFG22); + + /* + * Set up PCI-X capabilities. + */ + if (pci_ctl_status_2.s.ap_pcix) { + pci_cfg56.u32 = 0; + pci_cfg56.s.most = 3; + pci_cfg56.s.roe = 1; /* Enable relaxed ordering */ + pci_cfg56.s.dpere = 1; + pci_cfg56.s.ncp = 0xe8; + pci_cfg56.s.pxcid = 7; + NPI_WRITE(CVMX_NPI_PCI_CFG56, pci_cfg56.u32); + NPI_READ(CVMX_NPI_PCI_CFG56); + } + + NPI_WRITE(CVMX_NPI_PCI_READ_CMD_6, 0x22); + NPI_READ(CVMX_NPI_PCI_READ_CMD_6); + NPI_WRITE(CVMX_NPI_PCI_READ_CMD_C, 0x33); + NPI_READ(CVMX_NPI_PCI_READ_CMD_C); + NPI_WRITE(CVMX_NPI_PCI_READ_CMD_E, 0x33); + NPI_READ(CVMX_NPI_PCI_READ_CMD_E); + + /* + * Configure MEM1 sub-DID access. + */ + npi_mem_access_subid.u64 = 0; + npi_mem_access_subid.s.esr = 1; /* Byte-swap on read */ + npi_mem_access_subid.s.esw = 1; /* Byte-swap on write */ + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + npi_mem_access_subid.s.shortl = 1; + break; +#endif + default: + break; + } + cvmx_write_csr(CVMX_NPI_MEM_ACCESS_SUBID3, npi_mem_access_subid.u64); + + /* + * Configure BAR2. Linux says this has to come first. + */ + NPI_WRITE(CVMX_NPI_PCI_CFG08, 0x00000000); + NPI_READ(CVMX_NPI_PCI_CFG08); + NPI_WRITE(CVMX_NPI_PCI_CFG09, 0x00000080); + NPI_READ(CVMX_NPI_PCI_CFG09); + + /* + * Disable BAR1 IndexX. + */ + for (i = 0; i < 32; i++) { + NPI_WRITE(CVMX_NPI_PCI_BAR1_INDEXX(i), 0); + NPI_READ(CVMX_NPI_PCI_BAR1_INDEXX(i)); + } + + /* + * Configure BAR0 and BAR1. + */ + NPI_WRITE(CVMX_NPI_PCI_CFG04, 0x00000000); + NPI_READ(CVMX_NPI_PCI_CFG04); + NPI_WRITE(CVMX_NPI_PCI_CFG05, 0x00000000); + NPI_READ(CVMX_NPI_PCI_CFG05); + + NPI_WRITE(CVMX_NPI_PCI_CFG06, 0x80000000); + NPI_READ(CVMX_NPI_PCI_CFG06); + NPI_WRITE(CVMX_NPI_PCI_CFG07, 0x00000000); + NPI_READ(CVMX_NPI_PCI_CFG07); + + /* + * Clear PCI interrupts. + */ + cvmx_write_csr(CVMX_NPI_PCI_INT_SUM2, 0xffffffffffffffffull); sc = device_get_softc(dev); sc->sc_dev = dev; @@ -143,6 +344,19 @@ octopci_attach(device_t dev) if (error != 0) return (error); + /* + * Next offsets for resource allocation in octopci_init_bar. + */ + sc->sc_io_next = 0; + sc->sc_mem1_next = 0; + + /* + * Configure devices. + */ + octopci_write_config(dev, 0, 0, 0, PCIR_SUBBUS_1, 0xff, 1); + subbus = octopci_init_bus(dev, 0); + octopci_write_config(dev, 0, 0, 0, PCIR_SUBBUS_1, subbus, 1); + device_add_child(dev, "pci", 0); return (bus_generic_attach(dev)); @@ -336,12 +550,20 @@ octopci_route_interrupt(device_t dev, de func = pci_get_function(child); #if defined(OCTEON_VENDOR_LANNER) - if (slot < 32) { - if (slot == 3 || slot == 9) - irq = pin; - else - irq = pin - 1; - return (CVMX_IRQ_PCI_INT0 + (irq & 3)); + switch (cvmx_sysinfo_get()->board_type) { + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + return (CVMX_IRQ_PCI_INT0 + pin - 1); + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + if (slot < 32) { + if (slot == 3 || slot == 9) + irq = pin; + else + irq = pin - 1; + return (CVMX_IRQ_PCI_INT0 + (irq & 3)); + } + break; + default: + break; } #endif @@ -350,6 +572,184 @@ octopci_route_interrupt(device_t dev, de return (CVMX_IRQ_PCI_INT0 + (irq & 3)); } +static void +octopci_init_bar(device_t dev, unsigned b, unsigned s, unsigned f, unsigned barnum) +{ + struct octopci_softc *sc; + uint32_t bar; + unsigned size; + + sc = device_get_softc(dev); + + octopci_write_config(dev, b, s, f, PCIR_BAR(barnum), 0xffffffff, 4); + bar = octopci_read_config(dev, b, s, f, PCIR_BAR(barnum), 4); + + if (bar == 0) { + /* Bar not implemented. */ + return; + } + + /* XXX Some of this is wrong for 64-bit busses. */ + + if (PCI_BAR_IO(bar)) { + size = ~(bar & PCIM_BAR_IO_BASE) + 1; + + sc->sc_io_next = (sc->sc_io_next + size - 1) & ~(size - 1); + if (sc->sc_io_next + size > CVMX_OCT_PCI_IO_SIZE) { + device_printf(dev, "%02x.%02x:%02x: no ports for BAR%u.\n", + b, s, f, barnum); + return; + } + octopci_write_config(dev, b, s, f, PCIR_BAR(barnum), + CVMX_OCT_PCI_IO_BASE + sc->sc_io_next, 4); + sc->sc_io_next += size; + } else { + size = ~(bar & (uint32_t)PCIM_BAR_MEM_BASE) + 1; + + sc->sc_mem1_next = (sc->sc_mem1_next + size - 1) & ~(size - 1); + if (sc->sc_mem1_next + size > CVMX_OCT_PCI_MEM1_SIZE) { + device_printf(dev, "%02x.%02x:%02x: no memory for BAR%u.\n", + b, s, f, barnum); + return; + } + octopci_write_config(dev, b, s, f, PCIR_BAR(barnum), + CVMX_OCT_PCI_MEM1_BASE + sc->sc_mem1_next, 4); + sc->sc_mem1_next += size; + } +} + +static unsigned +octopci_init_device(device_t dev, unsigned b, unsigned s, unsigned f, unsigned secbus) +{ + unsigned barnum, bars; + uint8_t brctl; + uint8_t class, subclass; + uint8_t command; + uint8_t hdrtype; + + /* Read header type (again.) */ + hdrtype = octopci_read_config(dev, b, s, f, PCIR_HDRTYPE, 1); + + /* Program BARs. */ + switch (hdrtype & PCIM_HDRTYPE) { + case PCIM_HDRTYPE_NORMAL: + bars = 6; + break; + case PCIM_HDRTYPE_BRIDGE: + bars = 2; + break; + case PCIM_HDRTYPE_CARDBUS: + bars = 0; + break; + default: + device_printf(dev, "%02x.%02x:%02x: invalid header type %#x\n", + b, s, f, hdrtype); + return (secbus); + } + + for (barnum = 0; barnum < bars; barnum++) + octopci_init_bar(dev, b, s, f, barnum); + + /* Enable memory and I/O. */ + command = octopci_read_config(dev, b, s, f, PCIR_COMMAND, 1); + command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; + + /* Enable bus mastering. */ + command |= PCIM_CMD_BUSMASTEREN; + octopci_write_config(dev, b, s, f, PCIR_COMMAND, command, 1); + + /* Configure PCI-PCI bridges. */ + class = octopci_read_config(dev, b, s, f, PCIR_CLASS, 1); + if (class != PCIC_BRIDGE) + return (secbus); + + subclass = octopci_read_config(dev, b, s, f, PCIR_SUBCLASS, 1); + if (subclass != PCIS_BRIDGE_PCI) + return (secbus); + + /* Enable errors and parity checking. Do a bus reset. */ + brctl = octopci_read_config(dev, b, s, f, PCIR_BRIDGECTL_1, 1); + brctl |= PCIB_BCR_PERR_ENABLE | PCIB_BCR_SERR_ENABLE; + + /* Perform a secondary bus reset. */ + brctl |= PCIB_BCR_SECBUS_RESET; + octopci_write_config(dev, b, s, f, PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); + brctl &= ~PCIB_BCR_SECBUS_RESET; + octopci_write_config(dev, b, s, f, PCIR_BRIDGECTL_1, brctl, 1); + + secbus++; + + /* Program memory and I/O ranges. */ + octopci_write_config(dev, b, s, f, PCIR_MEMBASE_1, + CVMX_OCT_PCI_MEM1_BASE >> 16, 2); + octopci_write_config(dev, b, s, f, PCIR_MEMLIMIT_1, + (CVMX_OCT_PCI_MEM1_BASE + CVMX_OCT_PCI_MEM1_SIZE - 1) >> 16, 2); + + octopci_write_config(dev, b, s, f, PCIR_IOBASEL_1, + CVMX_OCT_PCI_IO_BASE >> 8, 1); + octopci_write_config(dev, b, s, f, PCIR_IOBASEH_1, + CVMX_OCT_PCI_IO_BASE >> 16, 2); + + octopci_write_config(dev, b, s, f, PCIR_IOLIMITL_1, + (CVMX_OCT_PCI_IO_BASE + CVMX_OCT_PCI_IO_SIZE - 1) >> 8, 1); + octopci_write_config(dev, b, s, f, PCIR_IOLIMITH_1, + (CVMX_OCT_PCI_IO_BASE + CVMX_OCT_PCI_IO_SIZE - 1) >> 16, 2); + + /* Program prefetchable memory decoder. */ + /* XXX */ + + /* Probe secondary/subordinate buses. */ + octopci_write_config(dev, b, s, f, PCIR_PRIBUS_1, b, 1); + octopci_write_config(dev, b, s, f, PCIR_SECBUS_1, secbus, 1); + octopci_write_config(dev, b, s, f, PCIR_SUBBUS_1, 0xff, 1); + + /* Perform a secondary bus reset. */ + brctl |= PCIB_BCR_SECBUS_RESET; + octopci_write_config(dev, b, s, f, PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); + brctl &= ~PCIB_BCR_SECBUS_RESET; + octopci_write_config(dev, b, s, f, PCIR_BRIDGECTL_1, brctl, 1); + + /* Give the bus time to settle now before reading configspace. */ + DELAY(100000); + + secbus = octopci_init_bus(dev, secbus); + + octopci_write_config(dev, b, s, f, PCIR_SUBBUS_1, secbus, 1); + + return (secbus); +} + +static unsigned +octopci_init_bus(device_t dev, unsigned b) +{ + unsigned s, f; + uint8_t hdrtype; + unsigned secbus; + + secbus = b; + + for (s = 0; s <= PCI_SLOTMAX; s++) { + for (f = 0; f <= PCI_FUNCMAX; f++) { + hdrtype = octopci_read_config(dev, b, s, f, PCIR_HDRTYPE, 1); + + if (hdrtype == 0xff) { + if (f == 0) + break; /* Next slot. */ + continue; /* Next function. */ + } + + secbus = octopci_init_device(dev, b, s, f, secbus); + + if (f == 0 && (hdrtype & PCIM_MFDEV) == 0) + break; /* Next slot. */ + } + } + + return (secbus); +} + static uint64_t octopci_cs_addr(unsigned bus, unsigned slot, unsigned func, unsigned reg) { Modified: head/sys/mips/cavium/octopcireg.h ============================================================================== --- head/sys/mips/cavium/octopcireg.h Thu Sep 23 23:05:31 2010 (r213088) +++ head/sys/mips/cavium/octopcireg.h Fri Sep 24 00:14:24 2010 (r213089) @@ -96,10 +96,10 @@ typedef union #define CVMX_OCT_SUBDID_PCI_MEM3 5 #define CVMX_OCT_SUBDID_PCI_MEM4 6 -#define CVMX_OCT_PCI_IO_BASE 0x00001000 +#define CVMX_OCT_PCI_IO_BASE 0x00004000 #define CVMX_OCT_PCI_IO_SIZE 0x08000000 -#define CVMX_OCT_PCI_MEM1_BASE 0x80000000 -#define CVMX_OCT_PCI_MEM1_SIZE 0x40000000 +#define CVMX_OCT_PCI_MEM1_BASE 0xf0000000 +#define CVMX_OCT_PCI_MEM1_SIZE 0x0f000000 #endif /* !_CAVIUM_OCTOPCIREG_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 01:26:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10C3F106564A; Fri, 24 Sep 2010 01:26:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6698FC15; Fri, 24 Sep 2010 01:26:45 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8O1QfjK024882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Sep 2010 11:26:42 +1000 Date: Fri, 24 Sep 2010 11:26:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Marcel Moolenaar In-Reply-To: <11C42F9D-7201-4804-8923-430F28E58C57@mac.com> Message-ID: <20100924105219.J780@delplex.bde.org> References: <201009200420.o8K4KtKn026514@svn.freebsd.org> <20100920163758.A788@besplex.bde.org> <11C42F9D-7201-4804-8923-430F28E58C57@mac.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r212886 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 01:26:46 -0000 On Mon, 20 Sep 2010, Marcel Moolenaar wrote: > On Sep 19, 2010, at 11:55 PM, Bruce Evans wrote: > >> On Mon, 20 Sep 2010, Marcel Moolenaar wrote: >> >>> Log: >>> Unbreak the build on strong-aligned architectures (arm, ia64). >>> Casting from (char *) to (struct ufs1_dinode *) changes the >>> alignment requirement of the pointer and GCC does not know that >>> the pointer is adequately aligned (due to malloc(3)), and warns >>> about it. Cast to (void *) first to by-pass the check. >> >> A previous version in which the pointer (iobuf) the correct type to >> begin with was better. It used to have type void *, but now has type >> caddr_t (whose existence is a bug), in order to abuse caddr_t by >> assuming that it is char * to do pointer arithmetic on it in 1 place >> (iobuf + sblock.fs_cgsize). The 7 other places where iobuf is used >> only assume that caddr_t is a pointer (or perhaps a [u]intptr_t). >> >> growfs has no other instances of caddr_t. > > My first instinct was to retype iobuf as (void *), but saw > the pointer arithmetic and decided against it. If we had > a macro that one can use to add X number of bytes to a pointer > to any, I would have used that. Other macros to add X number > of short, int, long, could be handy too, but that may not be > as useful as for bytes. > > Would it be useful to add a macro like (don't mind the name): > > #define ADDBYTESTOPOINTER(ptr, cnt) \ > ((__typeof(ptr))(void *)((uintptr_t)(void *)(ptr) + (cnt))) As you may know, I like such macros in system headers as much as I like __DECONST() -- they are good enough for lining /dev/null but only after suitable heating :-). They are unportable and make it too easy to use wrong types. They are OK in individual applications, but most applications should have few instances of pointer frobbing so they don't need macros for it except to highlight its bogusness. The above implementation has the technical error of casting away any qualifiers of (ptr). __DECONST() is OK in that respect (it is good for it to be an error if it removes more than a const qualifier, but it has the technical error of not casting uintptr_t to (void *). If you don't bother with the cast to (void *), then you could also not bother with the cast to (const void *), except the latter has the advantage of detecting removal of more than a const qualifier -- perhaps that was intentional. Both depend on the bug that -Wcast-qual doesn't work for casting to uintptr_t. I think I prefer casting to (char *) than to uintptr_t for adding byte offsets to pointers. These give different problems with casting away qualifiers, as mentioned above. Perhaps the best way is application- dependent. But portable applications cannot use uintptr_t for this except in negatively useful ifdefs, since uintptr_t might not exist. IMO, the correct fix for fixing -Wcast-qual errors is to not use -Wcast-qual. The Standard method for removing type qualifiers is to explicitly cast them away, and -Wcast-qual breaks this. But bogus casts are still too common, so first you have to find them all. There should be a -Wbogus-cast option to help find them. This is a DWIM option so I don't know how to implement it :-). It could start by warning about casts that are null on all target, then warn about casts that are null on the current target. There should remain a cast-qual option that only applies to implicit casts (for assignments and function calls). Bruce From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 02:35:51 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27AD71065679; Fri, 24 Sep 2010 02:35:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D869D8FC1F; Fri, 24 Sep 2010 02:35:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8O2VYgZ024003; Thu, 23 Sep 2010 20:31:35 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Sep 2010 20:31:43 -0600 (MDT) Message-Id: <20100923.203143.19192035494300157.imp@bsdimp.com> To: gavin@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: bruce@cran.org.uk, src-committers@FreeBSD.org, jhb@FreeBSD.org, kensmith@buffalo.edu, svn-src-all@FreeBSD.org, avg@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 02:35:51 -0000 In message: Gavin Atkinson writes: : On Thu, 23 Sep 2010, Ken Smith wrote: : > The issues talked about so far all contribute to the reason for that. : > But one of the more basic gut reactions to it all is that the users : > want to be interested in helping with the debugging (even if just : > providing the requested info) for any sort of crash information : > to be useful. And at the point we shift something from -current : > to -stable the percentage of people actively interested in participating : > in that sort of stuff flip. The bulk of people using -current : > know it's risky and they do it out of some interest in debugging : > stuff. The *bulk* of people using -stable are less interested or : > flat out not interested. And have no clue what crash dumps are, : > may be challenged to notice partition-getting-full issues, etc. : : I'm not sure I buy this argument, I'm afraid. Part of the advantage of : having all this done automatically on the as-shipped release media is that : end users don't have to be interested in debugging - crashinfo(8) does : most of the work for them. There's no easy way to actually determine : figures, but even if say only 10-15% of crashes can be diagnosed and : corrected just from the output of crashinfo(8) then that's a huge win for : the project as a whole. I'm guessing 10-15% is not unrealistic. : : I appreciate the issue about filling partitions is a valid one. Would a : possible compromise be that on release media, crashinfo(8) or similar will : default to only keeping the most recent coredump or similar? Given /var : now defaults to 4GB, Defaulting to keeping a single core is probably : acceptable. Furthermore, if we aren't interested in crash dumps by default, why do we install the huge .symbols files? Warner From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 02:41:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47EF4106564A; Fri, 24 Sep 2010 02:41:53 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BCE28FC13; Fri, 24 Sep 2010 02:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O2frpF087295; Fri, 24 Sep 2010 02:41:53 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O2frHM087292; Fri, 24 Sep 2010 02:41:53 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009240241.o8O2frHM087292@svn.freebsd.org> From: Juli Mallett Date: Fri, 24 Sep 2010 02:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213090 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 02:41:53 -0000 Author: jmallett Date: Fri Sep 24 02:41:52 2010 New Revision: 213090 URL: http://svn.freebsd.org/changeset/base/213090 Log: o) Add bus_teardown_intr for pci and ciu. This allows the Promise SATA driver to try to switch interrupt handlers at setup. It's not a very good implementation of bus_teardown_intr, though. o) Set cache line size and latency timers for PCI devices per Linux. Modified: head/sys/mips/cavium/ciu.c head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/ciu.c ============================================================================== --- head/sys/mips/cavium/ciu.c Fri Sep 24 00:14:24 2010 (r213089) +++ head/sys/mips/cavium/ciu.c Fri Sep 24 02:41:52 2010 (r213090) @@ -78,6 +78,8 @@ static struct resource *ciu_alloc_resour static int ciu_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); +static int ciu_teardown_intr(device_t, device_t, + struct resource *, void *); static void ciu_hinted_child(device_t, const char *, int); static void ciu_en0_intr_mask(void *); @@ -230,6 +232,19 @@ ciu_setup_intr(device_t bus, device_t ch return (0); } +static int +ciu_teardown_intr(device_t bus, device_t child, struct resource *res, + void *cookie) +{ + int error; + + error = intr_event_remove_handler(cookie); + if (error != 0) + return (error); + + return (0); +} + static void ciu_hinted_child(device_t bus, const char *dname, int dunit) { @@ -342,7 +357,7 @@ static device_method_t ciu_methods[] = { DEVMETHOD(bus_alloc_resource, ciu_alloc_resource), DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), DEVMETHOD(bus_setup_intr, ciu_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_teardown_intr, ciu_teardown_intr), DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_hinted_child, ciu_hinted_child), Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Fri Sep 24 00:14:24 2010 (r213089) +++ head/sys/mips/cavium/octopci.c Fri Sep 24 02:41:52 2010 (r213090) @@ -658,6 +658,16 @@ octopci_init_device(device_t dev, unsign command |= PCIM_CMD_BUSMASTEREN; octopci_write_config(dev, b, s, f, PCIR_COMMAND, command, 1); + /* + * Set cache line size. On Octeon it should be 128 bytes, + * but according to Linux some Intel bridges have trouble + * with values over 64 bytes, so use 64 bytes. + */ + octopci_write_config(dev, b, s, f, PCIR_CACHELNSZ, 16, 1); + + /* Set latency timer. */ + octopci_write_config(dev, b, s, f, PCIR_LATTIMER, 48, 1); + /* Configure PCI-PCI bridges. */ class = octopci_read_config(dev, b, s, f, PCIR_CLASS, 1); if (class != PCIC_BRIDGE) @@ -783,6 +793,7 @@ static device_method_t octopci_methods[] DEVMETHOD(bus_activate_resource,octopci_activate_resource), DEVMETHOD(bus_deactivate_resource,bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_add_child, bus_generic_add_child), From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 03:08:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB7031065670 for ; Fri, 24 Sep 2010 03:08:13 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6BEF58FC0A for ; Fri, 24 Sep 2010 03:08:12 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o8O385CG065045 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 24 Sep 2010 12:38:11 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <1285253887.95760.33.camel@bauer.cse.buffalo.edu> Date: Fri, 24 Sep 2010 12:38:05 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> To: Ken Smith X-Mailer: Apple Mail (2.1081) X-Spam-Score: -2.51 () ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Bruce Cran , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Andriy Gapon , Gavin Atkinson , svn-src-head@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 03:08:14 -0000 On 24/09/2010, at 24:28, Ken Smith wrote: > stuff. The *bulk* of people using -stable are less interested or > flat out not interested. And have no clue what crash dumps are, > may be challenged to notice partition-getting-full issues, etc. >=20 > I'm open to having my mind changed about this if there is enough > push-back. Just saying I'm not there yet. I'd say people are uninterested in debugging right up until their system = panics and they want to stop it doing that :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 03:30:25 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3521B106566C; Fri, 24 Sep 2010 03:30:25 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailD.acsu.buffalo.edu (localmailD.acsu.buffalo.edu [128.205.5.208]) by mx1.freebsd.org (Postfix) with ESMTP id EF86A8FC0A; Fri, 24 Sep 2010 03:30:24 +0000 (UTC) Received: from localmailD.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id A9EBC18180C; Thu, 23 Sep 2010 23:11:39 -0400 (EDT) Received: from localmailD.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailD.acsu.buffalo.edu (Postfix) with ESMTP id 82CA8C1A0E; Thu, 23 Sep 2010 23:11:38 -0400 (EDT) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailD.acsu.buffalo.edu (Prefixe) with ESMTP id 66A66C188B; Thu, 23 Sep 2010 23:11:38 -0400 (EDT) Received: from [192.168.1.101] (cpe-76-180-182-44.buffalo.res.rr.com [76.180.182.44]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id CBA3F264001; Thu, 23 Sep 2010 23:11:37 -0400 (EDT) From: Ken Smith To: "M. Warner Losh" In-Reply-To: <20100923.203143.19192035494300157.imp@bsdimp.com> References: <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> <20100923.203143.19192035494300157.imp@bsdimp.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-CwXNp4MEp8Z5xqbc5zLq" Organization: U. Buffalo Date: Thu, 23 Sep 2010 23:11:24 -0400 Message-ID: <1285297884.17619.17.camel@neo.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: XX: 27% Cc: bruce@cran.org.uk, src-committers@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, gavin@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 03:30:25 -0000 --=-CwXNp4MEp8Z5xqbc5zLq Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2010-09-23 at 20:31 -0600, M. Warner Losh wrote: > In message: > Gavin Atkinson writes: > : On Thu, 23 Sep 2010, Ken Smith wrote: > : > The issues talked about so far all contribute to the reason for that. > : > But one of the more basic gut reactions to it all is that the users > : > want to be interested in helping with the debugging (even if just > : > providing the requested info) for any sort of crash information > : > to be useful. And at the point we shift something from -current > : > to -stable the percentage of people actively interested in participat= ing > : > in that sort of stuff flip. The bulk of people using -current > : > know it's risky and they do it out of some interest in debugging > : > stuff. The *bulk* of people using -stable are less interested or > : > flat out not interested. And have no clue what crash dumps are, > : > may be challenged to notice partition-getting-full issues, etc. > :=20 > : I'm not sure I buy this argument, I'm afraid. Part of the advantage of= =20 > : having all this done automatically on the as-shipped release media is t= hat=20 > : end users don't have to be interested in debugging - crashinfo(8) does= =20 > : most of the work for them. There's no easy way to actually determine= =20 > : figures, but even if say only 10-15% of crashes can be diagnosed and= =20 > : corrected just from the output of crashinfo(8) then that's a huge win f= or=20 > : the project as a whole. I'm guessing 10-15% is not unrealistic. > :=20 > : I appreciate the issue about filling partitions is a valid one. Would = a=20 > : possible compromise be that on release media, crashinfo(8) or similar w= ill=20 > : default to only keeping the most recent coredump or similar? Given /va= r=20 > : now defaults to 4GB, Defaulting to keeping a single core is probably= =20 > : acceptable. >=20 > Furthermore, if we aren't interested in crash dumps by default, why do > we install the huge .symbols files? >=20 > Warner >=20 Because disks are big and (again, just trying to explain my understanding of what I inherited) we want all the support to be in place, just not turned on. There is a difference between "You can give us much better information by doing and then making a one-line change to rc.conf" versus "You can give us much better information by making a one-line change to rc.conf". This is definitely one I don't have a strong enough opinion on to fight over, I sympathize with both sides. If the general consensus is mostly towards changing so be it. I've got no way to tell what percentage of users would have any clue what to do with the crash info versus users who would be negatively impacted simply by the fact their systems are generating stuff they're completely ignorant of and will never touch. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-CwXNp4MEp8Z5xqbc5zLq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkycFtQACgkQ/G14VSmup/ZvagCePkYQEJEZ8YtKVyJk4cWzXcfu agsAnjrcZYs5KPcrI371BiAL/rTxKnJA =UmHi -----END PGP SIGNATURE----- --=-CwXNp4MEp8Z5xqbc5zLq-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 04:46:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E667106564A; Fri, 24 Sep 2010 04:46:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D47D8FC1A; Fri, 24 Sep 2010 04:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O4kkZN090102; Fri, 24 Sep 2010 04:46:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O4kkp6090099; Fri, 24 Sep 2010 04:46:46 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201009240446.o8O4kkp6090099@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 24 Sep 2010 04:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213091 - head/sys/dev/hifn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 04:46:46 -0000 Author: gonzo Date: Fri Sep 24 04:46:46 2010 New Revision: 213091 URL: http://svn.freebsd.org/changeset/base/213091 Log: - Do not place variables to memory allocated by busdma. pre/post ops might invalidate cache and hence effectively void validity of values Modified: head/sys/dev/hifn/hifn7751.c head/sys/dev/hifn/hifn7751var.h Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Fri Sep 24 02:41:52 2010 (r213090) +++ head/sys/dev/hifn/hifn7751.c Fri Sep 24 04:46:46 2010 (r213091) @@ -1372,45 +1372,45 @@ hifn_alloc_slot(struct hifn_softc *sc, i { struct hifn_dma *dma = sc->sc_dma; - if (dma->cmdi == HIFN_D_CMD_RSIZE) { - dma->cmdi = 0; + if (sc->sc_cmdi == HIFN_D_CMD_RSIZE) { + sc->sc_cmdi = 0; dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *cmdp = dma->cmdi++; - dma->cmdk = dma->cmdi; + *cmdp = sc->sc_cmdi++; + sc->sc_cmdk = sc->sc_cmdi; - if (dma->srci == HIFN_D_SRC_RSIZE) { - dma->srci = 0; + if (sc->sc_srci == HIFN_D_SRC_RSIZE) { + sc->sc_srci = 0; dma->srcr[HIFN_D_SRC_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *srcp = dma->srci++; - dma->srck = dma->srci; + *srcp = sc->sc_srci++; + sc->sc_srck = sc->sc_srci; - if (dma->dsti == HIFN_D_DST_RSIZE) { - dma->dsti = 0; + if (sc->sc_dsti == HIFN_D_DST_RSIZE) { + sc->sc_dsti = 0; dma->dstr[HIFN_D_DST_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_DSTR_SYNC(sc, HIFN_D_DST_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *dstp = dma->dsti++; - dma->dstk = dma->dsti; + *dstp = sc->sc_dsti++; + sc->sc_dstk = sc->sc_dsti; - if (dma->resi == HIFN_D_RES_RSIZE) { - dma->resi = 0; + if (sc->sc_resi == HIFN_D_RES_RSIZE) { + sc->sc_resi = 0; dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *resp = dma->resi++; - dma->resk = dma->resi; + *resp = sc->sc_resi++; + sc->sc_resk = sc->sc_resi; } static int @@ -1563,9 +1563,9 @@ hifn_init_dma(struct hifn_softc *sc) dma->resr[HIFN_D_RES_RSIZE].p = htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, resr[0])); - dma->cmdu = dma->srcu = dma->dstu = dma->resu = 0; - dma->cmdi = dma->srci = dma->dsti = dma->resi = 0; - dma->cmdk = dma->srck = dma->dstk = dma->resk = 0; + sc->sc_cmdu = sc->sc_srcu = sc->sc_dstu = sc->sc_resu = 0; + sc->sc_cmdi = sc->sc_srci = sc->sc_dsti = sc->sc_resi = 0; + sc->sc_cmdk = sc->sc_srck = sc->sc_dstk = sc->sc_resk = 0; } /* @@ -1723,7 +1723,7 @@ hifn_dmamap_load_dst(struct hifn_softc * u_int32_t p, l; int idx, used = 0, i; - idx = dma->dsti; + idx = sc->sc_dsti; for (i = 0; i < dst->nsegs - 1; i++) { dma->dstr[idx].p = htole32(dst->segs[i].ds_addr); dma->dstr[idx].l = htole32(HIFN_D_VALID | @@ -1764,8 +1764,8 @@ hifn_dmamap_load_dst(struct hifn_softc * idx = hifn_dmamap_dstwrap(sc, idx); - dma->dsti = idx; - dma->dstu += used; + sc->sc_dsti = idx; + sc->sc_dstu += used; return (idx); } @@ -1792,7 +1792,7 @@ hifn_dmamap_load_src(struct hifn_softc * int idx, i; u_int32_t last = 0; - idx = dma->srci; + idx = sc->sc_srci; for (i = 0; i < src->nsegs; i++) { if (i == src->nsegs - 1) last = HIFN_D_LAST; @@ -1805,8 +1805,8 @@ hifn_dmamap_load_src(struct hifn_softc * idx = hifn_dmamap_srcwrap(sc, idx); } - dma->srci = idx; - dma->srcu += src->nsegs; + sc->sc_srci = idx; + sc->sc_srcu += src->nsegs; return (idx); } @@ -1840,13 +1840,13 @@ hifn_crypto( * NB: check this first since it's easy. */ HIFN_LOCK(sc); - if ((dma->cmdu + 1) > HIFN_D_CMD_RSIZE || - (dma->resu + 1) > HIFN_D_RES_RSIZE) { + if ((sc->sc_cmdu + 1) > HIFN_D_CMD_RSIZE || + (sc->sc_resu + 1) > HIFN_D_RES_RSIZE) { #ifdef HIFN_DEBUG if (hifn_debug) { device_printf(sc->sc_dev, "cmd/result exhaustion, cmdu %u resu %u\n", - dma->cmdu, dma->resu); + sc->sc_cmdu, sc->sc_resu); } #endif hifnstats.hst_nomem_cr++; @@ -1916,14 +1916,14 @@ hifn_crypto( } if (m0 == NULL) { hifnstats.hst_nomem_mbuf++; - err = dma->cmdu ? ERESTART : ENOMEM; + err = sc->sc_cmdu ? ERESTART : ENOMEM; goto err_srcmap; } if (totlen >= MINCLSIZE) { MCLGET(m0, M_DONTWAIT); if ((m0->m_flags & M_EXT) == 0) { hifnstats.hst_nomem_mcl++; - err = dma->cmdu ? ERESTART : ENOMEM; + err = sc->sc_cmdu ? ERESTART : ENOMEM; m_freem(m0); goto err_srcmap; } @@ -1937,7 +1937,7 @@ hifn_crypto( MGET(m, M_DONTWAIT, MT_DATA); if (m == NULL) { hifnstats.hst_nomem_mbuf++; - err = dma->cmdu ? ERESTART : ENOMEM; + err = sc->sc_cmdu ? ERESTART : ENOMEM; m_freem(m0); goto err_srcmap; } @@ -1946,7 +1946,7 @@ hifn_crypto( MCLGET(m, M_DONTWAIT); if ((m->m_flags & M_EXT) == 0) { hifnstats.hst_nomem_mcl++; - err = dma->cmdu ? ERESTART : ENOMEM; + err = sc->sc_cmdu ? ERESTART : ENOMEM; mlast->m_next = m; m_freem(m0); goto err_srcmap; @@ -1994,7 +1994,7 @@ hifn_crypto( "Entering cmd: stat %8x ien %8x u %d/%d/%d/%d n %d/%d\n", READ_REG_1(sc, HIFN_1_DMA_CSR), READ_REG_1(sc, HIFN_1_DMA_IER), - dma->cmdu, dma->srcu, dma->dstu, dma->resu, + sc->sc_cmdu, sc->sc_srcu, sc->sc_dstu, sc->sc_resu, cmd->src_nsegs, cmd->dst_nsegs); } #endif @@ -2012,14 +2012,14 @@ hifn_crypto( /* * need N src, and N dst */ - if ((dma->srcu + cmd->src_nsegs) > HIFN_D_SRC_RSIZE || - (dma->dstu + cmd->dst_nsegs + 1) > HIFN_D_DST_RSIZE) { + if ((sc->sc_srcu + cmd->src_nsegs) > HIFN_D_SRC_RSIZE || + (sc->sc_dstu + cmd->dst_nsegs + 1) > HIFN_D_DST_RSIZE) { #ifdef HIFN_DEBUG if (hifn_debug) { device_printf(sc->sc_dev, "src/dst exhaustion, srcu %u+%u dstu %u+%u\n", - dma->srcu, cmd->src_nsegs, - dma->dstu, cmd->dst_nsegs); + sc->sc_srcu, cmd->src_nsegs, + sc->sc_dstu, cmd->dst_nsegs); } #endif hifnstats.hst_nomem_sd++; @@ -2027,14 +2027,14 @@ hifn_crypto( goto err_dstmap; } - if (dma->cmdi == HIFN_D_CMD_RSIZE) { - dma->cmdi = 0; + if (sc->sc_cmdi == HIFN_D_CMD_RSIZE) { + sc->sc_cmdi = 0; dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - cmdi = dma->cmdi++; + cmdi = sc->sc_cmdi++; cmdlen = hifn_write_command(cmd, dma->command_bufs[cmdi]); HIFN_CMD_SYNC(sc, cmdi, BUS_DMASYNC_PREWRITE); @@ -2043,14 +2043,14 @@ hifn_crypto( HIFN_D_MASKDONEIRQ); HIFN_CMDR_SYNC(sc, cmdi, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); - dma->cmdu++; + sc->sc_cmdu++; /* * We don't worry about missing an interrupt (which a "command wait" * interrupt salvages us from), unless there is more than one command * in the queue. */ - if (dma->cmdu > 1) { + if (sc->sc_cmdu > 1) { sc->sc_dmaier |= HIFN_DMAIER_C_WAIT; WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier); } @@ -2068,17 +2068,17 @@ hifn_crypto( if (hifn_debug) printf("load res\n"); #endif - if (dma->resi == HIFN_D_RES_RSIZE) { - dma->resi = 0; + if (sc->sc_resi == HIFN_D_RES_RSIZE) { + sc->sc_resi = 0; dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } - resi = dma->resi++; - KASSERT(dma->hifn_commands[resi] == NULL, + resi = sc->sc_resi++; + KASSERT(sc->sc_hifn_commands[resi] == NULL, ("hifn_crypto: command slot %u busy", resi)); - dma->hifn_commands[resi] = cmd; + sc->sc_hifn_commands[resi] = cmd; HIFN_RES_SYNC(sc, resi, BUS_DMASYNC_PREREAD); if ((hint & CRYPTO_HINT_MORE) && sc->sc_curbatch < hifn_maxbatch) { dma->resr[resi].l = htole32(HIFN_MAX_RESULT | @@ -2094,7 +2094,7 @@ hifn_crypto( } HIFN_RESR_SYNC(sc, resi, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - dma->resu++; + sc->sc_resu++; if (cmd->sloplen) cmd->slopidx = resi; @@ -2159,22 +2159,21 @@ hifn_tick(void* vsc) HIFN_LOCK(sc); if (sc->sc_active == 0) { - struct hifn_dma *dma = sc->sc_dma; u_int32_t r = 0; - if (dma->cmdu == 0 && sc->sc_c_busy) { + if (sc->sc_cmdu == 0 && sc->sc_c_busy) { sc->sc_c_busy = 0; r |= HIFN_DMACSR_C_CTRL_DIS; } - if (dma->srcu == 0 && sc->sc_s_busy) { + if (sc->sc_srcu == 0 && sc->sc_s_busy) { sc->sc_s_busy = 0; r |= HIFN_DMACSR_S_CTRL_DIS; } - if (dma->dstu == 0 && sc->sc_d_busy) { + if (sc->sc_dstu == 0 && sc->sc_d_busy) { sc->sc_d_busy = 0; r |= HIFN_DMACSR_D_CTRL_DIS; } - if (dma->resu == 0 && sc->sc_r_busy) { + if (sc->sc_resu == 0 && sc->sc_r_busy) { sc->sc_r_busy = 0; r |= HIFN_DMACSR_R_CTRL_DIS; } @@ -2209,9 +2208,9 @@ hifn_intr(void *arg) device_printf(sc->sc_dev, "irq: stat %08x ien %08x damier %08x i %d/%d/%d/%d k %d/%d/%d/%d u %d/%d/%d/%d\n", dmacsr, READ_REG_1(sc, HIFN_1_DMA_IER), sc->sc_dmaier, - dma->cmdi, dma->srci, dma->dsti, dma->resi, - dma->cmdk, dma->srck, dma->dstk, dma->resk, - dma->cmdu, dma->srcu, dma->dstu, dma->resu); + sc->sc_cmdi, sc->sc_srci, sc->sc_dsti, sc->sc_resi, + sc->sc_cmdk, sc->sc_srck, sc->sc_dstk, sc->sc_resk, + sc->sc_cmdu, sc->sc_srcu, sc->sc_dstu, sc->sc_resu); } #endif @@ -2243,7 +2242,7 @@ hifn_intr(void *arg) return; } - if ((dmacsr & HIFN_DMACSR_C_WAIT) && (dma->cmdu == 0)) { + if ((dmacsr & HIFN_DMACSR_C_WAIT) && (sc->sc_cmdu == 0)) { /* * If no slots to process and we receive a "waiting on * command" interrupt, we disable the "waiting on command" @@ -2254,7 +2253,7 @@ hifn_intr(void *arg) } /* clear the rings */ - i = dma->resk; u = dma->resu; + i = sc->sc_resk; u = sc->sc_resu; while (u != 0) { HIFN_RESR_SYNC(sc, i, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -2269,10 +2268,10 @@ hifn_intr(void *arg) u_int8_t *macbuf = NULL; HIFN_RES_SYNC(sc, i, BUS_DMASYNC_POSTREAD); - cmd = dma->hifn_commands[i]; + cmd = sc->sc_hifn_commands[i]; KASSERT(cmd != NULL, ("hifn_intr: null command slot %u", i)); - dma->hifn_commands[i] = NULL; + sc->sc_hifn_commands[i] = NULL; if (cmd->base_masks & HIFN_BASE_CMD_MAC) { macbuf = dma->result_bufs[i]; @@ -2287,9 +2286,9 @@ hifn_intr(void *arg) if (++i == (HIFN_D_RES_RSIZE + 1)) i = 0; } - dma->resk = i; dma->resu = u; + sc->sc_resk = i; sc->sc_resu = u; - i = dma->srck; u = dma->srcu; + i = sc->sc_srck; u = sc->sc_srcu; while (u != 0) { if (i == HIFN_D_SRC_RSIZE) i = 0; @@ -2302,9 +2301,9 @@ hifn_intr(void *arg) } i++, u--; } - dma->srck = i; dma->srcu = u; + sc->sc_srck = i; sc->sc_srcu = u; - i = dma->cmdk; u = dma->cmdu; + i = sc->sc_cmdk; u = sc->sc_cmdu; while (u != 0) { HIFN_CMDR_SYNC(sc, i, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -2320,7 +2319,7 @@ hifn_intr(void *arg) if (++i == (HIFN_D_CMD_RSIZE + 1)) i = 0; } - dma->cmdk = i; dma->cmdu = u; + sc->sc_cmdk = i; sc->sc_cmdu = u; HIFN_UNLOCK(sc); @@ -2331,7 +2330,7 @@ hifn_intr(void *arg) device_printf(sc->sc_dev, "wakeup crypto (%x) u %d/%d/%d/%d\n", sc->sc_needwakeup, - dma->cmdu, dma->srcu, dma->dstu, dma->resu); + sc->sc_cmdu, sc->sc_srcu, sc->sc_dstu, sc->sc_resu); #endif sc->sc_needwakeup &= ~wakeup; crypto_unblock(sc->sc_cid, wakeup); @@ -2725,11 +2724,11 @@ hifn_abort(struct hifn_softc *sc) struct cryptop *crp; int i, u; - i = dma->resk; u = dma->resu; + i = sc->sc_resk; u = sc->sc_resu; while (u != 0) { - cmd = dma->hifn_commands[i]; + cmd = sc->sc_hifn_commands[i]; KASSERT(cmd != NULL, ("hifn_abort: null command slot %u", i)); - dma->hifn_commands[i] = NULL; + sc->sc_hifn_commands[i] = NULL; crp = cmd->crp; if ((dma->resr[i].l & htole32(HIFN_D_VALID)) == 0) { @@ -2783,7 +2782,7 @@ hifn_abort(struct hifn_softc *sc) i = 0; u--; } - dma->resk = i; dma->resu = u; + sc->sc_resk = i; sc->sc_resu = u; hifn_reset_board(sc, 1); hifn_init_dma(sc); @@ -2831,7 +2830,7 @@ hifn_callback(struct hifn_softc *sc, str (caddr_t)&dma->slop[cmd->slopidx]); } - i = dma->dstk; u = dma->dstu; + i = sc->sc_dstk; u = sc->sc_dstu; while (u != 0) { if (i == HIFN_D_DST_RSIZE) i = 0; @@ -2844,7 +2843,7 @@ hifn_callback(struct hifn_softc *sc, str } i++, u--; } - dma->dstk = i; dma->dstu = u; + sc->sc_dstk = i; sc->sc_dstu = u; hifnstats.hst_obytes += cmd->dst_mapsize; Modified: head/sys/dev/hifn/hifn7751var.h ============================================================================== --- head/sys/dev/hifn/hifn7751var.h Fri Sep 24 02:41:52 2010 (r213090) +++ head/sys/dev/hifn/hifn7751var.h Fri Sep 24 04:46:46 2010 (r213091) @@ -81,7 +81,8 @@ #define MAX_SCATTER 64 /* - * Data structure to hold all 4 rings and any other ring related data. + * Data structure to hold all 4 rings and any other ring related data + * that should reside in DMA. */ struct hifn_dma { /* @@ -93,22 +94,13 @@ struct hifn_dma { struct hifn_desc dstr[HIFN_D_DST_RSIZE+1]; struct hifn_desc resr[HIFN_D_RES_RSIZE+1]; - struct hifn_command *hifn_commands[HIFN_D_RES_RSIZE]; u_char command_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_COMMAND]; u_char result_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_RESULT]; u_int32_t slop[HIFN_D_CMD_RSIZE]; - u_int64_t test_src, test_dst; +} ; - /* - * Our current positions for insertion and removal from the desriptor - * rings. - */ - int cmdi, srci, dsti, resi; - volatile int cmdu, srcu, dstu, resu; - int cmdk, srck, dstk, resk; -}; struct hifn_session { int hs_used; @@ -157,6 +149,15 @@ struct hifn_softc { bus_dma_segment_t sc_dmasegs[1]; bus_addr_t sc_dma_physaddr;/* physical address of sc_dma */ int sc_dmansegs; + struct hifn_command *sc_hifn_commands[HIFN_D_RES_RSIZE]; + /* + * Our current positions for insertion and removal from the desriptor + * rings. + */ + int sc_cmdi, sc_srci, sc_dsti, sc_resi; + volatile int sc_cmdu, sc_srcu, sc_dstu, sc_resu; + int sc_cmdk, sc_srck, sc_dstk, sc_resk; + int32_t sc_cid; int sc_maxses; int sc_nsessions; From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 07:14:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 384281065673; Fri, 24 Sep 2010 07:14:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 289D88FC16; Fri, 24 Sep 2010 07:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O7EFoi093169; Fri, 24 Sep 2010 07:14:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O7EFT5093167; Fri, 24 Sep 2010 07:14:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009240714.o8O7EFT5093167@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Sep 2010 07:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213092 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 07:14:15 -0000 Author: mav Date: Fri Sep 24 07:14:14 2010 New Revision: 213092 URL: http://svn.freebsd.org/changeset/base/213092 Log: Add missing le32toh(), same as recently done in ata-siliconimage.c. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Fri Sep 24 04:46:46 2010 (r213091) +++ head/sys/dev/ata/chipsets/ata-ahci.c Fri Sep 24 07:14:14 2010 (r213092) @@ -563,7 +563,7 @@ ata_ahci_end_transaction(struct ata_requ /* record how much data we actually moved */ clp = (struct ata_ahci_cmd_list *) (ch->dma.work + ATA_AHCI_CL_OFFSET); - request->donecount = clp->bytecount; + request->donecount = le32toh(clp->bytecount); /* release SG list etc */ ch->dma.unload(request); From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 07:52:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9454A106566C; Fri, 24 Sep 2010 07:52:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69E9C8FC1C; Fri, 24 Sep 2010 07:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O7q7MI094106; Fri, 24 Sep 2010 07:52:07 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O7q7Zh094102; Fri, 24 Sep 2010 07:52:07 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009240752.o8O7q7Zh094102@svn.freebsd.org> From: David Xu Date: Fri, 24 Sep 2010 07:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213096 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 07:52:07 -0000 Author: davidxu Date: Fri Sep 24 07:52:07 2010 New Revision: 213096 URL: http://svn.freebsd.org/changeset/base/213096 Log: In most cases, cancel_point and cancel_async needn't be checked again, because cancellation is almostly checked at cancellation points. Modified: head/lib/libthr/thread/thr_cancel.c head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_cancel.c ============================================================================== --- head/lib/libthr/thread/thr_cancel.c Fri Sep 24 07:29:29 2010 (r213095) +++ head/lib/libthr/thread/thr_cancel.c Fri Sep 24 07:52:07 2010 (r213096) @@ -131,9 +131,7 @@ _pthread_testcancel(void) { struct pthread *curthread = _get_curthread(); - curthread->cancel_point = 1; testcancel(curthread); - curthread->cancel_point = 0; } void @@ -159,7 +157,7 @@ _thr_cancel_enter2(struct pthread *curth void _thr_cancel_leave(struct pthread *curthread, int maycancel) { + curthread->cancel_point = 0; if (maycancel) testcancel(curthread); - curthread->cancel_point = 0; } Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Fri Sep 24 07:29:29 2010 (r213095) +++ head/lib/libthr/thread/thr_fork.c Fri Sep 24 07:52:07 2010 (r213096) @@ -248,7 +248,8 @@ _fork(void) _thr_rwlock_unlock(&_thr_atfork_lock); curthread->no_cancel = cancelsave; /* test async cancel */ - _thr_testcancel(curthread); + if (curthread->cancel_async) + _thr_testcancel(curthread); } errno = errsave; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Sep 24 07:29:29 2010 (r213095) +++ head/lib/libthr/thread/thr_private.h Fri Sep 24 07:52:07 2010 (r213096) @@ -357,7 +357,6 @@ struct pthread { #define SHOULD_CANCEL(thr) \ ((thr)->cancel_pending && (thr)->cancel_enable && \ - ((thr)->cancel_point || (thr)->cancel_async) && \ (thr)->no_cancel == 0) /* Cancellation is enabled */ From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 08:40:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFA91106566C; Fri, 24 Sep 2010 08:40:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF0138FC24; Fri, 24 Sep 2010 08:40:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O8ehec095304; Fri, 24 Sep 2010 08:40:43 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O8eha0095301; Fri, 24 Sep 2010 08:40:43 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201009240840.o8O8eha0095301@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 24 Sep 2010 08:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213097 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 08:40:44 -0000 Author: ae Date: Fri Sep 24 08:40:43 2010 New Revision: 213097 URL: http://svn.freebsd.org/changeset/base/213097 Log: Implement "force" (-F) option for gpart destroy verb. This option doesn't passed to kernel and handled in user-space. With -F option gpart creates new "delete" request for each partition in table. Each request has flags="X" that disables auto-commit feature. Last request is the original "destroy" request. It has own flags and can have disabled or enabled auto-commit feature. If error is occurred when deleting partitions, then new "undo" request is created and all changes will be rolled back. Approved by: kib (mentor) Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Fri Sep 24 07:52:07 2010 (r213096) +++ head/sbin/geom/class/part/geom_part.c Fri Sep 24 08:40:43 2010 (r213097) @@ -67,6 +67,7 @@ static char ssize[32]; #define GPART_PARAM_BOOTCODE "bootcode" #define GPART_PARAM_INDEX "index" #define GPART_PARAM_PARTCODE "partcode" +#define GPART_PARAM_FORCE "force" static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -84,6 +85,8 @@ static void gpart_show_geom(struct ggeom static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); +static void gpart_destroy(struct gctl_req *, unsigned int); +static void gpart_print_error(const char *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -120,10 +123,11 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "-i index [-f flags] geom" }, - { "destroy", 0, gpart_issue, { + { "destroy", 0, gpart_destroy, { + { 'F', GPART_PARAM_FORCE, NULL, G_TYPE_BOOL }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "[-f flags] geom" + "[-F] [-f flags] geom" }, { "modify", 0, gpart_issue, { { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, @@ -854,10 +858,104 @@ gpart_bootcode(struct gctl_req *req, uns } static void +gpart_destroy(struct gctl_req *req, unsigned int fl) +{ + struct gmesh mesh; + struct gclass *classp; + struct gctl_req *req2; + struct ggeom *gp; + struct gprovider *pp; + const char *s; + int error, val; + intmax_t idx; + + if (gctl_has_param(req, GPART_PARAM_FORCE)) { + val = gctl_get_int(req, GPART_PARAM_FORCE); + error = gctl_delete_param(req, GPART_PARAM_FORCE); + if (error) + errc(EXIT_FAILURE, error, "internal error"); + if (val == 0) + goto done; + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "arg0"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + val = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider){ + s = find_provcfg(pp, "index"); + if (s == NULL) + errx(EXIT_FAILURE, "Index not found for %s.", + pp->lg_name); + idx = strtoimax(s, NULL, 0); + req2 = gctl_get_handle(); + gctl_ro_param(req2, "class", -1, classp->lg_name); + gctl_ro_param(req2, "arg0", -1, gp->lg_name); + gctl_ro_param(req2, "verb", -1, "delete"); + gctl_ro_param(req2, GPART_PARAM_INDEX, + sizeof(intmax_t), &idx); + gctl_ro_param(req2, "flags", -1, "X"); + s = gctl_issue(req2); + if (s != NULL && s[0] != '\0') { + gpart_print_error(s); + gctl_free(req2); + if (val) { /* try to undo changes */ + req2 = gctl_get_handle(); + gctl_ro_param(req2, "verb", -1, + "undo"); + gctl_ro_param(req2, "class", -1, + classp->lg_name); + gctl_ro_param(req2, "arg0", -1, + gp->lg_name); + gctl_issue(req2); + gctl_free(req2); + } + geom_deletetree(&mesh); + exit(EXIT_FAILURE); + } + gctl_free(req2); + val = 1; + } + geom_deletetree(&mesh); + } +done: + gpart_issue(req, fl); +} + +static void +gpart_print_error(const char *errstr) +{ + char *errmsg; + int error; + + error = strtol(errstr, &errmsg, 0); + if (errmsg != errstr) { + while (errmsg[0] == ' ') + errmsg++; + if (errmsg[0] != '\0') + warnc(error, "%s", errmsg); + else + warnc(error, NULL); + } else + warnx("%s", errmsg); +} + +static void gpart_issue(struct gctl_req *req, unsigned int fl __unused) { char buf[4096]; - char *errmsg; const char *errstr; int error, status; @@ -883,17 +981,7 @@ gpart_issue(struct gctl_req *req, unsign goto done; } - error = strtol(errstr, &errmsg, 0); - if (errmsg != errstr) { - while (errmsg[0] == ' ') - errmsg++; - if (errmsg[0] != '\0') - warnc(error, "%s", errmsg); - else - warnc(error, NULL); - } else - warnx("%s", errmsg); - + gpart_print_error(errstr); status = EXIT_FAILURE; done: Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Fri Sep 24 07:52:07 2010 (r213096) +++ head/sbin/geom/class/part/gpart.8 Fri Sep 24 08:40:43 2010 (r213097) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2010 +.Dd Sep 24, 2010 .Dt GPART 8 .Os .Sh NAME @@ -118,6 +118,7 @@ utility: .\" ==== DESTROY ==== .Nm .Cm destroy +.Op Fl F .Op Fl f Ar flags .Ar geom .\" ==== MODIFY ==== @@ -317,6 +318,8 @@ Destroy the partitioning scheme as imple .Pp Additional options include: .Bl -tag -width 10n +.It Fl F +Forced destroying of the partition table even if it is not empty. .It Fl f Ar flags Additional operational flags. See the section entitled From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 09:04:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B372B106564A; Fri, 24 Sep 2010 09:04:16 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29AA8FC0C; Fri, 24 Sep 2010 09:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8O94G8E095809; Fri, 24 Sep 2010 09:04:16 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8O94GVM095803; Fri, 24 Sep 2010 09:04:16 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009240904.o8O94GVM095803@svn.freebsd.org> From: David Xu Date: Fri, 24 Sep 2010 09:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 09:04:16 -0000 Author: davidxu Date: Fri Sep 24 09:04:16 2010 New Revision: 213098 URL: http://svn.freebsd.org/changeset/base/213098 Log: Now userland POSIX semaphore is based on umtx. The kernel module is only used to support binary compatible, if want to run old binary, you need to kldload the module. Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Sep 24 08:40:43 2010 (r213097) +++ head/sys/amd64/conf/GENERIC Fri Sep 24 09:04:16 2010 (r213098) @@ -55,7 +55,6 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Sep 24 08:40:43 2010 (r213097) +++ head/sys/i386/conf/GENERIC Fri Sep 24 09:04:16 2010 (r213098) @@ -56,7 +56,6 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Fri Sep 24 08:40:43 2010 (r213097) +++ head/sys/pc98/conf/GENERIC Fri Sep 24 09:04:16 2010 (r213098) @@ -59,7 +59,6 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Sep 24 08:40:43 2010 (r213097) +++ head/sys/powerpc/conf/GENERIC Fri Sep 24 09:04:16 2010 (r213098) @@ -60,7 +60,6 @@ options STACK #stack(9) support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Sep 24 08:40:43 2010 (r213097) +++ head/sys/sparc64/conf/GENERIC Fri Sep 24 09:04:16 2010 (r213098) @@ -56,7 +56,6 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 09:29:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08F18106566B; Fri, 24 Sep 2010 09:29:43 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 7FECE8FC12; Fri, 24 Sep 2010 09:29:42 +0000 (UTC) Received: by qyk31 with SMTP id 31so1091095qyk.13 for ; Fri, 24 Sep 2010 02:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FL/TkrC/eIFbTCXzj5r/aCiH1XqdJmHYjzu85rW5JsQ=; b=mSp2aomPfEMPb3Vu0EOZ3Odly+9OnczMvZPChTBmGHg7871qdM7mGusD0fNscT+K5u 5oqPXV/g3HRhUjUlnKep9VkXQXtPjDuqp7bc1B1NR332Y7uQdRWqM20K344Kx3CgNAJ8 vRVrK3ttY27ZY8ctVhN/JQa19QVO70XdzTkys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dkIWrwSvOBKCIeUdLJ8fTeWWxLMRFMUBFsw/j8NOkydxdbFm4iULpNdVAZSrOMwZzM uCbWLaWe4Zm1UvhrKf5CIM2KSU2D0z3I+IPHpGuox/rHKD/gJvCg2YuJKoE709NWphLC i1LAzm8OjNNCSpt98CPcSV0AcnZp8TUsqhv4o= MIME-Version: 1.0 Received: by 10.229.1.161 with SMTP id 33mr2276118qcf.279.1285320581619; Fri, 24 Sep 2010 02:29:41 -0700 (PDT) Received: by 10.229.50.8 with HTTP; Fri, 24 Sep 2010 02:29:41 -0700 (PDT) In-Reply-To: <201009240840.o8O8eha0095301@svn.freebsd.org> References: <201009240840.o8O8eha0095301@svn.freebsd.org> Date: Fri, 24 Sep 2010 13:29:41 +0400 Message-ID: From: pluknet To: "Andrey V. Elsukov" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213097 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 09:29:43 -0000 On 24 September 2010 12:40, Andrey V. Elsukov wrote: > Author: ae > Date: Fri Sep 24 08:40:43 2010 > New Revision: 213097 > URL: http://svn.freebsd.org/changeset/base/213097 > > Log: > =A0Implement "force" (-F) option for gpart destroy verb. Thank you very much! This is a very useful feature. Will you MFC it to RELENG_8? --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 10:05:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058D6106566B; Fri, 24 Sep 2010 10:05:06 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward6.mail.yandex.net (forward6.mail.yandex.net [77.88.60.125]) by mx1.freebsd.org (Postfix) with ESMTP id A970D8FC1D; Fri, 24 Sep 2010 10:05:05 +0000 (UTC) Received: from smtp8.mail.yandex.net (smtp8.mail.yandex.net [77.88.61.54]) by forward6.mail.yandex.net (Yandex) with ESMTP id 24ED4BB07A8; Fri, 24 Sep 2010 13:49:42 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1285321782; bh=ld+TnJyZxHFYk2ckuO9WSKzocYZ0eCIHEl4l1Aq5K08=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=jKi6RhKrUVDLorpwdyQ2TeGcdGbGBMiIzQmHr4G32Kpri6XH9LqZBLrj4blzfbMvk Fmqbj3tcXG6nJz8T060OGI4KZy+tXOLzH6SZcU27Q83ryZZrik0jnaGp3gRl22x1mW AhOdmsl6jgT1uuC74o0UBYNuEnfpoJU3sHRuHqio= Received: from [10.43.163.197] (bu7cher.heavennet.ru [92.39.76.197]) by smtp8.mail.yandex.net (Yandex) with ESMTPSA id C99D820280A7; Fri, 24 Sep 2010 13:49:41 +0400 (MSD) Message-ID: <4C9C740D.20406@yandex.ru> Date: Fri, 24 Sep 2010 13:49:01 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.8) Gecko/20100806 Thunderbird/3.1.2 MIME-Version: 1.0 To: pluknet References: <201009240840.o8O8eha0095301@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1285321782 X-Yandex-Spam: 1 X-Yandex-Front: smtp8.mail.yandex.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213097 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 10:05:06 -0000 On 24.09.2010 13:29, pluknet wrote: >> Log: >> Implement "force" (-F) option for gpart destroy verb. > > Thank you very much! This is a very useful feature. > Will you MFC it to RELENG_8? It depends when pjd will do MFC of recent geom(8) stuff. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 10:17:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7A8106566C; Fri, 24 Sep 2010 10:17:30 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3351B8FC0A; Fri, 24 Sep 2010 10:17:29 +0000 (UTC) Received: by qyk7 with SMTP id 7so746322qyk.13 for ; Fri, 24 Sep 2010 03:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wx2spGVd12hVMDcnzFzPv9pyCdCZ+Xzhm6BHgH/kLok=; b=CtQHp9Qutc5wXlQM14Q+N0bjWo7Z+Ur0J5jkJZFjqYTW7rl6fp0FaGCgFYlaJs0WS6 WiTNQxxueVdBXhdNyE1vqbwXHVysqvvfIMHgZI/y3BOWjQ6PuMZG8Bt/gZpxD8cA6ctg XGl0+Qs93NnP+ATrr3FrYQSNY4q1lCPjGrsHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=X5wyJpULYAOqsPZcPj7dFeOOjTxfo0+TsFPcMf/s5FVnf/K/TX2OJlBKoFkrG0v5+D v7h73J7pZJcvri6f590gUmc2RyO3f1uNtXupOZ11+Soaa1Ou5sEP8V3YHZr0Mbd830s8 KLGhH5at7b/dev9/U9V4gxmUrYzWv7pC+3zLs= MIME-Version: 1.0 Received: by 10.229.215.76 with SMTP id hd12mr2378143qcb.44.1285323449379; Fri, 24 Sep 2010 03:17:29 -0700 (PDT) Received: by 10.229.50.8 with HTTP; Fri, 24 Sep 2010 03:17:29 -0700 (PDT) In-Reply-To: <201009160756.o8G7uZrg065332@svn.freebsd.org> References: <201009160756.o8G7uZrg065332@svn.freebsd.org> Date: Fri, 24 Sep 2010 14:17:29 +0400 Message-ID: From: pluknet To: Dag-Erling Smorgrav Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 10:17:30 -0000 On 16 September 2010 11:56, Dag-Erling Smorgrav wrote: > Author: des > Date: Thu Sep 16 07:56:34 2010 > New Revision: 212723 > URL: http://svn.freebsd.org/changeset/base/212723 > > Log: > =A0Implement proc/$$/environment. > [...] > =A0/* > =A0* Filler function for proc/pid/environ > =A0*/ > =A0static int > =A0linprocfs_doprocenviron(PFS_FILL_ARGS) > =A0{ > + =A0 =A0 =A0 int ret; > > - =A0 =A0 =A0 sbuf_printf(sb, "doprocenviron\n%c", '\0'); > - =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 PROC_LOCK(p); With this change I observe the following sleepable after non-sleepable: 1st 0xffffff000290b558 process lock (process lock) @ /usr/src/sys/modules/linprocfs/../../compat/linprocfs/linprocfs.c:1049 2nd 0xffffff00028f8848 user map (user map) @ /usr/src/sys/vm/vm_map.c:3525 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2a _witness_debugger() at _witness_debugger+0x2e witness_checkorder() at witness_checkorder+0x807 _sx_slock() at _sx_slock+0x55 vm_map_lookup() at vm_map_lookup+0x55 vm_fault() at vm_fault+0x113 proc_rwmem() at proc_rwmem+0x7a linprocfs_doprocenviron() at linprocfs_doprocenviron+0x122 pfs_read() at pfs_read+0x45b vn_read() at vn_read+0x256 dofileread() at dofileread+0xa1 kern_readv() at kern_readv+0x60 read() at read+0x55 syscallenter() at syscallenter+0x1aa syscall() at syscall+0x4c Xfast_syscall() at Xfast_syscall+0xe2 --- syscall (3, FreeBSD ELF64, read), rip =3D 0x80074134c, rsp =3D 0x7fffffffe9c8, rbp =3D 0 --- > + > + =A0 =A0 =A0 if ((ret =3D p_cansee(td, p)) !=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 PROC_UNLOCK(p); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return ret; > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 ret =3D linprocfs_doargv(td, p, sb, ps_string_env); > + =A0 =A0 =A0 PROC_UNLOCK(p); > + =A0 =A0 =A0 return (ret); > =A0} From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 10:40:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85CA106566C; Fri, 24 Sep 2010 10:40:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A679A8FC1C; Fri, 24 Sep 2010 10:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OAeHF6017885; Fri, 24 Sep 2010 10:40:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OAeHYh017876; Fri, 24 Sep 2010 10:40:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009241040.o8OAeHYh017876@svn.freebsd.org> From: Marius Strobl Date: Fri, 24 Sep 2010 10:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213099 - in head: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 10:40:17 -0000 Author: marius Date: Fri Sep 24 10:40:17 2010 New Revision: 213099 URL: http://svn.freebsd.org/changeset/base/213099 Log: Make WARNS=6 clean. MFC after: 1 week Modified: head/libexec/tftpd/Makefile head/libexec/tftpd/tftp-file.c head/libexec/tftpd/tftp-options.c head/libexec/tftpd/tftp-utils.c head/libexec/tftpd/tftp-utils.h head/libexec/tftpd/tftpd.c head/usr.bin/tftp/Makefile head/usr.bin/tftp/main.c Modified: head/libexec/tftpd/Makefile ============================================================================== --- head/libexec/tftpd/Makefile Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/Makefile Fri Sep 24 10:40:17 2010 (r213099) @@ -5,7 +5,6 @@ PROG= tftpd MAN= tftpd.8 SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c SRCS+= tftpd.c -WARNS= 3 WFORMAT=0 LDFLAGS= -lwrap Modified: head/libexec/tftpd/tftp-file.c ============================================================================== --- head/libexec/tftpd/tftp-file.c Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/tftp-file.c Fri Sep 24 10:40:17 2010 (r213099) @@ -103,13 +103,13 @@ static size_t convert_to_net(char *buffer, size_t count, int init) { size_t i; - static size_t n = 0, read = 0; + static size_t n = 0, in = 0; static int newline = 0; if (init) { newline = 0; n = 0; - read = 0; + in = 0; return 0 ; } @@ -124,13 +124,13 @@ convert_to_net(char *buffer, size_t coun } while (i < count) { - if (n == read) { + if (n == in) { /* When done we're done */ if (feof(file)) break; /* Otherwise read another bunch */ - read = fread(convbuffer, 1, count, file); - if (read == 0) break; + in = fread(convbuffer, 1, count, file); + if (in == 0) break; n = 0; } @@ -250,7 +250,7 @@ read_close(void) int -synchnet(int peer) +synchnet(int peer __unused) { return 0; Modified: head/libexec/tftpd/tftp-options.c ============================================================================== --- head/libexec/tftpd/tftp-options.c Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/tftp-options.c Fri Sep 24 10:40:17 2010 (r213099) @@ -79,7 +79,8 @@ int options_extra_enabled = 1; */ int -option_tsize(int peer, struct tftphdr *tp, int mode, struct stat *stbuf) +option_tsize(int peer __unused, struct tftphdr *tp __unused, int mode, + struct stat *stbuf) { if (options[OPT_TSIZE].o_request == NULL) @@ -159,21 +160,19 @@ option_rollover(int peer) int option_blksize(int peer) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; size_t len; if (options[OPT_BLKSIZE].o_request == NULL) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; int size = atoi(options[OPT_BLKSIZE].o_request); if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { @@ -191,20 +190,20 @@ option_blksize(int peer) } } - if (size > *maxdgram) { + if (size > (int)maxdgram) { if (acting_as_client) { tftp_log(LOG_ERR, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); + "%d bytes.\n", size, maxdgram); send_error(peer, EBADOP); return (1); } else { tftp_log(LOG_WARNING, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); - size = *maxdgram; + "%d bytes.\n", size, maxdgram); + size = maxdgram; /* No reason to return */ } } @@ -220,10 +219,9 @@ option_blksize(int peer) } int -option_blksize2(int peer) +option_blksize2(int peer __unused) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; int size, i; size_t len; @@ -236,13 +234,12 @@ option_blksize2(int peer) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; size = atoi(options[OPT_BLKSIZE2].o_request); for (i = 0; sizes[i] != 0; i++) { @@ -254,13 +251,13 @@ option_blksize2(int peer) return (acting_as_client ? 1 : 0); } - if (size > *maxdgram) { + if (size > (int)maxdgram) { for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } tftp_log(LOG_INFO, "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram " - "sysctl limits it to %d bytes.\n", size, *maxdgram); + "sysctl limits it to %d bytes.\n", size, maxdgram); size = sizes[i]; /* No need to return */ } @@ -279,7 +276,7 @@ option_blksize2(int peer) * Append the available options to the header */ uint16_t -make_options(int peer, char *buffer, uint16_t size) { +make_options(int peer __unused, char *buffer, uint16_t size) { int i; char *value; const char *option; Modified: head/libexec/tftpd/tftp-utils.c ============================================================================== --- head/libexec/tftpd/tftp-utils.c Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/tftp-utils.c Fri Sep 24 10:40:17 2010 (r213099) @@ -59,7 +59,7 @@ int acting_as_client; * first timeout) to 'timeoutnetwork' (i.e. the last timeout) */ int -settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts) +settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts __unused) { int i; @@ -91,7 +91,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + memcpy(&addr, &sin6->sin6_addr.s6_addr[12], sizeof(addr)); port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; @@ -170,7 +170,7 @@ struct packettypes packettypes[] = { { 0, NULL }, }; -char * +const char * packettype(int type) { static char failed[100]; @@ -231,7 +231,7 @@ debug_finds(char *s) return (i); } -char * +const char * debug_show(int d) { static char s[100]; @@ -317,4 +317,3 @@ printstats(const char *direction, int ve printf(" [%.0f bits/sec]", (ts->amount*8.)/delta); putchar('\n'); } - Modified: head/libexec/tftpd/tftp-utils.h ============================================================================== --- head/libexec/tftpd/tftp-utils.h Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/tftp-utils.h Fri Sep 24 10:40:17 2010 (r213099) @@ -64,17 +64,17 @@ ssize_t get_field(int peer, char *buffer */ struct packettypes { int value; - char *name; + const char *const name; }; extern struct packettypes packettypes[]; -char *packettype(int); +const char *packettype(int); /* * RP_ */ struct rp_errors { int error; - char *desc; + const char *const desc; }; extern struct rp_errors rp_errors[]; char *rp_strerror(int error); @@ -89,15 +89,15 @@ char *rp_strerror(int error); #define DEBUG_ACCESS 0x0008 struct debugs { int value; - char *name; - char *desc; + const char *const name; + const char *const desc; }; extern int debug; extern struct debugs debugs[]; extern int packetdroppercentage; int debug_find(char *s); int debug_finds(char *s); -char *debug_show(int d); +const char *debug_show(int d); /* * Log routines Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Fri Sep 24 09:04:16 2010 (r213098) +++ head/libexec/tftpd/tftpd.c Fri Sep 24 10:40:17 2010 (r213099) @@ -97,7 +97,7 @@ static int suppress_naks; static int logging; static int ipchroot; static int create_new = 0; -static char *newfile_format = "%Y%m%d"; +static const char *newfile_format = "%Y%m%d"; static int increase_name = 0; static mode_t mask = S_IWGRP | S_IWOTH; @@ -785,7 +785,6 @@ static void tftp_xmitfile(int peer, const char *mode) { uint16_t block; - uint32_t amount; time_t now; struct tftp_stats ts; @@ -799,13 +798,12 @@ tftp_xmitfile(int peer, const char *mode read_close(); if (debug&DEBUG_SIMPLE) tftp_log(LOG_INFO, "Sent %d bytes in %d seconds", - amount, time(NULL) - now); + ts.amount, time(NULL) - now); } static void tftp_recvfile(int peer, const char *mode) { - uint32_t filesize; uint16_t block; struct timeval now1, now2; struct tftp_stats ts; @@ -820,6 +818,7 @@ tftp_recvfile(int peer, const char *mode tftp_receive(peer, &block, &ts, NULL, 0); write_close(); + gettimeofday(&now2, NULL); if (debug&DEBUG_SIMPLE) { double f; @@ -832,9 +831,8 @@ tftp_recvfile(int peer, const char *mode (now2.tv_usec - now1.tv_usec) / 100000.0; tftp_log(LOG_INFO, "Download of %d bytes in %d blocks completed after %0.1f seconds\n", - filesize, block, f); + ts.amount, block, f); } return; } - Modified: head/usr.bin/tftp/Makefile ============================================================================== --- head/usr.bin/tftp/Makefile Fri Sep 24 09:04:16 2010 (r213098) +++ head/usr.bin/tftp/Makefile Fri Sep 24 10:40:17 2010 (r213099) @@ -1,12 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../../libexec/tftpd +.PATH: ${.CURDIR}/../../libexec/tftpd PROG= tftp SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c SRCS+= tftp-utils.c tftp.c -WARNS= 3 CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Sep 24 09:04:16 2010 (r213098) +++ head/usr.bin/tftp/main.c Fri Sep 24 10:40:17 2010 (r213099) @@ -222,8 +222,8 @@ urihandling(char *URI) char uri[ARG_MAX]; char *host = NULL; char *path = NULL; - char *options = NULL; - char *mode = "octet"; + char *opts = NULL; + const char *tmode = "octet"; char *s; char line[MAXLINE]; int i; @@ -241,14 +241,14 @@ urihandling(char *URI) if ((s = strchr(path, ';')) != NULL) { *s = '\0'; - options = s + 1; + opts = s + 1; - if (strncmp(options, "mode=", 5) == 0) { - mode = options; - mode += 5; + if (strncmp(opts, "mode=", 5) == 0) { + tmode = opts; + tmode += 5; for (i = 0; modes[i].m_name != NULL; i++) { - if (strcmp(modes[i].m_name, mode) == 0) + if (strcmp(modes[i].m_name, tmode) == 0) break; } if (modes[i].m_name == NULL) { @@ -697,7 +697,7 @@ tail(char *filename) } static const char * -command_prompt() +command_prompt(void) { return ("tftp> "); @@ -964,27 +964,25 @@ setblocksize(int argc, char *argv[]) if (argc != 1) { int size = atoi(argv[1]); size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { printf("Blocksize should be between %d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); asprintf(&options[OPT_BLKSIZE].o_request, - "%d", *maxdgram - 4); + "%ld", maxdgram - 4); } else { asprintf(&options[OPT_BLKSIZE].o_request, "%d", size); } @@ -1005,21 +1003,19 @@ setblocksize2(int argc, char *argv[]) int size = atoi(argv[1]); int i; size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; int sizes[] = { 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 0 }; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; for (i = 0; sizes[i] != 0; i++) { if (sizes[i] == size) break; @@ -1034,12 +1030,12 @@ setblocksize2(int argc, char *argv[]) printf("Blocksize2 should be between " "%d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize2 can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize2 can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } asprintf(&options[OPT_BLKSIZE2].o_request, "%d", sizes[i]); From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 10:59:47 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CB07106566B; Fri, 24 Sep 2010 10:59:47 +0000 (UTC) (envelope-from gavin@ury.york.ac.uk) Received: from gse-mta-27.emailfiltering.com (gse-mta-27-tx.emailfiltering.com [194.116.198.158]) by mx1.freebsd.org (Postfix) with ESMTP id CEA278FC13; Fri, 24 Sep 2010 10:59:45 +0000 (UTC) Received: from mail-gw5.york.ac.uk ([144.32.129.29]) by gse-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 755780012 for kensmith@buffalo.edu; 700040513cd033fa; Fri, 24 Sep 2010 11:59:31 +0100 Received: from ury.york.ac.uk ([144.32.108.81]:51201) by mail-gw5.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Oz600-0001Hy-QQ; Fri, 24 Sep 2010 11:59:28 +0100 Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1Oz600-0001Gi-JR; Fri, 24 Sep 2010 11:59:28 +0100 Date: Fri, 24 Sep 2010 11:59:28 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Ken Smith In-Reply-To: <1285297884.17619.17.camel@neo.cse.buffalo.edu> Message-ID: References: <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> <20100923.203143.19192035494300157.imp@bsdimp.com> <1285297884.17619.17.camel@neo.cse.buffalo.edu> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Cc: bruce@cran.org.uk, src-committers@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 10:59:47 -0000 On Thu, 23 Sep 2010, Ken Smith wrote: > This is definitely one I don't have a strong enough opinion > on to fight over, I sympathize with both sides. If the > general consensus is mostly towards changing so be it. > I've got no way to tell what percentage of users would > have any clue what to do with the crash info versus users > who would be negatively impacted simply by the fact their > systems are generating stuff they're completely ignorant > of and will never touch. We could make /etc/rc.d/savecore (the script that runs crashinfo) also email root@ (or wherever the periodic output is set to go to) with a pointer to the output, and instuctions on what to do (either delete, or email it somewhere). The output isn't sanitised so we'd have to be careful here - we can't just suggest send-pr. Thanks, Gavin From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 11:53:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E955910656C5; Fri, 24 Sep 2010 11:53:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 36C1B8FC27; Fri, 24 Sep 2010 11:53:15 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8OBrCA3092581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Sep 2010 14:53:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8OBrBBd040491; Fri, 24 Sep 2010 14:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8OBrB9c040490; Fri, 24 Sep 2010 14:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Sep 2010 14:53:11 +0300 From: Kostik Belousov To: pluknet Message-ID: <20100924115311.GH34228@deviant.kiev.zoral.com.ua> References: <201009160756.o8G7uZrg065332@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c7hkjup166d4FzgN" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 11:53:17 -0000 --c7hkjup166d4FzgN Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: > On 16 September 2010 11:56, Dag-Erling Smorgrav wrote: > > Author: des > > Date: Thu Sep 16 07:56:34 2010 > > New Revision: 212723 > > URL: http://svn.freebsd.org/changeset/base/212723 > > > > Log: > > =9AImplement proc/$$/environment. > > > [...] >=20 > > =9A/* > > =9A* Filler function for proc/pid/environ > > =9A*/ > > =9Astatic int > > =9Alinprocfs_doprocenviron(PFS_FILL_ARGS) > > =9A{ > > + =9A =9A =9A int ret; > > > > - =9A =9A =9A sbuf_printf(sb, "doprocenviron\n%c", '\0'); > > - =9A =9A =9A return (0); > > + =9A =9A =9A PROC_LOCK(p); >=20 > With this change I observe the following sleepable after non-sleepable: >=20 > 1st 0xffffff000290b558 process lock (process lock) @ > /usr/src/sys/modules/linprocfs/../../compat/linprocfs/linprocfs.c:1049 > 2nd 0xffffff00028f8848 user map (user map) @ /usr/src/sys/vm/vm_map.c:35= 25 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > _witness_debugger() at _witness_debugger+0x2e > witness_checkorder() at witness_checkorder+0x807 > _sx_slock() at _sx_slock+0x55 > vm_map_lookup() at vm_map_lookup+0x55 > vm_fault() at vm_fault+0x113 > proc_rwmem() at proc_rwmem+0x7a > linprocfs_doprocenviron() at linprocfs_doprocenviron+0x122 > pfs_read() at pfs_read+0x45b > vn_read() at vn_read+0x256 > dofileread() at dofileread+0xa1 > kern_readv() at kern_readv+0x60 > read() at read+0x55 > syscallenter() at syscallenter+0x1aa > syscall() at syscall+0x4c > Xfast_syscall() at Xfast_syscall+0xe2 > --- syscall (3, FreeBSD ELF64, read), rip =3D 0x80074134c, rsp =3D > 0x7fffffffe9c8, rbp =3D 0 --- >=20 >=20 > > + > > + =9A =9A =9A if ((ret =3D p_cansee(td, p)) !=3D 0) { > > + =9A =9A =9A =9A =9A =9A =9A PROC_UNLOCK(p); > > + =9A =9A =9A =9A =9A =9A =9A return ret; > > + =9A =9A =9A } > > + > > + =9A =9A =9A ret =3D linprocfs_doargv(td, p, sb, ps_string_env); > > + =9A =9A =9A PROC_UNLOCK(p); > > + =9A =9A =9A return (ret); > > =9A} This is easy to fix, isn't it ? But there seems to be much more nits. First, allocating 512 * sizeof(char *)-byte object on the stack is not good. Second, the initialization of iov_len for reading the array of string pointers misses '* sizeof(char *)'. And third (probably fatal) is the lack of checks that the end of array and each string fits into the user portion of the map. I do not see why addr that already has u_long type is casted to u_long. Also, VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host FreeBSD ABI, they may differ from the target process limits. Formatting is separate issue, let postpone it. diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linpro= cfs.c index c7fe158..fd62b1c 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -952,12 +952,9 @@ linprocfs_doargv(struct thread *td, struct proc *p, st= ruct sbuf *sb, struct uio tmp_uio; struct ps_strings pss; int ret, i, n_elements, found_end; - u_long addr; - char* env_vector[MAX_ARGV_STR]; + u_long addr, pbegin; + char **env_vector; char env_string[UIO_CHUNK_SZ]; - char *pbegin; - - =20 #define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ do { \ @@ -971,6 +968,10 @@ do { \ uio.uio_rw =3D (rw); \ uio.uio_td =3D (td); \ } while (0) +#define VALID_USER_ADDR(addr) \ + ((addr) >=3D p->p_sysent->sv_minuser && (addr) < p->p_sysent->sv_maxuser) + + env_vector =3D malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); =20 UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), @@ -978,37 +979,41 @@ do { \ =20 ret =3D proc_rwmem(p, &tmp_uio); if (ret !=3D 0) - return ret; + goto done; =20 /* Get the array address and the number of elements */ resolver(pss, &addr, &n_elements); =20 /* Consistent with lib/libkvm/kvm_proc.c */ - if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || - (u_long)addr >=3D VM_MAXUSER_ADDRESS) { - /* What error code should we return? */ - return 0; + if (n_elements > MAX_ARGV_STR || !VALID_USER_ADDR(addr) || + !VALID_USER_ADDR(addr + MAX_ARGV_STR * sizeof(char *))) { + ret =3D EFAULT; + goto done; } =20 - UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, + UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR * sizeof(char *), 1, (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); =20 ret =3D proc_rwmem(p, &tmp_uio); if (ret !=3D 0) - return ret; + goto done; =20 /* Now we can iterate through the list of strings */ for (i =3D 0; i < n_elements; i++) { found_end =3D 0; - pbegin =3D env_vector[i]; - while(!found_end) { + pbegin =3D (vm_offset_t)env_vector[i]; + while (!found_end) { + if (!VALID_USER_ADDR(pbegin) || + !VALID_USER_ADDR(pbegin + sizeof(env_string))) { + ret =3D EFAULT; + goto done; + } UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, - (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, - UIO_READ, td); + pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); =20 ret =3D proc_rwmem(p, &tmp_uio); if (ret !=3D 0) - return ret; + goto done; =20 if (!strvalid(env_string, UIO_CHUNK_SZ)) { /* @@ -1017,7 +1022,7 @@ do { \ * the pointer */ sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); - pbegin =3D &(*pbegin) + UIO_CHUNK_SZ; + pbegin +=3D UIO_CHUNK_SZ; } else { found_end =3D 1; } @@ -1025,9 +1030,12 @@ do { \ sbuf_printf(sb, "%s", env_string); } =20 +#undef VALID_USER_ADDR #undef UIO_HELPER =20 - return (0); +done: + free(env_vector, M_TEMP); + return (ret); } =20 static void @@ -1052,9 +1060,11 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return ret; } + _PHOLD(p); + PROC_UNLOCK(p); =20 ret =3D linprocfs_doargv(td, p, sb, ps_string_env); - PROC_UNLOCK(p); + PRELE(p); return (ret); } =20 --c7hkjup166d4FzgN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyckScACgkQC3+MBN1Mb4gV3ACglhzFjvkwxkueLStOkEcmkot0 dJYAoJUZRbmAxaWGJZRO5f6TmOCPxOiH =/lkV -----END PGP SIGNATURE----- --c7hkjup166d4FzgN-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 12:24:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7119F1065670; Fri, 24 Sep 2010 12:24:19 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id E0E6F8FC0A; Fri, 24 Sep 2010 12:24:18 +0000 (UTC) Received: by qyk31 with SMTP id 31so1286454qyk.13 for ; Fri, 24 Sep 2010 05:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hXGcuuIugQOXqRWtVxSXG6RpShLYjNny0BSXaRbfBj4=; b=I1ox2JwE8Sr3mHYMFWUK6/U6eXMABCaFF9J4RncGZrWnxCgUj20hoerSCUo86GCOYp eMuhi9X00LQq/I8+hc6LRdgagaF8IKEgaPYCs0MyKYCWkKVeTZUzCJTXbQ/SxbaQQ5sx nRP094ikMRlqjvwJZwPZX6cRnIe8GAGEA3CRU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=R09/2mQe/daCuH3HMgDNeTET8LAN1EEUvSHQLvLpXSoBhvE7DUlzB/Rg15AzCAoRzL /ggT5K6nWepTcXPAyO52Gjgde1akV/iPyMuHYU67oc2my8Vro01GAsO93+6TM3cW5N2R J9t5ni+2Sd59Ls3cGLtM5P13eOjrLtKxzRk58= MIME-Version: 1.0 Received: by 10.229.246.194 with SMTP id lz2mr2477723qcb.216.1285331058297; Fri, 24 Sep 2010 05:24:18 -0700 (PDT) Received: by 10.229.50.8 with HTTP; Fri, 24 Sep 2010 05:24:18 -0700 (PDT) In-Reply-To: <20100924115311.GH34228@deviant.kiev.zoral.com.ua> References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <20100924115311.GH34228@deviant.kiev.zoral.com.ua> Date: Fri, 24 Sep 2010 16:24:18 +0400 Message-ID: From: pluknet To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 12:24:19 -0000 2010/9/24 Kostik Belousov : > On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: >> On 16 September 2010 11:56, Dag-Erling Smorgrav wrote: >> > Author: des >> > Date: Thu Sep 16 07:56:34 2010 >> > New Revision: 212723 >> > URL: http://svn.freebsd.org/changeset/base/212723 >> > >> > Log: >> > =A0Implement proc/$$/environment. >> > >> [...] >> >> > =A0/* >> > =A0* Filler function for proc/pid/environ >> > =A0*/ >> > =A0static int >> > =A0linprocfs_doprocenviron(PFS_FILL_ARGS) >> > =A0{ >> > + =A0 =A0 =A0 int ret; >> > >> > - =A0 =A0 =A0 sbuf_printf(sb, "doprocenviron\n%c", '\0'); >> > - =A0 =A0 =A0 return (0); >> > + =A0 =A0 =A0 PROC_LOCK(p); >> >> With this change I observe the following sleepable after non-sleepable: >> [LOR there] >> >> >> > + >> > + =A0 =A0 =A0 if ((ret =3D p_cansee(td, p)) !=3D 0) { >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 PROC_UNLOCK(p); >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return ret; >> > + =A0 =A0 =A0 } >> > + >> > + =A0 =A0 =A0 ret =3D linprocfs_doargv(td, p, sb, ps_string_env); >> > + =A0 =A0 =A0 PROC_UNLOCK(p); >> > + =A0 =A0 =A0 return (ret); >> > =A0} > > This is easy to fix, isn't it ? But there seems to be much more nits. > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > good. > > Second, the initialization of iov_len for reading the array > of string pointers misses '* sizeof(char *)'. > > And third (probably fatal) is the lack of checks that the end of > array and each string fits into the user portion of the map. I do not > see why addr that already has u_long type is casted to u_long. Also, > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > FreeBSD ABI, they may differ from the target process limits. > Thanks for quick reaction. As for the latter, something doesn't quite work here. I see EFAULT against i386 process running on amd64. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 13:01:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D86F41065693; Fri, 24 Sep 2010 13:01:01 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72D78FC13; Fri, 24 Sep 2010 13:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OD117F020782; Fri, 24 Sep 2010 13:01:01 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OD11dr020780; Fri, 24 Sep 2010 13:01:01 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009241301.o8OD11dr020780@svn.freebsd.org> From: David Xu Date: Fri, 24 Sep 2010 13:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213100 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 13:01:01 -0000 Author: davidxu Date: Fri Sep 24 13:01:01 2010 New Revision: 213100 URL: http://svn.freebsd.org/changeset/base/213100 Log: inline testcancel() into thr_cancel_leave(), because cancel_pending is almost false, this makes a slight better branch predicting. Modified: head/lib/libthr/thread/thr_cancel.c Modified: head/lib/libthr/thread/thr_cancel.c ============================================================================== --- head/lib/libthr/thread/thr_cancel.c Fri Sep 24 10:40:17 2010 (r213099) +++ head/lib/libthr/thread/thr_cancel.c Fri Sep 24 13:01:01 2010 (r213100) @@ -158,6 +158,7 @@ void _thr_cancel_leave(struct pthread *curthread, int maycancel) { curthread->cancel_point = 0; - if (maycancel) - testcancel(curthread); + if (__predict_false(SHOULD_CANCEL(curthread) && + !THR_IN_CRITICAL(curthread) && maycancel)) + _pthread_exit(PTHREAD_CANCELED); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 13:06:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91C2C106566B; Fri, 24 Sep 2010 13:06:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B455E8FC22; Fri, 24 Sep 2010 13:06:52 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8OD6ibW098366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Sep 2010 16:06:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8OD6iJQ040830; Fri, 24 Sep 2010 16:06:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8OD6ig8040829; Fri, 24 Sep 2010 16:06:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Sep 2010 16:06:44 +0300 From: Kostik Belousov To: pluknet Message-ID: <20100924130644.GI34228@deviant.kiev.zoral.com.ua> References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <20100924115311.GH34228@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+Z7/5fzWRHDJ0o7Q" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 13:06:53 -0000 --+Z7/5fzWRHDJ0o7Q Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 24, 2010 at 04:24:18PM +0400, pluknet wrote: > 2010/9/24 Kostik Belousov : > > On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: > >> On 16 September 2010 11:56, Dag-Erling Smorgrav wrot= e: > >> > Author: des > >> > Date: Thu Sep 16 07:56:34 2010 > >> > New Revision: 212723 > >> > URL: http://svn.freebsd.org/changeset/base/212723 > >> > > >> > Log: > >> > =9AImplement proc/$$/environment. > >> > > >> [...] > >> > >> > =9A/* > >> > =9A* Filler function for proc/pid/environ > >> > =9A*/ > >> > =9Astatic int > >> > =9Alinprocfs_doprocenviron(PFS_FILL_ARGS) > >> > =9A{ > >> > + =9A =9A =9A int ret; > >> > > >> > - =9A =9A =9A sbuf_printf(sb, "doprocenviron\n%c", '\0'); > >> > - =9A =9A =9A return (0); > >> > + =9A =9A =9A PROC_LOCK(p); > >> > >> With this change I observe the following sleepable after non-sleepable: > >> > [LOR there] > >> > >> > >> > + > >> > + =9A =9A =9A if ((ret =3D p_cansee(td, p)) !=3D 0) { > >> > + =9A =9A =9A =9A =9A =9A =9A PROC_UNLOCK(p); > >> > + =9A =9A =9A =9A =9A =9A =9A return ret; > >> > + =9A =9A =9A } > >> > + > >> > + =9A =9A =9A ret =3D linprocfs_doargv(td, p, sb, ps_string_env); > >> > + =9A =9A =9A PROC_UNLOCK(p); > >> > + =9A =9A =9A return (ret); > >> > =9A} > > > > This is easy to fix, isn't it ? But there seems to be much more nits. > > > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > > good. > > > > Second, the initialization of iov_len for reading the array > > of string pointers misses '* sizeof(char *)'. > > > > And third (probably fatal) is the lack of checks that the end of > > array and each string fits into the user portion of the map. I do not > > see why addr that already has u_long type is casted to u_long. Also, > > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > > FreeBSD ABI, they may differ from the target process limits. > > >=20 > Thanks for quick reaction. >=20 > As for the latter, something doesn't quite work here. > I see EFAULT against i386 process running on amd64. Right, the COMPAT_FREEBSD32 case should properly convert both struct ps_strings and array of pointers to the host structures. So this is fourth issue. diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linpro= cfs.c index c7fe158..db837e2 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -96,6 +96,10 @@ __FBSDID("$FreeBSD$"); #include #endif /* __i386__ || __amd64__ */ =20 +#ifdef COMPAT_FREEBSD32 +#include +#endif + #ifdef COMPAT_LINUX32 /* XXX */ #include #else @@ -951,13 +955,14 @@ linprocfs_doargv(struct thread *td, struct proc *p, s= truct sbuf *sb, struct iovec iov; struct uio tmp_uio; struct ps_strings pss; - int ret, i, n_elements, found_end; - u_long addr; - char* env_vector[MAX_ARGV_STR]; + int ret, i, n_elements, elm_len, found_end; + u_long addr, pbegin; + char **env_vector; char env_string[UIO_CHUNK_SZ]; - char *pbegin; - - +#ifdef COMPAT_FREEBSD32 + struct freebsd32_ps_strings pss32; + uint32_t ptr; +#endif =20 #define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ do { \ @@ -971,63 +976,112 @@ do { \ uio.uio_rw =3D (rw); \ uio.uio_td =3D (td); \ } while (0) - - UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, - (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), - UIO_SYSSPACE, UIO_READ, td); - - ret =3D proc_rwmem(p, &tmp_uio); - if (ret !=3D 0) - return ret; +#define VALID_USER_ADDR(addr) \ + ((addr) >=3D p->p_sysent->sv_minuser && (addr) < p->p_sysent->sv_maxuser) + + env_vector =3D malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); + +#ifdef COMPAT_FREEBSD32 + if ((p->p_sysent->sv_flags & SV_ILP32) !=3D 0) { + UIO_HELPER(tmp_uio, iov, &pss32, sizeof(pss32), 1, + (off_t)(p->p_sysent->sv_psstrings), + sizeof(pss32), UIO_SYSSPACE, UIO_READ, td); + ret =3D proc_rwmem(p, &tmp_uio); + if (ret !=3D 0) + goto done; + pss.ps_argvstr =3D PTRIN(pss32.ps_argvstr); + pss.ps_nargvstr =3D pss32.ps_nargvstr; + pss.ps_envstr =3D PTRIN(pss32.ps_envstr); + pss.ps_nenvstr =3D pss32.ps_nenvstr; + + elm_len =3D MAX_ARGV_STR * sizeof(int32_t); + } else { +#endif + UIO_HELPER(tmp_uio, iov, &pss, sizeof(pss), 1, + (off_t)(p->p_sysent->sv_psstrings), + sizeof(pss), UIO_SYSSPACE, UIO_READ, td); + ret =3D proc_rwmem(p, &tmp_uio); + if (ret !=3D 0) + goto done; + + elm_len =3D MAX_ARGV_STR * sizeof(char *); +#ifdef COMPAT_FREEBSD32 + } +#endif =20 /* Get the array address and the number of elements */ resolver(pss, &addr, &n_elements); =20 /* Consistent with lib/libkvm/kvm_proc.c */ - if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || - (u_long)addr >=3D VM_MAXUSER_ADDRESS) { - /* What error code should we return? */ - return 0; + if (n_elements > MAX_ARGV_STR || !VALID_USER_ADDR(addr) || + !VALID_USER_ADDR(addr + elm_len)) { + ret =3D EFAULT; + goto done; } =20 - UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, - (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); +#ifdef COMPAT_FREEBSD32 + if ((p->p_sysent->sv_flags & SV_ILP32) !=3D 0) { + for (i =3D 0; i < MAX_ARGV_STR; i++) { + UIO_HELPER(tmp_uio, iov, &ptr, sizeof(ptr), 1, + (vm_offset_t)(addr + i * sizeof(uint32_t)), + iov.iov_len, UIO_SYSSPACE, UIO_READ, td); + ret =3D proc_rwmem(p, &tmp_uio); + if (ret !=3D 0) + goto done; + env_vector[i] =3D PTRIN(ptr); + } + } else { +#endif + UIO_HELPER(tmp_uio, iov, env_vector, elm_len, 1, + (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, + td); + ret =3D proc_rwmem(p, &tmp_uio); + if (ret !=3D 0) + goto done; +#ifdef COMPAT_FREEBSD32 + } +#endif =20 - ret =3D proc_rwmem(p, &tmp_uio); - if (ret !=3D 0) - return ret; =20 /* Now we can iterate through the list of strings */ for (i =3D 0; i < n_elements; i++) { found_end =3D 0; - pbegin =3D env_vector[i]; - while(!found_end) { + pbegin =3D (vm_offset_t)env_vector[i]; + while (!found_end) { + if (!VALID_USER_ADDR(pbegin) || + !VALID_USER_ADDR(pbegin + sizeof(env_string))) { + ret =3D EFAULT; + goto done; + } UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, - (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, - UIO_READ, td); + pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); =20 - ret =3D proc_rwmem(p, &tmp_uio); - if (ret !=3D 0) - return ret; + ret =3D proc_rwmem(p, &tmp_uio); + if (ret !=3D 0) { + ret =3D 0; + goto done; + } =20 - if (!strvalid(env_string, UIO_CHUNK_SZ)) { + if (!strvalid(env_string, UIO_CHUNK_SZ)) { /* - * We didn't find the end of the string + * We didn't find the end of the string. * Add the string to the buffer and move - * the pointer + * the pointer. */ sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); - pbegin =3D &(*pbegin) + UIO_CHUNK_SZ; - } else { + pbegin +=3D UIO_CHUNK_SZ; + } else found_end =3D 1; - } } sbuf_printf(sb, "%s", env_string); } =20 +#undef VALID_USER_ADDR #undef UIO_HELPER =20 - return (0); +done: + free(env_vector, M_TEMP); + return (ret); } =20 static void @@ -1052,9 +1106,11 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return ret; } + _PHOLD(p); + PROC_UNLOCK(p); =20 ret =3D linprocfs_doargv(td, p, sb, ps_string_env); - PROC_UNLOCK(p); + PRELE(p); return (ret); } =20 --+Z7/5fzWRHDJ0o7Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkycomQACgkQC3+MBN1Mb4gm+wCg5iz9Y7aJiRsIeucwFPQ3D/HC bewAoLN9HnfvWULhs4Vm6a36njMwqkcV =V696 -----END PGP SIGNATURE----- --+Z7/5fzWRHDJ0o7Q-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 13:17:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D3C1065670; Fri, 24 Sep 2010 13:17:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A1E028FC17; Fri, 24 Sep 2010 13:17:35 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 30D6846B35; Fri, 24 Sep 2010 09:17:35 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 326558A03C; Fri, 24 Sep 2010 09:17:34 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Fri, 24 Sep 2010 08:34:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <20100924115311.GH34228@deviant.kiev.zoral.com.ua> In-Reply-To: <20100924115311.GH34228@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009240834.16786.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Sep 2010 09:17:34 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, pluknet , src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 13:17:36 -0000 On Friday, September 24, 2010 7:53:11 am Kostik Belousov wrote: > On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: > > On 16 September 2010 11:56, Dag-Erling Smorgrav wrote: > > > Author: des > > > Date: Thu Sep 16 07:56:34 2010 > > > New Revision: 212723 > > > URL: http://svn.freebsd.org/changeset/base/212723 > > > > > > Log: > > > Implement proc/$$/environment. > > > > > [...] > > > > > /* > > > * Filler function for proc/pid/environ > > > */ > > > static int > > > linprocfs_doprocenviron(PFS_FILL_ARGS) > > > { > > > + int ret; > > > > > > - sbuf_printf(sb, "doprocenviron\n%c", '\0'); > > > - return (0); > > > + PROC_LOCK(p); > > > > With this change I observe the following sleepable after non-sleepable: > > > > 1st 0xffffff000290b558 process lock (process lock) @ > > /usr/src/sys/modules/linprocfs/../../compat/linprocfs/linprocfs.c:1049 > > 2nd 0xffffff00028f8848 user map (user map) @ /usr/src/sys/vm/vm_map.c:3525 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > > _witness_debugger() at _witness_debugger+0x2e > > witness_checkorder() at witness_checkorder+0x807 > > _sx_slock() at _sx_slock+0x55 > > vm_map_lookup() at vm_map_lookup+0x55 > > vm_fault() at vm_fault+0x113 > > proc_rwmem() at proc_rwmem+0x7a > > linprocfs_doprocenviron() at linprocfs_doprocenviron+0x122 > > pfs_read() at pfs_read+0x45b > > vn_read() at vn_read+0x256 > > dofileread() at dofileread+0xa1 > > kern_readv() at kern_readv+0x60 > > read() at read+0x55 > > syscallenter() at syscallenter+0x1aa > > syscall() at syscall+0x4c > > Xfast_syscall() at Xfast_syscall+0xe2 > > --- syscall (3, FreeBSD ELF64, read), rip = 0x80074134c, rsp = > > 0x7fffffffe9c8, rbp = 0 --- > > > > > > > + > > > + if ((ret = p_cansee(td, p)) != 0) { > > > + PROC_UNLOCK(p); > > > + return ret; > > > + } > > > + > > > + ret = linprocfs_doargv(td, p, sb, ps_string_env); > > > + PROC_UNLOCK(p); > > > + return (ret); > > > } > > This is easy to fix, isn't it ? But there seems to be much more nits. > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > good. > > Second, the initialization of iov_len for reading the array > of string pointers misses '* sizeof(char *)'. > > And third (probably fatal) is the lack of checks that the end of > array and each string fits into the user portion of the map. I do not > see why addr that already has u_long type is casted to u_long. Also, > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > FreeBSD ABI, they may differ from the target process limits. > > Formatting is separate issue, let postpone it. > > diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c > index c7fe158..fd62b1c 100644 > --- a/sys/compat/linprocfs/linprocfs.c > +++ b/sys/compat/linprocfs/linprocfs.c > @@ -952,12 +952,9 @@ linprocfs_doargv(struct thread *td, struct proc *p, struct sbuf *sb, > struct uio tmp_uio; > struct ps_strings pss; > int ret, i, n_elements, found_end; > - u_long addr; > - char* env_vector[MAX_ARGV_STR]; > + u_long addr, pbegin; > + char **env_vector; > char env_string[UIO_CHUNK_SZ]; > - char *pbegin; > - > - > > #define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ > do { \ > @@ -971,6 +968,10 @@ do { \ > uio.uio_rw = (rw); \ > uio.uio_td = (td); \ > } while (0) > +#define VALID_USER_ADDR(addr) \ > + ((addr) >= p->p_sysent->sv_minuser && (addr) < p->p_sysent->sv_maxuser) > + > + env_vector = malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); > > UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, > (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), > @@ -978,37 +979,41 @@ do { \ > > ret = proc_rwmem(p, &tmp_uio); > if (ret != 0) > - return ret; > + goto done; > > /* Get the array address and the number of elements */ > resolver(pss, &addr, &n_elements); > > /* Consistent with lib/libkvm/kvm_proc.c */ > - if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || > - (u_long)addr >= VM_MAXUSER_ADDRESS) { > - /* What error code should we return? */ > - return 0; > + if (n_elements > MAX_ARGV_STR || !VALID_USER_ADDR(addr) || > + !VALID_USER_ADDR(addr + MAX_ARGV_STR * sizeof(char *))) { > + ret = EFAULT; > + goto done; > } > > - UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, > + UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR * sizeof(char *), 1, > (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > ret = proc_rwmem(p, &tmp_uio); > if (ret != 0) > - return ret; > + goto done; > > /* Now we can iterate through the list of strings */ > for (i = 0; i < n_elements; i++) { > found_end = 0; > - pbegin = env_vector[i]; > - while(!found_end) { > + pbegin = (vm_offset_t)env_vector[i]; > + while (!found_end) { > + if (!VALID_USER_ADDR(pbegin) || > + !VALID_USER_ADDR(pbegin + sizeof(env_string))) { > + ret = EFAULT; > + goto done; > + } > UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, > - (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, > - UIO_READ, td); > + pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > ret = proc_rwmem(p, &tmp_uio); > if (ret != 0) > - return ret; > + goto done; > > if (!strvalid(env_string, UIO_CHUNK_SZ)) { > /* > @@ -1017,7 +1022,7 @@ do { \ > * the pointer > */ > sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); > - pbegin = &(*pbegin) + UIO_CHUNK_SZ; > + pbegin += UIO_CHUNK_SZ; > } else { > found_end = 1; > } > @@ -1025,9 +1030,12 @@ do { \ > sbuf_printf(sb, "%s", env_string); > } > > +#undef VALID_USER_ADDR > #undef UIO_HELPER > > - return (0); > +done: > + free(env_vector, M_TEMP); > + return (ret); > } > > static void > @@ -1052,9 +1060,11 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) > PROC_UNLOCK(p); > return ret; > } > + _PHOLD(p); > + PROC_UNLOCK(p); > > ret = linprocfs_doargv(td, p, sb, ps_string_env); > - PROC_UNLOCK(p); > + PRELE(p); > return (ret); > } You need to add a P_WEXIT check here. _PHOLD() / PRELE() do not work once P_WEXIT is set (rather, exit1() may not notice and wait for a _PHOLD() invoked to drain once P_WEXIT is set). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 13:28:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C144106566B; Fri, 24 Sep 2010 13:28:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DC2758FC1C; Fri, 24 Sep 2010 13:28:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 61DD946B64; Fri, 24 Sep 2010 09:28:51 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 570468A03C; Fri, 24 Sep 2010 09:28:50 -0400 (EDT) From: John Baldwin To: Ken Smith Date: Fri, 24 Sep 2010 09:23:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <20100922222441.00002f27@unknown> <20100923.203143.19192035494300157.imp@bsdimp.com> <1285297884.17619.17.camel@neo.cse.buffalo.edu> In-Reply-To: <1285297884.17619.17.camel@neo.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009240923.04406.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Sep 2010 09:28:50 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: bruce@cran.org.uk, src-committers@freebsd.org, svn-src-all@freebsd.org, avg@freebsd.org, gavin@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 13:28:52 -0000 On Thursday, September 23, 2010 11:11:24 pm Ken Smith wrote: > On Thu, 2010-09-23 at 20:31 -0600, M. Warner Losh wrote: > > In message: > > Gavin Atkinson writes: > > : On Thu, 23 Sep 2010, Ken Smith wrote: > > : > The issues talked about so far all contribute to the reason for that. > > : > But one of the more basic gut reactions to it all is that the users > > : > want to be interested in helping with the debugging (even if just > > : > providing the requested info) for any sort of crash information > > : > to be useful. And at the point we shift something from -current > > : > to -stable the percentage of people actively interested in participating > > : > in that sort of stuff flip. The bulk of people using -current > > : > know it's risky and they do it out of some interest in debugging > > : > stuff. The *bulk* of people using -stable are less interested or > > : > flat out not interested. And have no clue what crash dumps are, > > : > may be challenged to notice partition-getting-full issues, etc. > > : > > : I'm not sure I buy this argument, I'm afraid. Part of the advantage of > > : having all this done automatically on the as-shipped release media is that > > : end users don't have to be interested in debugging - crashinfo(8) does > > : most of the work for them. There's no easy way to actually determine > > : figures, but even if say only 10-15% of crashes can be diagnosed and > > : corrected just from the output of crashinfo(8) then that's a huge win for > > : the project as a whole. I'm guessing 10-15% is not unrealistic. > > : > > : I appreciate the issue about filling partitions is a valid one. Would a > > : possible compromise be that on release media, crashinfo(8) or similar will > > : default to only keeping the most recent coredump or similar? Given /var > > : now defaults to 4GB, Defaulting to keeping a single core is probably > > : acceptable. > > > > Furthermore, if we aren't interested in crash dumps by default, why do > > we install the huge .symbols files? > > > > Warner > > > > Because disks are big and (again, just trying to explain my > understanding of what I inherited) we want all the support > to be in place, just not turned on. There is a difference > between "You can give us much better information by doing > .symbols goo> and then making a one-line change to rc.conf" > versus "You can give us much better information by making > a one-line change to rc.conf". The biggest argument against this (and the reason I always enable crashdumps on all machines I am involved with) is that many panics are not easily reproducible, esp. ones that trigger under load. If dumpdev is not on by default, then the info from a rare or hard-to-trigger bug may simply be lost. Also, "just send-pr or mail the 'foo' file" is even simpler than "enable this knob in rc.conf and reproduce your issue, then come back". > This is definitely one I don't have a strong enough opinion > on to fight over, I sympathize with both sides. If the > general consensus is mostly towards changing so be it. > I've got no way to tell what percentage of users would > have any clue what to do with the crash info versus users > who would be negatively impacted simply by the fact their > systems are generating stuff they're completely ignorant > of and will never touch. Well, if we turn it on we should document it clearly. Folks are already interested in asking for help once a machine panics, and if the reply to a query on questions@ can say "please go look for a file named 'foo' and e-mail it somewhere or send-pr it", that is far simpler than having to enable dumps and reproduce the panic. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 13:32:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9513F106564A; Fri, 24 Sep 2010 13:32:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EA5408FC12; Fri, 24 Sep 2010 13:32:19 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8ODWFG6000316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Sep 2010 16:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8ODWFmi041014; Fri, 24 Sep 2010 16:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8ODWFCa041013; Fri, 24 Sep 2010 16:32:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Sep 2010 16:32:15 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20100924133215.GL34228@deviant.kiev.zoral.com.ua> References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <20100924115311.GH34228@deviant.kiev.zoral.com.ua> <201009240834.16786.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uwB7x3tnyrZQfZJI" Content-Disposition: inline In-Reply-To: <201009240834.16786.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, pluknet , src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 13:32:20 -0000 --uwB7x3tnyrZQfZJI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 24, 2010 at 08:34:16AM -0400, John Baldwin wrote: > On Friday, September 24, 2010 7:53:11 am Kostik Belousov wrote: > > On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: > > > On 16 September 2010 11:56, Dag-Erling Smorgrav wro= te: > > > > Author: des > > > > Date: Thu Sep 16 07:56:34 2010 > > > > New Revision: 212723 > > > > URL: http://svn.freebsd.org/changeset/base/212723 > > > > > > > > Log: > > > > Implement proc/$$/environment. > > > > > > > [...] > > >=20 > > > > /* > > > > * Filler function for proc/pid/environ > > > > */ > > > > static int > > > > linprocfs_doprocenviron(PFS_FILL_ARGS) > > > > { > > > > + int ret; > > > > > > > > - sbuf_printf(sb, "doprocenviron\n%c", '\0'); > > > > - return (0); > > > > + PROC_LOCK(p); > > >=20 > > > With this change I observe the following sleepable after non-sleepabl= e: > > >=20 > > > 1st 0xffffff000290b558 process lock (process lock) @ > > > /usr/src/sys/modules/linprocfs/../../compat/linprocfs/linprocfs.c:1049 > > > 2nd 0xffffff00028f8848 user map (user map) @=20 > /usr/src/sys/vm/vm_map.c:3525 > > > KDB: stack backtrace: > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > > > _witness_debugger() at _witness_debugger+0x2e > > > witness_checkorder() at witness_checkorder+0x807 > > > _sx_slock() at _sx_slock+0x55 > > > vm_map_lookup() at vm_map_lookup+0x55 > > > vm_fault() at vm_fault+0x113 > > > proc_rwmem() at proc_rwmem+0x7a > > > linprocfs_doprocenviron() at linprocfs_doprocenviron+0x122 > > > pfs_read() at pfs_read+0x45b > > > vn_read() at vn_read+0x256 > > > dofileread() at dofileread+0xa1 > > > kern_readv() at kern_readv+0x60 > > > read() at read+0x55 > > > syscallenter() at syscallenter+0x1aa > > > syscall() at syscall+0x4c > > > Xfast_syscall() at Xfast_syscall+0xe2 > > > --- syscall (3, FreeBSD ELF64, read), rip =3D 0x80074134c, rsp =3D > > > 0x7fffffffe9c8, rbp =3D 0 --- > > >=20 > > >=20 > > > > + > > > > + if ((ret =3D p_cansee(td, p)) !=3D 0) { > > > > + PROC_UNLOCK(p); > > > > + return ret; > > > > + } > > > > + > > > > + ret =3D linprocfs_doargv(td, p, sb, ps_string_env); > > > > + PROC_UNLOCK(p); > > > > + return (ret); > > > > } > >=20 > > This is easy to fix, isn't it ? But there seems to be much more nits. > >=20 > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > > good. > >=20 > > Second, the initialization of iov_len for reading the array > > of string pointers misses '* sizeof(char *)'. > >=20 > > And third (probably fatal) is the lack of checks that the end of > > array and each string fits into the user portion of the map. I do not > > see why addr that already has u_long type is casted to u_long. Also, > > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > > FreeBSD ABI, they may differ from the target process limits. > >=20 > > Formatting is separate issue, let postpone it. > >=20 > > diff --git a/sys/compat/linprocfs/linprocfs.c=20 > b/sys/compat/linprocfs/linprocfs.c > > index c7fe158..fd62b1c 100644 > > --- a/sys/compat/linprocfs/linprocfs.c > > +++ b/sys/compat/linprocfs/linprocfs.c > > @@ -952,12 +952,9 @@ linprocfs_doargv(struct thread *td, struct proc *p= ,=20 > struct sbuf *sb, > > struct uio tmp_uio; > > struct ps_strings pss; > > int ret, i, n_elements, found_end; > > - u_long addr; > > - char* env_vector[MAX_ARGV_STR]; > > + u_long addr, pbegin; > > + char **env_vector; > > char env_string[UIO_CHUNK_SZ]; > > - char *pbegin; > > - > > - > > =20 > > #define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ > > do { \ > > @@ -971,6 +968,10 @@ do { \ > > uio.uio_rw =3D (rw); \ > > uio.uio_td =3D (td); \ > > } while (0) > > +#define VALID_USER_ADDR(addr) \ > > + ((addr) >=3D p->p_sysent->sv_minuser && (addr) < p->p_sysent->sv_maxu= ser) > > + > > + env_vector =3D malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK= ); > > =20 > > UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, > > (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), > > @@ -978,37 +979,41 @@ do { \ > > =20 > > ret =3D proc_rwmem(p, &tmp_uio); > > if (ret !=3D 0) > > - return ret; > > + goto done; > > =20 > > /* Get the array address and the number of elements */ > > resolver(pss, &addr, &n_elements); > > =20 > > /* Consistent with lib/libkvm/kvm_proc.c */ > > - if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || > > - (u_long)addr >=3D VM_MAXUSER_ADDRESS) { > > - /* What error code should we return? */ > > - return 0; > > + if (n_elements > MAX_ARGV_STR || !VALID_USER_ADDR(addr) || > > + !VALID_USER_ADDR(addr + MAX_ARGV_STR * sizeof(char *))) { > > + ret =3D EFAULT; > > + goto done; > > } > > =20 > > - UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, > > + UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR * sizeof(char *), = 1, > > (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > =20 > > ret =3D proc_rwmem(p, &tmp_uio); > > if (ret !=3D 0) > > - return ret; > > + goto done; > > =20 > > /* Now we can iterate through the list of strings */ > > for (i =3D 0; i < n_elements; i++) { > > found_end =3D 0; > > - pbegin =3D env_vector[i]; > > - while(!found_end) { > > + pbegin =3D (vm_offset_t)env_vector[i]; > > + while (!found_end) { > > + if (!VALID_USER_ADDR(pbegin) || > > + !VALID_USER_ADDR(pbegin + sizeof(env_string))) { > > + ret =3D EFAULT; > > + goto done; > > + } > > UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, > > - (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, > > - UIO_READ, td); > > + pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > =20 > > ret =3D proc_rwmem(p, &tmp_uio); > > if (ret !=3D 0) > > - return ret; > > + goto done; > > =20 > > if (!strvalid(env_string, UIO_CHUNK_SZ)) { > > /* > > @@ -1017,7 +1022,7 @@ do { \ > > * the pointer > > */ > > sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); > > - pbegin =3D &(*pbegin) + UIO_CHUNK_SZ; > > + pbegin +=3D UIO_CHUNK_SZ; > > } else { > > found_end =3D 1; > > } > > @@ -1025,9 +1030,12 @@ do { \ > > sbuf_printf(sb, "%s", env_string); > > } > > =20 > > +#undef VALID_USER_ADDR > > #undef UIO_HELPER > > =20 > > - return (0); > > +done: > > + free(env_vector, M_TEMP); > > + return (ret); > > } > > =20 > > static void > > @@ -1052,9 +1060,11 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) > > PROC_UNLOCK(p); > > return ret; > > } > > + _PHOLD(p); > > + PROC_UNLOCK(p); > > =20 > > ret =3D linprocfs_doargv(td, p, sb, ps_string_env); > > - PROC_UNLOCK(p); > > + PRELE(p); > > return (ret); > > } >=20 > You need to add a P_WEXIT check here. _PHOLD() / PRELE() do not work > once P_WEXIT is set (rather, exit1() may not notice and wait for a > _PHOLD() invoked to drain once P_WEXIT is set). Hmm, I think that PHOLD is not needed there, actually. Pseudofs checks for exiting process in pfs_visible(_proc). Before the fill method is called, process is held and unlocked. So my second _PHOLD could be removed. --uwB7x3tnyrZQfZJI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkycqF4ACgkQC3+MBN1Mb4hZ1QCg40GXfKjzG0XjEh3fpgnA7jfx nZsAoLHvgP7PAIIt+Zlyk5pURRuALy0K =mp+o -----END PGP SIGNATURE----- --uwB7x3tnyrZQfZJI-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 14:25:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936B5106564A; Fri, 24 Sep 2010 14:25:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 365AA8FC19; Fri, 24 Sep 2010 14:25:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 98EB146B0D; Fri, 24 Sep 2010 10:25:27 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E4D228A03C; Fri, 24 Sep 2010 10:25:23 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Fri, 24 Sep 2010 10:25:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <201009240834.16786.jhb@freebsd.org> <20100924133215.GL34228@deviant.kiev.zoral.com.ua> In-Reply-To: <20100924133215.GL34228@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009241025.11877.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 24 Sep 2010 10:25:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, pluknet , src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 14:25:28 -0000 On Friday, September 24, 2010 9:32:15 am Kostik Belousov wrote: > On Fri, Sep 24, 2010 at 08:34:16AM -0400, John Baldwin wrote: > > On Friday, September 24, 2010 7:53:11 am Kostik Belousov wrote: > > > On Fri, Sep 24, 2010 at 02:17:29PM +0400, pluknet wrote: > > > > On 16 September 2010 11:56, Dag-Erling Smorgrav wrote: > > > > > Author: des > > > > > Date: Thu Sep 16 07:56:34 2010 > > > > > New Revision: 212723 > > > > > URL: http://svn.freebsd.org/changeset/base/212723 > > > > > > > > > > Log: > > > > > Implement proc/$$/environment. > > > > > > > > > [...] > > > > > > > > > /* > > > > > * Filler function for proc/pid/environ > > > > > */ > > > > > static int > > > > > linprocfs_doprocenviron(PFS_FILL_ARGS) > > > > > { > > > > > + int ret; > > > > > > > > > > - sbuf_printf(sb, "doprocenviron\n%c", '\0'); > > > > > - return (0); > > > > > + PROC_LOCK(p); > > > > > > > > With this change I observe the following sleepable after non- sleepable: > > > > > > > > 1st 0xffffff000290b558 process lock (process lock) @ > > > > /usr/src/sys/modules/linprocfs/../../compat/linprocfs/linprocfs.c:1049 > > > > 2nd 0xffffff00028f8848 user map (user map) @ > > /usr/src/sys/vm/vm_map.c:3525 > > > > KDB: stack backtrace: > > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > > > > _witness_debugger() at _witness_debugger+0x2e > > > > witness_checkorder() at witness_checkorder+0x807 > > > > _sx_slock() at _sx_slock+0x55 > > > > vm_map_lookup() at vm_map_lookup+0x55 > > > > vm_fault() at vm_fault+0x113 > > > > proc_rwmem() at proc_rwmem+0x7a > > > > linprocfs_doprocenviron() at linprocfs_doprocenviron+0x122 > > > > pfs_read() at pfs_read+0x45b > > > > vn_read() at vn_read+0x256 > > > > dofileread() at dofileread+0xa1 > > > > kern_readv() at kern_readv+0x60 > > > > read() at read+0x55 > > > > syscallenter() at syscallenter+0x1aa > > > > syscall() at syscall+0x4c > > > > Xfast_syscall() at Xfast_syscall+0xe2 > > > > --- syscall (3, FreeBSD ELF64, read), rip = 0x80074134c, rsp = > > > > 0x7fffffffe9c8, rbp = 0 --- > > > > > > > > > > > > > + > > > > > + if ((ret = p_cansee(td, p)) != 0) { > > > > > + PROC_UNLOCK(p); > > > > > + return ret; > > > > > + } > > > > > + > > > > > + ret = linprocfs_doargv(td, p, sb, ps_string_env); > > > > > + PROC_UNLOCK(p); > > > > > + return (ret); > > > > > } > > > > > > This is easy to fix, isn't it ? But there seems to be much more nits. > > > > > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > > > good. > > > > > > Second, the initialization of iov_len for reading the array > > > of string pointers misses '* sizeof(char *)'. > > > > > > And third (probably fatal) is the lack of checks that the end of > > > array and each string fits into the user portion of the map. I do not > > > see why addr that already has u_long type is casted to u_long. Also, > > > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > > > FreeBSD ABI, they may differ from the target process limits. > > > > > > Formatting is separate issue, let postpone it. > > > > > > diff --git a/sys/compat/linprocfs/linprocfs.c > > b/sys/compat/linprocfs/linprocfs.c > > > index c7fe158..fd62b1c 100644 > > > --- a/sys/compat/linprocfs/linprocfs.c > > > +++ b/sys/compat/linprocfs/linprocfs.c > > > @@ -952,12 +952,9 @@ linprocfs_doargv(struct thread *td, struct proc *p, > > struct sbuf *sb, > > > struct uio tmp_uio; > > > struct ps_strings pss; > > > int ret, i, n_elements, found_end; > > > - u_long addr; > > > - char* env_vector[MAX_ARGV_STR]; > > > + u_long addr, pbegin; > > > + char **env_vector; > > > char env_string[UIO_CHUNK_SZ]; > > > - char *pbegin; > > > - > > > - > > > > > > #define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ > > > do { \ > > > @@ -971,6 +968,10 @@ do { \ > > > uio.uio_rw = (rw); \ > > > uio.uio_td = (td); \ > > > } while (0) > > > +#define VALID_USER_ADDR(addr) \ > > > + ((addr) >= p->p_sysent->sv_minuser && (addr) < p->p_sysent- >sv_maxuser) > > > + > > > + env_vector = malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); > > > > > > UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, > > > (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), > > > @@ -978,37 +979,41 @@ do { \ > > > > > > ret = proc_rwmem(p, &tmp_uio); > > > if (ret != 0) > > > - return ret; > > > + goto done; > > > > > > /* Get the array address and the number of elements */ > > > resolver(pss, &addr, &n_elements); > > > > > > /* Consistent with lib/libkvm/kvm_proc.c */ > > > - if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || > > > - (u_long)addr >= VM_MAXUSER_ADDRESS) { > > > - /* What error code should we return? */ > > > - return 0; > > > + if (n_elements > MAX_ARGV_STR || !VALID_USER_ADDR(addr) || > > > + !VALID_USER_ADDR(addr + MAX_ARGV_STR * sizeof(char *))) { > > > + ret = EFAULT; > > > + goto done; > > > } > > > > > > - UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, > > > + UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR * sizeof(char *), 1, > > > (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > > > > > ret = proc_rwmem(p, &tmp_uio); > > > if (ret != 0) > > > - return ret; > > > + goto done; > > > > > > /* Now we can iterate through the list of strings */ > > > for (i = 0; i < n_elements; i++) { > > > found_end = 0; > > > - pbegin = env_vector[i]; > > > - while(!found_end) { > > > + pbegin = (vm_offset_t)env_vector[i]; > > > + while (!found_end) { > > > + if (!VALID_USER_ADDR(pbegin) || > > > + !VALID_USER_ADDR(pbegin + sizeof(env_string))) { > > > + ret = EFAULT; > > > + goto done; > > > + } > > > UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, > > > - (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, > > > - UIO_READ, td); > > > + pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); > > > > > > ret = proc_rwmem(p, &tmp_uio); > > > if (ret != 0) > > > - return ret; > > > + goto done; > > > > > > if (!strvalid(env_string, UIO_CHUNK_SZ)) { > > > /* > > > @@ -1017,7 +1022,7 @@ do { \ > > > * the pointer > > > */ > > > sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); > > > - pbegin = &(*pbegin) + UIO_CHUNK_SZ; > > > + pbegin += UIO_CHUNK_SZ; > > > } else { > > > found_end = 1; > > > } > > > @@ -1025,9 +1030,12 @@ do { \ > > > sbuf_printf(sb, "%s", env_string); > > > } > > > > > > +#undef VALID_USER_ADDR > > > #undef UIO_HELPER > > > > > > - return (0); > > > +done: > > > + free(env_vector, M_TEMP); > > > + return (ret); > > > } > > > > > > static void > > > @@ -1052,9 +1060,11 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) > > > PROC_UNLOCK(p); > > > return ret; > > > } > > > + _PHOLD(p); > > > + PROC_UNLOCK(p); > > > > > > ret = linprocfs_doargv(td, p, sb, ps_string_env); > > > - PROC_UNLOCK(p); > > > + PRELE(p); > > > return (ret); > > > } > > > > You need to add a P_WEXIT check here. _PHOLD() / PRELE() do not work > > once P_WEXIT is set (rather, exit1() may not notice and wait for a > > _PHOLD() invoked to drain once P_WEXIT is set). > > Hmm, I think that PHOLD is not needed there, actually. Pseudofs > checks for exiting process in pfs_visible(_proc). Before the fill > method is called, process is held and unlocked. So my second _PHOLD > could be removed. Yes, I think that is true. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 14:38:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4383106566C; Fri, 24 Sep 2010 14:38:54 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2EAE8FC14; Fri, 24 Sep 2010 14:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OEcs06027432; Fri, 24 Sep 2010 14:38:54 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OEcsvR027429; Fri, 24 Sep 2010 14:38:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009241438.o8OEcsvR027429@svn.freebsd.org> From: Attilio Rao Date: Fri, 24 Sep 2010 14:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213101 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 14:38:54 -0000 Author: attilio Date: Fri Sep 24 14:38:54 2010 New Revision: 213101 URL: http://svn.freebsd.org/changeset/base/213101 Log: IP_BINDANY is not correctly handled in getsockopt() case. Fix it by specifying the correct bits. Sponsored by: Sandvine Incorporated Reviewed by: bz, emaste, rstone Obtained from: Sandvine Incorporated MFC after: 10 days Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Sep 24 13:01:01 2010 (r213100) +++ head/sys/netinet/ip_output.c Fri Sep 24 14:38:54 2010 (r213101) @@ -1121,6 +1121,7 @@ ip_ctloutput(struct socket *so, struct s case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: + case IP_BINDANY: switch (sopt->sopt_name) { case IP_TOS: @@ -1176,6 +1177,9 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: optval = OPTBIT(INP_DONTFRAG); break; + case IP_BINDANY: + optval = OPTBIT(INP_BINDANY); + break; } error = sooptcopyout(sopt, &optval, sizeof optval); break; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri Sep 24 13:01:01 2010 (r213100) +++ head/sys/netinet6/ip6_output.c Fri Sep 24 14:38:54 2010 (r213101) @@ -1823,6 +1823,7 @@ do { \ case IPV6_PORTRANGE: case IPV6_RECVTCLASS: case IPV6_AUTOFLOWLABEL: + case IPV6_BINDANY: switch (optname) { case IPV6_RECVHOPOPTS: From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 14:44:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34C0A1065672; Fri, 24 Sep 2010 14:44:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23E1A8FC0C; Fri, 24 Sep 2010 14:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OEi5Mq027881; Fri, 24 Sep 2010 14:44:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OEi5hs027879; Fri, 24 Sep 2010 14:44:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009241444.o8OEi5hs027879@svn.freebsd.org> From: Marius Strobl Date: Fri, 24 Sep 2010 14:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213102 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 14:44:05 -0000 Author: marius Date: Fri Sep 24 14:44:04 2010 New Revision: 213102 URL: http://svn.freebsd.org/changeset/base/213102 Log: Remove the duplicate logging of failed read requests, whose error message also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not just the case the -n option is intended to deal with and thus really spammed us with ~20 messages in the default configuration when booting a diskless FreeBSD client, introduced with r207608 again. MFC after: 1 week Modified: head/libexec/tftpd/tftpd.c Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Fri Sep 24 14:38:54 2010 (r213101) +++ head/libexec/tftpd/tftpd.c Fri Sep 24 14:44:04 2010 (r213102) @@ -604,7 +604,6 @@ tftp_rrq(int peer, char *recvbuffer, ssi */ if (suppress_naks && *filename != '/' && ecode == ENOTFOUND) exit(0); - tftp_log(LOG_ERR, "Prevent NAK storm"); send_error(peer, ecode); exit(1); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 15:01:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7056106564A; Fri, 24 Sep 2010 15:01:45 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 942F38FC24; Fri, 24 Sep 2010 15:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OF1jlM029019; Fri, 24 Sep 2010 15:01:45 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OF1jjG029010; Fri, 24 Sep 2010 15:01:45 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009241501.o8OF1jjG029010@svn.freebsd.org> From: Attilio Rao Date: Fri, 24 Sep 2010 15:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213103 - in head/sys: conf libkern modules/krpc netinet nlm rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 15:01:45 -0000 Author: attilio Date: Fri Sep 24 15:01:45 2010 New Revision: 213103 URL: http://svn.freebsd.org/changeset/base/213103 Log: Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() general in the kernel (just as inet_ntoa() and inet_aton()) are and sync their prototype accordingly with already mentioned functions. Sponsored by: Sandvine Incorporated Reviewed by: emaste, rstone Approved by: dfr MFC after: 2 weeks Added: head/sys/libkern/inet_ntop.c - copied, changed from r213102, head/sys/rpc/inet_ntop.c head/sys/libkern/inet_pton.c - copied, changed from r213102, head/sys/rpc/inet_pton.c Deleted: head/sys/rpc/inet_ntop.c head/sys/rpc/inet_pton.c Modified: head/sys/conf/files head/sys/modules/krpc/Makefile head/sys/netinet/in.h head/sys/nlm/nlm_prot_impl.c head/sys/rpc/rpc_com.h head/sys/rpc/rpc_generic.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/conf/files Fri Sep 24 15:01:45 2010 (r213103) @@ -2328,6 +2328,8 @@ libkern/iconv_xlat16.c optional libicon libkern/index.c standard libkern/inet_aton.c standard libkern/inet_ntoa.c standard +libkern/inet_ntop.c standard +libkern/inet_pton.c standard libkern/mcount.c optional profiling-routine libkern/memcmp.c standard libkern/qsort.c standard @@ -2735,8 +2737,6 @@ rpc/clnt_dg.c optional krpc | nfslockd rpc/clnt_rc.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/clnt_vc.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/getnetconfig.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd -rpc/inet_ntop.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd -rpc/inet_pton.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/replay.c optional krpc | nfslockd | nfsserver | nfscl | nfsd rpc/rpc_callmsg.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/rpc_generic.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Copied and modified: head/sys/libkern/inet_ntop.c (from r213102, head/sys/rpc/inet_ntop.c) ============================================================================== --- head/sys/rpc/inet_ntop.c Fri Sep 24 14:44:04 2010 (r213102, copy source) +++ head/sys/libkern/inet_ntop.c Fri Sep 24 15:01:45 2010 (r213103) @@ -22,20 +22,18 @@ static const char rcsid[] = "$Id: inet_n __FBSDID("$FreeBSD$"); #include -#include #include #include -#include -#include +#include /*% * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size); -static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); +static char *inet_ntop4(const u_char *src, char *dst, socklen_t size); +static char *inet_ntop6(const u_char *src, char *dst, socklen_t size); /* char * * inet_ntop(af, src, dst, size) @@ -45,9 +43,8 @@ static const char *inet_ntop6(const u_ch * author: * Paul Vixie, 1996. */ -const char * -__rpc_inet_ntop(int af, const void * __restrict src, char * __restrict dst, - socklen_t size) +char * +inet_ntop(int af, const void *src, char *dst, socklen_t size) { switch (af) { case AF_INET: @@ -71,7 +68,7 @@ __rpc_inet_ntop(int af, const void * __r * author: * Paul Vixie, 1996. */ -static const char * +static char * inet_ntop4(const u_char *src, char *dst, socklen_t size) { static const char fmt[] = "%u.%u.%u.%u"; @@ -92,7 +89,7 @@ inet_ntop4(const u_char *src, char *dst, * author: * Paul Vixie, 1996. */ -static const char * +static char * inet_ntop6(const u_char *src, char *dst, socklen_t size) { /* Copied and modified: head/sys/libkern/inet_pton.c (from r213102, head/sys/rpc/inet_pton.c) ============================================================================== --- head/sys/rpc/inet_pton.c Fri Sep 24 14:44:04 2010 (r213102, copy source) +++ head/sys/libkern/inet_pton.c Fri Sep 24 15:01:45 2010 (r213103) @@ -22,12 +22,10 @@ static const char rcsid[] = "$Id: inet_p __FBSDID("$FreeBSD$"); #include -#include #include #include -#include -#include +#include #if __FreeBSD_version < 700000 #define strchr index @@ -53,7 +51,7 @@ static int inet_pton6(const char *src, u * Paul Vixie, 1996. */ int -__rpc_inet_pton(int af, const char * __restrict src, void * __restrict dst) +inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: Modified: head/sys/modules/krpc/Makefile ============================================================================== --- head/sys/modules/krpc/Makefile Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/modules/krpc/Makefile Fri Sep 24 15:01:45 2010 (r213103) @@ -9,8 +9,6 @@ SRCS= auth_none.c \ clnt_rc.c \ clnt_vc.c \ getnetconfig.c \ - inet_ntop.c \ - inet_pton.c \ rpc_callmsg.c \ rpc_generic.c \ rpc_prot.c \ Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/netinet/in.h Fri Sep 24 15:01:45 2010 (r213103) @@ -726,6 +726,8 @@ int in_localip(struct in_addr); int inet_aton(const char *, struct in_addr *); /* in libkern */ char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ +char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ +int inet_pton(int af, const char *, void *); /* in libkern */ void in_ifdetach(struct ifnet *); #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/nlm/nlm_prot_impl.c Fri Sep 24 15:01:45 2010 (r213103) @@ -1055,13 +1055,13 @@ nlm_find_host_by_addr(const struct socka switch (addr->sa_family) { case AF_INET: - __rpc_inet_ntop(AF_INET, + inet_ntop(AF_INET, &((const struct sockaddr_in *) addr)->sin_addr, tmp, sizeof tmp); break; #ifdef INET6 case AF_INET6: - __rpc_inet_ntop(AF_INET6, + inet_ntop(AF_INET6, &((const struct sockaddr_in6 *) addr)->sin6_addr, tmp, sizeof tmp); break; Modified: head/sys/rpc/rpc_com.h ============================================================================== --- head/sys/rpc/rpc_com.h Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/rpc/rpc_com.h Fri Sep 24 15:01:45 2010 (r213103) @@ -111,10 +111,6 @@ extern struct netbuf *__rpc_uaddr2taddr_ extern int __rpc_seman2socktype(int); extern int __rpc_socktype2seman(int); extern int __rpc_sockisbound(struct socket*); -extern const char *__rpc_inet_ntop(int af, const void * __restrict src, - char * __restrict dst, socklen_t size); -extern int __rpc_inet_pton(int af, const char * __restrict src, - void * __restrict dst); extern int bindresvport(struct socket *so, struct sockaddr *sa); struct xucred; Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Fri Sep 24 14:44:04 2010 (r213102) +++ head/sys/rpc/rpc_generic.c Fri Sep 24 15:01:45 2010 (r213103) @@ -306,7 +306,7 @@ __rpc_taddr2uaddr_af(int af, const struc switch (af) { case AF_INET: sin = nbuf->buf; - if (__rpc_inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) + if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf) == NULL) return NULL; port = ntohs(sin->sin_port); @@ -318,7 +318,7 @@ __rpc_taddr2uaddr_af(int af, const struc #ifdef INET6 case AF_INET6: sin6 = nbuf->buf; - if (__rpc_inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) + if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6) == NULL) return NULL; port = ntohs(sin6->sin6_port); @@ -396,7 +396,7 @@ __rpc_uaddr2taddr_af(int af, const char memset(sin, 0, sizeof *sin); sin->sin_family = AF_INET; sin->sin_port = htons(port); - if (__rpc_inet_pton(AF_INET, addrstr, &sin->sin_addr) <= 0) { + if (inet_pton(AF_INET, addrstr, &sin->sin_addr) <= 0) { free(sin, M_RPC); free(ret, M_RPC); ret = NULL; @@ -414,7 +414,7 @@ __rpc_uaddr2taddr_af(int af, const char memset(sin6, 0, sizeof *sin6); sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); - if (__rpc_inet_pton(AF_INET6, addrstr, &sin6->sin6_addr) <= 0) { + if (inet_pton(AF_INET6, addrstr, &sin6->sin6_addr) <= 0) { free(sin6, M_RPC); free(ret, M_RPC); ret = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 15:12:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AFA6106566B; Fri, 24 Sep 2010 15:12:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3D418FC1A; Fri, 24 Sep 2010 15:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OFCIEC029262; Fri, 24 Sep 2010 15:12:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OFCIHG029260; Fri, 24 Sep 2010 15:12:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009241512.o8OFCIHG029260@svn.freebsd.org> From: Marius Strobl Date: Fri, 24 Sep 2010 15:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213104 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 15:12:19 -0000 Author: marius Date: Fri Sep 24 15:12:18 2010 New Revision: 213104 URL: http://svn.freebsd.org/changeset/base/213104 Log: minor simplifications and cosmetics Modified: head/sys/sparc64/sparc64/elf_machdep.c Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Fri Sep 24 15:01:45 2010 (r213103) +++ head/sys/sparc64/sparc64/elf_machdep.c Fri Sep 24 15:12:18 2010 (r213104) @@ -132,8 +132,8 @@ void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) { -} +} /* * The following table holds for each relocation type: @@ -219,7 +219,7 @@ static const int reloc_target_flags[] = }; #if 0 -static const char *reloc_names[] = { +static const char *const reloc_names[] = { "NONE", "RELOC_8", "RELOC_16", "RELOC_32", "DISP_8", "DISP_16", "DISP_32", "WDISP_30", "WDISP_22", "HI22", "22", "13", "LO10", "GOT10", "GOT13", @@ -275,10 +275,9 @@ static const long reloc_target_bitmask[] int elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, elf_lookup_fn lookup) + int type, elf_lookup_fn lookup __unused) { const Elf_Rela *rela; - Elf_Addr value; Elf_Addr *where; if (type != ELF_RELOC_RELA) @@ -288,10 +287,8 @@ elf_reloc_local(linker_file_t lf, Elf_Ad if (ELF64_R_TYPE_ID(rela->r_info) != R_SPARC_RELATIVE) return (-1); - value = rela->r_addend + (Elf_Addr)lf->address; - where = (Elf_Addr *)((Elf_Addr)lf->address + rela->r_offset); - - *where = elf_relocaddr(lf, value); + where = (Elf_Addr *)(relocbase + rela->r_offset); + *where = elf_relocaddr(lf, rela->r_addend + relocbase); return (0); } @@ -346,9 +343,8 @@ elf_reloc(linker_file_t lf, Elf_Addr rel if (RELOC_PC_RELATIVE(rtype)) value -= (Elf_Addr)where; - if (RELOC_BASE_RELATIVE(rtype)) { + if (RELOC_BASE_RELATIVE(rtype)) value = elf_relocaddr(lf, value + relocbase); - } mask = RELOC_VALUE_BITMASK(rtype); value >>= RELOC_VALUE_RIGHTSHIFT(rtype); From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 16:40:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BDF2106566B; Fri, 24 Sep 2010 16:40:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B14C8FC15; Fri, 24 Sep 2010 16:40:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OGelY7031913; Fri, 24 Sep 2010 16:40:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OGelKS031911; Fri, 24 Sep 2010 16:40:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009241640.o8OGelKS031911@svn.freebsd.org> From: Marius Strobl Date: Fri, 24 Sep 2010 16:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213105 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 16:40:47 -0000 Author: marius Date: Fri Sep 24 16:40:46 2010 New Revision: 213105 URL: http://svn.freebsd.org/changeset/base/213105 Log: Improve r56796; the reply handler actually may remove the request from the chain in which case it shouldn't be removed twice. Reported by: Staale Kristoffersen MFC after: 1 week Modified: head/sys/dev/mpt/mpt.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Fri Sep 24 15:12:18 2010 (r213104) +++ head/sys/dev/mpt/mpt.c Fri Sep 24 16:40:46 2010 (r213105) @@ -844,13 +844,14 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; - TAILQ_REMOVE(chain, req, links); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; cb_index = MPT_CONTEXT_TO_CBI(le32toh(msg_hdr->MsgContext)); mpt_reply_handlers[cb_index](mpt, req, msg_hdr->MsgContext, &ioc_status_frame); + if (mpt_req_on_pending_list(mpt, req) != 0) + TAILQ_REMOVE(chain, req, links); } } From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:08:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1461065672; Fri, 24 Sep 2010 19:08:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE318FC12; Fri, 24 Sep 2010 19:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OJ8ukM036078; Fri, 24 Sep 2010 19:08:56 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJ8uW4036076; Fri, 24 Sep 2010 19:08:56 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201009241908.o8OJ8uW4036076@svn.freebsd.org> From: Kirk McKusick Date: Fri, 24 Sep 2010 19:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213119 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:08:56 -0000 Author: mckusick Date: Fri Sep 24 19:08:56 2010 New Revision: 213119 URL: http://svn.freebsd.org/changeset/base/213119 Log: Reported problem: Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192" show incorrect results from "df" for free and used space when mounted immediately after creation. fsck on the new filesystem (before ever mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5. This error hasn't occurred in any runs of fsck immediately after "newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option). Solution: The default UFS1 superblock is located at offset 8K in the filesystem partition; the default UFS2 superblock is located at offset 64K in the filesystem partition. For UFS1 filesystems with a blocksize of 64K, the first alternate superblock resides at 64K which is the the location used for the default UFS2 superblock. By default, the system first checks for a valid superblock at the default location for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of 64K, there is a valid UFS1 superblock at this location. Thus, even though it is expected to be a backup superblock, the system will use it as its default superblock. So, we have to ensure that all the statistcs on usage are correct in this first alternate superblock as it is the superblock that will actually be used. While tracking down this problem, another limitation of UFS1 became evident. For UFS1, the number of inodes per cylinder group is stored in an int16_t. Thus the maximum number of inodes per cylinder group is limited to 2^15 - 1. This limit can easily be exceeded for block sizes of 32K and above. Thus when building UFS1 filesystems, newfs must limit the number of inodes per cylinder group to 2^15 - 1. Reported by: Guy Helmer Followup by: Bruce Cran PR: 107692 MFC after: 4 weeks Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Fri Sep 24 19:07:14 2010 (r213118) +++ head/sbin/newfs/mkfs.c Fri Sep 24 19:08:56 2010 (r213119) @@ -376,16 +376,20 @@ restart: * Start packing more blocks into the cylinder group until * it cannot grow any larger, the number of cylinder groups * drops below MINCYLGRPS, or we reach the size requested. + * For UFS1 inodes per cylinder group are stored in an int16_t + * so fs_ipg is limited to 2^15 - 1. */ for ( ; sblock.fs_fpg < maxblkspercg; sblock.fs_fpg += sblock.fs_frag) { sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) - break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) - continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) - break; + if (Oflag > 1 || (Oflag == 1 && sblock.fs_ipg <= 0x7fff)) { + if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) + break; + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + continue; + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + break; + } sblock.fs_fpg -= sblock.fs_frag; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); @@ -584,8 +588,20 @@ restart: printf("** Exiting on Xflag 3\n"); exit(0); } - if (!Nflag) + if (!Nflag) { do_sbwrite(&disk); + /* + * For UFS1 filesystems with a blocksize of 64K, the first + * alternate superblock resides at the location used for + * the default UFS2 superblock. As there is a valid + * superblock at this location, the boot code will use + * it as its first choice. Thus we have to ensure that + * all of its statistcs on usage are correct. + */ + if (Oflag == 1 && sblock.fs_bsize == 65536) + wtfs(fsbtodb(&sblock, cgsblock(&sblock, 0)), + sblock.fs_bsize, (char *)&sblock); + } for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize) wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)), sblock.fs_cssize - i < sblock.fs_bsize ? From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:15:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB4F10656C0; Fri, 24 Sep 2010 19:15:29 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 54AC28FC0A; Fri, 24 Sep 2010 19:15:29 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 2AA0945CD9; Fri, 24 Sep 2010 21:15:28 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 7FF9445C99; Fri, 24 Sep 2010 21:15:22 +0200 (CEST) Date: Fri, 24 Sep 2010 21:15:04 +0200 From: Pawel Jakub Dawidek To: "Andrey V. Elsukov" Message-ID: <20100924191504.GC2236@garage.freebsd.pl> References: <201009240840.o8O8eha0095301@svn.freebsd.org> <4C9C740D.20406@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B4IIlcmfBL/1gGOG" Content-Disposition: inline In-Reply-To: <4C9C740D.20406@yandex.ru> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, pluknet , src-committers@freebsd.org Subject: Re: svn commit: r213097 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:15:29 -0000 --B4IIlcmfBL/1gGOG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 24, 2010 at 01:49:01PM +0400, Andrey V. Elsukov wrote: > On 24.09.2010 13:29, pluknet wrote: > >> Log: > >> Implement "force" (-F) option for gpart destroy verb. > >=20 > > Thank you very much! This is a very useful feature. > > Will you MFC it to RELENG_8? >=20 > It depends when pjd will do MFC of recent geom(8) stuff. If you are talking about G_TYPE_ASCNUM removal, I probably won't MFC it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --B4IIlcmfBL/1gGOG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyc+LcACgkQForvXbEpPzQL9QCgv1NsTyIe3L82pqni6+13pQXv vHsAoMFIM0MzK+W4l82kuGNCCz+41x+N =30cR -----END PGP SIGNATURE----- --B4IIlcmfBL/1gGOG-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:31:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1895D10656A3; Fri, 24 Sep 2010 19:31:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085FE8FC0C; Fri, 24 Sep 2010 19:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OJV8nh037348; Fri, 24 Sep 2010 19:31:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJV8B4037346; Fri, 24 Sep 2010 19:31:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009241931.o8OJV8B4037346@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 24 Sep 2010 19:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213133 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:31:09 -0000 Author: pjd Date: Fri Sep 24 19:31:08 2010 New Revision: 213133 URL: http://svn.freebsd.org/changeset/base/213133 Log: Add three GPT attributes: GPT_ENT_ATTR_BOOTME - this is bootable partition GPT_ENT_ATTR_BOOTONCE - try to boot only once from this partition GPT_ENT_ATTR_BOOTFAILED - set this flag if we cannot boot from partition containing GPT_ENT_ATTR_BOOTONCE flag; note that if we cannot boot from partition that contains only GPT_ENT_ATTR_BOOTME flag, the GPT_ENT_ATTR_BOOTFAILED flag won't be set According to wikipedia Microsoft TechNet says that attributes are divided into two halves: the lower 4 bytes representing partition independent attributes, and the upper 4 bytes are partition type dependent. Microsoft is already using bits 60 (read-only), 62 (hidden) and 63 (do not automount) and I'd like to not collide with those, so we are using bit 59 (bootme), 58 (bootonce) and 57 (bootfailed). Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) MFC after: 2 weeks Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri Sep 24 19:30:34 2010 (r213132) +++ head/sys/sys/gpt.h Fri Sep 24 19:31:08 2010 (r213133) @@ -65,6 +65,9 @@ struct gpt_ent { uint64_t ent_lba_end; uint64_t ent_attr; #define GPT_ENT_ATTR_PLATFORM (1ULL << 0) +#define GPT_ENT_ATTR_BOOTME (1ULL << 59) +#define GPT_ENT_ATTR_BOOTONCE (1ULL << 58) +#define GPT_ENT_ATTR_BOOTFAILED (1ULL << 57) uint16_t ent_name[36]; /* UTF-16. */ }; From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:33:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614241065674; Fri, 24 Sep 2010 19:33:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 503B98FC16; Fri, 24 Sep 2010 19:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OJXlFV037477; Fri, 24 Sep 2010 19:33:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJXlCr037475; Fri, 24 Sep 2010 19:33:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009241933.o8OJXlCr037475@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 24 Sep 2010 19:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213135 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:33:47 -0000 Author: pjd Date: Fri Sep 24 19:33:47 2010 New Revision: 213135 URL: http://svn.freebsd.org/changeset/base/213135 Log: Allow to configure GPT attributes. It shouldn't be allowed to set bootfailed attribute (it should be allowed only to unset it), but for test purposes it might be useful, so the current code allows it. Reviewed by: arch@ (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) MFC after: 2 weeks Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri Sep 24 19:31:53 2010 (r213134) +++ head/sys/geom/part/g_part_gpt.c Fri Sep 24 19:33:47 2010 (r213135) @@ -100,6 +100,8 @@ static const char *g_part_gpt_name(struc char *, size_t); static int g_part_gpt_probe(struct g_part_table *, struct g_consumer *); static int g_part_gpt_read(struct g_part_table *, struct g_consumer *); +static int g_part_gpt_setunset(struct g_part_table *table, + struct g_part_entry *baseentry, const char *attrib, unsigned int set); static const char *g_part_gpt_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_gpt_write(struct g_part_table *, struct g_consumer *); @@ -118,6 +120,7 @@ static kobj_method_t g_part_gpt_methods[ KOBJMETHOD(g_part_name, g_part_gpt_name), KOBJMETHOD(g_part_probe, g_part_gpt_probe), KOBJMETHOD(g_part_read, g_part_gpt_read), + KOBJMETHOD(g_part_setunset, g_part_gpt_setunset), KOBJMETHOD(g_part_type, g_part_gpt_type), KOBJMETHOD(g_part_write, g_part_gpt_write), { 0, 0 } @@ -519,6 +522,16 @@ g_part_gpt_dumpconf(struct g_part_table g_gpt_printf_utf16(sb, entry->ent.ent_name, sizeof(entry->ent.ent_name) >> 1); sbuf_printf(sb, "\n"); + if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME) + sbuf_printf(sb, "%sbootme\n", indent); + if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE) { + sbuf_printf(sb, "%sbootonce\n", + indent); + } + if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTFAILED) { + sbuf_printf(sb, "%sbootfailed\n", + indent); + } sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &entry->ent.ent_type); sbuf_printf(sb, "\n"); @@ -755,6 +768,78 @@ g_part_gpt_read(struct g_part_table *bas return (0); } +static int +g_part_gpt_setunset(struct g_part_table *table, struct g_part_entry *baseentry, + const char *attrib, unsigned int set) +{ + struct g_part_entry *iter; + struct g_part_gpt_entry *entry; + int changed, bootme, bootonce, bootfailed; + + bootme = bootonce = bootfailed = 0; + if (strcasecmp(attrib, "bootme") == 0) { + bootme = 1; + } else if (strcasecmp(attrib, "bootonce") == 0) { + /* BOOTME is set automatically with BOOTONCE, but not unset. */ + bootonce = 1; + if (set) + bootme = 1; + } else if (strcasecmp(attrib, "bootfailed") == 0) { + /* + * It should only be possible to unset BOOTFAILED, but it might + * be useful for test purposes to also be able to set it. + */ + bootfailed = 1; + } + if (!bootme && !bootonce && !bootfailed) + return (EINVAL); + + LIST_FOREACH(iter, &table->gpt_entry, gpe_entry) { + if (iter->gpe_deleted) + continue; + if (iter != baseentry) + continue; + changed = 0; + entry = (struct g_part_gpt_entry *)iter; + if (set) { + if (bootme && + !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME)) { + entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTME; + changed = 1; + } + if (bootonce && + !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE)) { + entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTONCE; + changed = 1; + } + if (bootfailed && + !(entry->ent.ent_attr & GPT_ENT_ATTR_BOOTFAILED)) { + entry->ent.ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + changed = 1; + } + } else { + if (bootme && + (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME)) { + entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTME; + changed = 1; + } + if (bootonce && + (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE)) { + entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + changed = 1; + } + if (bootfailed && + (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTFAILED)) { + entry->ent.ent_attr &= ~GPT_ENT_ATTR_BOOTFAILED; + changed = 1; + } + } + if (changed && !iter->gpe_created) + iter->gpe_modified = 1; + } + return (0); +} + static const char * g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:35:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA201065670; Fri, 24 Sep 2010 19:35:17 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id A7B098FC0C; Fri, 24 Sep 2010 19:35:17 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id o8OJKPXk023192; Fri, 24 Sep 2010 12:20:25 -0700 (PDT) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201009241920.o8OJKPXk023192@chez.mckusick.com> To: Doug Barton In-reply-to: <4C92DC2E.2020602@FreeBSD.org> Date: Fri, 24 Sep 2010 12:20:25 -0700 From: Kirk McKusick Cc: "Carlos A. M. dos Santos" , svn-src-head@freebsd.org, Brian Somers Subject: Re: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:35:18 -0000 > Date: Thu, 16 Sep 2010 20:10:38 -0700 > From: Doug Barton > To: "Carlos A. M. dos Santos" > CC: Brian Somers , Kirk McKusick , > svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, > src-committers@FreeBSD.org > Subject: Re: svn commit: r212617 - head/sys/ufs/ffs > > On 9/16/2010 7:29 PM, Carlos A. M. dos Santos wrote: > > On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers wrote: > >> If INVARIANTS is not defined, the above i++ will not happen. > > > > Which does not cause any harm, since "i" is a local variable, not used > > anywhere else in the function. A picky compiler would complain, > > however, that the variable is never read. > > If 'i' is only ever used in the INVARIANTS case then it should be > appropriately wrapped everywhere it appears. While the _current_ > situation may be harmless, in the future lack of an appropriate > indication of its use may cause a problem. This isn't just a pedantic > concern, we had a case like this that broke the build just recently. > > > Doug > > -- > > ... and that's just a little bit of history repeating. > -- Propellerheads > > Improve the effectiveness of your Internet presence with > a domain name makeover! http://SupersetSolutions.com/ What is the appropriate ifdef for a variable used only inside a KASSERT? Kirk McKusick From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:49:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70A931065670; Fri, 24 Sep 2010 19:49:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2008FC13; Fri, 24 Sep 2010 19:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OJnD9g037849; Fri, 24 Sep 2010 19:49:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJnDht037838; Fri, 24 Sep 2010 19:49:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009241949.o8OJnDht037838@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 24 Sep 2010 19:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213136 - in head/sys/boot: common i386/common i386/gptboot i386/gptzfsboot i386/zfsboot zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:49:13 -0000 Author: pjd Date: Fri Sep 24 19:49:12 2010 New Revision: 213136 URL: http://svn.freebsd.org/changeset/base/213136 Log: - Split code shared by almost any boot loader into separate files and clean up most layering violations: sys/boot/i386/common/rbx.h: RBX_* defines OPT_SET() OPT_CHECK() sys/boot/common/util.[ch]: memcpy() memset() memcmp() bcpy() bzero() bcmp() strcmp() strncmp() [new] strcpy() strcat() strchr() strlen() printf() sys/boot/i386/common/cons.[ch]: ioctrl putc() xputc() putchar() getc() xgetc() keyhit() [now takes number of seconds as an argument] getstr() sys/boot/i386/common/drv.[ch]: struct dsk drvread() drvwrite() [new] drvsize() [new] sys/boot/common/crc32.[ch] [new] sys/boot/common/gpt.[ch] [new] - Teach gptboot and gptzfsboot about new files. I haven't touched the rest, but there is still a lot of code duplication to be removed. - Implement full GPT support. Currently we just read primary header and partition table and don't care about checksums, etc. After this change we verify checksums of primary header and primary partition table and if there is a problem we fall back to backup header and backup partition table. - Clean up most messages to use prefix of boot program, so in case of an error we know where the error comes from, eg.: gptboot: unable to read primary GPT header - If we can't boot, print boot prompt only once and not every five seconds. - Honour newly added GPT attributes: bootme - this is bootable partition bootonce - try to boot from this partition only once bootfailed - we failed to boot from this partition - Change boot order of gptboot to the following: 1. Try to boot from all the partitions that have both 'bootme' and 'bootonce' attributes one by one. 2. Try to boot from all the partitions that have only 'bootme' attribute one by one. 3. If there are no partitions with 'bootme' attribute, boot from the first UFS partition. - The 'bootonce' functionality is implemented in the following way: 1. Walk through all the partitions and when 'bootonce' attribute is found without 'bootme' attribute, remove 'bootonce' attribute and set 'bootfailed' attribute. 'bootonce' attribute alone means that we tried to boot from this partition, but boot failed after leaving gptboot and machine was restarted. 2. Find partition with both 'bootme' and 'bootonce' attributes. 3. Remove 'bootme' attribute. 4. Try to execute /boot/loader or /boot/kernel/kernel from that partition. If succeeded we stop here. 5. If execution failed, remove 'bootonce' and set 'bootfailed'. 6. Go to 2. If whole boot succeeded there is new /etc/rc.d/gptboot script coming that will log all partitions that we failed to boot from (the ones with 'bootfailed' attribute) and will remove this attribute. It will also find partition with 'bootonce' attribute - this is the partition we booted from successfully. The script will log success and remove the attribute. All the GPT updates we do here goes to both primary and backup GPT if they are valid. We don't touch headers or partition tables when checksum doesn't match. Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com MFC after: 2 weeks Added: head/sys/boot/common/crc32.c (contents, props changed) head/sys/boot/common/crc32.h (contents, props changed) head/sys/boot/common/gpt.c (contents, props changed) head/sys/boot/common/gpt.h (contents, props changed) head/sys/boot/common/util.c (contents, props changed) head/sys/boot/common/util.h (contents, props changed) head/sys/boot/i386/common/ head/sys/boot/i386/common/cons.c (contents, props changed) head/sys/boot/i386/common/cons.h (contents, props changed) head/sys/boot/i386/common/drv.c (contents, props changed) head/sys/boot/i386/common/drv.h (contents, props changed) head/sys/boot/i386/common/rbx.h (contents, props changed) Modified: head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/zfs/Makefile head/sys/boot/zfs/zfsimpl.c Added: head/sys/boot/common/crc32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/crc32.c Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,108 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + */ + +/* + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "crc32.h" + +static uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t +crc32(const void *buf, size_t size) +{ + const uint8_t *p = buf; + uint32_t crc; + + crc = ~0U; + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc ^ ~0U); +} Added: head/sys/boot/common/crc32.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/crc32.h Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,13 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _CRC32_H_ +#define _CRC32_H_ + +uint32_t crc32(const void *buf, size_t size); + +#endif /* !_CRC32_H_ */ Added: head/sys/boot/common/gpt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/gpt.c Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,381 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef LITTLE_ENDIAN +#error gpt.c works only for little endian architectures +#endif + +#include "crc32.h" +#include "drv.h" +#include "util.h" +#include "gpt.h" + +#define MAXTBLENTS 128 + +static struct gpt_hdr hdr_primary, hdr_backup, *gpthdr; +static uint64_t hdr_primary_lba, hdr_backup_lba; +static struct gpt_ent table_primary[MAXTBLENTS], table_backup[MAXTBLENTS]; +static struct gpt_ent *gpttable; +static int curent, bootonce; + +/* + * Buffer below 64kB passed on gptread(), which can hold at least + * one sector od data (512 bytes). + */ +static char *secbuf; + +static void +gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + int entries_per_sec, firstent; + daddr_t slba; + + /* + * We need to update the following for both primary and backup GPT: + * 1. Sector on disk that contains curent partition. + * 2. Partition table checksum. + * 3. Header checksum. + * 4. Header on disk. + */ + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = curent / entries_per_sec; + firstent = slba * entries_per_sec; + bcpy(&table[firstent], secbuf, DEV_BSIZE); + slba += hdr->hdr_lba_table; + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + return; + } + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcpy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); + return; + } +} + +int +gptfind(const uuid_t *uuid, struct dsk *dskp, int part) +{ + struct gpt_ent *ent; + int firsttry; + + if (part >= 0) { + if (part == 0 || part > gpthdr->hdr_entries) { + printf("%s: invalid partition index\n", BOOTPROG); + return (-1); + } + ent = &gpttable[part - 1]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) { + printf("%s: specified partition is not UFS\n", + BOOTPROG); + return (-1); + } + curent = part - 1; + goto found; + } + + firsttry = (curent == -1); + curent++; + if (curent >= gpthdr->hdr_entries) { + curent = gpthdr->hdr_entries; + return (-1); + } + if (bootonce) { + /* + * First look for partition with both GPT_ENT_ATTR_BOOTME and + * GPT_ENT_ATTR_BOOTONCE flags. + */ + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTONCE)) + continue; + /* Ok, found one. */ + goto found; + } + bootonce = 0; + curent = 0; + } + for (; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + if (!(ent->ent_attr & GPT_ENT_ATTR_BOOTME)) + continue; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) + continue; + /* Ok, found one. */ + goto found; + } + if (firsttry) { + /* + * No partition with BOOTME flag was found, try to boot from + * first UFS partition. + */ + for (curent = 0; curent < gpthdr->hdr_entries; curent++) { + ent = &gpttable[curent]; + if (bcmp(&ent->ent_type, uuid, sizeof(uuid_t)) != 0) + continue; + /* Ok, found one. */ + goto found; + } + } + return (-1); +found: + dskp->part = curent + 1; + ent = &gpttable[curent]; + dskp->start = ent->ent_lba_start; + if (ent->ent_attr & GPT_ENT_ATTR_BOOTONCE) { + /* + * Clear BOOTME, but leave BOOTONCE set before trying to + * boot from this partition. + */ + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTME; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } + } + return (0); +} + +static int +gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + uint64_t hdrlba) +{ + uint32_t crc; + + if (drvread(dskp, secbuf, hdrlba, 1)) { + printf("%s: unable to read %s GPT header\n", BOOTPROG, which); + return (-1); + } + bcpy(secbuf, hdr, sizeof(*hdr)); + if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || + hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || + hdr->hdr_entsz < sizeof(struct gpt_ent) || + hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { + printf("%s: invalid %s GPT header\n", BOOTPROG, which); + return (-1); + } + crc = hdr->hdr_crc_self; + hdr->hdr_crc_self = 0; + if (crc32(hdr, hdr->hdr_size) != crc) { + printf("%s: %s GPT header checksum mismatch\n", BOOTPROG, + which); + return (-1); + } + hdr->hdr_crc_self = crc; + return (0); +} + +void +gptbootfailed(struct dsk *dskp) +{ + + if (!(gpttable[curent].ent_attr & GPT_ENT_ATTR_BOOTONCE)) + return; + + if (hdr_primary_lba > 0) { + table_primary[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_primary[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("primary", dskp, &hdr_primary, table_primary); + } + if (hdr_backup_lba > 0) { + table_backup[curent].ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + table_backup[curent].ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + gptupdate("backup", dskp, &hdr_backup, table_backup); + } +} + +static void +gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, + struct gpt_ent *table) +{ + struct gpt_ent *ent; + daddr_t slba; + int table_updated, sector_updated; + int entries_per_sec, nent, part; + + table_updated = 0; + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + for (nent = 0, slba = hdr->hdr_lba_table; + slba < hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; + slba++, nent += entries_per_sec) { + sector_updated = 0; + for (part = 0; part < entries_per_sec; part++) { + ent = &table[nent + part]; + if ((ent->ent_attr & (GPT_ENT_ATTR_BOOTME | + GPT_ENT_ATTR_BOOTONCE | + GPT_ENT_ATTR_BOOTFAILED)) != + GPT_ENT_ATTR_BOOTONCE) { + continue; + } + ent->ent_attr &= ~GPT_ENT_ATTR_BOOTONCE; + ent->ent_attr |= GPT_ENT_ATTR_BOOTFAILED; + table_updated = 1; + sector_updated = 1; + } + if (!sector_updated) + continue; + bcpy(&table[nent], secbuf, DEV_BSIZE); + if (drvwrite(dskp, secbuf, slba, 1)) { + printf("%s: unable to update %s GPT partition table\n", + BOOTPROG, which); + } + } + if (!table_updated) + return; + hdr->hdr_crc_table = crc32(table, hdr->hdr_entries * hdr->hdr_entsz); + hdr->hdr_crc_self = 0; + hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); + bzero(secbuf, DEV_BSIZE); + bcpy(hdr, secbuf, hdr->hdr_size); + if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) + printf("%s: unable to update %s GPT header\n", BOOTPROG, which); +} + +static int +gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp, + struct gpt_hdr *hdr, struct gpt_ent *table) +{ + struct gpt_ent *ent; + int entries_per_sec; + int part, nent; + daddr_t slba; + + if (hdr->hdr_entries == 0) + return (0); + + entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; + slba = hdr->hdr_lba_table; + nent = 0; + for (;;) { + if (drvread(dskp, secbuf, slba, 1)) { + printf("%s: unable to read %s GPT partition table\n", + BOOTPROG, which); + return (-1); + } + ent = (struct gpt_ent *)secbuf; + for (part = 0; part < entries_per_sec; part++, ent++) { + bcpy(ent, &table[nent], sizeof(table[nent])); + if (++nent >= hdr->hdr_entries) + break; + } + if (nent >= hdr->hdr_entries) + break; + slba++; + } + if (crc32(table, nent * hdr->hdr_entsz) != hdr->hdr_crc_table) { + printf("%s: %s GPT table checksum mismatch\n", BOOTPROG, which); + return (-1); + } + return (0); +} + +int +gptread(const uuid_t *uuid, struct dsk *dskp, char *buf) +{ + uint64_t altlba; + + /* + * Read and verify both GPT headers: primary and backup. + */ + + secbuf = buf; + hdr_primary_lba = hdr_backup_lba = 0; + curent = -1; + bootonce = 1; + dskp->start = 0; + + if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 && + gptread_table("primary", uuid, dskp, &hdr_primary, + table_primary) == 0) { + hdr_primary_lba = hdr_primary.hdr_lba_self; + gpthdr = &hdr_primary; + gpttable = table_primary; + } + + altlba = drvsize(dskp); + if (altlba > 0) + altlba--; + else if (hdr_primary_lba > 0) { + /* + * If we cannot obtain disk size, but primary header + * is valid, we can get backup header location from + * there. + */ + altlba = hdr_primary.hdr_lba_alt; + } + if (altlba == 0) + printf("%s: unable to locate backup GPT header\n", BOOTPROG); + else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 && + gptread_table("backup", uuid, dskp, &hdr_backup, + table_backup) == 0) { + hdr_backup_lba = hdr_backup.hdr_lba_self; + if (hdr_primary_lba == 0) { + gpthdr = &hdr_backup; + gpttable = table_backup; + printf("%s: using backup GPT\n", BOOTPROG); + } + } + + /* + * Convert all BOOTONCE without BOOTME flags into BOOTFAILED. + * BOOTONCE without BOOTME means that we tried to boot from it, + * but failed after leaving gptboot and machine was rebooted. + * We don't want to leave partitions marked as BOOTONCE only, + * because when we boot successfully start-up scripts should + * find at most one partition with only BOOTONCE flag and this + * will mean that we booted from that partition. + */ + if (hdr_primary_lba != 0) + gptbootconv("primary", dskp, &hdr_primary, table_primary); + if (hdr_backup_lba != 0) + gptbootconv("backup", dskp, &hdr_backup, table_backup); + + if (hdr_primary_lba == 0 && hdr_backup_lba == 0) + return (-1); + return (0); +} Added: head/sys/boot/common/gpt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/gpt.h Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _GPT_H_ +#define _GPT_H_ + +#include +#include + +int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); +int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); +void gptbootfailed(struct dsk *dskp); + +#endif /* !_GPT_H_ */ Added: head/sys/boot/common/util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/util.c Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,176 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include "cons.h" +#include "util.h" + +void +memcpy(void *dst, const void *src, int len) +{ + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; +} + +void +memset(void *b, int c, size_t len) +{ + char *bp = b; + + while (len--) + *bp++ = (unsigned char)c; +} + +int +memcmp(const void *b1, const void *b2, size_t len) +{ + const unsigned char *p1, *p2; + + for (p1 = b1, p2 = b2; len > 0; len--, p1++, p2++) { + if (*p1 != *p2) + return ((*p1) - (*p2)); + } + return (0); +} + +int +strcmp(const char *s1, const char *s2) +{ + + for (; *s1 == *s2 && *s1 != '\0'; s1++, s2++) + ; + return ((unsigned char)*s1 - (unsigned char)*s2); +} + +int +strncmp(const char *s1, const char *s2, size_t len) +{ + + for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + ; + return ((unsigned char)*s1 - (unsigned char)*s2); +} + +void +strcpy(char *dst, const char *src) +{ + + while (*src != '\0') + *dst++ = *src++; + *dst = '\0'; +} + +void +strcat(char *dst, const char *src) +{ + + while (*dst != '\0') + dst++; + while (*src != '\0') + *dst++ = *src++; + *dst = '\0'; +} + +char * +strchr(const char *s, char ch) +{ + + for (; *s != '\0'; s++) { + if (*s == ch) + return ((char *)(uintptr_t)(const void *)s); + } + return (NULL); +} + +size_t +strlen(const char *s) +{ + size_t len = 0; + + while (*s++ != '\0') + len++; + return (len); +} + +void +printf(const char *fmt, ...) +{ + va_list ap; + const char *hex = "0123456789abcdef"; + char buf[10], *s; + unsigned long long u; + int c, l; + + va_start(ap, fmt); + while ((c = *fmt++) != '\0') { + if (c != '%') { + putchar(c); + continue; + } + l = 0; +nextfmt: + c = *fmt++; + switch (c) { + case 'l': + l++; + goto nextfmt; + case 'c': + putchar(va_arg(ap, int)); + break; + case 's': + for (s = va_arg(ap, char *); *s != '\0'; s++) + putchar(*s); + break; + case 'd': /* A lie, always prints unsigned */ + case 'u': + case 'x': + switch (l) { + case 2: + u = va_arg(ap, unsigned long long); + break; + case 1: + u = va_arg(ap, unsigned long); + break; + default: + u = va_arg(ap, unsigned int); + break; + } + s = buf; + if (c == 'd' || c == 'u') { + do + *s++ = '0' + (u % 10U); + while (u /= 10); + } else { + do + *s++ = hex[u & 0xfu]; + while (u >>= 4); + } + while (--s >= buf) + putchar(*s); + break; + } + } + va_end(ap); +} Added: head/sys/boot/common/util.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/util.h Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include + +#include + +void memcpy(void *dst, const void *src, int len); +void memset(void *b, int c, size_t len); +int memcmp(const void *b1, const void *b2, size_t len); + +#define bcpy(src, dst, len) memcpy((dst), (src), (len)) +#define bzero(buf, size) memset((buf), 0, (size)) +#define bcmp(b1, b2, len) (memcmp((b1), (b2), (len)) != 0) + +int strcmp(const char *s1, const char *s2); +int strncmp(const char *s1, const char *s2, size_t len); +void strcpy(char *dst, const char *src); +void strcat(char *dst, const char *src); +char *strchr(const char *s, char ch); +size_t strlen(const char *s); + +void printf(const char *fmt, ...); + +#endif /* !_UTIL_H_ */ Added: head/sys/boot/i386/common/cons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/common/cons.c Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,152 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include + +#include "lib.h" +#include "rbx.h" +#include "util.h" +#include "cons.h" + +#define V86_ZR(x) ((x) & PSL_Z) + +#define SECOND 18 /* Circa that many ticks in a second. */ + +uint8_t ioctrl = IO_KEYBOARD; + +void +putc(int c) +{ + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); +} + +void +xputc(int c) +{ + + if (ioctrl & IO_KEYBOARD) + putc(c); + if (ioctrl & IO_SERIAL) + sio_putc(c); +} + +void +putchar(int c) +{ + + if (c == '\n') + xputc('\r'); + xputc(c); +} + +int +getc(int fn) +{ + + /* + * The extra comparison against zero is an attempt to work around + * what appears to be a bug in QEMU and Bochs. Both emulators + * sometimes report a key-press with scancode one and ascii zero + * when no such key is pressed in reality. As far as I can tell, + * this only happens shortly after a reboot. + */ + v86.ctl = V86_FLAGS; + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : (!V86_ZR(v86.efl) && (v86.eax & 0xff)); +} + +int +xgetc(int fn) +{ + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + for (;;) { + if (ioctrl & IO_KEYBOARD && getc(1)) + return (fn ? 1 : getc(0)); + if (ioctrl & IO_SERIAL && sio_ischar()) + return (fn ? 1 : sio_getc()); + if (fn) + return (0); + } + /* NOTREACHED */ +} + +int +keyhit(unsigned int secs) +{ + uint32_t t0, t1; + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + secs *= SECOND; + t0 = 0; + for (;;) { + if (xgetc(1)) + return (1); + if (secs > 0) { + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if (t1 < t0 || t1 >= t0 + secs) + return (0); + } + } + /* NOTREACHED */ +} + +void +getstr(char *cmdstr, size_t cmdstrsize) +{ + char *s; + int c; + + s = cmdstr; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmdstr) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmdstr < cmdstrsize - 1) + *s++ = c; + putchar(c); + break; + } + } +} Added: head/sys/boot/i386/common/cons.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/common/cons.h Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD$ + */ + +#ifndef _CONS_H_ +#define _CONS_H_ + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +extern uint8_t ioctrl; + +void putc(int c); +void xputc(int c); +void putchar(int c); +int getc(int fn); +int xgetc(int fn); +int keyhit(unsigned int secs); +void getstr(char *cmdstr, size_t cmdstrsize); + +#endif /* !_CONS_H_ */ Added: head/sys/boot/i386/common/drv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/common/drv.c Fri Sep 24 19:49:12 2010 (r213136) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 19:53:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F9E106566C; Fri, 24 Sep 2010 19:53:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E63CC8FC08; Fri, 24 Sep 2010 19:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OJrtKd038000; Fri, 24 Sep 2010 19:53:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OJrtP0037997; Fri, 24 Sep 2010 19:53:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009241953.o8OJrtP0037997@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 24 Sep 2010 19:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213137 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 19:53:56 -0000 Author: pjd Date: Fri Sep 24 19:53:55 2010 New Revision: 213137 URL: http://svn.freebsd.org/changeset/base/213137 Log: Add gptboot script that is responsible for: - looking for partition with 'bootonce' attribute alone (without 'bootme' attribute), removing it and logging that we successfully booted from this partition. - looking for partitions with 'bootfailed' attribute, removing it and logging that we failed to boot from this partition. Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com MFC after: 2 weeks Added: head/etc/rc.d/gptboot (contents, props changed) Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Fri Sep 24 19:49:12 2010 (r213136) +++ head/etc/rc.d/Makefile Fri Sep 24 19:53:55 2010 (r213137) @@ -11,7 +11,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI dmesg dumpon \ encswap \ faith fsck ftp-proxy ftpd \ - gbde geli geli2 gssd \ + gbde geli geli2 gptboot gssd \ hastd hcsecd \ hostapd hostid hostid_save hostname \ inetd initrandom \ Added: head/etc/rc.d/gptboot ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/gptboot Fri Sep 24 19:53:55 2010 (r213137) @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Copyright (c) 2010 Pawel Jakub Dawidek +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# PROVIDE: gptboot +# REQUIRE: mountcritremote +# KEYWORD: nojail + +. /etc/rc.subr + +name="gptboot" +start_cmd="gptboot_report" + +gptboot_report() +{ + gpart show | \ + egrep '(^=>| freebsd-ufs .*(\[|,)(bootfailed|bootonce)(,|\]))' | \ + sed 's/^=>//' | \ + egrep -v '(\[|,)bootme(,|\])' | \ + while read start size pos type attrs rest; do + case "${pos}" in + [0-9]*) + if [ -n "${disk}" ]; then + part="${disk}p${pos}" + echo "${attrs}" | egrep -q '(\[|,)bootfailed(,|\])' + bootfailed=$? + echo "${attrs}" | egrep -q '(\[|,)bootonce(,|\])' + bootonce=$? + if [ ${bootfailed} -eq 0 ]; then + logger -t gptboot -p local0.notice "Boot from ${part} failed." + gpart unset -a bootfailed -i ${pos} ${disk} >/dev/null + elif [ ${bootonce} -eq 0 ]; then + # We want to log success after all failures. + echo -n "Boot from ${part} succeeded." + gpart unset -a bootonce -i ${pos} ${disk} >/dev/null + fi + fi + ;; + *) + if [ "${type}" = "GPT" ]; then + disk="${pos}" + else + disk="" + fi + ;; + esac + done | logger -t gptboot -p local0.notice +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 20:29:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D7131065670 for ; Fri, 24 Sep 2010 20:29:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 286F88FC1E for ; Fri, 24 Sep 2010 20:29:20 +0000 (UTC) Received: (qmail 7118 invoked by uid 399); 24 Sep 2010 20:29:19 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 24 Sep 2010 20:29:19 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C9D0A1F.7050804@FreeBSD.org> Date: Fri, 24 Sep 2010 13:29:19 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: John Baldwin References: <20100922222441.00002f27@unknown> <20100923.203143.19192035494300157.imp@bsdimp.com> <1285297884.17619.17.camel@neo.cse.buffalo.edu> <201009240923.04406.jhb@freebsd.org> In-Reply-To: <201009240923.04406.jhb@freebsd.org> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: bruce@cran.org.uk, src-committers@freebsd.org, Ken Smith , svn-src-all@freebsd.org, avg@freebsd.org, gavin@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 20:29:21 -0000 On 9/24/2010 6:23 AM, John Baldwin wrote: > The biggest argument against this (and the reason I always enable crashdumps > on all machines I am involved with) is that many panics are not easily > reproducible, esp. ones that trigger under load. If dumpdev is not on by > default, then the info from a rare or hard-to-trigger bug may simply be lost. > Also, "just send-pr or mail the 'foo' file" is even simpler than "enable this > knob in rc.conf and reproduce your issue, then come back". I agree with John, and the others who have expressed similar sentiments. All of the technical problems that prevent this have solutions, particularly if Y! is willing to donate the patch that prevents multiple dumps from filling the disk. FWIW, Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 20:52:58 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECFC9106567A; Fri, 24 Sep 2010 20:52:57 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 61CF58FC26; Fri, 24 Sep 2010 20:52:57 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 2BD8BA686DE; Sat, 25 Sep 2010 04:52:56 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id PBM1M1F1uc+G; Sat, 25 Sep 2010 04:52:50 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 8B932A6868C; Sat, 25 Sep 2010 04:52:47 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=vNXUaZg8IzHzj993UsfNi7RTztzGjA+RRGhLWPbUW/FaMlojN8LGTHCgRx20/lsze 5GUzJl7Yjzoif0gvGfk3w== Message-ID: <4C9D0F9C.1020607@delphij.net> Date: Fri, 24 Sep 2010 13:52:44 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.12) Gecko/20100920 Thunderbird/3.0.8 ThunderBrowse/3.3.2 MIME-Version: 1.0 To: "M. Warner Losh" References: <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> <20100923.203143.19192035494300157.imp@bsdimp.com> In-Reply-To: <20100923.203143.19192035494300157.imp@bsdimp.com> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: bruce@cran.org.uk, src-committers@FreeBSD.ORG, kensmith@buffalo.edu, jhb@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, avg@FreeBSD.ORG, gavin@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 20:52:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010/09/23 19:31, M. Warner Losh wrote: > In message: > Gavin Atkinson writes: > : On Thu, 23 Sep 2010, Ken Smith wrote: > : > The issues talked about so far all contribute to the reason for that. > : > But one of the more basic gut reactions to it all is that the users > : > want to be interested in helping with the debugging (even if just > : > providing the requested info) for any sort of crash information > : > to be useful. And at the point we shift something from -current > : > to -stable the percentage of people actively interested in participating > : > in that sort of stuff flip. The bulk of people using -current > : > know it's risky and they do it out of some interest in debugging > : > stuff. The *bulk* of people using -stable are less interested or > : > flat out not interested. And have no clue what crash dumps are, > : > may be challenged to notice partition-getting-full issues, etc. > : > : I'm not sure I buy this argument, I'm afraid. Part of the advantage of > : having all this done automatically on the as-shipped release media is that > : end users don't have to be interested in debugging - crashinfo(8) does > : most of the work for them. There's no easy way to actually determine > : figures, but even if say only 10-15% of crashes can be diagnosed and > : corrected just from the output of crashinfo(8) then that's a huge win for > : the project as a whole. I'm guessing 10-15% is not unrealistic. > : > : I appreciate the issue about filling partitions is a valid one. Would a > : possible compromise be that on release media, crashinfo(8) or similar will > : default to only keeping the most recent coredump or similar? Given /var > : now defaults to 4GB, Defaulting to keeping a single core is probably > : acceptable. > > Furthermore, if we aren't interested in crash dumps by default, why do > we install the huge .symbols files? +1. Even textdump would be a huge help for the project (except it depends on KDB/DDB which should be considered more thoroughly due to security consequences). Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJMnQ+cAAoJEATO+BI/yjfBv+gH/27HC9fRFNlYh28YypZFjK/K FWKed15ZK+kR8pAvpONibBY/yWAWzsYyCxADn0q2aGAYItukQkonZnTWAQTbcbaG d4begzGOrr9xWRYbIar8VvLM7mlUu99FNVkscFMsNvkD6mMP7N6MB9SNnqg/yRSo jbSUceIkASnZni0poHoAKCpBJsPu2Yt/XnBXhbtR6tzHiWZKqKMCm5yfDHvH0+Cw kNcR6jInnGJk8f2qk2a6h2Qtu6/R9vwkmidtBCX7CLba07yRHP/cgjiAN79AgnKx 7AHw5ZCItGJMjyGukuc1eSBPJluzmTRXwhzZt+zbTB5He3gWe78jRkylDoj0qMw= =TtpC -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 21:23:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E9F2106566C; Fri, 24 Sep 2010 21:23:23 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 730808FC13; Fri, 24 Sep 2010 21:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8OLNNXP040138; Fri, 24 Sep 2010 21:23:23 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8OLNN1A040136; Fri, 24 Sep 2010 21:23:23 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009242123.o8OLNN1A040136@svn.freebsd.org> From: Juli Mallett Date: Fri, 24 Sep 2010 21:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213140 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 21:23:23 -0000 Author: jmallett Date: Fri Sep 24 21:23:23 2010 New Revision: 213140 URL: http://svn.freebsd.org/changeset/base/213140 Log: Make the vast majority of Simple Executive files standard. Perhaps some of these could be made dependent on either of the octusb or octe options, but making them standard fixes a number of option combinations that were previously broken. Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Fri Sep 24 20:08:59 2010 (r213139) +++ head/sys/mips/cavium/files.octeon1 Fri Sep 24 21:23:23 2010 (r213140) @@ -39,30 +39,29 @@ mips/cavium/octopci_bus_space.c option mips/cavium/usb/octusb.c optional usb octusb mips/cavium/usb/octusb_octeon.c optional usb octusb -contrib/octeon-sdk/cvmx-cmd-queue.c optional octe -contrib/octeon-sdk/cvmx-fpa.c optional octe -contrib/octeon-sdk/cvmx-helper.c optional octe -contrib/octeon-sdk/cvmx-helper-board.c optional octe -contrib/octeon-sdk/cvmx-helper-errata.c optional octe -contrib/octeon-sdk/cvmx-helper-fpa.c optional octe -contrib/octeon-sdk/cvmx-helper-loop.c optional octe -contrib/octeon-sdk/cvmx-helper-npi.c optional octe -contrib/octeon-sdk/cvmx-helper-rgmii.c optional octe -contrib/octeon-sdk/cvmx-helper-sgmii.c optional octe -contrib/octeon-sdk/cvmx-helper-spi.c optional octe -contrib/octeon-sdk/cvmx-helper-util.c optional octe -contrib/octeon-sdk/cvmx-helper-xaui.c optional octe -contrib/octeon-sdk/cvmx-pko.c optional octe -contrib/octeon-sdk/cvmx-spi.c optional octe -contrib/octeon-sdk/cvmx-spi4000.c optional octe -contrib/octeon-sdk/cvmx-twsi.c optional octe - contrib/octeon-sdk/cvmx-usb.c optional octusb # XXX Some files could be excluded in some configurations. Making them # optional but on in the default config would seem reasonable. +contrib/octeon-sdk/cvmx-cmd-queue.c standard contrib/octeon-sdk/cvmx-bootmem.c standard +contrib/octeon-sdk/cvmx-fpa.c standard +contrib/octeon-sdk/cvmx-helper.c standard +contrib/octeon-sdk/cvmx-helper-board.c standard +contrib/octeon-sdk/cvmx-helper-errata.c standard +contrib/octeon-sdk/cvmx-helper-fpa.c standard +contrib/octeon-sdk/cvmx-helper-loop.c standard +contrib/octeon-sdk/cvmx-helper-npi.c standard +contrib/octeon-sdk/cvmx-helper-rgmii.c standard +contrib/octeon-sdk/cvmx-helper-sgmii.c standard +contrib/octeon-sdk/cvmx-helper-spi.c standard +contrib/octeon-sdk/cvmx-helper-util.c standard +contrib/octeon-sdk/cvmx-helper-xaui.c standard +contrib/octeon-sdk/cvmx-pko.c standard +contrib/octeon-sdk/cvmx-spi.c standard +contrib/octeon-sdk/cvmx-spi4000.c standard contrib/octeon-sdk/cvmx-sysinfo.c standard contrib/octeon-sdk/cvmx-thunder.c standard +contrib/octeon-sdk/cvmx-twsi.c standard contrib/octeon-sdk/cvmx-warn.c standard contrib/octeon-sdk/octeon-model.c standard From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 23:50:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4759F1065670; Fri, 24 Sep 2010 23:50:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0307F8FC15; Fri, 24 Sep 2010 23:50:00 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D12C21FFC34; Fri, 24 Sep 2010 23:49:59 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id ABD198452F; Sat, 25 Sep 2010 01:49:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <201009160756.o8G7uZrg065332@svn.freebsd.org> <20100924115311.GH34228@deviant.kiev.zoral.com.ua> Date: Sat, 25 Sep 2010 01:49:59 +0200 In-Reply-To: <20100924115311.GH34228@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Fri, 24 Sep 2010 14:53:11 +0300") Message-ID: <86d3s2og60.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, pluknet , src-committers@freebsd.org Subject: Re: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 23:50:01 -0000 Kostik Belousov writes: > This is easy to fix, isn't it ? But there seems to be much more nits. > > First, allocating 512 * sizeof(char *)-byte object on the stack is not > good. > > Second, the initialization of iov_len for reading the array > of string pointers misses '* sizeof(char *)'. > > And third (probably fatal) is the lack of checks that the end of > array and each string fits into the user portion of the map. I do not > see why addr that already has u_long type is casted to u_long. Also, > VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS constants are for the native host > FreeBSD ABI, they may differ from the target process limits. Blah, I clearly didn't look closely enough at the final version. The original patch used malloc() but introduced a potential race condition due to having to drop the process lock. I wrote a version that used _PHOLD() / _PRELE() to hold the process across the unlock / malloc / lock window, but the originator had trouble with it (albeit only in qemu, not on real hardware), and I wasn't 100% sure my reasoning was sound, so I accepted his suggested solution. I'll look into this tomorrow. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Sep 24 23:54:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD602106564A; Fri, 24 Sep 2010 23:54:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC3D88FC12; Fri, 24 Sep 2010 23:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ONs3kM043353; Fri, 24 Sep 2010 23:54:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ONs34F043351; Fri, 24 Sep 2010 23:54:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009242354.o8ONs34F043351@svn.freebsd.org> From: Marius Strobl Date: Fri, 24 Sep 2010 23:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213147 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2010 23:54:03 -0000 Author: marius Date: Fri Sep 24 23:54:03 2010 New Revision: 213147 URL: http://svn.freebsd.org/changeset/base/213147 Log: Take mpt_req_on_{free,pending}_list() out from under INVARIANTS as these are generally useful and not just for debugging. Modified: head/sys/dev/mpt/mpt.h Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Fri Sep 24 23:51:45 2010 (r213146) +++ head/sys/dev/mpt/mpt.h Fri Sep 24 23:54:03 2010 (r213147) @@ -1157,19 +1157,13 @@ mpt_tag_2_req(struct mpt_softc *mpt, uin KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer")); return (mpt->tgt_cmd_ptrs[rtg]); } - +#endif static __inline int mpt_req_on_free_list(struct mpt_softc *, request_t *); static __inline int mpt_req_on_pending_list(struct mpt_softc *, request_t *); -static __inline void -mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); -static __inline void -mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); - - /* * Is request on freelist? */ @@ -1202,6 +1196,12 @@ mpt_req_on_pending_list(struct mpt_softc return (0); } +#ifdef INVARIANTS +static __inline void +mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); +static __inline void +mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); + /* * Make sure that req *is* part of one of the special lists */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 00:55:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC9F41065674; Sat, 25 Sep 2010 00:55:13 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3328FC1A; Sat, 25 Sep 2010 00:55:13 +0000 (UTC) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8OMrupM023521; Sat, 25 Sep 2010 08:53:56 +1000 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8OMrqa2005695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Sep 2010 08:53:53 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o8OMrqmq022394; Sat, 25 Sep 2010 08:53:52 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o8OMrqoq022393; Sat, 25 Sep 2010 08:53:52 +1000 (EST) (envelope-from peter) Date: Sat, 25 Sep 2010 08:53:52 +1000 From: Peter Jeremy To: freebsd-arch@freebsd.org Message-ID: <20100924225352.GD49476@server.vk2pj.dyndns.org> References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 00:55:13 -0000 --8w3uRX/HFJGApMzv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Pruning CC list and re-adding freebsd-arch on the (forlorn) hope that this thread will move to where it belongs] On 2010-Sep-23 07:31:13 -0700, Matthew Jacob wrote: >It turns out that the big issue here was more the savecore time coming=20 >back up rather than the time of dumping. In my experience, the problem isn't so much the savecore time as the time to run /usr/bin/crashinfo. Whilst savecore needs to run early (before anything tramples on the crashdump in swap), the latter could run at any time. It would seem reasonable to either run crashinfo in the background or as a batchjob triggered by /etc/rc.d/savecore. On 2010-Sep-23 18:59:53 +0100, Gavin Atkinson wrote: >I appreciate the issue about filling partitions is a valid one. Would a= =20 >possible compromise be that on release media, crashinfo(8) or similar will= =20 >default to only keeping the most recent coredump or similar? Given /var= =20 >now defaults to 4GB, Defaulting to keeping a single core is probably=20 >acceptable. savecore already has support for a 'minfree' file to prevent crashdumps filling the crashdir. Maybe the default install should include a minfree set to (say) 512MB. --=20 Peter Jeremy --8w3uRX/HFJGApMzv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkydLAAACgkQ/opHv/APuIeBZwCgrPXGmE7tyoHtpXnxO14kZa9q ezAAoIqq9p9cKpm2pD4gHQbBqSEWcATJ =tjph -----END PGP SIGNATURE----- --8w3uRX/HFJGApMzv-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 01:18:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84A3106564A; Sat, 25 Sep 2010 01:18:01 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5D4B8FC17; Sat, 25 Sep 2010 01:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P1I1Wj045194; Sat, 25 Sep 2010 01:18:01 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P1I1La045188; Sat, 25 Sep 2010 01:18:01 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009250118.o8P1I1La045188@svn.freebsd.org> From: Juli Mallett Date: Sat, 25 Sep 2010 01:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213150 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 01:18:01 -0000 Author: jmallett Date: Sat Sep 25 01:18:01 2010 New Revision: 213150 URL: http://svn.freebsd.org/changeset/base/213150 Log: Handle link updates in a task. Modified: head/sys/mips/cavium/octe/cavium-ethernet.h head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/cavium-ethernet.h ============================================================================== --- head/sys/mips/cavium/octe/cavium-ethernet.h Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/cavium-ethernet.h Sat Sep 25 01:18:01 2010 (r213150) @@ -75,6 +75,8 @@ typedef struct { struct ifqueue tx_free_queue[16]; + int need_link_update; + struct task link_task; struct ifmedia media; int if_flags; Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rgmii.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Sat Sep 25 01:18:01 2010 (r213150) @@ -136,27 +136,8 @@ static void cvm_oct_rgmii_poll(struct if link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; + priv->need_link_update = 1; mtx_unlock_spin(&global_register_lock); - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); - } else { - - if_link_state_change(ifp, LINK_STATE_DOWN); - DEBUGPRINT("%s: Link down\n", if_name(ifp)); - } } Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Sat Sep 25 01:18:01 2010 (r213150) @@ -93,25 +93,7 @@ static void cvm_oct_sgmii_poll(struct if link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); - } else { - if_link_state_change(ifp, LINK_STATE_DOWN); - DEBUGPRINT("%s: Link down\n", if_name(ifp)); - } + priv->need_link_update = 1; } int cvm_oct_sgmii_init(struct ifnet *ifp) Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Sat Sep 25 01:18:01 2010 (r213150) @@ -92,25 +92,7 @@ static void cvm_oct_xaui_poll(struct ifn link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); - } else { - if_link_state_change(ifp, LINK_STATE_DOWN); - DEBUGPRINT("%s: Link down\n", if_name(ifp)); - } + priv->need_link_update = 1; } Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet.c Sat Sep 25 01:18:01 2010 (r213150) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -129,6 +130,40 @@ static struct callout cvm_oct_poll_timer */ struct ifnet *cvm_oct_device[TOTAL_NUMBER_OF_PORTS]; +/** + * Task to handle link status changes. + */ +static struct taskqueue *cvm_oct_link_taskq; + +/** + * Function to update link status. + */ +static void cvm_oct_update_link(void *context, int pending) +{ + cvm_oct_private_t *priv = (cvm_oct_private_t *)context; + struct ifnet *ifp = priv->ifp; + cvmx_helper_link_info_t link_info; + + link_info.u64 = priv->link_info; + + if (link_info.s.link_up) { + if_link_state_change(ifp, LINK_STATE_UP); + if (priv->queue != -1) + DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", + if_name(ifp), link_info.s.speed, + (link_info.s.full_duplex) ? "Full" : "Half", + priv->port, priv->queue); + else + DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", + if_name(ifp), link_info.s.speed, + (link_info.s.full_duplex) ? "Full" : "Half", + priv->port); + } else { + if_link_state_change(ifp, LINK_STATE_DOWN); + DEBUGPRINT("%s: Link down\n", if_name(ifp)); + } + priv->need_link_update = 0; +} /** * Periodic timer tick for slow management operations @@ -149,6 +184,10 @@ static void cvm_do_timer(void *arg) if (MDIO_TRYLOCK()) { priv->poll(cvm_oct_device[port]); MDIO_UNLOCK(); + + if (priv->need_link_update) { + taskqueue_enqueue(cvm_oct_link_taskq, &priv->link_task); + } } } @@ -323,6 +362,11 @@ int cvm_oct_init_module(device_t bus) memset(cvm_oct_device, 0, sizeof(cvm_oct_device)); + cvm_oct_link_taskq = taskqueue_create("octe link", M_NOWAIT, + taskqueue_thread_enqueue, &cvm_oct_link_taskq); + taskqueue_start_threads(&cvm_oct_link_taskq, 1, PI_NET, + "octe link taskq"); + /* Initialize the FAU used for counting packet buffers that need to be freed */ cvmx_fau_atomic_write32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); @@ -345,6 +389,7 @@ int cvm_oct_init_module(device_t bus) priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED; priv->port = CVMX_PIP_NUM_INPUT_PORTS; priv->queue = -1; + TASK_INIT(&priv->link_task, 0, cvm_oct_update_link, priv); device_set_desc(dev, "Cavium Octeon POW Ethernet\n"); @@ -398,6 +443,7 @@ int cvm_oct_init_module(device_t bus) priv->fau = fau - cvmx_pko_get_num_queues(port) * 4; for (qos = 0; qos < cvmx_pko_get_num_queues(port); qos++) cvmx_fau_atomic_write32(priv->fau+qos*4, 0); + TASK_INIT(&priv->link_task, 0, cvm_oct_update_link, priv); switch (priv->imode) { From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 01:57:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 738961065674; Sat, 25 Sep 2010 01:57:47 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 606DE8FC0C; Sat, 25 Sep 2010 01:57:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P1vlth046058; Sat, 25 Sep 2010 01:57:47 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P1vlb2046043; Sat, 25 Sep 2010 01:57:47 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250157.o8P1vlb2046043@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 01:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213153 - in head/lib: libc libc/gen libc/include librt libthr libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 01:57:47 -0000 Author: davidxu Date: Sat Sep 25 01:57:47 2010 New Revision: 213153 URL: http://svn.freebsd.org/changeset/base/213153 Log: To support stack unwinding for cancellation points, add -fexceptions flag for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellation point, it also makes it possible that other functions can be cancellation points in libraries without having to be rewritten in libthr. Modified: head/lib/libc/Makefile head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/_pthread_stubs.c head/lib/libc/gen/sem.c head/lib/libc/gen/sem_new.c head/lib/libc/include/libc_private.h head/lib/librt/Makefile head/lib/librt/mq.c head/lib/libthr/Makefile head/lib/libthr/pthread.map head/lib/libthr/thread/thr_cancel.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/Makefile Sat Sep 25 01:57:47 2010 (r213153) @@ -31,6 +31,11 @@ CLEANFILES+=tags INSTALL_PIC_ARCHIVE= PRECIOUSLIB= +.ifndef NO_THREAD_STACK_UNWIND +CANCELPOINTS_CFLAGS=-fexceptions +CFLAGS+=${CANCELPOINTS_CFLAGS} +.endif + # # Only link with static libgcc.a (no libgcc_eh.a). # @@ -145,3 +150,5 @@ CWARNFLAGS:= ${.IMPSRC:Ngdtoa_*.c:C/^.+$ SSP_CFLAGS:= ${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/} # Disable stack protection for SSP symbols. SSP_CFLAGS:= ${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/} +# Generate stack unwinding tables for cancellation points +CANCELPOINTS_CFLAGS:= ${.IMPSRC:Mcancelpoints_*:C/^.+$/${CANCELPOINTS_CFLAGS}/:C/^$//} Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/gen/Makefile.inc Sat Sep 25 01:57:47 2010 (r213153) @@ -25,7 +25,7 @@ SRCS+= __getosreldate.c __xuname.c \ pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pututxline.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ - scandir.c seed48.c seekdir.c sem.c sem_new.c semctl.c \ + scandir.c seed48.c seekdir.c semctl.c \ setdomainname.c sethostname.c setjmperr.c setmode.c \ setproctitle.c setprogname.c siginterrupt.c siglist.c signal.c \ sigsetops.c sleep.c srand48.c statvfs.c stringlist.c strtofflags.c \ @@ -35,6 +35,14 @@ SRCS+= __getosreldate.c __xuname.c \ usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \ wordexp.c +CANCELPOINTS_SRCS=sem.c sem_new.c +.for src in ${CANCELPOINTS_SRCS} +SRCS+=cancelpoints_${src} +CLEANFILES+=cancelpoints_${src} +cancelpoints_${src}: + ln -sf ${.CURDIR}/gen/${src} ${.TARGET} +.endfor + SYM_MAPS+=${.CURDIR}/gen/Symbol.map # machine-dependent gen sources Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/gen/Symbol.map Sat Sep 25 01:57:47 2010 (r213153) @@ -403,6 +403,8 @@ FBSDprivate_1.0 { _pthread_attr_setstackaddr; _pthread_attr_setstacksize; _pthread_cancel; + _pthread_cancel_enter; + _pthread_cancel_leave; _pthread_cleanup_pop; _pthread_cleanup_push; _pthread_cond_broadcast; Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/gen/_pthread_stubs.c Sat Sep 25 01:57:47 2010 (r213153) @@ -121,6 +121,8 @@ pthread_func_entry_t __thr_jtable[PJT_MA {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_TESTCANCEL */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP_IMP */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH_IMP */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_ENTER */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_LEAVE */ }; /* @@ -269,6 +271,8 @@ STUB_FUNC2(pthread_setcanceltype, PJT_SE STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int) STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *); +STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int) +STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int) static int stub_zero(void) Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/gen/sem.c Sat Sep 25 01:57:47 2010 (r213153) @@ -312,21 +312,6 @@ _libc_sem_unlink_compat(const char *name } static int -enable_async_cancel(void) -{ - int old; - - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); - return (old); -} - -static void -restore_async_cancel(int val) -{ - _pthread_setcanceltype(val, NULL); -} - -static int _umtx_wait_uint(volatile unsigned *mtx, unsigned id, const struct timespec *timeout) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && @@ -371,15 +356,15 @@ _libc_sem_timedwait_compat(sem_t * __res const struct timespec * __restrict abstime) { struct timespec ts, ts2; - int val, retval, saved_cancel; + int val, retval; if (sem_check_validity(sem) != 0) return (-1); if ((*sem)->syssem != 0) { - saved_cancel = enable_async_cancel(); - retval = ksem_wait((*sem)->semid); - restore_async_cancel(saved_cancel); + _pthread_cancel_enter(1); + retval = ksem_wait((*sem)->semid); /* XXX no timeout */ + _pthread_cancel_leave(retval == -1); return (retval); } @@ -390,8 +375,10 @@ _libc_sem_timedwait_compat(sem_t * __res if (atomic_cmpset_acq_int(&(*sem)->count, val, val - 1)) return (0); } - if (retval) + if (retval) { + _pthread_testcancel(); break; + } if (abstime) { if (abstime->tv_nsec >= 1000000000 || abstime->tv_nsec < 0) { errno = EINVAL; @@ -402,9 +389,9 @@ _libc_sem_timedwait_compat(sem_t * __res } atomic_add_int(&(*sem)->nwaiters, 1); pthread_cleanup_push(sem_cancel_handler, sem); - saved_cancel = enable_async_cancel(); + _pthread_cancel_enter(1); retval = _umtx_wait_uint(&(*sem)->count, 0, abstime ? &ts2 : NULL); - restore_async_cancel(saved_cancel); + _pthread_cancel_leave(0); pthread_cleanup_pop(0); atomic_add_int(&(*sem)->nwaiters, -1); } Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/gen/sem_new.c Sat Sep 25 01:57:47 2010 (r213153) @@ -47,6 +47,7 @@ #include #include #include "un-namespace.h" +#include "libc_private.h" __weak_reference(_sem_close, sem_close); __weak_reference(_sem_destroy, sem_destroy); @@ -364,15 +365,6 @@ _sem_trywait(sem_t *sem) return (-1); } -static void -sem_cancel_handler(void *arg) -{ - sem_t *sem = arg; - - if (sem->_kern._has_waiters && sem->_kern._count) - usem_wake(&sem->_kern); -} - #define TIMESPEC_SUB(dst, src, val) \ do { \ (dst)->tv_sec = (src)->tv_sec - (val)->tv_sec; \ @@ -384,27 +376,12 @@ sem_cancel_handler(void *arg) } while (0) -static __inline int -enable_async_cancel(void) -{ - int old; - - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); - return (old); -} - -static __inline void -restore_async_cancel(int val) -{ - _pthread_setcanceltype(val, NULL); -} - int _sem_timedwait(sem_t * __restrict sem, const struct timespec * __restrict abstime) { struct timespec ts, ts2; - int val, retval, saved_cancel; + int val, retval; if (sem_check_validity(sem) != 0) return (-1); @@ -416,8 +393,10 @@ _sem_timedwait(sem_t * __restrict sem, return (0); } - if (retval) + if (retval) { + _pthread_testcancel(); break; + } /* * The timeout argument is only supposed to @@ -431,11 +410,9 @@ _sem_timedwait(sem_t * __restrict sem, clock_gettime(CLOCK_REALTIME, &ts); TIMESPEC_SUB(&ts2, abstime, &ts); } - pthread_cleanup_push(sem_cancel_handler, sem); - saved_cancel = enable_async_cancel(); + _pthread_cancel_enter(1); retval = usem_wait(&sem->_kern, abstime ? &ts2 : NULL); - restore_async_cancel(saved_cancel); - pthread_cleanup_pop(0); + _pthread_cancel_leave(0); } return (retval); } Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libc/include/libc_private.h Sat Sep 25 01:57:47 2010 (r213153) @@ -129,6 +129,8 @@ typedef enum { PJT_TESTCANCEL, PJT_CLEANUP_POP_IMP, PJT_CLEANUP_PUSH_IMP, + PJT_CANCEL_ENTER, + PJT_CANCEL_LEAVE, PJT_MAX } pjt_index_t; @@ -217,4 +219,7 @@ int _elf_aux_info(int aux, void *buf, in struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); +void _pthread_cancel_enter(int); +void _pthread_cancel_leave(int); + #endif /* _LIBC_PRIVATE_H_ */ Modified: head/lib/librt/Makefile ============================================================================== --- head/lib/librt/Makefile Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/librt/Makefile Sat Sep 25 01:57:47 2010 (r213153) @@ -3,14 +3,15 @@ LIB=rt SHLIB_MAJOR= 1 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} +.ifndef NO_THREAD_STACK_UNWIND +CFLAGS+=-fexceptions +.endif CFLAGS+=-Winline -Wall -g DPADD= ${LIBPTHREAD} LDADD= -lpthread WARNS?= 2 -#MAN= libthr.3 - SRCS+= aio.c mq.c sigev_thread.c timer.c PRECIOUSLIB= Modified: head/lib/librt/mq.c ============================================================================== --- head/lib/librt/mq.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/librt/mq.c Sat Sep 25 01:57:47 2010 (r213153) @@ -39,6 +39,7 @@ #include #include "sigev_thread.h" #include "un-namespace.h" +#include "libc_private.h" extern int __sys_kmq_notify(int, const struct sigevent *); extern int __sys_kmq_open(const char *, int, mode_t, @@ -200,12 +201,11 @@ ssize_t __mq_timedreceive_cancel(mqd_t mqd, char *buf, size_t len, unsigned *prio, const struct timespec *timeout) { - int oldtype; int ret; - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype); + _pthread_cancel_enter(1); ret = __sys_kmq_timedreceive(mqd->oshandle, buf, len, prio, timeout); - _pthread_setcanceltype(oldtype, NULL); + _pthread_cancel_leave(ret == -1); return (ret); } @@ -219,12 +219,11 @@ __mq_receive(mqd_t mqd, char *buf, size_ ssize_t __mq_receive_cancel(mqd_t mqd, char *buf, size_t len, unsigned *prio) { - int oldtype; int ret; - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype); + _pthread_cancel_enter(1); ret = __sys_kmq_timedreceive(mqd->oshandle, buf, len, prio, NULL); - _pthread_setcanceltype(oldtype, NULL); + _pthread_cancel_leave(ret == -1); return (ret); } ssize_t @@ -239,12 +238,11 @@ ssize_t __mq_timedsend_cancel(mqd_t mqd, char *buf, size_t len, unsigned prio, const struct timespec *timeout) { - int oldtype; int ret; - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype); + _pthread_cancel_enter(1); ret = __sys_kmq_timedsend(mqd->oshandle, buf, len, prio, timeout); - _pthread_setcanceltype(oldtype, NULL); + _pthread_cancel_leave(ret == -1); return (ret); } @@ -259,12 +257,11 @@ __mq_send(mqd_t mqd, char *buf, size_t l ssize_t __mq_send_cancel(mqd_t mqd, char *buf, size_t len, unsigned prio) { - int oldtype; int ret; - _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype); + _pthread_cancel_enter(1); ret = __sys_kmq_timedsend(mqd->oshandle, buf, len, prio, NULL); - _pthread_setcanceltype(oldtype, NULL); + _pthread_cancel_leave(ret == -1); return (ret); } Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libthr/Makefile Sat Sep 25 01:57:47 2010 (r213153) @@ -26,9 +26,7 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline -LIBTHR_UNWIND_STACK=yes - -.ifdef LIBTHR_UNWIND_STACK +.ifndef NO_THREAD_UNWIND_STACK CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions CFLAGS+=-D_PTHREAD_FORCED_UNWIND .endif Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libthr/pthread.map Sat Sep 25 01:57:47 2010 (r213153) @@ -246,6 +246,8 @@ FBSDprivate_1.0 { _pthread_attr_setstackaddr; _pthread_attr_setstacksize; _pthread_cancel; + _pthread_cancel_enter; + _pthread_cancel_leave; _pthread_cleanup_pop; _pthread_cleanup_push; _pthread_cond_broadcast; Modified: head/lib/libthr/thread/thr_cancel.c ============================================================================== --- head/lib/libthr/thread/thr_cancel.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libthr/thread/thr_cancel.c Sat Sep 25 01:57:47 2010 (r213153) @@ -162,3 +162,15 @@ _thr_cancel_leave(struct pthread *curthr !THR_IN_CRITICAL(curthread) && maycancel)) _pthread_exit(PTHREAD_CANCELED); } + +void +_pthread_cancel_enter(int maycancel) +{ + _thr_cancel_enter2(_get_curthread(), maycancel); +} + +void +_pthread_cancel_leave(int maycancel) +{ + _thr_cancel_leave(_get_curthread(), maycancel); +} Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libthr/thread/thr_init.c Sat Sep 25 01:57:47 2010 (r213153) @@ -248,7 +248,9 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ {DUAL_ENTRY(_pthread_testcancel)}, /* PJT_TESTCANCEL */ {DUAL_ENTRY(__pthread_cleanup_pop_imp)},/* PJT_CLEANUP_POP_IMP */ - {DUAL_ENTRY(__pthread_cleanup_push_imp)}/* PJT_CLEANUP_PUSH_IMP */ + {DUAL_ENTRY(__pthread_cleanup_push_imp)},/* PJT_CLEANUP_PUSH_IMP */ + {DUAL_ENTRY(_pthread_cancel_enter)}, /* PJT_CANCEL_ENTER */ + {DUAL_ENTRY(_pthread_cancel_leave)} /* PJT_CANCEL_LEAVE */ }; static int init_once = 0; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sat Sep 25 01:25:48 2010 (r213152) +++ head/lib/libthr/thread/thr_private.h Sat Sep 25 01:57:47 2010 (r213153) @@ -716,7 +716,8 @@ int _sched_yield(void); void _pthread_cleanup_push(void (*)(void *), void *); void _pthread_cleanup_pop(int); void _pthread_exit_mask(void *status, sigset_t *mask) __dead2 __hidden; - +void _pthread_cancel_enter(int maycancel); +void _pthread_cancel_leave(int maycancel); /* #include */ #ifdef _SYS_FCNTL_H_ From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 03:45:50 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC6E106566B; Sat, 25 Sep 2010 03:45:50 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 95B1D8FC17; Sat, 25 Sep 2010 03:45:50 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id D78137E853; Sat, 25 Sep 2010 13:45:48 +1000 (EST) Message-ID: <4C9D7068.2010100@freebsd.org> Date: Sat, 25 Sep 2010 13:45:44 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.9) Gecko/20100913 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: Marius Strobl References: <201009241640.o8OGelKS031911@svn.freebsd.org> In-Reply-To: <201009241640.o8OGelKS031911@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213105 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 03:45:51 -0000 Hi Marius, On 09/25/10 02:40, Marius Strobl wrote: > Author: marius > Date: Fri Sep 24 16:40:46 2010 > New Revision: 213105 > URL: http://svn.freebsd.org/changeset/base/213105 > > Log: > Improve r56796; the reply handler actually may remove the request from > the chain in which case it shouldn't be removed twice. > Reported by: Staale Kristoffersen Can you please provide a bit of extra commentary about the symptoms of the issue this patch addresses? Like Staale, I'm running a FreeBSD server which uses mpt for its disk subsystem (SunFire X4100 with 2 x SATA 2.5" disks in RAID-1) and I've had a series of long running problems with the performance of the controller. I'm keeping a close eye on all mpt related commits and hope to find the cause sometime. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:20:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2BC31065695; Sat, 25 Sep 2010 04:20:08 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 507BA8FC08; Sat, 25 Sep 2010 04:20:07 +0000 (UTC) Received: from ur.dons.net.au (ppp121-45-158-72.lns6.adl6.internode.on.net [121.45.158.72]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o8P4JqNv090233 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 25 Sep 2010 13:49:58 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20100924225352.GD49476@server.vk2pj.dyndns.org> Date: Sat, 25 Sep 2010 13:49:52 +0930 Content-Transfer-Encoding: 7bit Message-Id: References: <201009211507.o8LF7iVv097676@svn.freebsd.org> <4C9A1602.4020204@freebsd.org> <1285169017.64197.29.camel@buffy.york.ac.uk> <201009221558.27393.jhb@freebsd.org> <4C9A6EE6.5050301@freebsd.org> <20100922222441.00002f27@unknown> <1285253887.95760.33.camel@bauer.cse.buffalo.edu> <20100924225352.GD49476@server.vk2pj.dyndns.org> To: Peter Jeremy X-Mailer: Apple Mail (2.1081) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: svn commit: r212964 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:20:08 -0000 On 25/09/2010, at 8:23, Peter Jeremy wrote: > savecore already has support for a 'minfree' file to prevent > crashdumps filling the crashdir. Maybe the default install should > include a minfree set to (say) 512MB. Or perhaps add maxcount and set it to 1 as well as minfree at 512Mb. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:21:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3E06106564A; Sat, 25 Sep 2010 04:21:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B303B8FC14; Sat, 25 Sep 2010 04:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4LVSu049176; Sat, 25 Sep 2010 04:21:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4LVVh049174; Sat, 25 Sep 2010 04:21:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250421.o8P4LVVh049174@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 04:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213154 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:21:31 -0000 Author: davidxu Date: Sat Sep 25 04:21:31 2010 New Revision: 213154 URL: http://svn.freebsd.org/changeset/base/213154 Log: Simplify code, and in while loop, fix operator to match the unwinding direction. Modified: head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sat Sep 25 01:57:47 2010 (r213153) +++ head/lib/libthr/thread/thr_exit.c Sat Sep 25 04:21:31 2010 (r213154) @@ -140,17 +140,14 @@ thread_unwind_stop(int version, _Unwind_ /* XXX assume stack grows down to lower address */ cfa = _Unwind_GetCFA(context); - if (actions & _UA_END_OF_STACK) { - done = 1; - } else if (cfa >= (uintptr_t)curthread->unwind_stackend) { + if (actions & _UA_END_OF_STACK || + cfa >= (uintptr_t)curthread->unwind_stackend) { done = 1; } while ((cur = curthread->cleanup) != NULL && - (done || - ((uintptr_t)cur < (uintptr_t)curthread->unwind_stackend && - (uintptr_t)cur >= cfa))) { - __pthread_cleanup_pop_imp(1); + (done || (uintptr_t)cur <= cfa)) { + __pthread_cleanup_pop_imp(1); } if (done) From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:26:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768C2106566B; Sat, 25 Sep 2010 04:26:40 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 645DB8FC0C; Sat, 25 Sep 2010 04:26:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4QeBI049387; Sat, 25 Sep 2010 04:26:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4QeDZ049378; Sat, 25 Sep 2010 04:26:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250426.o8P4QeDZ049378@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 04:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213155 - head/tools/regression/pthread/unwind X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:26:40 -0000 Author: davidxu Date: Sat Sep 25 04:26:40 2010 New Revision: 213155 URL: http://svn.freebsd.org/changeset/base/213155 Log: Add test cases for stack unwinding. Added: head/tools/regression/pthread/unwind/ head/tools/regression/pthread/unwind/Makefile (contents, props changed) head/tools/regression/pthread/unwind/Test.cpp (contents, props changed) head/tools/regression/pthread/unwind/catch_pthread_exit.cpp (contents, props changed) head/tools/regression/pthread/unwind/cond_wait_cancel.cpp (contents, props changed) head/tools/regression/pthread/unwind/cond_wait_cancel2.cpp (contents, props changed) head/tools/regression/pthread/unwind/main_thread_exit.cpp (contents, props changed) head/tools/regression/pthread/unwind/sem_wait_cancel.cpp (contents, props changed) head/tools/regression/pthread/unwind/thread_normal_exit.cpp (contents, props changed) Added: head/tools/regression/pthread/unwind/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/Makefile Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,17 @@ +# $FreeBSD$ +all: main_thread_exit thread_normal_exit sem_wait_cancel \ + cond_wait_cancel cond_wait_cancel2 catch_pthread_exit + +.cpp: + c++ -o $@ $< -lpthread + +main_thread_exit: main_thread_exit.cpp +thread_normal_exit: thread_normal_exit.cpp +sem_wait_cancel: sem_wait_cancel.cpp +cond_wait_cancel: cond_wait_cancel.cpp +cond_wait_cancel2: cond_wait_cancel2.cpp +catch_pthread_exit: catch_pthread_exit.cpp + +clean: .PHONY + rm -rf main_thread_exit thread_normal_exit sem_wait_cancel \ + cond_wait_cancel cond_wait_cancel2 catch_pthread_exit Added: head/tools/regression/pthread/unwind/Test.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/Test.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,37 @@ +/* $FreeBSD$ */ + +int destructed; +int destructed2; + +class Test { +public: + Test() { printf("Test::Test()\n"); } + ~Test() { printf("Test::~Test()\n"); destructed = 1; } +}; + +void +cleanup_handler(void *arg) +{ + destructed2 = 1; + printf("%s()\n", __func__); +} + +void +check_destruct(void) +{ + if (!destructed) + printf("Bug, object destructor is not called\n"); + else + printf("OK\n"); +} + +void +check_destruct2(void) +{ + if (!destructed) + printf("Bug, object destructor is not called\n"); + else if (!destructed2) + printf("Bug, cleanup handler is not called\n"); + else + printf("OK\n"); +} Added: head/tools/regression/pthread/unwind/catch_pthread_exit.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/catch_pthread_exit.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,35 @@ +/* $FreeBSD$ */ +/* try to catch thread exiting, and rethrow the exception */ + +#include +#include +#include + +int caught; + +void * +thr_routine(void *arg) +{ + try { + pthread_exit(NULL); + } catch (...) { + caught = 1; + printf("thread exiting exception caught\n"); + /* rethrow */ + throw; + } +} + +int +main() +{ + pthread_t td; + + pthread_create(&td, NULL, thr_routine, NULL); + pthread_join(td, NULL); + if (caught) + printf("OK\n"); + else + printf("failure\n"); + return (0); +} Added: head/tools/regression/pthread/unwind/cond_wait_cancel.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/cond_wait_cancel.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,39 @@ +/* $FreeBSD$ */ +/* Test stack unwinding for pthread_cond_wait function */ + +#include +#include +#include +#include + +#include "Test.cpp" + +pthread_mutex_t mtx; +pthread_cond_t cv; + +void * +thr(void *arg) +{ + Test t; + + pthread_mutex_lock(&mtx); + pthread_cond_wait(&cv, &mtx); + pthread_mutex_unlock(&mtx); + printf("Bug, thread shouldn't be here.\n"); + return (0); +} + +int +main() +{ + pthread_t td; + + pthread_mutex_init(&mtx, NULL); + pthread_cond_init(&cv, NULL); + pthread_create(&td, NULL, thr, NULL); + sleep(1); + pthread_cancel(td); + pthread_join(td, NULL); + check_destruct(); + return (0); +} Added: head/tools/regression/pthread/unwind/cond_wait_cancel2.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/cond_wait_cancel2.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,56 @@ +/* + * $FreeBSD$ + * + * Test stack unwinding for mixed pthread_cleanup_push/pop and C++ + * object, both should work together. + * + */ + +#include +#include +#include +#include + +#include "Test.cpp" + +pthread_mutex_t mtx; +pthread_cond_t cv; + +void f() +{ + Test t; + + pthread_mutex_lock(&mtx); + pthread_cond_wait(&cv, &mtx); + pthread_mutex_unlock(&mtx); + printf("Bug, thread shouldn't be here.\n"); +} + +void g() +{ + f(); +} + +void * +thr(void *arg) +{ + pthread_cleanup_push(cleanup_handler, NULL); + g(); + pthread_cleanup_pop(0); + return (0); +} + +int +main() +{ + pthread_t td; + + pthread_mutex_init(&mtx, NULL); + pthread_cond_init(&cv, NULL); + pthread_create(&td, NULL, thr, NULL); + sleep(1); + pthread_cancel(td); + pthread_join(td, NULL); + check_destruct2(); + return (0); +} Added: head/tools/regression/pthread/unwind/main_thread_exit.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/main_thread_exit.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,18 @@ +/* $FreeBSD$ */ +/* check unwinding for main thread */ + +#include +#include +#include + +#include "Test.cpp" + +int +main() +{ + Test test; + + atexit(check_destruct); + pthread_exit((void *)1); + return (0); +} Added: head/tools/regression/pthread/unwind/sem_wait_cancel.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/sem_wait_cancel.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,35 @@ +/* $FreeBSD$ */ +/* Test stack unwinding for libc's sem */ + +#include +#include +#include +#include + +#include "Test.cpp" + +sem_t sem; + +void * +thr(void *arg) +{ + Test t; + + sem_wait(&sem); + printf("Bug, thread shouldn't be here.\n"); + return (0); +} + +int +main() +{ + pthread_t td; + + sem_init(&sem, 0, 0); + pthread_create(&td, NULL, thr, NULL); + sleep(1); + pthread_cancel(td); + pthread_join(td, NULL); + check_destruct(); + return (0); +} Added: head/tools/regression/pthread/unwind/thread_normal_exit.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pthread/unwind/thread_normal_exit.cpp Sat Sep 25 04:26:40 2010 (r213155) @@ -0,0 +1,28 @@ +/* $FreeBSD$ */ +/* test stack unwinding for a new thread */ + +#include +#include +#include + +#include "Test.cpp" + +void * +thr_routine(void *arg) +{ + Test test; + + pthread_exit(NULL); + printf("Bug, thread shouldn't be here\n"); +} + +int +main() +{ + pthread_t td; + + pthread_create(&td, NULL, thr_routine, NULL); + pthread_join(td, NULL); + check_destruct(); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:39:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C94D106564A; Sat, 25 Sep 2010 04:39:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF7308FC18; Sat, 25 Sep 2010 04:39:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4dCAN049672; Sat, 25 Sep 2010 04:39:12 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4dCts049668; Sat, 25 Sep 2010 04:39:12 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009250439.o8P4dCts049668@svn.freebsd.org> From: Juli Mallett Date: Sat, 25 Sep 2010 04:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213156 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:39:13 -0000 Author: jmallett Date: Sat Sep 25 04:39:12 2010 New Revision: 213156 URL: http://svn.freebsd.org/changeset/base/213156 Log: o) Send mbufs to BPF listeners from within cvm_oct_xmit(). o) Pin receive threads when they're running since we do access some core-local resources. Modified: head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Sat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/ethernet-rx.c Sat Sep 25 04:39:12 2010 (r213156) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -167,7 +169,7 @@ static inline int cvm_oct_check_rcv_erro */ void cvm_oct_tasklet_rx(void *context, int pending) { - const int coreid = cvmx_get_core_num(); + int coreid; uint64_t old_group_mask; uint64_t old_scratch; int rx_count = 0; @@ -175,6 +177,9 @@ void cvm_oct_tasklet_rx(void *context, i int num_freed; int packet_not_copied; + sched_pin(); + coreid = cvmx_get_core_num(); + /* Prefetch cvm_oct_device since we know we need it soon */ CVMX_PREFETCH(cvm_oct_device, 0); @@ -388,6 +393,7 @@ void cvm_oct_tasklet_rx(void *context, i } } } + sched_unpin(); } Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Sat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/ethernet-tx.c Sat Sep 25 04:39:12 2010 (r213156) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -239,6 +240,9 @@ int cvm_oct_xmit(struct mbuf *m, struct } else { /* Put this packet on the queue to be freed later */ _IF_ENQUEUE(&priv->tx_free_queue[qos], m); + + /* Pass it to any BPF listeners. */ + ETHER_BPF_MTAP(ifp, m); } if (work != NULL) cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); Modified: head/sys/mips/cavium/octe/octe.c ============================================================================== --- head/sys/mips/cavium/octe/octe.c Sat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/octe.c Sat Sep 25 04:39:12 2010 (r213156) @@ -310,24 +310,6 @@ octe_start(struct ifnet *ifp) OCTE_TX_UNLOCK(priv); - /* - * XXX - * - * We may not be able to pass the mbuf up to BPF for one of - * two very good reasons: - * (1) immediately after our inserting it another CPU may be - * kind enough to free it for us. - * (2) m_collapse gets called on m and we don't get back the - * modified pointer. - * - * We have some options other than an m_dup route: - * (1) use a mutex or spinlock to prevent another CPU from - * freeing it. We could lock the tx_free_list's lock, - * that would make sense. - * (2) get back the new mbuf pointer. - * (3) do the collapse here. - */ - if (priv->queue != -1) { error = cvm_oct_xmit(m, ifp); } else { From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:41:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE26106566C; Sat, 25 Sep 2010 04:41:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80BD18FC12; Sat, 25 Sep 2010 04:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4fggJ049760; Sat, 25 Sep 2010 04:41:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4fgBL049757; Sat, 25 Sep 2010 04:41:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009250441.o8P4fgBL049757@svn.freebsd.org> From: Warner Losh Date: Sat, 25 Sep 2010 04:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213157 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:41:42 -0000 Author: imp Date: Sat Sep 25 04:41:42 2010 New Revision: 213157 URL: http://svn.freebsd.org/changeset/base/213157 Log: Remove clauses 3 and 4, per changes to NetBSD versions of these files. Modified: head/sys/ia64/include/_stdint.h head/sys/ia64/include/bus.h Modified: head/sys/ia64/include/_stdint.h ============================================================================== --- head/sys/ia64/include/_stdint.h Sat Sep 25 04:39:12 2010 (r213156) +++ head/sys/ia64/include/_stdint.h Sat Sep 25 04:41:42 2010 (r213157) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Sat Sep 25 04:39:12 2010 (r213156) +++ head/sys/ia64/include/bus.h Sat Sep 25 04:41:42 2010 (r213157) @@ -42,13 +42,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 04:58:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F92B106564A; Sat, 25 Sep 2010 04:58:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5958FC1C; Sat, 25 Sep 2010 04:58:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P4wkc9050128; Sat, 25 Sep 2010 04:58:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P4wk7m050124; Sat, 25 Sep 2010 04:58:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201009250458.o8P4wk7m050124@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 25 Sep 2010 04:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213158 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 04:58:47 -0000 Author: lstewart Date: Sat Sep 25 04:58:46 2010 New Revision: 213158 URL: http://svn.freebsd.org/changeset/base/213158 Log: Internalise reassembly queue related functionality and variables which should not be used outside of the reassembly queue implementation. Provide a new function to flush all segments from a reassembly queue and call it from the appropriate places instead of manipulating the queue directly. Sponsored by: FreeBSD Foundation Reviewed by: andre, gnn, rpaulo MFC after: 2 weeks Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sat Sep 25 04:41:42 2010 (r213157) +++ head/sys/netinet/tcp_reass.c Sat Sep 25 04:58:46 2010 (r213158) @@ -83,7 +83,8 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -VNET_DEFINE(int, tcp_reass_qsize) = 0; +static VNET_DEFINE(int, tcp_reass_qsize) = 0; +#define V_tcp_reass_qsize VNET(tcp_reass_qsize) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, "Global number of TCP Segments currently in Reassembly Queue"); @@ -100,6 +101,9 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); +static VNET_DEFINE(uma_zone_t, tcp_reass_zone); +#define V_tcp_reass_zone VNET(tcp_reass_zone) + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -109,8 +113,6 @@ tcp_reass_zone_change(void *tag) uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); } -VNET_DEFINE(uma_zone_t, tcp_reass_zone); - void tcp_reass_init(void) { @@ -134,6 +136,26 @@ tcp_reass_destroy(void) } #endif +void +tcp_reass_flush(struct tcpcb *tp) +{ + struct tseg_qent *qe; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + while ((qe = LIST_FIRST(&tp->t_segq)) != NULL) { + LIST_REMOVE(qe, tqe_q); + m_freem(qe->tqe_m); + uma_zfree(V_tcp_reass_zone, qe); + tp->t_segqlen--; + V_tcp_reass_qsize--; + } + + KASSERT((tp->t_segqlen == 0), + ("TCP reass queue %p segment count is %d instead of 0 after flush.", + tp, tp->t_segqlen)); +} + int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Sep 25 04:41:42 2010 (r213157) +++ head/sys/netinet/tcp_subr.c Sat Sep 25 04:58:46 2010 (r213158) @@ -714,7 +714,6 @@ tcp_drop(struct tcpcb *tp, int errno) void tcp_discardcb(struct tcpcb *tp) { - struct tseg_qent *q; struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; #ifdef INET6 @@ -801,13 +800,7 @@ tcp_discardcb(struct tcpcb *tp) } /* free the reassembly queue, if any */ - while ((q = LIST_FIRST(&tp->t_segq)) != NULL) { - LIST_REMOVE(q, tqe_q); - m_freem(q->tqe_m); - uma_zfree(V_tcp_reass_zone, q); - tp->t_segqlen--; - V_tcp_reass_qsize--; - } + tcp_reass_flush(tp); /* Disconnect offload device, if any. */ tcp_offload_detach(tp); @@ -865,7 +858,6 @@ tcp_drain(void) CURVNET_SET(vnet_iter); struct inpcb *inpb; struct tcpcb *tcpb; - struct tseg_qent *te; /* * Walk the tcpbs, if existing, and flush the reassembly queue, @@ -881,14 +873,7 @@ tcp_drain(void) continue; INP_WLOCK(inpb); if ((tcpb = intotcpcb(inpb)) != NULL) { - while ((te = LIST_FIRST(&tcpb->t_segq)) - != NULL) { - LIST_REMOVE(te, tqe_q); - m_freem(te->tqe_m); - uma_zfree(V_tcp_reass_zone, te); - tcpb->t_segqlen--; - V_tcp_reass_qsize--; - } + tcp_reass_flush(tcpb); tcp_clean_sackreport(tcpb); } INP_WUNLOCK(inpb); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sat Sep 25 04:41:42 2010 (r213157) +++ head/sys/netinet/tcp_var.h Sat Sep 25 04:58:46 2010 (r213158) @@ -44,10 +44,6 @@ VNET_DECLARE(int, tcp_do_rfc1323); #define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) -VNET_DECLARE(int, tcp_reass_qsize); -VNET_DECLARE(struct uma_zone *, tcp_reass_zone); -#define V_tcp_reass_qsize VNET(tcp_reass_qsize) -#define V_tcp_reass_zone VNET(tcp_reass_zone) #endif /* _KERNEL */ /* TCP segment queue entry */ @@ -617,6 +613,7 @@ char *tcp_log_vain(struct in_conninfo *, const void *); int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); void tcp_reass_init(void); +void tcp_reass_flush(struct tcpcb *); #ifdef VIMAGE void tcp_reass_destroy(void); #endif From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 06:27:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B2F0106564A; Sat, 25 Sep 2010 06:27:11 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98B358FC13; Sat, 25 Sep 2010 06:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P6R9x5052164; Sat, 25 Sep 2010 06:27:09 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P6R9wm052161; Sat, 25 Sep 2010 06:27:09 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250627.o8P6R9wm052161@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 06:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213159 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 06:27:11 -0000 Author: davidxu Date: Sat Sep 25 06:27:09 2010 New Revision: 213159 URL: http://svn.freebsd.org/changeset/base/213159 Log: Because old _pthread_cleanup_push/pop do not have frame address, it is incompatible with stack unwinding code, if they are invoked, disable stack unwinding for current thread, and when thread is exiting, print a warning message. Modified: head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_clean.c ============================================================================== --- head/lib/libthr/thread/thr_clean.c Sat Sep 25 04:58:46 2010 (r213158) +++ head/lib/libthr/thread/thr_clean.c Sat Sep 25 06:27:09 2010 (r213159) @@ -78,12 +78,10 @@ __pthread_cleanup_pop_imp(int execute) void _pthread_cleanup_push(void (*routine) (void *), void *arg) { -#ifdef _PTHREAD_FORCED_UNWIND - PANIC("_pthread_cleanup_push is not supported while stack unwinding is enabled."); -#else struct pthread *curthread = _get_curthread(); struct pthread_cleanup *newbuf; + curthread->unwind_disabled = 1; if ((newbuf = (struct pthread_cleanup *) malloc(sizeof(struct _pthread_cleanup_info))) != NULL) { newbuf->routine = routine; @@ -92,15 +90,10 @@ _pthread_cleanup_push(void (*routine) (v newbuf->prev = curthread->cleanup; curthread->cleanup = newbuf; } -#endif } void _pthread_cleanup_pop(int execute) { -#ifdef _PTHREAD_FORCED_UNWIND - PANIC("_pthread_cleanup_pop is not supported while stack unwinding is enabled."); -#else __pthread_cleanup_pop_imp(execute); -#endif } Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Sat Sep 25 04:58:46 2010 (r213158) +++ head/lib/libthr/thread/thr_exit.c Sat Sep 25 06:27:09 2010 (r213159) @@ -51,6 +51,7 @@ static void exit_thread(void) __dead2; __weak_reference(_pthread_exit, pthread_exit); #ifdef _PTHREAD_FORCED_UNWIND +static int message_printed; static void thread_unwind(void) __dead2; #ifdef PIC @@ -220,18 +221,28 @@ _pthread_exit_mask(void *status, sigset_ /* Save the return value: */ curthread->ret = status; #ifdef _PTHREAD_FORCED_UNWIND + #ifdef PIC thread_uw_init(); +#endif /* PIC */ + +#ifdef PIC if (uwl_forcedunwind != NULL) { - thread_unwind(); - } #else if (_Unwind_ForcedUnwind != NULL) { +#endif + if (curthread->unwind_disabled) { + if (message_printed == 0) { + message_printed = 1; + _thread_printf(2, "Warning: old _pthread_cleanup_push was called, " + "stack unwinding is disabled.\n"); + } + goto cleanup; + } thread_unwind(); - } -#endif /* PIC */ - else { + } else { +cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 07:44:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE4F106566B; Sat, 25 Sep 2010 07:44:01 +0000 (UTC) (envelope-from prvs=1877da73e7=brian@FreeBSD.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id B9DE78FC12; Sat, 25 Sep 2010 07:44:00 +0000 (UTC) Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 25 Sep 2010 01:28:59 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=p1E0FbcuapThhG57xomuiJdXW/Q5N45ug4AOcQEGw+Q= c=1 sm=1 a=9fUDse7kmeoA:10 a=BLceEmwcHowA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=2rIISSrIAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=tZ5SSJdqAAAA:8 a=MMwg4So0AAAA:8 a=Is3w3vBinDowOhLId8IA:9 a=YJJrZ7KLX9omRmu6FYf1f5WgLScA:4 a=CjuIK1q_8ugA:10 a=uLAUHSNMqMQA:10 a=SV7veod9ZcQA:10 a=MSl-tDqOz04A:10 a=WJ3hkfHDukgA:10 a=mSPrdAm9YTB95ttd-U4A:9 a=SWCM_PHe09QMmdD_lPsUWNtu_lYA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 25 Sep 2010 01:28:59 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id C2D45C433C1_C9DA4BAB; Sat, 25 Sep 2010 07:28:58 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 631A7C460FB_C9DA4B7F; Sat, 25 Sep 2010 07:28:55 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o8P7Ss0a006044; Sat, 25 Sep 2010 00:28:55 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Sat, 25 Sep 2010 00:28:45 -0700 From: Brian Somers To: Kirk McKusick Message-ID: <20100925002845.652e8bd0@dev.lan.Awfulhak.org> In-Reply-To: <201009241920.o8OJKPXk023192@chez.mckusick.com> References: <4C92DC2E.2020602@FreeBSD.org> <201009241920.o8OJKPXk023192@chez.mckusick.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Iiks/N/my8MI5m6+Ti3WsdW"; protocol="application/pgp-signature" Cc: "Carlos A. M. dos Santos" , svn-src-head@FreeBSD.org, Doug Barton Subject: Re: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 07:44:01 -0000 --Sig_/Iiks/N/my8MI5m6+Ti3WsdW Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 24 Sep 2010 12:20:25 -0700 Kirk McKusick wr= ote: > > Date: Thu, 16 Sep 2010 20:10:38 -0700 > > From: Doug Barton > > To: "Carlos A. M. dos Santos" > > CC: Brian Somers , Kirk McKusick , > > svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, > > src-committers@FreeBSD.org > > Subject: Re: svn commit: r212617 - head/sys/ufs/ffs > >=20 > > On 9/16/2010 7:29 PM, Carlos A. M. dos Santos wrote: > > > On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers wro= te: > > >> If INVARIANTS is not defined, the above i++ will not happen. > > > > > > Which does not cause any harm, since "i" is a local variable, not used > > > anywhere else in the function. A picky compiler would complain, > > > however, that the variable is never read. > >=20 > > If 'i' is only ever used in the INVARIANTS case then it should be=20 > > appropriately wrapped everywhere it appears. While the _current_=20 > > situation may be harmless, in the future lack of an appropriate=20 > > indication of its use may cause a problem. This isn't just a pedantic=20 > > concern, we had a case like this that broke the build just recently. > >=20 > >=20 > > Doug > >=20 > > --=20 > >=20 > > ... and that's just a little bit of history repeating. > > -- Propellerheads > >=20 > > Improve the effectiveness of your Internet presence with > > a domain name makeover! http://SupersetSolutions.com/ >=20 > What is the appropriate ifdef for a variable used only inside a KASSERT? >=20 > Kirk McKusick I'd guess '#ifdef INVARIANTS' (from looking at systm.h). --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/Iiks/N/my8MI5m6+Ti3WsdW Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQCVAwUBTJ2ktQ7tvOdmanQhAQK0PQP8DSZ9fpAPtgGg5SSIDZHZXrnXecCosz2v IeqT/p0YlO2XzMO8Vw5ClxMxXg4s0w3DjQSGAm9EFMN9f+79uQavVsLWloHJ6sIV 0IkR35NViUBcbZ/4gPx0mbzk+sDRUqIikEDwUyQu08rb06DYqwiVwS8b4TwjeJdx kgFMU8TEQOA= =utIt -----END PGP SIGNATURE----- --Sig_/Iiks/N/my8MI5m6+Ti3WsdW-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 08:19:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472951065670; Sat, 25 Sep 2010 08:19:35 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3674F8FC08; Sat, 25 Sep 2010 08:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P8JZhc054784; Sat, 25 Sep 2010 08:19:35 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P8JZcD054782; Sat, 25 Sep 2010 08:19:35 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201009250819.o8P8JZcD054782@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Sat, 25 Sep 2010 08:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213160 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 08:19:35 -0000 Author: sanpei Date: Sat Sep 25 08:19:34 2010 New Revision: 213160 URL: http://svn.freebsd.org/changeset/base/213160 Log: Add Planex UE-200TX-G2 to list of supported devices. MFC after: 1 day Modified: head/share/man/man4/axe.4 Modified: head/share/man/man4/axe.4 ============================================================================== --- head/share/man/man4/axe.4 Sat Sep 25 06:27:09 2010 (r213159) +++ head/share/man/man4/axe.4 Sat Sep 25 08:19:34 2010 (r213160) @@ -188,6 +188,8 @@ Cisco-Linksys USB200Mv2 D-Link DUBE100B1 .It Planex UE-200TX-G +.It +Planex UE-200TX-G2 .El .Sh DIAGNOSTICS .Bl -diag From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 08:36:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A8D106564A; Sat, 25 Sep 2010 08:36:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9412F8FC0A; Sat, 25 Sep 2010 08:36:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P8akDi055207; Sat, 25 Sep 2010 08:36:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P8akbl055205; Sat, 25 Sep 2010 08:36:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250836.o8P8akbl055205@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 08:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213161 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 08:36:46 -0000 Author: davidxu Date: Sat Sep 25 08:36:46 2010 New Revision: 213161 URL: http://svn.freebsd.org/changeset/base/213161 Log: Add missing field. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sat Sep 25 08:19:34 2010 (r213160) +++ head/lib/libthr/thread/thr_private.h Sat Sep 25 08:36:46 2010 (r213161) @@ -452,6 +452,7 @@ struct pthread { #ifdef _PTHREAD_FORCED_UNWIND struct _Unwind_Exception ex; void *unwind_stackend; + int unwind_disabled; #endif /* From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 09:16:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C2B106564A; Sat, 25 Sep 2010 09:16:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A65E48FC14; Sat, 25 Sep 2010 09:16:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P9GkL2055970; Sat, 25 Sep 2010 09:16:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P9GkJQ055967; Sat, 25 Sep 2010 09:16:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201009250916.o8P9GkJQ055967@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 25 Sep 2010 09:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213162 - in head: share/man/man4 sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 09:16:46 -0000 Author: lstewart Date: Sat Sep 25 09:16:46 2010 New Revision: 213162 URL: http://svn.freebsd.org/changeset/base/213162 Log: Log the number of segments currently in the reassembly queue. Sponsored by: FreeBSD Foundation Modified: head/share/man/man4/siftr.4 head/sys/netinet/siftr.c Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Sat Sep 25 08:36:46 2010 (r213161) +++ head/share/man/man4/siftr.4 Sat Sep 25 09:16:46 2010 (r213162) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2010 +.Dd September 25, 2010 .Dt SIFTR 4 .Os .Sh NAME @@ -198,7 +198,7 @@ The data is CSV formatted. .Bd -literal -offset indent o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\ 1073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\ -33304,208,66608,0,208 +33304,208,66608,0,208,0 .Ed .Pp Field descriptions are as follows: @@ -328,6 +328,10 @@ The current number of bytes in the socke The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El +.Bl -tag -offset indent +.It Va 26 +The current number of segments in the reassembly queue. +.El .Pp The third type of log message is written to the file when the module is disabled and ceases collecting data from the running kernel. Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Sat Sep 25 08:36:46 2010 (r213161) +++ head/sys/netinet/siftr.c Sat Sep 25 09:16:46 2010 (r213162) @@ -55,7 +55,7 @@ * SIFTR should be directed to him via email: lastewart@swin.edu.au * * Initial release date: June 2007 - * Most recent update: June 2010 + * Most recent update: September 2010 ******************************************************/ #include @@ -105,7 +105,7 @@ __FBSDID("$FreeBSD$"); */ #define V_MAJOR 1 #define V_BACKBREAK 2 -#define V_BACKCOMPAT 3 +#define V_BACKCOMPAT 4 #define MODVERSION __CONCAT(V_MAJOR, __CONCAT(V_BACKBREAK, V_BACKCOMPAT)) #define MODVERSION_STR __XSTRING(V_MAJOR) "." __XSTRING(V_BACKBREAK) "." \ __XSTRING(V_BACKCOMPAT) @@ -226,6 +226,8 @@ struct pkt_node { u_int rcv_buf_cc; /* Number of bytes inflight that we are waiting on ACKs for. */ u_int sent_inflight_bytes; + /* Number of segments currently in the reassembly queue. */ + int t_segqlen; /* Link to next pkt_node in the list. */ STAILQ_ENTRY(pkt_node) nodes; }; @@ -442,7 +444,7 @@ siftr_process_pkt(struct pkt_node * pkt_ MAX_LOG_MSG_LEN, "%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:" "%x:%x:%x:%x:%x,%u,%ld,%ld,%ld,%ld,%ld,%u,%u,%u,%u,%u,%u," - "%u,%d,%u,%u,%u,%u,%u\n", + "%u,%d,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, pkt_node->tval.tv_sec, @@ -482,7 +484,8 @@ siftr_process_pkt(struct pkt_node * pkt_ pkt_node->snd_buf_cc, pkt_node->rcv_buf_hiwater, pkt_node->rcv_buf_cc, - pkt_node->sent_inflight_bytes); + pkt_node->sent_inflight_bytes, + pkt_node->t_segqlen); } else { /* IPv4 packet */ pkt_node->ip_laddr[0] = FIRST_OCTET(pkt_node->ip_laddr[3]); pkt_node->ip_laddr[1] = SECOND_OCTET(pkt_node->ip_laddr[3]); @@ -498,7 +501,7 @@ siftr_process_pkt(struct pkt_node * pkt_ log_buf->ae_bytesused = snprintf(log_buf->ae_data, MAX_LOG_MSG_LEN, "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld," - "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u\n", + "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, (intmax_t)pkt_node->tval.tv_sec, @@ -530,7 +533,8 @@ siftr_process_pkt(struct pkt_node * pkt_ pkt_node->snd_buf_cc, pkt_node->rcv_buf_hiwater, pkt_node->rcv_buf_cc, - pkt_node->sent_inflight_bytes); + pkt_node->sent_inflight_bytes, + pkt_node->t_segqlen); #ifdef SIFTR_IPV6 } #endif @@ -790,6 +794,7 @@ siftr_siftdata(struct pkt_node *pn, stru pn->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat; pn->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc; pn->sent_inflight_bytes = tp->snd_max - tp->snd_una; + pn->t_segqlen = tp->t_segqlen; /* We've finished accessing the tcb so release the lock. */ if (inp_locally_locked) From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 09:30:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB13D1065672; Sat, 25 Sep 2010 09:30:29 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 713E98FC1D; Sat, 25 Sep 2010 09:30:29 +0000 (UTC) Received: by iwn34 with SMTP id 34so3884501iwn.13 for ; Sat, 25 Sep 2010 02:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=BZMwMTj3CJPspqPqTAJIWxMOB9VzfIC/zLNPetXIUh4=; b=Qgl5jbmU/IBPEG0rN2KtTsJ59JB7aE4KdoOxaB1ZLnscKCoDJpFDOw2oW1jqHBxXGO VIHCaCw79tm6SiMMbBkYSauNbA14P3n8SHD35ysqj7mrJYRue69oJGtHNF+DaqHvSyvw WptzoJNZf8hcyVAhx/8xcQBH66j+XCLmKgjHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=a/N6d/ElSZTat0HIIDGe9sVkEmpvQtYzz6ULKcLW1ZUBV4yQlQ2TRfv17aNsPTduR1 pH00HcqrGVavhXAccQzGD31kBVw4srAGEr/rAy7GidLKR4KLR+rj6iicLp8HGIPu8nLh 0hhgNZyxFBUfsZlqyXAiK8VZdXzi3q9wPKjOc= Received: by 10.231.173.9 with SMTP id n9mr5264809ibz.146.1285407021480; Sat, 25 Sep 2010 02:30:21 -0700 (PDT) Received: from localhost (tor-exit-proxy5-readme.formlessnetworking.net [208.53.142.41]) by mx.google.com with ESMTPS id g31sm3431581ibh.4.2010.09.25.02.30.15 (version=SSLv3 cipher=RC4-MD5); Sat, 25 Sep 2010 02:30:20 -0700 (PDT) From: Anonymous To: David Xu References: <201009250836.o8P8akbl055205__9540.25641917742$1285403822$gmane$org@svn.freebsd.org> Date: Sat, 25 Sep 2010 13:23:41 +0400 In-Reply-To: <201009250836.o8P8akbl055205__9540.25641917742$1285403822$gmane$org@svn.freebsd.org> (David Xu's message of "Sat, 25 Sep 2010 08:36:46 +0000 (UTC)") Message-ID: <864odemb1e.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213161 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 09:30:29 -0000 David Xu writes: > Author: davidxu > Date: Sat Sep 25 08:36:46 2010 > New Revision: 213161 > URL: http://svn.freebsd.org/changeset/base/213161 > > Log: > Add missing field. > > Modified: > head/lib/libthr/thread/thr_private.h > > Modified: head/lib/libthr/thread/thr_private.h > ============================================================================== > --- head/lib/libthr/thread/thr_private.h Sat Sep 25 08:19:34 2010 (r213160) > +++ head/lib/libthr/thread/thr_private.h Sat Sep 25 08:36:46 2010 (r213161) > @@ -452,6 +452,7 @@ struct pthread { > #ifdef _PTHREAD_FORCED_UNWIND > struct _Unwind_Exception ex; > void *unwind_stackend; > + int unwind_disabled; > #endif > > /* What about NO_THREAD_UNWIND_STACK in src.conf? cc -O2 -pipe -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include -I/usr/src/lib/libthr/arch/amd64/include -I/usr/src/lib/libthr/sys -I/usr/src/lib/libthr/../../libexec/rtld-elf -I/usr/src/lib/libthr/../../libexec/rtld-elf/amd64 -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -DSYSCALL_COMPAT -ggdb -std=gnu99 -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/libthr/thread/thr_clean.c /usr/src/lib/libthr/thread/thr_clean.c: In function '_pthread_cleanup_push': /usr/src/lib/libthr/thread/thr_clean.c:84: error: 'struct pthread' has no member named 'unwind_disabled' *** Error code 1 From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 09:43:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F16D106566B; Sat, 25 Sep 2010 09:43:25 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA2C8FC12; Sat, 25 Sep 2010 09:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8P9hPj1056518; Sat, 25 Sep 2010 09:43:25 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8P9hPPC056516; Sat, 25 Sep 2010 09:43:25 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009250943.o8P9hPPC056516@svn.freebsd.org> From: David Xu Date: Sat, 25 Sep 2010 09:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213163 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 09:43:25 -0000 Author: davidxu Date: Sat Sep 25 09:43:24 2010 New Revision: 213163 URL: http://svn.freebsd.org/changeset/base/213163 Log: Only access unwind_disabled when _PTHREAD_FORCED_UNWIND is defined. Modified: head/lib/libthr/thread/thr_clean.c Modified: head/lib/libthr/thread/thr_clean.c ============================================================================== --- head/lib/libthr/thread/thr_clean.c Sat Sep 25 09:16:46 2010 (r213162) +++ head/lib/libthr/thread/thr_clean.c Sat Sep 25 09:43:24 2010 (r213163) @@ -80,8 +80,9 @@ _pthread_cleanup_push(void (*routine) (v { struct pthread *curthread = _get_curthread(); struct pthread_cleanup *newbuf; - +#ifdef _PTHREAD_FORCED_UNWIND curthread->unwind_disabled = 1; +#endif if ((newbuf = (struct pthread_cleanup *) malloc(sizeof(struct _pthread_cleanup_info))) != NULL) { newbuf->routine = routine; From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:02:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FBE71065693; Sat, 25 Sep 2010 10:02:12 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 8B74E8FC20; Sat, 25 Sep 2010 10:02:11 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o8P9edWU024193; Sat, 25 Sep 2010 11:40:39 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o8P9ed2l024192; Sat, 25 Sep 2010 11:40:39 +0200 (CEST) (envelope-from marius) Date: Sat, 25 Sep 2010 11:40:39 +0200 From: Marius Strobl To: Lawrence Stewart Message-ID: <20100925094039.GS46946@alchemy.franken.de> References: <201009241640.o8OGelKS031911@svn.freebsd.org> <4C9D7068.2010100@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C9D7068.2010100@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213105 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:02:12 -0000 On Sat, Sep 25, 2010 at 01:45:44PM +1000, Lawrence Stewart wrote: > Hi Marius, > > On 09/25/10 02:40, Marius Strobl wrote: > > Author: marius > > Date: Fri Sep 24 16:40:46 2010 > > New Revision: 213105 > > URL: http://svn.freebsd.org/changeset/base/213105 > > > > Log: > > Improve r56796; the reply handler actually may remove the request from > > the chain in which case it shouldn't be removed twice. > > Reported by: Staale Kristoffersen > > Can you please provide a bit of extra commentary about the symptoms of > the issue this patch addresses? Like Staale, I'm running a FreeBSD > server which uses mpt for its disk subsystem (SunFire X4100 with 2 x > SATA 2.5" disks in RAID-1) and I've had a series of long running > problems with the performance of the controller. I'm keeping a close eye > on all mpt related commits and hope to find the cause sometime. > In case the reply handler also removed the request this triggered a sanity check in TAILQ_REMOVE with INVARIANTS compiled in, causing a panic. I don't think it had a negative impact with INVARIANTS disabled. Also, in order to hit the problem you first had to run into a timeout leading to an IOC rest like here: http://folk.uio.no/stalk/mpt/timeout.txt i.e. I don't think this is related to your performance issue. Marius From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:31:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA54A1065674; Sat, 25 Sep 2010 10:31:05 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9F908FC1A; Sat, 25 Sep 2010 10:31:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PAV5ff059851; Sat, 25 Sep 2010 10:31:05 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PAV5xh059849; Sat, 25 Sep 2010 10:31:05 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251031.o8PAV5xh059849@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 10:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213164 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:31:05 -0000 Author: pjd Date: Sat Sep 25 10:31:05 2010 New Revision: 213164 URL: http://svn.freebsd.org/changeset/base/213164 Log: Ignore errors from BIO_FLUSH. It might confuse users that provider wasn't really killed. What we really care about are write errors only. MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli_ctl.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sat Sep 25 09:43:24 2010 (r213163) +++ head/sys/geom/eli/g_eli_ctl.c Sat Sep 25 10:31:05 2010 (r213164) @@ -688,7 +688,7 @@ g_eli_ctl_delkey(struct gctl_req *req, s * Flush write cache so we don't overwrite data N times in cache * and only once on disk. */ - g_io_flush(cp); + (void)g_io_flush(cp); } bzero(&md, sizeof(md)); bzero(sector, sizeof(sector)); @@ -739,13 +739,11 @@ g_eli_kill_one(struct g_eli_softc *sc) if (error == 0) error = err; } - err = g_io_flush(cp); - if (err != 0) { - G_ELI_DEBUG(0, "Cannot flush %s (error=%d).", - pp->name, err); - if (error == 0) - error = err; - } + /* + * Flush write cache so we don't overwrite data N times + * in cache and only once on disk. + */ + (void)g_io_flush(cp); } free(sector, M_ELI); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:32:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3CA106566C; Sat, 25 Sep 2010 10:32:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD568FC08; Sat, 25 Sep 2010 10:32:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PAW4H8059902; Sat, 25 Sep 2010 10:32:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PAW4om059899; Sat, 25 Sep 2010 10:32:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251032.o8PAW4om059899@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 10:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213165 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:32:04 -0000 Author: pjd Date: Sat Sep 25 10:32:04 2010 New Revision: 213165 URL: http://svn.freebsd.org/changeset/base/213165 Log: Change g_eli_debug to int, so one can turn off any GELI output by setting kern.geom.eli.debug sysctl to -1. MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat Sep 25 10:31:05 2010 (r213164) +++ head/sys/geom/eli/g_eli.c Sat Sep 25 10:32:04 2010 (r213165) @@ -56,9 +56,9 @@ MALLOC_DEFINE(M_ELI, "eli data", "GEOM_E SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, eli, CTLFLAG_RW, 0, "GEOM_ELI stuff"); -u_int g_eli_debug = 0; +int g_eli_debug = 0; TUNABLE_INT("kern.geom.eli.debug", &g_eli_debug); -SYSCTL_UINT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0, +SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0, "Debug level"); static u_int g_eli_tries = 3; TUNABLE_INT("kern.geom.eli.tries", &g_eli_tries); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sat Sep 25 10:31:05 2010 (r213164) +++ head/sys/geom/eli/g_eli.h Sat Sep 25 10:32:04 2010 (r213165) @@ -105,7 +105,7 @@ #define G_ELI_KEY_SHIFT 20 #ifdef _KERNEL -extern u_int g_eli_debug; +extern int g_eli_debug; extern u_int g_eli_overwrites; extern u_int g_eli_batch; From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:32:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 631E0106566C; Sat, 25 Sep 2010 10:32:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52A6D8FC13; Sat, 25 Sep 2010 10:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PAWq4b060064; Sat, 25 Sep 2010 10:32:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PAWqrU060062; Sat, 25 Sep 2010 10:32:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251032.o8PAWqrU060062@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 10:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213166 - head/sys/crypto/aesni X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:32:52 -0000 Author: pjd Date: Sat Sep 25 10:32:52 2010 New Revision: 213166 URL: http://svn.freebsd.org/changeset/base/213166 Log: Fix two copy&paste bugs. MFC after: 2 weeks Modified: head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Sat Sep 25 10:32:04 2010 (r213165) +++ head/sys/crypto/aesni/aesni_wrap.c Sat Sep 25 10:32:52 2010 (r213166) @@ -232,7 +232,7 @@ aesni_cipher_setup_common(struct aesni_s aesni_set_enckey(key, ses->enc_schedule, ses->rounds); aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, ses->rounds); - if (ses->algo == CRYPTO_AES_XTS) + if (ses->algo == CRYPTO_AES_CBC) arc4rand(ses->iv, sizeof(ses->iv), 0); else /* if (ses->algo == CRYPTO_AES_XTS) */ { aesni_set_enckey(key + keylen / 16, ses->xts_schedule, @@ -306,7 +306,7 @@ aesni_cipher_process(struct aesni_sessio aesni_decrypt_cbc(ses->rounds, ses->dec_schedule, enccrd->crd_len, buf, ses->iv); } else /* if (ses->algo == CRYPTO_AES_XTS) */ { - aesni_decrypt_xts(ses->rounds, ses->enc_schedule, + aesni_decrypt_xts(ses->rounds, ses->dec_schedule, ses->xts_schedule, enccrd->crd_len, buf, buf, ses->iv); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:34:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1779106566B; Sat, 25 Sep 2010 10:34:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90F5D8FC0A; Sat, 25 Sep 2010 10:34:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PAYB0w060140; Sat, 25 Sep 2010 10:34:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PAYBCI060138; Sat, 25 Sep 2010 10:34:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251034.o8PAYBCI060138@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 10:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213167 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:34:11 -0000 Author: pjd Date: Sat Sep 25 10:34:11 2010 New Revision: 213167 URL: http://svn.freebsd.org/changeset/base/213167 Log: - Use $md instead of md0, which fixes tests when md(4) device is already present. - Correct message - we create GPT, not MBR. MFC after: 2 weeks Modified: head/tools/regression/geom_eli/resize.t Modified: head/tools/regression/geom_eli/resize.t ============================================================================== --- head/tools/regression/geom_eli/resize.t Sat Sep 25 10:32:52 2010 (r213166) +++ head/tools/regression/geom_eli/resize.t Sat Sep 25 10:34:11 2010 (r213167) @@ -124,8 +124,8 @@ geli detach ${md}a.eli # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none # to geli init. -gpart create -s GPT md0 || echo -n "not " -echo ok $i - "Installed an MBR on md0" +gpart create -s GPT $md || echo -n "not " +echo ok $i - "Installed an GPT on md0" i=$((i + 1)) gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " echo ok $i - "Added a 20m partition in slot 1" From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 10:34:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12FE0106566C; Sat, 25 Sep 2010 10:34:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 019CF8FC0C; Sat, 25 Sep 2010 10:34:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PAYg7E060192; Sat, 25 Sep 2010 10:34:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PAYgd1060184; Sat, 25 Sep 2010 10:34:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251034.o8PAYgd1060184@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 10:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213168 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 10:34:43 -0000 Author: pjd Date: Sat Sep 25 10:34:42 2010 New Revision: 213168 URL: http://svn.freebsd.org/changeset/base/213168 Log: Update regression tests after AES-XTS addition. MFC after: 2 weeks Modified: head/tools/regression/geom_eli/init-a.t head/tools/regression/geom_eli/init.t head/tools/regression/geom_eli/integrity-copy.t head/tools/regression/geom_eli/integrity-data.t head/tools/regression/geom_eli/integrity-hmac.t head/tools/regression/geom_eli/onetime-a.t head/tools/regression/geom_eli/onetime.t Modified: head/tools/regression/geom_eli/init-a.t ============================================================================== --- head/tools/regression/geom_eli/init-a.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/init-a.t Sat Sep 25 10:34:42 2010 (r213168) @@ -6,15 +6,22 @@ no=45 sectors=100 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -echo "1..660" +echo "1..1380" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do Modified: head/tools/regression/geom_eli/init.t ============================================================================== --- head/tools/regression/geom_eli/init.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/init.t Sat Sep 25 10:34:42 2010 (r213168) @@ -6,15 +6,22 @@ no=45 sectors=100 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -echo "1..220" +echo "1..460" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do Modified: head/tools/regression/geom_eli/integrity-copy.t ============================================================================== --- head/tools/regression/geom_eli/integrity-copy.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/integrity-copy.t Sat Sep 25 10:34:42 2010 (r213168) @@ -7,15 +7,22 @@ sectors=100 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 sector=`mktemp /tmp/$base.XXXXXX` || exit 1 -echo "1..2640" +echo "1..5520" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do Modified: head/tools/regression/geom_eli/integrity-data.t ============================================================================== --- head/tools/regression/geom_eli/integrity-data.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/integrity-data.t Sat Sep 25 10:34:42 2010 (r213168) @@ -7,15 +7,22 @@ sectors=100 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 sector=`mktemp /tmp/$base.XXXXXX` || exit 1 -echo "1..1320" +echo "1..2760" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do Modified: head/tools/regression/geom_eli/integrity-hmac.t ============================================================================== --- head/tools/regression/geom_eli/integrity-hmac.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/integrity-hmac.t Sat Sep 25 10:34:42 2010 (r213168) @@ -7,15 +7,22 @@ sectors=100 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 sector=`mktemp /tmp/$base.XXXXXX` || exit 1 -echo "1..1320" +echo "1..2760" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do Modified: head/tools/regression/geom_eli/onetime-a.t ============================================================================== --- head/tools/regression/geom_eli/onetime-a.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/onetime-a.t Sat Sep 25 10:34:42 2010 (r213168) @@ -5,15 +5,22 @@ base=`basename $0` no=45 sectors=100 -echo "1..660" +echo "1..1380" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do Modified: head/tools/regression/geom_eli/onetime.t ============================================================================== --- head/tools/regression/geom_eli/onetime.t Sat Sep 25 10:34:11 2010 (r213167) +++ head/tools/regression/geom_eli/onetime.t Sat Sep 25 10:34:42 2010 (r213168) @@ -5,15 +5,22 @@ base=`basename $0` no=45 sectors=100 -echo "1..220" +echo "1..460" i=1 -for cipher in aes:0 aes:128 aes:192 aes:256 \ +for cipher in aes:0 aes:128 aes:256 \ + aes-xts:0 aes-xts:128 aes-xts:256 \ + aes-cbc:0 aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des:0 3des:192 \ + 3des-cbc:0 3des-cbc:192 \ blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \ blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \ blowfish:416 blowfish:448 \ - camellia:0 camellia:128 camellia:192 camellia:256; do + blowfish-cbc:0 blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 blowfish-cbc:224 \ + blowfish-cbc:256 blowfish-cbc:288 blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ + blowfish-cbc:416 blowfish-cbc:448 \ + camellia:0 camellia:128 camellia:192 camellia:256 \ + camellia-cbc:0 camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 11:29:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C9DC1065670; Sat, 25 Sep 2010 11:29:20 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out3.tiscali.nl (smtp-out3.tiscali.nl [195.241.79.178]) by mx1.freebsd.org (Postfix) with ESMTP id DF8F98FC08; Sat, 25 Sep 2010 11:29:19 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out3.tiscali.nl with esmtp (Exim) (envelope-from ) id 1OzSmj-0006dI-GO; Sat, 25 Sep 2010 13:19:17 +0200 Received: from 212-123-145-58.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id E3D195367; Sat, 25 Sep 2010 13:19:11 +0200 (CEST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Pawel Jakub Dawidek" References: <201009251034.o8PAYBCI060138@svn.freebsd.org> Date: Sat, 25 Sep 2010 13:19:11 +0200 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: <201009251034.o8PAYBCI060138@svn.freebsd.org> User-Agent: Opera Mail/10.62 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r213167 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 11:29:20 -0000 On Sat, 25 Sep 2010 12:34:11 +0200, Pawel Jakub Dawidek = =20 wrote: > Author: pjd > Date: Sat Sep 25 10:34:11 2010 > New Revision: 213167 > URL: http://svn.freebsd.org/changeset/base/213167 > > Log: > - Use $md instead of md0, which fixes tests when md(4) device is =20 > already > present. > - Correct message - we create GPT, not MBR. > MFC after: 2 weeks > > Modified: > head/tools/regression/geom_eli/resize.t > > Modified: head/tools/regression/geom_eli/resize.t > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/tools/regression/geom_eli/resize.t Sat Sep 25 10:32:52 =20 > 2010 (r213166) > +++ head/tools/regression/geom_eli/resize.t Sat Sep 25 10:34:11 =20 > 2010 (r213167) > @@ -124,8 +124,8 @@ geli detach ${md}a.eli > # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none > # to geli init. > -gpart create -s GPT md0 || echo -n "not " > -echo ok $i - "Installed an MBR on md0" > +gpart create -s GPT $md || echo -n "not " > +echo ok $i - "Installed an GPT on md0" > i=3D$((i + 1)) > gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " > echo ok $i - "Added a 20m partition in slot 1" Hi, You still use md0 in the message in stead of $md. Ronald. From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 11:36:33 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DDAA106564A; Sat, 25 Sep 2010 11:36:33 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id AAD098FC1A; Sat, 25 Sep 2010 11:36:32 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id o8PBOk2T050621; Sat, 25 Sep 2010 13:24:47 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4C9DDBFE.8070606@FreeBSD.org> Date: Sat, 25 Sep 2010 13:24:46 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.9) Gecko/20100825 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: David Xu References: <201009240904.o8O94GVM095803@svn.freebsd.org> In-Reply-To: <201009240904.o8O94GVM095803@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 11:36:33 -0000 Hi! On 24.09.10 11:04, David Xu wrote: > Author: davidxu > Date: Fri Sep 24 09:04:16 2010 > New Revision: 213098 > URL: http://svn.freebsd.org/changeset/base/213098 > > Log: > Now userland POSIX semaphore is based on umtx. The kernel module > is only used to support binary compatible, if want to run old > binary, you need to kldload the module. I guess this is also valid for powerpc/GENERIC64, right? Or do we need some work here? Thanks, Andreas > Modified: > head/sys/amd64/conf/GENERIC > head/sys/i386/conf/GENERIC > head/sys/pc98/conf/GENERIC > head/sys/powerpc/conf/GENERIC Index: sys/powerpc/conf/GENERIC64 =================================================================== --- sys/powerpc/conf/GENERIC64 (revision 213168) +++ sys/powerpc/conf/GENERIC64 (working copy) @@ -59,7 +59,6 @@ options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores -options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 11:48:13 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from alona.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 419B81065670; Sat, 25 Sep 2010 11:48:04 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <4C9DE168.4010200@freebsd.org> Date: Sat, 25 Sep 2010 19:47:52 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.21 (X11/20090522) MIME-Version: 1.0 To: Andreas Tobler References: <201009240904.o8O94GVM095803@svn.freebsd.org> <4C9DDBFE.8070606@FreeBSD.org> In-Reply-To: <4C9DDBFE.8070606@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 11:48:13 -0000 Andreas Tobler wrote: > Hi! > > On 24.09.10 11:04, David Xu wrote: >> Author: davidxu >> Date: Fri Sep 24 09:04:16 2010 >> New Revision: 213098 >> URL: http://svn.freebsd.org/changeset/base/213098 >> >> Log: >> Now userland POSIX semaphore is based on umtx. The kernel module >> is only used to support binary compatible, if want to run old >> binary, you need to kldload the module. > > I guess this is also valid for powerpc/GENERIC64, right? Or do we need > some work here? > > Thanks, > Andreas You can remove it without extra work. Regards, David Xu From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 13:32:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36A941065670; Sat, 25 Sep 2010 13:32:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4358FC14; Sat, 25 Sep 2010 13:32:11 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 53D41582C4; Sat, 25 Sep 2010 08:00:44 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 4fvunHzP7yEs; Sat, 25 Sep 2010 08:00:44 -0500 (CDT) Received: from wanderer.tachypleus.net (unknown [76.210.68.10]) by mail.icecube.wisc.edu (Postfix) with ESMTP id E37D2582C3; Sat, 25 Sep 2010 08:00:43 -0500 (CDT) Message-ID: <4C9DF27C.7020800@freebsd.org> Date: Sat, 25 Sep 2010 15:00:44 +0200 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.12) Gecko/20100914 Thunderbird/3.0.7 MIME-Version: 1.0 To: David Xu References: <201009240904.o8O94GVM095803@svn.freebsd.org> In-Reply-To: <201009240904.o8O94GVM095803@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213098 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 13:32:12 -0000 On 09/24/10 11:04, David Xu wrote: > Author: davidxu > Date: Fri Sep 24 09:04:16 2010 > New Revision: 213098 > URL: http://svn.freebsd.org/changeset/base/213098 > > Log: > Now userland POSIX semaphore is based on umtx. The kernel module > is only used to support binary compatible, if want to run old > binary, you need to kldload the module. > > Modified: > head/sys/amd64/conf/GENERIC > head/sys/i386/conf/GENERIC > head/sys/pc98/conf/GENERIC > head/sys/powerpc/conf/GENERIC > head/sys/sparc64/conf/GENERIC > You missed the powerpc64 GENERIC, which is named /sys/powerpc/conf/GENERIC64. It looks like you skipped sun4v too. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 14:33:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 328D71065670; Sat, 25 Sep 2010 14:33:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 073C38FC08; Sat, 25 Sep 2010 14:33:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PEXZTd065048; Sat, 25 Sep 2010 14:33:35 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PEXZr0065046; Sat, 25 Sep 2010 14:33:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201009251433.o8PEXZr0065046@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 25 Sep 2010 14:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213169 - head/tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 14:33:36 -0000 Author: trasz Date: Sat Sep 25 14:33:35 2010 New Revision: 213169 URL: http://svn.freebsd.org/changeset/base/213169 Log: Add a shell script to generate a test script for trivial ACLs. Added: head/tools/regression/acltools/mktrivial.sh (contents, props changed) Added: head/tools/regression/acltools/mktrivial.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/acltools/mktrivial.sh Sat Sep 25 14:33:35 2010 (r213169) @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Copyright (c) 2010 Edward Tomasz NapieraƂa +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# This shell script generates an input file for the "run" script, used +# to verify generation of trivial ACLs. + +echo "$ touch f" +touch f + +for s in `jot 7 0 7`; do + for u in `jot 7 0 7`; do + for g in `jot 7 0 7`; do + for o in `jot 7 0 7`; do + echo "$ chmod 0$s$u$g$o f" + chmod "0$s$u$g$o" f + echo "$ ls -l f | cut -d' ' -f1" + ls -l f | cut -d' ' -f1 | sed 's/^/> /' + echo "$ getfacl -q f" + getfacl -q f | sed 's/^/> /' + done + done + done +done + +echo "$ rm f" +rm f + From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 14:54:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C39D1065673; Sat, 25 Sep 2010 14:54:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB268FC23; Sat, 25 Sep 2010 14:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PEsVlW065501; Sat, 25 Sep 2010 14:54:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PEsVLw065499; Sat, 25 Sep 2010 14:54:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201009251454.o8PEsVLw065499@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 25 Sep 2010 14:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213170 - head/tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 14:54:31 -0000 Author: trasz Date: Sat Sep 25 14:54:31 2010 New Revision: 213170 URL: http://svn.freebsd.org/changeset/base/213170 Log: Don't leave zombies behind. Modified: head/tools/regression/acltools/run Modified: head/tools/regression/acltools/run ============================================================================== --- head/tools/regression/acltools/run Sat Sep 25 14:33:35 2010 (r213169) +++ head/tools/regression/acltools/run Sat Sep 25 14:54:31 2010 (r213170) @@ -271,6 +271,8 @@ sub exec_test($$) { *STDOUT->autoflush(); *OUT->autoflush(); + $SIG{CHLD} = 'IGNORE'; + if (fork()) { # Server if (*IN_DUP) { From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 15:37:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56EA5106564A; Sat, 25 Sep 2010 15:37:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 466E88FC1D; Sat, 25 Sep 2010 15:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PFbfN9066394; Sat, 25 Sep 2010 15:37:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PFbfvS066392; Sat, 25 Sep 2010 15:37:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251537.o8PFbfvS066392@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 15:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213171 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 15:37:41 -0000 Author: pjd Date: Sat Sep 25 15:37:41 2010 New Revision: 213171 URL: http://svn.freebsd.org/changeset/base/213171 Log: Don't hardcode md0 in message, use $md instead. Reported by: Ronald Klop Modified: head/tools/regression/geom_eli/resize.t Modified: head/tools/regression/geom_eli/resize.t ============================================================================== --- head/tools/regression/geom_eli/resize.t Sat Sep 25 14:54:31 2010 (r213170) +++ head/tools/regression/geom_eli/resize.t Sat Sep 25 15:37:41 2010 (r213171) @@ -125,7 +125,7 @@ geli detach ${md}a.eli # to geli init. gpart create -s GPT $md || echo -n "not " -echo ok $i - "Installed an GPT on md0" +echo ok $i - "Installed an GPT on ${md}" i=$((i + 1)) gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " echo ok $i - "Added a 20m partition in slot 1" From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 15:38:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 800981065742; Sat, 25 Sep 2010 15:38:01 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 24E638FC16; Sat, 25 Sep 2010 15:38:00 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 4934D45CA0; Sat, 25 Sep 2010 17:37:59 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id F055B456B1; Sat, 25 Sep 2010 17:37:51 +0200 (CEST) Date: Sat, 25 Sep 2010 17:37:32 +0200 From: Pawel Jakub Dawidek To: Ronald Klop Message-ID: <20100925153732.GB47356@garage.freebsd.pl> References: <201009251034.o8PAYBCI060138@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ghzN8eJ9Qlbqn3iT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213167 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 15:38:01 -0000 --ghzN8eJ9Qlbqn3iT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 25, 2010 at 01:19:11PM +0200, Ronald Klop wrote: > On Sat, 25 Sep 2010 12:34:11 +0200, Pawel Jakub Dawidek = =20 > wrote: >=20 > >Author: pjd > >Date: Sat Sep 25 10:34:11 2010 > >New Revision: 213167 > >URL: http://svn.freebsd.org/changeset/base/213167 > > > >Log: > > - Use $md instead of md0, which fixes tests when md(4) device is =20 > >already > > present. > > - Correct message - we create GPT, not MBR. > > MFC after: 2 weeks > > > >Modified: > > head/tools/regression/geom_eli/resize.t > > > >Modified: head/tools/regression/geom_eli/resize.t > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/tools/regression/geom_eli/resize.t Sat Sep 25 10:32:52 =20 > >2010 (r213166) > >+++ head/tools/regression/geom_eli/resize.t Sat Sep 25 10:34:11 =20 > >2010 (r213167) > >@@ -124,8 +124,8 @@ geli detach ${md}a.eli > > # 1g to 20m, 2g to 30m and keyfile to tmp.key, and adding -B none > > # to geli init. > >-gpart create -s GPT md0 || echo -n "not " > >-echo ok $i - "Installed an MBR on md0" > >+gpart create -s GPT $md || echo -n "not " > >+echo ok $i - "Installed an GPT on md0" > > i=3D$((i + 1)) > > gpart add -s 20m -t freebsd-ufs -i 1 $md || echo -n "not " > > echo ok $i - "Added a 20m partition in slot 1" >=20 > Hi, >=20 > You still use md0 in the message in stead of $md. Fix committed, thanks. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --ghzN8eJ9Qlbqn3iT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyeFzwACgkQForvXbEpPzQvNwCgtAkZdeRphcgmBqxDtDvadsB+ 47MAoIHIUzb3BcsglwI6KBS5RXAt3JJr =df6/ -----END PGP SIGNATURE----- --ghzN8eJ9Qlbqn3iT-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 17:38:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72DF3106566B; Sat, 25 Sep 2010 17:38:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60C1B8FC08; Sat, 25 Sep 2010 17:38:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PHcvDC068836; Sat, 25 Sep 2010 17:38:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PHcvta068833; Sat, 25 Sep 2010 17:38:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251738.o8PHcvta068833@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 17:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213172 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 17:38:57 -0000 Author: pjd Date: Sat Sep 25 17:38:57 2010 New Revision: 213172 URL: http://svn.freebsd.org/changeset/base/213172 Log: - Add support for loading passphrase from a file (-J and -j options). This is especially useful for things like installers, where regular geli prompt can't be used. - Add support for specifing multiple -K or -k options, so there is no need to cat all keyfiles and read them from standard input. Requested by: Kris Moore , thompsa MFC after: 2 weeks Modified: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sat Sep 25 15:37:41 2010 (r213171) +++ head/sbin/geom/class/eli/geli.8 Sat Sep 25 17:38:57 2010 (r213172) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2010 +.Dd September 25, 2010 .Dt GELI 8 .Os .Sh NAME @@ -56,6 +56,7 @@ utility: .Op Fl B Ar backupfile .Op Fl e Ar ealgo .Op Fl i Ar iterations +.Op Fl J Ar newpassfile .Op Fl K Ar newkeyfile .Op Fl l Ar keylen .Op Fl s Ar sectorsize @@ -66,6 +67,7 @@ utility: .Nm .Cm attach .Op Fl dprv +.Op Fl j Ar passfile .Op Fl k Ar keyfile .Ar prov .Nm @@ -91,6 +93,8 @@ utility: .Cm setkey .Op Fl pPv .Op Fl i Ar iterations +.Op Fl j Ar passfile +.Op Fl J Ar newpassfile .Op Fl k Ar keyfile .Op Fl K Ar newkeyfile .Op Fl n Ar keyno @@ -223,7 +227,7 @@ The metadata can be recovered with the subcommand described below. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar newkeyfile" +.Bl -tag -width ".Fl J Ar newpassfile" .It Fl a Ar aalgo Enable data integrity verification (authentication) using the given algorithm. This will reduce size of available storage and also reduce speed. @@ -272,15 +276,19 @@ If this option is not specified, .Nm will find the number of iterations which is equal to 2 seconds of crypto work. If 0 is given, PKCS#5v2 will not be used. +.It Fl J Ar newpassfile +Specifies a file which contains the passphrase or its part. +If +.Ar newpassfile +is given as -, standard input will be used. +Only the first line (excluding new-line character) is taken from the given file. +This argument can be specified multiple times. .It Fl K Ar newkeyfile Specifies a file which contains part of the key. If .Ar newkeyfile is given as -, standard input will be used. -Here is how more than one file with a key component can be used: -.Bd -literal -offset indent -# cat key1 key2 key3 | geli init -K - /dev/da0 -.Ed +This argument can be specified multiple times. .It Fl l Ar keylen Key length to use with the given cryptographic algorithm. If not given, the default key length for the given algorithm is used, which is: @@ -309,7 +317,7 @@ provider's name with an suffix. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar keyfile" +.Bl -tag -width ".Fl j Ar passfile" .It Fl d If specified, a decrypted provider will be detached automatically on last close. This can help with short memory - user does not have to remember to detach the @@ -321,6 +329,13 @@ Probably a better choice is the option for the .Cm detach subcommand. +.It Fl j Ar passfile +Specifies a file which contains the passphrase or its part. +For more information see the description of the +.Fl J +option for the +.Cm init +subcommand. .It Fl k Ar keyfile Specifies a file which contains part of the key. For more information see the description of the @@ -409,13 +424,17 @@ When a provider is attached, the user do an old passphrase/keyfile. .Pp Additional options include: -.Bl -tag -width ".Fl a Ar iterations" +.Bl -tag -width ".Fl J Ar newpassfile" .It Fl i Ar iterations Number of iterations to use with PKCS#5v2. If 0 is given, PKCS#5v2 will not be used. To be able to use this option with .Cm setkey subcommand, only one key have to be defined and this key has to be changed. +.It Fl j Ar passfile +Specifies a file which contains the old passphrase or its part. +.It Fl J Ar newpassfile +Specifies a file which contains the new passphrase or its part. .It Fl k Ar keyfile Specifies a file which contains part of the old key. .It Fl K Ar newkeyfile @@ -638,7 +657,7 @@ keyfile: # dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1 # dd if=/dev/random of=/boot/keys/da0.key1 bs=32k count=1 # dd if=/dev/random of=/boot/keys/da0.key2 bs=32k count=1 -# cat /boot/keys/da0.key0 /boot/keys/da0.key1 /boot/keys/da0.key2 | geli init -b -K - da0 +# geli init -b -K /boot/keys/da0.key0 -K /boot/keys/da0.key1 -K /boot/keys/da0.key2 da0 Enter new passphrase: Reenter new passphrase: # dd if=/dev/random of=/dev/da1s3a bs=1m @@ -711,6 +730,22 @@ update the metadata: # geli resize -s 1g ada0p1 # geli attach -k keyfile -p ada0p1 .Ed +.Pp +Initialize provider with passphrase split into two files. +The provider can be attached by giving those two files or by giving +.Dq foobar +passphrase on +.Nm +prompt: +.Bd -literal -offset indent +# echo foo > da0.pass0 +# echo bar > da0.pass1 +# geli init -J da0.pass0 -J da0.pass1 da0 +# geli attach -j da0.pass0 -j da0.pass1 da0 +# geli detach da0 +# geli attach da0 +Enter passphrase: foobar +.Ed .Sh ENCRYPTION MODES .Nm supports two encryption modes: Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Sat Sep 25 15:37:41 2010 (r213171) +++ head/sbin/geom/class/eli/geom_eli.c Sat Sep 25 17:38:57 2010 (r213172) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -79,14 +80,14 @@ static int eli_backup_create(struct gctl /* * Available commands: * - * init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] prov + * init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] prov * label - alias for 'init' - * attach [-dprv] [-k keyfile] prov + * attach [-dprv] [-j passfile] [-k keyfile] prov * detach [-fl] prov ... * stop - alias for 'detach' * onetime [-d] [-a aalgo] [-e ealgo] [-l keylen] prov * configure [-bB] prov ... - * setkey [-pPv] [-n keyno] [-k keyfile] [-K newkeyfile] prov + * setkey [-pPv] [-n keyno] [-j passfile] [-J newpassfile] [-k keyfile] [-K newkeyfile] prov * delkey [-afv] [-n keyno] prov * kill [-av] [prov ...] * backup [-v] prov file @@ -103,13 +104,14 @@ struct g_command class_commands[] = { { 'B', "backupfile", "", G_TYPE_STRING }, { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, - { 'K', "newkeyfile", "", G_TYPE_STRING }, + { 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'l', "keylen", "0", G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, { 's', "sectorsize", "0", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] [-s sectorsize] prov" + "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] prov" }, { "label", G_FLAG_VERBOSE, eli_main, { @@ -118,7 +120,8 @@ struct g_command class_commands[] = { { 'B', "backupfile", "", G_TYPE_STRING }, { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, - { 'K', "newkeyfile", "", G_TYPE_STRING }, + { 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'l', "keylen", "0", G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, { 's', "sectorsize", "0", G_TYPE_NUMBER }, @@ -129,12 +132,13 @@ struct g_command class_commands[] = { { "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main, { { 'd', "detach", NULL, G_TYPE_BOOL }, - { 'k', "keyfile", "", G_TYPE_STRING }, + { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-dprv] [-k keyfile] prov" + "[-dprv] [-j passfile] [-k keyfile] prov" }, { "detach", 0, NULL, { @@ -174,14 +178,16 @@ struct g_command class_commands[] = { { "setkey", G_FLAG_VERBOSE, eli_main, { { 'i', "iterations", "-1", G_TYPE_NUMBER }, - { 'k', "keyfile", "", G_TYPE_STRING }, - { 'K', "newkeyfile", "", G_TYPE_STRING }, + { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'J', "newpassfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'K', "newkeyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'n', "keyno", "-1", G_TYPE_NUMBER }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-pPv] [-n keyno] [-i iterations] [-k keyfile] [-K newkeyfile] prov" + "[-pPv] [-n keyno] [-i iterations] [-j passfile] [-J newpassfile] [-k keyfile] [-K newkeyfile] prov" }, { "delkey", G_FLAG_VERBOSE, eli_main, { @@ -249,7 +255,7 @@ eli_protect(struct gctl_req *req) } static void -eli_main(struct gctl_req *req, unsigned flags) +eli_main(struct gctl_req *req, unsigned int flags) { const char *name; @@ -295,7 +301,7 @@ arc4rand(unsigned char *buf, size_t size { uint32_t *buf4; size_t size4; - unsigned i; + unsigned int i; buf4 = (uint32_t *)buf; size4 = size / 4; @@ -324,123 +330,216 @@ eli_is_attached(const char *prov) return (0); } -static unsigned char * -eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, - int new) +static int +eli_genkey_files(struct gctl_req *req, bool new, const char *type, + struct hmac_ctx *ctxp, char *passbuf, size_t passbufsize) { - struct hmac_ctx ctx; - const char *str; - int error, nopassphrase; + char *p, buf[MAXPHYS], argname[16]; + const char *file; + int error, fd, i; + ssize_t done; + + assert((strcmp(type, "keyfile") == 0 && ctxp != NULL && + passbuf == NULL && passbufsize == 0) || + (strcmp(type, "passfile") == 0 && ctxp == NULL && + passbuf != NULL && passbufsize > 0)); + assert(strcmp(type, "keyfile") == 0 || passbuf[0] == '\0'); + + for (i = 0; ; i++) { + snprintf(argname, sizeof(argname), "%s%s%d", + new ? "new" : "", type, i); + + /* No more {key,pass}files? */ + if (!gctl_has_param(req, argname)) + return (i); - nopassphrase = - gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); + file = gctl_get_ascii(req, argname); + assert(file != NULL); - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - str = gctl_get_ascii(req, new ? "newkeyfile" : "keyfile"); - if (str[0] == '\0' && nopassphrase) { - gctl_error(req, "No key components given."); - return (NULL); - } else if (str[0] != '\0') { - char buf[MAXPHYS]; - ssize_t done; - int fd; - - if (strcmp(str, "-") == 0) + if (strcmp(file, "-") == 0) fd = STDIN_FILENO; else { - fd = open(str, O_RDONLY); + fd = open(file, O_RDONLY); if (fd == -1) { - gctl_error(req, "Cannot open keyfile %s: %s.", - str, strerror(errno)); - return (NULL); + gctl_error(req, "Cannot open %s %s: %s.", + type, file, strerror(errno)); + return (-1); + } + } + if (strcmp(type, "keyfile") == 0) { + while ((done = read(fd, buf, sizeof(buf))) > 0) + g_eli_crypto_hmac_update(ctxp, buf, done); + } else /* if (strcmp(type, "passfile") == 0) */ { + while ((done = read(fd, buf, sizeof(buf) - 1)) > 0) { + buf[done] = '\0'; + p = strchr(buf, '\n'); + if (p != NULL) { + *p = '\0'; + done = p - buf; + } + if (strlcat(passbuf, buf, passbufsize) >= + passbufsize) { + gctl_error(req, + "Passphrase in %s too long.", file); + bzero(buf, sizeof(buf)); + return (-1); + } + if (p != NULL) + break; } } - while ((done = read(fd, buf, sizeof(buf))) > 0) - g_eli_crypto_hmac_update(&ctx, buf, done); error = errno; - if (strcmp(str, "-") != 0) + if (strcmp(file, "-") != 0) close(fd); bzero(buf, sizeof(buf)); if (done == -1) { - gctl_error(req, "Cannot read keyfile %s: %s.", str, - strerror(error)); - return (NULL); + gctl_error(req, "Cannot read %s %s: %s.", + type, file, strerror(error)); + return (-1); } } + /* NOTREACHED */ +} - if (!nopassphrase) { - char buf1[BUFSIZ], buf2[BUFSIZ], *p; +static int +eli_genkey_passphrase_prompt(struct gctl_req *req, bool new, char *passbuf, + size_t passbufsize) +{ + char *p; - if (!new && md->md_iterations == -1) { - gctl_error(req, "Missing -p flag."); - return (NULL); + for (;;) { + p = readpassphrase( + new ? "Enter new passphrase:" : "Enter passphrase:", + passbuf, passbufsize, RPP_ECHO_OFF | RPP_REQUIRE_TTY); + if (p == NULL) { + bzero(passbuf, passbufsize); + gctl_error(req, "Cannot read passphrase: %s.", + strerror(errno)); + return (-1); } - for (;;) { - p = readpassphrase( - new ? "Enter new passphrase:" : "Enter passphrase:", - buf1, sizeof(buf1), RPP_ECHO_OFF | RPP_REQUIRE_TTY); + + if (new) { + char tmpbuf[BUFSIZ]; + + p = readpassphrase("Reenter new passphrase: ", + tmpbuf, sizeof(tmpbuf), + RPP_ECHO_OFF | RPP_REQUIRE_TTY); if (p == NULL) { - bzero(buf1, sizeof(buf1)); - gctl_error(req, "Cannot read passphrase: %s.", + bzero(passbuf, passbufsize); + gctl_error(req, + "Cannot read passphrase: %s.", strerror(errno)); - return (NULL); + return (-1); } - - if (new) { - p = readpassphrase("Reenter new passphrase: ", - buf2, sizeof(buf2), - RPP_ECHO_OFF | RPP_REQUIRE_TTY); - if (p == NULL) { - bzero(buf1, sizeof(buf1)); - gctl_error(req, - "Cannot read passphrase: %s.", - strerror(errno)); - return (NULL); - } - - if (strcmp(buf1, buf2) != 0) { - bzero(buf2, sizeof(buf2)); - fprintf(stderr, "They didn't match.\n"); - continue; - } - bzero(buf2, sizeof(buf2)); + + if (strcmp(passbuf, tmpbuf) != 0) { + bzero(passbuf, passbufsize); + fprintf(stderr, "They didn't match.\n"); + continue; } - break; + bzero(tmpbuf, sizeof(tmpbuf)); } - /* - * Field md_iterations equal to -1 means "choose some sane - * value for me". - */ - if (md->md_iterations == -1) { - assert(new); - if (verbose) - printf("Calculating number of iterations...\n"); - md->md_iterations = pkcs5v2_calculate(2000000); - assert(md->md_iterations > 0); - if (verbose) { - printf("Done, using %d iterations.\n", - md->md_iterations); - } + return (0); + } + /* NOTREACHED */ +} + +static int +eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, + struct hmac_ctx *ctxp) +{ + char passbuf[MAXPHYS]; + bool nopassphrase; + int nfiles; + + nopassphrase = + gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); + if (nopassphrase) { + if (gctl_has_param(req, new ? "newpassfile0" : "passfile0")) { + gctl_error(req, + "Options -%c and -%c are mutually exclusive.", + new ? 'J' : 'j', new ? 'P' : 'p'); + return (-1); } - /* - * If md_iterations is equal to 0, user don't want PKCS#5v2. - */ - if (md->md_iterations == 0) { - g_eli_crypto_hmac_update(&ctx, md->md_salt, - sizeof(md->md_salt)); - g_eli_crypto_hmac_update(&ctx, buf1, strlen(buf1)); - } else /* if (md->md_iterations > 0) */ { - unsigned char dkey[G_ELI_USERKEYLEN]; - - pkcs5v2_genkey(dkey, sizeof(dkey), md->md_salt, - sizeof(md->md_salt), buf1, md->md_iterations); - g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); - bzero(dkey, sizeof(dkey)); + return (0); + } + + if (!new && md->md_iterations == -1) { + gctl_error(req, "Missing -p flag."); + return (-1); + } + passbuf[0] = '\0'; + nfiles = eli_genkey_files(req, new, "passfile", NULL, passbuf, + sizeof(passbuf)); + if (nfiles == -1) + return (-1); + else if (nfiles == 0) { + if (eli_genkey_passphrase_prompt(req, new, passbuf, + sizeof(passbuf)) == -1) { + return (-1); } - bzero(buf1, sizeof(buf1)); } + /* + * Field md_iterations equal to -1 means "choose some sane + * value for me". + */ + if (md->md_iterations == -1) { + assert(new); + if (verbose) + printf("Calculating number of iterations...\n"); + md->md_iterations = pkcs5v2_calculate(2000000); + assert(md->md_iterations > 0); + if (verbose) { + printf("Done, using %d iterations.\n", + md->md_iterations); + } + } + /* + * If md_iterations is equal to 0, user doesn't want PKCS#5v2. + */ + if (md->md_iterations == 0) { + g_eli_crypto_hmac_update(ctxp, md->md_salt, + sizeof(md->md_salt)); + g_eli_crypto_hmac_update(ctxp, passbuf, strlen(passbuf)); + } else /* if (md->md_iterations > 0) */ { + unsigned char dkey[G_ELI_USERKEYLEN]; + + pkcs5v2_genkey(dkey, sizeof(dkey), md->md_salt, + sizeof(md->md_salt), passbuf, md->md_iterations); + g_eli_crypto_hmac_update(ctxp, dkey, sizeof(dkey)); + bzero(dkey, sizeof(dkey)); + } + bzero(passbuf, sizeof(passbuf)); + + return (0); +} + +static unsigned char * +eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key, + bool new) +{ + struct hmac_ctx ctx; + bool nopassphrase; + int nfiles; + + nopassphrase = + gctl_get_int(req, new ? "nonewpassphrase" : "nopassphrase"); + + g_eli_crypto_hmac_init(&ctx, NULL, 0); + + nfiles = eli_genkey_files(req, new, "keyfile", &ctx, NULL, 0); + if (nfiles == -1) + return (NULL); + else if (nfiles == 0 && nopassphrase) { + gctl_error(req, "No key components given."); + return (NULL); + } + + if (eli_genkey_passphrase(req, md, new, &ctx) == -1) + return (NULL); + g_eli_crypto_hmac_final(&ctx, key, 0); + return (key); } @@ -640,7 +739,7 @@ eli_init(struct gctl_req *req) arc4rand(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ - if (eli_genkey(req, &md, key, 1) == NULL) { + if (eli_genkey(req, &md, key, true) == NULL) { bzero(key, sizeof(key)); bzero(&md, sizeof(md)); return; @@ -720,7 +819,7 @@ eli_attach(struct gctl_req *req) return; } - if (eli_genkey(req, &md, key, 0) == NULL) { + if (eli_genkey(req, &md, key, false) == NULL) { bzero(key, sizeof(key)); return; } @@ -734,7 +833,7 @@ eli_attach(struct gctl_req *req) } static void -eli_configure_detached(struct gctl_req *req, const char *prov, int boot) +eli_configure_detached(struct gctl_req *req, const char *prov, bool boot) { struct g_eli_metadata md; @@ -761,7 +860,8 @@ static void eli_configure(struct gctl_req *req) { const char *prov; - int i, nargs, boot, noboot; + bool boot, noboot; + int i, nargs; nargs = gctl_get_int(req, "nargs"); if (nargs == 0) { @@ -806,7 +906,7 @@ eli_setkey_attached(struct gctl_req *req old = md->md_iterations; /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, 1) == NULL) { + if (eli_genkey(req, md, key, true) == NULL) { bzero(key, sizeof(key)); return; } @@ -831,8 +931,8 @@ eli_setkey_detached(struct gctl_req *req { unsigned char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN]; unsigned char *mkeydst; + unsigned int nkey; intmax_t val; - unsigned nkey; int error; if (md->md_keys == 0) { @@ -841,7 +941,7 @@ eli_setkey_detached(struct gctl_req *req } /* Generate key for Master Key decryption. */ - if (eli_genkey(req, md, key, 0) == NULL) { + if (eli_genkey(req, md, key, false) == NULL) { bzero(key, sizeof(key)); return; } @@ -897,7 +997,7 @@ eli_setkey_detached(struct gctl_req *req bzero(mkey, sizeof(mkey)); /* Generate key for Master Key encryption. */ - if (eli_genkey(req, md, key, 1) == NULL) { + if (eli_genkey(req, md, key, true) == NULL) { bzero(key, sizeof(key)); bzero(md, sizeof(*md)); return; @@ -959,9 +1059,9 @@ eli_delkey_detached(struct gctl_req *req { struct g_eli_metadata md; unsigned char *mkeydst; + unsigned int nkey; intmax_t val; - unsigned nkey; - int all, force; + bool all, force; if (eli_metadata_read(req, prov, &md) == -1) return; From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 17:41:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DFA6106566B; Sat, 25 Sep 2010 17:41:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3AC8FC14; Sat, 25 Sep 2010 17:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PHf2VW068932; Sat, 25 Sep 2010 17:41:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PHf2cb068930; Sat, 25 Sep 2010 17:41:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009251741.o8PHf2cb068930@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 25 Sep 2010 17:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213173 - head/tools/regression/geom_eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 17:41:02 -0000 Author: pjd Date: Sat Sep 25 17:41:02 2010 New Revision: 213173 URL: http://svn.freebsd.org/changeset/base/213173 Log: Add some regression tests for newly added -J and -j options. MFC after: 2 weeks Added: head/tools/regression/geom_eli/init-J.t (contents, props changed) Added: head/tools/regression/geom_eli/init-J.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_eli/init-J.t Sat Sep 25 17:41:02 2010 (r213173) @@ -0,0 +1,126 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` +no=45 +sectors=100 +keyfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 +passfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 +passfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 +mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 + +echo "1..150" + +dd if=/dev/random of=${keyfile0} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile0} +dd if=/dev/random bs=512 count=16 2>/dev/null | sha1 > ${passfile1} + +i=1 +for iter in -1 0 64; do + geli init -i ${iter} -B none -J ${passfile0} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -P -K ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -K ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${passfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${keyfile0} -k ${keyfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -k ${keyfile0} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -P -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli init -i ${iter} -B none -J ${passfile0} -J ${passfile1} -K ${keyfile0} -K ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -p md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile0} -j ${passfile1} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile0} -k ${keyfile1} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -k ${keyfile1} -k ${keyfile0} -j ${passfile1} -j ${passfile0} md${no} 2>/dev/null && echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} | geli attach -j - -j ${passfile1} -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile1} | geli attach -j ${passfile0} -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} | geli attach -j ${passfile0} -j ${passfile1} -k - -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k ${keyfile0} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${keyfile0} ${keyfile1} | geli attach -j ${passfile0} -j ${passfile1} -k - md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + cat ${passfile0} ${passfile1} | awk '{printf "%s", $0}' | geli attach -j - -k ${keyfile0} -k ${keyfile1} md${no} 2>/dev/null || echo -n "not " + echo "ok ${i}"; i=$((i+1)) + geli detach md${no} || echo -n "not " + echo "ok ${i}"; i=$((i+1)) +done + +mdconfig -d -u $no +rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} From owner-svn-src-head@FreeBSD.ORG Sat Sep 25 18:27:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6921106564A; Sat, 25 Sep 2010 18:27:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18828FC12; Sat, 25 Sep 2010 18:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8PIRT9W069996; Sat, 25 Sep 2010 18:27:29 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8PIRTPN069992; Sat, 25 Sep 2010 18:27:29 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201009251827.o8PIRTPN069992@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 25 Sep 2010 18:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213174 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2010 18:27:29 -0000 Author: ae Date: Sat Sep 25 18:27:29 2010 New Revision: 213174 URL: http://svn.freebsd.org/changeset/base/213174 Log: Some schemes can allocate memory for internal purposes but when GEOM does withering this memory doesn't freed. Add G_PART_DESTROY call to g_part_wither. Also add missed g_free() call to G_PART_READ method for MBR and PC98 schemes. Submitted by: jh (previous version) Reviewed by: pjd Approved by: kib (mentor) Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part.c Sat Sep 25 18:27:29 2010 (r213174) @@ -1273,6 +1273,7 @@ g_part_wither(struct g_geom *gp, int err table = gp->softc; if (table != NULL) { + G_PART_DESTROY(table, NULL); while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { LIST_REMOVE(entry, gpe_entry); g_free(entry); Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part_mbr.c Sat Sep 25 18:27:29 2010 (r213174) @@ -465,6 +465,7 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + g_free(buf); return (0); } Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sat Sep 25 17:41:02 2010 (r213173) +++ head/sys/geom/part/g_part_pc98.c Sat Sep 25 18:27:29 2010 (r213174) @@ -458,6 +458,7 @@ g_part_pc98_read(struct g_part_table *ba basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; + g_free(buf); return (0); }