svn commit: r366243 - head/usr.bin/calendar

2020-09-28 Thread Greg Lehey
Author: grog
Date: Tue Sep 29 05:49:45 2020
New Revision: 366243
URL: https://svnweb.freebsd.org/changeset/base/366243

Log:
  Document the fact (bug?) that the -a option will normally process
  root's calendar files three times, once each for root, toor and
  daemon.
  
  This relates to bug 246943, but does not solve it.  See discussion in
  bug report for more details.
  
  PR:   246943
  Reported by:  wcarson.bugzi...@disillusion.net

Modified:
  head/usr.bin/calendar/calendar.1

Modified: head/usr.bin/calendar/calendar.1
==
--- head/usr.bin/calendar/calendar.1Tue Sep 29 05:08:45 2020
(r366242)
+++ head/usr.bin/calendar/calendar.1Tue Sep 29 05:49:45 2020
(r366243)
@@ -70,9 +70,24 @@ Print lines from today and the next
 .Ar num
 days (forward, future).
 .It Fl a
-Process the ``calendar'' files of all users and mail the results
+Process the ``calendar'' files for users found in
+.Pa /etc/passwd
+and mail the results
 to them.
-This requires super-user privileges.
+This can result in multiple messages for specific files, since
+.Pa /etc/passwd
+does not require home directories to be unique.
+In particular, by default
+.Ar root ,
+.Ar toor
+and
+.Ar daemon
+share the same home directory.
+If this directory contains calendar information,
+.Nm
+will process the file three times.
+.Pp
+This option requires super-user privileges.
 .It Fl B Ar num
 Print lines from today and the previous
 .Ar num
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366242 - head/sys/dev/cxgbe

2020-09-28 Thread Navdeep Parhar
Author: np
Date: Tue Sep 29 05:08:45 2020
New Revision: 366242
URL: https://svnweb.freebsd.org/changeset/base/366242

Log:
  cxgbe(4): fixes for netmap operation with only some queues active.
  
  - Only active netmap receive queues should be in the RSS lookup table.
  
  - The RSS table should be restored for NIC operation when the last
active netmap queue is switched off, not the first one.
  
  - Support repeated netmap ON/OFF on a subset of the queues.  This works
whether the the queues being enabled and disabled are the only ones
active or not.  Some kring indexes have to be reset in the driver for
the second case.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_netmap.c

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Tue Sep 29 02:03:24 2020
(r366241)
+++ head/sys/dev/cxgbe/t4_netmap.c  Tue Sep 29 05:08:45 2020
(r366242)
@@ -347,6 +347,180 @@ free_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq 
 }
 
 static int
