Question
Avez-vous... Si vous ne voyez pas ce message correctement, [consultez-le en ligne] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZQ=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqlcmXn4+gnNmnk5Si0GKMqqt8f4GDlZdidWidc5NkZ2Vgq3N2lnN6lG2ZdWaZZm2Zp2tqaWuckmiTa5xe05mn=8). [(image)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgp8eWnNFiy6Ni=8) Bonjour, La fin d'année approche à grands pas ! Avez-vous un projet de vidéo en dessin animés ? [(image)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgqdGnq9eWyl+W0qBj28Wpmp9z2Z9rjJ+dlMWab2ZoyA=8) Vidéo en motion design : une communication impactante • Présenter votre entreprise, produit ou service • Communiquer sur les mesures sanitaires • Rassurer vos collaborateurs et clients + d'infos : [Cliquez-ici] (mailto:thie...@wedeo.fr?subject=En%20savoir%20plus%20sur%20le%20motion%20design%20) Avez-vous pensé à vos voeux ? Figurez-vous que la carte de vœux en motion design est appréciée pour son dynamisme et son efficacité. Ainsi, faites place à l'originalité et présentez vos voeux en vidéo ! [(image)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGasn9qmpZCUnJGFsYNgvJdkr9iWog=8) La vidéo de voeux sur mesure • Renforcer le sentiment d’appartenance • Délivrer un message fort • Impacter votre entourage professionnel +d'infos : [Cliquez-ici] (mailto:thie...@wedeo.fr?subject=En%20savoir%20plus%20sur%20les%20vid%C3%A9o%20de%20voeux) [(image)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgqdGnq9eWyl+W0qBj28Wpmp9z2Z9+apvSZJWlj4OazA=8) La vidéo de voeux personnalisable • Communiquer simplement et rapidement • Personnalisation à votre image • Bénéficier d'une solution abordable + d'infos : [Cliquez-ici] (mailto:thie...@wedeo.fr?subject=En%20savoir%20plus%20sur%20la%20vid%C3%A9o%20de%20voeux) Prenez soin de vous et de vos proches ! Thierry Maillard / CEO ☎️ 06.12.98.41.16 Voir l'intégralité de nos vidéos: [Cliquez-ici] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgqdGnq9eWyl+W0qBjx8yWpaWZz5GId429gbtmnHx5nXWgsJGOsX/ThnnFf5uT2p6bnKPW=8) [(image)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgp8eWnNFiy6Ni=8) Un correspondant dans votre région • Agent île de france : 01.86.86.01.42 • Agent Ouest : 02.52.68.36.82 • Agent Est : 03.74.82.00.14 • Agent Sud : 04.28.63.00.35 • Agent Sud-Ouest : 05.36.28.10.79 [(image:Facebook)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xglsOVnMSj1JxhxqKhk7uam5yjsNGnnaXSdMikoJqelA=8) [(image:Youtube)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgqdGnq9eWyl+W0qBjx8yWpaWZz5GId429gbtmnHx5nXWgsJGOsX/ThnnFf5uT2p6bnKPW=8) [(image:LinkedIn)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgnMugoseYzp9hxqKhk8ekpKeV0dtiq5vIldJg=8) [(image:Instagram)] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgmdClq8Ob15KgkZaj0ZOsnJuZ0sFi=8) Notre société produit plus de 40 vidéos motion design par mois. Que vous soyez une TPE ou PME , nous vous accompagnons de A à Z dans la réalisation de contenus attractives et captivants. [Contactez-nous] (https://wedeo-news.com/c6.php?ec=2=i3p9q3itgGlo=ZGRolWSbY2hq=ZA=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGaqp9xgp8eWnNFiy6NixqKi2MWYq5yukNCiqamT=8) Si vous ne souhaitez plus recevoir nos messages, suivez ce lien : [Veuillez me retirer de votre liste de diffusion] (https://wedeo-news.com/d6.php?ec=2=i3p9q3itgGlo=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=ZGRolWSbY2hq=8) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367582 - stable/12/sys/kern
Author: kib Date: Wed Nov 11 00:43:13 2020 New Revision: 367582 URL: https://svnweb.freebsd.org/changeset/base/367582 Log: MFC r367120: Check for process group change in tty_wait_background(). PR: 250701 Modified: stable/12/sys/kern/tty.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/tty.c == --- stable/12/sys/kern/tty.cTue Nov 10 23:25:16 2020(r367581) +++ stable/12/sys/kern/tty.cWed Nov 11 00:43:13 2020(r367582) @@ -464,6 +464,19 @@ tty_wait_background(struct tty *tp, struct thread *td, sig = 0; } PGRP_LOCK(pg); + + /* +* pg may no longer be our process group. +* Re-check after locking process group. +*/ + PROC_LOCK(p); + if (p->p_pgrp != pg) { + PROC_UNLOCK(p); + PGRP_UNLOCK(pg); + continue; + } + + PROC_UNLOCK(p); pgsignal(pg, ksi.ksi_signo, 1, ); PGRP_UNLOCK(pg); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367581 - head/sys/conf
Author: imp Date: Tue Nov 10 23:25:16 2020 New Revision: 367581 URL: https://svnweb.freebsd.org/changeset/base/367581 Log: Add INIT_ALL_ZERO and INIT_ALL_PATTERN to kern.opts.mk These options need to be in the kern.opts.mk file to be alive for kernel and module builds. This also reverts r367579 since that's not needed with this fix: the host's bsd.opts.mk is irrelevant. Reviewed by: brooks@ Differential Revision: https://reviews.freebsd.org/D27170 Modified: head/sys/conf/kern.mk head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.mk == --- head/sys/conf/kern.mk Tue Nov 10 21:29:10 2020(r367580) +++ head/sys/conf/kern.mk Tue Nov 10 23:25:16 2020(r367581) @@ -230,15 +230,15 @@ CFLAGS+= -mretpoline # # Initialize stack variables on function entry # -.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes" -.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=zero \ -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang .else .warning InitAll (zeros) requested but not support by compiler .endif -.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes" -.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern .else .warning InitAll (pattern) requested but not support by compiler Modified: head/sys/conf/kern.opts.mk == --- head/sys/conf/kern.opts.mk Tue Nov 10 21:29:10 2020(r367580) +++ head/sys/conf/kern.opts.mk Tue Nov 10 23:25:16 2020(r367581) @@ -52,6 +52,8 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BHYVE_SNAPSHOT \ EXTRA_TCP_STACKS \ +INIT_ALL_PATTERN \ +INIT_ALL_ZERO \ KERNEL_RETPOLINE \ OFED \ RATELIMIT \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
On Tue, Nov 10, 2020 at 02:44:45PM -0500, Shawn Webb wrote: > On Tue, Nov 10, 2020 at 07:17:29PM +, Brooks Davis wrote: > > On Tue, Nov 10, 2020 at 07:15:14PM +, Brooks Davis wrote: > > > Author: brooks > > > Date: Tue Nov 10 19:15:13 2020 > > > New Revision: 367577 > > > URL: https://svnweb.freebsd.org/changeset/base/367577 > > > > > > Log: > > > Support initializing stack variables on function entry > > > > > > There are two options: > > >- WITH_INIT_ALL_ZERO: Zero all variables on the stack. > > >- WITH_INIT_ALL_PATTERN: Initialize variables with well-defined > > > patterns. > > > > > > The exact pattern are a compiler implementation detail and vary by type. > > > They are somewhat documented in the LLVM commit message: > > > https://reviews.llvm.org/rL349442 > > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > > > than naming them after the LLVM specific compiler flags. > > > > > > In a range of consumer products, options like these are used in > > > both debug and production builds with debugs builds using patterns > > > (intended to provoke crashes on use of uninitialized values) and > > > production using zeros (deemed more likely to lead to harmless > > > misbehavior or NULL-pointer dereferences). > > > > We've tested this extensively in CheriBSD on RISC-V, in the wild it's > > probably most tested on Arm64 and x86. > > > > Despite the silly compiler flag you'll spot in the code, the zeroing > > option isn't going away in practice as Apple, Google, and Microsoft all > > ship with this feature in some of their products. > > HardenedBSD's testing of this last year on amd64 have (privately) > shown the feature to really hinder performance on more complex > applications (like when applied to clang/lld). A build of base > without init all zero applied to clang/lld would take around 1.5 > hours on my system. A build with it applied to clang/lld took around > four hours, if my memory serves correctly. I would probably advise > against applying it system-wide. But YMMV. I agree a more nuanced approach is likely useful in practice, but this does work and is part of the configuration we shipped for DARPA's FETT bug bounty. Hopefully this provides a starting point for further exploration. -- Brooks signature.asc Description: PGP signature
Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
Sorry about that. I've fixed it in r367579. -- Brooks On Tue, Nov 10, 2020 at 12:46:45PM -0800, Matthew Macy wrote: > These flags aren't defined by default when building external kernel modules: > > gmake[2]: Entering directory '/usr/home/matt/devel/ZoF/module' > env -u MAKEFLAGS make -C /home/matt/devel/ZoF/module -f Makefile.bsd -w > make[3]: Entering directory `/home/matt/devel/ZoF/module' > make[3]: "/usr/home/matt/devel/freebsd/sys/conf/kern.mk" line 233: > Malformed conditional (${MK_INIT_ALL_ZERO} == "yes") > make[3]: Fatal errors encountered -- cannot continue > make[3]: stopped in /home/matt/devel/ZoF/module > gmake[2]: *** [Makefile:53: modules-FreeBSD] Error 1 > gmake[2]: Leaving directory '/usr/home/matt/devel/ZoF/module' > > On Tue, Nov 10, 2020 at 11:15 AM Brooks Davis wrote: > > > > Author: brooks > > Date: Tue Nov 10 19:15:13 2020 > > New Revision: 367577 > > URL: https://svnweb.freebsd.org/changeset/base/367577 > > > > Log: > > Support initializing stack variables on function entry > > > > There are two options: > >- WITH_INIT_ALL_ZERO: Zero all variables on the stack. > >- WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. > > > > The exact pattern are a compiler implementation detail and vary by type. > > They are somewhat documented in the LLVM commit message: > > https://reviews.llvm.org/rL349442 > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > > than naming them after the LLVM specific compiler flags. > > > > In a range of consumer products, options like these are used in > > both debug and production builds with debugs builds using patterns > > (intended to provoke crashes on use of uninitialized values) and > > production using zeros (deemed more likely to lead to harmless > > misbehavior or NULL-pointer dereferences). > > > > Reviewed by: emaste > > Obtained from:CheriBSD > > Sponsored by: DARPA > > Differential Revision:https://reviews.freebsd.org/D27131 > > > > Added: > > head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props changed) > > head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props changed) > > Modified: > > head/share/mk/bsd.compiler.mk > > head/share/mk/bsd.lib.mk > > head/share/mk/bsd.opts.mk > > head/share/mk/bsd.prog.mk > > head/sys/conf/kern.mk > > > > Modified: head/share/mk/bsd.compiler.mk > > == > > --- head/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 > > (r367576) > > +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 > > (r367577) > > @@ -24,6 +24,7 @@ > > # - c++11: supports full (or nearly full) C++11 programming > > environment. > > # - retpoline: supports the retpoline speculative execution vulnerability > > # mitigation. > > +# - init-all: supports stack variable initialization. > > # > > # These variables with an X_ prefix will also be provided if XCC is set. > > # > > @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES= c++11 c++14 > > ${X_}COMPILER_FEATURES+= c++17 > > .endif > > .if ${${X_}COMPILER_TYPE} == "clang" > > -${X_}COMPILER_FEATURES+= retpoline > > +${X_}COMPILER_FEATURES+= retpoline init-all > > .endif > > > > .else > > > > Modified: head/share/mk/bsd.lib.mk > > == > > --- head/share/mk/bsd.lib.mkTue Nov 10 19:09:35 2020(r367576) > > +++ head/share/mk/bsd.lib.mkTue Nov 10 19:15:13 2020(r367577) > > @@ -85,6 +85,25 @@ LDFLAGS+= -Wl,-zretpolineplt > > .endif > > .endif > > > > +# Initialize stack variables on function entry > > +.if ${MK_INIT_ALL_ZERO} == "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+= -ftrivial-auto-var-init=zero \ > > + > > -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > > +CXXFLAGS+= -ftrivial-auto-var-init=zero \ > > + > > -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > > +.else > > +.warning InitAll (zeros) requested but not support by compiler > > +.endif > > +.elif ${MK_INIT_ALL_PATTERN} == "yes" > > +.if ${COMPILER_FEATURES:Minit-all} > > +CFLAGS+= -ftrivial-auto-var-init=pattern > > +CXXFLAGS+= -ftrivial-auto-var-init=pattern > > +.else > > +.warning InitAll (pattern) requested but not support by compiler > > +.endif > > +.endif > > + > > .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ > > empty(DEBUG_FLAGS:M-gdwarf*) > > CFLAGS+= ${DEBUG_FILES_CFLAGS} > > > > Modified: head/share/mk/bsd.opts.mk > > == > > --- head/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020(r367576) > > +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020(r367577) > > @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS = \ > > BIND_NOW \ > >
svn commit: r367580 - head/sys/kern
Author: mjg Date: Tue Nov 10 21:29:10 2020 New Revision: 367580 URL: https://svnweb.freebsd.org/changeset/base/367580 Log: thread: tidy up r367543 "locked" variable is spurious in the committed version. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c == --- head/sys/kern/kern_proc.c Tue Nov 10 21:12:32 2020(r367579) +++ head/sys/kern/kern_proc.c Tue Nov 10 21:29:10 2020(r367580) @@ -2748,7 +2748,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct stack *st; struct sbuf sb; struct proc *p; - bool locked; name = (int *)arg1; error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, ); @@ -2789,14 +2788,12 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) i++; } PROC_UNLOCK(p); - locked = false; numthreads = i; for (i = 0; i < numthreads; i++) { td = tdfind(lwpidarray[i], p->p_pid); if (td == NULL) { continue; } - locked = true; bzero(kkstp, sizeof(*kkstp)); (void)sbuf_new(, kkstp->kkst_trace, sizeof(kkstp->kkst_trace), SBUF_FIXEDLEN); @@ -2810,7 +2807,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) kkstp->kkst_state = KKST_STATE_RUNNING; thread_unlock(td); PROC_UNLOCK(p); - locked = false; stack_sbuf_print(, st); sbuf_finish(); sbuf_delete(); @@ -2818,10 +2814,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) if (error) break; } - if (!locked) - PROC_LOCK(p); - _PRELE(p); - PROC_UNLOCK(p); + PRELE(p); if (lwpidarray != NULL) free(lwpidarray, M_TEMP); stack_destroy(st); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367579 - head/sys/conf
Author: brooks Date: Tue Nov 10 21:12:32 2020 New Revision: 367579 URL: https://svnweb.freebsd.org/changeset/base/367579 Log: Be more tolerant of share/mk and kern.mk mismatch When building out-of-tree modules, it appears that the system share/mk is used, but sys/conf/kern.mk is used. That results in MK_INIT_ALL_ZERO being undefined. In the interest of maximum compatability, check that MK_INIT_ALL_* and COMPILER_FEATURES are defined before comparing their values. Reported by: mmacy Sponsored by: DARPA Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk == --- head/sys/conf/kern.mk Tue Nov 10 19:54:39 2020(r367578) +++ head/sys/conf/kern.mk Tue Nov 10 21:12:32 2020(r367579) @@ -230,15 +230,15 @@ CFLAGS+= -mretpoline # # Initialize stack variables on function entry # -.if ${MK_INIT_ALL_ZERO} == "yes" -.if ${COMPILER_FEATURES:Minit-all} +.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes" +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=zero \ -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang .else .warning InitAll (zeros) requested but not support by compiler .endif -.elif ${MK_INIT_ALL_PATTERN} == "yes" -.if ${COMPILER_FEATURES:Minit-all} +.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes" +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern .else .warning InitAll (pattern) requested but not support by compiler ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
These flags aren't defined by default when building external kernel modules: gmake[2]: Entering directory '/usr/home/matt/devel/ZoF/module' env -u MAKEFLAGS make -C /home/matt/devel/ZoF/module -f Makefile.bsd -w make[3]: Entering directory `/home/matt/devel/ZoF/module' make[3]: "/usr/home/matt/devel/freebsd/sys/conf/kern.mk" line 233: Malformed conditional (${MK_INIT_ALL_ZERO} == "yes") make[3]: Fatal errors encountered -- cannot continue make[3]: stopped in /home/matt/devel/ZoF/module gmake[2]: *** [Makefile:53: modules-FreeBSD] Error 1 gmake[2]: Leaving directory '/usr/home/matt/devel/ZoF/module' On Tue, Nov 10, 2020 at 11:15 AM Brooks Davis wrote: > > Author: brooks > Date: Tue Nov 10 19:15:13 2020 > New Revision: 367577 > URL: https://svnweb.freebsd.org/changeset/base/367577 > > Log: > Support initializing stack variables on function entry > > There are two options: >- WITH_INIT_ALL_ZERO: Zero all variables on the stack. >- WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. > > The exact pattern are a compiler implementation detail and vary by type. > They are somewhat documented in the LLVM commit message: > https://reviews.llvm.org/rL349442 > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > than naming them after the LLVM specific compiler flags. > > In a range of consumer products, options like these are used in > both debug and production builds with debugs builds using patterns > (intended to provoke crashes on use of uninitialized values) and > production using zeros (deemed more likely to lead to harmless > misbehavior or NULL-pointer dereferences). > > Reviewed by: emaste > Obtained from:CheriBSD > Sponsored by: DARPA > Differential Revision:https://reviews.freebsd.org/D27131 > > Added: > head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props changed) > head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props changed) > Modified: > head/share/mk/bsd.compiler.mk > head/share/mk/bsd.lib.mk > head/share/mk/bsd.opts.mk > head/share/mk/bsd.prog.mk > head/sys/conf/kern.mk > > Modified: head/share/mk/bsd.compiler.mk > == > --- head/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 > (r367576) > +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 > (r367577) > @@ -24,6 +24,7 @@ > # - c++11: supports full (or nearly full) C++11 programming environment. > # - retpoline: supports the retpoline speculative execution vulnerability > # mitigation. > +# - init-all: supports stack variable initialization. > # > # These variables with an X_ prefix will also be provided if XCC is set. > # > @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES= c++11 c++14 > ${X_}COMPILER_FEATURES+= c++17 > .endif > .if ${${X_}COMPILER_TYPE} == "clang" > -${X_}COMPILER_FEATURES+= retpoline > +${X_}COMPILER_FEATURES+= retpoline init-all > .endif > > .else > > Modified: head/share/mk/bsd.lib.mk > == > --- head/share/mk/bsd.lib.mkTue Nov 10 19:09:35 2020(r367576) > +++ head/share/mk/bsd.lib.mkTue Nov 10 19:15:13 2020(r367577) > @@ -85,6 +85,25 @@ LDFLAGS+= -Wl,-zretpolineplt > .endif > .endif > > +# Initialize stack variables on function entry > +.if ${MK_INIT_ALL_ZERO} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=zero \ > +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +CXXFLAGS+= -ftrivial-auto-var-init=zero \ > +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang > +.else > +.warning InitAll (zeros) requested but not support by compiler > +.endif > +.elif ${MK_INIT_ALL_PATTERN} == "yes" > +.if ${COMPILER_FEATURES:Minit-all} > +CFLAGS+= -ftrivial-auto-var-init=pattern > +CXXFLAGS+= -ftrivial-auto-var-init=pattern > +.else > +.warning InitAll (pattern) requested but not support by compiler > +.endif > +.endif > + > .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ > empty(DEBUG_FLAGS:M-gdwarf*) > CFLAGS+= ${DEBUG_FILES_CFLAGS} > > Modified: head/share/mk/bsd.opts.mk > == > --- head/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020(r367576) > +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020(r367577) > @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS = \ > BIND_NOW \ > CCACHE_BUILD \ > CTF \ > +INIT_ALL_PATTERN \ > +INIT_ALL_ZERO \ > INSTALL_AS_USER \ > PIE \ > RETPOLINE \ > @@ -84,6 +86,10 @@ __DEFAULT_DEPENDENT_OPTIONS = \ > > > .include > + > +.if ${MK_INIT_ALL_PATTERN} == "yes" && ${MK_INIT_ALL_ZERO} == "yes" > +.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. > +.endif > > #
svn commit: r367578 - head/sys/dev/cxgbe/tom
Author: jhb Date: Tue Nov 10 19:54:39 2020 New Revision: 367578 URL: https://svnweb.freebsd.org/changeset/base/367578 Log: Clear tp->tod in t4_pcb_detach(). Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear. In particular, if a newly accepted socket falls back to non-TOE due to an active open failure, the non-TOE socket will still have tp->tod set even though TF_TOE is clear. Reviewed by: np MFC after:2 weeks Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D27028 Modified: head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c == --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Nov 10 19:15:13 2020 (r367577) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Nov 10 19:54:39 2020 (r367578) @@ -382,6 +382,7 @@ t4_pcb_detach(struct toedev *tod __unused, struct tcpc } #endif + tp->tod = NULL; tp->t_toe = NULL; tp->t_flags &= ~TF_TOE; toep->flags &= ~TPF_ATTACHED; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
On Tue, Nov 10, 2020 at 07:17:29PM +, Brooks Davis wrote: > On Tue, Nov 10, 2020 at 07:15:14PM +, Brooks Davis wrote: > > Author: brooks > > Date: Tue Nov 10 19:15:13 2020 > > New Revision: 367577 > > URL: https://svnweb.freebsd.org/changeset/base/367577 > > > > Log: > > Support initializing stack variables on function entry > > > > There are two options: > >- WITH_INIT_ALL_ZERO: Zero all variables on the stack. > >- WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. > > > > The exact pattern are a compiler implementation detail and vary by type. > > They are somewhat documented in the LLVM commit message: > > https://reviews.llvm.org/rL349442 > > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > > than naming them after the LLVM specific compiler flags. > > > > In a range of consumer products, options like these are used in > > both debug and production builds with debugs builds using patterns > > (intended to provoke crashes on use of uninitialized values) and > > production using zeros (deemed more likely to lead to harmless > > misbehavior or NULL-pointer dereferences). > > We've tested this extensively in CheriBSD on RISC-V, in the wild it's > probably most tested on Arm64 and x86. > > Despite the silly compiler flag you'll spot in the code, the zeroing > option isn't going away in practice as Apple, Google, and Microsoft all > ship with this feature in some of their products. HardenedBSD's testing of this last year on amd64 have (privately) shown the feature to really hinder performance on more complex applications (like when applied to clang/lld). A build of base without init all zero applied to clang/lld would take around 1.5 hours on my system. A build with it applied to clang/lld took around four hours, if my memory serves correctly. I would probably advise against applying it system-wide. But YMMV. Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc signature.asc Description: PGP signature
Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
On Tue, Nov 10, 2020 at 07:15:14PM +, Brooks Davis wrote: > Author: brooks > Date: Tue Nov 10 19:15:13 2020 > New Revision: 367577 > URL: https://svnweb.freebsd.org/changeset/base/367577 > > Log: > Support initializing stack variables on function entry > > There are two options: >- WITH_INIT_ALL_ZERO: Zero all variables on the stack. >- WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. > > The exact pattern are a compiler implementation detail and vary by type. > They are somewhat documented in the LLVM commit message: > https://reviews.llvm.org/rL349442 > I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather > than naming them after the LLVM specific compiler flags. > > In a range of consumer products, options like these are used in > both debug and production builds with debugs builds using patterns > (intended to provoke crashes on use of uninitialized values) and > production using zeros (deemed more likely to lead to harmless > misbehavior or NULL-pointer dereferences). We've tested this extensively in CheriBSD on RISC-V, in the wild it's probably most tested on Arm64 and x86. Despite the silly compiler flag you'll spot in the code, the zeroing option isn't going away in practice as Apple, Google, and Microsoft all ship with this feature in some of their products. -- Brooks signature.asc Description: PGP signature
svn commit: r367577 - in head: share/mk sys/conf tools/build/options
Author: brooks Date: Tue Nov 10 19:15:13 2020 New Revision: 367577 URL: https://svnweb.freebsd.org/changeset/base/367577 Log: Support initializing stack variables on function entry There are two options: - WITH_INIT_ALL_ZERO: Zero all variables on the stack. - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patterns. The exact pattern are a compiler implementation detail and vary by type. They are somewhat documented in the LLVM commit message: https://reviews.llvm.org/rL349442 I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather than naming them after the LLVM specific compiler flags. In a range of consumer products, options like these are used in both debug and production builds with debugs builds using patterns (intended to provoke crashes on use of uninitialized values) and production using zeros (deemed more likely to lead to harmless misbehavior or NULL-pointer dereferences). Reviewed by: emaste Obtained from:CheriBSD Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27131 Added: head/tools/build/options/WITH_INIT_ALL_PATTERN (contents, props changed) head/tools/build/options/WITH_INIT_ALL_ZERO (contents, props changed) Modified: head/share/mk/bsd.compiler.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.compiler.mk == --- head/share/mk/bsd.compiler.mk Tue Nov 10 19:09:35 2020 (r367576) +++ head/share/mk/bsd.compiler.mk Tue Nov 10 19:15:13 2020 (r367577) @@ -24,6 +24,7 @@ # - c++11: supports full (or nearly full) C++11 programming environment. # - retpoline: supports the retpoline speculative execution vulnerability # mitigation. +# - init-all: supports stack variable initialization. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -214,7 +215,7 @@ ${X_}COMPILER_FEATURES= c++11 c++14 ${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= retpoline +${X_}COMPILER_FEATURES+= retpoline init-all .endif .else Modified: head/share/mk/bsd.lib.mk == --- head/share/mk/bsd.lib.mkTue Nov 10 19:09:35 2020(r367576) +++ head/share/mk/bsd.lib.mkTue Nov 10 19:15:13 2020(r367577) @@ -85,6 +85,25 @@ LDFLAGS+= -Wl,-zretpolineplt .endif .endif +# Initialize stack variables on function entry +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=zero \ +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -ftrivial-auto-var-init=zero \ +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.else +.warning InitAll (zeros) requested but not support by compiler +.endif +.elif ${MK_INIT_ALL_PATTERN} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=pattern +CXXFLAGS+= -ftrivial-auto-var-init=pattern +.else +.warning InitAll (pattern) requested but not support by compiler +.endif +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: head/share/mk/bsd.opts.mk == --- head/share/mk/bsd.opts.mk Tue Nov 10 19:09:35 2020(r367576) +++ head/share/mk/bsd.opts.mk Tue Nov 10 19:15:13 2020(r367577) @@ -71,6 +71,8 @@ __DEFAULT_NO_OPTIONS = \ BIND_NOW \ CCACHE_BUILD \ CTF \ +INIT_ALL_PATTERN \ +INIT_ALL_ZERO \ INSTALL_AS_USER \ PIE \ RETPOLINE \ @@ -84,6 +86,10 @@ __DEFAULT_DEPENDENT_OPTIONS = \ .include + +.if ${MK_INIT_ALL_PATTERN} == "yes" && ${MK_INIT_ALL_ZERO} == "yes" +.error WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive. +.endif # # Supported NO_* options (if defined, MK_* will be forced to "no", Modified: head/share/mk/bsd.prog.mk == --- head/share/mk/bsd.prog.mk Tue Nov 10 19:09:35 2020(r367576) +++ head/share/mk/bsd.prog.mk Tue Nov 10 19:15:13 2020(r367577) @@ -60,6 +60,25 @@ LDFLAGS+= -Wl,-zretpolineplt .endif .endif +# Initialize stack variables on function entry +.if ${MK_INIT_ALL_ZERO} == "yes" +.if ${COMPILER_FEATURES:Minit-all} +CFLAGS+= -ftrivial-auto-var-init=zero \ +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -ftrivial-auto-var-init=zero \ +-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.else +.warning InitAll (zeros) requested but not support by compiler +.endif +.elif ${MK_INIT_ALL_PATTERN} ==
svn commit: r367576 - in head/lib/csu/tests: . dynamic dynamicpie
Author: jhb Date: Tue Nov 10 19:09:35 2020 New Revision: 367576 URL: https://svnweb.freebsd.org/changeset/base/367576 Log: Add C startup code tests for PIE binaries. - Force dynamic to be a non-PIE binary. - Add a dynamicpie test which uses a PIE binary. Reviewed by: andrew Obtained from:CheriBSD MFC after:2 weeks Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27127 Added: head/lib/csu/tests/dynamicpie/ head/lib/csu/tests/dynamicpie/Makefile - copied, changed from r367573, head/lib/csu/tests/dynamic/Makefile Modified: head/lib/csu/tests/Makefile head/lib/csu/tests/dynamic/Makefile Modified: head/lib/csu/tests/Makefile == --- head/lib/csu/tests/Makefile Tue Nov 10 19:07:30 2020(r367575) +++ head/lib/csu/tests/Makefile Tue Nov 10 19:09:35 2020(r367576) @@ -3,6 +3,7 @@ SUBDIR=dso TESTS_SUBDIRS= dynamic TESTS_SUBDIRS+=dynamiclib +TESTS_SUBDIRS+=dynamicpie TESTS_SUBDIRS+=static SUBDIR_DEPEND_dynamiclib=dso Modified: head/lib/csu/tests/dynamic/Makefile == --- head/lib/csu/tests/dynamic/Makefile Tue Nov 10 19:07:30 2020 (r367575) +++ head/lib/csu/tests/dynamic/Makefile Tue Nov 10 19:09:35 2020 (r367576) @@ -2,5 +2,8 @@ .PATH: ${.CURDIR:H} +.include +MK_PIE=no + .include "../Makefile.tests" .include Copied and modified: head/lib/csu/tests/dynamicpie/Makefile (from r367573, head/lib/csu/tests/dynamic/Makefile) == --- head/lib/csu/tests/dynamic/Makefile Tue Nov 10 18:12:09 2020 (r367573, copy source) +++ head/lib/csu/tests/dynamicpie/Makefile Tue Nov 10 19:09:35 2020 (r367576) @@ -2,5 +2,8 @@ .PATH: ${.CURDIR:H} +.include +MK_PIE=yes + .include "../Makefile.tests" .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367575 - head/lib/csu/tests
Author: jhb Date: Tue Nov 10 19:07:30 2020 New Revision: 367575 URL: https://svnweb.freebsd.org/changeset/base/367575 Log: Fix dso_handle_check for PIE executables. PIE executables use crtbeginS.o and have a non-NULL dso_handle as a result. Reviewed by: andrew, emaste MFC after:2 weeks Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27126 Modified: head/lib/csu/tests/fini_test.c Modified: head/lib/csu/tests/fini_test.c == --- head/lib/csu/tests/fini_test.c Tue Nov 10 19:04:54 2020 (r367574) +++ head/lib/csu/tests/fini_test.c Tue Nov 10 19:07:30 2020 (r367575) @@ -141,9 +141,9 @@ dso_handle_check(void) { void *dso = __dso_handle; -#ifdef DSO_LIB +#if defined(DSO_LIB) || defined(__PIE__) ATF_REQUIRE_MSG(dso != NULL, - "Null __dso_handle in DSO"); + "Null __dso_handle in DSO/PIE"); #else ATF_REQUIRE_MSG(dso == NULL, "Invalid __dso_handle in non-DSO"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367574 - head/lib/csu/common
Author: jhb Date: Tue Nov 10 19:04:54 2020 New Revision: 367574 URL: https://svnweb.freebsd.org/changeset/base/367574 Log: Rename __JCR_LIST__ to __JCR_END__ in crtend.c. This is more consistent with the names used for .ctor and .dtor symbols and better reflects __JCR_END__'s role. Reviewed by: andrew Obtained from:CheriBSD MFC after:2 weeks Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27125 Modified: head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtend.c == --- head/lib/csu/common/crtend.cTue Nov 10 18:12:09 2020 (r367573) +++ head/lib/csu/common/crtend.cTue Nov 10 19:04:54 2020 (r367574) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); typedef void (*crt_func)(void); -static crt_func __JCR_LIST__[] __section(".jcr") __used = { +static crt_func __JCR_END__[] __section(".jcr") __used = { (crt_func)0 }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367573 - head/sys/vm
Author: jtl Date: Tue Nov 10 18:12:09 2020 New Revision: 367573 URL: https://svnweb.freebsd.org/changeset/base/367573 Log: When destroying a UMA zone which has a reserve (set with uma_zone_reserve()), messages like the following appear on the console: "Freed UMA keg (Test zone) was not empty (0 items). Lost 528 pages of memory." When keg_drain_domain() is draining the zone, it tries to keep the number of items specified in the reservation. However, when we are destroying the UMA zone, we do not need to keep those items. Therefore, when destroying a non-secondary and non-cache zone, we should reset the keg reservation to 0 prior to draining the zone. Reviewed by: markj Sponsored by: Netflix Differential Revision:https://reviews.freebsd.org/D27129 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Tue Nov 10 18:10:50 2020(r367572) +++ head/sys/vm/uma_core.c Tue Nov 10 18:12:09 2020(r367573) @@ -2791,6 +2791,10 @@ zone_dtor(void *arg, int size, void *udata) rw_wlock(_rwlock); LIST_REMOVE(zone, uz_link); rw_wunlock(_rwlock); + if ((zone->uz_flags & (UMA_ZONE_SECONDARY | UMA_ZFLAG_CACHE)) == 0) { + keg = zone->uz_keg; + keg->uk_reserve = 0; + } zone_reclaim(zone, M_WAITOK, true); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367572 - head/sys/kern
Author: mjg Date: Tue Nov 10 18:10:50 2020 New Revision: 367572 URL: https://svnweb.freebsd.org/changeset/base/367572 Log: Allow rtprio_thread to operate on threads of any process This in particular unbreaks rtkit. The limitation was a leftover of previous state, to quote a comment: /* * Though lwpid is unique, only current process is supported * since there is no efficient way to look up a LWP yet. */ Long since then a global tid hash was introduced to remedy the problem. Permission checks still apply. Submitted by: greg_unrelenting.technology (Greg V) Differential Revision:https://reviews.freebsd.org/D27158 Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c == --- head/sys/kern/kern_resource.c Tue Nov 10 18:07:13 2020 (r367571) +++ head/sys/kern/kern_resource.c Tue Nov 10 18:10:50 2020 (r367572) @@ -315,8 +315,7 @@ sys_rtprio_thread(struct thread *td, struct rtprio_thr td1 = td; PROC_LOCK(p); } else { - /* Only look up thread in current process */ - td1 = tdfind(uap->lwpid, curproc->p_pid); + td1 = tdfind(uap->lwpid, -1); if (td1 == NULL) return (ESRCH); p = td1->td_proc; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367571 - stable/12/sys/kern
Author: brooks Date: Tue Nov 10 18:07:13 2020 New Revision: 367571 URL: https://svnweb.freebsd.org/changeset/base/367571 Log: MFC r367302: sysvshm: pass relevant uap members as arguments Alter shmget_allocate_segment and shmget_existing to take the values they want from struct shmget_args rather than passing the struct around. In general, uap structures should only be the interface to sys_ functions. This makes one small functional change and records the allocated space rather than the requested space. If this turns out to be a problem (e.g. if software tries to find undersized segments by exact size rather than using keys), we can correct that easily. Reviewed by: kib Obtained from:CheriBSD Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27077 Modified: stable/12/sys/kern/sysv_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sysv_shm.c == --- stable/12/sys/kern/sysv_shm.c Tue Nov 10 18:05:17 2020 (r367570) +++ stable/12/sys/kern/sysv_shm.c Tue Nov 10 18:07:13 2020 (r367571) @@ -111,11 +111,6 @@ FEATURE(sysv_shm, "System V shared memory segments sup static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -static int shmget_allocate_segment(struct thread *td, -struct shmget_args *uap, int mode); -static int shmget_existing(struct thread *td, struct shmget_args *uap, -int mode, int segnum); - #defineSHMSEG_FREE 0x0200 #defineSHMSEG_REMOVED 0x0400 #defineSHMSEG_ALLOCATED0x0800 @@ -134,6 +129,10 @@ static void shm_deallocate_segment(struct shmid_kernel static int shm_find_segment_by_key(struct prison *, key_t); static struct shmid_kernel *shm_find_segment(struct prison *, int, bool); static int shm_delete_mapping(struct vmspace *vm, struct shmmap_state *); +static int shmget_allocate_segment(struct thread *td, key_t key, size_t size, +int mode); +static int shmget_existing(struct thread *td, size_t size, int shmflg, +int mode, int segnum); static void shmrealloc(void); static int shminit(void); static int sysvshm_modload(struct module *, int, void *); @@ -659,7 +658,7 @@ done: static int -shmget_existing(struct thread *td, struct shmget_args *uap, int mode, +shmget_existing(struct thread *td, size_t size, int shmflg, int mode, int segnum) { struct shmid_kernel *shmseg; @@ -671,35 +670,34 @@ shmget_existing(struct thread *td, struct shmget_args KASSERT(segnum >= 0 && segnum < shmalloced, ("segnum %d shmalloced %d", segnum, shmalloced)); shmseg = [segnum]; - if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) + if ((shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) return (EEXIST); #ifdef MAC - error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, uap->shmflg); + error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, shmflg); if (error != 0) return (error); #endif - if (uap->size != 0 && uap->size > shmseg->u.shm_segsz) + if (size != 0 && size > shmseg->u.shm_segsz) return (EINVAL); td->td_retval[0] = IXSEQ_TO_IPCID(segnum, shmseg->u.shm_perm); return (0); } static int -shmget_allocate_segment(struct thread *td, struct shmget_args *uap, int mode) +shmget_allocate_segment(struct thread *td, key_t key, size_t size, int mode) { struct ucred *cred = td->td_ucred; struct shmid_kernel *shmseg; vm_object_t shm_object; int i, segnum; - size_t size; SYSVSHM_ASSERT_LOCKED(); - if (uap->size < shminfo.shmmin || uap->size > shminfo.shmmax) + if (size < shminfo.shmmin || size > shminfo.shmmax) return (EINVAL); if (shm_nused >= shminfo.shmmni) /* Any shmids left? */ return (ENOSPC); - size = round_page(uap->size); + size = round_page(size); if (shm_committed + btoc(size) > shminfo.shmall) return (ENOMEM); if (shm_last_free < 0) { @@ -760,10 +758,10 @@ shmget_allocate_segment(struct thread *td, struct shmg shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED; - shmseg->u.shm_perm.key = uap->key; + shmseg->u.shm_perm.key = key; shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff; shmseg->cred = crhold(cred); - shmseg->u.shm_segsz = uap->size; + shmseg->u.shm_segsz = size; shmseg->u.shm_cpid = td->td_proc->p_pid; shmseg->u.shm_lpid = shmseg->u.shm_nattch = 0; shmseg->u.shm_atime = shmseg->u.shm_dtime = 0; @@ -796,16 +794,18 @@
svn commit: r367570 - head/share/mk
Author: bdrewery Date: Tue Nov 10 18:05:17 2020 New Revision: 367570 URL: https://svnweb.freebsd.org/changeset/base/367570 Log: makeman: Don't require filemon with MK_DIRDEPS_BUILD. MFC after:2 weeks Reviewed by: sjg, dim (tested earlier version) Sponsored by: Dell EMC Differential Revision:https://reviews.freebsd.org/D27134 Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk == --- head/share/mk/local.meta.sys.mk Tue Nov 10 14:23:46 2020 (r367569) +++ head/share/mk/local.meta.sys.mk Tue Nov 10 18:05:17 2020 (r367570) @@ -178,6 +178,10 @@ LDFLAGS_LAST+= -L${STAGE_LIBDIR} # we can use this but should not update it. UPDATE_DEPENDFILE= NO .endif +# Don't require filemon for makeman. +.if make(showconfig) +UPDATE_DEPENDFILE= NO +.endif # define the list of places that contain files we are responsible for .MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367569 - head/sys/contrib/openzfs/module/zfs
Author: mjg Date: Tue Nov 10 14:23:46 2020 New Revision: 367569 URL: https://svnweb.freebsd.org/changeset/base/367569 Log: zfs: combine zio caches if possible This deduplicates 2 sets of caches using the same sizes. Memory savings fluctuate a lot, one sample result is buildworld on zfs saving ~180MB RAM in reduced page count associated with zio caches. Modified: head/sys/contrib/openzfs/module/zfs/zio.c Modified: head/sys/contrib/openzfs/module/zfs/zio.c == --- head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:21:23 2020 (r367568) +++ head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:23:46 2020 (r367569) @@ -204,6 +204,19 @@ zio_init(void) if (align != 0) { char name[36]; + if (cflags == data_cflags) { + /* +* Resulting kmem caches would be identical. +* Save memory by creating only one. +*/ + (void) snprintf(name, sizeof (name), + "zio_buf_comb_%lu", (ulong_t)size); + zio_buf_cache[c] = kmem_cache_create(name, + size, align, NULL, NULL, NULL, NULL, NULL, + cflags); + zio_data_buf_cache[c] = zio_buf_cache[c]; + continue; + } (void) snprintf(name, sizeof (name), "zio_buf_%lu", (ulong_t)size); zio_buf_cache[c] = kmem_cache_create(name, size, @@ -234,37 +247,55 @@ zio_init(void) void zio_fini(void) { - size_t c; - kmem_cache_t *last_cache = NULL; - kmem_cache_t *last_data_cache = NULL; + size_t i, j, n; + kmem_cache_t *cache; - for (c = 0; c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; c++) { -#ifdef _ILP32 - /* -* Cache size limited to 1M on 32-bit platforms until ARC -* buffers no longer require virtual address space. -*/ - if (((c + 1) << SPA_MINBLOCKSHIFT) > zfs_max_recordsize) - break; -#endif + n = SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; + #if defined(ZFS_DEBUG) && !defined(_KERNEL) - if (zio_buf_cache_allocs[c] != zio_buf_cache_frees[c]) + for (i = 0; i < n; i++) { + if (zio_buf_cache_allocs[i] != zio_buf_cache_frees[i]) (void) printf("zio_fini: [%d] %llu != %llu\n", - (int)((c + 1) << SPA_MINBLOCKSHIFT), - (long long unsigned)zio_buf_cache_allocs[c], - (long long unsigned)zio_buf_cache_frees[c]); + (int)((i + 1) << SPA_MINBLOCKSHIFT), + (long long unsigned)zio_buf_cache_allocs[i], + (long long unsigned)zio_buf_cache_frees[i]); + } #endif - if (zio_buf_cache[c] != last_cache) { - last_cache = zio_buf_cache[c]; - kmem_cache_destroy(zio_buf_cache[c]); + + /* +* The same kmem cache can show up multiple times in both zio_buf_cache +* and zio_data_buf_cache. Do a wasteful but trivially correct scan to +* sort it out. +*/ + for (i = 0; i < n; i++) { + cache = zio_buf_cache[i]; + if (cache == NULL) + continue; + for (j = i; j < n; j++) { + if (cache == zio_buf_cache[j]) + zio_buf_cache[j] = NULL; + if (cache == zio_data_buf_cache[j]) + zio_data_buf_cache[j] = NULL; } - zio_buf_cache[c] = NULL; + kmem_cache_destroy(cache); + } - if (zio_data_buf_cache[c] != last_data_cache) { - last_data_cache = zio_data_buf_cache[c]; - kmem_cache_destroy(zio_data_buf_cache[c]); + for (i = 0; i < n; i++) { + cache = zio_data_buf_cache[i]; + if (cache == NULL) + continue; + for (j = i; j < n; j++) { + if (cache == zio_data_buf_cache[j]) + zio_data_buf_cache[j] = NULL; } - zio_data_buf_cache[c] = NULL; + kmem_cache_destroy(cache); + } + + for (i = 0; i < n; i++) { + if (zio_buf_cache[i] != NULL) + panic("zio_fini: zio_buf_cache[%d] != NULL", (int)i); + if (zio_data_buf_cache[i] != NULL) + panic("zio_fini: zio_data_buf_cache[%d] !=
svn commit: r367568 - head/sys/contrib/openzfs/module/zfs
Author: mjg Date: Tue Nov 10 14:21:23 2020 New Revision: 367568 URL: https://svnweb.freebsd.org/changeset/base/367568 Log: zfs: g/c unused data_alloc_arena Modified: head/sys/contrib/openzfs/module/zfs/zio.c Modified: head/sys/contrib/openzfs/module/zfs/zio.c == --- head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:17:05 2020 (r367567) +++ head/sys/contrib/openzfs/module/zfs/zio.c Tue Nov 10 14:21:23 2020 (r367568) @@ -144,7 +144,6 @@ void zio_init(void) { size_t c; - vmem_t *data_alloc_arena = NULL; zio_cache = kmem_cache_create("zio_cache", sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); @@ -213,8 +212,7 @@ zio_init(void) (void) snprintf(name, sizeof (name), "zio_data_buf_%lu", (ulong_t)size); zio_data_buf_cache[c] = kmem_cache_create(name, size, - align, NULL, NULL, NULL, NULL, - data_alloc_arena, data_cflags); + align, NULL, NULL, NULL, NULL, NULL, data_cflags); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367567 - head/sbin/reboot
Author: 0mp (doc,ports committer) Date: Tue Nov 10 14:17:05 2020 New Revision: 367567 URL: https://svnweb.freebsd.org/changeset/base/367567 Log: Address a mandoc warning MFC after:3 days Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 == --- head/sbin/reboot/boot_i386.8Tue Nov 10 13:36:07 2020 (r367566) +++ head/sbin/reboot/boot_i386.8Tue Nov 10 14:17:05 2020 (r367567) @@ -89,7 +89,7 @@ from partition of either the floppy or the hard disk. This boot may be aborted by typing any character on the keyboard at the -.Ql boot: +.Ql boot\&: prompt. At this time, the following input will be accepted: .Bl -tag -width indent ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367566 - stable/12/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Tue Nov 10 13:36:07 2020 New Revision: 367566 URL: https://svnweb.freebsd.org/changeset/base/367566 Log: MFC r366751: Remove ifdefs around IS_ALIGNED() definition in the LinuxKPI. Discussed with: manu@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h == --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Nov 10 13:33:39 2020(r367565) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Nov 10 13:36:07 2020(r367566) @@ -135,10 +135,7 @@ extern const volatile int lkpi_build_bug_on_zero; #defineALIGN(x, y) roundup2((x), (y)) #undef PTR_ALIGN #definePTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 5 -/* Moved from linuxkpi_gplv2 */ #defineIS_ALIGNED(x, a)(((x) & ((__typeof(x))(a) - 1)) == 0) -#endif #defineDIV_ROUND_UP(x, n) howmany(x, n) #define__KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #defineDIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367565 - in stable/11/sys/dev/usb: . quirk
Author: hselasky Date: Tue Nov 10 13:33:39 2020 New Revision: 367565 URL: https://svnweb.freebsd.org/changeset/base/367565 Log: MFC r366806: Add new USB quirk. PR: 250422 Submitted by: vidwer+fbsdb...@gmail.com Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c == --- stable/11/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:32:50 2020 (r367564) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:33:39 2020 (r367565) @@ -191,6 +191,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(CYPRESS, XX6830XX, 0x, 0x, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(EMTEC, DANEELEC4GB, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI, Modified: stable/11/sys/dev/usb/usbdevs == --- stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:32:50 2020 (r367564) +++ stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:33:39 2020 (r367565) @@ -1811,6 +1811,7 @@ product ELV USBI2C0xe00f USB-I2C interface product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter /* Emtec products */ +product EMTEC DANEELEC4GB 0x1e20 USB DISK Pro PMAP product EMTEC RUF2PS 0x2240 Flash Drive /* Encore products */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367564 - in stable/12/sys/dev/usb: . quirk
Author: hselasky Date: Tue Nov 10 13:32:50 2020 New Revision: 367564 URL: https://svnweb.freebsd.org/changeset/base/367564 Log: MFC r366806: Add new USB quirk. PR: 250422 Submitted by: vidwer+fbsdb...@gmail.com Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c == --- stable/12/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:31:01 2020 (r367563) +++ stable/12/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:32:50 2020 (r367564) @@ -221,6 +221,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(CYPRESS, XX6830XX, 0x, 0x, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(EMTEC, DANEELEC4GB, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI, Modified: stable/12/sys/dev/usb/usbdevs == --- stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:31:01 2020 (r367563) +++ stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:32:50 2020 (r367564) @@ -1885,6 +1885,7 @@ product ELV USBI2C0xe00f USB-I2C interface product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter /* Emtec products */ +product EMTEC DANEELEC4GB 0x1e20 USB DISK Pro PMAP product EMTEC RUF2PS 0x2240 Flash Drive /* Encore products */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367563 - stable/11/sys/ofed/drivers/infiniband/core
Author: hselasky Date: Tue Nov 10 13:31:01 2020 New Revision: 367563 URL: https://svnweb.freebsd.org/changeset/base/367563 Log: MFC r367269: Fix for referencing file via its vnode in ibore. Use the native vnode lookup functions, instead of going via the LinuxKPI, because the file referenced is typically created outside the LinuxKPI, and the LinuxKPI's fdget() can only resolve file descriptor numbers which were created by itself. The vnode pointer is used as an identifier to identify XRCD handles which are sharing resources. This patch fixes the so-called XRCD support in ibcore for FreeBSD. Refer to ibv_open_xrcd(3) for more information how the file descriptor argument is used. Reviewed by: kib@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c == --- stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:22:52 2020(r367562) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:31:01 2020(r367563) @@ -666,11 +666,11 @@ err_put: struct xrcd_table_entry { struct rb_node node; struct ib_xrcd *xrcd; - struct inode *inode; + struct vnode *vnode; }; static int xrcd_table_insert(struct ib_uverbs_device *dev, - struct inode *inode, + struct vnode *vnode, struct ib_xrcd *xrcd) { struct xrcd_table_entry *entry, *scan; @@ -682,15 +682,15 @@ static int xrcd_table_insert(struct ib_uverbs_device * return -ENOMEM; entry->xrcd = xrcd; - entry->inode = inode; + entry->vnode = vnode; while (*p) { parent = *p; scan = rb_entry(parent, struct xrcd_table_entry, node); - if (inode < scan->inode) { + if ((uintptr_t)vnode < (uintptr_t)scan->vnode) { p = &(*p)->rb_left; - } else if (inode > scan->inode) { + } else if ((uintptr_t)vnode > (uintptr_t)scan->vnode) { p = &(*p)->rb_right; } else { kfree(entry); @@ -700,12 +700,12 @@ static int xrcd_table_insert(struct ib_uverbs_device * rb_link_node(>node, parent, p); rb_insert_color(>node, >xrcd_tree); - igrab(inode); + vrefact(vnode); return 0; } static struct xrcd_table_entry *xrcd_table_search(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; struct rb_node *p = dev->xrcd_tree.rb_node; @@ -713,9 +713,9 @@ static struct xrcd_table_entry *xrcd_table_search(stru while (p) { entry = rb_entry(p, struct xrcd_table_entry, node); - if (inode < entry->inode) + if ((uintptr_t)vnode < (uintptr_t)entry->vnode) p = p->rb_left; - else if (inode > entry->inode) + else if ((uintptr_t)vnode > (uintptr_t)entry->vnode) p = p->rb_right; else return entry; @@ -724,11 +724,11 @@ static struct xrcd_table_entry *xrcd_table_search(stru return NULL; } -static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct inode *inode) +static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (!entry) return NULL; @@ -736,13 +736,13 @@ static struct ib_xrcd *find_xrcd(struct ib_uverbs_devi } static void xrcd_table_delete(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (entry) { - iput(inode); + vrele(vnode); rb_erase(>node, >xrcd_tree); kfree(entry); } @@ -758,8 +758,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil struct ib_udata udata; struct ib_uxrcd_object *obj; struct ib_xrcd *xrcd = NULL; - struct fd f = {NULL}; - struct inode *inode = NULL; + struct vnode *vnode = NULL; int ret = 0; int
svn commit: r367562 - stable/12/sys/ofed/drivers/infiniband/core
Author: hselasky Date: Tue Nov 10 13:22:52 2020 New Revision: 367562 URL: https://svnweb.freebsd.org/changeset/base/367562 Log: MFC r367269: Fix for referencing file via its vnode in ibore. Use the native vnode lookup functions, instead of going via the LinuxKPI, because the file referenced is typically created outside the LinuxKPI, and the LinuxKPI's fdget() can only resolve file descriptor numbers which were created by itself. The vnode pointer is used as an identifier to identify XRCD handles which are sharing resources. This patch fixes the so-called XRCD support in ibcore for FreeBSD. Refer to ibv_open_xrcd(3) for more information how the file descriptor argument is used. Reviewed by: kib@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c == --- stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:21:02 2020(r367561) +++ stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:22:52 2020(r367562) @@ -666,11 +666,11 @@ err_put: struct xrcd_table_entry { struct rb_node node; struct ib_xrcd *xrcd; - struct inode *inode; + struct vnode *vnode; }; static int xrcd_table_insert(struct ib_uverbs_device *dev, - struct inode *inode, + struct vnode *vnode, struct ib_xrcd *xrcd) { struct xrcd_table_entry *entry, *scan; @@ -682,15 +682,15 @@ static int xrcd_table_insert(struct ib_uverbs_device * return -ENOMEM; entry->xrcd = xrcd; - entry->inode = inode; + entry->vnode = vnode; while (*p) { parent = *p; scan = rb_entry(parent, struct xrcd_table_entry, node); - if (inode < scan->inode) { + if ((uintptr_t)vnode < (uintptr_t)scan->vnode) { p = &(*p)->rb_left; - } else if (inode > scan->inode) { + } else if ((uintptr_t)vnode > (uintptr_t)scan->vnode) { p = &(*p)->rb_right; } else { kfree(entry); @@ -700,12 +700,12 @@ static int xrcd_table_insert(struct ib_uverbs_device * rb_link_node(>node, parent, p); rb_insert_color(>node, >xrcd_tree); - igrab(inode); + vrefact(vnode); return 0; } static struct xrcd_table_entry *xrcd_table_search(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; struct rb_node *p = dev->xrcd_tree.rb_node; @@ -713,9 +713,9 @@ static struct xrcd_table_entry *xrcd_table_search(stru while (p) { entry = rb_entry(p, struct xrcd_table_entry, node); - if (inode < entry->inode) + if ((uintptr_t)vnode < (uintptr_t)entry->vnode) p = p->rb_left; - else if (inode > entry->inode) + else if ((uintptr_t)vnode > (uintptr_t)entry->vnode) p = p->rb_right; else return entry; @@ -724,11 +724,11 @@ static struct xrcd_table_entry *xrcd_table_search(stru return NULL; } -static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct inode *inode) +static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (!entry) return NULL; @@ -736,13 +736,13 @@ static struct ib_xrcd *find_xrcd(struct ib_uverbs_devi } static void xrcd_table_delete(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (entry) { - iput(inode); + vrele(vnode); rb_erase(>node, >xrcd_tree); kfree(entry); } @@ -758,8 +758,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil struct ib_udata udata; struct ib_uxrcd_object *obj; struct ib_xrcd *xrcd = NULL; - struct fd f = {NULL}; - struct inode *inode = NULL; + struct vnode *vnode = NULL; int ret = 0; int
svn commit: r367561 - in stable/11: share/man/man4 sys/dev/usb sys/dev/usb/input
Author: hselasky Date: Tue Nov 10 13:21:02 2020 New Revision: 367561 URL: https://svnweb.freebsd.org/changeset/base/367561 Log: MFC r367236: Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4). Submitted by: pedro martelletto Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/share/man/man4/uhid.4 stable/11/sys/dev/usb/input/uhid.c stable/11/sys/dev/usb/usb_generic.c stable/11/sys/dev/usb/usb_generic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/uhid.4 == --- stable/11/share/man/man4/uhid.4 Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/share/man/man4/uhid.4 Tue Nov 10 13:21:02 2020 (r367561) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd Oct 31, 2020 .Dt UHID 4 .Os .Sh NAME @@ -114,6 +114,11 @@ It should be or .Dv UHID_FEATURE_REPORT . This call may fail if the device does not support this feature. +.It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" +Returns information about the device, like USB vendor ID and USB product ID. +This call will not issue any USB transactions. +Also refer to +.Xr ugen 4 . .El .Pp Use Modified: stable/11/sys/dev/usb/input/uhid.c == --- stable/11/sys/dev/usb/input/uhid.c Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/sys/dev/usb/input/uhid.c Tue Nov 10 13:21:02 2020 (r367561) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #defineUSB_DEBUG_VAR uhid_debug #include @@ -141,11 +142,13 @@ static usb_fifo_cmd_t uhid_stop_write; static usb_fifo_open_t uhid_open; static usb_fifo_close_t uhid_close; static usb_fifo_ioctl_t uhid_ioctl; +static usb_fifo_ioctl_t uhid_ioctl_post; static struct usb_fifo_methods uhid_fifo_methods = { .f_open = _open, .f_close = _close, .f_ioctl = _ioctl, + .f_ioctl_post = _ioctl_post, .f_start_read = _start_read, .f_stop_read = _stop_read, .f_start_write = _start_write, @@ -642,6 +645,24 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *ad case USB_GET_REPORT_ID: *(int *)addr = 0; /* XXX: we only support reportid 0? */ + break; + + default: + error = ENOIOCTL; + break; + } + return (error); +} + +static int +uhid_ioctl_post(struct usb_fifo *fifo, u_long cmd, void *addr, +int fflags) +{ + int error; + + switch (cmd) { + case USB_GET_DEVICEINFO: + error = ugen_fill_deviceinfo(fifo, addr); break; default: Modified: stable/11/sys/dev/usb/usb_generic.c == --- stable/11/sys/dev/usb/usb_generic.c Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/sys/dev/usb/usb_generic.c Tue Nov 10 13:21:02 2020 (r367561) @@ -107,8 +107,6 @@ static int ugen_set_interface(struct usb_fifo *, uint8 static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd); -static int usb_gen_fill_deviceinfo(struct usb_fifo *, - struct usb_device_info *); static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); @@ -815,7 +813,7 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g } /** - * usb_gen_fill_deviceinfo + * ugen_fill_deviceinfo * * This function dumps information about an USB device to the * structure pointed to by the "di" argument. @@ -824,8 +822,8 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g *0: Success * Else: Failure **/ -static int -usb_gen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) +int +ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) { struct usb_device *udev; struct usb_device *hub; @@ -2214,7 +2212,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * case USB_DEVICEINFO: case USB_GET_DEVICEINFO: - error = usb_gen_fill_deviceinfo(f, addr); + error = ugen_fill_deviceinfo(f, addr); break; case USB_DEVICESTATS: Modified: stable/11/sys/dev/usb/usb_generic.h == --- stable/11/sys/dev/usb/usb_generic.h Tue Nov 10 13:18:44 2020 (r367560)
svn commit: r367560 - in stable/12: share/man/man4 sys/dev/usb sys/dev/usb/input
Author: hselasky Date: Tue Nov 10 13:18:44 2020 New Revision: 367560 URL: https://svnweb.freebsd.org/changeset/base/367560 Log: MFC r367236: Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4). Submitted by: pedro martelletto Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/share/man/man4/uhid.4 stable/12/sys/dev/usb/input/uhid.c stable/12/sys/dev/usb/usb_generic.c stable/12/sys/dev/usb/usb_generic.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/uhid.4 == --- stable/12/share/man/man4/uhid.4 Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/share/man/man4/uhid.4 Tue Nov 10 13:18:44 2020 (r367560) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2018 +.Dd Oct 31, 2020 .Dt UHID 4 .Os .Sh NAME @@ -131,6 +131,11 @@ and the .Va ugd_maxlen fields. This call may fail if the device does not support this feature. +.It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" +Returns information about the device, like USB vendor ID and USB product ID. +This call will not issue any USB transactions. +Also refer to +.Xr ugen 4 . .El .Pp Use Modified: stable/12/sys/dev/usb/input/uhid.c == --- stable/12/sys/dev/usb/input/uhid.c Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/sys/dev/usb/input/uhid.c Tue Nov 10 13:18:44 2020 (r367560) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #defineUSB_DEBUG_VAR uhid_debug #include @@ -143,11 +144,13 @@ static usb_fifo_cmd_t uhid_stop_write; static usb_fifo_open_t uhid_open; static usb_fifo_close_t uhid_close; static usb_fifo_ioctl_t uhid_ioctl; +static usb_fifo_ioctl_t uhid_ioctl_post; static struct usb_fifo_methods uhid_fifo_methods = { .f_open = _open, .f_close = _close, .f_ioctl = _ioctl, + .f_ioctl_post = _ioctl_post, .f_start_read = _start_read, .f_stop_read = _stop_read, .f_start_write = _start_write, @@ -644,6 +647,24 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *ad case USB_GET_REPORT_ID: *(int *)addr = 0; /* XXX: we only support reportid 0? */ + break; + + default: + error = ENOIOCTL; + break; + } + return (error); +} + +static int +uhid_ioctl_post(struct usb_fifo *fifo, u_long cmd, void *addr, +int fflags) +{ + int error; + + switch (cmd) { + case USB_GET_DEVICEINFO: + error = ugen_fill_deviceinfo(fifo, addr); break; default: Modified: stable/12/sys/dev/usb/usb_generic.c == --- stable/12/sys/dev/usb/usb_generic.c Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/sys/dev/usb/usb_generic.c Tue Nov 10 13:18:44 2020 (r367560) @@ -109,8 +109,6 @@ static int ugen_set_interface(struct usb_fifo *, uint8 static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd); -static int usb_gen_fill_deviceinfo(struct usb_fifo *, - struct usb_device_info *); static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); @@ -817,7 +815,7 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g } /** - * usb_gen_fill_deviceinfo + * ugen_fill_deviceinfo * * This function dumps information about an USB device to the * structure pointed to by the "di" argument. @@ -826,8 +824,8 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g *0: Success * Else: Failure **/ -static int -usb_gen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) +int +ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) { struct usb_device *udev; struct usb_device *hub; @@ -2216,7 +2214,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * case USB_DEVICEINFO: case USB_GET_DEVICEINFO: - error = usb_gen_fill_deviceinfo(f, addr); + error = ugen_fill_deviceinfo(f, addr); break; case USB_DEVICESTATS: Modified: stable/12/sys/dev/usb/usb_generic.h == --- stable/12/sys/dev/usb/usb_generic.h Tue Nov 10 13:16:37 2020 (r367559) +++
svn commit: r367559 - in stable/11/sys/dev/usb: . serial
Author: hselasky Date: Tue Nov 10 13:16:37 2020 New Revision: 367559 URL: https://svnweb.freebsd.org/changeset/base/367559 Log: MFC r367096: Add new USB IDs. Submitted by: aleksi.kaalin...@kapsi.fi PR: 250675 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/serial/uftdi.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uftdi.c == --- stable/11/sys/dev/usb/serial/uftdi.cTue Nov 10 13:15:53 2020 (r367558) +++ stable/11/sys/dev/usb/serial/uftdi.cTue Nov 10 13:16:37 2020 (r367559) @@ -291,6 +291,8 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(BBELECTRONICS, USPTL4, 0), UFTDI_DEV(BBELECTRONICS, USTL4, 0), UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(BRAINBOXES, US257, 0), + UFTDI_DEV(BRAINBOXES, US25701, 0), UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), Modified: stable/11/sys/dev/usb/usbdevs == --- stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:15:53 2020 (r367558) +++ stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:16:37 2020 (r367559) @@ -1355,6 +1355,10 @@ product BILLIONTON USBEL100 0x0988 USB100EL product BILLIONTON USBE100 0x8511 USBE100 product BILLIONTON USB2AR 0x90ff USB2AR Ethernet +/* Brainboxes Limited products */ +product BRAINBOXES US257 0x5001 US-257 USB2Serial 2xRS232 +product BRAINBOXES US25701 0x5002 US-25701 USB2Serial 2xRS232 + /* Broadcom products */ product BROADCOM BCM2033 0x2033 BCM2033 Bluetooth USB dongle ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367558 - in stable/12/sys/dev/usb: . serial
Author: hselasky Date: Tue Nov 10 13:15:53 2020 New Revision: 367558 URL: https://svnweb.freebsd.org/changeset/base/367558 Log: MFC r367096: Add new USB IDs. Submitted by: aleksi.kaalin...@kapsi.fi PR: 250675 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/serial/uftdi.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/uftdi.c == --- stable/12/sys/dev/usb/serial/uftdi.cTue Nov 10 13:13:37 2020 (r367557) +++ stable/12/sys/dev/usb/serial/uftdi.cTue Nov 10 13:15:53 2020 (r367558) @@ -293,6 +293,8 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(BBELECTRONICS, USPTL4, 0), UFTDI_DEV(BBELECTRONICS, USTL4, 0), UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(BRAINBOXES, US257, 0), + UFTDI_DEV(BRAINBOXES, US25701, 0), UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), Modified: stable/12/sys/dev/usb/usbdevs == --- stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:13:37 2020 (r367557) +++ stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:15:53 2020 (r367558) @@ -1416,6 +1416,10 @@ product BILLIONTON USBEL100 0x0988 USB100EL product BILLIONTON USBE100 0x8511 USBE100 product BILLIONTON USB2AR 0x90ff USB2AR Ethernet +/* Brainboxes Limited products */ +product BRAINBOXES US257 0x5001 US-257 USB2Serial 2xRS232 +product BRAINBOXES US25701 0x5002 US-25701 USB2Serial 2xRS232 + /* Broadcom products */ product BROADCOM BCM2033 0x2033 BCM2033 Bluetooth USB dongle ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367557 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi
Author: hselasky Date: Tue Nov 10 13:13:37 2020 New Revision: 367557 URL: https://svnweb.freebsd.org/changeset/base/367557 Log: MFC r364860 and r366996: Implement extensible arrays API using the existing radix tree implementation in the LinuxKPI. Differential Revision:https://reviews.freebsd.org/D25101 Reviewed by: kib @ Sponsored by: Mellanox Technologies // NVIDIA Networking Added: stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h - copied, changed from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c - copied, changed from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c Modified: stable/11/sys/conf/files stable/11/sys/modules/linuxkpi/Makefile Directory Properties: stable/11/ (props changed) Copied and modified: stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h (from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h) == --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Thu Aug 27 10:28:12 2020(r364860, copy source) +++ stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h Tue Nov 10 13:13:37 2020(r367557) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ Copied and modified: stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c (from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) == --- head/sys/compat/linuxkpi/common/src/linux_xarray.c Thu Aug 27 10:28:12 2020(r364860, copy source) +++ stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c Tue Nov 10 13:13:37 2020(r367557) @@ -79,7 +79,7 @@ static void xa_vm_wait_locked(struct xarray *xa) { xa_unlock(xa); - vm_wait(NULL); + vm_wait(); xa_lock(xa); } Modified: stable/11/sys/conf/files == --- stable/11/sys/conf/filesTue Nov 10 13:10:15 2020(r367556) +++ stable/11/sys/conf/filesTue Nov 10 13:13:37 2020(r367557) @@ -4332,6 +4332,8 @@ compat/linuxkpi/common/src/linux_usb.c optional compa compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.coptional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_xarray.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) ofed/drivers/infiniband/core/ib_addr.c optional ofed \ Modified: stable/11/sys/modules/linuxkpi/Makefile == --- stable/11/sys/modules/linuxkpi/Makefile Tue Nov 10 13:10:15 2020 (r367556) +++ stable/11/sys/modules/linuxkpi/Makefile Tue Nov 10 13:13:37 2020 (r367557) @@ -17,7 +17,8 @@ SRCS= linux_compat.c \ linux_slab.c \ linux_tasklet.c \ linux_usb.c \ - linux_work.c + linux_work.c \ + linux_xarray.c SRCS+= ${LINUXKPI_GENSRCS} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367556 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi
Author: hselasky Date: Tue Nov 10 13:10:15 2020 New Revision: 367556 URL: https://svnweb.freebsd.org/changeset/base/367556 Log: MFC r364860 and r366996: Implement extensible arrays API using the existing radix tree implementation in the LinuxKPI. Differential Revision:https://reviews.freebsd.org/D25101 Reviewed by: kib @ Sponsored by: Mellanox Technologies // NVIDIA Networking Added: stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h - copied, changed from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c - copied unchanged from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c Modified: stable/12/sys/conf/files stable/12/sys/modules/linuxkpi/Makefile Directory Properties: stable/12/ (props changed) Copied and modified: stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h (from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h) == --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Thu Aug 27 10:28:12 2020(r364860, copy source) +++ stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h Tue Nov 10 13:10:15 2020(r367556) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ Copied: stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c (from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c Tue Nov 10 13:10:15 2020(r367556, copy of r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) @@ -0,0 +1,391 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies, Ltd. + * 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 unmodified, 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +/* + * This function removes the element at the given index and returns + * the pointer to the removed element, if any. + */ +void * +__xa_erase(struct xarray *xa, uint32_t index) +{ + XA_ASSERT_LOCKED(xa); + + return (radix_tree_delete(>root, index)); +} + +void * +xa_erase(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = __xa_erase(xa, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This function returns the element pointer at the given index. A + * value of NULL is returned if the element does not exist. + */ +void * +xa_load(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = radix_tree_lookup(>root, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This is an internal function used to sleep until more memory + * becomes available. + */ +static void +xa_vm_wait_locked(struct xarray *xa) +{ + xa_unlock(xa); + vm_wait(NULL); + xa_lock(xa); +} + +/* + * This function iterates the xarray until it finds a free slot where + * it can insert the element pointer to by "ptr". It starts at the + * index pointed to by "pindex" and updates this value at return. The + * "mask" argument defines the maximum index allowed, inclusivly, and + * must be a power of two minus one value. The "gfp" argument + * basically tells if we can wait for more memory to become available + * or not. This function returns zero upon success or a negative error + * code on failure. A typical error code
svn commit: r367555 - head/sys/dev/mlx4/mlx4_ib
Author: hselasky Date: Tue Nov 10 12:58:25 2020 New Revision: 367555 URL: https://svnweb.freebsd.org/changeset/base/367555 Log: Include GID type when deleting GIDs from HW table under RoCE in mlx4ib. Refer to the Linux commit mentioned below for a more detailed description. Linux commit: a18177925c252da7801149abe217c05b80884798 Requested by: Isilon MFC after:1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c == --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cTue Nov 10 12:45:59 2020 (r367554) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cTue Nov 10 12:58:25 2020 (r367555) @@ -371,8 +371,13 @@ static int mlx4_ib_del_gid(struct ib_device *device, if (!gids) { ret = -ENOMEM; } else { - for (i = 0; i < MLX4_MAX_PORT_GIDS; i++) - memcpy([i].gid, _gid_table->gids[i].gid, sizeof(union ib_gid)); + for (i = 0; i < MLX4_MAX_PORT_GIDS; i++) { + memcpy([i].gid, + _gid_table->gids[i].gid, + sizeof(union ib_gid)); + gids[i].gid_type = + port_gid_table->gids[i].gid_type; + } } } spin_unlock_bh(>lock); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367554 - in stable/12: share/man/man4 sys/netinet sys/sys
Author: ae Date: Tue Nov 10 12:45:59 2020 New Revision: 367554 URL: https://svnweb.freebsd.org/changeset/base/367554 Log: MFC r366695: Implement SIOCGIFALIAS. It is lightweight way to check if an IPv4 address exists. Submitted by: Roy Marples Differential Revision: https://reviews.freebsd.org/D26636 Modified: stable/12/share/man/man4/netintro.4 stable/12/sys/netinet/in.c stable/12/sys/sys/sockio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netintro.4 == --- stable/12/share/man/man4/netintro.4 Tue Nov 10 12:13:18 2020 (r367553) +++ stable/12/share/man/man4/netintro.4 Tue Nov 10 12:45:59 2020 (r367554) @@ -28,7 +28,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd January 26, 2012 +.Dd October 14, 2020 .Dt NETINTRO 4 .Os .Sh NAME @@ -349,6 +349,13 @@ multiple masks or destination addresses, and also adop convention that specification of the default address means to delete the first address for the interface belonging to the address family in which the original socket was opened. +.It Dv SIOCGIFALIAS +This request provides means to get additional addresses +together with netmask and broadcast/destination from an +interface. +It also uses the +.Vt ifaliasreq +structure. .It Dv SIOCGIFCONF Get interface configuration list. This request takes an Modified: stable/12/sys/netinet/in.c == --- stable/12/sys/netinet/in.c Tue Nov 10 12:13:18 2020(r367553) +++ stable/12/sys/netinet/in.c Tue Nov 10 12:45:59 2020(r367554) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); +static int in_gifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static voidin_socktrim(struct sockaddr_in *); static voidin_purgemaddrs(struct ifnet *); @@ -240,6 +241,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data case SIOCGIFDSTADDR: case SIOCGIFNETMASK: break; + case SIOCGIFALIAS: + sx_xlock(_control_sx); + error = in_gifaddr_ioctl(cmd, data, ifp, td); + sx_xunlock(_control_sx); + return (error); case SIOCDIFADDR: sx_xlock(_control_sx); error = in_difaddr_ioctl(cmd, data, ifp, td); @@ -648,6 +654,60 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne IFADDR_EVENT_DEL); ifa_free(>ia_ifa); /* in_ifaddrhead */ + return (0); +} + +static int +in_gifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) +{ + struct in_aliasreq *ifra = (struct in_aliasreq *)data; + const struct sockaddr_in *addr = >ifra_addr; + struct epoch_tracker et; + struct ifaddr *ifa; + struct in_ifaddr *ia; + + /* +* ifra_addr must be present and be of INET family. +*/ + if (addr->sin_len != sizeof(struct sockaddr_in) || + addr->sin_family != AF_INET) + return (EINVAL); + + /* +* See whether address exist. +*/ + ia = NULL; + NET_EPOCH_ENTER_ET(et); + CK_STAILQ_FOREACH(ifa, >if_addrhead, ifa_link) { + struct in_ifaddr *it; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + it = (struct in_ifaddr *)ifa; + if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && + prison_check_ip4(td->td_ucred, >sin_addr) == 0) { + ia = it; + break; + } + } + if (ia == NULL) { + NET_EPOCH_EXIT_ET(et); + return (EADDRNOTAVAIL); + } + + ifra->ifra_mask = ia->ia_sockmask; + if ((ifp->if_flags & IFF_POINTOPOINT) && + ia->ia_dstaddr.sin_family == AF_INET) + ifra->ifra_dstaddr = ia->ia_dstaddr; + else if ((ifp->if_flags & IFF_BROADCAST) && + ia->ia_broadaddr.sin_family == AF_INET) + ifra->ifra_broadaddr = ia->ia_broadaddr; + else + memset(>ifra_broadaddr, 0, + sizeof(ifra->ifra_broadaddr)); + + NET_EPOCH_EXIT_ET(et); return (0); } Modified: stable/12/sys/sys/sockio.h == --- stable/12/sys/sys/sockio.h Tue Nov 10 12:13:18 2020(r367553) +++ stable/12/sys/sys/sockio.h Tue Nov 10 12:45:59 2020(r367554) @@ -83,6 +83,7 @@ #defineSIOCSIFDESCR _IOW('i', 41, struct ifreq)/* set ifnet descr */ #defineSIOCGIFDESCR_IOWR('i', 42, struct ifreq)/* get ifnet
svn commit: r367553 - in stable/12: share/dtrace sys/netpfil/ipfw
Author: ae Date: Tue Nov 10 12:13:18 2020 New Revision: 367553 URL: https://svnweb.freebsd.org/changeset/base/367553 Log: MFC r366908 (modified for stable/12 KBI): Add dtrace SDT probe ipfw:::rule-matched. It helps to reduce complexity with debugging of large ipfw rulesets. Also define several constants and translators, that can by used by dtrace scripts with this probe. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D26879 Added: stable/12/share/dtrace/ipfw.d - copied, changed from r366908, head/share/dtrace/ipfw.d Modified: stable/12/share/dtrace/Makefile stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/dtrace/Makefile == --- stable/12/share/dtrace/Makefile Tue Nov 10 11:32:01 2020 (r367552) +++ stable/12/share/dtrace/Makefile Tue Nov 10 12:13:18 2020 (r367553) @@ -21,7 +21,7 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace -DSRCS= mbuf.d +DSRCS= mbuf.d ipfw.d FILES= ${DSRCS} FILESDIR= /usr/lib/dtrace Copied and modified: stable/12/share/dtrace/ipfw.d (from r366908, head/share/dtrace/ipfw.d) == --- head/share/dtrace/ipfw.dWed Oct 21 15:01:33 2020(r366908, copy source) +++ stable/12/share/dtrace/ipfw.d Tue Nov 10 12:13:18 2020 (r367553) @@ -68,29 +68,17 @@ inline string ipfw_retcodes[int ret] = /* ip_fw_args flags */ #pragma D binding "1.0" IPFW_ARGS_ETHER -inline int IPFW_ARGS_ETHER = 0x0001; /* valid ethernet header */ +inline int IPFW_ARGS_ETHER = 0x0001; /* valid ethernet header */ #pragma D binding "1.0" IPFW_ARGS_NH4 -inline int IPFW_ARGS_NH4 = 0x0002; /* IPv4 next hop in hopstore */ +inline int IPFW_ARGS_NH4 = 0x0002; /* IPv4 next hop in hopstore */ #pragma D binding "1.0" IPFW_ARGS_NH6 -inline int IPFW_ARGS_NH6 = 0x0004; /* IPv6 next hop in hopstore */ +inline int IPFW_ARGS_NH6 = 0x0004; /* IPv6 next hop in hopstore */ #pragma D binding "1.0" IPFW_ARGS_NH4PTR -inline int IPFW_ARGS_NH4PTR = 0x0008; /* IPv4 next hop in next_hop */ +inline int IPFW_ARGS_NH4PTR = 0x0008; /* IPv4 next hop in next_hop */ #pragma D binding "1.0" IPFW_ARGS_NH6PTR -inline int IPFW_ARGS_NH6PTR = 0x0010; /* IPv6 next hop in next_hop6 */ +inline int IPFW_ARGS_NH6PTR = 0x0010; /* IPv6 next hop in next_hop6 */ #pragma D binding "1.0" IPFW_ARGS_REF -inline int IPFW_ARGS_REF = 0x0020; /* valid ipfw_rule_ref */ -#pragma D binding "1.0" IPFW_ARGS_IN -inline int IPFW_ARGS_IN = 0x0040; /* called on input */ -#pragma D binding "1.0" IPFW_ARGS_OUT -inline int IPFW_ARGS_OUT = 0x0080; /* called on output */ -#pragma D binding "1.0" IPFW_ARGS_IP4 -inline int IPFW_ARGS_IP4 = 0x0100; /* belongs to v4 ISR */ -#pragma D binding "1.0" IPFW_ARGS_IP6 -inline int IPFW_ARGS_IP6 = 0x0200; /* belongs to v6 ISR */ -#pragma D binding "1.0" IPFW_ARGS_DROP -inline int IPFW_ARGS_DROP =0x0400; /* drop it (dummynet) */ -#pragma D binding "1.0" IPFW_ARGS_LENMASK -inline int IPFW_ARGS_LENMASK = 0x; /* length of data in *mem */ +inline int IPFW_ARGS_REF = 0x0020; /* valid ipfw_rule_ref */ /* ipfw_rule_ref.info */ #pragma D binding "1.0" IPFW_INFO_MASK @@ -147,17 +135,13 @@ typedef struct ipfw_match_info { #pragma D binding "1.0" translator translator ipfw_match_info_t < struct ip_fw_args *p > { flags = p->flags; - m = (p->flags & IPFW_ARGS_LENMASK) ? NULL : p->m; - mem = (p->flags & IPFW_ARGS_LENMASK) ? p->mem : NULL; + m = p->m; + mem = NULL; inp = p->inp; - ifp = p->ifp; + ifp = p->oif; /* Initialize IP pointer corresponding to addr_type */ - ipp = (p->flags & IPFW_ARGS_IP4) ? - (p->flags & IPFW_ARGS_LENMASK) ? (struct ip *)p->mem : - (p->m != NULL) ? (struct ip *)p->m->m_data : NULL : NULL; - ip6p = (p->flags & IPFW_ARGS_IP6) ? - (p->flags & IPFW_ARGS_LENMASK) ? (struct ip6_hdr *)p->mem : - (p->m != NULL) ? (struct ip6_hdr *)p->m->m_data : NULL : NULL; + ipp = (p->m != NULL) ? (struct ip *)p->m->m_data : NULL; + ip6p = (p->m != NULL) ? (struct ip6_hdr *)p->m->m_data : NULL; /* fill f_id fields */ addr_type = p->f_id.addr_type; Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c == --- stable/12/sys/netpfil/ipfw/ip_fw2.c Tue Nov 10 11:32:01 2020 (r367552) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Tue Nov 10 12:13:18 2020 (r367553) @@ -55,6 +55,7 @@
svn commit: r367552 - head/share/man/man7
Author: 0mp (doc,ports committer) Date: Tue Nov 10 11:32:01 2020 New Revision: 367552 URL: https://svnweb.freebsd.org/changeset/base/367552 Log: Do not document MOTIFLIB in ports(7) Perhaps it made sense in 1998 (r32836), but now it feels a bit out of place. We tend to avoid documenting non-essential ports variables in the manual page (we try to document them in the Porter's Handbook instead). MFC after:1 week Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 == --- head/share/man/man7/ports.7 Tue Nov 10 10:40:44 2020(r367551) +++ head/share/man/man7/ports.7 Tue Nov 10 11:32:01 2020(r367552) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2020 +.Dd November 10, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -509,9 +509,6 @@ Normally .Xr fetch 1 . .It Va FORCE_PKG_REGISTER If set, overwrite any existing package registration on the system. -.It Va MOTIFLIB -Location of -.Pa "libXm\&." Ns Brq Pa a , Ns Pa so . .It Va INTERACTIVE If defined, only operate on a port if it requires interaction. .It Va BATCH ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367551 - head
Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:40:44 2020 New Revision: 367551 URL: https://svnweb.freebsd.org/changeset/base/367551 Log: Add an entry for r351863 (honoring ${name}_env in rc(8) scripts) PR: 239692 Requested by: koobs Modified: head/RELNOTES Modified: head/RELNOTES == --- head/RELNOTES Tue Nov 10 10:19:55 2020(r367550) +++ head/RELNOTES Tue Nov 10 10:40:44 2020(r367551) @@ -157,6 +157,13 @@ r352304: ntpd is no longer by default locked in memory. rlimit memlock 32 or rlimit memlock 0 can be used to restore this behaviour. +r351863: + rc.subr(8) now honors ${name}_env in all rc(8) scripts. Previously, + environment variables set by a user via ${name}_env were ignored + if the service defined a custom *_cmd variable to control the behavior + of the run_rc_command function, e.g., start_cmd, instead of relying on + the variables like command and command_args, + r351770,r352920,r352922,r352923: dd(1) now supports conv=fsync, conv=fdatasync, oflag=fsync, oflag=sync, and iflag=fullblock flags, compatible with illumos and GNU. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367550 - in stable/12: libexec/rc share/man/man8
Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:19:55 2020 New Revision: 367550 URL: https://svnweb.freebsd.org/changeset/base/367550 Log: MFC r351863: rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd) A user may set ${name}_env variable in rc.conf(5) in order to set additional environment variables for a service command. Unfortunately, at the moment this variable is only honored when the command is specified via the command variable. Those additional environment variables coming from ${name}_env are never set if the service is started via the ${rc_arg}_cmd variable (for example start_cmd). PR: 239692 Reviewed by: bcr, jilles Approved by: src (jilles) Requested by: koobs Modified: stable/12/libexec/rc/rc.subr stable/12/share/man/man8/rc.subr.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.subr == --- stable/12/libexec/rc/rc.subrTue Nov 10 10:17:11 2020 (r367549) +++ stable/12/libexec/rc/rc.subrTue Nov 10 10:19:55 2020 (r367550) @@ -1024,6 +1024,9 @@ run_rc_command() _postcmd=\$${rc_arg}_postcmd if [ -n "$_cmd" ]; then + if [ -n "$_env" ]; then + eval "export -- $_env" + fi _run_rc_precmd || return 1 _run_rc_doit "$_cmd $rc_extra_args" || return 1 _run_rc_postcmd Modified: stable/12/share/man/man8/rc.subr.8 == --- stable/12/share/man/man8/rc.subr.8 Tue Nov 10 10:17:11 2020 (r367549) +++ stable/12/share/man/man8/rc.subr.8 Tue Nov 10 10:19:55 2020 (r367550) @@ -556,9 +556,19 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to the +Those variables will be passed as arguments to the .Xr env 1 -utility. +utility unless +.Ar argument Ns Va _cmd +is defined. +In that case the contents of +.Va ${name}_env +will be exported via the +.Xr export 1 +builtin of +.Xr sh 1 , +which puts some limitations on the names of variables +(e.g., a variable name may not start with a digit). .It Va ${name}_env_file A file to source for environmental variables to run .Va command ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367549 - head
Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:17:11 2020 New Revision: 367549 URL: https://svnweb.freebsd.org/changeset/base/367549 Log: Add an entry to RELNOTES about renaming ACPI_DMAR to IOMMU Reviewed by: br (earlier version) Differential Revision:https://reviews.freebsd.org/D26813 Modified: head/RELNOTES Modified: head/RELNOTES == --- head/RELNOTES Tue Nov 10 08:59:55 2020(r367548) +++ head/RELNOTES Tue Nov 10 10:17:11 2020(r367549) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r366267: +Kernel option ACPI_DMAR was renamed to IOMMU. amd64's IOMMU subsystem +was split out from amd64 DMAR support and is now generic, i.e., it can +be used by all architectures. + r364896: A series of commits ending with r364896 added NFS over TLS to the kernel. This is believed to be compatible with ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367548 - stable/12/sys/net
Author: kib Date: Tue Nov 10 08:59:55 2020 New Revision: 367548 URL: https://svnweb.freebsd.org/changeset/base/367548 Log: MFC r367296: if_media.c SIOCGMEDIAX handler: improve loop Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c == --- stable/12/sys/net/if_media.cTue Nov 10 08:33:45 2020 (r367547) +++ stable/12/sys/net/if_media.cTue Nov 10 08:59:55 2020 (r367548) @@ -301,15 +301,17 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st * allocate. */ i = 0; - LIST_FOREACH(ep, >ifm_list, ifm_list) - if (i++ < ifmr->ifm_count) { + LIST_FOREACH(ep, >ifm_list, ifm_list) { + if (i < ifmr->ifm_count) { error = copyout(>ifm_media, - ifmr->ifm_ulist + i - 1, sizeof(int)); - if (error) + ifmr->ifm_ulist + i, sizeof(int)); + if (error != 0) break; } + i++; + } if (error == 0 && i > ifmr->ifm_count) - error = ifmr->ifm_count ? E2BIG : 0; + error = ifmr->ifm_count != 0 ? E2BIG : 0; ifmr->ifm_count = i; break; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r367547 - stable/12/tools/build
Author: 0mp (doc,ports committer) Date: Tue Nov 10 08:33:45 2020 New Revision: 367547 URL: https://svnweb.freebsd.org/changeset/base/367547 Log: MFC r367072: Mount devfs inside a beinstall(8) chroot It turns out that without /dev/null beinstall is not able to complete and instead exits with messages similar to these: -- >>> Installing kernel GENERIC completed on Sun Oct 25 17:47:37 CET 2020 -- /tmp/beinstall.JleGoP/mnt: Inspecting dirs /usr/src /usr/obj/usr/src/amd64.amd64 --- installworld --- make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at t480 on Sun Oct 25 15:53:28 CET 2020 make[2]: "/dev/null" line 2: Need an operator make[2]: Fatal errors encountered -- cannot continuemake[1]: "/usr/src/Makefile.inc1" line 593: CPUTYPE global should be set with ?=. Cleaning up ... umount -f /tmp/beinstall.JleGoP/mnt/usr/src /tmp/beinstall.JleGoP/mnt/usr/obj/usr/src/amd64.amd64 /tmp/beinstall.JleGoP/mnt Destroyed successfully error: Installworld failed! Upon a bit of debugging, it turns out that /dev/null inside the chroot environment is full random bytes, which cause "make -f /dev/null" to misbehave. Mounting a proper devfs inside the chroot seems to be the most appropriate way to fix it. will@ also noted that this change requires that whatever is needed in devfs must exist in the old kernel. Approved by: will Modified: stable/12/tools/build/beinstall.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/beinstall.sh == --- stable/12/tools/build/beinstall.sh Tue Nov 10 07:47:24 2020 (r367546) +++ stable/12/tools/build/beinstall.sh Tue Nov 10 08:33:45 2020 (r367547) @@ -216,6 +216,7 @@ fi create_be_dirs "${srcdir}" "${objdir}" || errx "Unable to create BE dirs" mount -t nullfs "${srcdir}" "${BE_MNTPT}${srcdir}" || errx "Unable to mount src" mount -t nullfs "${objdir}" "${BE_MNTPT}${objdir}" || errx "Unable to mount obj" +mount -t devfs devfs "${BE_MNTPT}/dev" || errx "Unable to mount devfs" chroot ${BE_MNTPT} make "$@" -C ${srcdir} installworld || \ errx "Installworld failed!" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"