From owner-svn-src-head@freebsd.org Sun Jan 13 00:19:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4646914A344A; Sun, 13 Jan 2019 00:19:16 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7616762B6; Sun, 13 Jan 2019 00:19:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C783EAD50; Sun, 13 Jan 2019 00:19:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D0JFEZ071229; Sun, 13 Jan 2019 00:19:15 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D0JFRD071228; Sun, 13 Jan 2019 00:19:15 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901130019.x0D0JFRD071228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 00:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342978 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7616762B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 00:19:16 -0000 Author: cognet Date: Sun Jan 13 00:19:15 2019 New Revision: 342978 URL: https://svnweb.freebsd.org/changeset/base/342978 Log: Instead of using an incomplete list of platforms that uses 64bits time_t in 32bits mode, special case amd64, as i386 is the only arch that still uses 32bits time_t. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Jan 12 22:36:33 2019 (r342977) +++ head/sys/kern/kern_tc.c Sun Jan 13 00:19:15 2019 (r342978) @@ -145,7 +145,8 @@ sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) getboottime(&boottime); -#ifndef __mips__ +/* i386 is the only arch which uses a 32bits time_t */ +#ifdef __amd64__ #ifdef SCTL_MASK32 int tv[2]; From owner-svn-src-head@freebsd.org Sun Jan 13 00:37:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EB1014A3D1B; Sun, 13 Jan 2019 00:37:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2F5876F47; Sun, 13 Jan 2019 00:37:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4537B0B0; Sun, 13 Jan 2019 00:37:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D0bVUr082073; Sun, 13 Jan 2019 00:37:31 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D0bVcE082072; Sun, 13 Jan 2019 00:37:31 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901130037.x0D0bVcE082072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 00:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342979 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 342979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2F5876F47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 00:37:32 -0000 Author: cognet Date: Sun Jan 13 00:37:31 2019 New Revision: 342979 URL: https://svnweb.freebsd.org/changeset/base/342979 Log: amd64 is the only arch that doesn't require padding for 32bits syscalls, so instead of listing every arch thar requires it, just exclude amd64. Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Jan 13 00:19:15 2019 (r342978) +++ head/sys/compat/freebsd32/syscalls.master Sun Jan 13 00:37:31 2019 (r342979) @@ -54,7 +54,7 @@ #include #include -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif From owner-svn-src-head@freebsd.org Sun Jan 13 00:38:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ABA014A3EA0; Sun, 13 Jan 2019 00:38:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFB1B7756A; Sun, 13 Jan 2019 00:38:56 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92BBDB0B8; Sun, 13 Jan 2019 00:38:56 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D0cu12082987; Sun, 13 Jan 2019 00:38:56 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D0ctiC082981; Sun, 13 Jan 2019 00:38:55 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901130038.x0D0ctiC082981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 00:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342980 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 342980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFB1B7756A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 00:38:57 -0000 Author: cognet Date: Sun Jan 13 00:38:55 2019 New Revision: 342980 URL: https://svnweb.freebsd.org/changeset/base/342980 Log: Regenerate sysent files after having modified syscalls.master. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Jan 13 00:37:31 2019 (r342979) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Jan 13 00:38:55 2019 (r342980) @@ -34,7 +34,7 @@ struct thread; #define PADR_(t) 0 #endif -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct freebsd32_wait4_args { @@ -167,7 +167,7 @@ struct freebsd32___sysctl_args { char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; - char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char new_l_[PADL_(const void *)]; const void * new; char new_r_[PADR_(const void *)]; char newlen_l_[PADL_(uint32_t)]; uint32_t newlen; char newlen_r_[PADR_(uint32_t)]; }; struct freebsd32_futimes_args { @@ -728,7 +728,7 @@ struct freebsd32_cpuset_setdomain_args { char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; }; -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); @@ -868,7 +868,7 @@ int freebsd32_cpuset_setdomain(struct thread *, struct #ifdef COMPAT_43 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct ofreebsd32_lseek_args { @@ -963,7 +963,7 @@ int ofreebsd32_getdirentries(struct thread *, struct o #ifdef COMPAT_FREEBSD4 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct freebsd4_freebsd32_getfsstat_args { @@ -1029,7 +1029,7 @@ int freebsd4_freebsd32_sigreturn(struct thread *, stru #ifdef COMPAT_FREEBSD6 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct freebsd6_freebsd32_pread_args { @@ -1119,7 +1119,7 @@ int freebsd6_freebsd32_lio_listio(struct thread *, str #ifdef COMPAT_FREEBSD7 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct freebsd7_freebsd32_semctl_args { @@ -1162,7 +1162,7 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct #ifdef COMPAT_FREEBSD10 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif #ifdef PAD64_REQUIRED @@ -1187,7 +1187,7 @@ int freebsd10_freebsd32_pipe(struct thread *, struct f #ifdef COMPAT_FREEBSD11 -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif struct freebsd11_freebsd32_stat_args { Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jan 13 00:37:31 2019 (r342979) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Jan 13 00:38:55 2019 (r342980) @@ -6,7 +6,7 @@ */ const char *freebsd32_syscallnames[] = { -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif "syscall", /* 0 = syscall */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jan 13 00:37:31 2019 (r342979) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Jan 13 00:38:55 2019 (r342980) @@ -53,7 +53,7 @@ /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jan 13 00:37:31 2019 (r342979) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Jan 13 00:38:55 2019 (r342980) @@ -11,7 +11,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg { int64_t *iarg = (int64_t *) uarg; switch (sysnum) { -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif /* nosys */ @@ -942,7 +942,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg uarg[1] = p->namelen; /* u_int */ uarg[2] = (intptr_t) p->old; /* void * */ uarg[3] = (intptr_t) p->oldlenp; /* uint32_t * */ - uarg[4] = (intptr_t) p->new; /* void * */ + uarg[4] = (intptr_t) p->new; /* const void * */ uarg[5] = p->newlen; /* uint32_t */ *n_args = 6; break; @@ -3320,7 +3320,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d { const char *p = NULL; switch (sysnum) { -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif /* nosys */ @@ -4823,7 +4823,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland uint32_t *"; break; case 4: - p = "userland void *"; + p = "userland const void *"; break; case 5: p = "uint32_t"; @@ -8916,7 +8916,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * { const char *p = NULL; switch (sysnum) { -#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif /* nosys */ From owner-svn-src-head@freebsd.org Sun Jan 13 02:28:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE191483E16; Sun, 13 Jan 2019 02:28:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F63A83F66; Sun, 13 Jan 2019 02:28:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24D63CA8D; Sun, 13 Jan 2019 02:28:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D2Scup041464; Sun, 13 Jan 2019 02:28:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D2SbWi041463; Sun, 13 Jan 2019 02:28:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901130228.x0D2SbWi041463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 13 Jan 2019 02:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342984 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 342984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F63A83F66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 02:28:38 -0000 Author: jhibbits Date: Sun Jan 13 02:28:37 2019 New Revision: 342984 URL: https://svnweb.freebsd.org/changeset/base/342984 Log: Add AT_HWCAP / AT_HWCAP2 to elf64_sysvec_v2. Summary: I was working on implementing ifuncs on powerpc64 elfv2 today, and I suddenly realized that the reason I was having so much trouble with AT_HWCAP and AT_HWCAP2 is they are missing from the sysentvec. After adding them, the auxv is being filled like it should. Submitted by: Brandon Bergren (git_bdragon.rtk0.net) Differential Revision: https://reviews.freebsd.org/D18575 Modified: head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Sun Jan 13 02:27:10 2019 (r342983) +++ head/sys/powerpc/powerpc/elf64_machdep.c Sun Jan 13 02:28:37 2019 (r342984) @@ -125,6 +125,9 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, + .sv_hwcap = &cpu_features, + .sv_hwcap2 = &cpu_features2, }; INIT_SYSENTVEC(elf64_sysvec_v2, &elf64_freebsd_sysvec_v2); From owner-svn-src-head@freebsd.org Sun Jan 13 02:33:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B0E1484173; Sun, 13 Jan 2019 02:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DDC38448C; Sun, 13 Jan 2019 02:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02FC7CC5C; Sun, 13 Jan 2019 02:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D2XKA2046600; Sun, 13 Jan 2019 02:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D2XKma046599; Sun, 13 Jan 2019 02:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901130233.x0D2XKma046599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 13 Jan 2019 02:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342985 - head/libexec/rtld-elf/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc64 X-SVN-Commit-Revision: 342985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DDC38448C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 02:33:21 -0000 Author: jhibbits Date: Sun Jan 13 02:33:20 2019 New Revision: 342985 URL: https://svnweb.freebsd.org/changeset/base/342985 Log: Fix rtld-elf compilation warning for powerpc64 ELFv2 ABI Summary: reloc_jmpslot function parameter 'defobj' is not used when using ELFv2 ABI Submitted by: alfredo.junior_eldorado.org.br Reviewed By: kib, git_bdragon.rtk0.net, emaste, jhibbits Differential Revision: https://reviews.freebsd.org/D18808 Modified: head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Sun Jan 13 02:28:37 2019 (r342984) +++ head/libexec/rtld-elf/powerpc64/reloc.c Sun Jan 13 02:33:20 2019 (r342985) @@ -447,7 +447,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat * Update the value of a PLT jump slot. */ Elf_Addr -reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, +reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj __unused, const Obj_Entry *obj __unused, const Elf_Rel *rel __unused) { From owner-svn-src-head@freebsd.org Sun Jan 13 05:30:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63F8D1489E6B; Sun, 13 Jan 2019 05:30:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A92C8BB9B; Sun, 13 Jan 2019 05:30:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41DEED47; Sun, 13 Jan 2019 05:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D5UQL6037074; Sun, 13 Jan 2019 05:30:26 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D5UQjG037073; Sun, 13 Jan 2019 05:30:26 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901130530.x0D5UQjG037073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 13 Jan 2019 05:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342989 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 342989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A92C8BB9B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 05:30:27 -0000 Author: kp Date: Sun Jan 13 05:30:26 2019 New Revision: 342989 URL: https://svnweb.freebsd.org/changeset/base/342989 Log: pfctl: Fix 'set skip' handling for groups When we skip on a group the kernel will automatically skip on the member interfaces. We still need to update our own cache though, or we risk overruling the kernel afterwards. This manifested as 'set skip' working initially, then not working when the rules were reloaded. PR: 229241 MFC after: 1 week Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Sun Jan 13 04:51:24 2019 (r342988) +++ head/sbin/pfctl/pfctl.c Sun Jan 13 05:30:26 2019 (r342989) @@ -1977,6 +1977,7 @@ int pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) { struct pfioc_iface pi; + struct node_host *h = NULL, *n = NULL; if ((loadopt & PFCTL_FLAG_OPTION) == 0) return (0); @@ -1984,6 +1985,12 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifna bzero(&pi, sizeof(pi)); pi.pfiio_flags = flags; + + /* Make sure our cache matches the kernel. If we set or clear the flag + * for a group this applies to all members. */ + h = ifa_grouplookup(ifname, 0); + for (n = h; n != NULL; n = n->next) + pfctl_set_interface_flags(pf, n->ifname, flags, how); if (strlcpy(pi.pfiio_name, ifname, sizeof(pi.pfiio_name)) >= sizeof(pi.pfiio_name)) From owner-svn-src-head@freebsd.org Sun Jan 13 06:01:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4D0C148AA8C; Sun, 13 Jan 2019 06:01:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5504C8C74E; Sun, 13 Jan 2019 06:01:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44934F3DC; Sun, 13 Jan 2019 06:01:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D61bwW054028; Sun, 13 Jan 2019 06:01:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D61bAB054027; Sun, 13 Jan 2019 06:01:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901130601.x0D61bAB054027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Jan 2019 06:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342991 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 342991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5504C8C74E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 06:01:38 -0000 Author: avos Date: Sun Jan 13 06:01:36 2019 New Revision: 342991 URL: https://svnweb.freebsd.org/changeset/base/342991 Log: net80211: provide rate validation for injected frames. There may be various side effects (device timeout, firmware and / or kernel panic) when an invalid (or inapplicable - e.g., an MCS rate for 11g-only device) is set; check rates before sending the frame to the driver. How-to-reproduce: Set an MCS (real or bogus - with 0x80 bit set) rate in ibp_rate0 field for any device that uses ieee80211_isratevalid() for rate checks - rum(4), run(4), ural(4), bwi(4) or ral(4); if kernel is compiled with INVARIANTS the check will result in "rate %d is basic/mcs?" panic. Tested with WUSB54GC (rum(4)), AP mode. MFC after: 1 week Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jan 13 05:31:53 2019 (r342990) +++ head/sys/net80211/ieee80211_output.c Sun Jan 13 06:01:36 2019 (r342991) @@ -604,6 +604,97 @@ ieee80211_validate_frame(struct mbuf *m, return (0); } +static int +ieee80211_validate_rate(struct ieee80211_node *ni, uint8_t rate) +{ + struct ieee80211com *ic = ni->ni_ic; + + if (IEEE80211_IS_HT_RATE(rate)) { + if ((ic->ic_htcaps & IEEE80211_HTC_HT) == 0) + return (EINVAL); + + rate = IEEE80211_RV(rate); + if (rate <= 31) { + if (rate > ic->ic_txstream * 8 - 1) + return (EINVAL); + + return (0); + } + + if (rate == 32) { + if ((ic->ic_htcaps & IEEE80211_HTC_TXMCS32) == 0) + return (EINVAL); + + return (0); + } + + if ((ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) == 0) + return (EINVAL); + + switch (ic->ic_txstream) { + case 0: + case 1: + return (EINVAL); + case 2: + if (rate > 38) + return (EINVAL); + + return (0); + case 3: + if (rate > 52) + return (EINVAL); + + return (0); + case 4: + default: + if (rate > 76) + return (EINVAL); + + return (0); + } + } + + if (!ieee80211_isratevalid(ic->ic_rt, rate)) + return (EINVAL); + + return (0); +} + +static int +ieee80211_sanitize_rates(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + int error; + + if (!params) + return (0); /* nothing to do */ + + /* NB: most drivers assume that ibp_rate0 is set (!= 0). */ + if (params->ibp_rate0 != 0) { + error = ieee80211_validate_rate(ni, params->ibp_rate0); + if (error != 0) + return (error); + } else { + /* XXX pre-setup some default (e.g., mgmt / mcast) rate */ + /* XXX __DECONST? */ + (void) m; + } + + if (params->ibp_rate1 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate1)) != 0) + return (error); + + if (params->ibp_rate2 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate2)) != 0) + return (error); + + if (params->ibp_rate3 != 0 && + (error = ieee80211_validate_rate(ni, params->ibp_rate3)) != 0) + return (error); + + return (0); +} + /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting @@ -717,6 +808,10 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, m->m_pkthdr.len - ieee80211_hdrsize(wh)); } else M_WME_SETAC(m, WME_AC_BE); + + error = ieee80211_sanitize_rates(ni, m, params); + if (error != 0) + senderr(error); IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { From owner-svn-src-head@freebsd.org Sun Jan 13 04:51:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41F101488EDA; Sun, 13 Jan 2019 04:51:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D83D38ADF5; Sun, 13 Jan 2019 04:51:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6D78E6BE; Sun, 13 Jan 2019 04:51:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D4pOR3020437; Sun, 13 Jan 2019 04:51:24 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D4pOfS020436; Sun, 13 Jan 2019 04:51:24 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901130451.x0D4pOfS020436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 13 Jan 2019 04:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342988 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 342988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D83D38ADF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 04:51:25 -0000 Author: jhibbits Date: Sun Jan 13 04:51:24 2019 New Revision: 342988 URL: https://svnweb.freebsd.org/changeset/base/342988 Log: powerpcspe: Correct SPE high-component loading Don't clobber the low part of the register restoring the high component of. This could lead to very bad behavior if it's an ABI-affected register. While here, also mark the asm volatile in the SPE high save case, to match the load case. Reported by: Branden Bergren (git_bdragon.rtk0.net) MFC after: 1 week Modified: head/sys/powerpc/booke/spe.c Modified: head/sys/powerpc/booke/spe.c ============================================================================== --- head/sys/powerpc/booke/spe.c Sun Jan 13 02:38:14 2019 (r342987) +++ head/sys/powerpc/booke/spe.c Sun Jan 13 04:51:24 2019 (r342988) @@ -425,7 +425,7 @@ static uint32_t spe_save_reg_high(int reg) { uint32_t vec[2]; -#define EVSTDW(n) case n: __asm ("evstdw %1,0(%0)" \ +#define EVSTDW(n) case n: __asm __volatile ("evstdw %1,0(%0)" \ :: "b"(vec), "n"(n)); break; switch (reg) { EVSTDW(0); EVSTDW(1); EVSTDW(2); EVSTDW(3); @@ -448,7 +448,7 @@ spe_save_reg_high(int reg) static void spe_load_reg_high(int reg, uint32_t val) { -#define EVLDW(n) case n: __asm __volatile("evmergelo "#n",%0,0," \ +#define EVLDW(n) case n: __asm __volatile("evmergelo "#n",%0,"#n \ :: "r"(val)); break; switch (reg) { EVLDW(1); EVLDW(2); EVLDW(3); EVLDW(4); From owner-svn-src-head@freebsd.org Sun Jan 13 05:31:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ADC91489EC5; Sun, 13 Jan 2019 05:31:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3082C8BD64; Sun, 13 Jan 2019 05:31:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26198EEC4; Sun, 13 Jan 2019 05:31:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0D5VsRf041676; Sun, 13 Jan 2019 05:31:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0D5VrJP041675; Sun, 13 Jan 2019 05:31:53 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901130531.x0D5VrJP041675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 13 Jan 2019 05:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342990 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 342990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3082C8BD64 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 05:31:54 -0000 Author: kp Date: Sun Jan 13 05:31:53 2019 New Revision: 342990 URL: https://svnweb.freebsd.org/changeset/base/342990 Log: pf tests: Test PR 229241 pfctl has an issue with 'set skip on ', which causes inconsistent behaviour: the set skip directive works initially, but does not take effect when the same rules are re-applied. PR: 229241 MFC after: 1 week Modified: head/tests/sys/netpfil/pf/set_skip.sh head/tests/sys/netpfil/pf/utils.subr Modified: head/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_skip.sh Sun Jan 13 05:30:26 2019 (r342989) +++ head/tests/sys/netpfil/pf/set_skip.sh Sun Jan 13 05:31:53 2019 (r342990) @@ -30,7 +30,38 @@ set_skip_group_cleanup() pft_cleanup } +atf_test_case "set_skip_group_lo" "cleanup" +set_skip_group_lo_head() +{ + atf_set descr 'Basic set skip test, lo' + atf_set require.user root +} + +set_skip_group_lo_body() +{ + # See PR 229241 + pft_init + + pft_mkjail alcatraz + jexec alcatraz ifconfig lo0 127.0.0.1/8 up + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on lo" \ + "block on lo0" + + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + pft_set_rules noflush alcatraz "set skip on lo" \ + "block on lo0" + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + jexec alcatraz pfctl -s rules +} + +set_skip_group_lo_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "set_skip_group" + atf_add_test_case "set_skip_group_lo" } Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Sun Jan 13 05:30:26 2019 (r342989) +++ head/tests/sys/netpfil/pf/utils.subr Sun Jan 13 05:31:53 2019 (r342990) @@ -49,8 +49,14 @@ pft_set_rules() jname=$1 shift - # Flush all states, rules, fragments, ... - jexec ${jname} pfctl -F all + if [ $jname == "noflush" ]; + then + jname=$1 + shift + else + # Flush all states, rules, fragments, ... + jexec ${jname} pfctl -F all + fi while [ $# -gt 0 ]; do printf "$1\n" From owner-svn-src-head@freebsd.org Sun Jan 13 19:49:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75667148373D; Sun, 13 Jan 2019 19:49:50 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D9DA8C05C; Sun, 13 Jan 2019 19:49:49 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F1EC200FD; Sun, 13 Jan 2019 19:49:49 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0DJnnue090008; Sun, 13 Jan 2019 19:49:49 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0DJnkRL089992; Sun, 13 Jan 2019 19:49:46 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901131949.x0DJnkRL089992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 19:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343004 - in head/sys/arm64: arm64 conf include X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in head/sys/arm64: arm64 conf include X-SVN-Commit-Revision: 343004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D9DA8C05C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 19:49:50 -0000 Author: cognet Date: Sun Jan 13 19:49:46 2019 New Revision: 343004 URL: https://svnweb.freebsd.org/changeset/base/343004 Log: Impleent COMPAT_FREEBSD32 for arm64. This is based on early work by andrew@. Modified: head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/arm64/freebsd32_machdep.c head/sys/arm64/arm64/identcpu.c head/sys/arm64/arm64/locore.S head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/undefined.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/conf/GENERIC head/sys/arm64/include/armreg.h head/sys/arm64/include/elf.h head/sys/arm64/include/frame.h head/sys/arm64/include/reg.h head/sys/arm64/include/ucontext.h head/sys/arm64/include/vfp.h Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/elf32_machdep.c Sun Jan 13 19:49:46 2019 (r343004) @@ -1,6 +1,15 @@ /*- - * Copyright (c) 2017 Nuxi, https://nuxi.nl/ + * Copyright (c) 2014, 2015 The FreeBSD Foundation. + * Copyright (c) 2014, 2017 Andrew Turner. + * Copyright (c) 2018 Olivier Houchard + * All rights reserved. * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -26,13 +35,225 @@ #include __FBSDID("$FreeBSD$"); -#include -#define __ELF_WORD_SIZE 32 +#define __ELF_WORD_SIZE 32 + +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include -void -elf32_dump_thread(struct thread *td __unused, void *dst __unused, - size_t *off __unused) +#include + +#include + +#define FREEBSD32_MINUSER 0x00001000 +#define FREEBSD32_MAXUSER ((1ul << 32) - PAGE_SIZE) +#define FREEBSD32_SHAREDPAGE (FREEBSD32_MAXUSER - PAGE_SIZE) +#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE + +extern const char *freebsd32_syscallnames[]; + +extern char aarch32_sigcode[]; +extern int sz_aarch32_sigcode; + +static int freebsd32_fetch_syscall_args(struct thread *td); +static void freebsd32_setregs(struct thread *td, struct image_params *imgp, + u_long stack); +static void freebsd32_set_syscall_retval(struct thread *, int); + +static boolean_t elf32_arm_abi_supported(struct image_params *); + +extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); + +static struct sysentvec elf32_freebsd_sysvec = { + .sv_size = SYS_MAXSYSCALL, + .sv_table = freebsd32_sysent, + .sv_errsize = 0, + .sv_errtbl = NULL, + .sv_transtrap = NULL, + .sv_fixup = elf32_freebsd_fixup, + .sv_sendsig = freebsd32_sendsig, + .sv_sigcode = aarch32_sigcode, + .sv_szsigcode = &sz_aarch32_sigcode, + .sv_name = "FreeBSD ELF32", + .sv_coredump = elf32_coredump, + .sv_imgact_try = NULL, + .sv_minsigstksz = MINSIGSTKSZ, + .sv_pagesize = PAGE_SIZE, + .sv_minuser = FREEBSD32_MINUSER, + .sv_maxuser = FREEBSD32_MAXUSER, + .sv_usrstack = FREEBSD32_USRSTACK, + .sv_psstrings = FREEBSD32_PS_STRINGS, + .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, + .sv_copyout_strings = freebsd32_copyout_strings, + .sv_setregs = freebsd32_setregs, + .sv_fixlimit = NULL, // XXX + .sv_maxssiz = NULL, + .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_TIMEKEEP, + .sv_set_syscall_retval = freebsd32_set_syscall_retval, + .sv_fetch_syscall_args = freebsd32_fetch_syscall_args, + .sv_syscallnames = freebsd32_syscallnames, + .sv_shared_page_base = FREEBSD32_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, + .sv_thread_detach = NULL, + .sv_trap = NULL, +}; +INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); + +static Elf32_Brandinfo freebsd32_brand_info = { + .brand = ELFOSABI_FREEBSD, + .machine = EM_ARM, + .compat_3_brand = "FreeBSD", + .emul_path = NULL, + .interp_path = "/libexec/ld-elf.so.1", + .sysvec = &elf32_freebsd_sysvec, + .interp_newpath = NULL, + .brand_note = &elf32_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE, + .header_supported= elf32_arm_abi_supported, +}; + +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, + (sysinit_cfunc_t)elf32_insert_brand_entry, &freebsd32_brand_info); + +static boolean_t +elf32_arm_abi_supported(struct image_params *imgp) { + const Elf32_Ehdr *hdr; + /* Check if we support AArch32 */ + if (ID_AA64PFR0_EL0(READ_SPECIALREG(id_aa64pfr0_el1)) != + ID_AA64PFR0_EL0_64_32) + return (FALSE); + +#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) +#define EF_ARM_EABI_FREEBSD_MIN 4 + hdr = (const Elf32_Ehdr *)imgp->image_header; + if (EF_ARM_EABI_VERSION(hdr->e_flags) < EF_ARM_EABI_FREEBSD_MIN) { + if (bootverbose) + uprintf("Attempting to execute non EABI binary " + "(rev %d) image %s", + EF_ARM_EABI_VERSION(hdr->e_flags), + imgp->args->fname); + return (FALSE); + } + + return (TRUE); +} + +static int +freebsd32_fetch_syscall_args(struct thread *td) +{ + struct proc *p; + register_t *ap; + struct syscall_args *sa; + int error, i, nap; + unsigned int args[4]; + + nap = 4; + p = td->td_proc; + ap = td->td_frame->tf_x; + sa = &td->td_sa; + + /* r7 is the syscall id */ + sa->code = td->td_frame->tf_x[7]; + + if (sa->code == SYS_syscall) { + sa->code = *ap++; + nap--; + } else if (sa->code == SYS___syscall) { + sa->code = ap[1]; + nap -= 2; + ap += 2; + } + + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; + else + sa->callp = &p->p_sysent->sv_table[sa->code]; + + sa->narg = sa->callp->sy_narg; + for (i = 0; i < nap; i++) + sa->args[i] = ap[i]; + if (sa->narg > nap) { + if ((sa->narg - nap) > nitems(args)) + panic("Too many system call arguiments"); + error = copyin((void *)td->td_frame->tf_x[13], args, + (sa->narg - nap) * sizeof(int)); + for (i = 0; i < (sa->narg - nap); i++) + sa->args[i + nap] = args[i]; + } + + td->td_retval[0] = 0; + td->td_retval[1] = 0; + + return (0); +} + +static void +freebsd32_set_syscall_retval(struct thread *td, int error) +{ + struct trapframe *frame; + + frame = td->td_frame; + switch (error) { + case 0: + frame->tf_x[0] = td->td_retval[0]; + frame->tf_x[1] = td->td_retval[1]; + frame->tf_spsr &= ~PSR_C; + break; + case ERESTART: + /* + * Reconstruct the pc to point at the swi. + */ + if ((frame->tf_spsr & PSR_T) != 0) + frame->tf_elr -= 2; //THUMB_INSN_SIZE; + else + frame->tf_elr -= 4; //INSN_SIZE; + break; + case EJUSTRETURN: + /* nothing to do */ + break; + default: + frame->tf_x[0] = error; + frame->tf_spsr |= PSR_C; + break; + } +} + +static void +freebsd32_setregs(struct thread *td, struct image_params *imgp, + u_long stack) +{ + struct trapframe *tf = td->td_frame; + + memset(tf, 0, sizeof(struct trapframe)); + + /* + * We need to set x0 for init as it doesn't call + * cpu_set_syscall_retval to copy the value. We also + * need to set td_retval for the cases where we do. + */ + tf->tf_x[0] = stack; + /* SP_usr is mapped to x13 */ + tf->tf_x[13] = stack; + /* LR_usr is mapped to x14 */ + tf->tf_x[14] = imgp->entry_addr; + tf->tf_elr = imgp->entry_addr; + tf->tf_spsr = PSR_M_32; +} + +void +elf32_dump_thread(struct thread *td, void *dst, size_t *off) +{ + /* XXX: VFP */ } Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/freebsd32_machdep.c Sun Jan 13 19:49:46 2019 (r343004) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2018 Olivier Houchard * Copyright (c) 2017 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without @@ -27,44 +28,382 @@ __FBSDID("$FreeBSD$"); #include - +#include +#include +#include +#include +#include +#include +#include +#ifdef VFP +#include +#endif #include +#include +extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); + /* + * The first two fields of a ucontext_t are the signal mask and the machine + * context. The next field is uc_link; we want to avoid destroying the link + * when copying out contexts. + */ +#define UC32_COPY_SIZE offsetof(ucontext32_t, uc_link) + +#ifdef VFP +static void get_fpcontext32(struct thread *td, mcontext32_vfp_t *); +#endif + +/* * Stubs for machine dependent 32-bits system calls. */ int +freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) +{ + int error; + +#define ARM_SYNC_ICACHE 0 +#define ARM_DRAIN_WRITEBUF 1 +#define ARM_SET_TP 2 +#define ARM_GET_TP 3 +#define ARM_GET_VFPSTATE 4 + + switch(uap->op) { + case ARM_SET_TP: + WRITE_SPECIALREG(TPIDR_EL0, uap->parms); + WRITE_SPECIALREG(TPIDRRO_EL0, uap->parms); + return 0; + case ARM_SYNC_ICACHE: + { + struct { + uint32_t addr; + uint32_t size; + } args; + + if ((error = copyin(uap->parms, &args, sizeof(args))) != 0) + return (error); + if ((uint64_t)args.addr + (uint64_t)args.size > 0xffffffff) + return (EINVAL); + cpu_icache_sync_range(args.addr, args.size); + return 0; + } + case ARM_GET_VFPSTATE: + { + mcontext32_vfp_t mcontext_vfp; + + struct { + uint32_t mc_vfp_size; + uint32_t mc_vfp; + } args; + if ((error = copyin(uap->parms, &args, sizeof(args))) != 0) + return (error); + if (args.mc_vfp_size != sizeof(mcontext_vfp)) + return (EINVAL); +#ifdef VFP + get_fpcontext32(td, &mcontext_vfp); +#else + bzero(&mcontext_vfp, sizeof(mcontext_vfp)); +#endif + error = copyout(&mcontext_vfp, + (void *)(uintptr_t)args.mc_vfp, + sizeof(mcontext_vfp)); + return error; + } + } + + return (EINVAL); +} + + + +#ifdef VFP +static void +get_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) +{ + struct pcb *curpcb; + + critical_enter(); + curpcb = curthread->td_pcb; + + if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + /* + * If we have just been running VFP instructions we will + * need to save the state to memcpy it below. + */ + vfp_save_state(td, curpcb); + + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called get_fpcontext while the kernel is using the VFP")); + KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Non-userspace FPU flags set in get_fpcontext")); + memcpy(mcp->mcv_reg, curpcb->pcb_fpustate.vfp_regs, + sizeof(mcp->mcv_reg)); + mcp->mcv_fpscr = VFP_FPSCR_FROM_SRCR(curpcb->pcb_fpustate.vfp_fpcr, + curpcb->pcb_fpustate.vfp_fpsr); + } + critical_exit(); +} + +static void +set_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) +{ + struct pcb *pcb; + + critical_enter(); + pcb = td->td_pcb; + if (td == curthread) + vfp_discard(td); + memcpy(pcb->pcb_fpustate.vfp_regs, mcp->mcv_reg, + sizeof(pcb->pcb_fpustate.vfp_regs)); + pcb->pcb_fpustate.vfp_fpsr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); + pcb->pcb_fpustate.vfp_fpcr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); + critical_exit(); +} +#endif +static void +get_mcontext32(struct thread *td, mcontext32_t *mcp, int flags) +{ + struct pcb *pcb; + struct trapframe *tf; + int i; + + pcb = td->td_pcb; + tf = td->td_frame; + + if ((flags & GET_MC_CLEAR_RET) != 0) { + mcp->mc_gregset[0] = 0; + mcp->mc_gregset[16] = tf->tf_spsr & ~PSR_C; + } else { + mcp->mc_gregset[0] = tf->tf_x[0]; + mcp->mc_gregset[16] = tf->tf_spsr; + } + for (i = 1; i < 15; i++) + mcp->mc_gregset[i] = tf->tf_x[i]; + mcp->mc_gregset[15] = tf->tf_elr; + + mcp->mc_vfp_size = 0; + mcp->mc_vfp_ptr = 0; + + memset(mcp->mc_spare, 0, sizeof(mcp->mc_spare)); +} + +static int +set_mcontext32(struct thread *td, mcontext32_t *mcp) +{ + struct trapframe *tf; + mcontext32_vfp_t mc_vfp; + int i; + + tf = td->td_frame; + + for (i = 0; i < 15; i++) + tf->tf_x[i] = mcp->mc_gregset[i]; + tf->tf_elr = mcp->mc_gregset[15]; + tf->tf_spsr = mcp->mc_gregset[16]; +#ifdef VFP + if (mcp->mc_vfp_size == sizeof(mc_vfp) && mcp->mc_vfp_ptr != 0) { + if (copyin((void *)(uintptr_t)mcp->mc_vfp_ptr, &mc_vfp, + sizeof(mc_vfp)) != 0) + return (EFAULT); + set_fpcontext32(td, &mc_vfp); + } +#endif + + return (0); +} + +#define UC_COPY_SIZE offsetof(ucontext32_t, uc_link) + +int freebsd32_getcontext(struct thread *td, struct freebsd32_getcontext_args *uap) { + ucontext32_t uc; + int ret; - return (ENOSYS); + if (uap->ucp == NULL) + ret = EINVAL; + else { + memset(&uc, 0, sizeof(uc)); + get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); + PROC_LOCK(td->td_proc); + uc.uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); + ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); + } + return (ret); } int freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap) { + ucontext32_t uc; + int ret; - return (ENOSYS); + if (uap->ucp == NULL) + ret = EINVAL; + else { + ret = copyin(uap->ucp, &uc, UC_COPY_SIZE); + if (ret == 0) { + ret = set_mcontext32(td, &uc.uc_mcontext); + if (ret == 0) + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, + NULL, 0); + } + } + return (ret); } int freebsd32_sigreturn(struct thread *td, struct freebsd32_sigreturn_args *uap) { + ucontext32_t uc; + int error; - return (ENOSYS); + if (uap == NULL) + return (EFAULT); + if (copyin(uap->sigcntxp, &uc, sizeof(uc))) + return (EFAULT); + error = set_mcontext32(td, &uc.uc_mcontext); + if (error != 0) + return (0); + + /* Restore signal mask. */ + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); + + return (EJUSTRETURN); + } int freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap) { + ucontext32_t uc; + int ret; - return (ENOSYS); + if (uap->oucp == NULL || uap->ucp == NULL) + ret = EINVAL; + else { + get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); + PROC_LOCK(td->td_proc); + uc.uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); + ret = copyout(&uc, uap->oucp, UC32_COPY_SIZE); + if (ret == 0) { + ret = copyin(uap->ucp, &uc, UC32_COPY_SIZE); + if (ret == 0) { + ret = set_mcontext32(td, &uc.uc_mcontext); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); + } + } + } + return (ret); } -int -freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) +void +freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { + struct thread *td; + struct proc *p; + struct trapframe *tf; + struct sigframe32 *fp, frame; + struct sigacts *psp; + struct siginfo32 siginfo; + struct sysentvec *sysent; + int onstack; + int sig; + int code; - return (ENOSYS); + siginfo_to_siginfo32(&ksi->ksi_info, &siginfo); + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + code = ksi->ksi_code; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + tf = td->td_frame; + onstack = sigonstack(tf->tf_x[13]); + + CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, + catcher, sig); + + /* Allocate and validate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct sigframe32 *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + fp = (struct sigframe32 *)td->td_frame->tf_x[13]; + + /* make room on the stack */ + fp--; + + /* make the stack aligned */ + fp = (struct sigframe32 *)((unsigned long)(fp) &~ (8 - 1)); + /* Populate the siginfo frame. */ + get_mcontext32(td, &frame.sf_uc.uc_mcontext, 0); +#ifdef VFP + get_fpcontext32(td, &frame.sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_size = sizeof(fp->sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_ptr = (uint32_t)(uintptr_t)&fp->sf_vfp; +#else + frame.sf_uc.uc_mcontext.mc_vfp_size = 0; + frame.sf_uc.uc_mcontext.mc_vfp_ptr = (uint32_t)NULL; +#endif + frame.sf_si = siginfo; + frame.sf_uc.uc_sigmask = *mask; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) + ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; + frame.sf_uc.uc_stack.ss_sp = (uintptr_t)td->td_sigstk.ss_sp; + frame.sf_uc.uc_stack.ss_size = td->td_sigstk.ss_size; + + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(td->td_proc); + + /* Copy the sigframe out to the user's stack. */ + if (copyout(&frame, fp, sizeof(*fp)) != 0) { + /* Process has trashed its stack. Kill it. */ + CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + /* + * Build context to run handler in. We invoke the handler + * directly, only returning via the trampoline. Note the + * trampoline version numbers are coordinated with machine- + * dependent code in libc. + */ + + tf->tf_x[0] = sig; + tf->tf_x[1] = (register_t)&fp->sf_si; + tf->tf_x[2] = (register_t)&fp->sf_uc; + + /* the trampoline uses r5 as the uc address */ + tf->tf_x[5] = (register_t)&fp->sf_uc; + tf->tf_elr = (register_t)catcher; + tf->tf_x[13] = (register_t)fp; + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_x[14] = (register_t)sysent->sv_sigcode_base; + else + tf->tf_x[14] = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); + /* Set the mode to enter in the signal handler */ + if ((register_t)catcher & 1) + tf->tf_spsr |= PSR_T; + else + tf->tf_spsr &= ~PSR_T; + + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_x[14], + tf->tf_x[13]); + + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); + } Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/identcpu.c Sun Jan 13 19:49:46 2019 (r343004) @@ -49,8 +49,28 @@ static int ident_lock; char machine[] = "arm64"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, - "Machine class"); +#ifdef SCTL_MASK32 +extern int adaptive_machine_arch; +#endif + +static int +sysctl_hw_machine(SYSCTL_HANDLER_ARGS) +{ +#ifdef SCTL_MASK32 + static const char machine32[] = "arm"; +#endif + int error; +#ifdef SCTL_MASK32 + if ((req->flags & SCTL_MASK32) != 0 && adaptive_machine_arch) + error = SYSCTL_OUT(req, machine32, sizeof(machine32)); + else +#endif + error = SYSCTL_OUT(req, machine, sizeof(machine)); + return (error); +} + +SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); /* * Per-CPU affinity as provided in MPIDR_EL1 Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/locore.S Sun Jan 13 19:49:46 2019 (r343004) @@ -699,3 +699,21 @@ esigcode: .global szsigcode szsigcode: .quad esigcode - sigcode + +ENTRY(aarch32_sigcode) + .word 0xe1a0000d // mov r0, sp + .word 0xe2800040 // add r0, r0, #SIGF_UC + .word 0xe59f700c // ldr r7, [pc, #12] + .word 0xef000000 // swi #0 + .word 0xe59f7008 // ldr r7, [pc, #8] + .word 0xef000000 // swi #0 + .word 0xeafffffa // b . - 16 +END(aarch32_sigcode) + .word SYS_sigreturn + .word SYS_exit + .align 3 +aarch32_esigcode: + .data + .global sz_aarch32_sigcode +sz_aarch32_sigcode: + .quad aarch32_esigcode - aarch32_sigcode Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/machdep.c Sun Jan 13 19:49:46 2019 (r343004) @@ -276,17 +276,36 @@ set_dbregs(struct thread *td, struct dbreg *regs) int fill_regs32(struct thread *td, struct reg32 *regs) { + int i; + struct trapframe *tf; - printf("ARM64TODO: fill_regs32"); - return (EDOOFUS); + tf = td->td_frame; + for (i = 0; i < 13; i++) + regs->r[i] = tf->tf_x[i]; + regs->r_sp = tf->tf_sp; + regs->r_lr = tf->tf_lr; + regs->r_pc = tf->tf_elr; + regs->r_cpsr = tf->tf_spsr; + + return (0); } int set_regs32(struct thread *td, struct reg32 *regs) { + int i; + struct trapframe *tf; - printf("ARM64TODO: set_regs32"); - return (EDOOFUS); + tf = td->td_frame; + for (i = 0; i < 13; i++) + tf->tf_x[i] = regs->r[i]; + tf->tf_sp = regs->r_sp; + tf->tf_lr = regs->r_lr; + tf->tf_elr = regs->r_pc; + tf->tf_spsr = regs->r_cpsr; + + + return (0); } int Modified: head/sys/arm64/arm64/undefined.c ============================================================================== --- head/sys/arm64/arm64/undefined.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/undefined.c Sun Jan 13 19:49:46 2019 (r343004) @@ -35,10 +35,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include +#include #include #include +#include MALLOC_DEFINE(M_UNDEF, "undefhandler", "Undefined instruction handler data"); @@ -83,6 +88,33 @@ id_aa64mmfr2_handler(vm_offset_t va, uint32_t insn, st return (0); } +#ifdef COMPAT_FREEBSD32 +/* arm32 GDB breakpoints */ +#define GDB_BREAKPOINT 0xe6000011 +#define GDB5_BREAKPOINT 0xe7ffdefe +static int +gdb_trapper(vm_offset_t va, uint32_t insn, struct trapframe *frame, + uint32_t esr) +{ + struct thread *td = curthread; + + if (insn == GDB_BREAKPOINT || insn == GDB5_BREAKPOINT) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32) && + va < VM_MAXUSER_ADDRESS) { + ksiginfo_t ksi; + + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGTRAP; + ksi.ksi_code = TRAP_TRACE; + ksi.ksi_addr = (void *)va; + trapsignal(td, &ksi); + return 1; + } + } + return 0; +} +#endif + void undef_init(void) { @@ -91,6 +123,9 @@ undef_init(void) LIST_INIT(&undef_handlers[1]); install_undef_handler(false, id_aa64mmfr2_handler); +#ifdef COMPAT_FREEBSD32 + install_undef_handler(true, gdb_trapper); +#endif } void * Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/arm64/vm_machdep.c Sun Jan 13 19:49:46 2019 (r343004) @@ -78,6 +78,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t * this may not have happened. */ td1->td_pcb->pcb_tpidr_el0 = READ_SPECIALREG(tpidr_el0); + td1->td_pcb->pcb_tpidrro_el0 = READ_SPECIALREG(tpidrro_el0); #ifdef VFP if ((td1->td_pcb->pcb_fpflags & PCB_FP_STARTED) != 0) vfp_save_state(td1, td1->td_pcb); @@ -97,7 +98,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t bcopy(td1->td_frame, tf, sizeof(*tf)); tf->tf_x[0] = 0; tf->tf_x[1] = 0; - tf->tf_spsr = 0; + tf->tf_spsr = td1->td_frame->tf_spsr & PSR_M_32; td2->td_frame = tf; @@ -195,7 +196,11 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * { struct trapframe *tf = td->td_frame; - tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); + /* 32bits processes use r13 for sp */ + if (td->td_frame->tf_spsr & PSR_M_32) + tf->tf_x[13] = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); + else + tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); tf->tf_elr = (register_t)entry; tf->tf_x[0] = (register_t)arg; } @@ -209,9 +214,19 @@ cpu_set_user_tls(struct thread *td, void *tls_base) return (EINVAL); pcb = td->td_pcb; - pcb->pcb_tpidr_el0 = (register_t)tls_base; - if (td == curthread) - WRITE_SPECIALREG(tpidr_el0, tls_base); + if (td->td_frame->tf_spsr & PSR_M_32) { + /* 32bits arm stores the user TLS into tpidrro */ + pcb->pcb_tpidrro_el0 = (register_t)tls_base; + pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) { + WRITE_SPECIALREG(tpidrro_el0, tls_base); + WRITE_SPECIALREG(tpidr_el0, tls_base); + } + } else { + pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); + } return (0); } Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/conf/GENERIC Sun Jan 13 19:49:46 2019 (r343004) @@ -52,7 +52,7 @@ options PROCFS # Process filesystem (requires PSEUD options PSEUDOFS # Pseudo-filesystem framework options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization -options COMPAT_FREEBSD32 # Incomplete, but used by cloudabi32.ko. +options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/armreg.h Sun Jan 13 19:49:46 2019 (r343004) @@ -575,7 +575,11 @@ #define PSR_M_EL1h 0x00000005 #define PSR_M_EL2t 0x00000008 #define PSR_M_EL2h 0x00000009 +#define PSR_M_64 0x00000000 +#define PSR_M_32 0x00000010 #define PSR_M_MASK 0x0000000f + +#define PSR_T 0x00000020 #define PSR_AARCH32 0x00000010 #define PSR_F 0x00000040 Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/elf.h Sun Jan 13 19:49:46 2019 (r343004) @@ -81,6 +81,10 @@ __ElfType(Auxinfo); #define ELF_TARG_VER 1 #endif +#if __ELF_WORD_SIZE == 32 +#define ET_DYN_LOAD_ADDR 0x12000 +#else #define ET_DYN_LOAD_ADDR 0x100000 +#endif #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/arm64/include/frame.h ============================================================================== --- head/sys/arm64/include/frame.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/frame.h Sun Jan 13 19:49:46 2019 (r343004) @@ -70,6 +70,14 @@ struct frame { int dummy; }; +#ifdef COMPAT_FREEBSD32 +struct sigframe32 { + struct siginfo32 sf_si; + ucontext32_t sf_uc; + mcontext32_vfp_t sf_vfp; +}; +#endif /* COMPAT_FREEBSD32 */ + #endif /* !LOCORE */ #endif /* !_MACHINE_FRAME_H_ */ Modified: head/sys/arm64/include/reg.h ============================================================================== --- head/sys/arm64/include/reg.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/reg.h Sun Jan 13 19:49:46 2019 (r343004) @@ -42,7 +42,11 @@ struct reg { }; struct reg32 { - int dummy; + unsigned int r[13]; + unsigned int r_sp; + unsigned int r_lr; + unsigned int r_pc; + unsigned int r_cpsr; }; struct fpreg { Modified: head/sys/arm64/include/ucontext.h ============================================================================== --- head/sys/arm64/include/ucontext.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/ucontext.h Sun Jan 13 19:49:46 2019 (r343004) @@ -61,4 +61,30 @@ struct __mcontext { typedef struct __mcontext mcontext_t; +#ifdef COMPAT_FREEBSD32 +#include +typedef struct __mcontext32 { + uint32_t mc_gregset[17]; + uint32_t mc_vfp_size; + uint32_t mc_vfp_ptr; + uint32_t mc_spare[33]; +} mcontext32_t; + +typedef struct __ucontext32 { + sigset_t uc_sigmask; + mcontext32_t uc_mcontext; + u_int32_t uc_link; + struct sigaltstack32 uc_stack; + u_int32_t uc_flags; + u_int32_t __spare__[4]; +} ucontext32_t; + +typedef struct __mcontext32_vfp { + __uint64_t mcv_reg[32]; + __uint32_t mcv_fpscr; +} mcontext32_vfp_t; + +#endif /* COMPAT_FREEBSD32 */ + + #endif /* !_MACHINE_UCONTEXT_H_ */ Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Sun Jan 13 18:48:13 2019 (r343003) +++ head/sys/arm64/include/vfp.h Sun Jan 13 19:49:46 2019 (r343004) @@ -65,6 +65,11 @@ int fpu_kern_leave(struct thread *, struct fpu_kern_ct int fpu_kern_thread(u_int); int is_fpu_kern_thread(u_int); +/* Convert to and from Aarch32 FPSCR to Aarch64 FPCR/FPSR */ +#define VFP_FPSCR_FROM_SRCR(vpsr, vpcr) ((vpsr) | ((vpcr) & 0x7c00000)) +#define VFP_FPSR_FROM_FPSCR(vpscr) ((vpscr) &~ 0x7c00000) +#define VFP_FPCR_FROM_FPSCR(vpsrc) ((vpsrc) & 0x7c00000) + #endif #endif From owner-svn-src-head@freebsd.org Sun Jan 13 20:33:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D76BA1485EE9; Sun, 13 Jan 2019 20:33:55 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 766398FBA7; Sun, 13 Jan 2019 20:33:55 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B2320979; Sun, 13 Jan 2019 20:33:55 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0DKXtHM020500; Sun, 13 Jan 2019 20:33:55 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0DKXtin020499; Sun, 13 Jan 2019 20:33:55 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201901132033.x0DKXtin020499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 13 Jan 2019 20:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343005 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 766398FBA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 20:33:56 -0000 Author: jah Date: Sun Jan 13 20:33:54 2019 New Revision: 343005 URL: https://svnweb.freebsd.org/changeset/base/343005 Log: Handle SIGIO for listening sockets r319722 separated struct socket and parts of the socket I/O path into listening-socket-specific and dataflow-socket-specific pieces. Listening socket connection notifications are now handled by solisten_wakeup() instead of sowakeup(), but solisten_wakeup() does not currently post SIGIO to the owning process. PR: 234258 Reported by: Kenneth Adelman MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18664 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Jan 13 19:49:46 2019 (r343004) +++ head/sys/kern/uipc_socket.c Sun Jan 13 20:33:54 2019 (r343005) @@ -886,6 +886,8 @@ solisten_wakeup(struct socket *sol) } SOLISTEN_UNLOCK(sol); wakeup_one(&sol->sol_comp); + if ((sol->so_state & SS_ASYNC) && sol->so_sigio != NULL) + pgsigio(&sol->so_sigio, SIGIO, 0); } /* From owner-svn-src-head@freebsd.org Sun Jan 13 23:29:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF43A148C884; Sun, 13 Jan 2019 23:29:47 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5718296327; Sun, 13 Jan 2019 23:29:47 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EDF322648; Sun, 13 Jan 2019 23:29:47 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0DNTlhT012729; Sun, 13 Jan 2019 23:29:47 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0DNTkJs012724; Sun, 13 Jan 2019 23:29:46 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901132329.x0DNTkJs012724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 23:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343006 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 343006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5718296327 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 23:29:47 -0000 Author: cognet Date: Sun Jan 13 23:29:46 2019 New Revision: 343006 URL: https://svnweb.freebsd.org/changeset/base/343006 Log: Introduce cpu_icache_sync_range_checked(), that does the same thing as cpu_icache_sync_range(), except that it sets pcb_onfault to catch any page fault, as doing cache maintenance operations for non-mapped generates a data abort, and use it in freebsd32_sysarch(), so that a userland program attempting to sync the icache with unmapped addresses doesn't crash the kernel. Spotted out by: andrew Modified: head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/arm64/freebsd32_machdep.c head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Sun Jan 13 20:33:54 2019 (r343005) +++ head/sys/arm64/arm64/cpufunc_asm.S Sun Jan 13 23:29:46 2019 (r343006) @@ -147,3 +147,24 @@ ENTRY(arm64_icache_sync_range) ic ialluis dsb ish END(arm64_icache_sync_range) + +/* + * int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t) + */ +ENTRY(arm64_icache_sync_range_checked) + adr x5, cache_maint_fault + SET_FAULT_HANDLER(x5, x6) + /* XXX: See comment in arm64_icache_sync_range */ + cache_handle_range dcop = cvau + ic ialluis + dsb ish + SET_FAULT_HANDLER(xzr, x6) + mov x0, #0 + ret +END(arm64_icache_sync_range_checked) + +ENTRY(cache_maint_fault) + SET_FAULT_HANDLER(xzr, x1) + mov x0, #EFAULT + ret +END(cache_maint_fault) Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Sun Jan 13 20:33:54 2019 (r343005) +++ head/sys/arm64/arm64/freebsd32_machdep.c Sun Jan 13 23:29:46 2019 (r343006) @@ -85,7 +85,7 @@ freebsd32_sysarch(struct thread *td, struct freebsd32_ return (error); if ((uint64_t)args.addr + (uint64_t)args.size > 0xffffffff) return (EINVAL); - cpu_icache_sync_range(args.addr, args.size); + cpu_icache_sync_range_checked(args.addr, args.size); return 0; } case ARM_GET_VFPSTATE: Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Sun Jan 13 20:33:54 2019 (r343005) +++ head/sys/arm64/include/cpufunc.h Sun Jan 13 23:29:46 2019 (r343006) @@ -138,12 +138,14 @@ extern int64_t dczva_line_size; #define cpu_idcache_wbinv_range(a, s) arm64_idcache_wbinv_range((a), (s)) #define cpu_icache_sync_range(a, s) arm64_icache_sync_range((a), (s)) +#define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) void arm64_nullop(void); void arm64_setttb(vm_offset_t); void arm64_tlb_flushID(void); void arm64_tlb_flushID_SE(vm_offset_t); void arm64_icache_sync_range(vm_offset_t, vm_size_t); +int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); From owner-svn-src-head@freebsd.org Sun Jan 13 23:41:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C7C148CE10; Sun, 13 Jan 2019 23:41:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2930B96AE4; Sun, 13 Jan 2019 23:41:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B91922968; Sun, 13 Jan 2019 23:41:57 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0DNfuYk023134; Sun, 13 Jan 2019 23:41:56 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0DNfu5r023132; Sun, 13 Jan 2019 23:41:56 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201901132341.x0DNfu5r023132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 13 Jan 2019 23:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343007 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 343007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2930B96AE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 13 Jan 2019 23:41:57 -0000 Author: cognet Date: Sun Jan 13 23:41:56 2019 New Revision: 343007 URL: https://svnweb.freebsd.org/changeset/base/343007 Log: Don't forget to add the needed #includes. Pointy hat to: cognet Modified: head/sys/arm64/arm64/cpufunc_asm.S Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Sun Jan 13 23:29:46 2019 (r343006) +++ head/sys/arm64/arm64/cpufunc_asm.S Sun Jan 13 23:41:56 2019 (r343007) @@ -29,8 +29,12 @@ * */ +#include #include #include + +#include "assym.inc" + __FBSDID("$FreeBSD$"); /* From owner-svn-src-head@freebsd.org Mon Jan 14 01:30:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C256148F526; Mon, 14 Jan 2019 01:30:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFA016AF57; Mon, 14 Jan 2019 01:30:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B238323A98; Mon, 14 Jan 2019 01:30:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0E1Umea076470; Mon, 14 Jan 2019 01:30:48 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0E1Um2T076469; Mon, 14 Jan 2019 01:30:48 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901140130.x0E1Um2T076469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 14 Jan 2019 01:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343008 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 343008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFA016AF57 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 01:30:49 -0000 Author: gonzo Date: Mon Jan 14 01:30:48 2019 New Revision: 343008 URL: https://svnweb.freebsd.org/changeset/base/343008 Log: Add Dell Chromebook to the list of devices with E820 extmem quirk enabled Just like for Acer C270 chromebook the E820 extmem workaround is required for FreeBSD to boot on Dell chromebook. PR: 204916 Submitted by: Keith White MFC after: 1 week Modified: head/stand/i386/libi386/biosmem.c Modified: head/stand/i386/libi386/biosmem.c ============================================================================== --- head/stand/i386/libi386/biosmem.c Sun Jan 13 23:41:56 2019 (r343007) +++ head/stand/i386/libi386/biosmem.c Mon Jan 14 01:30:48 2019 (r343008) @@ -74,6 +74,7 @@ struct bios_getmem_quirks { static struct bios_getmem_quirks quirks[] = { {"coreboot", "Acer", "Peppy", BQ_DISTRUST_E820_EXTMEM}, + {"coreboot", "Dell", "Wolf", BQ_DISTRUST_E820_EXTMEM}, {NULL, NULL, NULL, 0} }; From owner-svn-src-head@freebsd.org Mon Jan 14 03:13:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F6851491AAD; Mon, 14 Jan 2019 03:13:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A00B16DF4D; Mon, 14 Jan 2019 03:13:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C4BE24D87; Mon, 14 Jan 2019 03:13:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0E3DV4E035167; Mon, 14 Jan 2019 03:13:31 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0E3DVir035166; Mon, 14 Jan 2019 03:13:31 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901140313.x0E3DVir035166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 14 Jan 2019 03:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343009 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A00B16DF4D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 03:13:32 -0000 Author: gonzo Date: Mon Jan 14 03:13:31 2019 New Revision: 343009 URL: https://svnweb.freebsd.org/changeset/base/343009 Log: Add four kerberos CLI utilities to OptionalObsoleteFiles.inc Add asn1_compile, make-roken, kcc, and slc to the OptionalObsoleteFiles.inc so they would be removed during delete-old stage if the new world is built without Kerberos support. PR: 230725 Submitted by: Dmitry Wagin MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 14 01:30:48 2019 (r343008) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 14 03:13:31 2019 (r343009) @@ -2989,9 +2989,11 @@ OLD_FILES+=usr/share/man/man1/truss.1.gz .if ${MK_KERBEROS} == no OLD_FILES+=etc/rc.d/ipropd_master OLD_FILES+=etc/rc.d/ipropd_slave +OLD_FILES+=usr/bin/asn1_compile OLD_FILES+=usr/bin/compile_et OLD_FILES+=usr/bin/hxtool OLD_FILES+=usr/bin/kadmin +OLD_FILES+=usr/bin/kcc OLD_FILES+=usr/bin/kdestroy OLD_FILES+=usr/bin/kf OLD_FILES+=usr/bin/kgetcred @@ -3001,6 +3003,8 @@ OLD_FILES+=usr/bin/kpasswd OLD_FILES+=usr/bin/krb5-config OLD_FILES+=usr/bin/ksu OLD_FILES+=usr/bin/kswitch +OLD_FILES+=usr/bin/make-roken +OLD_FILES+=usr/bin/slc OLD_FILES+=usr/bin/string2key OLD_FILES+=usr/bin/verify_krb5_conf OLD_FILES+=usr/include/asn1-common.h From owner-svn-src-head@freebsd.org Mon Jan 14 06:34:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FE3149558C; Mon, 14 Jan 2019 06:34:59 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B6F72954; Mon, 14 Jan 2019 06:34:58 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6386E26F3F; Mon, 14 Jan 2019 06:34:58 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0E6YwXm038892; Mon, 14 Jan 2019 06:34:58 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0E6YscN038873; Mon, 14 Jan 2019 06:34:54 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201901140634.x0E6YscN038873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 14 Jan 2019 06:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... X-SVN-Group: head X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-service libexec/hprop libex... X-SVN-Commit-Revision: 343011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 90B6F72954 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 06:34:59 -0000 Author: nyan Date: Mon Jan 14 06:34:54 2019 New Revision: 343011 URL: https://svnweb.freebsd.org/changeset/base/343011 Log: Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed com_err.h. This fixes build when com_err.h is not installed. PR: 234691 MFC after: 1 week Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_krb5/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libheimntlm/Makefile head/kerberos5/lib/libhx509/Makefile head/kerberos5/lib/libkadm5clnt/Makefile head/kerberos5/lib/libkadm5srv/Makefile head/kerberos5/lib/libkdc/Makefile head/kerberos5/lib/libkrb5/Makefile head/kerberos5/lib/libwind/Makefile head/kerberos5/libexec/digest-service/Makefile head/kerberos5/libexec/hprop/Makefile head/kerberos5/libexec/hpropd/Makefile head/kerberos5/libexec/kadmind/Makefile head/kerberos5/libexec/kdc/Makefile head/kerberos5/usr.bin/hxtool/Makefile head/kerberos5/usr.bin/kadmin/Makefile head/kerberos5/usr.bin/string2key/Makefile head/kerberos5/usr.bin/verify_krb5_conf/Makefile head/kerberos5/usr.sbin/kstash/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libasn1/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -21,7 +21,8 @@ SRCS= asn1_err.c \ timegm.c \ ${GEN:S/.x$/.c/:S/.hx$/.h/} -CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err -I. GEN_RFC2459= asn1_rfc2459_asn1.x rfc2459_asn1.hx rfc2459_asn1-priv.hx GEN_CMS= asn1_cms_asn1.x cms_asn1.hx cms_asn1-priv.hx Modified: head/kerberos5/lib/libgssapi_krb5/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libgssapi_krb5/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -78,7 +78,9 @@ CFLAGS+=-I${KRB5DIR}/lib/gssapi/krb5 CFLAGS+=-I${KRB5DIR}/lib/gssapi/gssapi CFLAGS+=-I${KRB5DIR}/lib/krb5 CFLAGS+=-I${KRB5DIR}/lib/asn1 -CFLAGS+=-I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/roken +CFLAGS+=-I${SRCTOP}/contrib/com_err +CFLAGS+=-I. .include Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libhdb/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -59,6 +59,7 @@ SRCS= common.c \ CFLAGS+=-I${KRB5DIR}/lib/hdb -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken -I${SRCTOP}/contrib/sqlite3/ \ -I${KRB5DIR}/lib/krb5 \ + -I${SRCTOP}/contrib/com_err \ -I. ${LDAPCFLAGS} CFLAGS+=-DHDB_DB_DIR="\"/var/heimdal\"" Modified: head/kerberos5/lib/libheimntlm/Makefile ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libheimntlm/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -5,7 +5,8 @@ LDFLAGS= -Wl,--no-undefined LIBADD= crypto com_err krb5 roken SRCS= ntlm.c ntlm_err.c ntlm_err.h INCS= heimntlm.h heimntlm-protos.h ntlm_err.h -CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken +CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err VERSION_MAP= ${KRB5DIR}/lib/ntlm/version-script.map MAN= ntlm_buf.3 \ Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libhx509/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -211,7 +211,9 @@ CFLAGS+=-I${KRB5DIR}/lib/hx509 CFLAGS+=-I${KRB5DIR}/lib/hx509/ref CFLAGS+=-I${KRB5DIR}/lib/asn1 CFLAGS+=-I${KRB5DIR}/lib/wind -CFLAGS+=-I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/roken +CFLAGS+=-I${SRCTOP}/contrib/com_err +CFLAGS+=-I. GEN_OCSP= \ asn1_OCSPBasicOCSPResponse.x \ Modified: head/kerberos5/lib/libkadm5clnt/Makefile ============================================================================== --- head/kerberos5/lib/libkadm5clnt/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libkadm5clnt/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -34,7 +34,8 @@ SRCS= ad.c \ rename_c.c \ send_recv.c -CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err -I. .include Modified: head/kerberos5/lib/libkadm5srv/Makefile ============================================================================== --- head/kerberos5/lib/libkadm5srv/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libkadm5srv/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -35,7 +35,8 @@ SRCS= acl.c \ set_keys.c \ set_modifier.c -CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err -I. .include Modified: head/kerberos5/lib/libkdc/Makefile ============================================================================== --- head/kerberos5/lib/libkdc/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libkdc/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -28,7 +28,8 @@ SRCS= \ CFLAGS+= -I${KRB5DIR}/lib/roken \ -I${KRB5DIR}/lib/krb5 \ -I${KRB5DIR}/lib/hdb \ - -I${KRB5DIR}/kdc + -I${KRB5DIR}/kdc \ + -I${SRCTOP}/contrib/com_err .include Modified: head/kerberos5/lib/libkrb5/Makefile ============================================================================== --- head/kerberos5/lib/libkrb5/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libkrb5/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -621,7 +621,9 @@ CFLAGS+= -I${KRB5DIR}/lib/krb5 \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken \ -I${KRB5DIR}/lib/ipc \ - -I${KRB5DIR}/base -I. + -I${KRB5DIR}/base \ + -I${SRCTOP}/contrib/com_err \ + -I. .include Modified: head/kerberos5/lib/libwind/Makefile ============================================================================== --- head/kerberos5/lib/libwind/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/lib/libwind/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -27,7 +27,7 @@ SRCS= bidi.c \ SRCS+= wind_err.c \ wind_err.h -CFLAGS+=-I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/roken -I${SRCTOP}/contrib/com_err -I. .include Modified: head/kerberos5/libexec/digest-service/Makefile ============================================================================== --- head/kerberos5/libexec/digest-service/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/libexec/digest-service/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -7,7 +7,8 @@ CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/krb5 \ -I${KRB5DIR}/lib/ipc \ -I${KRB5DIR}/lib/wind \ - -I${KRB5DIR}/lib/roken + -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err LIBADD= hdb kdc heimipcs krb5 roken asn1 crypto vers heimntlm LDFLAGS=${LDAPLDFLAGS} Modified: head/kerberos5/libexec/hprop/Makefile ============================================================================== --- head/kerberos5/libexec/hprop/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/libexec/hprop/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -9,6 +9,7 @@ CFLAGS+=-I${KRB5DIR}/lib/asn1 CFLAGS+=-I${KRB5DIR}/lib/hx509 CFLAGS+=-I${KRB5DIR}/lib/ntlm CFLAGS+=-I${KRB5DIR}/kdc +CFLAGS+=-I${SRCTOP}/contrib/com_err CFLAGS+=-I${.OBJDIR:H:H}/lib/libkrb5 LIBADD= hdb krb5 roken vers DPADD= ${LDAPDPADD} Modified: head/kerberos5/libexec/hpropd/Makefile ============================================================================== --- head/kerberos5/libexec/hpropd/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/libexec/hpropd/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -3,7 +3,7 @@ PROG= hpropd MAN= hpropd.8 CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 \ - -I${KRB5DIR}/kdc ${LDAPCFLAGS} + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} LIBADD= hdb krb5 roken vers DPADD= ${LDAPDPADD} LDADD= ${LDAPLDADD} Modified: head/kerberos5/libexec/kadmind/Makefile ============================================================================== --- head/kerberos5/libexec/kadmind/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/libexec/kadmind/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -8,7 +8,7 @@ SRCS= rpc.c \ kadm_conn.c CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ - ${LDAPCFLAGS} + -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} LIBADD= kadm5srv gssapi hdb krb5 roken vers DPADD= ${LDAPDPADD} LDADD= ${LDAPLDADD} Modified: head/kerberos5/libexec/kdc/Makefile ============================================================================== --- head/kerberos5/libexec/kdc/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/libexec/kdc/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -9,7 +9,7 @@ SRCS= config.c \ main.c CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ - -I${KRB5DIR}/kdc ${LDAPCFLAGS} + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} LIBADD= kdc hdb krb5 roken crypt vers LDFLAGS=${LDAPLDFLAGS} Modified: head/kerberos5/usr.bin/hxtool/Makefile ============================================================================== --- head/kerberos5/usr.bin/hxtool/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/usr.bin/hxtool/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -5,7 +5,9 @@ MAN= CFLAGS+= -I${KRB5DIR}/lib/hx509 \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken \ - -I${KRB5DIR}/lib/sl -I. + -I${KRB5DIR}/lib/sl \ + -I${SRCTOP}/contrib/com_err \ + -I. LIBADD= hx509 roken asn1 crypto sl vers edit SRCS= hxtool.c hxtool-commands.c hxtool-commands.h Modified: head/kerberos5/usr.bin/kadmin/Makefile ============================================================================== --- head/kerberos5/usr.bin/kadmin/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/usr.bin/kadmin/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -25,7 +25,7 @@ SRCS= add_enctype.c \ util.c CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ - -I${KRB5DIR}/lib/sl -I. ${LDAPCFLAGS} + -I${KRB5DIR}/lib/sl -I${SRCTOP}/contrib/com_err -I. ${LDAPCFLAGS} LIBADD= kadm5clnt kadm5srv hdb krb5 roken vers sl asn1 crypto edit DPADD= ${LDAPDPADD} LDADD= ${LDAPLDADD} Modified: head/kerberos5/usr.bin/string2key/Makefile ============================================================================== --- head/kerberos5/usr.bin/string2key/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/usr.bin/string2key/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -6,7 +6,8 @@ CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/krb5 \ -I${KRB5DIR}/lib/roken \ - -I${KRB5DIR}/lib/windc + -I${KRB5DIR}/lib/windc \ + -I${SRCTOP}/contrib/com_err LIBADD= krb5 roken crypto vers .include Modified: head/kerberos5/usr.bin/verify_krb5_conf/Makefile ============================================================================== --- head/kerberos5/usr.bin/verify_krb5_conf/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/usr.bin/verify_krb5_conf/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -2,7 +2,8 @@ PROG= verify_krb5_conf MAN= verify_krb5_conf.8 -CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken +CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/contrib/com_err LIBADD= krb5 roken vers .include Modified: head/kerberos5/usr.sbin/kstash/Makefile ============================================================================== --- head/kerberos5/usr.sbin/kstash/Makefile Mon Jan 14 03:19:08 2019 (r343010) +++ head/kerberos5/usr.sbin/kstash/Makefile Mon Jan 14 06:34:54 2019 (r343011) @@ -3,7 +3,7 @@ PROG= kstash MAN= kstash.8 CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ - -I${KRB5DIR}/kdc ${LDAPCFLAGS} + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} LIBADD= hdb krb5 crypto vers DPADD= ${LDAPDPADD} LDADD= ${LDAPLDADD} From owner-svn-src-head@freebsd.org Mon Jan 14 07:31:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999841496771; Mon, 14 Jan 2019 07:31:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C08F74918; Mon, 14 Jan 2019 07:31:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23ED4277FA; Mon, 14 Jan 2019 07:31:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0E7VKvP065141; Mon, 14 Jan 2019 07:31:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0E7VKYY065140; Mon, 14 Jan 2019 07:31:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901140731.x0E7VKYY065140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Jan 2019 07:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343017 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C08F74918 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 07:31:20 -0000 Author: kib Date: Mon Jan 14 07:31:19 2019 New Revision: 343017 URL: https://svnweb.freebsd.org/changeset/base/343017 Log: Handle overflow in calculating max kmem size. vm_kmem_size is u_long, and it might be not capable of holding page count times PAGE_SIZE, even when scaled down by VM_KMEM_SIZE_SCALE. As bde reported, 12G PAE config ends up with zero for kmem size. Explicitly check for overflow and clamp kmem size at vm_kmem_size_max. If we end up at zero size because VM_KMEM_SIZE_MAX is not defined, panic with clear explanation rather then failing in a way which is hard to relate. Reported by: bde, pho Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18767 Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Jan 14 07:25:44 2019 (r343016) +++ head/sys/kern/kern_malloc.c Mon Jan 14 07:31:19 2019 (r343017) @@ -920,13 +920,16 @@ kmeminit(void) * variable: */ if (vm_kmem_size == 0) { - vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; - + vm_kmem_size = mem_size / vm_kmem_size_scale; + vm_kmem_size = vm_kmem_size * PAGE_SIZE < vm_kmem_size ? + vm_kmem_size_max : vm_kmem_size * PAGE_SIZE; if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) vm_kmem_size = vm_kmem_size_min; if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) vm_kmem_size = vm_kmem_size_max; } + if (vm_kmem_size == 0) + panic("Tune VM_KMEM_SIZE_* for the platform"); /* * The amount of KVA space that is preallocated to the From owner-svn-src-head@freebsd.org Mon Jan 14 08:23:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DEA21497C42; Mon, 14 Jan 2019 08:23:48 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF167631B; Mon, 14 Jan 2019 08:23:48 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B980251; Mon, 14 Jan 2019 08:23:48 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0E8NmGx096243; Mon, 14 Jan 2019 08:23:48 GMT (envelope-from lme@FreeBSD.org) Received: (from lme@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0E8Nmll096242; Mon, 14 Jan 2019 08:23:48 GMT (envelope-from lme@FreeBSD.org) Message-Id: <201901140823.x0E8Nmll096242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lme set sender to lme@FreeBSD.org using -f From: Lars Engels Date: Mon, 14 Jan 2019 08:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343020 - head/usr.sbin/bluetooth/bluetooth-config X-SVN-Group: head X-SVN-Commit-Author: lme X-SVN-Commit-Paths: head/usr.sbin/bluetooth/bluetooth-config X-SVN-Commit-Revision: 343020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FF167631B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 08:23:48 -0000 Author: lme (ports committer) Date: Mon Jan 14 08:23:47 2019 New Revision: 343020 URL: https://svnweb.freebsd.org/changeset/base/343020 Log: This new version of bluetooth-config.sh tries to follow the style of other shell scripts in base, removes the bogus "copyleft", adds the BeerWare license header and uses rc.subr(8) new 'enable' keyword for adding entries in rc.conf(5). Submitted by: erdgeist Approved by: bapt MFC after: 2 weeks Modified: head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Modified: head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh ============================================================================== --- head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 07:54:11 2019 (r343019) +++ head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 08:23:47 2019 (r343020) @@ -1,9 +1,12 @@ #!/bin/sh #- -# Copyleft 2019 Dirk Engling +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp +# ---------------------------------------------------------------------------- # -# This script is released under the beerware license. -# # $FreeBSD$ # @@ -11,8 +14,6 @@ exerr () { echo -e "Error: $*" >&2 ; exit 1; } print_syntax () { echo -e "Syntax: $0 scan [-d device] [-n node]"; exit 1; } -# Assuming we are called to do the pair-new-device subcommand first - main() { unset node device started bdaddresses retry @@ -22,132 +23,140 @@ shift # Get command line options while getopts :d:n: arg; do - case ${arg} in - d) device="$OPTARG";; - n) node="$OPTARG";; - ?) print_syntax;; - esac + case ${arg} in + d) device="$OPTARG";; + n) node="$OPTARG";; + ?) print_syntax;; + esac done # No use running without super user rights -[ $( id -u ) -eq 0 ] || exerr "$0 must modify files that belong to root. Re-run as root." +if [ $( id -u ) -ne 0 ]; then + exerr "$0 must modify files that belong to root. Re-run as root." +fi -known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | \ - /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1) +known_nodes=$( /usr/sbin/hccontrol read_node_list 2>/dev/null |\ + /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) # Check if netgraph knows about any HCI nodes if ! [ "${known_nodes}" ]; then - ng_nodes=$(/usr/sbin/ngctl list 2>/dev/null | \ - /usr/bin/grep -o "Name: .* Type: ubt" | /usr/bin/cut -d ' ' -f 2) + ng_nodes=$( /usr/sbin/ngctl list 2>/dev/null | \ + /usr/bin/grep -o "Name: .* Type: ubt" |/usr/bin/cut -d' ' -f2 ) - [ "${ng_nodes}" ] || exerr "No Bluetooth host controllers found." + [ "${ng_nodes}" ] || exerr "No Bluetooth host controllers found." - unset found - for n in ${ng_nodes}; do - if [ "${n}" = "${node%hci}" ]; then - # If we found the node but its stack is not set up, do it now - /usr/sbin/service bluetooth start ${node%hci} || exit 1 - found="YES" - fi - done + unset found + for n in ${ng_nodes}; do + if [ "${n}" = "${node%hci}" ]; then + # Found the node but its stack is not set up? Do it now. + /usr/sbin/service bluetooth start ${node%hci} || exit 1 + found="YES" + fi + done - # If we have Bluetooth controller nodes without a set up stack, - # ask the user if we shall start it up - if ! [ "${found}" ]; then - printf "No usable Bluetooth host controllers were found.\n" - printf "These host controllers exist in the system:\n %s" " ${ng_nodes}" - read -p "Choose a host controller to set up: [${ng_nodes%% *}]" node - : ${node:="${ng_nodes%% *}"} - /usr/sbin/service bluetooth start ${node} || exit 1 - fi + # If we have Bluetooth controller nodes without a set up stack, + # ask the user if we shall start it up + if ! [ "${found}" ]; then + printf "No usable Bluetooth host controllers were found.\n" + printf "These host controllers exist in the system:\n" + printf " %s\n" "${ng_nodes}" + prompt="Choose a host controller to set up: [${ng_nodes%% *}]" + read -p "${prompt}" node + : ${node:="${ng_nodes%% *}"} + /usr/sbin/service bluetooth start ${node} || exit 1 + fi - # Re-read known nodes - known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | \ - /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1) - # check if we succeeded in bringing it up - [ "${known_nodes}" ] || exerr "Failed to set up Bluetooth stack" + # Re-read known nodes + known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | + /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) + + # check if we succeeded in bringing it up + [ "${known_nodes}" ] || exerr "Failed to set up Bluetooth stack" fi # if a node was requested on command line, check if it is there if [ "${node}" ]; then - unset found - for n in ${known_nodes}; do - [ "${n}" = "${node}" ] && found="YES" - [ "${n}" = "${node}hci" ] && node="${node}hci" && found="YES" - done - [ "${found}" ] || exerr "Node ${node} not found" + unset found + for n in ${known_nodes}; do + [ "${n}" = "${node}" ] && found="YES" + [ "${n}" = "${node}hci" ] && node="${node}hci" && found="YES" + done + [ "${found}" ] || exerr "Node ${node} not found" fi [ "${node}" ] && node="-n ${node}" while ! [ "${bdaddresses}" ]; do - retry=X${retry} - printf "Scanning for new Bluetooth devices (Attempt %d of 5) ... " ${#retry} - bdaddresses=$( /usr/sbin/hccontrol -N ${node} inquiry 2>/dev/null | \ - /usr/bin/grep -o "BD_ADDR: .*" | /usr/bin/cut -d ' ' -f 2 ) + retry=X${retry} + printf "Scanning for new Bluetooth devices (Attempt %d of 5) ... " \ + ${#retry} + bdaddresses=$( /usr/sbin/hccontrol -N ${node} inquiry 2>/dev/null | + /usr/bin/grep -o "BD_ADDR: .*" | /usr/bin/cut -d ' ' -f 2 ) - # Count entries and, if a device was requested on command line, - # try to find it - unset found count - for bdaddress in ${bdaddresses}; do - count=X${count} - if [ "${bdaddress}" = "${device}" ]; then - found=YES - bdaddresses="${device}" - count=X - break - fi - done + # Count entries and, if a device was requested on command line, + # try to find it + unset found count + for bdaddress in ${bdaddresses}; do + count=X${count} + if [ "${bdaddress}" = "${device}" ]; then + found=YES + bdaddresses="${device}" + count=X + break + fi + done - # If device was requested on command line but is not found, - # or no devices found at all, rescan until retry is exhausted - if ! [ "${found}" -o "${count}" -a -z "${device}" ]; then - printf "failed.\n" - if [ "${#retry}" -eq 5 ]; then - [ "${device}" ] && exerr "Device ${device} not found" - exerr "No new Bluetooth devices found" - fi - unset bdaddresses - sleep 2 - continue - fi + # If device was requested on command line but is not found, + # or no devices found at all, rescan until retry is exhausted + if ! [ "${found}" -o "${count}" -a -z "${device}" ]; then + printf "failed.\n" + if [ "${#retry}" -eq 5 ]; then + [ "${device}" ] && exerr "Device ${device} not found" + exerr "No new Bluetooth devices found" + fi + unset bdaddresses + sleep 2 + continue + fi - [ ${#count} -gt 1 ] && plural=s || plural='' - printf "done.\nFound %d new bluetooth device%s (scanning for names):\n" ${#count} ${plural} + [ ${#count} -gt 1 ] && plural=s || plural='' + printf "done.\nFound %d new bluetooth device%s " ${#count} ${plural} + printf "(now scanning for names):\n" - # Looping again for the faster feedback - unset count - for bdaddress in ${bdaddresses}; do - count=X${count} - bdname=$( /usr/bin/bthost -b "${bdaddress}" 2>/dev/null ) - friendlyname=$( /usr/sbin/hccontrol Remote_Name_Request ${bdaddress} 2> /dev/null | \ - /usr/bin/grep -o "Name: .*" | /usr/bin/cut -d ' ' -f 2- ) + # Looping again for the faster feedback + unset count + for bdaddress in ${bdaddresses}; do + count=X${count} + bdname=$( /usr/bin/bthost -b "${bdaddress}" 2>/dev/null ) + friendlyname=$( /usr/sbin/hccontrol Remote_Name_Request \ + ${bdaddress} 2> /dev/null | + /usr/bin/grep -o "Name: .*" |/usr/bin/cut -d ' ' -f 2- ) - # sdpcontrol should be able to pull vendor and product id via sdp - printf "[%2d] %s\t\"%s\" (%s)\n" ${#count} "${bdaddress}" "${friendlyname}" "${bdname}" + # sdpcontrol should be able to pull vendor + product id via sdp + printf "[%2d] %s\t\"%s\" (%s)\n" ${#count} "${bdaddress}" \ + "${friendlyname}" "${bdname}" - eval bdaddress_${#count}=\${bdaddress} - eval bdname_${#count}=\${bdname} - eval friendlyname_${#count}=\${friendlyname} - done + eval bdaddress_${#count}=\${bdaddress} + eval bdname_${#count}=\${bdname} + eval friendlyname_${#count}=\${friendlyname} + done - # If a device was pre-selected, do not query the user - [ "${device}" ] && topair=1 || unset topair + # If a device was pre-selected, do not query the user + [ "${device}" ] && topair=1 || unset topair - # Even if only one device was found, user may chose 0 to rescan - while ! [ "${topair}" ]; do - if [ ${#count} -eq 1 ]; then - read -p "Select device to pair with [1, or 0 to rescan]: " topair - else - read -p "Select device to pair with [1-${#count}, or 0 to rescan]: " topair - fi - if ! [ "${topair}" -ge 0 -a "${topair}" -le "${#count}" ] 2>/dev/null ; then - printf "Value out of range: %s.\n" {topair} - unset topair - fi - done + # Even if only one device was found, user may chose 0 to rescan + while ! [ "${topair}" ]; do + prompt="Select device to pair with [1" + [ ${#count} -gt 1 ] && prompt="${prompt}-${#count}" + read -p "${prompt}, or 0 to rescan]: " topair + if ! [ "${topair}" -ge 0 -a "${topair}" -le "${#count}" ] \ + 2>/dev/null ; then + printf "Value out of range: %s.\n" {topair} + unset topair + fi + done - [ "${topair}" -eq "0" ] && unset bdaddresses retry + [ "${topair}" -eq "0" ] && unset bdaddresses retry done eval bdaddress=\${bdaddress_${topair}} @@ -156,20 +165,24 @@ eval friendlyname=\${friendlyname_${topair}} # Do we need to add an entry to /etc/bluetooth/hosts? if ! [ "${bdname}" ]; then - printf "\nAdding device ${bdaddress} to /etc/bluetooth/hosts.\n" + printf "\nAdding device ${bdaddress} to /etc/bluetooth/hosts.\n" - while ! [ "${bdname}" ]; do - read -p "Enter friendly name. [${friendlyname}]: " REPLY - : ${REPLY:="${friendlyname}"} + while ! [ "${bdname}" ]; do + read -p "Enter friendly name. [${friendlyname}]: " _r + : ${_r:="${friendlyname}"} - if [ "${REPLY}" ]; then - # Remove white space and non-friendly characters - bdname=$( printf "%s" "${REPLY}" | tr -c '[:alnum:]-,.' _ ) - [ "${REPLY}" != "${bdname}" ] && printf "Notice: Using sanitized name \"%s\" in /etc/bluetooth/hosts.\n" "${bdname}" - fi - done + if [ "${_r}" ]; then + # Remove white space and non-friendly characters + bdname=$( printf "%s" "${_r}" | tr -c '[:alnum:]-,.' _ ) + if [ "${_r}" != "${bdname}" ]; then + printf "Notice: Using sanitized name" + printf "\"%s\" in /etc/bluetooth/hosts.\n" \ + "${bdname}" + fi + fi + done - printf "%s\t%s\n" "${bdaddress}" "${bdname}" >> /etc/bluetooth/hosts + printf "%s\t%s\n" "${bdaddress}" "${bdname}" >> /etc/bluetooth/hosts fi # If scanning for the name did not succeed, resort to bdname @@ -183,86 +196,109 @@ fi # Also we cannot really modify the PIN in an existing entry. So we # need to prompt the user to manually do it and restart this script if ! /usr/sbin/service hcsecd enabled; then - printf "\nWarning: hcsecd is not enabled.\nThis daemon manages pairing requests.\n" - read -p "Enable hcsecd? [yes]: " REPLY - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/sysrc hcsecd_enable="YES";; esac + printf "\nWarning: hcsecd is not enabled.\n" + printf "This daemon manages pairing requests.\n" + read -p "Enable hcsecd? [yes]: " _r + case "${_r}" in + no|n|NO|N|No|nO) ;; + *) /usr/sbin/service hcsecd enable;; + esac fi + secd_config=$( /usr/sbin/sysrc -n hcsecd_config ) -secd_entries=$( /usr/bin/grep -Eo "bdaddr[[:space:]]+(${bdaddress}|${bdname})" ${secd_config} | awk '{ print $2; }' ) +secd_entries=$( /usr/bin/grep -Eo "bdaddr[[:space:]]+(${bdaddress}|${bdname})" \ + ${secd_config} | awk '{ print $2; }' ) if [ "${secd_entries}" ]; then - printf "\nWarning: An entry for device %s is already present in %s.\n" ${secd_entries} ${secd_config} - printf "To modify pairing information, edit this file and run\n service hcsecd restart\n" - read -p "Continue? [yes]: " REPLY - case "${REPLY}" in no|n|NO|N|No|nO) exit;; esac + printf "\nWarning: An entry for device %s is already present in %s.\n" \ + ${secd_entries} ${secd_config} + printf "To modify pairing information, edit this file and run\n" + printf " service hcsecd restart\n" + read -p "Continue? [yes]: " _r + case "${_r}" in no|n|NO|N|No|nO) exit;; esac else - printf "\nWriting pairing information description block to %s.\n" ${secd_config} - printf "(To get PIN, put device in pairing mode first.)\n" - read -p "Enter PIN [nopin]: " pin - [ "${pin}" ] && pin=\""${pin}"\" || pin="nopin" + printf "\nWriting pairing information description block to %s.\n" \ + ${secd_config} + printf "(To get PIN, put device in pairing mode first.)\n" + read -p "Enter PIN [nopin]: " pin + [ "${pin}" ] && pin=\""${pin}"\" || pin="nopin" - # Write out new hcsecd config block - printf "\ndevice {\n\tbdaddr\t%s;\n\tname\t\"%s\";\n\tkey\tnokey\;\n\tpin\t%s\;\n}\n" \ - "${bdaddress}" "${friendlyname}" "${pin}" >> ${secd_config} + # Write out new hcsecd config block + printf "\ndevice {\n\tbdaddr\t%s;\n\tname\t\"%s\";\n\tkey\tnokey\;\n\tpin\t%s\;\n}\n" \ + "${bdaddress}" "${friendlyname}" "${pin}" >> ${secd_config} - # ... and make daemon reload config, TODO: hcsecd should provide a reload hook - /usr/sbin/service hcsecd restart + # ... and make daemon reload config + # TODO: hcsecd should provide a reload hook + /usr/sbin/service hcsecd onerestart - # TODO: we should check if hcsecd succeeded pairing and revert to an old version - # of hcsecd.conf so we can undo adding the block above and retry with a new PIN - # also, if there's a way to force devices to re-pair, try this + # TODO: we should check if hcsecd succeeded pairing and revert to an + # old version of hcsecd.conf so we can undo adding the block above and + # retry with a new PIN + # also, if there's a way to force devices to re-pair, try this fi # now check for specific services to be provided by the device # first up: HID -if /usr/sbin/sdpcontrol -a "${bdaddress}" search HID | \ - /usr/bin/grep -q "^Record Handle: "; then +/usr/sbin/sdpcontrol -a "${bdaddress}" search HID | \ + /usr/bin/grep -q "^Record Handle: " || exit 0 - printf "\nThis device provides human interface device services.\n" - read -p "Set it up? [yes]: " REPLY - case "${REPLY}" in no|n|NO|N|No|nO) ;; - *) - if ! /usr/sbin/service bthidd enabled; then - printf "\nWarning: bthidd is not enabled." - printf "\nThis daemon manages Bluetooth HID devices.\n" - read -p "Enable bthidd? [yes]: " REPLY - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/sysrc bthidd_enable="YES";; esac - fi +printf "\nThis device provides human interface device services.\n" +read -p "Set it up? [yes]: " _r +case "${_r}" in + no|n|NO|N|No|nO) exit 0;; + *);; +esac - # Check if bthidd already knows about this device - bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ - /usr/bin/grep "${bdaddress}" ) - if [ "${bthidd_known}" ]; then - printf "Notice: Device %s already known to bthidd.\n" "${bdaddress}" - else - bthidd_config=$( /usr/sbin/sysrc -n bthidd_config ) - printf "Writing HID descriptor block to %s ... " "${bthidd_config}" - /usr/sbin/bthidcontrol -a "${bdaddress}" query >> "${bthidd_config}" +# Here we have found an HID and were asked to set it up +# NOTE: look out for the two exit 0 above if you extend this script - # Re-read config to see if we succeeded adding the device - bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ - grep "${bdaddress}" ) - if ! [ "${bthidd_known}" ]; then - printf "failed.\n" - else - printf "success.\nTo re-read its config, bthidd must be restarted.\n" - printf "Warning: If a Bluetooth keyboard is being used, the connection might be lost.\n" - printf "It can be manually restarted later with\n service bthidd restart\n" - read -p "Restart bthidd now? [yes]: " REPLY - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/service bthidd restart;; esac - fi - fi - ;; - esac +if ! /usr/sbin/service bthidd enabled; then + printf "\nWarning: bthidd is not enabled." + printf "\nThis daemon manages Bluetooth HID devices.\n" + read -p "Enable bthidd? [yes]: " _r + case "${_r}" in + no|n|NO|N|No|nO) ;; + *) /usr/sbin/service bthidd enable;; + esac fi +# Check if bthidd already knows about this device +bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ + /usr/bin/grep "${bdaddress}" ) + +if [ "${bthidd_known}" ]; then + printf "Notice: Device %s already known to bthidd.\n" "${bdaddress}" + return 0 +fi + +bthidd_config=$( /usr/sbin/sysrc -n bthidd_config ) +printf "Writing HID descriptor block to %s ... " "${bthidd_config}" +/usr/sbin/bthidcontrol -a "${bdaddress}" query >> "${bthidd_config}" + +# Re-read config to see if we succeeded adding the device +bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ + grep "${bdaddress}" ) +if ! [ "${bthidd_known}" ]; then + printf "failed.\n" +else + printf "success.\nTo re-read its config, bthidd must be restarted.\n" + printf "Warning: If a Bluetooth keyboard is being used, the connection" + printf "might be lost.\n" + printf "It can be manually restarted later with\n" + printf " service bthidd restart\n" + read -p "Restart bthidd now? [yes]: " _r + case "${_r}" in + no|n|NO|N|No|nO) ;; + *) /usr/sbin/service bthidd onerestart;; + esac +fi + } # After function definitions, main() can use them main "$@" - -exit +exit 0 # TODO # * If device is a keyboard, offer a text entry test field and if it does From owner-svn-src-head@freebsd.org Mon Jan 14 15:48:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39D114A39A6; Mon, 14 Jan 2019 15:48:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 523B28EA07; Mon, 14 Jan 2019 15:48:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D064F4F8E; Mon, 14 Jan 2019 15:48:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0EFmZIV032917; Mon, 14 Jan 2019 15:48:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0EFmZRO032916; Mon, 14 Jan 2019 15:48:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901141548.x0EFmZRO032916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 14 Jan 2019 15:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343023 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 343023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 523B28EA07 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 15:48:44 -0000 Author: pfg Date: Mon Jan 14 15:48:35 2019 New Revision: 343023 URL: https://svnweb.freebsd.org/changeset/base/343023 Log: msun: reduce diff between src/e_j0.c and src/e_j0f.c PR: 229501 MFC after: 1 week Modified: head/lib/msun/src/e_j0.c head/lib/msun/src/e_j0f.c Modified: head/lib/msun/src/e_j0.c ============================================================================== --- head/lib/msun/src/e_j0.c Mon Jan 14 09:57:36 2019 (r343022) +++ head/lib/msun/src/e_j0.c Mon Jan 14 15:48:35 2019 (r343023) @@ -80,7 +80,7 @@ S02 = 1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD S03 = 5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ -static const double zero = 0.0; +static const double zero = 0, qrtr = 0.25; double __ieee754_j0(double x) @@ -97,7 +97,7 @@ __ieee754_j0(double x) c = cos(x); ss = s-c; cc = s+c; - if(ix<0x7fe00000) { /* make sure x+x not overflow */ + if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ z = -cos(x+x); if ((s*c) Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D99814A495B; Mon, 14 Jan 2019 16:18:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDFBD68233; Mon, 14 Jan 2019 16:18:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0EGHwqx035749; Mon, 14 Jan 2019 08:17:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0EGHwqQ035748; Mon, 14 Jan 2019 08:17:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901141617.x0EGHwqQ035748@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... In-Reply-To: <201901140634.x0E6YscN038873@repo.freebsd.org> To: Takahashi Yoshihiro Date: Mon, 14 Jan 2019 08:17:58 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: DDFBD68233 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 16:18:08 -0000 > Author: nyan > Date: Mon Jan 14 06:34:54 2019 > New Revision: 343011 > URL: https://svnweb.freebsd.org/changeset/base/343011 > > Log: > Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed com_err.h. > This fixes build when com_err.h is not installed. Isn't this the general state of affairs for almost all of the source tree? I would rather see this solved in a general way, rather than sprinkly all this -I${SRCTOP} all over in the tree. It use to be (and maybe still is) required that you run cd $DRCTOP && make includes if you expected new source code to compile. I expect this has changed, but the just of it should work in some aspect. Thanks, Rod > > PR: 234691 > MFC after: 1 week > > Modified: > head/kerberos5/lib/libasn1/Makefile > head/kerberos5/lib/libgssapi_krb5/Makefile > head/kerberos5/lib/libhdb/Makefile > head/kerberos5/lib/libheimntlm/Makefile > head/kerberos5/lib/libhx509/Makefile > head/kerberos5/lib/libkadm5clnt/Makefile > head/kerberos5/lib/libkadm5srv/Makefile > head/kerberos5/lib/libkdc/Makefile > head/kerberos5/lib/libkrb5/Makefile > head/kerberos5/lib/libwind/Makefile > head/kerberos5/libexec/digest-service/Makefile > head/kerberos5/libexec/hprop/Makefile > head/kerberos5/libexec/hpropd/Makefile > head/kerberos5/libexec/kadmind/Makefile > head/kerberos5/libexec/kdc/Makefile > head/kerberos5/usr.bin/hxtool/Makefile > head/kerberos5/usr.bin/kadmin/Makefile > head/kerberos5/usr.bin/string2key/Makefile > head/kerberos5/usr.bin/verify_krb5_conf/Makefile > head/kerberos5/usr.sbin/kstash/Makefile > > Modified: head/kerberos5/lib/libasn1/Makefile > ============================================================================== > --- head/kerberos5/lib/libasn1/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libasn1/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -21,7 +21,8 @@ SRCS= asn1_err.c \ > timegm.c \ > ${GEN:S/.x$/.c/:S/.hx$/.h/} > > -CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err -I. > > GEN_RFC2459= asn1_rfc2459_asn1.x rfc2459_asn1.hx rfc2459_asn1-priv.hx > GEN_CMS= asn1_cms_asn1.x cms_asn1.hx cms_asn1-priv.hx > > Modified: head/kerberos5/lib/libgssapi_krb5/Makefile > ============================================================================== > --- head/kerberos5/lib/libgssapi_krb5/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libgssapi_krb5/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -78,7 +78,9 @@ CFLAGS+=-I${KRB5DIR}/lib/gssapi/krb5 > CFLAGS+=-I${KRB5DIR}/lib/gssapi/gssapi > CFLAGS+=-I${KRB5DIR}/lib/krb5 > CFLAGS+=-I${KRB5DIR}/lib/asn1 > -CFLAGS+=-I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/roken > +CFLAGS+=-I${SRCTOP}/contrib/com_err > +CFLAGS+=-I. > > .include > > > Modified: head/kerberos5/lib/libhdb/Makefile > ============================================================================== > --- head/kerberos5/lib/libhdb/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libhdb/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -59,6 +59,7 @@ SRCS= common.c \ > CFLAGS+=-I${KRB5DIR}/lib/hdb -I${KRB5DIR}/lib/asn1 \ > -I${KRB5DIR}/lib/roken -I${SRCTOP}/contrib/sqlite3/ \ > -I${KRB5DIR}/lib/krb5 \ > + -I${SRCTOP}/contrib/com_err \ > -I. ${LDAPCFLAGS} > CFLAGS+=-DHDB_DB_DIR="\"/var/heimdal\"" > > > Modified: head/kerberos5/lib/libheimntlm/Makefile > ============================================================================== > --- head/kerberos5/lib/libheimntlm/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libheimntlm/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -5,7 +5,8 @@ LDFLAGS= -Wl,--no-undefined > LIBADD= crypto com_err krb5 roken > SRCS= ntlm.c ntlm_err.c ntlm_err.h > INCS= heimntlm.h heimntlm-protos.h ntlm_err.h > -CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken > +CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err > VERSION_MAP= ${KRB5DIR}/lib/ntlm/version-script.map > > MAN= ntlm_buf.3 \ > > Modified: head/kerberos5/lib/libhx509/Makefile > ============================================================================== > --- head/kerberos5/lib/libhx509/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libhx509/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -211,7 +211,9 @@ CFLAGS+=-I${KRB5DIR}/lib/hx509 > CFLAGS+=-I${KRB5DIR}/lib/hx509/ref > CFLAGS+=-I${KRB5DIR}/lib/asn1 > CFLAGS+=-I${KRB5DIR}/lib/wind > -CFLAGS+=-I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/roken > +CFLAGS+=-I${SRCTOP}/contrib/com_err > +CFLAGS+=-I. > > GEN_OCSP= \ > asn1_OCSPBasicOCSPResponse.x \ > > Modified: head/kerberos5/lib/libkadm5clnt/Makefile > ============================================================================== > --- head/kerberos5/lib/libkadm5clnt/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libkadm5clnt/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -34,7 +34,8 @@ SRCS= ad.c \ > rename_c.c \ > send_recv.c > > -CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err -I. > > .include > > > Modified: head/kerberos5/lib/libkadm5srv/Makefile > ============================================================================== > --- head/kerberos5/lib/libkadm5srv/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libkadm5srv/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -35,7 +35,8 @@ SRCS= acl.c \ > set_keys.c \ > set_modifier.c > > -CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/kadm5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err -I. > > .include > > > Modified: head/kerberos5/lib/libkdc/Makefile > ============================================================================== > --- head/kerberos5/lib/libkdc/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libkdc/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -28,7 +28,8 @@ SRCS= \ > CFLAGS+= -I${KRB5DIR}/lib/roken \ > -I${KRB5DIR}/lib/krb5 \ > -I${KRB5DIR}/lib/hdb \ > - -I${KRB5DIR}/kdc > + -I${KRB5DIR}/kdc \ > + -I${SRCTOP}/contrib/com_err > > .include > > > Modified: head/kerberos5/lib/libkrb5/Makefile > ============================================================================== > --- head/kerberos5/lib/libkrb5/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libkrb5/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -621,7 +621,9 @@ CFLAGS+= -I${KRB5DIR}/lib/krb5 \ > -I${KRB5DIR}/lib/asn1 \ > -I${KRB5DIR}/lib/roken \ > -I${KRB5DIR}/lib/ipc \ > - -I${KRB5DIR}/base -I. > + -I${KRB5DIR}/base \ > + -I${SRCTOP}/contrib/com_err \ > + -I. > > .include > > > Modified: head/kerberos5/lib/libwind/Makefile > ============================================================================== > --- head/kerberos5/lib/libwind/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/lib/libwind/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -27,7 +27,7 @@ SRCS= bidi.c \ > SRCS+= wind_err.c \ > wind_err.h > > -CFLAGS+=-I${KRB5DIR}/lib/roken -I. > +CFLAGS+=-I${KRB5DIR}/lib/roken -I${SRCTOP}/contrib/com_err -I. > > .include > > > Modified: head/kerberos5/libexec/digest-service/Makefile > ============================================================================== > --- head/kerberos5/libexec/digest-service/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/libexec/digest-service/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -7,7 +7,8 @@ CFLAGS+= -I${KRB5DIR}/kdc \ > -I${KRB5DIR}/lib/krb5 \ > -I${KRB5DIR}/lib/ipc \ > -I${KRB5DIR}/lib/wind \ > - -I${KRB5DIR}/lib/roken > + -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err > LIBADD= hdb kdc heimipcs krb5 roken asn1 crypto vers heimntlm > LDFLAGS=${LDAPLDFLAGS} > > > Modified: head/kerberos5/libexec/hprop/Makefile > ============================================================================== > --- head/kerberos5/libexec/hprop/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/libexec/hprop/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -9,6 +9,7 @@ CFLAGS+=-I${KRB5DIR}/lib/asn1 > CFLAGS+=-I${KRB5DIR}/lib/hx509 > CFLAGS+=-I${KRB5DIR}/lib/ntlm > CFLAGS+=-I${KRB5DIR}/kdc > +CFLAGS+=-I${SRCTOP}/contrib/com_err > CFLAGS+=-I${.OBJDIR:H:H}/lib/libkrb5 > LIBADD= hdb krb5 roken vers > DPADD= ${LDAPDPADD} > > Modified: head/kerberos5/libexec/hpropd/Makefile > ============================================================================== > --- head/kerberos5/libexec/hpropd/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/libexec/hpropd/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -3,7 +3,7 @@ > PROG= hpropd > MAN= hpropd.8 > CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 \ > - -I${KRB5DIR}/kdc ${LDAPCFLAGS} > + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} > LIBADD= hdb krb5 roken vers > DPADD= ${LDAPDPADD} > LDADD= ${LDAPLDADD} > > Modified: head/kerberos5/libexec/kadmind/Makefile > ============================================================================== > --- head/kerberos5/libexec/kadmind/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/libexec/kadmind/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -8,7 +8,7 @@ SRCS= rpc.c \ > kadm_conn.c > > CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ > - ${LDAPCFLAGS} > + -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} > LIBADD= kadm5srv gssapi hdb krb5 roken vers > DPADD= ${LDAPDPADD} > LDADD= ${LDAPLDADD} > > Modified: head/kerberos5/libexec/kdc/Makefile > ============================================================================== > --- head/kerberos5/libexec/kdc/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/libexec/kdc/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -9,7 +9,7 @@ SRCS= config.c \ > main.c > > CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ > - -I${KRB5DIR}/kdc ${LDAPCFLAGS} > + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} > LIBADD= kdc hdb krb5 roken crypt vers > LDFLAGS=${LDAPLDFLAGS} > > > Modified: head/kerberos5/usr.bin/hxtool/Makefile > ============================================================================== > --- head/kerberos5/usr.bin/hxtool/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/usr.bin/hxtool/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -5,7 +5,9 @@ MAN= > CFLAGS+= -I${KRB5DIR}/lib/hx509 \ > -I${KRB5DIR}/lib/asn1 \ > -I${KRB5DIR}/lib/roken \ > - -I${KRB5DIR}/lib/sl -I. > + -I${KRB5DIR}/lib/sl \ > + -I${SRCTOP}/contrib/com_err \ > + -I. > LIBADD= hx509 roken asn1 crypto sl vers edit > SRCS= hxtool.c hxtool-commands.c hxtool-commands.h > > > Modified: head/kerberos5/usr.bin/kadmin/Makefile > ============================================================================== > --- head/kerberos5/usr.bin/kadmin/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/usr.bin/kadmin/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -25,7 +25,7 @@ SRCS= add_enctype.c \ > util.c > > CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ > - -I${KRB5DIR}/lib/sl -I. ${LDAPCFLAGS} > + -I${KRB5DIR}/lib/sl -I${SRCTOP}/contrib/com_err -I. ${LDAPCFLAGS} > LIBADD= kadm5clnt kadm5srv hdb krb5 roken vers sl asn1 crypto edit > DPADD= ${LDAPDPADD} > LDADD= ${LDAPLDADD} > > Modified: head/kerberos5/usr.bin/string2key/Makefile > ============================================================================== > --- head/kerberos5/usr.bin/string2key/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/usr.bin/string2key/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -6,7 +6,8 @@ CFLAGS+= -I${KRB5DIR}/kdc \ > -I${KRB5DIR}/lib/asn1 \ > -I${KRB5DIR}/lib/krb5 \ > -I${KRB5DIR}/lib/roken \ > - -I${KRB5DIR}/lib/windc > + -I${KRB5DIR}/lib/windc \ > + -I${SRCTOP}/contrib/com_err > LIBADD= krb5 roken crypto vers > > .include > > Modified: head/kerberos5/usr.bin/verify_krb5_conf/Makefile > ============================================================================== > --- head/kerberos5/usr.bin/verify_krb5_conf/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/usr.bin/verify_krb5_conf/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -2,7 +2,8 @@ > > PROG= verify_krb5_conf > MAN= verify_krb5_conf.8 > -CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken > +CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/contrib/com_err > LIBADD= krb5 roken vers > > .include > > Modified: head/kerberos5/usr.sbin/kstash/Makefile > ============================================================================== > --- head/kerberos5/usr.sbin/kstash/Makefile Mon Jan 14 03:19:08 2019 (r343010) > +++ head/kerberos5/usr.sbin/kstash/Makefile Mon Jan 14 06:34:54 2019 (r343011) > @@ -3,7 +3,7 @@ > PROG= kstash > MAN= kstash.8 > CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/roken \ > - -I${KRB5DIR}/kdc ${LDAPCFLAGS} > + -I${KRB5DIR}/kdc -I${SRCTOP}/contrib/com_err ${LDAPCFLAGS} > LIBADD= hdb krb5 crypto vers > DPADD= ${LDAPDPADD} > LDADD= ${LDAPLDADD} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jan 14 16:32:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F9CA14A5203; Mon, 14 Jan 2019 16:32:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 891A86A57F; Mon, 14 Jan 2019 16:32:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0EGWFGP035794; Mon, 14 Jan 2019 08:32:15 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0EGWFud035793; Mon, 14 Jan 2019 08:32:15 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901141632.x0EGWFud035793@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343020 - head/usr.sbin/bluetooth/bluetooth-config In-Reply-To: <201901140823.x0E8Nmll096242@repo.freebsd.org> To: Lars Engels Date: Mon, 14 Jan 2019 08:32:15 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 891A86A57F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 16:32:19 -0000 > Author: lme (ports committer) > Date: Mon Jan 14 08:23:47 2019 > New Revision: 343020 > URL: https://svnweb.freebsd.org/changeset/base/343020 > > Log: > This new version of bluetooth-config.sh tries to follow the style of other > shell scripts in base, removes the bogus "copyleft", adds the BeerWare license > header and uses rc.subr(8) new 'enable' keyword for adding entries in > rc.conf(5). > > Submitted by: erdgeist > Approved by: bapt > MFC after: 2 weeks > > Modified: > head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh > > Modified: head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh > ============================================================================== > --- head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 07:54:11 2019 (r343019) > +++ head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 08:23:47 2019 (r343020) > @@ -1,9 +1,12 @@ > #!/bin/sh > #- > -# Copyleft 2019 Dirk Engling > +# ---------------------------------------------------------------------------- > +# "THE BEER-WARE LICENSE" (Revision 42): > +# wrote this file. As long as you retain this notice you > +# can do whatever you want with this stuff. If we meet some day, and you think > +# this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp > +# ---------------------------------------------------------------------------- Great step forward, but it needs a copyright, without one the Berne convention applies, and that just makes this a case of an undocumented copyright. I didnt think about that when you showed it with no copyright, there really should be one in every file to get out of that Berne "undocumented" state. Thanks, Rod > # > -# This script is released under the beerware license. > -# > # $FreeBSD$ > # > > @@ -11,8 +14,6 @@ > exerr () { echo -e "Error: $*" >&2 ; exit 1; } > print_syntax () { echo -e "Syntax: $0 scan [-d device] [-n node]"; exit 1; } > > -# Assuming we are called to do the pair-new-device subcommand first > - > main() { > unset node device started bdaddresses retry > > @@ -22,132 +23,140 @@ shift > > # Get command line options > while getopts :d:n: arg; do > - case ${arg} in > - d) device="$OPTARG";; > - n) node="$OPTARG";; > - ?) print_syntax;; > - esac > + case ${arg} in > + d) device="$OPTARG";; > + n) node="$OPTARG";; > + ?) print_syntax;; > + esac > done > > # No use running without super user rights > -[ $( id -u ) -eq 0 ] || exerr "$0 must modify files that belong to root. Re-run as root." > +if [ $( id -u ) -ne 0 ]; then > + exerr "$0 must modify files that belong to root. Re-run as root." > +fi > > -known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | \ > - /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1) > +known_nodes=$( /usr/sbin/hccontrol read_node_list 2>/dev/null |\ > + /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) > > # Check if netgraph knows about any HCI nodes > if ! [ "${known_nodes}" ]; then > - ng_nodes=$(/usr/sbin/ngctl list 2>/dev/null | \ > - /usr/bin/grep -o "Name: .* Type: ubt" | /usr/bin/cut -d ' ' -f 2) > + ng_nodes=$( /usr/sbin/ngctl list 2>/dev/null | \ > + /usr/bin/grep -o "Name: .* Type: ubt" |/usr/bin/cut -d' ' -f2 ) > > - [ "${ng_nodes}" ] || exerr "No Bluetooth host controllers found." > + [ "${ng_nodes}" ] || exerr "No Bluetooth host controllers found." > > - unset found > - for n in ${ng_nodes}; do > - if [ "${n}" = "${node%hci}" ]; then > - # If we found the node but its stack is not set up, do it now > - /usr/sbin/service bluetooth start ${node%hci} || exit 1 > - found="YES" > - fi > - done > + unset found > + for n in ${ng_nodes}; do > + if [ "${n}" = "${node%hci}" ]; then > + # Found the node but its stack is not set up? Do it now. > + /usr/sbin/service bluetooth start ${node%hci} || exit 1 > + found="YES" > + fi > + done > > - # If we have Bluetooth controller nodes without a set up stack, > - # ask the user if we shall start it up > - if ! [ "${found}" ]; then > - printf "No usable Bluetooth host controllers were found.\n" > - printf "These host controllers exist in the system:\n %s" " ${ng_nodes}" > - read -p "Choose a host controller to set up: [${ng_nodes%% *}]" node > - : ${node:="${ng_nodes%% *}"} > - /usr/sbin/service bluetooth start ${node} || exit 1 > - fi > + # If we have Bluetooth controller nodes without a set up stack, > + # ask the user if we shall start it up > + if ! [ "${found}" ]; then > + printf "No usable Bluetooth host controllers were found.\n" > + printf "These host controllers exist in the system:\n" > + printf " %s\n" "${ng_nodes}" > + prompt="Choose a host controller to set up: [${ng_nodes%% *}]" > + read -p "${prompt}" node > + : ${node:="${ng_nodes%% *}"} > + /usr/sbin/service bluetooth start ${node} || exit 1 > + fi > > - # Re-read known nodes > - known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | \ > - /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1) > - # check if we succeeded in bringing it up > - [ "${known_nodes}" ] || exerr "Failed to set up Bluetooth stack" > + # Re-read known nodes > + known_nodes=$(/usr/sbin/hccontrol read_node_list 2>/dev/null | > + /usr/bin/tail -n +2 | /usr/bin/cut -d ' ' -f 1 ) > + > + # check if we succeeded in bringing it up > + [ "${known_nodes}" ] || exerr "Failed to set up Bluetooth stack" > fi > > # if a node was requested on command line, check if it is there > if [ "${node}" ]; then > - unset found > - for n in ${known_nodes}; do > - [ "${n}" = "${node}" ] && found="YES" > - [ "${n}" = "${node}hci" ] && node="${node}hci" && found="YES" > - done > - [ "${found}" ] || exerr "Node ${node} not found" > + unset found > + for n in ${known_nodes}; do > + [ "${n}" = "${node}" ] && found="YES" > + [ "${n}" = "${node}hci" ] && node="${node}hci" && found="YES" > + done > + [ "${found}" ] || exerr "Node ${node} not found" > fi > > [ "${node}" ] && node="-n ${node}" > > while ! [ "${bdaddresses}" ]; do > - retry=X${retry} > - printf "Scanning for new Bluetooth devices (Attempt %d of 5) ... " ${#retry} > - bdaddresses=$( /usr/sbin/hccontrol -N ${node} inquiry 2>/dev/null | \ > - /usr/bin/grep -o "BD_ADDR: .*" | /usr/bin/cut -d ' ' -f 2 ) > + retry=X${retry} > + printf "Scanning for new Bluetooth devices (Attempt %d of 5) ... " \ > + ${#retry} > + bdaddresses=$( /usr/sbin/hccontrol -N ${node} inquiry 2>/dev/null | > + /usr/bin/grep -o "BD_ADDR: .*" | /usr/bin/cut -d ' ' -f 2 ) > > - # Count entries and, if a device was requested on command line, > - # try to find it > - unset found count > - for bdaddress in ${bdaddresses}; do > - count=X${count} > - if [ "${bdaddress}" = "${device}" ]; then > - found=YES > - bdaddresses="${device}" > - count=X > - break > - fi > - done > + # Count entries and, if a device was requested on command line, > + # try to find it > + unset found count > + for bdaddress in ${bdaddresses}; do > + count=X${count} > + if [ "${bdaddress}" = "${device}" ]; then > + found=YES > + bdaddresses="${device}" > + count=X > + break > + fi > + done > > - # If device was requested on command line but is not found, > - # or no devices found at all, rescan until retry is exhausted > - if ! [ "${found}" -o "${count}" -a -z "${device}" ]; then > - printf "failed.\n" > - if [ "${#retry}" -eq 5 ]; then > - [ "${device}" ] && exerr "Device ${device} not found" > - exerr "No new Bluetooth devices found" > - fi > - unset bdaddresses > - sleep 2 > - continue > - fi > + # If device was requested on command line but is not found, > + # or no devices found at all, rescan until retry is exhausted > + if ! [ "${found}" -o "${count}" -a -z "${device}" ]; then > + printf "failed.\n" > + if [ "${#retry}" -eq 5 ]; then > + [ "${device}" ] && exerr "Device ${device} not found" > + exerr "No new Bluetooth devices found" > + fi > + unset bdaddresses > + sleep 2 > + continue > + fi > > - [ ${#count} -gt 1 ] && plural=s || plural='' > - printf "done.\nFound %d new bluetooth device%s (scanning for names):\n" ${#count} ${plural} > + [ ${#count} -gt 1 ] && plural=s || plural='' > + printf "done.\nFound %d new bluetooth device%s " ${#count} ${plural} > + printf "(now scanning for names):\n" > > - # Looping again for the faster feedback > - unset count > - for bdaddress in ${bdaddresses}; do > - count=X${count} > - bdname=$( /usr/bin/bthost -b "${bdaddress}" 2>/dev/null ) > - friendlyname=$( /usr/sbin/hccontrol Remote_Name_Request ${bdaddress} 2> /dev/null | \ > - /usr/bin/grep -o "Name: .*" | /usr/bin/cut -d ' ' -f 2- ) > + # Looping again for the faster feedback > + unset count > + for bdaddress in ${bdaddresses}; do > + count=X${count} > + bdname=$( /usr/bin/bthost -b "${bdaddress}" 2>/dev/null ) > + friendlyname=$( /usr/sbin/hccontrol Remote_Name_Request \ > + ${bdaddress} 2> /dev/null | > + /usr/bin/grep -o "Name: .*" |/usr/bin/cut -d ' ' -f 2- ) > > - # sdpcontrol should be able to pull vendor and product id via sdp > - printf "[%2d] %s\t\"%s\" (%s)\n" ${#count} "${bdaddress}" "${friendlyname}" "${bdname}" > + # sdpcontrol should be able to pull vendor + product id via sdp > + printf "[%2d] %s\t\"%s\" (%s)\n" ${#count} "${bdaddress}" \ > + "${friendlyname}" "${bdname}" > > - eval bdaddress_${#count}=\${bdaddress} > - eval bdname_${#count}=\${bdname} > - eval friendlyname_${#count}=\${friendlyname} > - done > + eval bdaddress_${#count}=\${bdaddress} > + eval bdname_${#count}=\${bdname} > + eval friendlyname_${#count}=\${friendlyname} > + done > > - # If a device was pre-selected, do not query the user > - [ "${device}" ] && topair=1 || unset topair > + # If a device was pre-selected, do not query the user > + [ "${device}" ] && topair=1 || unset topair > > - # Even if only one device was found, user may chose 0 to rescan > - while ! [ "${topair}" ]; do > - if [ ${#count} -eq 1 ]; then > - read -p "Select device to pair with [1, or 0 to rescan]: " topair > - else > - read -p "Select device to pair with [1-${#count}, or 0 to rescan]: " topair > - fi > - if ! [ "${topair}" -ge 0 -a "${topair}" -le "${#count}" ] 2>/dev/null ; then > - printf "Value out of range: %s.\n" {topair} > - unset topair > - fi > - done > + # Even if only one device was found, user may chose 0 to rescan > + while ! [ "${topair}" ]; do > + prompt="Select device to pair with [1" > + [ ${#count} -gt 1 ] && prompt="${prompt}-${#count}" > + read -p "${prompt}, or 0 to rescan]: " topair > + if ! [ "${topair}" -ge 0 -a "${topair}" -le "${#count}" ] \ > + 2>/dev/null ; then > + printf "Value out of range: %s.\n" {topair} > + unset topair > + fi > + done > > - [ "${topair}" -eq "0" ] && unset bdaddresses retry > + [ "${topair}" -eq "0" ] && unset bdaddresses retry > done > > eval bdaddress=\${bdaddress_${topair}} > @@ -156,20 +165,24 @@ eval friendlyname=\${friendlyname_${topair}} > > # Do we need to add an entry to /etc/bluetooth/hosts? > if ! [ "${bdname}" ]; then > - printf "\nAdding device ${bdaddress} to /etc/bluetooth/hosts.\n" > + printf "\nAdding device ${bdaddress} to /etc/bluetooth/hosts.\n" > > - while ! [ "${bdname}" ]; do > - read -p "Enter friendly name. [${friendlyname}]: " REPLY > - : ${REPLY:="${friendlyname}"} > + while ! [ "${bdname}" ]; do > + read -p "Enter friendly name. [${friendlyname}]: " _r > + : ${_r:="${friendlyname}"} > > - if [ "${REPLY}" ]; then > - # Remove white space and non-friendly characters > - bdname=$( printf "%s" "${REPLY}" | tr -c '[:alnum:]-,.' _ ) > - [ "${REPLY}" != "${bdname}" ] && printf "Notice: Using sanitized name \"%s\" in /etc/bluetooth/hosts.\n" "${bdname}" > - fi > - done > + if [ "${_r}" ]; then > + # Remove white space and non-friendly characters > + bdname=$( printf "%s" "${_r}" | tr -c '[:alnum:]-,.' _ ) > + if [ "${_r}" != "${bdname}" ]; then > + printf "Notice: Using sanitized name" > + printf "\"%s\" in /etc/bluetooth/hosts.\n" \ > + "${bdname}" > + fi > + fi > + done > > - printf "%s\t%s\n" "${bdaddress}" "${bdname}" >> /etc/bluetooth/hosts > + printf "%s\t%s\n" "${bdaddress}" "${bdname}" >> /etc/bluetooth/hosts > fi > > # If scanning for the name did not succeed, resort to bdname > @@ -183,86 +196,109 @@ fi > # Also we cannot really modify the PIN in an existing entry. So we > # need to prompt the user to manually do it and restart this script > if ! /usr/sbin/service hcsecd enabled; then > - printf "\nWarning: hcsecd is not enabled.\nThis daemon manages pairing requests.\n" > - read -p "Enable hcsecd? [yes]: " REPLY > - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/sysrc hcsecd_enable="YES";; esac > + printf "\nWarning: hcsecd is not enabled.\n" > + printf "This daemon manages pairing requests.\n" > + read -p "Enable hcsecd? [yes]: " _r > + case "${_r}" in > + no|n|NO|N|No|nO) ;; > + *) /usr/sbin/service hcsecd enable;; > + esac > fi > + > secd_config=$( /usr/sbin/sysrc -n hcsecd_config ) > -secd_entries=$( /usr/bin/grep -Eo "bdaddr[[:space:]]+(${bdaddress}|${bdname})" ${secd_config} | awk '{ print $2; }' ) > +secd_entries=$( /usr/bin/grep -Eo "bdaddr[[:space:]]+(${bdaddress}|${bdname})" \ > + ${secd_config} | awk '{ print $2; }' ) > > if [ "${secd_entries}" ]; then > - printf "\nWarning: An entry for device %s is already present in %s.\n" ${secd_entries} ${secd_config} > - printf "To modify pairing information, edit this file and run\n service hcsecd restart\n" > - read -p "Continue? [yes]: " REPLY > - case "${REPLY}" in no|n|NO|N|No|nO) exit;; esac > + printf "\nWarning: An entry for device %s is already present in %s.\n" \ > + ${secd_entries} ${secd_config} > + printf "To modify pairing information, edit this file and run\n" > + printf " service hcsecd restart\n" > + read -p "Continue? [yes]: " _r > + case "${_r}" in no|n|NO|N|No|nO) exit;; esac > else > - printf "\nWriting pairing information description block to %s.\n" ${secd_config} > - printf "(To get PIN, put device in pairing mode first.)\n" > - read -p "Enter PIN [nopin]: " pin > - [ "${pin}" ] && pin=\""${pin}"\" || pin="nopin" > + printf "\nWriting pairing information description block to %s.\n" \ > + ${secd_config} > + printf "(To get PIN, put device in pairing mode first.)\n" > + read -p "Enter PIN [nopin]: " pin > + [ "${pin}" ] && pin=\""${pin}"\" || pin="nopin" > > - # Write out new hcsecd config block > - printf "\ndevice {\n\tbdaddr\t%s;\n\tname\t\"%s\";\n\tkey\tnokey\;\n\tpin\t%s\;\n}\n" \ > - "${bdaddress}" "${friendlyname}" "${pin}" >> ${secd_config} > + # Write out new hcsecd config block > + printf "\ndevice {\n\tbdaddr\t%s;\n\tname\t\"%s\";\n\tkey\tnokey\;\n\tpin\t%s\;\n}\n" \ > + "${bdaddress}" "${friendlyname}" "${pin}" >> ${secd_config} > > - # ... and make daemon reload config, TODO: hcsecd should provide a reload hook > - /usr/sbin/service hcsecd restart > + # ... and make daemon reload config > + # TODO: hcsecd should provide a reload hook > + /usr/sbin/service hcsecd onerestart > > - # TODO: we should check if hcsecd succeeded pairing and revert to an old version > - # of hcsecd.conf so we can undo adding the block above and retry with a new PIN > - # also, if there's a way to force devices to re-pair, try this > + # TODO: we should check if hcsecd succeeded pairing and revert to an > + # old version of hcsecd.conf so we can undo adding the block above and > + # retry with a new PIN > + # also, if there's a way to force devices to re-pair, try this > fi > > # now check for specific services to be provided by the device > # first up: HID > > -if /usr/sbin/sdpcontrol -a "${bdaddress}" search HID | \ > - /usr/bin/grep -q "^Record Handle: "; then > +/usr/sbin/sdpcontrol -a "${bdaddress}" search HID | \ > + /usr/bin/grep -q "^Record Handle: " || exit 0 > > - printf "\nThis device provides human interface device services.\n" > - read -p "Set it up? [yes]: " REPLY > - case "${REPLY}" in no|n|NO|N|No|nO) ;; > - *) > - if ! /usr/sbin/service bthidd enabled; then > - printf "\nWarning: bthidd is not enabled." > - printf "\nThis daemon manages Bluetooth HID devices.\n" > - read -p "Enable bthidd? [yes]: " REPLY > - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/sysrc bthidd_enable="YES";; esac > - fi > +printf "\nThis device provides human interface device services.\n" > +read -p "Set it up? [yes]: " _r > +case "${_r}" in > + no|n|NO|N|No|nO) exit 0;; > + *);; > +esac > > - # Check if bthidd already knows about this device > - bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ > - /usr/bin/grep "${bdaddress}" ) > - if [ "${bthidd_known}" ]; then > - printf "Notice: Device %s already known to bthidd.\n" "${bdaddress}" > - else > - bthidd_config=$( /usr/sbin/sysrc -n bthidd_config ) > - printf "Writing HID descriptor block to %s ... " "${bthidd_config}" > - /usr/sbin/bthidcontrol -a "${bdaddress}" query >> "${bthidd_config}" > +# Here we have found an HID and were asked to set it up > +# NOTE: look out for the two exit 0 above if you extend this script > > - # Re-read config to see if we succeeded adding the device > - bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ > - grep "${bdaddress}" ) > - if ! [ "${bthidd_known}" ]; then > - printf "failed.\n" > - else > - printf "success.\nTo re-read its config, bthidd must be restarted.\n" > - printf "Warning: If a Bluetooth keyboard is being used, the connection might be lost.\n" > - printf "It can be manually restarted later with\n service bthidd restart\n" > - read -p "Restart bthidd now? [yes]: " REPLY > - case "${REPLY}" in no|n|NO|N|No|nO) ;; *) /usr/sbin/service bthidd restart;; esac > - fi > - fi > - ;; > - esac > +if ! /usr/sbin/service bthidd enabled; then > + printf "\nWarning: bthidd is not enabled." > + printf "\nThis daemon manages Bluetooth HID devices.\n" > + read -p "Enable bthidd? [yes]: " _r > + case "${_r}" in > + no|n|NO|N|No|nO) ;; > + *) /usr/sbin/service bthidd enable;; > + esac > fi > > +# Check if bthidd already knows about this device > +bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ > + /usr/bin/grep "${bdaddress}" ) > + > +if [ "${bthidd_known}" ]; then > + printf "Notice: Device %s already known to bthidd.\n" "${bdaddress}" > + return 0 > +fi > + > +bthidd_config=$( /usr/sbin/sysrc -n bthidd_config ) > +printf "Writing HID descriptor block to %s ... " "${bthidd_config}" > +/usr/sbin/bthidcontrol -a "${bdaddress}" query >> "${bthidd_config}" > + > +# Re-read config to see if we succeeded adding the device > +bthidd_known=$( /usr/sbin/bthidcontrol -a "${bdaddress}" known | \ > + grep "${bdaddress}" ) > +if ! [ "${bthidd_known}" ]; then > + printf "failed.\n" > +else > + printf "success.\nTo re-read its config, bthidd must be restarted.\n" > + printf "Warning: If a Bluetooth keyboard is being used, the connection" > + printf "might be lost.\n" > + printf "It can be manually restarted later with\n" > + printf " service bthidd restart\n" > + read -p "Restart bthidd now? [yes]: " _r > + case "${_r}" in > + no|n|NO|N|No|nO) ;; > + *) /usr/sbin/service bthidd onerestart;; > + esac > +fi > + > } > > # After function definitions, main() can use them > main "$@" > - > -exit > +exit 0 > > # TODO > # * If device is a keyboard, offer a text entry test field and if it does > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jan 14 17:15:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDE014A6C2F; Mon, 14 Jan 2019 17:15:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA646C677; Mon, 14 Jan 2019 17:15:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6630C1C47B; Mon, 14 Jan 2019 17:15:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 3C57D9784C; Mon, 14 Jan 2019 18:15:51 +0100 (CET) Date: Mon, 14 Jan 2019 18:15:51 +0100 From: Baptiste Daroussin To: rgrimes@freebsd.org Cc: Lars Engels , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343020 - head/usr.sbin/bluetooth/bluetooth-config Message-ID: <20190114171550.ttxceuyepezanhz5@ivaldir.net> References: <201901140823.x0E8Nmll096242@repo.freebsd.org> <201901141632.x0EGWFud035793@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vku2kgy2xltugn2x" Content-Disposition: inline In-Reply-To: <201901141632.x0EGWFud035793@pdx.rh.CN85.dnsmgr.net> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: CAA646C677 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 17:15:53 -0000 --vku2kgy2xltugn2x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2019 at 08:32:15AM -0800, Rodney W. Grimes wrote: > > Author: lme (ports committer) > > Date: Mon Jan 14 08:23:47 2019 > > New Revision: 343020 > > URL: https://svnweb.freebsd.org/changeset/base/343020 > >=20 > > Log: > > This new version of bluetooth-config.sh tries to follow the style of = other > > shell scripts in base, removes the bogus "copyleft", adds the BeerWar= e license > > header and uses rc.subr(8) new 'enable' keyword for adding entries in > > rc.conf(5). > > =20 > > Submitted by: erdgeist > > Approved by: bapt > > MFC after: 2 weeks > >=20 > > Modified: > > head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh > >=20 > > Modified: head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.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=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Ja= n 14 07:54:11 2019 (r343019) > > +++ head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Ja= n 14 08:23:47 2019 (r343020) > > @@ -1,9 +1,12 @@ > > #!/bin/sh > > #- > > -# Copyleft 2019 Dirk Engling > > +# --------------------------------------------------------------------= -------- > > +# "THE BEER-WARE LICENSE" (Revision 42): > > +# wrote this file. As long as you retain this = notice you > > +# can do whatever you want with this stuff. If we meet some day, and y= ou think > > +# this stuff is worth it, you can buy me a beer in return Poul-Henning= Kamp > > +# --------------------------------------------------------------------= -------- >=20 > Great step forward, but it needs a copyright, without one > the Berne convention applies, and that just makes this a > case of an undocumented copyright. I didnt think about that > when you showed it with no copyright, there really should be > one in every file to get out of that Berne "undocumented" state. >=20 None of the beerware code in base is following what you ask for. it is used= for ctm, fdwrite, ministat, recoverdisk, many places in the kernel etc. Best regards, Bapt --vku2kgy2xltugn2x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlw8w8QACgkQY4mL3PG3 PlrushAAqiqgKZGhgNy8A+w63Awfu03jDFv25hrE+JJAFwcPiUdI+LFZEUkncP1M Z6xgltmiRr6j1IX2KUULhht7GJ0ZPpOg1waBcSmj/kieYzW7BOrcLWj8nuAJ3lf1 KZf19gArcthir/fgYjEJ//UMMq9YR3ZreKnJ8HxYnwvmcXvYt1G5+Y/yjDRytOBq pmgLYs67DVJT2ICCUh1B3P4FM670/m065Q9i9e1TcNnOC//QcInOSlQIlGwbB+T1 3LxRgtMPa9Xzr7AjMmewfpYTqU3Zq+qgnkqRGyonB7JHKIRXDcEHpFT7QdFpXY4f 6/t4h0YYDfUwR/f9/Qpy4R5OuGGeKwtwF+mxG4wBtFDNPqgURf0nP/JwKopgoE5r HdvEWwh6wZz9HAYBw+B4Jp0VwBhLJYamne7/NzNrz3i1MFwfoPBpWxAR3XkIYYzA gF9czc4rwvvU5mu2uWKTa4oD+g7CR+zlpdrtwON6mqA6vkWzSxFPN9K8cHfBxnA5 3K+NWY7Do8qXVkoJQUMOZ06Q0Ub6M+qhZhRv1BWZGJeuqh9YarEaUevRlFKQCwEh 9A8pEtlEG6scPsoQnBdmTHO2NKu3gRIoiHv2cOpoRJnAkhEIu5choBHQg8pK2Xso DX099RYOO6yt6v6thjWV1vDFoW6UGF5HjhetX2zOc4AA76NJws0= =ID+5 -----END PGP SIGNATURE----- --vku2kgy2xltugn2x-- From owner-svn-src-head@freebsd.org Mon Jan 14 17:36:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 316DD148156F; Mon, 14 Jan 2019 17:36:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68FEC6D462; Mon, 14 Jan 2019 17:36:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0EHa7iI036138; Mon, 14 Jan 2019 09:36:07 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0EHa7KA036137; Mon, 14 Jan 2019 09:36:07 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901141736.x0EHa7KA036137@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343020 - head/usr.sbin/bluetooth/bluetooth-config In-Reply-To: <20190114171550.ttxceuyepezanhz5@ivaldir.net> To: Baptiste Daroussin Date: Mon, 14 Jan 2019 09:36:07 -0800 (PST) CC: rgrimes@FreeBSD.org, Lars Engels , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 68FEC6D462 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 17:36:10 -0000 > On Mon, Jan 14, 2019 at 08:32:15AM -0800, Rodney W. Grimes wrote: > > > Author: lme (ports committer) > > > Date: Mon Jan 14 08:23:47 2019 > > > New Revision: 343020 > > > URL: https://svnweb.freebsd.org/changeset/base/343020 > > > > > > Log: > > > This new version of bluetooth-config.sh tries to follow the style of other > > > shell scripts in base, removes the bogus "copyleft", adds the BeerWare license > > > header and uses rc.subr(8) new 'enable' keyword for adding entries in > > > rc.conf(5). > > > > > > Submitted by: erdgeist > > > Approved by: bapt > > > MFC after: 2 weeks > > > > > > Modified: > > > head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh > > > > > > Modified: head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh > > > ============================================================================== > > > --- head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 07:54:11 2019 (r343019) > > > +++ head/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Mon Jan 14 08:23:47 2019 (r343020) > > > @@ -1,9 +1,12 @@ > > > #!/bin/sh > > > #- > > > -# Copyleft 2019 Dirk Engling > > > +# ---------------------------------------------------------------------------- > > > +# "THE BEER-WARE LICENSE" (Revision 42): > > > +# wrote this file. As long as you retain this notice you ^^^^^^^^^^^^^^^^^^^^^^ And if I had looked more carefully it clearly does document who the Berne copyright holder would be. Sorry for the noise, Rod > > > +# can do whatever you want with this stuff. If we meet some day, and you think > > > +# this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp > > > +# ---------------------------------------------------------------------------- > > > > Great step forward, but it needs a copyright, without one > > the Berne convention applies, and that just makes this a > > case of an undocumented copyright. I didnt think about that > > when you showed it with no copyright, there really should be > > one in every file to get out of that Berne "undocumented" state. > > > > None of the beerware code in base is following what you ask for. it is used for > ctm, fdwrite, ministat, recoverdisk, many places in the kernel etc. > > Best regards, > Bapt -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jan 14 20:13:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 097591485F16; Mon, 14 Jan 2019 20:13:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E908073B69; Mon, 14 Jan 2019 20:13:42 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id j8c8gnkSVnBo4j8c9gMkBX; Mon, 14 Jan 2019 13:13:41 -0700 X-Authority-Analysis: v=2.3 cv=J8fUEzvS c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=PBJgjM2NpsWgmWMOLkQA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id D2F816FC; Mon, 14 Jan 2019 12:13:48 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0EKDd6B004744; Mon, 14 Jan 2019 12:13:39 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0EKDdsA004741; Mon, 14 Jan 2019 12:13:39 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901142013.x0EKDdsA004741@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Takahashi Yoshihiro , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... In-Reply-To: Message from "Rodney W. Grimes" of "Mon, 14 Jan 2019 08:17:58 -0800." <201901141617.x0EGHwqQ035748@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 14 Jan 2019 12:13:39 -0800 X-CMAE-Envelope: MS4wfJGQiRdOE4ZZxesD6HfcudFKMnr+Jmh93UaXE6Ktcu8AB6ZaLFI23ad3l0DNWUNgcdX++y5tSaJUyZRCLGHa4O6YrRskvj56D2AC1uc+iBVnv+WqCt+j I0fSClMXtnO9xOt746xibAMhgHjPRP1ZPpYSDGt9ei8ytoT7twmhPGM4b6y1gYn8l0uxp0BX0ga0NwfSwIlZ4pWpOG/FSZRMWCwUxCwKf6TYJiTkurv/8uqr kexMthw+vjUwQZ1+SgkIL0xm90SafVLtMebbCX8JkQiaQsGacSYjdOOP//V0IvLme/25AvjoWXYYFemvZXISRA== X-Rspamd-Queue-Id: E908073B69 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.85 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; LONG_SUBJ(1.52)[203]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-1.73)[ip: (-4.36), ipnet: 64.59.128.0/20(-2.36), asn: 6327(-1.82), country: CA(-0.09)]; R_SPF_NA(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 20:13:44 -0000 In message <201901141617.x0EGHwqQ035748@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > Author: nyan > > Date: Mon Jan 14 06:34:54 2019 > > New Revision: 343011 > > URL: https://svnweb.freebsd.org/changeset/base/343011 > > > > Log: > > Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed com_err. > h. > > This fixes build when com_err.h is not installed. > > Isn't this the general state of affairs for almost all > of the source tree? I would rather see this solved > in a general way, rather than sprinkly all this > -I${SRCTOP} all over in the tree. Agreed however in practice this is fixed when discovered while working on other issues/problems/projects. > > It use to be (and maybe still is) required that you run > cd $DRCTOP && make includes > if you expected new source code to compile. I expect > this has changed, but the just of it should work in > some aspect. This fixes the potential bug of requiring a header file to be installed. I suspect this to be an oversight at the time. Good that it's fixed now. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Jan 14 20:31:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 451D61486F23; Mon, 14 Jan 2019 20:31:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D394475015; Mon, 14 Jan 2019 20:31:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0EKVQSB036915; Mon, 14 Jan 2019 12:31:27 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0EKVQSb036914; Mon, 14 Jan 2019 12:31:26 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901142031.x0EKVQSb036914@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... In-Reply-To: <201901142013.x0EKDdsA004741@slippy.cwsent.com> To: Cy Schubert Date: Mon, 14 Jan 2019 12:31:26 -0800 (PST) CC: rgrimes@freebsd.org, Takahashi Yoshihiro , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: D394475015 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 20:31:30 -0000 > In message <201901141617.x0EGHwqQ035748@pdx.rh.CN85.dnsmgr.net>, > "Rodney W. Gri > mes" writes: > > > Author: nyan > > > Date: Mon Jan 14 06:34:54 2019 > > > New Revision: 343011 > > > URL: https://svnweb.freebsd.org/changeset/base/343011 > > > > > > Log: > > > Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed com_err. > > h. > > > This fixes build when com_err.h is not installed. > > > > Isn't this the general state of affairs for almost all > > of the source tree? I would rather see this solved > > in a general way, rather than sprinkly all this > > -I${SRCTOP} all over in the tree. > > Agreed however in practice this is fixed when discovered while working > on other issues/problems/projects. This adds another special case that should not exist. > > > > It use to be (and maybe still is) required that you run > > cd $DRCTOP && make includes > > if you expected new source code to compile. I expect > > this has changed, but the just of it should work in > > some aspect. > > This fixes the potential bug of requiring a header file to be > installed. I suspect this to be an oversight at the time. > > Good that it's fixed now. Something is wrong, as infact com_err.h *IS* installed as /usr/include/com_err.h diff /usr/include/com_err.h /usr/src/contrib/com_err/com_err.h -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jan 14 21:14:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6721A1487FE1; Mon, 14 Jan 2019 21:14:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C74C176567; Mon, 14 Jan 2019 21:14:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id h3so218399pfg.1; Mon, 14 Jan 2019 13:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=fCSdsPrLH91KcgNFFqNS9d22ksh29iSW6iERDD015pg=; b=liYD0z4TLhbvS8XSZSg7kpfXZlww/AmK69+THLVdZWMdbyIbmebUXl/yW7F3dBUw+f mUwbKF80sxWWshnK/oTKWyFE++XmaLMBH1w1zXUmyfepy7XpjxKHGeX4rC1b15c+1rDP UBCM21HQtrOycNYt/pmUDLuSSFaJo7lxkyXm0V75lzdIwUdxUuu5T9hWsWAHNtZBJ6dx UpVo7IuC+IEJN9Gfx+pLnaNNDjVqU1kQtjQE3a+H7UV5M2Wyv02G2UpncOJsCUaYwBkz PoV9Vk21xxusTaKAUzhO81RRSTdp5RqDx511/K34gw6F9aXE8twQHvwhLlTPCCGok+zO XGCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=fCSdsPrLH91KcgNFFqNS9d22ksh29iSW6iERDD015pg=; b=F7RWqNXWwbJCO6YDtJ9nsyZYVHBVXhIKsAw9b6YJPW0CK7hic5txDRpe0+Pydl0ev/ H2+f/XVHKnLH9GaIin681n1+0/7r/fRRaQOcfAUECxwaJc1twsTapGD/y5ar5Cwehl6/ XJ76WTNAUyZkWbOAleVxfN5mXtidfeFf+zLdMlYBftLmMmq9wkl6zCZ4mydfxfUIvFTc 5PKd7xUqQVhwdiKIpOru9pjNx4VQX2SrNhtX+n96ekJ59BEiXYMaNcs5uhnmeau3NFRR oE3kFVx1Le/Kv5hu1ssF+Sno4rHqWzp6z9LvzJXqaEAbKEYYL9gVvWbMd8iAUBM0NFZ7 EtWg== X-Gm-Message-State: AJcUukeMeN6nj625WvN3beA8hYIdIs0Zs+lXKTtOJE3IZOGfW5m9+J30 vcMQ1S81Pyk8fz0JTf4ekei5SL+T X-Google-Smtp-Source: ALg8bN6M4RG+OO7Xu2uNrsDlVQofurU3VuXM0uUzdFi9Y6mGXaJOhZzBS6sU2UhI4EmuicuxIPmbMg== X-Received: by 2002:a62:184e:: with SMTP id 75mr494076pfy.28.1547500469248; Mon, 14 Jan 2019 13:14:29 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id h79sm1740193pfj.186.2019.01.14.13.14.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 13:14:28 -0800 (PST) From: Enji Cooper Message-Id: <67E1A06E-292E-4771-A604-46C60D899277@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_C85D2B5D-7546-4C1A-959C-253E6362636D"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... Date: Mon, 14 Jan 2019 13:14:26 -0800 In-Reply-To: <201901142031.x0EKVQSb036914@pdx.rh.CN85.dnsmgr.net> Cc: Cy Schubert , Takahashi Yoshihiro , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: rgrimes@freebsd.org References: <201901142031.x0EKVQSb036914@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: C74C176567 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 21:14:31 -0000 --Apple-Mail=_C85D2B5D-7546-4C1A-959C-253E6362636D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 14, 2019, at 12:31 PM, Rodney W. Grimes = wrote: >=20 >> In message <201901141617.x0EGHwqQ035748@pdx.rh.CN85.dnsmgr.net>, >> "Rodney W. Gri >> mes" writes: >>>> Author: nyan >>>> Date: Mon Jan 14 06:34:54 2019 >>>> New Revision: 343011 >>>> URL: https://svnweb.freebsd.org/changeset/base/343011 >>>>=20 >>>> Log: >>>> Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed = com_err. >>> h. >>>> This fixes build when com_err.h is not installed. >>>=20 >>> Isn't this the general state of affairs for almost all >>> of the source tree? I would rather see this solved >>> in a general way, rather than sprinkly all this >>> -I${SRCTOP} all over in the tree. >>=20 >> Agreed however in practice this is fixed when discovered while = working >> on other issues/problems/projects. >=20 > This adds another special case that should not exist. >=20 >>>=20 >>> It use to be (and maybe still is) required that you run >>> cd $DRCTOP && make includes >>> if you expected new source code to compile. I expect >>> this has changed, but the just of it should work in >>> some aspect. >>=20 >> This fixes the potential bug of requiring a header file to be >> installed. I suspect this to be an oversight at the time. >>=20 >> Good that it's fixed now. >=20 > Something is wrong, as infact com_err.h *IS* > installed as /usr/include/com_err.h >=20 > diff /usr/include/com_err.h /usr/src/contrib/com_err/com_err.h Hi Rod, In the full case, yes. It=E2=80=99s relying on the staging = process for buildworld, which builds and installs everything in one = phase as part of =E2=80=9Cmake libraries=E2=80=9D. The list of kerberos libraries which rely on libcom_err is = potentially incomplete, so there=E2=80=99s a chance that it=E2=80=99s = not installing the headers in time. I=E2=80=99ll leave it as an exercise to the reader (in part, = because I=E2=80=99d rather not spending time chasing down this issue, as = there are other bigger fish to fry), to find the underlying issue in = Makefile.inc1 (in my not so humble opinion, kerberos/lib is broken down = a bit too much in Makefile.inc1, which obfuscates dependencies, makes it = extremely easy to miss them when adding/accounting for libraries, and = also plugs too much knowledge into a separate location in the build = system, duplicating efforts). Cheers, -Enji 2734 _prebuild_libs=3D ${_kerberos5_lib_libasn1} \ 2735 ${_kerberos5_lib_libhdb} \ 2736 ${_kerberos5_lib_libheimbase} \ 2737 ${_kerberos5_lib_libheimntlm} \ 2738 ${_libsqlite3} \ 2739 ${_kerberos5_lib_libheimipcc} \ 2740 ${_kerberos5_lib_libhx509} = ${_kerberos5_lib_libkrb5} \ 2741 ${_kerberos5_lib_libroken} \ 2742 ${_kerberos5_lib_libwind} \ 2743 lib/libbz2 ${_libcom_err} lib/libcrypt \ =E2=80=A6 2878 .if ${MK_KERBEROS} !=3D "no" 2879 kerberos5/lib/libasn1__L: lib/libcom_err__L = kerberos5/lib/libroken__L 2880 kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L = \ 2881 kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ 2882 kerberos5/lib/libwind__L lib/libsqlite3__L 2883 kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L = kerberos5/lib/libkrb5__L \ 2884 kerberos5/lib/libroken__L lib/libcom_err__L 2885 kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L = lib/libcom_err__L \ 2886 secure/lib/libcrypto__L kerberos5/lib/libroken__L = kerberos5/lib/libwind__L 2887 kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L = lib/libcom_err__L \ 2888 lib/libcrypt__L secure/lib/libcrypto__L = kerberos5/lib/libhx509__L \ 2889 kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ 2890 kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L 2891 kerberos5/lib/libroken__L: lib/libcrypt__L 2892 kerberos5/lib/libwind__L: kerberos5/lib/libroken__L = lib/libcom_err__L 2893 kerberos5/lib/libheimbase__L: lib/libthr__L 2894 kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L = kerberos5/lib/libheimbase__L lib/libthr__L 2895 .endif ... 2903 .if ${MK_KERBEROS} !=3D "no" 2904 _kerberos5_lib=3D kerberos5/lib 2905 _kerberos5_lib_libasn1=3D kerberos5/lib/libasn1 2906 _kerberos5_lib_libhdb=3D kerberos5/lib/libhdb 2907 _kerberos5_lib_libheimbase=3D kerberos5/lib/libheimbase 2908 _kerberos5_lib_libkrb5=3D kerberos5/lib/libkrb5 2909 _kerberos5_lib_libhx509=3D kerberos5/lib/libhx509 2910 _kerberos5_lib_libroken=3D kerberos5/lib/libroken 2911 _kerberos5_lib_libheimntlm=3D kerberos5/lib/libheimntlm 2912 _libsqlite3=3D lib/libsqlite3 2913 _kerberos5_lib_libheimipcc=3D kerberos5/lib/libheimipcc 2914 _kerberos5_lib_libwind=3D kerberos5/lib/libwind 2915 _libcom_err=3D lib/libcom_err 2916 .endif ... 2949 .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} 2950 ${_lib}__L: .PHONY .MAKE 2951 .if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib}) 2952 ${_+_}@${ECHODIR} "=3D=3D=3D> ${_lib} (obj,all,install)"; \ 2953 cd ${.CURDIR}/${_lib}; \ 2954 if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=3Dno= DIRPRFX=3D${_lib}/ obj; fi; \ 2955 ${MAKE} MK_TESTS=3Dno DIRPRFX=3D${_lib}/ all; \ 2956 ${MAKE} MK_TESTS=3Dno DIRPRFX=3D${_lib}/ install 2957 .endif 2958 .endfor --Apple-Mail=_C85D2B5D-7546-4C1A-959C-253E6362636D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlw8+7IACgkQ5JFNMZeD GN7TwhAAkfVdOVYG1zUazOxs9lajlrH4nMRy4evgPHGToQTQ+7padZnljo6c3rRM 5iUHczEwWCf0JqzvE85uQUD/3KCT+ef09MD4F4avB5Y+K+39PlHJsPp0DINGZtsd O324/CgBJ3ipaYVQsDCks4lRY8itfsM2TctLCu9xcjf6DxFG9WmE7P73NpgAeDms PPzWeHy64uwS8pdMoMUypdjUuZ549OtHwBTbfYkTgbgTPNCfDlmOo3Ln7xr5Q5Gs 1ZzxJ7kvHKbhQHNCoDzeDwwgFLoZlJpFbwWCAjYFxwTgS5+UqUz8R+osbOEeWrI+ IkU0rBb8S1+B4FosOxnaH0PVNYpWHH94ltlhZaQrVZZyBaUA0KoiwCXuHrarYH3R csxb6eYk1mcmOD55UyNGhIhChgUym/YfrW5RmodbdMVNNWcr6R3gjayYBshVMvXw C8lr62dG9mKtO2KoBM0dE6uhC8/41OHlLvIY60mOQhzf15usDfdOy4slwy1oIf7I PKJDaPf30+ZpZ0LFlBuM4GrzRhAAmApDwKR6q4Byjq+D10x5R08bnDMrFNO4FqHE IyfX1ZQe34JiRmczr74TbDejQTcQzbNuiOd6nDRjmum/jX4AgoGfUvY85BPH7pIk 8pVQN/njDQhlTf8A4ZYNQLIcIlpz+AWiIMl4jKO+7hUGLS+gQAQ= =qmlq -----END PGP SIGNATURE----- --Apple-Mail=_C85D2B5D-7546-4C1A-959C-253E6362636D-- From owner-svn-src-head@freebsd.org Mon Jan 14 21:24:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096541488394; Mon, 14 Jan 2019 21:24:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 23F9B76B26; Mon, 14 Jan 2019 21:24:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id j9iogw95g82Ycj9ipgxZPp; Mon, 14 Jan 2019 14:24:41 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=3JhidrIBZZsA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=lz2pXyTTt24pO-65IhIA:9 a=QEXdDO2ut3YA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 6524E7A0; Mon, 14 Jan 2019 13:24:46 -0800 (PST) Date: Mon, 14 Jan 2019 13:24:14 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <201901142031.x0EKVQSb036914@pdx.rh.CN85.dnsmgr.net> References: <201901142031.x0EKVQSb036914@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343011 - in head/kerberos5: lib/libasn1 lib/libgssapi_krb5 lib/libhdb lib/libheimntlm lib/libhx509 lib/libkadm5clnt lib/libkadm5srv lib/libkdc lib/libkrb5 lib/libwind libexec/digest-se... To: rgrimes@freebsd.org,"Rodney W. Grimes" CC: Takahashi Yoshihiro , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <500EC03A-1DAB-45A6-9CA8-1DE960EB6E6D@cschubert.com> X-CMAE-Envelope: MS4wfLUEWHAgLlC2tiAAZ/tcyTUDT8SUo4OVwKWMhuQaEA7ta2g27Gun98QXr5L0GT4agzDPqYKDO15uwXaMloXU4T1spBi0iO/wFyfT25RSPoN3d0z+HaT0 alP5chacTE2pKbDc2FjwmAzphHjxVsBrsndUVy4ZFOuhqhqrx5cRGVfxN7EjkaZo16J73PCqBi+3GX6Qn5tqazWi5P/q4HHkkfBmTWQXpsvcjWGXtaj9N0T3 crbAfbrlcOobtBmQi3tpO+PMiL+vpRaspFfZr4rPVQkiUTXb1KUYKqfj0/1zNhQkcDVgCQoozVyuLHSi3NmVX5YTfCTZKLREGaTwPwAj+mQxqPpZ3zV4bi07 wdTQTKPx X-Rspamd-Queue-Id: 23F9B76B26 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 21:24:50 -0000 On January 14, 2019 12:31:26 PM PST, "Rodney W=2E Grimes" wrote: >> In message <201901141617=2Ex0EGHwqQ035748@pdx=2Erh=2ECN85=2Ednsmgr=2Ene= t>,=20 >> "Rodney W=2E Gri >> mes" writes: >> > > Author: nyan >> > > Date: Mon Jan 14 06:34:54 2019 >> > > New Revision: 343011 >> > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343011 >> > >=20 >> > > Log: >> > > Use ${SRCTOP}/contrib/com_err/com_err=2Eh instead of the >installed com_err=2E >> > h=2E >> > > This fixes build when com_err=2Eh is not installed=2E >> > >> > Isn't this the general state of affairs for almost all >> > of the source tree? I would rather see this solved >> > in a general way, rather than sprinkly all this >> > -I${SRCTOP} all over in the tree=2E >>=20 >> Agreed however in practice this is fixed when discovered while >working=20 >> on other issues/problems/projects=2E > >This adds another special case that should not exist=2E > >> > >> > It use to be (and maybe still is) required that you run >> > cd $DRCTOP && make includes >> > if you expected new source code to compile=2E I expect >> > this has changed, but the just of it should work in >> > some aspect=2E >>=20 >> This fixes the potential bug of requiring a header file to be=20 >> installed=2E I suspect this to be an oversight at the time=2E >>=20 >> Good that it's fixed now=2E > >Something is wrong, as infact com_err=2Eh *IS* >installed as /usr/include/com_err=2Eh > >diff /usr/include/com_err=2Eh /usr/src/contrib/com_err/com_err=2Eh This is the typical location krb5 puts this file=2E There is a project bra= nch that moves this file by making kerberos private=2E It's currently block= ed by a number of ports this breaks, most of which are addressed=2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Jan 14 23:24:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ECDE148AB37; Mon, 14 Jan 2019 23:24:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E3F6382442; Mon, 14 Jan 2019 23:23:59 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x0ENNpf2043618 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 14 Jan 2019 15:23:51 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x0ENNpQR043617; Mon, 14 Jan 2019 15:23:51 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 14 Jan 2019 15:23:51 -0800 From: Gleb Smirnoff To: "Jason A. Harmening" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343005 - head/sys/kern Message-ID: <20190114232351.GS18452@FreeBSD.org> References: <201901132033.x0DKXtin020499@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901132033.x0DKXtin020499@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: E3F6382442 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:2906, ipnet:198.45.48.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 14 Jan 2019 23:24:00 -0000 Jason, thanks a lot for fixing this. On Sun, Jan 13, 2019 at 08:33:55PM +0000, Jason A. Harmening wrote: J> Author: jah J> Date: Sun Jan 13 20:33:54 2019 J> New Revision: 343005 J> URL: https://svnweb.freebsd.org/changeset/base/343005 J> J> Log: J> Handle SIGIO for listening sockets J> J> r319722 separated struct socket and parts of the socket I/O path into J> listening-socket-specific and dataflow-socket-specific pieces. Listening J> socket connection notifications are now handled by solisten_wakeup() instead J> of sowakeup(), but solisten_wakeup() does not currently post SIGIO to the J> owning process. J> J> PR: 234258 J> Reported by: Kenneth Adelman J> MFC after: 1 week J> Differential Revision: https://reviews.freebsd.org/D18664 J> J> Modified: J> head/sys/kern/uipc_socket.c J> J> Modified: head/sys/kern/uipc_socket.c J> ============================================================================== J> --- head/sys/kern/uipc_socket.c Sun Jan 13 19:49:46 2019 (r343004) J> +++ head/sys/kern/uipc_socket.c Sun Jan 13 20:33:54 2019 (r343005) J> @@ -886,6 +886,8 @@ solisten_wakeup(struct socket *sol) J> } J> SOLISTEN_UNLOCK(sol); J> wakeup_one(&sol->sol_comp); J> + if ((sol->so_state & SS_ASYNC) && sol->so_sigio != NULL) J> + pgsigio(&sol->so_sigio, SIGIO, 0); J> } J> J> /* J> -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Jan 15 00:02:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADAAE148B8C8; Tue, 15 Jan 2019 00:02:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6CF837D9; Tue, 15 Jan 2019 00:02:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ED9DA47C; Tue, 15 Jan 2019 00:02:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F027V5092947; Tue, 15 Jan 2019 00:02:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F026EW092943; Tue, 15 Jan 2019 00:02:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901150002.x0F026EW092943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 00:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343026 - in head: lib/libmemstat sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: lib/libmemstat sys/vm X-SVN-Commit-Revision: 343026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E6CF837D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 00:02:12 -0000 Author: glebius Date: Tue Jan 15 00:02:06 2019 New Revision: 343026 URL: https://svnweb.freebsd.org/changeset/base/343026 Log: o Move zone limit from keg level up to zone level. This means that now two zones sharing a keg may have different limits. Now this is going to work: zone = uma_zcreate(); uma_zone_set_max(zone, limit); zone2 = uma_zsecond_create(zone); uma_zone_set_max(zone2, limit2); Kegs no longer have uk_maxpages field, but zones have uz_items. When set, it may be rounded up to minimum possible CPU bucket cache size. For small limits bucket cache can also be reconfigured to be smaller. Counter uz_items is updated whenever items transition from keg to a bucket cache or directly to a consumer. If zone has uz_maxitems set and it is reached, then we are going to sleep. o Since new limits don't play well with multi-keg zones, remove them. The idea of multi-keg zones was introduced exactly 10 years ago, and never have had a practical usage. In discussion with Jeff we came to a wild agreement that if we ever want to reintroduce the idea of a smart allocator that would be able to choose between two (or more) totally different backing stores, that choice should be made one level higher than UMA, e.g. in malloc(9) or in mget(), or whatever and choice should be controlled by the caller. o Sleeping code is improved to account number of sleepers and wake them one by one, to avoid thundering herd problem. o Flag UMA_ZONE_NOBUCKETCACHE removed, instead uma_zone_set_maxcache() KPI added. Having no bucket cache basically means setting maxcache to 0. o Now with many fields added and many removed (no multi-keg zones!) make sure that struct uma_zone is perfectly aligned. Reviewed by: markj, jeff Tested by: pho Differential Revision: https://reviews.freebsd.org/D17773 Modified: head/lib/libmemstat/memstat_uma.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Mon Jan 14 21:46:56 2019 (r343025) +++ head/lib/libmemstat/memstat_uma.c Tue Jan 15 00:02:06 2019 (r343026) @@ -448,12 +448,7 @@ skip_percpu: mtp->mt_memalloced = mtp->mt_numallocs * mtp->mt_size; mtp->mt_memfreed = mtp->mt_numfrees * mtp->mt_size; mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed; - if (kz.uk_ppera > 1) - mtp->mt_countlimit = kz.uk_maxpages / - kz.uk_ipers; - else - mtp->mt_countlimit = kz.uk_maxpages * - kz.uk_ipers; + mtp->mt_countlimit = uz.uz_max_items; mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size; mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; for (i = 0; i < ndomains; i++) { Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Mon Jan 14 21:46:56 2019 (r343025) +++ head/sys/vm/uma.h Tue Jan 15 00:02:06 2019 (r343026) @@ -218,17 +218,6 @@ uma_zone_t uma_zsecond_create(char *name, uma_ctor cto uma_init zinit, uma_fini zfini, uma_zone_t master); /* - * Add a second master to a secondary zone. This provides multiple data - * backends for objects with the same size. Both masters must have - * compatible allocation flags. Presently, UMA_ZONE_MALLOC type zones are - * the only supported. - * - * Returns: - * Error on failure, 0 on success. - */ -int uma_zsecond_add(uma_zone_t zone, uma_zone_t master); - -/* * Create cache-only zones. * * This allows uma's per-cpu cache facilities to handle arbitrary @@ -285,10 +274,6 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * NUMA aware Zone. Implements a best * effort first-touch policy. */ -#define UMA_ZONE_NOBUCKETCACHE 0x20000 /* - * Don't cache full buckets. Limit - * UMA to per-cpu state. - */ /* * These flags are shared between the keg and zone. In zones wishing to add @@ -510,6 +495,18 @@ int uma_zone_reserve_kva(uma_zone_t zone, int nitems); * int The effective value of nitems after rounding up based on page size */ int uma_zone_set_max(uma_zone_t zone, int nitems); + +/* + * Sets a high limit on the number of items allowed in zone's bucket cache + * + * Arguments: + * zone The zone to limit + * nitems The requested upper limit on the number of items allowed + * + * Returns: + * int The effective value of nitems set + */ +int uma_zone_set_maxcache(uma_zone_t zone, int nitems); /* * Obtains the effective limit on the number of items in a zone Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Jan 14 21:46:56 2019 (r343025) +++ head/sys/vm/uma_core.c Tue Jan 15 00:02:06 2019 (r343026) @@ -219,7 +219,12 @@ struct uma_bucket_zone bucket_zones[] = { /* * Flags and enumerations to be passed to internal functions. */ -enum zfreeskip { SKIP_NONE = 0, SKIP_DTOR, SKIP_FINI }; +enum zfreeskip { + SKIP_NONE = 0, + SKIP_CNT = 0x00000001, + SKIP_DTOR = 0x00010000, + SKIP_FINI = 0x00020000, +}; #define UMA_ANYDOMAIN -1 /* Special value for domain search. */ @@ -255,17 +260,17 @@ static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); static void uma_startup3(void); static void *zone_alloc_item(uma_zone_t, void *, int, int); +static void *zone_alloc_item_locked(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); static void bucket_enable(void); static void bucket_init(void); static uma_bucket_t bucket_alloc(uma_zone_t zone, void *, int); static void bucket_free(uma_zone_t zone, uma_bucket_t, void *); static void bucket_zone_drain(void); -static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int); +static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int, int); static uma_slab_t zone_fetch_slab(uma_zone_t, uma_keg_t, int, int); -static uma_slab_t zone_fetch_slab_multi(uma_zone_t, uma_keg_t, int, int); static void *slab_alloc_item(uma_keg_t keg, uma_slab_t slab); -static void slab_free_item(uma_keg_t keg, uma_slab_t slab, void *item); +static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags); static int zone_import(uma_zone_t, void **, int, int, int); @@ -472,6 +477,7 @@ zone_try_fetch_bucket(uma_zone_t zone, uma_zone_domain zdom->uzd_nitems -= bucket->ub_cnt; if (ws && zdom->uzd_imin > zdom->uzd_nitems) zdom->uzd_imin = zdom->uzd_nitems; + zone->uz_bkt_count -= bucket->ub_cnt; } return (bucket); } @@ -482,11 +488,14 @@ zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdo { ZONE_LOCK_ASSERT(zone); + KASSERT(zone->uz_bkt_count < zone->uz_bkt_max, ("%s: zone %p overflow", + __func__, zone)); LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); zdom->uzd_nitems += bucket->ub_cnt; if (ws && zdom->uzd_imax < zdom->uzd_nitems) zdom->uzd_imax = zdom->uzd_nitems; + zone->uz_bkt_count += bucket->ub_cnt; } static void @@ -509,15 +518,6 @@ zone_maxaction(uma_zone_t zone) taskqueue_enqueue(taskqueue_thread, &zone->uz_maxaction); } -static void -zone_foreach_keg(uma_zone_t zone, void (*kegfn)(uma_keg_t)) -{ - uma_klink_t klink; - - LIST_FOREACH(klink, &zone->uz_kegs, kl_link) - kegfn(klink->kl_keg); -} - /* * Routine called by timeout which is used to fire off some time interval * based calculations. (stats, hash size, etc.) @@ -562,8 +562,9 @@ zone_domain_update_wss(uma_zone_domain_t zdom) * Returns nothing. */ static void -keg_timeout(uma_keg_t keg) +zone_timeout(uma_zone_t zone) { + uma_keg_t keg = zone->uz_keg; KEG_LOCK(keg); /* @@ -601,20 +602,11 @@ keg_timeout(uma_keg_t keg) return; } } - KEG_UNLOCK(keg); -} -static void -zone_timeout(uma_zone_t zone) -{ - int i; - - zone_foreach_keg(zone, &keg_timeout); - - ZONE_LOCK(zone); - for (i = 0; i < vm_ndomains; i++) + for (int i = 0; i < vm_ndomains; i++) zone_domain_update_wss(&zone->uz_domain[i]); - ZONE_UNLOCK(zone); + + KEG_UNLOCK(keg); } /* @@ -744,6 +736,11 @@ bucket_drain(uma_zone_t zone, uma_bucket_t bucket) for (i = 0; i < bucket->ub_cnt; i++) zone->uz_fini(bucket->ub_bucket[i], zone->uz_size); zone->uz_release(zone->uz_arg, bucket->ub_bucket, bucket->ub_cnt); + ZONE_LOCK(zone); + zone->uz_items -= bucket->ub_cnt; + if (zone->uz_sleepers && zone->uz_items < zone->uz_max_items) + wakeup_one(zone); + ZONE_UNLOCK(zone); bucket->ub_cnt = 0; } @@ -1029,7 +1026,7 @@ zone_drain_wait(uma_zone_t zone, int waitok) * we're running. Normally the uma_rwlock would protect us but we * must be able to release and acquire the right lock for each keg. */ - zone_foreach_keg(zone, &keg_drain); + keg_drain(zone->uz_keg); ZONE_LOCK(zone); zone->uz_flags &= ~UMA_ZFLAG_DRAINING; wakeup(zone); @@ -1068,7 +1065,8 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom KASSERT(domain >= 0 && domain < vm_ndomains, ("keg_alloc_slab: domain %d out of range", domain)); - mtx_assert(&keg->uk_lock, MA_OWNED); + KEG_LOCK_ASSERT(keg); + MPASS(zone->uz_lockptr == &keg->uk_lock); allocf = keg->uk_allocf; KEG_UNLOCK(keg); @@ -1164,8 +1162,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do void *mem; int pages; - keg = zone_first_keg(zone); - + keg = zone->uz_keg; /* * If we are in BOOT_BUCKETS or higher, than switch to real * allocator. Zones with page sized slabs switch at BOOT_PAGEALLOC. @@ -1303,7 +1300,7 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, int doma uma_keg_t keg; TAILQ_INIT(&alloctail); - keg = zone_first_keg(zone); + keg = zone->uz_keg; npages = howmany(bytes, PAGE_SIZE); while (npages > 0) { @@ -1525,8 +1522,6 @@ keg_large_init(uma_keg_t keg) { KASSERT(keg != NULL, ("Keg is null in keg_large_init")); - KASSERT((keg->uk_flags & UMA_ZFLAG_CACHEONLY) == 0, - ("keg_large_init: Cannot large-init a UMA_ZFLAG_CACHEONLY keg")); KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0, ("%s: Cannot large-init a UMA_ZONE_PCPU keg", __func__)); @@ -1747,15 +1742,14 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_sleeps = 0; zone->uz_count = 0; zone->uz_count_min = 0; + zone->uz_count_max = BUCKET_MAX; zone->uz_flags = 0; zone->uz_warning = NULL; /* The domain structures follow the cpu structures. */ zone->uz_domain = (struct uma_zone_domain *)&zone->uz_cpu[mp_ncpus]; + zone->uz_bkt_max = ULONG_MAX; timevalclear(&zone->uz_ratecheck); - keg = arg->keg; - ZONE_LOCK_INIT(zone, (arg->flags & UMA_ZONE_MTXCLASS)); - /* * This is a pure cache zone, no kegs. */ @@ -1768,6 +1762,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_release = arg->release; zone->uz_arg = arg->arg; zone->uz_lockptr = &zone->uz_lock; + ZONE_LOCK_INIT(zone, (arg->flags & UMA_ZONE_MTXCLASS)); rw_wlock(&uma_rwlock); LIST_INSERT_HEAD(&uma_cachezones, zone, uz_link); rw_wunlock(&uma_rwlock); @@ -1780,6 +1775,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_import = (uma_import)zone_import; zone->uz_release = (uma_release)zone_release; zone->uz_arg = zone; + keg = arg->keg; if (arg->flags & UMA_ZONE_SECONDARY) { KASSERT(arg->keg != NULL, ("Secondary zone on zero'd keg")); @@ -1818,12 +1814,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) return (error); } - /* - * Link in the first keg. - */ - zone->uz_klink.kl_keg = keg; - LIST_INSERT_HEAD(&zone->uz_kegs, &zone->uz_klink, kl_link); - zone->uz_lockptr = &keg->uk_lock; + zone->uz_keg = keg; zone->uz_size = keg->uk_size; zone->uz_flags |= (keg->uk_flags & (UMA_ZONE_INHERIT | UMA_ZFLAG_INHERIT)); @@ -1889,12 +1880,10 @@ keg_dtor(void *arg, int size, void *udata) static void zone_dtor(void *arg, int size, void *udata) { - uma_klink_t klink; uma_zone_t zone; uma_keg_t keg; zone = (uma_zone_t)arg; - keg = zone_first_keg(zone); if (!(zone->uz_flags & UMA_ZFLAG_INTERNAL)) cache_drain(zone); @@ -1910,25 +1899,17 @@ zone_dtor(void *arg, int size, void *udata) */ zone_drain_wait(zone, M_WAITOK); /* - * Unlink all of our kegs. - */ - while ((klink = LIST_FIRST(&zone->uz_kegs)) != NULL) { - klink->kl_keg = NULL; - LIST_REMOVE(klink, kl_link); - if (klink == &zone->uz_klink) - continue; - free(klink, M_TEMP); - } - /* * We only destroy kegs from non secondary zones. */ - if (keg != NULL && (zone->uz_flags & UMA_ZONE_SECONDARY) == 0) { + if ((keg = zone->uz_keg) != NULL && + (zone->uz_flags & UMA_ZONE_SECONDARY) == 0) { rw_wlock(&uma_rwlock); LIST_REMOVE(keg, uk_link); rw_wunlock(&uma_rwlock); zone_free_item(kegs, keg, NULL, SKIP_NONE); } - ZONE_LOCK_FINI(zone); + if (zone->uz_lockptr == &zone->uz_lock) + ZONE_LOCK_FINI(zone); } /* @@ -2219,7 +2200,7 @@ uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor uma_zone_t res; bool locked; - keg = zone_first_keg(master); + keg = master->uz_keg; memset(&args, 0, sizeof(args)); args.name = name; args.size = keg->uk_size; @@ -2263,90 +2244,11 @@ uma_zcache_create(char *name, int size, uma_ctor ctor, args.release = zrelease; args.arg = arg; args.align = 0; - args.flags = flags; + args.flags = flags | UMA_ZFLAG_CACHE; return (zone_alloc_item(zones, &args, UMA_ANYDOMAIN, M_WAITOK)); } -static void -zone_lock_pair(uma_zone_t a, uma_zone_t b) -{ - if (a < b) { - ZONE_LOCK(a); - mtx_lock_flags(b->uz_lockptr, MTX_DUPOK); - } else { - ZONE_LOCK(b); - mtx_lock_flags(a->uz_lockptr, MTX_DUPOK); - } -} - -static void -zone_unlock_pair(uma_zone_t a, uma_zone_t b) -{ - - ZONE_UNLOCK(a); - ZONE_UNLOCK(b); -} - -int -uma_zsecond_add(uma_zone_t zone, uma_zone_t master) -{ - uma_klink_t klink; - uma_klink_t kl; - int error; - - error = 0; - klink = malloc(sizeof(*klink), M_TEMP, M_WAITOK | M_ZERO); - - zone_lock_pair(zone, master); - /* - * zone must use vtoslab() to resolve objects and must already be - * a secondary. - */ - if ((zone->uz_flags & (UMA_ZONE_VTOSLAB | UMA_ZONE_SECONDARY)) - != (UMA_ZONE_VTOSLAB | UMA_ZONE_SECONDARY)) { - error = EINVAL; - goto out; - } - /* - * The new master must also use vtoslab(). - */ - if ((zone->uz_flags & UMA_ZONE_VTOSLAB) != UMA_ZONE_VTOSLAB) { - error = EINVAL; - goto out; - } - - /* - * The underlying object must be the same size. rsize - * may be different. - */ - if (master->uz_size != zone->uz_size) { - error = E2BIG; - goto out; - } - /* - * Put it at the end of the list. - */ - klink->kl_keg = zone_first_keg(master); - LIST_FOREACH(kl, &zone->uz_kegs, kl_link) { - if (LIST_NEXT(kl, kl_link) == NULL) { - LIST_INSERT_AFTER(kl, klink, kl_link); - break; - } - } - klink = NULL; - zone->uz_flags |= UMA_ZFLAG_MULTI; - zone->uz_slab = zone_fetch_slab_multi; - -out: - zone_unlock_pair(zone, master); - if (klink != NULL) - free(klink, M_TEMP); - - return (error); -} - - /* See uma.h */ void uma_zdestroy(uma_zone_t zone) @@ -2408,7 +2310,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags uma_bucket_t bucket; uma_cache_t cache; void *item; - int cpu, domain, lockfail; + int cpu, domain, lockfail, maxbucket; #ifdef INVARIANTS bool skipdbg; #endif @@ -2486,7 +2388,7 @@ zalloc_start: #endif zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { atomic_add_long(&zone->uz_fails, 1); - zone_free_item(zone, item, udata, SKIP_DTOR); + zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); return (NULL); } #ifdef INVARIANTS @@ -2529,8 +2431,10 @@ zalloc_start: domain = UMA_ANYDOMAIN; /* Short-circuit for zones without buckets and low memory. */ - if (zone->uz_count == 0 || bucketdisable) + if (zone->uz_count == 0 || bucketdisable) { + ZONE_LOCK(zone); goto zalloc_item; + } /* * Attempt to retrieve the item from the per-CPU cache has failed, so @@ -2578,8 +2482,17 @@ zalloc_start: * We bump the uz count when the cache size is insufficient to * handle the working set. */ - if (lockfail && zone->uz_count < BUCKET_MAX) + if (lockfail && zone->uz_count < zone->uz_count_max) zone->uz_count++; + + if (zone->uz_max_items > 0) { + if (zone->uz_items >= zone->uz_max_items) + goto zalloc_item; + maxbucket = MIN(zone->uz_count, + zone->uz_max_items - zone->uz_items); + } else + maxbucket = zone->uz_count; + zone->uz_items += maxbucket; ZONE_UNLOCK(zone); /* @@ -2587,11 +2500,19 @@ zalloc_start: * works we'll restart the allocation from the beginning and it * will use the just filled bucket. */ - bucket = zone_alloc_bucket(zone, udata, domain, flags); + bucket = zone_alloc_bucket(zone, udata, domain, flags, maxbucket); CTR3(KTR_UMA, "uma_zalloc: zone %s(%p) bucket zone returned %p", zone->uz_name, zone, bucket); + ZONE_LOCK(zone); if (bucket != NULL) { - ZONE_LOCK(zone); + if (bucket->ub_cnt < maxbucket) { + MPASS(zone->uz_flags & UMA_ZFLAG_CACHE || + zone->uz_items >= maxbucket - bucket->ub_cnt); + zone->uz_items -= maxbucket - bucket->ub_cnt; + if (zone->uz_sleepers > 0 && + zone->uz_items < zone->uz_max_items) + wakeup_one(zone); + } critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2606,7 +2527,7 @@ zalloc_start: domain == PCPU_GET(domain))) { cache->uc_allocbucket = bucket; zdom->uzd_imax += bucket->ub_cnt; - } else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + } else if (zone->uz_bkt_count >= zone->uz_bkt_max) { critical_exit(); ZONE_UNLOCK(zone); bucket_drain(zone, bucket); @@ -2616,13 +2537,18 @@ zalloc_start: zone_put_bucket(zone, zdom, bucket, false); ZONE_UNLOCK(zone); goto zalloc_start; + } else { + zone->uz_items -= maxbucket; + if (zone->uz_sleepers > 0 && + zone->uz_items + 1 < zone->uz_max_items) + wakeup_one(zone); } /* * We may not be able to get a bucket so return an actual item. */ zalloc_item: - item = zone_alloc_item(zone, udata, domain, flags); + item = zone_alloc_item_locked(zone, udata, domain, flags); return (item); } @@ -2665,6 +2591,7 @@ keg_first_slab(uma_keg_t keg, int domain, bool rr) KASSERT(domain >= 0 && domain < vm_ndomains, ("keg_first_slab: domain %d out of range", domain)); + KEG_LOCK_ASSERT(keg); slab = NULL; start = domain; @@ -2690,7 +2617,7 @@ keg_fetch_free_slab(uma_keg_t keg, int domain, bool rr { uint32_t reserve; - mtx_assert(&keg->uk_lock, MA_OWNED); + KEG_LOCK_ASSERT(keg); reserve = (flags & M_USE_RESERVE) != 0 ? 0 : keg->uk_reserve; if (keg->uk_free <= reserve) @@ -2708,7 +2635,7 @@ keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdo bool rr; restart: - mtx_assert(&keg->uk_lock, MA_OWNED); + KEG_LOCK_ASSERT(keg); /* * Use the keg's policy if upper layers haven't already specified a @@ -2741,23 +2668,10 @@ restart: if (flags & M_NOVM) break; - if (keg->uk_maxpages && keg->uk_pages >= keg->uk_maxpages) { - keg->uk_flags |= UMA_ZFLAG_FULL; - /* - * If this is not a multi-zone, set the FULL bit. - * Otherwise slab_multi() takes care of it. - */ - if ((zone->uz_flags & UMA_ZFLAG_MULTI) == 0) { - zone->uz_flags |= UMA_ZFLAG_FULL; - zone_log_warning(zone); - zone_maxaction(zone); - } - if (flags & M_NOWAIT) - return (NULL); - zone->uz_sleeps++; - msleep(keg, &keg->uk_lock, PVM, "keglimit", 0); - continue; - } + KASSERT(zone->uz_max_items == 0 || + zone->uz_items <= zone->uz_max_items, + ("%s: zone %p overflow", __func__, zone)); + slab = keg_alloc_slab(keg, zone, domain, aflags); /* * If we got a slab here it's safe to mark it partially used @@ -2800,7 +2714,7 @@ zone_fetch_slab(uma_zone_t zone, uma_keg_t keg, int do uma_slab_t slab; if (keg == NULL) { - keg = zone_first_keg(zone); + keg = zone->uz_keg; KEG_LOCK(keg); } @@ -2815,87 +2729,6 @@ zone_fetch_slab(uma_zone_t zone, uma_keg_t keg, int do return (NULL); } -/* - * uma_zone_fetch_slab_multi: Fetches a slab from one available keg. Returns - * with the keg locked. On NULL no lock is held. - * - * The last pointer is used to seed the search. It is not required. - */ -static uma_slab_t -zone_fetch_slab_multi(uma_zone_t zone, uma_keg_t last, int domain, int rflags) -{ - uma_klink_t klink; - uma_slab_t slab; - uma_keg_t keg; - int flags; - int empty; - int full; - - /* - * Don't wait on the first pass. This will skip limit tests - * as well. We don't want to block if we can find a provider - * without blocking. - */ - flags = (rflags & ~M_WAITOK) | M_NOWAIT; - /* - * Use the last slab allocated as a hint for where to start - * the search. - */ - if (last != NULL) { - slab = keg_fetch_slab(last, zone, domain, flags); - if (slab) - return (slab); - KEG_UNLOCK(last); - } - /* - * Loop until we have a slab incase of transient failures - * while M_WAITOK is specified. I'm not sure this is 100% - * required but we've done it for so long now. - */ - for (;;) { - empty = 0; - full = 0; - /* - * Search the available kegs for slabs. Be careful to hold the - * correct lock while calling into the keg layer. - */ - LIST_FOREACH(klink, &zone->uz_kegs, kl_link) { - keg = klink->kl_keg; - KEG_LOCK(keg); - if ((keg->uk_flags & UMA_ZFLAG_FULL) == 0) { - slab = keg_fetch_slab(keg, zone, domain, flags); - if (slab) - return (slab); - } - if (keg->uk_flags & UMA_ZFLAG_FULL) - full++; - else - empty++; - KEG_UNLOCK(keg); - } - if (rflags & (M_NOWAIT | M_NOVM)) - break; - flags = rflags; - /* - * All kegs are full. XXX We can't atomically check all kegs - * and sleep so just sleep for a short period and retry. - */ - if (full && !empty) { - ZONE_LOCK(zone); - zone->uz_flags |= UMA_ZFLAG_FULL; - zone->uz_sleeps++; - zone_log_warning(zone); - zone_maxaction(zone); - msleep(zone, zone->uz_lockptr, PVM, - "zonelimit", hz/100); - zone->uz_flags &= ~UMA_ZFLAG_FULL; - ZONE_UNLOCK(zone); - continue; - } - } - return (NULL); -} - static void * slab_alloc_item(uma_keg_t keg, uma_slab_t slab) { @@ -2904,7 +2737,7 @@ slab_alloc_item(uma_keg_t keg, uma_slab_t slab) uint8_t freei; MPASS(keg == slab->us_keg); - mtx_assert(&keg->uk_lock, MA_OWNED); + KEG_LOCK_ASSERT(keg); freei = BIT_FFS(SLAB_SETSIZE, &slab->us_free) - 1; BIT_CLR(SLAB_SETSIZE, freei, &slab->us_free); @@ -2971,10 +2804,9 @@ zone_import(uma_zone_t zone, void **bucket, int max, i } static uma_bucket_t -zone_alloc_bucket(uma_zone_t zone, void *udata, int domain, int flags) +zone_alloc_bucket(uma_zone_t zone, void *udata, int domain, int flags, int max) { uma_bucket_t bucket; - int max; CTR1(KTR_UMA, "zone_alloc:_bucket domain %d)", domain); @@ -2983,7 +2815,6 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do if (bucket == NULL) return (NULL); - max = MIN(bucket->ub_entries, zone->uz_count); bucket->ub_cnt = zone->uz_import(zone->uz_arg, bucket->ub_bucket, max, domain, flags); @@ -3038,13 +2869,45 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do static void * zone_alloc_item(uma_zone_t zone, void *udata, int domain, int flags) { + + ZONE_LOCK(zone); + return (zone_alloc_item_locked(zone, udata, domain, flags)); +} + +/* + * Returns with zone unlocked. + */ +static void * +zone_alloc_item_locked(uma_zone_t zone, void *udata, int domain, int flags) +{ void *item; #ifdef INVARIANTS bool skipdbg; #endif - item = NULL; + ZONE_LOCK_ASSERT(zone); + if (zone->uz_max_items > 0 && zone->uz_items >= zone->uz_max_items) { + zone_log_warning(zone); + zone_maxaction(zone); + if (flags & M_NOWAIT) { + ZONE_UNLOCK(zone); + return (NULL); + } + zone->uz_sleeps++; + zone->uz_sleepers++; + while (zone->uz_items >= zone->uz_max_items) + mtx_sleep(zone, zone->uz_lockptr, PVM, "zonelimit", 0); + zone->uz_sleepers--; + if (zone->uz_sleepers > 0 && + zone->uz_items + 1 < zone->uz_max_items) + wakeup_one(zone); + } + + zone->uz_items++; + zone->uz_allocs++; + ZONE_UNLOCK(zone); + if (domain != UMA_ANYDOMAIN) { /* avoid allocs targeting empty domains */ if (VM_DOMAIN_EMPTY(domain)) @@ -3052,7 +2915,6 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma } if (zone->uz_import(zone->uz_arg, &item, 1, domain, flags) != 1) goto fail; - atomic_add_long(&zone->uz_allocs, 1); #ifdef INVARIANTS skipdbg = uma_dbg_zskip(zone, item); @@ -3065,7 +2927,7 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma */ if (zone->uz_init != NULL) { if (zone->uz_init(item, zone->uz_size, flags) != 0) { - zone_free_item(zone, item, udata, SKIP_FINI); + zone_free_item(zone, item, udata, SKIP_FINI | SKIP_CNT); goto fail; } } @@ -3075,7 +2937,7 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma zone->uz_dtor != trash_dtor) && #endif zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { - zone_free_item(zone, item, udata, SKIP_DTOR); + zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); goto fail; } #ifdef INVARIANTS @@ -3091,9 +2953,13 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma return (item); fail: + ZONE_LOCK(zone); + zone->uz_items--; + zone->uz_allocs--; + ZONE_UNLOCK(zone); + atomic_add_long(&zone->uz_fails, 1); CTR2(KTR_UMA, "zone_alloc_item failed from %s(%p)", zone->uz_name, zone); - atomic_add_long(&zone->uz_fails, 1); return (NULL); } @@ -3104,7 +2970,8 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata uma_cache_t cache; uma_bucket_t bucket; uma_zone_domain_t zdom; - int cpu, domain, lockfail; + int cpu, domain; + bool lockfail; #ifdef INVARIANTS bool skipdbg; #endif @@ -3150,7 +3017,7 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata * The race here is acceptable. If we miss it we'll just have to wait * a little longer for the limits to be reset. */ - if (zone->uz_flags & UMA_ZFLAG_FULL) + if (zone->uz_sleepers > 0) goto zfree_item; /* @@ -3200,11 +3067,11 @@ zfree_start: if (zone->uz_count == 0 || bucketdisable) goto zfree_item; - lockfail = 0; + lockfail = false; if (ZONE_TRYLOCK(zone) == 0) { /* Record contention to size the buckets. */ ZONE_LOCK(zone); - lockfail = 1; + lockfail = true; } critical_enter(); cpu = curcpu; @@ -3233,9 +3100,9 @@ zfree_start: "uma_zfree: zone %s(%p) putting bucket %p on free list", zone->uz_name, zone, bucket); /* ub_cnt is pointing to the last free item */ - KASSERT(bucket->ub_cnt != 0, - ("uma_zfree: Attempting to insert an empty bucket onto the full list.\n")); - if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + KASSERT(bucket->ub_cnt == bucket->ub_entries, + ("uma_zfree: Attempting to insert not full bucket onto the full list.\n")); + if (zone->uz_bkt_count >= zone->uz_bkt_max) { ZONE_UNLOCK(zone); bucket_drain(zone, bucket); bucket_free(zone, bucket, udata); @@ -3248,7 +3115,7 @@ zfree_start: * We bump the uz count when the cache size is insufficient to * handle the working set. */ - if (lockfail && zone->uz_count < BUCKET_MAX) + if (lockfail && zone->uz_count < zone->uz_count_max) zone->uz_count++; ZONE_UNLOCK(zone); @@ -3279,8 +3146,6 @@ zfree_start: */ zfree_item: zone_free_item(zone, item, udata, SKIP_DTOR); - - return; } void @@ -3303,12 +3168,15 @@ uma_zfree_domain(uma_zone_t zone, void *item, void *ud } static void -slab_free_item(uma_keg_t keg, uma_slab_t slab, void *item) +slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item) { + uma_keg_t keg; uma_domain_t dom; uint8_t freei; - mtx_assert(&keg->uk_lock, MA_OWNED); + keg = zone->uz_keg; + MPASS(zone->uz_lockptr == &keg->uk_lock); + KEG_LOCK_ASSERT(keg); MPASS(keg == slab->us_keg); dom = &keg->uk_domain[slab->us_domain]; @@ -3338,11 +3206,9 @@ zone_release(uma_zone_t zone, void **bucket, int cnt) uma_slab_t slab; uma_keg_t keg; uint8_t *mem; - int clearfull; int i; - clearfull = 0; - keg = zone_first_keg(zone); + keg = zone->uz_keg; KEG_LOCK(keg); for (i = 0; i < cnt; i++) { item = bucket[i]; @@ -3356,37 +3222,11 @@ zone_release(uma_zone_t zone, void **bucket, int cnt) } } else { slab = vtoslab((vm_offset_t)item); - if (slab->us_keg != keg) { - KEG_UNLOCK(keg); - keg = slab->us_keg; - KEG_LOCK(keg); - } + MPASS(slab->us_keg == keg); } - slab_free_item(keg, slab, item); - if (keg->uk_flags & UMA_ZFLAG_FULL) { - if (keg->uk_pages < keg->uk_maxpages) { - keg->uk_flags &= ~UMA_ZFLAG_FULL; - clearfull = 1; - } - - /* - * We can handle one more allocation. Since we're - * clearing ZFLAG_FULL, wake up all procs blocked - * on pages. This should be uncommon, so keeping this - * simple for now (rather than adding count of blocked - * threads etc). - */ - wakeup(keg); - } + slab_free_item(zone, slab, item); } KEG_UNLOCK(keg); - if (clearfull) { - ZONE_LOCK(zone); - zone->uz_flags &= ~UMA_ZFLAG_FULL; - wakeup(zone); - ZONE_UNLOCK(zone); - } - } /* @@ -3423,42 +3263,69 @@ zone_free_item(uma_zone_t zone, void *item, void *udat if (skip < SKIP_FINI && zone->uz_fini) zone->uz_fini(item, zone->uz_size); - atomic_add_long(&zone->uz_frees, 1); zone->uz_release(zone->uz_arg, &item, 1); + + if (skip & SKIP_CNT) + return; + + ZONE_LOCK(zone); + zone->uz_frees++; + zone->uz_items--; + if (zone->uz_sleepers > 0 && zone->uz_items < zone->uz_max_items) + wakeup_one(zone); + ZONE_UNLOCK(zone); } /* See uma.h */ int uma_zone_set_max(uma_zone_t zone, int nitems) { - uma_keg_t keg; + struct uma_bucket_zone *ubz; - keg = zone_first_keg(zone); - if (keg == NULL) - return (0); - KEG_LOCK(keg); - keg->uk_maxpages = (nitems / keg->uk_ipers) * keg->uk_ppera; - if (keg->uk_maxpages * keg->uk_ipers < nitems) - keg->uk_maxpages += keg->uk_ppera; - nitems = (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers; - KEG_UNLOCK(keg); + /* + * If limit is very low we may need to limit how + * much items are allowed in CPU caches. + */ + ubz = &bucket_zones[0]; + for (; ubz->ubz_entries != 0; ubz++) + if (ubz->ubz_entries * 2 * mp_ncpus > nitems) + break; + if (ubz == &bucket_zones[0]) + nitems = ubz->ubz_entries * 2 * mp_ncpus; + else + ubz--; + ZONE_LOCK(zone); + zone->uz_count_max = zone->uz_count = ubz->ubz_entries; + if (zone->uz_count_min > zone->uz_count_max) + zone->uz_count_min = zone->uz_count_max; + zone->uz_max_items = nitems; + ZONE_UNLOCK(zone); + return (nitems); } /* See uma.h */ int +uma_zone_set_maxcache(uma_zone_t zone, int nitems) +{ + + ZONE_LOCK(zone); + zone->uz_bkt_max = nitems; + ZONE_UNLOCK(zone); + + return (nitems); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 15 00:33:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AE2148C389; Tue, 15 Jan 2019 00:33:56 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-it1-x12d.google.com (mail-it1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FA4C84CE3; Tue, 15 Jan 2019 00:33:55 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-it1-x12d.google.com with SMTP id z7so2576026iti.0; Mon, 14 Jan 2019 16:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kAsVfFsQGiloG+4s0Ooa/JA/N+AE/1J3AUEEvkwD4yw=; b=WtpFYL3A5emlPHYNKAeG+R3Uvcl60VtdHI8JlF3duNo/RaPvhYeHDw0OOuRHAb64xR sSQhmKqJMA52+mzAK89zofvTBz57EvL//VUKwMq4sxAc52DvFuQRQYKCsPQi2+vMWlU5 nE8pL6s3zTuU8M89SAOc5RUkEe+w7g/k29ogjLjPP9QrBur/T66l5DgCY7wtgaF85YNT U1SSe6mLrm1CWqB+zKe7oV98bnCVPWBbaCpt7GZ594Rzm0IYL1Na7ANSFolrOur5Jd9k 5kdX8+9XWtmKVYOm7f+YbQcQ1rKruPEe0tQGmSas0tp2Jy412sg+ZBoIe++Vy/8D+QiH Wcpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kAsVfFsQGiloG+4s0Ooa/JA/N+AE/1J3AUEEvkwD4yw=; b=m3PpCUbBQHnYX6AthtvMXqahYP27skPLcHfYcp//4/KHrjmPq8eZIeNKNg0bE6nSm6 hTpxI3dbexUmKZrHT5UKNHdNGrw4YwaBX63L8N/2zGVe3wqMSL7JB77pr8ZDJFu8xGWD HGNPkwKNsg+p/Y1kWw1kn/3O+F5e+00C3kUycJ1JEXgAceUtQwY2Fqj1WGsgLwUYQ79O hV7udedv2uerKzumbo+/rmiqWcqItgk4iAD1ng8ONueD4xvnWdKVxLRiqI6mrkQknv9V lNX6fBnt9oQXGsPoq7yQtuj0jsP6B6VkPfyGzAyLEPoUP+slOssiwU40+2GgMDBrl6FQ cy+Q== X-Gm-Message-State: AJcUukd7Z3VSGSX7TZGYS7wpKHv9rpj+TBBtWa5SRWmYN0dKLwd42J9L Ny3Qq2gAksb/au2na16P/VGrZrdWPyaMqPTjdpeg X-Google-Smtp-Source: ALg8bN6a/vNbcyJHHwl0l2vDU7fOnR2ujcv47UddBWswHH9XgNGRNymPl2z3Zz5eGz2J5lboNgEQSOxLIsU55bF+3dU= X-Received: by 2002:a02:84e1:: with SMTP id f88mr715327jai.107.1547512434568; Mon, 14 Jan 2019 16:33:54 -0800 (PST) MIME-Version: 1.0 References: <201901132033.x0DKXtin020499@repo.freebsd.org> <20190114232351.GS18452@FreeBSD.org> In-Reply-To: <20190114232351.GS18452@FreeBSD.org> From: Jason Harmening Date: Mon, 14 Jan 2019 16:33:43 -0800 Message-ID: Subject: Re: svn commit: r343005 - head/sys/kern To: Gleb Smirnoff Cc: "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8FA4C84CE3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 00:33:56 -0000 No problem! It was fun to dig into a part of the kernel I hadn't worked on before. On Mon, Jan 14, 2019 at 3:24 PM Gleb Smirnoff wrote: > Jason, > > thanks a lot for fixing this. > > On Sun, Jan 13, 2019 at 08:33:55PM +0000, Jason A. Harmening wrote: > J> Author: jah > J> Date: Sun Jan 13 20:33:54 2019 > J> New Revision: 343005 > J> URL: https://svnweb.freebsd.org/changeset/base/343005 > J> > J> Log: > J> Handle SIGIO for listening sockets > J> > J> r319722 separated struct socket and parts of the socket I/O path into > J> listening-socket-specific and dataflow-socket-specific pieces. > Listening > J> socket connection notifications are now handled by solisten_wakeup() > instead > J> of sowakeup(), but solisten_wakeup() does not currently post SIGIO to > the > J> owning process. > J> > J> PR: 234258 > J> Reported by: Kenneth Adelman > J> MFC after: 1 week > J> Differential Revision: https://reviews.freebsd.org/D18664 > J> > J> Modified: > J> head/sys/kern/uipc_socket.c > J> > J> Modified: head/sys/kern/uipc_socket.c > J> > ============================================================================== > J> --- head/sys/kern/uipc_socket.c Sun Jan 13 19:49:46 2019 > (r343004) > J> +++ head/sys/kern/uipc_socket.c Sun Jan 13 20:33:54 2019 > (r343005) > J> @@ -886,6 +886,8 @@ solisten_wakeup(struct socket *sol) > J> } > J> SOLISTEN_UNLOCK(sol); > J> wakeup_one(&sol->sol_comp); > J> + if ((sol->so_state & SS_ASYNC) && sol->so_sigio != NULL) > J> + pgsigio(&sol->so_sigio, SIGIO, 0); > J> } > J> > J> /* > J> > > -- > Gleb Smirnoff > From owner-svn-src-head@freebsd.org Tue Jan 15 00:35:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04F43148C482; Tue, 15 Jan 2019 00:35:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AEDD84E71; Tue, 15 Jan 2019 00:35:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C513A9EB; Tue, 15 Jan 2019 00:35:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F0ZKkD009895; Tue, 15 Jan 2019 00:35:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F0ZK6d009893; Tue, 15 Jan 2019 00:35:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901150035.x0F0ZK6d009893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 00:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343027 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 343027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AEDD84E71 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 00:35:21 -0000 Author: glebius Date: Tue Jan 15 00:35:19 2019 New Revision: 343027 URL: https://svnweb.freebsd.org/changeset/base/343027 Log: Add flag LK_NEW for lockinit() that is converted to LO_NEW and passed down to lock_init(). This allows for lockinit() on a not prezeroed memory. Modified: head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Jan 15 00:02:06 2019 (r343026) +++ head/sys/kern/kern_lock.c Tue Jan 15 00:35:19 2019 (r343027) @@ -450,6 +450,8 @@ lockinit(struct lock *lk, int pri, const char *wmesg, iflags |= LO_QUIET; if (flags & LK_IS_VNODE) iflags |= LO_IS_VNODE; + if (flags & LK_NEW) + iflags |= LO_NEW; iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE); lock_init(&lk->lock_object, &lock_class_lockmgr, wmesg, NULL, iflags); Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Tue Jan 15 00:02:06 2019 (r343026) +++ head/sys/sys/lockmgr.h Tue Jan 15 00:35:19 2019 (r343027) @@ -143,7 +143,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct /* * Flags for lockinit(). */ -#define LK_INIT_MASK 0x0000FF +#define LK_INIT_MASK 0x0001FF #define LK_CANRECURSE 0x000001 #define LK_NODUP 0x000002 #define LK_NOPROFILE 0x000004 @@ -152,6 +152,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct #define LK_QUIET 0x000020 #define LK_ADAPTIVE 0x000040 #define LK_IS_VNODE 0x000080 /* Tell WITNESS about a VNODE lock */ +#define LK_NEW 0x000100 /* * Additional attributes to be used in lockmgr(). From owner-svn-src-head@freebsd.org Tue Jan 15 00:37:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECBBC148C536; Tue, 15 Jan 2019 00:37:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9181E84FF5; Tue, 15 Jan 2019 00:37:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C3E8A9ED; Tue, 15 Jan 2019 00:37:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F0bbuT010027; Tue, 15 Jan 2019 00:37:37 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F0bbxJ010026; Tue, 15 Jan 2019 00:37:37 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901150037.x0F0bbxJ010026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 15 Jan 2019 00:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343028 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 343028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9181E84FF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 00:37:38 -0000 Author: gonzo Date: Tue Jan 15 00:37:37 2019 New Revision: 343028 URL: https://svnweb.freebsd.org/changeset/base/343028 Log: [mv_pci] Increase default PCI space size for mv_pci mv_pci driver reads PCI memory window layout from DTB data and if the data is incomplete falls back to default value. The value is too small to fit two PCI spaces for mwlwifi devices on WRT3200ACM so the resource allocation for them fails. Increase the default to 4Mb from 1Mb so the devices can be properly attached. MFC after: 1 week Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Jan 15 00:35:19 2019 (r343027) +++ head/sys/arm/mv/mv_pci.c Tue Jan 15 00:37:37 2019 (r343028) @@ -100,7 +100,7 @@ struct mv_pci_range { }; #define FDT_RANGES_CELLS ((3 + 3 + 2) * 2) -#define PCI_SPACE_LEN 0x00100000 +#define PCI_SPACE_LEN 0x00400000 static void mv_pci_range_dump(struct mv_pci_range *range) From owner-svn-src-head@freebsd.org Tue Jan 15 00:52:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D92F148CA06; Tue, 15 Jan 2019 00:52:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01D318598C; Tue, 15 Jan 2019 00:52:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA6AAD4F; Tue, 15 Jan 2019 00:52:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F0qf7j020568; Tue, 15 Jan 2019 00:52:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F0qfLk020567; Tue, 15 Jan 2019 00:52:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901150052.x0F0qfLk020567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 15 Jan 2019 00:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343029 - head/sys/dev/led X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/led X-SVN-Commit-Revision: 343029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01D318598C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 00:52:42 -0000 Author: gonzo Date: Tue Jan 15 00:52:41 2019 New Revision: 343029 URL: https://svnweb.freebsd.org/changeset/base/343029 Log: [led] propagate error from set_led() to the caller Do not lose error condition by always returning 0 from set_led. None of the calls to set_led checks for return value at the moment so none of API consumers in base is affected. PR: 231567 Submitted by: Bertrand Petit MFC after: 1 week Modified: head/sys/dev/led/led.c Modified: head/sys/dev/led/led.c ============================================================================== --- head/sys/dev/led/led.c Tue Jan 15 00:37:37 2019 (r343028) +++ head/sys/dev/led/led.c Tue Jan 15 00:52:41 2019 (r343029) @@ -261,7 +261,7 @@ led_set(char const *name, char const *cmd) mtx_unlock(&led_mtx); if (sb != NULL) sbuf_delete(sb); - return (0); + return (error); } static struct cdevsw led_cdevsw = { From owner-svn-src-head@freebsd.org Tue Jan 15 01:02:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53B28148D052; Tue, 15 Jan 2019 01:02:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 007F3865C9; Tue, 15 Jan 2019 01:02:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5AAEAEEE; Tue, 15 Jan 2019 01:02:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F12KOh026660; Tue, 15 Jan 2019 01:02:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F12Hlt025856; Tue, 15 Jan 2019 01:02:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901150102.x0F12Hlt025856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 01:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm X-SVN-Commit-Revision: 343030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 007F3865C9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 01:02:21 -0000 Author: glebius Date: Tue Jan 15 01:02:16 2019 New Revision: 343030 URL: https://svnweb.freebsd.org/changeset/base/343030 Log: Allocate pager bufs from UMA instead of 80-ish mutex protected linked list. o In vm_pager_bufferinit() create pbuf_zone and start accounting on how many pbufs are we going to have set. In various subsystems that are going to utilize pbufs create private zones via call to pbuf_zsecond_create(). The latter calls uma_zsecond_create(), and sets a limit on created zone. After startup preallocate pbufs according to requirements of all pbuf zones. Subsystems that used to have a private limit with old allocator now have private pbuf zones: md(4), fusefs, NFS client, smbfs, VFS cluster, FFS, swap, vnode pager. The following subsystems use shared pbuf zone: cam(4), nvme(4), physio(9), aio(4). They should have their private limits, but changing that is out of scope of this commit. o Fetch tunable value of kern.nswbuf from init_param2() and while here move NSWBUF_MIN to opt_param.h and eliminate opt_swap.h, that was holding only this option. Default values aren't touched by this commit, but they probably should be reviewed wrt to modern hardware. This change removes a tight bottleneck from sendfile(2) operation, that uses pbufs in vnode pager. Other pagers also would benefit from faster allocation. Together with: gallatin Tested by: pho Modified: head/sys/cam/cam_periph.c head/sys/conf/options head/sys/dev/md/md.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/fs/fuse/fuse_main.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_vfsops.c head/sys/kern/kern_physio.c head/sys/kern/subr_param.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_rawread.c head/sys/vm/swap_pager.c head/sys/vm/vm_pager.c head/sys/vm/vnode_pager.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/cam/cam_periph.c Tue Jan 15 01:02:16 2019 (r343030) @@ -936,7 +936,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma /* * Get the buffer. */ - mapinfo->bp[i] = getpbuf(NULL); + mapinfo->bp[i] = uma_zalloc(pbuf_zone, M_WAITOK); /* put our pointer in the data slot */ mapinfo->bp[i]->b_data = *data_ptrs[i]; @@ -962,9 +962,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma for (j = 0; j < i; ++j) { *data_ptrs[j] = mapinfo->bp[j]->b_caller1; vunmapbuf(mapinfo->bp[j]); - relpbuf(mapinfo->bp[j], NULL); + uma_zfree(pbuf_zone, mapinfo->bp[j]); } - relpbuf(mapinfo->bp[i], NULL); + uma_zfree(pbuf_zone, mapinfo->bp[i]); PRELE(curproc); return(EACCES); } @@ -1052,7 +1052,7 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ vunmapbuf(mapinfo->bp[i]); /* release the buffer */ - relpbuf(mapinfo->bp[i], NULL); + uma_zfree(pbuf_zone, mapinfo->bp[i]); } /* allow ourselves to be swapped once again */ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/conf/options Tue Jan 15 01:02:16 2019 (r343030) @@ -187,7 +187,7 @@ NO_ADAPTIVE_SX NO_EVENTTIMERS opt_timer.h NO_OBSOLETE_CODE opt_global.h NO_SYSCTL_DESCR opt_global.h -NSWBUF_MIN opt_swap.h +NSWBUF_MIN opt_param.h MBUF_PACKET_ZONE_DISABLE opt_global.h PANIC_REBOOT_WAIT_TIME opt_panic.h PCI_HP opt_pci.h Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/dev/md/md.c Tue Jan 15 01:02:16 2019 (r343030) @@ -231,7 +231,7 @@ static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INI #define NMASK (NINDIR-1) static int nshift; -static int md_vnode_pbuf_freecnt; +static uma_zone_t md_pbuf_zone; struct indir { uintptr_t *array; @@ -962,7 +962,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) auio.uio_iovcnt = piov - auio.uio_iov; piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { - pb = getpbuf(&md_vnode_pbuf_freecnt); + pb = uma_zalloc(md_pbuf_zone, M_WAITOK); bp->bio_resid = len; unmapped_step: npages = atop(min(MAXPHYS, round_page(len + (ma_offs & @@ -1013,7 +1013,7 @@ unmapped_step: if (len > 0) goto unmapped_step; } - relpbuf(pb, &md_vnode_pbuf_freecnt); + uma_zfree(md_pbuf_zone, pb); } free(piov, M_MD); @@ -2118,7 +2118,7 @@ g_md_init(struct g_class *mp __unused) sx_xunlock(&md_sx); } } - md_vnode_pbuf_freecnt = nswbuf / 10; + md_pbuf_zone = pbuf_zsecond_create("mdpbuf", nswbuf / 10); status_dev = make_dev(&mdctl_cdevsw, INT_MAX, UID_ROOT, GID_WHEEL, 0600, MDCTL_NAME); g_topology_lock(); @@ -2214,5 +2214,6 @@ g_md_fini(struct g_class *mp __unused) sx_destroy(&md_sx); if (status_dev != NULL) destroy_dev(status_dev); + uma_zdestroy(md_pbuf_zone); delete_unrhdr(md_uh); } Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 15 01:02:16 2019 (r343030) @@ -1052,7 +1052,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr * this passthrough command. */ PHOLD(curproc); - buf = getpbuf(NULL); + buf = uma_zalloc(pbuf_zone, M_WAITOK); buf->b_data = pt->buf; buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; @@ -1101,7 +1101,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr err: if (buf != NULL) { - relpbuf(buf, NULL); + uma_zfree(pbuf_zone, buf); PRELE(curproc); } Modified: head/sys/fs/fuse/fuse_main.c ============================================================================== --- head/sys/fs/fuse/fuse_main.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/fuse/fuse_main.c Tue Jan 15 01:02:16 2019 (r343030) @@ -84,7 +84,7 @@ struct mtx fuse_mtx; extern struct vfsops fuse_vfsops; extern struct cdevsw fuse_cdevsw; extern struct vop_vector fuse_vnops; -extern int fuse_pbuf_freecnt; +extern uma_zone_t fuse_pbuf_zone; static struct vfsconf fuse_vfsconf = { .vfc_version = VFS_VERSION, @@ -122,7 +122,6 @@ fuse_loader(struct module *m, int what, void *arg) switch (what) { case MOD_LOAD: /* kldload */ - fuse_pbuf_freecnt = nswbuf / 2 + 1; mtx_init(&fuse_mtx, "fuse_mtx", NULL, MTX_DEF); err = fuse_device_init(); if (err) { @@ -130,6 +129,7 @@ fuse_loader(struct module *m, int what, void *arg) return (err); } fuse_ipc_init(); + fuse_pbuf_zone = pbuf_zsecond_create("fusepbuf", nswbuf / 2); /* vfs_modevent ignores its first arg */ if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) @@ -144,6 +144,7 @@ fuse_loader(struct module *m, int what, void *arg) if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) return (err); fuse_bringdown(eh_tag); + uma_zdestroy(fuse_pbuf_zone); break; default: return (EINVAL); Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/fuse/fuse_vnops.c Tue Jan 15 01:02:16 2019 (r343030) @@ -201,7 +201,7 @@ static int fuse_reclaim_revoked = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, reclaim_revoked, CTLFLAG_RW, &fuse_reclaim_revoked, 0, ""); -int fuse_pbuf_freecnt = -1; +uma_zone_t fuse_pbuf_zone; #define fuse_vm_page_lock(m) vm_page_lock((m)); #define fuse_vm_page_unlock(m) vm_page_unlock((m)); @@ -1824,7 +1824,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap) * We use only the kva address for the buffer, but this is extremely * convenient and fast. */ - bp = getpbuf(&fuse_pbuf_freecnt); + bp = uma_zalloc(fuse_pbuf_zone, M_WAITOK); kva = (vm_offset_t)bp->b_data; pmap_qenter(kva, pages, npages); @@ -1845,7 +1845,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap) error = fuse_io_dispatch(vp, &uio, IO_DIRECT, cred); pmap_qremove(kva, npages); - relpbuf(bp, &fuse_pbuf_freecnt); + uma_zfree(fuse_pbuf_zone, bp); if (error && (uio.uio_resid == count)) { FS_DEBUG("error %d\n", error); @@ -1958,7 +1958,7 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) * We use only the kva address for the buffer, but this is extremely * convenient and fast. */ - bp = getpbuf(&fuse_pbuf_freecnt); + bp = uma_zalloc(fuse_pbuf_zone, M_WAITOK); kva = (vm_offset_t)bp->b_data; pmap_qenter(kva, pages, npages); @@ -1978,7 +1978,7 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) error = fuse_io_dispatch(vp, &uio, IO_DIRECT, cred); pmap_qremove(kva, npages); - relpbuf(bp, &fuse_pbuf_freecnt); + uma_zfree(fuse_pbuf_zone, bp); if (!error) { int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE; Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/nfsclient/nfs_clbio.c Tue Jan 15 01:02:16 2019 (r343030) @@ -70,7 +70,7 @@ extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMO extern int newnfs_directio_enable; extern int nfs_keep_dirty_on_error; -int ncl_pbuf_freecnt = -1; /* start out unlimited */ +uma_zone_t ncl_pbuf_zone; static struct buf *nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td); @@ -182,7 +182,7 @@ ncl_getpages(struct vop_getpages_args *ap) * We use only the kva address for the buffer, but this is extremely * convenient and fast. */ - bp = getpbuf(&ncl_pbuf_freecnt); + bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); @@ -203,7 +203,7 @@ ncl_getpages(struct vop_getpages_args *ap) error = ncl_readrpc(vp, &uio, cred); pmap_qremove(kva, npages); - relpbuf(bp, &ncl_pbuf_freecnt); + uma_zfree(ncl_pbuf_zone, bp); if (error && (uio.uio_resid == count)) { printf("ncl_getpages: error %d\n", error); @@ -793,7 +793,7 @@ do_sync: while (uiop->uio_resid > 0) { size = MIN(uiop->uio_resid, wsize); size = MIN(uiop->uio_iov->iov_len, size); - bp = getpbuf(&ncl_pbuf_freecnt); + bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); t_iov->iov_base = malloc(size, M_NFSDIRECTIO, M_WAITOK); @@ -836,7 +836,7 @@ err_free: free(t_iov, M_NFSDIRECTIO); free(t_uio, M_NFSDIRECTIO); bp->b_vp = NULL; - relpbuf(bp, &ncl_pbuf_freecnt); + uma_zfree(ncl_pbuf_zone, bp); if (error == EINTR) return (error); goto do_sync; @@ -1571,7 +1571,7 @@ ncl_doio_directwrite(struct buf *bp) mtx_unlock(&np->n_mtx); } bp->b_vp = NULL; - relpbuf(bp, &ncl_pbuf_freecnt); + uma_zfree(ncl_pbuf_zone, bp); } /* Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/nfsclient/nfs_clport.c Tue Jan 15 01:02:16 2019 (r343030) @@ -79,7 +79,7 @@ extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; extern uma_zone_t newnfsnode_zone; extern struct buf_ops buf_ops_newnfs; -extern int ncl_pbuf_freecnt; +extern uma_zone_t ncl_pbuf_zone; extern short nfsv4_cbport; extern int nfscl_enablecallb; extern int nfs_numnfscbd; @@ -1023,7 +1023,7 @@ nfscl_init(void) return; inited = 1; nfscl_inited = 1; - ncl_pbuf_freecnt = nswbuf / 2 + 1; + ncl_pbuf_zone = pbuf_zsecond_create("nfspbuf", nswbuf / 2); } /* @@ -1357,6 +1357,7 @@ nfscl_modevent(module_t mod, int type, void *data) #if 0 ncl_call_invalcaches = NULL; nfsd_call_nfscl = NULL; + uma_zdestroy(ncl_pbuf_zone); /* and get rid of the mutexes */ mtx_destroy(&ncl_iod_mutex); loaded = 0; Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/smbfs/smbfs_io.c Tue Jan 15 01:02:16 2019 (r343030) @@ -63,7 +63,7 @@ /*#define SMBFS_RWGENERIC*/ -extern int smbfs_pbuf_freecnt; +extern uma_zone_t smbfs_pbuf_zone; static int smbfs_fastlookup = 1; @@ -468,7 +468,7 @@ smbfs_getpages(ap) scred = smbfs_malloc_scred(); smb_makescred(scred, td, cred); - bp = getpbuf(&smbfs_pbuf_freecnt); + bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); @@ -490,7 +490,7 @@ smbfs_getpages(ap) smbfs_free_scred(scred); pmap_qremove(kva, npages); - relpbuf(bp, &smbfs_pbuf_freecnt); + uma_zfree(smbfs_pbuf_zone, bp); if (error && (uio.uio_resid == count)) { printf("smbfs_getpages: error %d\n",error); @@ -593,7 +593,7 @@ smbfs_putpages(ap) rtvals[i] = VM_PAGER_ERROR; } - bp = getpbuf(&smbfs_pbuf_freecnt); + bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); @@ -621,7 +621,7 @@ smbfs_putpages(ap) pmap_qremove(kva, npages); - relpbuf(bp, &smbfs_pbuf_freecnt); + uma_zfree(smbfs_pbuf_zone, bp); if (error == 0) { vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 15 01:02:16 2019 (r343030) @@ -88,7 +88,7 @@ MODULE_DEPEND(smbfs, netsmb, NSMB_VERSION, NSMB_VERSIO MODULE_DEPEND(smbfs, libiconv, 1, 1, 2); MODULE_DEPEND(smbfs, libmchain, 1, 1, 1); -int smbfs_pbuf_freecnt = -1; /* start out unlimited */ +uma_zone_t smbfs_pbuf_zone; static int smbfs_cmount(struct mntarg *ma, void * data, uint64_t flags) @@ -367,7 +367,8 @@ smbfs_quotactl(mp, cmd, uid, arg) int smbfs_init(struct vfsconf *vfsp) { - smbfs_pbuf_freecnt = nswbuf / 2 + 1; + + smbfs_pbuf_zone = pbuf_zsecond_create("smbpbuf", nswbuf / 2); SMBVDEBUG("done.\n"); return 0; } @@ -377,6 +378,7 @@ int smbfs_uninit(struct vfsconf *vfsp) { + uma_zdestroy(smbfs_pbuf_zone); SMBVDEBUG("done.\n"); return 0; } Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/kern/kern_physio.c Tue Jan 15 01:02:16 2019 (r343030) @@ -104,7 +104,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) maxpages = btoc(MIN(uio->uio_resid, MAXPHYS)) + 1; pages = malloc(sizeof(*pages) * maxpages, M_DEVBUF, M_WAITOK); } else { - pbuf = getpbuf(NULL); + pbuf = uma_zalloc(pbuf_zone, M_WAITOK); sa = pbuf->b_data; maxpages = btoc(MAXPHYS); pages = pbuf->b_pages; @@ -220,7 +220,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) } doerror: if (pbuf) - relpbuf(pbuf, NULL); + uma_zfree(pbuf_zone, pbuf); else if (pages) free(pages, M_DEVBUF); g_destroy_bio(bp); Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/kern/subr_param.c Tue Jan 15 01:02:16 2019 (r343030) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -285,6 +286,15 @@ init_param2(long physpages) nbuf = NBUF; TUNABLE_INT_FETCH("kern.nbuf", &nbuf); TUNABLE_INT_FETCH("kern.bio_transient_maxcnt", &bio_transient_maxcnt); + + /* + * Physical buffers are pre-allocated buffers (struct buf) that + * are used as temporary holders for I/O, such as paging I/O. + */ + nswbuf = min(nbuf / 4, 256); + TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); + if (nswbuf < NSWBUF_MIN) + nswbuf = NSWBUF_MIN; /* * The default for maxpipekva is min(1/64 of the kernel address space, Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/kern/vfs_aio.c Tue Jan 15 01:02:16 2019 (r343030) @@ -1267,7 +1267,7 @@ aio_qbio(struct proc *p, struct kaiocb *job) goto unref; } - job->pbuf = pbuf = (struct buf *)getpbuf(NULL); + job->pbuf = pbuf = uma_zalloc(pbuf_zone, M_WAITOK); BUF_KERNPROC(pbuf); AIO_LOCK(ki); ki->kaio_buffer_count++; @@ -1318,7 +1318,7 @@ doerror: AIO_LOCK(ki); ki->kaio_buffer_count--; AIO_UNLOCK(ki); - relpbuf(pbuf, NULL); + uma_zfree(pbuf_zone, pbuf); job->pbuf = NULL; } g_destroy_bio(bp); @@ -2344,7 +2344,7 @@ aio_biowakeup(struct bio *bp) ki = userp->p_aioinfo; if (job->pbuf) { pmap_qremove((vm_offset_t)job->pbuf->b_data, job->npages); - relpbuf(job->pbuf, NULL); + uma_zfree(pbuf_zone, job->pbuf); job->pbuf = NULL; atomic_subtract_int(&num_buf_aio, 1); AIO_LOCK(ki); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/kern/vfs_bio.c Tue Jan 15 01:02:16 2019 (r343030) @@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "opt_swap.h" static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer"); @@ -1017,10 +1016,6 @@ bd_speedup(void) mtx_unlock(&bdlock); } -#ifndef NSWBUF_MIN -#define NSWBUF_MIN 16 -#endif - #ifdef __i386__ #define TRANSIENT_DENOM 5 #else @@ -1130,19 +1125,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) } /* - * swbufs are used as temporary holders for I/O, such as paging I/O. - * We have no less then 16 and no more then 256. - */ - nswbuf = min(nbuf / 4, 256); - TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); - if (nswbuf < NSWBUF_MIN) - nswbuf = NSWBUF_MIN; - - /* * Reserve space for the buffer cache buffers */ - swbuf = (void *)v; - v = (caddr_t)(swbuf + nswbuf); buf = (void *)v; v = (caddr_t)(buf + nbuf); Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/kern/vfs_cluster.c Tue Jan 15 01:02:16 2019 (r343030) @@ -63,7 +63,9 @@ SYSCTL_INT(_debug, OID_AUTO, rcluster, CTLFLAG_RW, &rc #endif static MALLOC_DEFINE(M_SEGMENT, "cl_savebuf", "cluster_save buffer"); +static uma_zone_t cluster_pbuf_zone; +static void cluster_init(void *); static struct cluster_save *cluster_collectbufs(struct vnode *vp, struct buf *last_bp, int gbflags); static struct buf *cluster_rbuild(struct vnode *vp, u_quad_t filesize, @@ -83,6 +85,15 @@ static int read_min = 1; SYSCTL_INT(_vfs, OID_AUTO, read_min, CTLFLAG_RW, &read_min, 0, "Cluster read min block count"); +SYSINIT(cluster, SI_SUB_CPU, SI_ORDER_ANY, cluster_init, NULL); + +static void +cluster_init(void *dummy) +{ + + cluster_pbuf_zone = pbuf_zsecond_create("clpbuf", nswbuf / 2); +} + /* * Read data to a buf, including read-ahead if we find this to be beneficial. * cluster_read replaces bread. @@ -372,7 +383,7 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, da ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) return tbp; - bp = trypbuf(&cluster_pbuf_freecnt); + bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT); if (bp == NULL) return tbp; @@ -603,7 +614,7 @@ cluster_callback(struct buf *bp) bufdone(tbp); } pbrelvp(bp); - relpbuf(bp, &cluster_pbuf_freecnt); + uma_zfree(cluster_pbuf_zone, bp); } /* @@ -856,9 +867,8 @@ cluster_wbuild(struct vnode *vp, long size, daddr_t st (tbp->b_bcount != tbp->b_bufsize) || (tbp->b_bcount != size) || (len == 1) || - ((bp = (vp->v_vflag & VV_MD) != 0 ? - trypbuf(&cluster_pbuf_freecnt) : - getpbuf(&cluster_pbuf_freecnt)) == NULL)) { + ((bp = uma_zalloc(cluster_pbuf_zone, + (vp->v_vflag & VV_MD) != 0 ? M_NOWAIT : M_WAITOK)) == NULL)) { totalwritten += tbp->b_bufsize; bawrite(tbp); ++start_lbn; Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/sys/buf.h Tue Jan 15 01:02:16 2019 (r343030) @@ -44,6 +44,7 @@ #include #include #include +#include struct bio; struct buf; @@ -275,6 +276,11 @@ struct buf { #define PRINT_BUF_VFLAGS "\20\4bkgrderr\3bkgrdwait\2bkgrdinprog\1scanned" #ifdef _KERNEL + +#ifndef NSWBUF_MIN +#define NSWBUF_MIN 16 +#endif + /* * Buffer locking */ @@ -287,7 +293,7 @@ extern const char *buf_wmesg; /* Default buffer lock * Initialize a lock. */ #define BUF_LOCKINIT(bp) \ - lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, 0) + lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, LK_NEW) /* * * Get a lock sleeping non-interruptably until it becomes available. @@ -493,10 +499,6 @@ extern int bdwriteskip; extern int dirtybufferflushes; extern int altbufferflushes; extern int nswbuf; /* Number of swap I/O buffer headers. */ -extern int cluster_pbuf_freecnt; /* Number of pbufs for clusters */ -extern int vnode_pbuf_freecnt; /* Number of pbufs for vnode pager */ -extern int vnode_async_pbuf_freecnt; /* Number of pbufs for vnode pager, - asynchronous reads */ extern caddr_t unmapped_buf; /* Data address for unmapped buffers. */ static inline int @@ -537,7 +539,6 @@ void brelse(struct buf *); void bqrelse(struct buf *); int vfs_bio_awrite(struct buf *); void vfs_drain_busy_pages(struct buf *bp); -struct buf * getpbuf(int *); struct buf *incore(struct bufobj *, daddr_t); struct buf *gbincore(struct bufobj *, daddr_t); struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); @@ -549,6 +550,9 @@ int bufwrite(struct buf *); void bufdone(struct buf *); void bd_speedup(void); +extern uma_zone_t pbuf_zone; +uma_zone_t pbuf_zsecond_create(char *name, int max); + int cluster_read(struct vnode *, u_quad_t, daddr_t, long, struct ucred *, long, int, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int, int); @@ -562,7 +566,6 @@ void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *); int vmapbuf(struct buf *, int); void vunmapbuf(struct buf *); -void relpbuf(struct buf *, int *); void brelvp(struct buf *); void bgetvp(struct vnode *, struct buf *); void pbgetbo(struct bufobj *bo, struct buf *bp); @@ -571,7 +574,6 @@ void pbrelbo(struct buf *); void pbrelvp(struct buf *); int allocbuf(struct buf *bp, int size); void reassignbuf(struct buf *); -struct buf *trypbuf(int *); void bwait(struct buf *, u_char, const char *); void bdone(struct buf *); Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/ufs/ffs/ffs_rawread.c Tue Jan 15 01:02:16 2019 (r343030) @@ -74,9 +74,7 @@ int ffs_rawread(struct vnode *vp, struct uio *uio, int SYSCTL_DECL(_vfs_ffs); -static int ffsrawbufcnt = 4; -SYSCTL_INT(_vfs_ffs, OID_AUTO, ffsrawbufcnt, CTLFLAG_RD, &ffsrawbufcnt, 0, - "Buffers available for raw reads"); +static uma_zone_t ffsraw_pbuf_zone; static int allowrawread = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, allowrawread, CTLFLAG_RW, &allowrawread, 0, @@ -90,7 +88,8 @@ static void ffs_rawread_setup(void *arg __unused) { - ffsrawbufcnt = (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8; + ffsraw_pbuf_zone = pbuf_zsecond_create("ffsrawpbuf", + (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8); } SYSINIT(ffs_raw, SI_SUB_VM_CONF, SI_ORDER_ANY, ffs_rawread_setup, NULL); @@ -296,8 +295,7 @@ ffs_rawread_main(struct vnode *vp, while (resid > 0) { if (bp == NULL) { /* Setup first read */ - /* XXX: Leave some bufs for swap */ - bp = getpbuf(&ffsrawbufcnt); + bp = uma_zalloc(ffsraw_pbuf_zone, M_WAITOK); pbgetvp(vp, bp); error = ffs_rawread_readahead(vp, udata, offset, resid, td, bp); @@ -305,9 +303,9 @@ ffs_rawread_main(struct vnode *vp, break; if (resid > bp->b_bufsize) { /* Setup fist readahead */ - /* XXX: Leave bufs for swap */ if (rawreadahead != 0) - nbp = trypbuf(&ffsrawbufcnt); + nbp = uma_zalloc(ffsraw_pbuf_zone, + M_NOWAIT); else nbp = NULL; if (nbp != NULL) { @@ -324,7 +322,8 @@ ffs_rawread_main(struct vnode *vp, nbp); if (nerror) { pbrelvp(nbp); - relpbuf(nbp, &ffsrawbufcnt); + uma_zfree(ffsraw_pbuf_zone, + nbp); nbp = NULL; } } @@ -365,7 +364,7 @@ ffs_rawread_main(struct vnode *vp, if (resid <= bp->b_bufsize) { /* No more readaheads */ pbrelvp(nbp); - relpbuf(nbp, &ffsrawbufcnt); + uma_zfree(ffsraw_pbuf_zone, nbp); nbp = NULL; } else { /* Setup next readahead */ nerror = ffs_rawread_readahead(vp, @@ -379,7 +378,7 @@ ffs_rawread_main(struct vnode *vp, nbp); if (nerror != 0) { pbrelvp(nbp); - relpbuf(nbp, &ffsrawbufcnt); + uma_zfree(ffsraw_pbuf_zone, nbp); nbp = NULL; } } @@ -395,13 +394,13 @@ ffs_rawread_main(struct vnode *vp, if (bp != NULL) { pbrelvp(bp); - relpbuf(bp, &ffsrawbufcnt); + uma_zfree(ffsraw_pbuf_zone, bp); } if (nbp != NULL) { /* Run down readahead buffer */ bwait(nbp, PRIBIO, "rawrd"); vunmapbuf(nbp); pbrelvp(nbp); - relpbuf(nbp, &ffsrawbufcnt); + uma_zfree(ffsraw_pbuf_zone, nbp); } if (error == 0) Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/vm/swap_pager.c Tue Jan 15 01:02:16 2019 (r343030) @@ -71,7 +71,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_swap.h" #include "opt_vm.h" #include @@ -324,9 +323,8 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred * static int swap_pager_full = 2; /* swap space exhaustion (task killing) */ static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/ -static int nsw_rcount; /* free read buffers */ -static int nsw_wcount_sync; /* limit write buffers / synchronous */ -static int nsw_wcount_async; /* limit write buffers / asynchronous */ +static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ +static int nsw_wcount_async; /* limit async write buffers */ static int nsw_wcount_async_max;/* assigned maximum */ static int nsw_cluster_max; /* maximum VOP I/O allowed */ @@ -352,6 +350,8 @@ static struct sx sw_alloc_sx; (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) static struct pagerlst swap_pager_object_list[NOBJLISTS]; +static uma_zone_t swwbuf_zone; +static uma_zone_t swrbuf_zone; static uma_zone_t swblk_zone; static uma_zone_t swpctrie_zone; @@ -539,13 +539,13 @@ swap_pager_swap_init(void) */ nsw_cluster_max = min((MAXPHYS/PAGE_SIZE), MAX_PAGEOUT_CLUSTER); - mtx_lock(&pbuf_mtx); - nsw_rcount = (nswbuf + 1) / 2; - nsw_wcount_sync = (nswbuf + 3) / 4; nsw_wcount_async = 4; nsw_wcount_async_max = nsw_wcount_async; - mtx_unlock(&pbuf_mtx); + mtx_init(&swbuf_mtx, "async swbuf mutex", NULL, MTX_DEF); + swwbuf_zone = pbuf_zsecond_create("swwbuf", nswbuf / 4); + swrbuf_zone = pbuf_zsecond_create("swrbuf", nswbuf / 2); + /* * Initialize our zone, taking the user's requested size or * estimating the number we need based on the number of pages @@ -1205,7 +1205,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); VM_OBJECT_WUNLOCK(object); - bp = getpbuf(&nsw_rcount); + bp = uma_zalloc(swrbuf_zone, M_WAITOK); /* Pages cannot leave the object while busy. */ for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { MPASS(p->pindex == bm->pindex + i); @@ -1406,12 +1406,17 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, * All I/O parameters have been satisfied, build the I/O * request and assign the swap space. */ - if (sync == TRUE) { - bp = getpbuf(&nsw_wcount_sync); - } else { - bp = getpbuf(&nsw_wcount_async); - bp->b_flags = B_ASYNC; + if (sync != TRUE) { + mtx_lock(&swbuf_mtx); + while (nsw_wcount_async == 0) + msleep(&nsw_wcount_async, &swbuf_mtx, PVM, + "swbufa", 0); + nsw_wcount_async--; + mtx_unlock(&swbuf_mtx); } + bp = uma_zalloc(swwbuf_zone, M_WAITOK); + if (sync != TRUE) + bp->b_flags = B_ASYNC; bp->b_flags |= B_PAGING; bp->b_iocmd = BIO_WRITE; @@ -1634,15 +1639,13 @@ swp_pager_async_iodone(struct buf *bp) /* * release the physical I/O buffer */ - relpbuf( - bp, - ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : - ((bp->b_flags & B_ASYNC) ? - &nsw_wcount_async : - &nsw_wcount_sync - ) - ) - ); + if (bp->b_flags & B_ASYNC) { + mtx_lock(&swbuf_mtx); + if (++nsw_wcount_async == 1) + wakeup(&nsw_wcount_async); + mtx_unlock(&swbuf_mtx); + } + uma_zfree((bp->b_iocmd == BIO_READ) ? swrbuf_zone : swwbuf_zone, bp); } int @@ -2627,6 +2630,7 @@ swapgeom_done(struct bio *bp2) bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount - bp2->bio_completed; bp->b_error = bp2->bio_error; + bp->b_caller1 = NULL; bufdone(bp); sp = bp2->bio_caller1; mtx_lock(&sw_dev_mtx); @@ -2666,6 +2670,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) return; } + bp->b_caller1 = bio; bio->bio_caller1 = sp; bio->bio_caller2 = bp; bio->bio_cmd = bp->b_iocmd; @@ -2880,7 +2885,7 @@ sysctl_swap_async_max(SYSCTL_HANDLER_ARGS) if (new > nswbuf / 2 || new < 1) return (EINVAL); - mtx_lock(&pbuf_mtx); + mtx_lock(&swbuf_mtx); while (nsw_wcount_async_max != new) { /* * Adjust difference. If the current async count is too low, @@ -2895,11 +2900,11 @@ sysctl_swap_async_max(SYSCTL_HANDLER_ARGS) } else { nsw_wcount_async_max -= nsw_wcount_async; nsw_wcount_async = 0; - msleep(&nsw_wcount_async, &pbuf_mtx, PSWP, + msleep(&nsw_wcount_async, &swbuf_mtx, PSWP, "swpsysctl", 0); } } - mtx_unlock(&pbuf_mtx); + mtx_unlock(&swbuf_mtx); return (0); } Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Tue Jan 15 00:52:41 2019 (r343029) +++ head/sys/vm/vm_pager.c Tue Jan 15 01:02:16 2019 (r343030) @@ -68,6 +68,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_param.h" + #include #include #include @@ -85,11 +87,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ +uma_zone_t pbuf_zone; +static int pbuf_init(void *, int, int); +static int pbuf_ctor(void *, int, void *, int); +static void pbuf_dtor(void *, int, void *); -struct buf *swbuf; - static int dead_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static vm_object_t dead_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *); @@ -167,9 +171,6 @@ struct pagerops *pagertab[] = { * cleaning requests (NPENDINGIO == 64) * the maximum swap cluster size * (MAXPHYS == 64k) if you want to get the most efficiency. */ -struct mtx_padalign __exclusive_cache_line pbuf_mtx; -static TAILQ_HEAD(swqueue, buf) bswlist; -static int bswneeded; vm_offset_t swapbkva; /* swap buffers kva */ void @@ -177,7 +178,6 @@ vm_pager_init(void) { struct pagerops **pgops; - TAILQ_INIT(&bswlist); /* * Initialize known pagers */ @@ -186,30 +186,51 @@ vm_pager_init(void) (*(*pgops)->pgo_init)(); } +static int nswbuf_max; + void vm_pager_bufferinit(void) { - struct buf *bp; - int i; - mtx_init(&pbuf_mtx, "pbuf mutex", NULL, MTX_DEF); - bp = swbuf; + /* Main zone for paging bufs. */ + pbuf_zone = uma_zcreate("pbuf", sizeof(struct buf), + pbuf_ctor, pbuf_dtor, pbuf_init, NULL, UMA_ALIGN_CACHE, + UMA_ZONE_VM | UMA_ZONE_NOFREE); + /* Few systems may still use this zone directly, so it needs a limit. */ + nswbuf_max += uma_zone_set_max(pbuf_zone, NSWBUF_MIN); +} + +uma_zone_t +pbuf_zsecond_create(char *name, int max) +{ + uma_zone_t zone; + + zone = uma_zsecond_create(name, pbuf_ctor, pbuf_dtor, NULL, NULL, + pbuf_zone); /* - * Now set up swap and physical I/O buffer headers. + * uma_prealloc() rounds up to items per slab. If we would prealloc + * immediately on every pbuf_zsecond_create(), we may accumulate too + * much of difference between hard limit and prealloced items, which + * means wasted memory. */ - for (i = 0; i < nswbuf; i++, bp++) { - TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist); - BUF_LOCKINIT(bp); - LIST_INIT(&bp->b_dep); - bp->b_rcred = bp->b_wcred = NOCRED; - bp->b_xflags = 0; - } + if (nswbuf_max > 0) + nswbuf_max += uma_zone_set_max(zone, max); + else + uma_prealloc(pbuf_zone, uma_zone_set_max(zone, max)); - cluster_pbuf_freecnt = nswbuf / 2; - vnode_pbuf_freecnt = nswbuf / 2 + 1; - vnode_async_pbuf_freecnt = nswbuf / 2; + return (zone); } +static void +pbuf_prealloc(void *arg __unused) +{ + + uma_prealloc(pbuf_zone, nswbuf_max); + nswbuf_max = -1; +} + +SYSINIT(pbuf, SI_SUB_KTHREAD_BUF, SI_ORDER_ANY, pbuf_prealloc, NULL); + /* * Allocate an instance of a pager of the given type. * Size, protection and offset parameters are passed in for pagers that @@ -347,111 +368,34 @@ vm_pager_object_lookup(struct pagerlst *pg_list, void return (object); } -/* - * initialize a physical buffer - */ - -/* - * XXX This probably belongs in vfs_bio.c - */ -static void -initpbuf(struct buf *bp) +static int +pbuf_ctor(void *mem, int size, void *arg, int flags) { + struct buf *bp = mem; - KASSERT(bp->b_bufobj == NULL, ("initpbuf with bufobj")); - KASSERT(bp->b_vp == NULL, ("initpbuf with vp")); + bp->b_vp = NULL; + bp->b_bufobj = NULL; + + /* copied from initpbuf() */ bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; - bp->b_qindex = 0; /* On no queue (QUEUE_NONE) */ - bp->b_kvabase = (caddr_t)(MAXPHYS * (bp - swbuf)) + swapbkva; + bp->b_qindex = 0; /* On no queue (QUEUE_NONE) */ bp->b_data = bp->b_kvabase; - bp->b_kvasize = MAXPHYS; - bp->b_flags = 0; bp->b_xflags = 0; + bp->b_flags = 0; bp->b_ioflags = 0; bp->b_iodone = NULL; bp->b_error = 0; BUF_LOCK(bp, LK_EXCLUSIVE, NULL); - buf_track(bp, __func__); -} -/* - * allocate a physical buffer - * - * There are a limited number (nswbuf) of physical buffers. We need - * to make sure that no single subsystem is able to hog all of them, - * so each subsystem implements a counter which is typically initialized - * to 1/2 nswbuf. getpbuf() decrements this counter in allocation and - * increments it on release, and blocks if the counter hits zero. A - * subsystem may initialize the counter to -1 to disable the feature, - * but it must still be sure to match up all uses of getpbuf() with - * relpbuf() using the same variable. - * - * NOTE: pfreecnt can be NULL, but this 'feature' will be removed - * relatively soon when the rest of the subsystems get smart about it. XXX *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 15 01:19:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6C5148ECB5; Tue, 15 Jan 2019 01:19:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDE987BC5; Tue, 15 Jan 2019 01:19:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66E43B23B; Tue, 15 Jan 2019 01:19:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F1JUJB032369; Tue, 15 Jan 2019 01:19:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F1JUWD032367; Tue, 15 Jan 2019 01:19:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901150119.x0F1JUWD032367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 01:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343031 - in head: . share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: . share/man/man9 X-SVN-Commit-Revision: 343031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EDE987BC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 01:19:31 -0000 Author: glebius Date: Tue Jan 15 01:19:29 2019 New Revision: 343031 URL: https://svnweb.freebsd.org/changeset/base/343031 Log: Remove pbuf(9) manual page that is now nearly 100% outdated. Deleted: head/share/man/man9/pbuf.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jan 15 01:02:16 2019 (r343030) +++ head/ObsoleteFiles.inc Tue Jan 15 01:19:29 2019 (r343031) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190114: old pbuf allocator removed +OLD_FILES+=usr/share/man/man9/pbuf.9.gz # 20181219: ibcs removal OLD_FILES+=usr/share/examples/ibcs2/hello.uu OLD_FILES+=usr/share/examples/ibcs2/README Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jan 15 01:02:16 2019 (r343030) +++ head/share/man/man9/Makefile Tue Jan 15 01:19:29 2019 (r343031) @@ -225,7 +225,6 @@ MAN= accept_filter.9 \ owll.9 \ own.9 \ panic.9 \ - pbuf.9 \ PCBGROUP.9 \ p_candebug.9 \ p_cansee.9 \ @@ -1576,9 +1575,6 @@ MLINKS+=osd.9 osd_call.9 \ osd.9 osd_register.9 \ osd.9 osd_set.9 MLINKS+=panic.9 vpanic.9 -MLINKS+=pbuf.9 getpbuf.9 \ - pbuf.9 relpbuf.9 \ - pbuf.9 trypbuf.9 MLINKS+=PCBGROUP.9 in_pcbgroup_byhash.9 \ PCBGROUP.9 in_pcbgroup_byinpcb.9 \ PCBGROUP.9 in_pcbgroup_destroy.9 \ From owner-svn-src-head@freebsd.org Tue Jan 15 03:43:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B254149B720; Tue, 15 Jan 2019 03:43:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC1B66A28F; Tue, 15 Jan 2019 03:43:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CC03D253; Tue, 15 Jan 2019 03:43:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F3hkh4011544; Tue, 15 Jan 2019 03:43:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F3hksk011543; Tue, 15 Jan 2019 03:43:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901150343.x0F3hksk011543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 03:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343037 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC1B66A28F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 03:43:47 -0000 Author: glebius Date: Tue Jan 15 03:43:46 2019 New Revision: 343037 URL: https://svnweb.freebsd.org/changeset/base/343037 Log: Fix compilation on 32-bit. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 15 02:26:03 2019 (r343036) +++ head/sys/vm/uma_core.c Tue Jan 15 03:43:46 2019 (r343037) @@ -3758,8 +3758,8 @@ uma_print_zone(uma_zone_t zone) uma_cache_t cache; int i; - printf("zone: %s(%p) size %d maxitems %lu flags %#x\n", - zone->uz_name, zone, zone->uz_size, zone->uz_max_items, + printf("zone: %s(%p) size %d maxitems %ju flags %#x\n", + zone->uz_name, zone, zone->uz_size, (uintmax_t)zone->uz_max_items, zone->uz_flags); if (zone->uz_lockptr != &zone->uz_lock) uma_print_keg(zone->uz_keg); From owner-svn-src-head@freebsd.org Tue Jan 15 06:18:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD25B14A2242; Tue, 15 Jan 2019 06:18:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31E326FFD6; Tue, 15 Jan 2019 06:18:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f53.google.com with SMTP id a16so1135083lfg.3; Mon, 14 Jan 2019 22:18:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RnwXeOBuDmmhLoUIRHpbCZ/jO14T58/SQDcFcGO0sPE=; b=LEm1rI+7iVw3Tis6u3Mz1GbOhwZuvT3rBiJitJJXDfvfM22Ka3O2ys6ub2ifmfVTx0 xQeYmInaDwsuW+fdjJVE/+IPbImwKSBKhAkizL2Rl8M2Ry5mp/abmsWprFNy04ChFqc0 1yE40c+vfFN1s5zrivQhepTUmJsJG39OCCDoEXxvBUPUfFcgbKbC7Kavfc/v6G8x6sdm QmMCHKKfaRvknNz1UNPry85j0Uoam37z30OZqdRWijnHIqAZ5xBSruuzYJFg07ZEurJr TfVqJERv6Tan+4j9ewKeYwlSroOl80gkkyHiQBfY+o3vfNIbdcW0JeNaMPuHPnQmILmI tasA== X-Gm-Message-State: AJcUukdO4SH3BqmpAdlOBpM9LtlJldjSSfQj+UZozFBoXNAVTnA5Q/9V B5nz5wdY4eHl8Jg3vLYqsRL3L1S1 X-Google-Smtp-Source: ALg8bN7Gl7enZpN6uMMrWaOyY3/dtmYqhnXayM6ZoveQK7r8+VPxnYlttXXbIFvgoSzlscAlkyTXvQ== X-Received: by 2002:a19:3fcf:: with SMTP id m198mr1519886lfa.106.1547533091349; Mon, 14 Jan 2019 22:18:11 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id p186sm444834lfd.83.2019.01.14.22.18.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 22:18:10 -0800 (PST) Subject: Re: svn commit: r343026 - in head: lib/libmemstat sys/vm To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901150002.x0F026EW092943@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Tue, 15 Jan 2019 08:18:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201901150002.x0F026EW092943@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 31E326FFD6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.957,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 06:18:20 -0000 On 15/01/2019 02:02, Gleb Smirnoff wrote: > o Since new limits don't play well with multi-keg zones, remove them. The > idea of multi-keg zones was introduced exactly 10 years ago, and never > have had a practical usage. In discussion with Jeff we came to a wild > agreement that if we ever want to reintroduce the idea of a smart allocator > that would be able to choose between two (or more) totally different > backing stores, that choice should be made one level higher than UMA, > e.g. in malloc(9) or in mget(), or whatever and choice should be controlled > by the caller. I would make this a separate commit before the main change. But no troubles. Thank you for the change! -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Jan 15 06:44:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C7014A3206; Tue, 15 Jan 2019 06:44:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7894D70E4B; Tue, 15 Jan 2019 06:44:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB1BF2ED; Tue, 15 Jan 2019 06:44:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F6ico0005771; Tue, 15 Jan 2019 06:44:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F6icDs005770; Tue, 15 Jan 2019 06:44:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901150644.x0F6icDs005770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 15 Jan 2019 06:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343038 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7894D70E4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 06:44:39 -0000 Author: delphij Date: Tue Jan 15 06:44:37 2019 New Revision: 343038 URL: https://svnweb.freebsd.org/changeset/base/343038 Log: Use TD_IS_IDLETHREAD instead of unrolled version. MFC after: 2 weeks Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Tue Jan 15 03:43:46 2019 (r343037) +++ head/sys/kern/kern_ktr.c Tue Jan 15 06:44:37 2019 (r343038) @@ -341,7 +341,7 @@ ktr_tracepoint(uint64_t mask, const char *file, int li #ifdef KTR_ALQ if (ktr_alq_enabled) { if (td->td_critnest == 0 && - (td->td_flags & TDF_IDLETD) == 0 && + (TD_IS_IDLETHREAD(td)) == 0 && td != ald_thread) { if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) goto done; From owner-svn-src-head@freebsd.org Tue Jan 15 08:59:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F4B14A6BC7; Tue, 15 Jan 2019 08:59:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47757758B1; Tue, 15 Jan 2019 08:59:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 383EB1891B; Tue, 15 Jan 2019 08:59:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F8xqeZ074681; Tue, 15 Jan 2019 08:59:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F8xqqt074680; Tue, 15 Jan 2019 08:59:52 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901150859.x0F8xqqt074680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 15 Jan 2019 08:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343041 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47757758B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 08:59:52 -0000 Author: kp Date: Tue Jan 15 08:59:51 2019 New Revision: 343041 URL: https://svnweb.freebsd.org/changeset/base/343041 Log: pf: silence a runtime warning Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'. This warning does not clarify anything for users, so silence it, just as OpenBSD has. PR: 234874 MFC after: 1 week Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Tue Jan 15 06:52:34 2019 (r343040) +++ head/sys/netpfil/pf/pf_table.c Tue Jan 15 08:59:51 2019 (r343041) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x + #define ACCEPT_FLAGS(flags, oklist) \ do { \ if ((flags & ~(oklist)) & \ @@ -1992,7 +1994,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) - printf("pfr_update_stats: assertion failed.\n"); + DPFPRINTF(PF_DEBUG_URGENT, + ("pfr_update_stats: assertion failed.\n")); op_pass = PFR_OP_XPASS; } kt->pfrkt_packets[dir_out][op_pass]++; From owner-svn-src-head@freebsd.org Tue Jan 15 09:48:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D8C61482987; Tue, 15 Jan 2019 09:48:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6474772EA; Tue, 15 Jan 2019 09:48:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7A55191A4; Tue, 15 Jan 2019 09:48:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0F9mIqd001042; Tue, 15 Jan 2019 09:48:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0F9mIIS001041; Tue, 15 Jan 2019 09:48:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201901150948.x0F9mIIS001041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 15 Jan 2019 09:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343042 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 343042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6474772EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 09:48:19 -0000 Author: andrew Date: Tue Jan 15 09:48:18 2019 New Revision: 343042 URL: https://svnweb.freebsd.org/changeset/base/343042 Log: Ensure the I-Cache is correctly handled in arm64_icache_sync_range The cache_handle_range macro to handle the arm64 instruction and data cache operations would return when it was complete. This causes problems for arm64_icache_sync_range and arm64_icache_sync_range_checked as they assume they can execute the i-cache handling instruction after it has been called. Fix this by making this assumption correct. While here add missing instruction barriers and adjust the style to match the rest of the assembly. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18838 Modified: head/sys/arm64/arm64/cpufunc_asm.S Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Tue Jan 15 08:59:51 2019 (r343041) +++ head/sys/arm64/arm64/cpufunc_asm.S Tue Jan 15 09:48:18 2019 (r343042) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); .if \ic != 0 isb .endif - ret .endm ENTRY(arm64_nullop) @@ -112,6 +111,7 @@ END(arm64_tlb_flushID) */ ENTRY(arm64_dcache_wb_range) cache_handle_range dcop = cvac + ret END(arm64_dcache_wb_range) /* @@ -119,6 +119,7 @@ END(arm64_dcache_wb_range) */ ENTRY(arm64_dcache_wbinv_range) cache_handle_range dcop = civac + ret END(arm64_dcache_wbinv_range) /* @@ -129,6 +130,7 @@ END(arm64_dcache_wbinv_range) */ ENTRY(arm64_dcache_inv_range) cache_handle_range dcop = ivac + ret END(arm64_dcache_inv_range) /* @@ -136,6 +138,7 @@ END(arm64_dcache_inv_range) */ ENTRY(arm64_idcache_wbinv_range) cache_handle_range dcop = civac, ic = 1, icop = ivau + ret END(arm64_idcache_wbinv_range) /* @@ -150,6 +153,8 @@ ENTRY(arm64_icache_sync_range) cache_handle_range dcop = cvau ic ialluis dsb ish + isb + ret END(arm64_icache_sync_range) /* @@ -161,7 +166,8 @@ ENTRY(arm64_icache_sync_range_checked) /* XXX: See comment in arm64_icache_sync_range */ cache_handle_range dcop = cvau ic ialluis - dsb ish + dsb ish + isb SET_FAULT_HANDLER(xzr, x6) mov x0, #0 ret From owner-svn-src-head@freebsd.org Tue Jan 15 15:35:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 527EE148DFA7; Tue, 15 Jan 2019 15:35:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBCC68B9B9; Tue, 15 Jan 2019 15:35:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCE4B1CD16; Tue, 15 Jan 2019 15:35:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FFZEiF018788; Tue, 15 Jan 2019 15:35:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FFZE94018787; Tue, 15 Jan 2019 15:35:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901151535.x0FFZE94018787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Jan 2019 15:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343043 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 343043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBCC68B9B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 15:35:15 -0000 Author: emaste Date: Tue Jan 15 15:35:14 2019 New Revision: 343043 URL: https://svnweb.freebsd.org/changeset/base/343043 Log: scp: disallow empty or current directory Obtained from: OpenBSD scp.c 1.198 Security: CVE-2018-20685 Sponsored by: The FreeBSD Foundation Modified: head/crypto/openssh/scp.c Modified: head/crypto/openssh/scp.c ============================================================================== --- head/crypto/openssh/scp.c Tue Jan 15 09:48:18 2019 (r343042) +++ head/crypto/openssh/scp.c Tue Jan 15 15:35:14 2019 (r343043) @@ -1106,7 +1106,8 @@ sink(int argc, char **argv) SCREWUP("size out of range"); size = (off_t)ull; - if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { + if (*cp == '\0' || strchr(cp, '/') != NULL || + strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) { run_err("error: unexpected filename: %s", cp); exit(1); } From owner-svn-src-head@freebsd.org Tue Jan 15 16:07:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA16C148EA71; Tue, 15 Jan 2019 16:07:11 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDF68CB6F; Tue, 15 Jan 2019 16:07:11 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 4BEC72700225; Tue, 15 Jan 2019 11:07:05 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 4BEC72700225 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1547568425; bh=FXZKVWzfYOFV8bKjRehKMx1CjozMKn3KVRFNnvXBZYs=; h=Subject:To:From:Date:From; b=dyxb+QMLqs25MfJQ8fC2nzWzdrL9tWwbCLpoqb1Sq7Nm9FcdRFEgVL1CxKOWZAWIf eiT0mViUs5WDsvtsuo8cJun1zxKiD67g/HvSDsL6dNZh5Jx0srA+TR2ifsagHQ2jw5 MmMBqn1ZWp6LK0zccw+d6zRj6+dimFgSvHUon6t1dwEZySGBp7dfqeWxbxb8eACHMR 2+iW1j35MRcPO8WnGBAwbnyZYG89aXxQxq0YHy7kCsJiO3PYL4Yjc/9GMQehyWKTvq mcp8Nia3gMtZwen9oDClIAr3/m4B6QxbtywFu6VJfhjsYGKNz3FWp+oFgzD62L/EwQ di7jZ4AqBKyug== Subject: Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901150102.x0F12Hlt025856@repo.freebsd.org> From: Andrew Gallatin Message-ID: <9f0e56b9-387e-8374-2a63-5d7f407ee753@cs.duke.edu> Date: Tue, 15 Jan 2019 11:07:04 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901150102.x0F12Hlt025856@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8BDF68CB6F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.90)[-0.905,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 16:07:12 -0000 On 1/14/19 8:02 PM, Gleb Smirnoff wrote: > Log: > Allocate pager bufs from UMA instead of 80-ish mutex protected linked list. <...> > Together with: gallatin Thank you so much for carrying this over the finish line! Drew From owner-svn-src-head@freebsd.org Tue Jan 15 16:13:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3FE1148ED68 for ; Tue, 15 Jan 2019 16:13:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic314-19.consmr.mail.gq1.yahoo.com (sonic314-19.consmr.mail.gq1.yahoo.com [98.137.69.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 665D78D1B3 for ; Tue, 15 Jan 2019 16:13:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1547568797; bh=SfZPHXFyGmLBit0PGzdur7uEovzt7RSExiRTT6VHRU0=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=iMtrqvKKKY8uCYGL7oGFF5Vm92mtLT6wK4E+U8rLo1xAntB6iMGTUBgQY4vsSp9nDB2QcU7g81MvPuFQXGOILautkLMgKfIwYsR5hwqeepvkHO8+bkt0hOleFnoazjPsNobx9C8nYzBDua/bumExpFSVNjNVVHUygtr8aX4P9MBagw4GNdOemEu48QSnxkgaJcn6XHTvqUlckPE16GKm2ZH2nm33f9Pfw8iVi4Hk0nsJrr13vVAqscxjvJnTXVdWazW3AiazAaoRIELyU3MegItP7TjXJXHma9G5umskqMClwbvY801l0NN1Q00chH1WAFqq8L8qTi/Mn2AtAGtdyQ== X-YMail-OSG: rjY2nf0VM1k0GpDhB9vXCEzhms2uaXMlkLZPBj6fHfGUHtQBfB2Qjzsh5IZKnyX bqR0k6kmdIo4PC16_vH1q3NwkshWNj3NbdOFhtPLLUYnrzDD0HcCjiJ5kU.Xcxrb_CVIamkHNmCJ 7kcEFR2ByNO45IgUz.gJLOGknfe.7AVHQP7I0R_3Q0_Zcqzohd67upZy9WrZXGkUFcniM_AyjGU9 WmYDHyYwG4HoKC.AfBHsPES5vZUobYMDT4S_FBrED__cruTLyPq_8rS_78srV3ui88xSw1BEuskd 46tWqWZbl95Y40J9eloIQYVvoFv1QLvCy4fOb03.tRpfSCItu3l4va7oCHY2q5aQXQjb5Ljt0qvh rZJci0N.M1Fsxe3cNQBQeEIwxCEby6Kxrp1Sr0oTi1UAv_CjaOl4t7xn4eKqFGk1U_NWladOtA22 XRhrikLWyfcsDOW.TW0907AibAKQq45TWl5jQhkORjUR7Rf.uoqFn9P52.xuJigevkEItCbIMon1 dqMv9gLGgXrITLeRH.TIpSDpBfM4j65m0R28DEbvl3scpDZvk6P82Wfzy9yQNipFPLHmnwcefM3J z9Tmh2_.tfjjeZh8kOIn1h4xPve8wm7y.0poYa9hk77ZrXN55KR7SK1NpD25Sjwe_ux4F1hJFvnS lVqf3TnNKMaMVP4QJ5i1eOksnJZY5oR1ebDqkMU7_Icgo6RkVDWMCcNDWA..x7xlHoU2ykn26bHc _To88eUk5MEUOnUwyemRYudJkL6eFnAC3UVHuapA0Adkgpb7aQrAJ7RJvuAWF22zK9H45dAcZLGp U9bYHHiChZG_fIIVF_LJNYuj6vPLzqCJJe6Vspk7ycAznuNYeQkgh1dpL6l2timIZO18QULxLIdr 2HGvsar6azofyfPFYW3lGla5.PujjzyX6E1f74aiuc6sfKYe5eUz37W2bFR31pbekNa2m0NAwF2P wkF_V6yvEEtTYh.FQ4Gy0tzgKpvc_y_XgX.84lMvh4P32l3euCI8mYymgNecJ5cCnD.VWqvgBrDv muEXZkGaY.W9vQ6frg302U9MADw6WyVzyPxC7Z3Y- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Tue, 15 Jan 2019 16:13:17 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.5]) ([181.52.72.201]) by smtp421.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7e659f2dd81bf65fdb5ef832c32cbbd5; Tue, 15 Jan 2019 16:13:17 +0000 (UTC) Subject: Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm To: Andrew Gallatin , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901150102.x0F12Hlt025856@repo.freebsd.org> <9f0e56b9-387e-8374-2a63-5d7f407ee753@cs.duke.edu> From: Pedro Giffuni Message-ID: Date: Tue, 15 Jan 2019 11:13:18 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <9f0e56b9-387e-8374-2a63-5d7f407ee753@cs.duke.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 665D78D1B3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 16:13:20 -0000 On 1/15/19 11:07 AM, Andrew Gallatin wrote: > On 1/14/19 8:02 PM, Gleb Smirnoff wrote: > >> Log: >>    Allocate pager bufs from UMA instead of 80-ish mutex protected >> linked list. > > <...> > >>    Together with:    gallatin > > Thank you so much for carrying this over the finish line! > > Drew > > It appears to be very impressive! Plans for MFC? Pedro. From owner-svn-src-head@freebsd.org Tue Jan 15 17:00:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF3911490327; Tue, 15 Jan 2019 17:00:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7E78EF2C; Tue, 15 Jan 2019 17:00:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0FH0CIt041084; Tue, 15 Jan 2019 09:00:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0FH0Crl041083; Tue, 15 Jan 2019 09:00:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343043 - head/crypto/openssh In-Reply-To: <201901151535.x0FFZE94018787@repo.freebsd.org> To: Ed Maste Date: Tue, 15 Jan 2019 09:00:12 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 5E7E78EF2C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 17:00:16 -0000 > Author: emaste > Date: Tue Jan 15 15:35:14 2019 > New Revision: 343043 > URL: https://svnweb.freebsd.org/changeset/base/343043 > > Log: > scp: disallow empty or current directory > > Obtained from: OpenBSD scp.c 1.198 > Security: CVE-2018-20685 > Sponsored by: The FreeBSD Foundation Can this be MFCed to 12, 11 and 10? > > Modified: > head/crypto/openssh/scp.c > > Modified: head/crypto/openssh/scp.c > ============================================================================== > --- head/crypto/openssh/scp.c Tue Jan 15 09:48:18 2019 (r343042) > +++ head/crypto/openssh/scp.c Tue Jan 15 15:35:14 2019 (r343043) > @@ -1106,7 +1106,8 @@ sink(int argc, char **argv) > SCREWUP("size out of range"); > size = (off_t)ull; > > - if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { > + if (*cp == '\0' || strchr(cp, '/') != NULL || > + strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) { > run_err("error: unexpected filename: %s", cp); > exit(1); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jan 15 17:40:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84FB11491555; Tue, 15 Jan 2019 17:40:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C17168455; Tue, 15 Jan 2019 17:40:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B8751E1B2; Tue, 15 Jan 2019 17:40:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FHeJKX094732; Tue, 15 Jan 2019 17:40:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FHeJXc094731; Tue, 15 Jan 2019 17:40:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201901151740.x0FHeJXc094731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 15 Jan 2019 17:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343047 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C17168455 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 17:40:20 -0000 Author: shurd Date: Tue Jan 15 17:40:19 2019 New Revision: 343047 URL: https://svnweb.freebsd.org/changeset/base/343047 Log: Fix window update issue when scaling disabled When the TCP window scale option is not used, and the window opens up enough in one soreceive, a window update will not be sent. For example, if recwin == 65535, so->so_rcv.sb_hiwat >= 262144, and so->so_rcv.sb_hiwat <= 524272, the window update will never be sent. This is because recwin and adv are clamped to TCP_MAXWIN << tp->rcv_scale, and so will never be >= so->so_rcv.sb_hiwat / 4 or <= so->so_rcv.sb_hiwat / 8. This patch ensures a window update is sent if the window opens by TCP_MAXWIN << tp->rcv_scale, which should only happen when the window size goes from zero to the max expressible. This issue looks like it was introduced in r306769 when recwin was clamped to TCP_MAXWIN << tp->rcv_scale. MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D18821 Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Jan 15 16:12:47 2019 (r343046) +++ head/sys/netinet/tcp_output.c Tue Jan 15 17:40:19 2019 (r343047) @@ -656,7 +656,8 @@ after_sack_rexmit: if (adv >= (int32_t)(2 * tp->t_maxseg) && (adv >= (int32_t)(so->so_rcv.sb_hiwat / 4) || recwin <= (so->so_rcv.sb_hiwat / 8) || - so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg || + adv >= TCP_MAXWIN << tp->rcv_scale)) goto send; if (2 * adv >= (int32_t)so->so_rcv.sb_hiwat) goto send; From owner-svn-src-head@freebsd.org Tue Jan 15 18:18:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C68A9149204A; Tue, 15 Jan 2019 18:18:17 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 54D4B6AE2E; Tue, 15 Jan 2019 18:18:17 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x0FIIC57048531 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 15 Jan 2019 10:18:12 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x0FIICFE048530; Tue, 15 Jan 2019 10:18:12 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 15 Jan 2019 10:18:12 -0800 From: Gleb Smirnoff To: Pedro Giffuni Cc: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm Message-ID: <20190115181812.GY18452@FreeBSD.org> References: <201901150102.x0F12Hlt025856@repo.freebsd.org> <9f0e56b9-387e-8374-2a63-5d7f407ee753@cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 54D4B6AE2E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.948,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:18:17 -0000 On Tue, Jan 15, 2019 at 11:13:18AM -0500, Pedro Giffuni wrote: P> >>    Allocate pager bufs from UMA instead of 80-ish mutex protected P> >> linked list. P> > P> >>    Together with:    gallatin P> > P> > Thank you so much for carrying this over the finish line! P> > P> It appears to be very impressive! Plans for MFC? Nope. I'm very conservative about stable branch being stable branch :) -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Jan 15 18:20:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3AA1492118; Tue, 15 Jan 2019 18:20:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E45156AFC3; Tue, 15 Jan 2019 18:20:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D77301E88D; Tue, 15 Jan 2019 18:20:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIKKic020114; Tue, 15 Jan 2019 18:20:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIKKuS020113; Tue, 15 Jan 2019 18:20:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901151820.x0FIKKuS020113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 15 Jan 2019 18:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343048 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 343048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E45156AFC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:20:21 -0000 Author: jhb Date: Tue Jan 15 18:20:20 2019 New Revision: 343048 URL: https://svnweb.freebsd.org/changeset/base/343048 Log: Update the note about the need for COMPAT_FREEBSD kernel options. Rather than mentioning the requirement for 4.x binaries but not explaining why (it was assuming an upgrade from 4.x to 5.0-current), explain when compat options are needed (for running existing host binaries) in a more general way while using a more modern example (COMPAT_FREEBSD11 for 11.x binaries). While here, explicitly mention that a GENERIC kernel should always work. Reported by: Robert Huff Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18740 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Jan 15 17:40:19 2019 (r343047) +++ head/UPDATING Tue Jan 15 18:20:20 2019 (r343048) @@ -1901,12 +1901,13 @@ COMMON ITEMS: can be deleted by "make delete-old-libs", but you have to make sure that no program is using those libraries anymore. - [8] In order to have a kernel that can run the 4.x binaries needed to - do an installworld, you must include the COMPAT_FREEBSD4 option in - your kernel. Failure to do so may leave you with a system that is - hard to boot to recover. A similar kernel option COMPAT_FREEBSD5 is - required to run the 5.x binaries on more recent kernels. And so on - for COMPAT_FREEBSD6 and COMPAT_FREEBSD7. + [8] The new kernel must be able to run existing binaries used by + an installworld. When upgrading across major versions, the new + kernel's configuration must include the correct COMPAT_FREEBSD + option for existing binaries (e.g. COMPAT_FREEBSD11 to run 11.x + binaries). Failure to do so may leave you with a system that is + hard to boot to recover. A GENERIC kernel will include suitable + compatibility options to run binaries from older branches. Make sure that you merge any new devices from GENERIC since the last time you updated your kernel config file. From owner-svn-src-head@freebsd.org Tue Jan 15 18:24:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD8B149247B; Tue, 15 Jan 2019 18:24:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1BD56B683; Tue, 15 Jan 2019 18:24:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E5CD1EA56; Tue, 15 Jan 2019 18:24:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIOZOL025810; Tue, 15 Jan 2019 18:24:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIOYwP025806; Tue, 15 Jan 2019 18:24:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151824.x0FIOYwP025806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 18:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343051 - in head/sys: compat/linuxkpi/common/src vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src vm X-SVN-Commit-Revision: 343051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1BD56B683 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:24:36 -0000 Author: glebius Date: Tue Jan 15 18:24:34 2019 New Revision: 343051 URL: https://svnweb.freebsd.org/changeset/base/343051 Log: Make uz_allocs, uz_frees and uz_fails counter(9). This removes some atomic updates and reduces amount of data protected by zone lock. During startup point these fields to EARLY_COUNTER. After startup allocate them for all early zones. Tested by: pho Modified: head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/vm/uma_core.c head/sys/vm/uma_dbg.c head/sys/vm/uma_int.h Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan 15 18:22:16 2019 (r343050) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan 15 18:24:34 2019 (r343051) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 15 18:22:16 2019 (r343050) +++ head/sys/vm/uma_core.c Tue Jan 15 18:24:34 2019 (r343051) @@ -1715,6 +1715,15 @@ keg_ctor(void *mem, int size, void *udata, int flags) return (0); } +static void +zone_alloc_counters(uma_zone_t zone) +{ + + zone->uz_allocs = counter_u64_alloc(M_WAITOK); + zone->uz_frees = counter_u64_alloc(M_WAITOK); + zone->uz_fails = counter_u64_alloc(M_WAITOK); +} + /* * Zone header ctor. This initializes all fields, locks, etc. * @@ -1736,9 +1745,6 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_slab = zone_fetch_slab; zone->uz_init = NULL; zone->uz_fini = NULL; - zone->uz_allocs = 0; - zone->uz_frees = 0; - zone->uz_fails = 0; zone->uz_sleeps = 0; zone->uz_count = 0; zone->uz_count_min = 0; @@ -1750,6 +1756,14 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_bkt_max = ULONG_MAX; timevalclear(&zone->uz_ratecheck); + if (__predict_true(booted == BOOT_RUNNING)) + zone_alloc_counters(zone); + else { + zone->uz_allocs = EARLY_COUNTER; + zone->uz_frees = EARLY_COUNTER; + zone->uz_fails = EARLY_COUNTER; + } + /* * This is a pure cache zone, no kegs. */ @@ -1908,6 +1922,9 @@ zone_dtor(void *arg, int size, void *udata) rw_wunlock(&uma_rwlock); zone_free_item(kegs, keg, NULL, SKIP_NONE); } + counter_u64_free(zone->uz_allocs); + counter_u64_free(zone->uz_frees); + counter_u64_free(zone->uz_fails); if (zone->uz_lockptr == &zone->uz_lock) ZONE_LOCK_FINI(zone); } @@ -1928,12 +1945,19 @@ zone_foreach(void (*zfunc)(uma_zone_t)) uma_keg_t keg; uma_zone_t zone; - rw_rlock(&uma_rwlock); + /* + * Before BOOT_RUNNING we are guaranteed to be single + * threaded, so locking isn't needed. Startup functions + * are allowed to use M_WAITOK. + */ + if (__predict_true(booted == BOOT_RUNNING)) + rw_rlock(&uma_rwlock); LIST_FOREACH(keg, &uma_kegs, uk_link) { LIST_FOREACH(zone, &keg->uk_zones, uz_link) zfunc(zone); } - rw_runlock(&uma_rwlock); + if (__predict_true(booted == BOOT_RUNNING)) + rw_runlock(&uma_rwlock); } /* @@ -2109,6 +2133,7 @@ uma_startup3(void) uma_dbg_cnt = counter_u64_alloc(M_WAITOK); uma_skip_cnt = counter_u64_alloc(M_WAITOK); #endif + zone_foreach(zone_alloc_counters); callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); booted = BOOT_RUNNING; @@ -2387,7 +2412,7 @@ zalloc_start: zone->uz_dtor != trash_dtor) && #endif zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { - atomic_add_long(&zone->uz_fails, 1); + counter_u64_add(zone->uz_fails, 1); zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); return (NULL); } @@ -2845,7 +2870,7 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do if (bucket->ub_cnt == 0) { bucket_free(zone, bucket, udata); - atomic_add_long(&zone->uz_fails, 1); + counter_u64_add(zone->uz_fails, 1); return (NULL); } @@ -2905,7 +2930,6 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i } zone->uz_items++; - zone->uz_allocs++; ZONE_UNLOCK(zone); if (domain != UMA_ANYDOMAIN) { @@ -2947,6 +2971,7 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i if (flags & M_ZERO) uma_zero_item(item, zone); + counter_u64_add(zone->uz_allocs, 1); CTR3(KTR_UMA, "zone_alloc_item item %p from %s(%p)", item, zone->uz_name, zone); @@ -2955,9 +2980,8 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i fail: ZONE_LOCK(zone); zone->uz_items--; - zone->uz_allocs--; ZONE_UNLOCK(zone); - atomic_add_long(&zone->uz_fails, 1); + counter_u64_add(zone->uz_fails, 1); CTR2(KTR_UMA, "zone_alloc_item failed from %s(%p)", zone->uz_name, zone); return (NULL); @@ -3268,8 +3292,9 @@ zone_free_item(uma_zone_t zone, void *item, void *udat if (skip & SKIP_CNT) return; + counter_u64_add(zone->uz_frees, 1); + ZONE_LOCK(zone); - zone->uz_frees++; zone->uz_items--; if (zone->uz_sleepers > 0 && zone->uz_items < zone->uz_max_items) wakeup_one(zone); @@ -3358,7 +3383,8 @@ uma_zone_get_cur(uma_zone_t zone) u_int i; ZONE_LOCK(zone); - nitems = zone->uz_allocs - zone->uz_frees; + nitems = counter_u64_fetch(zone->uz_allocs) - + counter_u64_fetch(zone->uz_frees); CPU_FOREACH(i) { /* * See the comment in sysctl_vm_zone_stats() regarding the @@ -3801,8 +3827,8 @@ uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint6 allocs += cache->uc_allocs; frees += cache->uc_frees; } - allocs += z->uz_allocs; - frees += z->uz_frees; + allocs += counter_u64_fetch(z->uz_allocs); + frees += counter_u64_fetch(z->uz_frees); sleeps += z->uz_sleeps; if (cachefreep != NULL) *cachefreep = cachefree; @@ -3895,9 +3921,9 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS) zdom = &z->uz_domain[i]; uth.uth_zone_free += zdom->uzd_nitems; } - uth.uth_allocs = z->uz_allocs; - uth.uth_frees = z->uz_frees; - uth.uth_fails = z->uz_fails; + uth.uth_allocs = counter_u64_fetch(z->uz_allocs); + uth.uth_frees = counter_u64_fetch(z->uz_frees); + uth.uth_fails = counter_u64_fetch(z->uz_fails); uth.uth_sleeps = z->uz_sleeps; /* * While it is not normally safe to access the cache @@ -4105,8 +4131,8 @@ DB_SHOW_COMMAND(uma, db_show_uma) LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) { if (kz->uk_flags & UMA_ZFLAG_INTERNAL) { - allocs = z->uz_allocs; - frees = z->uz_frees; + allocs = counter_u64_fetch(z->uz_allocs); + frees = counter_u64_fetch(z->uz_frees); sleeps = z->uz_sleeps; cachefree = 0; } else Modified: head/sys/vm/uma_dbg.c ============================================================================== --- head/sys/vm/uma_dbg.c Tue Jan 15 18:22:16 2019 (r343050) +++ head/sys/vm/uma_dbg.c Tue Jan 15 18:24:34 2019 (r343051) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Jan 15 18:22:16 2019 (r343050) +++ head/sys/vm/uma_int.h Tue Jan 15 18:24:34 2019 (r343051) @@ -364,10 +364,10 @@ struct uma_zone { uint16_t uz_count_min; /* Minimal amount of items in bucket */ /* Offset 256, stats. */ - uint64_t uz_allocs UMA_ALIGN; /* Total number of allocations */ + counter_u64_t uz_allocs; /* Total number of allocations */ + counter_u64_t uz_frees; /* Total number of frees */ + counter_u64_t uz_fails; /* Total number of alloc failures */ uint64_t uz_sleeps; /* Total number of alloc sleeps */ - uint64_t uz_frees; /* Total number of frees */ - volatile u_long uz_fails; /* Total number of alloc failures */ /* * This HAS to be the last item because we adjust the zone size From owner-svn-src-head@freebsd.org Tue Jan 15 18:32:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 535D41492885; Tue, 15 Jan 2019 18:32:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA61D6BE88; Tue, 15 Jan 2019 18:32:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEA631EC0A; Tue, 15 Jan 2019 18:32:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIWQhI031089; Tue, 15 Jan 2019 18:32:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIWQrj031088; Tue, 15 Jan 2019 18:32:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151832.x0FIWQrj031088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 18:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343052 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA61D6BE88 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:32:27 -0000 Author: glebius Date: Tue Jan 15 18:32:26 2019 New Revision: 343052 URL: https://svnweb.freebsd.org/changeset/base/343052 Log: Only do uz_items accounting for zones that have a limit set in uz_max_items. This reduces amount of locking required for these zones. Also, for cache only zones (UMA_ZFLAG_CACHE) accounting uz_items wasn't correct at all, since they may allocate items directly from their backing store and then free them via UMA underflowing uz_items. Tested by: pho Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 15 18:24:34 2019 (r343051) +++ head/sys/vm/uma_core.c Tue Jan 15 18:32:26 2019 (r343052) @@ -736,11 +736,13 @@ bucket_drain(uma_zone_t zone, uma_bucket_t bucket) for (i = 0; i < bucket->ub_cnt; i++) zone->uz_fini(bucket->ub_bucket[i], zone->uz_size); zone->uz_release(zone->uz_arg, bucket->ub_bucket, bucket->ub_cnt); - ZONE_LOCK(zone); - zone->uz_items -= bucket->ub_cnt; - if (zone->uz_sleepers && zone->uz_items < zone->uz_max_items) - wakeup_one(zone); - ZONE_UNLOCK(zone); + if (zone->uz_max_items > 0) { + ZONE_LOCK(zone); + zone->uz_items -= bucket->ub_cnt; + if (zone->uz_sleepers && zone->uz_items < zone->uz_max_items) + wakeup_one(zone); + ZONE_UNLOCK(zone); + } bucket->ub_cnt = 0; } @@ -2515,9 +2517,9 @@ zalloc_start: goto zalloc_item; maxbucket = MIN(zone->uz_count, zone->uz_max_items - zone->uz_items); + zone->uz_items += maxbucket; } else maxbucket = zone->uz_count; - zone->uz_items += maxbucket; ZONE_UNLOCK(zone); /* @@ -2530,9 +2532,8 @@ zalloc_start: zone->uz_name, zone, bucket); ZONE_LOCK(zone); if (bucket != NULL) { - if (bucket->ub_cnt < maxbucket) { - MPASS(zone->uz_flags & UMA_ZFLAG_CACHE || - zone->uz_items >= maxbucket - bucket->ub_cnt); + if (zone->uz_max_items > 0 && bucket->ub_cnt < maxbucket) { + MPASS(zone->uz_items >= maxbucket - bucket->ub_cnt); zone->uz_items -= maxbucket - bucket->ub_cnt; if (zone->uz_sleepers > 0 && zone->uz_items < zone->uz_max_items) @@ -2562,7 +2563,7 @@ zalloc_start: zone_put_bucket(zone, zdom, bucket, false); ZONE_UNLOCK(zone); goto zalloc_start; - } else { + } else if (zone->uz_max_items > 0) { zone->uz_items -= maxbucket; if (zone->uz_sleepers > 0 && zone->uz_items + 1 < zone->uz_max_items) @@ -2912,24 +2913,25 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i ZONE_LOCK_ASSERT(zone); - if (zone->uz_max_items > 0 && zone->uz_items >= zone->uz_max_items) { - zone_log_warning(zone); - zone_maxaction(zone); - if (flags & M_NOWAIT) { - ZONE_UNLOCK(zone); - return (NULL); + if (zone->uz_max_items > 0) { + if (zone->uz_items >= zone->uz_max_items) { + zone_log_warning(zone); + zone_maxaction(zone); + if (flags & M_NOWAIT) { + ZONE_UNLOCK(zone); + return (NULL); + } + zone->uz_sleeps++; + zone->uz_sleepers++; + while (zone->uz_items >= zone->uz_max_items) + mtx_sleep(zone, zone->uz_lockptr, PVM, "zonelimit", 0); + zone->uz_sleepers--; + if (zone->uz_sleepers > 0 && + zone->uz_items + 1 < zone->uz_max_items) + wakeup_one(zone); } - zone->uz_sleeps++; - zone->uz_sleepers++; - while (zone->uz_items >= zone->uz_max_items) - mtx_sleep(zone, zone->uz_lockptr, PVM, "zonelimit", 0); - zone->uz_sleepers--; - if (zone->uz_sleepers > 0 && - zone->uz_items + 1 < zone->uz_max_items) - wakeup_one(zone); + zone->uz_items++; } - - zone->uz_items++; ZONE_UNLOCK(zone); if (domain != UMA_ANYDOMAIN) { @@ -2978,9 +2980,11 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i return (item); fail: - ZONE_LOCK(zone); - zone->uz_items--; - ZONE_UNLOCK(zone); + if (zone->uz_max_items > 0) { + ZONE_LOCK(zone); + zone->uz_items--; + ZONE_UNLOCK(zone); + } counter_u64_add(zone->uz_fails, 1); CTR2(KTR_UMA, "zone_alloc_item failed from %s(%p)", zone->uz_name, zone); @@ -3294,11 +3298,14 @@ zone_free_item(uma_zone_t zone, void *item, void *udat counter_u64_add(zone->uz_frees, 1); - ZONE_LOCK(zone); - zone->uz_items--; - if (zone->uz_sleepers > 0 && zone->uz_items < zone->uz_max_items) - wakeup_one(zone); - ZONE_UNLOCK(zone); + if (zone->uz_max_items > 0) { + ZONE_LOCK(zone); + zone->uz_items--; + if (zone->uz_sleepers > 0 && + zone->uz_items < zone->uz_max_items) + wakeup_one(zone); + ZONE_UNLOCK(zone); + } } /* See uma.h */ @@ -3902,8 +3909,11 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS) uth.uth_align = kz->uk_align; uth.uth_size = kz->uk_size; uth.uth_rsize = kz->uk_rsize; - uth.uth_pages += (z->uz_items / kz->uk_ipers) * - kz->uk_ppera; + if (z->uz_max_items > 0) + uth.uth_pages = (z->uz_items / kz->uk_ipers) * + kz->uk_ppera; + else + uth.uth_pages = kz->uk_pages; uth.uth_maxpages += (z->uz_max_items / kz->uk_ipers) * kz->uk_ppera; uth.uth_limit = z->uz_max_items; From owner-svn-src-head@freebsd.org Tue Jan 15 18:47:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BD41492F49; Tue, 15 Jan 2019 18:47:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B14C96C5ED; Tue, 15 Jan 2019 18:47:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A47F21EDCD; Tue, 15 Jan 2019 18:47:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIlJin038824; Tue, 15 Jan 2019 18:47:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIlJRe038823; Tue, 15 Jan 2019 18:47:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151847.x0FIlJRe038823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 18:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343053 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 343053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B14C96C5ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:47:20 -0000 Author: glebius Date: Tue Jan 15 18:47:19 2019 New Revision: 343053 URL: https://svnweb.freebsd.org/changeset/base/343053 Log: This was missed in r343051: make uz_allocs, uz_frees and uz_fails counter(9). Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Tue Jan 15 18:32:26 2019 (r343052) +++ head/lib/libmemstat/memstat_uma.c Tue Jan 15 18:47:19 2019 (r343053) @@ -29,6 +29,7 @@ */ #include +#include #include #include @@ -406,9 +407,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *k * Reset the statistics on a current node. */ _memstat_mt_reset_stats(mtp, mp_maxid + 1); - mtp->mt_numallocs = uz.uz_allocs; - mtp->mt_numfrees = uz.uz_frees; - mtp->mt_failures = uz.uz_fails; + mtp->mt_numallocs = kvm_counter_u64_fetch(kvm, + (unsigned long )uz.uz_allocs); + mtp->mt_numfrees = kvm_counter_u64_fetch(kvm, + (unsigned long )uz.uz_frees); + mtp->mt_failures = kvm_counter_u64_fetch(kvm, + (unsigned long )uz.uz_fails); mtp->mt_sleeps = uz.uz_sleeps; if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; From owner-svn-src-head@freebsd.org Tue Jan 15 18:49:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC9B1492FE8; Tue, 15 Jan 2019 18:49:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91E276C79D; Tue, 15 Jan 2019 18:49:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85EEC1EDD1; Tue, 15 Jan 2019 18:49:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FInVVV039171; Tue, 15 Jan 2019 18:49:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FInV3R039170; Tue, 15 Jan 2019 18:49:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151849.x0FInV3R039170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 18:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343054 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91E276C79D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:49:32 -0000 Author: glebius Date: Tue Jan 15 18:49:31 2019 New Revision: 343054 URL: https://svnweb.freebsd.org/changeset/base/343054 Log: Remove harmless leftover from code that cycles over zone's kegs. Just use + instead of +=. There is no functional change. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 15 18:47:19 2019 (r343053) +++ head/sys/vm/uma_core.c Tue Jan 15 18:49:31 2019 (r343054) @@ -3914,10 +3914,10 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS) kz->uk_ppera; else uth.uth_pages = kz->uk_pages; - uth.uth_maxpages += (z->uz_max_items / kz->uk_ipers) * + uth.uth_maxpages = (z->uz_max_items / kz->uk_ipers) * kz->uk_ppera; uth.uth_limit = z->uz_max_items; - uth.uth_keg_free += z->uz_keg->uk_free; + uth.uth_keg_free = z->uz_keg->uk_free; /* * A zone is secondary is it is not the first entry From owner-svn-src-head@freebsd.org Tue Jan 15 18:50:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D8B1493061; Tue, 15 Jan 2019 18:50:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A90956C904; Tue, 15 Jan 2019 18:50:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C0301EDD8; Tue, 15 Jan 2019 18:50:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIoB9I039341; Tue, 15 Jan 2019 18:50:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIoBMd039340; Tue, 15 Jan 2019 18:50:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151850.x0FIoBMd039340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 18:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343055 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A90956C904 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:50:12 -0000 Author: glebius Date: Tue Jan 15 18:50:11 2019 New Revision: 343055 URL: https://svnweb.freebsd.org/changeset/base/343055 Log: style(9): break long line. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jan 15 18:49:31 2019 (r343054) +++ head/sys/vm/uma_core.c Tue Jan 15 18:50:11 2019 (r343055) @@ -2924,7 +2924,8 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i zone->uz_sleeps++; zone->uz_sleepers++; while (zone->uz_items >= zone->uz_max_items) - mtx_sleep(zone, zone->uz_lockptr, PVM, "zonelimit", 0); + mtx_sleep(zone, zone->uz_lockptr, PVM, + "zonelimit", 0); zone->uz_sleepers--; if (zone->uz_sleepers > 0 && zone->uz_items + 1 < zone->uz_max_items) From owner-svn-src-head@freebsd.org Tue Jan 15 18:53:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A5414932A3; Tue, 15 Jan 2019 18:53:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D95406CD2D; Tue, 15 Jan 2019 18:53:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE5A21EF78; Tue, 15 Jan 2019 18:53:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FIrjaX044349; Tue, 15 Jan 2019 18:53:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FIrjWS044348; Tue, 15 Jan 2019 18:53:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901151853.x0FIrjWS044348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 15 Jan 2019 18:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343056 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 343056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D95406CD2D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 18:53:46 -0000 Author: jhb Date: Tue Jan 15 18:53:45 2019 New Revision: 343056 URL: https://svnweb.freebsd.org/changeset/base/343056 Log: Reject new sessions if the necessary queues aren't initialized. ccr reuses the control queue and first rx queue from the first port on each adapter. The driver cannot send requests until those queues are initialized. Refuse to create sessions for now if the queues aren't ready. This is a workaround until cxgbe allocates one or more dedicated queues for ccr. PR: 233851 MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18478 Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Jan 15 18:50:11 2019 (r343055) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Jan 15 18:53:45 2019 (r343056) @@ -1652,12 +1652,6 @@ ccr_attach(device_t dev) struct ccr_softc *sc; int32_t cid; - /* - * TODO: Crypto requests will panic if the parent device isn't - * initialized so that the queues are up and running. Need to - * figure out how to handle that correctly, maybe just reject - * requests if the adapter isn't fully initialized? - */ sc = device_get_softc(dev); sc->dev = dev; sc->adapter = device_get_softc(device_get_parent(dev)); @@ -2058,6 +2052,16 @@ ccr_newsession(device_t dev, crypto_session_t cses, st } sc = device_get_softc(dev); + + /* + * XXX: Don't create a session if the queues aren't + * initialized. This is racy as the rxq can be destroyed by + * the associated VI detaching. Eventually ccr should use + * dedicated queues. + */ + if (sc->rxq->iq.adapter == NULL || sc->txq->adapter == NULL) + return (ENXIO); + mtx_lock(&sc->lock); if (sc->detaching) { mtx_unlock(&sc->lock); From owner-svn-src-head@freebsd.org Tue Jan 15 19:33:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F961493F6F; Tue, 15 Jan 2019 19:33:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 122086E123; Tue, 15 Jan 2019 19:33:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 000071F64F; Tue, 15 Jan 2019 19:33:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FJXla2069320; Tue, 15 Jan 2019 19:33:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FJXl8a069317; Tue, 15 Jan 2019 19:33:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901151933.x0FJXl8a069317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Jan 2019 19:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src vm X-SVN-Commit-Revision: 343058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 122086E123 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 19:33:48 -0000 Author: glebius Date: Tue Jan 15 19:33:47 2019 New Revision: 343058 URL: https://svnweb.freebsd.org/changeset/base/343058 Log: Fix compilation failures on different arches that have vm_machdep.c not aware of counter_u64_t by including counter.h into uma_int.h. I'm not happy about this inclusion, but it fixes compilation ASAP. Modified: head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/vm/uma_dbg.c head/sys/vm/uma_int.h Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan 15 19:01:04 2019 (r343057) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan 15 19:33:47 2019 (r343058) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/vm/uma_dbg.c ============================================================================== --- head/sys/vm/uma_dbg.c Tue Jan 15 19:01:04 2019 (r343057) +++ head/sys/vm/uma_dbg.c Tue Jan 15 19:33:47 2019 (r343058) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Jan 15 19:01:04 2019 (r343057) +++ head/sys/vm/uma_int.h Tue Jan 15 19:33:47 2019 (r343058) @@ -30,6 +30,7 @@ * */ +#include #include #include #include From owner-svn-src-head@freebsd.org Tue Jan 15 19:46:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F067F14942B8; Tue, 15 Jan 2019 19:46:29 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B4D6E6B7; Tue, 15 Jan 2019 19:46:29 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x12c.google.com with SMTP id i145so7017947ita.4; Tue, 15 Jan 2019 11:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AicBN51rp1HAvKqSXJM1Z/x/x8EvzD7e6iTB58Xxs2A=; b=jAacVt8E5i4Ll66ygMCw8cZBpavvhFulHRX3zNVQYv7Y2bObNc4MW2Z8CBMwfutccw cAQJyQO8OMuoWctc1utQ+PisQdkCgqUSpZdqBSpAkLaJEZqAMg4seunM4QyQhH7bCIhH 5uqfv+Zd5536TtG5sv/Fv96f+IwVK7P+xG+meJ9t+QkBCpeOL4DFsa37qCFMtfowiui9 eQoseank6tY8D3lu6ltSmn7MKs/47BpxWFd4gXMpaulNfhlzkIB2WJQN/aseiv/B1YL+ klM8mI8oq/wSuWLXktcCsSoKgmwoDh7OQ7zzH6T+kgUx316rss521kmxCPNbaiKBxsLv Zilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AicBN51rp1HAvKqSXJM1Z/x/x8EvzD7e6iTB58Xxs2A=; b=JTPBkc70Blq81m2w8GiJ+xdyD9Wt3XZ73OVx5AEY3zalz8wSnmZV36AR3b89QWqb5Y EJSIgLurrCCD31UE7lo88WcrH82dmTzFqxMhi08M2NMMXsuFwi6UbxYysXoAZQaEzndm Zb7FxMl9yRQUwVAAoOer3hGhMHnjNh7I/ojVEMChyoYbIa6GCNwI78fmXu4GvZ6qfS0l aQkwSad7sgdWntSyybopinxXr553TxC0wJzolsO4UADsU+ZcXL+8o60oAzsrMbneXfWX pZfNHNIU/uMpmq7k8yApbGXsw5l5V7t36FVun0n6XBMY1VJkYrdqsqv8X/zGEzZQSXX0 yn6A== X-Gm-Message-State: AJcUukd6QWg5YprNrbrwINEkbqC+aVRsPkbrJkJnPQd92XBQhB1TIpl7 53vdxUKKu/r1eW8hMgH2+Om9cxbvK/0= X-Google-Smtp-Source: ALg8bN763VYBpDdSFNGmpiBK9VwqoWGzFV9ZUuz687WisIdtOeZJKaKVSUG/Nk9SYcNwIiS8Q+r2aA== X-Received: by 2002:a24:248:: with SMTP id 69mr3504116itu.91.1547581588400; Tue, 15 Jan 2019 11:46:28 -0800 (PST) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id y76sm2090652ita.18.2019.01.15.11.46.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Jan 2019 11:46:27 -0800 (PST) Date: Tue, 15 Jan 2019 13:46:23 -0600 From: Justin Hibbits To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm Message-ID: <20190115134623.139064b2@titan.knownspace> In-Reply-To: <201901151933.x0FJXl8a069317@repo.freebsd.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 90B4D6E6B7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 19:46:30 -0000 On Tue, 15 Jan 2019 19:33:47 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Jan 15 19:33:47 2019 > New Revision: 343058 > URL: https://svnweb.freebsd.org/changeset/base/343058 > > Log: > Fix compilation failures on different arches that have vm_machdep.c > not aware of counter_u64_t by including counter.h into uma_int.h. I'm > not happy about this inclusion, but it fixes compilation ASAP. > > Modified: > head/sys/compat/linuxkpi/common/src/linux_page.c > head/sys/vm/uma_dbg.c > head/sys/vm/uma_int.h > > Modified: head/sys/compat/linuxkpi/common/src/linux_page.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan > 15 19:01:04 2019 (r343057) +++ > head/sys/compat/linuxkpi/common/src/linux_page.c Tue Jan 15 > 19:33:47 2019 (r343058) @@ -31,7 +31,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > -#include > #include > #include > #include > > Modified: head/sys/vm/uma_dbg.c > ============================================================================== > --- head/sys/vm/uma_dbg.c Tue Jan 15 19:01:04 2019 > (r343057) +++ head/sys/vm/uma_dbg.c Tue Jan 15 19:33:47 > 2019 (r343058) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > > Modified: head/sys/vm/uma_int.h > ============================================================================== > --- head/sys/vm/uma_int.h Tue Jan 15 19:01:04 2019 > (r343057) +++ head/sys/vm/uma_int.h Tue Jan 15 19:33:47 > 2019 (r343058) @@ -30,6 +30,7 @@ > * > */ > > +#include > #include > #include > #include > Why not #include counter.h in the relevant vm_machdep.c files instead? - Justin From owner-svn-src-head@freebsd.org Tue Jan 15 20:06:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB2E61494B59; Tue, 15 Jan 2019 20:06:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 23D3E6F1EE; Tue, 15 Jan 2019 20:06:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x0FK6H0M049313 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 15 Jan 2019 12:06:17 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x0FK6HoE049312; Tue, 15 Jan 2019 12:06:17 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 15 Jan 2019 12:06:17 -0800 From: Gleb Smirnoff To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm Message-ID: <20190115200617.GZ18452@FreeBSD.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190115134623.139064b2@titan.knownspace> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 23D3E6F1EE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 20:06:20 -0000 On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: J> Why not #include counter.h in the relevant vm_machdep.c files instead? This also is ugly :( Not sure more or less. Probably less, but I urged to plug all possible compilation failures at a time. What is ugly is that most files just need counter_u64_t size, and they don't use counter(9) KPI. The fact that vm_machdep or Linux KPI want to look into internal type uma_zone_t is also ugly. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Jan 15 20:20:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F626149500B for ; Tue, 15 Jan 2019 20:20:28 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C23656F83F for ; Tue, 15 Jan 2019 20:20:27 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1547583618; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=he6bfYSCPhHVuloqhG9SPt7iejihESxzc7hhr7ri+U25aSBTVl7dm8vU8ZgCft8b5BHZzwLRxY7mL WcnbdjnD8lWbzc3T8RnbsxytfZrz+LUtCK7GxyG7c8F0O6w61mbfgkgV/kRAJXRo3wssqTS/8xtnPB bLkfNBz3SS9PjIRG1idvE8f23G2qFY33ErboRfclcgwcw6YyltIUBBbos6663rW1/TCYqbemx7FAO5 q1B6zR4zrNJtmJmRF6QpuM8bbd50XFuxBb3B9xQGRhYmA9mgHKvyncdUA1oIWRX4Qd9odEEIpCh2YM Both5ZmOhERhVK8QoKU7R6LssbThiow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=GvdNdrm0KPcCpM2KH7WpCIrKZpr9Ylw+9v02wScWlI8=; b=ArYZ1PJX+a2gCDwVSWlmi7wP8F16/5nW1XcaSUoitqTmlfGnJuLR/mEyXYx/gCV/0+ykc7Efgs1Ss pMBOKfczKy0IF/l8ftRNkhOjUX36N5iDaR6jJjg9bXrzGqtivJdKRp6t/33Ek7G7Sax+E+2HgOdcHB w/Uvf03v5ZdudJ+UcaQg8TBripT46jib/x+h3A3bSx+z3KbQEm6NB3wFG1AF2WpI5P0oUPAE3oolI7 DtZ4tqBykDC0N5grcSqiV7vBgT6UO7kMvB7hI1i2V5qkkLYtL+uIAeQ79sTDawca+ggyAfo8q5ofgl +tm7SMqtQDIe2FDGGx4KF3aR9VOGwxg== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=GvdNdrm0KPcCpM2KH7WpCIrKZpr9Ylw+9v02wScWlI8=; b=Z+FBMr4R1WULJf3IfO8YcAfAGZ9lUEJePfXqhd/rE8QLjUjLzQRLjMsCNOSiAmoKM9NHDxV8QGTtF ZaEGWEL4dnmEDS9MVJqBygv8jC2vygpa315L/MWapJmY2+iVGcYnuVa67SQqLKpa3wyVk2LR59sG6F ahCgn4jQmq0yOGlfrZ1v3cF9r+Ua1jgcQLS7FKSD0bqnW1h5KgoJrrubCTKIpT3atZCURZVHLhYTEj ledgeWUaoQUOiF31vTxk1H642hFPYtjyWvBqyK/dnLICQNcAJv0Au/CgBQwMWX+qAtQ6ueqphW1VFA rHIx86RT4nxLGXNLmk0vrsqC0PK8Tdw== X-MHO-RoutePath: aGlwcGll X-MHO-User: f7e920e5-1902-11e9-8a28-a1efd8da9a94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id f7e920e5-1902-11e9-8a28-a1efd8da9a94; Tue, 15 Jan 2019 20:20:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0FKKEeJ072390; Tue, 15 Jan 2019 13:20:14 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <79ee763bb72a47f3e7888caf266174a62c23e532.camel@freebsd.org> Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm From: Ian Lepore To: Gleb Smirnoff , Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 15 Jan 2019 13:20:14 -0700 In-Reply-To: <20190115200617.GZ18452@FreeBSD.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> <20190115200617.GZ18452@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C23656F83F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 20:20:28 -0000 On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote: > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: > J> Why not #include counter.h in the relevant vm_machdep.c files > instead? > > This also is ugly :( Not sure more or less. Probably less, but I > urged to plug all possible compilation failures at a time. > > What is ugly is that most files just need counter_u64_t size, > and they don't use counter(9) KPI. > > The fact that vm_machdep or Linux KPI want to look into internal > type uma_zone_t is also ugly. > Isn't the usual fix for this problem to create a __counter_u64_t in sys/types.h and use it in places where including the full header file is undesirable for some reason? -- Ian From owner-svn-src-head@freebsd.org Tue Jan 15 20:33:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F57149557F; Tue, 15 Jan 2019 20:33:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8420A701A3; Tue, 15 Jan 2019 20:33:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x0FKXGjo049440 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 15 Jan 2019 12:33:16 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x0FKXGHV049439; Tue, 15 Jan 2019 12:33:16 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 15 Jan 2019 12:33:16 -0800 From: Gleb Smirnoff To: Ian Lepore Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm Message-ID: <20190115203316.GA18452@FreeBSD.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> <20190115200617.GZ18452@FreeBSD.org> <79ee763bb72a47f3e7888caf266174a62c23e532.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79ee763bb72a47f3e7888caf266174a62c23e532.camel@freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 8420A701A3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 20:33:19 -0000 On Tue, Jan 15, 2019 at 01:20:14PM -0700, Ian Lepore wrote: I> On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote: I> > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: I> > J> Why not #include counter.h in the relevant vm_machdep.c files I> > instead? I> > I> > This also is ugly :( Not sure more or less. Probably less, but I I> > urged to plug all possible compilation failures at a time. I> > I> > What is ugly is that most files just need counter_u64_t size, I> > and they don't use counter(9) KPI. I> > I> > The fact that vm_machdep or Linux KPI want to look into internal I> > type uma_zone_t is also ugly. I> > I> I> Isn't the usual fix for this problem to create a __counter_u64_t in I> sys/types.h and use it in places where including the full header file I> is undesirable for some reason? I'm inclined to this solution. Do you want to sign up as reviewer? :) -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Jan 15 21:04:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 874761496758; Tue, 15 Jan 2019 21:04:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 281EC716C1; Tue, 15 Jan 2019 21:04:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 6F47610AFCD; Tue, 15 Jan 2019 16:04:02 -0500 (EST) Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm To: Gleb Smirnoff , Ian Lepore Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> <20190115200617.GZ18452@FreeBSD.org> <79ee763bb72a47f3e7888caf266174a62c23e532.camel@freebsd.org> <20190115203316.GA18452@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 15 Jan 2019 13:03:48 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190115203316.GA18452@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 15 Jan 2019 16:04:03 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 281EC716C1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 21:04:04 -0000 On 1/15/19 12:33 PM, Gleb Smirnoff wrote: > On Tue, Jan 15, 2019 at 01:20:14PM -0700, Ian Lepore wrote: > I> On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote: > I> > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: > I> > J> Why not #include counter.h in the relevant vm_machdep.c files > I> > instead? > I> > > I> > This also is ugly :( Not sure more or less. Probably less, but I > I> > urged to plug all possible compilation failures at a time. > I> > > I> > What is ugly is that most files just need counter_u64_t size, > I> > and they don't use counter(9) KPI. > I> > > I> > The fact that vm_machdep or Linux KPI want to look into internal > I> > type uma_zone_t is also ugly. > I> > > I> > I> Isn't the usual fix for this problem to create a __counter_u64_t in > I> sys/types.h and use it in places where including the full header file > I> is undesirable for some reason? > > I'm inclined to this solution. Do you want to sign up as reviewer? :) I think normally we'd put the __counter_u64_t in sys/_types.h if we went that route. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Jan 15 21:06:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A68A8149691A; Tue, 15 Jan 2019 21:06:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C386718F4; Tue, 15 Jan 2019 21:06:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367D420593; Tue, 15 Jan 2019 21:06:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FL6x8P019402; Tue, 15 Jan 2019 21:06:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FL6xn7019401; Tue, 15 Jan 2019 21:06:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901152106.x0FL6xn7019401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 15 Jan 2019 21:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343060 - head/sys/dev/drm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/drm X-SVN-Commit-Revision: 343060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C386718F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 21:06:59 -0000 Author: gonzo Date: Tue Jan 15 21:06:58 2019 New Revision: 343060 URL: https://svnweb.freebsd.org/changeset/base/343060 Log: [drm] Fix off-by-one error when accessing driver-specific ioctl handlers array PR: 231513 Submitted by: Young_X Approved by: imp MFC after: 1 week Modified: head/sys/dev/drm/drm_drv.c Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Tue Jan 15 20:27:21 2019 (r343059) +++ head/sys/dev/drm/drm_drv.c Tue Jan 15 21:06:58 2019 (r343060) @@ -745,7 +745,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t d if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) { /* The array entries begin at DRM_COMMAND_BASE ioctl nr */ nr -= DRM_COMMAND_BASE; - if (nr > dev->driver->max_ioctl) { + if (nr >= dev->driver->max_ioctl) { DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n", nr, dev->driver->max_ioctl); return EINVAL; From owner-svn-src-head@freebsd.org Tue Jan 15 22:31:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40195149900D; Tue, 15 Jan 2019 22:31:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBAB67687D; Tue, 15 Jan 2019 22:31:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7A7214B5; Tue, 15 Jan 2019 22:31:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FMVsoB066978; Tue, 15 Jan 2019 22:31:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FMVsrs066977; Tue, 15 Jan 2019 22:31:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201901152231.x0FMVsrs066977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 15 Jan 2019 22:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343065 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBAB67687D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 22:31:55 -0000 Author: bz Date: Tue Jan 15 22:31:54 2019 New Revision: 343065 URL: https://svnweb.freebsd.org/changeset/base/343065 Log: With the sync from Dragonfly BSD in r318216 a bug slipped in (also still present upstream it seems). The tlv variable was changed to a pointer but the advancement of the data pointer was left as sizeof(tlv). While the sizeof the (now) pointer equals the sizeof 2 x uint32_t (size of the struct) on 64bit platforms, on 32bit platforms the size of the advancement of the data pointer was wrong leading to firmware load issues. Correctly advance the data pointer by the size of the structure and not by the size of a pointer. PR: 219683 Submitted by: waddlesplash gamil.com (Haiku) on irc MFC after: 1 week Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Jan 15 21:43:18 2019 (r343064) +++ head/sys/dev/iwm/if_iwm.c Tue Jan 15 22:31:54 2019 (r343065) @@ -626,7 +626,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } len -= roundup2(tlv_len, 4); - data += sizeof(tlv) + roundup2(tlv_len, 4); + data += sizeof(*tlv) + roundup2(tlv_len, 4); switch ((int)tlv_type) { case IWM_UCODE_TLV_PROBE_MAX_LEN: From owner-svn-src-head@freebsd.org Tue Jan 15 23:35:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B52149A8EF; Tue, 15 Jan 2019 23:35:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAA180A88; Tue, 15 Jan 2019 23:35:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B97921EF9; Tue, 15 Jan 2019 23:35:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FNZsjA001229; Tue, 15 Jan 2019 23:35:54 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FNZscL001228; Tue, 15 Jan 2019 23:35:54 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901152335.x0FNZscL001228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 15 Jan 2019 23:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343066 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 343066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AAA180A88 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 23:35:54 -0000 Author: sjg Date: Tue Jan 15 23:35:53 2019 New Revision: 343066 URL: https://svnweb.freebsd.org/changeset/base/343066 Log: Use .undef per variable Attempting to expand a variable to a list of vars to .undef does not actually work. Reviewed by: bdrewery Differential Revision: D17251 Modified: head/share/mk/dirdeps-options.mk Modified: head/share/mk/dirdeps-options.mk ============================================================================== --- head/share/mk/dirdeps-options.mk Tue Jan 15 22:31:54 2019 (r343065) +++ head/share/mk/dirdeps-options.mk Tue Jan 15 23:35:53 2019 (r343066) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: dirdeps-options.mk,v 1.8 2018/05/29 22:31:21 sjg Exp $ +# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $ # # @(#) Copyright (c) 2018, Simon J. Gerraty # @@ -54,7 +54,8 @@ DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U} DIRDEPS := ${DIRDEPS:O:u} # avoid cross contamination .for o in ${DIRDEPS_OPTIONS:tu} -.undef DIRDEPS.$o.yes DIRDEPS.$o.no +.undef DIRDEPS.$o.yes +.undef DIRDEPS.$o.no .endfor .else # whether options are enabled or not, From owner-svn-src-head@freebsd.org Tue Jan 15 23:37:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8372E149A9CB; Tue, 15 Jan 2019 23:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28DD380C6B; Tue, 15 Jan 2019 23:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14C0621F00; Tue, 15 Jan 2019 23:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FNbncc001347; Tue, 15 Jan 2019 23:37:49 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FNbnsJ001345; Tue, 15 Jan 2019 23:37:49 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201901152337.x0FNbnsJ001345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 15 Jan 2019 23:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343067 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 343067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28DD380C6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 15 Jan 2019 23:37:50 -0000 Author: sjg Date: Tue Jan 15 23:37:49 2019 New Revision: 343067 URL: https://svnweb.freebsd.org/changeset/base/343067 Log: Fix STAGE_DIR.* to handle indirect *DIR variables. bsd.{files,conf}.mk recently changed to allow *DIR to name a variable rather than a path. STAGE_DIR.* need to adapt. Reviewed by: bdrewery Differential Revision: D18847 Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Tue Jan 15 23:35:53 2019 (r343066) +++ head/share/mk/bsd.confs.mk Tue Jan 15 23:37:49 2019 (r343067) @@ -40,7 +40,6 @@ ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFDIR} STAGE_SETS+= ${group:C,[/*],_,g} -STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} . if defined(NO_ROOT) . if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} @@ -65,6 +64,7 @@ DIRS+= ${group}DIR _${group}DIR= ${group}DIR . endif +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}} . for cnf in ${${group}} ${group}OWN_${cnf}?= ${${group}OWN} @@ -119,7 +119,7 @@ INSTALL_COPY= -C STAGE_AS_SETS+= ${cnf:T} STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} # XXX {group}OWN,GRP,MODE -STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} +STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${_${group}DIR_${cnf}}} stage_as.${cnf:T}: ${cnf} realinstallconfig: installdirs-${_${group}DIR_${cnf}} _${group}INS_${cnf:T} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Tue Jan 15 23:35:53 2019 (r343066) +++ head/share/mk/bsd.files.mk Tue Jan 15 23:37:49 2019 (r343067) @@ -37,7 +37,6 @@ ${group}GRP= ${SHAREGRP} ${group}MODE?= ${SHAREMODE} ${group}DIR?= BINDIR STAGE_SETS+= ${group:C,[/*],_,g} -STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} @@ -57,6 +56,7 @@ DIRS+= ${group}DIR _${group}DIR= ${group}DIR .endif +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR}} .for file in ${${group}} ${group}OWN_${file}?= ${${group}OWN} @@ -100,7 +100,7 @@ ${group}NAME_${file}?= ${file:T} STAGE_AS_SETS+= ${file} STAGE_AS_${file}= ${${group}NAME_${file}} # XXX {group}OWN,GRP,MODE -STAGE_DIR.${file}= ${STAGE_OBJTOP}${${group}DIR_${file}} +STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}} stage_as.${file}: ${file} installfiles-${group}: _${group}INS1_${file} From owner-svn-src-head@freebsd.org Wed Jan 16 00:39:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E14CE149C2D3; Wed, 16 Jan 2019 00:39:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8050C82FC9; Wed, 16 Jan 2019 00:39:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6692D2293C; Wed, 16 Jan 2019 00:39:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G0dQAa032307; Wed, 16 Jan 2019 00:39:26 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G0dNFW032289; Wed, 16 Jan 2019 00:39:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201901160039.x0G0dNFW032289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 16 Jan 2019 00:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343068 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 343068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8050C82FC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 00:39:27 -0000 Author: araujo Date: Wed Jan 16 00:39:23 2019 New Revision: 343068 URL: https://svnweb.freebsd.org/changeset/base/343068 Log: Use capsicum_helpers(3) that allow us to simplify the code and its functions will return success when the kernel is built without support of the capability mode. It is important to note, that I'm taking a more conservative approach with these changes and it will be done in small steps. Reviewed by: jhb MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D18744 Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/dbgport.c head/usr.sbin/bhyve/gdb.c head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_passthru.c head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/bhyverun.c Wed Jan 16 00:39:23 2019 (r343068) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -949,15 +948,13 @@ do_open(const char *vmname) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); - if (cap_rights_limit(vm_get_device_fd(ctx), &rights) == -1 && - errno != ENOSYS) + if (caph_rights_limit(vm_get_device_fd(ctx), &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); vm_get_ioctls(&ncmds); cmds = vm_get_ioctls(NULL); if (cmds == NULL) errx(EX_OSERR, "out of memory"); - if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 && - errno != ENOSYS) + if (caph_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); free((cap_ioctl_t *)cmds); #endif Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/block_if.c Wed Jan 16 00:39:23 2019 (r343068) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -473,7 +476,7 @@ blockif_open(const char *optstr, const char *ident) if (ro) cap_rights_clear(&rights, CAP_FSYNC, CAP_WRITE); - if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(fd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif @@ -504,7 +507,7 @@ blockif_open(const char *optstr, const char *ident) psectsz = sbuf.st_blksize; #ifndef WITHOUT_CAPSICUM - if (cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/consport.c Wed Jan 16 00:39:23 2019 (r343068) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #endif #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -138,11 +141,9 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && - errno != ENOSYS) + if (caph_rights_limit(STDIN_FILENO, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && - errno != ENOSYS) + if (caph_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif ttyopen(); Modified: head/usr.sbin/bhyve/dbgport.c ============================================================================== --- head/usr.sbin/bhyve/dbgport.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/dbgport.c Wed Jan 16 00:39:23 2019 (r343068) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -167,7 +170,7 @@ init_dbgport(int sport) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(listen_fd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(listen_fd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/gdb.c Wed Jan 16 00:39:23 2019 (r343068) @@ -1252,9 +1252,9 @@ limit_gdb_socket(int s) cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE, CAP_SETSOCKOPT, CAP_IOCTL); - if (cap_rights_limit(s, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(s, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(s, ioctls, nitems(ioctls)) == -1 && errno != ENOSYS) + if (caph_ioctls_limit(s, ioctls, nitems(ioctls)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); } #endif Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/mevent.c Wed Jan 16 00:39:23 2019 (r343068) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -420,7 +423,7 @@ mevent_dispatch(void) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_KQUEUE); - if (cap_rights_limit(mfd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(mfd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif @@ -437,9 +440,9 @@ mevent_dispatch(void) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(mevent_pipefd[0], &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(mevent_pipefd[0], &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_rights_limit(mevent_pipefd[1], &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(mevent_pipefd[1], &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/pci_e82545.c Wed Jan 16 00:39:23 2019 (r343068) @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -2240,7 +2243,7 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->esc_tapfd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(sc->esc_tapfd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/pci_passthru.c Wed Jan 16 00:39:23 2019 (r343068) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -674,9 +677,9 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } #ifndef WITHOUT_CAPSICUM - if (cap_rights_limit(pcifd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(pcifd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(pcifd, pci_ioctls, nitems(pci_ioctls)) == -1 && errno != ENOSYS) + if (caph_ioctls_limit(pcifd, pci_ioctls, nitems(pci_ioctls)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif @@ -689,9 +692,9 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p } #ifndef WITHOUT_CAPSICUM - if (cap_rights_limit(iofd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(iofd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(iofd, io_ioctls, nitems(io_ioctls)) == -1 && errno != ENOSYS) + if (caph_ioctls_limit(iofd, io_ioctls, nitems(io_ioctls)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif @@ -706,7 +709,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *p #ifndef WITHOUT_CAPSICUM cap_rights_clear(&rights, CAP_IOCTL); cap_rights_set(&rights, CAP_MMAP_RW); - if (cap_rights_limit(memfd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(memfd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/pci_virtio_console.c Wed Jan 16 00:39:23 2019 (r343068) @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -328,7 +331,7 @@ pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const c #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(s, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(s, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/pci_virtio_net.c Wed Jan 16 00:39:23 2019 (r343068) @@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$"); #endif #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -779,7 +782,7 @@ pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char * #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->vsc_tapfd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(sc->vsc_tapfd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Wed Jan 16 00:39:23 2019 (r343068) @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -158,7 +161,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_READ); - if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(fd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/rfb.c Wed Jan 16 00:39:23 2019 (r343068) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -1024,7 +1027,7 @@ rfb_init(char *hostname, int port, int wait, char *pas #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); - if (cap_rights_limit(rc->sfd, &rights) == -1 && errno != ENOSYS) + if (caph_rights_limit(rc->sfd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Tue Jan 15 23:37:49 2019 (r343067) +++ head/usr.sbin/bhyve/uart_emul.c Wed Jan 16 00:39:23 2019 (r343068) @@ -684,14 +684,12 @@ uart_set_backend(struct uart_softc *sc, const char *op #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->tty.fd, &rights) == -1 && - errno != ENOSYS) + if (caph_rights_limit(sc->tty.fd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && - errno != ENOSYS) + if (caph_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); if (!uart_stdio) { - if (caph_limit_stdin() == -1 && errno != ENOSYS) + if (caph_limit_stdin() == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); } From owner-svn-src-head@freebsd.org Wed Jan 16 01:08:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D8FB149CF09; Wed, 16 Jan 2019 01:08:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C00A83E1E; Wed, 16 Jan 2019 01:08:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F028722E5B; Wed, 16 Jan 2019 01:08:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G18Z0W047885; Wed, 16 Jan 2019 01:08:35 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G18ZRn047882; Wed, 16 Jan 2019 01:08:35 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901160108.x0G18ZRn047882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 16 Jan 2019 01:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343069 - in head/sys: arm64/conf dts/arm/overlays dts/arm64/overlays modules/dtb/rpi X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: arm64/conf dts/arm/overlays dts/arm64/overlays modules/dtb/rpi X-SVN-Commit-Revision: 343069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C00A83E1E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 01:08:36 -0000 Author: gonzo Date: Wed Jan 16 01:08:34 2019 New Revision: 343069 URL: https://svnweb.freebsd.org/changeset/base/343069 Log: [rpi] Reorganize spigen(4) overlays for Raspberry Pi - Remove CS=2 entry from spigen-rpi2 since it didn't work - Add spigen-rpi3 overlay for Raspberry Pi 3 - Enable rpi overlay modules for GENERIC kernel on aarch64 PR: 233489 Submitted by: bobf@mrp3.com Reviewed by: db MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16088 Added: head/sys/dts/arm64/overlays/spigen-rpi3.dtso (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/dts/arm/overlays/spigen-rpi2.dtso head/sys/modules/dtb/rpi/Makefile Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Jan 16 00:39:23 2019 (r343068) +++ head/sys/arm64/conf/GENERIC Wed Jan 16 01:08:34 2019 (r343069) @@ -296,4 +296,4 @@ options FDT device acpi # DTBs -makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi" Modified: head/sys/dts/arm/overlays/spigen-rpi2.dtso ============================================================================== --- head/sys/dts/arm/overlays/spigen-rpi2.dtso Wed Jan 16 00:39:23 2019 (r343068) +++ head/sys/dts/arm/overlays/spigen-rpi2.dtso Wed Jan 16 01:08:34 2019 (r343069) @@ -12,6 +12,7 @@ spigen0: spigen0 { compatible = "freebsd,spigen"; reg = <0>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; spigen1: spigen1 { @@ -20,20 +21,10 @@ spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; - spigen2: spigen2 { - compatible = "freebsd,spigen"; - reg = <2>; - spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ - status = "okay"; - }; }; &{/soc/gpio@7e200000/spi0_cs_pins} { - brcm,pins = <8 7 16>; + brcm,pins = <8 7>; brcm,function = <4>; /* ALT0 */ -}; - -&{/soc/gpio@7e200000/spi0_gpio7} { - brcm,pins = <7 8 16 9 10 11>; }; Added: head/sys/dts/arm64/overlays/spigen-rpi3.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/spigen-rpi3.dtso Wed Jan 16 01:08:34 2019 (r343069) @@ -0,0 +1,30 @@ +/* $FreeBSD$ */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2837"; +}; + +&{/soc/spi@7e204000} { + status = "okay"; + spigen0: spigen0 { + compatible = "freebsd,spigen"; + reg = <0>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ + status = "okay"; + }; + spigen1: spigen1 { + compatible = "freebsd,spigen"; + reg = <1>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ + status = "okay"; + }; +}; + +&{/soc/gpio@7e200000/spi0_cs_pins} { + brcm,pins = <8 7>; + brcm,function = <4>; /* ALT0 */ +}; + Modified: head/sys/modules/dtb/rpi/Makefile ============================================================================== --- head/sys/modules/dtb/rpi/Makefile Wed Jan 16 00:39:23 2019 (r343068) +++ head/sys/modules/dtb/rpi/Makefile Wed Jan 16 01:08:34 2019 (r343069) @@ -1,7 +1,12 @@ # $FreeBSD$ # DTS files for the Raspberry Pi-B +.if ${MACHINE_ARCH:Marmv[67]*} != "" DTSO= \ spigen-rpi-b.dtso \ - spigen-rpi2.dtso \ + spigen-rpi2.dtso +.elif ${MACHINE_ARCH} == "aarch64" +DTSO= \ + spigen-rpi3.dtso +.endif .include From owner-svn-src-head@freebsd.org Wed Jan 16 02:05:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE05E149E96E; Wed, 16 Jan 2019 02:05:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 762A085FC3; Wed, 16 Jan 2019 02:05:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50BF0238A3; Wed, 16 Jan 2019 02:05:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G25h9L079389; Wed, 16 Jan 2019 02:05:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G25hkr079388; Wed, 16 Jan 2019 02:05:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901160205.x0G25hkr079388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 16 Jan 2019 02:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343073 - head/contrib/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter X-SVN-Commit-Revision: 343073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 762A085FC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 02:05:44 -0000 Author: cy Date: Wed Jan 16 02:05:42 2019 New Revision: 343073 URL: https://svnweb.freebsd.org/changeset/base/343073 Log: Remove an IRIX-only source file. MFC after: 1 week Deleted: head/contrib/ipfilter/mli_ipl.c From owner-svn-src-head@freebsd.org Wed Jan 16 02:13:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486F5149EC03; Wed, 16 Jan 2019 02:13:24 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D816386417; Wed, 16 Jan 2019 02:13:22 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE12D23A5B; Wed, 16 Jan 2019 02:13:22 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G2DML6084507; Wed, 16 Jan 2019 02:13:22 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G2DMtW084504; Wed, 16 Jan 2019 02:13:22 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201901160213.x0G2DMtW084504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 16 Jan 2019 02:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343074 - in head/sys: contrib/ena-com dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: contrib/ena-com dev/ena X-SVN-Commit-Revision: 343074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D816386417 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 02:13:24 -0000 Author: mw Date: Wed Jan 16 02:13:21 2019 New Revision: 343074 URL: https://svnweb.freebsd.org/changeset/base/343074 Log: Suppress excessive error prints in ENA TX hotpath In FreeBSD, this is normal situation that the Tx ring is being full. In hat case, the packet is put back into drbr and the next attempt to send it is taken after the cleanup. Too much logs like this can cause system instability and even cause the device reset (because keep alive or cleanup could be missed). To fix that, the log level of this message is changed to debug. Upon this change upgrade the driver version to v0.8.2. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/contrib/ena-com/ena_eth_com.c head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Directory Properties: head/sys/contrib/ena-com/ (props changed) Modified: head/sys/contrib/ena-com/ena_eth_com.c ============================================================================== --- head/sys/contrib/ena-com/ena_eth_com.c Wed Jan 16 02:05:42 2019 (r343073) +++ head/sys/contrib/ena-com/ena_eth_com.c Wed Jan 16 02:13:21 2019 (r343074) @@ -386,7 +386,7 @@ int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, /* num_bufs +1 for potential meta desc */ if (!ena_com_sq_have_enough_space(io_sq, num_bufs + 1)) { - ena_trc_err("Not enough space in the tx queue\n"); + ena_trc_dbg("Not enough space in the tx queue\n"); return ENA_COM_NO_MEM; } Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Wed Jan 16 02:05:42 2019 (r343073) +++ head/sys/dev/ena/ena.c Wed Jan 16 02:13:21 2019 (r343074) @@ -2813,7 +2813,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { - device_printf(adapter->pdev, "failed to prepare tx bufs\n"); + ena_trace(ENA_DBG | ENA_TXPTH, "failed to prepare tx bufs\n"); counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; } Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Wed Jan 16 02:05:42 2019 (r343073) +++ head/sys/dev/ena/ena.h Wed Jan 16 02:13:21 2019 (r343074) @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 0 #define DRV_MODULE_VER_MINOR 8 -#define DRV_MODULE_VER_SUBMINOR 1 +#define DRV_MODULE_VER_SUBMINOR 2 #define DRV_MODULE_NAME "ena" From owner-svn-src-head@freebsd.org Wed Jan 16 02:19:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 291C0149ECDE; Wed, 16 Jan 2019 02:19:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9969A865B3; Wed, 16 Jan 2019 02:19:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E2323A5D; Wed, 16 Jan 2019 02:19:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G2J5X8084789; Wed, 16 Jan 2019 02:19:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G2J4WZ084786; Wed, 16 Jan 2019 02:19:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901160219.x0G2J4WZ084786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 16 Jan 2019 02:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343075 - in head/sys: amd64/vmm x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/vmm x86/x86 X-SVN-Commit-Revision: 343075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9969A865B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 02:19:06 -0000 Author: cem Date: Wed Jan 16 02:19:04 2019 New Revision: 343075 URL: https://svnweb.freebsd.org/changeset/base/343075 Log: vmm(4): Take steps towards multicore bhyve AMD support vmm's CPUID emulation presented Intel topology information to the guest, but disabled AMD topology information and in some cases passed through garbage. I.e., CPUID leaves 0x8000_001[de] were passed through to the guest, but guest CPUs can migrate between host threads, so the information presented was not consistent. This could easily be observed with 'cpucontrol -i 0xfoo /dev/cpuctl0'. Slightly improve this situation by enabling the AMD topology feature flag and presenting at least the CPUID fields used by FreeBSD itself to probe topology on more modern AMD64 hardware (Family 15h+). Older stuff is probably less interesting. I have not been able to empirically confirm it is sufficient, but it should not regress anything either. Reviewed by: araujo (previous version) Relnotes: sure Modified: head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Wed Jan 16 02:13:21 2019 (r343074) +++ head/sys/amd64/vmm/x86.c Wed Jan 16 02:19:04 2019 (r343075) @@ -136,18 +136,23 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, case CPUID_8000_0008: cpuid_count(*eax, *ecx, regs); if (vmm_is_amd()) { + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); /* - * XXX this might appear silly because AMD - * cpus don't have threads. + * Here, width is ApicIdCoreIdSize, present on + * at least Family 15h and newer. It + * represents the "number of bits in the + * initial apicid that indicate thread id + * within a package." * - * However this matches the logical cpus as - * advertised by leaf 0x1 and will work even - * if threads is set incorrectly on an AMD host. + * Our topo_probe_amd() uses it for + * pkg_id_shift and other OSes may rely on it. */ - vm_get_topology(vm, &sockets, &cores, &threads, - &maxcpus); - logical_cpus = threads * cores; - regs[2] = logical_cpus - 1; + width = MIN(0xF, log2(threads * cores)); + if (width < 0x4) + width = 0; + logical_cpus = MIN(0xFF, threads * cores - 1); + regs[2] = (width << AMDID_COREID_SIZE_SHIFT) | logical_cpus; } break; @@ -155,9 +160,9 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, cpuid_count(*eax, *ecx, regs); /* - * Hide SVM and Topology Extension features from guest. + * Hide SVM from guest. */ - regs[2] &= ~(AMDID2_SVM | AMDID2_TOPOLOGY); + regs[2] &= ~AMDID2_SVM; /* * Don't advertise extended performance counter MSRs @@ -219,6 +224,68 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, regs[3] |= AMDPM_TSC_INVARIANT; break; + case CPUID_8000_001D: + /* AMD Cache topology, like 0000_0004 for Intel. */ + if (!vmm_is_amd()) + goto default_leaf; + + /* + * Similar to Intel, generate a ficticious cache + * topology for the guest with L3 shared by the + * package, and L1 and L2 local to a core. + */ + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + switch (*ecx) { + case 0: + logical_cpus = threads; + level = 1; + func = 1; /* data cache */ + break; + case 1: + logical_cpus = threads; + level = 2; + func = 3; /* unified cache */ + break; + case 2: + logical_cpus = threads * cores; + level = 3; + func = 3; /* unified cache */ + break; + default: + logical_cpus = 0; + level = 0; + func = 0; + break; + } + + logical_cpus = MIN(0xfff, logical_cpus - 1); + regs[0] = (logical_cpus << 14) | (1 << 8) | + (level << 5) | func; + regs[1] = (func > 0) ? (CACHE_LINE_SIZE - 1) : 0; + regs[2] = 0; + regs[3] = 0; + break; + + case CPUID_8000_001E: + /* AMD Family 16h+ additional identifiers */ + if (!vmm_is_amd() || CPUID_TO_FAMILY(cpu_id) < 0x16) + goto default_leaf; + + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + regs[0] = vcpu_id; + threads = MIN(0xFF, threads - 1); + regs[1] = (threads << 8) | + (vcpu_id >> log2(threads + 1)); + /* + * XXX Bhyve topology cannot yet represent >1 node per + * processor. + */ + regs[2] = 0; + regs[3] = 0; + break; + case CPUID_0000_0001: do_cpuid(1, regs); @@ -359,7 +426,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, CPUID_STDEXT_AVX512F | CPUID_STDEXT_AVX512PF | CPUID_STDEXT_AVX512ER | - CPUID_STDEXT_AVX512CD); + CPUID_STDEXT_AVX512CD | CPUID_STDEXT_SHA); regs[2] = 0; regs[3] = 0; @@ -391,35 +458,42 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, case CPUID_0000_000B: /* - * Processor topology enumeration + * Intel processor topology enumeration */ - vm_get_topology(vm, &sockets, &cores, &threads, - &maxcpus); - if (*ecx == 0) { - logical_cpus = threads; - width = log2(logical_cpus); - level = CPUID_TYPE_SMT; - x2apic_id = vcpu_id; - } + if (vmm_is_intel()) { + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + if (*ecx == 0) { + logical_cpus = threads; + width = log2(logical_cpus); + level = CPUID_TYPE_SMT; + x2apic_id = vcpu_id; + } - if (*ecx == 1) { - logical_cpus = threads * cores; - width = log2(logical_cpus); - level = CPUID_TYPE_CORE; - x2apic_id = vcpu_id; - } + if (*ecx == 1) { + logical_cpus = threads * cores; + width = log2(logical_cpus); + level = CPUID_TYPE_CORE; + x2apic_id = vcpu_id; + } - if (!cpuid_leaf_b || *ecx >= 2) { - width = 0; - logical_cpus = 0; - level = 0; - x2apic_id = 0; - } + if (!cpuid_leaf_b || *ecx >= 2) { + width = 0; + logical_cpus = 0; + level = 0; + x2apic_id = 0; + } - regs[0] = width & 0x1f; - regs[1] = logical_cpus & 0xffff; - regs[2] = (level << 8) | (*ecx & 0xff); - regs[3] = x2apic_id; + regs[0] = width & 0x1f; + regs[1] = logical_cpus & 0xffff; + regs[2] = (level << 8) | (*ecx & 0xff); + regs[3] = x2apic_id; + } else { + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + } break; case CPUID_0000_000D: @@ -481,6 +555,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; default: +default_leaf: /* * The leaf value has already been clamped so * simply pass this through, keeping count of Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Wed Jan 16 02:13:21 2019 (r343074) +++ head/sys/amd64/vmm/x86.h Wed Jan 16 02:19:04 2019 (r343075) @@ -49,6 +49,8 @@ #define CPUID_8000_0006 (0x80000006) #define CPUID_8000_0007 (0x80000007) #define CPUID_8000_0008 (0x80000008) +#define CPUID_8000_001D (0x8000001D) +#define CPUID_8000_001E (0x8000001E) /* * CPUID instruction Fn0000_0001: Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Wed Jan 16 02:13:21 2019 (r343074) +++ head/sys/x86/x86/mp_x86.c Wed Jan 16 02:19:04 2019 (r343075) @@ -235,6 +235,7 @@ add_deterministic_cache(int type, int level, int share * - BKDG For AMD Family 10h Processors (Publication # 31116) * - BKDG For AMD Family 15h Models 00h-0Fh Processors (Publication # 42301) * - BKDG For AMD Family 16h Models 00h-0Fh Processors (Publication # 48751) + * - PPR For AMD Family 17h Models 00h-0Fh Processors (Publication # 54945) */ static void topo_probe_amd(void) From owner-svn-src-head@freebsd.org Wed Jan 16 03:46:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D77414A1259; Wed, 16 Jan 2019 03:46:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93E38945B; Wed, 16 Jan 2019 03:46:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99F8924A05; Wed, 16 Jan 2019 03:46:27 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G3kR4g032139; Wed, 16 Jan 2019 03:46:27 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G3kRCS032138; Wed, 16 Jan 2019 03:46:27 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201901160346.x0G3kRCS032138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 16 Jan 2019 03:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343077 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 343077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A93E38945B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 03:46:28 -0000 Author: araujo Date: Wed Jan 16 03:46:27 2019 New Revision: 343077 URL: https://svnweb.freebsd.org/changeset/base/343077 Log: Fix broken uart on Win2016 guest. Obtained from: Joyent (commit/2bf1a940afbd1382faff159e7c93c72779ca10f4) MFC after: 3 weeks. Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Wed Jan 16 03:07:32 2019 (r343076) +++ head/usr.sbin/bhyve/uart_emul.c Wed Jan 16 03:46:27 2019 (r343077) @@ -431,6 +431,13 @@ uart_write(struct uart_softc *sc, int offset, uint8_t sc->thre_int_pending = true; break; case REG_IER: + /* Assert an interrupt if re-enabling the THRE intr, since we + * always report THRE as active in the status register. + */ + if ((sc->ier & IER_ETXRDY) == 0 && + (value & IER_ETXRDY) != 0) { + sc->thre_int_pending = true; + } /* * Apply mask so that bits 4-7 are 0 * Also enables bits 0-3 only if they're 1 From owner-svn-src-head@freebsd.org Wed Jan 16 03:52:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C1414A15A6; Wed, 16 Jan 2019 03:52:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25AD88995E; Wed, 16 Jan 2019 03:52:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1409524BBE; Wed, 16 Jan 2019 03:52:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G3qhgb037018; Wed, 16 Jan 2019 03:52:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G3qh2Y037017; Wed, 16 Jan 2019 03:52:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901160352.x0G3qh2Y037017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 16 Jan 2019 03:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343078 - head/sys/powerpc/fpu X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/fpu X-SVN-Commit-Revision: 343078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25AD88995E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 03:52:44 -0000 Author: jhibbits Date: Wed Jan 16 03:52:43 2019 New Revision: 343078 URL: https://svnweb.freebsd.org/changeset/base/343078 Log: powerpc: Fix FPU fsqrt emulation special case results If fsqrts is emulated with +INF as its argument, the 0 return value causes a NULL pointer dereference, panicking the system. Follow the PowerISA and return +INF with no FP exception. MFC after: 1 week Modified: head/sys/powerpc/fpu/fpu_sqrt.c Modified: head/sys/powerpc/fpu/fpu_sqrt.c ============================================================================== --- head/sys/powerpc/fpu/fpu_sqrt.c Wed Jan 16 03:46:27 2019 (r343077) +++ head/sys/powerpc/fpu/fpu_sqrt.c Wed Jan 16 03:52:43 2019 (r343078) @@ -226,12 +226,12 @@ fpu_sqrt(struct fpemu *fe) return (x); } if (x->fp_sign) { + fe->fe_cx |= FPSCR_VXSQRT; return (fpu_newnan(fe)); } if (ISINF(x)) { - fe->fe_cx |= FPSCR_VXSQRT; - DUMPFPN(FPE_REG, 0); - return (0); + DUMPFPN(FPE_REG, x); + return (x); } /* From owner-svn-src-head@freebsd.org Wed Jan 16 04:02:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB9514A1914; Wed, 16 Jan 2019 04:02:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 611A389FCA; Wed, 16 Jan 2019 04:02:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 559E224C54; Wed, 16 Jan 2019 04:02:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G429Vv041352; Wed, 16 Jan 2019 04:02:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G429dt041351; Wed, 16 Jan 2019 04:02:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901160402.x0G429dt041351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Jan 2019 04:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343080 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 611A389FCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 04:02:09 -0000 Author: glebius Date: Wed Jan 16 04:02:08 2019 New Revision: 343080 URL: https://svnweb.freebsd.org/changeset/base/343080 Log: Whitespace. Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Jan 16 04:01:30 2019 (r343079) +++ head/sys/vm/uma_int.h Wed Jan 16 04:02:08 2019 (r343080) @@ -365,7 +365,7 @@ struct uma_zone { uint16_t uz_count_min; /* Minimal amount of items in bucket */ /* Offset 256, stats. */ - counter_u64_t uz_allocs; /* Total number of allocations */ + counter_u64_t uz_allocs; /* Total number of allocations */ counter_u64_t uz_frees; /* Total number of frees */ counter_u64_t uz_fails; /* Total number of alloc failures */ uint64_t uz_sleeps; /* Total number of alloc sleeps */ From owner-svn-src-head@freebsd.org Wed Jan 16 05:09:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9987C14A32C2; Wed, 16 Jan 2019 05:09:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C37E8C171; Wed, 16 Jan 2019 05:09:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A3AF25786; Wed, 16 Jan 2019 05:09:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G59U4P074253; Wed, 16 Jan 2019 05:09:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G59U1h074252; Wed, 16 Jan 2019 05:09:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901160509.x0G59U1h074252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Jan 2019 05:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343081 - head/contrib/netbsd-tests/kernel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/contrib/netbsd-tests/kernel X-SVN-Commit-Revision: 343081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C37E8C171 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 05:09:30 -0000 Author: kib Date: Wed Jan 16 05:09:29 2019 New Revision: 343081 URL: https://svnweb.freebsd.org/changeset/base/343081 Log: Trim spaces at the end of lines. Reviewed by: markj, ngie Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18837 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 16 04:02:08 2019 (r343080) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 16 05:09:29 2019 (r343081) @@ -840,9 +840,9 @@ sharer(void) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, msg); - ATF_TP_ADD_TC(tp, sem); - ATF_TP_ADD_TC(tp, shm); + ATF_TP_ADD_TC(tp, msg); + ATF_TP_ADD_TC(tp, sem); + ATF_TP_ADD_TC(tp, shm); return atf_no_error(); } From owner-svn-src-head@freebsd.org Wed Jan 16 05:16:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E0F14A3598; Wed, 16 Jan 2019 05:15:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 813A18C6C9; Wed, 16 Jan 2019 05:15:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 741DA25967; Wed, 16 Jan 2019 05:15:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G5FxnF079447; Wed, 16 Jan 2019 05:15:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G5FwqA079441; Wed, 16 Jan 2019 05:15:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901160515.x0G5FwqA079441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Jan 2019 05:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343082 - in head: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: contrib/netbsd-tests/kernel lib/libc/sys sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 343082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 813A18C6C9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 05:16:00 -0000 Author: kib Date: Wed Jan 16 05:15:57 2019 New Revision: 343082 URL: https://svnweb.freebsd.org/changeset/base/343082 Log: Implement shmat(2) flag SHM_REMAP. Based on the description in Linux man page. Reviewed by: markj, ngie (previous version) Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18837 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c head/lib/libc/sys/shmat.2 head/sys/kern/sysv_shm.c head/sys/sys/shm.h head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 16 05:09:29 2019 (r343081) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Wed Jan 16 05:15:57 2019 (r343082) @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -772,19 +773,27 @@ ATF_TC_BODY(shm, tc) atf_tc_fail("sender: received unexpected signal"); } -ATF_TC_CLEANUP(shm, tc) +static void +shmid_cleanup(const char *name) { - int sender_shmid; + int shmid; /* * Remove the shared memory area if it exists. */ - sender_shmid = read_int("sender_shmid"); - if (sender_shmid != -1) - if (shmctl(sender_shmid, IPC_RMID, NULL) == -1) + shmid = read_int(name); + if (shmid != -1) { + if (shmctl(shmid, IPC_RMID, NULL) == -1) err(1, "shmctl IPC_RMID"); + } } +ATF_TC_CLEANUP(shm, tc) +{ + + shmid_cleanup("sender_shmid"); +} + void print_shmid_ds(struct shmid_ds *sp, mode_t mode) { @@ -837,12 +846,53 @@ sharer(void) exit(0); } +#ifdef SHM_REMAP +ATF_TC_WITH_CLEANUP(shm_remap); +ATF_TC_HEAD(shm_remap, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks SHM_REMAP"); +} + +ATF_TC_BODY(shm_remap, tc) +{ + char *shm_buf; + int shmid_remap; + + pgsize = sysconf(_SC_PAGESIZE); + + shmkey = get_ftok(4160); + ATF_REQUIRE_MSG(shmkey != (key_t)-1, "get_ftok failed"); + + ATF_REQUIRE_MSG((shmid_remap = shmget(shmkey, pgsize, + IPC_CREAT | 0640)) != -1, "shmget: %d", errno); + write_int("shmid_remap", shmid_remap); + + ATF_REQUIRE_MSG((shm_buf = mmap(NULL, pgsize, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0)) != MAP_FAILED, "mmap: %d", errno); + + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, 0) == (void *)-1, + "shmat without MAP_REMAP succeeded"); + ATF_REQUIRE_MSG(shmat(shmid_remap, shm_buf, SHM_REMAP) == shm_buf, + "shmat(SHM_REMAP): %d", errno); +} + +ATF_TC_CLEANUP(shm_remap, tc) +{ + + shmid_cleanup("shmid_remap"); +} +#endif /* SHM_REMAP */ + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, msg); ATF_TP_ADD_TC(tp, sem); ATF_TP_ADD_TC(tp, shm); +#ifdef SHM_REMAP + ATF_TP_ADD_TC(tp, shm_remap); +#endif return atf_no_error(); } Modified: head/lib/libc/sys/shmat.2 ============================================================================== --- head/lib/libc/sys/shmat.2 Wed Jan 16 05:09:29 2019 (r343081) +++ head/lib/libc/sys/shmat.2 Wed Jan 16 05:15:57 2019 (r343082) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2018 +.Dd January 14, 2019 .Dt SHMAT 2 .Os .Sh NAME @@ -64,17 +64,38 @@ kernel. .It If .Fa addr -is nonzero and SHM_RND is not specified in +is nonzero and +.Va SHM_RND +is not specified in .Fa flag , the segment is attached the specified address. .It If .Fa addr -is specified and SHM_RND is specified, +is specified and +.Va SHM_RND +is specified, .Fa addr is rounded down to the nearest multiple of SHMLBA. .El .Pp +If the +.Va SHM_REMAP +flag is specified and the passed +.Fa addr +is not +.Dv NULL , +any existing mappings in the virtual addresses range are +cleared before the segment is attached. +If the flag is not specified, +.Fa addr +is not +.Dv NULL , +and the virtual address range contains +some pre-existing mappings, the +.Fn shmat +call fails. +.Pp The .Fn shmdt system call @@ -104,6 +125,14 @@ The .Fa addr argument was not an acceptable address. +.It Bq Er ENOMEM +The specified +.Fa addr +cannot be used for mapping, for instance due to the amount of available +space being smaller than the segment size, +or because pre-existing mappings are in the range and no +.Va SHM_REMAP +flag was provided. .It Bq Er EMFILE Failed to attach the shared memory segment because the per-process .Va kern.ipc.shmseg Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Wed Jan 16 05:09:29 2019 (r343081) +++ head/sys/kern/sysv_shm.c Wed Jan 16 05:15:57 2019 (r343082) @@ -388,7 +388,7 @@ kern_shmat_locked(struct thread *td, int shmid, const vm_offset_t attach_va; vm_prot_t prot; vm_size_t size; - int error, i, rv; + int cow, error, find_space, i, rv; AUDIT_ARG_SVIPC_ID(shmid); AUDIT_ARG_VALUE(shmflg); @@ -427,6 +427,7 @@ kern_shmat_locked(struct thread *td, int shmid, const return (EMFILE); size = round_page(shmseg->u.shm_segsz); prot = VM_PROT_READ; + cow = MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL; if ((shmflg & SHM_RDONLY) == 0) prot |= VM_PROT_WRITE; if (shmaddr != NULL) { @@ -436,6 +437,9 @@ kern_shmat_locked(struct thread *td, int shmid, const attach_va = (vm_offset_t)shmaddr; else return (EINVAL); + if ((shmflg & SHM_REMAP) != 0) + cow |= MAP_REMAP; + find_space = VMFS_NO_SPACE; } else { /* * This is just a hint to vm_map_find() about where to @@ -443,12 +447,12 @@ kern_shmat_locked(struct thread *td, int shmid, const */ attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr + lim_max(td, RLIMIT_DATA)); + find_space = VMFS_OPTIMAL_SPACE; } vm_object_reference(shmseg->object); rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va, - size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE, - prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL); + size, 0, find_space, prot, prot, cow); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg->object); return (ENOMEM); Modified: head/sys/sys/shm.h ============================================================================== --- head/sys/sys/shm.h Wed Jan 16 05:09:29 2019 (r343081) +++ head/sys/sys/shm.h Wed Jan 16 05:15:57 2019 (r343082) @@ -52,6 +52,7 @@ #define SHM_RDONLY 010000 /* Attach read-only (else read-write) */ #define SHM_RND 020000 /* Round attach address to SHMLBA */ +#define SHM_REMAP 030000 /* Unmap before mapping */ #define SHMLBA PAGE_SIZE /* Segment low boundary address multiple */ /* "official" access mode definitions; somewhat braindead since you have Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jan 16 05:09:29 2019 (r343081) +++ head/sys/vm/vm_map.c Wed Jan 16 05:15:57 2019 (r343082) @@ -1565,6 +1565,8 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || object == NULL, ("vm_map_find: non-NULL backing object for stack")); + MPASS((cow & MAP_REMAP) == 0 || (find_space == VMFS_NO_SPACE && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || (object->flags & OBJ_COLORED) == 0)) find_space = VMFS_ANY_SPACE; @@ -1595,6 +1597,14 @@ again: } goto done; } + } else if ((cow & MAP_REMAP) != 0) { + if (*addr < vm_map_min(map) || + *addr + length > vm_map_max(map) || + *addr + length <= length) { + rv = KERN_INVALID_ADDRESS; + goto done; + } + vm_map_delete(map, *addr, *addr + length); } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Wed Jan 16 05:09:29 2019 (r343081) +++ head/sys/vm/vm_map.h Wed Jan 16 05:15:57 2019 (r343082) @@ -342,6 +342,7 @@ long vmspace_resident_count(struct vmspace *vmspace); #define MAP_DISABLE_COREDUMP 0x0100 #define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ #define MAP_VN_WRITECOUNT 0x0400 +#define MAP_REMAP 0x0800 #define MAP_STACK_GROWS_DOWN 0x1000 #define MAP_STACK_GROWS_UP 0x2000 #define MAP_ACC_CHARGED 0x4000 From owner-svn-src-head@freebsd.org Wed Jan 16 05:44:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F02814A3DA4; Wed, 16 Jan 2019 05:44:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43CB8D9BE; Wed, 16 Jan 2019 05:44:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95FB725E69; Wed, 16 Jan 2019 05:44:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G5iE3X095382; Wed, 16 Jan 2019 05:44:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G5iErW095381; Wed, 16 Jan 2019 05:44:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901160544.x0G5iErW095381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Jan 2019 05:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343085 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C43CB8D9BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 05:44:15 -0000 Author: kib Date: Wed Jan 16 05:44:14 2019 New Revision: 343085 URL: https://svnweb.freebsd.org/changeset/base/343085 Log: Improve iflib busdma(9) KPI use. - Specify BUS_DMA_NOWAIT for bus_dmamap_load() on rx refill, since callbacks are not supposed to be used. - Match tso/non-tso tags to corresponding tx map operations. Create separate tso maps for tx descriptors. In particular, do not use non-tso tag to load, unload, or destroy a map created with tso tag. - Add missed bus_dmamap_sync() calls. Submitted by: marius. Reported and tested by: pho Reviewed by: marius Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jan 16 05:17:27 2019 (r343084) +++ head/sys/net/iflib.c Wed Jan 16 05:44:14 2019 (r343085) @@ -282,6 +282,7 @@ typedef struct iflib_sw_rx_desc_array { typedef struct iflib_sw_tx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; @@ -1491,6 +1492,8 @@ iflib_fast_intr_rxtx(void *arg) ctx = rxq->ifr_ctx; + bus_dmamap_sync(rxq->ifr_ifdi->idi_tag, rxq->ifr_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if (!ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) { IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); continue; @@ -1583,6 +1586,7 @@ iflib_txsd_alloc(iflib_txq_t txq) device_t dev = ctx->ifc_dev; bus_size_t tsomaxsize; int err, nsegments, ntsosegments; + bool tso; nsegments = scctx->isc_tx_nsegments; ntsosegments = scctx->isc_tx_tso_segments_max; @@ -1617,8 +1621,8 @@ iflib_txsd_alloc(iflib_txq_t txq) (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } - if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) && - (err = bus_dma_tag_create(bus_get_dma_tag(dev), + tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0; + if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1631,7 +1635,6 @@ iflib_txsd_alloc(iflib_txq_t txq) NULL, /* lockfuncarg */ &txq->ift_tso_desc_tag))) { device_printf(dev,"Unable to allocate TX TSO DMA tag: %d\n", err); - goto fail; } if (!(txq->ift_sds.ifsd_m = @@ -1643,19 +1646,38 @@ iflib_txsd_alloc(iflib_txq_t txq) } /* Create the descriptor buffer dma maps */ - if (!(txq->ift_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + if ((txq->ift_sds.ifsd_map = (bus_dmamap_t *)malloc( + sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "Unable to allocate tx_buffer map memory\n"); err = ENOMEM; goto fail; } + if (tso && (txq->ift_sds.ifsd_tso_map = (bus_dmamap_t *)malloc( + sizeof(bus_dmamap_t) * scctx->isc_ntxd[txq->ift_br_offset], + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { + device_printf(dev, "Unable to allocate TSO tx_buffer " + "map memory\n"); + err = ENOMEM; + goto fail; + } + for (int i = 0; i < scctx->isc_ntxd[txq->ift_br_offset]; i++) { - err = bus_dmamap_create(txq->ift_desc_tag, 0, &txq->ift_sds.ifsd_map[i]); + err = bus_dmamap_create(txq->ift_desc_tag, 0, + &txq->ift_sds.ifsd_map[i]); if (err != 0) { device_printf(dev, "Unable to create TX DMA map\n"); goto fail; } + if (!tso) + continue; + err = bus_dmamap_create(txq->ift_tso_desc_tag, 0, + &txq->ift_sds.ifsd_tso_map[i]); + if (err != 0) { + device_printf(dev, "Unable to create TSO TX DMA map\n"); + goto fail; + } } return (0); fail: @@ -1673,10 +1695,22 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int if (txq->ift_sds.ifsd_map != NULL) map = txq->ift_sds.ifsd_map[i]; if (map != NULL) { + bus_dmamap_sync(txq->ift_desc_tag, map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txq->ift_desc_tag, map); bus_dmamap_destroy(txq->ift_desc_tag, map); txq->ift_sds.ifsd_map[i] = NULL; } + + map = NULL; + if (txq->ift_sds.ifsd_tso_map != NULL) + map = txq->ift_sds.ifsd_tso_map[i]; + if (map != NULL) { + bus_dmamap_sync(txq->ift_tso_desc_tag, map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, map); + bus_dmamap_destroy(txq->ift_tso_desc_tag, map); + txq->ift_sds.ifsd_tso_map[i] = NULL; + } } static void @@ -1690,6 +1724,10 @@ iflib_txq_destroy(iflib_txq_t txq) free(txq->ift_sds.ifsd_map, M_IFLIB); txq->ift_sds.ifsd_map = NULL; } + if (txq->ift_sds.ifsd_tso_map != NULL) { + free(txq->ift_sds.ifsd_tso_map, M_IFLIB); + txq->ift_sds.ifsd_tso_map = NULL; + } if (txq->ift_sds.ifsd_m != NULL) { free(txq->ift_sds.ifsd_m, M_IFLIB); txq->ift_sds.ifsd_m = NULL; @@ -1715,11 +1753,15 @@ iflib_txsd_free(if_ctx_t ctx, iflib_txq_t txq, int i) if (txq->ift_sds.ifsd_map != NULL) { bus_dmamap_sync(txq->ift_desc_tag, - txq->ift_sds.ifsd_map[i], - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(txq->ift_desc_tag, - txq->ift_sds.ifsd_map[i]); + txq->ift_sds.ifsd_map[i], BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_desc_tag, txq->ift_sds.ifsd_map[i]); } + if (txq->ift_sds.ifsd_tso_map != NULL) { + bus_dmamap_sync(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[i], BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[i]); + } m_free(*mp); DBG_COUNTER_INC(tx_frees); *mp = NULL; @@ -1926,10 +1968,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun cb_arg.error = 0; MPASS(sd_map != NULL); err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[frag_idx], - cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, 0); - bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); - + cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, + BUS_DMA_NOWAIT); if (err != 0 || cb_arg.error) { /* * !zone_pack ? @@ -1939,6 +1979,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun break; } + bus_dmamap_sync(fl->ifl_desc_tag, sd_map[frag_idx], + BUS_DMASYNC_PREREAD); sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; sd_cl[frag_idx] = cl; #if MEMORY_LOGGING @@ -2030,6 +2072,7 @@ static void iflib_fl_bufs_free(iflib_fl_t fl) { iflib_dma_info_t idi = fl->ifl_ifdi; + bus_dmamap_t sd_map; uint32_t i; for (i = 0; i < fl->ifl_size; i++) { @@ -2037,7 +2080,9 @@ iflib_fl_bufs_free(iflib_fl_t fl) caddr_t *sd_cl = &fl->ifl_sds.ifsd_cl[i]; if (*sd_cl != NULL) { - bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; + sd_map = fl->ifl_sds.ifsd_map[i]; + bus_dmamap_sync(fl->ifl_desc_tag, sd_map, + BUS_DMASYNC_POSTREAD); bus_dmamap_unload(fl->ifl_desc_tag, sd_map); if (*sd_cl != NULL) uma_zfree(fl->ifl_zone, *sd_cl); @@ -2140,19 +2185,32 @@ static void iflib_rx_sds_free(iflib_rxq_t rxq) { iflib_fl_t fl; - int i; + int i, j; if (rxq->ifr_fl != NULL) { for (i = 0; i < rxq->ifr_nfl; i++) { fl = &rxq->ifr_fl[i]; if (fl->ifl_desc_tag != NULL) { + if (fl->ifl_sds.ifsd_map != NULL) { + for (j = 0; j < fl->ifl_size; i++) { + if (fl->ifl_sds.ifsd_map[i] == + NULL) + continue; + bus_dmamap_sync( + fl->ifl_desc_tag, + fl->ifl_sds.ifsd_map[i], + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload( + fl->ifl_desc_tag, + fl->ifl_sds.ifsd_map[i]); + } + } bus_dma_tag_destroy(fl->ifl_desc_tag); fl->ifl_desc_tag = NULL; } free(fl->ifl_sds.ifsd_m, M_IFLIB); free(fl->ifl_sds.ifsd_cl, M_IFLIB); free(fl->ifl_sds.ifsd_ba, M_IFLIB); - /* XXX destroy maps first */ free(fl->ifl_sds.ifsd_map, M_IFLIB); fl->ifl_sds.ifsd_m = NULL; fl->ifl_sds.ifsd_cl = NULL; @@ -2430,11 +2488,10 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int map = fl->ifl_sds.ifsd_map[cidx]; di = fl->ifl_ifdi; next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); - bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* not valid assert if bxe really does SGE from non-contiguous elements */ MPASS(fl->ifl_cidx == cidx); + bus_dmamap_sync(fl->ifl_desc_tag, map, BUS_DMASYNC_POSTREAD); if (unload) bus_dmamap_unload(fl->ifl_desc_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); @@ -2442,7 +2499,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int fl->ifl_gen = 0; bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bit_clear(fl->ifl_rx_bitmap, cidx); + bit_clear(fl->ifl_rx_bitmap, cidx); } static struct mbuf * @@ -2519,6 +2576,9 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) m->m_data += 2; #endif memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); + bus_dmamap_sync(rxq->ifr_fl->ifl_desc_tag, + rxq->ifr_fl->ifl_sds.ifsd_map[ri->iri_frags[0].irf_idx], + BUS_DMASYNC_PREREAD); m->m_len = ri->iri_frags[0].irf_len; } else { m = assemble_segments(rxq, ri, &sd); @@ -2587,6 +2647,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if_ctx_t ctx = rxq->ifr_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + iflib_dma_info_t di; int avail, i; qidx_t *cidxp; struct if_rxd_info ri; @@ -2631,6 +2692,9 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) ri.iri_cidx = *cidxp; ri.iri_ifp = ifp; ri.iri_frags = rxq->ifr_frags; + di = rxq->ifr_fl[rxq->ifr_frags[0].irf_flid].ifl_ifdi; + bus_dmamap_sync(di->idi_tag, di->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); err = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); if (err) @@ -3006,16 +3070,17 @@ iflib_remove_mbuf(iflib_txq_t txq) { int ntxd, pidx; struct mbuf *m, **ifsd_m; - bus_dmamap_t *ifsd_map; ifsd_m = txq->ift_sds.ifsd_m; ntxd = txq->ift_size; pidx = txq->ift_pidx & (ntxd - 1); ifsd_m = txq->ift_sds.ifsd_m; - ifsd_map = txq->ift_sds.ifsd_map; m = ifsd_m[pidx]; ifsd_m[pidx] = NULL; - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[pidx]); + bus_dmamap_unload(txq->ift_desc_tag, txq->ift_sds.ifsd_map[pidx]); + if (txq->ift_sds.ifsd_tso_map != NULL) + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[pidx]); #if MEMORY_LOGGING txq->ift_dequeued++; #endif @@ -3131,11 +3196,13 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { desc_tag = txq->ift_tso_desc_tag; max_segs = scctx->isc_tx_tso_segments_max; + map = txq->ift_sds.ifsd_tso_map[pidx]; MPASS(desc_tag != NULL); MPASS(max_segs > 0); } else { desc_tag = txq->ift_desc_tag; max_segs = scctx->isc_tx_nsegments; + map = txq->ift_sds.ifsd_map[pidx]; } if ((sctx->isc_flags & IFLIB_NEED_ETHER_PAD) && __predict_false(m_head->m_pkthdr.len < scctx->isc_min_frame_size)) { @@ -3297,7 +3364,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) { uint32_t qsize, cidx, mask, gen; struct mbuf *m, **ifsd_m; - bus_dmamap_t *ifsd_map; bool do_prefetch; cidx = txq->ift_cidx; @@ -3305,7 +3371,6 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) qsize = txq->ift_size; mask = qsize-1; ifsd_m = txq->ift_sds.ifsd_m; - ifsd_map = txq->ift_sds.ifsd_map; do_prefetch = (txq->ift_ctx->ifc_flags & IFC_PREFETCH); while (n-- > 0) { @@ -3315,7 +3380,19 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) } if ((m = ifsd_m[cidx]) != NULL) { prefetch(&ifsd_m[(cidx + CACHE_PTR_INCREMENT) & mask]); - bus_dmamap_unload(txq->ift_desc_tag, ifsd_map[cidx]); + if (m->m_pkthdr.csum_flags & CSUM_TSO) { + bus_dmamap_sync(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[cidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_tso_desc_tag, + txq->ift_sds.ifsd_tso_map[cidx]); + } else { + bus_dmamap_sync(txq->ift_desc_tag, + txq->ift_sds.ifsd_map[cidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(txq->ift_desc_tag, + txq->ift_sds.ifsd_map[cidx]); + } /* XXX we don't support any drivers that batch packets yet */ MPASS(m->m_nextpkt == NULL); m_freem(m); @@ -3400,6 +3477,8 @@ iflib_txq_can_drain(struct ifmp_ring *r) iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); return ((TXQ_AVAIL(txq) > MAX_TX_DESC(ctx) + 2) || ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)); } @@ -3564,6 +3643,8 @@ _task_fn_tx(void *context) if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; if (if_getcapenable(ifp) & IFCAP_NETMAP) { + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); @@ -5817,6 +5898,8 @@ iflib_tx_credits_update(if_ctx_t ctx, iflib_txq_t txq) if (ctx->isc_txd_credits_update == NULL) return (0); + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if ((credits = ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, true)) == 0) return (0); From owner-svn-src-head@freebsd.org Wed Jan 16 05:51:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C689114A3F62; Wed, 16 Jan 2019 05:51:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 682E18DE09; Wed, 16 Jan 2019 05:51:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B5FF25FB1; Wed, 16 Jan 2019 05:51:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G5p4FD095718; Wed, 16 Jan 2019 05:51:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G5p468095717; Wed, 16 Jan 2019 05:51:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901160551.x0G5p468095717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Jan 2019 05:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343086 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 343086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 682E18DE09 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 05:51:05 -0000 Author: kib Date: Wed Jan 16 05:51:03 2019 New Revision: 343086 URL: https://svnweb.freebsd.org/changeset/base/343086 Log: Remove unused prototype. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Wed Jan 16 05:44:14 2019 (r343085) +++ head/sys/x86/x86/busdma_bounce.c Wed Jan 16 05:51:03 2019 (r343086) @@ -142,7 +142,6 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); From owner-svn-src-head@freebsd.org Wed Jan 16 06:10:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5DF14A4465; Wed, 16 Jan 2019 06:10:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8B848E742; Wed, 16 Jan 2019 06:10:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBFC2261FC; Wed, 16 Jan 2019 06:10:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0G6AtHN006350; Wed, 16 Jan 2019 06:10:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0G6Atlp006349; Wed, 16 Jan 2019 06:10:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901160610.x0G6Atlp006349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Jan 2019 06:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343087 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 343087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8B848E742 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 06:10:56 -0000 Author: kib Date: Wed Jan 16 06:10:55 2019 New Revision: 343087 URL: https://svnweb.freebsd.org/changeset/base/343087 Log: Style(9) fixes for x86/busdma_bounce.c. Remove extra parentheses. Adjust indents and lines fill. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Wed Jan 16 05:51:03 2019 (r343086) +++ head/sys/x86/x86/busdma_bounce.c Wed Jan 16 06:10:55 2019 (r343087) @@ -137,19 +137,16 @@ static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int commit); + int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_addr_t addr1, - bus_addr_t addr2, bus_size_t size); + vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - pmap_t pmap, void *buf, bus_size_t buflen, - int flags); + pmap_t pmap, void *buf, bus_size_t buflen, int flags); static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_paddr_t buf, bus_size_t buflen, - int flags); + vm_paddr_t buf, bus_size_t buflen, int flags); static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int flags); + int flags); static int bounce_bus_dma_zone_setup(bus_dma_tag_t dmat) @@ -202,15 +199,15 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si newtag->map_count = 0; newtag->segments = NULL; - if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) + if (parent != NULL && (newtag->common.filter != NULL || + (parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0)) newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; - if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && (flags & BUS_DMA_ALLOCNOW) != 0) error = bounce_bus_dma_zone_setup(newtag); else @@ -309,7 +306,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) @@ -448,14 +445,15 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad * * In the meantime warn the user if malloc gets it wrong. */ - if ((dmat->common.maxsize <= PAGE_SIZE) && - (dmat->common.alignment <= dmat->common.maxsize) && + if (dmat->common.maxsize <= PAGE_SIZE && + dmat->common.alignment <= dmat->common.maxsize && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), mflags); } else if (dmat->common.nsegments >= - howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, + PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ @@ -512,7 +510,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_ bus_addr_t curaddr; bus_size_t sgsize; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { /* * Count the number of bounce pages * needed in order to complete this transfer @@ -541,7 +539,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap bus_addr_t paddr; bus_size_t sg_len; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->common.lowaddr, ptoa((vm_paddr_t)Maxmem), @@ -580,7 +578,7 @@ _bus_dmamap_count_ma(bus_dma_tag_t dmat, bus_dmamap_t int page_index; vm_paddr_t paddr; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if (map != &nobounce_dmamap && map->pagesneeded == 0) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->common.lowaddr, ptoa((vm_paddr_t)Maxmem), @@ -718,7 +716,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dm while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); @@ -786,7 +784,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_ */ max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); @@ -853,7 +851,7 @@ bounce_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmam paddr = VM_PAGE_TO_PHYS(ma[page_index]) + ma_offs; max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - ma_offs; - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0 && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, paddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); @@ -1066,9 +1064,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat) /* Check to see if we already have a suitable zone */ STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->common.alignment <= bz->alignment) && - (dmat->common.lowaddr >= bz->lowaddr) && - (dmat->common.domain == bz->domain)) { + if (dmat->common.alignment <= bz->alignment && + dmat->common.lowaddr >= bz->lowaddr && + dmat->common.domain == bz->domain) { dmat->bounce_zone = bz; return (0); } @@ -1196,7 +1194,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) + bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; From owner-svn-src-head@freebsd.org Wed Jan 16 10:23:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018DF148273A; Wed, 16 Jan 2019 10:23:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D417955E6; Wed, 16 Jan 2019 10:23:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 818183CDA81; Wed, 16 Jan 2019 21:23:42 +1100 (AEDT) Date: Wed, 16 Jan 2019 21:23:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm In-Reply-To: <20190115200617.GZ18452@FreeBSD.org> Message-ID: <20190116204533.X1031@besplex.bde.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> <20190115200617.GZ18452@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=66gzK4BooDlOObVp9BoA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 4D417955E6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 10:23:54 -0000 On Tue, 15 Jan 2019, Gleb Smirnoff wrote: > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: > J> Why not #include counter.h in the relevant vm_machdep.c files instead? > > This also is ugly :( Not sure more or less. Probably less, but I > urged to plug all possible compilation failures at a time. It is better, but it is a bug if vm_machdep.c files include uma's internal header. Perhaps Justin meant vm files other than vm_machdep.c. The only non-uma ones in vm/* chummy with uma's internals are memguard.c and vm_page.c. > What is ugly is that most files just need counter_u64_t size, > and they don't use counter(9) KPI. > > The fact that vm_machdep or Linux KPI want to look into internal > type uma_zone_t is also ugly. This is a bug in uma. style(9) forbids using typedefs for struct types and pointers to struct types, since these are usually just foot shooting. They usually give the opposite of opaque types, since the header that declarers them usually also declares lots of pollution and often declares the internals of the types that are supposed to be opaque. I, partially fixed this in my version about 15 years ago: XX Index: uma.h XX =================================================================== XX RCS file: /home/ncvs/src/sys/vm/uma.h,v XX retrieving revision 1.18 XX diff -u -2 -r1.18 uma.h XX --- uma.h 1 Jun 2004 01:36:26 -0000 1.18 XX +++ uma.h 1 Jun 2004 08:52:15 -0000 XX @@ -25,17 +25,21 @@ XX * XX * $FreeBSD: src/sys/vm/uma.h,v 1.18 2004/06/01 01:36:26 bmilekic Exp $ XX - * XX */ XX XX +#ifndef _VM_UMA_H_ XX +#define _VM_UMA_H_ XX + XX /* XX * uma.h - External definitions for the Universal Memory Allocator XX - * XX -*/ XX + */ XX XX -#ifndef VM_UMA_H XX -#define VM_UMA_H XX +#include XX XX -#include /* For NULL */ XX -#include /* For M_* */ XX +/* Shared with . */ XX +#define M_NOWAIT 0x0001 /* do not block */ XX +#define M_WAITOK 0x0002 /* do not block */ XX +#define M_ZERO 0x0100 /* bzero the allocation */ XX +#define M_NOVM 0x0200 /* don't ask VM for pages */ XX +#define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ XX XX /* User visable parameters */ uma.h has grosser pollution for NULL and M_*. I don't like lots of little headers like sys/_null.h, but it may as well be used when it exists. Replicating the definitions of M_* is easier than replicating the definition of NULL. XX @@ -44,7 +48,6 @@ XX /* Types and type defs */ XX XX -struct uma_zone; XX /* Opaque type used as a handle to the zone */ XX -typedef struct uma_zone * uma_zone_t; XX +typedef struct uma_zone * uma_zone_t; /* XXX actually non-opaque. */ XX XX /* I didn't completely fix this. The full fix would remove the typedef. XX @@ -254,6 +257,8 @@ XX * returned if the zone is empty or the ctor failed. XX */ XX - XX +#ifndef _UMA_ZALLOC_ARG_DECLARED XX void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); XX +#define _UMA_ZALLOC_ARG_DECLARED XX +#endif XX XX /* XX @@ -282,6 +287,8 @@ XX * Nothing. XX */ XX - XX +#ifndef _UMA_ZFREE_ARG_DECLARED XX void uma_zfree_arg(uma_zone_t zone, void *item, void *arg); XX +#define _UMA_ZFREE_ARG_DECLARED XX +#endif XX XX /* These ifdefs fix the largest source of pollution. The declarations are repeated in so that mbuf.h doesn't need to include . These functions aren't even inline, so calling them in inline functions in mbuf.h (and inlining these functions) is especially useless. I also fixed mbuf.h to not include . and are among the few files that I completed removal of pollution in 20-25 years ago. Now they are much more polluted than when I started cleaning them. mbuf.h now includes: sys/param.h, sys/systm.h (_KERNEL only), sys/queue.h (this is not considered pollution, and I didn't clean it), sys/_lock.h, sys/_mutex.h, machine/_limits.h (the last 3 are needed for too much inlining, but are not considered pollution). malloc.h now includes (in bogus order): sys/queue.h, sys/systm.h, vm/uma.h and its nested pollution (last 2 _KERNEL only), sys/lock.h (WITNESS only), sys/sdt.h (_KERNEL only, and not in the suckage section). XX @@ -504,3 +511,3 @@ XX u_int32_t *uma_find_refcnt(uma_zone_t zone, void *item); XX XX -#endif XX +#endif /* !_VM_UMA_H_ */ The patch is for a 2004 version. The current version starts with the same bugs and ends with 2 bugs in the fix for the missing comment. Bruce From owner-svn-src-head@freebsd.org Wed Jan 16 10:33:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D52C91482FAE; Wed, 16 Jan 2019 10:33:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C28E95D6A; Wed, 16 Jan 2019 10:33:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D034F85; Wed, 16 Jan 2019 10:33:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GAXqlS048014; Wed, 16 Jan 2019 10:33:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GAXpTv048012; Wed, 16 Jan 2019 10:33:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901161033.x0GAXpTv048012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 16 Jan 2019 10:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343088 - in head/sys/dev: rtwn/usb usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 343088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C28E95D6A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 10:33:53 -0000 Author: avos Date: Wed Jan 16 10:33:51 2019 New Revision: 343088 URL: https://svnweb.freebsd.org/changeset/base/343088 Log: rtwn_usb(4): add new USB id for RTL8821AU Reported by: Mike Tancsa Tested by: Mike Tancsa MFC after: 3 days Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 16 06:10:55 2019 (r343087) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 16 10:33:51 2019 (r343088) @@ -156,7 +156,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(EDIMAX, EW7811UTC_2), RTWN_RTL8821AU_DEV(HAWKING, HD65U), RTWN_RTL8821AU_DEV(MELCO, WIU2433DM), - RTWN_RTL8821AU_DEV(NETGEAR, A6100) + RTWN_RTL8821AU_DEV(NETGEAR, A6100), + RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU) #undef RTWN_RTL8821AU_DEV }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 16 06:10:55 2019 (r343087) +++ head/sys/dev/usb/usbdevs Wed Jan 16 10:33:51 2019 (r343088) @@ -3957,6 +3957,7 @@ product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Ad product REALTEK RTL8712 0x8712 RTL8712 product REALTEK RTL8713 0x8713 RTL8713 product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU +product REALTEK RTL8821AU 0xa811 RTL8821AU product REALTEK RTL8723BU 0xb720 RTL8723BU product REALTEK RTL8192SU 0xc512 RTL8192SU product REALTEK RTL8812AU 0x8812 RTL8812AU Wireless Adapter From owner-svn-src-head@freebsd.org Wed Jan 16 11:33:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF051484756; Wed, 16 Jan 2019 11:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9399897FE8; Wed, 16 Jan 2019 11:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C9A19AC; Wed, 16 Jan 2019 11:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GBXmiH003396; Wed, 16 Jan 2019 11:33:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GBXmmV003394; Wed, 16 Jan 2019 11:33:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901161133.x0GBXmmV003394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 16 Jan 2019 11:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343089 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9399897FE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 11:33:49 -0000 Author: tuexen Date: Wed Jan 16 11:33:47 2019 New Revision: 343089 URL: https://svnweb.freebsd.org/changeset/base/343089 Log: Limit the user-controllable amount of memory the kernel allocates via IPPROTO_SCTP level socket options. This issue was found by running syzkaller. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Jan 16 10:33:51 2019 (r343088) +++ head/sys/netinet/sctp_constants.h Wed Jan 16 11:33:47 2019 (r343089) @@ -983,6 +983,9 @@ __FBSDID("$FreeBSD$"); ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ (((uint8_t *)&(a)->s_addr)[1] == 254)) +/* Maximum size of optval for IPPROTO_SCTP level socket options. */ +#define SCTP_SOCKET_OPTION_LIMIT (64 * 1024) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jan 16 10:33:51 2019 (r343088) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 16 11:33:47 2019 (r343089) @@ -6828,6 +6828,10 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt return (error); } optsize = sopt->sopt_valsize; + if (optsize > SCTP_SOCKET_OPTION_LIMIT) { + SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); + return (ENOBUFS); + } if (optsize) { SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); if (optval == NULL) { From owner-svn-src-head@freebsd.org Wed Jan 16 12:11:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E33851486194; Wed, 16 Jan 2019 12:11:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8984F6AF94; Wed, 16 Jan 2019 12:11:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C2652020; Wed, 16 Jan 2019 12:11:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GCBUZf023612; Wed, 16 Jan 2019 12:11:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GCBUhP023611; Wed, 16 Jan 2019 12:11:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901161211.x0GCBUhP023611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 16 Jan 2019 12:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343092 - in head/sys/dev/rtwn: rtl8192c rtl8812a X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8192c rtl8812a X-SVN-Commit-Revision: 343092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8984F6AF94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 12:11:31 -0000 Author: avos Date: Wed Jan 16 12:11:29 2019 New Revision: 343092 URL: https://svnweb.freebsd.org/changeset/base/343092 Log: rtwn(4): clear 'basic' rate bit before calculating RTS/CTS rate. Rate tables have this bit set to indicate minimal set of basic rates; however, it overlappes with MCS bit, so rate2ridx() will treat them as an 11n rate. Due to the current rates setup the issue can be reproduced only in 5GHz band with 11n / protection enabled. Tested with RTL8821AU, HOSTAP mode. MFC after: 5 days Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx.c head/sys/dev/rtwn/rtl8812a/r12a_tx.c Modified: head/sys/dev/rtwn/rtl8192c/r92c_tx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_tx.c Wed Jan 16 12:04:29 2019 (r343091) +++ head/sys/dev/rtwn/rtl8192c/r92c_tx.c Wed Jan 16 12:11:29 2019 (r343092) @@ -103,7 +103,7 @@ r92c_tx_protection(struct rtwn_softc *sc, struct r92c_ rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); - ridx = rate2ridx(rate); + ridx = rate2ridx(IEEE80211_RV(rate)); txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, ridx)); /* RTS rate fallback limit (max). */ Modified: head/sys/dev/rtwn/rtl8812a/r12a_tx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_tx.c Wed Jan 16 12:04:29 2019 (r343091) +++ head/sys/dev/rtwn/rtl8812a/r12a_tx.c Wed Jan 16 12:11:29 2019 (r343092) @@ -111,7 +111,7 @@ r12a_tx_protection(struct rtwn_softc *sc, struct r12a_ rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); - ridx = rate2ridx(rate); + ridx = rate2ridx(IEEE80211_RV(rate)); txd->txdw4 |= htole32(SM(R12A_TXDW4_RTSRATE, ridx)); /* RTS rate fallback limit (max). */ From owner-svn-src-head@freebsd.org Wed Jan 16 12:12:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D54C148637D; Wed, 16 Jan 2019 12:12:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 200286B1B0; Wed, 16 Jan 2019 12:12:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 123482071; Wed, 16 Jan 2019 12:12:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GCCenw024505; Wed, 16 Jan 2019 12:12:40 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GCCeRh024502; Wed, 16 Jan 2019 12:12:40 GMT (envelope-from des@FreeBSD.org) Message-Id: <201901161212.x0GCCeRh024502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 Jan 2019 12:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343093 - in head: include lib/libc/gen libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 343093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 200286B1B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 12:12:41 -0000 Author: des Date: Wed Jan 16 12:12:40 2019 New Revision: 343093 URL: https://svnweb.freebsd.org/changeset/base/343093 Log: Implement dlopenat(3). MFC after: 3 weeks Modified: head/include/dlfcn.h head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.c Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Wed Jan 16 12:11:29 2019 (r343092) +++ head/include/dlfcn.h Wed Jan 16 12:12:40 2019 (r343093) @@ -120,6 +120,7 @@ void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); #if __BSD_VISIBLE +void *dlopenat(int, const char *, int); void *fdlopen(int, int); int dladdr(const void * __restrict, Dl_info * __restrict); dlfunc_t dlfunc(void * __restrict, const char * __restrict); Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Wed Jan 16 12:11:29 2019 (r343092) +++ head/lib/libc/gen/dlopen.3 Wed Jan 16 12:12:40 2019 (r343093) @@ -32,11 +32,12 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd January 15, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , +.Nm dlopenat , .Nm fdlopen , .Nm dlsym , .Nm dlvsym , @@ -51,6 +52,8 @@ .Ft void * .Fn dlopen "const char *path" "int mode" .Ft void * +.Fn dlopenat "int fd" "const char *path" "int mode" +.Ft void * .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" @@ -169,6 +172,24 @@ If fails, it returns a null pointer, and sets an error condition which may be interrogated with .Fn dlerror . +.Pp +The +.Fn dlopenat +function is equivalent to +.Fn dlopen +except in the case where the path specifies a relative path. +In this case the file to be opened is determined relative to the +directory associated with the file descriptor fd instead of the +current working directory. +If +.Fn dlopenat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is +identical to a call to +.Fn dlopen . .Pp The .Fn fdlopen Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 16 12:11:29 2019 (r343092) +++ head/libexec/rtld-elf/rtld.c Wed Jan 16 12:12:40 2019 (r343093) @@ -93,8 +93,8 @@ static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); static int dlclose_locked(void *, RtldLockState *); -static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, - int lo_flags, int mode, RtldLockState *lockstate); +static Obj_Entry *dlopen_object(int, const char *name, int fd, + Obj_Entry *refobj, int lo_flags, int mode, RtldLockState *lockstate); static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); @@ -118,7 +118,7 @@ static void load_filtees(Obj_Entry *, int flags, RtldL static void unload_filtees(Obj_Entry *, RtldLockState *); static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); -static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); +static Obj_Entry *load_object(int, const char *, int, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); static int obj_enforce_relro(Obj_Entry *); @@ -147,7 +147,7 @@ static int relocate_objects(Obj_Entry *, bool, Obj_Ent static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int rtld_dirname(const char *, char *); static int rtld_dirname_abs(const char *, char *); -static void *rtld_dlopen(const char *name, int fd, int mode); +static void *rtld_dlopen(int, const char *name, int fd, int mode); static void rtld_exit(void); static char *search_library_path(const char *, const char *, const char *, int *); @@ -231,6 +231,7 @@ extern Elf_Dyn _DYNAMIC; int dlclose(void *) __exported; char *dlerror(void) __exported; void *dlopen(const char *, int) __exported; +void *dlopenat(int, const char *, int) __exported; void *fdlopen(int, int) __exported; void *dlsym(void *, const char *) __exported; dlfunc_t dlfunc(void *, const char *) __exported; @@ -2292,8 +2293,8 @@ load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int { for (; needed != NULL; needed = needed->next) { - needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj, - flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | + needed->obj = dlopen_object(AT_FDCWD, obj->strtab + needed->name, -1, + obj, flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | RTLD_LOCAL, lockstate); } } @@ -2316,8 +2317,8 @@ process_needed(Obj_Entry *obj, Needed_Entry *needed, i Obj_Entry *obj1; for (; needed != NULL; needed = needed->next) { - obj1 = needed->obj = load_object(obj->strtab + needed->name, -1, obj, - flags & ~RTLD_LO_NOLOAD); + obj1 = needed->obj = load_object(AT_FDCWD, obj->strtab + needed->name, + -1, obj, flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing && (flags & RTLD_LO_FILTEES) == 0) return (-1); } @@ -2360,7 +2361,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - obj = load_object(p, -1, NULL, 0); + obj = load_object(AT_FDCWD, p, -1, NULL, 0); if (obj == NULL) return -1; /* XXX - cleanup */ obj->z_interpose = true; @@ -2389,7 +2390,8 @@ printable_path(const char *path) * on failure. */ static Obj_Entry * -load_object(const char *name, int fd_u, const Obj_Entry *refobj, int flags) +load_object(int atfd, const char *name, int fd_u, const Obj_Entry *refobj, + int flags) { Obj_Entry *obj; int fd; @@ -2426,7 +2428,7 @@ load_object(const char *name, int fd_u, const Obj_Entr * To avoid a race, we open the file and use fstat() rather than * using stat(). */ - if ((fd = open(path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) { + if ((fd = openat(atfd, path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) { _rtld_error("Cannot open \"%s\"", path); free(path); return (NULL); @@ -3255,21 +3257,28 @@ dllockinit(void *context, } void * +dlopenat(int fd, const char *name, int mode) +{ + + return (rtld_dlopen(fd, name, -1, mode)); +} + +void * dlopen(const char *name, int mode) { - return (rtld_dlopen(name, -1, mode)); + return (rtld_dlopen(AT_FDCWD, name, -1, mode)); } void * fdlopen(int fd, int mode) { - return (rtld_dlopen(NULL, fd, mode)); + return (rtld_dlopen(AT_FDCWD, NULL, fd, mode)); } static void * -rtld_dlopen(const char *name, int fd, int mode) +rtld_dlopen(int atfd, const char *name, int fd, int mode) { RtldLockState lockstate; int lo_flags; @@ -3291,7 +3300,7 @@ rtld_dlopen(const char *name, int fd, int mode) if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE; - return (dlopen_object(name, fd, obj_main, lo_flags, + return (dlopen_object(atfd, name, fd, obj_main, lo_flags, mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); } @@ -3306,8 +3315,8 @@ dlopen_cleanup(Obj_Entry *obj, RtldLockState *lockstat } static Obj_Entry * -dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, - int mode, RtldLockState *lockstate) +dlopen_object(int atfd, const char *name, int fd, Obj_Entry *refobj, + int lo_flags, int mode, RtldLockState *lockstate) { Obj_Entry *old_obj_tail; Obj_Entry *obj; @@ -3329,7 +3338,7 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref obj = obj_main; obj->refcount++; } else { - obj = load_object(name, fd, refobj, lo_flags); + obj = load_object(atfd, name, fd, refobj, lo_flags); } if (obj) { From owner-svn-src-head@freebsd.org Wed Jan 16 12:33:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0171486987; Wed, 16 Jan 2019 12:33:08 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8D9B6BAEC; Wed, 16 Jan 2019 12:33:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9146D23C2; Wed, 16 Jan 2019 12:33:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GCX7v5034927; Wed, 16 Jan 2019 12:33:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GCX6nb034923; Wed, 16 Jan 2019 12:33:06 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901161233.x0GCX6nb034923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 16 Jan 2019 12:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343094 - head/sys/dev/iwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwn X-SVN-Commit-Revision: 343094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8D9B6BAEC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 12:33:08 -0000 Author: avos Date: Wed Jan 16 12:33:06 2019 New Revision: 343094 URL: https://svnweb.freebsd.org/changeset/base/343094 Log: iwn(4): (partially) rewrite A-MPDU Tx path Generic Tx stats fixes: - do not try to parse "aggregation status" for single frames; send them to iwn_tx_done() instead; - try to attach mbuf / node reference pair to reported BA events; allows to fix reported status for ieee80211_tx_complete() and ifnet counters (previously all A-MPDU frames were counted as failed - see PR 210211); requires few more firmware bug workarounds; - preserve short / long retry counters for wlan_amrr(4) (disabled for now - causes significant performance degradation). - Add new IWN_DEBUG_AMPDU debug category. - Add one more check into iwn_tx_data() to prevent aggregation ring overflow. - Workaround 'seqno % 256' != 'current Tx slot' case (until D9195 is not in the tree). - Improve watchdog timer updates (previously watchdog check was omitted when at least one frame was transmitted). - Stop Tx when memory leak in currently used ring was detected (unlikely to happen). - Few other minor fixes. Was previously tested with: - Intel 6205, STA mode (Tx aggregation behaves much better now). - Intel 4965AGN, STA mode (still unstable). PR: 192641, 210211 Reviewed by: adrian, dhw MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10728 Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwn_debug.h head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jan 16 12:12:40 2019 (r343093) +++ head/sys/dev/iwn/if_iwn.c Wed Jan 16 12:33:06 2019 (r343094) @@ -168,6 +168,7 @@ static int iwn_alloc_tx_ring(struct iwn_softc *, struc int); static void iwn_reset_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); static void iwn_free_tx_ring(struct iwn_softc *, struct iwn_tx_ring *); +static void iwn_check_tx_ring(struct iwn_softc *, int); static void iwn5000_ict_reset(struct iwn_softc *); static int iwn_read_eeprom(struct iwn_softc *, uint8_t macaddr[IEEE80211_ADDR_LEN]); @@ -199,6 +200,8 @@ static void iwn_calib_timeout(void *); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); +static void iwn_agg_tx_complete(struct iwn_softc *, struct iwn_tx_ring *, + int, int, int); static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *); static void iwn5000_rx_calib_results(struct iwn_softc *, struct iwn_rx_desc *); @@ -207,10 +210,13 @@ static void iwn4965_tx_done(struct iwn_softc *, struct struct iwn_rx_data *); static void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); +static void iwn_adj_ampdu_ptr(struct iwn_softc *, struct iwn_tx_ring *); static void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, int, uint8_t); -static void iwn_ampdu_tx_done(struct iwn_softc *, int, int, int, int, int, - void *); +static int iwn_ampdu_check_bitmap(uint64_t, int, int); +static int iwn_ampdu_index_check(struct iwn_softc *, struct iwn_tx_ring *, + uint64_t, int, int); +static void iwn_ampdu_tx_done(struct iwn_softc *, int, int, int, void *); static void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_notif_intr(struct iwn_softc *); static void iwn_wakeup_intr(struct iwn_softc *); @@ -2075,6 +2081,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, struct iwn_tx_ ieee80211_free_node(data->ni); data->ni = NULL; } + data->remapped = 0; + data->long_retries = 0; } /* Clear TX descriptors. */ memset(ring->desc, 0, ring->desc_dma.size); @@ -2114,6 +2122,42 @@ iwn_free_tx_ring(struct iwn_softc *sc, struct iwn_tx_r } static void +iwn_check_tx_ring(struct iwn_softc *sc, int qid) +{ + struct iwn_tx_ring *ring = &sc->txq[qid]; + + KASSERT(ring->queued >= 0, ("%s: ring->queued (%d) for queue %d < 0!", + __func__, ring->queued, qid)); + + if (qid >= sc->firstaggqueue) { + struct iwn_ops *ops = &sc->ops; + struct ieee80211_tx_ampdu *tap = sc->qid2tap[qid]; + + if (ring->queued == 0 && !IEEE80211_AMPDU_RUNNING(tap)) { + uint16_t ssn = tap->txa_start & 0xfff; + uint8_t tid = tap->txa_tid; + int *res = tap->txa_private; + + iwn_nic_lock(sc); + ops->ampdu_tx_stop(sc, qid, tid, ssn); + iwn_nic_unlock(sc); + + sc->qid2tap[qid] = NULL; + free(res, M_DEVBUF); + } + } + + if (ring->queued < IWN_TX_RING_LOMARK) { + sc->qfullmsk &= ~(1 << qid); + + if (ring->queued == 0) + sc->sc_tx_timer = 0; + else + sc->sc_tx_timer = 5; + } +} + +static void iwn5000_ict_reset(struct iwn_softc *sc) { /* Disable interrupts. */ @@ -3169,104 +3213,129 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc * } -/* Process an incoming Compressed BlockAck. */ static void -iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc) +iwn_agg_tx_complete(struct iwn_softc *sc, struct iwn_tx_ring *ring, int tid, + int idx, int success) { struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; - struct iwn_ops *ops = &sc->ops; + struct iwn_tx_data *data = &ring->data[idx]; struct iwn_node *wn; + struct mbuf *m; struct ieee80211_node *ni; + + KASSERT(data->ni != NULL, ("idx %d: no node", idx)); + KASSERT(data->m != NULL, ("idx %d: no mbuf", idx)); + + /* Unmap and free mbuf. */ + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + m = data->m, data->m = NULL; + ni = data->ni, data->ni = NULL; + wn = (void *)ni; + +#if 0 + /* XXX causes significant performance degradation. */ + txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | + IEEE80211_RATECTL_STATUS_LONG_RETRY; + txs->long_retries = data->long_retries - 1; +#else + txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY; +#endif + txs->short_retries = wn->agg[tid].short_retries; + if (success) + txs->status = IEEE80211_RATECTL_TX_SUCCESS; + else + txs->status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; + + wn->agg[tid].short_retries = 0; + data->long_retries = 0; + + DPRINTF(sc, IWN_DEBUG_AMPDU, "%s: freeing m %p ni %p idx %d qid %d\n", + __func__, m, ni, idx, ring->qid); + ieee80211_ratectl_tx_complete(ni, txs); + ieee80211_tx_complete(ni, m, !success); +} + +/* Process an incoming Compressed BlockAck. */ +static void +iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc) +{ + struct iwn_tx_ring *ring; + struct iwn_tx_data *data; + struct iwn_node *wn; struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); - struct iwn_tx_ring *txq; - struct iwn_tx_data *txdata; struct ieee80211_tx_ampdu *tap; - struct mbuf *m; uint64_t bitmap; - uint16_t ssn; uint8_t tid; - int i, lastidx, qid, *res, shift; - int tx_ok = 0, tx_err = 0; + int i, qid, shift; + int tx_ok = 0; - DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", __func__); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); qid = le16toh(ba->qid); - txq = &sc->txq[ba->qid]; - tap = sc->qid2tap[ba->qid]; + tap = sc->qid2tap[qid]; + ring = &sc->txq[qid]; tid = tap->txa_tid; wn = (void *)tap->txa_ni; - res = NULL; - ssn = 0; - if (!IEEE80211_AMPDU_RUNNING(tap)) { - res = tap->txa_private; - ssn = tap->txa_start & 0xfff; - } + DPRINTF(sc, IWN_DEBUG_AMPDU, "%s: qid %d tid %d seq %04X ssn %04X\n" + "bitmap: ba %016jX wn %016jX, start %d\n", + __func__, qid, tid, le16toh(ba->seq), le16toh(ba->ssn), + (uintmax_t)le64toh(ba->bitmap), (uintmax_t)wn->agg[tid].bitmap, + wn->agg[tid].startidx); - for (lastidx = le16toh(ba->ssn) & 0xff; txq->read != lastidx;) { - txdata = &txq->data[txq->read]; - - /* Unmap and free mbuf. */ - bus_dmamap_sync(txq->data_dmat, txdata->map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(txq->data_dmat, txdata->map); - m = txdata->m, txdata->m = NULL; - ni = txdata->ni, txdata->ni = NULL; - - KASSERT(ni != NULL, ("no node")); - KASSERT(m != NULL, ("no mbuf")); - - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: freeing m=%p\n", __func__, m); - ieee80211_tx_complete(ni, m, 1); - - txq->queued--; - txq->read = (txq->read + 1) % IWN_TX_RING_COUNT; - } - - if (txq->queued == 0 && res != NULL) { - iwn_nic_lock(sc); - ops->ampdu_tx_stop(sc, qid, tid, ssn); - iwn_nic_unlock(sc); - sc->qid2tap[qid] = NULL; - free(res, M_DEVBUF); - return; - } - if (wn->agg[tid].bitmap == 0) return; shift = wn->agg[tid].startidx - ((le16toh(ba->seq) >> 4) & 0xff); - if (shift < 0) + if (shift <= -64) shift += 0x100; - if (wn->agg[tid].nframes > (64 - shift)) - return; - /* - * Walk the bitmap and calculate how many successful and failed - * attempts are made. + * Walk the bitmap and calculate how many successful attempts + * are made. * * Yes, the rate control code doesn't know these are A-MPDU - * subframes and that it's okay to fail some of these. + * subframes; due to that long_retries stats are not used here. */ - ni = tap->txa_ni; - bitmap = (le64toh(ba->bitmap) >> shift) & wn->agg[tid].bitmap; - for (i = 0; bitmap; i++) { - txs->flags = 0; /* XXX TODO */ - if ((bitmap & 1) == 0) { - tx_err ++; - txs->status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; - } else { - tx_ok ++; - txs->status = IEEE80211_RATECTL_TX_SUCCESS; + bitmap = le64toh(ba->bitmap); + if (shift >= 0) + bitmap >>= shift; + else + bitmap <<= -shift; + bitmap &= wn->agg[tid].bitmap; + wn->agg[tid].bitmap = 0; + + for (i = wn->agg[tid].startidx; + bitmap; + bitmap >>= 1, i = (i + 1) % IWN_TX_RING_COUNT) { + if ((bitmap & 1) == 0) + continue; + + data = &ring->data[i]; + if (__predict_false(data->m == NULL)) { + /* + * There is no frame; skip this entry. + * + * NB: it is "ok" to have both + * 'tx done' + 'compressed BA' replies for frame + * with STATE_SCD_QUERY status. + */ + DPRINTF(sc, IWN_DEBUG_AMPDU, + "%s: ring %d: no entry %d\n", __func__, qid, i); + continue; } - ieee80211_ratectl_tx_complete(ni, txs); - bitmap >>= 1; + + tx_ok++; + iwn_agg_tx_complete(sc, ring, tid, i, 1); } - DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, - "->%s: end; %d ok; %d err\n",__func__, tx_ok, tx_err); + ring->queued -= tx_ok; + iwn_check_tx_ring(sc, qid); + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_AMPDU, + "->%s: end; %d ok\n",__func__, tx_ok); } /* @@ -3514,9 +3583,9 @@ iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_de stat->rate, le16toh(stat->duration), le32toh(stat->status)); - if (qid >= sc->firstaggqueue) { - iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, - stat->rtsfailcnt, stat->ackfailcnt, &stat->status); + if (qid >= sc->firstaggqueue && stat->nframes != 1) { + iwn_ampdu_tx_done(sc, qid, stat->nframes, stat->rtsfailcnt, + &stat->status); } else { iwn_tx_done(sc, desc, stat->rtsfailcnt, stat->ackfailcnt, le32toh(stat->status) & 0xff); @@ -3544,15 +3613,32 @@ iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_de iwn5000_reset_sched(sc, qid, desc->idx); #endif - if (qid >= sc->firstaggqueue) { - iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, - stat->rtsfailcnt, stat->ackfailcnt, &stat->status); + if (qid >= sc->firstaggqueue && stat->nframes != 1) { + iwn_ampdu_tx_done(sc, qid, stat->nframes, stat->rtsfailcnt, + &stat->status); } else { iwn_tx_done(sc, desc, stat->rtsfailcnt, stat->ackfailcnt, le16toh(stat->status) & 0xff); } } +static void +iwn_adj_ampdu_ptr(struct iwn_softc *sc, struct iwn_tx_ring *ring) +{ + int i; + + for (i = ring->read; i != ring->cur; i = (i + 1) % IWN_TX_RING_COUNT) { + struct iwn_tx_data *data = &ring->data[i]; + + if (data->m != NULL) + break; + + data->remapped = 0; + } + + ring->read = i; +} + /* * Adapter-independent backend for TX_DONE firmware notifications. */ @@ -3566,7 +3652,18 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc * struct mbuf *m; struct ieee80211_node *ni; + if (__predict_false(data->m == NULL && + ring->qid >= sc->firstaggqueue)) { + /* + * There is no frame; skip this entry. + */ + DPRINTF(sc, IWN_DEBUG_AMPDU, "%s: ring %d: no entry %d\n", + __func__, ring->qid, desc->idx); + return; + } + KASSERT(data->ni != NULL, ("no node")); + KASSERT(data->m != NULL, ("no mbuf")); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -3576,7 +3673,20 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc * m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; + data->long_retries = 0; + + if (ring->qid >= sc->firstaggqueue) + iwn_adj_ampdu_ptr(sc, ring); + /* + * XXX f/w may hang (device timeout) when desc->idx - ring->read == 64 + * (aggregation queues only). + */ + + ring->queued--; + iwn_check_tx_ring(sc, ring->qid); + + /* * Update rate control statistics for the node. */ txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | @@ -3624,10 +3734,6 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc * ieee80211_tx_complete(ni, m, (status & IWN_TX_FAIL) != 0); - sc->sc_tx_timer = 0; - if (--ring->queued < IWN_TX_RING_LOMARK) - sc->qfullmsk &= ~(1 << ring->qid); - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); } @@ -3664,148 +3770,218 @@ iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc wakeup(&ring->desc[desc->idx]); } +static int +iwn_ampdu_check_bitmap(uint64_t bitmap, int start, int idx) +{ + int bit, shift; + + bit = idx - start; + shift = 0; + if (bit >= 64) { + shift = 0x100 - bit; + bit = 0; + } else if (bit <= -64) + bit = 0x100 + bit; + else if (bit < 0) { + shift = -bit; + bit = 0; + } + + if (bit - shift >= 64) + return (0); + + return ((bitmap & (1ULL << (bit - shift))) != 0); +} + +/* + * Firmware bug workaround: in case if 'retries' counter + * overflows 'seqno' field will be incremented: + * status|sequence|status|sequence|status|sequence + * 0000 0A48 0001 0A49 0000 0A6A + * 1000 0A48 1000 0A49 1000 0A6A + * 2000 0A48 2000 0A49 2000 0A6A + * ... + * E000 0A48 E000 0A49 E000 0A6A + * F000 0A48 F000 0A49 F000 0A6A + * 0000 0A49 0000 0A49 0000 0A6B + * 1000 0A49 1000 0A49 1000 0A6B + * ... + * D000 0A49 D000 0A49 D000 0A6B + * E000 0A49 E001 0A49 E000 0A6B + * F000 0A49 F001 0A49 F000 0A6B + * 0000 0A4A 0000 0A4B 0000 0A6A + * 1000 0A4A 1000 0A4B 1000 0A6A + * ... + * + * Odd 'seqno' numbers are incremened by 2 every 2 overflows. + * For even 'seqno' % 4 != 0 overflow is cyclic (0 -> +1 -> 0). + * Not checked with nretries >= 64. + * + */ +static int +iwn_ampdu_index_check(struct iwn_softc *sc, struct iwn_tx_ring *ring, + uint64_t bitmap, int start, int idx) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct iwn_tx_data *data; + int diff, min_retries, max_retries, new_idx, loop_end; + + new_idx = idx - IWN_LONG_RETRY_LIMIT_LOG; + if (new_idx < 0) + new_idx += IWN_TX_RING_COUNT; + + /* + * Corner case: check if retry count is not too big; + * reset device otherwise. + */ + if (!iwn_ampdu_check_bitmap(bitmap, start, new_idx)) { + data = &ring->data[new_idx]; + if (data->long_retries > IWN_LONG_RETRY_LIMIT) { + device_printf(sc->sc_dev, + "%s: retry count (%d) for idx %d/%d overflow, " + "resetting...\n", __func__, data->long_retries, + ring->qid, new_idx); + ieee80211_restart_all(ic); + return (-1); + } + } + + /* Correct index if needed. */ + loop_end = idx; + do { + data = &ring->data[new_idx]; + diff = idx - new_idx; + if (diff < 0) + diff += IWN_TX_RING_COUNT; + + min_retries = IWN_LONG_RETRY_FW_OVERFLOW * diff; + if ((new_idx % 2) == 0) + max_retries = IWN_LONG_RETRY_FW_OVERFLOW * (diff + 1); + else + max_retries = IWN_LONG_RETRY_FW_OVERFLOW * (diff + 2); + + if (!iwn_ampdu_check_bitmap(bitmap, start, new_idx) && + ((data->long_retries >= min_retries && + data->long_retries < max_retries) || + (diff == 1 && + (new_idx & 0x03) == 0x02 && + data->long_retries >= IWN_LONG_RETRY_FW_OVERFLOW))) { + DPRINTF(sc, IWN_DEBUG_AMPDU, + "%s: correcting index %d -> %d in queue %d" + " (retries %d)\n", __func__, idx, new_idx, + ring->qid, data->long_retries); + return (new_idx); + } + + new_idx = (new_idx + 1) % IWN_TX_RING_COUNT; + } while (new_idx != loop_end); + + return (idx); +} + static void -iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, - int rtsfailcnt, int ackfailcnt, void *stat) +iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int nframes, int rtsfailcnt, + void *stat) { - struct iwn_ops *ops = &sc->ops; struct iwn_tx_ring *ring = &sc->txq[qid]; - struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; + struct ieee80211_tx_ampdu *tap = sc->qid2tap[qid]; + struct iwn_node *wn = (void *)tap->txa_ni; struct iwn_tx_data *data; - struct mbuf *m; - struct iwn_node *wn; - struct ieee80211_node *ni; - struct ieee80211_tx_ampdu *tap; - uint64_t bitmap; - uint32_t *status = stat; + uint64_t bitmap = 0; uint16_t *aggstatus = stat; - uint16_t ssn; - uint8_t tid; - int bit, i, lastidx, *res, seqno, shift, start; + uint8_t tid = tap->txa_tid; + int bit, i, idx, shift, start, tx_err; - /* XXX TODO: status is le16 field! Grr */ - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: nframes=%d, status=0x%08x\n", - __func__, - nframes, - *status); - tap = sc->qid2tap[qid]; - tid = tap->txa_tid; - wn = (void *)tap->txa_ni; - ni = tap->txa_ni; + start = le16toh(*(aggstatus + nframes * 2)) & 0xff; - /* - * XXX TODO: ACK and RTS failures would be nice here! - */ + for (i = 0; i < nframes; i++) { + uint16_t status = le16toh(aggstatus[i * 2]); - /* - * A-MPDU single frame status - if we failed to transmit it - * in A-MPDU, then it may be a permanent failure. - * - * XXX TODO: check what the Linux iwlwifi driver does here; - * there's some permanent and temporary failures that may be - * handled differently. - */ - if (nframes == 1) { - txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | - IEEE80211_RATECTL_STATUS_LONG_RETRY; - txs->short_retries = rtsfailcnt; - txs->long_retries = ackfailcnt; - if ((*status & 0xff) != 1 && (*status & 0xff) != 2) { -#ifdef NOT_YET - printf("ieee80211_send_bar()\n"); -#endif + if (status & IWN_AGG_TX_STATE_IGNORE_MASK) + continue; + + idx = le16toh(aggstatus[i * 2 + 1]) & 0xff; + data = &ring->data[idx]; + if (data->remapped) { + idx = iwn_ampdu_index_check(sc, ring, bitmap, start, idx); + if (idx == -1) { + /* skip error (device will be restarted anyway). */ + continue; + } + + /* Index may have changed. */ + data = &ring->data[idx]; + } + + /* + * XXX Sometimes (rarely) some frames are excluded from events. + * XXX Due to that long_retries counter may be wrong. + */ + data->long_retries &= ~0x0f; + data->long_retries += IWN_AGG_TX_TRY_COUNT(status) + 1; + + if (data->long_retries >= IWN_LONG_RETRY_FW_OVERFLOW) { + int diff, wrong_idx; + + diff = data->long_retries / IWN_LONG_RETRY_FW_OVERFLOW; + wrong_idx = (idx + diff) % IWN_TX_RING_COUNT; + /* - * If we completely fail a transmit, make sure a - * notification is pushed up to the rate control - * layer. + * Mark the entry so the above code will check it + * next time. */ - /* XXX */ - txs->status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED; - } else { + ring->data[wrong_idx].remapped = 1; + } + + if (status & IWN_AGG_TX_STATE_UNDERRUN_MSK) { /* - * If nframes=1, then we won't be getting a BA for - * this frame. Ensure that we correctly update the - * rate control code with how many retries were - * needed to send it. + * NB: count retries but postpone - it was not + * transmitted. */ - txs->status = IEEE80211_RATECTL_TX_SUCCESS; + continue; } - ieee80211_ratectl_tx_complete(ni, txs); - } - bitmap = 0; - start = idx; - for (i = 0; i < nframes; i++) { - if (le16toh(aggstatus[i * 2]) & 0xc) - continue; - - idx = le16toh(aggstatus[2*i + 1]) & 0xff; bit = idx - start; shift = 0; if (bit >= 64) { - shift = 0x100 - idx + start; + shift = 0x100 - bit; bit = 0; - start = idx; } else if (bit <= -64) - bit = 0x100 - start + idx; + bit = 0x100 + bit; else if (bit < 0) { - shift = start - idx; - start = idx; + shift = -bit; bit = 0; } bitmap = bitmap << shift; bitmap |= 1ULL << bit; } - tap = sc->qid2tap[qid]; - tid = tap->txa_tid; - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].short_retries = rtsfailcnt; - res = NULL; - ssn = 0; - if (!IEEE80211_AMPDU_RUNNING(tap)) { - res = tap->txa_private; - ssn = tap->txa_start & 0xfff; - } + DPRINTF(sc, IWN_DEBUG_AMPDU, "%s: nframes %d start %d bitmap %016jX\n", + __func__, nframes, start, (uintmax_t)bitmap); - /* This is going nframes DWORDS into the descriptor? */ - seqno = le32toh(*(status + nframes)) & 0xfff; - for (lastidx = (seqno & 0xff); ring->read != lastidx;) { - data = &ring->data[ring->read]; + i = ring->read; - /* Unmap and free mbuf. */ - bus_dmamap_sync(ring->data_dmat, data->map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(ring->data_dmat, data->map); - m = data->m, data->m = NULL; - ni = data->ni, data->ni = NULL; + for (tx_err = 0; + i != wn->agg[tid].startidx; + i = (i + 1) % IWN_TX_RING_COUNT) { + data = &ring->data[i]; + data->remapped = 0; + if (data->m == NULL) + continue; - KASSERT(ni != NULL, ("no node")); - KASSERT(m != NULL, ("no mbuf")); - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: freeing m=%p\n", __func__, m); - ieee80211_tx_complete(ni, m, 1); - - ring->queued--; - ring->read = (ring->read + 1) % IWN_TX_RING_COUNT; + tx_err++; + iwn_agg_tx_complete(sc, ring, tid, i, 0); } - if (ring->queued == 0 && res != NULL) { - iwn_nic_lock(sc); - ops->ampdu_tx_stop(sc, qid, tid, ssn); - iwn_nic_unlock(sc); - sc->qid2tap[qid] = NULL; - free(res, M_DEVBUF); - return; - } + ring->read = wn->agg[tid].startidx; + ring->queued -= tx_err; - sc->sc_tx_timer = 0; - if (ring->queued < IWN_TX_RING_LOMARK) - sc->qfullmsk &= ~(1 << ring->qid); + iwn_check_tx_ring(sc, qid); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); } @@ -4369,7 +4545,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; uint32_t flags; - uint16_t seqno, qos; + uint16_t qos; uint8_t tid, type; int ac, totlen, rate; @@ -4411,25 +4587,17 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru */ ac = M_WME_GETAC(m); - seqno = ni->ni_txseqs[tid]; if (m->m_flags & M_AMPDU_MPDU) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; - if (!IEEE80211_AMPDU_RUNNING(tap)) { + if (!IEEE80211_AMPDU_RUNNING(tap)) return (EINVAL); - } - /* - * Queue this frame to the hardware ring that we've - * negotiated AMPDU TX on. - * - * Note that the sequence number must match the TX slot - * being used! - */ + /* NB: clear Fragment Number field. */ + /* XXX move this to net80211 */ + *(uint16_t *)wh->i_seq = 0; + ac = *(int *)tap->txa_private; - *(uint16_t *)wh->i_seq = - htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); - ni->ni_txseqs[tid]++; } /* Encrypt the frame if need be. */ @@ -4498,15 +4666,42 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru } ring = &sc->txq[ac]; - if ((m->m_flags & M_AMPDU_MPDU) != 0 && - (seqno % 256) != ring->cur) { - device_printf(sc->sc_dev, - "%s: m=%p: seqno (%d) (%d) != ring index (%d) !\n", - __func__, - m, - seqno, - seqno % 256, - ring->cur); + if (m->m_flags & M_AMPDU_MPDU) { + uint16_t seqno = ni->ni_txseqs[tid]; + + if (ring->queued > IWN_TX_RING_COUNT / 2 && + (ring->cur + 1) % IWN_TX_RING_COUNT == ring->read) { + DPRINTF(sc, IWN_DEBUG_AMPDU, "%s: no more space " + "(queued %d) left in %d queue!\n", + __func__, ring->queued, ac); + return (ENOBUFS); + } + + /* + * Queue this frame to the hardware ring that we've + * negotiated AMPDU TX on. + * + * Note that the sequence number must match the TX slot + * being used! + */ + if ((seqno % 256) != ring->cur) { + device_printf(sc->sc_dev, + "%s: m=%p: seqno (%d) (%d) != ring index (%d) !\n", + __func__, + m, + seqno, + seqno % 256, + ring->cur); + + /* XXX until D9195 will not be committed */ + ni->ni_txseqs[tid] &= ~0xff; + ni->ni_txseqs[tid] += ring->cur; + seqno = ni->ni_txseqs[tid]; + } + + *(uint16_t *)wh->i_seq = + htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + ni->ni_txseqs[tid]++; } /* Prepare TX firmware command. */ @@ -4667,6 +4862,13 @@ iwn_tx_cmd(struct iwn_softc *sc, struct mbuf *m, struc desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; + + if (__predict_false(data->m != NULL || data->ni != NULL)) { + device_printf(sc->sc_dev, "%s: ni (%p) or m (%p) for idx %d " + "in queue %d is not NULL!\n", __func__, data->ni, data->m, + ring->cur, ring->qid); + return EIO; + } /* Prepare TX firmware command. */ cmd = &ring->cmd[ring->cur]; Modified: head/sys/dev/iwn/if_iwn_debug.h ============================================================================== --- head/sys/dev/iwn/if_iwn_debug.h Wed Jan 16 12:12:40 2019 (r343093) +++ head/sys/dev/iwn/if_iwn_debug.h Wed Jan 16 12:33:06 2019 (r343094) @@ -44,6 +44,7 @@ enum { IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ IWN_DEBUG_SCAN = 0x00008000, /* Scan related operations */ IWN_DEBUG_STATS = 0x00010000, /* Statistics updates */ + IWN_DEBUG_AMPDU = 0x00020000, /* A-MPDU specific Tx */ IWN_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Wed Jan 16 12:12:40 2019 (r343093) +++ head/sys/dev/iwn/if_iwnreg.h Wed Jan 16 12:33:06 2019 (r343094) @@ -1378,10 +1378,17 @@ struct iwn_ucode_info { #define IWN_AGG_TX_STATUS_MSK 0x00000fff #define IWN_AGG_TX_TRY_MSK 0x0000f000 +#define IWN_AGG_TX_TRY_POS 12 +#define IWN_AGG_TX_TRY_COUNT(status) \ + (((status) & IWN_AGG_TX_TRY_MSK) >> IWN_AGG_TX_TRY_POS) #define IWN_AGG_TX_STATE_LAST_SENT_MSK \ (IWN_AGG_TX_STATE_LAST_SENT_TTL_MSK | \ IWN_AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK) + +#define IWN_AGG_TX_STATE_IGNORE_MASK \ + (IWN_AGG_TX_STATE_FEW_BYTES_MSK | \ + IWN_AGG_TX_STATE_ABORT_MSK) /* # tx attempts for first frame in aggregation */ #define IWN_AGG_TX_STATE_TRY_CNT_POS 12 Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Wed Jan 16 12:12:40 2019 (r343093) +++ head/sys/dev/iwn/if_iwnvar.h Wed Jan 16 12:33:06 2019 (r343094) @@ -100,6 +100,11 @@ struct iwn_tx_data { bus_addr_t scratch_paddr; struct mbuf *m; struct ieee80211_node *ni; + unsigned int remapped:1; + unsigned int long_retries:7; +#define IWN_LONG_RETRY_FW_OVERFLOW 0x10 +#define IWN_LONG_RETRY_LIMIT_LOG 7 +#define IWN_LONG_RETRY_LIMIT ((1 << IWN_LONG_RETRY_LIMIT_LOG) - 3) }; struct iwn_tx_ring { @@ -138,8 +143,8 @@ struct iwn_node { uint8_t id; struct { uint64_t bitmap; + int short_retries; int startidx; - int nframes; } agg[IEEE80211_TID_SIZE]; }; From owner-svn-src-head@freebsd.org Wed Jan 16 12:48:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6F1A1487023; Wed, 16 Jan 2019 12:48:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D30CF6C3D6; Wed, 16 Jan 2019 12:48:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x0GCmo1U036514 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Jan 2019 14:48:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x0GCmo1U036514 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x0GCmn0b036513; Wed, 16 Jan 2019 14:48:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Jan 2019 14:48:49 +0200 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343093 - in head: include lib/libc/gen libexec/rtld-elf Message-ID: <20190116124849.GI26174@kib.kiev.ua> References: <201901161212.x0GCCeRh024502@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201901161212.x0GCCeRh024502@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 12:48:59 -0000 On Wed, Jan 16, 2019 at 12:12:40PM +0000, Dag-Erling Smørgrav wrote: > Author: des > Date: Wed Jan 16 12:12:40 2019 > New Revision: 343093 > URL: https://svnweb.freebsd.org/changeset/base/343093 > > Log: > Implement dlopenat(3). > > MFC after: 3 weeks > > Modified: > head/include/dlfcn.h > head/lib/libc/gen/dlopen.3 > head/libexec/rtld-elf/rtld.c > It is non-functional: - The new symbol is not exported from rtld, so it cannot be referenced at runtime. - libc does not provide stubs for static linker and statically linked binaries, so nothing can be linked against it. That said, why is it useful to have this function when we already have fdlopen(3) ? From owner-svn-src-head@freebsd.org Wed Jan 16 14:42:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8929D148AA2D; Wed, 16 Jan 2019 14:42:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 279A470749; Wed, 16 Jan 2019 14:42:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A70D3BDB; Wed, 16 Jan 2019 14:42:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GEgX9k002395; Wed, 16 Jan 2019 14:42:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GEgX1x002394; Wed, 16 Jan 2019 14:42:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901161442.x0GEgX1x002394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 16 Jan 2019 14:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343095 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 343095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 279A470749 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 14:42:34 -0000 Author: kevans Date: Wed Jan 16 14:42:33 2019 New Revision: 343095 URL: https://svnweb.freebsd.org/changeset/base/343095 Log: awg: Move MAC soft reset to awg_init_locked to avoid soft reset timeout From NetBSD: Since the MAC can get stuck in reset state with no link, ignore reset timeouts and continue with initializing the device. Fixes "soft reset timeout" issue at boot with no network cable plugged in. awg_init may be called multiple times throughout normal interface usage, so the tx/rx descriptor base address registers must be written after each MAC reset and are moved as such. This problem has been observed on FreeBSD, H3/H2+ devices with an internal PHY (includes OrangePi R1, OrangePi One at least). Reviewed by: manu, ganbold Obtained from: NetBSD MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18844 Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Jan 16 12:33:06 2019 (r343094) +++ head/sys/arm/allwinner/if_awg.c Wed Jan 16 14:42:33 2019 (r343095) @@ -750,6 +750,31 @@ awg_disable_intr(struct awg_softc *sc) WR4(sc, EMAC_INT_EN, 0); } +static int +awg_reset(struct awg_softc *sc) +{ + int retry; + + /* Soft reset all registers and logic */ + WR4(sc, EMAC_BASIC_CTL_1, BASIC_CTL_SOFT_RST); + + /* Wait for soft reset bit to self-clear */ + for (retry = SOFT_RST_RETRY; retry > 0; retry--) { + if ((RD4(sc, EMAC_BASIC_CTL_1) & BASIC_CTL_SOFT_RST) == 0) + break; + DELAY(10); + } + if (retry == 0) { + device_printf(sc->dev, "soft reset timed out\n"); +#ifdef AWG_DEBUG + awg_dump_regs(sc->dev); +#endif + return (ETIMEDOUT); + } + + return (0); +} + static void awg_init_locked(struct awg_softc *sc) { @@ -765,6 +790,12 @@ awg_init_locked(struct awg_softc *sc) if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) return; + awg_reset(sc); + + /* Write transmit and receive descriptor base address registers */ + WR4(sc, EMAC_TX_DMA_LIST, sc->tx.desc_ring_paddr); + WR4(sc, EMAC_RX_DMA_LIST, sc->rx.desc_ring_paddr); + awg_setup_rxfilter(sc); /* Configure DMA burst length and priorities */ @@ -1653,40 +1684,6 @@ awg_phy_reset(device_t dev) return (0); } -static int -awg_reset(device_t dev) -{ - struct awg_softc *sc; - int retry; - - sc = device_get_softc(dev); - - /* Reset PHY if necessary */ - if (awg_phy_reset(dev) != 0) { - device_printf(dev, "failed to reset PHY\n"); - return (ENXIO); - } - - /* Soft reset all registers and logic */ - WR4(sc, EMAC_BASIC_CTL_1, BASIC_CTL_SOFT_RST); - - /* Wait for soft reset bit to self-clear */ - for (retry = SOFT_RST_RETRY; retry > 0; retry--) { - if ((RD4(sc, EMAC_BASIC_CTL_1) & BASIC_CTL_SOFT_RST) == 0) - break; - DELAY(10); - } - if (retry == 0) { - device_printf(dev, "soft reset timed out\n"); -#ifdef AWG_DEBUG - awg_dump_regs(dev); -#endif - return (ETIMEDOUT); - } - - return (0); -} - static void awg_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -1840,10 +1837,6 @@ awg_setup_dma(device_t dev) bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, BUS_DMASYNC_PREWRITE); - /* Write transmit and receive descriptor base address registers */ - WR4(sc, EMAC_TX_DMA_LIST, sc->tx.desc_ring_paddr); - WR4(sc, EMAC_RX_DMA_LIST, sc->rx.desc_ring_paddr); - return (0); } @@ -1888,10 +1881,12 @@ awg_attach(device_t dev) /* Read MAC address before resetting the chip */ awg_get_eaddr(dev, eaddr); - /* Soft reset EMAC core */ - error = awg_reset(dev); - if (error != 0) + /* Reset PHY if necessary */ + error = awg_phy_reset(dev); + if (error != 0) { + device_printf(dev, "failed to reset PHY\n"); return (error); + } /* Setup DMA descriptors */ error = awg_setup_dma(dev); From owner-svn-src-head@freebsd.org Wed Jan 16 15:49:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3327F148CAD1 for ; Wed, 16 Jan 2019 15:49:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82F287314E for ; Wed, 16 Jan 2019 15:49:34 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1547652751; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=QI+1ra049tWPKVNACCg26DLSBJKQ/rigc2eHhIelXfDxnR13I+VL2j1MDw+vLn099E0OL8DRdlxMD l/fJXn+dOi/rKaQlbbDi4SGqnmmRcHiuM1y1L+EdMNlF2B17FhR87kOFdW8b5qZfzb0pw/6knxI4UP kpTElvtRXWTG+P0mSZOlkl0i2JnC0/5VpyM5N5jA4Ayjen2O7e0hRID9dQ2H59DxtPBkc6TbsvBttr hLhko2SNUmNIjNZY8sZNLH1QsFcnXMuSKrEpu61fOalwrHJ+QdhChdvtW5JxLizkmGXPMrp9nxSAdV 3XbkePeUvSjZxqAqfpKlgGvJlDn0BkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=yAC8gX5qGWhxdWU0hKZhTTczYvKmL+gAY2fQsFsM/is=; b=qAGLqaZ4yt60wYqO5WBGFUBqLIi/yB4MLgO0KUk3D6QKyPWhLjlayE3RUlddGko/N3+5L0JtsQ0O2 QVCDi6pkn06pnxszlGtK911jyY762/NgA1IMG/z+O/rPe0vYJB+Z0BSFTMyzih76IW1Yu3yyCzVBD6 sTKKbBqnS3MSw4N2TJj6I4KDsoQgRLOC37otC9KIgsRcXXTEAoKPMIHv+onzoZ3U5hp+3OYljTQHi/ CqqK8+gjcUC6CMDgw+hJ6rWu7Z8lGBqPPOf+0TA6R556GXvqSOJIMKoXHrmzTl6Z9pc9PWu+m1yOu/ GgwvHSYLZs9PZsOUca/S05bzIUHVb1g== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=yAC8gX5qGWhxdWU0hKZhTTczYvKmL+gAY2fQsFsM/is=; b=Ucts5aWcpB3WKJtLTVJyTsR39vbkbszqqaso71VKvDrgaYHVRJc8qV6IsiXGVO54UyTKGySUMM59E pwmwt98suz/8L0qQ8LfwmVN7FxwEJTTZJ3vRVEc0rvTfQeqHF6L6J5HEL18Jv6AW2itR6n901THCrp XGXiQrRG0qa65X28MJWGSxwm2u3gs1To9xOBnmQ7cn38lRrW9jM/tdBMAwH2S/ad8FPnCJLHy2htr8 d0J9R1JnlqCxvnNGIPjP6TMKf8a/WuV0zapr2P+NyYCeyOd1MJu3ephKLylxJGNm8hFrnnJRNumRDP H8TGBfA8OzpbMBlSklBPV4jiKgzuPrQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: ef4683c3-19a3-11e9-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id ef4683c3-19a3-11e9-a59a-7b143e15dabc; Wed, 16 Jan 2019 15:32:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0GFXMKI074617; Wed, 16 Jan 2019 08:33:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <604708565c923c1fdba0924ccc497ee5cb6595d8.camel@freebsd.org> Subject: Re: svn commit: r343058 - in head/sys: compat/linuxkpi/common/src vm From: Ian Lepore To: Gleb Smirnoff Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 16 Jan 2019 08:33:22 -0700 In-Reply-To: <20190115203316.GA18452@FreeBSD.org> References: <201901151933.x0FJXl8a069317@repo.freebsd.org> <20190115134623.139064b2@titan.knownspace> <20190115200617.GZ18452@FreeBSD.org> <79ee763bb72a47f3e7888caf266174a62c23e532.camel@freebsd.org> <20190115203316.GA18452@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 82F287314E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 15:49:35 -0000 On Tue, 2019-01-15 at 12:33 -0800, Gleb Smirnoff wrote: > On Tue, Jan 15, 2019 at 01:20:14PM -0700, Ian Lepore wrote: > I> On Tue, 2019-01-15 at 12:06 -0800, Gleb Smirnoff wrote: > I> > On Tue, Jan 15, 2019 at 01:46:23PM -0600, Justin Hibbits wrote: > I> > J> Why not #include counter.h in the relevant vm_machdep.c files > I> > instead? > I> > > I> > This also is ugly :( Not sure more or less. Probably less, but I > I> > urged to plug all possible compilation failures at a time. > I> > > I> > What is ugly is that most files just need counter_u64_t size, > I> > and they don't use counter(9) KPI. > I> > > I> > The fact that vm_machdep or Linux KPI want to look into internal > I> > type uma_zone_t is also ugly. > I> > > I> > I> Isn't the usual fix for this problem to create a __counter_u64_t > in > I> sys/types.h and use it in places where including the full header > file > I> is undesirable for some reason? > > I'm inclined to this solution. Do you want to sign up as reviewer? :) > I can barely keep up with reading all my freebsd-related email these days, I'd better not commit to a review that I may not actually get around to. :/ -- Ian From owner-svn-src-head@freebsd.org Wed Jan 16 20:14:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05C71494071; Wed, 16 Jan 2019 20:14:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61D8B8593B; Wed, 16 Jan 2019 20:14:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 331C273B0; Wed, 16 Jan 2019 20:14:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GKEHw2078221; Wed, 16 Jan 2019 20:14:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GKEG9w078218; Wed, 16 Jan 2019 20:14:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901162014.x0GKEG9w078218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Jan 2019 20:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343100 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61D8B8593B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 20:14:18 -0000 Author: glebius Date: Wed Jan 16 20:14:16 2019 New Revision: 343100 URL: https://svnweb.freebsd.org/changeset/base/343100 Log: Do not reserve KVA for paging bufs in vm_ksubmap_init(), since now they allocate it in pbuf_init(). This should have been done together with r343030. Modified: head/sys/vm/vm_init.c head/sys/vm/vm_kern.h head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Wed Jan 16 19:20:14 2019 (r343099) +++ head/sys/vm/vm_init.c Wed Jan 16 20:14:16 2019 (r343100) @@ -221,11 +221,9 @@ again: panic("startup: table size inconsistency"); /* - * Allocate the clean map to hold all of the paging and I/O virtual - * memory. + * Allocate the clean map to hold all of I/O virtual memory. */ - size = (long)nbuf * BKVASIZE + (long)nswbuf * MAXPHYS + - (long)bio_transient_maxcnt * MAXPHYS; + size = (long)nbuf * BKVASIZE + (long)bio_transient_maxcnt * MAXPHYS; kmi->clean_sva = firstaddr = kva_alloc(size); kmi->clean_eva = firstaddr + size; @@ -240,13 +238,6 @@ again: kmi->buffer_eva = kmi->buffer_sva + size; vmem_init(buffer_arena, "buffer arena", kmi->buffer_sva, size, PAGE_SIZE, (mp_ncpus > 4) ? BKVASIZE * 8 : 0, 0); - firstaddr += size; - - /* - * Now swap kva. - */ - swapbkva = firstaddr; - size = (long)nswbuf * MAXPHYS; firstaddr += size; /* Modified: head/sys/vm/vm_kern.h ============================================================================== --- head/sys/vm/vm_kern.h Wed Jan 16 19:20:14 2019 (r343099) +++ head/sys/vm/vm_kern.h Wed Jan 16 20:14:16 2019 (r343100) @@ -74,7 +74,6 @@ extern struct vmem *kmem_arena; extern struct vmem *buffer_arena; extern struct vmem *transient_arena; extern struct vmem *memguard_arena; -extern vm_offset_t swapbkva; extern u_long vm_kmem_size; extern u_int exec_map_entries; extern u_int exec_map_entry_size; Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Wed Jan 16 19:20:14 2019 (r343099) +++ head/sys/vm/vm_pager.c Wed Jan 16 20:14:16 2019 (r343100) @@ -163,16 +163,6 @@ struct pagerops *pagertab[] = { &mgtdevicepagerops, /* OBJT_MGTDEVICE */ }; -/* - * Kernel address space for mapping pages. - * Used by pagers where KVAs are needed for IO. - * - * XXX needs to be large enough to support the number of pending async - * cleaning requests (NPENDINGIO == 64) * the maximum swap cluster size - * (MAXPHYS == 64k) if you want to get the most efficiency. - */ -vm_offset_t swapbkva; /* swap buffers kva */ - void vm_pager_init(void) { From owner-svn-src-head@freebsd.org Wed Jan 16 20:20:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B06414941BC; Wed, 16 Jan 2019 20:20:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D32C185BFA; Wed, 16 Jan 2019 20:20:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5DBB73BC; Wed, 16 Jan 2019 20:20:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GKKclS078698; Wed, 16 Jan 2019 20:20:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GKKcCP078696; Wed, 16 Jan 2019 20:20:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901162020.x0GKKcCP078696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Jan 2019 20:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343101 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D32C185BFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 20:20:39 -0000 Author: glebius Date: Wed Jan 16 20:20:38 2019 New Revision: 343101 URL: https://svnweb.freebsd.org/changeset/base/343101 Log: Fix mistake in r343030: move nswbuf calculation back to kern_vfs_bio_buffer_alloc(), because in init_param2() nbuf isn't really initialized yet. Pointed out by: bde Modified: head/sys/kern/subr_param.c head/sys/kern/vfs_bio.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Wed Jan 16 20:14:16 2019 (r343100) +++ head/sys/kern/subr_param.c Wed Jan 16 20:20:38 2019 (r343101) @@ -291,10 +291,7 @@ init_param2(long physpages) * Physical buffers are pre-allocated buffers (struct buf) that * are used as temporary holders for I/O, such as paging I/O. */ - nswbuf = min(nbuf / 4, 256); TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); - if (nswbuf < NSWBUF_MIN) - nswbuf = NSWBUF_MIN; /* * The default for maxpipekva is min(1/64 of the kernel address space, Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Jan 16 20:14:16 2019 (r343100) +++ head/sys/kern/vfs_bio.c Wed Jan 16 20:20:38 2019 (r343101) @@ -1124,6 +1124,12 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) nbuf = buf_sz / BKVASIZE; } + if (nswbuf == 0) { + nswbuf = min(nbuf / 4, 256); + if (nswbuf < NSWBUF_MIN) + nswbuf = NSWBUF_MIN; + } + /* * Reserve space for the buffer cache buffers */ From owner-svn-src-head@freebsd.org Wed Jan 16 20:46:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 212B81494ECD; Wed, 16 Jan 2019 20:46:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B73A786DA1; Wed, 16 Jan 2019 20:46:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8949278C7; Wed, 16 Jan 2019 20:46:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GKkeiu094440; Wed, 16 Jan 2019 20:46:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GKkeBw094439; Wed, 16 Jan 2019 20:46:40 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901162046.x0GKkeBw094439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 16 Jan 2019 20:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343103 - head/contrib/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter X-SVN-Commit-Revision: 343103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B73A786DA1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 20:46:41 -0000 Author: cy Date: Wed Jan 16 20:46:39 2019 New Revision: 343103 URL: https://svnweb.freebsd.org/changeset/base/343103 Log: Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was no longer needed. MFC after: 1 week Deleted: head/contrib/ipfilter/pcap-bpf.h From owner-svn-src-head@freebsd.org Wed Jan 16 21:13:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64FEA1495F75; Wed, 16 Jan 2019 21:13:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0907A87F80; Wed, 16 Jan 2019 21:13:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7D9A7DCA; Wed, 16 Jan 2019 21:13:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GLDoT3010110; Wed, 16 Jan 2019 21:13:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GLDorU010109; Wed, 16 Jan 2019 21:13:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901162113.x0GLDorU010109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 16 Jan 2019 21:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343104 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 343104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0907A87F80 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 21:13:51 -0000 Author: gonzo Date: Wed Jan 16 21:13:50 2019 New Revision: 343104 URL: https://svnweb.freebsd.org/changeset/base/343104 Log: [mv] Fix invalid condition in fdt_fixup_ranges Add parentheses to perform assignment before comparison. The prior condition worked because fdt_parent_addr_cells returns 1 for the DTB on which fdt_fixup_ranges is called and accidentally par_addr_cells ends up to be set to the same value. PR: 210705 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/arm/mv/mv_common.c Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed Jan 16 20:46:39 2019 (r343103) +++ head/sys/arm/mv/mv_common.c Wed Jan 16 21:13:50 2019 (r343104) @@ -2935,7 +2935,7 @@ fdt_fixup_ranges(phandle_t root) /* Fix-up SoC ranges according to real fdt_immr_pa */ if ((node = fdt_find_compatible(root, "simple-bus", 1)) != 0) { if (fdt_addrsize_cells(node, &addr_cells, &size_cells) == 0 && - (par_addr_cells = fdt_parent_addr_cells(node) <= 2)) { + ((par_addr_cells = fdt_parent_addr_cells(node)) <= 2)) { tuple_size = sizeof(pcell_t) * (par_addr_cells + addr_cells + size_cells); len = OF_getprop(node, "ranges", ranges, From owner-svn-src-head@freebsd.org Wed Jan 16 21:59:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D03821496C39; Wed, 16 Jan 2019 21:59:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B9F18933B; Wed, 16 Jan 2019 21:59:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB4F84DD; Wed, 16 Jan 2019 21:59:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GLxJkj031322; Wed, 16 Jan 2019 21:59:19 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GLxJaA031321; Wed, 16 Jan 2019 21:59:19 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901162159.x0GLxJaA031321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 16 Jan 2019 21:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343105 - head/lib/libedit X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/lib/libedit X-SVN-Commit-Revision: 343105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B9F18933B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 21:59:20 -0000 Author: jilles Date: Wed Jan 16 21:59:18 2019 New Revision: 343105 URL: https://svnweb.freebsd.org/changeset/base/343105 Log: libedit: Avoid out of bounds read in 'bind' command This is CVS revision 1.31 from NetBSD lib/libedit/chartype.c: Make sure that argv is NULL terminated since functions like tty_stty rely on it to be so (Gerry Swinslow) This broke when the wide-character support was enabled in libedit. The conversion from multibyte to wide-character did not supply the apparently expected terminating NULL in the new argv array. PR: 233343 Submitted by: Yuichiro NAITO Obtained from: NetBSD MFC after: 1 week Modified: head/lib/libedit/chartype.c Modified: head/lib/libedit/chartype.c ============================================================================== --- head/lib/libedit/chartype.c Wed Jan 16 21:13:50 2019 (r343104) +++ head/lib/libedit/chartype.c Wed Jan 16 21:59:18 2019 (r343105) @@ -157,7 +157,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1) return NULL; - wargv = el_malloc((size_t)argc * sizeof(*wargv)); + wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv)); for (i = 0, p = conv->wbuff; i < argc; ++i) { if (!argv[i]) { /* don't pass null pointers to mbstowcs */ @@ -175,6 +175,7 @@ ct_decode_argv(int argc, const char *argv[], ct_buffer bufspace -= (size_t)bytes; p += bytes; } + wargv[i] = NULL; return wargv; } From owner-svn-src-head@freebsd.org Wed Jan 16 22:29:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49E8314978B3; Wed, 16 Jan 2019 22:29:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEBAF8A330; Wed, 16 Jan 2019 22:29:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0CA789F0; Wed, 16 Jan 2019 22:29:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GMTYqk046944; Wed, 16 Jan 2019 22:29:34 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GMTY0U046942; Wed, 16 Jan 2019 22:29:34 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901162229.x0GMTY0U046942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 16 Jan 2019 22:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343106 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEBAF8A330 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 16 Jan 2019 22:29:35 -0000 Author: gonzo Date: Wed Jan 16 22:29:34 2019 New Revision: 343106 URL: https://svnweb.freebsd.org/changeset/base/343106 Log: [usb] Add quirk for SmartG2 USB memory key PR: 167001 Submitted by: Daan Vreeken [PA4DAN] MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 16 21:59:18 2019 (r343105) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 16 22:29:34 2019 (r343106) @@ -498,6 +498,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(QUALCOMMINC, ZTE_MF730M, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0), + USB_QUIRK(SMART2, G2MEMKEY, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 16 21:59:18 2019 (r343105) +++ head/sys/dev/usb/usbdevs Wed Jan 16 22:29:34 2019 (r343106) @@ -561,6 +561,7 @@ vendor NETAC 0x0dd8 Netac vendor SITECOMEU 0x0df6 Sitecom Europe vendor MOBILEACTION 0x0df7 Mobile Action vendor AMIGO 0x0e0b Amigo Technology +vendor SMART2 0x0e39 Smart Modular Technologies vendor SPEEDDRAGON 0x0e55 Speed Dragon Multimedia vendor HAWKING 0x0e66 Hawking vendor FOSSIL 0x0e67 Fossil, Inc @@ -4372,6 +4373,9 @@ product SKANHEX SX_520Z 0x5200 SX 520z Camera /* Smart Technologies products */ product SMART PL2303 0x2303 Serial adapter + +/* Smart Modular Technologies products */ +product SMART2 G2MEMKEY 0x1700 G2 Memory Key /* SmartBridges products */ product SMARTBRIDGES SMARTLINK 0x0001 SmartLink USB Ethernet From owner-svn-src-head@freebsd.org Thu Jan 17 05:15:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61AB51481726; Thu, 17 Jan 2019 05:15:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07B5D72856; Thu, 17 Jan 2019 05:15:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AFFD720; Thu, 17 Jan 2019 05:15:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0H5FP47061634; Thu, 17 Jan 2019 05:15:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0H5FPag061633; Thu, 17 Jan 2019 05:15:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901170515.x0H5FPag061633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 Jan 2019 05:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343108 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 343108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07B5D72856 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 05:15:26 -0000 Author: kib Date: Thu Jan 17 05:15:25 2019 New Revision: 343108 URL: https://svnweb.freebsd.org/changeset/base/343108 Log: Trim whitespace at EoL, use tabs instead of spaces for indent. PR: 235004 Submitted by: Jose Luis Duran MFC after: 3 days Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Jan 17 04:51:05 2019 (r343107) +++ head/sys/amd64/vmm/intel/vmx.c Thu Jan 17 05:15:25 2019 (r343108) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); (PROCBASED_INT_WINDOW_EXITING | \ PROCBASED_NMI_WINDOW_EXITING) -#define PROCBASED_CTLS_ONE_SETTING \ +#define PROCBASED_CTLS_ONE_SETTING \ (PROCBASED_SECONDARY_CONTROLS | \ PROCBASED_MWAIT_EXITING | \ PROCBASED_MONITOR_EXITING | \ @@ -428,7 +428,7 @@ vmx_allow_x2apic_msrs(struct vmx *vmx) for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_TMR0 + i); - + for (i = 0; i < 8; i++) error += guest_msr_ro(vmx, MSR_APIC_IRR0 + i); @@ -576,7 +576,7 @@ vmx_disable(void *arg __unused) static int vmx_cleanup(void) { - + if (pirvec >= 0) lapic_ipi_free(pirvec); @@ -1097,7 +1097,7 @@ static int vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx) { int handled, func; - + func = vmxctx->guest_rax; handled = x86_emulate_cpuid(vm, vcpu, @@ -3096,7 +3096,7 @@ vmx_get_intr_shadow(struct vmx *vmx, int vcpu, int run uint64_t gi; int error; - error = vmcs_getreg(&vmx->vmcs[vcpu], running, + error = vmcs_getreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_GUEST_INTERRUPTIBILITY), &gi); *retval = (gi & HWINTR_BLOCKING) ? 1 : 0; return (error); @@ -3140,8 +3140,8 @@ vmx_shadow_reg(int reg) switch (reg) { case VM_REG_GUEST_CR0: shreg = VMCS_CR0_SHADOW; - break; - case VM_REG_GUEST_CR4: + break; + case VM_REG_GUEST_CR4: shreg = VMCS_CR4_SHADOW; break; default: @@ -3212,7 +3212,7 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (shadow > 0) { /* * Store the unmodified value in the shadow - */ + */ error = vmcs_setreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(shadow), val); } @@ -3395,7 +3395,7 @@ vmx_setcap(void *arg, int vcpu, int type, int val) } } - return (retval); + return (retval); } struct vlapic_vtx { @@ -3698,7 +3698,7 @@ vmx_vlapic_init(void *arg, int vcpuid) struct vmx *vmx; struct vlapic *vlapic; struct vlapic_vtx *vlapic_vtx; - + vmx = arg; vlapic = malloc(sizeof(struct vlapic_vtx), M_VLAPIC, M_WAITOK | M_ZERO); From owner-svn-src-head@freebsd.org Thu Jan 17 04:51:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED2414A77F6; Thu, 17 Jan 2019 04:51:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50A6A71B81; Thu, 17 Jan 2019 04:51:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 365A0D22C; Thu, 17 Jan 2019 04:51:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0H4p6vP047421; Thu, 17 Jan 2019 04:51:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0H4p6n4047420; Thu, 17 Jan 2019 04:51:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901170451.x0H4p6n4047420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 Jan 2019 04:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343107 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50A6A71B81 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 04:51:06 -0000 Author: kib Date: Thu Jan 17 04:51:05 2019 New Revision: 343107 URL: https://svnweb.freebsd.org/changeset/base/343107 Log: Re-wrap long line after r341827. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Jan 16 22:29:34 2019 (r343106) +++ head/sys/kern/kern_fork.c Thu Jan 17 04:51:05 2019 (r343107) @@ -882,7 +882,9 @@ fork1(struct thread *td, struct fork_req *fr) * processes; don't let root exceed the limit. */ nprocs_new = atomic_fetchadd_int(&nprocs, 1) + 1; - if ((nprocs_new >= maxproc - 10 && priv_check_cred(td->td_ucred, PRIV_MAXPROC) != 0) || nprocs_new >= maxproc) { + if ((nprocs_new >= maxproc - 10 && + priv_check_cred(td->td_ucred, PRIV_MAXPROC) != 0) || + nprocs_new >= maxproc) { error = EAGAIN; sx_xlock(&allproc_lock); if (ppsratecheck(&lastfail, &curfail, 1)) { From owner-svn-src-head@freebsd.org Thu Jan 17 06:22:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF8F1484E25; Thu, 17 Jan 2019 06:22:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B8D75626; Thu, 17 Jan 2019 06:22:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2988BE2CC; Thu, 17 Jan 2019 06:22:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0H6MFS2097996; Thu, 17 Jan 2019 06:22:15 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0H6MFMT097995; Thu, 17 Jan 2019 06:22:15 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901170622.x0H6MFMT097995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 17 Jan 2019 06:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343109 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35B8D75626 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 06:22:15 -0000 Author: gonzo Date: Thu Jan 17 06:22:14 2019 New Revision: 343109 URL: https://svnweb.freebsd.org/changeset/base/343109 Log: Add optional obsolete files for the installworld without sendmail Add two more entries for WITHOUT_SENDMAIL install. The /var/spool/clientmqueue entry would be deleted only if there are no files/dirs in it, so the content generated during previous lifecycle of the system is safe PR: 228484 Submitted by: Dmitry Wagin MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 17 05:15:25 2019 (r343108) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 17 06:22:14 2019 (r343109) @@ -7354,6 +7354,7 @@ OLD_FILES+=usr/share/man/man8/rtquery.8.gz .endif .if ${MK_SENDMAIL} == no +OLD_FILES+=etc/mtree/BSD.sendmail.dist OLD_FILES+=etc/newsyslog.conf.d/sendmail.conf OLD_FILES+=etc/periodic/daily/150.clean-hoststat OLD_FILES+=etc/periodic/daily/440.status-mailq @@ -7592,6 +7593,7 @@ OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.ucbva OLD_DIRS+=usr/share/sendmail/cf/siteconfig OLD_DIRS+=usr/share/sendmail/cf OLD_DIRS+=usr/share/sendmail +OLD_DIRS+=var/spool/clientmqueue .endif .if ${MK_SERVICESDB} == no From owner-svn-src-head@freebsd.org Thu Jan 17 06:34:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D184514857E4; Thu, 17 Jan 2019 06:34:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C24276054; Thu, 17 Jan 2019 06:34:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA47E498; Thu, 17 Jan 2019 06:34:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0H6YetI003659; Thu, 17 Jan 2019 06:34:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0H6YeO5003658; Thu, 17 Jan 2019 06:34:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901170634.x0H6YeO5003658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 17 Jan 2019 06:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343110 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C24276054 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 06:34:41 -0000 Author: gonzo Date: Thu Jan 17 06:34:39 2019 New Revision: 343110 URL: https://svnweb.freebsd.org/changeset/base/343110 Log: Fix conditional obsolete files entry for WITHOUT_EXAMPLES Add all the files under /usr/share/examples to the MK_EXAMPLES section. OLD_DIRS entries are not removed if they're not empty so prior to this change WITHOUT_EXAMPLES didn't have significant effect on the updated system. PR: 228484 Submitted by: Dmitry Wagin (original patch) MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 17 06:22:14 2019 (r343109) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 17 06:34:39 2019 (r343110) @@ -2303,22 +2303,274 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat .endif .if ${MK_EXAMPLES} == no +OLD_FILES+=usr/share/examples/BSD_daemon/FreeBSD.pfa +OLD_FILES+=usr/share/examples/BSD_daemon/README +OLD_FILES+=usr/share/examples/BSD_daemon/beastie.eps +OLD_FILES+=usr/share/examples/BSD_daemon/beastie.fig +OLD_FILES+=usr/share/examples/BSD_daemon/eps.patch +OLD_FILES+=usr/share/examples/BSD_daemon/poster.sh +OLD_FILES+=usr/share/examples/FreeBSD_version/FreeBSD_version.c +OLD_FILES+=usr/share/examples/FreeBSD_version/Makefile +OLD_FILES+=usr/share/examples/FreeBSD_version/README +OLD_FILES+=usr/share/examples/IPv6/USAGE +OLD_FILES+=usr/share/examples/bhyve/vmrun.sh +OLD_FILES+=usr/share/examples/bootforth/README +OLD_FILES+=usr/share/examples/bootforth/boot.4th +OLD_FILES+=usr/share/examples/bootforth/frames.4th +OLD_FILES+=usr/share/examples/bootforth/loader.rc +OLD_FILES+=usr/share/examples/bootforth/menu.4th +OLD_FILES+=usr/share/examples/bootforth/menuconf.4th +OLD_FILES+=usr/share/examples/bootforth/screen.4th +OLD_FILES+=usr/share/examples/bsdconfig/add_some_packages.sh +OLD_FILES+=usr/share/examples/bsdconfig/browse_packages_http.sh +OLD_FILES+=usr/share/examples/bsdconfig/bsdconfigrc +OLD_FILES+=usr/share/examples/csh/dot.cshrc +OLD_FILES+=usr/share/examples/diskless/ME +OLD_FILES+=usr/share/examples/diskless/README.BOOTP +OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING +OLD_FILES+=usr/share/examples/diskless/clone_root +OLD_FILES+=usr/share/examples/dma/mailer.conf +OLD_FILES+=usr/share/examples/drivers/README +OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh +OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh +OLD_FILES+=usr/share/examples/dwatch/profile_template +OLD_FILES+=usr/share/examples/etc/README.examples +OLD_FILES+=usr/share/examples/etc/bsd-style-copyright +OLD_FILES+=usr/share/examples/etc/group +OLD_FILES+=usr/share/examples/etc/login.access +OLD_FILES+=usr/share/examples/etc/make.conf +OLD_FILES+=usr/share/examples/etc/rc.bsdextended +OLD_FILES+=usr/share/examples/etc/rc.firewall +OLD_FILES+=usr/share/examples/etc/rc.sendmail +OLD_FILES+=usr/share/examples/etc/termcap.small +OLD_FILES+=usr/share/examples/etc/wpa_supplicant.conf +OLD_FILES+=usr/share/examples/find_interface/Makefile +OLD_FILES+=usr/share/examples/find_interface/README +OLD_FILES+=usr/share/examples/find_interface/find_interface.c +OLD_FILES+=usr/share/examples/hast/ucarp.sh +OLD_FILES+=usr/share/examples/hast/ucarp_down.sh +OLD_FILES+=usr/share/examples/hast/ucarp_up.sh +OLD_FILES+=usr/share/examples/hast/vip-down.sh +OLD_FILES+=usr/share/examples/hast/vip-up.sh +OLD_FILES+=usr/share/examples/hostapd/hostapd.conf +OLD_FILES+=usr/share/examples/hostapd/hostapd.eap_user +OLD_FILES+=usr/share/examples/hostapd/hostapd.wpa_psk +OLD_FILES+=usr/share/examples/indent/indent.pro +OLD_FILES+=usr/share/examples/ipfilter/BASIC.NAT +OLD_FILES+=usr/share/examples/ipfilter/BASIC_1.FW +OLD_FILES+=usr/share/examples/ipfilter/BASIC_2.FW +OLD_FILES+=usr/share/examples/ipfilter/README +OLD_FILES+=usr/share/examples/ipfilter/example.1 +OLD_FILES+=usr/share/examples/ipfilter/example.10 +OLD_FILES+=usr/share/examples/ipfilter/example.11 +OLD_FILES+=usr/share/examples/ipfilter/example.12 +OLD_FILES+=usr/share/examples/ipfilter/example.13 +OLD_FILES+=usr/share/examples/ipfilter/example.14 +OLD_FILES+=usr/share/examples/ipfilter/example.2 +OLD_FILES+=usr/share/examples/ipfilter/example.3 +OLD_FILES+=usr/share/examples/ipfilter/example.4 +OLD_FILES+=usr/share/examples/ipfilter/example.5 +OLD_FILES+=usr/share/examples/ipfilter/example.6 +OLD_FILES+=usr/share/examples/ipfilter/example.7 +OLD_FILES+=usr/share/examples/ipfilter/example.8 +OLD_FILES+=usr/share/examples/ipfilter/example.9 +OLD_FILES+=usr/share/examples/ipfilter/example.sr +OLD_FILES+=usr/share/examples/ipfilter/examples.txt +OLD_FILES+=usr/share/examples/ipfilter/firewall +OLD_FILES+=usr/share/examples/ipfilter/firewall.1 +OLD_FILES+=usr/share/examples/ipfilter/firewall.2 +OLD_FILES+=usr/share/examples/ipfilter/ftp-proxy +OLD_FILES+=usr/share/examples/ipfilter/ftppxy +OLD_FILES+=usr/share/examples/ipfilter/ipf-howto.txt +OLD_FILES+=usr/share/examples/ipfilter/ipf.conf.permissive +OLD_FILES+=usr/share/examples/ipfilter/ipf.conf.restrictive +OLD_FILES+=usr/share/examples/ipfilter/ipf.conf.sample +OLD_FILES+=usr/share/examples/ipfilter/ipnat.conf.sample +OLD_FILES+=usr/share/examples/ipfilter/mkfilters +OLD_FILES+=usr/share/examples/ipfilter/nat-setup +OLD_FILES+=usr/share/examples/ipfilter/nat.eg +OLD_FILES+=usr/share/examples/ipfilter/rules.txt +OLD_FILES+=usr/share/examples/ipfilter/server +OLD_FILES+=usr/share/examples/ipfilter/tcpstate +OLD_FILES+=usr/share/examples/ipfw/change_rules.sh +OLD_FILES+=usr/share/examples/jails/README +OLD_FILES+=usr/share/examples/jails/VIMAGE +OLD_FILES+=usr/share/examples/jails/jail.xxx.conf +OLD_FILES+=usr/share/examples/jails/jib +OLD_FILES+=usr/share/examples/jails/jng +OLD_FILES+=usr/share/examples/jails/rc.conf.jails +OLD_FILES+=usr/share/examples/jails/rcjail.xxx.conf +OLD_FILES+=usr/share/examples/kld/Makefile +OLD_FILES+=usr/share/examples/kld/cdev/Makefile +OLD_FILES+=usr/share/examples/kld/cdev/README +OLD_FILES+=usr/share/examples/kld/cdev/module/Makefile +OLD_FILES+=usr/share/examples/kld/cdev/module/cdev.c +OLD_FILES+=usr/share/examples/kld/cdev/module/cdev.h +OLD_FILES+=usr/share/examples/kld/cdev/module/cdevmod.c +OLD_FILES+=usr/share/examples/kld/cdev/test/Makefile +OLD_FILES+=usr/share/examples/kld/cdev/test/testcdev.c +OLD_FILES+=usr/share/examples/kld/dyn_sysctl/Makefile +OLD_FILES+=usr/share/examples/kld/dyn_sysctl/README +OLD_FILES+=usr/share/examples/kld/dyn_sysctl/dyn_sysctl.c +OLD_FILES+=usr/share/examples/kld/firmware/Makefile +OLD_FILES+=usr/share/examples/kld/firmware/README +OLD_FILES+=usr/share/examples/kld/firmware/fwconsumer/Makefile +OLD_FILES+=usr/share/examples/kld/firmware/fwconsumer/fw_consumer.c +OLD_FILES+=usr/share/examples/kld/firmware/fwimage/Makefile +OLD_FILES+=usr/share/examples/kld/firmware/fwimage/firmware.img.uu +OLD_FILES+=usr/share/examples/kld/khelp/Makefile +OLD_FILES+=usr/share/examples/kld/khelp/README +OLD_FILES+=usr/share/examples/kld/khelp/h_example.c +OLD_FILES+=usr/share/examples/kld/syscall/Makefile +OLD_FILES+=usr/share/examples/kld/syscall/module/Makefile +OLD_FILES+=usr/share/examples/kld/syscall/module/syscall.c +OLD_FILES+=usr/share/examples/kld/syscall/test/Makefile +OLD_FILES+=usr/share/examples/kld/syscall/test/call.c +OLD_FILES+=usr/share/examples/libusb20/Makefile +OLD_FILES+=usr/share/examples/libusb20/README +OLD_FILES+=usr/share/examples/libusb20/bulk.c +OLD_FILES+=usr/share/examples/libusb20/control.c +OLD_FILES+=usr/share/examples/libusb20/util.c +OLD_FILES+=usr/share/examples/libusb20/util.h +OLD_FILES+=usr/share/examples/libvgl/Makefile +OLD_FILES+=usr/share/examples/libvgl/demo.c +OLD_FILES+=usr/share/examples/mdoc/POSIX-copyright +OLD_FILES+=usr/share/examples/mdoc/deshallify.sh +OLD_FILES+=usr/share/examples/mdoc/example.1 +OLD_FILES+=usr/share/examples/mdoc/example.3 +OLD_FILES+=usr/share/examples/mdoc/example.4 +OLD_FILES+=usr/share/examples/mdoc/example.9 +OLD_FILES+=usr/share/examples/netgraph/ether.bridge +OLD_FILES+=usr/share/examples/netgraph/frame_relay +OLD_FILES+=usr/share/examples/netgraph/ngctl +OLD_FILES+=usr/share/examples/netgraph/raw +OLD_FILES+=usr/share/examples/netgraph/udp.tunnel +OLD_FILES+=usr/share/examples/netgraph/virtual.chain +OLD_FILES+=usr/share/examples/netgraph/virtual.lan +OLD_FILES+=usr/share/examples/pc-sysinstall/README +OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.fbsd-netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.geli +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.gmirror +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.netinstall +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.restore +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.rsync +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.upgrade +OLD_FILES+=usr/share/examples/pc-sysinstall/pcinstall.cfg.zfs +OLD_FILES+=usr/share/examples/perfmon/Makefile +OLD_FILES+=usr/share/examples/perfmon/README +OLD_FILES+=usr/share/examples/perfmon/perfmon.c +OLD_FILES+=usr/share/examples/pf/ackpri +OLD_FILES+=usr/share/examples/pf/faq-example1 +OLD_FILES+=usr/share/examples/pf/faq-example2 +OLD_FILES+=usr/share/examples/pf/faq-example3 +OLD_FILES+=usr/share/examples/pf/pf.conf +OLD_FILES+=usr/share/examples/pf/queue1 +OLD_FILES+=usr/share/examples/pf/queue2 +OLD_FILES+=usr/share/examples/pf/queue3 +OLD_FILES+=usr/share/examples/pf/queue4 +OLD_FILES+=usr/share/examples/pf/spamd +OLD_FILES+=usr/share/examples/ppi/Makefile +OLD_FILES+=usr/share/examples/ppi/ppilcd.c +OLD_FILES+=usr/share/examples/ppp/chap-auth +OLD_FILES+=usr/share/examples/ppp/login-auth +OLD_FILES+=usr/share/examples/ppp/ppp.conf.sample +OLD_FILES+=usr/share/examples/ppp/ppp.conf.span-isp +OLD_FILES+=usr/share/examples/ppp/ppp.conf.span-isp.working +OLD_FILES+=usr/share/examples/ppp/ppp.linkdown.sample +OLD_FILES+=usr/share/examples/ppp/ppp.linkdown.span-isp +OLD_FILES+=usr/share/examples/ppp/ppp.linkdown.span-isp.working +OLD_FILES+=usr/share/examples/ppp/ppp.linkup.sample +OLD_FILES+=usr/share/examples/ppp/ppp.linkup.span-isp +OLD_FILES+=usr/share/examples/ppp/ppp.linkup.span-isp.working +OLD_FILES+=usr/share/examples/ppp/ppp.secret.sample +OLD_FILES+=usr/share/examples/ppp/ppp.secret.span-isp +OLD_FILES+=usr/share/examples/ppp/ppp.secret.span-isp.working +OLD_FILES+=usr/share/examples/printing/diablo-if-net +OLD_FILES+=usr/share/examples/printing/hpdf +OLD_FILES+=usr/share/examples/printing/hpif +OLD_FILES+=usr/share/examples/printing/hpof +OLD_FILES+=usr/share/examples/printing/hprf +OLD_FILES+=usr/share/examples/printing/hpvf +OLD_FILES+=usr/share/examples/printing/if-simple +OLD_FILES+=usr/share/examples/printing/if-simpleX +OLD_FILES+=usr/share/examples/printing/ifhp +OLD_FILES+=usr/share/examples/printing/make-ps-header +OLD_FILES+=usr/share/examples/printing/netprint +OLD_FILES+=usr/share/examples/printing/psdf +OLD_FILES+=usr/share/examples/printing/psdfX +OLD_FILES+=usr/share/examples/printing/psif +OLD_FILES+=usr/share/examples/printing/pstf +OLD_FILES+=usr/share/examples/printing/pstfX +OLD_FILES+=usr/share/examples/scsi_target/Makefile +OLD_FILES+=usr/share/examples/scsi_target/scsi_cmds.c +OLD_FILES+=usr/share/examples/scsi_target/scsi_target.8 +OLD_FILES+=usr/share/examples/scsi_target/scsi_target.c +OLD_FILES+=usr/share/examples/scsi_target/scsi_target.h +OLD_FILES+=usr/share/examples/ses/Makefile +OLD_FILES+=usr/share/examples/ses/Makefile.inc +OLD_FILES+=usr/share/examples/ses/getencstat/Makefile +OLD_FILES+=usr/share/examples/ses/getencstat/getencstat.0 +OLD_FILES+=usr/share/examples/ses/sesd/Makefile +OLD_FILES+=usr/share/examples/ses/sesd/sesd.0 +OLD_FILES+=usr/share/examples/ses/setencstat/Makefile +OLD_FILES+=usr/share/examples/ses/setencstat/setencstat.0 +OLD_FILES+=usr/share/examples/ses/setobjstat/Makefile +OLD_FILES+=usr/share/examples/ses/setobjstat/setobjstat.0 +OLD_FILES+=usr/share/examples/ses/srcs/chpmon.c +OLD_FILES+=usr/share/examples/ses/srcs/eltsub.c +OLD_FILES+=usr/share/examples/ses/srcs/eltsub.h +OLD_FILES+=usr/share/examples/ses/srcs/getencstat.c +OLD_FILES+=usr/share/examples/ses/srcs/getnobj.c +OLD_FILES+=usr/share/examples/ses/srcs/getobjmap.c +OLD_FILES+=usr/share/examples/ses/srcs/getobjstat.c +OLD_FILES+=usr/share/examples/ses/srcs/inienc.c +OLD_FILES+=usr/share/examples/ses/srcs/sesd.c +OLD_FILES+=usr/share/examples/ses/srcs/setencstat.c +OLD_FILES+=usr/share/examples/ses/srcs/setobjstat.c +OLD_FILES+=usr/share/examples/smbfs/dot.nsmbrc +OLD_FILES+=usr/share/examples/smbfs/print/lj6l +OLD_FILES+=usr/share/examples/smbfs/print/ljspool +OLD_FILES+=usr/share/examples/smbfs/print/printcap.sample +OLD_FILES+=usr/share/examples/smbfs/print/tolj +OLD_FILES+=usr/share/examples/sunrpc/Makefile +OLD_FILES+=usr/share/examples/sunrpc/dir/Makefile +OLD_FILES+=usr/share/examples/sunrpc/dir/dir.x +OLD_FILES+=usr/share/examples/sunrpc/dir/dir_proc.c +OLD_FILES+=usr/share/examples/sunrpc/dir/rls.c +OLD_FILES+=usr/share/examples/sunrpc/msg/Makefile +OLD_FILES+=usr/share/examples/sunrpc/msg/msg.x +OLD_FILES+=usr/share/examples/sunrpc/msg/msg_proc.c +OLD_FILES+=usr/share/examples/sunrpc/msg/printmsg.c +OLD_FILES+=usr/share/examples/sunrpc/msg/rprintmsg.c +OLD_FILES+=usr/share/examples/sunrpc/sort/Makefile +OLD_FILES+=usr/share/examples/sunrpc/sort/rsort.c +OLD_FILES+=usr/share/examples/sunrpc/sort/sort.x +OLD_FILES+=usr/share/examples/sunrpc/sort/sort_proc.c +OLD_FILES+=usr/share/examples/tcsh/complete.tcsh +OLD_FILES+=usr/share/examples/tcsh/csh-mode.el +OLD_FILES+=usr/share/examples/uefisign/uefikeys +OLD_FILES+=usr/share/examples/ypldap/ypldap.conf OLD_DIRS+=usr/share/examples OLD_DIRS+=usr/share/examples/BSD_daemon OLD_DIRS+=usr/share/examples/FreeBSD_version OLD_DIRS+=usr/share/examples/IPv6 +OLD_DIRS+=usr/share/examples/bhyve OLD_DIRS+=usr/share/examples/bootforth OLD_DIRS+=usr/share/examples/bsdconfig OLD_DIRS+=usr/share/examples/csh OLD_DIRS+=usr/share/examples/diskless OLD_DIRS+=usr/share/examples/dma OLD_DIRS+=usr/share/examples/drivers +OLD_DIRS+=usr/share/examples/dwatch OLD_DIRS+=usr/share/examples/etc OLD_DIRS+=usr/share/examples/etc/defaults OLD_DIRS+=usr/share/examples/find_interface OLD_DIRS+=usr/share/examples/hast OLD_DIRS+=usr/share/examples/ibcs2 +OLD_DIRS+=usr/share/examples/hostapd OLD_DIRS+=usr/share/examples/indent +OLD_DIRS+=usr/share/examples/ipfilter OLD_DIRS+=usr/share/examples/ipfw OLD_DIRS+=usr/share/examples/jails OLD_DIRS+=usr/share/examples/kld @@ -2337,7 +2589,9 @@ OLD_DIRS+=usr/share/examples/libusb20 OLD_DIRS+=usr/share/examples/libvgl OLD_DIRS+=usr/share/examples/mdoc OLD_DIRS+=usr/share/examples/netgraph +OLD_DIRS+=usr/share/examples/pc-sysinstall OLD_DIRS+=usr/share/examples/perfmon +OLD_DIRS+=usr/share/examples/pf OLD_DIRS+=usr/share/examples/ppi OLD_DIRS+=usr/share/examples/ppp OLD_DIRS+=usr/share/examples/printing From owner-svn-src-head@freebsd.org Thu Jan 17 06:35:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1883114858B0; Thu, 17 Jan 2019 06:35:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B905D761F3; Thu, 17 Jan 2019 06:35:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99320E49A; Thu, 17 Jan 2019 06:35:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0H6Zms4003784; Thu, 17 Jan 2019 06:35:48 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0H6ZjEs003767; Thu, 17 Jan 2019 06:35:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901170635.x0H6ZjEs003767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 17 Jan 2019 06:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc/gen lib/libc/nls lib/lib... X-SVN-Commit-Revision: 343111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B905D761F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 06:35:49 -0000 Author: mckusick Date: Thu Jan 17 06:35:45 2019 New Revision: 343111 URL: https://svnweb.freebsd.org/changeset/base/343111 Log: Create new EINTEGRITY error with message "Integrity check failed". An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Reviewed by: gnn, dim, brueffer, imp Discussed with: kib, cem, emaste, ed, jilles Differential Revision: https://reviews.freebsd.org/D18765 Modified: head/cddl/lib/libdtrace/errno.d head/contrib/libc++/include/__errc head/contrib/libc++/include/errno.h head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po head/contrib/libxo/tests/gettext/strerror.pot head/contrib/openbsm/libbsm/bsm_errno.c head/contrib/openbsm/sys/bsm/audit_errno.h head/lib/libc/gen/errlst.c head/lib/libc/nls/C.msg head/lib/libc/sys/intro.2 head/stand/liblua/lerrno.c head/sys/bsm/audit_errno.h head/sys/compat/cloudabi/cloudabi_errno.c head/sys/compat/linux/linux_errno.inc head/sys/security/audit/bsm_errno.c head/sys/sys/errno.h Modified: head/cddl/lib/libdtrace/errno.d ============================================================================== --- head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:34:39 2019 (r343110) +++ head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:35:45 2019 (r343111) @@ -225,7 +225,9 @@ inline int ENOTRECOVERABLE = 95; #pragma D binding "1.13" ENOTRECOVERABLE inline int EOWNERDEAD = 96; #pragma D binding "1.13" EOWNERDEAD -inline int ELAST = 96; +inline int EINTEGRITY = 96; +#pragma D binding "1.13" EINTEGRITY +inline int ELAST = 97; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -340,6 +342,7 @@ inline string strerror[int errno] = errno == ECAPMODE ? "Not permitted in capability mode" : errno == ENOTRECOVERABLE ? "State not recoverable" : errno == EOWNERDEAD ? "Previous owner died" : + errno == EINTEGRITY ? "Integrity check failed" : errno == ERESTART ? "restart syscall" : errno == EJUSTRETURN ? "don't modify regs, just return" : errno == ENOIOCTL ? "ioctl not handled by this layer" : Modified: head/contrib/libc++/include/__errc ============================================================================== --- head/contrib/libc++/include/__errc Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/libc++/include/__errc Thu Jan 17 06:35:45 2019 (r343111) @@ -46,6 +46,7 @@ enum class errc identifier_removed, // EIDRM illegal_byte_sequence, // EILSEQ inappropriate_io_control_operation, // ENOTTY + integrity_check_failed, // EINTEGRITY interrupted, // EINTR invalid_argument, // EINVAL invalid_seek, // ESPIPE @@ -143,6 +144,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc) identifier_removed = EIDRM, illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, + integrity_check_failed = EINTEGRITY, interrupted = EINTR, invalid_argument = EINVAL, invalid_seek = ESPIPE, Modified: head/contrib/libc++/include/errno.h ============================================================================== --- head/contrib/libc++/include/errno.h Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/libc++/include/errno.h Thu Jan 17 06:35:45 2019 (r343111) @@ -33,49 +33,72 @@ Macros: #ifdef __cplusplus -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) #ifdef ELAST static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; +static const int __elast2 = ELAST+3; #else static const int __elast1 = 104; static const int __elast2 = 105; +static const int __elast2 = 106; #endif -#ifdef ENOTRECOVERABLE +#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#define EINTEGRITY __elast3 +#ifdef ELAST +#undef ELAST +#define ELAST EINTEGRITY +#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#ifdef ELAST +#undef ELAST +#define ELAST EOWNERDEAD + +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 +#define EINTEGRITY __elast2 +#ifdef ELAST +#undef ELAST +#define ELAST EINTEGRITY +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define EOWNERDEAD __elast1 #ifdef ELAST #undef ELAST #define ELAST EOWNERDEAD -#endif -#elif defined(EOWNERDEAD) +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EINTEGRITY __elast2 +#ifdef ELAST +#undef ELAST +#define ELAST EINTEGRITY +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 #ifdef ELAST #undef ELAST #define ELAST ENOTRECOVERABLE -#endif -#else // defined(EOWNERDEAD) - -#define EOWNERDEAD __elast1 -#define ENOTRECOVERABLE __elast2 +#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define EINTEGRITY __elast1 #ifdef ELAST #undef ELAST -#define ELAST ENOTRECOVERABLE -#endif +#define ELAST EINTEGRITY -#endif // defined(EOWNERDEAD) +#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY) -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY) // supply errno values likely to be missing, particularly on Windows @@ -391,6 +414,10 @@ static const int __elast2 = 105; #ifndef EMLINK #define EMLINK 9979 +#endif + +#ifndef EINTEGRITY +#define EINTEGRITY 9980 #endif #endif // __cplusplus Modified: head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po ============================================================================== --- head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 17 06:35:45 2019 (r343111) @@ -457,3 +457,7 @@ msgstr "Atestay otnay ecoverableray" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "Eviouspray ownerway iedday" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "integrityyay eckchay ailedfay" Modified: head/contrib/libxo/tests/gettext/strerror.pot ============================================================================== --- head/contrib/libxo/tests/gettext/strerror.pot Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/libxo/tests/gettext/strerror.pot Thu Jan 17 06:35:45 2019 (r343111) @@ -466,3 +466,7 @@ msgstr "" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "" Modified: head/contrib/openbsm/libbsm/bsm_errno.c ============================================================================== --- head/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 17 06:35:45 2019 (r343111) @@ -239,6 +239,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: head/contrib/openbsm/sys/bsm/audit_errno.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 17 06:34:39 2019 (r343110) +++ head/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 17 06:35:45 2019 (r343111) @@ -204,6 +204,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Thu Jan 17 06:34:39 2019 (r343110) +++ head/lib/libc/gen/errlst.c Thu Jan 17 06:35:45 2019 (r343111) @@ -158,12 +158,12 @@ const char *const sys_errlist[] = { "Not permitted in capability mode", /* 94 - ECAPMODE */ "State not recoverable", /* 95 - ENOTRECOVERABLE */ "Previous owner died", /* 96 - EOWNERDEAD */ + "Integrity check failed", /* 97 - EINTEGRITY */ /* * Reserved space in sys_errlist, take the next slot for a next error code. * Reserve prevents the array size from changing for some time. */ - __uprefix, /* 97 */ __uprefix, /* 98 */ __uprefix, /* 99 */ __uprefix, /* 100 */ Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Thu Jan 17 06:34:39 2019 (r343110) +++ head/lib/libc/nls/C.msg Thu Jan 17 06:35:45 2019 (r343111) @@ -197,6 +197,8 @@ $ ENOTRECOVERABLE 95 State not recoverable $ EOWNERDEAD 96 Previous owner died +$ EINTEGRITY +97 Integrity check failed $ $ strsignal() support catalog $ Modified: head/lib/libc/sys/intro.2 ============================================================================== --- head/lib/libc/sys/intro.2 Thu Jan 17 06:34:39 2019 (r343110) +++ head/lib/libc/sys/intro.2 Thu Jan 17 06:35:45 2019 (r343111) @@ -472,6 +472,20 @@ The system call or operation is not permitted for capa The state protected by a robust mutex is not recoverable. .It Er 96 EOWNERDEAD Em "Previous owner died" . The owner of a robust mutex terminated while holding the mutex lock. +.It Er 97 EINTEGRITY Em "Integrity check failed" . +An integrity check such as a check-hash or a cross-correlation failed. +The integrity error falls between +.Er EINVAL +that identifies errors in parameters to a system call and +.Er EIO +that identifies errors with the underlying storage media. +It is typically raised by intermediate kernel layers such as a +filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. +Uses include allowing the +.Xr mount 8 +command to return a different exit value to automate the running of +.Xr fsck 8 +during a system boot. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: head/stand/liblua/lerrno.c ============================================================================== --- head/stand/liblua/lerrno.c Thu Jan 17 06:34:39 2019 (r343110) +++ head/stand/liblua/lerrno.c Thu Jan 17 06:35:45 2019 (r343111) @@ -146,6 +146,7 @@ static const struct err_name_number { ENTRY(ECAPMODE), ENTRY(ENOTRECOVERABLE), ENTRY(EOWNERDEAD), + ENTRY(EINTEGRITY), ENTRY(ELAST), ENTRY(ERESTART), ENTRY(EJUSTRETURN), Modified: head/sys/bsm/audit_errno.h ============================================================================== --- head/sys/bsm/audit_errno.h Thu Jan 17 06:34:39 2019 (r343110) +++ head/sys/bsm/audit_errno.h Thu Jan 17 06:35:45 2019 (r343111) @@ -208,6 +208,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: head/sys/compat/cloudabi/cloudabi_errno.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 17 06:34:39 2019 (r343110) +++ head/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 17 06:35:45 2019 (r343111) @@ -63,6 +63,7 @@ cloudabi_convert_errno(int error) [EIDRM] = CLOUDABI_EIDRM, [EILSEQ] = CLOUDABI_EILSEQ, [EINPROGRESS] = CLOUDABI_EINPROGRESS, + [EINTEGRITY] = CLOUDABI_EINVAL, [EINTR] = CLOUDABI_EINTR, [EINVAL] = CLOUDABI_EINVAL, [EIO] = CLOUDABI_EIO, Modified: head/sys/compat/linux/linux_errno.inc ============================================================================== --- head/sys/compat/linux/linux_errno.inc Thu Jan 17 06:34:39 2019 (r343110) +++ head/sys/compat/linux/linux_errno.inc Thu Jan 17 06:35:45 2019 (r343111) @@ -142,7 +142,8 @@ const int linux_errtbl[ELAST + 1] = { -1, /* ECAPMODE -> EPERM */ -131, /* ENOTRECOVERABLE */ -130, /* EOWNERDEAD */ + -22, /* EINTEGRITY -> EINVAL */ }; -_Static_assert(ELAST == 96, +_Static_assert(ELAST == 97, "missing errno entries in linux_errtbl"); Modified: head/sys/security/audit/bsm_errno.c ============================================================================== --- head/sys/security/audit/bsm_errno.c Thu Jan 17 06:34:39 2019 (r343110) +++ head/sys/security/audit/bsm_errno.c Thu Jan 17 06:35:45 2019 (r343111) @@ -243,6 +243,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Thu Jan 17 06:34:39 2019 (r343110) +++ head/sys/sys/errno.h Thu Jan 17 06:35:45 2019 (r343111) @@ -180,10 +180,11 @@ __END_DECLS #define ECAPMODE 94 /* Not permitted in capability mode */ #define ENOTRECOVERABLE 95 /* State not recoverable */ #define EOWNERDEAD 96 /* Previous owner died */ +#define EINTEGRITY 97 /* Integrity check failed */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 96 /* Must be equal largest errno */ +#define ELAST 97 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) From owner-svn-src-head@freebsd.org Thu Jan 17 07:07:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1CF14863DC for ; Thu, 17 Jan 2019 07:07:39 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83411770AE for ; Thu, 17 Jan 2019 07:07:39 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-qk1-x72e.google.com with SMTP id c21so5435698qkl.6 for ; Wed, 16 Jan 2019 23:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zb7ITq9cCfqEw59hAAkIy7bDwZMGBVLJSgTcfFDerYQ=; b=DocWam9cIQ7Sfc78RMP6rmXppFa4m6Hx+DiIH1ajrRnu87xaKNUnDhIKVw2etZABFj yezGf5iakarZx9XGtlpiYWTvY9nRiWbgM91NsiIlygZvSuS44yROH/KLKR8c8GED9VYL EOojjP1wleD9FhKamqhqJIl2gXhbef8iWHce+GTNyijo+RogTlHudAnXvqKlRWDhff+l B4h1tfU4nHFMe5PDTdi5O90cEmzs8UfGpdc6DJJAU3DlcpWMcMC3xS4tade3WA7/e09w Ia76122uEBwz0nAKbTIX7pI7/Qa3XfbKEkcs/UJerNPPuSo2PxzOf4FgzXb8emBJI/QK ysAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zb7ITq9cCfqEw59hAAkIy7bDwZMGBVLJSgTcfFDerYQ=; b=RJouUI9u+1blBAJgDUBZCRdRiVmpcBb7P167Hv7gAtyJp/cAZnVA/oXT7Cyi/OGSS6 2HkhLuFYWtQNwxykhmtLYJ7B0wQiRHl/LEbUFdzMwPfgDjn037cUVqGjJtE4A6JHgbL9 Ycy9fLRY21kmlIQ0R6SNkNgW5KRsqSUl9592wOvutS7SpNWkm9vaLCH5iwGbvRqrgBac bq27w/TSsfP3u5E/HEz8hphYuGGwMvE7hKKcMONG3qxjNYoL+7xnhl7KfPL2tB5EM+j2 nSmWfD655uMOR4B5cWZKpi6zuRqfK42TnTcveC75qZHCl9raAmeVfRprBu3rE6hjEm1S ToJg== X-Gm-Message-State: AJcUukebJlec0ttyEohMq6T4ucdIhxmLdgABDWYjpylxq47XN0zfb3PX jWWwnh+/Y4TBM2m+P3wYzUrR4bVE9MZAz6CPTiuK1A== X-Google-Smtp-Source: ALg8bN6zNForQS8P01R0ncQFYRblTtApCnNvldqtiZsK04dBDe25tLquiv8UpFabprlTLApy0nkMaUcUYf2il1OC3is= X-Received: by 2002:a37:bdc6:: with SMTP id n189mr9653918qkf.330.1547708858824; Wed, 16 Jan 2019 23:07:38 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a0c:b542:0:0:0:0:0 with HTTP; Wed, 16 Jan 2019 23:07:38 -0800 (PST) In-Reply-To: <201901170635.x0H6ZjEs003767@repo.freebsd.org> References: <201901170635.x0H6ZjEs003767@repo.freebsd.org> From: Oliver Pinter Date: Thu, 17 Jan 2019 08:07:38 +0100 Message-ID: Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... To: Kirk McKusick Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 83411770AE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 07:07:40 -0000 On Thursday, January 17, 2019, Kirk McKusick wrote: > Author: mckusick > Date: Thu Jan 17 06:35:45 2019 > New Revision: 343111 > URL: https://svnweb.freebsd.org/changeset/base/343111 > > Log: > Create new EINTEGRITY error with message "Integrity check failed". > > An integrity check such as a check-hash or a cross-correlation failed. > The integrity error falls between EINVAL that identifies errors in > parameters to a system call and EIO that identifies errors with the > underlying storage media. EINTEGRITY is typically raised by intermediate > kernel layers such as a filesystem or an in-kernel GEOM subsystem when > they detect inconsistencies. Uses include allowing the mount(8) command > to return a different exit value to automate the running of fsck(8) > during a system boot. > > These changes make no use of the new error, they just add it. Later > commits will be made for the use of the new error number and it will > be added to additional manual pages as appropriate. > > Reviewed by: gnn, dim, brueffer, imp > Discussed with: kib, cem, emaste, ed, jilles > Differential Revision: https://reviews.freebsd.org/D18765 > > Modified: > head/cddl/lib/libdtrace/errno.d > head/contrib/libc++/include/__errc > head/contrib/libc++/include/errno.h > head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po > head/contrib/libxo/tests/gettext/strerror.pot > head/contrib/openbsm/libbsm/bsm_errno.c > head/contrib/openbsm/sys/bsm/audit_errno.h > head/lib/libc/gen/errlst.c > head/lib/libc/nls/C.msg > head/lib/libc/sys/intro.2 > head/stand/liblua/lerrno.c > head/sys/bsm/audit_errno.h > head/sys/compat/cloudabi/cloudabi_errno.c > head/sys/compat/linux/linux_errno.inc > head/sys/security/audit/bsm_errno.c > head/sys/sys/errno.h > > Modified: head/cddl/lib/libdtrace/errno.d > ============================================================ > ================== > --- head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:35:45 2019 > (r343111) > @@ -225,7 +225,9 @@ inline int ENOTRECOVERABLE = 95; > #pragma D binding "1.13" ENOTRECOVERABLE > inline int EOWNERDEAD = 96; > #pragma D binding "1.13" EOWNERDEAD > -inline int ELAST = 96; > +inline int EINTEGRITY = 96; > +#pragma D binding "1.13" EINTEGRITY > +inline int ELAST = 97; > #pragma D binding "1.0" ELAST > inline int ERESTART = -1; > #pragma D binding "1.0" ERESTART > @@ -340,6 +342,7 @@ inline string strerror[int errno] = > errno == ECAPMODE ? "Not permitted in capability mode" > : > errno == ENOTRECOVERABLE ? "State not recoverable" : > errno == EOWNERDEAD ? "Previous owner died" : > + errno == EINTEGRITY ? "Integrity check failed" : > errno == ERESTART ? "restart syscall" : > errno == EJUSTRETURN ? "don't modify regs, just return" : > errno == ENOIOCTL ? "ioctl not handled by this layer" : > > Modified: head/contrib/libc++/include/__errc > ============================================================ > ================== > --- head/contrib/libc++/include/__errc Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/contrib/libc++/include/__errc Thu Jan 17 06:35:45 2019 > (r343111) > @@ -46,6 +46,7 @@ enum class errc > identifier_removed, // EIDRM > illegal_byte_sequence, // EILSEQ > inappropriate_io_control_operation, // ENOTTY > + integrity_check_failed, // EINTEGRITY > interrupted, // EINTR > invalid_argument, // EINVAL > invalid_seek, // ESPIPE > @@ -143,6 +144,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc) > identifier_removed = EIDRM, > illegal_byte_sequence = EILSEQ, > inappropriate_io_control_operation = ENOTTY, > + integrity_check_failed = EINTEGRITY, > interrupted = EINTR, > invalid_argument = EINVAL, > invalid_seek = ESPIPE, > > Modified: head/contrib/libc++/include/errno.h > ============================================================ > ================== > --- head/contrib/libc++/include/errno.h Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/contrib/libc++/include/errno.h Thu Jan 17 06:35:45 2019 > (r343111) > @@ -33,49 +33,72 @@ Macros: > > #ifdef __cplusplus > > -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) > +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || > !defined(EINTEGRITY) > > #ifdef ELAST > > static const int __elast1 = ELAST+1; > static const int __elast2 = ELAST+2; > +static const int __elast2 = ELAST+3; I think this should be __elast3 > > #else > > static const int __elast1 = 104; > static const int __elast2 = 105; > +static const int __elast2 = 106; And here too > > #endif > > -#ifdef ENOTRECOVERABLE > +#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && > !defined(EINTEGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EOWNERDEAD __elast2 > +#define EINTEGRITY __elast3 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > > +#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && > defined(EINTEGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EOWNERDEAD __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EOWNERDEAD > + > +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && > !defined(EINTEGRITY) > #define EOWNERDEAD __elast1 > +#define EINTEGRITY __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > > +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && > defined(EINTEGRITY) > +#define EOWNERDEAD __elast1 > #ifdef ELAST > #undef ELAST > #define ELAST EOWNERDEAD > -#endif > > -#elif defined(EOWNERDEAD) > +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && > !defined(EINTEGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EINTEGRITY __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > > +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && > defined(EINTEGRITY) > #define ENOTRECOVERABLE __elast1 > #ifdef ELAST > #undef ELAST > #define ELAST ENOTRECOVERABLE > -#endif > > -#else // defined(EOWNERDEAD) > - > -#define EOWNERDEAD __elast1 > -#define ENOTRECOVERABLE __elast2 > +#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && > !defined(EINTEGRITY) > +#define EINTEGRITY __elast1 > #ifdef ELAST > #undef ELAST > -#define ELAST ENOTRECOVERABLE > -#endif > +#define ELAST EINTEGRITY > > -#endif // defined(EOWNERDEAD) > +#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && > !defined(INTEGRITY) > > -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) > +#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || > !defined(INTEGRITY) > > // supply errno values likely to be missing, particularly on Windows > > @@ -391,6 +414,10 @@ static const int __elast2 = 105; > > #ifndef EMLINK > #define EMLINK 9979 > +#endif > + > +#ifndef EINTEGRITY > +#define EINTEGRITY 9980 > #endif > > #endif // __cplusplus > > Modified: head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po > ============================================================ > ================== > --- head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan > 17 06:34:39 2019 (r343110) > +++ head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan > 17 06:35:45 2019 (r343111) > @@ -457,3 +457,7 @@ msgstr "Atestay otnay ecoverableray" > # 96 - EOWNERDEAD > msgid "Previous owner died" > msgstr "Eviouspray ownerway iedday" > + > +# 97 - EINTEGRITY > +msgid "Integrity check failed" > +msgstr "integrityyay eckchay ailedfay" > > Modified: head/contrib/libxo/tests/gettext/strerror.pot > ============================================================ > ================== > --- head/contrib/libxo/tests/gettext/strerror.pot Thu Jan 17 > 06:34:39 2019 (r343110) > +++ head/contrib/libxo/tests/gettext/strerror.pot Thu Jan 17 > 06:35:45 2019 (r343111) > @@ -466,3 +466,7 @@ msgstr "" > # 96 - EOWNERDEAD > msgid "Previous owner died" > msgstr "" > + > +# 97 - EINTEGRITY > +msgid "Integrity check failed" > +msgstr "" > > Modified: head/contrib/openbsm/libbsm/bsm_errno.c > ============================================================ > ================== > --- head/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 17 06:35:45 2019 > (r343111) > @@ -239,6 +239,13 @@ static const struct bsm_errno bsm_errnos[] = { > ERRNO_NO_LOCAL_MAPPING, > #endif > ES("Process died with the lock") }, > + { BSM_ERRNO_EINTEGRITY, > +#ifdef EINTEGRITY > + EINTEGRITY, > +#else > + ERRNO_NO_LOCAL_MAPPING, > +#endif > + ES("Integrity check failed") }, > { BSM_ERRNO_ENOTRECOVERABLE, > #ifdef ENOTRECOVERABLE > ENOTRECOVERABLE, > > Modified: head/contrib/openbsm/sys/bsm/audit_errno.h > ============================================================ > ================== > --- head/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 17 06:35:45 2019 > (r343111) > @@ -204,6 +204,7 @@ > #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. > */ > #define BSM_ERRNO_ENOTCAPABLE 223 /* > FreeBSD-specific. */ > #define BSM_ERRNO_ECAPMODE 224 /* > FreeBSD-specific. */ > +#define BSM_ERRNO_EINTEGRITY 225 /* > FreeBSD-specific. */ > > /* > * In the event that OpenBSM doesn't have a file representation of a local > > Modified: head/lib/libc/gen/errlst.c > ============================================================ > ================== > --- head/lib/libc/gen/errlst.c Thu Jan 17 06:34:39 2019 (r343110) > +++ head/lib/libc/gen/errlst.c Thu Jan 17 06:35:45 2019 (r343111) > @@ -158,12 +158,12 @@ const char *const sys_errlist[] = { > "Not permitted in capability mode", /* 94 - ECAPMODE */ > "State not recoverable", /* 95 - ENOTRECOVERABLE */ > "Previous owner died", /* 96 - EOWNERDEAD */ > + "Integrity check failed", /* 97 - EINTEGRITY */ > > /* > * Reserved space in sys_errlist, take the next slot for a next error > code. > * Reserve prevents the array size from changing for some time. > */ > - __uprefix, /* 97 */ > __uprefix, /* 98 */ > __uprefix, /* 99 */ > __uprefix, /* 100 */ > > Modified: head/lib/libc/nls/C.msg > ============================================================ > ================== > --- head/lib/libc/nls/C.msg Thu Jan 17 06:34:39 2019 (r343110) > +++ head/lib/libc/nls/C.msg Thu Jan 17 06:35:45 2019 (r343111) > @@ -197,6 +197,8 @@ $ ENOTRECOVERABLE > 95 State not recoverable > $ EOWNERDEAD > 96 Previous owner died > +$ EINTEGRITY > +97 Integrity check failed > $ > $ strsignal() support catalog > $ > > Modified: head/lib/libc/sys/intro.2 > ============================================================ > ================== > --- head/lib/libc/sys/intro.2 Thu Jan 17 06:34:39 2019 (r343110) > +++ head/lib/libc/sys/intro.2 Thu Jan 17 06:35:45 2019 (r343111) > @@ -472,6 +472,20 @@ The system call or operation is not permitted for capa > The state protected by a robust mutex is not recoverable. > .It Er 96 EOWNERDEAD Em "Previous owner died" . > The owner of a robust mutex terminated while holding the mutex lock. > +.It Er 97 EINTEGRITY Em "Integrity check failed" . > +An integrity check such as a check-hash or a cross-correlation failed. > +The integrity error falls between > +.Er EINVAL > +that identifies errors in parameters to a system call and > +.Er EIO > +that identifies errors with the underlying storage media. > +It is typically raised by intermediate kernel layers such as a > +filesystem or an in-kernel GEOM subsystem when they detect > inconsistencies. > +Uses include allowing the > +.Xr mount 8 > +command to return a different exit value to automate the running of > +.Xr fsck 8 > +during a system boot. > .El > .Sh DEFINITIONS > .Bl -tag -width Ds > > Modified: head/stand/liblua/lerrno.c > ============================================================ > ================== > --- head/stand/liblua/lerrno.c Thu Jan 17 06:34:39 2019 (r343110) > +++ head/stand/liblua/lerrno.c Thu Jan 17 06:35:45 2019 (r343111) > @@ -146,6 +146,7 @@ static const struct err_name_number { > ENTRY(ECAPMODE), > ENTRY(ENOTRECOVERABLE), > ENTRY(EOWNERDEAD), > + ENTRY(EINTEGRITY), > ENTRY(ELAST), > ENTRY(ERESTART), > ENTRY(EJUSTRETURN), > > Modified: head/sys/bsm/audit_errno.h > ============================================================ > ================== > --- head/sys/bsm/audit_errno.h Thu Jan 17 06:34:39 2019 (r343110) > +++ head/sys/bsm/audit_errno.h Thu Jan 17 06:35:45 2019 (r343111) > @@ -208,6 +208,7 @@ > #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. > */ > #define BSM_ERRNO_ENOTCAPABLE 223 /* > FreeBSD-specific. */ > #define BSM_ERRNO_ECAPMODE 224 /* > FreeBSD-specific. */ > +#define BSM_ERRNO_EINTEGRITY 225 /* > FreeBSD-specific. */ > > /* > * In the event that OpenBSM doesn't have a file representation of a local > > Modified: head/sys/compat/cloudabi/cloudabi_errno.c > ============================================================ > ================== > --- head/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 17 06:35:45 2019 > (r343111) > @@ -63,6 +63,7 @@ cloudabi_convert_errno(int error) > [EIDRM] = CLOUDABI_EIDRM, > [EILSEQ] = CLOUDABI_EILSEQ, > [EINPROGRESS] = CLOUDABI_EINPROGRESS, > + [EINTEGRITY] = CLOUDABI_EINVAL, > [EINTR] = CLOUDABI_EINTR, > [EINVAL] = CLOUDABI_EINVAL, > [EIO] = CLOUDABI_EIO, > > Modified: head/sys/compat/linux/linux_errno.inc > ============================================================ > ================== > --- head/sys/compat/linux/linux_errno.inc Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/sys/compat/linux/linux_errno.inc Thu Jan 17 06:35:45 2019 > (r343111) > @@ -142,7 +142,8 @@ const int linux_errtbl[ELAST + 1] = { > -1, /* ECAPMODE -> EPERM */ > -131, /* ENOTRECOVERABLE */ > -130, /* EOWNERDEAD */ > + -22, /* EINTEGRITY -> EINVAL */ > }; > > -_Static_assert(ELAST == 96, > +_Static_assert(ELAST == 97, > "missing errno entries in linux_errtbl"); > > Modified: head/sys/security/audit/bsm_errno.c > ============================================================ > ================== > --- head/sys/security/audit/bsm_errno.c Thu Jan 17 06:34:39 2019 > (r343110) > +++ head/sys/security/audit/bsm_errno.c Thu Jan 17 06:35:45 2019 > (r343111) > @@ -243,6 +243,13 @@ static const struct bsm_errno bsm_errnos[] = { > ERRNO_NO_LOCAL_MAPPING, > #endif > ES("Process died with the lock") }, > + { BSM_ERRNO_EINTEGRITY, > +#ifdef EINTEGRITY > + EINTEGRITY, > +#else > + ERRNO_NO_LOCAL_MAPPING, > +#endif > + ES("Integrity check failed") }, > { BSM_ERRNO_ENOTRECOVERABLE, > #ifdef ENOTRECOVERABLE > ENOTRECOVERABLE, > > Modified: head/sys/sys/errno.h > ============================================================ > ================== > --- head/sys/sys/errno.h Thu Jan 17 06:34:39 2019 (r343110) > +++ head/sys/sys/errno.h Thu Jan 17 06:35:45 2019 (r343111) > @@ -180,10 +180,11 @@ __END_DECLS > #define ECAPMODE 94 /* Not permitted in > capability mode */ > #define ENOTRECOVERABLE 95 /* State not recoverable */ > #define EOWNERDEAD 96 /* Previous owner died */ > +#define EINTEGRITY 97 /* Integrity check failed > */ > #endif /* _POSIX_SOURCE */ > > #ifndef _POSIX_SOURCE > -#define ELAST 96 /* Must be equal largest > errno */ > +#define ELAST 97 /* Must be equal largest > errno */ > #endif /* _POSIX_SOURCE */ > > #if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Jan 17 07:29:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F841486A40; Thu, 17 Jan 2019 07:29:00 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B22F77994; Thu, 17 Jan 2019 07:28:59 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 10f924d9; Thu, 17 Jan 2019 02:28:48 -0500 (EST) Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id 048d658c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Thu, 17 Jan 2019 02:28:48 -0500 (EST) Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... To: Kirk McKusick References: <201901170635.x0H6ZjEs003767@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtDJDaGFybGllIExp IChtYWlsaW5nIGxpc3RzL0dNQU5FKSA8bWxAdmlzaHdpbi5pbmZvPokCTgQTAQgAOBYhBP9/ wqq+WvuNT2xG/o5weN7yA6tsBQJbe4q8AhsjBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJ EI5weN7yA6ts4z8P/jJ4Sb5i4hcC2yAdPv4UK6jT0NKbB8omp3Gha5le4+RzabPoUrhG1uOp 6gSmmBU1dgMOq6vCzeCx3tW0TJaBnjIYciYAnQYUIJlgDOHYz05tMqE89BZJFdiFoMpGYgzZ 02AWXaDXVRGViQlKKyopMIiJ5JPgjxuFWfSoH6qMvR4Vm8PrLkTiY0kea2lSXkE8I9hYdFST SSm6dxbaEGApawdFegz7eSTIefQ4K8y5/H0YtWmOObMYYX0aLN31OAdCot+1M2TT1OnEfLM+ sWpD3C3l5F2OWREHKrq+Ma3tI4MiZQDNvzRQ9mkpU3mZIHixRQfhsaMj5PmF7GC8aacYlbO0 b0o1xUlPqD8tKIscPO2E2iujs38g/3Dt7Oyhb95CyTjiVbORajUEisM01cKS+RjskvH2VW72 mIq+YjorwhTzikhqgWoEtKMrkac9KMYM26kNy6I4YtZp1aIIv8tx4Y3tV/h3e6jZM7oMQZC7 x0oFlxfApJKtLyQPtRBXC96GaBM/kuqtwHYdQScWeP+ujp0hjj6+SfaJcxlYs3cyoETzNIew mYNZ3PGBpJYsapXdbNqbQHFarhIH9B1pgrNLqe1sa/+3xoQ7SORK93g2bCvKzaakgsa2soYH y4CksAPZ9PYyVFuOXiiygcWwdqylzPxwXg8vp5QGXD4ZkJ7aZd5wuQINBFt7iHUBEADXZe2B xvCTsh2xGL/uxMUqzveqgUWr4NRbAxtK4g5pbDkn2dn6i+v2CReVrH7F/ffmEnSIi0HwuEDs P3APjCOuaYGOHAruNi+2CFvwEfowdYRYPkP3G3jsI7ijxWLWb8Xg6UrGgOoiEfqfreA15I1p fOoOlmhSwvrYpf6wopRR2P9f+jPdfBdYJv+sQiAAwxbtAVy5AEnOQeC7r2hRIiSLiPWaEAyI FsZ7F9LV1xN+ksCv166MM0c7DmvtojhwDyru6zxh8MtvLzuE+VKu1MpzGRtrCt0U2zoo2sS+ CCReFjEaqbhnQUieLFpq+WiKYF/WruS9UzQACCyaR155L/pPNufvVYG4RbRWARxJIFLV2/sN +CZ5B6JKa/QO/HaVm/k/ozhD+mVIDPuFVcvoQgqW3AlSNjxF7vMNs9/uMmVsSBZsvFGGUaHk zCs1dsy3orKANFwPI4+ePGDT4gJdtDI8qKruNljb9D/Hw/TzE3HyxQo9j5cToblBWiFB97ct P2zXkoz7VSvi/ceFt+0e1NbWJPrQeTJT2pEIkkLXU6AfvCt+K5wbf95AqAGC+x8oMPfqsmax CmQ7T+SSnpH4LMtvLdc+usVglMKvTx7lBYoo93I28CG7JCPbstvsSE3F7eGalX6WXHRpo323 Uz5Bnzx9qYw6AiWns2HW4Wv9zlYZlQARAQABiQI2BBgBCAAgFiEE/3/Cqr5a+41PbEb+jnB4 3vIDq2wFAlt7iHUCGwwACgkQjnB43vIDq2xMZw//asEi+B4qKyZlBCfuQk4fCCapeD83kCvA 8fd4ImbOY1lZQiU5nKUDYq1iGTNnkbeuwv8EyYy5hFRs8klS6RolKoV6nUToBZg8LxJ5qSG7 VlsrxrIEjgpmY/7c9BhLS0rIyXFf5C335L+1xCpLfWYyCZxWFWEqLwytaNj6DukX4uQFhxwe 42IY0hybyYw8dMgpTvYBGIbcO0etGDix/nCqA6LvbbvuMEd0MEbDRjusK8yxoabcbgawzCPh 7jsfo8AU5Yrs7r2a68ujnSgw3auQ+L70Ao+LxZyuKey2V4QbIQjKC5FqANCNk/mBf1eTm+RL r7EyAq3v6Tv4PeNYqVZHob1TQLIqZUmh42rAdR0ugUPeXLCPBP2+j5ypviBAqdmwDWyz9Y68 SngRo1JHskcU5jlfwA1CCI/EuGtsjsU8ZcrDdjucKlwiXMWmHpQv2OE1HC+hDcZ9nSwXQmCk BJ2tLg3cWae30vqVzeqsivEM+kONjBwMRQGXSyn+muOHeB0Leqz3FnRE1ZZ1Spya9G/ZIOSt UPDeJD1aExla5BgGYZoxWLKlrpauOOVVOOpl+1nKrK2cfC6jU8D+otwX+9RSfRAcU8gPHz/J NKqLD/FPA+44XHOceMlVvEQQbQfmuat6HVnRZ4zCxJuMLcQR/5kjf1CkXBUgbykPBcU4KV+G MXM= Message-ID: Date: Thu, 17 Jan 2019 02:28:42 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901170635.x0H6ZjEs003767@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q2upOuXpe7R55pKKabqPaXmZDRS9SjAAP" X-Rspamd-Queue-Id: 8B22F77994 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 07:29:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Q2upOuXpe7R55pKKabqPaXmZDRS9SjAAP Content-Type: multipart/mixed; boundary="1McyOKagBQ2yGiA1WxTMzE6saaDEJ8U4b"; protected-headers="v1" From: Charlie Li To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... References: <201901170635.x0H6ZjEs003767@repo.freebsd.org> In-Reply-To: <201901170635.x0H6ZjEs003767@repo.freebsd.org> --1McyOKagBQ2yGiA1WxTMzE6saaDEJ8U4b Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 17/01/2019 01:35, Kirk McKusick wrote: > Modified: head/contrib/libc++/include/errno.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/contrib/libc++/include/errno.h Thu Jan 17 06:34:39 2019 (r3431= 10) > +++ head/contrib/libc++/include/errno.h Thu Jan 17 06:35:45 2019 (r3431= 11) > @@ -33,49 +33,72 @@ Macros: > =20 > #ifdef __cplusplus > =20 > -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) > +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINT= EGRITY) > =20 > #ifdef ELAST > =20 > static const int __elast1 =3D ELAST+1; > static const int __elast2 =3D ELAST+2; > +static const int __elast2 =3D ELAST+3; > =20 > #else > =20 > static const int __elast1 =3D 104; > static const int __elast2 =3D 105; > +static const int __elast2 =3D 106; > =20 > #endif > =20 > -#ifdef ENOTRECOVERABLE > +#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINT= EGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EOWNERDEAD __elast2 > +#define EINTEGRITY __elast3 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > =20 > +#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EIN= TEGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EOWNERDEAD __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EOWNERDEAD > + > +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EIN= TEGRITY) > #define EOWNERDEAD __elast1 > +#define EINTEGRITY __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > =20 > +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINT= EGRITY) > +#define EOWNERDEAD __elast1 > #ifdef ELAST > #undef ELAST > #define ELAST EOWNERDEAD > -#endif > =20 > -#elif defined(EOWNERDEAD) > +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EIN= TEGRITY) > +#define ENOTRECOVERABLE __elast1 > +#define EINTEGRITY __elast2 > +#ifdef ELAST > +#undef ELAST > +#define ELAST EINTEGRITY > =20 > +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINT= EGRITY) > #define ENOTRECOVERABLE __elast1 > #ifdef ELAST > #undef ELAST > #define ELAST ENOTRECOVERABLE > -#endif > =20 > -#else // defined(EOWNERDEAD) > - > -#define EOWNERDEAD __elast1 > -#define ENOTRECOVERABLE __elast2 > +#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINT= EGRITY) > +#define EINTEGRITY __elast1 > #ifdef ELAST > #undef ELAST > -#define ELAST ENOTRECOVERABLE > -#endif > +#define ELAST EINTEGRITY > =20 > -#endif // defined(EOWNERDEAD) > +#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(= INTEGRITY) > =20 > -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) > +#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(= INTEGRITY) > =20 > // supply errno values likely to be missing, particularly on Windows > =20 > @@ -391,6 +414,10 @@ static const int __elast2 =3D 105; > =20 > #ifndef EMLINK > #define EMLINK 9979 > +#endif > + > +#ifndef EINTEGRITY > +#define EINTEGRITY 9980 > #endif > =20 > #endif // __cplusplus >=20 The build errors out as Clang complains about all of these conditional directives being unterminated. --- algorithm.o --- In file included from /usr/src/contrib/libc++/src/algorithm.cpp:11: In file included from /usr/src/contrib/libc++/include/random:1646: In file included from /usr/src/contrib/libc++/include/istream:163: In file included from /usr/src/contrib/libc++/include/ostream:138: In file included from /usr/src/contrib/libc++/include/ios:216: In file included from /usr/src/contrib/libc++/include/__locale:18: In file included from /usr/src/contrib/libc++/include/mutex:191: In file included from /usr/src/contrib/libc++/include/__mutex_base:16: In file included from /usr/src/contrib/libc++/include/system_error:146: In file included from /usr/src/contrib/libc++/include/__errc:106: In file included from /usr/src/contrib/libc++/include/cerrno:27: /usr/src/contrib/libc++/include/errno.h:70:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:63:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:56:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:52:2: error: unterminated conditional directive #if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) ^ /usr/src/contrib/libc++/include/errno.h:36:2: error: unterminated conditional directive #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) ^ /usr/src/contrib/libc++/include/errno.h:34:2: error: unterminated conditional directive #ifdef __cplusplus ^ /usr/src/contrib/libc++/include/errno.h:11:2: error: unterminated conditional directive #ifndef _LIBCPP_ERRNO_H ^ In file included from /usr/src/contrib/libc++/src/algorithm.cpp:11: In file included from /usr/src/contrib/libc++/include/random:1646: In file included from /usr/src/contrib/libc++/include/istream:163: In file included from /usr/src/contrib/libc++/include/ostream:138: In file included from /usr/src/contrib/libc++/include/ios:216: In file included from /usr/src/contrib/libc++/include/__locale:18: In file included from /usr/src/contrib/libc++/include/mutex:191: In file included from /usr/src/contrib/libc++/include/__mutex_base:17: In file included from /usr/src/contrib/libc++/include/__threading_support:16: /usr/src/contrib/libc++/include/errno.h:70:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:63:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:56:2: error: unterminated conditional directive #ifdef ELAST ^ /usr/src/contrib/libc++/include/errno.h:52:2: error: unterminated conditional directive #if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) ^ /usr/src/contrib/libc++/include/errno.h:36:2: error: unterminated conditional directive #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) ^ /usr/src/contrib/libc++/include/errno.h:34:2: error: unterminated conditional directive #ifdef __cplusplus ^ /usr/src/contrib/libc++/include/errno.h:11:2: error: unterminated conditional directive #ifndef _LIBCPP_ERRNO_H ^ 14 errors generated. *** [algorithm.o] Error code 1 --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --1McyOKagBQ2yGiA1WxTMzE6saaDEJ8U4b-- --Q2upOuXpe7R55pKKabqPaXmZDRS9SjAAP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlxALq8ACgkQjnB43vID q2wxMw/+JnbbIe1+oh92c5TghzCLDTtu1ghOVda2gqsHuuo+pXc4G467/POU/w99 tIOtaeLYZTov9nhDn2gYJ0OQivU++jt10fCfFCy2wRnaWNs2ttygn8hA6TfB3Kxd 05QM3ZoHgX34kkPT+ZDe48ah1iAKOAw5Vnptcdih8ughdEl/49gHLhPOdWHSaDEE ZzXVa66Zx4ci9lr4vsSlKq7RnEBfZZ9Hp1j25R58to8TlmJUUyImbWEFYoqpLx+z 0P01LZxGoYgRdbnE1u32N2Zfutb92qtfb9YOcYRqHKnYO2M2cDF78C96B+DlcJkY rdixlROov+2J8TyhISZimKxnzQciZGbY2JmjRnHlruM50hz3PcXsrEwhQ+PFPxFi uKv7hztuUwtr4a3pn/s1mqQvjDZXVxHNqX1qR41ZyKrqcZF2Cef3FK+APZTnNZ5s 5kRR+S3Ikz+/mAQblJ1csopIn5rAfICJsW7Ax5a0KxT2mrDlsncvVcrZAirbvJVW Q7G7oGPWL4e5DyMRNedF/2xwiuX/Ma3og8P1A8uJNqsmgBDY+tF/wzBAqwLhuWII TrAiCEDgy9uBd7dFb5cpN6ndXhrFC5kxXXNECZx3dfvtDzq37VrQ4qQh7G3pp2mS 5A8QN++fWpdYkVAxLBKVfpTPSqGexIkRc6bOj4B8ursXw4uILqA= =fAUg -----END PGP SIGNATURE----- --Q2upOuXpe7R55pKKabqPaXmZDRS9SjAAP-- From owner-svn-src-head@freebsd.org Thu Jan 17 14:09:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4369149770B; Thu, 17 Jan 2019 14:09:56 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695CE8FC3E; Thu, 17 Jan 2019 14:09:56 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A80E1B34F; Thu, 17 Jan 2019 14:09:56 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HE9u8f040666; Thu, 17 Jan 2019 14:09:56 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HE9ubv040665; Thu, 17 Jan 2019 14:09:56 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201901171409.x0HE9ubv040665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 17 Jan 2019 14:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343112 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 343112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 695CE8FC3E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 14:09:56 -0000 Author: eugen Date: Thu Jan 17 14:09:55 2019 New Revision: 343112 URL: https://svnweb.freebsd.org/changeset/base/343112 Log: jail(8): stop crashing with SIGSEGV inside run_command() function while processing not entirely correct jail.conf(5) file having something like "ip4.addr = 127.0.0.1;" and no "ip4 = ...;" so extrap variable stays NULL. Reported by: marck MFC after: 1 month Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Thu Jan 17 06:35:45 2019 (r343111) +++ head/usr.sbin/jail/command.c Thu Jan 17 14:09:55 2019 (r343112) @@ -374,7 +374,7 @@ run_command(struct cfjail *j) argc = 4; } - if (!down) { + if (!down && extrap != NULL) { for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { size_t len = strlen(cs) + 1; From owner-svn-src-head@freebsd.org Thu Jan 17 15:35:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB3B2149A720; Thu, 17 Jan 2019 15:35:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 857856CDAF; Thu, 17 Jan 2019 15:35:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684F01C315; Thu, 17 Jan 2019 15:35:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HFZ5Bx087840; Thu, 17 Jan 2019 15:35:05 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HFZ564087839; Thu, 17 Jan 2019 15:35:05 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901171535.x0HFZ564087839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 17 Jan 2019 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343113 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 343113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 857856CDAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 15:35:12 -0000 Author: mckusick Date: Thu Jan 17 15:35:04 2019 New Revision: 343113 URL: https://svnweb.freebsd.org/changeset/base/343113 Log: Fix #if defined broken in -r343111 Pointy-hat-to: mckusick Modified: head/contrib/libc++/include/errno.h Modified: head/contrib/libc++/include/errno.h ============================================================================== --- head/contrib/libc++/include/errno.h Thu Jan 17 14:09:55 2019 (r343112) +++ head/contrib/libc++/include/errno.h Thu Jan 17 15:35:04 2019 (r343113) @@ -35,7 +35,7 @@ Macros: #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) -#ifdef ELAST +#if defined(ELAST) static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; @@ -53,46 +53,46 @@ static const int __elast2 = 106; #define ENOTRECOVERABLE __elast1 #define EOWNERDEAD __elast2 #define EINTEGRITY __elast3 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY #elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 #define EOWNERDEAD __elast2 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 #define EINTEGRITY __elast2 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define EOWNERDEAD __elast1 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 #define EINTEGRITY __elast2 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST ENOTRECOVERABLE #elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EINTEGRITY __elast1 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY From owner-svn-src-head@freebsd.org Thu Jan 17 15:42:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC54149AB6F; Thu, 17 Jan 2019 15:42:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23BD46D7DA; Thu, 17 Jan 2019 15:42:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 127C01C3A1; Thu, 17 Jan 2019 15:42:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HFgAFJ093100; Thu, 17 Jan 2019 15:42:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HFgAJi093099; Thu, 17 Jan 2019 15:42:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901171542.x0HFgAJi093099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 17 Jan 2019 15:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343114 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 343114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23BD46D7DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 15:42:11 -0000 Author: mckusick Date: Thu Jan 17 15:42:10 2019 New Revision: 343114 URL: https://svnweb.freebsd.org/changeset/base/343114 Log: Proper definition of elast3. Reported by: Oliver Pinter Modified: head/contrib/libc++/include/errno.h Modified: head/contrib/libc++/include/errno.h ============================================================================== --- head/contrib/libc++/include/errno.h Thu Jan 17 15:35:04 2019 (r343113) +++ head/contrib/libc++/include/errno.h Thu Jan 17 15:42:10 2019 (r343114) @@ -39,13 +39,13 @@ Macros: static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; -static const int __elast2 = ELAST+3; +static const int __elast3 = ELAST+3; #else static const int __elast1 = 104; static const int __elast2 = 105; -static const int __elast2 = 106; +static const int __elast3 = 106; #endif From owner-svn-src-head@freebsd.org Thu Jan 17 15:51:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1FD5149B2D5; Thu, 17 Jan 2019 15:51:32 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3C46DDB1; Thu, 17 Jan 2019 15:51:32 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x0HFxtkO022937; Thu, 17 Jan 2019 07:59:55 -0800 (PST) (envelope-from mckusick@mckusick.com) Message-Id: <201901171559.x0HFxtkO022937@chez.mckusick.com> From: Kirk McKusick To: Oliver Pinter Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: Comments: In-reply-to Oliver Pinter message dated "Thu, 17 Jan 2019 08:07:38 +0100." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22935.1547740795.1@chez.mckusick.com> Date: Thu, 17 Jan 2019 07:59:55 -0800 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: 4B3C46DDB1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 15:51:33 -0000 Thanks for your pointer to the problem. Now fixed in -r343113. Kirk McKusick From owner-svn-src-head@freebsd.org Thu Jan 17 15:53:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98CE3149B399; Thu, 17 Jan 2019 15:53:22 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE0496E146; Thu, 17 Jan 2019 15:53:21 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x0HG1vBc023006; Thu, 17 Jan 2019 08:01:57 -0800 (PST) (envelope-from mckusick@mckusick.com) Message-Id: <201901171601.x0HG1vBc023006@chez.mckusick.com> From: Kirk McKusick To: Charlie Li Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: Comments: In-reply-to Charlie Li message dated "Thu, 17 Jan 2019 02:28:42 -0500." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23004.1547740917.1@chez.mckusick.com> Date: Thu, 17 Jan 2019 08:01:57 -0800 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: EE0496E146 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 15:53:22 -0000 Thanks for your analysis. Now fixed in -r343113. Kirk McKusick From owner-svn-src-head@freebsd.org Thu Jan 17 15:59:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8505149B582; Thu, 17 Jan 2019 15:59:52 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AF56E3D7; Thu, 17 Jan 2019 15:59:52 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x0HG8SCv023111; Thu, 17 Jan 2019 08:08:28 -0800 (PST) (envelope-from mckusick@mckusick.com) Message-Id: <201901171608.x0HG8SCv023111@chez.mckusick.com> From: Kirk McKusick To: Oliver Pinter Subject: Re: svn commit: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc... cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: Comments: In-reply-to Oliver Pinter message dated "Thu, 17 Jan 2019 08:07:38 +0100." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23109.1547741308.1@chez.mckusick.com> Date: Thu, 17 Jan 2019 08:08:28 -0800 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: 59AF56E3D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 15:59:53 -0000 Per my previous email, it is fixed in -r343114 not -r343113. Kirk McKusick From owner-svn-src-head@freebsd.org Thu Jan 17 16:27:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B37149C5F4; Thu, 17 Jan 2019 16:27:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC8606F980; Thu, 17 Jan 2019 16:26:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 741D41CBD7; Thu, 17 Jan 2019 16:26:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HGQxEn014738; Thu, 17 Jan 2019 16:26:59 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HGQxV6014737; Thu, 17 Jan 2019 16:26:59 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901171626.x0HGQxV6014737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 17 Jan 2019 16:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343115 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 343115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC8606F980 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 16:27:01 -0000 Author: mckusick Date: Thu Jan 17 16:26:59 2019 New Revision: 343115 URL: https://svnweb.freebsd.org/changeset/base/343115 Log: Truely fix #if defined broken in -r343111 Pointy-hat-to: mckusick Modified: head/contrib/libc++/include/errno.h Modified: head/contrib/libc++/include/errno.h ============================================================================== --- head/contrib/libc++/include/errno.h Thu Jan 17 15:42:10 2019 (r343114) +++ head/contrib/libc++/include/errno.h Thu Jan 17 16:26:59 2019 (r343115) @@ -56,6 +56,7 @@ static const int __elast3 = 106; #if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY +#endif #elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 @@ -63,6 +64,7 @@ static const int __elast3 = 106; #if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD +#endif #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 @@ -70,12 +72,14 @@ static const int __elast3 = 106; #if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY +#endif #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define EOWNERDEAD __elast1 #if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD +#endif #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 @@ -83,18 +87,21 @@ static const int __elast3 = 106; #if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY +#endif #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 #if defined(ELAST) #undef ELAST #define ELAST ENOTRECOVERABLE +#endif #elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EINTEGRITY __elast1 #if defined(ELAST) #undef ELAST #define ELAST EINTEGRITY +#endif #endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY) From owner-svn-src-head@freebsd.org Thu Jan 17 16:50:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CDAE149CF63; Thu, 17 Jan 2019 16:50:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFFCB706E6; Thu, 17 Jan 2019 16:50:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C59731CF52; Thu, 17 Jan 2019 16:50:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HGopil026447; Thu, 17 Jan 2019 16:50:51 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HGopPY026445; Thu, 17 Jan 2019 16:50:51 GMT (envelope-from des@FreeBSD.org) Message-Id: <201901171650.x0HGopPY026445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 17 Jan 2019 16:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343116 - in head: include lib/libc/gen libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 343116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFFCB706E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 16:50:52 -0000 Author: des Date: Thu Jan 17 16:50:50 2019 New Revision: 343116 URL: https://svnweb.freebsd.org/changeset/base/343116 Log: Revert r343093 until I can address the issues raised by kib@. Modified: head/include/dlfcn.h head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.c Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Thu Jan 17 16:26:59 2019 (r343115) +++ head/include/dlfcn.h Thu Jan 17 16:50:50 2019 (r343116) @@ -120,7 +120,6 @@ void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); #if __BSD_VISIBLE -void *dlopenat(int, const char *, int); void *fdlopen(int, int); int dladdr(const void * __restrict, Dl_info * __restrict); dlfunc_t dlfunc(void * __restrict, const char * __restrict); Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Thu Jan 17 16:26:59 2019 (r343115) +++ head/lib/libc/gen/dlopen.3 Thu Jan 17 16:50:50 2019 (r343116) @@ -32,12 +32,11 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 15, 2019 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , -.Nm dlopenat , .Nm fdlopen , .Nm dlsym , .Nm dlvsym , @@ -52,8 +51,6 @@ .Ft void * .Fn dlopen "const char *path" "int mode" .Ft void * -.Fn dlopenat "int fd" "const char *path" "int mode" -.Ft void * .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" @@ -172,24 +169,6 @@ If fails, it returns a null pointer, and sets an error condition which may be interrogated with .Fn dlerror . -.Pp -The -.Fn dlopenat -function is equivalent to -.Fn dlopen -except in the case where the path specifies a relative path. -In this case the file to be opened is determined relative to the -directory associated with the file descriptor fd instead of the -current working directory. -If -.Fn dlopenat -is passed the special value -.Dv AT_FDCWD -in the -.Fa fd -parameter, the current working directory is used and the behavior is -identical to a call to -.Fn dlopen . .Pp The .Fn fdlopen Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jan 17 16:26:59 2019 (r343115) +++ head/libexec/rtld-elf/rtld.c Thu Jan 17 16:50:50 2019 (r343116) @@ -93,8 +93,8 @@ static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); static int dlclose_locked(void *, RtldLockState *); -static Obj_Entry *dlopen_object(int, const char *name, int fd, - Obj_Entry *refobj, int lo_flags, int mode, RtldLockState *lockstate); +static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, + int lo_flags, int mode, RtldLockState *lockstate); static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); @@ -118,7 +118,7 @@ static void load_filtees(Obj_Entry *, int flags, RtldL static void unload_filtees(Obj_Entry *, RtldLockState *); static int load_needed_objects(Obj_Entry *, int); static int load_preload_objects(void); -static Obj_Entry *load_object(int, const char *, int, const Obj_Entry *, int); +static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); static int obj_enforce_relro(Obj_Entry *); @@ -147,7 +147,7 @@ static int relocate_objects(Obj_Entry *, bool, Obj_Ent static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int rtld_dirname(const char *, char *); static int rtld_dirname_abs(const char *, char *); -static void *rtld_dlopen(int, const char *name, int fd, int mode); +static void *rtld_dlopen(const char *name, int fd, int mode); static void rtld_exit(void); static char *search_library_path(const char *, const char *, const char *, int *); @@ -231,7 +231,6 @@ extern Elf_Dyn _DYNAMIC; int dlclose(void *) __exported; char *dlerror(void) __exported; void *dlopen(const char *, int) __exported; -void *dlopenat(int, const char *, int) __exported; void *fdlopen(int, int) __exported; void *dlsym(void *, const char *) __exported; dlfunc_t dlfunc(void *, const char *) __exported; @@ -2293,8 +2292,8 @@ load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int { for (; needed != NULL; needed = needed->next) { - needed->obj = dlopen_object(AT_FDCWD, obj->strtab + needed->name, -1, - obj, flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | + needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj, + flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | RTLD_LOCAL, lockstate); } } @@ -2317,8 +2316,8 @@ process_needed(Obj_Entry *obj, Needed_Entry *needed, i Obj_Entry *obj1; for (; needed != NULL; needed = needed->next) { - obj1 = needed->obj = load_object(AT_FDCWD, obj->strtab + needed->name, - -1, obj, flags & ~RTLD_LO_NOLOAD); + obj1 = needed->obj = load_object(obj->strtab + needed->name, -1, obj, + flags & ~RTLD_LO_NOLOAD); if (obj1 == NULL && !ld_tracing && (flags & RTLD_LO_FILTEES) == 0) return (-1); } @@ -2361,7 +2360,7 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - obj = load_object(AT_FDCWD, p, -1, NULL, 0); + obj = load_object(p, -1, NULL, 0); if (obj == NULL) return -1; /* XXX - cleanup */ obj->z_interpose = true; @@ -2390,8 +2389,7 @@ printable_path(const char *path) * on failure. */ static Obj_Entry * -load_object(int atfd, const char *name, int fd_u, const Obj_Entry *refobj, - int flags) +load_object(const char *name, int fd_u, const Obj_Entry *refobj, int flags) { Obj_Entry *obj; int fd; @@ -2428,7 +2426,7 @@ load_object(int atfd, const char *name, int fd_u, cons * To avoid a race, we open the file and use fstat() rather than * using stat(). */ - if ((fd = openat(atfd, path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) { + if ((fd = open(path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) { _rtld_error("Cannot open \"%s\"", path); free(path); return (NULL); @@ -3257,28 +3255,21 @@ dllockinit(void *context, } void * -dlopenat(int fd, const char *name, int mode) -{ - - return (rtld_dlopen(fd, name, -1, mode)); -} - -void * dlopen(const char *name, int mode) { - return (rtld_dlopen(AT_FDCWD, name, -1, mode)); + return (rtld_dlopen(name, -1, mode)); } void * fdlopen(int fd, int mode) { - return (rtld_dlopen(AT_FDCWD, NULL, fd, mode)); + return (rtld_dlopen(NULL, fd, mode)); } static void * -rtld_dlopen(int atfd, const char *name, int fd, int mode) +rtld_dlopen(const char *name, int fd, int mode) { RtldLockState lockstate; int lo_flags; @@ -3300,7 +3291,7 @@ rtld_dlopen(int atfd, const char *name, int fd, int mo if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE; - return (dlopen_object(atfd, name, fd, obj_main, lo_flags, + return (dlopen_object(name, fd, obj_main, lo_flags, mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); } @@ -3315,8 +3306,8 @@ dlopen_cleanup(Obj_Entry *obj, RtldLockState *lockstat } static Obj_Entry * -dlopen_object(int atfd, const char *name, int fd, Obj_Entry *refobj, - int lo_flags, int mode, RtldLockState *lockstate) +dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, + int mode, RtldLockState *lockstate) { Obj_Entry *old_obj_tail; Obj_Entry *obj; @@ -3338,7 +3329,7 @@ dlopen_object(int atfd, const char *name, int fd, Obj_ obj = obj_main; obj->refcount++; } else { - obj = load_object(atfd, name, fd, refobj, lo_flags); + obj = load_object(name, fd, refobj, lo_flags); } if (obj) { From owner-svn-src-head@freebsd.org Thu Jan 17 17:05:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3DE4149D93E; Thu, 17 Jan 2019 17:05:31 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3087A713AA; Thu, 17 Jan 2019 17:05:31 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f51.google.com with SMTP id v5so8349008lfe.7; Thu, 17 Jan 2019 09:05:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=xSMv7QmJUM4uBJmuhKnfDUjpJgiGYPJ1JfBhcAtwzBY=; b=MfHZnNTVIXfsm4mowdXqaSTAZPrdFbUj/TdhorUJFsfjx9wkbG3bbqqP07IeKPv5zN gXcMUOUE9jsj+iyZ2JGl9sK1Ki7P9/hYrlP6/G5Ki11VWnw70rpKSMQ8sBMxjjf1NQ2A LvUXq5Wzd73oP6lf1laZ/BIZD09FgpIrS+8e2IPxApbHP4qGCO4YruuwjGyB2YB/DB25 YFwakfwBRiZ/ktvmGmAEjr4Ijh/k80jwfHqNxCzErl0PN/BvfksRzvbcOkl1TeVOPD4Y 786cQGxL6zuNCPurCu+HUm3zyqH8biEaxVPWAdKITZqS3fRGAyZK7jcYdeB1ewUJvtGK yy2w== X-Gm-Message-State: AJcUukdBLFKHSksfz5UBpb/KRA32mCLHZq/2FrEy7kxWYBbMBGFjBHii yIwMipsD8Diy6men9FJEgBppVsKS X-Google-Smtp-Source: ALg8bN7ozQ+PrjHBF89fJW8AxtJLi2WWTiNxT0s07Qq3B0A4C06v1VVcpbIkGT3U8jpa6EC0/VeQGA== X-Received: by 2002:a19:a84e:: with SMTP id r75mr10991383lfe.45.1547744723407; Thu, 17 Jan 2019 09:05:23 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id h203sm395256lfe.44.2019.01.17.09.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 09:05:22 -0800 (PST) Subject: Re: svn commit: r343113 - head/contrib/libc++/include To: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901171535.x0HFZ564087839@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <99fd64c3-b3b3-fd50-6370-224a329a3340@FreeBSD.org> Date: Thu, 17 Jan 2019 19:05:20 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201901171535.x0HFZ564087839@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3087A713AA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 17:05:32 -0000 On 17/01/2019 17:35, Kirk McKusick wrote: > -#ifdef ELAST > +#if defined(ELAST) I think that these are exactly the same, so not sure what the change does. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Jan 17 17:36:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CAC5149E6CE; Thu, 17 Jan 2019 17:36:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C758372A02; Thu, 17 Jan 2019 17:36:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 906A51D7D9; Thu, 17 Jan 2019 17:36:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HHaImd052706; Thu, 17 Jan 2019 17:36:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HHaIad052705; Thu, 17 Jan 2019 17:36:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901171736.x0HHaIad052705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Jan 2019 17:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343117 - head/usr.bin/cmp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cmp X-SVN-Commit-Revision: 343117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C758372A02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 17:36:19 -0000 Author: markj Date: Thu Jan 17 17:36:18 2019 New Revision: 343117 URL: https://svnweb.freebsd.org/changeset/base/343117 Log: Fix handling of rights on stdio streams. - Limit rights on stdio before opening input files. Otherwise, open() may return one of the standard descriptors and we end up limiting rights such that we cannot read from one of the input files. - Use caph_limit_stdio(), which suppresses EBADF, to ensure that we don't emit an error if one of the stdio streams is closed. - Don't bother further limiting rights on stdin when stdin isn't going to be used. Doing so correctly requires checking for a number of edge cases, and it doesn't provide any significant benefit. PR: 234885 Reviewed by: oshogbo MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18860 Modified: head/usr.bin/cmp/cmp.c Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Thu Jan 17 16:50:50 2019 (r343116) +++ head/usr.bin/cmp/cmp.c Thu Jan 17 17:36:18 2019 (r343117) @@ -116,14 +116,16 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); + if (caph_limit_stdio() == -1) + err(ERR_EXIT, "failed to limit stdio"); + /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = 0; + fd1 = STDIN_FILENO; file1 = "stdin"; - } - else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -134,10 +136,9 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = 0; + fd2 = STDIN_FILENO; file2 = "stdin"; - } - else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -174,16 +175,6 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit fcntls for %s", file1); if (caph_fcntls_limit(fd2, fcntls) < 0) err(ERR_EXIT, "unable to limit fcntls for %s", file2); - - if (!special) { - cap_rights_init(&rights); - if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { - err(ERR_EXIT, "unable to limit stdio"); - } - } - - if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) - err(ERR_EXIT, "unable to limit stdio"); caph_cache_catpages(); From owner-svn-src-head@freebsd.org Thu Jan 17 18:08:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E15149F509; Thu, 17 Jan 2019 18:08:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEEA273C52; Thu, 17 Jan 2019 18:08:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E13C71DCF8; Thu, 17 Jan 2019 18:08:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HI80En068567; Thu, 17 Jan 2019 18:08:00 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HI80jC068564; Thu, 17 Jan 2019 18:08:00 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201901171808.x0HI80jC068564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 17 Jan 2019 18:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343118 - in head/usr.sbin: . trim X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head/usr.sbin: . trim X-SVN-Commit-Revision: 343118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEEA273C52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 18:08:01 -0000 Author: eugen Date: Thu Jan 17 18:07:59 2019 New Revision: 343118 URL: https://svnweb.freebsd.org/changeset/base/343118 Log: Re-add new small tool trim(8) to delete contents for blocks on devices using wear-leveling algorithms as a few weeks passed after review and discussion of trim(8) ceased and we still have no utility to perform the job. Reviewed by: hackers@ MFC after: 2 weeks Added: head/usr.sbin/trim/ head/usr.sbin/trim/Makefile (contents, props changed) head/usr.sbin/trim/trim.8 (contents, props changed) head/usr.sbin/trim/trim.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Jan 17 17:36:18 2019 (r343117) +++ head/usr.sbin/Makefile Thu Jan 17 18:07:59 2019 (r343118) @@ -92,6 +92,7 @@ SUBDIR= adduser \ tcpdrop \ tcpdump \ traceroute \ + trim \ trpt \ tzsetup \ ugidfw \ Added: head/usr.sbin/trim/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/trim/Makefile Thu Jan 17 18:07:59 2019 (r343118) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= trim +MAN= trim.8 +LIBADD= util +LDFLAGS= -lutil + +.include Added: head/usr.sbin/trim/trim.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/trim/trim.8 Thu Jan 17 18:07:59 2019 (r343118) @@ -0,0 +1,167 @@ +.\" +.\" Copyright (c) 2019 Eugene Grosbein . +.\" 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 January 18, 2019 +.Dt TRIM 8 +.Os +.Sh NAME +.Nm trim +.Nd erase device blocks that have no needed contents +.Sh SYNOPSIS +.Nm +.Op Fl Nfqv +.Fl [ [lo] Xo +.Bk -words +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t ] +.Sm on +.Xc +.Ek +.Bk -words +.Op Fl r Ar rfile +.Ek +.Ar device ... +.Sh DESCRIPTION +The +.Nm +utility erases specified region of the device. +It is mostly relevant for storage that implement trim (like flash based, +or thinly provisioned storage). +.Sy All erased data is lost. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl N +Do not actually erase anything but show what it would do (dry run). +Implies +.Fl v . +This is the default. Overrides +.Fl f . +.It Fl f +Perform the operation. Overrides +.Fl N . +.It Fl l Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +.It Fl o Xo +.Sm off +.Ar offset +.Op Cm K | k | M | m | G | g | T | t +.Sm on +.Xc +Specify the length +.Fl l +of the region to trim or its offset +.Fl o +from the beginning of the device. +.Sy The whole device is erased by default +unless one or both of these options are presented. +.Pp +The argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. +.It Fl q +Do not output anything except of possible error messages (quiet mode). +Overrides +.Fl v . +.It Fl r Ar rfile +Uses the length of given +.Ar rfile +as length of the region to erase. +.Sy The whole device is erased by default. +.It Fl v +Show offset and length of actual region being erased, in bytes. +.El +.Pp +Later options override previous ones. +.Pp +Note that actual success of the operation depends of underlying +device driver such as +.Xr ada 4 , +.Xr da 4 +and others. +Refer to corresponding manual pages for detail on possible caveats +in low level support for ATA TRIM or SCSI UNMAP commands. +.Sh EXIT STATUS +.Ex -std +If the final erase operation fails for an argument, the +.Nm +utility returns exit code 1. +It can also return one of the exit codes defined in +.Xr sysexits 3 , +as follows: +.Bl -tag -width ".Dv EX_UNAVAILABLE" +.It Dv EX_USAGE +The specified offset or length of the region is incorrect. +.It Dv EX_OSERR +There is no enough memory to proceed. +.It Dv EX_NOINPUT +The specified +.Ar rfile +cannot be opened (perhaps, it does not exist). +.It Dv EX_IOERR +The specified +.Ar rfile +cannot be examined for its size due to some system input/output error. +.It Dv EX_DATAERR +The specified +.Ar rfile +is not regular file, directory nor special device, so its size +cannot be examined. +.It Dv EX_UNAVAILABLE +The specified +.Ar rfile +is special device file not supporting DIOCGMEDIASIZE +.Xr ioctl 2 +(probably not a disk), so its size cannot be examined. +.El +.Sh SEE ALSO +.Xr ada 4 , +.Xr da 4 , +.Xr ioctl 2 , +.Xr nda 4 , +.Xr sysexits 3 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 12.1 . +.Sh AUTHORS +The +.Nm +utility was written by +.An Eugene Grosbein Aq Mt eugen@FreeBSD.org . Added: head/usr.sbin/trim/trim.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/trim/trim.c Thu Jan 17 18:07:59 2019 (r343118) @@ -0,0 +1,210 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Eugene Grosbein . + * 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. + * + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +__FBSDID("$FreeBSD$"); + +static off_t getsize(const char *path); +static int opendev(const char *path, int flags); +static int trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose); +static void usage(const char *name); + +int +main(int argc, char **argv) +{ + off_t offset, length; + uint64_t usz; + int ch, error; + bool dryrun, verbose; + char *fname, *name; + + error = 0; + length = offset = 0; + name = argv[0]; + dryrun = verbose = true; + + while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1) + switch (ch) { + case 'N': + dryrun = true; + verbose = true; + break; + case 'f': + dryrun = false; + break; + case 'l': + case 'o': + if (expand_number(optarg, &usz) == -1 || + (off_t)usz < 0 || (usz == 0 && ch == 'l')) + errx(EX_USAGE, + "invalid %s of the region: %s", + ch == 'o' ? "offset" : "length", + optarg); + if (ch == 'o') + offset = (off_t)usz; + else + length = (off_t)usz; + break; + case 'q': + verbose = false; + break; + case 'r': + if ((length = getsize(optarg)) == 0) + errx(EX_USAGE, + "invalid zero length reference file" + " for the region: %s", optarg); + break; + case 'v': + verbose = true; + break; + default: + usage(name); + /* NOTREACHED */ + } + + argv += optind; + argc -= optind; + + if (argc < 1) + usage(name); + + while ((fname = *argv++) != NULL) + if (trim(fname, offset, length, dryrun, verbose) < 0) + error++; + + return (error ? EXIT_FAILURE : EXIT_SUCCESS); +} + +static int +opendev(const char *path, int flags) +{ + int fd; + char *tstr; + + if ((fd = open(path, flags)) < 0) { + if (errno == ENOENT && path[0] != '/') { + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) + errx(EX_OSERR, "no memory"); + fd = open(tstr, flags); + free(tstr); + } + } + + if (fd < 0) + err(EX_NOINPUT, "open failed: %s", path); + + return (fd); +} + +static off_t +getsize(const char *path) +{ + struct stat sb; + off_t mediasize; + int fd; + + fd = opendev(path, O_RDONLY | O_DIRECT); + + if (fstat(fd, &sb) < 0) + err(EX_IOERR, "fstat failed: %s", path); + + if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { + close(fd); + return (sb.st_size); + } + + if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) + errx(EX_DATAERR, + "invalid type of the file " + "(not regular, directory nor special device): %s", + path); + + if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) + err(EX_UNAVAILABLE, + "ioctl(DIOCGMEDIASIZE) failed, probably not a disk: " + "%s", path); + + close(fd); + return (mediasize); +} + +static int +trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose) +{ + off_t arg[2]; + int error, fd; + + if (length == 0) + length = getsize(path); + + if (verbose) + printf("trim %s offset %ju length %ju\n", + path, (uintmax_t)offset, (uintmax_t)length); + + if (dryrun) { + printf("dry run: add -f to actually perform the operation\n"); + return (0); + } + + fd = opendev(path, O_WRONLY | O_DIRECT); + arg[0] = offset; + arg[1] = length; + + error = ioctl(fd, DIOCGDELETE, arg); + if (error < 0) + warn("ioctl(DIOCGDELETE) failed: %s", path); + + close(fd); + return (error); +} + +static void +usage(const char *name) +{ + (void)fprintf(stderr, + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] device ...\n", + name); + exit(EX_USAGE); +} From owner-svn-src-head@freebsd.org Thu Jan 17 18:51:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F51A14A10DA; Thu, 17 Jan 2019 18:51:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D406975BE3; Thu, 17 Jan 2019 18:51:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC7791E5AC; Thu, 17 Jan 2019 18:51:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HIpuqG094283; Thu, 17 Jan 2019 18:51:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HIpucZ094282; Thu, 17 Jan 2019 18:51:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901171851.x0HIpucZ094282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 17 Jan 2019 18:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343119 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 343119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D406975BE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 18:51:57 -0000 Author: kevans Date: Thu Jan 17 18:51:56 2019 New Revision: 343119 URL: https://svnweb.freebsd.org/changeset/base/343119 Log: Revert r343095 This was intended to fix the soft reset timeout on boot for OrangePi One/R1 with internal PHY, but seems to cause other problems later on due to soft resetting around some state changes that may or may not make the NIC non-functional. Reverting this for now while a better solution is sought out. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Thu Jan 17 18:07:59 2019 (r343118) +++ head/sys/arm/allwinner/if_awg.c Thu Jan 17 18:51:56 2019 (r343119) @@ -750,31 +750,6 @@ awg_disable_intr(struct awg_softc *sc) WR4(sc, EMAC_INT_EN, 0); } -static int -awg_reset(struct awg_softc *sc) -{ - int retry; - - /* Soft reset all registers and logic */ - WR4(sc, EMAC_BASIC_CTL_1, BASIC_CTL_SOFT_RST); - - /* Wait for soft reset bit to self-clear */ - for (retry = SOFT_RST_RETRY; retry > 0; retry--) { - if ((RD4(sc, EMAC_BASIC_CTL_1) & BASIC_CTL_SOFT_RST) == 0) - break; - DELAY(10); - } - if (retry == 0) { - device_printf(sc->dev, "soft reset timed out\n"); -#ifdef AWG_DEBUG - awg_dump_regs(sc->dev); -#endif - return (ETIMEDOUT); - } - - return (0); -} - static void awg_init_locked(struct awg_softc *sc) { @@ -790,12 +765,6 @@ awg_init_locked(struct awg_softc *sc) if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) return; - awg_reset(sc); - - /* Write transmit and receive descriptor base address registers */ - WR4(sc, EMAC_TX_DMA_LIST, sc->tx.desc_ring_paddr); - WR4(sc, EMAC_RX_DMA_LIST, sc->rx.desc_ring_paddr); - awg_setup_rxfilter(sc); /* Configure DMA burst length and priorities */ @@ -1684,6 +1653,40 @@ awg_phy_reset(device_t dev) return (0); } +static int +awg_reset(device_t dev) +{ + struct awg_softc *sc; + int retry; + + sc = device_get_softc(dev); + + /* Reset PHY if necessary */ + if (awg_phy_reset(dev) != 0) { + device_printf(dev, "failed to reset PHY\n"); + return (ENXIO); + } + + /* Soft reset all registers and logic */ + WR4(sc, EMAC_BASIC_CTL_1, BASIC_CTL_SOFT_RST); + + /* Wait for soft reset bit to self-clear */ + for (retry = SOFT_RST_RETRY; retry > 0; retry--) { + if ((RD4(sc, EMAC_BASIC_CTL_1) & BASIC_CTL_SOFT_RST) == 0) + break; + DELAY(10); + } + if (retry == 0) { + device_printf(dev, "soft reset timed out\n"); +#ifdef AWG_DEBUG + awg_dump_regs(dev); +#endif + return (ETIMEDOUT); + } + + return (0); +} + static void awg_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -1837,6 +1840,10 @@ awg_setup_dma(device_t dev) bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, BUS_DMASYNC_PREWRITE); + /* Write transmit and receive descriptor base address registers */ + WR4(sc, EMAC_TX_DMA_LIST, sc->tx.desc_ring_paddr); + WR4(sc, EMAC_RX_DMA_LIST, sc->rx.desc_ring_paddr); + return (0); } @@ -1881,12 +1888,10 @@ awg_attach(device_t dev) /* Read MAC address before resetting the chip */ awg_get_eaddr(dev, eaddr); - /* Reset PHY if necessary */ - error = awg_phy_reset(dev); - if (error != 0) { - device_printf(dev, "failed to reset PHY\n"); + /* Soft reset EMAC core */ + error = awg_reset(dev); + if (error != 0) return (error); - } /* Setup DMA descriptors */ error = awg_setup_dma(dev); From owner-svn-src-head@freebsd.org Thu Jan 17 19:14:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CAA914A1E1A; Thu, 17 Jan 2019 19:14:04 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BA776984; Thu, 17 Jan 2019 19:14:02 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x0HJMYaq029738; Thu, 17 Jan 2019 11:22:34 -0800 (PST) (envelope-from mckusick@mckusick.com) Message-Id: <201901171922.x0HJMYaq029738@chez.mckusick.com> From: Kirk McKusick To: Andriy Gapon Subject: Re: svn commit: r343113 - head/contrib/libc++/include cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: <99fd64c3-b3b3-fd50-6370-224a329a3340@FreeBSD.org> Comments: In-reply-to Andriy Gapon message dated "Thu, 17 Jan 2019 19:05:20 +0200." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29736.1547752954.1@chez.mckusick.com> Date: Thu, 17 Jan 2019 11:22:34 -0800 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: D8BA776984 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.945,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 19:14:04 -0000 > From: Andriy Gapon > Date: Thu, 17 Jan 2019 19:05:20 +0200 > To: Kirk McKusick , src-committers@freebsd.org, > svn-src-all@freebsd.org, svn-src-head@freebsd.org > Subject: Re: svn commit: r343113 - head/contrib/libc++/include > > On 17/01/2019 17:35, Kirk McKusick wrote: >> -#ifdef ELAST >> +#if defined(ELAST) > > I think that these are exactly the same, so not sure what the change does. > > -- > Andriy Gapon It was suggested to me that Clang was 'strict' and that it would kick out the first form. That proved to not be true. To compound my goof, I missed the actual fix when I did the commit, so had to do -r343115 to get the needed part of the fix in place. I should learn to have my morning coffee *before* commiting anything. Kirk McKusick From owner-svn-src-head@freebsd.org Thu Jan 17 19:44:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9296D14A455D; Thu, 17 Jan 2019 19:44:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3341280B3F; Thu, 17 Jan 2019 19:44:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2557C1EEE4; Thu, 17 Jan 2019 19:44:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HJim3e023237; Thu, 17 Jan 2019 19:44:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HJilaa023236; Thu, 17 Jan 2019 19:44:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901171944.x0HJilaa023236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 17 Jan 2019 19:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343120 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 343120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3341280B3F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 19:44:48 -0000 Author: cem Date: Thu Jan 17 19:44:47 2019 New Revision: 343120 URL: https://svnweb.freebsd.org/changeset/base/343120 Log: Add definitions for AMD Spectre/Meltdown CPUID information No functional change, aside from printing recognized bits in CPU identification. The bits are documented in 111006-B "Indirect Branch Control Extension"[1] and 124441 "Speculative Store Bypass Disable."[2] Notably missing (left as future work): * Integration with hw.spec_store_bypass_disable and hw_ssb_active flag, which are currently Intel-specific * Integration with hw_ibrs_active global flag, which are currently Intel-specific * SSB_NO integration in hw_ssb_recalculate() * Bhyve integration (PR 235010) [1]: https://developer.amd.com/wp-content/resources/111006-B_AMD64TechnologyIndirectBranchControlExtenstion_WP_7-18Update_FNL.pdf [2]: https://developer.amd.com/wp-content/resources/124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf PR: 235010 (related, but does not fix) MFC after: a week Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Jan 17 18:51:56 2019 (r343119) +++ head/sys/x86/include/specialreg.h Thu Jan 17 19:44:47 2019 (r343120) @@ -374,6 +374,17 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_IBPB 0x00001000 +#define AMDFEID_IBRS 0x00004000 +#define AMDFEID_STIBP 0x00008000 +/* The below are only defined if the corresponding base feature above exists. */ +#define AMDFEID_IBRS_ALWAYSON 0x00010000 +#define AMDFEID_STIBP_ALWAYSON 0x00020000 +#define AMDFEID_PREFER_IBRS 0x00040000 +#define AMDFEID_SSBD 0x01000000 +/* SSBD via MSRC001_011F instead of MSR 0x48: */ +#define AMDFEID_VIRT_SSBD 0x02000000 +#define AMDFEID_SSB_NO 0x04000000 /* * AMD extended function 8000_0008h ecx info @@ -719,6 +730,10 @@ /* * IA32_SPEC_CTRL and IA32_PRED_CMD MSRs are described in the Intel' * document 336996-001 Speculative Execution Side Channel Mitigations. + * + * AMD uses the same MSRs and bit definitions, as described in 111006-B + * "Indirect Branch Control Extension" and 124441 "Speculative Store Bypass + * Disable." */ /* MSR IA32_SPEC_CTRL */ #define IA32_SPEC_CTRL_IBRS 0x00000001 Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Jan 17 18:51:56 2019 (r343119) +++ head/sys/x86/x86/identcpu.c Thu Jan 17 19:44:47 2019 (r343120) @@ -1021,13 +1021,34 @@ printcpuinfo(void) } if (amd_extended_feature_extensions != 0) { + u_int amd_fe_masked; + + amd_fe_masked = amd_extended_feature_extensions; + if ((amd_fe_masked & AMDFEID_IBRS) == 0) + amd_fe_masked &= + ~(AMDFEID_IBRS_ALWAYSON | + AMDFEID_PREFER_IBRS); + if ((amd_fe_masked & AMDFEID_STIBP) == 0) + amd_fe_masked &= + ~AMDFEID_STIBP_ALWAYSON; + printf("\n " "AMD Extended Feature Extensions ID EBX=" - "0x%b", amd_extended_feature_extensions, + "0x%b", amd_fe_masked, "\020" "\001CLZERO" "\002IRPerf" - "\003XSaveErPtr"); + "\003XSaveErPtr" + "\015IBPB" + "\017IBRS" + "\020STIBP" + "\021IBRS_ALWAYSON" + "\022STIBP_ALWAYSON" + "\023PREFER_IBRS" + "\031SSBD" + "\032VIRT_SSBD" + "\033SSB_NO" + ); } if (via_feature_rng != 0 || via_feature_xcrypt != 0) From owner-svn-src-head@freebsd.org Thu Jan 17 20:01:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5D8C14A4DC7; Thu, 17 Jan 2019 20:01:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 657C281882; Thu, 17 Jan 2019 20:01:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556A91F105; Thu, 17 Jan 2019 20:01:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HK17Vl030529; Thu, 17 Jan 2019 20:01:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HK17GI030507; Thu, 17 Jan 2019 20:01:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901172001.x0HK17GI030507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 Jan 2019 20:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343121 - head/usr.sbin/nscd X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/nscd X-SVN-Commit-Revision: 343121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 657C281882 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 20:01:07 -0000 Author: trasz Date: Thu Jan 17 20:01:06 2019 New Revision: 343121 URL: https://svnweb.freebsd.org/changeset/base/343121 Log: Workaround for nscd(8) failure with large entries. It fixes a case where eg a 2KB group entry would take several seconds to complete with cache enabled in nsswitch.conf. MFC after: 2 weeks Sponsored by: Chalmers University of Technology Differential Revision: https://reviews.freebsd.org/D18392 Modified: head/usr.sbin/nscd/nscd.c Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Thu Jan 17 19:44:47 2019 (r343120) +++ head/usr.sbin/nscd/nscd.c Thu Jan 17 20:01:06 2019 (r343121) @@ -405,6 +405,12 @@ process_socket_event(struct kevent *event_data, struct * process_socket_event). */ if (qstate->kevent_watermark > MAX_SOCKET_IO_SIZE) { +#if 0 + /* + * XXX: Uncommenting this code makes nscd(8) fail for + * entries larger than a few kB, causing few second + * worth of delay for each call to retrieve them. + */ if (qstate->io_buffer != NULL) free(qstate->io_buffer); @@ -421,6 +427,7 @@ process_socket_event(struct kevent *event_data, struct if (qstate->kevent_filter == EVFILT_READ) qstate->use_alternate_io = 1; +#endif qstate->io_buffer_watermark = MAX_SOCKET_IO_SIZE; EV_SET(&eventlist[1], event_data->ident, From owner-svn-src-head@freebsd.org Thu Jan 17 20:22:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D201514A570C; Thu, 17 Jan 2019 20:22:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 70BB982744; Thu, 17 Jan 2019 20:22:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kEBFg7s8vMRX3kEBGgn8vn; Thu, 17 Jan 2019 13:22:28 -0700 X-Authority-Analysis: v=2.3 cv=TL87tGta c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=sMp5GC8IKM9tDUOlDx8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 218272D5A; Thu, 17 Jan 2019 12:22:41 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0HKMNKc062563; Thu, 17 Jan 2019 12:22:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0HKMN2Z062553; Thu, 17 Jan 2019 12:22:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901172022.x0HKMN2Z062553@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Eugene Grosbein cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from Eugene Grosbein of "Thu, 17 Jan 2019 18:08:00 +0000." <201901171808.x0HI80jC068564@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 Jan 2019 12:22:23 -0800 X-CMAE-Envelope: MS4wfJw+b7MPLX8MThg0WeBOl02j4JxK+ZW+2s9Dx0MNiC1NJvbRiI5906dw7mLxHh0V4HsXUHzM/I5qwZMRZkCKziyUFBfnFL6ZOLx4TKOT4iIl+gcXNv4D 5hPsrUO4dpvP6lNlIKWUFtpOP6FgqgsTvLUKVwty40y4DvPP4hJpfUkoM8haLJQf83DVuS4jnlVJzqMHXNR/erqSnVG1CUKQrvrrC1EJ0Tml0Or8ChqCHIAU pNA25sh05wvrapuUrPFSYNQW/4j6PBntbYcB1YHnsWuofnDo7OVOKdIaHmhK2hYb X-Rspamd-Queue-Id: 70BB982744 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.51 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-1.87)[ip: (-5.07), ipnet: 64.59.128.0/20(-2.38), asn: 6327(-1.84), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 20:22:38 -0000 In message <201901171808.x0HI80jC068564@repo.freebsd.org>, Eugene Grosbein writ es: > Author: eugen > Date: Thu Jan 17 18:07:59 2019 > New Revision: 343118 > URL: https://svnweb.freebsd.org/changeset/base/343118 > > Log: > Re-add new small tool trim(8) to delete contents for blocks > on devices using wear-leveling algorithms as a few weeks passed > after review and discussion of trim(8) ceased and > we still have no utility to perform the job. > > Reviewed by: hackers@ > MFC after: 2 weeks > > Added: > head/usr.sbin/trim/ > head/usr.sbin/trim/Makefile (contents, props changed) > head/usr.sbin/trim/trim.8 (contents, props changed) > head/usr.sbin/trim/trim.c (contents, props changed) > Modified: > head/usr.sbin/Makefile > This is wrong. IIRC there was discussion that this should be in dd(1). Why not submit a revision to add the functionality to dd? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Jan 17 20:23:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11CB614A574B; Thu, 17 Jan 2019 20:23:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A10158288A; Thu, 17 Jan 2019 20:23:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f43.google.com with SMTP id k2so8891728iog.7; Thu, 17 Jan 2019 12:23:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=TDR5HjotlZVa0sGWU+Ukmj2szL1Gg9Yp7K8DE/Myt2I=; b=DuIOFU0izcj4jnzxeBoBp2ZLfjGbxL25lbE4cdPRZlCB4wg0KqazIvN8f6ipoBUvlK ers/JmJLdrdiihSZWbZklL6hOvbnF1uaGtONH1xPdUjG7U3pAWxGoJ8qu6G3jNloyA4a YN0soBFHD6XYgNV1qA0tpsdkvEcQb4Or9OIGtIs+fiQaQI8rwmo5qSbQzmH5fpttADnI CmLOpFIfd6XBk7AIlsJbA8z9cDaqu1T/732fAIiSqfGJA+sPlWYnPGwIhKlEXzgiX2Mf 7VJJUF1jwuqipxQfHpkGRVTTrpxj/7xYAjsjDslvcmQdRbLzUr7lo8VE1185ZQGBofz7 VyTQ== X-Gm-Message-State: AJcUukdmMS4Th11SIg9kGPRq1vKNiSGX5gregehu36Ay6ZP9kJ6lxY64 ND8nt5fZmKATfKXduLq9OGCVf/5y X-Google-Smtp-Source: ALg8bN5w7ksAYH29gmtvAkvWm6Ll1njWAfmcpT1dibSGB8kijlLQyVvqihqxPoe0gsviAFA0OpxNOQ== X-Received: by 2002:a5e:8817:: with SMTP id l23mr7930263ioj.272.1547756603596; Thu, 17 Jan 2019 12:23:23 -0800 (PST) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com. [209.85.166.182]) by smtp.gmail.com with ESMTPSA id e22sm913976iod.47.2019.01.17.12.23.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 12:23:23 -0800 (PST) Received: by mail-it1-f182.google.com with SMTP id g76so3496235itg.2; Thu, 17 Jan 2019 12:23:23 -0800 (PST) X-Received: by 2002:a02:a791:: with SMTP id e17mr9672631jaj.104.1547756603121; Thu, 17 Jan 2019 12:23:23 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> In-Reply-To: <201901171808.x0HI80jC068564@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 17 Jan 2019 12:23:12 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Eugene Grosbein Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A10158288A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 20:23:31 -0000 Please back it out; stop attributing code review to "hackers@," which can not (it's a list, not individuals) and did not review this changeset; and put it on phabricator for actual review. I think summary backout is warranted on the basis of your handling of this last time around and lack of attempt to solicit review for this time. On Thu, Jan 17, 2019 at 10:08 AM Eugene Grosbein wrote: > > Author: eugen > Date: Thu Jan 17 18:07:59 2019 > New Revision: 343118 > URL: https://svnweb.freebsd.org/changeset/base/343118 > > Log: > Re-add new small tool trim(8) to delete contents for blocks > on devices using wear-leveling algorithms as a few weeks passed > after review and discussion of trim(8) ceased and > we still have no utility to perform the job. > > Reviewed by: hackers@ > MFC after: 2 weeks > > Added: > head/usr.sbin/trim/ > head/usr.sbin/trim/Makefile (contents, props changed) > head/usr.sbin/trim/trim.8 (contents, props changed) > head/usr.sbin/trim/trim.c (contents, props changed) > Modified: > head/usr.sbin/Makefile > > Modified: head/usr.sbin/Makefile > ============================================================================== > --- head/usr.sbin/Makefile Thu Jan 17 17:36:18 2019 (r343117) > +++ head/usr.sbin/Makefile Thu Jan 17 18:07:59 2019 (r343118) > @@ -92,6 +92,7 @@ SUBDIR= adduser \ > tcpdrop \ > tcpdump \ > traceroute \ > + trim \ > trpt \ > tzsetup \ > ugidfw \ > > Added: head/usr.sbin/trim/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/trim/Makefile Thu Jan 17 18:07:59 2019 (r343118) > @@ -0,0 +1,8 @@ > +# $FreeBSD$ > + > +PROG= trim > +MAN= trim.8 > +LIBADD= util > +LDFLAGS= -lutil > + > +.include > > Added: head/usr.sbin/trim/trim.8 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/trim/trim.8 Thu Jan 17 18:07:59 2019 (r343118) > @@ -0,0 +1,167 @@ > +.\" > +.\" Copyright (c) 2019 Eugene Grosbein . > +.\" 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 January 18, 2019 > +.Dt TRIM 8 > +.Os > +.Sh NAME > +.Nm trim > +.Nd erase device blocks that have no needed contents > +.Sh SYNOPSIS > +.Nm > +.Op Fl Nfqv > +.Fl [ [lo] Xo > +.Bk -words > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t ] > +.Sm on > +.Xc > +.Ek > +.Bk -words > +.Op Fl r Ar rfile > +.Ek > +.Ar device ... > +.Sh DESCRIPTION > +The > +.Nm > +utility erases specified region of the device. > +It is mostly relevant for storage that implement trim (like flash based, > +or thinly provisioned storage). > +.Sy All erased data is lost. > +.Pp > +The following options are available: > +.Bl -tag -width indent > +.It Fl N > +Do not actually erase anything but show what it would do (dry run). > +Implies > +.Fl v . > +This is the default. Overrides > +.Fl f . > +.It Fl f > +Perform the operation. Overrides > +.Fl N . > +.It Fl l Xo > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t > +.Sm on > +.Xc > +.It Fl o Xo > +.Sm off > +.Ar offset > +.Op Cm K | k | M | m | G | g | T | t > +.Sm on > +.Xc > +Specify the length > +.Fl l > +of the region to trim or its offset > +.Fl o > +from the beginning of the device. > +.Sy The whole device is erased by default > +unless one or both of these options are presented. > +.Pp > +The argument may be suffixed with one of > +.Cm K , > +.Cm M , > +.Cm G > +or > +.Cm T > +(either upper or lower case) to indicate a multiple of > +Kilobytes, Megabytes, Gigabytes or Terabytes > +respectively. > +.It Fl q > +Do not output anything except of possible error messages (quiet mode). > +Overrides > +.Fl v . > +.It Fl r Ar rfile > +Uses the length of given > +.Ar rfile > +as length of the region to erase. > +.Sy The whole device is erased by default. > +.It Fl v > +Show offset and length of actual region being erased, in bytes. > +.El > +.Pp > +Later options override previous ones. > +.Pp > +Note that actual success of the operation depends of underlying > +device driver such as > +.Xr ada 4 , > +.Xr da 4 > +and others. > +Refer to corresponding manual pages for detail on possible caveats > +in low level support for ATA TRIM or SCSI UNMAP commands. > +.Sh EXIT STATUS > +.Ex -std > +If the final erase operation fails for an argument, the > +.Nm > +utility returns exit code 1. > +It can also return one of the exit codes defined in > +.Xr sysexits 3 , > +as follows: > +.Bl -tag -width ".Dv EX_UNAVAILABLE" > +.It Dv EX_USAGE > +The specified offset or length of the region is incorrect. > +.It Dv EX_OSERR > +There is no enough memory to proceed. > +.It Dv EX_NOINPUT > +The specified > +.Ar rfile > +cannot be opened (perhaps, it does not exist). > +.It Dv EX_IOERR > +The specified > +.Ar rfile > +cannot be examined for its size due to some system input/output error. > +.It Dv EX_DATAERR > +The specified > +.Ar rfile > +is not regular file, directory nor special device, so its size > +cannot be examined. > +.It Dv EX_UNAVAILABLE > +The specified > +.Ar rfile > +is special device file not supporting DIOCGMEDIASIZE > +.Xr ioctl 2 > +(probably not a disk), so its size cannot be examined. > +.El > +.Sh SEE ALSO > +.Xr ada 4 , > +.Xr da 4 , > +.Xr ioctl 2 , > +.Xr nda 4 , > +.Xr sysexits 3 > +.Sh HISTORY > +The > +.Nm > +utility first appeared in > +.Fx 12.1 . > +.Sh AUTHORS > +The > +.Nm > +utility was written by > +.An Eugene Grosbein Aq Mt eugen@FreeBSD.org . > > Added: head/usr.sbin/trim/trim.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/trim/trim.c Thu Jan 17 18:07:59 2019 (r343118) > @@ -0,0 +1,210 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2019 Eugene Grosbein . > + * 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. > + * > + */ > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +__FBSDID("$FreeBSD$"); > + > +static off_t getsize(const char *path); > +static int opendev(const char *path, int flags); > +static int trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose); > +static void usage(const char *name); > + > +int > +main(int argc, char **argv) > +{ > + off_t offset, length; > + uint64_t usz; > + int ch, error; > + bool dryrun, verbose; > + char *fname, *name; > + > + error = 0; > + length = offset = 0; > + name = argv[0]; > + dryrun = verbose = true; > + > + while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1) > + switch (ch) { > + case 'N': > + dryrun = true; > + verbose = true; > + break; > + case 'f': > + dryrun = false; > + break; > + case 'l': > + case 'o': > + if (expand_number(optarg, &usz) == -1 || > + (off_t)usz < 0 || (usz == 0 && ch == 'l')) > + errx(EX_USAGE, > + "invalid %s of the region: %s", > + ch == 'o' ? "offset" : "length", > + optarg); > + if (ch == 'o') > + offset = (off_t)usz; > + else > + length = (off_t)usz; > + break; > + case 'q': > + verbose = false; > + break; > + case 'r': > + if ((length = getsize(optarg)) == 0) > + errx(EX_USAGE, > + "invalid zero length reference file" > + " for the region: %s", optarg); > + break; > + case 'v': > + verbose = true; > + break; > + default: > + usage(name); > + /* NOTREACHED */ > + } > + > + argv += optind; > + argc -= optind; > + > + if (argc < 1) > + usage(name); > + > + while ((fname = *argv++) != NULL) > + if (trim(fname, offset, length, dryrun, verbose) < 0) > + error++; > + > + return (error ? EXIT_FAILURE : EXIT_SUCCESS); > +} > + > +static int > +opendev(const char *path, int flags) > +{ > + int fd; > + char *tstr; > + > + if ((fd = open(path, flags)) < 0) { > + if (errno == ENOENT && path[0] != '/') { > + if (asprintf(&tstr, "%s%s", _PATH_DEV, path) < 0) > + errx(EX_OSERR, "no memory"); > + fd = open(tstr, flags); > + free(tstr); > + } > + } > + > + if (fd < 0) > + err(EX_NOINPUT, "open failed: %s", path); > + > + return (fd); > +} > + > +static off_t > +getsize(const char *path) > +{ > + struct stat sb; > + off_t mediasize; > + int fd; > + > + fd = opendev(path, O_RDONLY | O_DIRECT); > + > + if (fstat(fd, &sb) < 0) > + err(EX_IOERR, "fstat failed: %s", path); > + > + if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)) { > + close(fd); > + return (sb.st_size); > + } > + > + if (!S_ISCHR(sb.st_mode) && !S_ISBLK(sb.st_mode)) > + errx(EX_DATAERR, > + "invalid type of the file " > + "(not regular, directory nor special device): %s", > + path); > + > + if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) > + err(EX_UNAVAILABLE, > + "ioctl(DIOCGMEDIASIZE) failed, probably not a disk: " > + "%s", path); > + > + close(fd); > + return (mediasize); > +} > + > +static int > +trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose) > +{ > + off_t arg[2]; > + int error, fd; > + > + if (length == 0) > + length = getsize(path); > + > + if (verbose) > + printf("trim %s offset %ju length %ju\n", > + path, (uintmax_t)offset, (uintmax_t)length); > + > + if (dryrun) { > + printf("dry run: add -f to actually perform the operation\n"); > + return (0); > + } > + > + fd = opendev(path, O_WRONLY | O_DIRECT); > + arg[0] = offset; > + arg[1] = length; > + > + error = ioctl(fd, DIOCGDELETE, arg); > + if (error < 0) > + warn("ioctl(DIOCGDELETE) failed: %s", path); > + > + close(fd); > + return (error); > +} > + > +static void > +usage(const char *name) > +{ > + (void)fprintf(stderr, > + "usage: %s [-[lo] offset[K|k|M|m|G|g|T|t]] [-r rfile] [-Nfqv] device ...\n", > + name); > + exit(EX_USAGE); > +} > From owner-svn-src-head@freebsd.org Thu Jan 17 20:47:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D7A214A6529; Thu, 17 Jan 2019 20:47:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E8CC083861; Thu, 17 Jan 2019 20:47:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kEYzg8581MRX3kEZ1gnFpu; Thu, 17 Jan 2019 13:46:59 -0700 X-Authority-Analysis: v=2.3 cv=TL87tGta c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=-PYHFkKkSge0k5BvVXoA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 7FC692E68; Thu, 17 Jan 2019 12:47:14 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0HKkvUH011505; Thu, 17 Jan 2019 12:46:57 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0HKkvWs011502; Thu, 17 Jan 2019 12:46:57 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901172046.x0HKkvWs011502@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from Conrad Meyer of "Thu, 17 Jan 2019 12:24:33 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 Jan 2019 12:46:57 -0800 X-CMAE-Envelope: MS4wfIXGrbhTrq3wOkRWBo/+3OdBTmFdvURdlBDCHQZPZ6rrFAv5/bmWjuolfDU1jmOoalq9PJUCfdXjfRDPMj7Pfji9J/BkM6aO0XzhlJh9GMKSmZEEoUvd kC3NV2cWEU/omNKt8gmRoqtNnNYy6/Lxxg092QVLBKGurRZNo0sMToF5P9s/vXrLjMp2H0voAmnwmFlokL5Oc7+lMRwRVCICcMTzqAqh1osFD1f1otGm97g3 xJPrHkO6pgFRgJIzJivJC5/d0PhQlq5C9xrQr4j5c+pDWbkUWVzLL+TPTj1sd1Ga X-Rspamd-Queue-Id: E8CC083861 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.67 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.01)[ip: (-5.76), ipnet: 64.59.128.0/20(-2.37), asn: 6327(-1.83), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 20:47:07 -0000 In message , Conrad Meyer writes: > On Thu, Jan 17, 2019 at 12:22 PM Cy Schubert wrot > e: > > This is wrong. IIRC there was discussion that this should be in dd(1). > > Why not submit a revision to add the functionality to dd? > > Well, it's wrong, but not because we need another weird dd mode. dd > is hard enough to use already. I've never found dd confusing. What's wrong conv=erase? If it must stay, sderase is a better name. That's really what it does. Ports maybe? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Jan 17 21:15:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D952B14A729B; Thu, 17 Jan 2019 21:15:02 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6191784AD6; Thu, 17 Jan 2019 21:15:02 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0HLEk36079146 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jan 2019 22:14:51 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: Cy.Schubert@cschubert.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0HLEj7N060560 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 04:14:46 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Cy Schubert References: <201901172022.x0HKMN2Z062553@slippy.cwsent.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <8f78a51b-51a6-08fd-7e49-dd00aaa54c6c@freebsd.org> Date: Fri, 18 Jan 2019 04:14:39 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201901172022.x0HKMN2Z062553@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 6191784AD6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:15:03 -0000 18.01.2019 3:22, Cy Schubert wrote: > This is wrong. IIRC there was discussion that this should be in dd(1). > Why not submit a revision to add the functionality to dd? There is already https://reviews.freebsd.org/D18382 that had no code updates over 6 weeks and latest revision needs a fix as it is broken. Also, dd cannot be used to trim whole several devices with one invocation like "trim ada ada1 ada2". From owner-svn-src-head@freebsd.org Thu Jan 17 21:16:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB04A14A7380; Thu, 17 Jan 2019 21:16:17 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8C584C8B; Thu, 17 Jan 2019 21:16:17 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0HLGAA7079184 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jan 2019 22:16:11 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: cem@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0HLG9ll060573 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 04:16:10 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: cem@freebsd.org References: <201901171808.x0HI80jC068564@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> Date: Fri, 18 Jan 2019 04:16:03 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 3E8C584C8B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.997,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:16:17 -0000 18.01.2019 3:23, Conrad Meyer пишет: > Please back it out; stop attributing code review to "hackers@," which > can not (it's a list, not individuals) and did not review this > changeset; and put it on phabricator for actual review. There is already https://reviews.freebsd.org/D18380 by imp and there were over 6 weeks since it had an update. Newly committed code has most of its changes. From owner-svn-src-head@freebsd.org Thu Jan 17 21:26:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05EB614A7B03; Thu, 17 Jan 2019 21:26:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80610854C2; Thu, 17 Jan 2019 21:26:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id f4so9072896ion.2; Thu, 17 Jan 2019 13:26:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=70WQDS+Uf8BrJNcn0lLkDaAEnlOi5kF1R1H9Dk0X+lE=; b=k/jhAKxZdMsnzvaAk7fwItWAywexSn3Mj3/FqC1CpuVNDF8vsAZleKskN7/Sbdcx9U JA59mZBy5N/z3gJBeX109rCQmJ3lvACcgMc8zqeFEnZwVVMItgkojsnJj98JjMKvFC3Q Xq3HAXRS430xEbZwHpv9jhAu0iUXFnTZ1XN6CiCtf++N5NaJ3qSK3QunsPlRywjbTrq+ x/01lG3NRN4R7TAqIlvfDFAXq9R2TiqDX1bz51zxbLwx9QlAnmT9I6qOJvArQCP36KuO kDfr9Y2BddB2y0FVA6JPRHik6Qy1T4wnrQKbmE83oFA2MFwY3zDpNVXWnmyHhZIWiafv bWyw== X-Gm-Message-State: AJcUukcErKx2Uhjlw/6GCBoAobcfWLDv/WaJ1l28BlZlXONEdGLuLeSA L09Qs5wB7dH0GC2G0hzq3vdeNNeC X-Google-Smtp-Source: ALg8bN71zBnpHYDewBN4dYPsq/qiO/mD49W/iaOikLsJszd9akL2ZhBqOY9BTjc6mL9NeN+e2bpliA== X-Received: by 2002:a5d:9405:: with SMTP id v5mr8971003ion.250.1547756684226; Thu, 17 Jan 2019 12:24:44 -0800 (PST) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id n4sm963501iog.36.2019.01.17.12.24.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 12:24:44 -0800 (PST) Received: by mail-it1-f170.google.com with SMTP id a6so2918373itl.4; Thu, 17 Jan 2019 12:24:44 -0800 (PST) X-Received: by 2002:a24:b64a:: with SMTP id d10mr9533778itj.149.1547756683927; Thu, 17 Jan 2019 12:24:43 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> <201901172022.x0HKMN2Z062553@slippy.cwsent.com> In-Reply-To: <201901172022.x0HKMN2Z062553@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 17 Jan 2019 12:24:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 80610854C2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:26:21 -0000 On Thu, Jan 17, 2019 at 12:22 PM Cy Schubert wrote: > This is wrong. IIRC there was discussion that this should be in dd(1). > Why not submit a revision to add the functionality to dd? Well, it's wrong, but not because we need another weird dd mode. dd is hard enough to use already. From owner-svn-src-head@freebsd.org Thu Jan 17 21:38:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D351314A806A; Thu, 17 Jan 2019 21:38:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 705A185C7E; Thu, 17 Jan 2019 21:38:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DE2C2029F; Thu, 17 Jan 2019 21:38:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HLcw7e082955; Thu, 17 Jan 2019 21:38:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HLcwBp082954; Thu, 17 Jan 2019 21:38:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901172138.x0HLcwBp082954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 Jan 2019 21:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343122 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 705A185C7E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:38:59 -0000 Author: emaste Date: Thu Jan 17 21:38:57 2019 New Revision: 343122 URL: https://svnweb.freebsd.org/changeset/base/343122 Log: freebsd-update: Clarify unsupported release upgrade error message Notify users that upgrading from -CURRENT or -STABLE is unsupported by freebsd-update. Also ensure --currently-running provides a correctly formatted release (as done by -r). PR: 234771 Submitted by: Gerald Aryeetey Reported by: yuri Reviewed by: bcran MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18803 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 17 20:01:06 2019 (r343121) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 17 21:38:57 2019 (r343122) @@ -304,6 +304,14 @@ config_TargetRelease () { fi } +# Pretend current release is FreeBSD $1 +config_SourceRelease () { + UNAME_r=$1 + if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then + UNAME_r="${UNAME_r}-RELEASE" + fi +} + # Define what happens to output of utilities config_VerboseLevel () { if [ -z ${VERBOSELEVEL} ]; then @@ -442,7 +450,8 @@ parse_cmdline () { NOTTYOK=1 ;; --currently-running) - shift; export UNAME_r="$1" + shift + config_SourceRelease $1 || usage ;; # Configuration file equivalents @@ -657,6 +666,18 @@ fetchupgrade_check_params () { ARCH=`uname -m` FETCHDIR=${RELNUM}/${ARCH} PATCHDIR=${RELNUM}/${ARCH}/bp + + # Disallow upgrade from a version that is not `-RELEASE` + if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then + echo -n "`basename $0`: " + cat <<- EOF + Cannot upgrade from a version that is not a '-RELEASE' using `basename $0`. + Instead, FreeBSD can be directly upgraded by source or upgraded to a + RELEASE/RELENG version prior to running `basename $0`. + EOF + echo "System version: ${RELNUM}" + exit 1 + fi # Figure out what directory contains the running kernel BOOTFILE=`sysctl -n kern.bootfile` From owner-svn-src-head@freebsd.org Thu Jan 17 21:46:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8DD14A8718; Thu, 17 Jan 2019 21:46:40 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD6F886424; Thu, 17 Jan 2019 21:46:39 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-it1-x129.google.com with SMTP id p197so3252910itp.0; Thu, 17 Jan 2019 13:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o0o9D8q16UHlXu7NXZdRIsVH1MB5D4+h7OQpd2pjvq0=; b=L4LtqQQwdWm4Kth8KDdseyhE/qiJhYZfZrKl+fB7AGU1O5v4U7jeziKVIAiy6ptPM8 n6C9Csw02y9tnMcwKP2rLZUYG1mfYoiBPZ37JxWKIO7/nc/AEZNK+GBpHdiq4qV7VYKR zw6p529rsEjWNlNy81+RRXv+ehgYpG/NS3H/8IIa/8snoeQd4KZCF5diwhNyE9lDdX5Z 8j2zZsjotrQzPungXPN/nRxsZyQ13VCoJ9m+QgKPUPS7pa4Hjm8oca8h8aVbawc6/LIN Wv9/HIcFpnzvEjKHlZQfgpgQpyf4rw/rX+db4cG2QNTNF7ROfv1KabvEerelWqneJHi8 J9ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o0o9D8q16UHlXu7NXZdRIsVH1MB5D4+h7OQpd2pjvq0=; b=s/W4im1X0AbRr9SpxKzVmXkRSVF7innlDzlC7wCDVkCkLEjHlxifROB0UDM/mrsOLG EUrMArxTF+e+NlQ2Et7qmfvxgwI5WW42j1iopeLxAfvD2j9rnHzJK/UWDOLq/WUwMY6Y jtj3A2G2Bx7HwWL7vUYe0lu2hxxPZeKJAoqdnqs/X2rNnVauyL5wD406guUjLshDJCqJ WiibuoR80lNNi941pJVFJy46KcZ40CVFMalSyA1lokdFfvd7yzlTt705s7n5gDktuZ0U iWpyPvScX75X144RXIXlU4Hl/7YZI92WN7+owwhaPzT9qCrS7jlEUVkPWURSaeDo1Q9J 7Ozw== X-Gm-Message-State: AJcUukeIMT+AYuOG5/S1qZaaIQx8zBOJI5nlVsl1W8GPK1zBRMXZC1Rr v0LF5kGszDTOy2rYoVcfMhRTM6dZbS43dO76REidfw== X-Google-Smtp-Source: ALg8bN41QHOg2yno1gsJSC32nDeGQycKby+VLzM/SZu7mnnnSXtmN6F15NVPdIBv4CBDpy9xR8b2mTbnQIHvu77uwGY= X-Received: by 2002:a05:660c:91:: with SMTP id t17mr974504itj.41.1547761598593; Thu, 17 Jan 2019 13:46:38 -0800 (PST) MIME-Version: 1.0 References: <201901172138.x0HLcwBp082954@repo.freebsd.org> In-Reply-To: <201901172138.x0HLcwBp082954@repo.freebsd.org> From: Xin LI Date: Thu, 17 Jan 2019 13:46:27 -0800 Message-ID: Subject: Re: svn commit: r343122 - head/usr.sbin/freebsd-update To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: CD6F886424 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:46:40 -0000 On Thu, Jan 17, 2019 at 1:39 PM Ed Maste wrote: > Author: emaste > Date: Thu Jan 17 21:38:57 2019 > New Revision: 343122 > URL: https://svnweb.freebsd.org/changeset/base/343122 > > Log: > freebsd-update: Clarify unsupported release upgrade error message > > Notify users that upgrading from -CURRENT or -STABLE is unsupported by > freebsd-update. > > Also ensure --currently-running provides a correctly formatted release > (as done by -r). > > PR: 234771 > Submitted by: Gerald Aryeetey > Reported by: yuri > Reviewed by: bcran > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18803 > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 17 > 20:01:06 2019 (r343121) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 17 > 21:38:57 2019 (r343122) > @@ -304,6 +304,14 @@ config_TargetRelease () { > fi > } > > +# Pretend current release is FreeBSD $1 > +config_SourceRelease () { > + UNAME_r=$1 > + if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then > + UNAME_r="${UNAME_r}-RELEASE" > + fi > +} > + > # Define what happens to output of utilities > config_VerboseLevel () { > if [ -z ${VERBOSELEVEL} ]; then > @@ -442,7 +450,8 @@ parse_cmdline () { > NOTTYOK=1 > ;; > --currently-running) > - shift; export UNAME_r="$1" > + shift > + config_SourceRelease $1 || usage > ;; > > # Configuration file equivalents > @@ -657,6 +666,18 @@ fetchupgrade_check_params () { > ARCH=`uname -m` > FETCHDIR=${RELNUM}/${ARCH} > PATCHDIR=${RELNUM}/${ARCH}/bp > + > + # Disallow upgrade from a version that is not `-RELEASE` > + if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then > + echo -n "`basename $0`: " > + cat <<- EOF > + Cannot upgrade from a version that is not a > '-RELEASE' using `basename $0`. > + Instead, FreeBSD can be directly upgraded by > source or upgraded to a > + RELEASE/RELENG version prior to running `basename > $0`. > + EOF > + echo "System version: ${RELNUM}" > + exit 1 > + fi > I think this would break upgrading from e.g. -BETA or -RC, which is supported? Cheers, From owner-svn-src-head@freebsd.org Thu Jan 17 21:52:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC80B14A8A5D; Thu, 17 Jan 2019 21:52:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510358694B; Thu, 17 Jan 2019 21:52:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40E282065A; Thu, 17 Jan 2019 21:52:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HLqgPk093274; Thu, 17 Jan 2019 21:52:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HLqgcI093273; Thu, 17 Jan 2019 21:52:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901172152.x0HLqgcI093273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 17 Jan 2019 21:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343123 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 343123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 510358694B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 21:52:42 -0000 Author: tsoome Date: Thu Jan 17 21:52:41 2019 New Revision: 343123 URL: https://svnweb.freebsd.org/changeset/base/343123 Log: loader should ignore active multi_vdev_crash_dump feature on zpool Since the loader zfs reader does not need to read the dump zvol, we can just enable the feature. illumos issue #9051 https://www.illumos.org/issues/9051 MFC after: 2 weeks Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Thu Jan 17 21:38:57 2019 (r343122) +++ head/stand/libsa/zfs/zfsimpl.c Thu Jan 17 21:52:41 2019 (r343123) @@ -62,6 +62,7 @@ static const char *features_for_read[] = { "org.illumos:sha512", "org.illumos:skein", "org.zfsonlinux:large_dnode", + "com.joyent:multi_vdev_crash_dump", NULL }; From owner-svn-src-head@freebsd.org Thu Jan 17 22:00:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7083A14A8C74; Thu, 17 Jan 2019 22:00:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BE386C41; Thu, 17 Jan 2019 22:00:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073C620686; Thu, 17 Jan 2019 22:00:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HM02eZ093735; Thu, 17 Jan 2019 22:00:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HM02O8093734; Thu, 17 Jan 2019 22:00:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901172200.x0HM02O8093734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 17 Jan 2019 22:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343124 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 343124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16BE386C41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:00:03 -0000 Author: tsoome Date: Thu Jan 17 22:00:02 2019 New Revision: 343124 URL: https://svnweb.freebsd.org/changeset/base/343124 Log: libsa: add asprintf() asprintf() is a nice tool for string processing. MFC after: 2 weeks Modified: head/stand/libsa/printf.c head/stand/libsa/stand.h Modified: head/stand/libsa/printf.c ============================================================================== --- head/stand/libsa/printf.c Thu Jan 17 21:52:41 2019 (r343123) +++ head/stand/libsa/printf.c Thu Jan 17 22:00:02 2019 (r343124) @@ -122,6 +122,34 @@ snprint_func(int ch, void *arg) } int +asprintf(char **buf, const char *cfmt, ...) +{ + int retval; + struct print_buf arg; + va_list ap; + + *buf = NULL; + va_start(ap, cfmt); + retval = kvprintf(cfmt, NULL, NULL, 10, ap); + va_end(ap); + if (retval <= 0) + return (-1); + + arg.size = retval + 1; + arg.buf = *buf = malloc(arg.size); + if (*buf == NULL) + return (-1); + + va_start(ap, cfmt); + retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap); + va_end(ap); + + if (arg.size >= 1) + *(arg.buf)++ = 0; + return (retval); +} + +int snprintf(char *buf, size_t size, const char *cfmt, ...) { int retval; Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Thu Jan 17 21:52:41 2019 (r343123) +++ head/stand/libsa/stand.h Thu Jan 17 22:00:02 2019 (r343124) @@ -268,6 +268,7 @@ extern void *reallocf(void *ptr, size_t size); extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); +extern int asprintf(char **buf, const char *cfmt, ...) __printflike(2, 3); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); extern int vprintf(const char *fmt, __va_list); From owner-svn-src-head@freebsd.org Thu Jan 17 22:33:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 041381481D23 for ; Thu, 17 Jan 2019 22:33:07 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91F658834E for ; Thu, 17 Jan 2019 22:33:06 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ot1-f46.google.com with SMTP id 32so12623236ota.12 for ; Thu, 17 Jan 2019 14:33:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nG9CR3hjUxDG1YaytjKZIvtz/e+badylI/o7xv6jhCM=; b=qZpx4poSBvqigPUqKTEEeKiFQZQWWXwYhUzRjQtIuCDh1T4wmIqvHTLAqrcl33JaKF 5EpdB0BEjMO/o/X/www1Y4+gtP8I9dLBZF64ub9fNwm73EU4aU87ckNvM2/I0AmiY4tX 2U9kaBXkkMGlBWKeLnFemHS/lkhSMXC25oN2+RrRRfeoEb1rWfzIE6+7Uj3za24rh8Bl 29tLqq2f0BkHSFWiY5huLY+/bMKRbPd3OJPfOWkWv2fgVfaYM6uVKoSKn86fxwXILuFQ VmXPw6goWyWxazeravOEyC1eboB5t1wM16CrLEGPEPgATmMIycZ3h2fhdBTfH2Hx0aXd Ypbw== X-Gm-Message-State: AJcUukfysu1fxJOTCrdVdqdKlTQ+ftVYjo84hIXNHVLf/tSpYCufFYPE xwJOUQxdCb4J3b4kOE8CfoiJapHldfuB4zC9xNhFGw== X-Google-Smtp-Source: ALg8bN4PUKalXUJcV+dGUgyJvfNShsPm3nePw+1PKU1AqvLrspbggIY6nshy26Ag/ETXhmG7Qte91lWwYeYaOsHzIKo= X-Received: by 2002:a9d:8c6:: with SMTP id 64mr10277608otf.168.1547763919710; Thu, 17 Jan 2019 14:25:19 -0800 (PST) MIME-Version: 1.0 References: <201901172046.x0HKkvWs011502@slippy.cwsent.com> In-Reply-To: <201901172046.x0HKkvWs011502@slippy.cwsent.com> From: Maxim Sobolev Date: Thu, 17 Jan 2019 14:25:07 -0800 Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Cy Schubert Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 91F658834E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:33:07 -0000 What I think we really need is some way to easily porti-ze useful stuff that would otherwise go into /usr/[s]bin, so adding things would be just as easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I know, this is topic almost as old as the FreeBSD Project itself, but perhaps we just did not approach it the right way. It was always the idea that we would just move bunch of stuff from src/usr.[s]bin repo into ports/. Which brings several important question such as "who is to host the distfile"? "where sources hosted", "who is to update the port when changes happen?" etc. Perhaps even by forking the whole ports idea into a smaller closely-guarged subset. Something like a new baseports repository, which might have structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy etc. Then add some automagic glue to kick in on every commit and transfer this into valid ports, which is going to be packaged by the poudriere and such. This way we could reduce amount of port-foo average src committer needs in order to maintain code. I am almost tempted to sit and write something over the next weekend or few of thereofs. Using usr.sbin/trim as an example. -Max On Thu, Jan 17, 2019 at 12:47 PM Cy Schubert wrote: > In message il.com> > , Conrad Meyer writes: > > On Thu, Jan 17, 2019 at 12:22 PM Cy Schubert > wrot > > e: > > > This is wrong. IIRC there was discussion that this should be in dd(1). > > > Why not submit a revision to add the functionality to dd? > > > > Well, it's wrong, but not because we need another weird dd mode. dd > > is hard enough to use already. > > I've never found dd confusing. What's wrong conv=erase? > > If it must stay, sderase is a better name. That's really what it does. > > Ports maybe? > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > > From owner-svn-src-head@freebsd.org Thu Jan 17 22:41:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AFF0148225C; Thu, 17 Jan 2019 22:41:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1F1B889E1; Thu, 17 Jan 2019 22:41:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f54.google.com with SMTP id g8so9215327iok.4; Thu, 17 Jan 2019 14:41:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fvADXouP4pgcCvLdrgD1eS3rq+3uIXnz+zjvchfFV5M=; b=aidGT6zBWlSVdNoafIvVauVKqlwBzDZrig8LlIkKSk6JFHUaQ8oPwHDJtyftz7u8xF lMYXGWmZoJ4nqOtHFfNpRx1lyobAAQtdAMBnTOQ+Jaevu2sx54ihhuVPbTBcALyn3jhV pyarMxK8/NjqlChZLoTBXgH8OOjonmk7GxCdWaK/yrgCABXUmEnWJmoQVHZwdF2A0lSM DztZ+rUgq4jH4VFUkRMJPN/40nbY43qhMZ8ouWwCL7rXo5Z7tVy9Vwlj8+c3S871inKW Qf7VGj4L0W+yTQ+DuP/XNdIjWisrJbJHgDc5LKVzpLqg42TeShvxKSgeTGQ7UBcAKcD+ F8rA== X-Gm-Message-State: AJcUukcQR7nwgtMC3uo8Y4GV/OwvB3DNU46c8XJyhMXE6S8q9VPDCbwL UtrBDMotGSQVRoA08VZOBlB0iiz2MXfp8vuM3JM= X-Google-Smtp-Source: ALg8bN65UtD6cvgnSdCmmBFiO+WDLWu4wI36EWDCnBN3Mh6zCkmx59wXO922BhV88mFvQ1001QegDQo36uxA93iPNLw= X-Received: by 2002:a6b:fe13:: with SMTP id x19mr7667594ioh.294.1547764384384; Thu, 17 Jan 2019 14:33:04 -0800 (PST) MIME-Version: 1.0 References: <201901172138.x0HLcwBp082954@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 17 Jan 2019 17:32:52 -0500 Message-ID: Subject: Re: svn commit: r343122 - head/usr.sbin/freebsd-update To: Xin LI Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D1F1B889E1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:41:08 -0000 On Thu, 17 Jan 2019 at 16:46, Xin LI wrote: > > On Thu, Jan 17, 2019 at 1:39 PM Ed Maste wrote: >> >> Author: emaste >> Date: Thu Jan 17 21:38:57 2019 >> New Revision: 343122 >> URL: https://svnweb.freebsd.org/changeset/base/343122 >> >> Log: >> freebsd-update: Clarify unsupported release upgrade error message > > I think this would break upgrading from e.g. -BETA or -RC, which is supported? Indeed, followup coming shortly. From owner-svn-src-head@freebsd.org Thu Jan 17 22:41:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F7CC148225D; Thu, 17 Jan 2019 22:41:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75126889DC; Thu, 17 Jan 2019 22:41:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f194.google.com with SMTP id m8so2149066itk.0; Thu, 17 Jan 2019 14:41:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=MMDgv0itVnEGq7M1krxYnqYLTYTsE1087q5pQbjjYnw=; b=YJ62j3iHD9V1815eiUWHZsXdNuha6DX6u/eXk4TvJw3WyIewcO4o7BqVrE3P+3DiLJ RF9we2evlXBiAHKn7MP+Fd1aUD3sSq98nyi4VCRH83g6VcSrwq7uxihQlvnnWq6CgqWt 537W2eRZA7yqp8WRfUUXfiwK8pLuZ5DE0Niov6jBCJJnzk7BlUK9/eiZBhmSFfszhd3P MlzdZe1430edsBn3CRcC3fLZT3nsYFuXzMvgZUdV1zWbnYXEAYqBS9f3NoBdD6BEQIUH oR1IHJrQbjB4ZGVT3IIMLp37FS4pj7x4G/C4q/pFy6ubUaBONVikDyz0hJzEsz0N6+fn 9lTA== X-Gm-Message-State: AJcUukdy+wwy2FrNWjh8PumDlTJ+X3X/YbXP1mEcM/EUWVZhTcC2wVlm 3VM2/NIoIxMiv8M2SYxkTRw8fsy6 X-Google-Smtp-Source: ALg8bN6jzUeC6vinmnPhWN2uhW150eQge3JqQkXsm1Vo09dQ7hcUJ+A5+nQx2+9yN1pTWPCCtF0R9A== X-Received: by 2002:a24:22c6:: with SMTP id o189mr8632098ito.86.1547764424995; Thu, 17 Jan 2019 14:33:44 -0800 (PST) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com. [209.85.166.46]) by smtp.gmail.com with ESMTPSA id o16sm1343476ito.19.2019.01.17.14.33.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 14:33:44 -0800 (PST) Received: by mail-io1-f46.google.com with SMTP id m19so9193126ioh.3; Thu, 17 Jan 2019 14:33:44 -0800 (PST) X-Received: by 2002:a6b:6111:: with SMTP id v17mr9489803iob.107.1547764424349; Thu, 17 Jan 2019 14:33:44 -0800 (PST) MIME-Version: 1.0 References: <201901150102.x0F12Hlt025856@repo.freebsd.org> In-Reply-To: <201901150102.x0F12Hlt025856@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 17 Jan 2019 14:33:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343030 - in head/sys: cam conf dev/md dev/nvme fs/fuse fs/nfsclient fs/smbfs kern sys ufs/ffs vm To: Gleb Smirnoff Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 75126889DC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.194 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.03 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.89)[-0.889,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.13)[ipnet: 209.85.128.0/17(-3.74), asn: 15169(-1.82), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[194.166.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.166.85.209.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:41:08 -0000 On WITNESS builds after this change and all followup fixes I can see (@ r343108), I get a new warning: Sleeping on "pageprocwait" with the following non-sleepable locks held: exclusive sleep mutex pbuf (UMA zone) r = 0 (0xfffff80003033e00) locked @ .../sys/vm/uma_core.c:1139 stack backtrace: #0 0xffffffff80c0a164 at witness_debugger.part.14+0xa4 #1 0xffffffff80c0d465 at witness_warn+0x285 #2 0xffffffff80baa3b9 at _sleep+0x59 #3 0xffffffff80f03c73 at vm_wait_doms+0x103 #4 0xffffffff80eeb8e5 at vm_domainset_iter_policy+0x55 #5 0xffffffff80eeab59 at uma_prealloc+0xc9 #6 0xffffffff80f0d643 at pbuf_zsecond_create+0x63 #7 0xffffffff80ee2c9f at swap_pager_swap_init+0x5f #8 0xffffffff80f0cf57 at vm_pageout+0x27 For what it's worth, this is a bhyve guest with vm.ndomains 1. (The bhyve host has 2 domains, but I don't see how that would be relevant.) Best, Conrad On Mon, Jan 14, 2019 at 5:02 PM Gleb Smirnoff wrote: > > Author: glebius > Date: Tue Jan 15 01:02:16 2019 > New Revision: 343030 > URL: https://svnweb.freebsd.org/changeset/base/343030 > > Log: > Allocate pager bufs from UMA instead of 80-ish mutex protected linked list. > > o In vm_pager_bufferinit() create pbuf_zone and start accounting on how many > pbufs are we going to have set. > In various subsystems that are going to utilize pbufs create private zones > via call to pbuf_zsecond_create(). The latter calls uma_zsecond_create(), > and sets a limit on created zone. After startup preallocate pbufs according > to requirements of all pbuf zones. > > Subsystems that used to have a private limit with old allocator now have > private pbuf zones: md(4), fusefs, NFS client, smbfs, VFS cluster, FFS, > swap, vnode pager. > > The following subsystems use shared pbuf zone: cam(4), nvme(4), physio(9), > aio(4). They should have their private limits, but changing that is out of > scope of this commit. > > o Fetch tunable value of kern.nswbuf from init_param2() and while here move > NSWBUF_MIN to opt_param.h and eliminate opt_swap.h, that was holding only > this option. > Default values aren't touched by this commit, but they probably should be > reviewed wrt to modern hardware. > > This change removes a tight bottleneck from sendfile(2) operation, that > uses pbufs in vnode pager. Other pagers also would benefit from faster > allocation. > > Together with: gallatin > Tested by: pho > > Modified: > head/sys/cam/cam_periph.c > head/sys/conf/options > head/sys/dev/md/md.c > head/sys/dev/nvme/nvme_ctrlr.c > head/sys/fs/fuse/fuse_main.c > head/sys/fs/fuse/fuse_vnops.c > head/sys/fs/nfsclient/nfs_clbio.c > head/sys/fs/nfsclient/nfs_clport.c > head/sys/fs/smbfs/smbfs_io.c > head/sys/fs/smbfs/smbfs_vfsops.c > head/sys/kern/kern_physio.c > head/sys/kern/subr_param.c > head/sys/kern/vfs_aio.c > head/sys/kern/vfs_bio.c > head/sys/kern/vfs_cluster.c > head/sys/sys/buf.h > head/sys/ufs/ffs/ffs_rawread.c > head/sys/vm/swap_pager.c > head/sys/vm/vm_pager.c > head/sys/vm/vnode_pager.c > > Modified: head/sys/cam/cam_periph.c > ============================================================================== > --- head/sys/cam/cam_periph.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/cam/cam_periph.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -936,7 +936,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma > /* > * Get the buffer. > */ > - mapinfo->bp[i] = getpbuf(NULL); > + mapinfo->bp[i] = uma_zalloc(pbuf_zone, M_WAITOK); > > /* put our pointer in the data slot */ > mapinfo->bp[i]->b_data = *data_ptrs[i]; > @@ -962,9 +962,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma > for (j = 0; j < i; ++j) { > *data_ptrs[j] = mapinfo->bp[j]->b_caller1; > vunmapbuf(mapinfo->bp[j]); > - relpbuf(mapinfo->bp[j], NULL); > + uma_zfree(pbuf_zone, mapinfo->bp[j]); > } > - relpbuf(mapinfo->bp[i], NULL); > + uma_zfree(pbuf_zone, mapinfo->bp[i]); > PRELE(curproc); > return(EACCES); > } > @@ -1052,7 +1052,7 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ > vunmapbuf(mapinfo->bp[i]); > > /* release the buffer */ > - relpbuf(mapinfo->bp[i], NULL); > + uma_zfree(pbuf_zone, mapinfo->bp[i]); > } > > /* allow ourselves to be swapped once again */ > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/conf/options Tue Jan 15 01:02:16 2019 (r343030) > @@ -187,7 +187,7 @@ NO_ADAPTIVE_SX > NO_EVENTTIMERS opt_timer.h > NO_OBSOLETE_CODE opt_global.h > NO_SYSCTL_DESCR opt_global.h > -NSWBUF_MIN opt_swap.h > +NSWBUF_MIN opt_param.h > MBUF_PACKET_ZONE_DISABLE opt_global.h > PANIC_REBOOT_WAIT_TIME opt_panic.h > PCI_HP opt_pci.h > > Modified: head/sys/dev/md/md.c > ============================================================================== > --- head/sys/dev/md/md.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/dev/md/md.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -231,7 +231,7 @@ static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INI > #define NMASK (NINDIR-1) > static int nshift; > > -static int md_vnode_pbuf_freecnt; > +static uma_zone_t md_pbuf_zone; > > struct indir { > uintptr_t *array; > @@ -962,7 +962,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) > auio.uio_iovcnt = piov - auio.uio_iov; > piov = auio.uio_iov; > } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { > - pb = getpbuf(&md_vnode_pbuf_freecnt); > + pb = uma_zalloc(md_pbuf_zone, M_WAITOK); > bp->bio_resid = len; > unmapped_step: > npages = atop(min(MAXPHYS, round_page(len + (ma_offs & > @@ -1013,7 +1013,7 @@ unmapped_step: > if (len > 0) > goto unmapped_step; > } > - relpbuf(pb, &md_vnode_pbuf_freecnt); > + uma_zfree(md_pbuf_zone, pb); > } > > free(piov, M_MD); > @@ -2118,7 +2118,7 @@ g_md_init(struct g_class *mp __unused) > sx_xunlock(&md_sx); > } > } > - md_vnode_pbuf_freecnt = nswbuf / 10; > + md_pbuf_zone = pbuf_zsecond_create("mdpbuf", nswbuf / 10); > status_dev = make_dev(&mdctl_cdevsw, INT_MAX, UID_ROOT, GID_WHEEL, > 0600, MDCTL_NAME); > g_topology_lock(); > @@ -2214,5 +2214,6 @@ g_md_fini(struct g_class *mp __unused) > sx_destroy(&md_sx); > if (status_dev != NULL) > destroy_dev(status_dev); > + uma_zdestroy(md_pbuf_zone); > delete_unrhdr(md_uh); > } > > Modified: head/sys/dev/nvme/nvme_ctrlr.c > ============================================================================== > --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -1052,7 +1052,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr > * this passthrough command. > */ > PHOLD(curproc); > - buf = getpbuf(NULL); > + buf = uma_zalloc(pbuf_zone, M_WAITOK); > buf->b_data = pt->buf; > buf->b_bufsize = pt->len; > buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; > @@ -1101,7 +1101,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr > > err: > if (buf != NULL) { > - relpbuf(buf, NULL); > + uma_zfree(pbuf_zone, buf); > PRELE(curproc); > } > > > Modified: head/sys/fs/fuse/fuse_main.c > ============================================================================== > --- head/sys/fs/fuse/fuse_main.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/fuse/fuse_main.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -84,7 +84,7 @@ struct mtx fuse_mtx; > extern struct vfsops fuse_vfsops; > extern struct cdevsw fuse_cdevsw; > extern struct vop_vector fuse_vnops; > -extern int fuse_pbuf_freecnt; > +extern uma_zone_t fuse_pbuf_zone; > > static struct vfsconf fuse_vfsconf = { > .vfc_version = VFS_VERSION, > @@ -122,7 +122,6 @@ fuse_loader(struct module *m, int what, void *arg) > > switch (what) { > case MOD_LOAD: /* kldload */ > - fuse_pbuf_freecnt = nswbuf / 2 + 1; > mtx_init(&fuse_mtx, "fuse_mtx", NULL, MTX_DEF); > err = fuse_device_init(); > if (err) { > @@ -130,6 +129,7 @@ fuse_loader(struct module *m, int what, void *arg) > return (err); > } > fuse_ipc_init(); > + fuse_pbuf_zone = pbuf_zsecond_create("fusepbuf", nswbuf / 2); > > /* vfs_modevent ignores its first arg */ > if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) > @@ -144,6 +144,7 @@ fuse_loader(struct module *m, int what, void *arg) > if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) > return (err); > fuse_bringdown(eh_tag); > + uma_zdestroy(fuse_pbuf_zone); > break; > default: > return (EINVAL); > > Modified: head/sys/fs/fuse/fuse_vnops.c > ============================================================================== > --- head/sys/fs/fuse/fuse_vnops.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/fuse/fuse_vnops.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -201,7 +201,7 @@ static int fuse_reclaim_revoked = 0; > SYSCTL_INT(_vfs_fuse, OID_AUTO, reclaim_revoked, CTLFLAG_RW, > &fuse_reclaim_revoked, 0, ""); > > -int fuse_pbuf_freecnt = -1; > +uma_zone_t fuse_pbuf_zone; > > #define fuse_vm_page_lock(m) vm_page_lock((m)); > #define fuse_vm_page_unlock(m) vm_page_unlock((m)); > @@ -1824,7 +1824,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap) > * We use only the kva address for the buffer, but this is extremely > * convenient and fast. > */ > - bp = getpbuf(&fuse_pbuf_freecnt); > + bp = uma_zalloc(fuse_pbuf_zone, M_WAITOK); > > kva = (vm_offset_t)bp->b_data; > pmap_qenter(kva, pages, npages); > @@ -1845,7 +1845,7 @@ fuse_vnop_getpages(struct vop_getpages_args *ap) > error = fuse_io_dispatch(vp, &uio, IO_DIRECT, cred); > pmap_qremove(kva, npages); > > - relpbuf(bp, &fuse_pbuf_freecnt); > + uma_zfree(fuse_pbuf_zone, bp); > > if (error && (uio.uio_resid == count)) { > FS_DEBUG("error %d\n", error); > @@ -1958,7 +1958,7 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) > * We use only the kva address for the buffer, but this is extremely > * convenient and fast. > */ > - bp = getpbuf(&fuse_pbuf_freecnt); > + bp = uma_zalloc(fuse_pbuf_zone, M_WAITOK); > > kva = (vm_offset_t)bp->b_data; > pmap_qenter(kva, pages, npages); > @@ -1978,7 +1978,7 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) > error = fuse_io_dispatch(vp, &uio, IO_DIRECT, cred); > > pmap_qremove(kva, npages); > - relpbuf(bp, &fuse_pbuf_freecnt); > + uma_zfree(fuse_pbuf_zone, bp); > > if (!error) { > int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE; > > Modified: head/sys/fs/nfsclient/nfs_clbio.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clbio.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/nfsclient/nfs_clbio.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -70,7 +70,7 @@ extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMO > extern int newnfs_directio_enable; > extern int nfs_keep_dirty_on_error; > > -int ncl_pbuf_freecnt = -1; /* start out unlimited */ > +uma_zone_t ncl_pbuf_zone; > > static struct buf *nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, > struct thread *td); > @@ -182,7 +182,7 @@ ncl_getpages(struct vop_getpages_args *ap) > * We use only the kva address for the buffer, but this is extremely > * convenient and fast. > */ > - bp = getpbuf(&ncl_pbuf_freecnt); > + bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); > > kva = (vm_offset_t) bp->b_data; > pmap_qenter(kva, pages, npages); > @@ -203,7 +203,7 @@ ncl_getpages(struct vop_getpages_args *ap) > error = ncl_readrpc(vp, &uio, cred); > pmap_qremove(kva, npages); > > - relpbuf(bp, &ncl_pbuf_freecnt); > + uma_zfree(ncl_pbuf_zone, bp); > > if (error && (uio.uio_resid == count)) { > printf("ncl_getpages: error %d\n", error); > @@ -793,7 +793,7 @@ do_sync: > while (uiop->uio_resid > 0) { > size = MIN(uiop->uio_resid, wsize); > size = MIN(uiop->uio_iov->iov_len, size); > - bp = getpbuf(&ncl_pbuf_freecnt); > + bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); > t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); > t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); > t_iov->iov_base = malloc(size, M_NFSDIRECTIO, M_WAITOK); > @@ -836,7 +836,7 @@ err_free: > free(t_iov, M_NFSDIRECTIO); > free(t_uio, M_NFSDIRECTIO); > bp->b_vp = NULL; > - relpbuf(bp, &ncl_pbuf_freecnt); > + uma_zfree(ncl_pbuf_zone, bp); > if (error == EINTR) > return (error); > goto do_sync; > @@ -1571,7 +1571,7 @@ ncl_doio_directwrite(struct buf *bp) > mtx_unlock(&np->n_mtx); > } > bp->b_vp = NULL; > - relpbuf(bp, &ncl_pbuf_freecnt); > + uma_zfree(ncl_pbuf_zone, bp); > } > > /* > > Modified: head/sys/fs/nfsclient/nfs_clport.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clport.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/nfsclient/nfs_clport.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -79,7 +79,7 @@ extern struct vop_vector newnfs_vnodeops; > extern struct vop_vector newnfs_fifoops; > extern uma_zone_t newnfsnode_zone; > extern struct buf_ops buf_ops_newnfs; > -extern int ncl_pbuf_freecnt; > +extern uma_zone_t ncl_pbuf_zone; > extern short nfsv4_cbport; > extern int nfscl_enablecallb; > extern int nfs_numnfscbd; > @@ -1023,7 +1023,7 @@ nfscl_init(void) > return; > inited = 1; > nfscl_inited = 1; > - ncl_pbuf_freecnt = nswbuf / 2 + 1; > + ncl_pbuf_zone = pbuf_zsecond_create("nfspbuf", nswbuf / 2); > } > > /* > @@ -1357,6 +1357,7 @@ nfscl_modevent(module_t mod, int type, void *data) > #if 0 > ncl_call_invalcaches = NULL; > nfsd_call_nfscl = NULL; > + uma_zdestroy(ncl_pbuf_zone); > /* and get rid of the mutexes */ > mtx_destroy(&ncl_iod_mutex); > loaded = 0; > > Modified: head/sys/fs/smbfs/smbfs_io.c > ============================================================================== > --- head/sys/fs/smbfs/smbfs_io.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/smbfs/smbfs_io.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -63,7 +63,7 @@ > > /*#define SMBFS_RWGENERIC*/ > > -extern int smbfs_pbuf_freecnt; > +extern uma_zone_t smbfs_pbuf_zone; > > static int smbfs_fastlookup = 1; > > @@ -468,7 +468,7 @@ smbfs_getpages(ap) > scred = smbfs_malloc_scred(); > smb_makescred(scred, td, cred); > > - bp = getpbuf(&smbfs_pbuf_freecnt); > + bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); > > kva = (vm_offset_t) bp->b_data; > pmap_qenter(kva, pages, npages); > @@ -490,7 +490,7 @@ smbfs_getpages(ap) > smbfs_free_scred(scred); > pmap_qremove(kva, npages); > > - relpbuf(bp, &smbfs_pbuf_freecnt); > + uma_zfree(smbfs_pbuf_zone, bp); > > if (error && (uio.uio_resid == count)) { > printf("smbfs_getpages: error %d\n",error); > @@ -593,7 +593,7 @@ smbfs_putpages(ap) > rtvals[i] = VM_PAGER_ERROR; > } > > - bp = getpbuf(&smbfs_pbuf_freecnt); > + bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); > > kva = (vm_offset_t) bp->b_data; > pmap_qenter(kva, pages, npages); > @@ -621,7 +621,7 @@ smbfs_putpages(ap) > > pmap_qremove(kva, npages); > > - relpbuf(bp, &smbfs_pbuf_freecnt); > + uma_zfree(smbfs_pbuf_zone, bp); > > if (error == 0) { > vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, > > Modified: head/sys/fs/smbfs/smbfs_vfsops.c > ============================================================================== > --- head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -88,7 +88,7 @@ MODULE_DEPEND(smbfs, netsmb, NSMB_VERSION, NSMB_VERSIO > MODULE_DEPEND(smbfs, libiconv, 1, 1, 2); > MODULE_DEPEND(smbfs, libmchain, 1, 1, 1); > > -int smbfs_pbuf_freecnt = -1; /* start out unlimited */ > +uma_zone_t smbfs_pbuf_zone; > > static int > smbfs_cmount(struct mntarg *ma, void * data, uint64_t flags) > @@ -367,7 +367,8 @@ smbfs_quotactl(mp, cmd, uid, arg) > int > smbfs_init(struct vfsconf *vfsp) > { > - smbfs_pbuf_freecnt = nswbuf / 2 + 1; > + > + smbfs_pbuf_zone = pbuf_zsecond_create("smbpbuf", nswbuf / 2); > SMBVDEBUG("done.\n"); > return 0; > } > @@ -377,6 +378,7 @@ int > smbfs_uninit(struct vfsconf *vfsp) > { > > + uma_zdestroy(smbfs_pbuf_zone); > SMBVDEBUG("done.\n"); > return 0; > } > > Modified: head/sys/kern/kern_physio.c > ============================================================================== > --- head/sys/kern/kern_physio.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/kern/kern_physio.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -104,7 +104,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) > maxpages = btoc(MIN(uio->uio_resid, MAXPHYS)) + 1; > pages = malloc(sizeof(*pages) * maxpages, M_DEVBUF, M_WAITOK); > } else { > - pbuf = getpbuf(NULL); > + pbuf = uma_zalloc(pbuf_zone, M_WAITOK); > sa = pbuf->b_data; > maxpages = btoc(MAXPHYS); > pages = pbuf->b_pages; > @@ -220,7 +220,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) > } > doerror: > if (pbuf) > - relpbuf(pbuf, NULL); > + uma_zfree(pbuf_zone, pbuf); > else if (pages) > free(pages, M_DEVBUF); > g_destroy_bio(bp); > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/kern/subr_param.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > @@ -285,6 +286,15 @@ init_param2(long physpages) > nbuf = NBUF; > TUNABLE_INT_FETCH("kern.nbuf", &nbuf); > TUNABLE_INT_FETCH("kern.bio_transient_maxcnt", &bio_transient_maxcnt); > + > + /* > + * Physical buffers are pre-allocated buffers (struct buf) that > + * are used as temporary holders for I/O, such as paging I/O. > + */ > + nswbuf = min(nbuf / 4, 256); > + TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); > + if (nswbuf < NSWBUF_MIN) > + nswbuf = NSWBUF_MIN; > > /* > * The default for maxpipekva is min(1/64 of the kernel address space, > > Modified: head/sys/kern/vfs_aio.c > ============================================================================== > --- head/sys/kern/vfs_aio.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/kern/vfs_aio.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -1267,7 +1267,7 @@ aio_qbio(struct proc *p, struct kaiocb *job) > goto unref; > } > > - job->pbuf = pbuf = (struct buf *)getpbuf(NULL); > + job->pbuf = pbuf = uma_zalloc(pbuf_zone, M_WAITOK); > BUF_KERNPROC(pbuf); > AIO_LOCK(ki); > ki->kaio_buffer_count++; > @@ -1318,7 +1318,7 @@ doerror: > AIO_LOCK(ki); > ki->kaio_buffer_count--; > AIO_UNLOCK(ki); > - relpbuf(pbuf, NULL); > + uma_zfree(pbuf_zone, pbuf); > job->pbuf = NULL; > } > g_destroy_bio(bp); > @@ -2344,7 +2344,7 @@ aio_biowakeup(struct bio *bp) > ki = userp->p_aioinfo; > if (job->pbuf) { > pmap_qremove((vm_offset_t)job->pbuf->b_data, job->npages); > - relpbuf(job->pbuf, NULL); > + uma_zfree(pbuf_zone, job->pbuf); > job->pbuf = NULL; > atomic_subtract_int(&num_buf_aio, 1); > AIO_LOCK(ki); > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/kern/vfs_bio.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include "opt_swap.h" > > static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer"); > > @@ -1017,10 +1016,6 @@ bd_speedup(void) > mtx_unlock(&bdlock); > } > > -#ifndef NSWBUF_MIN > -#define NSWBUF_MIN 16 > -#endif > - > #ifdef __i386__ > #define TRANSIENT_DENOM 5 > #else > @@ -1130,19 +1125,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) > } > > /* > - * swbufs are used as temporary holders for I/O, such as paging I/O. > - * We have no less then 16 and no more then 256. > - */ > - nswbuf = min(nbuf / 4, 256); > - TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); > - if (nswbuf < NSWBUF_MIN) > - nswbuf = NSWBUF_MIN; > - > - /* > * Reserve space for the buffer cache buffers > */ > - swbuf = (void *)v; > - v = (caddr_t)(swbuf + nswbuf); > buf = (void *)v; > v = (caddr_t)(buf + nbuf); > > > Modified: head/sys/kern/vfs_cluster.c > ============================================================================== > --- head/sys/kern/vfs_cluster.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/kern/vfs_cluster.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -63,7 +63,9 @@ SYSCTL_INT(_debug, OID_AUTO, rcluster, CTLFLAG_RW, &rc > #endif > > static MALLOC_DEFINE(M_SEGMENT, "cl_savebuf", "cluster_save buffer"); > +static uma_zone_t cluster_pbuf_zone; > > +static void cluster_init(void *); > static struct cluster_save *cluster_collectbufs(struct vnode *vp, > struct buf *last_bp, int gbflags); > static struct buf *cluster_rbuild(struct vnode *vp, u_quad_t filesize, > @@ -83,6 +85,15 @@ static int read_min = 1; > SYSCTL_INT(_vfs, OID_AUTO, read_min, CTLFLAG_RW, &read_min, 0, > "Cluster read min block count"); > > +SYSINIT(cluster, SI_SUB_CPU, SI_ORDER_ANY, cluster_init, NULL); > + > +static void > +cluster_init(void *dummy) > +{ > + > + cluster_pbuf_zone = pbuf_zsecond_create("clpbuf", nswbuf / 2); > +} > + > /* > * Read data to a buf, including read-ahead if we find this to be beneficial. > * cluster_read replaces bread. > @@ -372,7 +383,7 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, da > ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) > return tbp; > > - bp = trypbuf(&cluster_pbuf_freecnt); > + bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT); > if (bp == NULL) > return tbp; > > @@ -603,7 +614,7 @@ cluster_callback(struct buf *bp) > bufdone(tbp); > } > pbrelvp(bp); > - relpbuf(bp, &cluster_pbuf_freecnt); > + uma_zfree(cluster_pbuf_zone, bp); > } > > /* > @@ -856,9 +867,8 @@ cluster_wbuild(struct vnode *vp, long size, daddr_t st > (tbp->b_bcount != tbp->b_bufsize) || > (tbp->b_bcount != size) || > (len == 1) || > - ((bp = (vp->v_vflag & VV_MD) != 0 ? > - trypbuf(&cluster_pbuf_freecnt) : > - getpbuf(&cluster_pbuf_freecnt)) == NULL)) { > + ((bp = uma_zalloc(cluster_pbuf_zone, > + (vp->v_vflag & VV_MD) != 0 ? M_NOWAIT : M_WAITOK)) == NULL)) { > totalwritten += tbp->b_bufsize; > bawrite(tbp); > ++start_lbn; > > Modified: head/sys/sys/buf.h > ============================================================================== > --- head/sys/sys/buf.h Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/sys/buf.h Tue Jan 15 01:02:16 2019 (r343030) > @@ -44,6 +44,7 @@ > #include > #include > #include > +#include > > struct bio; > struct buf; > @@ -275,6 +276,11 @@ struct buf { > #define PRINT_BUF_VFLAGS "\20\4bkgrderr\3bkgrdwait\2bkgrdinprog\1scanned" > > #ifdef _KERNEL > + > +#ifndef NSWBUF_MIN > +#define NSWBUF_MIN 16 > +#endif > + > /* > * Buffer locking > */ > @@ -287,7 +293,7 @@ extern const char *buf_wmesg; /* Default buffer lock > * Initialize a lock. > */ > #define BUF_LOCKINIT(bp) \ > - lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, 0) > + lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, LK_NEW) > /* > * > * Get a lock sleeping non-interruptably until it becomes available. > @@ -493,10 +499,6 @@ extern int bdwriteskip; > extern int dirtybufferflushes; > extern int altbufferflushes; > extern int nswbuf; /* Number of swap I/O buffer headers. */ > -extern int cluster_pbuf_freecnt; /* Number of pbufs for clusters */ > -extern int vnode_pbuf_freecnt; /* Number of pbufs for vnode pager */ > -extern int vnode_async_pbuf_freecnt; /* Number of pbufs for vnode pager, > - asynchronous reads */ > extern caddr_t unmapped_buf; /* Data address for unmapped buffers. */ > > static inline int > @@ -537,7 +539,6 @@ void brelse(struct buf *); > void bqrelse(struct buf *); > int vfs_bio_awrite(struct buf *); > void vfs_drain_busy_pages(struct buf *bp); > -struct buf * getpbuf(int *); > struct buf *incore(struct bufobj *, daddr_t); > struct buf *gbincore(struct bufobj *, daddr_t); > struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); > @@ -549,6 +550,9 @@ int bufwrite(struct buf *); > void bufdone(struct buf *); > void bd_speedup(void); > > +extern uma_zone_t pbuf_zone; > +uma_zone_t pbuf_zsecond_create(char *name, int max); > + > int cluster_read(struct vnode *, u_quad_t, daddr_t, long, > struct ucred *, long, int, int, struct buf **); > int cluster_wbuild(struct vnode *, long, daddr_t, int, int); > @@ -562,7 +566,6 @@ void vfs_busy_pages(struct buf *, int clear_modify); > void vfs_unbusy_pages(struct buf *); > int vmapbuf(struct buf *, int); > void vunmapbuf(struct buf *); > -void relpbuf(struct buf *, int *); > void brelvp(struct buf *); > void bgetvp(struct vnode *, struct buf *); > void pbgetbo(struct bufobj *bo, struct buf *bp); > @@ -571,7 +574,6 @@ void pbrelbo(struct buf *); > void pbrelvp(struct buf *); > int allocbuf(struct buf *bp, int size); > void reassignbuf(struct buf *); > -struct buf *trypbuf(int *); > void bwait(struct buf *, u_char, const char *); > void bdone(struct buf *); > > > Modified: head/sys/ufs/ffs/ffs_rawread.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_rawread.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/ufs/ffs/ffs_rawread.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -74,9 +74,7 @@ int ffs_rawread(struct vnode *vp, struct uio *uio, int > > SYSCTL_DECL(_vfs_ffs); > > -static int ffsrawbufcnt = 4; > -SYSCTL_INT(_vfs_ffs, OID_AUTO, ffsrawbufcnt, CTLFLAG_RD, &ffsrawbufcnt, 0, > - "Buffers available for raw reads"); > +static uma_zone_t ffsraw_pbuf_zone; > > static int allowrawread = 1; > SYSCTL_INT(_vfs_ffs, OID_AUTO, allowrawread, CTLFLAG_RW, &allowrawread, 0, > @@ -90,7 +88,8 @@ static void > ffs_rawread_setup(void *arg __unused) > { > > - ffsrawbufcnt = (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8; > + ffsraw_pbuf_zone = pbuf_zsecond_create("ffsrawpbuf", > + (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8); > } > SYSINIT(ffs_raw, SI_SUB_VM_CONF, SI_ORDER_ANY, ffs_rawread_setup, NULL); > > @@ -296,8 +295,7 @@ ffs_rawread_main(struct vnode *vp, > while (resid > 0) { > > if (bp == NULL) { /* Setup first read */ > - /* XXX: Leave some bufs for swap */ > - bp = getpbuf(&ffsrawbufcnt); > + bp = uma_zalloc(ffsraw_pbuf_zone, M_WAITOK); > pbgetvp(vp, bp); > error = ffs_rawread_readahead(vp, udata, offset, > resid, td, bp); > @@ -305,9 +303,9 @@ ffs_rawread_main(struct vnode *vp, > break; > > if (resid > bp->b_bufsize) { /* Setup fist readahead */ > - /* XXX: Leave bufs for swap */ > if (rawreadahead != 0) > - nbp = trypbuf(&ffsrawbufcnt); > + nbp = uma_zalloc(ffsraw_pbuf_zone, > + M_NOWAIT); > else > nbp = NULL; > if (nbp != NULL) { > @@ -324,7 +322,8 @@ ffs_rawread_main(struct vnode *vp, > nbp); > if (nerror) { > pbrelvp(nbp); > - relpbuf(nbp, &ffsrawbufcnt); > + uma_zfree(ffsraw_pbuf_zone, > + nbp); > nbp = NULL; > } > } > @@ -365,7 +364,7 @@ ffs_rawread_main(struct vnode *vp, > > if (resid <= bp->b_bufsize) { /* No more readaheads */ > pbrelvp(nbp); > - relpbuf(nbp, &ffsrawbufcnt); > + uma_zfree(ffsraw_pbuf_zone, nbp); > nbp = NULL; > } else { /* Setup next readahead */ > nerror = ffs_rawread_readahead(vp, > @@ -379,7 +378,7 @@ ffs_rawread_main(struct vnode *vp, > nbp); > if (nerror != 0) { > pbrelvp(nbp); > - relpbuf(nbp, &ffsrawbufcnt); > + uma_zfree(ffsraw_pbuf_zone, nbp); > nbp = NULL; > } > } > @@ -395,13 +394,13 @@ ffs_rawread_main(struct vnode *vp, > > if (bp != NULL) { > pbrelvp(bp); > - relpbuf(bp, &ffsrawbufcnt); > + uma_zfree(ffsraw_pbuf_zone, bp); > } > if (nbp != NULL) { /* Run down readahead buffer */ > bwait(nbp, PRIBIO, "rawrd"); > vunmapbuf(nbp); > pbrelvp(nbp); > - relpbuf(nbp, &ffsrawbufcnt); > + uma_zfree(ffsraw_pbuf_zone, nbp); > } > > if (error == 0) > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/vm/swap_pager.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -71,7 +71,6 @@ > #include > __FBSDID("$FreeBSD$"); > > -#include "opt_swap.h" > #include "opt_vm.h" > > #include > @@ -324,9 +323,8 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred * > > static int swap_pager_full = 2; /* swap space exhaustion (task killing) */ > static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/ > -static int nsw_rcount; /* free read buffers */ > -static int nsw_wcount_sync; /* limit write buffers / synchronous */ > -static int nsw_wcount_async; /* limit write buffers / asynchronous */ > +static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ > +static int nsw_wcount_async; /* limit async write buffers */ > static int nsw_wcount_async_max;/* assigned maximum */ > static int nsw_cluster_max; /* maximum VOP I/O allowed */ > > @@ -352,6 +350,8 @@ static struct sx sw_alloc_sx; > (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) > > static struct pagerlst swap_pager_object_list[NOBJLISTS]; > +static uma_zone_t swwbuf_zone; > +static uma_zone_t swrbuf_zone; > static uma_zone_t swblk_zone; > static uma_zone_t swpctrie_zone; > > @@ -539,13 +539,13 @@ swap_pager_swap_init(void) > */ > nsw_cluster_max = min((MAXPHYS/PAGE_SIZE), MAX_PAGEOUT_CLUSTER); > > - mtx_lock(&pbuf_mtx); > - nsw_rcount = (nswbuf + 1) / 2; > - nsw_wcount_sync = (nswbuf + 3) / 4; > nsw_wcount_async = 4; > nsw_wcount_async_max = nsw_wcount_async; > - mtx_unlock(&pbuf_mtx); > + mtx_init(&swbuf_mtx, "async swbuf mutex", NULL, MTX_DEF); > > + swwbuf_zone = pbuf_zsecond_create("swwbuf", nswbuf / 4); > + swrbuf_zone = pbuf_zsecond_create("swrbuf", nswbuf / 2); > + > /* > * Initialize our zone, taking the user's requested size or > * estimating the number we need based on the number of pages > @@ -1205,7 +1205,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, > ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); > > VM_OBJECT_WUNLOCK(object); > - bp = getpbuf(&nsw_rcount); > + bp = uma_zalloc(swrbuf_zone, M_WAITOK); > /* Pages cannot leave the object while busy. */ > for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { > MPASS(p->pindex == bm->pindex + i); > @@ -1406,12 +1406,17 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, > * All I/O parameters have been satisfied, build the I/O > * request and assign the swap space. > */ > - if (sync == TRUE) { > - bp = getpbuf(&nsw_wcount_sync); > - } else { > - bp = getpbuf(&nsw_wcount_async); > - bp->b_flags = B_ASYNC; > + if (sync != TRUE) { > + mtx_lock(&swbuf_mtx); > + while (nsw_wcount_async == 0) > + msleep(&nsw_wcount_async, &swbuf_mtx, PVM, > + "swbufa", 0); > + nsw_wcount_async--; > + mtx_unlock(&swbuf_mtx); > } > + bp = uma_zalloc(swwbuf_zone, M_WAITOK); > + if (sync != TRUE) > + bp->b_flags = B_ASYNC; > bp->b_flags |= B_PAGING; > bp->b_iocmd = BIO_WRITE; > > @@ -1634,15 +1639,13 @@ swp_pager_async_iodone(struct buf *bp) > /* > * release the physical I/O buffer > */ > - relpbuf( > - bp, > - ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : > - ((bp->b_flags & B_ASYNC) ? > - &nsw_wcount_async : > - &nsw_wcount_sync > - ) > - ) > - ); > + if (bp->b_flags & B_ASYNC) { > + mtx_lock(&swbuf_mtx); > + if (++nsw_wcount_async == 1) > + wakeup(&nsw_wcount_async); > + mtx_unlock(&swbuf_mtx); > + } > + uma_zfree((bp->b_iocmd == BIO_READ) ? swrbuf_zone : swwbuf_zone, bp); > } > > int > @@ -2627,6 +2630,7 @@ swapgeom_done(struct bio *bp2) > bp->b_ioflags |= BIO_ERROR; > bp->b_resid = bp->b_bcount - bp2->bio_completed; > bp->b_error = bp2->bio_error; > + bp->b_caller1 = NULL; > bufdone(bp); > sp = bp2->bio_caller1; > mtx_lock(&sw_dev_mtx); > @@ -2666,6 +2670,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) > return; > } > > + bp->b_caller1 = bio; > bio->bio_caller1 = sp; > bio->bio_caller2 = bp; > bio->bio_cmd = bp->b_iocmd; > @@ -2880,7 +2885,7 @@ sysctl_swap_async_max(SYSCTL_HANDLER_ARGS) > if (new > nswbuf / 2 || new < 1) > return (EINVAL); > > - mtx_lock(&pbuf_mtx); > + mtx_lock(&swbuf_mtx); > while (nsw_wcount_async_max != new) { > /* > * Adjust difference. If the current async count is too low, > @@ -2895,11 +2900,11 @@ sysctl_swap_async_max(SYSCTL_HANDLER_ARGS) > } else { > nsw_wcount_async_max -= nsw_wcount_async; > nsw_wcount_async = 0; > - msleep(&nsw_wcount_async, &pbuf_mtx, PSWP, > + msleep(&nsw_wcount_async, &swbuf_mtx, PSWP, > "swpsysctl", 0); > } > } > - mtx_unlock(&pbuf_mtx); > + mtx_unlock(&swbuf_mtx); > > return (0); > } > > Modified: head/sys/vm/vm_pager.c > ============================================================================== > --- head/sys/vm/vm_pager.c Tue Jan 15 00:52:41 2019 (r343029) > +++ head/sys/vm/vm_pager.c Tue Jan 15 01:02:16 2019 (r343030) > @@ -68,6 +68,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_param.h" > + > #include > #include > #include > @@ -85,11 +87,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > -int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ > +uma_zone_t pbuf_zone; > +static int pbuf_init(void *, int, int); > +static int pbuf_ctor(void *, int, void *, int); > +static void pbuf_dtor(void *, int, void *); > > -struct buf *swbuf; > - > static int dead_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); > static vm_object_t dead_pager_alloc(void *, vm_ooffset_t, vm_prot_t, > vm_ooffset_t, struct ucred *); > @@ -167,9 +171,6 @@ struct pagerops *pagertab[] = { > * cleaning requests (NPENDINGIO == 64) * the maximum swap cluster size > * (MAXPHYS == 64k) if you want to get the most efficiency. > */ > -struct mtx_padalign __exclusive_cache_line pbuf_mtx; > -static TAILQ_HEAD(swqueue, buf) bswlist; > -static int bswneeded; > vm_offset_t swapbkva; /* swap buffers kva */ > > void > @@ -177,7 +178,6 @@ vm_pager_init(void) > { > struct pagerops **pgops; > > - TAILQ_INIT(&bswlist); > /* > * Initialize known pagers > */ > @@ -186,30 +186,51 @@ vm_pager_init(void) > (*(*pgops)->pgo_init)(); > } > > +static int nswbuf_max; > + > void > vm_pager_bufferinit(void) > { > - struct buf *bp; > - int i; > > - mtx_init(&pbuf_mtx, "pbuf mutex", NULL, MTX_DEF); > - bp = swbuf; > + /* Main zone for paging bufs. */ > + pbuf_zone = uma_zcreate("pbuf", sizeof(struct buf), > + pbuf_ctor, pbuf_dtor, pbuf_init, NULL, UMA_ALIGN_CACHE, > + UMA_ZONE_VM | UMA_ZONE_NOFREE); > + /* Few systems may still use this zone directly, so it needs a limit. */ > + nswbuf_max += uma_zone_set_max(pbuf_zone, NSWBUF_MIN); > +} > + > +uma_zone_t > +pbuf_zsecond_create(char *name, int max) > +{ > + uma_zone_t zone; > + > + zone = uma_zsecond_create(name, pbuf_ctor, pbuf_dtor, NULL, NULL, > + pbuf_zone); > /* > - * Now set up swap and physical I/O buffer headers. > + * uma_prealloc() rounds up to items per slab. If we would prealloc > + * immediately on every pbuf_zsecond_create(), we may accumulate too > + * much of difference between hard limit and prealloced items, which > + * means wasted memory. > */ > - for (i = 0; i < nswbuf; i++, bp++) { > - TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist); > - BUF_LOCKINIT(bp); > - LIST_INIT(&bp->b_dep); > - bp->b_rcred = bp->b_wcred = NOCRED; > - bp->b_xflags = 0; > - } > + if (nswbuf_max > 0) > + nswbuf_max += uma_zone_set_max(zone, max); > + else > + uma_prealloc(pbuf_zone, uma_zone_set_max(zone, max)); > > - cluster_pbuf_freecnt = nswbuf / 2; > - vnode_pbuf_freecnt = nswbuf / 2 + 1; > - vnode_async_pbuf_freecnt = nswbuf / 2; > + return (zone); > } > > +static void > +pbuf_prealloc(void *arg __unused) > +{ > + > + uma_prealloc(pbuf_zone, nswbuf_max); > + nswbuf_max = -1; > +} > + > +SYSINIT(pbuf, SI_SUB_KTHREAD_BUF, SI_ORDER_ANY, pbuf_prealloc, NULL); > + > /* > * Allocate an instance of a pager of the given type. > * Size, protection and offset parameters are passed in for pagers that > @@ -347,111 +368,34 @@ vm_pager_object_lookup(struct pagerlst *pg_list, void > return (object); > } > > -/* > - * initialize a physical buffer > - */ > - > -/* > - * XXX This probably belongs in vfs_bio.c > - */ > -static void > -initpbuf(struct buf *bp) > +static int > +pbuf_ctor(void *mem, int size, void *arg, int flags) > { > + struct buf *bp = mem; > > - KASSERT(bp->b_bufobj == NULL, ("initpbuf with bufobj")); > - KASSERT(bp->b_vp == NULL, ("initpbuf with vp")); > + bp->b_vp = NULL; > + bp->b_bufobj = NULL; > + > + /* copied from initpbuf() */ > bp->b_rcred = NOCRED; > bp->b_wcred = NOCRED; > - bp->b_qindex = 0; /* On no queue (QUEUE_NONE) */ > - bp->b_kvabase = (caddr_t)(MAXPHYS * (bp - swbuf)) + swapbkva; > + bp->b_qindex = 0; /* On no queue (QUEUE_NONE) */ > bp->b_data = bp->b_kvabase; > - bp->b_kvasize = MAXPHYS; > - bp->b_flags = 0; > bp->b_xflags = 0; > + bp->b_flags = 0; > bp->b_ioflags = 0; > bp->b_iodone = NULL; > bp->b_error = 0; > BUF_LOCK(bp, LK_EXCLUSIVE, NULL); > - buf_track(bp, __func__); > -} > > -/* > - * allocate a physical buffer > - * > - * There are a limited number (nswbuf) of physical buffers. We need > - * to make sure that no single subsystem is able to hog all of them, > - * so each subsystem implements a counter which is typically initialized > - * to 1/2 nswbuf. getpbuf() decrements this counter in allocation and > - * increments it on release, and blocks if the counter hits zero. A > - * subsystem may initialize the counter to -1 to disable the feature, > - * but it must still be sure to match up all uses of getpbuf() with > - * relpbuf() using the same variable. > - * > - * NOTE: pfreecnt can be NULL, but this 'feature' will be removed > - * relatively soon when the rest of the subsystems get smart about it. XXX > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Thu Jan 17 22:42:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3CBD148235D; Thu, 17 Jan 2019 22:42:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2028B88D22; Thu, 17 Jan 2019 22:42:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42b.google.com with SMTP id z9so5542701pfi.2; Thu, 17 Jan 2019 14:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=SzzKjqQHsR533bgl0deVFjugbvZDMIN4uGzcj7mWG7c=; b=DlaaF13HNgj+dBrckJI5RcF9RhYN/nEEegfCq+Bhyry3dvpAa5fqg9QRAP7nf7+5TI PhVYxow3JP8MeFxQ1HqK/O4Zyc8cRBUljmqyd0E4kl8kPC15mPP+NCUpErbYSVRycEgd 0hBL5Sb3UXXaQo6Fa+xzZzbphtZ94y7w7etOWAr2R7acltvJvh8vb7cu4oPT3tSzGfWJ Niv3Z5UqL2Cxe8adcbWzOvvUIVrWKuq3s2lQN8Gc2HXAVfL31O6mSu94cVJaS57+RwBm NxLdPwdjkbhBx0DLXdGuybNc9jNdgi7xYrmkuMYRcULPSbx9NaXOdKUlRUCEErGSgJJS Bpfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=SzzKjqQHsR533bgl0deVFjugbvZDMIN4uGzcj7mWG7c=; b=icSpj6UERem5m9NdBfJ1KS9R1YaXm6Gpq+aQPLq1vtpe8zg5aL8Ar1ttIuIpfdRup1 rzfTz3VVCa4s+7y+wg08N/OxtfJcMKJJZbXgl7u0lh07wqKq1XReCFPD70YWea17/yrx OhUgJ02YTpE/Klcrlgf9+D2jNGJrybLv+ngj52hYw3B2PWFnK9IfPY71jd5JjoCCSt+V 3UhKr8w+IOTvtepHMixIVdgVhZI3y5QFdJJEzGq6KpUjE+XE+hSq6+TaQb93dPSXfr6N VH7Y6Td118i7l6usFcYBQJ4fe2B+3+TVmtl+VW2vbYhMWrmH7eCy30qPNdw6U/STbVx1 RZMA== X-Gm-Message-State: AJcUukdQtZs82u7yGROUSeHPxyfj4SrJxfonfretLDe3v53B5Kc+s8hf jQB3vOtgU7Pu8VRgJXTapXQWEbGN X-Google-Smtp-Source: ALg8bN4ilXWkBcJFwBQieuoXYHuFKS2rja3R8yTAKhXkXV8dDyOKkEaiNs9S9tvU4O4ANLGWrBe4Tw== X-Received: by 2002:a63:ce50:: with SMTP id r16mr15001119pgi.217.1547764925698; Thu, 17 Jan 2019 14:42:05 -0800 (PST) Received: from [10.252.30.249] ([198.134.98.50]) by smtp.gmail.com with ESMTPSA id 62sm2909282pgc.61.2019.01.17.14.42.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 14:42:04 -0800 (PST) From: Enji Cooper Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_6CB1620B-6707-4F06-B7FF-9F1ECBA36F56"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim Date: Thu, 17 Jan 2019 14:42:04 -0800 In-Reply-To: Cc: Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Maxim Sobolev References: <201901172046.x0HKkvWs011502@slippy.cwsent.com> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 2028B88D22 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:42:07 -0000 --Apple-Mail=_6CB1620B-6707-4F06-B7FF-9F1ECBA36F56 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 17, 2019, at 2:25 PM, Maxim Sobolev = wrote: >=20 > What I think we really need is some way to easily porti-ze useful = stuff that would otherwise go into /usr/[s]bin, so adding things would = be just as easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I = know, this is topic almost as old as the FreeBSD Project itself, but = perhaps we just did not approach it the right way. It was always the = idea that we would just move bunch of stuff from src/usr.[s]bin repo = into ports/. Which brings several important question such as "who is to = host the distfile"? "where sources hosted", "who is to update the port = when changes happen?" etc. Projects like this could be hosted on GitHub. Ports supports GitHub out = of the box, so this seems like a low barrier for entry (the bonus of = doing this is that the projects could potentially be used by other = non-FreeBSD projects, and contributed by others outside the FreeBSD = project; the downside is having to deal with FreeBSD CI, as Travis CI = only supports Linux (IIRC making Travis support FreeBSD is a non-trivial = project, but it=E2=80=99s likely a very worthwhile goal, as it would = make it easier to catch issues upfront with third-party projects that = FreeBSD consumes, like llvm), enforcing style (can be done with git = commit hooks and GitHub checks), etc. I would really like to do these = things because it=E2=80=99s difficult getting folks to support FreeBSD = in third-party projects as-is. Lowering the barrier of entry would allow = FreeBSD and its developers to better scale (and make FreeBSD more of a = first-class OS). > Perhaps even by forking the whole ports idea into a smaller = closely-guarged subset. Something like a new baseports repository, which = might have structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy = etc. Then add some automagic glue to kick in on every commit and = transfer this into valid ports, which is going to be packaged by the = poudriere and such. This way we could reduce amount of port-foo average = src committer needs in order to maintain code. I am almost tempted to = sit and write something over the next weekend or few of thereofs. Using = usr.sbin/trim as an example. Please see my above comment. Cheers! -Enji --Apple-Mail=_6CB1620B-6707-4F06-B7FF-9F1ECBA36F56 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlxBBLwACgkQ5JFNMZeD GN5Oog//eg4gG5Onqnn9+CKOMxhk+ELELTyd4gb2Yx81EmpBdHpusExAI8eZfhzQ e5Grt7jipkNeqPUaLlEmRGBbYSHbq7mE2tHQ8SIkLdWHt72YZ2Rco43TbXlmzzIF ka+A1A+6jkBPk1qez1RHYoMs2F3jdND+1SvGnwAqWeMklMD9RAfy0QCFe3uh87cZ sApG8b8zzn7hk3VTGn1pJJzKZGZUOCYxBrZcO6zckEdiqoLmMPsCcRHG3/xJ7jRW MyiblPqeKdNMEXPzKmO/RRb5Dbjq2hXbrKWI0HCb8EwKt8KUCOWSIy+C7OLBxlQS ArpJA+xo8zVvMitb+kekxupjfYBZlPBDOV2aSQLCXAZj4jQI9hqRQOqYBw0Kt72q FH5HjteRrcIdaamrHt6lRvYPBe4SBWvd7jomFhxCiWSg+jvx0rC9zFC+4uSzqEsr v16ZLSmnPP0e5OltgGP0JM7fNkMxhU2o9VVglaR3OhhuouvXml4iXGncsdoIeeEn E9qNm6xW5GnPdu81CRgtpOAQ6JHbJ2/rYcgPt7SAiVh3Qm2RNFyLbGcWXYTo5Pgv sCEwhR2ENCgwpqpFSHkKB0wpWE3ZskTjMFhvirDYm91R/6NRuEPc5k8gpMEOOKii E8Mbb2Y/pTd4iK8O01wL4dPkFfLkWZsNBP6n5ootb1hI7iKmKjE= =RYxu -----END PGP SIGNATURE----- --Apple-Mail=_6CB1620B-6707-4F06-B7FF-9F1ECBA36F56-- From owner-svn-src-head@freebsd.org Thu Jan 17 22:43:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FCD01482623; Thu, 17 Jan 2019 22:43:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE68989082; Thu, 17 Jan 2019 22:43:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id m62so4072615ith.5; Thu, 17 Jan 2019 14:43:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=0Ie4QDBR9bkWLCtsoaBF64uD85dS5Hw31mojuNcIinQ=; b=ntiFCRzuK/nCJsBmOhocOwh2Ps78nK2O0WPQJlKp3bdmVr2YIM19OuQGRDlJeeHcXA UD7KWgKCr6PtoE9J2QZXFTwKXJfKF+Vv1yG9ouqofB/43nBtcTb3GlDkg2derVGQJ7hE 6eI5tpTsn+ooku8N8rS1Jil8Pq24YhW35yl5mggf5no+tOXH5qmQF/W2BYUFiyO2PU6m Fr0AL9TVT0j/6+UPcEeVaA6R1o/79Yk1uPnRB5qnaqoi8oSaLRd3ZrWApr6/yVt2hEFl J+y3SOIh8Y2GeFRHSDkc5usR9x9bS6KGxqc/Lt8OT1BB3O1sgrEA3uZ1H9lsosa/CKZN rETA== X-Gm-Message-State: AJcUukfxJC5EYiOtc4x7vEMD/9LQCRLUcyAaLc1dsWR/6RW7lS/rcUWo vF1mHZSvynwQipjcKmsyBgMPQe3+ X-Google-Smtp-Source: ALg8bN46bsSikaFfJRk5wUSPBE45S7K3Wep/WWDv6YG5p/jGhqofcVmqlu+WtqP/WRGK9T3bBAhufg== X-Received: by 2002:a24:2104:: with SMTP id e4mr9090720ita.59.1547761548205; Thu, 17 Jan 2019 13:45:48 -0800 (PST) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id y5sm940866ioj.9.2019.01.17.13.45.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 13:45:47 -0800 (PST) Received: by mail-io1-f49.google.com with SMTP id b23so9062063ios.10; Thu, 17 Jan 2019 13:45:47 -0800 (PST) X-Received: by 2002:a6b:6111:: with SMTP id v17mr9388524iob.107.1547761547775; Thu, 17 Jan 2019 13:45:47 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> In-Reply-To: <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 17 Jan 2019 13:45:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Eugene Grosbein Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: BE68989082 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 22:43:31 -0000 On Thu, Jan 17, 2019 at 1:16 PM Eugene Grosbein wrote: > > 18.01.2019 3:23, Conrad Meyer =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > Please back it out; stop attributing code review to "hackers@," which > > can not (it's a list, not individuals) and did not review this > > changeset; and put it on phabricator for actual review. > > There is already https://reviews.freebsd.org/D18380 by imp > and there were over 6 weeks since it had an update. > Newly committed code has most of its changes. Your response does not address *any* of the above concerns. It's just unrelated. The review you linked to isn't one you submitted for this change; it's Warner's, and that one stalled because you were such a jerk to him last time that he needed time off from you. If you want to socialize, revive, or expedite someone else's review, maybe add a new comment to the review, or post a discussion hackers@, or something like that. You still can't attribute code review to hackers@, especially as no such review happened. Conrad From owner-svn-src-head@freebsd.org Thu Jan 17 23:18:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E421483553 for ; Thu, 17 Jan 2019 23:18:51 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B5A88A270 for ; Thu, 17 Jan 2019 23:18:51 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-oi1-f178.google.com with SMTP id j21so7564534oii.8 for ; Thu, 17 Jan 2019 15:18:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HALbC2X3d6Vh62ZWNRm+ai/mxF5pQFs2pByi+RlNRzw=; b=pa9fLNXKkpbhKKoRRPXHIax0cZZyWcnD+crR96hiWP4zfcSDvHG7V+mKhKYSXOXouY MvhPvpYQKkaTjzLfRLIy0IGh32HVbF3AqP733+zbwXETwTzVfpg1qnR1PoWR8Xq3bUNA lhkxjBhnpuqy0vRBHjDDqIGOFqC6hsrAO9oYuImTIx6K9MgTIlstaQRZz6hCj/o/37jR ZEBalZlvTAysc6PfIGjkOGwJ44DkDVoL4oYyR/8M9OPJbf58pS/OTuaQ0aH4MqkaaWx0 D138ePZgZq4KIX4/+q+02ojm/Pessyb5I1i1YtUNG4AXLQaTu4dwTrULYGF+p9lqW39W DaOA== X-Gm-Message-State: AJcUukcepO56yLIVswLxI+ffGZdVHjbhoJreoLVplCPx1ajRq39PPPe/ aTy0bHHqvDHwXVXJSvyUHPkRIMIpgC9fOXN93UG6J36z X-Google-Smtp-Source: ALg8bN7SIF70e3ZzTiGwy3FtwmD6iFowOqS1ihQE7SuKxfDZRBzQsE6JA7L1FBtLO6kQyHS72NnId+MfRxgM5V+5wOw= X-Received: by 2002:aca:c003:: with SMTP id q3mr8343031oif.119.1547767129870; Thu, 17 Jan 2019 15:18:49 -0800 (PST) MIME-Version: 1.0 References: <201901172046.x0HKkvWs011502@slippy.cwsent.com> In-Reply-To: From: Maxim Sobolev Date: Thu, 17 Jan 2019 15:18:39 -0800 Message-ID: Subject: Packaging base system (again) [Was: svn commit: r343118 - in head/usr.sbin: . trim] To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8B5A88A270 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 23:18:52 -0000 On Thu, Jan 17, 2019 at 2:42 PM Enji Cooper wrote: > > Perhaps even by forking the whole ports idea into a smaller > closely-guarged subset. Something like a new baseports repository, which > might have structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy > etc. Then add some automagic glue to kick in on every commit and transfer > this into valid ports, which is going to be packaged by the poudriere and > such. This way we could reduce amount of port-foo average src committer > needs in order to maintain code. I am almost tempted to sit and write > something over the next weekend or few of thereofs. Using usr.sbin/trim as > an example. > > Please see my above comment. > Well, I don't think your comment really addresses my concerns here. Correct me if I am wrong, but you seem suggesting that every src developer would also need some external account (github in this example) to maintain his or her chunk of code independently of everyone else's. This is pretty much a no-go from starters. There are also many more major issues with such approach, such as completely different branching model for src and ports as an example. ports is a good framework in general, for maintaining software produced by external entities. I don't feel it's very appropriate for maintaining software produced by the Project itself, though, due to complexity inherited with that. We need something simpler and more self-consistent, at the same time I see no reasons why it could not utilize some if not all tooling with we build around ports/Mk over the years. IMHO. -Max From owner-svn-src-head@freebsd.org Thu Jan 17 23:21:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FC6314836A2; Thu, 17 Jan 2019 23:21:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27B1B8A462; Thu, 17 Jan 2019 23:21:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D46121483; Thu, 17 Jan 2019 23:21:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0HNL2cX036089; Thu, 17 Jan 2019 23:21:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0HNL2f4036088; Thu, 17 Jan 2019 23:21:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901172321.x0HNL2f4036088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 17 Jan 2019 23:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343125 - head/sys/dev/ioat X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/ioat X-SVN-Commit-Revision: 343125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27B1B8A462 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Jan 2019 23:21:03 -0000 Author: cem Date: Thu Jan 17 23:21:02 2019 New Revision: 343125 URL: https://svnweb.freebsd.org/changeset/base/343125 Log: ioat(4): Set __result_use_check on ioat_acquire_reserve Even M_WAITOK callers must check for failure. For example, if the device is quiescing, either due to automatic error-recovery induced reset, or due to administrative detach, the routine will return ENXIO and the acquire reference will not be held. So, there is no mode in which it is safe to assume the routine succeeds without checking. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.h Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Thu Jan 17 22:00:02 2019 (r343124) +++ head/sys/dev/ioat/ioat.h Thu Jan 17 23:21:02 2019 (r343125) @@ -173,7 +173,8 @@ void ioat_release(bus_dmaengine_t dmaengine); * * On failure, the caller does not hold the dmaengine. */ -int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags); +int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags) + __result_use_check; /* * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to From owner-svn-src-head@freebsd.org Fri Jan 18 00:08:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C1FB1485089; Fri, 18 Jan 2019 00:08:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D54788C4C2; Fri, 18 Jan 2019 00:08:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0I08Tjs052764; Thu, 17 Jan 2019 16:08:29 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0I08THg052763; Thu, 17 Jan 2019 16:08:29 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901180008.x0I08THg052763@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: To: Maxim Sobolev Date: Thu, 17 Jan 2019 16:08:29 -0800 (PST) CC: Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: D54788C4C2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:08:38 -0000 > What I think we really need is some way to easily porti-ze useful stuff > that would otherwise go into /usr/[s]bin, so adding things would be just as > easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I know, this is > topic almost as old as the FreeBSD Project itself, but perhaps we just did > not approach it the right way. It was always the idea that we would just > move bunch of stuff from src/usr.[s]bin repo into ports/. Which brings > several important question such as "who is to host the distfile"? "where > sources hosted", "who is to update the port when changes happen?" etc. > > Perhaps even by forking the whole ports idea into a smaller closely-guarged > subset. Something like a new baseports repository, which might have > structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy etc. Then add > some automagic glue to kick in on every commit and transfer this into valid > ports, which is going to be packaged by the poudriere and such. This way we > could reduce amount of port-foo average src committer needs in order to > maintain code. I am almost tempted to sit and write something over the next > weekend or few of thereofs. Using usr.sbin/trim as an example. Couldnt the "distribution" just live as files commited into the ports tree as a "work" hierarcy and the top level file be marked as no fetch. We use to stick small stuff in ports by putting there files in files/ and having that work IIRC. I really really dislike the idea of putting stuff from base in external repositories and then fetching them, something just feels fundementally wrong about that. > -Max > > On Thu, Jan 17, 2019 at 12:47 PM Cy Schubert > wrote: > > > In message > il.com> > > , Conrad Meyer writes: > > > On Thu, Jan 17, 2019 at 12:22 PM Cy Schubert > > wrot > > > e: > > > > This is wrong. IIRC there was discussion that this should be in dd(1). > > > > Why not submit a revision to add the functionality to dd? > > > > > > Well, it's wrong, but not because we need another weird dd mode. dd > > > is hard enough to use already. > > > > I've never found dd confusing. What's wrong conv=erase? > > > > If it must stay, sderase is a better name. That's really what it does. > > > > Ports maybe? > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 18 00:12:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3257148533F for ; Fri, 18 Jan 2019 00:12:35 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6E98C8FF for ; Fri, 18 Jan 2019 00:12:35 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-it1-x129.google.com with SMTP id i145so4345637ita.4 for ; Thu, 17 Jan 2019 16:12:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R2ek3BtAJjNbrFlYaNXLeYo/CdRPnLa8OPk9Wpgm/Uo=; b=NBzngUZ81IGJ1uz5QtdN3p0wHb4vo1+I4DjLj3+aHqJ0uh02NyLtOs1KpLgShVy/80 hvdXvtOrjM1uC8a6UHmsLGxvRna13URNNn8EQ+12OUce1Z7h4+pEF24Rv5u2T3tS1Hl5 IE3lV0LQ6d1zsKngK82MJQBdbpgmpUtcei8ww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R2ek3BtAJjNbrFlYaNXLeYo/CdRPnLa8OPk9Wpgm/Uo=; b=unAHs4PmEbfR4hkSORza26fasB50kFYNqerDCZ6xIwF7Qd0irfkAWAY50pdGkycAT5 lcoksG2o3//fyXFqiUfh4oIWsWZqF+LZvyaC3AEawN6YjgHFCylqYtYQvKtrSMJ0Acuj ZFtApwtmmZ0EYE0NrPGgpLuwoMjuTwpi8opN5vuEMAa9Xy0K+Ra7nGUF2AOOBrSHT0EJ C1PRzfD+n8i0yWcnQX+YcQ1yNdA2nRZy8OoxOWwwZ2MTmuuDLJldqRzqmGNqwkA3WG8B ymcJXBk/iUTnmrA7ysQMokaoUuftp1OUIt0Vld80ieOVdiny+hk+vQv7wuUtJpCDSlzx LI0A== X-Gm-Message-State: AJcUukdHaabX0WJ8LuCkz3tmiGL61G+IwvhPH0K1NDJxQ0JX0LT0IhfM EOapQKL+2sXeaergnKrLUJHIEvXLrAkq+uvwpWQKhw== X-Google-Smtp-Source: ALg8bN7zlzj8rFyig/DyECqHBSj5op07xpOIrqRFKZ1TCV/0f6JX2db4dAaoqgb/S41X116cmfMkHkShFbpw8bqY65c= X-Received: by 2002:a02:f42:: with SMTP id h63mr9500495jad.133.1547770354652; Thu, 17 Jan 2019 16:12:34 -0800 (PST) MIME-Version: 1.0 References: <201901172321.x0HNL2f4036088@repo.freebsd.org> In-Reply-To: <201901172321.x0HNL2f4036088@repo.freebsd.org> From: Kevin Bowling Date: Thu, 17 Jan 2019 17:12:23 -0700 Message-ID: Subject: Re: svn commit: r343125 - head/sys/dev/ioat To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7E6E98C8FF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:12:36 -0000 Out of curiosity are you using this driver? Any performance data? On Thu, Jan 17, 2019 at 4:21 PM Conrad Meyer wrote: > Author: cem > Date: Thu Jan 17 23:21:02 2019 > New Revision: 343125 > URL: https://svnweb.freebsd.org/changeset/base/343125 > > Log: > ioat(4): Set __result_use_check on ioat_acquire_reserve > > Even M_WAITOK callers must check for failure. For example, if the > device is > quiescing, either due to automatic error-recovery induced reset, or due > to > administrative detach, the routine will return ENXIO and the acquire > reference will not be held. So, there is no mode in which it is safe to > assume the routine succeeds without checking. > > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/dev/ioat/ioat.h > > Modified: head/sys/dev/ioat/ioat.h > > ============================================================================== > --- head/sys/dev/ioat/ioat.h Thu Jan 17 22:00:02 2019 (r343124) > +++ head/sys/dev/ioat/ioat.h Thu Jan 17 23:21:02 2019 (r343125) > @@ -173,7 +173,8 @@ void ioat_release(bus_dmaengine_t dmaengine); > * > * On failure, the caller does not hold the dmaengine. > */ > -int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int > mflags); > +int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int > mflags) > + __result_use_check; > > /* > * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is > written to > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Fri Jan 18 00:26:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A15E14859C9; Fri, 18 Jan 2019 00:26:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10A348D318; Fri, 18 Jan 2019 00:26:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7D7D2207F; Fri, 18 Jan 2019 00:26:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0I0QPgU073260; Fri, 18 Jan 2019 00:26:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0I0QPOV073259; Fri, 18 Jan 2019 00:26:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901180026.x0I0QPOV073259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 18 Jan 2019 00:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343127 - head/usr.bin/compress X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/compress X-SVN-Commit-Revision: 343127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10A348D318 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:26:26 -0000 Author: gonzo Date: Fri Jan 18 00:26:25 2019 New Revision: 343127 URL: https://svnweb.freebsd.org/changeset/base/343127 Log: Fix descriptor/memory leak in compress(1) code This is mostly a style fix since the code in question is not called multiple times and doesn't have cummulative effect. PR: 204953 Submitted by: David Binderman MFC after: 1 week Modified: head/usr.bin/compress/compress.c Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Thu Jan 17 23:22:56 2019 (r343126) +++ head/usr.bin/compress/compress.c Fri Jan 18 00:26:25 2019 (r343127) @@ -322,6 +322,8 @@ decompress(const char *in, const char *out, int bits) if ((ofp = fopen(out, "w")) == NULL || (nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) { cwarn("%s", out); + if (ofp) + (void)fclose(ofp); (void)fclose(ifp); return; } From owner-svn-src-head@freebsd.org Fri Jan 18 00:39:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87CAD1486635; Fri, 18 Jan 2019 00:39:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6758DCCE; Fri, 18 Jan 2019 00:39:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1548E2222F; Fri, 18 Jan 2019 00:39:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0I0dHbK078684; Fri, 18 Jan 2019 00:39:17 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0I0dHuC078683; Fri, 18 Jan 2019 00:39:17 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901180039.x0I0dHuC078683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 18 Jan 2019 00:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343128 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D6758DCCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:39:18 -0000 Author: gonzo Date: Fri Jan 18 00:39:17 2019 New Revision: 343128 URL: https://svnweb.freebsd.org/changeset/base/343128 Log: Add ypldap to the list of conditional obsolete files ypldap should be removed during delete-old if WITHOUT_NIS flag is enabled PR: 230727 Submitted by: Dmitry Wagin MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jan 18 00:26:25 2019 (r343127) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jan 18 00:39:17 2019 (r343128) @@ -6522,6 +6522,7 @@ OLD_FILES+=usr/bin/ypcat OLD_FILES+=usr/bin/ypchfn OLD_FILES+=usr/bin/ypchpass OLD_FILES+=usr/bin/ypchsh +OLD_FILES+=usr/bin/ypldap OLD_FILES+=usr/bin/ypmatch OLD_FILES+=usr/bin/yppasswd OLD_FILES+=usr/bin/ypwhich From owner-svn-src-head@freebsd.org Fri Jan 18 00:39:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1465A14866CD for ; Fri, 18 Jan 2019 00:39:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4CA8DE14 for ; Fri, 18 Jan 2019 00:39:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id z18so7145565qkj.10 for ; Thu, 17 Jan 2019 16:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=esWXdcvVsrAGIE27FKVpJZHn8ai99wulOljeiG0A4hE=; b=MB+uFc0ShVBU6OuM3Z245TOXnd9qQ2risCBgwrX2GhjWPOr3/I2xPDuiQK4X95JZXK Pt+Po+5lqD9Na1zmV4707+UMAFJQ5m2j+WYZWojVYxgGrn1UsouDLnJyTNZ0QGVCIxbr +6c/GXwlTa3cX9M/2h7yKn8N07J0eZFxNRtC02yXZs4W/SBeBuueU9hUPg7/8AeQFZ1Q Qv3oa88AQSNhquglPTxHW02X7Kiv8IMlvrvASRZ1fW6qmHEEplTuV6HjcjrlkeICyhdp auJDdXj9uPv/06kR57gkfuzEATb6encxMMy/EPZdXizi+j5FMp915mXrSEBJUe/jMUD2 bhdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=esWXdcvVsrAGIE27FKVpJZHn8ai99wulOljeiG0A4hE=; b=oF17JjgdW23RPVBbs2kPSvuxF8ibUwn4Q0UZJAFo1Wmq7Bnc0W+8RnKgRq6s30P9yw 2tFSOcUNjuQ7fQ43IUVwjDiiZTchSzqBPqGdqUbCOfO+L9XPD1Md36/jUHT0D2vUwbcv mSTwM/ZX/mbBafOqwx9OKp9hFWHwm2n1VcjZbc9tYs4xJkyAYbjA/PtYkd7Nt51feeO2 ClUGNDGoCuBOBEAY/Ulg/x0ryjLoY9YLLlkRTxAey4T5x2qOvzFEe/azJ5FPh2En2kzF r50LkyZ3KBfsrBDFRgoGFldGrqZv215I8aUCkSZh1JUMiXqPcNJ2jhUBm/puCcmrasKt Q/DA== X-Gm-Message-State: AJcUukffd3fbvZHIQM8/NqKhyBpTOqgc2bhbRP7yzNzDruEwXoZMyDbU +RScmgPJVXquyugZ8IkIds2cwyvBqu00EJEXXG1rxA== X-Google-Smtp-Source: ALg8bN5rXZ7c0lV0FONfR0gt8lCYBhgfcga9vtib+FmWJqP4h10cIGUdaS0w6ezjWiZt8wV+PREdhy8C+EEfnDm26qk= X-Received: by 2002:a37:6e86:: with SMTP id j128mr13493133qkc.46.1547771985956; Thu, 17 Jan 2019 16:39:45 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> In-Reply-To: <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> From: Warner Losh Date: Thu, 17 Jan 2019 17:39:34 -0700 Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Eugene Grosbein Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 9D4CA8DE14 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:39:47 -0000 On Thu, Jan 17, 2019 at 2:16 PM Eugene Grosbein wrote: > 18.01.2019 3:23, Conrad Meyer =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > Please back it out; stop attributing code review to "hackers@," which > > can not (it's a list, not individuals) and did not review this > > changeset; and put it on phabricator for actual review. > > There is already https://reviews.freebsd.org/D18380 by imp > and there were over 6 weeks since it had an update. > Newly committed code has most of its changes. > You hijacked that review. Don't you dare use it as evidence of consent to the sh*t you just pulled. Back it out, do a proper review. This one was not proper, nor was it complete. Don't go using my name to support a program I've come to think is a really bad idea. Warner From owner-svn-src-head@freebsd.org Fri Jan 18 00:42:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4943148690B for ; Fri, 18 Jan 2019 00:42:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFEE8E2D5 for ; Fri, 18 Jan 2019 00:42:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x743.google.com with SMTP id o8so7127107qkk.11 for ; Thu, 17 Jan 2019 16:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=00MgM50rGdtSbWiq9CVjIX9gdy0oZkLGdwOCLIaKpm4=; b=Ez2C2Mn9Rp7hvS5MWLqqMw9ZT8VpbrxBio2a0S0B5THZrUsv0eb+pjxmhKPdhXSk2E Z8nGpNNi4W9JoNUlF+sRrpX3wGTMx0jOt1vLLLWPVK4ddmwJHpeAlHzO9h1fYKIoPk3g iJYVCNaw992826b8ueXhZwXyeTbMcEoA+WcD1kAK27JFbgvL9M88tT11Ssf3SlKnXUMk iXKPnou3K2I8WcqAkgCeRMkmXraJFha/gZ8Ijkxc1nGbHUV+cs37OonBU6wyS7YUf1p7 6nI9pTEm9u4Fsjz14MS5QxEQp3QT3veOFYPhC3ySSc8HyUtm8ho6WEW2a9EjD6IGVhzI PsFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=00MgM50rGdtSbWiq9CVjIX9gdy0oZkLGdwOCLIaKpm4=; b=PgW3kdKJsJPyx0IZ0izcYqqoyeTzm5fwotdy4n+pq1rWmNs6X1l36ywh/rOIsV2PTg jgHG6BWzYjIK2KPEvnCcuAm4W2hnhrjoEG5UYB8GFcx8BticcHv4cn8J/NVrOuXEkFUn J3SiPUoRE7iH+KqAD2Bx8Cc4EsfEz2qkzgeSw5tkiJuz39bWCnVHVbNYPXjLQ3+n4E+z bHLwYLkaGH1Iv8iVqTX4NtcIy6WnZuIdVy7arw6ex8UcF8BXwzD8Gkk2bOqFSj6WDwcH BOWVby9jwomr/vrBrzKOIz6t3avWGdbhbpPVcshVuXRdgDegFzO1YxU4f82ZHKoJN4+e GckA== X-Gm-Message-State: AJcUukfM/n+p348QDWmK8uwlWqSHiem97xZ3vgfsBs9hyQgjCDtZr54d vuvgUEaPlnspWlQ7Ultr/j+hPC0NrgAMkGOLLep4HQ== X-Google-Smtp-Source: ALg8bN6lyQM0IiSuyLciyPsuS/EmvaBHDbrVBozquuAT0gIcrD3C3J6xlEnFJrB/qMZ/AM1cHlu0BKdYRn7ZPV1glgM= X-Received: by 2002:a37:6c05:: with SMTP id h5mr13072995qkc.175.1547772124804; Thu, 17 Jan 2019 16:42:04 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 17 Jan 2019 17:41:53 -0700 Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: "Conrad E. Meyer" Cc: Eugene Grosbein , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4DFEE8E2D5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:42:06 -0000 On Thu, Jan 17, 2019 at 3:43 PM Conrad Meyer wrote: > On Thu, Jan 17, 2019 at 1:16 PM Eugene Grosbein wrote= : > > > > 18.01.2019 3:23, Conrad Meyer =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > > > Please back it out; stop attributing code review to "hackers@," which > > > can not (it's a list, not individuals) and did not review this > > > changeset; and put it on phabricator for actual review. > > > > There is already https://reviews.freebsd.org/D18380 by imp > > and there were over 6 weeks since it had an update. > > Newly committed code has most of its changes. > > Your response does not address *any* of the above concerns. It's just > unrelated. > Yes. > The review you linked to isn't one you submitted for this change; it's > Warner's, and that one stalled because you were such a jerk to him > last time that he needed time off from you. > I abandoned it because dd is the better way to go because it can transfer images with 0's and TRIM the zero'd pages (and only the zero'd pages). Sure dd is hard to use, but it's not that hard to use. > If you want to socialize, revive, or expedite someone else's review, > maybe add a new comment to the review, or post a discussion hackers@, > or something like that. You still can't attribute code review to > hackers@, especially as no such review happened. > I think it should be backed out. Especially since it hijacks my work and my name to try to ram it into the tree. I'm very much not amused. Warner From owner-svn-src-head@freebsd.org Fri Jan 18 00:48:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FA961486DFB; Fri, 18 Jan 2019 00:48:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ACE78E73C; Fri, 18 Jan 2019 00:48:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0I0moQ6052936; Thu, 17 Jan 2019 16:48:50 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0I0mois052935; Thu, 17 Jan 2019 16:48:50 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901180048.x0I0mois052935@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: To: Warner Losh Date: Thu, 17 Jan 2019 16:48:50 -0800 (PST) CC: "Conrad E. Meyer" , Eugene Grosbein , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 6ACE78E73C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:48:54 -0000 > On Thu, Jan 17, 2019 at 3:43 PM Conrad Meyer wrote: > > > On Thu, Jan 17, 2019 at 1:16 PM Eugene Grosbein wrote: > > > > > > 18.01.2019 3:23, Conrad Meyer ?????: > > > > > > > Please back it out; stop attributing code review to "hackers@," which > > > > can not (it's a list, not individuals) and did not review this > > > > changeset; and put it on phabricator for actual review. > > > > > > There is already https://reviews.freebsd.org/D18380 by imp > > > and there were over 6 weeks since it had an update. > > > Newly committed code has most of its changes. > > > > Your response does not address *any* of the above concerns. It's just > > unrelated. > > > > Yes. > > > > The review you linked to isn't one you submitted for this change; it's > > Warner's, and that one stalled because you were such a jerk to him > > last time that he needed time off from you. > > > > I abandoned it because dd is the better way to go because it can transfer > images with 0's and TRIM the zero'd pages (and only the zero'd pages). Sure > dd is hard to use, but it's not that hard to use. I strongly disagree that dd is the proper place for this tool, dd is far to easy a way to destroy data when trying to do this type of operation and should be the last choice for implementing what is normally a very safe thing to do. And as eugene points out dd can not easily be made to do "trim ada0 ada1 ada4" which is probably the far more common use of this command. dd's ability to do sparse(ing) of a file should NOT be overloaded with a device layer block trimming function. > > > > If you want to socialize, revive, or expedite someone else's review, > > maybe add a new comment to the review, or post a discussion hackers@, > > or something like that. You still can't attribute code review to > > hackers@, especially as no such review happened. > > > > I think it should be backed out. Especially since it hijacks my work and my > name to try to ram it into the tree. > > I'm very much not amused. Nor am I with some of the reactoin to the commit :-( -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 18 00:49:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C6A91486EB4; Fri, 18 Jan 2019 00:49:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 073E98E896; Fri, 18 Jan 2019 00:49:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id g85so4454767ita.3; Thu, 17 Jan 2019 16:49:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=4BR2P7GqZ2ZwmMeqZvweeD6syBbdydmbE0YX2Zch3Yc=; b=RDUnkBF2nMtSw7VpqB0IH0uTxL6Uy9f+DE6KC893G7UM30gv4MGZkXRLvWbXoQoTkB ntqJ8lV4b4fqQdfbwyx6HYIsG9nvh2LFbNqtLtbAkCoI1JXzGfB3HAGNOSJgGS45TrAF rtQ0IEROtGa4Chu9igfj2IDdCh9WeYU7UdASP8wSq5SAzV3wJ/WqPTnsrSRcBqgIwdco Jwg9umfcxftH/vX7nsNeKADngsXTTvTKIBXTzG5H6izo2xA5M02db0UrzbaNC2NlMiFc LGEUsFLxgl+DgilNMciJEOyQOEZ4wP2o6b7cpexSaf3i/hHYXdP8pcsO/FTqDt/Bdw9j TdwQ== X-Gm-Message-State: AJcUukdjmpxfwrarTLmgzfnk+LsN/knISMH0XQHfi0nFjxa95oP7Zzqw giisoiwtwmBqFX0nYxbFeYVtpM5I X-Google-Smtp-Source: ALg8bN4xcxDGgSPZBJyjvkcmKHfl98KJkW5ZCoi0pOzgpY19tldKGIKntmAjf93Y2jYuqGIANJPJYQ== X-Received: by 2002:a02:781e:: with SMTP id p30mr9899245jac.85.1547772209229; Thu, 17 Jan 2019 16:43:29 -0800 (PST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id v3sm1189205ioj.79.2019.01.17.16.43.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 16:43:28 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id k7so9404137iob.6; Thu, 17 Jan 2019 16:43:28 -0800 (PST) X-Received: by 2002:a5e:8d04:: with SMTP id m4mr8534997ioj.233.1547772208763; Thu, 17 Jan 2019 16:43:28 -0800 (PST) MIME-Version: 1.0 References: <201901172321.x0HNL2f4036088@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 17 Jan 2019 16:43:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343125 - head/sys/dev/ioat To: Kevin Bowling Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 073E98E896 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:49:12 -0000 On Thu, Jan 17, 2019 at 4:12 PM Kevin Bowling wrote: > > Out of curiosity are you using this driver? Any performance data? Yep. I don't have any hard numbers on hand but my recollection is it caps out at about 5 GB/s, total, on Broadwell. Our workload with it is predominantly unmapped 8kB copies but includes some 512 byte copies as well. My recollection is that the channels are logical and share a single DMA engine, so there's not much reason to use more than one of them. It may improve on future microarchs but I can't speak to those. Cheers, Conrad From owner-svn-src-head@freebsd.org Fri Jan 18 00:55:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA2A14873CC for ; Fri, 18 Jan 2019 00:55:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF2E78EDF1 for ; Fri, 18 Jan 2019 00:55:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x841.google.com with SMTP id y20so13469900qtm.13 for ; Thu, 17 Jan 2019 16:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PR3u1wr566KY7MQkkxUo7MWbtVG3BC78LZ12uiAS1SE=; b=pIdxLxue1wm6F+xQfDIWL7heHo9L02Lm6DNMr5I5W2BrihVZ74bjzT0Q0ZvcKt6Z1i xWt3k5zBpq5roMTgW0J9timOBTc+4e3Q8NN74BsYSHUn2EpaAwpIgUtjmIYUsBnBNzOm gkVG6xysYK9vx8mgy+CQCsWJRNoDVj7fZ0J0qGVaNDI1PAq882rQ0JFmJ46sZtQg1Bv9 qgUGoxrwdJYmSakBnUsneS01OafaE88lUZRiNICQEtS1vKRqqRjJlGWiyFE2SwJri65d eTQ0jMSAu/FCnlxrKPH1a1jxbEaULye2gzsf69pkAOoPQDSaA/uHH+CVyO603cxVQl9d DCAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PR3u1wr566KY7MQkkxUo7MWbtVG3BC78LZ12uiAS1SE=; b=ubz1IM/rwylbBzGpyvQtlibiVvsQTnnSHtANoAutmH9GV4f/7B/67feKx0UupxOcYL zam48VOvVSg10+b0MSynpwfwpxTRd4f1Ezqi/SCeb4CaGzUrzdWNb2uLlRrubSosMJH4 JjmEAIM+jaDfufl+d69CBARXK63Qzz2kWA7xPPo1eRz9qyrqHZKB6PEuXiYoY71QUyYJ Hz3CU49ML4vGY227I4iy0H5kQhkTA/vgshpEyF46SKQWYRlSKycWb2PFWclaG/kikxYY 6snJRustLFmr2Q4YF1uSmsRKBXXCswMKE/rqi2FD/EnT1C7TNrVNCPPN4jxpMBDEO1cu MYxw== X-Gm-Message-State: AJcUukc2I6jJhIitPcFeWvcynSNjL3WQrMQ9eDOoZwdhNFJMaYMTbpXW 28XHU5VaQNz+nGVOi5rWTAbzEUISCZ6RJ/0Vbg9jIA== X-Google-Smtp-Source: ALg8bN5lWRv1uXJgmldsa0ZMwTe9PlLrF/i3ORvT7ZJoYFemoWW/mOa0X/qSQgsEySZhzPgu4w2e+lp1cduAudG2DEk= X-Received: by 2002:ac8:42c1:: with SMTP id g1mr14016764qtm.118.1547772907060; Thu, 17 Jan 2019 16:55:07 -0800 (PST) MIME-Version: 1.0 References: <201901180048.x0I0mois052935@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901180048.x0I0mois052935@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Thu, 17 Jan 2019 17:54:56 -0700 Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: "Rodney W. Grimes" Cc: "Conrad E. Meyer" , Eugene Grosbein , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: AF2E78EDF1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 00:55:08 -0000 On Thu, Jan 17, 2019 at 5:48 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Thu, Jan 17, 2019 at 3:43 PM Conrad Meyer wrote: > > > > > On Thu, Jan 17, 2019 at 1:16 PM Eugene Grosbein > wrote: > > > > > > > > 18.01.2019 3:23, Conrad Meyer ?????: > > > > > > > > > Please back it out; stop attributing code review to "hackers@," > which > > > > > can not (it's a list, not individuals) and did not review this > > > > > changeset; and put it on phabricator for actual review. > > > > > > > > There is already https://reviews.freebsd.org/D18380 by imp > > > > and there were over 6 weeks since it had an update. > > > > Newly committed code has most of its changes. > > > > > > Your response does not address *any* of the above concerns. It's just > > > unrelated. > > > > > > > Yes. > > > > > > > The review you linked to isn't one you submitted for this change; it's > > > Warner's, and that one stalled because you were such a jerk to him > > > last time that he needed time off from you. > > > > > > > I abandoned it because dd is the better way to go because it can transfer > > images with 0's and TRIM the zero'd pages (and only the zero'd pages). > Sure > > dd is hard to use, but it's not that hard to use. > > I strongly disagree that dd is the proper place for this tool, > dd is far to easy a way to destroy data when trying to do this > type of operation and should be the last choice for implementing > what is normally a very safe thing to do. > > And as eugene points out dd can not easily be made > to do "trim ada0 ada1 ada4" which is probably the > far more common use of this command > for i in ada0 ada1 ada4; do dd of=/dev/$i if=/dev/zero conv=trim &; done; wait if that's your objection. It's a weak counter argument, but this really isn't the place for the debate. > dd's ability to do sparse(ing) of a file should NOT be > overloaded with a device layer block trimming function. > It's not overloaded. You have to specifically ask for the conversion. It's the right place for it. > > > > > > > If you want to socialize, revive, or expedite someone else's review, > > > maybe add a new comment to the review, or post a discussion hackers@, > > > or something like that. You still can't attribute code review to > > > hackers@, especially as no such review happened. > > > > > > > I think it should be backed out. Especially since it hijacks my work and > my > > name to try to ram it into the tree. > > > > I'm very much not amused. > > Nor am I with some of the reactoin to the commit :-( > I'm sorry, but I fire back when people abuse me. Especially when it's a repeat offender who clearly didn't internalize the feedback given the first time. Warner From owner-svn-src-head@freebsd.org Fri Jan 18 02:37:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3740B148A896; Fri, 18 Jan 2019 02:37:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B2386BF1E; Fri, 18 Jan 2019 02:37:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kK2BgPfKM82YckK2CgARKP; Thu, 17 Jan 2019 19:37:29 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=sohWm2Wet7b4VzDZGNkA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1C5FB380D; Thu, 17 Jan 2019 18:37:44 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0I2bPI6053196; Thu, 17 Jan 2019 18:37:25 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0I2bP5m053193; Thu, 17 Jan 2019 18:37:25 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901180237.x0I2bP5m053193@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Maxim Sobolev , Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from "Rodney W. Grimes" of "Thu, 17 Jan 2019 16:08:29 -0800." <201901180008.x0I08THg052763@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 Jan 2019 18:37:25 -0800 X-CMAE-Envelope: MS4wfPVfLNZCySeXRvKg8rEKd7XHBsCPGBwWYysn4D1SFD2c9PK5GJxidq+n1cgXWkUdQBly4G7GVlWsC71+1jpcvfUKBx9UMU6C9hQo/robIkVMiSVCrSvO yytqQLhx5047oN5GNBv+PLoC5dVNkVxdzAX1BSJNSO5KJHhpaYYajCvQ1jSzcNaNlIh+IzXaQtsqQ/i0V4aECAsQloYK3Dp6ifoN25lhJxfpqatiiUWdqNA/ 1dsEiOXicKLcjvW++N2PelZXWi+4D35ux+6XbJv/loVI68cpnFqdlnfyHSG1pR9YSrRHTij8mILqpU+UcyVgiNzAqXXzXAwbC9NWBJkF1C1nBcxhw6+Kib6Y NWCxADag X-Rspamd-Queue-Id: 6B2386BF1E X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.47 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-1.78)[ip: (-4.63), ipnet: 64.59.128.0/20(-2.37), asn: 6327(-1.83), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 02:37:33 -0000 In message <201901180008.x0I08THg052763@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > What I think we really need is some way to easily porti-ze useful stuff > > that would otherwise go into /usr/[s]bin, so adding things would be just as > > easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I know, this is > > topic almost as old as the FreeBSD Project itself, but perhaps we just did > > not approach it the right way. It was always the idea that we would just > > move bunch of stuff from src/usr.[s]bin repo into ports/. Which brings > > several important question such as "who is to host the distfile"? "where > > sources hosted", "who is to update the port when changes happen?" etc. > > > > Perhaps even by forking the whole ports idea into a smaller closely-guarged > > subset. Something like a new baseports repository, which might have > > structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy etc. Then add > > some automagic glue to kick in on every commit and transfer this into valid > > ports, which is going to be packaged by the poudriere and such. This way we > > could reduce amount of port-foo average src committer needs in order to > > maintain code. I am almost tempted to sit and write something over the next > > weekend or few of thereofs. Using usr.sbin/trim as an example. > > Couldnt the "distribution" just live as files commited into > the ports tree as a "work" hierarcy and the top level file > be marked as no fetch. We use to stick small stuff in ports > by putting there files in files/ and having that work IIRC. If it must live in one of our repositories, then a users, projects or other hierarchy in ports might be acceptable. However there would be too great a temptation to fork a random piece of software on the internet. baseports/usr.bin/whatever doesn't make much sense. If it's in ports it should use the ports infrastructure and install in $LOCALBASE. If it's in ports, it's not in base and should not be installed outside of $LOCALBASE. If it's to be installed in for instance, /usr/bin, then it must live in usr.bin. > > I really really dislike the idea of putting stuff from base in > external repositories and then fetching them, something just > feels fundementally wrong about that. Trim should not be in base/. If it's in ports it should be installed in $LOCALBASE not outside it. The point is, trim should not be in base. It should not live in /usr/src nor should it be installed outside of $LOCALBASE. If anything, as is it could be a port. It should not live in a user or project branch of base nor should it be sourced out of some hypothetical quasi FreeBSD source repository in ports or any other FreeBSD repo for that matter. It doesn't belong here at all. It's function can however be provided by dd. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Jan 18 02:41:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85136148AA80; Fri, 18 Jan 2019 02:41:09 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 824426C279; Fri, 18 Jan 2019 02:41:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kK5hgPgqN82YckK5jgARqO; Thu, 17 Jan 2019 19:41:07 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VC6dibHgwd1Umev_L9gA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 0618A382A; Thu, 17 Jan 2019 18:41:23 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0I2f515057062; Thu, 17 Jan 2019 18:41:05 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0I2f5wO057051; Thu, 17 Jan 2019 18:41:05 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901180241.x0I2f5wO057051@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Enji Cooper cc: Maxim Sobolev , Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from Enji Cooper of "Thu, 17 Jan 2019 14:42:04 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 Jan 2019 18:41:05 -0800 X-CMAE-Envelope: MS4wfFC3kqow5XAF1uflEJ7j44LDb4dyYbIK3puaDxQxYfQU1HpFyQIHO9p2lhr33hgJYGVQ69wMfiMDJT0yjjIveOyO9ZUwN+HCy78ROHCffewwioOL1SAg QqhS9wblrIQHJk8en3/YgnR6CY0nTa2EGho847s7QfzwMJ/+kxzuvrSUqJuWPMvPxt3YLaOzeoVPC802QOJBBNSEqVeQAGPrrpiXPtamL//1GDucfSe5WmiX 1+q6qOjgsnMAMg+t9hjF/uT0gdzvZYgHg4OIj53k3eh5mI3sRUA4U1MrRTcaQsrnBhVTzWcGyytesoN322uHvdnOrqUPlZR8KPtFceFk8FmQw0bJkZ1UNX2Q RPtKf7rK X-Rspamd-Queue-Id: 824426C279 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.45 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-1.76)[ip: (-4.54), ipnet: 64.59.128.0/20(-2.36), asn: 6327(-1.82), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 02:41:09 -0000 In message , Enji Cooper writes : > > > --Apple-Mail=_6CB1620B-6707-4F06-B7FF-9F1ECBA36F56 > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=utf-8 > > > > On Jan 17, 2019, at 2:25 PM, Maxim Sobolev = > wrote: > >=20 > > What I think we really need is some way to easily porti-ze useful = > stuff that would otherwise go into /usr/[s]bin, so adding things would = > be just as easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I = > know, this is topic almost as old as the FreeBSD Project itself, but = > perhaps we just did not approach it the right way. It was always the = > idea that we would just move bunch of stuff from src/usr.[s]bin repo = > into ports/. Which brings several important question such as "who is to = > host the distfile"? "where sources hosted", "who is to update the port = > when changes happen?" etc. > > Projects like this could be hosted on GitHub. Ports supports GitHub out = > of the box, so this seems like a low barrier for entry (the bonus of = > doing this is that the projects could potentially be used by other = > non-FreeBSD projects, and contributed by others outside the FreeBSD = > project; the downside is having to deal with FreeBSD CI, as Travis CI = > only supports Linux (IIRC making Travis support FreeBSD is a non-trivial = > project, but it=E2=80=99s likely a very worthwhile goal, as it would = > make it easier to catch issues upfront with third-party projects that = > FreeBSD consumes, like llvm), enforcing style (can be done with git = > commit hooks and GitHub checks), etc. I would really like to do these = > things because it=E2=80=99s difficult getting folks to support FreeBSD = > in third-party projects as-is. Lowering the barrier of entry would allow = > FreeBSD and its developers to better scale (and make FreeBSD more of a = > first-class OS). Yes. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Jan 18 02:53:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB556148B17D; Fri, 18 Jan 2019 02:53:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 44AC96C92C; Fri, 18 Jan 2019 02:53:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kKHOgPlxo82YckKHQgATR2; Thu, 17 Jan 2019 19:53:12 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=1grL2wql0I3dgmcLu_sA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2FB58386A; Thu, 17 Jan 2019 18:53:27 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0I2r9UZ068960; Thu, 17 Jan 2019 18:53:09 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0I2r9Jw068957; Thu, 17 Jan 2019 18:53:09 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901180253.x0I2r9Jw068957@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Maxim Sobolev cc: Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from Maxim Sobolev of "Thu, 17 Jan 2019 14:25:07 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 Jan 2019 18:53:09 -0800 X-CMAE-Envelope: MS4wfE7+i2sgIC4R673SOybF69mufQnDz1SrepRnQwaWwrZ04mE2eHZ8JGvG4zgfCEeUhaAG6FDugO0PoGrnNdsLPAcqm1zYfTLTbpDKnAY3lCMtqgNUjjal 0XF3GJTglytaAFuNv6Dama33rs2DrGo3poNAgNLqDTacXxJ35g1OkrapwOp1RiZlMmdznFck/1Johk8CxvYbklKEMMFeYqOe2kOTUlcPw2orW4pcdqlo5S+3 w1RwDGpgszBjA381qKAoeuQVhFzBR1N2yAd9U3vysBEB9fBSTjnJRRjvCrO0O41KskP0f3swsXPgRSFMXv7J8w== X-Rspamd-Queue-Id: 44AC96C92C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-1.63)[ip: (-3.89), ipnet: 64.59.128.0/20(-2.35), asn: 6327(-1.81), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 02:53:15 -0000 In message , Maxim Sobolev writes: > > What I think we really need is some way to easily porti-ze useful stuff > that would otherwise go into /usr/[s]bin, so adding things would be just as > easy as hooking up SUBDIR into usr.[s]bin/Makefile. Yes, I know, this is > topic almost as old as the FreeBSD Project itself, but perhaps we just did > not approach it the right way. It was always the idea that we would just > move bunch of stuff from src/usr.[s]bin repo into ports/. Which brings > several important question such as "who is to host the distfile"? "where > sources hosted", "who is to update the port when changes happen?" etc. pkgbase might address some of the above. Ports and base might install in a homogeneous manner. > > Perhaps even by forking the whole ports idea into a smaller closely-guarged > subset. Something like a new baseports repository, which might have > structure like baseports/usr.bin/xxx, baseports/usr.sbin/yyy etc. Then add > some automagic glue to kick in on every commit and transfer this into valid > ports, which is going to be packaged by the poudriere and such. This way we > could reduce amount of port-foo average src committer needs in order to > maintain code. I am almost tempted to sit and write something over the next > weekend or few of thereofs. Using usr.sbin/trim as an example. If it's external it should should live in ports and be installed in $LOCALBASE. A quasi src repo in ports to install software outside of $LOCALBASE doesn't make any sense. ALso see my comment about pkgbase. I expect pkgbase to homogenize base and ports into a seamless install. Alternatively pkgbase and ports could use different package repos. For example when I was an MVS sysprog, MVS and JES were installed in one repo while CICS and IMS were installed each in their own repos. That was site specific but not out of the realm of possibilities here either. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Jan 18 04:23:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23129148E34F; Fri, 18 Jan 2019 04:23:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE5EB74F27; Fri, 18 Jan 2019 04:23:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC3C24FB5; Fri, 18 Jan 2019 04:23:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0I4NqOq098903; Fri, 18 Jan 2019 04:23:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0I4NqL9098902; Fri, 18 Jan 2019 04:23:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901180423.x0I4NqL9098902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 18 Jan 2019 04:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343129 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 343129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE5EB74F27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 04:23:53 -0000 Author: gonzo Date: Fri Jan 18 04:23:52 2019 New Revision: 343129 URL: https://svnweb.freebsd.org/changeset/base/343129 Log: [ata] Add workaround for KingDian S200 SSD crash on receiving TRIM command - Add ADA_Q_NO_TRIM quirk to be used with the device that falsely advertise TRIM support - Add ADA_Q_NO_TRIM entry for KingDian S200 SSD PR: 222802 Submitted by: Bertrand Petit MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Jan 18 00:39:17 2019 (r343128) +++ head/sys/cam/ata/ata_da.c Fri Jan 18 04:23:52 2019 (r343129) @@ -118,7 +118,8 @@ typedef enum { ADA_Q_4K = 0x01, ADA_Q_NCQ_TRIM_BROKEN = 0x02, ADA_Q_LOG_BROKEN = 0x04, - ADA_Q_SMR_DM = 0x08 + ADA_Q_SMR_DM = 0x08, + ADA_Q_NO_TRIM = 0x10 } ada_quirks; #define ADA_Q_BIT_STRING \ @@ -126,7 +127,8 @@ typedef enum { "\0014K" \ "\002NCQ_TRIM_BROKEN" \ "\003LOG_BROKEN" \ - "\004SMR_DM" + "\004SMR_DM" \ + "\005NO_TRIM" typedef enum { ADA_CCB_RAHEAD = 0x01, @@ -543,6 +545,14 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* + * KingDian S200 60GB P0921B + * Trimming crash the SSD + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KingDian S200 *", "*" }, + /*quirks*/ADA_Q_NO_TRIM + }, + { + /* * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -1810,6 +1820,10 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + /* Device lies about TRIM capability. */ + if ((softc->quirks & ADA_Q_NO_TRIM) && + (softc->flags & ADA_FLAG_CAN_TRIM)) + softc->flags &= ~ADA_FLAG_CAN_TRIM; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; softc->disk->d_delmaxsize = softc->params.secsize * From owner-svn-src-head@freebsd.org Fri Jan 18 08:19:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D3BA149350A; Fri, 18 Jan 2019 08:19:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A91AC82D08; Fri, 18 Jan 2019 08:19:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA8C2767A; Fri, 18 Jan 2019 08:19:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0I8JsMv018874; Fri, 18 Jan 2019 08:19:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0I8Jski018873; Fri, 18 Jan 2019 08:19:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901180819.x0I8Jski018873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 18 Jan 2019 08:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343130 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A91AC82D08 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 08:19:55 -0000 Author: kp Date: Fri Jan 18 08:19:54 2019 New Revision: 343130 URL: https://svnweb.freebsd.org/changeset/base/343130 Log: pf: fix pfsync breaking carp Fix missing initialisation of sc_flags into a valid sync state on clone which breaks carp in pfsync. This regression was introduce by r342051. PR: 235005 Submitted by: smh@FreeBSD.org Pointy hat to: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18882 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Jan 18 04:23:52 2019 (r343129) +++ head/sys/netpfil/pf/if_pfsync.c Fri Jan 18 08:19:54 2019 (r343130) @@ -335,6 +335,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit, ca pfsync_buckets = mp_ncpus * 2; sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | M_ZERO); + sc->sc_flags |= PFSYNCF_OK; sc->sc_maxupdates = 128; ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); From owner-svn-src-head@freebsd.org Fri Jan 18 08:58:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0A2914947C8; Fri, 18 Jan 2019 08:58:13 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 536C884A2F; Fri, 18 Jan 2019 08:58:13 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0I8w1u0085847 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Jan 2019 09:58:04 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: cem@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0I8vxsX064930 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 15:58:00 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: cem@freebsd.org References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: Date: Fri, 18 Jan 2019 15:57:54 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 536C884A2F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 08:58:14 -0000 18.01.2019 4:45, Conrad Meyer wrote: >>> Please back it out; stop attributing code review to "hackers@," which >>> can not (it's a list, not individuals) and did not review this >>> changeset; and put it on phabricator for actual review. >> >> There is already https://reviews.freebsd.org/D18380 by imp >> and there were over 6 weeks since it had an update. >> Newly committed code has most of its changes. > > Your response does not address *any* of the above concerns. It's just > unrelated. > > The review you linked to isn't one you submitted for this change; This is a review still. > it's Warner's, and that one stalled because you were such a jerk to him This is not true. > last time that he needed time off from you. Please do not speak for him. > If you want to socialize, revive, or expedite someone else's review, > maybe add a new comment to the review, I did. > or post a discussion hackers@, I did. > or something like that. You still can't attribute code review to > hackers@, especially as no such review happened. It happened a week before I make first commit, in a way. I cannot make people do a review if they do not want to review. And we still had no utility to do the job. From owner-svn-src-head@freebsd.org Fri Jan 18 09:00:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 658781494B42; Fri, 18 Jan 2019 09:00:07 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DE59584DD6; Fri, 18 Jan 2019 09:00:06 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0I8xrZt085873 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Jan 2019 09:59:54 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0I8xr0T064953 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 15:59:53 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Warner Losh , "Rodney W. Grimes" References: <201901180048.x0I0mois052935@pdx.rh.CN85.dnsmgr.net> Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: Date: Fri, 18 Jan 2019 15:59:47 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: DE59584DD6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 09:00:07 -0000 18.01.2019 7:54, Warner Losh wrote: > On Thu, Jan 17, 2019 at 5:48 PM Rodney W. Grimes > wrote: > > I'm sorry, but I fire back when people abuse me. Sorry, I did not mean to. And I still do not understand how do I abuse you now. From owner-svn-src-head@freebsd.org Fri Jan 18 09:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 318791494E3C; Fri, 18 Jan 2019 09:06:06 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AB37285487; Fri, 18 Jan 2019 09:06:05 +0000 (UTC) (envelope-from eugen@freebsd.org) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0I95wsP085978 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Jan 2019 10:05:59 +0100 (CET) (envelope-from eugen@freebsd.org) X-Envelope-From: eugen@freebsd.org X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0I95vTP065002 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 16:05:57 +0700 (+07) (envelope-from eugen@freebsd.org) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Warner Losh References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <4b204e03-48fd-07ae-45ae-70c5e03442c2@freebsd.org> Date: Fri, 18 Jan 2019 16:05:52 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: AB37285487 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 09:06:06 -0000 18.01.2019 7:39, Warner Losh wrote: > You hijacked that review. Don't you dare use it as evidence of consent to the sh*t you just pulled. > > Back it out, do a proper review. This one was not proper, nor was it complete. Don't go using my name to support a program I've come to think is a really bad idea. I do not see how I "hijacked" it this time. And I do not understand how another review would help as there is clearly no one wishing to review the code anymore. I really hope this is not some kind of bureaucracy or cargo cult for sake of formal procedures but mis-understanding at my side. Please explain. From owner-svn-src-head@freebsd.org Fri Jan 18 09:17:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6509514951DD; Fri, 18 Jan 2019 09:17:23 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D246085B48; Fri, 18 Jan 2019 09:17:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0I9HA6d086105 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Jan 2019 10:17:11 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: sobomax@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x0I9HAXe065048 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 18 Jan 2019 16:17:10 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Maxim Sobolev , Cy Schubert References: <201901172046.x0HKkvWs011502@slippy.cwsent.com> Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein.net> Date: Fri, 18 Jan 2019 16:17:04 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: D246085B48 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 09:17:23 -0000 18.01.2019 5:25, Maxim Sobolev wrote: > Using usr.sbin/trim as an example. We still lack a command usable at installation stage (escape to shell) to trim a device or partition dedicated to ZFS Cache/ZFS Intention Log/zvol any other use when ports/packages are not yet available. From owner-svn-src-head@freebsd.org Fri Jan 18 10:31:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC066149736B; Fri, 18 Jan 2019 10:31:39 +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 173E688B36; Fri, 18 Jan 2019 10:31:39 +0000 (UTC) (envelope-from des@des.no) Received: from next.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 2408723FD1; Fri, 18 Jan 2019 10:31:38 +0000 (UTC) Received: by next.des.no (Postfix, from userid 1001) id DEAA18464; Fri, 18 Jan 2019 11:31:38 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI Cc: Ed Maste , "src-committers\@freebsd.org" , "svn-src-all\@freebsd.org" , "svn-src-head\@freebsd.org" Subject: Re: svn commit: r343122 - head/usr.sbin/freebsd-update In-Reply-To: (Xin LI's message of "Thu, 17 Jan 2019 13:46:27 -0800") References: <201901172138.x0HLcwBp082954@repo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix) Date: Fri, 18 Jan 2019 11:31:38 +0100 Message-ID: <86won22r5h.fsf@next.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 173E688B36 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of des@des.no designates 194.63.250.102 as permitted sender) smtp.mailfrom=des@des.no X-Spamd-Result: default: False [-6.26 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[des.no]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: smtp.des.no]; NEURAL_HAM_SHORT(-0.77)[-0.768,0]; IP_SCORE(-3.28)[ip: (-8.67), ipnet: 194.63.250.0/24(-4.33), asn: 12996(-3.39), country: NO(-0.01)]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12996, ipnet:194.63.250.0/24, country:NO]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 10:31:40 -0000 Xin LI writes: > I think this would break upgrading from e.g. -BETA or -RC, which is suppo= rted? Upgrading from -ALPHA is also supported. Furthermore, expr(1) is a better way of handling this than echo | grep, even if it only supports basic REs; they are sufficient for this purpose. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Fri Jan 18 10:45:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F1B71497A76; Fri, 18 Jan 2019 10:45:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E16F89519; Fri, 18 Jan 2019 10:45:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66CA91014; Fri, 18 Jan 2019 10:45:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IAjSGE097379; Fri, 18 Jan 2019 10:45:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IAjSmw097377; Fri, 18 Jan 2019 10:45:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901181045.x0IAjSmw097377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Jan 2019 10:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343143 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 343143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E16F89519 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 10:45:29 -0000 Author: kib Date: Fri Jan 18 10:45:27 2019 New Revision: 343143 URL: https://svnweb.freebsd.org/changeset/base/343143 Log: nvdimm: add a driver for the NVDIMM root device The NVDIMM root device is parent to the individual ACPI NVDIMM devices. Add a driver for the NVDIMM root device that can own enumeration of NVDIMM devices as well as NVDIMM SPA ranges that the system has. Submitted by: D Scott Phillips Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18346 Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Jan 18 09:57:03 2019 (r343142) +++ head/sys/dev/nvdimm/nvdimm.c Fri Jan 18 10:45:27 2019 (r343143) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -51,28 +52,27 @@ __FBSDID("$FreeBSD$"); ACPI_MODULE_NAME("NVDIMM") static devclass_t nvdimm_devclass; -static device_t *nvdimm_devs; -static int nvdimm_devcnt; +static devclass_t nvdimm_root_devclass; MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); struct nvdimm_dev * nvdimm_find_by_handle(nfit_handle_t nv_handle) { - device_t dev; - struct nvdimm_dev *res, *nv; - int i; + struct nvdimm_dev *res; + device_t *dimms; + int i, error, num_dimms; res = NULL; - for (i = 0; i < nvdimm_devcnt; i++) { - dev = nvdimm_devs[i]; - if (dev == NULL) - continue; - nv = device_get_softc(dev); - if (nv->nv_handle == nv_handle) { - res = nv; + error = devclass_get_devices(nvdimm_devclass, &dimms, &num_dimms); + if (error != 0) + return (NULL); + for (i = 0; i < num_dimms; i++) { + if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) { + res = device_get_softc(dimms[i]); break; } } + free(dimms, M_TEMP); return (res); } @@ -89,8 +89,8 @@ nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg) return (0); MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0); - nv->nv_flush_addr = malloc(nfitflshaddr->HintCount * sizeof(uint64_t *), - M_NVDIMM, M_WAITOK); + nv->nv_flush_addr = mallocarray(nfitflshaddr->HintCount, + sizeof(uint64_t *), M_NVDIMM, M_WAITOK); for (i = 0; i < nfitflshaddr->HintCount; i++) nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i]; nv->nv_flush_addr_cnt = nfitflshaddr->HintCount; @@ -169,206 +169,166 @@ nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum Acpi return (error); } -static ACPI_STATUS -nvdimm_walk_dev(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +static int +nvdimm_probe(device_t dev) { - ACPI_STATUS status; - struct nvdimm_ns_walk_ctx *wctx; - wctx = ctx; - status = wctx->func(handle, wctx->arg); - return_ACPI_STATUS(status); + return (BUS_PROBE_NOWILDCARD); } -static ACPI_STATUS -nvdimm_walk_root(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +static int +nvdimm_attach(device_t dev) { + struct nvdimm_dev *nv; + ACPI_TABLE_NFIT *nfitbl; + ACPI_HANDLE handle; ACPI_STATUS status; - if (!acpi_MatchHid(handle, "ACPI0012")) - return_ACPI_STATUS(AE_OK); - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 100, - nvdimm_walk_dev, NULL, ctx, NULL); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - return_ACPI_STATUS(AE_CTRL_TERMINATE); + nv = device_get_softc(dev); + handle = nvdimm_root_get_acpi_handle(dev); + if (handle == NULL) + return (EINVAL); + nv->nv_dev = dev; + nv->nv_handle = nvdimm_root_get_device_handle(dev); + + status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); + if (ACPI_FAILURE(status)) { + if (bootverbose) + device_printf(dev, "cannot get NFIT\n"); + return (ENXIO); + } + nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, + nvdimm_parse_flush_addr, nv); + AcpiPutTable(&nfitbl->Header); + return (0); } -static ACPI_STATUS -nvdimm_foreach_acpi(ACPI_STATUS (*func)(ACPI_HANDLE, void *), void *arg) +static int +nvdimm_detach(device_t dev) { - struct nvdimm_ns_walk_ctx wctx; - ACPI_STATUS status; + struct nvdimm_dev *nv; - wctx.func = func; - wctx.arg = arg; - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 100, - nvdimm_walk_root, NULL, &wctx, NULL); - return_ACPI_STATUS(status); + nv = device_get_softc(dev); + free(nv->nv_flush_addr, M_NVDIMM); + return (0); } -static ACPI_STATUS -nvdimm_count_devs(ACPI_HANDLE handle __unused, void *arg) +static int +nvdimm_suspend(device_t dev) { - int *cnt; - cnt = arg; - (*cnt)++; + return (0); +} - ACPI_BUFFER name; - ACPI_STATUS status; - if (bootverbose) { - name.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiGetName(handle, ACPI_FULL_PATHNAME, &name); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(status); - printf("nvdimm: enumerated %s\n", (char *)name.Pointer); - AcpiOsFree(name.Pointer); - } +static int +nvdimm_resume(device_t dev) +{ - return_ACPI_STATUS(AE_OK); + return (0); } -struct nvdimm_create_dev_arg { - device_t acpi0; - int *cnt; -}; - static ACPI_STATUS -nvdimm_create_dev(ACPI_HANDLE handle, void *arg) +nvdimm_root_create_dev(ACPI_HANDLE handle, UINT32 nesting_level, void *context, + void **return_value) { - struct nvdimm_create_dev_arg *narg; - device_t child; - int idx; + ACPI_STATUS status; + ACPI_DEVICE_INFO *device_info; + device_t parent, child; + uintptr_t *ivars; - narg = arg; - idx = *(narg->cnt); - child = device_find_child(narg->acpi0, "nvdimm", idx); - if (child == NULL) - child = BUS_ADD_CHILD(narg->acpi0, 1, "nvdimm", idx); + parent = context; + child = BUS_ADD_CHILD(parent, 100, "nvdimm", -1); if (child == NULL) { - if (bootverbose) - device_printf(narg->acpi0, - "failed to create nvdimm%d\n", idx); + device_printf(parent, "failed to create nvdimm\n"); return_ACPI_STATUS(AE_ERROR); } - acpi_set_handle(child, handle); - KASSERT(nvdimm_devs[idx] == NULL, ("nvdimm_devs[%d] not NULL", idx)); - nvdimm_devs[idx] = child; - - (*(narg->cnt))++; - return_ACPI_STATUS(AE_OK); -} - -static bool -nvdimm_init(void) -{ - ACPI_STATUS status; - - if (nvdimm_devcnt != 0) - return (true); - if (acpi_disabled("nvdimm")) - return (false); - status = nvdimm_foreach_acpi(nvdimm_count_devs, &nvdimm_devcnt); + status = AcpiGetObjectInfo(handle, &device_info); if (ACPI_FAILURE(status)) { - if (bootverbose) - printf("nvdimm_init: count failed\n"); - return (false); + device_printf(parent, "failed to get nvdimm device info\n"); + return_ACPI_STATUS(AE_ERROR); } - nvdimm_devs = malloc(nvdimm_devcnt * sizeof(device_t), M_NVDIMM, - M_WAITOK | M_ZERO); - return (true); + ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX - 1, sizeof(uintptr_t), + M_NVDIMM, M_ZERO | M_WAITOK); + device_set_ivars(child, ivars); + nvdimm_root_set_acpi_handle(child, handle); + nvdimm_root_set_device_handle(child, device_info->Address); + return_ACPI_STATUS(AE_OK); } -static void -nvdimm_identify(driver_t *driver, device_t parent) -{ - struct nvdimm_create_dev_arg narg; - ACPI_STATUS status; - int i; +static char *nvdimm_root_id[] = {"ACPI0012", NULL}; - if (!nvdimm_init()) - return; - narg.acpi0 = parent; - narg.cnt = &i; - i = 0; - status = nvdimm_foreach_acpi(nvdimm_create_dev, &narg); - if (ACPI_FAILURE(status) && bootverbose) - printf("nvdimm_identify: create failed\n"); -} - static int -nvdimm_probe(device_t dev) +nvdimm_root_probe(device_t dev) { + int rv; - return (BUS_PROBE_NOWILDCARD); + if (acpi_disabled("nvdimm")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, nvdimm_root_id, NULL); + if (rv <= 0) + device_set_desc(dev, "ACPI NVDIMM root device"); + + return (rv); } static int -nvdimm_attach(device_t dev) +nvdimm_root_attach(device_t dev) { - struct nvdimm_dev *nv; - ACPI_TABLE_NFIT *nfitbl; ACPI_HANDLE handle; ACPI_STATUS status; - int i; + int error; - nv = device_get_softc(dev); handle = acpi_get_handle(dev); - if (handle == NULL) - return (EINVAL); - nv->nv_dev = dev; - for (i = 0; i < nvdimm_devcnt; i++) { - if (nvdimm_devs[i] == dev) { - nv->nv_devs_idx = i; - break; - } - } - MPASS(i < nvdimm_devcnt); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &nv->nv_handle))) { - device_printf(dev, "cannot get handle\n"); - return (ENXIO); - } - - status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); - if (ACPI_FAILURE(status)) { - if (bootverbose) - device_printf(dev, "cannot get NFIT\n"); - return (ENXIO); - } - nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, - nvdimm_parse_flush_addr, nv); - AcpiPutTable(&nfitbl->Header); - return (0); + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1, + nvdimm_root_create_dev, NULL, dev, NULL); + if (ACPI_FAILURE(status)) + device_printf(dev, "failed adding children\n"); + error = bus_generic_attach(dev); + return (error); } static int -nvdimm_detach(device_t dev) +nvdimm_root_detach(device_t dev) { - struct nvdimm_dev *nv; + device_t *children; + int i, error, num_children; - nv = device_get_softc(dev); - nvdimm_devs[nv->nv_devs_idx] = NULL; - free(nv->nv_flush_addr, M_NVDIMM); - return (0); + error = bus_generic_detach(dev); + if (error != 0) + return (error); + error = device_get_children(dev, &children, &num_children); + if (error != 0) + return (error); + for (i = 0; i < num_children; i++) + free(device_get_ivars(children[i]), M_NVDIMM); + free(children, M_TEMP); + error = device_delete_children(dev); + return (error); } static int -nvdimm_suspend(device_t dev) +nvdimm_root_read_ivar(device_t dev, device_t child, int index, + uintptr_t *result) { + if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) + return (ENOENT); + *result = ((uintptr_t *)device_get_ivars(child))[index]; return (0); } static int -nvdimm_resume(device_t dev) +nvdimm_root_write_ivar(device_t dev, device_t child, int index, + uintptr_t value) { + if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) + return (ENOENT); + ((uintptr_t *)device_get_ivars(child))[index] = value; return (0); } static device_method_t nvdimm_methods[] = { - DEVMETHOD(device_identify, nvdimm_identify), DEVMETHOD(device_probe, nvdimm_probe), DEVMETHOD(device_attach, nvdimm_attach), DEVMETHOD(device_detach, nvdimm_detach), @@ -383,41 +343,22 @@ static driver_t nvdimm_driver = { sizeof(struct nvdimm_dev), }; -static void -nvdimm_fini(void) -{ +static device_method_t nvdimm_root_methods[] = { + DEVMETHOD(device_probe, nvdimm_root_probe), + DEVMETHOD(device_attach, nvdimm_root_attach), + DEVMETHOD(device_detach, nvdimm_root_detach), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), + DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), + DEVMETHOD_END +}; - free(nvdimm_devs, M_NVDIMM); - nvdimm_devs = NULL; - nvdimm_devcnt = 0; -} +static driver_t nvdimm_root_driver = { + "nvdimm_root", + nvdimm_root_methods, +}; -static int -nvdimm_modev(struct module *mod, int what, void *arg) -{ - int error; - - switch (what) { - case MOD_LOAD: - error = 0; - break; - - case MOD_UNLOAD: - nvdimm_fini(); - error = 0; - break; - - case MOD_QUIESCE: - error = 0; - break; - - default: - error = EOPNOTSUPP; - break; - } - - return (error); -} - -DRIVER_MODULE(nvdimm, acpi, nvdimm_driver, nvdimm_devclass, nvdimm_modev, NULL); +DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, NULL, + NULL); +DRIVER_MODULE(nvdimm, nvdimm_root, nvdimm_driver, nvdimm_devclass, NULL, NULL); MODULE_DEPEND(nvdimm, acpi, 1, 1, 1); Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Jan 18 09:57:03 2019 (r343142) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Jan 18 10:45:27 2019 (r343143) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -34,12 +35,20 @@ typedef uint32_t nfit_handle_t; +enum nvdimm_root_ivar { + NVDIMM_ROOT_IVAR_ACPI_HANDLE, + NVDIMM_ROOT_IVAR_DEVICE_HANDLE, + NVDIMM_ROOT_IVAR_MAX, +}; +__BUS_ACCESSOR(nvdimm_root, acpi_handle, NVDIMM_ROOT, ACPI_HANDLE, ACPI_HANDLE) +__BUS_ACCESSOR(nvdimm_root, device_handle, NVDIMM_ROOT, DEVICE_HANDLE, + nfit_handle_t) + struct nvdimm_dev { device_t nv_dev; nfit_handle_t nv_handle; uint64_t **nv_flush_addr; int nv_flush_addr_cnt; - int nv_devs_idx; }; enum SPA_mapping_type { @@ -72,11 +81,6 @@ struct SPA_mapping { struct vm_object *spa_obj; bool spa_g_proc_run; bool spa_g_proc_exiting; -}; - -struct nvdimm_ns_walk_ctx { - ACPI_STATUS (*func)(ACPI_HANDLE, void *); - void *arg; }; extern struct SPA_mapping *spa_mappings; From owner-svn-src-head@freebsd.org Fri Jan 18 10:54:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 859711497E31; Fri, 18 Jan 2019 10:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2388889AC5; Fri, 18 Jan 2019 10:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8A0B11D4; Fri, 18 Jan 2019 10:54:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IAsaZo002454; Fri, 18 Jan 2019 10:54:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IAsaM5002453; Fri, 18 Jan 2019 10:54:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901181054.x0IAsaM5002453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Jan 2019 10:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343144 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 343144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2388889AC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 10:54:37 -0000 Author: kib Date: Fri Jan 18 10:54:36 2019 New Revision: 343144 URL: https://svnweb.freebsd.org/changeset/base/343144 Log: nvdimm: initialize SPA uuids statically. The SPA ids are published numbers, so it's safe (if not a bit annoying) to copy them into a source file. Submitted by: D Scott Phillips Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18733 Modified: head/sys/dev/nvdimm/nvdimm_spa.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Fri Jan 18 10:45:27 2019 (r343143) +++ head/sys/dev/nvdimm/nvdimm_spa.c Fri Jan 18 10:54:36 2019 (r343144) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. + * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -64,6 +65,23 @@ __FBSDID("$FreeBSD$"); #include #include +#define UUID_INITIALIZER_VOLATILE_MEMORY \ + {0x7305944f,0xfdda,0x44e3,0xb1,0x6c,{0x3f,0x22,0xd2,0x52,0xe5,0xd0}} +#define UUID_INITIALIZER_PERSISTENT_MEMORY \ + {0x66f0d379,0xb4f3,0x4074,0xac,0x43,{0x0d,0x33,0x18,0xb7,0x8c,0xdb}} +#define UUID_INITIALIZER_CONTROL_REGION \ + {0x92f701f6,0x13b4,0x405d,0x91,0x0b,{0x29,0x93,0x67,0xe8,0x23,0x4c}} +#define UUID_INITIALIZER_DATA_REGION \ + {0x91af0530,0x5d86,0x470e,0xa6,0xb0,{0x0a,0x2d,0xb9,0x40,0x82,0x49}} +#define UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK \ + {0x77ab535a,0x45fc,0x624b,0x55,0x60,{0xf7,0xb2,0x81,0xd1,0xf9,0x6e}} +#define UUID_INITIALIZER_VOLATILE_VIRTUAL_CD \ + {0x3d5abd30,0x4175,0x87ce,0x6d,0x64,{0xd2,0xad,0xe5,0x23,0xc4,0xbb}} +#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK \ + {0x5cea02c9,0x4d07,0x69d3,0x26,0x9f,{0x44,0x96,0xfb,0xe0,0x96,0xf9}} +#define UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD \ + {0x08018188,0x42cd,0xbb48,0x10,0x0f,{0x53,0x87,0xd5,0x3d,0xed,0x3d}} + struct SPA_mapping *spa_mappings; int spa_mappings_cnt; @@ -79,52 +97,64 @@ nvdimm_spa_count(void *nfitsubtbl __unused, void *arg) static struct nvdimm_SPA_uuid_list_elm { const char *u_name; - const char *u_id_str; struct uuid u_id; const bool u_usr_acc; } nvdimm_SPA_uuid_list[] = { [SPA_TYPE_VOLATILE_MEMORY] = { .u_name = "VOLA MEM ", - .u_id_str = UUID_VOLATILE_MEMORY, + .u_id = UUID_INITIALIZER_VOLATILE_MEMORY, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_MEMORY] = { .u_name = "PERS MEM", - .u_id_str = UUID_PERSISTENT_MEMORY, + .u_id = UUID_INITIALIZER_PERSISTENT_MEMORY, .u_usr_acc = true, }, [SPA_TYPE_CONTROL_REGION] = { .u_name = "CTRL RG ", - .u_id_str = UUID_CONTROL_REGION, + .u_id = UUID_INITIALIZER_CONTROL_REGION, .u_usr_acc = false, }, [SPA_TYPE_DATA_REGION] = { .u_name = "DATA RG ", - .u_id_str = UUID_DATA_REGION, + .u_id = UUID_INITIALIZER_DATA_REGION, .u_usr_acc = true, }, [SPA_TYPE_VOLATILE_VIRTUAL_DISK] = { .u_name = "VIRT DSK", - .u_id_str = UUID_VOLATILE_VIRTUAL_DISK, + .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_DISK, .u_usr_acc = true, }, [SPA_TYPE_VOLATILE_VIRTUAL_CD] = { .u_name = "VIRT CD ", - .u_id_str = UUID_VOLATILE_VIRTUAL_CD, + .u_id = UUID_INITIALIZER_VOLATILE_VIRTUAL_CD, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_VIRTUAL_DISK] = { .u_name = "PV DSK ", - .u_id_str = UUID_PERSISTENT_VIRTUAL_DISK, + .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_DISK, .u_usr_acc = true, }, [SPA_TYPE_PERSISTENT_VIRTUAL_CD] = { .u_name = "PV CD ", - .u_id_str = UUID_PERSISTENT_VIRTUAL_CD, + .u_id = UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD, .u_usr_acc = true, }, }; +enum SPA_mapping_type +nvdimm_spa_type_from_uuid(struct uuid *uuid) +{ + int j; + + for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { + if (uuidcmp(uuid, &nvdimm_SPA_uuid_list[j].u_id) != 0) + continue; + return (j); + } + return (SPA_TYPE_UNKNOWN); +} + static vm_memattr_t nvdimm_spa_memattr(struct SPA_mapping *spa) { @@ -539,48 +569,30 @@ nvdimm_spa_parse(void *nfitsubtbl, void *arg) { ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; struct SPA_mapping *spa; - int error, *i, j; + enum SPA_mapping_type spa_type; + int error, *i; i = arg; - spa = &spa_mappings[*i]; + spa = &spa_mappings[(*i)++]; nfitaddr = nfitsubtbl; - - for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { - /* XXXKIB: is ACPI UUID representation compatible ? */ - if (uuidcmp((struct uuid *)&nfitaddr->RangeGuid, - &nvdimm_SPA_uuid_list[j].u_id) != 0) - continue; - error = nvdimm_spa_init_one(spa, nfitaddr, j); - if (error != 0) - nvdimm_spa_fini_one(spa); - break; - } - if (j == nitems(nvdimm_SPA_uuid_list) && bootverbose) { + spa_type = nvdimm_spa_type_from_uuid( + (struct uuid *)&nfitaddr->RangeGuid); + if (spa_type == SPA_TYPE_UNKNOWN) { printf("Unknown SPA UUID %d ", nfitaddr->RangeIndex); printf_uuid((struct uuid *)&nfitaddr->RangeGuid); printf("\n"); + return (0); } - (*i)++; + error = nvdimm_spa_init_one(spa, nfitaddr, spa_type); + if (error != 0) + nvdimm_spa_fini_one(spa); return (0); } static int nvdimm_spa_init1(ACPI_TABLE_NFIT *nfitbl) { - struct nvdimm_SPA_uuid_list_elm *sle; int error, i; - - for (i = 0; i < nitems(nvdimm_SPA_uuid_list); i++) { - sle = &nvdimm_SPA_uuid_list[i]; - error = parse_uuid(sle->u_id_str, &sle->u_id); - if (error != 0) { - if (bootverbose) - printf("nvdimm_identify: error %d parsing " - "known SPA UUID %d %s\n", error, i, - sle->u_id_str); - return (error); - } - } error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, nvdimm_spa_count, &spa_mappings_cnt); Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Jan 18 10:45:27 2019 (r343143) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Jan 18 10:54:36 2019 (r343144) @@ -60,6 +60,7 @@ enum SPA_mapping_type { SPA_TYPE_VOLATILE_VIRTUAL_CD = 5, SPA_TYPE_PERSISTENT_VIRTUAL_DISK= 6, SPA_TYPE_PERSISTENT_VIRTUAL_CD = 7, + SPA_TYPE_UNKNOWN = 127, }; struct SPA_mapping { @@ -88,6 +89,7 @@ extern int spa_mappings_cnt; MALLOC_DECLARE(M_NVDIMM); +enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *); struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t nv_handle); int nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, int (*cb)(void *, void *), void *arg); From owner-svn-src-head@freebsd.org Fri Jan 18 12:54:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175BC149C952; Fri, 18 Jan 2019 12:54:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF17A8E5B8; Fri, 18 Jan 2019 12:54:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kTfUgSwn182YckTfVgBLjj; Fri, 18 Jan 2019 05:54:42 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=H0GPC0OhAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=sYRoXnj-x_WCtMZ0wH8A:9 a=CjuIK1q_8ugA:10 a=KczGKrPSgCPlefTG41c3:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id AEC79501; Fri, 18 Jan 2019 04:54:57 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0ICscDO076363; Fri, 18 Jan 2019 04:54:38 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0ICsbBb076360; Fri, 18 Jan 2019 04:54:38 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901181254.x0ICsbBb076360@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Eugene Grosbein cc: Maxim Sobolev , Cy Schubert , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: Message from Eugene Grosbein of "Fri, 18 Jan 2019 16:17:04 +0700." <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 18 Jan 2019 04:54:37 -0800 X-CMAE-Envelope: MS4wfAzaY0CbMzeRET55Lrz1ShmVY1f1Xw/nJBtpGjOcchdFXAJzH2C6t8dOOcf8T4rsz8LWxNAcMYAx6W8rfHJ1wGk0zcYocV6BWkuH9V3Hc5HIZVfnnWKo JHOO2ZbunFMIFQah9Dy9F6SAL2zxhtpdpZKPfwtfaZZcH0+I803LQkBvwngI5yuL1pv8/apk6axKr/JblzJriaVSm693lSX0ntUdGZ+8pJF1IalcIoqPWnBc xWbtmRdXeIiSuQ3UYFJBZuzqtwCzMjtz2Jk4reBjKk/ldA3RKCKFP/yOhmHAjY/3h3BpbFt1YqKQqTWENbcTQAA6r0yFGd3PkMrt+tY+jWfLqpMgvxWm9CQf AnneQeOs X-Rspamd-Queue-Id: EF17A8E5B8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.30 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.61)[ip: (-3.81), ipnet: 64.59.128.0/20(-2.36), asn: 6327(-1.82), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 12:54:47 -0000 In message <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein.net>, Eugene Grosbein writes: > 18.01.2019 5:25, Maxim Sobolev wrote: > > > Using usr.sbin/trim as an example. > > We still lack a command usable at installation stage (escape to shell) to tri > m a device or partition > dedicated to ZFS Cache/ZFS Intention Log/zvol any other use when ports/packag > es are not yet available. OK, I will put a review together for dd. Do you realize that what you just said? Your statement is inconsistent with where trim is installed? Then it should have been installed in /sbin not where you put it. I don't want to start yet another bikeshed arguing the merits of this or that -- I'm intentionally being vague here because I really don't want to stat a different bikeshed thread. But suffice it to say, dd is the place for it because it lives in /bin and dd is already included in /rescue. Everything about trim is wrong, even where it is put. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Jan 18 13:35:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B5C149DD3C; Fri, 18 Jan 2019 13:35:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD3008FBFA; Fri, 18 Jan 2019 13:35:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBE1E2E04; Fri, 18 Jan 2019 13:35:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IDZ7N0085625; Fri, 18 Jan 2019 13:35:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IDZ71B085622; Fri, 18 Jan 2019 13:35:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901181335.x0IDZ71B085622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Jan 2019 13:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343145 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD3008FBFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 13:35:08 -0000 Author: kib Date: Fri Jan 18 13:35:06 2019 New Revision: 343145 URL: https://svnweb.freebsd.org/changeset/base/343145 Log: MI VM: Make it possible to set size of superpage at boot instead of compile time. In order to allow single kernel to use PAE pagetables on i386 if hardware supports it, and fall back to classic two-level paging structures if not, superpage code should be able to adopt to either 2M or 4M superpages size. There I make MI VM structures large enough to track the biggest possible superpage, by allowing architecture to define VM_NFREEORDER_MAX and VM_LEVEL_0_ORDER_MAX constants. Corresponding VM_NFREEORDER and VM_LEVEL_0_ORDER symbols can be defined as runtime values and must be less than the _MAX constants. If architecture does not define _MAXs, it is assumed that _MAX == normal constant. Reviewed by: markj Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18853 Modified: head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Fri Jan 18 10:54:36 2019 (r343144) +++ head/sys/vm/vm_phys.c Fri Jan 18 13:35:06 2019 (r343145) @@ -106,7 +106,8 @@ static struct rwlock_padalign vm_phys_fictitious_reg_l MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages"); static struct vm_freelist __aligned(CACHE_LINE_SIZE) - vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER]; + vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL] + [VM_NFREEORDER_MAX]; static int __read_mostly vm_nfreelists; Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Jan 18 10:54:36 2019 (r343144) +++ head/sys/vm/vm_phys.h Fri Jan 18 13:35:06 2019 (r343145) @@ -42,6 +42,10 @@ #ifdef _KERNEL +#ifndef VM_NFREEORDER_MAX +#define VM_NFREEORDER_MAX VM_NFREEORDER +#endif + /* Domains must be dense (non-sparse) and zero-based. */ struct mem_affinity { vm_paddr_t start; @@ -63,7 +67,7 @@ struct vm_phys_seg { vm_paddr_t end; vm_page_t first_page; int domain; - struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER]; + struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; }; extern struct vm_phys_seg vm_phys_segs[]; Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Fri Jan 18 10:54:36 2019 (r343144) +++ head/sys/vm/vm_reserv.c Fri Jan 18 13:35:06 2019 (r343145) @@ -77,10 +77,15 @@ __FBSDID("$FreeBSD$"); #if VM_NRESERVLEVEL > 0 +#ifndef VM_LEVEL_0_ORDER_MAX +#define VM_LEVEL_0_ORDER_MAX VM_LEVEL_0_ORDER +#endif + /* * The number of small pages that are contained in a level 0 reservation */ #define VM_LEVEL_0_NPAGES (1 << VM_LEVEL_0_ORDER) +#define VM_LEVEL_0_NPAGES_MAX (1 << VM_LEVEL_0_ORDER_MAX) /* * The number of bits by which a physical address is shifted to obtain the @@ -114,6 +119,7 @@ typedef u_long popmap_t; * The number of population map entries in a reservation */ #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) +#define NPOPMAP_MAX howmany(VM_LEVEL_0_NPAGES_MAX, NBPOPMAP) /* * Number of elapsed ticks before we update the LRU queue position. Used @@ -191,7 +197,7 @@ struct vm_reserv { uint16_t popcnt; /* (r) # of pages in use */ int lasttick; /* (r) last pop update tick. */ char inpartpopq; /* (d) */ - popmap_t popmap[NPOPMAP]; /* (r) bit vector, used pages */ + popmap_t popmap[NPOPMAP_MAX]; /* (r) bit vector, used pages */ }; #define vm_reserv_lockptr(rv) (&(rv)->lock) From owner-svn-src-head@freebsd.org Fri Jan 18 13:38:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB58149DE60; Fri, 18 Jan 2019 13:38:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 519178FE51; Fri, 18 Jan 2019 13:38:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 452342E3A; Fri, 18 Jan 2019 13:38:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IDcvEA085828; Fri, 18 Jan 2019 13:38:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IDcuND085826; Fri, 18 Jan 2019 13:38:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901181338.x0IDcuND085826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Jan 2019 13:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343146 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 343146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 519178FE51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 13:38:57 -0000 Author: kib Date: Fri Jan 18 13:38:56 2019 New Revision: 343146 URL: https://svnweb.freebsd.org/changeset/base/343146 Log: x86 busdma: fix mis-use of bus_addr_t where vm_paddr_t is assumed. Right now bus_addr_t and vm_paddr_t are always aliased to the same underlying integer type on x86, which makes the interchange hard to detect. Shortly, i386 kernel would use uint64_t for vm_paddr_t to enable automatic use of PAE paging structures if hardware allows it, while bus_addr_t would be extended to 64bit only when PAE option is specified. Fix all places that were identified as using bus_addr_t while page address was assumed. This was performed by testing the complete PAE merging patch on machine with > 4G of RAM enabled. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18854 Modified: head/sys/x86/include/busdma_impl.h head/sys/x86/x86/busdma_bounce.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/x86/include/busdma_impl.h ============================================================================== --- head/sys/x86/include/busdma_impl.h Fri Jan 18 13:35:06 2019 (r343145) +++ head/sys/x86/include/busdma_impl.h Fri Jan 18 13:38:56 2019 (r343146) @@ -87,7 +87,7 @@ struct bus_dma_impl { }; void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); -int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); +int bus_dma_run_filter(struct bus_dma_tag_common *dmat, vm_paddr_t paddr); int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Fri Jan 18 13:35:06 2019 (r343145) +++ head/sys/x86/x86/busdma_bounce.c Fri Jan 18 13:38:56 2019 (r343146) @@ -139,7 +139,7 @@ static int alloc_bounce_pages(bus_dma_tag_t dmat, u_in static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_addr_t addr1, bus_addr_t addr2, bus_size_t size); + vm_offset_t vaddr, vm_paddr_t addr1, vm_paddr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); @@ -507,7 +507,7 @@ static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, bus_size_t buflen, int flags) { - bus_addr_t curaddr; + vm_paddr_t curaddr; bus_size_t sgsize; if (map != &nobounce_dmamap && map->pagesneeded == 0) { @@ -536,7 +536,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap { vm_offset_t vaddr; vm_offset_t vendaddr; - bus_addr_t paddr; + vm_paddr_t paddr; bus_size_t sg_len; if (map != &nobounce_dmamap && map->pagesneeded == 0) { @@ -643,12 +643,19 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam * Add a single contiguous physical range to the segment list. */ static int -_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, +_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t curaddr, bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) { bus_addr_t baddr, bmask; int seg; + KASSERT(curaddr <= BUS_SPACE_MAXADDR, + ("ds_addr %#jx > BUS_SPACE_MAXADDR %#jx; dmat %p fl %#x low %#jx " + "hi %#jx", + (uintmax_t)curaddr, (uintmax_t)BUS_SPACE_MAXADDR, + dmat, dmat->bounce_flags, (uintmax_t)dmat->common.lowaddr, + (uintmax_t)dmat->common.highaddr)); + /* * Make sure we don't cross any boundaries. */ @@ -695,7 +702,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dm int *segp) { bus_size_t sgsize; - bus_addr_t curaddr; + vm_paddr_t curaddr; int error; if (map == NULL) @@ -747,7 +754,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_ int *segp) { bus_size_t sgsize, max_sgsize; - bus_addr_t curaddr; + vm_paddr_t curaddr; vm_offset_t kvaddr, vaddr; int error; @@ -1194,7 +1201,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) + vm_paddr_t addr1, vm_paddr_t addr2, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Fri Jan 18 13:35:06 2019 (r343145) +++ head/sys/x86/x86/busdma_machdep.c Fri Jan 18 13:38:56 2019 (r343146) @@ -99,14 +99,15 @@ bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op) * to check for a match, if there is no filter callback then assume a match. */ int -bus_dma_run_filter(struct bus_dma_tag_common *tc, bus_addr_t paddr) +bus_dma_run_filter(struct bus_dma_tag_common *tc, vm_paddr_t paddr) { int retval; retval = 0; do { - if (((paddr > tc->lowaddr && paddr <= tc->highaddr) || - ((paddr & (tc->alignment - 1)) != 0)) && + if ((paddr >= BUS_SPACE_MAXADDR || + (paddr > tc->lowaddr && paddr <= tc->highaddr) || + (paddr & (tc->alignment - 1)) != 0) && (tc->filter == NULL || (*tc->filter)(tc->filterarg, paddr) != 0)) retval = 1; From owner-svn-src-head@freebsd.org Fri Jan 18 13:43:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777BE149E2AD; Fri, 18 Jan 2019 13:43:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A73290470; Fri, 18 Jan 2019 13:43:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F7712FEB; Fri, 18 Jan 2019 13:43:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IDhB1A090774; Fri, 18 Jan 2019 13:43:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IDhBdp090773; Fri, 18 Jan 2019 13:43:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901181343.x0IDhBdp090773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Jan 2019 13:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343147 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 343147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A73290470 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 13:43:12 -0000 Author: kib Date: Fri Jan 18 13:43:11 2019 New Revision: 343147 URL: https://svnweb.freebsd.org/changeset/base/343147 Log: i386/PAE busdma: allow more bounce pages. If i386 has more than 4G of memory, allow the same number of busdma bounce pages as for amd64. In fact, in this case bouncing sometimes is much heavier than on amd64. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18854 Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Fri Jan 18 13:38:56 2019 (r343146) +++ head/sys/x86/x86/busdma_bounce.c Fri Jan 18 13:43:11 2019 (r343147) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef __i386__ -#define MAX_BPAGES 512 +#define MAX_BPAGES (Maxmem > atop(0x100000000ULL) ? 8192 : 512) #else #define MAX_BPAGES 8192 #endif From owner-svn-src-head@freebsd.org Fri Jan 18 14:54:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FE0C14A1080; Fri, 18 Jan 2019 14:54:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E828931DC; Fri, 18 Jan 2019 14:54:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0IEsB7t055785; Fri, 18 Jan 2019 06:54:11 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0IEsAWh055784; Fri, 18 Jan 2019 06:54:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901181454.x0IEsAWh055784@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim In-Reply-To: <201901181254.x0ICsbBb076360@slippy.cwsent.com> To: Cy Schubert Date: Fri, 18 Jan 2019 06:54:10 -0800 (PST) CC: Eugene Grosbein , Maxim Sobolev , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 7E828931DC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.933,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 14:54:16 -0000 > In message <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein.net>, Eugene > Grosbein > writes: > > 18.01.2019 5:25, Maxim Sobolev wrote: > > > > > Using usr.sbin/trim as an example. > > > > We still lack a command usable at installation stage (escape to shell) to tri > > m a device or partition > > dedicated to ZFS Cache/ZFS Intention Log/zvol any other use when ports/packag > > es are not yet available. > > OK, I will put a review together for dd. Ignoring all the hyperbola below, here is what your looking for: https://reviews.freebsd.org/D18382 > > Do you realize that what you just said? Your statement is inconsistent > with where trim is installed? Then it should have been installed in > /sbin not where you put it. I don't want to start yet another bikeshed > arguing the merits of this or that -- I'm intentionally being vague > here because I really don't want to stat a different bikeshed thread. > But suffice it to say, dd is the place for it because it lives in /bin > and dd is already included in /rescue. > > Everything about trim is wrong, even where it is put. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 18 15:11:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEAF414A15E6; Fri, 18 Jan 2019 15:11:23 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4747293B13; Fri, 18 Jan 2019 15:11:23 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x0IFB7UE089201 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Jan 2019 16:11:07 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: Cy.Schubert@cschubert.com Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id x0IFB6x5067968; Fri, 18 Jan 2019 22:11:06 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Cy Schubert References: <201901181254.x0ICsbBb076360@slippy.cwsent.com> Cc: Maxim Sobolev , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5C41EC89.9000900@grosbein.net> Date: Fri, 18 Jan 2019 22:11:05 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201901181254.x0ICsbBb076360@slippy.cwsent.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4747293B13 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 15:11:23 -0000 On 18.01.2019 19:54, Cy Schubert wrote: > In message <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein.net>, Eugene > Grosbein > writes: >> 18.01.2019 5:25, Maxim Sobolev wrote: >> >>> Using usr.sbin/trim as an example. >> >> We still lack a command usable at installation stage (escape to shell) to tri >> m a device or partition >> dedicated to ZFS Cache/ZFS Intention Log/zvol any other use when ports/packag >> es are not yet available. > > OK, I will put a review together for dd. > > Do you realize that what you just said? Your statement is inconsistent > with where trim is installed? Then it should have been installed in > /sbin not where you put it. I don't want to start yet another bikeshed > arguing the merits of this or that -- I'm intentionally being vague > here because I really don't want to stat a different bikeshed thread. > But suffice it to say, dd is the place for it because it lives in /bin > and dd is already included in /rescue. Modern FreeBSD installation media have usr/bin and usr/sbin ready for shell session as they contain live system. I'm not against dd conv=trim but it has different usage pattern and it is not easy replacement for trim(8). From owner-svn-src-head@freebsd.org Fri Jan 18 17:33:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6BE14A502E for ; Fri, 18 Jan 2019 17:33:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EED469EAE for ; Fri, 18 Jan 2019 17:33:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72d.google.com with SMTP id 68so8470078qke.9 for ; Fri, 18 Jan 2019 09:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fnZDPTFOEjHODZS2rK/9THBHr+oAEwiJOZwtV/PxZKY=; b=WmoBIfkDmFL9hYYz7AognLdM7Gu/37TIX/4i4X6gY9Fy/UaXeAGyRG9nRBSvQUg6od RZFvdHo6p9Tj968Yc/Ea1brPNfldi0Gkk/jTcyHskL45wxjYbm+R/sLA8VnyfAOpDTOr tJou1O9uepJ0mZmd975XQXTakvA6wvpYrfyfeVUkPJOwRxlO30kKfeNZi/AD1DqtcE1y ah9xEzuitNPkOWYOVyEqWbjToKlVBFUZ+t3TvHdqKWDAqgnatJIevJdLAdbqSky/Flka KfI2mYqrhmMDtvJ2kZn/ko+iiZvgQ85Bumoe7KcVmX8gzTZBlkts1xRUH+vpEz/jiayP cw7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fnZDPTFOEjHODZS2rK/9THBHr+oAEwiJOZwtV/PxZKY=; b=sop8hMn5Px+oXH0Mid3KcNkqaAad0qB78/5OA2wxZ++sMu2wpXOW4ykqsSZrSIeO4F wkBFP9HIVESimxd7kANbYQX4usTcy1NXr+wDxKZ4DnxJdyQqRUMY9RHJY6fnZfZKAWHk BgZJBzd42KgSGq6VZEkOq5Cre1IcOUqOnV/xS68U5GklGCBBENf+7orgFROUZqBbf8bS rpYifzURkehlTA042RYCIKtE3g3Ets48rDSfBCPyi6Xii+BiB9ug9621FY4VuyjElB+t Fktd3HDoDk92sFNIXPnG6/I7NJg5DLW0Y2bkYAspVD3TEfxO/unZ4blv8vBlKg4e7o8y 7diQ== X-Gm-Message-State: AJcUukfpzqN9uxw3zu6Gl8ETxM7KA0SbW28dZqDAP9Y1n5stp4GW9HYp sqw8wVQQmE+IliQd1xkbYo7z0IYT+gxKpEZkhG2Y3w== X-Google-Smtp-Source: ALg8bN6eA4JSAXRqHmqtiPGfJBovas/F7beUcI8mrsXE29OVC10VAlDKQ8CagPHjFIGCJWcwEypvfDJVZ2A+BIoJNYo= X-Received: by 2002:a37:6e86:: with SMTP id j128mr16404614qkc.46.1547832781311; Fri, 18 Jan 2019 09:33:01 -0800 (PST) MIME-Version: 1.0 References: <201901171808.x0HI80jC068564@repo.freebsd.org> <2d239dc0-915c-2d2b-0936-a40af5e9ead9@freebsd.org> <4b204e03-48fd-07ae-45ae-70c5e03442c2@freebsd.org> In-Reply-To: <4b204e03-48fd-07ae-45ae-70c5e03442c2@freebsd.org> From: Warner Losh Date: Fri, 18 Jan 2019 10:32:50 -0700 Message-ID: Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Eugene Grosbein Cc: "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 1EED469EAE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 17:33:02 -0000 On Fri, Jan 18, 2019 at 2:06 AM Eugene Grosbein wrote: > 18.01.2019 7:39, Warner Losh wrote: > > > You hijacked that review. Don't you dare use it as evidence of consent > to the sh*t you just pulled. > > > > Back it out, do a proper review. This one was not proper, nor was it > complete. Don't go using my name to support a program I've come to think is > a really bad idea. > > I do not see how I "hijacked" it this time. > > And I do not understand how another review would help as there is clearly > no one wishing to review the code anymore. > I really hope this is not some kind of bureaucracy or cargo cult for sake > of formal procedures > but mis-understanding at my side. Please explain. > I created the review and was revising it. You committed it out from under me. That's quite rude in this community and really really bothers me. That's why I'm so mad and using such strong language. Warner From owner-svn-src-head@freebsd.org Fri Jan 18 17:41:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C63E14A543B; Fri, 18 Jan 2019 17:41:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7D5B6A5E0; Fri, 18 Jan 2019 17:41:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA9055AF4; Fri, 18 Jan 2019 17:41:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IHfjNk014632; Fri, 18 Jan 2019 17:41:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IHfjs6014631; Fri, 18 Jan 2019 17:41:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901181741.x0IHfjs6014631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Jan 2019 17:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343152 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7D5B6A5E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 17:41:46 -0000 Author: emaste Date: Fri Jan 18 17:41:45 2019 New Revision: 343152 URL: https://svnweb.freebsd.org/changeset/base/343152 Log: freebsd-update: Use BASEDIR when checking for src component src could potentially be installed under the based dir and not under the root or vice versa. PR: 224048 Submitted by: Gerald Aryeetey Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18849 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Fri Jan 18 16:04:36 2019 (r343151) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Fri Jan 18 17:41:45 2019 (r343152) @@ -221,7 +221,7 @@ config_KeepModifiedMetadata () { config_Components () { for C in $@; do if [ "$C" = "src" ]; then - if [ -e /usr/src/COPYRIGHT ]; then + if [ -e "${BASEDIR}/usr/src/COPYRIGHT" ]; then COMPONENTS="${COMPONENTS} ${C}" else echo "src component not installed, skipped" From owner-svn-src-head@freebsd.org Fri Jan 18 17:51:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77CB014A595E; Fri, 18 Jan 2019 17:51:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBEC06AD60; Fri, 18 Jan 2019 17:51:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0IHpAJ4056606; Fri, 18 Jan 2019 09:51:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0IHpAkU056605; Fri, 18 Jan 2019 09:51:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901181751.x0IHpAkU056605@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343152 - head/usr.sbin/freebsd-update In-Reply-To: <201901181741.x0IHfjs6014631@repo.freebsd.org> To: Ed Maste Date: Fri, 18 Jan 2019 09:51:10 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: EBEC06AD60 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 17:51:20 -0000 > Author: emaste > Date: Fri Jan 18 17:41:45 2019 > New Revision: 343152 > URL: https://svnweb.freebsd.org/changeset/base/343152 > > Log: > freebsd-update: Use BASEDIR when checking for src component > > src could potentially be installed under the based dir > and not under the root or vice versa. > > PR: 224048 > Submitted by: Gerald Aryeetey > Reviewed by: delphij > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18849 > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Fri Jan 18 16:04:36 2019 (r343151) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Fri Jan 18 17:41:45 2019 (r343152) > @@ -221,7 +221,7 @@ config_KeepModifiedMetadata () { > config_Components () { > for C in $@; do > if [ "$C" = "src" ]; then > - if [ -e /usr/src/COPYRIGHT ]; then > + if [ -e "${BASEDIR}/usr/src/COPYRIGHT" ]; then > COMPONENTS="${COMPONENTS} ${C}" > else > echo "src component not installed, skipped" > Since your in here fixing... there is a false positive on the detection of what is installed when we zero the size of a set, ie, now that doc.txz is a 0 size set it always thinks you have doc installed due to rounding errors in the calculation that says you have x% of this installed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 18 18:22:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D86A814A6D2C; Fri, 18 Jan 2019 18:22:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC7B6CA12; Fri, 18 Jan 2019 18:22:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7224C6375; Fri, 18 Jan 2019 18:22:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IIMlXG036432; Fri, 18 Jan 2019 18:22:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IIMlBp036431; Fri, 18 Jan 2019 18:22:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901181822.x0IIMlBp036431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Jan 2019 18:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343153 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CC7B6CA12 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 18:22:48 -0000 Author: emaste Date: Fri Jan 18 18:22:47 2019 New Revision: 343153 URL: https://svnweb.freebsd.org/changeset/base/343153 Log: freebsd-update.8: mandoc -Tlint fixes PR: 185389 Reported by: bcr MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.8 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Fri Jan 18 17:41:45 2019 (r343152) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Fri Jan 18 18:22:47 2019 (r343153) @@ -27,7 +27,7 @@ .\" .Dd June 14, 2017 .Dt FREEBSD-UPDATE 8 -.Os FreeBSD +.Os .Sh NAME .Nm freebsd-update .Nd fetch and install binary updates to FreeBSD @@ -47,9 +47,12 @@ The .Nm tool is used to fetch, install, and rollback binary -updates to the FreeBSD base system. +updates to the +.Fx +base system. Note that updates are only available if they are being built for the -FreeBSD release and architecture being used; in particular, the +.Fx +release and architecture being used; in particular, the .Fx Security Team only builds updates for releases shipped in binary form by the From owner-svn-src-head@freebsd.org Fri Jan 18 18:33:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1388F14A7460; Fri, 18 Jan 2019 18:33:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 563EC6D430; Fri, 18 Jan 2019 18:33:09 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id kYwugSKt1nBo4kYwvgc8Ls; Fri, 18 Jan 2019 11:33:02 -0700 X-Authority-Analysis: v=2.3 cv=J8fUEzvS c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=3JhidrIBZZsA:10 a=H0GPC0OhAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=XzW2ZnVlJkLzrLaYYeEA:9 a=QEXdDO2ut3YA:10 a=KczGKrPSgCPlefTG41c3:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 2957C437; Fri, 18 Jan 2019 10:33:18 -0800 (PST) Date: Fri, 18 Jan 2019 10:32:36 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <5C41EC89.9000900@grosbein.net> References: <201901181254.x0ICsbBb076360@slippy.cwsent.com> <5C41EC89.9000900@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343118 - in head/usr.sbin: . trim To: Eugene Grosbein CC: Maxim Sobolev , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfHdsYnCRnezpvRWyeNPNC1C4JzR3+w3+6lnnxw80noyzJ4J28lWEm22KWTCdyNHhF5d67WK16bukzSgje4g2u452KYbN76+8hBtB6mCmamnIz097wlae Bu2nGf9kFbGPryzoB8Jq0zHLqdTb8Opm4glsSUwbCYWHza6wxbw83jLhk0ofzIjoztgcPEXX3ss+rCeNGDO+LVUL2W5xEiayujUthkmmJiSxVt9wb6LDgTBW K5fs++1fF9yGjdI8TSix0VuWT9R5w9sv6VM7OEV8pwiwF+3EfaZrmHowf3eP/ZGOLlFJlxG5SKzb6MPTJRpRHDfYckRuA7lAcNu+pMF0Aky18Oq88g8o8k7G TTGdX4uj X-Rspamd-Queue-Id: 563EC6D430 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 18:33:11 -0000 On January 18, 2019 7:11:05 AM PST, Eugene Grosbein = wrote: >On 18=2E01=2E2019 19:54, Cy Schubert wrote: > >> In message <81bb343b-ad8a-371d-d94f-f72c8dbce754@grosbein=2Enet>, >Eugene=20 >> Grosbein >> writes: >>> 18=2E01=2E2019 5:25, Maxim Sobolev wrote: >>> >>>> Using usr=2Esbin/trim as an example=2E=20 >>> >>> We still lack a command usable at installation stage (escape to >shell) to tri >>> m a device or partition >>> dedicated to ZFS Cache/ZFS Intention Log/zvol any other use when >ports/packag >>> es are not yet available=2E >>=20 >> OK, I will put a review together for dd=2E >>=20 >> Do you realize that what you just said? Your statement is >inconsistent=20 >> with where trim is installed? Then it should have been installed in=20 >> /sbin not where you put it=2E I don't want to start yet another >bikeshed=20 >> arguing the merits of this or that -- I'm intentionally being vague=20 >> here because I really don't want to stat a different bikeshed thread=2E > >> But suffice it to say, dd is the place for it because it lives in >/bin=20 >> and dd is already included in /rescue=2E > >Modern FreeBSD installation media have usr/bin and usr/sbin ready for >shell session >as they contain live system=2E I'm not against dd conv=3Dtrim but it has >different usage pattern >and it is not easy replacement for trim(8)=2E What do you not understand? We do not want it in base without a proper rev= iew=2E This second attempt at commit without a proper review is IMO disresp= ectful=2E Remove it now and submit a proper review=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Fri Jan 18 20:35:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB68B1481860; Fri, 18 Jan 2019 20:35:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 637D47261A; Fri, 18 Jan 2019 20:35:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 593AD7B5B; Fri, 18 Jan 2019 20:35:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IKZPNP008210; Fri, 18 Jan 2019 20:35:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IKZPKN008209; Fri, 18 Jan 2019 20:35:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201901182035.x0IKZPKN008209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 18 Jan 2019 20:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343154 - head X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 343154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 637D47261A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 20:35:25 -0000 Author: dim Date: Fri Jan 18 20:35:24 2019 New Revision: 343154 URL: https://svnweb.freebsd.org/changeset/base/343154 Log: Remove leading slash from OLD_DIRS assignment in ObsoleteFiles.inc. The "make delete-old" mechanism will already take care of such prefixes, and this prevents a double leading slash from being displayed. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jan 18 18:22:47 2019 (r343153) +++ head/ObsoleteFiles.inc Fri Jan 18 20:35:24 2019 (r343154) @@ -828,7 +828,7 @@ OLD_FILES+=tests/sys/geom/class/eli/integrity_hmac_tes OLD_FILES+=tests/sys/geom/class/eli/onetime_a_test.sh OLD_FILES+=tests/sys/geom/class/eli/onetime_d_test.sh # 20171230: Remove /etc/skel from mtree -OLD_DIRS+=/etc/skel +OLD_DIRS+=etc/skel # 20171208: Remove basename_r(3) OLD_FILES+=usr/share/man/man3/basename_r.3.gz # 20171204: Move fdformat man page from volume 1 to volume 8. From owner-svn-src-head@freebsd.org Fri Jan 18 21:00:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B233F14822B1; Fri, 18 Jan 2019 21:00:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52EB6733EE; Fri, 18 Jan 2019 21:00:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4080A7F07; Fri, 18 Jan 2019 21:00:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IL0t0h021782; Fri, 18 Jan 2019 21:00:55 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IL0se9021761; Fri, 18 Jan 2019 21:00:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901182100.x0IL0se9021761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 18 Jan 2019 21:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343156 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52EB6733EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 21:00:55 -0000 Author: gonzo Date: Fri Jan 18 21:00:54 2019 New Revision: 343156 URL: https://svnweb.freebsd.org/changeset/base/343156 Log: [usb] Add HID_IGNORE quirks for multiple UPS devices Without HID_IGNORE quirk enabled these models appear in the system as a uhid devices while NUT (Network UPS Tool) expects them to be ugen. PR: 131521 Submitted by: Naoyuki Tai , John Bayly MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 18 20:59:06 2019 (r343155) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 18 21:00:54 2019 (r343156) @@ -110,8 +110,19 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(XEROX, WCM15, 0x0000, 0xffff, UQ_BROKEN_BIDIR), /* Devices which should be ignored by uhid */ USB_QUIRK(APC, UPS, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6H375USB, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(BELKIN, F6C550AVR, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C1250TWRK, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C1500TWRK, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C900UNV, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C100UNV, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C120UNV, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C800UNV, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(BELKIN, F6C1100UNV, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(CYBERPOWER, BC900D, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(CYBERPOWER, OR2200LCDRM2U, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(DELL2, VARIOUS_UPS, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(CYPRESS, SILVERSHIELD, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(DREAMLINK, DL100B, 0x0000, 0xffff, UQ_HID_IGNORE), @@ -119,8 +130,26 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(LIEBERT2, PSI1000, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(LIEBERT2, POWERSURE_PSA, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(MGE, UPS1, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(MGE, UPS2, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(POWERCOM, IMPERIAL_SERIES, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(POWERCOM, SMART_KING_PRO, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(POWERCOM, WOW, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(POWERCOM, VANGUARD, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(POWERCOM, BLACK_KNIGHT_PRO, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, AVR550U, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, AVR750U, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, ECO550UPS, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, T750_INTL, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, RT_2200_INTL, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, OMNI1000LCD, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, OMNI900LCD, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, SMART_2200RMXL2U, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, UPS_3014, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, SU1500RTXL2UA, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, SU6000RT4U, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(TRIPPLITE2, SU1500RTXL2UA_2, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(APPLE, IPHONE, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(APPLE, IPHONE_3G, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(MEGATEC, UPS, 0x0000, 0xffff, UQ_HID_IGNORE), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Jan 18 20:59:06 2019 (r343155) +++ head/sys/dev/usb/usbdevs Fri Jan 18 21:00:54 2019 (r343156) @@ -140,6 +140,7 @@ vendor SANYO 0x0474 Sanyo Electric vendor SEAGATE 0x0477 Seagate vendor CONNECTIX 0x0478 Connectix vendor SEMTECH 0x047a Semtech +vendor DELL2 0x047c Dell vendor KENSINGTON 0x047d Kensington vendor LUCENT 0x047e Lucent vendor PLANTRONICS 0x047f Plantronics @@ -554,6 +555,7 @@ vendor ACDC 0x0d7e American Computer & Digital Compon vendor CMEDIA 0x0d8c CMEDIA vendor CONCEPTRONIC 0x0d8e Conceptronic vendor SKANHEX 0x0d96 Skanhex Technology, Inc. +vendor POWERCOM 0x0d9f PowerCOM vendor MSI 0x0db0 Micro Star International vendor ELCON 0x0db7 ELCON Systemtechnik vendor UNKNOWN4 0x0dcd Unknown vendor @@ -1366,8 +1368,16 @@ product BELKIN USB2LAN 0x0121 USB to LAN product BELKIN F5U208 0x0208 F5U208 VideoBus II product BELKIN F5U237 0x0237 F5U237 USB 2.0 7-Port Hub product BELKIN F5U257 0x0257 F5U257 Serial +product BELKIN F6H375USB 0x0375 F6H375-USB product BELKIN F5U409 0x0409 F5U409 Serial product BELKIN F6C550AVR 0x0551 F6C550-AVR UPS +product BELKIN F6C1250TWRK 0x0750 F6C1250-TW-RK +product BELKIN F6C1500TWRK 0x0751 F6C1500-TW-RK +product BELKIN F6C900UNV 0x0900 F6C900-UNV +product BELKIN F6C100UNV 0x0910 F6C100-UNV +product BELKIN F6C120UNV 0x0912 F6C120-UNV UPS +product BELKIN F6C800UNV 0x0980 F6C800-UNV +product BELKIN F6C1100UNV 0x1100 F6C1100-UNV, F6C1200-UNV product BELKIN F5U120 0x1203 F5U120-PC Hub product BELKIN RTL8188CU 0x1102 RTL8188CU Wireless Adapter product BELKIN F9L1103 0x1103 F9L1103 Wireless Adapter @@ -1601,7 +1611,9 @@ product CURITEL UM150 0x3711 EVDO modem product CURITEL UM175 0x3714 EVDO modem /* CyberPower products */ -product CYBERPOWER 1500CAVRLCD 0x0501 1500CAVRLCD +product CYBERPOWER BC900D 0x0005 900AVR/BC900D, CP1200AVR/BC1200D +product CYBERPOWER 1500CAVRLCD 0x0501 1500CAVRLCD +product CYBERPOWER OR2200LCDRM2U 0x0601 OR2200LCDRM2U /* CyberTAN Technology products */ product CYBERTAN TG54USB 0x1666 TG54USB @@ -1653,6 +1665,7 @@ product DELL U5730 0x8180 Dell 5730 3G product DELL U5730_2 0x8181 Dell 5730 3G product DELL U5730_3 0x8182 Dell 5730 3G product DELL DW700 0x9500 Dell DW700 GPS +product DELL2 VARIOUS_UPS 0xffff Various UPS Models /* Delorme Paublishing products */ product DELORME EARTHMATE 0x0100 Earthmate GPS @@ -2401,6 +2414,8 @@ product HP 930C 0x1204 DeskJet 930c product HP3 RTL8188CU 0x1629 RTL8188CU product HP P2000U 0x1801 Inkjet P-2000U product HP HS2300 0x1e1d HS2300 HSDPA (aka MC8775) +product HP T500 0x1f01 T500 +product HP T750 0x1f02 T750 product HP 640C 0x2004 DeskJet 640c product HP 4670V 0x3005 ScanJet 4670v product HP P1100 0x3102 Photosmart P1100 @@ -2777,6 +2792,7 @@ product LEXMARK S2450 0x0009 Optra S 2450 /* Liebert products */ product LIEBERT POWERSURE_PXT 0xffff PowerSure Personal XT +product LIEBERT2 POWERSURE_PSA 0x0001 PowerSure PSA UPS product LIEBERT2 PSI1000 0x0004 UPS PSI 1000 FW:08 /* Link Instruments Inc. products */ @@ -3702,6 +3718,13 @@ product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revis product PLX TESTBOARD 0x9060 test board product PLX CA42 0xac70 CA-42 +/* PowerCOM products */ +product POWERCOM IMPERIAL_SERIES 0x00a2 IMPERIAL Series +product POWERCOM SMART_KING_PRO 0x00a3 Smart KING Pro +product POWERCOM WOW 0x00a4 WOW +product POWERCOM VANGUARD 0x00a5 Vanguard +product POWERCOM BLACK_KNIGHT_PRO 0x00a6 Black Knight Pro + /* PNY products */ product PNY ATTACHE2 0x0010 USB 2.0 Flash Drive @@ -4642,7 +4665,20 @@ product TRENDNET RTL8188CU 0x648b RTL8188CU product TRENDNET TEW805UB 0x805b TEW-805UB /* Tripp-Lite products */ -product TRIPPLITE U209 0x2008 Serial +product TRIPPLITE U209 0x2008 Serial +product TRIPPLITE2 OMNIVS1000 0x0001 OMNIVS1000, SMART550USB +product TRIPPLITE2 AVR550U 0x1003 AVR550U +product TRIPPLITE2 AVR750U 0x1007 AVR750U +product TRIPPLITE2 ECO550UPS 0x1008 ECO550UPS +product TRIPPLITE2 T750_INTL 0x1f06 T750 INTL +product TRIPPLITE2 RT_2200_INTL 0x1f0a R/T 2200 INTL +product TRIPPLITE2 OMNI1000LCD 0x2005 OMNI1000LCD +product TRIPPLITE2 OMNI900LCD 0x2007 OMNI900LCD +product TRIPPLITE2 SMART_2200RMXL2U 0x3012 smart2200RMXL2U +product TRIPPLITE2 UPS_3014 0x3014 Unknown UPS +product TRIPPLITE2 SU1500RTXL2UA 0x4001 SmartOnline SU1500RTXL2UA +product TRIPPLITE2 SU6000RT4U 0x4002 SmartOnline SU6000RT4U +product TRIPPLITE2 SU1500RTXL2UA_2 0x4003 SmartOnline SU1500RTXL2UA /* Trumpion products */ product TRUMPION T33520 0x1001 T33520 USB Flash Card Controller From owner-svn-src-head@freebsd.org Fri Jan 18 21:30:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C7D148353C; Fri, 18 Jan 2019 21:30:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B31187519F; Fri, 18 Jan 2019 21:30:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98EB8434; Fri, 18 Jan 2019 21:30:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ILU7r7035932; Fri, 18 Jan 2019 21:30:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ILU6Yg035928; Fri, 18 Jan 2019 21:30:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901182130.x0ILU6Yg035928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 18 Jan 2019 21:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343161 - in head: include/protocols libexec/talkd usr.bin/talk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: include/protocols libexec/talkd usr.bin/talk X-SVN-Commit-Revision: 343161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B31187519F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 21:30:08 -0000 Author: brooks Date: Fri Jan 18 21:30:06 2019 New Revision: 343161 URL: https://svnweb.freebsd.org/changeset/base/343161 Log: Use a private definition of osockaddr rather then relying on type namespace polution in sys/socket.h. Also remove support for operation on 4.3BSD. PR: 224529 Differential Revision: https://reviews.freebsd.org/D14505 Modified: head/include/protocols/talkd.h head/libexec/talkd/talkd.c head/usr.bin/talk/invite.c head/usr.bin/talk/look_up.c Modified: head/include/protocols/talkd.h ============================================================================== --- head/include/protocols/talkd.h Fri Jan 18 21:25:46 2019 (r343160) +++ head/include/protocols/talkd.h Fri Jan 18 21:30:06 2019 (r343161) @@ -55,6 +55,15 @@ */ /* + * The talk protocol embeds a 4.3BSD sockaddr. Define our own version + * rather then relying on namespace polution in kernel headers. + */ +struct tsockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +/* * Client->server request message format. */ typedef struct { @@ -63,8 +72,8 @@ typedef struct { u_char answer; /* not used */ u_char pad; u_int32_t id_num; /* message id */ - struct osockaddr addr; /* old (4.3) style */ - struct osockaddr ctl_addr; /* old (4.3) style */ + struct tsockaddr addr; /* old (4.3) style */ + struct tsockaddr ctl_addr; /* old (4.3) style */ int32_t pid; /* caller's process id */ #define NAME_SIZE 12 char l_name[NAME_SIZE];/* caller's name */ @@ -82,7 +91,7 @@ typedef struct { u_char answer; /* respose to request message, see below */ u_char pad; u_int32_t id_num; /* message id */ - struct osockaddr addr; /* address for establishing conversation */ + struct tsockaddr addr; /* address for establishing conversation */ } CTL_RESPONSE; #define TALK_VERSION 1 /* protocol version */ Modified: head/libexec/talkd/talkd.c ============================================================================== --- head/libexec/talkd/talkd.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/libexec/talkd/talkd.c Fri Jan 18 21:30:06 2019 (r343161) @@ -114,7 +114,8 @@ main(int argc, char *argv[]) continue; } lastmsgtime = time(0); - (void)memcpy(&ctl_addr, &mp->ctl_addr, sizeof(ctl_addr)); + (void)memcpy(&ctl_addr.sa_data, &mp->ctl_addr.sa_data, + sizeof(ctl_addr.sa_data)); ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family); ctl_addr.sa_len = sizeof(ctl_addr); process_request(mp, &response); Modified: head/usr.bin/talk/invite.c ============================================================================== --- head/usr.bin/talk/invite.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/usr.bin/talk/invite.c Fri Jan 18 21:30:06 2019 (r343161) @@ -77,13 +77,9 @@ invite_remote(void) itimer.it_interval = itimer.it_value; if (listen(sockt, 5) != 0) p_error("Error on attempt to listen for caller"); -#ifdef MSG_EOR /* copy new style sockaddr to old, swap family (short in old) */ - msg.addr = *(struct osockaddr *)&my_addr; /* XXX new to old style*/ + msg.addr = *(struct tsockaddr *)&my_addr; msg.addr.sa_family = htons(my_addr.sin_family); -#else - msg.addr = *(struct sockaddr *)&my_addr; -#endif msg.id_num = htonl(-1); /* an impossible id_num */ invitation_waiting = 1; announce_invite(); Modified: head/usr.bin/talk/look_up.c ============================================================================== --- head/usr.bin/talk/look_up.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/usr.bin/talk/look_up.c Fri Jan 18 21:30:06 2019 (r343161) @@ -59,13 +59,9 @@ check_local(void) struct sockaddr addr; /* the rest of msg was set up in get_names */ -#ifdef MSG_EOR /* copy new style sockaddr to old, swap family (short in old) */ - msg.ctl_addr = *(struct osockaddr *)&ctl_addr; + msg.ctl_addr = *(struct tsockaddr *)&ctl_addr; msg.ctl_addr.sa_family = htons(ctl_addr.sin_family); -#else - msg.ctl_addr = *(struct sockaddr *)&ctl_addr; -#endif /* must be initiating a talk */ if (!look_for_invite(rp)) return (0); From owner-svn-src-head@freebsd.org Fri Jan 18 21:46:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4DF41484698; Fri, 18 Jan 2019 21:46:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B66B76001; Fri, 18 Jan 2019 21:46:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 686AC8796; Fri, 18 Jan 2019 21:46:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ILkdW9046380; Fri, 18 Jan 2019 21:46:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ILkdoJ046379; Fri, 18 Jan 2019 21:46:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901182146.x0ILkdoJ046379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 18 Jan 2019 21:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343162 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B66B76001 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 21:46:40 -0000 Author: brooks Date: Fri Jan 18 21:46:38 2019 New Revision: 343162 URL: https://svnweb.freebsd.org/changeset/base/343162 Log: Make SIFTR work again after r342125 (D18443). Correct a logic error. Only disable when already enabled or enable when disabled. Submitted by: Richard Scheffenegger Reviewed by: Cheng Cui Obtained from: Cheng Cui MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18885 Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Fri Jan 18 21:30:06 2019 (r343161) +++ head/sys/netinet/siftr.c Fri Jan 18 21:46:38 2019 (r343162) @@ -1219,7 +1219,7 @@ siftr_manage_ops(uint8_t action) if ((s = sbuf_new(NULL, NULL, 200, SBUF_AUTOEXTEND)) == NULL) return (-1); - if (action == SIFTR_ENABLE) { + if (action == SIFTR_ENABLE && siftr_pkt_manager_thr == NULL) { /* * Create our alq * XXX: We should abort if alq_open fails! @@ -1424,7 +1424,8 @@ siftr_manage_ops(uint8_t action) alq_close(siftr_alq); siftr_alq = NULL; - } + } else + error = EINVAL; sbuf_delete(s); @@ -1445,13 +1446,15 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) new = siftr_enabled; error = sysctl_handle_int(oidp, &new, 0, req); - if (error != 0 && req->newptr != NULL) { + if (error == 0 && req->newptr != NULL) { if (new > 1) return (EINVAL); else if (new != siftr_enabled) { - error = siftr_manage_ops(new); - if (error != 0) + if ((error = siftr_manage_ops(new)) == 0) { + siftr_enabled = new; + } else { siftr_manage_ops(SIFTR_DISABLE); + } } } @@ -1462,7 +1465,9 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) static void siftr_shutdown_handler(void *arg) { - siftr_manage_ops(SIFTR_DISABLE); + if (siftr_enabled == 1) { + siftr_manage_ops(SIFTR_DISABLE); + } } From owner-svn-src-head@freebsd.org Fri Jan 18 22:20:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50499148533B; Fri, 18 Jan 2019 22:20:30 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E71E27711A; Fri, 18 Jan 2019 22:20:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAD638CD9; Fri, 18 Jan 2019 22:20:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IMKTu5062451; Fri, 18 Jan 2019 22:20:29 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IMKTAh062449; Fri, 18 Jan 2019 22:20:29 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201901182220.x0IMKTAh062449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Fri, 18 Jan 2019 22:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343163 - in head/sys: dev/atkbdc sys X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys: dev/atkbdc sys X-SVN-Commit-Revision: 343163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E71E27711A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 22:20:30 -0000 Author: wulf Date: Fri Jan 18 22:20:29 2019 New Revision: 343163 URL: https://svnweb.freebsd.org/changeset/base/343163 Log: psm(4): detect Lenovo top-button clickpads libinput has special handling for Lenovo ThinkPad *40 series, where it treats clicks on the top button area as if they came from the TrackPoint: https://wayland.freedesktop.org/libinput/doc/latest/t440-support.html Detect these devices and set the corresponding evdev property. Submitted by: Greg V MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18676 Modified: head/sys/dev/atkbdc/psm.c head/sys/sys/mouse.h Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Fri Jan 18 21:46:38 2019 (r343162) +++ head/sys/dev/atkbdc/psm.c Fri Jan 18 22:20:29 2019 (r343163) @@ -136,6 +136,7 @@ struct psmcpnp_softc { enum { PSMCPNP_GENERIC, PSMCPNP_FORCEPAD, + PSMCPNP_TOPBUTTONPAD, } type; /* Based on PnP ID */ }; @@ -1826,6 +1827,8 @@ psm_register_synaptics(device_t dev) evdev_support_prop(evdev_a, INPUT_PROP_SEMI_MT); if (sc->synhw.capClickPad) evdev_support_prop(evdev_a, INPUT_PROP_BUTTONPAD); + if (sc->synhw.capClickPad && sc->synhw.topButtonPad) + evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD); evdev_support_key(evdev_a, BTN_TOUCH); evdev_support_nfingers(evdev_a, 3); psm_support_abs_bulk(evdev_a, synaptics_absinfo_st); @@ -5711,7 +5714,7 @@ synaptics_sysctl_create_softbuttons_tree(struct psm_so */ /* hw.psm.synaptics.softbuttons_y */ - sc->syninfo.softbuttons_y = 1700; + sc->syninfo.softbuttons_y = sc->synhw.topButtonPad ? -1700 : 1700; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, "softbuttons_y", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, @@ -6441,6 +6444,9 @@ enable_synaptics(struct psm_softc *sc, enum probearg a case PSMCPNP_FORCEPAD: synhw.forcePad = 1; break; + case PSMCPNP_TOPBUTTONPAD: + synhw.topButtonPad = 1; + break; default: break; } @@ -6483,8 +6489,11 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.minimumYCoord); } if (synhw.capClickPad) { + printf(" Clickpad capabilities:\n"); printf(" forcePad: %d\n", synhw.forcePad); + printf(" topButtonPad: %d\n", + synhw.topButtonPad); } } buttons += synhw.capClickPad; @@ -7332,6 +7341,44 @@ static struct isa_pnp_id psmcpnp_ids[] = { }; /* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ +static struct isa_pnp_id topbtpad_ids[] = { + { 0x1700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0017, ThinkPad */ + { 0x1800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0018, ThinkPad */ + { 0x1900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0019, ThinkPad */ + { 0x2300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0023, ThinkPad */ + { 0x2a00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002a, ThinkPad */ + { 0x2b00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002b, ThinkPad */ + { 0x2c00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002c, ThinkPad */ + { 0x2d00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002d, ThinkPad */ + { 0x2e00ae30, "Lenovo PS/2 clickpad port" }, /* LEN002e, ThinkPad */ + { 0x3300ae30, "Lenovo PS/2 clickpad port" }, /* LEN0033, ThinkPad */ + { 0x3400ae30, "Lenovo PS/2 clickpad port" }, /* LEN0034, ThinkPad */ + { 0x3500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0035, ThinkPad */ + { 0x3600ae30, "Lenovo PS/2 clickpad port" }, /* LEN0036, ThinkPad */ + { 0x3700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0037, ThinkPad */ + { 0x3800ae30, "Lenovo PS/2 clickpad port" }, /* LEN0038, ThinkPad */ + { 0x3900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0039, ThinkPad */ + { 0x4100ae30, "Lenovo PS/2 clickpad port" }, /* LEN0041, ThinkPad */ + { 0x4200ae30, "Lenovo PS/2 clickpad port" }, /* LEN0042, ThinkPad */ + { 0x4500ae30, "Lenovo PS/2 clickpad port" }, /* LEN0045, ThinkPad */ + { 0x4700ae30, "Lenovo PS/2 clickpad port" }, /* LEN0047, ThinkPad */ + { 0x4900ae30, "Lenovo PS/2 clickpad port" }, /* LEN0049, ThinkPad */ + { 0x0020ae30, "Lenovo PS/2 clickpad port" }, /* LEN2000, ThinkPad */ + { 0x0120ae30, "Lenovo PS/2 clickpad port" }, /* LEN2001, ThinkPad */ + { 0x0220ae30, "Lenovo PS/2 clickpad port" }, /* LEN2002, ThinkPad */ + { 0x0320ae30, "Lenovo PS/2 clickpad port" }, /* LEN2003, ThinkPad */ + { 0x0420ae30, "Lenovo PS/2 clickpad port" }, /* LEN2004, ThinkPad */ + { 0x0520ae30, "Lenovo PS/2 clickpad port" }, /* LEN2005, ThinkPad */ + { 0x0620ae30, "Lenovo PS/2 clickpad port" }, /* LEN2006, ThinkPad */ + { 0x0720ae30, "Lenovo PS/2 clickpad port" }, /* LEN2007, ThinkPad */ + { 0x0820ae30, "Lenovo PS/2 clickpad port" }, /* LEN2008, ThinkPad */ + { 0x0920ae30, "Lenovo PS/2 clickpad port" }, /* LEN2009, ThinkPad */ + { 0x0a20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200a, ThinkPad */ + { 0x0b20ae30, "Lenovo PS/2 clickpad port" }, /* LEN200b, ThinkPad */ + { 0 } +}; + +/* _HID list for quirk detection. Any device below has _CID from psmcpnp_ids */ static struct isa_pnp_id forcepad_ids[] = { { 0x0d302e4f, "HP PS/2 forcepad port" }, /* SYN300D, EB 1040 */ { 0x14302e4f, "HP PS/2 forcepad port" }, /* SYN3014, EB 1040 */ @@ -7371,6 +7418,8 @@ psmcpnp_probe(device_t dev) if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) sc->type = PSMCPNP_FORCEPAD; + else if (ISA_PNP_PROBE(device_get_parent(dev), dev, topbtpad_ids) == 0) + sc->type = PSMCPNP_TOPBUTTONPAD; else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) sc->type = PSMCPNP_GENERIC; else Modified: head/sys/sys/mouse.h ============================================================================== --- head/sys/sys/mouse.h Fri Jan 18 21:46:38 2019 (r343162) +++ head/sys/sys/mouse.h Fri Jan 18 22:20:29 2019 (r343163) @@ -136,6 +136,7 @@ typedef struct synapticshw { int infoXupmm; int infoYupmm; int forcePad; + int topButtonPad; } synapticshw_t; /* iftype */ From owner-svn-src-head@freebsd.org Fri Jan 18 22:31:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA0D14855D2; Fri, 18 Jan 2019 22:31:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7247761D; Fri, 18 Jan 2019 22:31:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f42.google.com with SMTP id g8so12097617iok.4; Fri, 18 Jan 2019 14:31:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xkJTxEJnjHWEuaQr4SShwcfuVgyenKqtIZtBWqhfDPU=; b=S3GsHMLKxvF6OwvEETTq28zjDXkkM7vNh8PqjC35RdNPvUMHdhQD62Y9HvzJcdu9RR ISTReDE+nXua7KLKDlJj9rI3HPpZ2NmZPiTFQs8BWJyhApA0crD39yQJuGMPg4HVZLlj ogiEUvvoeqtxZbvNtWQzIBDtK440zqTTphj+6erSqMLASxhNwdeOiJVjqSjE/hN/J1BQ eQciGanJ07ojju4ylzZ2p0ZJAC9bYiX+YVoxaM/osL41fC/o2AW31sC25uT4JwKR+DpH m7xK0vHJ4W7TNMdca8avTjzE2pj0TE1uQbQobfbYBn+bF+claP9M2000cfi8RBku7Fjz fxWg== X-Gm-Message-State: AJcUukdRVX77OuVv+4Yb4NjJqYcXmrscbHQLAXJbbQXoaQ383jtG/qI0 PFHQNLfrQSP2Q6PuK5qrzTQkdlFob5YRgWR6wN+KlQ== X-Google-Smtp-Source: ALg8bN4zWoXF22tF61I6NFKU+SI1LiLNa8rnM7vvLo5mqwYaMP9ir7fipm/YyWluZG2P21QcHQlZIBR4cNTYB279ID4= X-Received: by 2002:a5d:878d:: with SMTP id f13mr6357440ion.239.1547850667626; Fri, 18 Jan 2019 14:31:07 -0800 (PST) MIME-Version: 1.0 References: <201901181741.x0IHfjs6014631@repo.freebsd.org> <201901181751.x0IHpAkU056605@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901181751.x0IHpAkU056605@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Fri, 18 Jan 2019 17:30:54 -0500 Message-ID: Subject: Re: svn commit: r343152 - head/usr.sbin/freebsd-update To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8D7247761D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 22:31:15 -0000 On Fri, 18 Jan 2019 at 12:51, Rodney W. Grimes wrote: > > Since your in here fixing... there is a false positive on the > detection of what is installed when we zero the size of a set, > ie, now that doc.txz is a 0 size set it always thinks you have > doc installed due to rounding errors in the calculation that > says you have x% of this installed. Hi Rod, I'm not sure exactly what you mean here - could you clarify, or create a PR with the details? From owner-svn-src-head@freebsd.org Fri Jan 18 22:54:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37F4E14863DF; Fri, 18 Jan 2019 22:54:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD33080765; Fri, 18 Jan 2019 22:54:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0IMsY90057816; Fri, 18 Jan 2019 14:54:35 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0IMsYYW057815; Fri, 18 Jan 2019 14:54:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901182254.x0IMsYYW057815@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343152 - head/usr.sbin/freebsd-update In-Reply-To: To: Ed Maste Date: Fri, 18 Jan 2019 14:54:34 -0800 (PST) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: AD33080765 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 22:54:39 -0000 > On Fri, 18 Jan 2019 at 12:51, Rodney W. Grimes > wrote: > > > > Since your in here fixing... there is a false positive on the > > detection of what is installed when we zero the size of a set, > > ie, now that doc.txz is a 0 size set it always thinks you have > > doc installed due to rounding errors in the calculation that > > says you have x% of this installed. > > Hi Rod, I'm not sure exactly what you mean here - could you clarify, > or create a PR with the details? During the 12.0 release cycle the doc.txz part of the system went away, we put up an empty tar ball, when freebsd-update evaluates if you have installed this component it says you have, even though you have not. This is caused by function: upgrade_guess_components () { when it does this: join -t ' ' -1 2 -2 2 compfreq.present compfreq.total | while read S P T; do if [ ${P} -gt `expr ${T} / 2` ]; then echo ${S} fi done > comp.present When expr ${T} the count of items in the set is 0 all things are -gt 0 and so it says the component is present. This is an incorrect false positive. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 18 23:00:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF64314868DA; Fri, 18 Jan 2019 23:00:53 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5494180CD8; Fri, 18 Jan 2019 23:00:53 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49EC693C6; Fri, 18 Jan 2019 23:00:53 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0IN0rks086110; Fri, 18 Jan 2019 23:00:53 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0IN0r84086109; Fri, 18 Jan 2019 23:00:53 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201901182300.x0IN0r84086109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Fri, 18 Jan 2019 23:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343164 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: marck X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 343164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5494180CD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 23:00:53 -0000 Author: marck (doc committer) Date: Fri Jan 18 23:00:52 2019 New Revision: 343164 URL: https://svnweb.freebsd.org/changeset/base/343164 Log: Clarify error messages a bit. X-Found-With: r343112 MFC after: 1 month Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Fri Jan 18 22:20:29 2019 (r343163) +++ head/usr.sbin/jail/command.c Fri Jan 18 23:00:52 2019 (r343164) @@ -497,7 +497,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.devfs: no path"); + jail_warnx(j, "mount.devfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 5); @@ -528,7 +528,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.fdescfs: no path"); + jail_warnx(j, "mount.fdescfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 8); @@ -554,7 +554,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.procfs: no path"); + jail_warnx(j, "mount.procfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 6); From owner-svn-src-head@freebsd.org Fri Jan 18 23:26:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF6A61487149; Fri, 18 Jan 2019 23:26:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8247F818D6; Fri, 18 Jan 2019 23:26:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FF00988E; Fri, 18 Jan 2019 23:26:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0INQVJ9000129; Fri, 18 Jan 2019 23:26:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0INQV5l000128; Fri, 18 Jan 2019 23:26:31 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901182326.x0INQV5l000128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Jan 2019 23:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343165 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 343165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8247F818D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 23:26:32 -0000 Author: jhibbits Date: Fri Jan 18 23:26:31 2019 New Revision: 343165 URL: https://svnweb.freebsd.org/changeset/base/343165 Log: Fix top(1) long options handling getopt_long(3) requires the long options be terminated by a NULL block. Without the terminator, an invalid long option results in a segmentation fault. Reported by: Brandon Bergren MFC after: 1 week Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Jan 18 23:00:52 2019 (r343164) +++ head/usr.bin/top/top.c Fri Jan 18 23:26:31 2019 (r343165) @@ -110,7 +110,8 @@ static const struct option longopts[] = { { "uids", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'v' }, { "swap", no_argument, NULL, 'w' }, - { "system-idle-procs", no_argument, NULL, 'z' } + { "system-idle-procs", no_argument, NULL, 'z' }, + { NULL, 0, NULL, 0 } }; static void From owner-svn-src-head@freebsd.org Fri Jan 18 23:54:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2725D1487C0B; Fri, 18 Jan 2019 23:54:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0DB182880; Fri, 18 Jan 2019 23:54:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B06339D92; Fri, 18 Jan 2019 23:54:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0INspXw015767; Fri, 18 Jan 2019 23:54:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0INspeZ015766; Fri, 18 Jan 2019 23:54:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901182354.x0INspeZ015766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 18 Jan 2019 23:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343166 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 343166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0DB182880 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 18 Jan 2019 23:54:52 -0000 Author: cem Date: Fri Jan 18 23:54:51 2019 New Revision: 343166 URL: https://svnweb.freebsd.org/changeset/base/343166 Log: vmm(4): Mask Spectre feature bits on AMD hosts For parity with Intel hosts, which already mask out the CPUID feature bits that indicate the presence of the SPEC_CTRL MSR, do the same on AMD. Eventually we may want to have a better support story for guests, but for now, limit the damage of incorrectly indicating an MSR we do not yet support. Eventually, we may want a generic CPUID override system for administrators, or for minimum supported feature set in heterogenous environments with failover. That is a much larger scope effort than this bug fix. PR: 235010 Reported by: Rys Sommefeldt Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Fri Jan 18 23:26:31 2019 (r343165) +++ head/sys/amd64/vmm/x86.c Fri Jan 18 23:54:51 2019 (r343166) @@ -136,6 +136,14 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, case CPUID_8000_0008: cpuid_count(*eax, *ecx, regs); if (vmm_is_amd()) { + /* + * As on Intel (0000_0007:0, EDX), mask out + * unsupported or unsafe AMD extended features + * (8000_0008 EBX). + */ + regs[1] &= (AMDFEID_CLZERO | AMDFEID_IRPERF | + AMDFEID_XSAVEERPTR); + vm_get_topology(vm, &sockets, &cores, &threads, &maxcpus); /* From owner-svn-src-head@freebsd.org Sat Jan 19 01:08:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5441489D79; Sat, 19 Jan 2019 01:08:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21CD185283; Sat, 19 Jan 2019 01:08:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0J18kXl058216; Fri, 18 Jan 2019 17:08:46 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0J18isQ058215; Fri, 18 Jan 2019 17:08:44 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901190108.x0J18isQ058215@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343166 - head/sys/amd64/vmm In-Reply-To: <201901182354.x0INspeZ015766@repo.freebsd.org> To: Conrad Meyer Date: Fri, 18 Jan 2019 17:08:44 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 21CD185283 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 01:08:52 -0000 > Author: cem > Date: Fri Jan 18 23:54:51 2019 > New Revision: 343166 > URL: https://svnweb.freebsd.org/changeset/base/343166 > > Log: > vmm(4): Mask Spectre feature bits on AMD hosts > > For parity with Intel hosts, which already mask out the CPUID feature > bits that indicate the presence of the SPEC_CTRL MSR, do the same on > AMD. > > Eventually we may want to have a better support story for guests, but > for now, limit the damage of incorrectly indicating an MSR we do not yet > support. > > Eventually, we may want a generic CPUID override system for > administrators, or for minimum supported feature set in heterogenous > environments with failover. That is a much larger scope effort than > this bug fix. This area has a MAINTAINERS line, could you please respect it. > PR: 235010 > Reported by: Rys Sommefeldt > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/amd64/vmm/x86.c > > Modified: head/sys/amd64/vmm/x86.c > ============================================================================== > --- head/sys/amd64/vmm/x86.c Fri Jan 18 23:26:31 2019 (r343165) > +++ head/sys/amd64/vmm/x86.c Fri Jan 18 23:54:51 2019 (r343166) > @@ -136,6 +136,14 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, > case CPUID_8000_0008: > cpuid_count(*eax, *ecx, regs); > if (vmm_is_amd()) { > + /* > + * As on Intel (0000_0007:0, EDX), mask out > + * unsupported or unsafe AMD extended features > + * (8000_0008 EBX). > + */ > + regs[1] &= (AMDFEID_CLZERO | AMDFEID_IRPERF | > + AMDFEID_XSAVEERPTR); > + > vm_get_topology(vm, &sockets, &cores, &threads, > &maxcpus); > /* > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 19 04:54:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A818A14960B2; Sat, 19 Jan 2019 04:54:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE648DE8F; Sat, 19 Jan 2019 04:54:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 370C0DAF2; Sat, 19 Jan 2019 04:54:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0J4sDxt076385; Sat, 19 Jan 2019 04:54:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0J4sDiV076384; Sat, 19 Jan 2019 04:54:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901190454.x0J4sDiV076384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 Jan 2019 04:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343168 - head/sys/contrib/ncsw/user/env X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/contrib/ncsw/user/env X-SVN-Commit-Revision: 343168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DE648DE8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 04:54:13 -0000 Author: jhibbits Date: Sat Jan 19 04:54:12 2019 New Revision: 343168 URL: https://svnweb.freebsd.org/changeset/base/343168 Log: powerpc/dpaa: Handle DMAP virtual addresses in DPAA sendfile(2) appears to now use DMAP wherever possible. These addresses are not managed by pmap, so pmap_kextract() returns a 0 physical address, causing failure. This change fixes nginx running on P5020 SoC. MFC after: 3 weeks Modified: head/sys/contrib/ncsw/user/env/xx.c Modified: head/sys/contrib/ncsw/user/env/xx.c ============================================================================== --- head/sys/contrib/ncsw/user/env/xx.c Sat Jan 19 04:47:19 2019 (r343167) +++ head/sys/contrib/ncsw/user/env/xx.c Sat Jan 19 04:54:12 2019 (r343168) @@ -701,7 +701,12 @@ XX_VirtToPhys(void *addr) return (XX_PInfo.portal_ci_pa[QM_PORTAL][cpu] + (vm_offset_t)addr - XX_PInfo.portal_ci_va[QM_PORTAL]); - paddr = pmap_kextract((vm_offset_t)addr); + if (PMAP_HAS_DMAP && (vm_offset_t)addr >= DMAP_BASE_ADDRESS && + (vm_offset_t)addr <= DMAP_MAX_ADDRESS) + return (DMAP_TO_PHYS((vm_offset_t)addr)); + else + paddr = pmap_kextract((vm_offset_t)addr); + if (paddr == 0) printf("NetCommSW: " "Unable to translate virtual address %p!\n", addr); @@ -756,6 +761,9 @@ XX_PhysToVirt(physAddress_t addr) if (pv != NULL) return ((void *)(pv->pv_va + ((vm_offset_t)addr & PAGE_MASK))); + + if (PMAP_HAS_DMAP) + return ((void *)PHYS_TO_DMAP(addr)); printf("NetCommSW: " "Unable to translate physical address 0x%09jx!\n", (uintmax_t)addr); From owner-svn-src-head@freebsd.org Sat Jan 19 04:47:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404651495B83; Sat, 19 Jan 2019 04:47:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5A228D947; Sat, 19 Jan 2019 04:47:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C895FD925; Sat, 19 Jan 2019 04:47:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0J4lJW0071539; Sat, 19 Jan 2019 04:47:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0J4lJnP071537; Sat, 19 Jan 2019 04:47:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901190447.x0J4lJnP071537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 Jan 2019 04:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343167 - in head/sys/powerpc: powerpc pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: powerpc pseries X-SVN-Commit-Revision: 343167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5A228D947 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 04:47:20 -0000 Author: jhibbits Date: Sat Jan 19 04:47:19 2019 New Revision: 343167 URL: https://svnweb.freebsd.org/changeset/base/343167 Log: powerpc: Fix opaque irq data initialization The powerpc_intr structure is not zero-initialized, so on an invariants build would panic in the xics driver with an invalid pointer. Also fix the xics driver to share the private data setup code between xics_enable() and xics_bind(). Reported by: Leonardo Bianconi Modified: head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/pseries/xics.c Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Fri Jan 18 23:54:51 2019 (r343166) +++ head/sys/powerpc/powerpc/intr_machdep.c Sat Jan 19 04:47:19 2019 (r343167) @@ -209,6 +209,7 @@ intr_lookup(u_int irq) i->event = NULL; i->cntp = NULL; + i->priv = NULL; i->trig = INTR_TRIGGER_CONFORM; i->pol = INTR_POLARITY_CONFORM; i->irq = irq; Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Fri Jan 18 23:54:51 2019 (r343166) +++ head/sys/powerpc/pseries/xics.c Sat Jan 19 04:47:19 2019 (r343167) @@ -295,6 +295,20 @@ xics_attach(device_t dev) return (0); } +static __inline struct xicp_intvec * +xicp_setup_priv(struct xicp_softc *sc, u_int irq, void **priv) +{ + if (*priv == NULL) { + KASSERT(sc->nintvecs + 1 < nitems(sc->intvecs), + ("Too many XICP interrupts")); + mtx_lock(&sc->sc_mtx); + *priv = &sc->intvecs[sc->nintvecs++]; + mtx_unlock(&sc->sc_mtx); + } + + return (*priv); +} + /* * PIC I/F methods. */ @@ -311,11 +325,8 @@ xicp_bind(device_t dev, u_int irq, cpuset_t cpumask, v if (irq == MAX_XICP_IRQS) return; - if (*priv == NULL) - *priv = &sc->intvecs[sc->nintvecs++]; + iv = xicp_setup_priv(sc, irq, priv); - iv = *priv; - /* * This doesn't appear to actually support affinity groups, so pick a * random CPU. @@ -426,14 +437,7 @@ xicp_enable(device_t dev, u_int irq, u_int vector, voi /* Bind to this CPU to start: distrib. ID is last entry in gserver# */ cpu = PCPU_GET(hwref); - if (*priv == NULL) { - KASSERT(sc->nintvecs + 1 < nitems(sc->intvecs), - ("Too many XICP interrupts")); - mtx_lock(&sc->sc_mtx); - *priv = &sc->intvecs[sc->nintvecs++]; - mtx_unlock(&sc->sc_mtx); - } - intr = *priv; + intr = xicp_setup_priv(sc, irq, priv); intr->irq = irq; intr->vector = vector; From owner-svn-src-head@freebsd.org Sat Jan 19 05:20:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC3FA1496E68; Sat, 19 Jan 2019 05:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70E868EA51; Sat, 19 Jan 2019 05:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64B0EDEA9; Sat, 19 Jan 2019 05:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0J5KWh5087348; Sat, 19 Jan 2019 05:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0J5KWUu087347; Sat, 19 Jan 2019 05:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901190520.x0J5KWUu087347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 Jan 2019 05:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343169 - head/sys/contrib/ncsw/user/env X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/contrib/ncsw/user/env X-SVN-Commit-Revision: 343169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70E868EA51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 05:20:33 -0000 Author: jhibbits Date: Sat Jan 19 05:20:31 2019 New Revision: 343169 URL: https://svnweb.freebsd.org/changeset/base/343169 Log: dpaa: fix 32-bit build Book-E powerpc uses 64-bit vm_paddr_t, and 32-bit powerpc has 32-bit pointers, so gcc errors with cast to pointer from integer of different size. As this will not actually be used in reality anyway, simply quiet the warning by casting through uintptr_t. MFC after: 3 weeks MFC with: r343168 Modified: head/sys/contrib/ncsw/user/env/xx.c Modified: head/sys/contrib/ncsw/user/env/xx.c ============================================================================== --- head/sys/contrib/ncsw/user/env/xx.c Sat Jan 19 04:54:12 2019 (r343168) +++ head/sys/contrib/ncsw/user/env/xx.c Sat Jan 19 05:20:31 2019 (r343169) @@ -763,7 +763,7 @@ XX_PhysToVirt(physAddress_t addr) return ((void *)(pv->pv_va + ((vm_offset_t)addr & PAGE_MASK))); if (PMAP_HAS_DMAP) - return ((void *)PHYS_TO_DMAP(addr)); + return ((void *)(uintptr_t)PHYS_TO_DMAP(addr)); printf("NetCommSW: " "Unable to translate physical address 0x%09jx!\n", (uintmax_t)addr); From owner-svn-src-head@freebsd.org Sat Jan 19 05:31:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95491149775C; Sat, 19 Jan 2019 05:31:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3409D8F1B1; Sat, 19 Jan 2019 05:31:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E519E1EE; Sat, 19 Jan 2019 05:31:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0J5Vndd093394; Sat, 19 Jan 2019 05:31:49 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0J5VmUt093393; Sat, 19 Jan 2019 05:31:48 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901190531.x0J5VmUt093393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 19 Jan 2019 05:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343170 - head/sys/dev/aic7xxx X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/aic7xxx X-SVN-Commit-Revision: 343170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3409D8F1B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 05:31:49 -0000 Author: gonzo Date: Sat Jan 19 05:31:48 2019 New Revision: 343170 URL: https://svnweb.freebsd.org/changeset/base/343170 Log: [aic7xxx] Use correct product name 29320LPE instead of non-existent 39320LPE The PCI id belongs to Adaptec 29320LPE controller. The same fix also was merged[1] to OpenBSD driver ~6 years ago. [1] https://github.com/openbsd/src/commit/f997b5 PR: 172133 Submitted by: henning.petersen@t-online.de MFC after: 1 week Modified: head/sys/dev/aic7xxx/aic79xx_pci.c Modified: head/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_pci.c Sat Jan 19 05:20:31 2019 (r343169) +++ head/sys/dev/aic7xxx/aic79xx_pci.c Sat Jan 19 05:31:48 2019 (r343170) @@ -75,6 +75,7 @@ ahd_compose_id(u_int device, u_int vendor, u_int subde #define ID_AIC7901 0x800F9005FFFF9005ull #define ID_AHA_29320A 0x8000900500609005ull #define ID_AHA_29320ALP 0x8017900500449005ull +#define ID_AHA_29320LPE 0x8017900500459005ull #define ID_AIC7901A 0x801E9005FFFF9005ull #define ID_AHA_29320LP 0x8014900500449005ull @@ -91,7 +92,6 @@ ahd_compose_id(u_int device, u_int vendor, u_int subde #define ID_AHA_39320D_B 0x801C900500419005ull #define ID_AHA_39320D_HP 0x8011900500AC0E11ull #define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull -#define ID_AHA_39320LPE 0x8017900500459005ull #define ID_AIC7902_PCI_REV_A4 0x3 #define ID_AIC7902_PCI_REV_B0 0x10 #define SUBID_HP 0x0E11 @@ -144,6 +144,12 @@ struct ahd_pci_identity ahd_pci_ident_table [] = "Adaptec 29320ALP Ultra320 SCSI adapter", ahd_aic7901_setup }, + { + ID_AHA_29320LPE, + ID_ALL_MASK, + "Adaptec 29320LPE Ultra320 SCSI adapter", + ahd_aic7901_setup + }, /* aic7901A based controllers */ { ID_AHA_29320LP, @@ -210,12 +216,6 @@ struct ahd_pci_identity ahd_pci_ident_table [] = ID_AHA_39320D_B_HP, ID_ALL_MASK, "Adaptec (HP OEM) 39320D Ultra320 SCSI adapter", - ahd_aic7902_setup - }, - { - ID_AHA_39320LPE, - ID_ALL_MASK, - "Adaptec 39320LPE Ultra320 SCSI adapter", ahd_aic7902_setup }, /* Generic chip probes for devices we don't know 'exactly' */ From owner-svn-src-head@freebsd.org Sat Jan 19 16:04:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFDCD148541F; Sat, 19 Jan 2019 16:04:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE1B8839B; Sat, 19 Jan 2019 16:04:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4D61CD52; Sat, 19 Jan 2019 16:04:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0JG4Q6I027347; Sat, 19 Jan 2019 16:04:26 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0JG4QjI027346; Sat, 19 Jan 2019 16:04:26 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901191604.x0JG4QjI027346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 19 Jan 2019 16:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343190 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FE1B8839B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 16:04:27 -0000 Author: avos Date: Sat Jan 19 16:04:26 2019 New Revision: 343190 URL: https://svnweb.freebsd.org/changeset/base/343190 Log: net80211: drop m_pullup call from ieee80211_crypto_decap. For most wireless drivers Rx mbuf is allocated as one contiguous chunk; only few are using chains for allocations - but even then at least MCLBYTES (minus Rx descriptor size) is available in the first mbuf. In addition to the above, m_pullup was never called here - otherwise, reallocation will break post-crypto_decap logic (ieee80211_decap, ieee80211_deliver_data...), so just remove it; length check is left in case if some truncated frame appears here. PR: 234241 MFC after: 1 week Modified: head/sys/net80211/ieee80211_crypto.c Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Sat Jan 19 15:07:25 2019 (r343189) +++ head/sys/net80211/ieee80211_crypto.c Sat Jan 19 16:04:26 2019 (r343190) @@ -662,14 +662,15 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, stru k = &ni->ni_ucastkey; /* - * Insure crypto header is contiguous for all decap work. + * Insure crypto header is contiguous and long enough for all + * decap work. */ cip = k->wk_cipher; - if (m->m_len < hdrlen + cip->ic_header && - (m = m_pullup(m, hdrlen + cip->ic_header)) == NULL) { + if (m->m_len < hdrlen + cip->ic_header) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, - "unable to pullup %s header", cip->ic_name); - vap->iv_stats.is_rx_wepfail++; /* XXX */ + "frame is too short (%d < %u) for crypto decap", + cip->ic_name, m->m_len, hdrlen + cip->ic_header); + vap->iv_stats.is_rx_tooshort++; *key = NULL; return (0); } From owner-svn-src-head@freebsd.org Sat Jan 19 20:45:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 459EB1494691; Sat, 19 Jan 2019 20:45:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1AC76F09A; Sat, 19 Jan 2019 20:45:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D130E1FC4D; Sat, 19 Jan 2019 20:45:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0JKjfQV077082; Sat, 19 Jan 2019 20:45:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0JKjf04077081; Sat, 19 Jan 2019 20:45:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901192045.x0JKjf04077081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 19 Jan 2019 20:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343203 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 343203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1AC76F09A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 19 Jan 2019 20:45:42 -0000 Author: tsoome Date: Sat Jan 19 20:45:41 2019 New Revision: 343203 URL: https://svnweb.freebsd.org/changeset/base/343203 Log: ixgbe: this statement may fall through warnings with gcc The recent gcc versions (7 and 8 at least) can check for switch case statements for fall through (implicit-fallthrough). When fall through is intentional, the default method for warning suppression is to place comment /* FALLTHROUGH */ exactly before next case statement. Differential Revision: https://reviews.freebsd.org/D18577 Modified: head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_common.c Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 19 19:04:00 2019 (r343202) +++ head/sys/dev/ixgbe/ixgbe_82599.c Sat Jan 19 20:45:41 2019 (r343203) @@ -1750,7 +1750,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *h case 0x0000: /* mask VLAN ID */ fdirm |= IXGBE_FDIRM_VLANID; - /* fall through */ + /* FALLTHROUGH */ case 0x0FFF: /* mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANP; @@ -2039,7 +2039,7 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_h DEBUGOUT(" Error on src/dst port\n"); return IXGBE_ERR_CONFIG; } - /* fall through */ + /* FALLTHROUGH */ case IXGBE_ATR_FLOW_TYPE_TCPV4: case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4: case IXGBE_ATR_FLOW_TYPE_UDPV4: Modified: head/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.c Sat Jan 19 19:04:00 2019 (r343202) +++ head/sys/dev/ixgbe/ixgbe_common.c Sat Jan 19 20:45:41 2019 (r343203) @@ -269,7 +269,8 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - /* fall through - only backplane uses autoc */ + /* only backplane uses autoc */ + /* FALLTHROUGH */ case ixgbe_media_type_fiber_fixed: case ixgbe_media_type_fiber_qsfp: case ixgbe_media_type_fiber: @@ -4756,7 +4757,8 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int rxpktsize <<= IXGBE_RXPBSIZE_SHIFT; for (; i < (num_pb / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); - /* fall through - configure remaining packet buffers */ + /* configure remaining packet buffers */ + /* FALLTHROUGH */ case PBA_STRATEGY_EQUAL: rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; for (; i < num_pb; i++)