+cxgbe_netmap_simple_rss(struct adapter *sc, struct vi_info *vi,
+struct ifnet *ifp, struct netmap_adapter *na)
+{
+   struct netmap_kring *kring;
+   struct sge_nm_rxq *nm_rxq;
+   int rc, i, j, nm_state, defq;
+   uint16_t *rss;
+
+   /*
+* Check if there's at least one active (or about to go active) netmap
+* rx queue.
+*/
+   defq = -1;
+   for_each_nm_rxq(vi, j, nm_rxq) {
+   nm_state = atomic_load_int(&nm_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF && nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID);
+   if (defq == -1) {
+   defq = nm_rxq->iq_abs_id;
+   break;
+   }
+   }
+   }
+
+   if (defq == -1) {
+   /* No active netmap queues.  Switch back to NIC queues. */
+   rss = vi->rss;
+   defq = vi->rss[0];
+   } else {
+   for (i = 0; i < vi->rss_size;) {
+   for_each_nm_rxq(vi, j, nm_rxq) {
+   nm_state = atomic_load_int(&nm_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF &&
+   !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF &&
+   nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id !=
+   INVALID_NM_RXQ_CNTXT_ID);
+   vi->nm_rss[i++] = nm_rxq->iq_abs_id;
+   if (i == vi->rss_size)
+   break;
+   }
+   }
+   }
+   rss = vi->nm_rss;
+   }
+
+   rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss,
+   vi->rss_size);
+   if (rc != 0)
+   if_printf(ifp, "netmap rss_config failed: %d\n", rc);
+
+   rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0);
+   if (rc != 0) {
+   if_printf(ifp, "netmap defaultq config failed: %d\n", rc);
+   }
+
+   return (rc);
+}
+
+/*
+ * Odd number of rx queues work best for split RSS mode as the first queue can
+ * be dedicated for non-RSS traffic and the rest divided into two equal halves.
+ */
+static int
+cxgbe_netmap_split_rss(struct adapter *sc, struct vi_info *vi,
+struct ifnet *ifp, struct netmap_adapter *na)
+{
+   struct netmap_kring *kring;
+   struct sge_nm_rxq *nm_rxq;
+   int rc, i, j, nm_state, defq;
+   int nactive[2] = {0, 0};
+   int dq[2] = {-1, -1};
+   bool dq_norss;  /* default queue should not be in RSS table. */
+
+   MPASS(nm_split_rss != 0);
+   MPASS(vi->nnmrxq > 1);
+
+   for_each_nm_rxq(vi, i, nm_rxq) {
+   j = i / ((vi->nnmrxq + 1) / 2);
+   nm_state = atomic_load_int(&nm_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF && nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID);
+   nactive[j]++;
+   if (dq[j] == -1) {
+   dq[j] = nm_rxq->iq_abs_id;
+   break;
+   }
+   }
+   }
+
+   if (nactive[0] == 0 || nactive[

svn commit: r366237 - head/usr.bin/procstat

2020-09-28 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 29 00:20:58 2020
New Revision: 366237
URL: https://svnweb.freebsd.org/changeset/base/366237

Log:
  procstat: Fix regression after 365880.
  
  Basically it reverts one chunk that reversed the parsing logic, making
  legacy variants of invocation, like `procstat -a -f', non-operational.
  
  Reported and tested by:   Dewayne Geraghty 

  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/usr.bin/procstat/procstat.c

Modified: head/usr.bin/procstat/procstat.c
==
--- head/usr.bin/procstat/procstat.cMon Sep 28 22:16:29 2020
(r366236)
+++ head/usr.bin/procstat/procstat.cTue Sep 29 00:20:58 2020
(r366237)
@@ -425,9 +425,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
 
-   if (cmd == NULL && argv[0] != NULL)
-   cmd = getcmd(argv[0]);
-   if (cmd != NULL) {
+   if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) {
if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0)
usage(cmd);
if (cmd->opt != NULL) {
@@ -443,12 +441,13 @@ main(int argc, char *argv[])
argv += 1;
}
} else {
-   cmd = getcmd("basic");
+   if (cmd == NULL)
+   cmd = getcmd("basic");
+   if (cmd->cmd != procstat_files &&
+   (procstat_opts & PS_OPT_CAPABILITIES) != 0 &&
+   (cmd->cmp & PS_MODE_COMPAT) == 0)
+   usage(cmd);
}
-   if (cmd->cmd != procstat_files &&
-   (procstat_opts & PS_OPT_CAPABILITIES) != 0 &&
-   (cmd->cmp & PS_MODE_COMPAT) == 0)
-   usage(cmd);
 
/* Must specify either the -a flag or a list of pids. */
if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366231 - head/sys/kern

2020-09-28 Thread Kyle Evans
Author: kevans
Date: Mon Sep 28 17:19:57 2020
New Revision: 366231
URL: https://svnweb.freebsd.org/changeset/base/366231

Log:
  Address whitespace nits in subr_rtc.c
  
  These were separated out from a nearby patch from Andrew Gierth.
  
  MFC after:3 days

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==
--- head/sys/kern/subr_rtc.cMon Sep 28 16:54:39 2020(r366230)
+++ head/sys/kern/subr_rtc.cMon Sep 28 17:19:57 2020(r366231)
@@ -164,7 +164,7 @@ clock_dbgprint_hdr(device_t dev, int rw)
getnanotime(&now);
device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write");
clock_print_ts(&now, 9);
-   printf(": "); 
+   printf(": ");
 }
 
 void
@@ -241,7 +241,7 @@ clock_register_flags(device_t clockdev, long resolutio
}
sx_xunlock(&rtc_list_lock);
 
-   device_printf(clockdev, 
+   device_printf(clockdev,
"registered as a time-of-day clock, resolution %d.%6.6ds\n",
newrtc->resolution / 100, newrtc->resolution % 100);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366230 - in head: share/man/man9 sys/net sys/sys

2020-09-28 Thread Ed Maste
Author: emaste
Date: Mon Sep 28 16:54:39 2020
New Revision: 366230
URL: https://svnweb.freebsd.org/changeset/base/366230

Log:
  add SIOCGIFDATA ioctl
  
  For interfaces that do not support SIOCGIFMEDIA (for which there are
  quite a few) the only fallback is to query the interface for
  if_data->ifi_link_state.  While it's possible to get at if_data for an
  interface via getifaddrs(3) or sysctl, both are heavy weight mechanisms.
  
  SIOCGIFDATA is a simple ioctl to retrieve this fast with very little
  resource use in comparison.  This implementation mirrors that of other
  similar ioctls in FreeBSD.
  
  Submitted by: Roy Marples 
  Reviewed by:  markj
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D26538

Modified:
  head/share/man/man9/ifnet.9
  head/sys/net/if.c
  head/sys/sys/sockio.h

Modified: head/share/man/man9/ifnet.9
==
--- head/share/man/man9/ifnet.9 Mon Sep 28 16:19:29 2020(r366229)
+++ head/share/man/man9/ifnet.9 Mon Sep 28 16:54:39 2020(r366230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 14, 2018
+.Dd September 28, 2020
 .Dt IFNET 9
 .Os
 .Sh NAME
@@ -1310,12 +1310,13 @@ list.
 Caller must have appropriate privilege.
 (No call-down to driver.)
 .It Dv SIOCGIFCAP
+.It Dv SIOCGIFDATA
 .It Dv SIOCGIFFIB
 .It Dv SIOCGIFFLAGS
 .It Dv SIOCGIFMETRIC
 .It Dv SIOCGIFMTU
 .It Dv SIOCGIFPHYS
-Get interface capabilities, FIB, flags, metric, MTU, medium selection.
+Get interface capabilities, data, FIB, flags, metric, MTU, medium selection.
 (No call-down to driver.)
 .Pp
 .It Dv SIOCSIFCAP

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Sep 28 16:19:29 2020(r366229)
+++ head/sys/net/if.c   Mon Sep 28 16:54:39 2020(r366230)
@@ -2518,6 +2518,18 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
ifr->ifr_curcap = ifp->if_capenable;
break;
 
+   case SIOCGIFDATA:
+   {
+   struct if_data ifd;
+
+   /* Ensure uninitialised padding is not leaked. */
+   memset(&ifd, 0, sizeof(ifd));
+
+   if_data_copy(ifp, &ifd);
+   error = copyout(&ifd, ifr_data_get_ptr(ifr), sizeof(ifd));
+   break;
+   }
+
 #ifdef MAC
case SIOCGIFMAC:
error = mac_ifnet_ioctl_get(td->td_ucred, ifr, ifp);

Modified: head/sys/sys/sockio.h
==
--- head/sys/sys/sockio.h   Mon Sep 28 16:19:29 2020(r366229)
+++ head/sys/sys/sockio.h   Mon Sep 28 16:54:39 2020(r366230)
@@ -83,6 +83,7 @@
 #defineSIOCSIFDESCR _IOW('i', 41, struct ifreq)/* set ifnet 
descr */ 
 #defineSIOCGIFDESCR_IOWR('i', 42, struct ifreq)/* get ifnet 
descr */ 
 #defineSIOCAIFADDR  _IOW('i', 43, struct ifaliasreq)/* add/chg IF 
alias */
+#defineSIOCGIFDATA  _IOW('i', 44, struct ifreq)/* get if_data 
*/
 
 #defineSIOCADDMULTI _IOW('i', 49, struct ifreq)/* add m'cast 
addr */
 #defineSIOCDELMULTI _IOW('i', 50, struct ifreq)/* del m'cast 
addr */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366228 - head/stand/lua

2020-09-28 Thread Warner Losh
Author: imp
Date: Mon Sep 28 16:19:21 2020
New Revision: 366228
URL: https://svnweb.freebsd.org/changeset/base/366228

Log:
  Report the kernel console on the boot screen
  
  Report what console the boot loader is telling the kernel to use:
o Dual (Serial Primary)
o Dual (Video Primary)
o Serial
o Video
  
  This allows the user to interrupt the boot and tweak the cosnole, if
  needed, in a trivial way. Useful for installs where the default
  selected may not be quite what you want, or when you are running a
  dual setup and need to toggle over to the other console being primary.
  The 'c'/'C' keys will do the cycling through the consoles.  Note:
  you'll still have to drop into the loader to set details about serial
  consoles. And this doesn't change the console the loader is using.
  
  Reviewed by: kevans@
  MFC After: 3 days
  Differential Revision: https://reviews.freebsd.org/D26573

Modified:
  head/stand/lua/core.lua
  head/stand/lua/menu.lua

Modified: head/stand/lua/core.lua
==
--- head/stand/lua/core.lua Mon Sep 28 14:47:36 2020(r366227)
+++ head/stand/lua/core.lua Mon Sep 28 16:19:21 2020(r366228)
@@ -451,6 +451,40 @@ function core.popFrontTable(tbl)
return first_value, new_tbl
 end
 
+function core.getConsoleName()
+   if loader.getenv("boot_multicons") ~= nil then
+   if loader.getenv("boot_serial") ~= nil then
+   return "Dual (Serial primary)"
+   else
+   return "Dual (Video primary)"
+   end
+   else
+   if loader.getenv("boot_serial") ~= nil then
+   return "Serial"
+   else
+   return "Video"
+   end
+   end
+end
+
+function core.nextConsoleChoice()
+   if loader.getenv("boot_multicons") ~= nil then
+   if loader.getenv("boot_serial") ~= nil then
+   loader.unsetenv("boot_serial")
+   else
+   loader.unsetenv("boot_multicons")
+   loader.setenv("boot_serial", "YES")
+   end
+   else
+   if loader.getenv("boot_serial") ~= nil then
+   loader.unsetenv("boot_serial")
+   else
+   loader.setenv("boot_multicons", "YES")
+   loader.setenv("boot_serial", "YES")
+   end
+   end
+end
+
 recordDefaults()
 hook.register("config.reloaded", core.clearCachedKernels)
 return core

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Mon Sep 28 14:47:36 2020(r366227)
+++ head/stand/lua/menu.lua Mon Sep 28 16:19:21 2020(r366228)
@@ -244,6 +244,7 @@ menu.welcome = {
boot_entry_2,
menu_entries.prompt,
menu_entries.reboot,
+   menu_entries.console,
{
entry_type = core.MENU_SEPARATOR,
},
@@ -283,6 +284,16 @@ menu.welcome = {
core.boot()
end,
alias = {"s", "S"},
+   },
+   console = {
+   entry_type = core.MENU_ENTRY,
+   name = function()
+   return color.highlight("C") .. "ons: " .. 
core.getConsoleName()
+   end,
+   func = function()
+   core.nextConsoleChoice()
+   end,
+   alias = {"c", "C"},
},
prompt = {
entry_type = core.MENU_RETURN,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366229 - head/sys/kern

2020-09-28 Thread Warner Losh
Author: imp
Date: Mon Sep 28 16:19:29 2020
New Revision: 366229
URL: https://svnweb.freebsd.org/changeset/base/366229

Log:
  For mulitcons boot, report it and which console is primary
  
  Until we can do proper /etc/rc output on both consoles in multicons
  boot (or all of them if we ever generalize), report when we are
  booting multicons. Also report the primary console. This will be a big
  hint why output stops after this line (though some slow USB discovery
  still happens after mountroot / init starts).
  
  Reviewed by: scottl@, tsoome@
  Differential Revision: https://reviews.freebsd.org/D26574

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Mon Sep 28 16:19:21 2020(r366228)
+++ head/sys/kern/init_main.c   Mon Sep 28 16:19:29 2020(r366229)
@@ -715,6 +715,14 @@ start_init(void *dummy)
/* Wipe GELI passphrase from the environment. */
kern_unsetenv("kern.geom.eli.passphrase");
 
+   /* For Multicons, report which console is primary to both */
+   if (boothowto & RB_MULTIPLE) {
+   if (boothowto & RB_SERIAL)
+   printf("Dual Console: Serial Primary, Video 
Secondary\n");
+   else
+   printf("Dual Console: Video Primary, Serial 
Secondary\n");
+   }
+
if ((var = kern_getenv("init_path")) != NULL) {
strlcpy(init_path, var, sizeof(init_path));
freeenv(var);
@@ -724,7 +732,7 @@ start_init(void *dummy)
while ((path = strsep(&tmp_init_path, ":")) != NULL) {
if (bootverbose)
printf("start_init: trying %s\n", path);
-   
+
memset(&args, 0, sizeof(args));
error = exec_alloc_args(&args);
if (error != 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366207 - head/lib/libc/gen

2020-09-28 Thread Konstantin Belousov
On Mon, Sep 28, 2020 at 10:06:55AM -0500, Kyle Evans wrote:
> I would be tempted to just revert the rest of the local modifications
> (sans negative check, maybe) and widen it in the one spot that the
> compiler complains about:
> 
> - if (strlcpy(buf, execpath, buflen_) >= buflen_)
> + if (strlcpy(buf, execpath, buflen) >= (size_t)buflen)
> 
> I had expressed this in the review, but with no particular conviction.
If this is the only place where the warning occurs, IMO it would be quite
good to reduce the change.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366207 - head/lib/libc/gen

2020-09-28 Thread Kyle Evans
On Mon, Sep 28, 2020 at 10:04 AM Konstantin Belousov
 wrote:
>
> On Sun, Sep 27, 2020 at 10:08:49PM -0600, Alan Somers wrote:
> > On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov 
> > wrote:
> >
> > > On Sun, Sep 27, 2020 at 10:26:41PM +, Alan Somers wrote:
> > > > Author: asomers
> > > > Date: Sun Sep 27 22:26:41 2020
> > > > New Revision: 366207
> > > > URL: https://svnweb.freebsd.org/changeset/base/366207
> > > >
> > > > Log:
> > > >   Misc compiler warning fixes in lib/libc
> > > >
> > > >   Reviewed by:kevans, imp
> > > >   MFC after:  2 weeks
> > > >   Differential Revision:  https://reviews.freebsd.org/D26534
> > > >
> > > > Modified:
> > > >   head/lib/libc/gen/auxv.c
> > > >   head/lib/libc/gen/basename_compat.c
> > > >   head/lib/libc/gen/crypt.c
> > > >   head/lib/libc/gen/dirname_compat.c
> > > >   head/lib/libc/gen/fts-compat.c
> > > >   head/lib/libc/gen/ftw-compat11.c
> > > >   head/lib/libc/gen/getentropy.c
> > > >
> > > > Modified: head/lib/libc/gen/auxv.c
> > > >
> > > ==
> > > > --- head/lib/libc/gen/auxv.c  Sun Sep 27 21:43:19 2020(r366206)
> > > > +++ head/lib/libc/gen/auxv.c  Sun Sep 27 22:26:41 2020(r366207)
> > > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void)
> > > >  }
> > > >
> > > >  static pthread_once_t aux_once = PTHREAD_ONCE_INIT;
> > > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len,
> > > bsdflags;
> > > > +static int pagesize, osreldate, ncpus, bsdflags;
> > > > +static size_t canary_len, pagesizes_len;
> > > >  static int hwcap_present, hwcap2_present;
> > > >  static char *canary, *pagesizes, *execpath;
> > > >  static void *ps_strings, *timekeep;
> > > > @@ -245,16 +246,21 @@ int
> > > >  _elf_aux_info(int aux, void *buf, int buflen)
> > > >  {
> > > >   int res;
> > > > + size_t buflen_;
> > > >
> > > >   __init_elf_aux_vector();
> > > >   if (__elf_aux_vector == NULL)
> > > >   return (ENOSYS);
> > > >   _once(&aux_once, init_aux);
> > > >
> > > > + if (buflen < 0)
> > > > + return (EINVAL);
> > > > + buflen_ = (size_t)buflen;
> > > > +
> > > >   switch (aux) {
> > > >   case AT_CANARY:
> > > > - if (canary != NULL && canary_len >= buflen) {
> > > > - memcpy(buf, canary, buflen);
> > > > + if (canary != NULL && canary_len >= buflen_) {
> > > > + memcpy(buf, canary, buflen_);
> > > >   memset(canary, 0, canary_len);
> > > >   canary = NULL;
> > > >   res = 0;
> > > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen)
> > > >   else if (buf == NULL)
> > > >   res = EINVAL;
> > > >   else {
> > > > - if (strlcpy(buf, execpath, buflen) >= buflen)
> > > > + if (strlcpy(buf, execpath, buflen_) >= buflen_)
> > > >   res = EINVAL;
> > > >   else
> > > >   res = 0;
> > > >   }
> > > >   break;
> > > >   case AT_HWCAP:
> > > > - if (hwcap_present && buflen == sizeof(u_long)) {
> > > > + if (hwcap_present && buflen_ == sizeof(u_long)) {
> > > >   *(u_long *)buf = hwcap;
> > > >   res = 0;
> > > >   } else
> > > >   res = ENOENT;
> > > >   break;
> > > >   case AT_HWCAP2:
> > > > - if (hwcap2_present && buflen == sizeof(u_long)) {
> > > > + if (hwcap2_present && buflen_ == sizeof(u_long)) {
> > > >   *(u_long *)buf = hwcap2;
> > > >   res = 0;
> > > >   } else
> > > >   res = ENOENT;
> > > >   break;
> > > >   case AT_PAGESIZES:
> > > > - if (pagesizes != NULL && pagesizes_len >= buflen) {
> > > > - memcpy(buf, pagesizes, buflen);
> > > > + if (pagesizes != NULL && pagesizes_len >= buflen_) {
> > > > + memcpy(buf, pagesizes, buflen_);
> > > >   res = 0;
> > > >   } else
> > > >   res = ENOENT;
> > > >   break;
> > > >   case AT_PAGESZ:
> > > > - if (buflen == sizeof(int)) {
> > > > + if (buflen_ == sizeof(int)) {
> > > >   if (pagesize != 0) {
> > > >   *(int *)buf = pagesize;
> > > >   res = 0;
> > > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen)
> > > >   res = EINVAL;
> > > >   break;
> > > >   case AT_OSRELDATE:
> > > > - if (buflen == sizeof(int)) {
> > > > + if (buflen_ == sizeof(int)) {
> > > >   if (osreldate != 0)

Re: svn commit: r366207 - head/lib/libc/gen

2020-09-28 Thread Konstantin Belousov
On Sun, Sep 27, 2020 at 10:08:49PM -0600, Alan Somers wrote:
> On Sun, Sep 27, 2020 at 5:15 PM Konstantin Belousov 
> wrote:
> 
> > On Sun, Sep 27, 2020 at 10:26:41PM +, Alan Somers wrote:
> > > Author: asomers
> > > Date: Sun Sep 27 22:26:41 2020
> > > New Revision: 366207
> > > URL: https://svnweb.freebsd.org/changeset/base/366207
> > >
> > > Log:
> > >   Misc compiler warning fixes in lib/libc
> > >
> > >   Reviewed by:kevans, imp
> > >   MFC after:  2 weeks
> > >   Differential Revision:  https://reviews.freebsd.org/D26534
> > >
> > > Modified:
> > >   head/lib/libc/gen/auxv.c
> > >   head/lib/libc/gen/basename_compat.c
> > >   head/lib/libc/gen/crypt.c
> > >   head/lib/libc/gen/dirname_compat.c
> > >   head/lib/libc/gen/fts-compat.c
> > >   head/lib/libc/gen/ftw-compat11.c
> > >   head/lib/libc/gen/getentropy.c
> > >
> > > Modified: head/lib/libc/gen/auxv.c
> > >
> > ==
> > > --- head/lib/libc/gen/auxv.c  Sun Sep 27 21:43:19 2020(r366206)
> > > +++ head/lib/libc/gen/auxv.c  Sun Sep 27 22:26:41 2020(r366207)
> > > @@ -67,7 +67,8 @@ __init_elf_aux_vector(void)
> > >  }
> > >
> > >  static pthread_once_t aux_once = PTHREAD_ONCE_INIT;
> > > -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len,
> > bsdflags;
> > > +static int pagesize, osreldate, ncpus, bsdflags;
> > > +static size_t canary_len, pagesizes_len;
> > >  static int hwcap_present, hwcap2_present;
> > >  static char *canary, *pagesizes, *execpath;
> > >  static void *ps_strings, *timekeep;
> > > @@ -245,16 +246,21 @@ int
> > >  _elf_aux_info(int aux, void *buf, int buflen)
> > >  {
> > >   int res;
> > > + size_t buflen_;
> > >
> > >   __init_elf_aux_vector();
> > >   if (__elf_aux_vector == NULL)
> > >   return (ENOSYS);
> > >   _once(&aux_once, init_aux);
> > >
> > > + if (buflen < 0)
> > > + return (EINVAL);
> > > + buflen_ = (size_t)buflen;
> > > +
> > >   switch (aux) {
> > >   case AT_CANARY:
> > > - if (canary != NULL && canary_len >= buflen) {
> > > - memcpy(buf, canary, buflen);
> > > + if (canary != NULL && canary_len >= buflen_) {
> > > + memcpy(buf, canary, buflen_);
> > >   memset(canary, 0, canary_len);
> > >   canary = NULL;
> > >   res = 0;
> > > @@ -267,35 +273,35 @@ _elf_aux_info(int aux, void *buf, int buflen)
> > >   else if (buf == NULL)
> > >   res = EINVAL;
> > >   else {
> > > - if (strlcpy(buf, execpath, buflen) >= buflen)
> > > + if (strlcpy(buf, execpath, buflen_) >= buflen_)
> > >   res = EINVAL;
> > >   else
> > >   res = 0;
> > >   }
> > >   break;
> > >   case AT_HWCAP:
> > > - if (hwcap_present && buflen == sizeof(u_long)) {
> > > + if (hwcap_present && buflen_ == sizeof(u_long)) {
> > >   *(u_long *)buf = hwcap;
> > >   res = 0;
> > >   } else
> > >   res = ENOENT;
> > >   break;
> > >   case AT_HWCAP2:
> > > - if (hwcap2_present && buflen == sizeof(u_long)) {
> > > + if (hwcap2_present && buflen_ == sizeof(u_long)) {
> > >   *(u_long *)buf = hwcap2;
> > >   res = 0;
> > >   } else
> > >   res = ENOENT;
> > >   break;
> > >   case AT_PAGESIZES:
> > > - if (pagesizes != NULL && pagesizes_len >= buflen) {
> > > - memcpy(buf, pagesizes, buflen);
> > > + if (pagesizes != NULL && pagesizes_len >= buflen_) {
> > > + memcpy(buf, pagesizes, buflen_);
> > >   res = 0;
> > >   } else
> > >   res = ENOENT;
> > >   break;
> > >   case AT_PAGESZ:
> > > - if (buflen == sizeof(int)) {
> > > + if (buflen_ == sizeof(int)) {
> > >   if (pagesize != 0) {
> > >   *(int *)buf = pagesize;
> > >   res = 0;
> > > @@ -305,7 +311,7 @@ _elf_aux_info(int aux, void *buf, int buflen)
> > >   res = EINVAL;
> > >   break;
> > >   case AT_OSRELDATE:
> > > - if (buflen == sizeof(int)) {
> > > + if (buflen_ == sizeof(int)) {
> > >   if (osreldate != 0) {
> > >   *(int *)buf = osreldate;
> > >   res = 0;
> > > @@ -315,7 +321,7 @@ _elf_aux_info(int aux, void *buf, int buflen)
> > >   res = EINVAL;
> > >   break;
> > >   case AT_NCPUS:
> > > -

svn commit: r366226 - head/sys/netinet

2020-09-28 Thread Michael Tuexen
Author: tuexen
Date: Mon Sep 28 14:11:53 2020
New Revision: 366226
URL: https://svnweb.freebsd.org/changeset/base/366226

Log:
  Minor cleanup.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Mon Sep 28 13:56:35 2020(r366225)
+++ head/sys/netinet/sctp_pcb.c Mon Sep 28 14:11:53 2020(r366226)
@@ -6524,7 +6524,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s
(ptype == SCTP_DEL_IP_ADDRESS) ||
(ptype == SCTP_ERROR_CAUSE_IND) ||
(ptype == SCTP_SUCCESS_REPORT)) {
-/* don't care */ ;
+   /* don't care */
} else {
if ((ptype & 0x8000) == 0x) {
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r366196 - head/sys/arm64/conf

2020-09-28 Thread Michal Meloun


On 27.09.2020 19:51, Bjoern A. Zeeb wrote:
> On 27 Sep 2020, at 10:15, Michal Meloun wrote:
> 
>> Author: mmel
>> Date: Sun Sep 27 10:15:03 2020
>> New Revision: 366196
>> URL: https://svnweb.freebsd.org/changeset/base/366196
>>
>> Log:
>>   Add LINUX_BOOT_ABI back to arm64 GENERIC kernel.
>>
>>   It was removed in r355289 but forgot to return it back when new
>> u-boot booti
>>   support was committed.  Although booti is not the preferred method of
>>   booting the kernel, it is very useful for the initial phase of porting
>>   FreeBSD to a new platform or booting the kernel on various embedded
>> boards
>>   in an industrial environment.
> 
> Seem this prevents (at least my) kernels to boot from loader.
> 
> Removing the option and rebuilding and the kernel booted.
> 
It should be fixed in r366219. Sorry for troubles and
thanks for report.
Michal

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r366219 - head/sys/arm64/arm64

2020-09-28 Thread Michal Meloun
Author: mmel
Date: Mon Sep 28 09:16:27 2020
New Revision: 366219
URL: https://svnweb.freebsd.org/changeset/base/366219

Log:
  Fix booting arm64 EFI with LINUX_BOOT_ABI enabled.
  Use address of the pointer passed to kernel to determine whether the pointer
  is a FDT block (physical address) or a module pointer (virtual kernel 
address).
  This fragment was supposed to be committed before r366196, but I accidentally
  skipped it in a patch series.
  
  Reported by:  bz

Modified:
  head/sys/arm64/arm64/locore.S

Modified: head/sys/arm64/arm64/locore.S
==
--- head/sys/arm64/arm64/locore.S   Mon Sep 28 07:59:50 2020
(r366218)
+++ head/sys/arm64/arm64/locore.S   Mon Sep 28 09:16:27 2020
(r366219)
@@ -46,8 +46,6 @@
 
 /* U-Boot booti related constants. */
 #if defined(LINUX_BOOT_ABI)
-#define FDT_MAGIC  0xEDFE0DD0  /* FDT blob Magic */
-
 #ifndef UBOOT_IMAGE_OFFSET
 #defineUBOOT_IMAGE_OFFSET  0   /* Image offset from 
start of */
 #endif /*  2 MiB page */
@@ -408,11 +406,12 @@ create_pagetables:
/* No modules or FDT pointer ? */
cbz x0, booti_no_fdt
 
-   /* Test if modulep points to modules descriptor or to FDT */
-   ldr w8, [x0]
-   ldr w7, =FDT_MAGIC
-   cmp w7, w8
-   b.eqbooti_fdt
+   /*
+* Test if x0 points to modules descriptor(virtual address) or
+* to FDT (physical address)
+*/
+   cmp x0, x6  /* x6 is #(KERNBASE) */
+   b.lobooti_fdt
 #endif
 
/* Booted with modules pointer */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"