Re: svn commit: r368575 - head/stand/lua
How about ’show-module-options’? rgds, toomas > On 12. Dec 2020, at 07:57, Kyle Evans wrote: > > Author: kevans > Date: Sat Dec 12 05:57:42 2020 > New Revision: 368575 > URL: https://svnweb.freebsd.org/changeset/base/368575 > > Log: > lualoader: provide module-manipulation commands > > Specifically, we have: > - enable-module > - disable-module > - toggle-module > > These can be used to add/remove modules to be loaded or force modules to be > loaded in spite of modules_blacklist. In the typical case, a user is > expected to use them to recover an issue happening due to a module directive > they've added to their loader.conf or because they discover that they've > under-specified what to load. > > MFC after: 1 week > > Modified: > head/stand/lua/cli.lua > head/stand/lua/cli.lua.8 > head/stand/lua/config.lua > head/stand/lua/config.lua.8 > > Modified: head/stand/lua/cli.lua > == > --- head/stand/lua/cli.luaSat Dec 12 02:26:43 2020(r368574) > +++ head/stand/lua/cli.luaSat Dec 12 05:57:42 2020(r368575) > @@ -65,6 +65,14 @@ local function parseBootArgs(argv, with_kernel) > end > end > > +local function setModule(module, loading) > + if loading and config.enableModule(module) then > + print(module .. " will be loaded") > + elseif not loading and config.disableModule(module) then > + print(module .. " will not be loaded") > + end > +end > + > -- Declares a global function cli_execute that attempts to dispatch the > -- arguments passed as a lua function. This gives lua a chance to intercept > -- builtin CLI commands like "boot" > @@ -132,6 +140,37 @@ end > > cli['reload-conf'] = function() > config.reload() > +end > + > +cli["enable-module"] = function(...) > + local _, argv = cli.arguments(...) > + if #argv == 0 then > + print("usage error: enable-module module") > + return > + end > + > + setModule(argv[1], true) > +end > + > +cli["disable-module"] = function(...) > + local _, argv = cli.arguments(...) > + if #argv == 0 then > + print("usage error: disable-module module") > + return > + end > + > + setModule(argv[1], false) > +end > + > +cli["toggle-module"] = function(...) > + local _, argv = cli.arguments(...) > + if #argv == 0 then > + print("usage error: toggle-module module") > + return > + end > + > + local module = argv[1] > + setModule(module, not config.isModuleEnabled(module)) > end > > -- Used for splitting cli varargs into cmd_name and the rest of argv > > Modified: head/stand/lua/cli.lua.8 > == > --- head/stand/lua/cli.lua.8 Sat Dec 12 02:26:43 2020(r368574) > +++ head/stand/lua/cli.lua.8 Sat Dec 12 05:57:42 2020(r368575) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 13, 2019 > +.Dd December 12, 2020 > .Dt CLI.LUA 8 > .Os > .Sh NAME > @@ -77,14 +77,26 @@ This function may be invoked by a user at the loader p > .Ic foo . > Arguments may be passed to it as usual, space-delimited. > .Ss Default Commands > -As of present, the > +The > .Nm > -module by default provides commands for > -.Ic autoboot , > -.Ic boot , > -.Ic boot-conf , > -and > -.Ic reload-conf . > +module provides the following default commands: > +.Bl -bullet > +.\"-width toggle-module -offset indent > +.It > +.Ic autoboot > +.It > +.Ic boot > +.It > +.Ic boot-conf > +.It > +.Ic reload-conf > +.It > +.Ic enable-module > +.It > +.Ic disable-module > +.It > +.Ic toggle-module > +.El > .Pp > For > .Ic autoboot , > @@ -103,6 +115,16 @@ The > command will reload the configuration from disk. > This is useful if you have manually changed currdev and would like to easily > reload the configuration from the new device. > +.Pp > +The > +.Ic enable-module , > +.Ic disable-module , > +and > +.Ic toggle-module > +commands manipulate the list of modules to be loaded along with the kernel. > +Modules blacklisted are considered disabled by > +.Ic toggle-module . > +These commands will override any such restriction as needed. > .Ss Exported Functions > The following functions are exported from > .Nm : > > Modified: head/stand/lua/config.lua > == > --- head/stand/lua/config.lua Sat Dec 12 02:26:43 2020(r368574) > +++ head/stand/lua/config.lua Sat Dec 12 05:57:42 2020(r368575) > @@ -312,7 +312,7 @@ local function loadModule(mod, silent) > for k, v in pairs(mod) do > if v.load ~= nil and v.load:lower() == "yes" then > local module_name = v.name or k > - if blacklist[module_name] ~= nil then > + if not v.force and blacklist[module_name] ~= nil then >
svn commit: r368576 - head/sbin/geom/core
Author: rew Date: Sat Dec 12 07:22:38 2020 New Revision: 368576 URL: https://svnweb.freebsd.org/changeset/base/368576 Log: geom(8): list geoms with /dev/ prefix Allow geom(8) to list geoms with the '/dev/' prefix. `geom part show` accepts the '/dev/' prefix but `geom part list` does not. Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior of find_geom() in lib/geom/part/geom_part.c. PR: 188213 Reported by:Ronald F. Guilmette Reviewed by:imp, kevans Approved by:kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27556 Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Sat Dec 12 05:57:42 2020(r368575) +++ head/sbin/geom/core/geom.c Sat Dec 12 07:22:38 2020(r368576) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -861,6 +862,9 @@ static struct ggeom * find_geom(struct gclass *classp, const char *name) { struct ggeom *gp; + + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 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: r368575 - head/stand/lua
Author: kevans Date: Sat Dec 12 05:57:42 2020 New Revision: 368575 URL: https://svnweb.freebsd.org/changeset/base/368575 Log: lualoader: provide module-manipulation commands Specifically, we have: - enable-module - disable-module - toggle-module These can be used to add/remove modules to be loaded or force modules to be loaded in spite of modules_blacklist. In the typical case, a user is expected to use them to recover an issue happening due to a module directive they've added to their loader.conf or because they discover that they've under-specified what to load. MFC after:1 week Modified: head/stand/lua/cli.lua head/stand/lua/cli.lua.8 head/stand/lua/config.lua head/stand/lua/config.lua.8 Modified: head/stand/lua/cli.lua == --- head/stand/lua/cli.lua Sat Dec 12 02:26:43 2020(r368574) +++ head/stand/lua/cli.lua Sat Dec 12 05:57:42 2020(r368575) @@ -65,6 +65,14 @@ local function parseBootArgs(argv, with_kernel) end end +local function setModule(module, loading) + if loading and config.enableModule(module) then + print(module .. " will be loaded") + elseif not loading and config.disableModule(module) then + print(module .. " will not be loaded") + end +end + -- Declares a global function cli_execute that attempts to dispatch the -- arguments passed as a lua function. This gives lua a chance to intercept -- builtin CLI commands like "boot" @@ -132,6 +140,37 @@ end cli['reload-conf'] = function() config.reload() +end + +cli["enable-module"] = function(...) + local _, argv = cli.arguments(...) + if #argv == 0 then + print("usage error: enable-module module") + return + end + + setModule(argv[1], true) +end + +cli["disable-module"] = function(...) + local _, argv = cli.arguments(...) + if #argv == 0 then + print("usage error: disable-module module") + return + end + + setModule(argv[1], false) +end + +cli["toggle-module"] = function(...) + local _, argv = cli.arguments(...) + if #argv == 0 then + print("usage error: toggle-module module") + return + end + + local module = argv[1] + setModule(module, not config.isModuleEnabled(module)) end -- Used for splitting cli varargs into cmd_name and the rest of argv Modified: head/stand/lua/cli.lua.8 == --- head/stand/lua/cli.lua.8Sat Dec 12 02:26:43 2020(r368574) +++ head/stand/lua/cli.lua.8Sat Dec 12 05:57:42 2020(r368575) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2019 +.Dd December 12, 2020 .Dt CLI.LUA 8 .Os .Sh NAME @@ -77,14 +77,26 @@ This function may be invoked by a user at the loader p .Ic foo . Arguments may be passed to it as usual, space-delimited. .Ss Default Commands -As of present, the +The .Nm -module by default provides commands for -.Ic autoboot , -.Ic boot , -.Ic boot-conf , -and -.Ic reload-conf . +module provides the following default commands: +.Bl -bullet +.\"-width toggle-module -offset indent +.It +.Ic autoboot +.It +.Ic boot +.It +.Ic boot-conf +.It +.Ic reload-conf +.It +.Ic enable-module +.It +.Ic disable-module +.It +.Ic toggle-module +.El .Pp For .Ic autoboot , @@ -103,6 +115,16 @@ The command will reload the configuration from disk. This is useful if you have manually changed currdev and would like to easily reload the configuration from the new device. +.Pp +The +.Ic enable-module , +.Ic disable-module , +and +.Ic toggle-module +commands manipulate the list of modules to be loaded along with the kernel. +Modules blacklisted are considered disabled by +.Ic toggle-module . +These commands will override any such restriction as needed. .Ss Exported Functions The following functions are exported from .Nm : Modified: head/stand/lua/config.lua == --- head/stand/lua/config.lua Sat Dec 12 02:26:43 2020(r368574) +++ head/stand/lua/config.lua Sat Dec 12 05:57:42 2020(r368575) @@ -312,7 +312,7 @@ local function loadModule(mod, silent) for k, v in pairs(mod) do if v.load ~= nil and v.load:lower() == "yes" then local module_name = v.name or k - if blacklist[module_name] ~= nil then + if not v.force and blacklist[module_name] ~= nil then if not silent then print(MSG_MODBLACKLIST:format(module_name)) end @@ -680,6 +680,45 @@ function config.loadelf() status = loadModule(modules, not config.verbose) hook.runAll("modules.loaded") retu
svn commit: r368574 - head/bin/setfacl
Author: delphij Date: Sat Dec 12 02:26:43 2020 New Revision: 368574 URL: https://svnweb.freebsd.org/changeset/base/368574 Log: Remove unused headers. MFC after:2 weeks Modified: head/bin/setfacl/mask.c head/bin/setfacl/merge.c head/bin/setfacl/remove.c head/bin/setfacl/util.c Modified: head/bin/setfacl/mask.c == --- head/bin/setfacl/mask.c Sat Dec 12 02:24:33 2020(r368573) +++ head/bin/setfacl/mask.c Sat Dec 12 02:26:43 2020(r368574) @@ -32,9 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include "setfacl.h" Modified: head/bin/setfacl/merge.c == --- head/bin/setfacl/merge.cSat Dec 12 02:24:33 2020(r368573) +++ head/bin/setfacl/merge.cSat Dec 12 02:26:43 2020(r368574) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "setfacl.h" Modified: head/bin/setfacl/remove.c == --- head/bin/setfacl/remove.c Sat Dec 12 02:24:33 2020(r368573) +++ head/bin/setfacl/remove.c Sat Dec 12 02:26:43 2020(r368574) @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include "setfacl.h" Modified: head/bin/setfacl/util.c == --- head/bin/setfacl/util.c Sat Dec 12 02:24:33 2020(r368573) +++ head/bin/setfacl/util.c Sat Dec 12 02:26:43 2020(r368574) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "setfacl.h" ___ 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: r368573 - head/bin/stty
Author: delphij Date: Sat Dec 12 02:24:33 2020 New Revision: 368573 URL: https://svnweb.freebsd.org/changeset/base/368573 Log: Remove unneeded headers. MFC after:2 weeks Modified: head/bin/stty/cchar.c head/bin/stty/key.c head/bin/stty/modes.c head/bin/stty/stty.c head/bin/stty/util.c Modified: head/bin/stty/cchar.c == --- head/bin/stty/cchar.c Sat Dec 12 01:05:31 2020(r368572) +++ head/bin/stty/cchar.c Sat Dec 12 02:24:33 2020(r368573) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/bin/stty/key.c == --- head/bin/stty/key.c Sat Dec 12 01:05:31 2020(r368572) +++ head/bin/stty/key.c Sat Dec 12 02:24:33 2020(r368573) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/bin/stty/modes.c == --- head/bin/stty/modes.c Sat Dec 12 01:05:31 2020(r368572) +++ head/bin/stty/modes.c Sat Dec 12 02:24:33 2020(r368573) @@ -36,7 +36,6 @@ static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2 __FBSDID("$FreeBSD$"); #include -#include #include #include "stty.h" Modified: head/bin/stty/stty.c == --- head/bin/stty/stty.cSat Dec 12 01:05:31 2020(r368572) +++ head/bin/stty/stty.cSat Dec 12 02:24:33 2020(r368573) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/bin/stty/util.c == --- head/bin/stty/util.cSat Dec 12 01:05:31 2020(r368572) +++ head/bin/stty/util.cSat Dec 12 02:24:33 2020(r368573) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include "stty.h" ___ 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: r368572 - head/sys/netpfil/ipfw
Author: melifaro Date: Sat Dec 12 01:05:31 2020 New Revision: 368572 URL: https://svnweb.freebsd.org/changeset/base/368572 Log: Fix NOINET6 build broken by r368571. Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c == --- head/sys/netpfil/ipfw/ip_fw_table_algo.cFri Dec 11 23:57:30 2020 (r368571) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.cSat Dec 12 01:05:31 2020 (r368572) @@ -3920,7 +3920,7 @@ ta_dump_kfib_tentry_int(int family, const struct rtent tent->v.kidx = 0; } #endif -#ifdef INET +#ifdef INET6 if (family == AF_INET6) { rt_get_inet6_prefix_plen(rt, &tent->k.addr6, &plen, &scopeid); tent->masklen = plen; ___ 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: r368571 - head/sys/netpfil/ipfw
Author: melifaro Date: Fri Dec 11 23:57:30 2020 New Revision: 368571 URL: https://svnweb.freebsd.org/changeset/base/368571 Log: ipfw kfib algo: Use rt accessors instead of accessing rib/rtentry directly. This removes assumptions on prefix storage and rtentry layout from an external code. Differential Revision:https://reviews.freebsd.org/D27450 Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c == --- head/sys/netpfil/ipfw/ip_fw_table_algo.cFri Dec 11 22:52:20 2020 (r368570) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.cFri Dec 11 23:57:30 2020 (r368571) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -3781,11 +3781,10 @@ static int ta_init_kfib(struct ip_fw_chain *ch, void * static void ta_destroy_kfib(void *ta_state, struct table_info *ti); static void ta_dump_kfib_tinfo(void *ta_state, struct table_info *ti, ipfw_ta_tinfo *tinfo); -static int contigmask(uint8_t *p, int len); static int ta_dump_kfib_tentry(void *ta_state, struct table_info *ti, void *e, ipfw_obj_tentry *tent); -static int ta_dump_kfib_tentry_int(struct sockaddr *paddr, -struct sockaddr *pmask, ipfw_obj_tentry *tent); +static int ta_dump_kfib_tentry_int(int familt, const struct rtentry *rt, +ipfw_obj_tentry *tent); static int ta_find_kfib_tentry(void *ta_state, struct table_info *ti, ipfw_obj_tentry *tent); static void ta_foreach_kfib(void *ta_state, struct table_info *ti, @@ -3900,84 +3899,35 @@ ta_dump_kfib_tinfo(void *ta_state, struct table_info * tinfo->flags = IPFW_TATFLAGS_AFDATA; tinfo->taclass4 = IPFW_TACLASS_RADIX; tinfo->count4 = 0; - tinfo->itemsize4 = sizeof(struct rtentry); + tinfo->itemsize4 = 128; /* table is readonly, value does not matter */ tinfo->taclass6 = IPFW_TACLASS_RADIX; tinfo->count6 = 0; - tinfo->itemsize6 = sizeof(struct rtentry); + tinfo->itemsize6 = 128; } static int -contigmask(uint8_t *p, int len) -{ - int i, n; - - for (i = 0; i < len ; i++) - if ( (p[i/8] & (1 << (7 - (i%8 == 0) /* first bit unset */ - break; - for (n= i + 1; n < len; n++) - if ( (p[n/8] & (1 << (7 - (n % 8 != 0) - return (-1); /* mask not contiguous */ - return (i); -} - -static int -ta_dump_kfib_tentry(void *ta_state, struct table_info *ti, void *e, +ta_dump_kfib_tentry_int(int family, const struct rtentry *rt, ipfw_obj_tentry *tent) { - struct rtentry *rte; + uint32_t scopeid; + int plen; - rte = (struct rtentry *)e; - - return ta_dump_kfib_tentry_int(rt_key(rte), rt_mask(rte), tent); -} - -static int -ta_dump_kfib_tentry_int(struct sockaddr *paddr, struct sockaddr *pmask, -ipfw_obj_tentry *tent) -{ #ifdef INET - struct sockaddr_in *addr, *mask; -#endif -#ifdef INET6 - struct sockaddr_in6 *addr6, *mask6; -#endif - int len; - - len = 0; - - /* Guess IPv4/IPv6 radix by sockaddr family */ -#ifdef INET - if (paddr->sa_family == AF_INET) { - addr = (struct sockaddr_in *)paddr; - mask = (struct sockaddr_in *)pmask; - tent->k.addr.s_addr = addr->sin_addr.s_addr; - len = 32; - if (mask != NULL) - len = contigmask((uint8_t *)&mask->sin_addr, 32); - if (len == -1) - len = 0; - tent->masklen = len; + if (family == AF_INET) { + rt_get_inet_prefix_plen(rt, &tent->k.addr, &plen, &scopeid); + tent->masklen = plen; tent->subtype = AF_INET; - tent->v.kidx = 0; /* Do we need to put GW here? */ + tent->v.kidx = 0; } #endif -#ifdef INET6 - if (paddr->sa_family == AF_INET6) { - addr6 = (struct sockaddr_in6 *)paddr; - mask6 = (struct sockaddr_in6 *)pmask; - memcpy(&tent->k.addr6, &addr6->sin6_addr, - sizeof(struct in6_addr)); - len = 128; - if (mask6 != NULL) - len = contigmask((uint8_t *)&mask6->sin6_addr, 128); - if (len == -1) - len = 0; - tent->masklen = len; +#ifdef INET + if (family == AF_INET6) { + rt_get_inet6_prefix_plen(rt, &tent->k.addr6, &plen, &scopeid); + tent->masklen = plen; tent->subtype = AF_INET6; tent->v.kidx = 0; } #endif - return (0); } @@ -3985,66 +3935,61 @@ static int ta_find_kfib_tentry(void *ta_state, struct table_info *ti, ipfw_obj_tentry *tent) { - struct rt_addrinfo info; - struct sockaddr_in6 key6, dst6, mask6; -
svn commit: r368569 - head/tests/sys/kern
Author: rlibby Date: Fri Dec 11 22:52:16 2020 New Revision: 368569 URL: https://svnweb.freebsd.org/changeset/base/368569 Log: fdgrowtable_test.c: appease gcc Work around bogus gcc -Wreturn-type. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44511 Reviewed by: kevans, rew Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27563 Modified: head/tests/sys/kern/fdgrowtable_test.c Modified: head/tests/sys/kern/fdgrowtable_test.c == --- head/tests/sys/kern/fdgrowtable_test.c Fri Dec 11 22:52:12 2020 (r368568) +++ head/tests/sys/kern/fdgrowtable_test.c Fri Dec 11 22:52:16 2020 (r368569) @@ -151,7 +151,7 @@ ATF_TC_BODY(free_oldtables, tc) ATF_CHECK(old_tables(kd,kp) == 0); } -static void * +static _Noreturn void * exec_thread(void *args) { for (;;) ___ 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: r368567 - head/sys/modules/zfs
Author: rlibby Date: Fri Dec 11 22:52:08 2020 New Revision: 368567 URL: https://svnweb.freebsd.org/changeset/base/368567 Log: zfs: quiet gcc -Wmissing-include-dirs Don't tell it to look for headers in a non-existent directory. Reviewed by: imp, mmacy Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27565 Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile == --- head/sys/modules/zfs/Makefile Fri Dec 11 22:52:03 2020 (r368566) +++ head/sys/modules/zfs/Makefile Fri Dec 11 22:52:08 2020 (r368567) @@ -18,7 +18,6 @@ KMOD= zfs CFLAGS+= -I${INCDIR} -CFLAGS+= -I${INCDIR}/spl CFLAGS+= -I${INCDIR}/os/freebsd CFLAGS+= -I${INCDIR}/os/freebsd/spl CFLAGS+= -I${INCDIR}/os/freebsd/zfs ___ 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: r368565 - head/sys/ufs/ffs
Author: rlibby Date: Fri Dec 11 22:51:57 2020 New Revision: 368565 URL: https://svnweb.freebsd.org/changeset/base/368565 Log: ffs: quiet -Wstrict-prototypes Reviewed by: kib, markj, mckusick Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27558 Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Fri Dec 11 22:51:53 2020 (r368564) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Dec 11 22:51:57 2020 (r368565) @@ -758,6 +758,7 @@ static struct malloc_type *memtype[] = { */ static void check_clear_deps(struct mount *); static void softdep_error(char *, int); +static int softdep_prerename_vnode(struct ufsmount *, struct vnode *); static int softdep_process_worklist(struct mount *, int); static int softdep_waitidle(struct mount *, int); static void drain_output(struct vnode *); ___ 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: r368570 - head/tests/sys/posixshm
Author: rlibby Date: Fri Dec 11 22:52:20 2020 New Revision: 368570 URL: https://svnweb.freebsd.org/changeset/base/368570 Log: posixshm_test.c: remove tautological checks Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27564 Modified: head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/posixshm/posixshm_test.c == --- head/tests/sys/posixshm/posixshm_test.c Fri Dec 11 22:52:16 2020 (r368569) +++ head/tests/sys/posixshm/posixshm_test.c Fri Dec 11 22:52:20 2020 (r368570) @@ -1322,7 +1322,6 @@ ATF_TC_BODY(largepage_mlock, tc) error = sysctlbyname("vm.max_user_wired", &max_wired, &sz, NULL, 0); ATF_REQUIRE_MSG(error == 0, "sysctlbyname(vm.max_user_wired) failed; error=%d", errno); - ATF_REQUIRE(max_wired >= 0); sz = sizeof(wired); error = sysctlbyname("vm.stats.vm.v_user_wire_count", &wired, &sz, NULL, @@ -1330,7 +1329,6 @@ ATF_TC_BODY(largepage_mlock, tc) ATF_REQUIRE_MSG(error == 0, "sysctlbyname(vm.stats.vm.v_user_wire_count) failed; error=%d", errno); - ATF_REQUIRE(wired >= 0); pscnt = pagesizes(ps); for (int i = 1; i < pscnt; i++) { ___ 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: r368564 - head/sys/dev/qat
Author: rlibby Date: Fri Dec 11 22:51:53 2020 New Revision: 368564 URL: https://svnweb.freebsd.org/changeset/base/368564 Log: qat: quiet -Wredundant-decls Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27554 Modified: head/sys/dev/qat/qat_ae.c Modified: head/sys/dev/qat/qat_ae.c == --- head/sys/dev/qat/qat_ae.c Fri Dec 11 22:51:48 2020(r368563) +++ head/sys/dev/qat/qat_ae.c Fri Dec 11 22:51:53 2020(r368564) @@ -82,8 +82,6 @@ static intqat_ae_write_4(struct qat_softc *, u_char, uint32_t); static int qat_ae_read_4(struct qat_softc *, u_char, bus_size_t, uint32_t *); -static int qat_ae_write_4(struct qat_softc *, u_char, bus_size_t, - uint32_t); static voidqat_ae_ctx_indr_write(struct qat_softc *, u_char, uint32_t, bus_size_t, uint32_t); static int qat_ae_ctx_indr_read(struct qat_softc *, u_char, uint32_t, ___ 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: r368568 - head/sbin/savecore
Author: rlibby Date: Fri Dec 11 22:52:12 2020 New Revision: 368568 URL: https://svnweb.freebsd.org/changeset/base/368568 Log: savecore: bail on write error even when decompressing Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27560 Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c == --- head/sbin/savecore/savecore.c Fri Dec 11 22:52:08 2020 (r368567) +++ head/sbin/savecore/savecore.c Fri Dec 11 22:52:12 2020 (r368568) @@ -491,12 +491,12 @@ sparsefwrite(const char *buf, size_t nr, FILE *fp) static char *zbuf; static size_t zbufsize; -static size_t +static ssize_t GunzipWrite(z_stream *z, char *in, size_t insize, FILE *fp) { static bool firstblock = true; /* XXX not re-entrable/usable */ const size_t hdrlen = 10; - size_t nw = 0; + size_t nw = 0, w; int rv; z->next_in = in; @@ -520,18 +520,21 @@ GunzipWrite(z_stream *z, char *in, size_t insize, FILE logmsg(LOG_ERR, "decompression failed: %s", z->msg); return (-1); } - nw += sparsefwrite(zbuf, zbufsize - z->avail_out, fp); + w = sparsefwrite(zbuf, zbufsize - z->avail_out, fp); + if (w < zbufsize - z->avail_out) + return (-1); + nw += w; } while (z->avail_in > 0 && rv != Z_STREAM_END); return (nw); } -static size_t +static ssize_t ZstdWrite(ZSTD_DCtx *Zctx, char *in, size_t insize, FILE *fp) { ZSTD_inBuffer Zin; ZSTD_outBuffer Zout; - size_t nw = 0; + size_t nw = 0, w; int rv; Zin.src = in; @@ -547,7 +550,10 @@ ZstdWrite(ZSTD_DCtx *Zctx, char *in, size_t insize, FI ZSTD_getErrorName(rv)); return (-1); } - nw += sparsefwrite(zbuf, Zout.pos, fp); + w = sparsefwrite(zbuf, Zout.pos, fp); + if (w < Zout.pos) + return (-1); + nw += w; } while (Zin.pos < Zin.size && rv != 0); return (nw); @@ -558,7 +564,8 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize uint8_t compression, char *buf, const char *device, const char *filename, FILE *fp) { - size_t nr, nw, wl; + size_t nr, wl; + ssize_t nw; off_t dmpcnt, origsize; z_stream z; /* gzip */ ZSTD_DCtx *Zctx;/* zstd */ @@ -609,8 +616,8 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize nw = fwrite(buf, 1, wl, fp); else nw = sparsefwrite(buf, wl, fp); - if ((compression == KERNELDUMP_COMP_NONE && nw != wl) || - (compression != KERNELDUMP_COMP_NONE && nw < 0)) { + if (nw < 0 || (compression == KERNELDUMP_COMP_NONE && +(size_t)nw != wl)) { logmsg(LOG_ERR, "write error on %s file: %m", filename); logmsg(LOG_WARNING, ___ 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: r368563 - head/sys/dev/ntb/ntb_hw
Author: rlibby Date: Fri Dec 11 22:51:48 2020 New Revision: 368563 URL: https://svnweb.freebsd.org/changeset/base/368563 Log: ntb: quiet gcc -Wreturn-type Reviewed by: cem, markj Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27553 Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c == --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 11 22:51:44 2020 (r368562) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 11 22:51:48 2020 (r368563) @@ -1309,6 +1309,7 @@ db_ioread(struct ntb_softc *ntb, uint64_t regoff) case NTB_XEON_GEN1: return (intel_ntb_reg_read(2, regoff)); } + __assert_unreachable(); } static inline void ___ 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: r368566 - in head/sys: dev/if_wg/include/sys dev/if_wg/module modules/if_wg
Author: rlibby Date: Fri Dec 11 22:52:03 2020 New Revision: 368566 URL: https://svnweb.freebsd.org/changeset/base/368566 Log: if_wg: appease gcc - remove -ferror-limit option - quiet -Wredundant-decls Reviewed by: mmacy Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27559 Modified: head/sys/dev/if_wg/include/sys/if_wg_session_vars.h head/sys/dev/if_wg/include/sys/wg_module.h head/sys/dev/if_wg/module/if_wg_session.c head/sys/modules/if_wg/Makefile Modified: head/sys/dev/if_wg/include/sys/if_wg_session_vars.h == --- head/sys/dev/if_wg/include/sys/if_wg_session_vars.h Fri Dec 11 22:51:57 2020(r368565) +++ head/sys/dev/if_wg/include/sys/if_wg_session_vars.h Fri Dec 11 22:52:03 2020(r368566) @@ -274,9 +274,6 @@ struct wg_tag { int t_mtu; }; -int wg_route_add(struct wg_route_table *tbl, struct wg_peer *peer, -const struct wg_allowedip *cidr_); - struct wg_peer *wg_route_lookup(struct wg_route_table *, struct mbuf *, enum route_direction); Modified: head/sys/dev/if_wg/include/sys/wg_module.h == --- head/sys/dev/if_wg/include/sys/wg_module.h Fri Dec 11 22:51:57 2020 (r368565) +++ head/sys/dev/if_wg/include/sys/wg_module.h Fri Dec 11 22:52:03 2020 (r368566) @@ -47,8 +47,6 @@ #include #include -MALLOC_DECLARE(M_WG); - enum noise_lengths { NOISE_PUBLIC_KEY_LEN = CURVE25519_KEY_SIZE, Modified: head/sys/dev/if_wg/module/if_wg_session.c == --- head/sys/dev/if_wg/module/if_wg_session.c Fri Dec 11 22:51:57 2020 (r368565) +++ head/sys/dev/if_wg/module/if_wg_session.c Fri Dec 11 22:52:03 2020 (r368566) @@ -113,7 +113,6 @@ SYSCTL_INT(_net_wg, OID_AUTO, debug, CTLFLAG_RWTUN, &w #define DPRINTF(sc, ...) if (wireguard_debug) if_printf(sc->sc_ifp, ##__VA_ARGS__) /* Socket */ -intwg_socket_close(struct wg_socket *); static int wg_socket_bind(struct wg_softc *sc, struct wg_socket *); static int wg_send(struct wg_softc *, struct wg_endpoint *, struct mbuf *); @@ -145,9 +144,6 @@ static void wg_timers_disable(struct wg_timers *); /* Queue */ static int wg_queue_in(struct wg_peer *, struct mbuf *); static struct mbuf *wg_queue_dequeue(struct wg_queue *, struct wg_tag **); - -/* Route */ -void wg_route_destroy(struct wg_route_table *); /* Cookie */ Modified: head/sys/modules/if_wg/Makefile == --- head/sys/modules/if_wg/Makefile Fri Dec 11 22:51:57 2020 (r368565) +++ head/sys/modules/if_wg/Makefile Fri Dec 11 22:52:03 2020 (r368566) @@ -14,7 +14,6 @@ ZINCDIR= ${SRCTOP}/sys/dev/if_wg/module/crypto/zinc CFLAGS+= -I${INCDIR} CFLAGS+= -D__KERNEL__ -CFLAGS+= -ferror-limit=7 DEBUG_FLAGS=-g ___ 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: r368562 - head/sys/kern
Author: rlibby Date: Fri Dec 11 22:51:44 2020 New Revision: 368562 URL: https://svnweb.freebsd.org/changeset/base/368562 Log: cache_fplookup: quiet gcc -Wreturn-type Reviewed by: markj, mjg Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D27555 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Fri Dec 11 21:51:50 2020(r368561) +++ head/sys/kern/vfs_cache.c Fri Dec 11 22:51:44 2020(r368562) @@ -4603,6 +4603,7 @@ out: cache_fpl_cleanup_cnp(cnp); return (error); } + __assert_unreachable(); } /* ___ 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: r368561 - in head: share/man/man4 sys/dev/if_ndis
Author: brooks Date: Fri Dec 11 21:51:50 2020 New Revision: 368561 URL: https://svnweb.freebsd.org/changeset/base/368561 Log: ndis(4): expand deprecation to the whole driver nids(4) was a clever idea in the early 2000's when the market was flooded with 10/100 NICs with Windows-only drivers, but that hasn't been the case for ages and the driver has had no meaningful maintenance in ages. It only supports Windows-XP era drivers. Reviewed by: imp, bcr MFC after:3 days Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D27527 Modified: head/share/man/man4/ndis.4 head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/if_ndis/if_ndis_usb.c Modified: head/share/man/man4/ndis.4 == --- head/share/man/man4/ndis.4 Fri Dec 11 21:43:44 2020(r368560) +++ head/share/man/man4/ndis.4 Fri Dec 11 21:51:50 2020(r368561) @@ -121,7 +121,7 @@ which can be configured via the .Xr sysctl 8 command. .Sh DEPRECATION NOTICE -The PC Card attachment of this driver is scheduled for removal prior to the release of +This driver is scheduled for removal prior to the release of .Fx 13.0 .Sh DIAGNOSTICS .Bl -diag Modified: head/sys/dev/if_ndis/if_ndis_pccard.c == --- head/sys/dev/if_ndis/if_ndis_pccard.c Fri Dec 11 21:43:44 2020 (r368560) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Fri Dec 11 21:51:50 2020 (r368561) @@ -304,7 +304,7 @@ ndis_attach_pccard(dev) error = ndis_attach(dev); if (error == 0) - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "ndis removed"); fail: return(error); Modified: head/sys/dev/if_ndis/if_ndis_pci.c == --- head/sys/dev/if_ndis/if_ndis_pci.c Fri Dec 11 21:43:44 2020 (r368560) +++ head/sys/dev/if_ndis/if_ndis_pci.c Fri Dec 11 21:51:50 2020 (r368561) @@ -337,6 +337,9 @@ ndis_attach_pci(dev) sc->ndis_devidx = devidx; error = ndis_attach(dev); + if (error == 0) + gone_in_dev(dev, 13, "ndis removed"); + fail: return(error); Modified: head/sys/dev/if_ndis/if_ndis_usb.c == --- head/sys/dev/if_ndis/if_ndis_usb.c Fri Dec 11 21:43:44 2020 (r368560) +++ head/sys/dev/if_ndis/if_ndis_usb.c Fri Dec 11 21:51:50 2020 (r368561) @@ -199,6 +199,8 @@ ndisusb_attach(device_t self) if (ndis_attach(self) != 0) return (ENXIO); + gone_in_dev(self, 13, "ndis removed"); + return (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: r368560 - head
Author: brooks Date: Fri Dec 11 21:43:44 2020 New Revision: 368560 URL: https://svnweb.freebsd.org/changeset/base/368560 Log: Note removal of hme(4) Sponsored by: DARPA Modified: head/RELNOTES Modified: head/RELNOTES == --- head/RELNOTES Fri Dec 11 21:40:38 2020(r368559) +++ head/RELNOTES Fri Dec 11 21:43:44 2020(r368560) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r368559: + The hme(4) driver was removed. + r367660: Fixes the case where gssd will not startup because /usr is a separate local file system that is not yet mounted. It does not fix the case ___ 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: r368559 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/hme sys/dev/sk sys/i386/conf sys/modules sys/modules/hme sys/netpfil/pf
Author: brooks Date: Fri Dec 11 21:40:38 2020 New Revision: 368559 URL: https://svnweb.freebsd.org/changeset/base/368559 Log: hme(4): Remove as previous announced The hme (Happy Meal Ethernet) driver was the onboard NIC in most supported sparc64 platforms. A few PCI NICs do exist, but we have seen no evidence of use on non-sparc systems. Reviewed by: imp, emaste, bcr Sponsored by: DARPA Deleted: head/share/man/man4/hme.4 head/sys/dev/hme/if_hme.c head/sys/dev/hme/if_hme_pci.c head/sys/dev/hme/if_hmereg.h head/sys/dev/hme/if_hmevar.h head/sys/modules/hme/Makefile Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/dev/sk/if_sk.c head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/netpfil/pf/pf.c Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Fri Dec 11 20:01:45 2020(r368558) +++ head/ObsoleteFiles.inc Fri Dec 11 21:40:38 2020(r368559) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20201211: hme(4) removed +OLD_FILES+=usr/share/man/man4/hme.4.gz +OLD_FILES+=usr/share/man/man4/if_hme.4.gz # 20201124: ping6(8) was merged into ping(8) OLD_FILES+=usr/lib/debug/sbin/ping6.debug OLD_FILES+=usr/share/man/man8/ping6.8.gz Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileFri Dec 11 20:01:45 2020 (r368558) +++ head/share/man/man4/MakefileFri Dec 11 21:40:38 2020 (r368559) @@ -180,7 +180,6 @@ MAN=aac.4 \ gre.4 \ h_ertt.4 \ hifn.4 \ - hme.4 \ hpet.4 \ ${_hpt27xx.4} \ ${_hptiop.4} \ @@ -665,7 +664,6 @@ MLINKS+=gpio.4 gpiobus.4 MLINKS+=gpioths.4 dht11.4 MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 -MLINKS+=hme.4 if_hme.4 MLINKS+=hpet.4 acpi_hpet.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=${_attimer.4} ${_i8254.4} Modified: head/share/man/man4/altq.4 == --- head/share/man/man4/altq.4 Fri Dec 11 20:01:45 2020(r368558) +++ head/share/man/man4/altq.4 Fri Dec 11 21:40:38 2020(r368559) @@ -148,7 +148,6 @@ They have been applied to the following hardware drive .Xr et 4 , .Xr fxp 4 , .Xr gem 4 , -.Xr hme 4 , .Xr igb 4 , .Xr ixgbe 4 , .Xr jme 4 , Modified: head/share/man/man4/miibus.4 == --- head/share/man/man4/miibus.4Fri Dec 11 20:01:45 2020 (r368558) +++ head/share/man/man4/miibus.4Fri Dec 11 21:40:38 2020 (r368559) @@ -77,8 +77,6 @@ Agere ET1310 Gigabit Ethernet Intel EtherExpress PRO/100B .It Xr gem 4 Sun ERI, Sun GEM and Apple GMAC Ethernet -.It Xr hme 4 -Sun HME Ethernet .It Xr jme 4 JMicron JMC250 Gigabit/JMC260 Fast Ethernet .It Xr lge 4 @@ -157,7 +155,6 @@ but as a result are not well behaved newbus device dri .Xr et 4 , .Xr fxp 4 , .Xr gem 4 , -.Xr hme 4 , .Xr jme 4 , .Xr lge 4 , .Xr msk 4 , Modified: head/share/man/man4/vlan.4 == --- head/share/man/man4/vlan.4 Fri Dec 11 20:01:45 2020(r368558) +++ head/share/man/man4/vlan.4 Fri Dec 11 21:40:38 2020(r368559) @@ -172,7 +172,6 @@ These interfaces natively support long frames for .Xr fwe 4 , .Xr fxp 4 , .Xr gem 4 , -.Xr hme 4 , .Xr le 4 , .Xr nfe 4 , .Xr rl 4 , Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Fri Dec 11 20:01:45 2020(r368558) +++ head/sys/amd64/conf/GENERIC Fri Dec 11 21:40:38 2020(r368559) @@ -271,7 +271,6 @@ device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) device gem # Sun GEM/Sun ERI/Apple GMAC -device hme # Sun HME (Happy Meal Ethernet) device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Fri Dec 11 20:01:45 2020(r368558) +++ head/sys/conf/NOTES Fri Dec 11 21:40:38 2020(r368559) @@ -1867,7 +1867,6 @@ devicexmphy # XaQti XMAC II # fxp
svn commit: r368558 - head/sys/riscv/include
Author: mhorne Date: Fri Dec 11 20:01:45 2020 New Revision: 368558 URL: https://svnweb.freebsd.org/changeset/base/368558 Log: riscv: small counter(9) improvements Prefer atomics to critical section. This reduces the cost of the increment operation and removes the possibility of it being interrupted by counter_u64_zero(). Use CPU_FOREACH() macro to skip absent CPUs. Replace hand-rolled address calculation with zpcpu_get(). Reviewed by: markj Differential Revision:https://reviews.freebsd.org/D27536 Modified: head/sys/riscv/include/counter.h Modified: head/sys/riscv/include/counter.h == --- head/sys/riscv/include/counter.hFri Dec 11 19:45:40 2020 (r368557) +++ head/sys/riscv/include/counter.hFri Dec 11 20:01:45 2020 (r368558) @@ -30,14 +30,12 @@ #define_MACHINE_COUNTER_H_ #include -#ifdef INVARIANTS -#include -#endif +#include #defineEARLY_COUNTER &__pcpu[0].pc_early_dummy_counter -#definecounter_enter() critical_enter() -#definecounter_exit() critical_exit() +#definecounter_enter() do {} while (0) +#definecounter_exit() do {} while (0) #ifdef IN_SUBR_COUNTER_C static inline uint64_t @@ -54,19 +52,17 @@ counter_u64_fetch_inline(uint64_t *p) int i; r = 0; - for (i = 0; i < mp_ncpus; i++) - r += counter_u64_read_one((uint64_t *)p, i); + CPU_FOREACH(i) + r += counter_u64_read_one(p, i); return (r); } -/* XXXKIB might interrupt increment */ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * - PCPU_GET(cpuid))) = 0; + *(zpcpu_get((counter_u64_t *)arg)) = 0; } static inline void @@ -78,18 +74,13 @@ counter_u64_zero_inline(counter_u64_t c) } #endif -#definecounter_u64_add_protected(c, inc) do {\ - CRITICAL_ASSERT(curthread); \ - *(uint64_t *)zpcpu_get(c) += (inc); \ -} while (0) +#definecounter_u64_add_protected(c, inc) counter_u64_add(c, inc) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - counter_enter(); - counter_u64_add_protected(c, inc); - counter_exit(); + atomic_add_64((uint64_t *)zpcpu_get(c), inc); } #endif /* ! _MACHINE_COUNTER_H_ */ ___ 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: r368557 - head/share/man/man9
Author: np Date: Fri Dec 11 19:45:40 2020 New Revision: 368557 URL: https://svnweb.freebsd.org/changeset/base/368557 Log: vnet.9: Use correct location of vnet.h. MFC after:1 week Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D27557 Modified: head/share/man/man9/vnet.9 Modified: head/share/man/man9/vnet.9 == --- head/share/man/man9/vnet.9 Fri Dec 11 19:27:21 2020(r368556) +++ head/share/man/man9/vnet.9 Fri Dec 11 19:45:40 2020(r368557) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2018 +.Dd December 10, 2020 .Dt VNET 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .Cd "options VIMAGE" .Cd "options VNET_DEBUG" .Pp -.In sys/vnet.h +.In net/vnet.h .\" .Ss "Constants and Global Variables" .\" ___ 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: r368556 - head/usr.bin/lock
Author: fernape (ports committer) Date: Fri Dec 11 19:27:21 2020 New Revision: 368556 URL: https://svnweb.freebsd.org/changeset/base/368556 Log: lock(1): Add EXAMPLES section Add simple example showing the use of the flags: p, t, v Reviewed by: gbe@, yuripv@ Approved by: manpages (yuripv@) Differential Revision:https://reviews.freebsd.org/D27541 Modified: head/usr.bin/lock/lock.1 Modified: head/usr.bin/lock/lock.1 == --- head/usr.bin/lock/lock.1Fri Dec 11 18:14:43 2020(r368555) +++ head/usr.bin/lock/lock.1Fri Dec 11 19:27:21 2020(r368556) @@ -28,7 +28,7 @@ .\"@(#)lock.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 10, 2002 +.Dd December 11, 2020 .Dt LOCK 1 .Os .Sh NAME @@ -73,6 +73,11 @@ or .Xr vt 4 virtual terminal. .El +.Sh EXAMPLES +Lock the terminal for 5 minutes, disable switching virtual terminals and +require the user's login password to unlock: +.Pp +.Dl $ lock -p -t 5 -v .Sh SEE ALSO .Xr vidcontrol 1 , .Xr syscons 4 , ___ 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: r368555 - in head/secure/caroot: blacklisted trusted
Author: kevans Date: Fri Dec 11 18:14:43 2020 New Revision: 368555 URL: https://svnweb.freebsd.org/changeset/base/368555 Log: caroot: update bundle Summary: - One (1) added - Ten (10) removed MFC after:3 days Added: head/secure/caroot/blacklisted/GeoTrust_Global_CA.pem - copied unchanged from r368554, head/secure/caroot/trusted/GeoTrust_Global_CA.pem head/secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority.pem - copied unchanged from r368554, head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem head/secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority_-_G3.pem - copied unchanged from r368554, head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem head/secure/caroot/blacklisted/GeoTrust_Universal_CA.pem - copied unchanged from r368554, head/secure/caroot/trusted/GeoTrust_Universal_CA.pem head/secure/caroot/blacklisted/GeoTrust_Universal_CA_2.pem - copied unchanged from r368554, head/secure/caroot/trusted/GeoTrust_Universal_CA_2.pem head/secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem - copied unchanged from r368554, head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem head/secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem - copied unchanged from r368554, head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem head/secure/caroot/blacklisted/thawte_Primary_Root_CA.pem - copied unchanged from r368554, head/secure/caroot/trusted/thawte_Primary_Root_CA.pem head/secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G2.pem - copied unchanged from r368554, head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem head/secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G3.pem - copied unchanged from r368554, head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem head/secure/caroot/trusted/NAVER_Global_Root_Certification_Authority.pem (contents, props changed) Deleted: head/secure/caroot/trusted/GeoTrust_Global_CA.pem head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem head/secure/caroot/trusted/GeoTrust_Universal_CA.pem head/secure/caroot/trusted/GeoTrust_Universal_CA_2.pem head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem head/secure/caroot/trusted/thawte_Primary_Root_CA.pem head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem Copied: head/secure/caroot/blacklisted/GeoTrust_Global_CA.pem (from r368554, head/secure/caroot/trusted/GeoTrust_Global_CA.pem) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/blacklisted/GeoTrust_Global_CA.pem Fri Dec 11 18:14:43 2020(r368555, copy of r368554, head/secure/caroot/trusted/GeoTrust_Global_CA.pem) @@ -0,0 +1,90 @@ +## +## GeoTrust Global CA +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: +Data: +Version: 3 (0x2) +Serial Number: 144470 (0x23456) +Signature Algorithm: sha1WithRSAEncryption +Issuer: C = US, O = GeoTrust Inc., CN = GeoTrust Global CA +Validity +Not Before: May 21 04:00:00 2002 GMT +Not After : May 21 04:00:00 2022 GMT +Subject: C = US, O = GeoTrust Inc., CN = GeoTrust Global CA +Subject Public Key Info: +Public Key Algorithm: rsaEncryption +RSA Public-Key: (2048 bit) +Modulus: +00:da:cc:18:63:30:fd:f4:17:23:1a:56:7e:5b:df: +3c:6c:38:e4:71:b7:78:91:d4:bc:a1:d8:4c:f8:a8: +43:b6:03:e9:4d:21:07:08:88:da:58:2f:66:39:29: +bd:05:78:8b:9d:38:e8:05:b7:6a:7e:71:a4:e6:c4: +60:a6:b0:ef:80:e4:89:28:0f:9e:25:d6:ed:83:f3: +ad:a6:91:c7:98:c9:42:18:35:14:9d:ad:98:46:92: +2e:4f:ca:f1:87:43:c1:16:95:57:2d:50:ef:89:2d: +80:7a:57:ad:f2:ee:5f:6b:d2:00:8d:b9:14:f8:14: +15:35:d9:c0:46:a3:7b:72:c8:91:bf:c9:55:2b:cd: +d0:97:3e:9c:26:64:cc:df:ce:83:19:71:ca:4e:e6: +d4:d5:7b:a9:19:cd:55:de:c8:ec:d2:5e:38:53:e5: +5c:4f:8c:2d:fe:50:23:36:fc:66:e6:c
svn commit: r368554 - stable/12/sys/net
Author: kp Date: Fri Dec 11 15:39:22 2020 New Revision: 368554 URL: https://svnweb.freebsd.org/changeset/base/368554 Log: MFC r368020, r368025: if: Protect V_ifnet in vnet_if_return() When we terminate a vnet (i.e. jail) we move interfaces back to their home vnet. We need to protect our access to the V_ifnet CK_LIST. We could enter NET_EPOCH, but if_detach_internal() (called from if_vmove()) waits for net epoch callback completion. That's not possible from NET_EPOCH. Instead, we take the IFNET_WLOCK, build a list of the interfaces that need to move and, once we've released the lock, move them back to their home vnet. We cannot hold the IFNET_WLOCK() during if_vmove(), because that results in a LOR between ifnet_sx, in_multi_sx and iflib ctx lock. Separate out moving the ifp into or out of V_ifnet, so we can hold the lock as we do the list manipulation, but do not hold it as we if_vmove(). if: Fix non-VIMAGE build if_link_ifnet() and if_unlink_ifnet() are needed even when VIMAGE is not enabled. Sponsored by: Modirum MDPay Modified: stable/12/sys/net/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c == --- stable/12/sys/net/if.c Fri Dec 11 14:32:42 2020(r368553) +++ stable/12/sys/net/if.c Fri Dec 11 15:39:22 2020(r368554) @@ -274,6 +274,8 @@ static int if_getgroupmembers(struct ifgroupreq *); static voidif_delgroups(struct ifnet *); static voidif_attach_internal(struct ifnet *, int, struct if_clone *); static int if_detach_internal(struct ifnet *, int, struct if_clone **); +static voidif_link_ifnet(struct ifnet *); +static boolif_unlink_ifnet(struct ifnet *, bool); #ifdef VIMAGE static voidif_vmove(struct ifnet *, struct vnet *); #endif @@ -472,17 +474,85 @@ vnet_if_uninit(const void *unused __unused) } VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_uninit, NULL); +#endif static void +if_link_ifnet(struct ifnet *ifp) +{ + + IFNET_WLOCK(); + CK_STAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); +#ifdef VIMAGE + curvnet->vnet_ifcnt++; +#endif + IFNET_WUNLOCK(); +} + +static bool +if_unlink_ifnet(struct ifnet *ifp, bool vmove) +{ + struct ifnet *iter; + int found = 0; + + IFNET_WLOCK(); + CK_STAILQ_FOREACH(iter, &V_ifnet, if_link) + if (iter == ifp) { + CK_STAILQ_REMOVE(&V_ifnet, ifp, ifnet, if_link); + if (!vmove) + ifp->if_flags |= IFF_DYING; + found = 1; + break; + } +#ifdef VIMAGE + curvnet->vnet_ifcnt--; +#endif + IFNET_WUNLOCK(); + + return (found); +} + +#ifdef VIMAGE +static void vnet_if_return(const void *unused __unused) { struct ifnet *ifp, *nifp; + struct ifnet **pending; + int found, i; + i = 0; + + /* +* We need to protect our access to the V_ifnet tailq. Ordinarily we'd +* enter NET_EPOCH, but that's not possible, because if_vmove() calls +* if_detach_internal(), which waits for NET_EPOCH callbacks to +* complete. We can't do that from within NET_EPOCH. +* +* However, we can also use the IFNET_xLOCK, which is the V_ifnet +* read/write lock. We cannot hold the lock as we call if_vmove() +* though, as that presents LOR w.r.t ifnet_sx, in_multi_sx and iflib +* ctx lock. +*/ + IFNET_WLOCK(); + + pending = malloc(sizeof(struct ifnet *) * curvnet->vnet_ifcnt, + M_IFNET, M_WAITOK | M_ZERO); + /* Return all inherited interfaces to their parent vnets. */ CK_STAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { - if (ifp->if_home_vnet != ifp->if_vnet) - if_vmove(ifp, ifp->if_home_vnet); + if (ifp->if_home_vnet != ifp->if_vnet) { + found = if_unlink_ifnet(ifp, true); + MPASS(found); + + pending[i++] = ifp; + } } + IFNET_WUNLOCK(); + + for (int j = 0; j < i; j++) { + if_vmove(pending[j], pending[j]->if_home_vnet); + } + + free(pending, M_IFNET); } VNET_SYSUNINIT(vnet_if_return, SI_SUB_VNET_DONE, SI_ORDER_ANY, vnet_if_return, NULL); @@ -890,12 +960,7 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc } #endif - IFNET_WLOCK(); - CK_STAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); -#ifdef VIMAGE - curvnet->vnet_ifcnt++; -#endif - IFNET_WUNLOCK(); + if_link_ifnet(ifp); if (domain_init_status >= 2) if_attachdomain1(ifp); @@ -1033,9 +1098,12 @@ if_purgemaddrs(struct ifnet *ifp) void if_detach(struct ifnet *ifp) { + bool found; CURVNET
svn commit: r368553 - head/sbin/decryptcore
Author: vangyzen Date: Fri Dec 11 14:32:42 2020 New Revision: 368553 URL: https://svnweb.freebsd.org/changeset/base/368553 Log: decryptcore: preload OpenSSL error strings; seed PRNG As in r360226, preload OpenSSL error strings and seed the PRNG before entering capability mode. MFC after:2 weeks Sponsored by: Dell EMC Isilon Modified: head/sbin/decryptcore/decryptcore.c Modified: head/sbin/decryptcore/decryptcore.c == --- head/sbin/decryptcore/decryptcore.c Fri Dec 11 14:11:41 2020 (r368552) +++ head/sbin/decryptcore/decryptcore.c Fri Dec 11 14:32:42 2020 (r368553) @@ -170,6 +170,19 @@ decrypt(int ofd, const char *privkeyfile, const char * goto failed; } + /* +* Obsolescent OpenSSL only knows about /dev/random, and needs to +* pre-seed before entering cap mode. For whatever reason, +* RSA_pub_encrypt uses the internal PRNG. +*/ +#if OPENSSL_VERSION_NUMBER < 0x1010L + { + unsigned char c[1]; + RAND_bytes(c, 1); + } +#endif + ERR_load_crypto_strings(); + caph_cache_catpages(); if (caph_enter() < 0) { pjdlog_errno(LOG_ERR, "Unable to enter capability mode"); ___ 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: r368552 - stable/12/sys/net
Author: kp Date: Fri Dec 11 14:11:41 2020 New Revision: 368552 URL: https://svnweb.freebsd.org/changeset/base/368552 Log: MFC r368015: if: Remove ifnet_rwlock It no longer serves any purpose, as evidenced by the fact that we never take it without ifnet_sxlock. This differs slightly from r368015 in that we keep the ifnet_rwlock instance (but no longer take the lock) in case there are external users who still take the lock. Sponsored by: Modirum MDPay Modified: stable/12/sys/net/if.c stable/12/sys/net/if_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c == --- stable/12/sys/net/if.c Fri Dec 11 13:23:59 2020(r368551) +++ stable/12/sys/net/if.c Fri Dec 11 14:11:41 2020(r368552) @@ -305,12 +305,8 @@ VNET_DEFINE(struct ifnet **, ifindex_table); /* * The global network interface list (V_ifnet) and related state (such as - * if_index, if_indexlim, and ifindex_table) are protected by an sxlock and - * an rwlock. Either may be acquired shared to stablize the list, but both - * must be acquired writable to modify the list. This model allows us to - * both stablize the interface list during interrupt thread processing, but - * also to stablize it over long-running ioctls, without introducing priority - * inversions and deadlocks. + * if_index, if_indexlim, and ifindex_table) are protected by an sxlock. + * This may be acquired to stabilise the list, or we may rely on NET_EPOCH. */ struct rwlock ifnet_rwlock; RW_SYSINIT_FLAGS(ifnet_rw, &ifnet_rwlock, "ifnet_rw", RW_RECURSE); Modified: stable/12/sys/net/if_var.h == --- stable/12/sys/net/if_var.h Fri Dec 11 13:23:59 2020(r368551) +++ stable/12/sys/net/if_var.h Fri Dec 11 14:11:41 2020(r368552) @@ -569,27 +569,11 @@ struct ifmultiaddr { extern struct rwlock ifnet_rwlock; extern struct sx ifnet_sxlock; -#defineIFNET_WLOCK() do { \ - sx_xlock(&ifnet_sxlock);\ - rw_wlock(&ifnet_rwlock);\ -} while (0) - -#defineIFNET_WUNLOCK() do { \ - rw_wunlock(&ifnet_rwlock); \ - sx_xunlock(&ifnet_sxlock); \ -} while (0) - -/* - * To assert the ifnet lock, you must know not only whether it's for read or - * write, but also whether it was acquired with sleep support or not. - */ -#defineIFNET_RLOCK_ASSERT()sx_assert(&ifnet_sxlock, SA_SLOCKED) +#defineIFNET_WLOCK() sx_xlock(&ifnet_sxlock) +#defineIFNET_WUNLOCK() sx_xunlock(&ifnet_sxlock) +#defineIFNET_RLOCK_ASSERT()sx_assert(&ifnet_sxlock, SA_SLOCKED) #defineIFNET_RLOCK_NOSLEEP_ASSERT() MPASS(in_epoch(net_epoch_preempt)) -#defineIFNET_WLOCK_ASSERT() do { \ - sx_assert(&ifnet_sxlock, SA_XLOCKED); \ - rw_assert(&ifnet_rwlock, RA_WLOCKED); \ -} while (0) - +#defineIFNET_WLOCK_ASSERT()sx_assert(&ifnet_sxlock, SA_XLOCKED) #defineIFNET_RLOCK() sx_slock(&ifnet_sxlock) #defineIFNET_RLOCK_NOSLEEP() struct epoch_tracker ifnet_rlock_et; epoch_enter_preempt(net_epoch_preempt, &ifnet_rlock_et) #defineIFNET_RUNLOCK() sx_sunlock(&ifnet_sxlock) ___ 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: r368551 - head/usr.bin/calendar/tests
Author: se Date: Fri Dec 11 13:23:59 2020 New Revision: 368551 URL: https://svnweb.freebsd.org/changeset/base/368551 Log: Install 2 forgotten shell scripts required to run the tests Submitted by: arichardson (Alexander Richardson) Differential Revision:https://reviews.freebsd.org/D27568 Modified: head/usr.bin/calendar/tests/Makefile Modified: head/usr.bin/calendar/tests/Makefile == --- head/usr.bin/calendar/tests/MakefileFri Dec 11 08:04:54 2020 (r368550) +++ head/usr.bin/calendar/tests/MakefileFri Dec 11 13:23:59 2020 (r368551) @@ -10,9 +10,11 @@ TEST_METADATA.legacy_test+= timeout="600" ${PACKAGE}FILES+= calendar.comment ${PACKAGE}FILES+= regress.comment.out +${PACKAGE}FILES+= comment.sh ${PACKAGE}FILES+= calendar.cond ${PACKAGE}FILES+= regress.cond.out +${PACKAGE}FILES+= cond.sh ${PACKAGE}FILES+= calendar.calibrate ${PACKAGE}FILES+= regress.a1.out ___ 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: r368550 - head/usr.bin/locate/locate
Author: ygy (doc committer) Date: Fri Dec 11 08:04:54 2020 New Revision: 368550 URL: https://svnweb.freebsd.org/changeset/base/368550 Log: Fix a grammar error on locate(1). While here, also fix a useless .Tn reported by mandoc. PR: 251746 MFC after:1 week Sumbitted by: David Schlachter Modified: head/usr.bin/locate/locate/locate.1 Modified: head/usr.bin/locate/locate/locate.1 == --- head/usr.bin/locate/locate/locate.1 Fri Dec 11 04:02:19 2020 (r368549) +++ head/usr.bin/locate/locate/locate.1 Fri Dec 11 08:04:54 2020 (r368550) @@ -29,7 +29,7 @@ .\"@(#)locate.18.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 17, 2006 +.Dd December 11, 2020 .Dt LOCATE 1 .Os .Sh NAME @@ -75,7 +75,7 @@ is matched as though it were .Pp Historically, locate only stored characters between 32 and 127. The -current implementation store any character except newline +current implementation stores any character except newline .Pq Sq \en and .Dv NUL @@ -88,8 +88,7 @@ are stored in 2 bytes. The following options are available: .Bl -tag -width 10n .It Fl 0 -Print pathnames separated by an -.Tn ASCII +Print pathnames separated by an ASCII .Dv NUL character (character code 0) instead of default NL (newline, character code 10). ___ 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"