Re: svn commit: r367626 - head/sys/geom/bde

2020-11-12 Thread Oliver Pinter
On Thursday, November 12, 2020, Mateusz Guzik  wrote:

> Author: mjg
> Date: Thu Nov 12 20:20:57 2020
> New Revision: 367626
> URL: https://svnweb.freebsd.org/changeset/base/367626
>
> Log:
>   gbde: replace malloc_last_fail with a kludge
>
>   This facilitates removal of malloc_last_fail without really impacting
>   anything.
>
> Modified:
>   head/sys/geom/bde/g_bde_work.c
>
> Modified: head/sys/geom/bde/g_bde_work.c
> 
> ==
> --- head/sys/geom/bde/g_bde_work.c  Thu Nov 12 20:20:43 2020
> (r367625)
> +++ head/sys/geom/bde/g_bde_work.c  Thu Nov 12 20:20:57 2020
> (r367626)
> @@ -77,6 +77,20 @@
>  #include 
>  #include 
>
> +/*
> + * FIXME: This used to call malloc_last_fail which in practice was almost
> + * guaranteed to return time_uptime even in face of severe memory
> shortage.
> + * As GBDE is the only consumer the kludge below was added to facilitate
> the
> + * removal with minimial changes. The code should be fixed to respond to
> memory
> + * pressure (e.g., by using lowmem eventhandler) instead.
> + */
> +static int
> +g_bde_malloc_last_fail(void)
> +{
> +
> +   return (time_uptime);
> +}
> +


Previously malloc_last_fail returned a relatively small number - if i read
the code correctly:

-int
-malloc_last_fail(void)
-{
-
-   return (time_uptime - t_malloc_fail);
-}
-


>  static void g_bde_delete_sector(struct g_bde_softc *wp, struct
> g_bde_sector *sp);
>  static struct g_bde_sector * g_bde_new_sector(struct g_bde_work *wp,
> u_int len);
>  static void g_bde_release_keysector(struct g_bde_work *wp);
> @@ -210,7 +224,7 @@ g_bde_get_keysector(struct g_bde_work *wp)
> g_trace(G_T_TOPOLOGY, "g_bde_get_keysector(%p, %jd)", wp,
> (intmax_t)offset);
> sc = wp->softc;
>
> -   if (malloc_last_fail() < g_bde_ncache)
> +   if (g_bde_malloc_last_fail() < g_bde_ncache)
> g_bde_purge_sector(sc, -1);


And in this case, the semantic change renders all of these calls from alway
true to always false expression.


>
> sp = TAILQ_FIRST(&sc->freelist);
> @@ -228,7 +242,7 @@ g_bde_get_keysector(struct g_bde_work *wp)
> if (sp->ref == 1)
> sp->owner = wp;
> } else {
> -   if (malloc_last_fail() < g_bde_ncache) {
> +   if (g_bde_malloc_last_fail() < g_bde_ncache) {
> TAILQ_FOREACH(sp, &sc->freelist, list)
> if (sp->ref == 0)
> break;
> @@ -311,7 +325,7 @@ g_bde_purge_sector(struct g_bde_softc *sc, int fractio
> if (fraction > 0)
> n = sc->ncache / fraction + 1;
> else
> -   n = g_bde_ncache - malloc_last_fail();
> +   n = g_bde_ncache - g_bde_malloc_last_fail();
> if (n < 0)
> return;
> if (n > sc->ncache)
> ___
> svn-src-h...@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-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: r367280 - head/lib/libc/gen

2020-11-02 Thread Oliver Pinter
On Monday, November 2, 2020, Stefan Eßer  wrote:

> Author: se
> Date: Mon Nov  2 18:48:06 2020
> New Revision: 367280
> URL: https://svnweb.freebsd.org/changeset/base/367280
>
> Log:
>   Re-arrange some of the code to separate writable user tree variables from
>   R/O variables.
>
>   While here fix some nearby style. No functional change intended.
>
>   MFC after:1 month


Is there any phabricator reference for this / these commit(s) + reviewer
lists?


trim
___
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: r367243 - in head: lib/libc/gen sys/kern

2020-11-01 Thread Oliver Pinter
On Sunday, November 1, 2020, Stefan Eßer  wrote:

> Author: se
> Date: Sat Oct 31 23:48:41 2020
> New Revision: 367243
> URL: https://svnweb.freebsd.org/changeset/base/367243
>
> Log:
>   Make sysctl user.local a tunable that can be written at run-time
>
>   This sysctl value had been provided as a read-only variable that is
>   compiled into the C library based on the value of _PATH_LOCALBASE in
>   paths.h.
>
>   After this change, the value is compiled into the kernel as an empty
>   string, which is translated to _PATH_LOCALBASE by the C library.
>
>   This empty string can be overridden at boot time or by a privileged
>   user at run time and will then be returned by sysctl.
>
>   When set to an empty string, the value returned by sysctl reverts to
>   _PATH_LOCALBASE.
>
>   This update does not change the behavior on any system that does
>   not modify the default value of user.localbase.
>
>   I consider this change as experimental and would prefer if the run-time
>   write permission was reconsidered and the sysctl variable defined with
>   CLFLAG_RDTUN instead to restrict it to be set at boot time.
>
>   MFC after:1 month



 Wouldn't be better to make this variable a per-jail variable?

>
> Modified:
>   head/lib/libc/gen/sysctl.c
>   head/sys/kern/kern_mib.c
>
> Modified: head/lib/libc/gen/sysctl.c
> 
> ==
> --- head/lib/libc/gen/sysctl.c  Sat Oct 31 23:19:59 2020(r367242)
> +++ head/lib/libc/gen/sysctl.c  Sat Oct 31 23:48:41 2020(r367243)
> @@ -68,14 +68,14 @@ sysctl(const int *name, u_int namelen, void *oldp, siz
> if (retval || name[0] != CTL_USER)
> return (retval);
>
> -   if (newp != NULL) {
> -   errno = EPERM;
> -   return (-1);
> -   }
> if (namelen != 2) {
> errno = EINVAL;
> return (-1);
> }
> +   if (newp != NULL && name[1] != USER_LOCALBASE) {
> +   errno = EPERM;
> +   return (-1);
> +   }
>
> switch (name[1]) {
> case USER_CS_PATH:
> @@ -88,13 +88,21 @@ sysctl(const int *name, u_int namelen, void *oldp, siz
> memmove(oldp, _PATH_STDPATH,
> sizeof(_PATH_STDPATH));
> return (0);
> case USER_LOCALBASE:
> -   if (oldp != NULL && orig_oldlen < sizeof(_PATH_LOCALBASE))
> {
> -   errno = ENOMEM;
> -   return (-1);
> +   if (oldlenp != NULL) {
> +   if (oldp == NULL) {
> +   if (*oldlenp == 1)
> +   *oldlenp = sizeof(_PATH_LOCALBASE);
> +   } else {
> +   if (*oldlenp != 1)
> +   return (retval);
> +   if (orig_oldlen < sizeof(_PATH_LOCALBASE))
> {
> +   errno = ENOMEM;
> +   return (-1);
> +   }
> +   *oldlenp = sizeof(_PATH_LOCALBASE);
> +   memmove(oldp, _PATH_LOCALBASE,
> sizeof(_PATH_LOCALBASE));
> +   }
> }
> -   *oldlenp = sizeof(_PATH_LOCALBASE);
> -   if (oldp != NULL)
> -   memmove(oldp, _PATH_LOCALBASE,
> sizeof(_PATH_LOCALBASE));
> return (0);
> }
>
>
> Modified: head/sys/kern/kern_mib.c
> 
> ==
> --- head/sys/kern/kern_mib.cSat Oct 31 23:19:59 2020(r367242)
> +++ head/sys/kern/kern_mib.cSat Oct 31 23:48:41 2020(r367243)
> @@ -652,8 +652,11 @@ SYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG
>  SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of streams a process may
> have open at one time");
>  SYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
>  SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of types supported for
> timezone names");
> -SYSCTL_STRING(_user, USER_LOCALBASE, localbase, CTLFLAG_RD,
> -"", 0, "Prefix used to install and locate add-on packages");
> +
> +static char localbase[MAXPATHLEN] = "";
> +
> +SYSCTL_STRING(_user, USER_LOCALBASE, localbase, CTLFLAG_RWTUN,
> +localbase, sizeof(localbase), "Prefix used to install and locate
> add-on packages");
>
>  #include 
>  SYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
> ___
> svn-src-h...@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-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

Re: svn commit: r367038 - head/sbin/mount_nullfs

2020-10-25 Thread Oliver Pinter
On Sunday, October 25, 2020, Edward Tomasz Napierala 
wrote:

> On 1025T0717, Cy Schubert wrote:
> > In message  gmail.c
> > om>
> > , Oliver Pinter writes:
> > > On Sunday, October 25, 2020, Edward Tomasz Napierala <
> tr...@freebsd.org>
> > > wrote:
> > >
> > > > Author: trasz
> > > > Date: Sun Oct 25 14:09:00 2020
> > > > New Revision: 367038
> > > > URL: https://svnweb.freebsd.org/changeset/base/367038
> > > >
> > > > Log:
> > > >   Remove the check that prevents creating "loops" from
> mount_nullfs(8).
> > > >
> > > >
> > > The simple question is: why?
> >
> > I was about to ask that myself.
> >
> > The why is usually more important than the how.
>
> Two reasons.
>
> First, from what I can tell this is an artificial limitation which serves
> no purpose.  I thought it was to prevent some kind of deadlock between
> vnodes, so I asked kib@, and he mentioned removing that very limitation
> from the kernel code; thus, it looks to me like a historical leftover.
>
> Second, I've stumbled upon this when trying to nullfs-mount '/' on
> '/compat/ubuntu/bsd/', which would be useful for autochroot functionality,
> when (or if) it becomes a thing.


Thank you!
___
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: r367038 - head/sbin/mount_nullfs

2020-10-25 Thread Oliver Pinter
On Sunday, October 25, 2020, Edward Tomasz Napierala 
wrote:

> Author: trasz
> Date: Sun Oct 25 14:09:00 2020
> New Revision: 367038
> URL: https://svnweb.freebsd.org/changeset/base/367038
>
> Log:
>   Remove the check that prevents creating "loops" from mount_nullfs(8).
>
>
The simple question is: why?



>   Reviewed by:  kib
>   MFC after:2 weeks
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:https://reviews.freebsd.org/D26921
>
> Modified:
>   head/sbin/mount_nullfs/mount_nullfs.c
>
> Modified: head/sbin/mount_nullfs/mount_nullfs.c
> 
> ==
> --- head/sbin/mount_nullfs/mount_nullfs.c   Sun Oct 25 10:08:46 2020
>   (r367037)
> +++ head/sbin/mount_nullfs/mount_nullfs.c   Sun Oct 25 14:09:00 2020
>   (r367038)
> @@ -59,7 +59,6 @@ static const char rcsid[] =
>
>  #include "mntopts.h"
>
> -intsubdir(const char *, const char *);
>  static voidusage(void) __dead2;
>
>  int
> @@ -104,10 +103,6 @@ main(int argc, char *argv[])
> if (checkpath(argv[1], source) != 0)
> err(EX_USAGE, "%s", source);
>
> -   if (subdir(target, source) || subdir(source, target))
> -   errx(EX_USAGE, "%s (%s) and %s are not distinct paths",
> -   argv[0], target, argv[1]);
> -
> build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1);
> build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1);
> build_iovec(&iov, &iovlen, "target", target, (size_t)-1);
> @@ -119,21 +114,6 @@ main(int argc, char *argv[])
> err(1, "%s", source);
> }
> exit(0);
> -}
> -
> -int
> -subdir(const char *p, const char *dir)
> -{
> -   int l;
> -
> -   l = strlen(dir);
> -   if (l <= 1)
> -   return (1);
> -
> -   if ((strncmp(p, dir, l) == 0) && (p[l] == '/' || p[l] == '\0'))
> -   return (1);
> -
> -   return (0);
>  }
>
>  static void
> ___
> svn-src-h...@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-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: r365378 - head/usr.sbin/traceroute6

2020-09-06 Thread Oliver Pinter
On Sunday, September 6, 2020, Mariusz Zaborski  wrote:

> Author: oshogbo
> Date: Sun Sep  6 14:04:02 2020
> New Revision: 365378
> URL: https://svnweb.freebsd.org/changeset/base/365378
>
> Log:
>   traceroute6: capsicumize it
>
>   Submitted by: Shubh Gupta 
>   Sponsored by: Google (GSOC 2020)
>   Differential Revision:https://reviews.freebsd.org/D25604
>
> Modified:
>   head/usr.sbin/traceroute6/Makefile
>   head/usr.sbin/traceroute6/traceroute6.c
>
> Modified: head/usr.sbin/traceroute6/Makefile
> 
> ==
> --- head/usr.sbin/traceroute6/Makefile  Sun Sep  6 11:29:06 2020
> (r365377)
> +++ head/usr.sbin/traceroute6/Makefile  Sun Sep  6 14:04:02 2020
> (r365378)
> @@ -13,6 +13,10 @@
>  # A PARTICULAR PURPOSE.
>  # $FreeBSD$
>
> +.include 
> +
> +.include 


Dup


> +
>  TRACEROUTE_DISTDIR?= ${SRCTOP}/contrib/traceroute
>  .PATH: ${TRACEROUTE_DISTDIR}
>
> @@ -26,7 +30,13 @@ BINMODE= 4555
>  CFLAGS+= -DIPSEC -DHAVE_POLL
>  CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I.
>
> -LIBADD=ipsec
> +.if ${MK_CASPER} != "no"
> +LIBADD+=   casper
> +LIBADD+=   cap_dns
> +CFLAGS+=   -DWITH_CASPER
> +.endif
> +
> +LIBADD+=   ipsec
>
>  .include 
>
>
> Modified: head/usr.sbin/traceroute6/traceroute6.c
> 
> ==
> --- head/usr.sbin/traceroute6/traceroute6.c Sun Sep  6 11:29:06 2020
>   (r365377)
> +++ head/usr.sbin/traceroute6/traceroute6.c Sun Sep  6 14:04:02 2020
>   (r365378)
> @@ -249,6 +249,7 @@ static const char rcsid[] =
>   */
>
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -260,6 +261,10 @@ static const char rcsid[] =
>
>  #include 
>
> +#include 
> +#include 
> +#include 
> +
>  #include 
>  #include 
>  #include 
> @@ -289,11 +294,6 @@ static const char rcsid[] =
>
>  #defineMAXPACKET   65535   /* max ip packet size */
>
> -#ifndef HAVE_GETIPNODEBYNAME
> -#define getipnodebyname(x, y, z, u)gethostbyname2((x), (y))
> -#define freehostent(x)
> -#endif
> -
>  static u_char  packet[512];/* last inbound (icmp) packet */
>  static char*outpacket; /* last output packet */
>
> @@ -304,6 +304,7 @@ int setpolicy(int so, char *policy);
>  #endif
>  void   send_probe(int, u_long);
>  void   *get_uphdr(struct ip6_hdr *, u_char *);
> +void   capdns_open(void);
>  intget_hoplim(struct msghdr *);
>  double deltaT(struct timeval *, struct timeval *);
>  const char *pr_type(int);
> @@ -312,6 +313,8 @@ voidprint(struct msghdr *, int);
>  const char *inetname(struct sockaddr *);
>  u_int32_t sctp_crc32c(void *, u_int32_t);
>  u_int16_t in_cksum(u_int16_t *addr, int);
> +u_int16_t udp_cksum(struct sockaddr_in6 *, struct sockaddr_in6 *,
> +void *, u_int32_t);
>  u_int16_t tcp_chksum(struct sockaddr_in6 *, struct sockaddr_in6 *,
>  void *, u_int32_t);
>  void   usage(void);
> @@ -335,6 +338,8 @@ static struct cmsghdr *cmsg;
>  static char *source = NULL;
>  static char *hostname;
>
> +static cap_channel_t *capdns;
> +
>  static u_long nprobes = 3;
>  static u_long first_hop = 1;
>  static u_long max_hops = 30;
> @@ -368,7 +373,10 @@ main(int argc, char *argv[])
> char ipsec_inpolicy[] = "in bypass";
> char ipsec_outpolicy[] = "out bypass";
>  #endif
> +   cap_rights_t rights;
>
> +   capdns_open();
> +
> /*
>  * Receive ICMP
>  */
> @@ -429,6 +437,7 @@ main(int argc, char *argv[])
> }
> break;
> case 'g':
> +   /* XXX use after capability mode is entered */
> hp = getipnodebyname(optarg, AF_INET6, 0,
> &h_errno);
> if (hp == NULL) {
> fprintf(stderr,
> @@ -560,8 +569,8 @@ main(int argc, char *argv[])
> sndsock = rcvsock;
> break;
> case IPPROTO_UDP:
> -   if ((sndsock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
> -   perror("socket(SOCK_DGRAM)");
> +   if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP)) <
> 0) {
> +   perror("socket(SOCK_RAW)");
> exit(5);
> }
> break;
> @@ -606,7 +615,9 @@ main(int argc, char *argv[])
> hints.ai_socktype = SOCK_RAW;
> hints.ai_protocol = IPPROTO_ICMPV6;
> hints.ai_flags = AI_CANONNAME;
> -   error = getaddrinfo(*argv, NULL, &hints, &res);
> +
> +   error = cap_getaddrinfo(capdns, *argv, NULL, &hints, &res);
> +
> if (error) {
> fprintf(stderr,
> "traceroute6: %s\n", gai_strerror(error));
> @@ -624,7 +635,7 @@ main(int argc, char *argv[])
> exit(1);
> }
> if (res->ai_next) {
> -   if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf,
> 

Re: svn commit: r364312 - head/sys/net80211

2020-08-17 Thread Oliver Pinter
On Monday, August 17, 2020, Bjoern A. Zeeb  wrote:

> Author: bz
> Date: Mon Aug 17 16:28:59 2020
> New Revision: 364312
> URL: https://svnweb.freebsd.org/changeset/base/364312
>
> Log:
>   net80211: remove vertical whitespace
>
>   No functional changes.
>
>   MFC after:2 weeks
>   Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
>
> Modified:
>   head/sys/net80211/ieee80211.c
>   head/sys/net80211/ieee80211_ioctl.c
>   head/sys/net80211/ieee80211_vht.c
>
> Modified: head/sys/net80211/ieee80211.c
> 
> ==
> --- head/sys/net80211/ieee80211.c   Mon Aug 17 16:27:02 2020
> (r364311)
> +++ head/sys/net80211/ieee80211.c   Mon Aug 17 16:28:59 2020
> (r364312)
> @@ -529,8 +529,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ie
>
> ifp = if_alloc(IFT_ETHER);
> if (ifp == NULL) {
> -   ic_printf(ic, "%s: unable to allocate ifnet\n",
> -   __func__);
> +   ic_printf(ic, "%s: unable to allocate ifnet\n", __func__);
> return ENOMEM;
> }
> if_initname(ifp, name, unit);
> @@ -1210,9 +1209,7 @@ set_vht_extchan(struct ieee80211_channel *c)
> }
>
> printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n",
> -   __func__,
> -   c->ic_ieee,
> -   c->ic_flags);
> +   __func__, c->ic_ieee, c->ic_flags);
>
> return (0);
>  }
> @@ -1247,11 +1244,7 @@ addchan(struct ieee80211_channel chans[], int
> maxchans
>
>  #if 0
> printf("%s: %d: ieee=%d, freq=%d, flags=0x%08x\n",
> -   __func__,
> -   *nchans,
> -   ieee,
> -   freq,
> -   flags);
> +   __func__, *nchans, ieee, freq, flags);
>  #endif
>
> c = &chans[(*nchans)++];
> @@ -1281,9 +1274,7 @@ copychan_prev(struct ieee80211_channel chans[], int
> ma
>
>  #if 0
> printf("%s: %d: flags=0x%08x\n",
> -   __func__,
> -   *nchans,
> -   flags);
> +   __func__, *nchans, flags);
>  #endif
>
> c = &chans[(*nchans)++];
> @@ -1779,11 +1770,7 @@ ieee80211_lookup_channel_rxstatus(struct
> ieee80211vap
>
> IEEE80211_DPRINTF(vap, IEEE80211_MSG_INPUT,
> "%s: freq=%d, ieee=%d, flags=0x%08x; c=%p\n",
> -   __func__,
> -   (int) rxs->c_freq,
> -   (int) rxs->c_ieee,
> -   flags,
> -   c);
> +   __func__, (int) rxs->c_freq, (int) rxs->c_ieee, flags, c);
>
> return (c);
>  }
>
> Modified: head/sys/net80211/ieee80211_ioctl.c
> 
> ==
> --- head/sys/net80211/ieee80211_ioctl.c Mon Aug 17 16:27:02 2020
> (r364311)
> +++ head/sys/net80211/ieee80211_ioctl.c Mon Aug 17 16:28:59 2020
> (r364312)
> @@ -1159,12 +1159,9 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap,
> u_l
> if (vap->iv_flags_ext & IEEE80211_FEXT_UAPSD)
> ireq->i_val = 1;
> break;
> -
> -   /* VHT */

Removed comment.

> case IEEE80211_IOC_VHTCONF:
> ireq->i_val = vap->iv_flags_vht & IEEE80211_FVHT_MASK;
> break;
> -
> default:
> error = ieee80211_ioctl_getdefault(vap, ireq);
> break;
>
> Modified: head/sys/net80211/ieee80211_vht.c
> 
> ==
> --- head/sys/net80211/ieee80211_vht.c   Mon Aug 17 16:27:02 2020
> (r364311)
> +++ head/sys/net80211/ieee80211_vht.c   Mon Aug 17 16:28:59 2020
> (r364312)
> @@ -93,9 +93,7 @@ vht_recv_action_placeholder(struct ieee80211_node *ni,
>
>  #ifdef IEEE80211_DEBUG
> ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
> -   __func__,
> -   wh->i_fc[0],
> -   wh->i_fc[1]);
> +   __func__, wh->i_fc[0], wh->i_fc[1]);
>  #endif
> return (0);
>  }
> @@ -107,9 +105,7 @@ vht_send_action_placeholder(struct ieee80211_node *ni,
>
>  #ifdef IEEE80211_DEBUG
> ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
> -   __func__,
> -   category,
> -   action);
> +   __func__, category, action);
>  #endif
> return (EINVAL);
>  }
> @@ -229,9 +225,7 @@ ieee80211_vht_announce(struct ieee80211com *ic)
> if (tx == 3 && rx == 3)
> continue;
> ic_printf(ic, "[VHT] NSS %d: TX MCS 0..%d, RX MCS 0..%d\n",
> -   i + 1,
> -   vht_mcs_to_num(tx),
> -   vht_mcs_to_num(rx));
> +   i + 1, vht_mcs_to_num(tx), vht_mcs_to_num(rx));
> }
>  }
>
> @@ -269,10 +263,7 @@ ieee80211_parse_vhtopmode(struct ieee80211_node *ni,
> c
>
>  #if 0
> printf("%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n",
> -   __func__,
> -   ni->ni_vht_chan1,
> -   ni->ni

Re: svn commit: r363060 - in head: stand/defaults sys/amd64/amd64 sys/powerpc/aim sys/vm

2020-07-09 Thread Oliver Pinter
On Friday, July 10, 2020, Scott Long  wrote:

> Author: scottl
> Date: Thu Jul  9 22:38:36 2020
> New Revision: 363060
> URL: https://svnweb.freebsd.org/changeset/base/363060
>
> Log:
>   Revert r362998, r326999 while a better compatibility strategy is devised.
>
> Modified:
>   head/stand/defaults/loader.conf
>   head/sys/amd64/amd64/pmap.c
>   head/sys/powerpc/aim/mmu_radix.c
>   head/sys/vm/vm_page.c
>   head/sys/vm/vm_page.h
>
> Modified: head/stand/defaults/loader.conf
> 
> ==
> --- head/stand/defaults/loader.conf Thu Jul  9 20:55:18 2020
> (r363059)
> +++ head/stand/defaults/loader.conf Thu Jul  9 22:38:36 2020
> (r363060)
> @@ -53,7 +53,7 @@ entropy_cache_type="boot_entropy_cache"   #
> Required for
>  ram_excludelist_load="NO"  # Set this to YES to load a file
> # containing a list of addresses to
> # exclude from the running system.
> -ram_excludelist_name="/boot/excludelist.txt" # Set this to the name of
> the file
> +ram_excludeist_name="/boot/excludelist.txt" # Set this to the name of
> the file


Hi!

This part of the revert seems still broken.



>  ram_excludelist_type="ram_excludelist" # Required for the kernel to find
> # the blacklist module
>
>
> Modified: head/sys/amd64/amd64/pmap.c
> 
> ==
> --- head/sys/amd64/amd64/pmap.c Thu Jul  9 20:55:18 2020(r363059)
> +++ head/sys/amd64/amd64/pmap.c Thu Jul  9 22:38:36 2020(r363060)
> @@ -2060,7 +2060,7 @@ pmap_init(void)
> int error, i, ret, skz63;
>
> /* L1TF, reserve page @0 unconditionally */
> -   vm_page_excludelist_add(0, bootverbose);
> +   vm_page_blacklist_add(0, bootverbose);
>
> /* Detect bare-metal Skylake Server and Skylake-X. */
> if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL &&
> @@ -2081,7 +2081,7 @@ pmap_init(void)
> printf("SKZ63: skipping 4M RAM starting "
> "at physical 1G\n");
> for (i = 0; i < atop(0x40); i++) {
> -   ret = vm_page_excludelist_add(0x4000 +
> +   ret = vm_page_blacklist_add(0x4000 +
> ptoa(i), FALSE);
> if (!ret && bootverbose)
> printf("page at %#lx already
> used\n",
>
> Modified: head/sys/powerpc/aim/mmu_radix.c
> 
> ==
> --- head/sys/powerpc/aim/mmu_radix.cThu Jul  9 20:55:18 2020
> (r363059)
> +++ head/sys/powerpc/aim/mmu_radix.cThu Jul  9 22:38:36 2020
> (r363060)
> @@ -3557,7 +3557,7 @@ mmu_radix_init()
> int error, i, pv_npg;
>
> /* L1TF, reserve page @0 unconditionally */
> -   vm_page_excludelist_add(0, bootverbose);
> +   vm_page_blacklist_add(0, bootverbose);
>
> zone_radix_pgd = uma_zcache_create("radix_pgd_cache",
> RADIX_PGD_SIZE, NULL, NULL,
>
> Modified: head/sys/vm/vm_page.c
> 
> ==
> --- head/sys/vm/vm_page.c   Thu Jul  9 20:55:18 2020(r363059)
> +++ head/sys/vm/vm_page.c   Thu Jul  9 22:38:36 2020(r363060)
> @@ -155,11 +155,10 @@ vm_page_t vm_page_array;
>  long vm_page_array_size;
>  long first_page;
>
> -static TAILQ_HEAD(, vm_page) excludelist_head;
> -static int sysctl_vm_page_excludelist(SYSCTL_HANDLER_ARGS);
> -SYSCTL_PROC(_vm, OID_AUTO, page_excludelist, CTLTYPE_STRING | CTLFLAG_RD |
> -CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_excludelist, "A",
> -"Blacklist pages");
> +static TAILQ_HEAD(, vm_page) blacklist_head;
> +static int sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS);
> +SYSCTL_PROC(_vm, OID_AUTO, page_blacklist, CTLTYPE_STRING | CTLFLAG_RD |
> +CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_blacklist, "A", "Blacklist
> pages");
>
>  static uma_zone_t fakepg_zone;
>
> @@ -259,16 +258,16 @@ vm_set_page_size(void)
>  }
>
>  /*
> - * vm_page_excludelist_next:
> + * vm_page_blacklist_next:
>   *
> - * Find the next entry in the provided string of excludelist
> + * Find the next entry in the provided string of blacklist
>   * addresses.  Entries are separated by space, comma, or newline.
>   * If an invalid integer is encountered then the rest of the
>   * string is skipped.  Updates the list pointer to the next
>   * character, or NULL if the string is exhausted or invalid.
>   */
>  static vm_paddr_t
> -vm_page_excludelist_next(char **list, char *end)
> +vm_page_blacklist_next(char **list, char *end)
>  {
> vm_paddr_t bad;
> char *cp, *pos;
> @@ -315,13 +314,13 @@ vm_page_

Re: svn commit: r362998 - in head: stand/defaults sys/amd64/amd64 sys/powerpc/aim sys/vm

2020-07-07 Thread Oliver Pinter
On Tuesday, July 7, 2020, Scott Long  wrote:

> Author: scottl
> Date: Tue Jul  7 20:33:11 2020
> New Revision: 362998
> URL: https://svnweb.freebsd.org/changeset/base/362998
>
> Log:
>   Migrate the feature of excluding RAM pages to use "excludelist"
>   as its nomenclature.
>
>   MFC after:1 week
>
> Modified:
>   head/stand/defaults/loader.conf
>   head/sys/amd64/amd64/pmap.c
>   head/sys/powerpc/aim/mmu_radix.c
>   head/sys/vm/vm_page.c
>   head/sys/vm/vm_page.h
>
> Modified: head/stand/defaults/loader.conf
> 
> ==
> --- head/stand/defaults/loader.conf Tue Jul  7 19:09:38 2020
> (r362997)
> +++ head/stand/defaults/loader.conf Tue Jul  7 20:33:11 2020
> (r362998)
> @@ -49,12 +49,12 @@ entropy_cache_type="boot_entropy_cache" #
> Required for
> # must not change value even if the
> # _name above does change!
>
> -###  RAM Blacklist configuration  
> -ram_blacklist_load="NO"# Set this to YES to load
> a file
> +###  RAM Excludelist configuration  
> +ram_excludelist_load="NO"  # Set this to YES to load a file
> # containing a list of addresses to
> # exclude from the running system.
> -ram_blacklist_name="/boot/blacklist.txt" # Set this to the name of the
> file
> -ram_blacklist_type="ram_blacklist" # Required for the kernel to find
> +ram_excludeist_name="/boot/excludelist.txt" # Set this to the name of
> the file
> +ram_excludelist_type="ram_excludelist" # Required for the kernel to find


This will break systems where the blacklist file is already in use. At
least please add this to release notes and provide a backward compatible
way.



> # the blacklist module
>
>  ###  Microcode loading configuration  
>
> Modified: head/sys/amd64/amd64/pmap.c
> 
> ==
> --- head/sys/amd64/amd64/pmap.c Tue Jul  7 19:09:38 2020(r362997)
> +++ head/sys/amd64/amd64/pmap.c Tue Jul  7 20:33:11 2020(r362998)
> @@ -2060,7 +2060,7 @@ pmap_init(void)
> int error, i, ret, skz63;
>
> /* L1TF, reserve page @0 unconditionally */
> -   vm_page_blacklist_add(0, bootverbose);
> +   vm_page_excludelist_add(0, bootverbose);
>
> /* Detect bare-metal Skylake Server and Skylake-X. */
> if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL &&
> @@ -2081,7 +2081,7 @@ pmap_init(void)
> printf("SKZ63: skipping 4M RAM starting "
> "at physical 1G\n");
> for (i = 0; i < atop(0x40); i++) {
> -   ret = vm_page_blacklist_add(0x4000 +
> +   ret = vm_page_excludelist_add(0x4000 +
> ptoa(i), FALSE);
> if (!ret && bootverbose)
> printf("page at %#lx already
> used\n",
>
> Modified: head/sys/powerpc/aim/mmu_radix.c
> 
> ==
> --- head/sys/powerpc/aim/mmu_radix.cTue Jul  7 19:09:38 2020
> (r362997)
> +++ head/sys/powerpc/aim/mmu_radix.cTue Jul  7 20:33:11 2020
> (r362998)
> @@ -3557,7 +3557,7 @@ mmu_radix_init()
> int error, i, pv_npg;
>
> /* L1TF, reserve page @0 unconditionally */
> -   vm_page_blacklist_add(0, bootverbose);
> +   vm_page_excludelist_add(0, bootverbose);
>
> zone_radix_pgd = uma_zcache_create("radix_pgd_cache",
> RADIX_PGD_SIZE, NULL, NULL,
>
> Modified: head/sys/vm/vm_page.c
> 
> ==
> --- head/sys/vm/vm_page.c   Tue Jul  7 19:09:38 2020(r362997)
> +++ head/sys/vm/vm_page.c   Tue Jul  7 20:33:11 2020(r362998)
> @@ -155,10 +155,11 @@ vm_page_t vm_page_array;
>  long vm_page_array_size;
>  long first_page;
>
> -static TAILQ_HEAD(, vm_page) blacklist_head;
> -static int sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS);
> -SYSCTL_PROC(_vm, OID_AUTO, page_blacklist, CTLTYPE_STRING | CTLFLAG_RD |
> -CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_blacklist, "A", "Blacklist
> pages");
> +static TAILQ_HEAD(, vm_page) excludelist_head;
> +static int sysctl_vm_page_excludelist(SYSCTL_HANDLER_ARGS);
> +SYSCTL_PROC(_vm, OID_AUTO, page_excludelist, CTLTYPE_STRING | CTLFLAG_RD |
> +CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_excludelist, "A",
> +"Blacklist pages");
>
>  static uma_zone_t fakepg_zone;
>
> @@ -258,16 +259,16 @@ vm_set_page_size(void)
>  }
>
>  /*
> - * vm_page_blacklist_next:
> + * vm_page_exclu

Re: svn commit: r361884 - in head/usr.bin/sed: . tests

2020-06-07 Thread Oliver Pinter
On Sunday, June 7, 2020, Kyle Evans  wrote:

> Author: kevans
> Date: Sun Jun  7 04:32:38 2020
> New Revision: 361884
> URL: https://svnweb.freebsd.org/changeset/base/361884
>
> Log:
>   sed: attempt to learn about hex escapes (e.g. \x27)
>
>   Somewhat predictably, software often wants to use \x27/\x24 among others
> so
>   that they can decline worrying about ugly escaping, if said escaping is
> even
>   possible. Right now, this software is using these and getting the wrong
>   results, as we'll interpret those as x27 and x24 respectively. Some
> examples
>   of this, when an exp-run was ran, were science/octopus and misc/vifm.
>
>   Go ahead and process these at all times.  We allow either one or two
> digits,
>   and the tests account for both.  If extra digits are specified, e.g.
> \x2727,
>   then the third and fourth digits are interpreted literally as one might
>   expect.
>
>   PR:   229925
>   MFC after:2 weeks


Could you please put an entry from this to release notes? :)



>
> Modified:
>   head/usr.bin/sed/compile.c
>   head/usr.bin/sed/tests/sed2_test.sh
>
> Modified: head/usr.bin/sed/compile.c
> 
> ==
> --- head/usr.bin/sed/compile.c  Sun Jun  7 03:11:34 2020(r361883)
> +++ head/usr.bin/sed/compile.c  Sun Jun  7 04:32:38 2020(r361884)
> @@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)compile.c   8.1 (Berke
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -365,6 +366,51 @@ nonsel:/* Now parse the command */
> }
>  }
>
> +static int
> +hex2char(const char *in, char *out, int len)
> +{
> +   long ord;
> +   char *endptr, hexbuf[3];
> +
> +   hexbuf[0] = in[0];
> +   hexbuf[1] = len > 1 ? in[1] : '\0';
> +   hexbuf[2] = '\0';
> +
> +   errno = 0;
> +   ord = strtol(hexbuf, &endptr, 16);
> +   if (*endptr != '\0' || errno != 0)
> +   return (ERANGE);
> +   *out = (char)ord;
> +   return (0);
> +}
> +
> +static bool
> +hexdigit(char c)
> +{
> +   int lc;
> +
> +   lc = tolower(c);
> +   return isdigit(lc) || (lc >= 'a' && lc <= 'f');
> +}
> +
> +static bool
> +dohex(const char *in, char *out, int *len)
> +{
> +   int tmplen;
> +
> +   if (!hexdigit(in[0]))
> +   return (false);
> +   tmplen = 1;
> +   if (hexdigit(in[1]))
> +   ++tmplen;
> +   if (hex2char(in, out, tmplen) == 0) {
> +   *len = tmplen;
> +   return (true);
> +   }
> +
> +   return (false);
> +}
> +
>  /*
>   * Get a delimited string.  P points to the delimiter of the string; d
> points
>   * to a buffer area.  Newline and delimiter escapes are processed; other
> @@ -377,6 +423,7 @@ nonsel: /* Now parse the command */
>  static char *
>  compile_delimited(char *p, char *d, int is_tr)
>  {
> +   int hexlen;
> char c;
>
> c = *p++;
> @@ -412,6 +459,12 @@ compile_delimited(char *p, char *d, int is_tr)
> }
> p += 2;
> continue;
> +   } else if (*p == '\\' && p[1] == 'x') {
> +   if (dohex(&p[2], d, &hexlen)) {
> +   ++d;
> +   p += hexlen + 2;
> +   continue;
> +   }
> } else if (*p == '\\' && p[1] == '\\') {
> if (is_tr)
> p++;
> @@ -431,7 +484,7 @@ compile_delimited(char *p, char *d, int is_tr)
>  static char *
>  compile_ccl(char **sp, char *t)
>  {
> -   int c, d;
> +   int c, d, hexlen;
> char *s = *sp;
>
> *t++ = *s++;
> @@ -459,6 +512,10 @@ compile_ccl(char **sp, char *t)
> *t = '\t';
> s++;
> break;
> +   case 'x':
> +   if (dohex(&s[2], t, &hexlen))
> +   s += hexlen + 1;
> +   break;
> }
> }
> }
> @@ -499,7 +556,7 @@ static char *
>  compile_subst(char *p, struct s_subst *s)
>  {
> static char lbuf[_POSIX2_LINE_MAX + 1];
> -   int asize, size;
> +   int asize, hexlen, size;
> u_char ref;
> char c, *text, *op, *sp;
> int more = 1, sawesc = 0;
> @@ -562,6 +619,21 @@ compile_subst(char *p, struct s_subst *s)
> break;
> case 't':
> *p = '\t';
> +   break;
> +   case 'x':
> +#defineADVANCE_N(s, n) \
> +   do { 

Re: svn commit: r361143 - head/release/tools

2020-05-17 Thread Oliver Pinter
On Sunday, May 17, 2020, Colin Percival  wrote:

> Author: cperciva
> Date: Sun May 17 21:54:59 2020
> New Revision: 361143
> URL: https://svnweb.freebsd.org/changeset/base/361143
>
> Log:
>   Add /etc/autofs/special_efs to EC2 AMIs
>
>   Since Amazon Elastic File System is only available within AWS, it seems
>   more appropriate to have this added only in EC2 AMIs rather than
>   "polluting" non-EC2 images with it.
>
>   Reviewed by:  gjb
>   MFC after:7 days
>   Relnotes: Amazon EFS filesystems can be automounted by enabling
> autofs
> and placing "/efs -efs" into /etc/auto_master.
>   Sponsored by: https://www.patreon.com/cperciva
>   Differential Revision:https://reviews.freebsd.org/D24791
>
> Modified:
>   head/release/tools/ec2.conf
>
> Modified: head/release/tools/ec2.conf
> 
> ==
> --- head/release/tools/ec2.conf Sun May 17 21:29:45 2020(r361142)
> +++ head/release/tools/ec2.conf Sun May 17 21:54:59 2020(r361143)
> @@ -113,6 +113,23 @@ vm_extra_pre_umount() {
> -e '1,/^#server/s/^#server.*/server 169.254.169.123
> iburst/' \
> ${DESTDIR}/etc/ntp.conf
>
> +   # Provide a map for accessing Elastic File System mounts
> +   cat > ${DESTDIR}/etc/autofs/special_efs <<'EOF'
> +#!/bin/sh
> +
> +if [ $# -eq 0 ]; then
> +# No way to know which EFS filesystems exist and are
> +# accessible to this EC2 instance.
> +exit 0
> +fi
> +
> +# Provide instructions on how to mount the requested filesystem.
> +FS=$1
> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/
> availability-zone | sed -e 's/[a-z]$//'`


What will be this hard-coded ip address without any verification or at
least https?


> +echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws.
> com:/"
> +EOF
> +   chmod 755 ${DESTDIR}/etc/autofs/special_efs
> +
> # The first time the AMI boots, the installed "first boot" scripts
> # should be allowed to run:
> # * ec2_configinit (download and process EC2 user-data)
> ___
> svn-src-h...@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-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: r360025 - head/sys/dev/acpica

2020-04-16 Thread Oliver Pinter
On Thursday, April 16, 2020, Colin Percival  wrote:

> Author: cperciva
> Date: Thu Apr 16 21:56:52 2020
> New Revision: 360025
> URL: https://svnweb.freebsd.org/changeset/base/360025
>
> Log:
>   Alert devd when acpi_video brightness changes
>
>   On my Dell Latitude 7390 laptop, the brightness hotkeys
>   (Fn+) send ACPI notifications which acpi_video
>   handles by adjusting its brightness setting; but ACPI does not
>   actually do anything with the backlight.
>
>   Announcing brightness changes via devd makes it possible to close
>   the loop by triggering the intel_backlight utility to perform the
>   required backlight adjustment.
>
>   Reviewed by:  imp
>   MFC after:3 days
>   Differential Revision:https://reviews.freebsd.org/D24424
>
> Modified:
>   head/sys/dev/acpica/acpi_video.c


Please add this to release notes!


>
> Modified: head/sys/dev/acpica/acpi_video.c
> 
> ==
> --- head/sys/dev/acpica/acpi_video.cThu Apr 16 21:53:17 2020
> (r360024)
> +++ head/sys/dev/acpica/acpi_video.cThu Apr 16 21:56:52 2020
> (r360025)
> @@ -1036,6 +1036,7 @@ vo_get_brightness(ACPI_HANDLE handle)
>  static void
>  vo_set_brightness(ACPI_HANDLE handle, int level)
>  {
> +   char notify_buf[16];
> ACPI_STATUS status;
>
> ACPI_SERIAL_ASSERT(video_output);
> @@ -1043,6 +1044,8 @@ vo_set_brightness(ACPI_HANDLE handle, int level)
> if (ACPI_FAILURE(status))
> printf("can't evaluate %s._BCM - %s\n",
>acpi_name(handle), AcpiFormatException(status));
> +   snprintf(notify_buf, sizeof(notify_buf), "notify=%d", level);
> +   devctl_notify("ACPI", "Video", "brightness", notify_buf);
>  }
>
>  static UINT32
> ___
> svn-src-h...@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-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: r359408 - head/stand/libsa/zfs

2020-03-28 Thread Oliver Pinter
On Saturday, March 28, 2020, Toomas Soome  wrote:

> Author: tsoome
> Date: Sat Mar 28 21:50:27 2020
> New Revision: 359408
> URL: https://svnweb.freebsd.org/changeset/base/359408
>
> Log:
>   loader: strdup name strings from dataset walker
>
>   The removal of zfs scratch buffer did miss the fact the dataset
>   lookup was picking up the names from zap list.
>
> Modified:
>   head/stand/libsa/zfs/zfs.c
>
> Modified: head/stand/libsa/zfs/zfs.c
> 
> ==
> --- head/stand/libsa/zfs/zfs.c  Sat Mar 28 21:47:44 2020(r359407)
> +++ head/stand/libsa/zfs/zfs.c  Sat Mar 28 21:50:27 2020(r359408)
> @@ -92,7 +92,7 @@ static intzfs_env_count;
>  SLIST_HEAD(zfs_be_list, zfs_be_entry) zfs_be_head =
> SLIST_HEAD_INITIALIZER(zfs_be_head);
>  struct zfs_be_list *zfs_be_headp;
>  struct zfs_be_entry {
> -   const char *name;
> +   cha *name;


I think this will be "char *".


> SLIST_ENTRY(zfs_be_entry) entries;
>  } *zfs_be, *zfs_be_tmp;
>
> @@ -906,6 +906,7 @@ zfs_bootenv_initial(const char *name)
> while (!SLIST_EMPTY(&zfs_be_head)) {
> zfs_be = SLIST_FIRST(&zfs_be_head);
> SLIST_REMOVE_HEAD(&zfs_be_head, entries);
> +   free(zfs_be->name);
> free(zfs_be);
> }
>
> @@ -973,6 +974,7 @@ zfs_bootenv(const char *name)
> while (!SLIST_EMPTY(&zfs_be_head)) {
> zfs_be = SLIST_FIRST(&zfs_be_head);
> SLIST_REMOVE_HEAD(&zfs_be_head, entries);
> +   free(zfs_be->name);
> free(zfs_be);
> }
>
> @@ -992,7 +994,11 @@ zfs_belist_add(const char *name, uint64_t value __unus
> if (zfs_be == NULL) {
> return (ENOMEM);
> }
> -   zfs_be->name = name;
> +   zfs_be->name = strdup(name);
> +   if (zfs_be->name == NULL) {
> +   free(zfs_be);
> +   return (ENOMEM);
> +   }
> SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries);
> zfs_env_count++;
>
> ___
> svn-src-h...@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-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: r359168 - head

2020-03-24 Thread Oliver Pinter
Wouldn't there been a better way to split up the global obsoletefiles.inc
file and put them in to specific components directory or at least split
them up by release basis to easier the future deletions?

On Tuesday, March 24, 2020, Gleb Smirnoff  wrote:

> On Fri, Mar 20, 2020 at 04:02:46PM +, Ed Maste wrote:
> E> Author: emaste
> E> Date: Fri Mar 20 16:02:45 2020
> E> New Revision: 359168
> E> URL: https://svnweb.freebsd.org/changeset/base/359168
> E>
> E> Log:
> E>   remove ancient pre-2000 ObsoleteFiles.inc entries
> E>
> E>   We support 10.3 as the minimum version to install from, which was
> E>   released in the mid-2010s.  There's a lot of ancient ObsoleteFiles.inc
> E>   history that serves no purpose today; start by removing entries from
> E>   1999 and earlier.
>
> I understand that rationale is to speedup 'make delete-old' times, and
> trimming the default file definitely makes sense. However, what about
> keeping the full ObsoleteFiles.inc version, at least for documenting
> purposes?
>
> --
> Gleb Smirnoff
> ___
> svn-src-h...@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-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: r358561 - in head: . share/man/man5 share/man/man7 tools/build/options tools/tools/nanobsd/dhcpd tools/tools/nanobsd/embedded usr.bin usr.bin/calendar usr.bin/calendar/calendars usr.bi

2020-03-02 Thread Oliver Pinter
On Tuesday, March 3, 2020, Conrad Meyer  wrote:

> Author: cem
> Date: Mon Mar  2 23:37:47 2020
> New Revision: 358561
> URL: https://svnweb.freebsd.org/changeset/base/358561
>
> Log:
>   Fix typo in r278616



Umm, this commit isn't really just a typo fix. Please revert it.


>
>   FreeBSD isn't an encyclopedia.
>
> Deleted:
>   head/tools/build/options/WITHOUT_CALENDAR
>   head/usr.bin/calendar/Makefile
>   head/usr.bin/calendar/Makefile.depend
>   head/usr.bin/calendar/calendar.1
>   head/usr.bin/calendar/calendar.c
>   head/usr.bin/calendar/calendar.h
>   head/usr.bin/calendar/calendars/calendar.all
>   head/usr.bin/calendar/calendars/calendar.australia
>   head/usr.bin/calendar/calendars/calendar.birthday
>   head/usr.bin/calendar/calendars/calendar.brazilian
>   head/usr.bin/calendar/calendars/calendar.christian
>   head/usr.bin/calendar/calendars/calendar.computer
>   head/usr.bin/calendar/calendars/calendar.croatian
>   head/usr.bin/calendar/calendars/calendar.dutch
>   head/usr.bin/calendar/calendars/calendar.french
>   head/usr.bin/calendar/calendars/calendar.german
>   head/usr.bin/calendar/calendars/calendar.history
>   head/usr.bin/calendar/calendars/calendar.holiday
>   head/usr.bin/calendar/calendars/calendar.hungarian
>   head/usr.bin/calendar/calendars/calendar.judaic
>   head/usr.bin/calendar/calendars/calendar.lotr
>   head/usr.bin/calendar/calendars/calendar.music
>   head/usr.bin/calendar/calendars/calendar.newzealand
>   head/usr.bin/calendar/calendars/calendar.russian
>   head/usr.bin/calendar/calendars/calendar.southafrica
>   head/usr.bin/calendar/calendars/calendar.ukrainian
>   head/usr.bin/calendar/calendars/calendar.usholiday
>   head/usr.bin/calendar/calendars/calendar.world
>   head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/
>   head/usr.bin/calendar/calendars/de_DE.ISO8859-1/
>   head/usr.bin/calendar/calendars/fr_FR.ISO8859-1/
>   head/usr.bin/calendar/calendars/hr_HR.ISO8859-2/
>   head/usr.bin/calendar/calendars/hu_HU.ISO8859-2/
>   head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/
>   head/usr.bin/calendar/calendars/pt_BR.UTF-8/
>   head/usr.bin/calendar/calendars/ru_RU.KOI8-R/
>   head/usr.bin/calendar/calendars/ru_RU.UTF-8/
>   head/usr.bin/calendar/calendars/uk_UA.KOI8-U/
>   head/usr.bin/calendar/dates.c
>   head/usr.bin/calendar/day.c
>   head/usr.bin/calendar/events.c
>   head/usr.bin/calendar/io.c
>   head/usr.bin/calendar/locale.c
>   head/usr.bin/calendar/ostern.c
>   head/usr.bin/calendar/parsedata.c
>   head/usr.bin/calendar/paskha.c
>   head/usr.bin/calendar/pathnames.h
>   head/usr.bin/calendar/pom.c
>   head/usr.bin/calendar/sunpos.c
>   head/usr.bin/calendar/tests/
>   head/usr.sbin/periodic/etc/daily/300.calendar
> Modified:
>   head/ObsoleteFiles.inc
>   head/share/man/man5/periodic.conf.5
>   head/share/man/man5/src.conf.5
>   head/share/man/man7/hier.7
>   head/tools/tools/nanobsd/dhcpd/common
>   head/tools/tools/nanobsd/embedded/common
>   head/usr.bin/Makefile
>   head/usr.bin/leave/leave.1
>   head/usr.sbin/periodic/etc/daily/Makefile
>   head/usr.sbin/periodic/periodic.conf
>
> Modified: head/ObsoleteFiles.inc
> 
> ==
> --- head/ObsoleteFiles.inc  Mon Mar  2 23:25:02 2020(r358560)
> +++ head/ObsoleteFiles.inc  Mon Mar  2 23:37:47 2020(r358561)
> @@ -36,6 +36,11 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>
> +# 20200302: calendar(1) removed
> +OLD_DIRS+=usr/share/calendar
> +OLD_FILES+=usr/bin/calendar
> +OLD_FILES+=usr/share/man/man1/calendar.1.gz
> +
>  # 20200301: bktr removed
>  OLD_DIRS+=usr/include/dev/bktr
>  OLD_FILES+=usr/include/dev/bktr/ioctl_bktr.h
>
> Modified: head/share/man/man5/periodic.conf.5
> 
> ==
> --- head/share/man/man5/periodic.conf.5 Mon Mar  2 23:25:02 2020
> (r358560)
> +++ head/share/man/man5/periodic.conf.5 Mon Mar  2 23:37:47 2020
> (r358561)
> @@ -273,13 +273,6 @@ Set to
>  if you want the
>  .Pa /etc/mail/aliases
>  file backed up and modifications to be displayed in your daily output.
> -.It Va daily_calendar_enable
> -.Pq Vt bool
> -Set to
> -.Dq Li YES
> -if you want to run
> -.Nm calendar Fl a
> -daily.
>  .It Va daily_accounting_enable
>  .Pq Vt bool
>  Set to
> @@ -970,7 +963,6 @@ is shared or distributed.
>  .El
>  .Sh SEE ALSO
>  .Xr apropos 1 ,
> -.Xr calendar 1 ,
>  .Xr df 1 ,
>  .Xr diff 1 ,
>  .Xr gzip 1 ,
>
> Modified: head/share/man/man5/src.conf.5
> 
> ==
> --- head/share/man/man5/src.conf.5  Mon Mar  2 23:25:02 2020
> (r358560)
> +++ head/share/man/man5/src.conf.5  Mon Mar  2 23:37:47 2020
> (r358561)
> @@ -271,9 +271,6 @@ is set explicitly)
>  .El
>  .It Va WITHOUT_BZIP2_SUPPORT
>  Set to build some programs without optional bzip2 support.
> -.It Va WITHOUT_CALENDAR
> -Set to not build
> -.Xr calendar 1 .
>  .It Va WITHOUT_CAPSICUM
>  Set

Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts

2020-01-15 Thread Oliver Pinter
On Wednesday, January 15, 2020, Ben Woods  wrote:

> Author: woodsb02 (ports committer)
> Date: Wed Jan 15 07:47:52 2020
> New Revision: 356758
> URL: https://svnweb.freebsd.org/changeset/base/356758
>
> Log:
>   bsdinstall: Change "default" (first) Partitioning method to ZFS
>
>   Reported by:  Ruben Schade (during his talk at linux.conf.au)
>   Approved by:  philip
>   Differential Revision:https://reviews.freebsd.org/D23173


What's the justification behind this change?
Plus I miss from here the relontes tag.



>
> Modified:
>   head/usr.sbin/bsdinstall/bsdinstall.8
>   head/usr.sbin/bsdinstall/scripts/auto
>
> Modified: head/usr.sbin/bsdinstall/bsdinstall.8
> 
> ==
> --- head/usr.sbin/bsdinstall/bsdinstall.8   Wed Jan 15 06:18:32 2020
>   (r356757)
> +++ head/usr.sbin/bsdinstall/bsdinstall.8   Wed Jan 15 07:47:52 2020
>   (r356758)
> @@ -119,7 +119,7 @@ Provides the installer's interactive guided disk parti
>  installations.
>  Defaults to UFS.
>  .It Cm zfsboot
> -Provides an alternative ZFS-only automatic interactive disk partitioner.
> +Provides a ZFS-only automatic interactive disk partitioner.
>  Creates a single
>  .Ic zpool
>  with separate datasets for
>
> Modified: head/usr.sbin/bsdinstall/scripts/auto
> 
> ==
> --- head/usr.sbin/bsdinstall/scripts/auto   Wed Jan 15 06:18:32 2020
>   (r356757)
> +++ head/usr.sbin/bsdinstall/scripts/auto   Wed Jan 15 07:47:52 2020
>   (r356758)
> @@ -289,7 +289,7 @@ Shell \"Open a shell and partition by hand\""
>  CURARCH=$( uname -m )
>  case $CURARCH in
> amd64|arm64|i386)   # Booting ZFS Supported
> -   PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\""
> +   PMODES="\"Auto (ZFS)\" \"Guided Root-on-ZFS\" $PMODES"
> ;;
> *)  # Booting ZFS Unspported
> ;;
> @@ -303,6 +303,10 @@ PARTMODE=`echo $PMODES | xargs dialog --backtitle "Fre
>  exec 3>&-
>
>  case "$PARTMODE" in
> +"Auto (ZFS)")  # ZFS
> +   bsdinstall zfsboot || error "ZFS setup failed"
> +   bsdinstall mount || error "Failed to mount filesystem"
> +   ;;
>  "Auto (UFS)")  # Guided
> bsdinstall autopart || error "Partitioning error"
> bsdinstall mount || error "Failed to mount filesystem"
> @@ -319,10 +323,6 @@ case "$PARTMODE" in
> else
> bsdinstall partedit || error "Partitioning error"
> fi
> -   bsdinstall mount || error "Failed to mount filesystem"
> -   ;;
> -"Auto (ZFS)")  # ZFS
> -   bsdinstall zfsboot || error "ZFS setup failed"
> bsdinstall mount || error "Failed to mount filesystem"
> ;;
>  *)
> ___
> svn-src-h...@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-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: r356159 - head/sys/vm

2019-12-29 Thread Oliver Pinter
Thanks for the detailed answer Mark!

On Sunday, December 29, 2019, Mark Johnston  wrote:

> On Sun, Dec 29, 2019 at 03:39:55AM +0100, Oliver Pinter wrote:
> > Is there any performance measurement from before and after. It would be
> > nice to see them.
>
> I did not do extensive benchmarking.  The aim of the patch set was
> simply to remove the use of the hashed page lock, since it shows up
> prominently in lock profiles of some workloads.  The problem is that we
> acquire these locks any time a page's LRU state is updated, and the use
> of the hash lock means that we get false sharing.  The solution is to
> implement these state updates using atomic operations on the page
> structure itself, making data contention much less likely.  Another
> option was to embed a mutex into the vm_page structure, but this would
> bloat a structure which is already too large.
>
> A secondary goal was to reduce the number of locks held during page
> queue scans.  Such scans frequently call pmap_ts_referenced() to collect
> info about recent references to the page.  This operation can be
> expensive since it may require a TLB shootdown, and it can block for a
> long time on the pmap lock, for example if the lock holder is copying
> the page tables as part of a fork().  Now, the active queue scan body is
> executed without any locks held, so a page daemon thread blocked on a
> pmap lock no longer has the potential to block other threads by holding
> on to a shared page lock.  Before, the page daemon could block faulting
> threads for a long time, hurting latency.  I don't have any benchmarks
> that capture this, but it's something that I've observed in production
> workloads.
>
> I used some microbenchmarks to verify that the change did not penalize
> the single-threaded case.  Here are some results on a 64-core arm64
> system I have been playing with:
> https://people.freebsd.org/~markj/arm64_page_lock/
>
> The benchmark from will-it-scale simply maps 128MB of anonymous memory,
> faults on each page, and unmaps it, in a loop.  In the fault handler we
> allocate a page and insert it into the active queue, and the unmap
> operation removes all of those pages from the queue.  I collected the
> throughput for 1, 2, 4, 8, 16 and 32 concurrent processes.
>
> With my patches we see some modest gains at low concurrency.  At higher
> levels of concurrency we actually get lower throughput than before as
> contention moves from the page locks and the page queue lock to just the
> page queue lock.  I don't believe this is a real regression: first, the
> benchmark is quite extreme relative to any useful workload, and second,
> arm64 suffers from using a much smaller batch size than amd64 for
> batched page queue operations.  Changing that pushes the results out
> somewhat.  Some earlier testing on a 2-socket Xeon system showed a
> similar pattern with smaller differences.
>
___
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: r356159 - head/sys/vm

2019-12-28 Thread Oliver Pinter
Is there any performance measurement from before and after. It would be
nice to see them.

On Saturday, December 28, 2019, Mark Johnston  wrote:

> Author: markj
> Date: Sat Dec 28 19:04:29 2019
> New Revision: 356159
> URL: https://svnweb.freebsd.org/changeset/base/356159
>
> Log:
>   Remove some unused functions.
>
>   The previous series of patches orphaned some vm_page functions, so
>   remove them.
>
>   Reviewed by:  dougm, kib
>   Sponsored by: Netflix, Intel
>   Differential Revision:https://reviews.freebsd.org/D22886
>
> Modified:
>   head/sys/vm/vm_page.c
>   head/sys/vm/vm_page.h
>
> Modified: head/sys/vm/vm_page.c
> 
> ==
> --- head/sys/vm/vm_page.c   Sat Dec 28 19:04:15 2019(r356158)
> +++ head/sys/vm/vm_page.c   Sat Dec 28 19:04:29 2019(r356159)
> @@ -3662,52 +3662,6 @@ vm_page_enqueue(vm_page_t m, uint8_t queue)
>  }
>
>  /*
> - * vm_page_requeue:[ internal use only ]
> - *
> - * Schedule a requeue of the given page.
> - *
> - * The page must be locked.
> - */
> -void
> -vm_page_requeue(vm_page_t m)
> -{
> -
> -   vm_page_assert_locked(m);
> -   KASSERT(vm_page_queue(m) != PQ_NONE,
> -   ("%s: page %p is not logically enqueued", __func__, m));
> -   KASSERT(m->ref_count > 0,
> -   ("%s: page %p does not carry any references", __func__, m));
> -
> -   if ((m->a.flags & PGA_REQUEUE) == 0)
> -   vm_page_aflag_set(m, PGA_REQUEUE);
> -   vm_page_pqbatch_submit(m, atomic_load_8(&m->a.queue));
> -}
> -
> -/*
> - * vm_page_swapqueue:  [ internal use only ]
> - *
> - * Move the page from one queue to another, or to the tail of its
> - * current queue, in the face of a possible concurrent free of the
> - * page.
> - */
> -void
> -vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t newq)
> -{
> -   vm_page_astate_t new, old;
> -
> -   old = vm_page_astate_load(m);
> -   do {
> -   if (old.queue != oldq || (old.flags & PGA_DEQUEUE) != 0)
> -   return;
> -   new = old;
> -   new.flags |= PGA_REQUEUE;
> -   new.queue = newq;
> -   } while (!vm_page_pqstate_commit_dequeue(m, &old, new));
> -
> -   vm_page_pqbatch_submit(m, newq);
> -}
> -
> -/*
>   * vm_page_free_prep:
>   *
>   * Prepares the given page to be put on the free list,
>
> Modified: head/sys/vm/vm_page.h
> 
> ==
> --- head/sys/vm/vm_page.h   Sat Dec 28 19:04:15 2019(r356158)
> +++ head/sys/vm/vm_page.h   Sat Dec 28 19:04:29 2019(r356159)
> @@ -649,7 +649,6 @@ bool vm_page_remove_xbusy(vm_page_t);
>  int vm_page_rename(vm_page_t, vm_object_t, vm_pindex_t);
>  void vm_page_replace(vm_page_t mnew, vm_object_t object,
>  vm_pindex_t pindex, vm_page_t mold);
> -void vm_page_requeue(vm_page_t m);
>  int vm_page_sbusied(vm_page_t m);
>  vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start,
>  vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options);
> @@ -659,7 +658,6 @@ int vm_page_sleep_if_busy(vm_page_t m, const char *msg
>  int vm_page_sleep_if_xbusy(vm_page_t m, const char *msg);
>  vm_offset_t vm_page_startup(vm_offset_t vaddr);
>  void vm_page_sunbusy(vm_page_t m);
> -void vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t newq);
>  bool vm_page_try_remove_all(vm_page_t m);
>  bool vm_page_try_remove_write(vm_page_t m);
>  int vm_page_trysbusy(vm_page_t m);
> @@ -833,31 +831,6 @@ vm_page_aflag_set(vm_page_t m, uint16_t bits)
> addr = (void *)&m->a;
> val = bits << VM_PAGE_AFLAG_SHIFT;
> atomic_set_32(addr, val);
> -}
> -
> -/*
> - * Atomically update the queue state of the page.  The operation
> fails if
> - * any of the queue flags in "fflags" are set or if the "queue" field
> of
> - * the page does not match the expected value; if the operation is
> - * successful, the flags in "nflags" are set and all other queue state
> - * flags are cleared.
> - */
> -static inline bool
> -vm_page_pqstate_cmpset(vm_page_t m, uint32_t oldq, uint32_t newq,
> -uint32_t fflags, uint32_t nflags)
> -{
> -   vm_page_astate_t new, old;
> -
> -   old = vm_page_astate_load(m);
> -   do {
> -   if ((old.flags & fflags) != 0 || old.queue != oldq)
> -   return (false);
> -   new = old;
> -   new.flags = (new.flags & ~PGA_QUEUE_OP_MASK) | nflags;
> -   new.queue = newq;
> -   } while (!vm_page_astate_fcmpset(m, &old, new));
> -
> -   return (true);
>  }
>
>  /*
> ___
> svn-src-h...@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: r354039 - head/stand/efi/loader

2019-10-24 Thread Oliver Pinter
On Thursday, October 24, 2019, Simon J. Gerraty  wrote:

> Author: sjg
> Date: Thu Oct 24 19:52:41 2019
> New Revision: 354039
> URL: https://svnweb.freebsd.org/changeset/base/354039
>
> Log:
>   Allow loader.efi to identify non-standard boot setup
>
>   PATH_BOOTABLE_TOKEN can be set to a non-standard
>   path that identifies a device as bootable.
>
>   Reviewed by: kevans, bcran
>   Differential Revision:  https://reviews.freebsd.org/D22062
>
> Modified:
>   head/stand/efi/loader/main.c


This will be a different patch. The committed code and the code in
phabricator differs.


>
> Modified: head/stand/efi/loader/main.c
> 
> ==
> --- head/stand/efi/loader/main.cThu Oct 24 19:50:18 2019
> (r354038)
> +++ head/stand/efi/loader/main.cThu Oct 24 19:52:41 2019
> (r354039)
> @@ -863,6 +863,7 @@ main(int argc, CHAR16 *argv[])
> archsw.arch_getdev = efi_getdev;
> archsw.arch_copyin = efi_copyin;
> archsw.arch_copyout = efi_copyout;
> +   archsw.arch_hypervisor = x86_hypervisor;
> archsw.arch_readin = efi_readin;
> archsw.arch_zfs_probe = efi_zfs_probe;
>
> ___
> svn-src-h...@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-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: r353539 - in head/sys: amd64/sgx cddl/contrib/opensolaris/uts/common/fs/zfs compat/linuxkpi/common/src dev/drm2/ttm dev/md dev/netmap dev/xen/gntdev dev/xen/privcmd fs/nfsclient fs/smb

2019-10-15 Thread Oliver Pinter
On Tuesday, October 15, 2019, Jeff Roberson  wrote:

> Author: jeff
> Date: Tue Oct 15 03:45:41 2019
> New Revision: 353539
> URL: https://svnweb.freebsd.org/changeset/base/353539
>
> Log:
>   (4/6) Protect page valid with the busy lock.
>
>   Atomics are used for page busy and valid state when the shared busy is
>   held.  The details of the locking protocol and valid and dirty
>   synchronization are in the updated vm_page.h comments.
>
>   Reviewed by:kib, markj
>   Tested by:  pho
>   Sponsored by:   Netflix, Intel
>   Differential Revision:https://reviews.freebsd.org/D21594
>
> Modified:
>   head/sys/amd64/sgx/sgx.c
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>   head/sys/compat/linuxkpi/common/src/linux_compat.c
>   head/sys/dev/drm2/ttm/ttm_bo_vm.c
>   head/sys/dev/drm2/ttm/ttm_tt.c
>   head/sys/dev/md/md.c
>   head/sys/dev/netmap/netmap_freebsd.c
>   head/sys/dev/xen/gntdev/gntdev.c
>   head/sys/dev/xen/privcmd/privcmd.c
>   head/sys/fs/nfsclient/nfs_clbio.c
>   head/sys/fs/smbfs/smbfs_io.c
>   head/sys/fs/tmpfs/tmpfs_subr.c
>   head/sys/kern/kern_exec.c
>   head/sys/kern/uipc_shm.c
>   head/sys/kern/vfs_bio.c
>   head/sys/kern/vfs_cluster.c
>   head/sys/vm/device_pager.c
>   head/sys/vm/phys_pager.c
>   head/sys/vm/sg_pager.c
>   head/sys/vm/swap_pager.c
>   head/sys/vm/vm_fault.c
>   head/sys/vm/vm_map.c
>   head/sys/vm/vm_mmap.c
>   head/sys/vm/vm_object.c
>   head/sys/vm/vm_page.c
>   head/sys/vm/vm_page.h
>   head/sys/vm/vm_pageout.c
>   head/sys/vm/vm_swapout.c
>   head/sys/vm/vnode_pager.c
>
> Modified: head/sys/amd64/sgx/sgx.c
> 
> ==
> --- head/sys/amd64/sgx/sgx.cTue Oct 15 03:41:36 2019(r353538)
> +++ head/sys/amd64/sgx/sgx.cTue Oct 15 03:45:41 2019(r353539)
> @@ -220,8 +220,8 @@ sgx_va_slot_init_by_index(struct sgx_softc *sc, vm_obj
>
> page = PHYS_TO_VM_PAGE(epc->phys);
>
> -   vm_page_insert(page, object, idx);
> page->valid = VM_PAGE_BITS_ALL;


This wouldn't be vm_page_valid(page)?


> +   vm_page_insert(page, object, idx);
> }
>
> return (0);
> @@ -610,8 +610,8 @@ sgx_insert_epc_page_by_index(vm_page_t page, vm_object
>
> VM_OBJECT_ASSERT_WLOCKED(object);
>
> -   vm_page_insert(page, object, pidx);
> page->valid = VM_PAGE_BITS_ALL;


And here too?


> +   vm_page_insert(page, object, pidx);
>  }
>
>  static void
>
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
> 
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Tue Oct
> 15 03:41:36 2019(r353538)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Tue Oct
> 15 03:45:41 2019(r353539)
> @@ -1731,11 +1731,13 @@ dmu_read_pages(objset_t *os, uint64_t object,
> vm_page_
> db = dbp[0];
> for (i = 0; i < *rbehind; i++) {
> m = vm_page_grab(vmobj, ma[0]->pindex - 1 - i,
> -   VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY);
> +   VM_ALLOC_NORMAL | VM_ALLOC_NOWAIT |
> +   VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY);
> if (m == NULL)
> break;
> -   if (m->valid != 0) {
> +   if (!vm_page_none_valid(m)) {
> ASSERT3U(m->valid, ==, VM_PAGE_BITS_ALL);
> +   vm_page_sunbusy(m);
> break;
> }
> ASSERT(m->dirty == 0);
> @@ -1746,13 +1748,14 @@ dmu_read_pages(objset_t *os, uint64_t object,
> vm_page_
> va = zfs_map_page(m, &sf);
> bcopy((char *)db->db_data + bufoff, va, PAGESIZE);
> zfs_unmap_page(sf);
> -   m->valid = VM_PAGE_BITS_ALL;
> +   vm_page_valid(m);
> vm_page_lock(m);
> if ((m->busy_lock & VPB_BIT_WAITERS) != 0)
> vm_page_activate(m);
> else
> vm_page_deactivate(m);
> vm_page_unlock(m);
> +   vm_page_sunbusy(m);
> }
> *rbehind = i;
>
> @@ -1763,7 +1766,7 @@ dmu_read_pages(objset_t *os, uint64_t object,
> vm_page_
> m = ma[mi];
> if (m != bogus_page) {
> vm_page_assert_xbusied(m);
> -   ASSERT(m->valid == 0);
> +   ASSERT(vm_page_none_valid(m));
> ASSERT(m->dirty == 0);
> ASSERT(!pmap_page_is_mapped(m));
> va = zfs_map_page(m, &sf);
> @@ -1791,7 +1794,7 @@ dmu_read_pages(objset_t *os, uint64_t object,
> vm_page_
>

Re: svn commit: r346018 - head/sys/conf

2019-09-03 Thread Oliver Pinter
Please revert this patch. If I'm not wrong, this will break the
freebsd-version command's generation or output.

On Sunday, April 7, 2019, Warner Losh  wrote:

> Author: imp
> Date: Sun Apr  7 18:39:55 2019
> New Revision: 346018
> URL: https://svnweb.freebsd.org/changeset/base/346018
>
> Log:
>   Use default shell assignment rather more complicated if then
>   construct.
>
>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
> feedback)
>   Differential Revision: https://reviews.freebsd.org/D19797
>
> Modified:
>   head/sys/conf/newvers.sh
>
> Modified: head/sys/conf/newvers.sh
> 
> ==
> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
> @@ -46,10 +46,7 @@
>
>  TYPE="FreeBSD"
>  REVISION="13.0"
> -BRANCH="CURRENT"
> -if [ -n "${BRANCH_OVERRIDE}" ]; then
> -   BRANCH=${BRANCH_OVERRIDE}
> -fi
> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>  RELEASE="${REVISION}-${BRANCH}"
>  VERSION="${TYPE} ${RELEASE}"
>
> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>  SYSDIR=$(dirname $0)/..
>  fi
>
> -if [ -n "${PARAMFILE}" ]; then
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${PARAMFILE})
> -else
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${SYSDIR}/sys/param.h)
> -fi
> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>
> -b=share/examples/etc/bsd-style-copyright
>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
> year=$(sed -Ee '/^Copyright .* The FreeBSD
> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>  else
> year=$(date +%Y)
>  fi
>  # look for copyright template
> +b=share/examples/etc/bsd-style-copyright
>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>  do
> if [ -r "$bsd_copyright" ]; then
> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>
>  # VARS_ONLY means no files should be generated, this is just being
>  # included.
> -if [ -n "$VARS_ONLY" ]; then
> -   return 0
> -fi
> +[ -n "$VARS_ONLY" ] && return 0
>
>  LC_ALL=C; export LC_ALL
>  if [ ! -r version ]
> ___
> svn-src-h...@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-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: r346018 - head/sys/conf

2019-09-03 Thread Oliver Pinter
On Monday, April 8, 2019, Warner Losh  wrote:

>
>
> On Sun, Apr 7, 2019, 3:16 PM Oliver Pinter 
> wrote:
>
>> Please revert this patch. If I'm not wrong, this will break the
>> freebsd-version command's generation or output.
>>
>
> You are going to need to be a lot more specific about this. It makes no
> sense to me at all how any of this could break that. The code is identical
> logically and produces the same result.
>

Now I double checked, it may work, but I remembered to this "black magic" :
https://github.com/freebsd/freebsd/blob/master/bin/freebsd-version/Makefile


>
> Warner
>
>
> On Sunday, April 7, 2019, Warner Losh  wrote:
>>
>>> Author: imp
>>> Date: Sun Apr  7 18:39:55 2019
>>> New Revision: 346018
>>> URL: https://svnweb.freebsd.org/changeset/base/346018
>>>
>>> Log:
>>>   Use default shell assignment rather more complicated if then
>>>   construct.
>>>
>>>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
>>> feedback)
>>>   Differential Revision: https://reviews.freebsd.org/D19797
>>>
>>> Modified:
>>>   head/sys/conf/newvers.sh
>>>
>>> Modified: head/sys/conf/newvers.sh
>>> 
>>> ==
>>> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
>>> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
>>> @@ -46,10 +46,7 @@
>>>
>>>  TYPE="FreeBSD"
>>>  REVISION="13.0"
>>> -BRANCH="CURRENT"
>>> -if [ -n "${BRANCH_OVERRIDE}" ]; then
>>> -   BRANCH=${BRANCH_OVERRIDE}
>>> -fi
>>> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>>>  RELEASE="${REVISION}-${BRANCH}"
>>>  VERSION="${TYPE} ${RELEASE}"
>>>
>>> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>>>  SYSDIR=$(dirname $0)/..
>>>  fi
>>>
>>> -if [ -n "${PARAMFILE}" ]; then
>>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/
>>> {print $3}' \
>>> -   ${PARAMFILE})
>>> -else
>>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/
>>> {print $3}' \
>>> -   ${SYSDIR}/sys/param.h)
>>> -fi
>>> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
>>> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>>>
>>> -b=share/examples/etc/bsd-style-copyright
>>>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
>>> year=$(sed -Ee '/^Copyright .* The FreeBSD
>>> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>>>  else
>>> year=$(date +%Y)
>>>  fi
>>>  # look for copyright template
>>> +b=share/examples/etc/bsd-style-copyright
>>>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>>>  do
>>> if [ -r "$bsd_copyright" ]; then
>>> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>>>
>>>  # VARS_ONLY means no files should be generated, this is just being
>>>  # included.
>>> -if [ -n "$VARS_ONLY" ]; then
>>> -   return 0
>>> -fi
>>> +[ -n "$VARS_ONLY" ] && return 0
>>>
>>>  LC_ALL=C; export LC_ALL
>>>  if [ ! -r version ]
>>> ___
>>> svn-src-h...@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-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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-09-03 Thread Oliver Pinter
On Sunday, April 7, 2019, Chris Rees  wrote:

> Author: crees (doc,ports committer)
> Date: Sun Apr  7 18:31:45 2019
> New Revision: 346017
> URL: https://svnweb.freebsd.org/changeset/base/346017
>
> Log:
>   Remove now unnecessary kldstat check before attempting to load modules.
>
>   Since r233109, kldload has the -n option, which silently ignores options
>   that are already loaded.
>
>   https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
>
>   Note that this script no longer reports if the module is already loaded,
>   but it could be argued this wasn't particularly useful information.
>
>   PR:   docs/234248


This is why a docs PR?


>   Reviewed by:  bcr (docs), kib, rgrimes (visual)


I haven't seen kib on the reviewers list.


>   Approved by:  jilles
>   Differential Revision:https://reviews.freebsd.org/D18670
>
> Modified:
>   head/libexec/rc/rc.d/abi
>   head/libexec/rc/rc.d/bthidd
>   head/libexec/rc/rc.d/cfumass
>   head/libexec/rc/rc.d/kld
>   head/libexec/rc/rc.d/mdconfig
>   head/libexec/rc/rc.d/mdconfig2
>   head/libexec/rc/rc.d/mountcritremote
>   head/libexec/rc/rc.d/syscons
>   head/libexec/rc/rc.subr
>   head/share/man/man5/rc.conf.5
>
> Modified: head/libexec/rc/rc.d/abi
> 
> ==
> --- head/libexec/rc/rc.d/abiSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/abiSun Apr  7 18:31:45 2019(r346017)
> @@ -27,10 +27,10 @@ linux_start()
> local _tmpdir
>
> echo -n ' linux'
> -   load_kld -e 'linux(aout|elf)' linux
> +   load_kld linux
> case `sysctl -n hw.machine_arch` in
> amd64)
> -   load_kld -e 'linux64elf' linux64
> +   load_kld linux64
> ;;
> esac
> if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
>
> Modified: head/libexec/rc/rc.d/bthidd
> 
> ==
> --- head/libexec/rc/rc.d/bthidd Sun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/bthidd Sun Apr  7 18:31:45 2019(r346017)
> @@ -34,11 +34,11 @@ evdev_enabled()
>  bthidd_prestart()
>  {
> if evdev_enabled; then
> -   load_kld -m uinput uinput
> +   load_kld uinput
> fi
> -   load_kld -m kbdmux kbdmux
> -   load_kld -m vkbd vkbd
> -   load_kld -m ng_btsocket ng_btsocket
> +   load_kld kbdmux
> +   load_kld vkbd
> +   load_kld ng_btsocket
> return 0
>  }
>
>
> Modified: head/libexec/rc/rc.d/cfumass
> 
> ==
> --- head/libexec/rc/rc.d/cfumassSun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/cfumassSun Apr  7 18:31:45 2019
> (r346017)
> @@ -75,7 +75,7 @@ cfumass_start()
> return "${err}"
> fi
>
> -   load_kld -e cfumass cfumass
> +   load_kld cfumass
>
> # If the template is already switched to Mass Storage, then reset
> # it to -1 to force the host to reenumerate it; otherwise it might
>
> Modified: head/libexec/rc/rc.d/kld
> 
> ==
> --- head/libexec/rc/rc.d/kldSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/kldSun Apr  7 18:31:45 2019(r346017)
> @@ -46,7 +46,7 @@ kld_start()
>
> echo 'Loading kernel modules:'
> for _kld in $kld_list ; do
> -   load_kld -e ${_kld}.ko $_kld
> +   load_kld $_kld
> done
>  }
>
>
> Modified: head/libexec/rc/rc.d/mdconfig
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -114,7 +114,7 @@ mdconfig_start()
> continue
> fi
> if [ "${_file}" != "${_file%.uzip}" ]; then
> -   load_kld -m g_uzip geom_uzip ||
> return 3
> +   load_kld geom_uzip || return 3
> # sleep a bit to allow creation of
> /dev/mdX.uzip
> sleep 2
> fi
>
> Modified: head/libexec/rc/rc.d/mdconfig2
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -123,7 +123,7 @@ mdconfig2_start()
> # been created.
> if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then
> if [ "${_file}" != "${_file%

Re: svn commit: r345638 - head/sys/sys

2019-09-03 Thread Oliver Pinter
On Thursday, March 28, 2019, Cy Schubert  wrote:

> In message <201903281056.x2saur5e070...@repo.freebsd.org>, Ed Maste
> writes:
> > Author: emaste
> > Date: Thu Mar 28 10:56:27 2019
> > New Revision: 345638
> > URL: https://svnweb.freebsd.org/changeset/base/345638
> >
> > Log:
> >   Revert change accidentally committed along with r345625
> >
> >   Reported by:Oliver Pinter 
> >
> > Modified:
> >   head/sys/sys/elf_common.h
> >
> > Modified: head/sys/sys/elf_common.h
> > 
> =
> > =
> > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019(r345637)
> > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019(r345638)
> > @@ -763,8 +763,7 @@ typedef struct {
> >  #define  NT_FREEBSD_FEATURE_CTL  4
> >
> >  /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
> > -#define  NT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> > -#define  NT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
> > +#define  NT_FREEBSD_FCTL_ASLR_DISABLE0x0001
>
> --- readelf.o ---
> /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4:
> error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT'
> { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
>   ^
> 1 error generated.
> *** [readelf.o] Error code 1
>
>
Sure, the "the other hunk" missing from this revert, but it is fixed now by
a different commit.


> >
> >  /* Values for n_type.  Used in core files. */
> >  #define  NT_PRSTATUS 1   /* Process status. */
> >
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  http://www.FreeBSD.org
>
> The need of the many outweighs the greed of the few.
>
>
>
> ___
> svn-src-h...@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-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: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys

2019-09-03 Thread Oliver Pinter
On Thursday, March 28, 2019, Ed Maste  wrote:

> Author: emaste
> Date: Thu Mar 28 02:12:32 2019
> New Revision: 345625
> URL: https://svnweb.freebsd.org/changeset/base/345625
>
> Log:
>   revert r341429 "disable BIND_NOW in libc, libthr, and rtld"
>
>   r345620 by kib@ fixed the rtld issue that caused a crash at startup
>   during resolution of libc's ifuncs with BIND_NOW.
>
>   PR:   23
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/contrib/elftoolchain/readelf/readelf.c
>   head/lib/libc/Makefile
>   head/lib/libthr/Makefile
>   head/libexec/rtld-elf/Makefile
>   head/sys/sys/elf_common.h
>
> Modified: head/contrib/elftoolchain/readelf/readelf.c
> 
> ==
> --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019
>   (r345624)
> +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019
>   (r345625)
> @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re)
>
>  static struct flag_desc note_feature_ctl_flags[] = {
> { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" },
> +   { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
> { 0, NULL }
>  };
>
>
Seems like this and the other hunk belongs to a different patch.


>
> Modified: head/lib/libc/Makefile
> 
> ==
> --- head/lib/libc/Makefile  Thu Mar 28 01:12:44 2019(r345624)
> +++ head/lib/libc/Makefile  Thu Mar 28 02:12:32 2019(r345625)
> @@ -6,8 +6,6 @@ SHLIBDIR?= /lib
>
>  .include 
>
> -# BIND_NOW in libc results in segfault at startup (PR 23)
> -MK_BIND_NOW=   no
>  # Force building of libc_pic.a
>  MK_TOOLCHAIN=  yes
>
>
> Modified: head/lib/libthr/Makefile
> 
> ==
> --- head/lib/libthr/MakefileThu Mar 28 01:12:44 2019(r345624)
> +++ head/lib/libthr/MakefileThu Mar 28 02:12:32 2019(r345625)
> @@ -9,7 +9,6 @@ PACKAGE=clibs
>  SHLIBDIR?= /lib
>
>  .include 
> -MK_BIND_NOW= no
>  MK_SSP=no
>
>  LIB=thr
>
> Modified: head/libexec/rtld-elf/Makefile
> 
> ==
> --- head/libexec/rtld-elf/Makefile  Thu Mar 28 01:12:44 2019
> (r345624)
> +++ head/libexec/rtld-elf/Makefile  Thu Mar 28 02:12:32 2019
> (r345625)
> @@ -6,7 +6,6 @@
>
>  .include 
>  PACKAGE=   clibs
> -MK_BIND_NOW=   no
>  MK_PIE=no # Always position independent using local rules
>  MK_SSP=no
>
>
> Modified: head/sys/sys/elf_common.h
> 
> ==
> --- head/sys/sys/elf_common.h   Thu Mar 28 01:12:44 2019(r345624)
> +++ head/sys/sys/elf_common.h   Thu Mar 28 02:12:32 2019(r345625)
> @@ -763,7 +763,8 @@ typedef struct {
>  #defineNT_FREEBSD_FEATURE_CTL  4
>
>  /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
> -#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> +#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> +#defineNT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
>
>  /* Values for n_type.  Used in core files. */
>  #defineNT_PRSTATUS 1   /* Process status. */
> ___
> svn-src-h...@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-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: r351471 - in head/sys: kern sys

2019-08-25 Thread Oliver Pinter
On Sunday, August 25, 2019, Mateusz Guzik  wrote:

> Author: mjg
> Date: Sun Aug 25 05:11:43 2019
> New Revision: 351471
> URL: https://svnweb.freebsd.org/changeset/base/351471
>
> Log:
>   vfs: add vholdnz (for already held vnodes)


Why?

(Yes, is can read the real reason in phabricator, but the phabricator
didn't considered a persistent information in relation to commit message.
Review helper tool just comes and goes as time goes forward, but commit
messages survives the repo conversions to other VCS...)

And once you have taken the time to write a correct description in
phabricator, it would be really really nice and helpful if you would copy
them into commit message.


>
>   Reviewed by:  kib (previous version)
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:https://reviews.freebsd.org/D21358
>
> Modified:
>   head/sys/kern/vfs_subr.c
>   head/sys/sys/vnode.h
>
> Modified: head/sys/kern/vfs_subr.c
> 
> ==
> --- head/sys/kern/vfs_subr.cSun Aug 25 04:56:33 2019(r351470)
> +++ head/sys/kern/vfs_subr.cSun Aug 25 05:11:43 2019(r351471)
> @@ -3018,6 +3018,19 @@ _vhold(struct vnode *vp, bool locked)
> VI_UNLOCK(vp);
>  }
>
> +void
> +vholdnz(struct vnode *vp)
> +{
> +
> +   CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
> +#ifdef INVARIANTS
> +   int old = atomic_fetchadd_int(&vp->v_holdcnt, 1);
> +   VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__));
> +#else
> +   atomic_add_int(&vp->v_holdcnt, 1);
> +#endif
> +}
> +
>  /*
>   * Drop the hold count of the vnode.  If this is the last reference to
>   * the vnode we place it on the free list unless it has been vgone'd
>
> Modified: head/sys/sys/vnode.h
> 
> ==
> --- head/sys/sys/vnode.hSun Aug 25 04:56:33 2019(r351470)
> +++ head/sys/sys/vnode.hSun Aug 25 05:11:43 2019(r351471)
> @@ -657,6 +657,7 @@ voidvgone(struct vnode *vp);
>  #definevhold(vp)   _vhold((vp), 0)
>  #definevholdl(vp)  _vhold((vp), 1)
>  void   _vhold(struct vnode *, bool);
> +void   vholdnz(struct vnode *);
>  void   vinactive(struct vnode *, struct thread *);
>  intvinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
>  intvtruncbuf(struct vnode *vp, off_t length, int blksize);
> ___
> svn-src-h...@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-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: r349999 - head/sys/netinet

2019-07-15 Thread Oliver Pinter
On Monday, July 15, 2019, Michael Tuexen  wrote:

> Author: tuexen
> Date: Mon Jul 15 14:54:04 2019
> New Revision: 34
> URL: https://svnweb.freebsd.org/changeset/base/34
>
> Log:
>   Add support for MSG_EOR and MSG_EOF in sendmsg() for SCTP.
>
>   This is an FreeBSD extension, not covered by Posix.
>
>   This issue was found by running syzkaller.


Aren't there syzkaller ids for these findings?


>
>   MFC after:1 week
>
> Modified:
>   head/sys/netinet/sctp_output.c
>
> Modified: head/sys/netinet/sctp_output.c
> 
> ==
> --- head/sys/netinet/sctp_output.c  Mon Jul 15 14:52:52 2019
> (r349998)
> +++ head/sys/netinet/sctp_output.c  Mon Jul 15 14:54:04 2019
> (r34)
> @@ -12652,6 +12652,12 @@ sctp_lower_sosend(struct socket *so,
> sinfo_flags = inp->def_send.sinfo_flags;
> sinfo_assoc_id = inp->def_send.sinfo_assoc_id;
> }
> +   if (flags & MSG_EOR) {
> +   sinfo_flags |= SCTP_EOR;
> +   }
> +   if (flags & MSG_EOF) {
> +   sinfo_flags |= SCTP_EOF;
> +   }
> if (sinfo_flags & SCTP_SENDALL) {
> /* its a sendall */
> error = sctp_sendall(inp, uio, top, srcv);
> @@ -12819,9 +12825,17 @@ sctp_lower_sosend(struct socket *so,
> }
> } else
> asoc = &stcb->asoc;
> -   if (srcv == NULL)
> +   if (srcv == NULL) {
> srcv = (struct sctp_sndrcvinfo *)&asoc->def_send;
> -   if (srcv->sinfo_flags & SCTP_ADDR_OVER) {
> +   sinfo_flags = srcv->sinfo_flags;
> +   if (flags & MSG_EOR) {
> +   sinfo_flags |= SCTP_EOR;
> +   }
> +   if (flags & MSG_EOF) {
> +   sinfo_flags |= SCTP_EOF;
> +   }
> +   }
> +   if (sinfo_flags & SCTP_ADDR_OVER) {
> if (addr)
> net = sctp_findnet(stcb, addr);
> else
> @@ -12928,7 +12942,7 @@ sctp_lower_sosend(struct socket *so,
> (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) ||
> (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) ||
> (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) {
> -   if (srcv->sinfo_flags & SCTP_ABORT) {
> +   if (sinfo_flags & SCTP_ABORT) {
> ;
> } else {
> SCTP_LTRACE_ERR_RET(NULL, stcb, NULL,
> SCTP_FROM_SCTP_OUTPUT, ECONNRESET);
> @@ -12941,7 +12955,7 @@ sctp_lower_sosend(struct socket *so,
> p->td_ru.ru_msgsnd++;
> }
> /* Are we aborting? */
> -   if (srcv->sinfo_flags & SCTP_ABORT) {
> +   if (sinfo_flags & SCTP_ABORT) {
> struct mbuf *mm;
> ssize_t tot_demand, tot_out = 0, max_out;
>
> @@ -13145,7 +13159,7 @@ skip_preblock:
>  * case NOTE: uio will be null when top/mbuf is passed
>  */
> if (sndlen == 0) {
> -   if (srcv->sinfo_flags & SCTP_EOF) {
> +   if (sinfo_flags & SCTP_EOF) {
> got_all_of_the_send = 1;
> goto dataless_eof;
> } else {
> @@ -13194,7 +13208,7 @@ skip_preblock:
> }
> sctp_snd_sb_alloc(stcb, sp->length);
> atomic_add_int(&asoc->stream_queue_cnt, 1);
> -   if (srcv->sinfo_flags & SCTP_UNORDERED) {
> +   if (sinfo_flags & SCTP_UNORDERED) {
> SCTP_STAT_INCR(sctps_sends_with_unord);
> }
> TAILQ_INSERT_TAIL(&strm->outqueue, sp, next);
> @@ -13269,15 +13283,15 @@ skip_preblock:
> sctp_snd_sb_alloc(stcb, sndout);
> atomic_add_int(&sp->length, sndout);
> len += sndout;
> -   if (srcv->sinfo_flags &
> SCTP_SACK_IMMEDIATELY) {
> +   if (sinfo_flags & SCTP_SACK_IMMEDIATELY) {
> sp->sinfo_flags |=
> SCTP_SACK_IMMEDIATELY;
> }
>
> /* Did we reach EOR? */
> if ((uio->uio_resid == 0) &&
> ((user_marks_eor == 0) ||
> -   (srcv->sinfo_flags & SCTP_EOF) ||
> -   (user_marks_eor && (srcv->sinfo_flags
> & SCTP_EOR {
> +   (sinfo_flags & SCTP_EOF) ||
> +   (user_marks_eor && (sinfo_flags &
> SCTP_EOR {
> sp->msg_is_complete = 1;
> } else {
> sp->msg_is_complete 

Re: svn commit: r349046 - head/sys/vm

2019-06-14 Thread Oliver Pinter
On Saturday, June 15, 2019, Doug Moore  wrote:

> Author: dougm
> Date: Sat Jun 15 04:30:13 2019
> New Revision: 349046
> URL: https://svnweb.freebsd.org/changeset/base/349046
>
> Log:
>   Critical comments were lost in r349203. This patch seeks to restore
>   the lost information in new comments.
>
>   Reported by: alc
>   Reviewed by: alc
>   Approved by: kib (mentor)
>   Differential Revision: https://reviews.freebsd.org/D20632
>
> Modified:
>   head/sys/vm/vm_map.c
>
> Modified: head/sys/vm/vm_map.c
> 
> ==
> --- head/sys/vm/vm_map.cSat Jun 15 01:27:49 2019(r349045)
> +++ head/sys/vm/vm_map.cSat Jun 15 04:30:13 2019(r349046)
> @@ -2186,17 +2186,22 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t
> entry,
> VM_MAP_ASSERT_LOCKED(map);
> KASSERT(entry->end > start && entry->start < start,
> ("_vm_map_clip_start: invalid clip of entry %p", entry));
> +   vm_map_simplify_entry(map, entry);


Hi!

This isn't just comment.


>
> /*
> -* Split off the front portion -- note that we must insert the new
> -* entry BEFORE this one, so that this entry has the specified
> -* starting address.
> +* Create a backing object now, if none exists, so that more
> individual
> +* objects won't be created after the map entry is split.
>  */
> -   vm_map_simplify_entry(map, entry);
> vm_map_entry_charge_object(map, entry);
> +
> +   /* Clone the entry. */
> new_entry = vm_map_entry_create(map);
> *new_entry = *entry;
>
> +   /*
> +* Split off the front portion.  Insert the new entry BEFORE this
> one,
> +* so that this entry has the specified starting address.
> +*/
> new_entry->end = start;
> entry->offset += (start - entry->start);
> entry->start = start;
> @@ -2244,14 +2249,20 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t
> entry, v
> KASSERT(entry->start < end && entry->end > end,
> ("_vm_map_clip_end: invalid clip of entry %p", entry));
>
> -
> /*
> -* Create a new entry and insert it AFTER the specified entry
> +* Create a backing object now, if none exists, so that more
> individual
> +* objects won't be created after the map entry is split.
>  */
> vm_map_entry_charge_object(map, entry);
> +
> +   /* Clone the entry. */
> new_entry = vm_map_entry_create(map);
> *new_entry = *entry;
>
> +   /*
> +* Split off the back portion.  Insert the new entry AFTER this
> one,
> +* so that this entry has the specified ending address.
> +*/
> new_entry->start = entry->end = end;
> new_entry->offset += (end - entry->start);
> if (new_entry->cred != NULL)
> ___
> svn-src-h...@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-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: r347532 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat

2019-05-13 Thread Oliver Pinter
And it would be nice to bump __freebsd_version too.

On Monday, May 13, 2019, Rodney W. Grimes  wrote:

> > > Author: markj
> > > Date: Mon May 13 16:38:48 2019
> > > New Revision: 347532
> > > URL: https://svnweb.freebsd.org/changeset/base/347532
> > >
> > > Log:
> > >   Provide separate accounting for user-wired pages.
> > >
> > >   Historically we have not distinguished between kernel wirings and
> user
> > >   wirings for accounting purposes.  User wirings (via mlock(2)) were
> > >   subject to a global limit on the number of wired pages, so if large
> > >   swaths of physical memory were wired by the kernel, as happens with
> > >   the ZFS ARC among other things, the limit could be exceeded, causing
> > >   user wirings to fail.
> > >
> > >   The change adds a new counter, v_user_wire_count, which counts the
> > >   number of virtual pages wired by user processes via mlock(2) and
> > >   mlockall(2).  Only user-wired pages are subject to the system-wide
> > >   limit which helps provide some safety against deadlocks.  In
> > >   particular, while sources of kernel wirings typically support some
> > >   backpressure mechanism, there is no way to reclaim user-wired pages
> > >   shorting of killing the wiring process.  The limit is exported as
> > >   vm.max_user_wired, renamed from vm.max_wired, and changed from u_int
> > >   to u_long.
> > >
> > >   The choice to count virtual user-wired pages rather than physical
> > >   pages was done for simplicity.  There are mechanisms that can cause
> > >   user-wired mappings to be destroyed while maintaining a wiring of
> > >   the backing physical page; these make it difficult to accurately
> > >   track user wirings at the physical page layer.
> > >
> > >   The change also closes some holes which allowed user wirings to
> succeed
> > >   even when they would cause the system limit to be exceeded.  For
> > >   instance, mmap() may now fail with ENOMEM in a process that has
> called
> > >   mlockall(MCL_FUTURE) if the new mapping would cause the user wiring
> > >   limit to be exceeded.
> > >
> > >   Note that bhyve -S is subject to the user wiring limit, which
> defaults
> > >   to 1/3 of physical RAM.  Users that wish to exceed the limit must
> tune
> > >   vm.max_user_wired.
> >
> > Because of that this should probably have a:
> > Release Notes:Yes
>
> And probably an UPDATING entry since this may cause some -head
> users VM's to fall over on a update/reboot.
>
>
> > >   Reviewed by:  kib, ngie (mlock() test changes)
> > >   Tested by:pho (earlier version)
> > >   MFC after:45 days
> > >   Sponsored by: Netflix
> > >   Differential Revision:https://reviews.freebsd.org/D19908
> > >
> > > Modified:
> > >   head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
> > >   head/lib/libc/sys/mlock.2
> > >   head/lib/libc/sys/mlockall.2
> > >   head/lib/libc/tests/sys/mlock_helper.c
> > >   head/sys/amd64/vmm/vmm.c
> > >   head/sys/sys/vmmeter.h
> > >   head/sys/vm/vm_glue.c
> > >   head/sys/vm/vm_map.c
> > >   head/sys/vm/vm_map.h
> > >   head/sys/vm/vm_meter.c
> > >   head/sys/vm/vm_mmap.c
> > >   head/sys/vm/vm_pageout.c
> > >   head/sys/vm/vm_pageout.h
> > >   head/sys/vm/vm_unix.c
> > >   head/usr.bin/vmstat/vmstat.c
> > >
> > > Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
> > > 
> ==
> > > --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.cMon May
> 13 15:39:54 2019(r347531)
> > > +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.cMon May
> 13 16:38:48 2019(r347532)
> > > @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09
> 12:02:44
> > >  #define _KMEMUSER
> > >  #include 
> > >
> > > -void set_vm_max_wired(int);
> > > +void set_vm_max_wired(u_long);
> > >  void restore_vm_max_wired(void);
> > >  #endif
> > >
> > >
> > > Modified: head/lib/libc/sys/mlock.2
> > > 
> ==
> > > --- head/lib/libc/sys/mlock.2   Mon May 13 15:39:54 2019
> (r347531)
> > > +++ head/lib/libc/sys/mlock.2   Mon May 13 16:38:48 2019
> (r347532)
> > > @@ -28,7 +28,7 @@
> > >  .\"@(#)mlock.2 8.2 (Berkeley) 12/11/93
> > >  .\" $FreeBSD$
> > >  .\"
> > > -.Dd March 20, 2018
> > > +.Dd May 13, 2019
> > >  .Dt MLOCK 2
> > >  .Os
> > >  .Sh NAME
> > > @@ -97,13 +97,13 @@ resource limit and the
> > >  system-wide
> > >  .Dq wired pages
> > >  limit
> > > -.Va vm.max_wired .
> > > -.Va vm.max_wired
> > > +.Va vm.max_user_wired .
> > > +.Va vm.max_user_wired
> > >  applies to the system as a whole, so the amount available to a single
> > >  process at any given time is the difference between
> > > -.Va vm.max_wired
> > > +.Va vm.max_user_wired
> > >  and
> > > -.Va vm.stats.vm.v_wire_count .
> > > +.Va vm.stats.vm.v_user_wire_count .
> > >  .Pp
> > >  If
> > >  .Va security.bsd.unprivileged_mlock
> > > @@ -124,13 +124,11 @@ will fail if:
> >

Re: svn commit: r346018 - head/sys/conf

2019-04-08 Thread Oliver Pinter
On Monday, April 8, 2019, Warner Losh  wrote:

>
>
> On Sun, Apr 7, 2019, 3:16 PM Oliver Pinter 
> wrote:
>
>> Please revert this patch. If I'm not wrong, this will break the
>> freebsd-version command's generation or output.
>>
>
> You are going to need to be a lot more specific about this. It makes no
> sense to me at all how any of this could break that. The code is identical
> logically and produces the same result.
>

Now I double checked, it may work, but I remembered to this "black magic" :
https://github.com/freebsd/freebsd/blob/master/bin/freebsd-version/Makefile


>
> Warner
>
>
> On Sunday, April 7, 2019, Warner Losh  wrote:
>>
>>> Author: imp
>>> Date: Sun Apr  7 18:39:55 2019
>>> New Revision: 346018
>>> URL: https://svnweb.freebsd.org/changeset/base/346018
>>>
>>> Log:
>>>   Use default shell assignment rather more complicated if then
>>>   construct.
>>>
>>>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
>>> feedback)
>>>   Differential Revision: https://reviews.freebsd.org/D19797
>>>
>>> Modified:
>>>   head/sys/conf/newvers.sh
>>>
>>> Modified: head/sys/conf/newvers.sh
>>> 
>>> ==
>>> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
>>> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
>>> @@ -46,10 +46,7 @@
>>>
>>>  TYPE="FreeBSD"
>>>  REVISION="13.0"
>>> -BRANCH="CURRENT"
>>> -if [ -n "${BRANCH_OVERRIDE}" ]; then
>>> -   BRANCH=${BRANCH_OVERRIDE}
>>> -fi
>>> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>>>  RELEASE="${REVISION}-${BRANCH}"
>>>  VERSION="${TYPE} ${RELEASE}"
>>>
>>> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>>>  SYSDIR=$(dirname $0)/..
>>>  fi
>>>
>>> -if [ -n "${PARAMFILE}" ]; then
>>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/
>>> {print $3}' \
>>> -   ${PARAMFILE})
>>> -else
>>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/
>>> {print $3}' \
>>> -   ${SYSDIR}/sys/param.h)
>>> -fi
>>> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
>>> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>>>
>>> -b=share/examples/etc/bsd-style-copyright
>>>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
>>> year=$(sed -Ee '/^Copyright .* The FreeBSD
>>> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>>>  else
>>> year=$(date +%Y)
>>>  fi
>>>  # look for copyright template
>>> +b=share/examples/etc/bsd-style-copyright
>>>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>>>  do
>>> if [ -r "$bsd_copyright" ]; then
>>> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>>>
>>>  # VARS_ONLY means no files should be generated, this is just being
>>>  # included.
>>> -if [ -n "$VARS_ONLY" ]; then
>>> -   return 0
>>> -fi
>>> +[ -n "$VARS_ONLY" ] && return 0
>>>
>>>  LC_ALL=C; export LC_ALL
>>>  if [ ! -r version ]
>>> ___
>>> svn-src-h...@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-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: r346018 - head/sys/conf

2019-04-07 Thread Oliver Pinter
Please revert this patch. If I'm not wrong, this will break the
freebsd-version command's generation or output.

On Sunday, April 7, 2019, Warner Losh  wrote:

> Author: imp
> Date: Sun Apr  7 18:39:55 2019
> New Revision: 346018
> URL: https://svnweb.freebsd.org/changeset/base/346018
>
> Log:
>   Use default shell assignment rather more complicated if then
>   construct.
>
>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
> feedback)
>   Differential Revision: https://reviews.freebsd.org/D19797
>
> Modified:
>   head/sys/conf/newvers.sh
>
> Modified: head/sys/conf/newvers.sh
> 
> ==
> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
> @@ -46,10 +46,7 @@
>
>  TYPE="FreeBSD"
>  REVISION="13.0"
> -BRANCH="CURRENT"
> -if [ -n "${BRANCH_OVERRIDE}" ]; then
> -   BRANCH=${BRANCH_OVERRIDE}
> -fi
> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>  RELEASE="${REVISION}-${BRANCH}"
>  VERSION="${TYPE} ${RELEASE}"
>
> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>  SYSDIR=$(dirname $0)/..
>  fi
>
> -if [ -n "${PARAMFILE}" ]; then
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${PARAMFILE})
> -else
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${SYSDIR}/sys/param.h)
> -fi
> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>
> -b=share/examples/etc/bsd-style-copyright
>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
> year=$(sed -Ee '/^Copyright .* The FreeBSD
> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>  else
> year=$(date +%Y)
>  fi
>  # look for copyright template
> +b=share/examples/etc/bsd-style-copyright
>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>  do
> if [ -r "$bsd_copyright" ]; then
> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>
>  # VARS_ONLY means no files should be generated, this is just being
>  # included.
> -if [ -n "$VARS_ONLY" ]; then
> -   return 0
> -fi
> +[ -n "$VARS_ONLY" ] && return 0
>
>  LC_ALL=C; export LC_ALL
>  if [ ! -r version ]
> ___
> svn-src-h...@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-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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-04-07 Thread Oliver Pinter
On Sunday, April 7, 2019, Chris Rees  wrote:

> Author: crees (doc,ports committer)
> Date: Sun Apr  7 18:31:45 2019
> New Revision: 346017
> URL: https://svnweb.freebsd.org/changeset/base/346017
>
> Log:
>   Remove now unnecessary kldstat check before attempting to load modules.
>
>   Since r233109, kldload has the -n option, which silently ignores options
>   that are already loaded.
>
>   https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
>
>   Note that this script no longer reports if the module is already loaded,
>   but it could be argued this wasn't particularly useful information.
>
>   PR:   docs/234248


This is why a docs PR?


>   Reviewed by:  bcr (docs), kib, rgrimes (visual)


I haven't seen kib on the reviewers list.


>   Approved by:  jilles
>   Differential Revision:https://reviews.freebsd.org/D18670
>
> Modified:
>   head/libexec/rc/rc.d/abi
>   head/libexec/rc/rc.d/bthidd
>   head/libexec/rc/rc.d/cfumass
>   head/libexec/rc/rc.d/kld
>   head/libexec/rc/rc.d/mdconfig
>   head/libexec/rc/rc.d/mdconfig2
>   head/libexec/rc/rc.d/mountcritremote
>   head/libexec/rc/rc.d/syscons
>   head/libexec/rc/rc.subr
>   head/share/man/man5/rc.conf.5
>
> Modified: head/libexec/rc/rc.d/abi
> 
> ==
> --- head/libexec/rc/rc.d/abiSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/abiSun Apr  7 18:31:45 2019(r346017)
> @@ -27,10 +27,10 @@ linux_start()
> local _tmpdir
>
> echo -n ' linux'
> -   load_kld -e 'linux(aout|elf)' linux
> +   load_kld linux
> case `sysctl -n hw.machine_arch` in
> amd64)
> -   load_kld -e 'linux64elf' linux64
> +   load_kld linux64
> ;;
> esac
> if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
>
> Modified: head/libexec/rc/rc.d/bthidd
> 
> ==
> --- head/libexec/rc/rc.d/bthidd Sun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/bthidd Sun Apr  7 18:31:45 2019(r346017)
> @@ -34,11 +34,11 @@ evdev_enabled()
>  bthidd_prestart()
>  {
> if evdev_enabled; then
> -   load_kld -m uinput uinput
> +   load_kld uinput
> fi
> -   load_kld -m kbdmux kbdmux
> -   load_kld -m vkbd vkbd
> -   load_kld -m ng_btsocket ng_btsocket
> +   load_kld kbdmux
> +   load_kld vkbd
> +   load_kld ng_btsocket
> return 0
>  }
>
>
> Modified: head/libexec/rc/rc.d/cfumass
> 
> ==
> --- head/libexec/rc/rc.d/cfumassSun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/cfumassSun Apr  7 18:31:45 2019
> (r346017)
> @@ -75,7 +75,7 @@ cfumass_start()
> return "${err}"
> fi
>
> -   load_kld -e cfumass cfumass
> +   load_kld cfumass
>
> # If the template is already switched to Mass Storage, then reset
> # it to -1 to force the host to reenumerate it; otherwise it might
>
> Modified: head/libexec/rc/rc.d/kld
> 
> ==
> --- head/libexec/rc/rc.d/kldSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/kldSun Apr  7 18:31:45 2019(r346017)
> @@ -46,7 +46,7 @@ kld_start()
>
> echo 'Loading kernel modules:'
> for _kld in $kld_list ; do
> -   load_kld -e ${_kld}.ko $_kld
> +   load_kld $_kld
> done
>  }
>
>
> Modified: head/libexec/rc/rc.d/mdconfig
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -114,7 +114,7 @@ mdconfig_start()
> continue
> fi
> if [ "${_file}" != "${_file%.uzip}" ]; then
> -   load_kld -m g_uzip geom_uzip ||
> return 3
> +   load_kld geom_uzip || return 3
> # sleep a bit to allow creation of
> /dev/mdX.uzip
> sleep 2
> fi
>
> Modified: head/libexec/rc/rc.d/mdconfig2
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -123,7 +123,7 @@ mdconfig2_start()
> # been created.
> if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then
> if [ "${_file}" != "${_file%

Re: svn commit: r345638 - head/sys/sys

2019-03-28 Thread Oliver Pinter
On Thursday, March 28, 2019, Cy Schubert  wrote:

> In message <201903281056.x2saur5e070...@repo.freebsd.org>, Ed Maste
> writes:
> > Author: emaste
> > Date: Thu Mar 28 10:56:27 2019
> > New Revision: 345638
> > URL: https://svnweb.freebsd.org/changeset/base/345638
> >
> > Log:
> >   Revert change accidentally committed along with r345625
> >
> >   Reported by:Oliver Pinter 
> >
> > Modified:
> >   head/sys/sys/elf_common.h
> >
> > Modified: head/sys/sys/elf_common.h
> > 
> =
> > =
> > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019(r345637)
> > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019(r345638)
> > @@ -763,8 +763,7 @@ typedef struct {
> >  #define  NT_FREEBSD_FEATURE_CTL  4
> >
> >  /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
> > -#define  NT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> > -#define  NT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
> > +#define  NT_FREEBSD_FCTL_ASLR_DISABLE0x0001
>
> --- readelf.o ---
> /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4:
> error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT'
> { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
>   ^
> 1 error generated.
> *** [readelf.o] Error code 1
>
>
Sure, the "the other hunk" missing from this revert, but it is fixed now by
a different commit.


> >
> >  /* Values for n_type.  Used in core files. */
> >  #define  NT_PRSTATUS 1   /* Process status. */
> >
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  http://www.FreeBSD.org
>
> The need of the many outweighs the greed of the few.
>
>
>
> ___
> svn-src-h...@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-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: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys

2019-03-28 Thread Oliver Pinter
On Thursday, March 28, 2019, Ed Maste  wrote:

> Author: emaste
> Date: Thu Mar 28 02:12:32 2019
> New Revision: 345625
> URL: https://svnweb.freebsd.org/changeset/base/345625
>
> Log:
>   revert r341429 "disable BIND_NOW in libc, libthr, and rtld"
>
>   r345620 by kib@ fixed the rtld issue that caused a crash at startup
>   during resolution of libc's ifuncs with BIND_NOW.
>
>   PR:   23
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/contrib/elftoolchain/readelf/readelf.c
>   head/lib/libc/Makefile
>   head/lib/libthr/Makefile
>   head/libexec/rtld-elf/Makefile
>   head/sys/sys/elf_common.h
>
> Modified: head/contrib/elftoolchain/readelf/readelf.c
> 
> ==
> --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019
>   (r345624)
> +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019
>   (r345625)
> @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re)
>
>  static struct flag_desc note_feature_ctl_flags[] = {
> { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" },
> +   { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" },
> { 0, NULL }
>  };
>
>
Seems like this and the other hunk belongs to a different patch.


>
> Modified: head/lib/libc/Makefile
> 
> ==
> --- head/lib/libc/Makefile  Thu Mar 28 01:12:44 2019(r345624)
> +++ head/lib/libc/Makefile  Thu Mar 28 02:12:32 2019(r345625)
> @@ -6,8 +6,6 @@ SHLIBDIR?= /lib
>
>  .include 
>
> -# BIND_NOW in libc results in segfault at startup (PR 23)
> -MK_BIND_NOW=   no
>  # Force building of libc_pic.a
>  MK_TOOLCHAIN=  yes
>
>
> Modified: head/lib/libthr/Makefile
> 
> ==
> --- head/lib/libthr/MakefileThu Mar 28 01:12:44 2019(r345624)
> +++ head/lib/libthr/MakefileThu Mar 28 02:12:32 2019(r345625)
> @@ -9,7 +9,6 @@ PACKAGE=clibs
>  SHLIBDIR?= /lib
>
>  .include 
> -MK_BIND_NOW= no
>  MK_SSP=no
>
>  LIB=thr
>
> Modified: head/libexec/rtld-elf/Makefile
> 
> ==
> --- head/libexec/rtld-elf/Makefile  Thu Mar 28 01:12:44 2019
> (r345624)
> +++ head/libexec/rtld-elf/Makefile  Thu Mar 28 02:12:32 2019
> (r345625)
> @@ -6,7 +6,6 @@
>
>  .include 
>  PACKAGE=   clibs
> -MK_BIND_NOW=   no
>  MK_PIE=no # Always position independent using local rules
>  MK_SSP=no
>
>
> Modified: head/sys/sys/elf_common.h
> 
> ==
> --- head/sys/sys/elf_common.h   Thu Mar 28 01:12:44 2019(r345624)
> +++ head/sys/sys/elf_common.h   Thu Mar 28 02:12:32 2019(r345625)
> @@ -763,7 +763,8 @@ typedef struct {
>  #defineNT_FREEBSD_FEATURE_CTL  4
>
>  /* NT_FREEBSD_FEATURE_CTL desc[0] bits */
> -#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> +#defineNT_FREEBSD_FCTL_ASLR_DISABLE0x0001
> +#defineNT_FREEBSD_FCTL_IMPLIED_MAX_PROT0x0002
>
>  /* Values for n_type.  Used in core files. */
>  #defineNT_PRSTATUS 1   /* Process status. */
> ___
> svn-src-h...@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-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: r332100 - in head: . lib/libc/gen sys/sys

2019-03-14 Thread Oliver Pinter
On Friday, April 6, 2018, Ed Schouten  wrote:

> Author: ed
> Date: Fri Apr  6 13:00:45 2018
> New Revision: 332100
> URL: https://svnweb.freebsd.org/changeset/base/332100
>
> Log:
>   Let syslog(3) use RFC 5424.
>
>   With r332099 changing syslogd(8) to parse RFC 5424 formatted syslog
>   messages, go ahead and also change the syslog(3) libc function to
>   generate them. Compared to RFC 3164, RFC 5424 has various advantages,
>   such as sub-second precision for log entry timestamps.
>
>   As this change could have adverse effects when not updating syslogd(8)
>   or using a different system logging daemon, add a notice to UPDATING and
>   increase __FreeBSD_version.
>
>   Differential Revision:https://reviews.freebsd.org/D14926


+= relnotes = yes


>
> Modified:
>   head/UPDATING
>   head/lib/libc/gen/syslog.3
>   head/lib/libc/gen/syslog.c
>   head/sys/sys/param.h
>
> Modified: head/UPDATING
> 
> ==
> --- head/UPDATING   Fri Apr  6 12:57:01 2018(r332099)
> +++ head/UPDATING   Fri Apr  6 13:00:45 2018(r332100)
> @@ -51,6 +51,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
>
>  ** SPECIAL WARNING:
> **
>
> +20180406:
> +   In addition to supporting RFC 3164 formatted messages, the
> +   syslogd(8) service is now capable of parsing RFC 5424 formatted
> +   log messages. The main benefit of using RFC 5424 is that clients
> +   may now send log messages with timestamps containing year numbers,
> +   microseconds and time zone offsets.
> +
> +   Similarly, the syslog(3) C library function has been altered to
> +   send RFC 5424 formatted messages to the local system logging
> +   daemon. On systems using syslogd(8), this change should have no
> +   negative impact, as long as syslogd(8) and the C library are
> +   updated at the same time. On systems using a different system
> +   logging daemon, it may be necessary to make configuration
> +   adjustments, depending on the software used.
> +
> +   When using syslog-ng, add the 'syslog-protocol' flag to local
> +   input sources to enable parsing of RFC 5424 formatted messages:
> +
> +   source src {
> +   unix-dgram("/var/run/log" flags(syslog-protocol));
> +   }
> +
> +   When using rsyslog, disable the 'SysSock.UseSpecialParser' option
> +   of the 'imuxsock' module to let messages be processed by the
> +   regular RFC 3164/5424 parsing pipeline:
> +
> +   module(load="imuxsock" SysSock.UseSpecialParser="off")
> +
> +   Do note that these changes only affect communication between local
> +   applications and syslogd(8). The format that syslogd(8) uses to
> +   store messages on disk or forward messages to other systems
> +   remains unchanged. syslogd(8) still uses RFC 3164 for these
> +   purposes. Options to customize this behaviour will be added in the
> +   future. Utilities that process log files stored in /var/log are
> +   thus expected to continue to function as before.
> +
> +   __FreeBSD_version has been incremented to 1200061 to denote this
> +   change.
> +
>  20180328:
> Support for token ring networks has been removed. If you
> have "device token" in your kernel config you should remove
>
> Modified: head/lib/libc/gen/syslog.3
> 
> ==
> --- head/lib/libc/gen/syslog.3  Fri Apr  6 12:57:01 2018(r332099)
> +++ head/lib/libc/gen/syslog.3  Fri Apr  6 13:00:45 2018(r332100)
> @@ -28,7 +28,7 @@
>  .\" @(#)syslog.3   8.1 (Berkeley) 6/4/93
>  .\" $FreeBSD$
>  .\"
> -.Dd November 5, 2017
> +.Dd April 6, 2018
>  .Dt SYSLOG 3
>  .Os
>  .Sh NAME
> @@ -156,6 +156,9 @@ Write the message to standard error output as well to
>  .It Dv LOG_PID
>  Log the process id with each message: useful for identifying
>  instantiations of daemons.
> +On
> +.Fx ,
> +this option is enabled by default.
>  .El
>  .Pp
>  The
>
> Modified: head/lib/libc/gen/syslog.c
> 
> ==
> --- head/lib/libc/gen/syslog.c  Fri Apr  6 12:57:01 2018(r332099)
> +++ head/lib/libc/gen/syslog.c  Fri Apr  6 13:00:45 2018(r332100)
> @@ -36,9 +36,10 @@ static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/
>  __FBSDID("$FreeBSD$");
>
>  #include "namespace.h"
> -#include 
> +#include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -134,11 +135,13 @@ syslog(int pri, const char *fmt, ...)
>  static void
>  vsyslog1(int pri, const char *fmt, va_list ap)
>  {
> -   int cnt;
> +   struct timeval now;
> +   struct tm tm;
> char ch, *p;
> -   time_t now;
> -   int fd, saved_errno;
> -   char *stdp, tbuf[2048], fmt_cp

Re: svn commit: r343416 - head/bin/sh

2019-01-25 Thread Oliver Pinter
On Friday, January 25, 2019, Alexey Dokuchaev  wrote:

> On Fri, Jan 25, 2019 at 06:02:58AM +, Edward Napierala wrote:
> > The aliases are gone, let's continue on the remaining bits below.
>
> They are not gone, they were commented out; also, bogus double linefeeds
> are not gone.  But most importantly, this whole file is useless and IMHO
> should just be removed.  /bin/sh is not supposed to be one's interactive
> shell.


False. Since the ability to install the system from pkg, and the ability to
remove the tcsh package easily, someone really want to or try to use sh as
their default interactive shell.

>From other hand there are no clear communication about the fact that the
/bin/sh isn't suitable for interactive in non-developer visible place -
like in motd or in official documentations, fix me if I'm wrong.


>
> > It is alien, because it's different from their experience
> > from other systems they are used to.
>
> This argument does not really hold because /bin/sh is not... see above.
>
> > It doesn't affect existing installs.  It doesn't affect people
> > who run the default root shell (tcsh), nor folks who use shells
>
> AFAICT default root shell is /bin/csh, not tcsh. ;-)  But that also
> means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who
> change the root shell should either pick another interactive shell,
> or if they want /bin/sh be ready to deal with sanitary environment.
>
> > And for folks who do have their own tree with their preferred
> > /root/.shrc to "make distribution" from, it should actually make
> > their diff to upstream smaller.
>
> I don't like extra files, esp. configuration files that look like they
> are for interactive shell while our /bin/sh is in fact not.  This is
> confusing, and FreeBSD is not supposed to be confusing.
>
> > It is a syntax problem:
> >
> > trasz@v2:~ % while :; do date; sleep 1; done
> > while: Expression Syntax.
> > do: Command not found.
> > done: Command not found.
>
> Are you trying to use sh(1) loop in (t)csh?  Why?  And what does it have
> to do with the /usr/src/bin/sh/dot.shrc issue?
>
> ./danfe
> ___
> svn-src-h...@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-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: r343111 - in head: cddl/lib/libdtrace contrib/libc++/include contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/lib

2019-01-16 Thread Oliver Pinter
On Thursday, January 17, 2019, Kirk McKusick  wrote:

> Author: mckusick
> Date: Thu Jan 17 06:35:45 2019
> New Revision: 343111
> URL: https://svnweb.freebsd.org/changeset/base/343111
>
> Log:
>   Create new EINTEGRITY error with message "Integrity check failed".
>
>   An integrity check such as a check-hash or a cross-correlation failed.
>   The integrity error falls between EINVAL that identifies errors in
>   parameters to a system call and EIO that identifies errors with the
>   underlying storage media. EINTEGRITY is typically raised by intermediate
>   kernel layers such as a filesystem or an in-kernel GEOM subsystem when
>   they detect inconsistencies. Uses include allowing the mount(8) command
>   to return a different exit value to automate the running of fsck(8)
>   during a system boot.
>
>   These changes make no use of the new error, they just add it. Later
>   commits will be made for the use of the new error number and it will
>   be added to additional manual pages as appropriate.
>
>   Reviewed by:gnn, dim, brueffer, imp
>   Discussed with: kib, cem, emaste, ed, jilles
>   Differential Revision: https://reviews.freebsd.org/D18765
>
> Modified:
>   head/cddl/lib/libdtrace/errno.d
>   head/contrib/libc++/include/__errc
>   head/contrib/libc++/include/errno.h
>   head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po
>   head/contrib/libxo/tests/gettext/strerror.pot
>   head/contrib/openbsm/libbsm/bsm_errno.c
>   head/contrib/openbsm/sys/bsm/audit_errno.h
>   head/lib/libc/gen/errlst.c
>   head/lib/libc/nls/C.msg
>   head/lib/libc/sys/intro.2
>   head/stand/liblua/lerrno.c
>   head/sys/bsm/audit_errno.h
>   head/sys/compat/cloudabi/cloudabi_errno.c
>   head/sys/compat/linux/linux_errno.inc
>   head/sys/security/audit/bsm_errno.c
>   head/sys/sys/errno.h
>
> Modified: head/cddl/lib/libdtrace/errno.d
> 
> ==
> --- head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:34:39 2019
> (r343110)
> +++ head/cddl/lib/libdtrace/errno.d Thu Jan 17 06:35:45 2019
> (r343111)
> @@ -225,7 +225,9 @@ inline int ENOTRECOVERABLE = 95;
>  #pragma D binding "1.13" ENOTRECOVERABLE
>  inline int EOWNERDEAD = 96;
>  #pragma D binding "1.13" EOWNERDEAD
> -inline int ELAST = 96;
> +inline int EINTEGRITY = 96;
> +#pragma D binding "1.13" EINTEGRITY
> +inline int ELAST = 97;
>  #pragma D binding "1.0" ELAST
>  inline int ERESTART = -1;
>  #pragma D binding "1.0" ERESTART
> @@ -340,6 +342,7 @@ inline string strerror[int errno] =
> errno == ECAPMODE ? "Not permitted in capability mode"
> :
> errno == ENOTRECOVERABLE ?  "State not recoverable" :
> errno == EOWNERDEAD ?   "Previous owner died" :
> +   errno == EINTEGRITY ?   "Integrity check failed" :
> errno == ERESTART ? "restart syscall" :
> errno == EJUSTRETURN ?  "don't modify regs, just return" :
> errno == ENOIOCTL ? "ioctl not handled by this layer" :
>
> Modified: head/contrib/libc++/include/__errc
> 
> ==
> --- head/contrib/libc++/include/__errc  Thu Jan 17 06:34:39 2019
> (r343110)
> +++ head/contrib/libc++/include/__errc  Thu Jan 17 06:35:45 2019
> (r343111)
> @@ -46,6 +46,7 @@ enum class errc
>  identifier_removed, // EIDRM
>  illegal_byte_sequence,  // EILSEQ
>  inappropriate_io_control_operation, // ENOTTY
> +integrity_check_failed, // EINTEGRITY
>  interrupted,// EINTR
>  invalid_argument,   // EINVAL
>  invalid_seek,   // ESPIPE
> @@ -143,6 +144,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc)
>  identifier_removed  = EIDRM,
>  illegal_byte_sequence   = EILSEQ,
>  inappropriate_io_control_operation  = ENOTTY,
> +integrity_check_failed  = EINTEGRITY,
>  interrupted = EINTR,
>  invalid_argument= EINVAL,
>  invalid_seek= ESPIPE,
>
> Modified: head/contrib/libc++/include/errno.h
> 
> ==
> --- head/contrib/libc++/include/errno.h Thu Jan 17 06:34:39 2019
> (r343110)
> +++ head/contrib/libc++/include/errno.h Thu Jan 17 06:35:45 2019
> (r343111)
> @@ -33,49 +33,72 @@ Macros:
>
>  #ifdef __cplusplus
>
> -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
> +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) ||
> !defined(EINTEGRITY)
>
>  #ifdef ELAST
>
>  static const int __elast1 = ELAST+1;
>  static const int __elast2 = ELAST+2;
> +static const int __elast2 = ELAST+3;


I think this should be __elast3


>
>  #else
>
>  static const int __elast1 = 104;
>  static const int __elast2 = 105;
> +static const int __elast2 = 106;


And here too


>
>  #endif
>
> -#ifdef E

Re: svn commit: r341759 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_

2018-12-09 Thread Oliver Pinter
On Sunday, December 9, 2018, Warner Losh  wrote:

> On Sun, Dec 9, 2018 at 1:09 PM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
>
> > > In message <201812090645.wb96jnso066...@repo.freebsd.org>, Cy Schubert
> > > writes:
> > > > Author: cy
> > > > Date: Sun Dec  9 06:45:49 2018
> > > > New Revision: 341759
> > > > URL: https://svnweb.freebsd.org/changeset/base/341759
> > > >
> > > > Log:
> > > >   MFV r341618:
> > > >
> > > >   Update wpa 2.6 --> 2.7.
> > >
> > > Relnotes: yes
> >
> > As an FYI, or maybe a new procedure, doing a reply to
> > a commit message adding relnotes: yes does very little
> > to insure that this commit gets refered to in release
> > notes.
> >
> > What about we add RELNOTES.missed to the tree
> > next to UPDATING, and when someone forgets to tag
> > the Relnotes:yes into a commit you just follow up
> > with a commit to that file, stating the svn revision
> > which was missing the note and then we have a nice
> > documented and clean way to extract the missing
> > release note items, rather than trying to cull it
> > from a thread in a mail list archive.
> >
> > The file would get truncated to 0 at appropriate
> > times on various branches.
> >
>
> How about just RELNOTES. You put the revision that is relevant and a quick
> blurb. That way we don't have to look in two places. All release notes go
> in here, no exceptions. You can retroactively tag them, or you can commit
> this as part of commit.


>
I don't really know SVN, but there wouldn't be a chicken egg probem during
commit time? I mean you would really know the SVN id. So you could only add
a specific revision in a different commit to RELEASE file.


>
> Have a blurb at the top that tells people what
> order to add them in, and you'd be set. We'd then retire "relnotes: yes" in
> the commit message. This would also allow 'helpers' to format the RELNOTES
> file as we go rather than having to play 2 years of catch-up at major
> branch times.
>
> Having it in the commit message just doesn't work, and this is one of many
> reasons: Cy forgot. Other times I'll do something and it's only a month
> later I realize it needs to be in the release notes after some issue has
> come up Other times I put relnotes: yes in only to realize that's my
> vanity talking, and nobody else cares.
>
> Warner
> ___
> svn-src-h...@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-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: r341446 - head/release/amd64

2018-12-04 Thread Oliver Pinter
On Tuesday, December 4, 2018, Yuri Pankov  wrote:

> Oliver Pinter wrote:
> >
> >
> > On Monday, December 3, 2018, Yuri Pankov  > <mailto:yur...@freebsd.org>> wrote:
> >
> > Author: yuripv
> > Date: Mon Dec  3 22:31:57 2018
> > New Revision: 341446
> > URL: https://svnweb.freebsd.org/changeset/base/341446
> > <https://svnweb.freebsd.org/changeset/base/341446>
> >
> > Log:
> >   mkisoimages.sh: don't use -p flag when copying loader.efi to
> msdosfs.
> >
> >   This fixes 'cdrom' target in the case when world was built by user,
> >   and not root.
> >
> >   Reviewed by:  imp
> >   Differential revision:https://reviews.freebsd.org/D18414
> > <https://reviews.freebsd.org/D18414>
> >
> >
> > This was a known issue
> > : https://lists.freebsd.org/pipermail/svn-src-head/2018-
> November/119689.html
>
> Sorry, I missed that.



No problem. Ed was directly CCd and notified on IRC.


>
> Looking at the HBSD change, does chmod step have any significance?



 It just ensures the correct file permissions.


> > Modified:
> >   head/release/amd64/mkisoimages.sh
> >
> > Modified: head/release/amd64/mkisoimages.sh
> > 
> ==
> > --- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018
> > (r341445)
> > +++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018
> > (r341446)
> > @@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
> > mkdir efi
> > mount -t msdosfs /dev/$device efi
> > mkdir -p efi/efi/boot
> > -   cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> > +   cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> > umount efi
> > rmdir efi
> > mdconfig -d -u $device
> > ___
> > svn-src-h...@freebsd.org <mailto:svn-src-h...@freebsd.org> mailing
> list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > <https://lists.freebsd.org/mailman/listinfo/svn-src-head>
> > To unsubscribe, send any mail to
> > "svn-src-head-unsubscr...@freebsd.org
> > <mailto:svn-src-head-unsubscr...@freebsd.org>"
> >
>
>
>
___
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: r341446 - head/release/amd64

2018-12-03 Thread Oliver Pinter
On Monday, December 3, 2018, Yuri Pankov  wrote:

> Author: yuripv
> Date: Mon Dec  3 22:31:57 2018
> New Revision: 341446
> URL: https://svnweb.freebsd.org/changeset/base/341446
>
> Log:
>   mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
>
>   This fixes 'cdrom' target in the case when world was built by user,
>   and not root.
>
>   Reviewed by:  imp
>   Differential revision:https://reviews.freebsd.org/D18414
>
>
This was a known issue :
https://lists.freebsd.org/pipermail/svn-src-head/2018-November/119689.html


> Modified:
>   head/release/amd64/mkisoimages.sh
>
> Modified: head/release/amd64/mkisoimages.sh
> 
> ==
> --- head/release/amd64/mkisoimages.sh   Mon Dec  3 22:09:23 2018
> (r341445)
> +++ head/release/amd64/mkisoimages.sh   Mon Dec  3 22:31:57 2018
> (r341446)
> @@ -49,7 +49,7 @@ if [ "$1" = "-b" ]; then
> mkdir efi
> mount -t msdosfs /dev/$device efi
> mkdir -p efi/efi/boot
> -   cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> +   cp "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi
> umount efi
> rmdir efi
> mdconfig -d -u $device
> ___
> svn-src-h...@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-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: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm

2018-11-20 Thread Oliver Pinter
On Tuesday, November 20, 2018, Ben Widawsky  wrote:

> Author: bwidawsk
> Date: Tue Nov 20 22:49:19 2018
> New Revision: 340709
> URL: https://svnweb.freebsd.org/changeset/base/340709
>
> Log:
>   linuxkpi: Add some basic swap functions
>
>   These are used by kms-drm to determine various heuristics relate
>   memory conditions.
>
>   The number of free swap pages is just a variable, and it can be
>   much cheaper by either adding a new getter, or simply extern'ing
>   swap_total. However, this patch opts to use the more expensive,
>   existing interface - since this isn't an operation in a high per
>   path.
>
>   This allows us to remove some more gpl linuxkpi and do the follo
>   kms-drm:
>   git rm linuxkpi/gplv2/include/linux/swap.h
>
>   Reviewed by:mmacy, Johannes Lundberg 
>   Approved by:emaste (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D18052
>
> Added:
>   head/sys/compat/linuxkpi/common/include/linux/swap.h   (contents, props
> changed)
> Modified:
>   head/sys/vm/vm_pageout.h
>   head/sys/vm/vm_swapout.c
>
> Added: head/sys/compat/linuxkpi/common/include/linux/swap.h
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/compat/linuxkpi/common/include/linux/swap.hTue Nov
> 20 22:49:19 2018(r340709)
> @@ -0,0 +1,102 @@
> +/*-
> + * Copyright (c) 2018 Intel Corporation
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions are
> + * met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in
> + *the documentation and/or other materials provided with the
> + *distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
> WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + *
> + * $FreeBSD$
> + */
> +
> +#ifndef_LINUX_SWAP_H_
> +#define_LINUX_SWAP_H_
> +
> +#include 
> +#include 
> +
> +static inline long
> +get_nr_swap_pages(void)
> +{
> +   int i, j;
> +
> +   /* NB: This could be done cheaply by obtaining swap_total directly
> */
> +   swap_pager_status(&i, &j);
> +   return i - j;
> +}
> +
> +static inline int
> +current_is_kswapd(void)
> +{
> +   return vm_curproc_is_vmproc();
> +}
> +
> +#endif


Probably I'm wrong, but this file contains twice the same intended content.


> +/*-
> + * Copyright (c) 2018 Intel Corporation
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions are
> + * met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in
> + *the documentation and/or other materials provided with the
> + *distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
> WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + *
> + * $FreeBSD$
> + */
> +
> +#ifndef_LINUX_SWAP_H_
> +#define_LINUX_SWAP_H_
> +
> +#include 
> +#include 
> +
> +static inline long
> +get_nr_swap_pages(void)
> +{
> +   

Re: svn commit: r339609 - in head/release: amd64 i386 powerpc sparc64

2018-11-07 Thread Oliver Pinter
This fixes a build for us:
https://github.com/HardenedBSD/hardenedBSD/commit/c1a6f17c2a62ca9d1d0f4d788d8d832e9e909b6b

On Sunday, November 4, 2018, Oliver Pinter 
wrote:

> On 10/22/18, Ed Maste  wrote:
> > Author: emaste
> > Date: Mon Oct 22 19:39:20 2018
> > New Revision: 339609
> > URL: https://svnweb.freebsd.org/changeset/base/339609
> >
> > Log:
> >   release: set -e to exit on error in iso image scripts
> >
> >   Reviewed by:gjb
> >   Differential Revision:  https://reviews.freebsd.org/D17651
> >
> > Modified:
> >   head/release/amd64/mkisoimages.sh
> >   head/release/i386/mkisoimages.sh
> >   head/release/powerpc/mkisoimages.sh
> >   head/release/sparc64/mkisoimages.sh
> >
> > Modified: head/release/amd64/mkisoimages.sh
>
> This commit catches an warning / error in cd generation for amd64,
> with this error:
>
> >>> Installing everything completed on Mon Oct 22 18:07:00 UTC 2018
> --
> 1+0 records in
> 1+0 records out
> 4096 bytes transferred in 0.000197 secs (20757002 bytes/sec)
> 200+0 records in
> 200+0 records out
> 819200 bytes transferred in 0.020971 secs (39064121 bytes/sec)
> newfs_msdos: cannot get number of sectors per track: Operation not
> supported
> newfs_msdos: cannot get number of heads: Operation not supported
> newfs_msdos: trim 25 sectors to adjust to a multiple of 63
> /dev/md0: 1532 sectors in 1532 FAT12 clusters (512 bytes/cluster)
> BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512
> Sectors=1575 Media=0xf8 FATsecs=5 SecPerTrack=63 Heads=1 HiddenSecs=0
> cp: chown: efi/efi/boot/bootx64.efi: Invalid argument
> 1+0 records in
> 1+0 records out
>
> The last working cd generation was before this commit:
> https://jenkins.hardenedbsd.org/jenkins/job/HardenedBSD-
> CURRENT-amd64/1361/console
>
> And after this commit it breaks on the above line:
> https://jenkins.hardenedbsd.org/jenkins/job/HardenedBSD-CURRENT-amd64/
>
> in ${SRCTOP}/release/amd64/mkisoimages.sh the -p option can't work
> when you copy to a FAT FS, so the easiest fix would be to remove the
> -p option from cp's line.
> Other problem with a script after the set -e changes, that if
> something fails, no one cleans up the created md devices.
>
>
> > 
> ==
> > --- head/release/amd64/mkisoimages.sh Mon Oct 22 18:41:22 2018
> (r339608)
> > +++ head/release/amd64/mkisoimages.sh Mon Oct 22 19:39:20 2018
> (r339609)
> > @@ -23,6 +23,8 @@
> >  # extra-bits-dir, if provided, contains additional files to be merged
> >  # into base-bits-dir as part of making the image.
> >
> > +set -e
> > +
> >  if [ -z $ETDUMP ]; then
> >   ETDUMP=etdump
> >  fi
> >
> > Modified: head/release/i386/mkisoimages.sh
> > 
> ==
> > --- head/release/i386/mkisoimages.sh  Mon Oct 22 18:41:22 2018
> (r339608)
> > +++ head/release/i386/mkisoimages.sh  Mon Oct 22 19:39:20 2018
> (r339609)
> > @@ -23,6 +23,8 @@
> >  # extra-bits-dir, if provided, contains additional files to be merged
> >  # into base-bits-dir as part of making the image.
> >
> > +set -e
> > +
> >  if [ "$1" = "-b" ]; then
> >   # This is highly x86-centric and will be used directly below.
> >   bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"
> >
> > Modified: head/release/powerpc/mkisoimages.sh
> > 
> ==
> > --- head/release/powerpc/mkisoimages.sh   Mon Oct 22 18:41:22 2018
>   (r339608)
> > +++ head/release/powerpc/mkisoimages.sh   Mon Oct 22 19:39:20 2018
>   (r339609)
> > @@ -23,6 +23,7 @@
> >  # extra-bits-dir, if provided, contains additional files to be merged
> >  # into base-bits-dir as part of making the image.
> >
> > +set -e
> >
> >  if [ "$1" = "-b" ]; then
> >   bootable=1
> >
> > Modified: head/release/sparc64/mkisoimages.sh
> > 
> ==
> > --- head/release/sparc64/mkisoimages.sh   Mon Oct 22 18:41:22 2018
>   (r339608)
> > +++ head/release/sparc64/mkisoimages.sh   Mon Oct 22 19:39:20 2018
>   (r339609)
> > @@ -22,6 +22,8 @@
> >  # resulting ISO image, base-bits-dir contains the image contents and
> >  # extra-bits-dir, if provide

Re: svn commit: r339609 - in head/release: amd64 i386 powerpc sparc64

2018-11-04 Thread Oliver Pinter
On 10/22/18, Ed Maste  wrote:
> Author: emaste
> Date: Mon Oct 22 19:39:20 2018
> New Revision: 339609
> URL: https://svnweb.freebsd.org/changeset/base/339609
>
> Log:
>   release: set -e to exit on error in iso image scripts
>
>   Reviewed by:gjb
>   Differential Revision:  https://reviews.freebsd.org/D17651
>
> Modified:
>   head/release/amd64/mkisoimages.sh
>   head/release/i386/mkisoimages.sh
>   head/release/powerpc/mkisoimages.sh
>   head/release/sparc64/mkisoimages.sh
>
> Modified: head/release/amd64/mkisoimages.sh

This commit catches an warning / error in cd generation for amd64,
with this error:

>>> Installing everything completed on Mon Oct 22 18:07:00 UTC 2018
--
1+0 records in
1+0 records out
4096 bytes transferred in 0.000197 secs (20757002 bytes/sec)
200+0 records in
200+0 records out
819200 bytes transferred in 0.020971 secs (39064121 bytes/sec)
newfs_msdos: cannot get number of sectors per track: Operation not supported
newfs_msdos: cannot get number of heads: Operation not supported
newfs_msdos: trim 25 sectors to adjust to a multiple of 63
/dev/md0: 1532 sectors in 1532 FAT12 clusters (512 bytes/cluster)
BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512
Sectors=1575 Media=0xf8 FATsecs=5 SecPerTrack=63 Heads=1 HiddenSecs=0
cp: chown: efi/efi/boot/bootx64.efi: Invalid argument
1+0 records in
1+0 records out

The last working cd generation was before this commit:
https://jenkins.hardenedbsd.org/jenkins/job/HardenedBSD-CURRENT-amd64/1361/console

And after this commit it breaks on the above line:
https://jenkins.hardenedbsd.org/jenkins/job/HardenedBSD-CURRENT-amd64/

in ${SRCTOP}/release/amd64/mkisoimages.sh the -p option can't work
when you copy to a FAT FS, so the easiest fix would be to remove the
-p option from cp's line.
Other problem with a script after the set -e changes, that if
something fails, no one cleans up the created md devices.


> ==
> --- head/release/amd64/mkisoimages.sh Mon Oct 22 18:41:22 2018
> (r339608)
> +++ head/release/amd64/mkisoimages.sh Mon Oct 22 19:39:20 2018
> (r339609)
> @@ -23,6 +23,8 @@
>  # extra-bits-dir, if provided, contains additional files to be merged
>  # into base-bits-dir as part of making the image.
>
> +set -e
> +
>  if [ -z $ETDUMP ]; then
>   ETDUMP=etdump
>  fi
>
> Modified: head/release/i386/mkisoimages.sh
> ==
> --- head/release/i386/mkisoimages.sh  Mon Oct 22 18:41:22 2018
> (r339608)
> +++ head/release/i386/mkisoimages.sh  Mon Oct 22 19:39:20 2018
> (r339609)
> @@ -23,6 +23,8 @@
>  # extra-bits-dir, if provided, contains additional files to be merged
>  # into base-bits-dir as part of making the image.
>
> +set -e
> +
>  if [ "$1" = "-b" ]; then
>   # This is highly x86-centric and will be used directly below.
>   bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"
>
> Modified: head/release/powerpc/mkisoimages.sh
> ==
> --- head/release/powerpc/mkisoimages.sh   Mon Oct 22 18:41:22 2018
> (r339608)
> +++ head/release/powerpc/mkisoimages.sh   Mon Oct 22 19:39:20 2018
> (r339609)
> @@ -23,6 +23,7 @@
>  # extra-bits-dir, if provided, contains additional files to be merged
>  # into base-bits-dir as part of making the image.
>
> +set -e
>
>  if [ "$1" = "-b" ]; then
>   bootable=1
>
> Modified: head/release/sparc64/mkisoimages.sh
> ==
> --- head/release/sparc64/mkisoimages.sh   Mon Oct 22 18:41:22 2018
> (r339608)
> +++ head/release/sparc64/mkisoimages.sh   Mon Oct 22 19:39:20 2018
> (r339609)
> @@ -22,6 +22,8 @@
>  # resulting ISO image, base-bits-dir contains the image contents and
>  # extra-bits-dir, if provided, contains additional files to be merged
>  # into base-bits-dir as part of making the image.
> +set -e
> +
>  if [ $# -lt 3 ]; then
>   echo "Usage: $0 [-b] image-label image-name base-bits-dir
> [extra-bits-dir]" > /dev/stderr
>   exit 1
> ___
> svn-src-h...@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-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: r339971 - in head: libexec/rc share/man/man5 share/man/man8

2018-11-01 Thread Oliver Pinter
On Wednesday, October 31, 2018, Devin Teske  wrote:

> Author: dteske
> Date: Wed Oct 31 20:37:12 2018
> New Revision: 339971
> URL: https://svnweb.freebsd.org/changeset/base/339971
>
> Log:
>   Add new rc keywords: enable, disable, delete
>
>   This adds new keywords to rc/service to enable/disable a service's
>   rc.conf(5) variable and "delete" to remove the variable.
>
>   When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
>   (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
>   deleted if empty after modification using "service $foo delete".
>
>   Submitted by: lme (modified)
>   Reviewed by:  0mp (previous version), lme, bcr
>   Relnotes: yes
>   Sponsored by: Smule, Inc.
>   Differential Revision:https://reviews.freebsd.org/D17113



Hi!

Really nice. Do you plan to MFC this commit to stable branches?


>
> Modified:
>   head/libexec/rc/rc.conf
>   head/libexec/rc/rc.subr
>   head/share/man/man5/rc.conf.5
>   head/share/man/man8/rc.8
>
> Modified: head/libexec/rc/rc.conf
> 
> ==
> --- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018(r339970)
> +++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018(r339971)
> @@ -617,6 +617,7 @@ savecore_enable="YES"   # Extract core from dump
> devices
>  savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
> # By default, only the 10 most recent kernel dumps
> # are saved.
> +service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d
> files.
>  crashinfo_enable="YES" # Automatically generate crash dump summary.
>  crashinfo_program="/usr/sbin/crashinfo"# Script to generate
> crash dump summary.
>  quota_enable="NO"  # turn on quotas on startup (or NO).
>
> Modified: head/libexec/rc/rc.subr
> 
> ==
> --- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018(r339970)
> +++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018(r339971)
> @@ -922,7 +922,7 @@ run_rc_command()
> eval _override_command=\$${name}_program
> command=${_override_command:-$command}
>
> -   _keywords="start stop restart rcvar enabled describe extracommands
> $extra_commands"
> +   _keywords="start stop restart rcvar enable disable delete enabled
> describe extracommands $extra_commands"
> rc_pid=
> _pidcmd=
> _procname=${procname:-${command}}
> @@ -977,12 +977,13 @@ run_rc_command()
> if [ "$_elem" != "$rc_arg" ]; then
> continue
> fi
> -   # if ${rcvar} is set, $1 is not
> "rcvar" and not "describe"
> -   # and ${rc_pid} is not set, then
> run
> +   # if ${rcvar} is set, $1 is not
> "rcvar", "describe",
> +   # "enable" or "delete", and
> ${rc_pid} is not set, run:
> #   checkyesno ${rcvar}
> # and return if that failed
> #
> if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" !=
> "stop" \
> +   -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \
> -a "$rc_arg" != "describe" ] ||
> [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z
> "${rc_pid}" ]; then
> if ! checkyesno ${rcvar}; then
> @@ -1028,6 +1029,31 @@ run_rc_command()
>
> extracommands)
> echo "$extra_commands"
> +   ;;
> +
> +   enable)
> +   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") &&
> +   echo "$name enabled in ${_out%%:*}"
> +   ;;
> +
> +   disable)
> +   _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") &&
> +   echo "$name disabled in ${_out%%:*}"
> +   ;;
> +
> +   delete)
> +   _files=
> +   for _file in $(sysrc -lEs "$name"); do
> +   _out=$(sysrc -Fif $_file "$rcvar") &&
> _files="$_files $_file"
> +   done
> +   /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar
> deleted in ${_files# }"
> +   # delete file in rc.conf.d if desired and
> empty.
> +   checkyesno service_delete_empty || _files=
> +   for _file in $_files; do
> +   [ "$_file" = "${_file#*/rc.conf.d/}" ] &&
> continue
> +   [ $(/usr/bin/stat -f%z $_file) -gt 0 ] &&
> continue
> +   /bin/rm "

Re: svn commit: r339386 - in head/sys/amd64: amd64 include

2018-10-16 Thread Oliver Pinter
On 10/16/18, Konstantin Belousov  wrote:
> Author: kib
> Date: Tue Oct 16 17:28:10 2018
> New Revision: 339386
> URL: https://svnweb.freebsd.org/changeset/base/339386
>
> Log:
>   Provide pmap_large_map() KPI on amd64.
>
>   The KPI allows to map very large contigous physical memory regions
>   into KVA, which are not covered by DMAP.
>
>   I see both with QEMU and with some real hardware started shipping, the
>   regions for NVDIMMs might be very far apart from the normal RAM, and
>   we expect that at least initial users of NVDIMM could install very
>   large amount of such memory.  IMO it is not reasonable to extend DMAP
>   to cover that far-away regions both because it could overflow existing
>   4T window for DMAP in KVA, and because it costs in page table pages
>   allocations, for gap and for possibly unused NV RAM.
>
>   Also, KPI provides some special functionality for fast cache flushing
>   based on the knowledge of the NVRAM mapping use.
>
>   Reviewed by:alc, markj
>   Sponsored by:   The FreeBSD Foundation
>   Approved by:re (gjb)
>   MFC after:  1 week
>   Differential revision:  https://reviews.freebsd.org/D17070
>
> Modified:
>   head/sys/amd64/amd64/pmap.c
>   head/sys/amd64/include/pmap.h
>   head/sys/amd64/include/vmparam.h
>
> Modified: head/sys/amd64/amd64/pmap.c
> ==
> --- head/sys/amd64/amd64/pmap.c   Tue Oct 16 17:17:11 2018
> (r339385)
> +++ head/sys/amd64/amd64/pmap.c   Tue Oct 16 17:28:10 2018
> (r339386)
> @@ -409,6 +409,9 @@ static struct mtx qframe_mtx;
>
>  static int pmap_flags = PMAP_PDE_SUPERPAGE;  /* flags for x86 pmaps */
>
> +static vmem_t *large_vmem;
> +static u_int lm_ents;
> +
>  int pmap_pcid_enabled = 1;
>  SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN |
> CTLFLAG_NOFETCH,
>  &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?");
> @@ -655,6 +658,7 @@ static void pmap_invalidate_cache_range_all(vm_offset_
>  static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va,
>   pd_entry_t pde);
>  static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
> +static vm_page_t pmap_large_map_getptp_unlocked(void);
>  static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask);
>  #if VM_NRESERVLEVEL > 0
>  static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va,
> @@ -1313,7 +1317,7 @@ void
>  pmap_init(void)
>  {
>   struct pmap_preinit_mapping *ppim;
> - vm_page_t mpte;
> + vm_page_t m, mpte;
>   vm_size_t s;
>   int error, i, pv_npg, ret, skz63;
>
> @@ -1440,6 +1444,28 @@ pmap_init(void)
>   (vmem_addr_t *)&qframe);
>   if (error != 0)
>   panic("qframe allocation failed");
> +
> + lm_ents = 8;
> + TUNABLE_INT_FETCH("vm.pmap.large_map_pml4_entries", &lm_ents);
> + if (lm_ents > LMEPML4I - LMSPML4I + 1)
> + lm_ents = LMEPML4I - LMSPML4I + 1;
> + if (bootverbose)
> + printf("pmap: large map %u PML4 slots (%lu Gb)\n",

Isn't this GB (GigaByte instead of Gigabit?)

> + lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024));
> + if (lm_ents != 0) {
> + large_vmem = vmem_create("large", LARGEMAP_MIN_ADDRESS,
> + (vmem_size_t)lm_ents * NBPML4, PAGE_SIZE, 0, M_WAITOK);
> + if (large_vmem == NULL) {
> + printf("pmap: cannot create large map\n");
> + lm_ents = 0;
> + }
> + for (i = 0; i < lm_ents; i++) {
> + m = pmap_large_map_getptp_unlocked();
> + kernel_pmap->pm_pml4[LMSPML4I + i] = X86_PG_V |
> + X86_PG_RW | X86_PG_A | X86_PG_M | pg_nx |
> + VM_PAGE_TO_PHYS(m);
> + }
> + }
>  }
>
>  static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0,
> @@ -2315,14 +2341,6 @@ pmap_force_invalidate_cache_range(vm_offset_t sva,
> vm_
>  {
>
>   sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1);
> - if (eva - sva >= PMAP_CLFLUSH_THRESHOLD) {
> - /*
> -  * The supplied range is bigger than 2MB.
> -  * Globally invalidate cache.
> -  */
> - pmap_invalidate_cache();
> - return;
> - }
>
>   /*
>* XXX: Some CPUs fault, hang, or trash the local APIC
> @@ -2406,6 +2424,64 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int
> coun
>   }
>  }
>
> +void
> +pmap_flush_cache_range(vm_offset_t sva, vm_offset_t eva)
> +{
> +
> + pmap_invalidate_cache_range_check_align(sva, eva);
> +
> + if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) == 0) {
> + pmap_force_invalidate_cache_range(sva, eva);
> + return;
> + }
> +
> + /* See comment in pmap_force_invalidate_cache_range(). */
> + if (pmap_kextract(sva) == lapic_paddr)
> + return;
> +
> + sfence

Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20

2018-08-19 Thread Oliver Pinter
On 8/19/18, Xin LI  wrote:
> Author: delphij
> Date: Sun Aug 19 17:40:50 2018
> New Revision: 338059
> URL: https://svnweb.freebsd.org/changeset/base/338059
>
> Log:
>   Update userland arc4random() with OpenBSD's Chacha20 based arc4random().
>
> ObsoleteFiles.inc:
>
>   Remove manual pages for arc4random_addrandom(3) and
>   arc4random_stir(3).
>
> contrib/ntp/lib/isc/random.c:
> contrib/ntp/sntp/libevent/evutil_rand.c:
>
>   Eliminate in-tree usage of arc4random_addrandom().
>
> crypto/heimdal/lib/roken/rand.c:
> crypto/openssh/config.h:
>
>   Eliminate in-tree usage of arc4random_stir().
>
> include/stdlib.h:
>
>   Remove arc4random_stir() and arc4random_addrandom() prototypes,
>   provide temporary shims for transistion period.
>
> lib/libc/gen/Makefile.inc:
>
>   Hook arc4random-compat.c to build, add hint for Chacha20 source for
>   kernel, and remove arc4random_addrandom(3) and arc4random_stir(3)
>   links.
>
> lib/libc/gen/arc4random.c:
>
>   Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the
>   sys/crypto/chacha20 implementation of keystream.
>
> lib/libc/gen/Symbol.map:
>
>   Remove arc4random_stir and arc4random_addrandom interfaces.
>
> lib/libc/gen/arc4random.h:
>
>   Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own.
>
> lib/libc/gen/arc4random.3:
>
>   Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r11 and
>   r118247.
>
> lib/libc/gen/arc4random-compat.c:
>
>   Compatibility shims for arc4random_stir and arc4random_addrandom
>   functions to preserve ABI.  Log once when called but do nothing
>   otherwise.
>
> lib/libc/gen/getentropy.c:
> lib/libc/include/libc_private.h:
>
>   Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl).
>   Remove from libc_private.h as a result.
>
> sys/crypto/chacha20/chacha.c:
> sys/crypto/chacha20/chacha.h:
>
>   Make it possible to use the kernel implementation in libc.
>
>   PR: 182610
>   Reviewed by:cem, markm
>   Obtained from:  OpenBSD
>   Relnotes:   yes
>   Differential Revision:  https://reviews.freebsd.org/D16760
>
> Added:
>   head/lib/libc/gen/arc4random-compat.c   (contents, props changed)
>   head/lib/libc/gen/arc4random.h   (contents, props changed)
> Modified:
>   head/ObsoleteFiles.inc
>   head/contrib/ntp/lib/isc/random.c
>   head/contrib/ntp/sntp/libevent/evutil_rand.c
>   head/crypto/heimdal/lib/roken/rand.c
>   head/crypto/openssh/config.h
>   head/include/stdlib.h
>   head/lib/libc/gen/Makefile.inc
>   head/lib/libc/gen/Symbol.map
>   head/lib/libc/gen/arc4random.3
>   head/lib/libc/gen/arc4random.c   (contents, props changed)
>   head/lib/libc/gen/getentropy.c
>   head/lib/libc/include/libc_private.h
>   head/sys/crypto/chacha20/chacha.c
>   head/sys/crypto/chacha20/chacha.h
>
> Modified: head/ObsoleteFiles.inc
> ==
> --- head/ObsoleteFiles.incSun Aug 19 17:36:50 2018(r338058)
> +++ head/ObsoleteFiles.incSun Aug 19 17:40:50 2018(r338059)
> @@ -38,6 +38,9 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>
> +# 20180819: Remove deprecated arc4random(3) stir/addrandom interfaces
> +OLD_FILES+=usr/share/man/man3/arc4random_addrandom.3.gz
> +OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz
>  # 20180819: send-pr(1) placeholder removal
>  OLD_FILES+=usr/bin/send-pr
>  # 20180725: Cleanup old libcasper.so.0
>
> Modified: head/contrib/ntp/lib/isc/random.c
> ==
> --- head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:36:50 2018
> (r338058)
> +++ head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:40:50 2018
> (r338059)
> @@ -67,8 +67,6 @@ isc_random_seed(isc_uint32_t seed)
>
>  #ifndef HAVE_ARC4RANDOM
>   srand(seed);
> -#else
> - arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t));
>  #endif
>  }
>
>
> Modified: head/contrib/ntp/sntp/libevent/evutil_rand.c
> ==
> --- head/contrib/ntp/sntp/libevent/evutil_rand.c  Sun Aug 19 17:36:50
> 2018  (r338058)
> +++ head/contrib/ntp/sntp/libevent/evutil_rand.c  Sun Aug 19 17:40:50
> 2018  (r338059)
> @@ -195,8 +195,6 @@ evutil_secure_rng_get_bytes(void *buf, size_t n)
>  void
>  evutil_secure_rng_add_bytes(const char *buf, size_t n)
>  {
> - arc4random_addrandom((unsigned char*)buf,
> - n>(size_t)INT_MAX ? INT_MAX : (int)n);
>  }
>
>  void
>
> Modified: head/crypto/heimdal/lib/roken/rand.c
> ==
> --- head/crypto/heimdal/lib/roken/rand.c  Sun Aug 19 17:36:50 2018
> (r338058)
> +++ head/crypto/heimdal/lib/roken/rand.c  Sun Aug 19 17:40:50 2018
> (r338059)
> @@ -37,7 +37,6 @@ void ROKEN_LIB_FUNCTI

Re: svn commit: r337849 - in head: bin/csh bin/sh etc etc/root

2018-08-15 Thread Oliver Pinter
On Wednesday, August 15, 2018, Brad Davis  wrote:

> Author: brd
> Date: Wed Aug 15 14:41:24 2018
> New Revision: 337849
> URL: https://svnweb.freebsd.org/changeset/base/337849
>
> Log:
>   Move all sh and csh files into bin/sh/ or bin/csh/
>
>   This simplifies pkgbase by migrating these to CONFS so they are properly
>   tagged as config files.
>
>   Approved by:  will (mentor)
>   Differential Revision:https://reviews.freebsd.org/D16708
>
> Added:
>   head/bin/csh/csh.cshrc
>  - copied unchanged from r337848, head/etc/csh.cshrc
>   head/bin/csh/csh.login
>  - copied unchanged from r337848, head/etc/csh.login
>   head/bin/csh/csh.logout
>  - copied unchanged from r337848, head/etc/csh.logout
>   head/bin/csh/dot.cshrc
>  - copied unchanged from r337848, head/etc/root/dot.cshrc
>   head/bin/csh/dot.login
>  - copied unchanged from r337848, head/etc/root/dot.login
>   head/bin/sh/dot.profile
>  - copied unchanged from r337848, head/etc/root/dot.profile
>   head/bin/sh/profile
>  - copied unchanged from r337848, head/etc/profile
> Deleted:
>   head/etc/csh.cshrc
>   head/etc/csh.login
>   head/etc/csh.logout
>   head/etc/profile
>   head/etc/root/dot.cshrc
>   head/etc/root/dot.login
>   head/etc/root/dot.profile
> Modified:
>   head/bin/csh/Makefile
>   head/bin/sh/Makefile
>   head/etc/Makefile
>
> Modified: head/bin/csh/Makefile
> 
> ==
> --- head/bin/csh/Makefile   Wed Aug 15 14:29:04 2018(r337848)
> +++ head/bin/csh/Makefile   Wed Aug 15 14:41:24 2018(r337849)
> @@ -8,6 +8,11 @@
>
>  .include 
>
> +CONFGROUPS=ETC ROOT
> +ETC=   csh.cshrc csh.login csh.logout
> +ROOT=  dot.cshrc
> +ROOTDIR=   /root
> +ROOTNAME=  .cshrc
>  PACKAGE=runtime
>  TCSHDIR= ${SRCTOP}/contrib/tcsh
>  .PATH: ${TCSHDIR}
> @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1
>
>  LIBADD=termcapw crypt
>
> -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
> +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \
> +   /root/.cshrc /.cshrc
>
>  CLEANFILES= ${GENHDRS} gethost csh.1
>
> @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s
> sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
> sort >> ${.TARGET}
> @echo '#endif /* _h_tc_const */' >> ${.TARGET}
> +
> +beforeinstall:
> +   rm -f ${DESTDIR}/.cshrc
> +
> +afterinstallconfig:
> +   sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd


Why? If afterinstallconfig called unconditionally after install, then why
changing all of the csh entries to sh?

The old behavior was almost the same, but only when WITHOUT_CSH was
specified.

Fixme if I'm wrong.


> +   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
>
>  .include 
>
> Copied: head/bin/csh/csh.cshrc (from r337848, head/etc/csh.cshrc)
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/bin/csh/csh.cshrc  Wed Aug 15 14:41:24 2018(r337849,
> copy of r337848, head/etc/csh.cshrc)
> @@ -0,0 +1,3 @@
> +# $FreeBSD$
> +#
> +# System-wide .cshrc file for csh(1).
>
> Copied: head/bin/csh/csh.login (from r337848, head/etc/csh.login)
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/bin/csh/csh.login  Wed Aug 15 14:41:24 2018(r337849,
> copy of r337848, head/etc/csh.login)
> @@ -0,0 +1,15 @@
> +# $FreeBSD$
> +#
> +# System-wide .login file for csh(1).
> +# Uncomment this to give you the default 4.2 behavior, where disk
> +# information is shown in K-Blocks
> +# setenv BLOCKSIZE K
> +#
> +# For the setting of languages and character sets please see
> +# login.conf(5) and in particular the charset and lang options.
> +# For full locales list check /usr/share/locale/*
> +#
> +# Check system messages
> +# msgs -q
> +# Allow terminal messages
> +# mesg y
>
> Copied: head/bin/csh/csh.logout (from r337848, head/etc/csh.logout)
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/bin/csh/csh.logout Wed Aug 15 14:41:24 2018(r337849,
> copy of r337848, head/etc/csh.logout)
> @@ -0,0 +1,3 @@
> +# $FreeBSD$
> +#
> +# System-wide .logout file for csh(1).
>
> Copied: head/bin/csh/dot.cshrc (from r337848, head/etc/root/dot.cshrc)
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/bin/csh/dot.cshrc  Wed Aug 15 14:41:24 2018(r337849,
> copy of r337848, head/etc/root/dot.cshrc)
> @@ -0,0 +1,43 @@
> +# $FreeBSD$
> +#
> +# .cshrc - csh resource script, read at beginning of execution by each
> shell
> +#
> +# see also csh(1), environ(7).
> +# 

Re: svn commit: r336876 - in head/sys: amd64/amd64 amd64/ia32 amd64/include conf dev/hyperv/vmbus/amd64

2018-07-29 Thread Oliver Pinter
On 7/30/18, Konstantin Belousov  wrote:
> Please trim useless content.
> Did I missed anything interesting in your mail ?
>
> On Sun, Jul 29, 2018 at 11:57:47PM +0200, Oliver Pinter wrote:
>> On 7/29/18, Konstantin Belousov  wrote:
>> > +ENTRY(copyin_smap)
>> > +  PUSH_FRAME_POINTER
>> > +  movqPCPU(CURPCB),%rax
>> > +  movq$copyin_fault,PCB_ONFAULT(%rax)
>> > +  testq   %rdx,%rdx   /* anything to do? */
>> > +  jz  done_copyin
>> > +
>> > +  /*
>> > +   * make sure address is valid
>> > +   */
>> > +  movq%rdi,%rax
>> > +  addq%rdx,%rax
>> > +  jc  copyin_fault
>> > +  movq$VM_MAXUSER_ADDRESS,%rcx
>> > +  cmpq%rcx,%rax
>> > +  ja  copyin_fault
>> > +
>> > +  xchgq   %rdi,%rsi
>> > +  movq%rdx,%rcx
>> > +  movb%cl,%al
>> > +  shrq$3,%rcx /* copy longword-wise */
>>
>> missing cld from here
> In fact not.  It is copyin_nosmap that got unneeded cld.
>
> See r327820, apparently I mis-merged this commit into the SMAP branch.
>
>>
>> > +  stac
>> > +  rep
>> > +  movsq
>> > +  movb%al,%cl
>> > +  andb$7,%cl  /* copy remaining bytes */
>> >je  done_copyin
>> >rep
>> >movsb
>> > +  clac
>
>> > +ENTRY(copyinstr_smap)
>> > +  PUSH_FRAME_POINTER
>> > +  movq%rdx,%r8/* %r8 = maxlen */
>> > +  movq%rcx,%r9/* %r9 = *len */
>> > +  xchgq   %rdi,%rsi   /* %rdi = from, %rsi = to */
>> > +  movqPCPU(CURPCB),%rcx
>> > +  movq$cpystrflt,PCB_ONFAULT(%rcx)
>> > +
>> > +  movq$VM_MAXUSER_ADDRESS,%rax
>> > +
>> > +  /* make sure 'from' is within bounds */
>> > +  subq%rsi,%rax
>> > +  jbe cpystrflt
>> > +
>> > +  /* restrict maxlen to <= VM_MAXUSER_ADDRESS-from */
>> > +  cmpq%rdx,%rax
>> > +  jae 1f
>> > +  movq%rax,%rdx
>> > +  movq%rax,%r8
>> > +1:
>> > +  incq%rdx
>>
>> missing cld here
> Same.
>
>>
>> > +
>> > +2:
>> > +  decq%rdx
>> > +  jz  copyinstr_succ
>>
>
>> cpystrflt_x:
>> /* set *lencopied and return %eax */
>> movqPCPU(CURPCB),%rcx
>> movq$0,PCB_ONFAULT(%rcx)
>>
>> testq   %r9,%r9
>> jz  1f
>> subq%rdx,%r8
>> movq%r8,(%r9) << Here you access user-space, with cleared
>> RFLAGS.AC from the fault handler.
> How does this instruction access userspace ?  I do not see.

As far as I remember from 4 years, the r9 may contained a user-space
address in 10-STABLE
in the case of starting the init. I've a stac/clac pair in my internal
version, but I haven't found
yet the relevant commit message.

 For a quick grep around - http://ix.io/1fje - I haven't found yet
this place, so it's looks good in your version.

>
>> 1:
>> POP_FRAME_POINTER
>> ret
>
> So the patch below removes unneeded (mismerged) cld's left in the
> support.S.
>
> diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
> index 9b8b2a40461..0aa307e6895 100644
> --- a/sys/amd64/amd64/support.S
> +++ b/sys/amd64/amd64/support.S
> @@ -307,7 +307,6 @@ ENTRY(copyout_smap)
>   movq%rdx,%rcx
>
>   shrq$3,%rcx
> - cld
>   stac
>   rep
>   movsq
> @@ -358,7 +357,6 @@ ENTRY(copyin_nosmap)
>   movq%rdx,%rcx
>   movb%cl,%al
>   shrq$3,%rcx /* copy longword-wise */
> - cld
>   rep
>   movsq
>   movb%al,%cl
> @@ -887,7 +885,6 @@ ENTRY(copyinstr_nosmap)
>   movq%rax,%r8
>  1:
>   incq%rdx
> - cld
>
>  2:
>   decq%rdx

Looks fine to me.
>
___
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: r336876 - in head/sys: amd64/amd64 amd64/ia32 amd64/include conf dev/hyperv/vmbus/amd64

2018-07-29 Thread Oliver Pinter
On 7/29/18, Konstantin Belousov  wrote:
> Author: kib
> Date: Sun Jul 29 20:47:00 2018
> New Revision: 336876
> URL: https://svnweb.freebsd.org/changeset/base/336876
>
> Log:
>   Use SMAP on amd64.
>
>   Ifuncs selectors dispatch copyin(9) family to the suitable variant, to
>   set rflags.AC around userspace access.  Rflags.AC bit is cleared in
>   all kernel entry points unconditionally even on machines not
>   supporting SMAP.
>
>   Reviewed by:jhb
>   Sponsored by:   The FreeBSD Foundation
>   Differential revision:  https://reviews.freebsd.org/D13838
>
> Added:
>   head/sys/amd64/amd64/copyout.c   (contents, props changed)
> Modified:
>   head/sys/amd64/amd64/exception.S
>   head/sys/amd64/amd64/initcpu.c
>   head/sys/amd64/amd64/machdep.c
>   head/sys/amd64/amd64/pmap.c
>   head/sys/amd64/amd64/support.S
>   head/sys/amd64/amd64/trap.c
>   head/sys/amd64/ia32/ia32_exception.S
>   head/sys/amd64/include/asmacros.h
>   head/sys/conf/files.amd64
>   head/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S
>
> Added: head/sys/amd64/amd64/copyout.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/amd64/amd64/copyout.cSun Jul 29 20:47:00 2018
> (r336876)
> @@ -0,0 +1,178 @@
> +/*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
> + * Copyright (c) 2018 The FreeBSD Foundation
> + * All rights reserved.
> + *
> + * This software was developed by Konstantin Belousov 
> + * under sponsorship from the FreeBSD Foundation.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
> WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#include 
> +__FBSDID("$FreeBSD$");
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +int fubyte_nosmap(volatile const void *base);
> +int fubyte_smap(volatile const void *base);
> +DEFINE_IFUNC(, int, fubyte, (volatile const void *), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + fubyte_smap : fubyte_nosmap);
> +}
> +
> +int fuword16_nosmap(volatile const void *base);
> +int fuword16_smap(volatile const void *base);
> +DEFINE_IFUNC(, int, fuword16, (volatile const void *), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + fuword16_smap : fuword16_nosmap);
> +}
> +
> +int fueword_nosmap(volatile const void *base, long *val);
> +int fueword_smap(volatile const void *base, long *val);
> +DEFINE_IFUNC(, int, fueword, (volatile const void *, long *), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + fueword_smap : fueword_nosmap);
> +}
> +DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + fueword_smap : fueword_nosmap);
> +}
> +
> +int  fueword32_nosmap(volatile const void *base, int32_t *val);
> +int  fueword32_smap(volatile const void *base, int32_t *val);
> +DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + fueword32_smap : fueword32_nosmap);
> +}
> +
> +int  subyte_nosmap(volatile void *base, int byte);
> +int  subyte_smap(volatile void *base, int byte);
> +DEFINE_IFUNC(, int, subyte, (volatile void *, int), static)
> +{
> +
> + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
> + subyte_smap : subyte_nosmap);
> +}
> +
> +int  suword16_nosmap(volatile void *base, int word);
> +int  suword16_smap(volatile void *base, int word);
> +DEFINE_IFUNC(, int, suword16, (volatile void *, int), static)
> +{
> +
> + return ((c

Re: svn commit: r336025 - in head/sys: amd64/include i386/include

2018-07-06 Thread Oliver Pinter
On Friday, July 6, 2018, Rodney W. Grimes 
wrote:

> > Author: hselasky
> > Date: Fri Jul  6 10:13:42 2018
> > New Revision: 336025
> > URL: https://svnweb.freebsd.org/changeset/base/336025
> >
> > Log:
> >   Make sure kernel modules built by default are portable between UP and
> >   SMP systems by extending defined(SMP) to include defined(KLD_MODULE).
> >
> >   This is a regression issue after r335873 .
> >
> >   Discussed with: mmacy@
> >   Sponsored by:   Mellanox Technologies
>
> Though this fixes the issue, it also means that now when
> anyone intentionally builds a UP kernel with modules
> they are getting SMP support in the modules and I am
> not sure they would want that.  I know I don't.
>
>
On linux case the lock instructions are runtime patchable. They have so
called altinstruction facility, which able to detect specific conditions -
in this case up vs smp - and in up case the locks are replaced with simple
nops or one multi word nop when the instruction longer than 1 byte.



> > Modified:
> >   head/sys/amd64/include/atomic.h
> >   head/sys/i386/include/atomic.h
> >
> > Modified: head/sys/amd64/include/atomic.h
> > 
> ==
> > --- head/sys/amd64/include/atomic.h   Fri Jul  6 10:10:00 2018
> (r336024)
> > +++ head/sys/amd64/include/atomic.h   Fri Jul  6 10:13:42 2018
> (r336025)
> > @@ -132,7 +132,7 @@ void  atomic_store_rel_##TYPE(volatile
> u_##TYPE *p, u_
> >   * For userland, always use lock prefixes so that the binaries will run
> >   * on both SMP and !SMP systems.
> >   */
> > -#if defined(SMP) || !defined(_KERNEL)
> > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE)
> >  #define  MPLOCKED"lock ; "
> >  #else
> >  #define  MPLOCKED
> > @@ -354,7 +354,7 @@ atomic_testandclear_long(volatile u_long *p, u_int
> v)
> >   */
> >  #define  OFFSETOF_MONITORBUF 0x100
> >
> > -#if defined(SMP)
> > +#if defined(SMP) || defined(KLD_MODULE)
> >  static __inline void
> >  __storeload_barrier(void)
> >  {
> >
> > Modified: head/sys/i386/include/atomic.h
> > 
> ==
> > --- head/sys/i386/include/atomic.hFri Jul  6 10:10:00 2018
> (r336024)
> > +++ head/sys/i386/include/atomic.hFri Jul  6 10:13:42 2018
> (r336025)
> > @@ -143,7 +143,7 @@ void  atomic_subtract_64(volatile
> uint64_t *, uint64_t
> >   * For userland, always use lock prefixes so that the binaries will run
> >   * on both SMP and !SMP systems.
> >   */
> > -#if defined(SMP) || !defined(_KERNEL)
> > +#if defined(SMP) || !defined(_KERNEL) || defined(KLD_MODULE)
> >  #define  MPLOCKED"lock ; "
> >  #else
> >  #define  MPLOCKED
> > @@ -302,7 +302,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v)
> >   */
> >
> >  #if defined(_KERNEL)
> > -#if defined(SMP)
> > +#if defined(SMP) || defined(KLD_MODULE)
> >  #define  __storeload_barrier()   __mbk()
> >  #else /* _KERNEL && UP */
> >  #define  __storeload_barrier()   __compiler_membar()
> >
> >
>
> --
> Rod Grimes
> rgri...@freebsd.org
> ___
> svn-src-h...@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-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: r335999 - in head/sys: amd64/amd64 i386/i386

2018-07-05 Thread Oliver Pinter
On Thursday, July 5, 2018, Konstantin Belousov  wrote:

> Author: kib
> Date: Thu Jul  5 16:38:54 2018
> New Revision: 335999
> URL: https://svnweb.freebsd.org/changeset/base/335999
>
> Log:
>   In x86 pmap_extract_and_hold(), there is no need to recalculate the
>   physical address, which is readily available after sucessfull
>   vm_page_pa_tryrelock().


Hi!

Wrong commit message.


>
>   Noted and reviewed by:alc
>   Sponsored by: The FreeBSD Foundation
>   MFC after:1 week
>   Differential revision:https://reviews.freebsd.org/D16085
>
> Modified:
>   head/sys/amd64/amd64/pmap.c
>   head/sys/i386/i386/pmap.c
>
> Modified: head/sys/amd64/amd64/pmap.c
> 
> ==
> --- head/sys/amd64/amd64/pmap.c Thu Jul  5 16:30:32 2018(r335998)
> +++ head/sys/amd64/amd64/pmap.c Thu Jul  5 16:38:54 2018(r335999)
> @@ -2308,7 +2308,6 @@ retry:
> PG_PS_FRAME) | (va & PDRMASK), &pa))
> goto retry;
> m = PHYS_TO_VM_PAGE(pa);
> -   vm_page_hold(m);
> }
> } else {
> pte = *pmap_pde_to_pte(pdep, va);
> @@ -2318,10 +2317,10 @@ retry:
> &pa))
> goto retry;
> m = PHYS_TO_VM_PAGE(pa);
> -   if (m != NULL)
> -   vm_page_hold(m);
> }
> }
> +   if (m != NULL)
> +   vm_page_hold(m);
> }
> PA_UNLOCK_COND(pa);
> PMAP_UNLOCK(pmap);
>
> Modified: head/sys/i386/i386/pmap.c
> 
> ==
> --- head/sys/i386/i386/pmap.c   Thu Jul  5 16:30:32 2018(r335998)
> +++ head/sys/i386/i386/pmap.c   Thu Jul  5 16:38:54 2018(r335999)
> @@ -1673,7 +1673,6 @@ retry:
> PG_PS_FRAME) | (va & PDRMASK), &pa))
> goto retry;
> m = PHYS_TO_VM_PAGE(pa);
> -   vm_page_hold(m);
> }
> } else {
> pte = pmap_pte_ufast(pmap, va, pde);
> @@ -1683,10 +1682,10 @@ retry:
> &pa))
> goto retry;
> m = PHYS_TO_VM_PAGE(pa);
> -   if (m != NULL)
> -   vm_page_hold(m);
> }
> }
> +   if (m != NULL)
> +   vm_page_hold(m);
> }
> PA_UNLOCK_COND(pa);
> PMAP_UNLOCK(pmap);
> ___
> svn-src-h...@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-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: r335690 - head/sys/kern

2018-06-27 Thread Oliver Pinter
On Wednesday, June 27, 2018, Warner Losh  wrote:

> Author: imp
> Date: Wed Jun 27 04:11:09 2018
> New Revision: 335690
> URL: https://svnweb.freebsd.org/changeset/base/335690
>
> Log:
>   Fix devctl generation for core files.
>
>   We have a problem with vn_fullpath_global when the file exists. Work
>   around it by printing the full path if the core file name starts with /,
>   or current working directory followed by the filename if not.
>
>   Sponsored by: Netflix
>   Differential Review: https://reviews.freebsd.org/D16026
>
> Modified:
>   head/sys/kern/kern_sig.c
>
> Modified: head/sys/kern/kern_sig.c
> 
> ==
> --- head/sys/kern/kern_sig.cWed Jun 27 04:10:48 2018(r335689)
> +++ head/sys/kern/kern_sig.cWed Jun 27 04:11:09 2018(r335690)
> @@ -3431,24 +3431,6 @@ out:
> return (0);
>  }
>
> -static int
> -coredump_sanitise_path(const char *path)
> -{
> -   size_t i;
> -
> -   /*
> -* Only send a subset of ASCII to devd(8) because it
> -* might pass these strings to sh -c.
> -*/
> -   for (i = 0; path[i]; i++)
> -   if (!(isalpha(path[i]) || isdigit(path[i])) &&
> -   path[i] != '/' && path[i] != '.' &&
> -   path[i] != '-')
> -   return (0);


This part of code existed to prevent shell code injection via file names.
After this commit we lose this.



> -
> -   return (1);
> -}
> -
>  /*
>   * Dump a process' core.  The main routine does some
>   * policy checking, and creates the name of the coredump;
> @@ -3469,11 +3451,8 @@ coredump(struct thread *td)
> char *name; /* name of corefile */
> void *rl_cookie;
> off_t limit;
> -   char *data = NULL;
> char *fullpath, *freepath = NULL;
> -   size_t len;
> -   static const char comm_name[] = "comm=";
> -   static const char core_name[] = "core=";
> +   struct sbuf *sb;
>
> PROC_LOCK_ASSERT(p, MA_OWNED);
> MPASS((p->p_flag & P_HADTHREADS) == 0 || p->p_singlethread == td);
> @@ -3556,23 +3535,35 @@ coredump(struct thread *td)
>  */
> if (error != 0 || coredump_devctl == 0)
> goto out;
> -   len = MAXPATHLEN * 2 + sizeof(comm_name) - 1 +
> -   sizeof(' ') + sizeof(core_name) - 1;
> -   data = malloc(len, M_TEMP, M_WAITOK);
> +   sb = sbuf_new_auto();
> if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0)
> -   goto out;
> -   if (!coredump_sanitise_path(fullpath))
> -   goto out;
> -   snprintf(data, len, "%s%s ", comm_name, fullpath);
> +   goto out2;
> +   sbuf_printf(sb, "comm=\"");
> +   devctl_safe_quote_sb(sb, fullpath);
> free(freepath, M_TEMP);
> -   freepath = NULL;
> -   if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0)
> -   goto out;
> -   if (!coredump_sanitise_path(fullpath))
> -   goto out;
> -   strlcat(data, core_name, len);
> -   strlcat(data, fullpath, len);
> -   devctl_notify("kernel", "signal", "coredump", data);
> +   sbuf_printf(sb, "\" core=\"");
> +
> +   /*
> +* We can't lookup core file vp directly. When we're replacing a
> core, and
> +* other random times, we flush the name cache, so it will fail.
> Instead,
> +* if the path of the core is relative, add the current dir in
> front if it.
> +*/
> +   if (name[0] != '/') {
> +   fullpath = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
> +   if (kern___getcwd(td, fullpath, UIO_SYSSPACE, MAXPATHLEN,
> MAXPATHLEN) != 0) {
> +   free(fullpath, M_TEMP);
> +   goto out2;
> +   }
> +   devctl_safe_quote_sb(sb, fullpath);
> +   free(fullpath, M_TEMP);
> +   sbuf_putc(sb, '/');
> +   }
> +   devctl_safe_quote_sb(sb, name);
> +   sbuf_printf(sb, "\"");
> +   if (sbuf_finish(sb) == 0)
> +   devctl_notify("kernel", "signal", "coredump",
> sbuf_data(sb));
> +out2:
> +   sbuf_delete(sb);
>  out:
> error1 = vn_close(vp, FWRITE, cred, td);
> if (error == 0)
> @@ -3580,8 +3571,6 @@ out:
>  #ifdef AUDIT
> audit_proc_coredump(td, name, error);
>  #endif
> -   free(freepath, M_TEMP);
> -   free(data, M_TEMP);
> free(name, M_TEMP);
> return (error);
>  }
> ___
> svn-src-h...@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-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: r334046 - head/tools/tools/intel-ucode-split

2018-06-17 Thread Oliver Pinter
On Sunday, June 17, 2018, Mark Johnston  wrote:

> On Sat, Jun 16, 2018 at 06:25:03PM -0700, Eitan Adler wrote:
> > On 13 June 2018 at 07:07, Mark Johnston  wrote:
> > > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote:
> > >> On Wednesday, June 13, 2018, Ed Maste  wrote:
> > >>
> > >> > On Tue, 12 Jun 2018 at 18:17, Sean Bruno 
> wrote:
> > >> > >
> > >> > > On 06/12/18 16:05, Oliver Pinter wrote:
> > >> > > > On 5/22/18, Ed Maste  wrote:
> > >> > > >> Author: emaste
> > >> > > >> Date: Tue May 22 14:35:33 2018
> > >> > > >> New Revision: 334046
> > >> > > >> URL: https://svnweb.freebsd.org/changeset/base/334046
> > >> > > >>
> > >> > > >> Log:
> > >> > > >>   intel-ucode-split: add -n flag to skip creating output files
> > >> > > >>
> > >> > > >>   Sponsored by:  The FreeBSD Foundation
> > >> > > >>
> > >> > > >> Modified:
> > >> > > >>   head/tools/tools/intel-ucode-split/intel-ucode-split.c
> > >> > > >
> > >> > > > Hi!
> > >> > > >
> > >> > > > Could you please MFC the intel-ucode-split related commits to
> > >> > 11-STABLE?
> > >> > > >
> > >> > > > Thanks,
> > >> > > > op
> > >> > >
> > >> > > Do you need it in base for some reason?  This code is already in
> the
> > >> > > devcpu-data port and is used when the port is built.  Its not
> needed for
> > >> > > anything AFAIK.
> > >> >
> > >> > Indeed, the real use in FreeBSD is via the devcpu-data port; I
> > >> > committed it to src/tools/ for collaboration and testing. I'll merge
> > >> > it to stable/11 if it will be useful for someone, but am curious
> about
> > >> > the use case.
> > >> >
> > >>
> > >>
> > >> I'm considering to write an in kernel microcode update facility,
> based on
> > >> firmware(9), and in first idea it would be nice during the generation
> of
> > >> firmware modules.
> > >
> > > FWIW, I'm working on this for 12.0 and was planning to describe my
> > > proposal on -arch in the next couple of weeks.  For my purposes at
> > > least, firmware(9) isn't suitable.  We'd like to ensure that updates
> are
> > > applied before the kernel does CPU identification, and that happens
> > > quite early during boot.  This places some constraints on the
> > > implementation which exclude firmware(9).
> >
> > Naive question, knowing nothing about firmware(9), but why can't it be
> > enhanced to work that early? It seems there might be other use-cases
> > for very-early-boot firmware application.
>
> The constraint means that almost none of the standard kernel APIs (e.g.,
> malloc()) are usable at the time that the update is to be applied.  It
> doesn't seem practical to me to try and implement firmware(9)'s
> abstractions under such limitations.  Further, because microcode
> updating is an platform-specific operation, in this case it's preferable
> to tie the implementation to that platform's code.


How do you plan to put the firmware into memory? Preload it with the loader
or compile into kernel module or with somehow early fs access from kernel?

Or instead of updating the microcode from kernel, do the whole process from
the loader?
This will be problematic in resume case.

___
> svn-src-h...@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-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: r335072 - head/sys/amd64/amd64

2018-06-13 Thread Oliver Pinter
On Thursday, June 14, 2018, Rodney W. Grimes 
wrote:

> > Author: kib
> > Date: Wed Jun 13 17:55:09 2018
> > New Revision: 335072
> > URL: https://svnweb.freebsd.org/changeset/base/335072
> >
> > Log:
> >   Enable eager FPU context switch by default on amd64.
> >
> >   With compilers making increasing use of vector instructions the
> >   performance benefit of lazily switching FPU state is no longer a
> >   desirable tradeoff.  Linux switched to eager FPU context switch some
> >   time ago, and the idea was floated on the FreeBSD-current mailing list
> >   some years ago[1].
> >
> >   Enable eager FPU context switch by default on amd64, with a
> tunable/sysctl
> >   available to turn it back off.
> >
> >   [1] https://lists.freebsd.org/pipermail/freebsd-current/
> 2015-March/055198.html
> >
> >   Reviewed by:jhb
> >   Tested by:  pho
> >   Sponsored by:   The FreeBSD Foundation
>
> MFC: ?


Already done.


>
> ...
>
> --
> Rod Grimes
> rgri...@freebsd.org
> ___
> svn-src-h...@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-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: r335072 - head/sys/amd64/amd64

2018-06-13 Thread Oliver Pinter
On Wednesday, June 13, 2018, Konstantin Belousov  wrote:

> Author: kib
> Date: Wed Jun 13 17:55:09 2018
> New Revision: 335072
> URL: https://svnweb.freebsd.org/changeset/base/335072
>
> Log:
>   Enable eager FPU context switch by default on amd64.
>
>   With compilers making increasing use of vector instructions the
>   performance benefit of lazily switching FPU state is no longer a
>   desirable tradeoff.  Linux switched to eager FPU context switch some
>   time ago, and the idea was floated on the FreeBSD-current mailing list
>   some years ago[1].
>
>   Enable eager FPU context switch by default on amd64, with a
> tunable/sysctl
>   available to turn it back off.
>
>   [1] https://lists.freebsd.org/pipermail/freebsd-current/
> 2015-March/055198.html
>
>
http://www.openwall.com/lists/oss-security/2018/06/13/7



>   Reviewed by:  jhb
>   Tested by:pho
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/sys/amd64/amd64/cpu_switch.S
>   head/sys/amd64/amd64/fpu.c
>
> Modified: head/sys/amd64/amd64/cpu_switch.S
> 
> ==
> --- head/sys/amd64/amd64/cpu_switch.S   Wed Jun 13 17:42:55 2018
> (r335071)
> +++ head/sys/amd64/amd64/cpu_switch.S   Wed Jun 13 17:55:09 2018
> (r335072)
> @@ -128,10 +128,10 @@ done_store_dr:
>
> /* have we used fp, and need a save? */
> cmpq%rdi,PCPU(FPCURTHREAD)
> -   jne 3f
> +   jne 2f
> movqPCB_SAVEFPU(%r8),%r8
> clts
> -   cmpl$0,use_xsave
> +   cmpl$0,use_xsave(%rip)
> jne 1f
> fxsave  (%r8)
> jmp 2f
> @@ -143,12 +143,7 @@ ctx_switch_xsave:
> /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */
> xsave   (%r8)
> movq%rcx,%rdx
> -2: smsw%ax
> -   orb $CR0_TS,%al
> -   lmsw%ax
> -   xorl%eax,%eax
> -   movq%rax,PCPU(FPCURTHREAD)
> -3:
> +2:
> /* Save is done.  Now fire up new thread. Leave old vmspace. */
> movq%rsi,%r12
> movq%rdi,%r13
> @@ -238,6 +233,8 @@ done_load_dr:
> movqPCB_RBX(%r8),%rbx
> movqPCB_RIP(%r8),%rax
> movq%rax,(%rsp)
> +   movqPCPU(CURTHREAD),%rdi
> +   callfpu_activate_sw
> ret
>
> /*
>
> Modified: head/sys/amd64/amd64/fpu.c
> 
> ==
> --- head/sys/amd64/amd64/fpu.c  Wed Jun 13 17:42:55 2018(r335071)
> +++ head/sys/amd64/amd64/fpu.c  Wed Jun 13 17:55:09 2018(r335072)
> @@ -142,6 +142,11 @@ static voidfpu_clean_state(void);
>  SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
>  SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in
> hardware");
>
> +int lazy_fpu_switch = 0;
> +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN |
> CTLFLAG_NOFETCH,
> +&lazy_fpu_switch, 0,
> +"Lazily load FPU context after context switch");
> +
>  int use_xsave; /* non-static for cpu_switch.S */
>  uint64_t xsave_mask;   /* the same */
>  static uma_zone_t fpu_save_area_zone;
> @@ -242,6 +247,7 @@ fpuinit_bsp1(void)
> uint64_t xsave_mask_user;
> bool old_wp;
>
> +   TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch);
> if (!use_xsave)
> return;
> cpuid_count(0xd, 0x0, cp);
> @@ -651,6 +657,45 @@ fputrap_sse(void)
> return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]);
>  }
>
> +static void
> +restore_fpu_curthread(struct thread *td)
> +{
> +   struct pcb *pcb;
> +
> +   /*
> +* Record new context early in case frstor causes a trap.
> +*/
> +   PCPU_SET(fpcurthread, td);
> +
> +   stop_emulating();
> +   fpu_clean_state();
> +   pcb = td->td_pcb;
> +
> +   if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
> +   /*
> +* This is the first time this thread has used the FPU or
> +* the PCB doesn't contain a clean FPU state.  Explicitly
> +* load an initial state.
> +*
> +* We prefer to restore the state from the actual save
> +* area in PCB instead of directly loading from
> +* fpu_initialstate, to ignite the XSAVEOPT
> +* tracking engine.
> +*/
> +   bcopy(fpu_initialstate, pcb->pcb_save,
> +   cpu_max_ext_state_size);
> +   fpurestore(pcb->pcb_save);
> +   if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
> +   fldcw(pcb->pcb_initial_fpucw);
> +   if (PCB_USER_FPU(pcb))
> +   set_pcb_flags(pcb, PCB_FPUINITDONE |
> +   PCB_USERFPUINITDONE);
> +   else
> +   set_pcb_flags(pcb, PCB_FPUINITDONE);
> +   } else
> +   fpurestore(pcb

Re: svn commit: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Oliver Pinter
On Wednesday, June 13, 2018, Ed Maste  wrote:

> On Tue, 12 Jun 2018 at 18:17, Sean Bruno  wrote:
> >
> > On 06/12/18 16:05, Oliver Pinter wrote:
> > > On 5/22/18, Ed Maste  wrote:
> > >> Author: emaste
> > >> Date: Tue May 22 14:35:33 2018
> > >> New Revision: 334046
> > >> URL: https://svnweb.freebsd.org/changeset/base/334046
> > >>
> > >> Log:
> > >>   intel-ucode-split: add -n flag to skip creating output files
> > >>
> > >>   Sponsored by:  The FreeBSD Foundation
> > >>
> > >> Modified:
> > >>   head/tools/tools/intel-ucode-split/intel-ucode-split.c
> > >
> > > Hi!
> > >
> > > Could you please MFC the intel-ucode-split related commits to
> 11-STABLE?
> > >
> > > Thanks,
> > > op
> >
> > Do you need it in base for some reason?  This code is already in the
> > devcpu-data port and is used when the port is built.  Its not needed for
> > anything AFAIK.
>
> Indeed, the real use in FreeBSD is via the devcpu-data port; I
> committed it to src/tools/ for collaboration and testing. I'll merge
> it to stable/11 if it will be useful for someone, but am curious about
> the use case.
>


I'm considering to write an in kernel microcode update facility, based on
firmware(9), and in first idea it would be nice during the generation of
firmware modules.
___
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: r334046 - head/tools/tools/intel-ucode-split

2018-06-12 Thread Oliver Pinter
On 5/22/18, Ed Maste  wrote:
> Author: emaste
> Date: Tue May 22 14:35:33 2018
> New Revision: 334046
> URL: https://svnweb.freebsd.org/changeset/base/334046
>
> Log:
>   intel-ucode-split: add -n flag to skip creating output files
>
>   Sponsored by:   The FreeBSD Foundation
>
> Modified:
>   head/tools/tools/intel-ucode-split/intel-ucode-split.c

Hi!

Could you please MFC the intel-ucode-split related commits to 11-STABLE?


Thanks,
op

>
> Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c
> ==
> --- head/tools/tools/intel-ucode-split/intel-ucode-split.cTue May 22
> 14:26:58 2018 (r334045)
> +++ head/tools/tools/intel-ucode-split/intel-ucode-split.cTue May 22
> 14:35:33 2018 (r334046)
> @@ -112,7 +112,7 @@ static void
>  usage(void)
>  {
>
> - printf("ucode-split [-v] microcode_file\n");
> + printf("ucode-split [-nv] microcode_file\n");
>   exit(1);
>  }
>
> @@ -124,11 +124,14 @@ main(int argc, char *argv[])
>   size_t len, resid;
>   ssize_t rv;
>   int c, ifd, ofd;
> - bool vflag;
> + bool nflag, vflag;
>
> - vflag = false;
> - while ((c = getopt(argc, argv, "v")) != -1) {
> + nflag = vflag = false;
> + while ((c = getopt(argc, argv, "nv")) != -1) {
>   switch (c) {
> + case 'n':
> + nflag = true;
> + break;
>   case 'v':
>   vflag = true;
>   break;
> @@ -166,40 +169,48 @@ main(int argc, char *argv[])
>   if (vflag)
>   dump_header(&hdr);
>
> - sig_str = format_signature(hdr.processor_signature);
> - asprintf(&output_file, "%s.%02x", sig_str,
> - hdr.processor_flags & 0xff);
> - free(sig_str);
> - if (output_file == NULL)
> - err(1, "asprintf");
> - ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
> - if (ofd < 0)
> - err(1, "open");
> -
> - /* Write header. */
> - rv = write(ofd, &hdr, sizeof(hdr));
> - if (rv < (ssize_t)sizeof(hdr))
> - err(1, "write");
> -
> - /* Copy data. */
>   resid = (hdr.total_size != 0 ? hdr.total_size : 2048) -
>   sizeof(hdr);
>   if (resid > 1 << 24) /* Arbitrary chosen maximum size. */
>   errx(1, "header total_size too large");
> - while (resid > 0) {
> - len = resid < bufsize ? resid : bufsize;
> - rv = read(ifd, buf, len);
> - if (rv < 0)
> - err(1, "read");
> - else if (rv < (ssize_t)len)
> - errx(1, "truncated microcode data");
> - if (write(ofd, buf, len) < (ssize_t)len)
> +
> + if (nflag) {
> + if (lseek(ifd, resid, SEEK_CUR) == -1)
> + err(1, "lseek");
> + printf("\n");
> + } else {
> + sig_str = format_signature(hdr.processor_signature);
> + asprintf(&output_file, "%s.%02x", sig_str,
> + hdr.processor_flags & 0xff);
> + free(sig_str);
> + if (output_file == NULL)
> + err(1, "asprintf");
> + ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC,
> + 0600);
> + if (ofd < 0)
> + err(1, "open");
> + 
> + /* Write header. */
> + rv = write(ofd, &hdr, sizeof(hdr));
> + if (rv < (ssize_t)sizeof(hdr))
>   err(1, "write");
> - resid -= len;
> + 
> + /* Copy data. */
> + while (resid > 0) {
> + len = resid < bufsize ? resid : bufsize;
> + rv = read(ifd, buf, len);
> + if (rv < 0)
> + err(1, "read");
> + else if (rv < (ssize_t)len)
> + errx(1, "truncated microcode data");
> + if (write(ofd, buf, len) < (ssize_t)len)
> + err(1, "write");
> + resid -= len;
> + }
> + if (vflag)
> + printf("written to %s\n\n", output_file);
> + close(ofd);
> + free(output_file);
>   }
> - if (vflag)
> - printf("written to %s\n\n", output_file);
> - close(ofd);
> - fre

Re: svn commit: r334931 - in head: . sys/sys

2018-06-10 Thread Oliver Pinter
On 6/10/18, Jonathan Anderson  wrote:
> On 10 Jun 2018, at 16:49, Antoine Brodin wrote:
>
>> On Sun, Jun 10, 2018 at 9:15 PM, Eitan Adler 
>> wrote:
>>> Author: eadler
>>> Date: Sun Jun 10 19:15:38 2018
>>> New Revision: 334931
>>> URL: https://svnweb.freebsd.org/changeset/base/334931
>>>
>>> Log:
>>>   Revert r334929
>>>
>>>   Apparently some software might depend on a header whose sole
>>> contents is
>>>   a `#warning` to remove it. Revert pending exp-run.
>>
>> Hi,
>>
>> It's not just a #warning,  there is a #include line below...
>> And after this change,  most ports that supported sandboxing were no
>> longer sandboxed.
>
> This used the be the primary header file for Capsicum, but we switched
> to the somewhat-more-portable sys/capsicum.h awhile ago. The current
> sys/capability.h includes the new header while emitting a warning in
> order to encourage people to switch to capsicum.h without breaking
> anything (yet). This is a transitional step, and I think the plan is to
> remove sys/capability.h after... maybe the 12-STABLE branch?
>

As second step, it would be fine to slip the #warning over to #error,
and fix the ports.

>
> Jon
> --
> Jonathan Anderson
> jonat...@freebsd.org
> ___
> svn-src-h...@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-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: r333675 - head

2018-05-16 Thread Oliver Pinter
On 5/16/18, Warner Losh  wrote:
> Author: imp
> Date: Wed May 16 13:52:24 2018
> New Revision: 333675
> URL: https://svnweb.freebsd.org/changeset/base/333675
>
> Log:
>   Add note about LD=ld.lld being a temporary requirement when building
>   the kernel the traditional way.
>
> Modified:
>   head/UPDATING
>
> Modified: head/UPDATING
> ==
> --- head/UPDATING Wed May 16 13:47:30 2018(r333674)
> +++ head/UPDATING Wed May 16 13:52:24 2018(r333675)
> @@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
>
>  ** SPECIAL WARNING:
> **
>
> +20150510:
2018 :)

> + The amd64 kernel now requires a ld that supports ifunc to produce a
> + working kernel, either lld or a newer binutils. lld is built by default
> + on amd64, and the 'buildkernel' target uses it automatically. However,
> + it is not the default linker, so building the kernel the traditional
> + way requires LD=ld.lld on the command line (or LD=/usr/local/bin/ld for
> + binutils port/package). lld will soon be default, and this requirement
> + will go away.
> +
>  20180508:
>   The nxge(4) driver has been removed.  This driver was for PCI-X 10g
>   cards made by s2io/Neterion.  The company was aquired by Exar and
> ___
> svn-src-h...@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-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: r333438 - head/sbin/geom/class/eli

2018-05-09 Thread Oliver Pinter
On Wednesday, May 9, 2018, Mariusz Zaborski  wrote:

> Author: oshogbo
> Date: Wed May  9 20:51:16 2018
> New Revision: 333438
> URL: https://svnweb.freebsd.org/changeset/base/333438
>
> Log:
>   Change option dry-run from 'n' to 'C' in geli attach command.
>
>   'n' is used in other commands to define the key index.
>   We should be consistent with that.
>   'C' option is used by patch(1) to perform dryrun so lets use that.
>
>   Reviewed by:  allanjude
>   Differential Revision:https://reviews.freebsd.org/D15308


Relnotes: yes


>
> Modified:
>   head/sbin/geom/class/eli/geli.8
>   head/sbin/geom/class/eli/geom_eli.c
>
> Modified: head/sbin/geom/class/eli/geli.8
> 
> ==
> --- head/sbin/geom/class/eli/geli.8 Wed May  9 20:49:50 2018
> (r333437)
> +++ head/sbin/geom/class/eli/geli.8 Wed May  9 20:51:16 2018
> (r333438)
> @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd April 10, 2018
> +.Dd May 9, 2018
>  .Dt GELI 8
>  .Os
>  .Sh NAME
> @@ -67,7 +67,7 @@ utility:
>  .Cm init
>  .Nm
>  .Cm attach
> -.Op Fl dnprv
> +.Op Fl Cdprv
>  .Op Fl j Ar passfile
>  .Op Fl k Ar keyfile
>  .Ar prov
> @@ -393,6 +393,9 @@ suffix.
>  .Pp
>  Additional options include:
>  .Bl -tag -width ".Fl j Ar passfile"
> +.It Fl C
> +Do a dry-run decryption.
> +This is useful to verify passphrase and keyfile without decrypting the
> device.
>  .It Fl d
>  If specified, a decrypted provider will be detached automatically on last
> close.
>  This can help with scarce memory so the user does not have to remember to
> detach the
> @@ -420,9 +423,6 @@ For more information see the description of the
>  option for the
>  .Cm init
>  subcommand.
> -.It Fl n
> -Do a dry-run decryption.
> -This is useful to verify passphrase and keyfile without decrypting the
> device.
>  .It Fl p
>  Do not use a passphrase as a component of the User Key.
>  Cannot be combined with the
>
> Modified: head/sbin/geom/class/eli/geom_eli.c
> 
> ==
> --- head/sbin/geom/class/eli/geom_eli.c Wed May  9 20:49:50 2018
> (r333437)
> +++ head/sbin/geom/class/eli/geom_eli.c Wed May  9 20:51:16 2018
> (r333438)
> @@ -86,7 +86,7 @@ static int eli_backup_create(struct gctl_req *req, con
>   *
>   * init [-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations]
> [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version]
> prov
>   * label - alias for 'init'
> - * attach [-dprv] [-j passfile] [-k keyfile] prov
> + * attach [-Cdprv] [-j passfile] [-k keyfile] prov
>   * detach [-fl] prov ...
>   * stop - alias for 'detach'
>   * onetime [-d] [-a aalgo] [-e ealgo] [-l keylen] prov
> @@ -145,15 +145,15 @@ struct g_command class_commands[] = {
> },
> { "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main,
> {
> +   { 'C', "dryrun", NULL, G_TYPE_BOOL },
> { 'd', "detach", NULL, G_TYPE_BOOL },
> { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING |
> G_TYPE_MULTI },
> { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING |
> G_TYPE_MULTI },
> -   { 'n', "dryrun", NULL, G_TYPE_BOOL },
> { 'p', "nopassphrase", NULL, G_TYPE_BOOL },
> { 'r', "readonly", NULL, G_TYPE_BOOL },
> G_OPT_SENTINEL
> },
> -   "[-dnprv] [-j passfile] [-k keyfile] prov"
> +   "[-Cdprv] [-j passfile] [-k keyfile] prov"
> },
> { "detach", 0, NULL,
> {
> ___
> svn-src-h...@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-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: r333409 - in head/sys: netinet sys

2018-05-09 Thread Oliver Pinter
On Wednesday, May 9, 2018, Warner Losh  wrote:

> Author: imp
> Date: Wed May  9 14:11:35 2018
> New Revision: 333409
> URL: https://svnweb.freebsd.org/changeset/base/333409
>
> Log:
>   Minor style nits
>
>   Use full copyright year.
>   Remove 'All Rights Reserved' from new file (rights holder OK'd)
>   Minor #ifdef motion and #endif tagging
>   Remove __FBSDID macro from comments
>
>   Sponsored by: Netflix
>   OK'd by: rrs@
>
> Modified:
>   head/sys/netinet/tcp_hpts.c
>   head/sys/netinet/tcp_hpts.h
>   head/sys/sys/kern_prefetch.h
>
> Modified: head/sys/netinet/tcp_hpts.c
> 
> ==
> --- head/sys/netinet/tcp_hpts.c Wed May  9 13:53:10 2018(r333408)
> +++ head/sys/netinet/tcp_hpts.c Wed May  9 14:11:35 2018(r333409)
> @@ -1,6 +1,5 @@
>  /*-
> - * Copyright (c) 2016-8
> - * Netflix Inc.  All rights reserved.
> + * Copyright (c) 2016-2018 Netflix Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
>
> Modified: head/sys/netinet/tcp_hpts.h
> 
> ==
> --- head/sys/netinet/tcp_hpts.h Wed May  9 13:53:10 2018(r333408)
> +++ head/sys/netinet/tcp_hpts.h Wed May  9 14:11:35 2018(r333409)
> @@ -1,8 +1,5 @@
> -#ifndef __tcp_hpts_h__
> -#define __tcp_hpts_h__
>  /*-
> - * Copyright (c) 2016-8
> - * Netflix Inc.  All rights reserved.
> + * Copyright (c) 2016-18 Netflix Inc.


Hi!

Could you please use full year here, same as in the other parts of this
patch?


>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> @@ -25,9 +22,12 @@
>   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>   * SUCH DAMAGE.
>   *
> - * __FBSDID("$FreeBSD$")
> + * $FreeBSD$
>   */
>
> +#ifndef __tcp_hpts_h__
> +#define __tcp_hpts_h__
> +
>  /*
>   * The hpts uses a 102400 wheel. The wheel
>   * defines the time in 10 usec increments (102400 x 10).
> @@ -300,5 +300,5 @@ tcp_get_usecs(struct timeval *tv)
> return (tcp_tv_to_usectick(tv));
>  }
>
> -#endif
> -#endif
> +#endif /* _KERNEL */
> +#endif /* __tcp_hpts_h__ */
>
> Modified: head/sys/sys/kern_prefetch.h
> 
> ==
> --- head/sys/sys/kern_prefetch.hWed May  9 13:53:10 2018
> (r333408)
> +++ head/sys/sys/kern_prefetch.hWed May  9 14:11:35 2018
> (r333409)
> @@ -1,7 +1,5 @@
> -#ifndef __kern_prefetch_h__
>  /*-
> - * Copyright (c) 2016-8
> - * Netflix Inc.  All rights reserved.
> + * Copyright (c) 2016-2018 Netflix Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> @@ -24,8 +22,9 @@
>   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>   * SUCH DAMAGE.
>   *
> - * __FBSDID("$FreeBSD$")
> + * $FreeBSD$
>   */
> +#ifndef __kern_prefetch_h__
>  #define __kern_prefetch_h__
>  #ifdef _KERNEL
>
> @@ -39,5 +38,5 @@ kern_prefetch(const volatile void *addr, void* before)
>  #endif
>  }
>
> -#endif
> -#endif
> +#endif /* _KERNEL */
> +#endif /* __kern_prefetch_h__ */
> ___
> svn-src-h...@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-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: r333324 - in head/sys: amd64/amd64 conf

2018-05-07 Thread Oliver Pinter
On 5/7/18, Rodney W. Grimes  wrote:
>> Author: mjg
>> Date: Mon May  7 15:07:28 2018
>> New Revision: 24
>> URL: https://svnweb.freebsd.org/changeset/base/24
>>
>> Log:
>>   amd64: replace libkern's memset and memmove with assembly variants
>>
>>   memmove is repurposed bcopy (arguments swapped, return value added)
>>   The libkern variant is a wrapper around bcopy, so this is a big
>>   improvement.
>>
>>   memset is repurposed memcpy. The librkern variant is doing fishy stuff,
>>   including branching on 0 and calling bzero.
>>
>>   Both functions are rather crude and subject to partial depessimization.
>>
>>   This is a soft prerequisite to adding variants utilizing the
>>   'Enhanced REP MOVSB/STOSB' bit and let the kernel patch at runtime.
>>
>> Modified:
>>   head/sys/amd64/amd64/support.S
>>   head/sys/conf/files.amd64
>>
>> Modified: head/sys/amd64/amd64/support.S
>> ==
>> --- head/sys/amd64/amd64/support.S   Mon May  7 15:07:26 2018
>> (r23)
>> +++ head/sys/amd64/amd64/support.S   Mon May  7 15:07:28 2018
>> (r24)
>> @@ -162,6 +162,58 @@ ENTRY(bcopy)
>>  END(bcopy)
>>
>>  /*
>> + * memmove(dst, src, cnt)
>> + * rdi, rsi, rdx
>> + * Original by:
>> + *  w...@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
>
> If the original is by w...@tools.de, who is this version by?
> Or is this simply copied from some other FreeBSD file?

Btw, it would be much better to review the relevant and function parts
of the codes, rather than mocking with comments. ;) // not limited to
this patch

>
> Thanks,
>> + */
>> +ENTRY(memmove)
>> +PUSH_FRAME_POINTER
>> +movq%rdi,%r9
>> +movq%rdx,%rcx
>> +
>> +movq%rdi,%rax
>> +subq%rsi,%rax
>> +cmpq%rcx,%rax   /* overlapping && src < dst? */
>> +jb  1f
>> +
>> +shrq$3,%rcx /* copy by 64-bit words */
>> +rep
>> +movsq
>> +movq%rdx,%rcx
>> +andq$7,%rcx /* any bytes left? */
>> +rep
>> +movsb
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +
>> +/* ALIGN_TEXT */
>> +1:
>> +addq%rcx,%rdi   /* copy backwards */
>> +addq%rcx,%rsi
>> +decq%rdi
>> +decq%rsi
>> +andq$7,%rcx /* any fractional bytes? */
>> +std
>> +rep
>> +movsb
>> +movq%rdx,%rcx   /* copy remainder by 32-bit 
>> words */
>> +shrq$3,%rcx
>> +subq$7,%rsi
>> +subq$7,%rdi
>> +rep
>> +movsq
>> +cld
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +END(memmove)
>> +
>> +/*
>> + * memcpy(dst, src, len)
>> + *rdi, rsi, rdx
>> + *
>>   * Note: memcpy does not support overlapping copies
>>   */
>>  ENTRY(memcpy)
>> @@ -178,6 +230,27 @@ ENTRY(memcpy)
>>  POP_FRAME_POINTER
>>  ret
>>  END(memcpy)
>> +
>> +/*
>> + * memset(dst, c,   len)
>> + *rdi, rsi, rdx
>> + */
>> +ENTRY(memset)
>> +PUSH_FRAME_POINTER
>> +movq%rdi,%r9
>> +movq%rdx,%rcx
>> +movq%rsi,%rax
>> +shrq$3,%rcx
>> +rep
>> +stosq
>> +movq%rdx,%rcx
>> +andq$7,%rcx
>> +rep
>> +stosb
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +END(memset)
>>
>>  /*
>>   * pagecopy(%rdi=from, %rsi=to)
>>
>> Modified: head/sys/conf/files.amd64
>> ==
>> --- head/sys/conf/files.amd64Mon May  7 15:07:26 2018
>> (r23)
>> +++ head/sys/conf/files.amd64Mon May  7 15:07:28 2018
>> (r24)
>> @@ -620,8 +620,6 @@ isa/vga_isa.coptionalvga
>>  kern/kern_clocksource.c standard
>>  kern/link_elf_obj.c standard
>>  libkern/x86/crc32_sse42.c   standard
>> -libkern/memmove.c   standard
>> -libkern/memset.cstandard
>>  #
>>  # IA32 binary support
>>  #
>>
>>
>
> --
> Rod Grimes
> rgri...@freebsd.org
> ___
> svn-src-h...@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-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: r333324 - in head/sys: amd64/amd64 conf

2018-05-07 Thread Oliver Pinter
On 5/7/18, Oliver Pinter  wrote:
> On 5/7/18, Mateusz Guzik  wrote:
>> Author: mjg
>> Date: Mon May  7 15:07:28 2018
>> New Revision: 24
>> URL: https://svnweb.freebsd.org/changeset/base/24
>>
>> Log:
>>   amd64: replace libkern's memset and memmove with assembly variants
>>
>>   memmove is repurposed bcopy (arguments swapped, return value added)
>>   The libkern variant is a wrapper around bcopy, so this is a big
>>   improvement.
>>
>>   memset is repurposed memcpy. The librkern variant is doing fishy stuff,
>>   including branching on 0 and calling bzero.
>>
>>   Both functions are rather crude and subject to partial depessimization.
>>
>>   This is a soft prerequisite to adding variants utilizing the
>>   'Enhanced REP MOVSB/STOSB' bit and let the kernel patch at runtime.
>>
>> Modified:
>>   head/sys/amd64/amd64/support.S
>>   head/sys/conf/files.amd64
>>
>> Modified: head/sys/amd64/amd64/support.S
>> ==
>> --- head/sys/amd64/amd64/support.S   Mon May  7 15:07:26 2018
>> (r23)
>> +++ head/sys/amd64/amd64/support.S   Mon May  7 15:07:28 2018
>> (r24)
>> @@ -162,6 +162,58 @@ ENTRY(bcopy)
>>  END(bcopy)
>>
>>  /*
>> + * memmove(dst, src, cnt)
>> + * rdi, rsi, rdx
>> + * Original by:
>> + *  w...@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
>> + */
>> +ENTRY(memmove)
>> +PUSH_FRAME_POINTER
>> +movq%rdi,%r9
>> +movq%rdx,%rcx
>> +
>> +movq%rdi,%rax
>> +subq%rsi,%rax
>> +cmpq%rcx,%rax   /* overlapping && src < dst? */
>> +jb  1f
>> +
>> +shrq$3,%rcx /* copy by 64-bit words */
>> +rep
>> +movsq
>> +movq%rdx,%rcx
>> +andq$7,%rcx /* any bytes left? */
>> +rep
>> +movsb
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +
>> +/* ALIGN_TEXT */
>> +1:
>> +addq%rcx,%rdi   /* copy backwards */
>> +addq%rcx,%rsi
>> +decq%rdi
>> +decq%rsi
>> +andq$7,%rcx /* any fractional bytes? */
>> +std
>> +rep
>> +movsb
>> +movq%rdx,%rcx   /* copy remainder by 32-bit 
>> words */
>> +shrq$3,%rcx
>> +subq$7,%rsi
>> +subq$7,%rdi
>> +rep
>> +movsq
>> +cld
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +END(memmove)
>> +
>> +/*
>> + * memcpy(dst, src, len)
>> + *rdi, rsi, rdx
>> + *
>>   * Note: memcpy does not support overlapping copies
>>   */
>>  ENTRY(memcpy)
>> @@ -178,6 +230,27 @@ ENTRY(memcpy)
>>  POP_FRAME_POINTER
>>  ret
>>  END(memcpy)
>> +
>> +/*
>> + * memset(dst, c,   len)
>> + *rdi, rsi, rdx
>> + */
>> +ENTRY(memset)
>> +PUSH_FRAME_POINTER
>> +movq%rdi,%r9
>> +movq%rdx,%rcx
>> +movq%rsi,%rax
>> +shrq$3,%rcx
>> +rep
>> +stosq
>
> According to Intel SDM stosq stores the whole RAX into destination,
> and then increments the destination register with 8. This
> implementation is wrong, since the c is a char, and the The RAX looks
> like 00CC, so the stored patter would be 00CC * SIZE / 8 * 8 +
> CC * SIZE % 8 in destination buffer.

Attached the proof.

>
>> +movq%rdx,%rcx
>> +andq$7,%rcx
>> +rep
>> +stosb
>> +movq%r9,%rax
>> +POP_FRAME_POINTER
>> +ret
>> +END(memset)
>>
>>  /*
>>   * pagecopy(%rdi=from, %rsi=to)
>>
>> Modified: head/sys/conf/files.amd64
>> ==
>> --- head/sys/conf/files.amd64Mon May  7 15:07:26 2018
>> (r23)
>> +++ head/sys/conf/files.amd64Mon May  7 15:07:28 2018
>> (r24)
>> @@ -620,8 +620,6 @@ isa/vga_isa.coptionalvga
>>  kern/kern_clocksource.c standard
>>  kern/link_elf_obj.c standard
>>  libkern/x86/crc32_sse42.c   standard
>> -libkern/memmove.c   standard
>> -libkern/memset.cstandard
>>  #
>>  # IA32 binary support
>>  #
>> ___
>> svn-src-h...@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-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: r333324 - in head/sys: amd64/amd64 conf

2018-05-07 Thread Oliver Pinter
On 5/7/18, Mateusz Guzik  wrote:
> Author: mjg
> Date: Mon May  7 15:07:28 2018
> New Revision: 24
> URL: https://svnweb.freebsd.org/changeset/base/24
>
> Log:
>   amd64: replace libkern's memset and memmove with assembly variants
>
>   memmove is repurposed bcopy (arguments swapped, return value added)
>   The libkern variant is a wrapper around bcopy, so this is a big
>   improvement.
>
>   memset is repurposed memcpy. The librkern variant is doing fishy stuff,
>   including branching on 0 and calling bzero.
>
>   Both functions are rather crude and subject to partial depessimization.
>
>   This is a soft prerequisite to adding variants utilizing the
>   'Enhanced REP MOVSB/STOSB' bit and let the kernel patch at runtime.
>
> Modified:
>   head/sys/amd64/amd64/support.S
>   head/sys/conf/files.amd64
>
> Modified: head/sys/amd64/amd64/support.S
> ==
> --- head/sys/amd64/amd64/support.SMon May  7 15:07:26 2018
> (r23)
> +++ head/sys/amd64/amd64/support.SMon May  7 15:07:28 2018
> (r24)
> @@ -162,6 +162,58 @@ ENTRY(bcopy)
>  END(bcopy)
>
>  /*
> + * memmove(dst, src, cnt)
> + * rdi, rsi, rdx
> + * Original by:
> + *  w...@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
> + */
> +ENTRY(memmove)
> + PUSH_FRAME_POINTER
> + movq%rdi,%r9
> + movq%rdx,%rcx
> +
> + movq%rdi,%rax
> + subq%rsi,%rax
> + cmpq%rcx,%rax   /* overlapping && src < dst? */
> + jb  1f
> +
> + shrq$3,%rcx /* copy by 64-bit words */
> + rep
> + movsq
> + movq%rdx,%rcx
> + andq$7,%rcx /* any bytes left? */
> + rep
> + movsb
> + movq%r9,%rax
> + POP_FRAME_POINTER
> + ret
> +
> + /* ALIGN_TEXT */
> +1:
> + addq%rcx,%rdi   /* copy backwards */
> + addq%rcx,%rsi
> + decq%rdi
> + decq%rsi
> + andq$7,%rcx /* any fractional bytes? */
> + std
> + rep
> + movsb
> + movq%rdx,%rcx   /* copy remainder by 32-bit 
> words */
> + shrq$3,%rcx
> + subq$7,%rsi
> + subq$7,%rdi
> + rep
> + movsq
> + cld
> + movq%r9,%rax
> + POP_FRAME_POINTER
> + ret
> +END(memmove)
> +
> +/*
> + * memcpy(dst, src, len)
> + *rdi, rsi, rdx
> + *
>   * Note: memcpy does not support overlapping copies
>   */
>  ENTRY(memcpy)
> @@ -178,6 +230,27 @@ ENTRY(memcpy)
>   POP_FRAME_POINTER
>   ret
>  END(memcpy)
> +
> +/*
> + * memset(dst, c,   len)
> + *rdi, rsi, rdx
> + */
> +ENTRY(memset)
> + PUSH_FRAME_POINTER
> + movq%rdi,%r9
> + movq%rdx,%rcx
> + movq%rsi,%rax
> + shrq$3,%rcx
> + rep
> + stosq

According to Intel SDM stosq stores the whole RAX into destination,
and then increments the destination register with 8. This
implementation is wrong, since the c is a char, and the The RAX looks
like 00CC, so the stored patter would be 00CC * SIZE / 8 * 8 +
CC * SIZE % 8 in destination buffer.

> + movq%rdx,%rcx
> + andq$7,%rcx
> + rep
> + stosb
> + movq%r9,%rax
> + POP_FRAME_POINTER
> + ret
> +END(memset)
>
>  /*
>   * pagecopy(%rdi=from, %rsi=to)
>
> Modified: head/sys/conf/files.amd64
> ==
> --- head/sys/conf/files.amd64 Mon May  7 15:07:26 2018(r23)
> +++ head/sys/conf/files.amd64 Mon May  7 15:07:28 2018(r24)
> @@ -620,8 +620,6 @@ isa/vga_isa.c optionalvga
>  kern/kern_clocksource.c  standard
>  kern/link_elf_obj.c  standard
>  libkern/x86/crc32_sse42.cstandard
> -libkern/memmove.cstandard
> -libkern/memset.c standard
>  #
>  # IA32 binary support
>  #
> ___
> svn-src-h...@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-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: r332994 - head/sys/amd64/amd64

2018-04-25 Thread Oliver Pinter
On Wednesday, April 25, 2018, Tycho Nightingale  wrote:

> Author: tychon
> Date: Wed Apr 25 14:21:13 2018
> New Revision: 332994
> URL: https://svnweb.freebsd.org/changeset/base/332994
>
> Log:
>   If a trap is encountered upon executing iretq from within doreti() the
>   hardware will ensure the stack pointer is aligned to a 16-byte
>   boundary before saving the fault state on the stack.
>
>   In the PTI case, handle this potential alignment adjustment by copying
>   both frames independently while unwinding the stack in between.
>
>   Reviewed by:  kib
>   Sponsored by: Dell EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D15183


Is there any plan to MFC this commit?


>
> Modified:
>   head/sys/amd64/amd64/exception.S
>
> Modified: head/sys/amd64/amd64/exception.S
> 
> ==
> --- head/sys/amd64/amd64/exception.SWed Apr 25 13:23:58 2018
> (r332993)
> +++ head/sys/amd64/amd64/exception.SWed Apr 25 14:21:13 2018
> (r332994)
> @@ -341,6 +341,9 @@ page_cr2:
>  * On the stack, we have the hardware interrupt frame to return
>  * to usermode (faulted) and another frame with error code, for
>  * fault.  For PTI, copy both frames to the main thread stack.
> +* Handle the potential 16-byte alignment adjustment incurred
> +* during the second fault by copying both frames independently
> +* while unwinding the stack in between.
>  */
> .macro PROTF_ENTRY name,trapno
>  \name\()_pti_doreti:
> @@ -351,7 +354,11 @@ page_cr2:
> movq%rax,%cr3
> movqPCPU(RSP0),%rax
> subq$2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted
> frame */
> -   MOVE_STACKS (PTI_SIZE / 4 - 3)
> +   MOVE_STACKS (PTI_SIZE / 8)
> +   addq$PTI_SIZE,%rax
> +   movqPTI_RSP(%rsp),%rsp
> +   MOVE_STACKS (PTI_SIZE / 8 - 3)
> +   subq$PTI_SIZE,%rax
> movq%rax,%rsp
> popq%rdx
> popq%rax
> ___
> svn-src-h...@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-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: r332471 - head/sys/dev/ocs_fc

2018-04-13 Thread Oliver Pinter
On Friday, April 13, 2018, Ram Kishore Vegesna  wrote:

> Author: ram
> Date: Fri Apr 13 13:31:20 2018
> New Revision: 332471
> URL: https://svnweb.freebsd.org/changeset/base/332471
>
> Log:
>   Check if STACK is defined before using the stack(9).
>
>   PR: 227446
>   Reported by: emaste
>   Approved by: ken
>
> Modified:
>   head/sys/dev/ocs_fc/ocs_os.c
>
> Modified: head/sys/dev/ocs_fc/ocs_os.c
> 
> ==
> --- head/sys/dev/ocs_fc/ocs_os.cFri Apr 13 13:23:31 2018
> (r332470)
> +++ head/sys/dev/ocs_fc/ocs_os.cFri Apr 13 13:31:20 2018
> (r332471)
> @@ -37,6 +37,7 @@
>   */
>
>  #include "ocs.h"
> +#include "opt_stack.h"


These types of includes - where you includes opts - should go before any
other includes.



>  #include 
>  #include 
>  #include /* for debug of memory allocations
> */
> @@ -855,11 +856,13 @@ void ocs_intr_enable(ocs_os_handle_t os)
>
>  void ocs_print_stack(void)
>  {
> +#if defined(STACK)
> struct stack st;
>
> stack_zero(&st);
> stack_save(&st);
> stack_print(&st);
> +#endif
>  }
>
>  void ocs_abort(void)
> ___
> svn-src-h...@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-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: r331880 - stable/11/etc

2018-04-09 Thread Oliver Pinter
On Monday, April 9, 2018, Warner Losh  wrote:

> On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans  wrote:
>
> > Right- so, back out this MFC (and the subsequent FreeBSD_version bump)
> > and fix the ports to do the right thing for 12.x while that's still
> > not a technically supported branch?
>
>
> Don't back out the version bump. Other things may be riding along on it
> 'for free'. Better to bump it again when you unMFC (if it's been more than
> a few days since we've had one), and then yet-again when a fixed MFC
> happens. Unless there's something you can ride along on for free :)
>
> Otherwise, that's a great plan.


What's about "direction Z"? Like moving find to /bin and do a compatibility
symlink for them from /usr/bin?


>
> Warner
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to "
> svn-src-stable-11-unsubscr...@freebsd.org"
>
___
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: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/

2018-04-06 Thread Oliver Pinter
On 4/6/18, John Baldwin  wrote:
> On Monday, April 02, 2018 12:27:47 PM Ed Maste wrote:
>> On 31 March 2018 at 14:41, Mark Linimon  wrote:
>> This is the most important point of this discussion: we do need to
>> ensure there's good communication and coordination between teams where
>> dependencies like this exist. I'll take the blame here: Dimitry asked
>> me about merging the Clang update to stable/11 and I agreed that it
>> was reasonable to merge sooner rather than later to have as much lead
>> time as possible before the 11.2 process starts. I also assumed that
>> outstanding Clang 6 issues in ports were farther along in being
>> addressed.
>>
>> The key lesson from this discussion is that for significant commits
>> and merges like this one we should make sure to always have sufficient
>> advance notice.
>
> Is this driven by -mretpoline?

Don't think so since it requires LLD as linker. The LLVM 5 which was already
part of the 11-stable has the retpoline option. See r331219.

>From other side, I like to see a newer compiler sets in the recent
releases, because
there are lot of performance improvements and other fixes.

> That is, would we not be as aggressive
> with pushing for clang 6 in 11.2 if it weren't for that?  I kind of feel
> like we probably wouldn't and would have left it at 5 and let clang 6 be
> a FreeBSD 12 thing.  Was -mretpoline backported to clang 5 (I thought
> there was some talk of providing patches for clang 5)?
>
> --
> John Baldwin
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscr...@freebsd.org"
>
___
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: r330897 - in stable/11: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps b

2018-03-28 Thread Oliver Pinter
On 3/28/18, Oliver Pinter  wrote:
> On 3/28/18, Oliver Pinter  wrote:
>> Hi!
>>
>> This part of the MFC is wrong:
>>
>> https://svnweb.freebsd.org/base/stable/11/sys/sys/random.h?limit_changes=0&r1=330897&r2=330896&pathrev=330897
>>
>> Could you please MFC back the other random related changes too? Some
>> of them made by cem@.
>
> Namely these commits:
>
> commit b95744ba0ac2f46a95ecbe423a4d8dd7c9513da0
> Author: Oliver Pinter 
> Date:   Sun Oct 15 17:15:48 2017 +0200
>
> opBSD MFC r324394: random(4): Gather entropy from Pure sources
>
> At initialization, hc_source_mask only includes non-Pure sources.
>
> The patch changes source registration to enable the registered source in
> the
> hc_source_mask bitmask. This mask governs which sources are harvested.
>
> This patch also disallows userspace from disabling such sources.
>
> PR: 222807
> Submitted by:   W. Dean Freeman 
> Reviewed by:jmg (earlier version), delphij
> Approved by:secteam (delphij)
> Obtained from:  HBSD 0054e3e170e083811acc9f3b637f8be8a86c03e7
> Security:   yes
> Differential Revision:  https://reviews.freebsd.org/D12611
>
> (cherry picked from commit 1c36667f647c87c89227b495e8a79ff1d38a2d31)
>
> Author: cem 
> Original-commit-date: Sat Oct 7 19:02:03 2017 +0000
> svn-commit-id: /head/ r324394
> Signed-off-by: Oliver Pinter 
>
> commit 6c94c5ce8a5b3ed5dec3bb0437da293de1da22fc
> Author: Oliver Pinter 
> Date:   Sun Oct 15 17:15:43 2017 +0200
>
> opBSD MFC r324393: random(4): Add missing source descriptions
>
> Add source descriptions missed in r260847, r303035.
>
> While here, convert the array to C99 initializers.
>
> Reviewed by:delphij
> Approved by:secteam (delphij)
> Sponsored by:   Dell EMC Isilon
> Differential Revision:  https://reviews.freebsd.org/D12618
>
> (cherry picked from commit 25edb3fc554994c75b6282d88b1dd960fd476737)
>
> Adopted to 11-STABLE since arm/broadcom/bcm2835/bcm2835_rng.c
> does not exists here.
>
> Author: cem 
> Original-commit-date: Sat Oct 7 18:59:29 2017 +
> svn-commit-id: /head/ r324393
> Signed-off-by: Oliver Pinter 
>
> commit 28fc9178aca64f2fec46e2753187b35bcab8e962
> Author: Oliver Pinter 
> Date:   Sun Oct 15 17:15:37 2017 +0200
>
> opBSD MFC r324372: random(4): Discard low entropy inputs
>
> The later fields of the harvest_event structure are predictable and
> provide
> little value to the entropy pool.  Only feed in the relatively high
> entropy
> counter and explicit entropy buffer to increase measured input entropy.
>
> See also:
> https://people.freebsd.org/~jmg/vbsdcon_2017_ddfreebsdrng_slides.pdf
>
> PR: 222807
> Submitted by:   W. Dean Freeman 
> Reviewed by:jmg (earlier version), delphij
> Approved by:secteam (delphij)
> Obtained from:  HBSD 8d809124d563937edd84c9c9d5494406e359c55c
> Security:   no -- low entropy marginal input has no known
> negative affect on pool quality
> Differential Revision:  https://reviews.freebsd.org/D12610
>
> (cherry picked from commit 1d234c562d594d49fd330eef90cd1b8f0e73f8fa)
>
> Author: cem 
> Original-commit-date: Fri Oct 6 18:27:55 2017 +
> svn-commit-id: /head/ r324372
> Signed-off-by: Oliver Pinter 
>

Or please apply the attached patch.

>
>>
>> On 3/14/18, Eitan Adler  wrote:
>>> Author: eadler
>>> Date: Wed Mar 14 03:19:51 2018
>>> New Revision: 330897
>>> URL: https://svnweb.freebsd.org/changeset/base/330897
>>>
>
> [... trim ...]
>
From 38d9b670806c64c31f49f425707d59aad89b6246 Mon Sep 17 00:00:00 2001
From: Oliver Pinter 
Date: Wed, 28 Mar 2018 20:26:30 +0200
Subject: [PATCH] opBSD: revert misMFCd parts of sys/sys/random.h

Signed-off-by: Oliver Pinter 

diff --git a/sys/sys/random.h b/sys/sys/random.h
index 9e03e5ef6527..26764851d00c 100644
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -60,9 +60,9 @@ read_random(void *a __unused, u_int b __unused)
 #endif
 
 /*
- * Note: if you add or remove members of random_entropy_source, remember to
- * also update the strings in the static array random_source_descr[] in
- * random_harvestq.c.
+ * Note: if you add or remove members of random_entropy_source, remember to 
also update the
+ * KASSERT regarding what valid members are in random_harvest_internal(), and 
remember the
+ * strings in the static array random_source_descr[] in random_harvestq.c.
  *
  * NOTE: complain loudly to markm@ or on the lists if this enum gets more than 
32
  * distinct value

Re: svn commit: r330897 - in stable/11: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps b

2018-03-28 Thread Oliver Pinter
On 3/28/18, Oliver Pinter  wrote:
> Hi!
>
> This part of the MFC is wrong:
>
> https://svnweb.freebsd.org/base/stable/11/sys/sys/random.h?limit_changes=0&r1=330897&r2=330896&pathrev=330897
>
> Could you please MFC back the other random related changes too? Some
> of them made by cem@.

Namely these commits:

commit b95744ba0ac2f46a95ecbe423a4d8dd7c9513da0
Author: Oliver Pinter 
Date:   Sun Oct 15 17:15:48 2017 +0200

opBSD MFC r324394: random(4): Gather entropy from Pure sources

At initialization, hc_source_mask only includes non-Pure sources.

The patch changes source registration to enable the registered source in the
hc_source_mask bitmask. This mask governs which sources are harvested.

This patch also disallows userspace from disabling such sources.

PR: 222807
Submitted by:   W. Dean Freeman 
Reviewed by:jmg (earlier version), delphij
Approved by:secteam (delphij)
Obtained from:  HBSD 0054e3e170e083811acc9f3b637f8be8a86c03e7
Security:   yes
Differential Revision:  https://reviews.freebsd.org/D12611

(cherry picked from commit 1c36667f647c87c89227b495e8a79ff1d38a2d31)

Author: cem 
Original-commit-date: Sat Oct 7 19:02:03 2017 +
svn-commit-id: /head/ r324394
Signed-off-by: Oliver Pinter 

commit 6c94c5ce8a5b3ed5dec3bb0437da293de1da22fc
Author: Oliver Pinter 
Date:   Sun Oct 15 17:15:43 2017 +0200

opBSD MFC r324393: random(4): Add missing source descriptions

Add source descriptions missed in r260847, r303035.

While here, convert the array to C99 initializers.

Reviewed by:delphij
Approved by:secteam (delphij)
Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D12618

(cherry picked from commit 25edb3fc554994c75b6282d88b1dd960fd476737)

Adopted to 11-STABLE since arm/broadcom/bcm2835/bcm2835_rng.c
does not exists here.

Author: cem 
Original-commit-date: Sat Oct 7 18:59:29 2017 +
svn-commit-id: /head/ r324393
Signed-off-by: Oliver Pinter 

commit 28fc9178aca64f2fec46e2753187b35bcab8e962
Author: Oliver Pinter 
Date:   Sun Oct 15 17:15:37 2017 +0200

opBSD MFC r324372: random(4): Discard low entropy inputs

The later fields of the harvest_event structure are predictable and provide
little value to the entropy pool.  Only feed in the relatively high entropy
counter and explicit entropy buffer to increase measured input entropy.

See also:
https://people.freebsd.org/~jmg/vbsdcon_2017_ddfreebsdrng_slides.pdf

PR: 222807
Submitted by:   W. Dean Freeman 
Reviewed by:jmg (earlier version), delphij
Approved by:secteam (delphij)
Obtained from:  HBSD 8d809124d563937edd84c9c9d5494406e359c55c
Security:   no -- low entropy marginal input has no known
negative affect on pool quality
Differential Revision:  https://reviews.freebsd.org/D12610

(cherry picked from commit 1d234c562d594d49fd330eef90cd1b8f0e73f8fa)

Author: cem 
Original-commit-date: Fri Oct 6 18:27:55 2017 +
svn-commit-id: /head/ r324372
Signed-off-by: Oliver Pinter 


>
> On 3/14/18, Eitan Adler  wrote:
>> Author: eadler
>> Date: Wed Mar 14 03:19:51 2018
>> New Revision: 330897
>> URL: https://svnweb.freebsd.org/changeset/base/330897
>>

[... trim ...]
___
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: r331252 - in head/sys/amd64: amd64 include

2018-03-20 Thread Oliver Pinter
On Tuesday, March 20, 2018, Konstantin Belousov  wrote:

> Author: kib
> Date: Tue Mar 20 17:43:50 2018
> New Revision: 331252
> URL: https://svnweb.freebsd.org/changeset/base/331252
>
> Log:
>   Provide KPI for handling of rw/ro kernel text.
>
>   This is a pure syntax patch to create an interface to enable and later
>   restore write access to the kernel text and other read-only mapped
>   regions.  It is in line with e.g. vm_fault_disable_pagefaults() by
>   allowing the nesting.
>
>   Discussed with:   Peter Lei 
>   Reviewed by:  jtl
>   Sponsored by: The FreeBSD Foundation
>   MFC after:1 week
>   Differential revision:https://reviews.freebsd.org/D14768
>
> Modified:
>   head/sys/amd64/amd64/db_interface.c
>   head/sys/amd64/amd64/gdb_machdep.c
>   head/sys/amd64/amd64/machdep.c
>   head/sys/amd64/include/md_var.h
>
> Modified: head/sys/amd64/amd64/db_interface.c
> 
> ==
> --- head/sys/amd64/amd64/db_interface.c Tue Mar 20 17:41:54 2018
> (r331251)
> +++ head/sys/amd64/amd64/db_interface.c Tue Mar 20 17:43:50 2018
> (r331252)
> @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>
>  #include 
> +#include 
>  #include 
>
>  #include 
> @@ -75,19 +76,19 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da
> jmp_buf jb;
> void *prev_jb;
> char *dst;
> -   u_long cr0save;
> +   bool old_wp;
> int ret;
>
> -   cr0save = rcr0();
> +   old_wp = false;


This line should be
old_wp = (rcr0() & CR0_WP) ? true : false;
to preserve the old behavior in ret != 0 case.


> prev_jb = kdb_jmpbuf(jb);
> ret = setjmp(jb);
> if (ret == 0) {
> -   load_cr0(cr0save & ~CR0_WP);
> +   old_wp = disable_wp();
> dst = (char *)addr;
> while (size-- > 0)
> *dst++ = *data++;
> }
> -   load_cr0(cr0save);
> +   restore_wp(old_wp);
> (void)kdb_jmpbuf(prev_jb);
> return (ret);
>  }
>
> Modified: head/sys/amd64/amd64/gdb_machdep.c
> 
> ==
> --- head/sys/amd64/amd64/gdb_machdep.c  Tue Mar 20 17:41:54 2018
> (r331251)
> +++ head/sys/amd64/amd64/gdb_machdep.c  Tue Mar 20 17:43:50 2018
> (r331252)
> @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -127,17 +128,14 @@ gdb_cpu_signal(int type, int code)
>  void *
>  gdb_begin_write(void)
>  {
> -   u_long cr0save;
>
> -   cr0save = rcr0();
> -   load_cr0(cr0save & ~CR0_WP);
> -   return ((void *)cr0save);
> +   return (disable_wp() ? &gdb_begin_write : NULL);
>  }
>
>  void
>  gdb_end_write(void *arg)
>  {
>
> -   load_cr0((u_long)arg);
> +   restore_wp(arg != NULL);
>  }
>
>
> Modified: head/sys/amd64/amd64/machdep.c
> 
> ==
> --- head/sys/amd64/amd64/machdep.c  Tue Mar 20 17:41:54 2018
> (r331251)
> +++ head/sys/amd64/amd64/machdep.c  Tue Mar 20 17:43:50 2018
> (r331252)
> @@ -2597,6 +2597,31 @@ clear_pcb_flags(struct pcb *pcb, const u_int flags)
> : "cc", "memory");
>  }
>
> +/*
> + * Enable and restore kernel text write permissions.
> + * Callers must ensure that disable_wp()/restore_wp() are executed
> + * without rescheduling on the same core.
> + */
> +bool
> +disable_wp(void)
> +{
> +   u_int cr0;
> +
> +   cr0 = rcr0();
> +   if ((cr0 & CR0_WP) == 0)
> +   return (false);
> +   load_cr0(cr0 & ~CR0_WP);
> +   return (true);
> +}
> +
> +void
> +restore_wp(bool old_wp)
> +{
> +
> +   if (old_wp)
> +   load_cr0(rcr0() | CR0_WP);
> +}
> +
>  #ifdef KDB
>
>  /*
>
> Modified: head/sys/amd64/include/md_var.h
> 
> ==
> --- head/sys/amd64/include/md_var.h Tue Mar 20 17:41:54 2018
> (r331251)
> +++ head/sys/amd64/include/md_var.h Tue Mar 20 17:43:50 2018
> (r331252)
> @@ -53,6 +53,8 @@ void  amd64_conf_fast_syscall(void);
>  void   amd64_db_resume_dbreg(void);
>  void   amd64_lower_shared_page(struct sysentvec *);
>  void   amd64_syscall(struct thread *td, int traced);
> +bool   disable_wp(void);
> +void   restore_wp(bool old_wp);
>  void   doreti_iret(void) __asm(__STRING(doreti_iret));
>  void   doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
>  void   ld_ds(void) __asm(__STRING(ld_ds));
> ___
> svn-src-h...@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-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all

Re: svn commit: r319510 - head/contrib/xz/src/liblzma/check

2018-03-19 Thread Oliver Pinter
On Sunday, March 18, 2018, Eitan Adler  wrote:

> On 2 June 2017 at 19:42, Ed Maste  wrote:
> > Author: emaste
> > Date: Sat Jun  3 02:42:49 2017
> > New Revision: 319510
> > URL: https://svnweb.freebsd.org/changeset/base/319510
> >
> > Log:
> >   xz: set noexec stack flag on FreeBSD
>
> Heya. Is this one safe to MFC ?


I think go for it.


>
>
>
> --
> Eitan Adler
> ___
> svn-src-h...@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-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: r331212 - in head: etc/mtree stand/defaults

2018-03-19 Thread Oliver Pinter
On Monday, March 19, 2018, Kyle Evans  wrote:

> Author: kevans
> Date: Mon Mar 19 16:16:12 2018
> New Revision: 331212
> URL: https://svnweb.freebsd.org/changeset/base/331212
>
> Log:
>   Move /boot/overlays to /boot/dtb/overlays
>
>
Hi!

Do you plan to add the old files to ObsoleteFiles.inc?


>   The former is fairly vague; these are FDT overlays to be applied to the
>   running system, so /boot/dtb is a sensible location to put it without
>   cluttering up /boot/dtb even further if desired.
>
> Modified:
>   head/etc/mtree/BSD.root.dist
>   head/stand/defaults/loader.conf
>
> Modified: head/etc/mtree/BSD.root.dist
> 
> ==
> --- head/etc/mtree/BSD.root.distMon Mar 19 15:48:31 2018
> (r331211)
> +++ head/etc/mtree/BSD.root.distMon Mar 19 16:16:12 2018
> (r331212)
> @@ -11,6 +11,8 @@
>  defaults
>  ..
>  dtb
> +overlays  tags=package=runtime
> +..
>  ..
>  firmware
>  ..
> @@ -19,8 +21,6 @@
>  kernel
>  ..
>  modules
> -..
> -overlays  tags=package=runtime
>  ..
>  zfs
>  ..
>
> Modified: head/stand/defaults/loader.conf
> 
> ==
> --- head/stand/defaults/loader.conf Mon Mar 19 15:48:31 2018
> (r331211)
> +++ head/stand/defaults/loader.conf Mon Mar 19 16:16:12 2018
> (r331212)
> @@ -80,7 +80,7 @@ bootenv_autolist="YES"# Auto populate
> the list of ZF
>  #comconsole_speed="9600"   # Set the current serial console speed
>  #console="vidconsole"  # A comma separated list of console(s)
>  #currdev="disk1s1a"# Set the current device
> -module_path="/boot/modules;/boot/dtb;/boot/overlays"   # Set the module
> search path
> +module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays"   # Set the
> module search path
>  #prompt="\\${interpret}"   # Set the command prompt
>  #root_disk_unit="0"# Force the root disk unit number
>  #rootdev="disk1s1a"# Set the root filesystem
> ___
> svn-src-h...@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-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: r330972 - stable/11/share/misc

2018-03-16 Thread Oliver Pinter
On 3/16/18, Rodney W. Grimes  wrote:
>> On Thu, 15 Mar 2018, Rodney W. Grimes wrote:
>>
>> >> On 15/03/2018 10:30, Eitan Adler wrote:
>> >>> ...
>> >>> Log:
>> >>>   MFC
>> >>> r303063,r311852,r311930,r317040,r320506,r321301,r325162,r326759,r329004,:
>> >> I have never seen things like these MFC-ed before...
>> >> Should we be really doing them?
>> >
>> > Yes, imho.  And the reasons may seem odd to sum, but here is my spin on
>> > this:
>> > ...
>> > Maybe we should even add to the end of the commiters "these are the
>> > things you should do as a new committer" the merging of your info
>> > into to all supported/active releases.  Which is a good opportunity
>> > for teaching how to do svn sparse checkouts as you really do not
>> > want to pull all of stable/10 out just to commit to 1 file.
>>
>> Actually, it is necessary to check out everything to MFC to 1 file.
>> Sparse checkouts only work for committing to head.  They break mergeinfo
>> for MFCs.  Or so I was told when I MFCed with a sparse checkout.  This is
>> my excuse for not MFC'ing anything.
>
> The procedure for a branch is harder, you can do sparse, you just
> have to do the tree one level at a time in sparse mode until you
> get to the leaf you want to commit at.
>
> Then you do the merge at the top of the sparse tree,
> then commit:
>
> (Recent example done to help someone with there first MFC:)
>
> #!/bin/sh
> mkdir ~/svnwork.r328011
> cd ~/svnwork.r328011
> svn checkout svn+ssh://repo.freebsd.org/base --depth immediates
>
> cd base/stable && svn update --set-depth=immediates
> cd 11 && svn update --set-depth=immediates
> cd sys && svn update --set-depth=immediates
> cd amd64 && svn update --set-depth=infinity
>
> cd ~/svnwork.r328011/base/stable/11
> svn merge -c r328011,r329162 ^/head
> svn diff >~/svnwork.r328011/diff.OUT
>
>
> You now no longer have that excuse :-)

wow, this looks like a brutal overhead... :-\

If I want to pull up a specific file to a specific version with git, I
have two options:
a) a proper way
a.0) git checkout target_branch
a.1) git log origin_branch -- path/file
a.2) collect the commit ids from the above command
a.3) foreach i ( collected ids ) git cherry-pick $i

b) the lazy mode
b.0) git checkout target_branch
b.1) git show target_branch:./path/file > ./path/file
b.2) git commit -a

the b.1) point will be a git show id:./path/file > ./path/file too,
where the id is an exact git commit id

>
> --
> Rod Grimes
> rgri...@freebsd.org
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscr...@freebsd.org"
>
___
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: r331021 - stable/11/sys/dev/efidev

2018-03-15 Thread Oliver Pinter
On 3/15/18, Kyle Evans  wrote:
> Author: kevans
> Date: Thu Mar 15 19:41:26 2018
> New Revision: 331021
> URL: https://svnweb.freebsd.org/changeset/base/331021
>
> Log:
>   r322279: Don't create /dev/efi without EFI runtime
Hi!

Is this an MFC or a direct commit to 11-stable?


>
>   Turns out to be even simpler to just not create /dev/efi if we don't
>   have a efi runtime.
>
> Modified:
>   stable/11/sys/dev/efidev/efidev.c
> Directory Properties:
>   stable/11/   (props changed)
>
> Modified: stable/11/sys/dev/efidev/efidev.c
> ==
> --- stable/11/sys/dev/efidev/efidev.c Thu Mar 15 19:32:33 2018
> (r331020)
> +++ stable/11/sys/dev/efidev/efidev.c Thu Mar 15 19:41:26 2018
> (r331021)
> @@ -39,28 +39,15 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>
> -static d_open_t efidev_open;
>  static d_ioctl_t efidev_ioctl;
>
>  static struct cdevsw efi_cdevsw = {
>   .d_name = "efi",
>   .d_version = D_VERSION,
> - .d_open = efidev_open,
>   .d_ioctl = efidev_ioctl,
>  };
>   
>  static int
> -efidev_open(struct cdev *dev __unused, int oflags __unused,
> -int devtype __unused, struct thread *td __unused)
> -{
> - /*
> -  * Only return success when we have an actual runtime to call.
> -  */
> -
> - return efi_rt_ok();
> -}
> -
> -static int
>  efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr,
>  int flags __unused, struct thread *td __unused)
>  {
> @@ -195,6 +182,11 @@ efidev_modevents(module_t m, int event, void *arg __un
>
>   switch (event) {
>   case MOD_LOAD:
> + /*
> +  * If we have no efi environment, then don't create the device.
> +  */
> + if (efi_rt_ok() != 0)
> + return (0);
>   make_dev_args_init(&mda);
>   mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME;
>   mda.mda_devsw = &efi_cdevsw;
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscr...@freebsd.org"
>
___
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: r330972 - stable/11/share/misc

2018-03-15 Thread Oliver Pinter
On Thursday, March 15, 2018, Warner Losh  wrote:

> On Thu, Mar 15, 2018 at 10:31 AM, Warner Losh  wrote:
>
> >
> >
> > On Thu, Mar 15, 2018 at 10:20 AM, Ian Lepore  wrote:
> >
> >> On Thu, 2018-03-15 at 09:14 -0700, Rodney W. Grimes wrote:
> >> > >
> >> > > On Thu, 2018-03-15 at 10:52 -0500, Justin Hibbits wrote:
> >> > > >
> >> > > > On Thu, Mar 15, 2018 at 10:46 AM, Ian Lepore 
> >> > > > wrote:
> >> > > > >
> >> > > > >
> >> > > > > I agree completely with all of this.??It bothers me how many
> >> > > > > committers
> >> > > > > have the attitude that handling MFCs is not part of being a
> >> > > > > committer.
> >> > > > Never attribute to arrogance that which can adequately be
> >> > > > explained
> >> > > > by
> >> > > > sheer laziness ;)
> >> > > >
> >> > > > - Justin (guilty of marking changes as MFC after, and ignoring
> >> > > > them
> >> > > > for far too long)
> >> > > >
> >> > > Laziness and procrastination I understand -- I own a lovely glass
> >> > > house
> >> > > in that neighborhood. ?I tend to put off MFCs for way too long then
> >> > > every few months have to spend a whole weekend catching up.
> >> > MFC: 1 week (by pool|self)#defaults to self if missing
> >> >
> >> > There is already a very nice tracking tool for outstanding MFC's,
> >> > if we added a bit of smarts in its parser, and created a pool of
> >> > MFC commiters (Eitan seems to have started one :-)) those who
> >> > do not want to do there own MFC work could pass the hat.
> >>
> >> If you're talking about the MFC after: field in commits, I don't use
> >> it. I have about zero tolerance for being nagged by anybody about
> >> anything, and that goes double for robots nagging me with spam mail.
> >>
> >> The MFC tool that works well for me is gonzo's MFCTracker site [*] that
> >> doesn't require extra markup in the commit messages.
> >>
> >
> > I also have a MFC tool for git, but it's n
> >
>
> [[ stupid track pad and too easy button pushes... ]]
>
> but it's not ready for prime time. It's useful if you have a list of things
> you want to MFC for playing them onto the stable branch so you can test
> before committing to svn stable. It shows the big issues with moving to git
> as the source of truth, though. We have way too much traffic in the repo to
> have git cherry to produce any kind of reasonable output (too many changes,
> can't restrict to a subset of the tree, no way to check prior commits to
> files affected, etc), and the git cherry-pick command relies a bit too much
> on the merge magic, so it doesn't record merges (there is no merge-info in
> git).
>
> However, I could dust off the tool and fix up the rough edges if there's
> any interest at all. Kyle Evans used it to MFC my crazy src/stand stuff...
>
>
I use this script to merge / cherry-pick changes from master:
https://github.com/opntr/opBSD-ng-tools/blob/master/git/opBSD_mfc.sh


> Warner
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to "
> svn-src-stable-11-unsubscr...@freebsd.org"
>
___
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: r302595 - in head/sys: kern net

2018-03-08 Thread Oliver Pinter
On 7/11/16, Nathan Whitehorn  wrote:
> Author: nwhitehorn
> Date: Mon Jul 11 21:25:28 2016
> New Revision: 302595
> URL: https://svnweb.freebsd.org/changeset/base/302595
>
> Log:
>   Remove assumptions in MI code that the BSP is CPU 0.
>
>   MFC after:  2 weeks

Please MFC this commit to 11-STABLE, since without them, we encounter
boot issues with enabled EARLY_AP_STARTUP.

Thanks,
Oliver

>
> Modified:
>   head/sys/kern/init_main.c
>   head/sys/net/netisr.c
>
> Modified: head/sys/kern/init_main.c
> ==
> --- head/sys/kern/init_main.c Mon Jul 11 21:23:50 2016(r302594)
> +++ head/sys/kern/init_main.c Mon Jul 11 21:25:28 2016(r302595)
> @@ -495,7 +495,7 @@ proc0_init(void *dummy __unused)
>   td->td_lend_user_pri = PRI_MAX;
>   td->td_priority = PVM;
>   td->td_base_pri = PVM;
> - td->td_oncpu = 0;
> + td->td_oncpu = curcpu;
>   td->td_flags = TDF_INMEM;
>   td->td_pflags = TDP_KTHREAD;
>   td->td_cpuset = cpuset_thread0();
>
> Modified: head/sys/net/netisr.c
> ==
> --- head/sys/net/netisr.c Mon Jul 11 21:23:50 2016(r302594)
> +++ head/sys/net/netisr.c Mon Jul 11 21:25:28 2016(r302595)
> @@ -1273,8 +1273,6 @@ netisr_init(void *arg)
>   struct pcpu *pc;
>  #endif
>
> - KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__));
> -
>   NETISR_LOCK_INIT();
>   if (netisr_maxthreads == 0 || netisr_maxthreads < -1 )
>   netisr_maxthreads = 1;  /* default behavior */
> ___
> svn-src-h...@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-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: r330601 - head/sys/i386/ibcs2

2018-03-07 Thread Oliver Pinter
Wrong commit message. IBCS isn't cloudabi.

On Wednesday, March 7, 2018, Eitan Adler  wrote:

> Author: eadler
> Date: Wed Mar  7 14:44:32 2018
> New Revision: 330601
> URL: https://svnweb.freebsd.org/changeset/base/330601
>
> Log:
>   sys: Fix a few potential infoleaks in cloudabi
>
>   While there is no immediate leak, if the structure changes underneath
>   us, there might be in the future.
>
>   Submitted by: Domagoj Stolfa 
>   MFC After:1 month
>   Sponsored by: DARPA/AFRL
>
> Modified:
>   head/sys/i386/ibcs2/ibcs2_ipc.c
>
> Modified: head/sys/i386/ibcs2/ibcs2_ipc.c
> 
> ==
> --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:41:29 2018
> (r330600)
> +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar  7 14:44:32 2018
> (r330601)
> @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v)
> struct msqid_ds bs;
> int error;
>
> +   memset(&is, 0, sizeof(is));
> +
> switch (uap->cmd) {
> case IBCS2_IPC_STAT:
> error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs);
> @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v)
> union semun semun;
> register_t rval;
> int error;
> +
> +   memset(&is, 0, sizeof(is));
>
> switch(uap->cmd) {
> case IBCS2_IPC_STAT:
> ___
> svn-src-h...@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-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: r330539 - in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include

2018-03-06 Thread Oliver Pinter
X-MFC-with:

commit 27ac811b7acd31b1bdbf959fe49a957cdeabf780
Author: bde 
Date:   Fri Mar 24 17:34:55 2017 +

Remove buggy adjustment of page tables in db_write_bytes().

Long ago, perhaps only on i386, kernel text was mapped read-only and
it was necessary to change the mapping to read-write to set breakpoints
in kernel text.  Other writes by ddb to kernel text were also allowed.
This write protection is harder to implement with 4MB pages, and was
lost even for 4K pages when 4MB pages were implemented.  So changing
the mapping became useless.  It was actually worse than useless since
it followed followed various null and otherwise garbage pointers to
not change random memory instead of the mapping.  (On i386s, the
pointers became good in pmap_bootstrap(), and on amd64 the pointers
became bad in pmap_bootstrap() if not before.)

Another bug broke detection of following of null pointers on i386,
except early in boot where not detecting this was a feature.  When
I fixed the bug, I accidentally broke the feature and soon got traps
in db_write_bytes().  Setting breakpoints early in ddb was broken.

kib pointed out that a clean way to do the adjustment would be to use
a special [sub]map giving a small window on the bytes to be written.

The trap handler didn't know how to fix up errors for pagefaults
accessing the map itself.  Such errors rarely need fixups, since most
traps for the map are for the first access which is a read.

Reviewed by:kib

Notes:
svn path=/head/; revision=315914

On 3/6/18, Jonathan T. Looney  wrote:
> Author: jtl
> Date: Tue Mar  6 14:28:37 2018
> New Revision: 330539
> URL: https://svnweb.freebsd.org/changeset/base/330539
>
> Log:
>   amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits
>   correctly for the data contained on each memory page.
>
>   There are several components to this change:
>* Add a variable to indicate the start of the R/W portion of the
>  initial memory.
>* Stop detecting NX bit support for each AP.  Instead, use the value
>  from the BSP and, if supported, activate the feature on the other
>  APs just before loading the correct page table.  (Functionally, we
>  already assume that the BSP and all APs had the same support or
>  lack of support for the NX bit.)
>* Set the RW and NX bits correctly for the kernel text, data, and
>  BSS (subject to some caveats below).
>* Ensure DDB can write to memory when necessary (such as to set a
>  breakpoint).
>* Ensure GDB can write to memory when necessary (such as to set a
>  breakpoint).  For this purpose, add new MD functions gdb_begin_write()
>  and gdb_end_write() which the GDB support code can call before and
>  after writing to memory.
>
>   This change is not comprehensive:
>* It doesn't do anything to protect modules.
>* It doesn't do anything for kernel memory allocated after the kernel
>  starts running.
>* In order to avoid excessive memory inefficiency, it may let multiple
>  types of data share a 2M page, and assigns the most permissions
>  needed for data on that page.
>
>   Reviewed by:jhb, kib
>   Discussed with: emaste
>   MFC after:  2 weeks
>   Sponsored by:   Netflix
>   Differential Revision:  https://reviews.freebsd.org/D14282
>
> Modified:
>   head/sys/amd64/amd64/db_interface.c
>   head/sys/amd64/amd64/gdb_machdep.c
>   head/sys/amd64/amd64/initcpu.c
>   head/sys/amd64/amd64/mpboot.S
>   head/sys/amd64/amd64/pmap.c
>   head/sys/amd64/include/cpu.h
>   head/sys/amd64/include/gdb_machdep.h
>   head/sys/arm/include/gdb_machdep.h
>   head/sys/conf/ldscript.amd64
>   head/sys/gdb/gdb_packet.c
>   head/sys/i386/include/gdb_machdep.h
>   head/sys/mips/include/gdb_machdep.h
>   head/sys/powerpc/include/gdb_machdep.h
>   head/sys/sparc64/include/gdb_machdep.h
>
> Modified: head/sys/amd64/amd64/db_interface.c
> ==
> --- head/sys/amd64/amd64/db_interface.c   Tue Mar  6 14:18:45 2018
> (r330538)
> +++ head/sys/amd64/amd64/db_interface.c   Tue Mar  6 14:28:37 2018
> (r330539)
> @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>
> +#include 
> +#include 
> +
>  #include 
>
>  /*
> @@ -62,6 +65,9 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat
>
>  /*
>   * Write bytes to kernel address space for debugger.
> + * We need to disable write protection temporarily so we can write
> + * things (such as break points) that might be in write-protected
> + * memory.
>   */
>  int
>  db_write_bytes(vm_offset_t addr, size_t size, char *data)
> @@ -69,15 +75,19 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da
>   jmp_buf jb;
>   void *prev_jb;
>   char *dst;
> + u_long cr0save;
>   int ret;
>
> + cr0save = rcr0();
>   prev_jb = kdb_jmpbuf(jb);
>   r

Re: svn commit: r329649 - head/stand/liblua

2018-02-20 Thread Oliver Pinter
On Tuesday, February 20, 2018, Conrad Meyer  wrote:

> Author: cem
> Date: Tue Feb 20 18:21:30 2018
> New Revision: 329649
> URL: https://svnweb.freebsd.org/changeset/base/329649
>
> Log:
>   Lua lfs.attributes: Provide a more consistent error return
>
>   In the remaining error case, return a 3-tuple consistent with the other
>   error return case.
>
>   Document how to invoke lfs.attributes() and detect/decode error return in
>   example comments.
>
>   Reviewed by:  kevans
>   Sponsored by: Dell EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D14451
>
> Modified:
>   head/stand/liblua/lfs.c
>
> Modified: head/stand/liblua/lfs.c
> 
> ==
> --- head/stand/liblua/lfs.c Tue Feb 20 18:12:07 2018(r329648)
> +++ head/stand/liblua/lfs.c Tue Feb 20 18:21:30 2018(r329649)
> @@ -80,13 +80,20 @@ __FBSDID("$FreeBSD$");
>   * (etc.)
>   *
>   * The other available API is lfs.attributes(), which functions somewhat
> like
> - * stat(2) and returns a table of values:
> + * stat(2) and returns a table of values.  Example code:
>   *
> - * for k, v in pairs(lfs.attributes("/boot")) do
> + * attrs, errormsg, errorcode = lfs.attributes("/boot")
> + * if attrs == nil then
> + * print(errormsg)
> + * return errorcode
> + * end
> + *
> + * for k, v in pairs(attrs) do
>   * print(k .. ":\t" .. v)
>   * end
> + * return 0


Hi!

Missing  ; at the end of lines here.


>   *
> - * Prints:
> + * Prints (on success):
>   * gid:0
>   * change: 140737488342640
>   * mode:   directory
> @@ -277,7 +284,9 @@ lua_attributes(lua_State *L)
> path = luaL_checkstring(L, 1);
> if (path == NULL) {
> lua_pushnil(L);
> -   return 1;
> +   lua_pushfstring(L, "cannot convert first argument to
> string");
> +   lua_pushinteger(L, EINVAL);
> +   return 3;
> }
>
> rc = stat(path, &sb);
> ___
> svn-src-h...@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-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: r329154 - in head/etc: defaults devd

2018-02-12 Thread Oliver Pinter
On Monday, February 12, 2018, Alexey Dokuchaev  wrote:

> On Sun, Feb 11, 2018 at 10:55:48PM -0800, Cy Schubert wrote:
> > In message <201802120651.w1c6pkqf042...@repo.freebsd.org>, Warner Losh
> > writes:
> > > New Revision: 329154
> > > URL: https://svnweb.freebsd.org/changeset/base/329154
> > >
> > > Log:
> > >   Turn devmatch on by default.
> > >
> > >   Turn devmatch on by default. However, use 'start' instead of
> > >   'onestart' in the devmatch.conf file so the setting of
> > >   'devmatch_enable' is honored. Give an example of what to put in
> > >   devd.conf if you want to disable just the run-time part of devmatch.
> > >
> > > ...
> > > @@ -41,7 +41,7 @@ ddb_enable="NO"   # Set to YES to load ddb
> script
> > > s at b
> > >  ddb_config="/etc/ddb.conf" # ddb(8) config file.
> > >  devd_enable="YES"  # Run devd, to trigger programs on device tree
> changes.
> > >  devd_flags=""  # Additional flags for devd(8).
> > > -devmatch_enable="NO"   # Demand load kernel modules based on
> device ids.
> > > +devmatch_enable="YES"  # Demand load kernel modules based on
> device id
> > > s.
> >
> > This assumes that everyone has /usr in /. We might want to consider
> > moving devmatch to /sbin, or document that
>
> I was actually surprised to find out it's installed as /usr/sbin/devmatch;
> /sbin indeed looks more appropriate.
>
> > /usr and / be merged.
>
> Please don't.


There are already lot of separated / and /usr installations, so +1.


>
> ./danfe
> ___
> svn-src-h...@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-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: r328820 - in stable/11/sys/cam: . ata nvme scsi

2018-02-05 Thread Oliver Pinter
On Saturday, February 3, 2018, Alexander Motin  wrote:

> Author: mav
> Date: Fri Feb  2 23:22:58 2018
> New Revision: 328820
> URL: https://svnweb.freebsd.org/changeset/base/328820
>
> Log:
>   MFC r303468 (by imp):
>   Move protocol specific stuff into a linker set object that's
>   per-protocol. This reduces the number scsi symbols references by
>   cam_xpt significantly, and eliminates all ata / nvme symbols. There's
>   still some NVME / ATA specific code for dealing with XPT_NVME_IO and
>   XPT_ATA_IO respectively, and a bunch of scsi-specific code, but this
>   is progress.
>
>
Hi!

Once you finished with the cherry-picking of nvme related commits, could
you please bump the __FreeBSD_version and add them to release notes?



> Modified:
>   stable/11/sys/cam/ata/ata_xpt.c
>   stable/11/sys/cam/cam_xpt.c
>   stable/11/sys/cam/cam_xpt_internal.h
>   stable/11/sys/cam/nvme/nvme_xpt.c
>   stable/11/sys/cam/scsi/scsi_xpt.c
> Directory Properties:
>   stable/11/   (props changed)
>
> Modified: stable/11/sys/cam/ata/ata_xpt.c
> 
> ==
> --- stable/11/sys/cam/ata/ata_xpt.c Fri Feb  2 23:19:20 2018
> (r328819)
> +++ stable/11/sys/cam/ata/ata_xpt.c Fri Feb  2 23:22:58 2018
> (r328820)
> @@ -189,6 +189,11 @@ static void ata_dev_async(u_int32_t
> async_code,
> void *async_arg);
>  static void ata_action(union ccb *start_ccb);
>  static void ata_announce_periph(struct cam_periph *periph);
> +static void ata_proto_announce(struct cam_ed *device);
> +static void ata_proto_denounce(struct cam_ed *device);
> +static void ata_proto_debug_out(union ccb *ccb);
> +static void semb_proto_announce(struct cam_ed *device);
> +static void semb_proto_denounce(struct cam_ed *device);
>
>  static int ata_dma = 1;
>  static int atapi_dma = 1;
> @@ -215,6 +220,43 @@ ATA_XPT_XPORT(sata, SATA);
>
>  #undef ATA_XPORT_XPORT
>
> +static struct xpt_proto_ops ata_proto_ops_ata = {
> +   .announce = ata_proto_announce,
> +   .denounce = ata_proto_denounce,
> +   .debug_out = ata_proto_debug_out,
> +};
> +static struct xpt_proto ata_proto_ata = {
> +   .proto = PROTO_ATA,
> +   .name = "ata",
> +   .ops = &ata_proto_ops_ata,
> +};
> +
> +static struct xpt_proto_ops ata_proto_ops_satapm = {
> +   .announce = ata_proto_announce,
> +   .denounce = ata_proto_denounce,
> +   .debug_out = ata_proto_debug_out,
> +};
> +static struct xpt_proto ata_proto_satapm = {
> +   .proto = PROTO_SATAPM,
> +   .name = "satapm",
> +   .ops = &ata_proto_ops_satapm,
> +};
> +
> +static struct xpt_proto_ops ata_proto_ops_semb = {
> +   .announce = semb_proto_announce,
> +   .denounce = semb_proto_denounce,
> +   .debug_out = ata_proto_debug_out,
> +};
> +static struct xpt_proto ata_proto_semb = {
> +   .proto = PROTO_SEMB,
> +   .name = "semb",
> +   .ops = &ata_proto_ops_semb,
> +};
> +
> +CAM_XPT_PROTO(ata_proto_ata);
> +CAM_XPT_PROTO(ata_proto_satapm);
> +CAM_XPT_PROTO(ata_proto_semb);
> +
>  static void
>  probe_periph_init()
>  {
> @@ -2116,4 +2158,41 @@ ata_announce_periph(struct cam_periph *periph)
> printf(")");
> }
> printf("\n");
> +}
> +
> +static void
> +ata_proto_announce(struct cam_ed *device)
> +{
> +   ata_print_ident(&device->ident_data);
> +}
> +
> +static void
> +ata_proto_denounce(struct cam_ed *device)
> +{
> +   ata_print_ident_short(&device->ident_data);
> +}
> +
> +static void
> +semb_proto_announce(struct cam_ed *device)
> +{
> +   semb_print_ident((struct sep_identify_data *)&device->ident_data);
> +}
> +
> +static void
> +semb_proto_denounce(struct cam_ed *device)
> +{
> +   semb_print_ident_short((struct sep_identify_data
> *)&device->ident_data);
> +}
> +
> +static void
> +ata_proto_debug_out(union ccb *ccb)
> +{
> +   char cdb_str[(sizeof(struct ata_cmd) * 3) + 1];
> +
> +   if (ccb->ccb_h.func_code != XPT_ATA_IO)
> +   return;
> +
> +   CAM_DEBUG(ccb->ccb_h.path,
> +   CAM_DEBUG_CDB,("%s. ACB: %s\n", ata_op_string(&ccb->ataio.cmd)
> ,
> +   ata_cmd_string(&ccb->ataio.cmd, cdb_str,
> sizeof(cdb_str;
>  }
>
> Modified: stable/11/sys/cam/cam_xpt.c
> 
> ==
> --- stable/11/sys/cam/cam_xpt.c Fri Feb  2 23:19:20 2018(r328819)
> +++ stable/11/sys/cam/cam_xpt.c Fri Feb  2 23:22:58 2018(r328820)
> @@ -747,6 +747,19 @@ cam_module_event_handler(module_t mod, int what, void
> return 0;
>  }
>
> +static struct xpt_proto *
> +xpt_proto_find(cam_proto proto)
> +{
> +   struct xpt_proto **pp;
> +
> +   SET_FOREACH(pp, cam_xpt_proto_set) {
> +   if ((*pp)->proto == proto)
> +   return *pp;
> +   }
> +
> +   return NULL;
> +}
> +
>  static void
>  xpt_rescan_done(struct cam_periph *periph, un

Re: svn commit: r327362 - in head/usr.bin/find: . tests

2017-12-29 Thread Oliver Pinter
On Friday, December 29, 2017, Conrad Meyer  wrote:

> On Fri, Dec 29, 2017 at 2:41 PM, Oliver Pinter
>  wrote:
> > Why did you comment out these tests?
>
> I think unit tests are a good idea for this kind of change, which is
> why I wrote them.  And I run them before commit.  But I'm not
> interested in tilting at the test build infrastructure to actually
> enable them.  Someone else can hook them up to the build if they want
> to.


Okay. That's fine. Thanks for the clarification.


>
> Conrad
>
___
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: r327362 - in head/usr.bin/find: . tests

2017-12-29 Thread Oliver Pinter
On Friday, December 29, 2017, Conrad Meyer  wrote:

> Author: cem
> Date: Fri Dec 29 22:08:43 2017
> New Revision: 327362
> URL: https://svnweb.freebsd.org/changeset/base/327362
>
> Log:
>   find(1): Fix -newer and -samefile to conform to POSIX[0]
>
>   By default, or with the -P flag, find(1) should evaluate paths
> "physically."
>   For symlinks, this means using the link itself instead of the target.
>
>   Historically (since the import of BSD 4.4-lite from CSRG), find(1) has
>   failed to refer to the link itself, at least for -newer and -samefile.
>
>   [0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html
>
>   PR:   222698
>   Reported by:  Harald Schmalzbauer 
>   Sponsored by: Dell EMC Isilon
>
> Added:
>   head/usr.bin/find/tests/
>   head/usr.bin/find/tests/Makefile   (contents, props changed)
>   head/usr.bin/find/tests/find_test.sh   (contents, props changed)
> Modified:
>   head/usr.bin/find/Makefile
>   head/usr.bin/find/function.c
>
> Modified: head/usr.bin/find/Makefile
> 
> ==
> --- head/usr.bin/find/Makefile  Fri Dec 29 21:37:36 2017(r327361)
> +++ head/usr.bin/find/Makefile  Fri Dec 29 22:08:43 2017(r327362)
> @@ -8,4 +8,7 @@ YFLAGS=
>
>  NO_WMISSING_VARIABLE_DECLARATIONS=
>
> +#HAS_TESTS=
> +#SUBDIR.${MK_TESTS}+= tests


Why did you comment out these tests?


> +
>  .include 
>
> Modified: head/usr.bin/find/function.c
> 
> ==
> --- head/usr.bin/find/function.cFri Dec 29 21:37:36 2017
> (r327361)
> +++ head/usr.bin/find/function.cFri Dec 29 22:08:43 2017
> (r327362)
> @@ -1066,12 +1066,17 @@ c_samefile(OPTION *option, char ***argvp)
> char *fn;
> PLAN *new;
> struct stat sb;
> +   int error;
>
> fn = nextarg(option, argvp);
> ftsoptions &= ~FTS_NOSTAT;
>
> new = palloc(option);
> -   if (stat(fn, &sb))
> +   if (ftsoptions & FTS_PHYSICAL)
> +   error = lstat(fn, &sb);
> +   else
> +   error = stat(fn, &sb);
> +   if (error != 0)
> err(1, "%s", fn);
> new->i_data = sb.st_ino;
> return new;
> @@ -1201,6 +1206,7 @@ c_newer(OPTION *option, char ***argvp)
> char *fn_or_tspec;
> PLAN *new;
> struct stat sb;
> +   int error;
>
> fn_or_tspec = nextarg(option, argvp);
> ftsoptions &= ~FTS_NOSTAT;
> @@ -1214,7 +1220,11 @@ c_newer(OPTION *option, char ***argvp)
> /* Use the seconds only in the comparison. */
> new->t_data.tv_nsec = 9;
> } else {
> -   if (stat(fn_or_tspec, &sb))
> +   if (ftsoptions & FTS_PHYSICAL)
> +   error = lstat(fn_or_tspec, &sb);
> +   else
> +   error = stat(fn_or_tspec, &sb);
> +   if (error != 0)
> err(1, "%s", fn_or_tspec);
> if (option->flags & F_TIME2_C)
> new->t_data = sb.st_ctim;
>
> Added: head/usr.bin/find/tests/Makefile
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/find/tests/MakefileFri Dec 29 22:08:43 2017
> (r327362)
> @@ -0,0 +1,5 @@
> +# $FreeBSD$
> +
> +ATF_TESTS_SH=  find_test
> +
> +.include 
>
> Added: head/usr.bin/find/tests/find_test.sh
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/usr.bin/find/tests/find_test.shFri Dec 29 22:08:43 2017
>   (r327362)
> @@ -0,0 +1,73 @@
> +#
> +# Copyright 2017, Conrad Meyer .
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions are
> +# met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +# * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
> +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +# THEORY OF

Re: svn commit: r327089 - in head/sys: dev/drm2/i915 dev/drm2/radeon dev/ed dev/intpm dev/ioat dev/ntb/ntb_hw net

2017-12-22 Thread Oliver Pinter
On 12/22/17, Warner Losh  wrote:
> Author: imp
> Date: Fri Dec 22 17:53:27 2017
> New Revision: 327089
> URL: https://svnweb.freebsd.org/changeset/base/327089
>
> Log:
>   Use '#' rather than some made up name for fields we want to ignore.
>
> Modified:
>   head/sys/dev/drm2/i915/i915_drv.c
>   head/sys/dev/drm2/radeon/radeon_drv.c
>   head/sys/dev/ed/if_ed_pci.c
>   head/sys/dev/intpm/intpm.c
>   head/sys/dev/ioat/ioat.c
>   head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
>   head/sys/net/iflib.h
>
> Modified: head/sys/dev/drm2/i915/i915_drv.c
> ==
> --- head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:52:38 2017
> (r327088)
> +++ head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:53:27 2017
> (r327089)
> @@ -1236,7 +1236,7 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iic, 1, 1, 1);
>  MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
> -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, i915,
> pciidlist,
> +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist,
>  sizeof(pciidlist[0]), nitems(pciidlist));
>
>  /* We give fast paths for the really cool registers */
>
> Modified: head/sys/dev/drm2/radeon/radeon_drv.c
> ==
> --- head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:52:38
> 2017  (r327088)
> +++ head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:53:27
> 2017  (r327089)
> @@ -401,5 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
>  MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
> -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms,
> +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:@", vgapci, radeonkms,

@ vs #

>  pciidlist, sizeof(pciidlist[0]), nitems(pciidlist));
>
> Modified: head/sys/dev/ed/if_ed_pci.c
> ==
> --- head/sys/dev/ed/if_ed_pci.c   Fri Dec 22 17:52:38 2017
> (r327088)
> +++ head/sys/dev/ed/if_ed_pci.c   Fri Dec 22 17:53:27 2017
> (r327089)
> @@ -145,6 +145,6 @@ static driver_t ed_pci_driver = {
>  DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0);
>  MODULE_DEPEND(ed, pci, 1, 1, 1);
>  MODULE_DEPEND(ed, ether, 1, 1, 1);
> -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids,
> sizeof(pci_ids[0]),
> +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ed, pci_ids,

@ vs #

> sizeof(pci_ids[0]),
>  nitems(pci_ids) - 1);
>
>
> Modified: head/sys/dev/intpm/intpm.c
> ==
> --- head/sys/dev/intpm/intpm.cFri Dec 22 17:52:38 2017
> (r327088)
> +++ head/sys/dev/intpm/intpm.cFri Dec 22 17:53:27 2017
> (r327089)
> @@ -895,5 +895,5 @@ DRIVER_MODULE_ORDERED(intsmb, pci, intsmb_driver, ints
>  DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
>  MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
>  MODULE_VERSION(intsmb, 1);
> -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, intpm, intsmb_products,
> +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products,
>  sizeof(intsmb_products[0]), nitems(intsmb_products));
>
> Modified: head/sys/dev/ioat/ioat.c
> ==
> --- head/sys/dev/ioat/ioat.c  Fri Dec 22 17:52:38 2017(r327088)
> +++ head/sys/dev/ioat/ioat.c  Fri Dec 22 17:53:27 2017(r327089)
> @@ -240,7 +240,7 @@ static struct _pcsid
>   { 0x20218086, "SKX IOAT" },
>  };
>
> -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ioat, pci_ids,
> +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids,
>  sizeof(pci_ids[0]), nitems(pci_ids));
>
>  /*
>
> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
> ==
> --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.cFri Dec 22 17:52:38
> 2017  (r327088)
> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.cFri Dec 22 17:53:27
> 2017  (r327089)
> @@ -3119,5 +3119,5 @@ static DEFINE_CLASS_0(ntb_hw, ntb_intel_driver,
> ntb_in
>  DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL,
> NULL);
>  MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1);
>  MODULE_VERSION(ntb_hw_intel, 1);
> -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ntb_hw_intel, pci_ids,
> +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ntb_hw_intel, pci_ids,

@ vs #

>  sizeof(pci_ids[0]), nitems(pci_ids));
>
> Modified: head/sys/net/iflib.h
> ==
> --- head/sys/net/iflib.h  Fri Dec 22 17:52:38 2017(r327088)
> +++ head/sys/net/iflib.h  Fri Dec 22 17:53:27 2017(r327089)
> @@ -174,7 +1

Re: svn commit: r326664 - head/sys/vm

2017-12-07 Thread Oliver Pinter
On 12/7/17, Mark Johnston  wrote:
> Author: markj
> Date: Thu Dec  7 19:38:09 2017
> New Revision: 326664
> URL: https://svnweb.freebsd.org/changeset/base/326664
>
> Log:
>   Fix the UMA reclaim worker after r326347.
>
>   atomic_set_*() sets a bit in the target memory location, so
>   atomic_set_int(&uma_reclaim_needed, 0) does not do what it looks like
>   it does.
>
>   PR: 224080
>   Reviewed by:jeff, kib
>   Differential Revision:  https://reviews.freebsd.org/D13412
>
> Modified:
>   head/sys/vm/uma_core.c
>
> Modified: head/sys/vm/uma_core.c
> ==
> --- head/sys/vm/uma_core.cThu Dec  7 18:04:48 2017(r326663)
> +++ head/sys/vm/uma_core.cThu Dec  7 19:38:09 2017(r326664)
> @@ -3177,7 +3177,7 @@ uma_reclaim_worker(void *arg __unused)
>   EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM);
>   sx_xlock(&uma_drain_lock);
>   uma_reclaim_locked(true);
> - atomic_set_int(&uma_reclaim_needed, 0);
> + uma_reclaim_needed = 0;

atomic_store_rel_int(&uma_reclaim_needed, 0) ?

>   sx_xunlock(&uma_drain_lock);
>   /* Don't fire more than once per-second. */
>   pause("umarclslp", hz);
> ___
> svn-src-h...@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-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: r326224 - head

2017-11-26 Thread Oliver Pinter
On Sunday, November 26, 2017, Cy Schubert  wrote:

> Author: cy
> Date: Sun Nov 26 06:31:34 2017
> New Revision: 326224
> URL: https://svnweb.freebsd.org/changeset/base/326224
>
> Log:
>   Fix spelling error (probably typo).
>
> Modified:
>   head/ObsoleteFiles.inc
>
> Modified: head/ObsoleteFiles.inc
> 
> ==
> --- head/ObsoleteFiles.inc  Sun Nov 26 04:55:23 2017(r326223)
> +++ head/ObsoleteFiles.inc  Sun Nov 26 06:31:34 2017(r326224)
> @@ -38,7 +38,7 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>
> -# 20171118: Remove old etc capser failes
> +# 20171118: Remove old etc capser files


There is an other one: capser -> casper.


>  OLD_FILES+=etc/casper/system.dns
>  OLD_FILES+=etc/casper/system.grp
>  OLD_FILES+=etc/casper/system.pwd
> ___
> svn-src-h...@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-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: r325957 - in head: sys/kern tests/sys/vfs

2017-11-17 Thread Oliver Pinter
On Friday, November 17, 2017, Conrad Meyer  wrote:

> Author: cem
> Date: Fri Nov 17 19:25:39 2017
> New Revision: 325957
> URL: https://svnweb.freebsd.org/changeset/base/325957
>
> Log:
>   vfs_lookup: Allow PATH_MAX-1 symlinks
>
>   Previously, symlinks in FreeBSD were artificially limited to PATH_MAX-2.
>
>   Add a short test case to verify the change.
>
>   Submitted by: Gaurav Gangalwar 
>   Reviewed by:  kib
>   Sponsored by: Dell EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D12589
>
> Added:
>   head/tests/sys/vfs/lookup_test.sh   (contents, props changed)
> Modified:
>   head/sys/kern/vfs_lookup.c
>   head/tests/sys/vfs/Makefile
>
> Modified: head/sys/kern/vfs_lookup.c
> 
> ==
> --- head/sys/kern/vfs_lookup.c  Fri Nov 17 19:10:10 2017(r325956)
> +++ head/sys/kern/vfs_lookup.c  Fri Nov 17 19:25:39 2017(r325957)
> @@ -499,7 +499,7 @@ namei(struct nameidata *ndp)
> error = ENOENT;
> break;
> }
> -   if (linklen + ndp->ni_pathlen >= MAXPATHLEN) {
> +   if (linklen + ndp->ni_pathlen > MAXPATHLEN) {
> if (ndp->ni_pathlen > 1)
> uma_zfree(namei_zone, cp);
> error = ENAMETOOLONG;
>
> Modified: head/tests/sys/vfs/Makefile
> 
> ==
> --- head/tests/sys/vfs/Makefile Fri Nov 17 19:10:10 2017(r325956)
> +++ head/tests/sys/vfs/Makefile Fri Nov 17 19:25:39 2017(r325957)
> @@ -7,6 +7,8 @@ TESTSDIR=   ${TESTSBASE}/sys/vfs
>  ATF_TESTS_C+=  lookup_cap_dotdot
>  CFLAGS.lookup_cap_dotdot.c+=   -I${SRCTOP}/tests
>
> +#ATF_TESTS_SH+=lookup_test


This commented out line is intended?


> +
>  TAP_TESTS_SH+= trailing_slash
>
>  .include 
>
> Added: head/tests/sys/vfs/lookup_test.sh
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/tests/sys/vfs/lookup_test.sh   Fri Nov 17 19:25:39 2017
> (r325957)
> @@ -0,0 +1,17 @@
> +# $FreeBSD$
> +
> +long_symlink_head()
> +{
> +   atf_set "descr" "Test for 1023 (PATH_MAX-1) symlink support"
> +}
> +long_symlink_body()
> +{
> +   atf_check -s exit:0 ln -s aa
> 
> 
> 
> a/
> 
> 
> 
> 
> aaa/aa
> 
> 
> 
> a/
> 
> 
> 
> aa
>  a sym_long
> +   # was: "stat: sym_long: stat: File name too long"; exit 1
> +   atf_check -s exit:0 -o ignore stat -L sym_long
> +}
> +
> +atf_init_test_cases()
> +{
> +   atf_add_test_case long_symlink
> +}
> ___
> svn-src-h...@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-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: r324619 - in head/usr.bin/procstat: . tests

2017-11-13 Thread Oliver Pinter
On Saturday, October 14, 2017, Brooks Davis  wrote:

> Author: brooks
> Date: Sat Oct 14 18:38:36 2017
> New Revision: 324619
> URL: https://svnweb.freebsd.org/changeset/base/324619
>
> Log:
>   Switch procstat from subcommand flags to verbs
>
>   - Use an enumerated value instead of separate flags for commands
>   - Look for a verb if no command flag is set
>   - Lookup the "xocontainer" value based on the command
>   - Document the new command verbs in the man-page
>
>   Submitted by: kdrak...@zoho.com 
>   Differential Revision:https://reviews.freebsd.org/D10916


+= Release notes?


>
> Modified:
>   head/usr.bin/procstat/procstat.1
>   head/usr.bin/procstat/procstat.c
>   head/usr.bin/procstat/procstat.h
>   head/usr.bin/procstat/procstat_args.c
>   head/usr.bin/procstat/procstat_auxv.c
>   head/usr.bin/procstat/procstat_basic.c
>   head/usr.bin/procstat/procstat_bin.c
>   head/usr.bin/procstat/procstat_cred.c
>   head/usr.bin/procstat/procstat_cs.c
>   head/usr.bin/procstat/procstat_files.c
>   head/usr.bin/procstat/procstat_kstack.c
>   head/usr.bin/procstat/procstat_ptlwpinfo.c
>   head/usr.bin/procstat/procstat_rlimit.c
>   head/usr.bin/procstat/procstat_rusage.c
>   head/usr.bin/procstat/procstat_sigs.c
>   head/usr.bin/procstat/procstat_threads.c
>   head/usr.bin/procstat/procstat_vm.c
>   head/usr.bin/procstat/tests/procstat_test.sh
>
> Modified: head/usr.bin/procstat/procstat.1
> 
> ==
> --- head/usr.bin/procstat/procstat.1Sat Oct 14 17:51:25 2017
> (r324618)
> +++ head/usr.bin/procstat/procstat.1Sat Oct 14 18:38:36 2017
> (r324619)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd October 3, 2017
> +.Dd October 14, 2017
>  .Dt PROCSTAT 1
>  .Os
>  .Sh NAME
> @@ -34,14 +34,75 @@
>  .Sh SYNOPSIS
>  .Nm
>  .Op Fl -libxo
> -.Op Fl CHhn
> +.Op Fl h
>  .Op Fl M Ar core
>  .Op Fl N Ar system
>  .Op Fl w Ar interval
> -.Op Fl b | c | e | f | i | j | k | l | L | r | s | S | t | v | x
> -.Op Fl a | Ar pid | Ar core ...
> +.Ar command
> +.Op Ar pid ... | Ar core ...
> +.Nm
> +.Op Fl -libxo
> +.Fl a
> +.Op Fl h
> +.Op Fl M Ar core
> +.Op Fl N Ar system
> +.Op Fl w Ar interval
> +.Ar command
> +.Nm
> +.Op Fl -libxo
> +.Op Fl h
> +.Op Fl M Ar core
> +.Op Fl N Ar system
> +.Op Fl w Ar interval
> +.Oo
> +.Fl b |
> +.Fl c |
> +.Fl e |
> +.Fl f Oo Fl C Oc |
> +.Fl i Oo Fl n Oc |
> +.Fl j Oo Fl n Oc |
> +.Fl k Oo Fl k Oc |
> +.Fl l |
> +.Fl r Oo Fl H Oc |
> +.Fl s |
> +.Fl S |
> +.Fl t |
> +.Fl v |
> +.Fl x
> +.Oc
> +.Op Ar pid ... | Ar core ...
> +.Nm
> +.Op Fl -libxo
> +.Fl a
> +.Op Fl h
> +.Op Fl M Ar core
> +.Op Fl N Ar system
> +.Op Fl w Ar interval
> +.Oo
> +.Fl b |
> +.Fl c |
> +.Fl e |
> +.Fl f Oo Fl C Oc |
> +.Fl i Oo Fl n Oc |
> +.Fl j Oo Fl n Oc |
> +.Fl k Oo Fl k Oc |
> +.Fl l |
> +.Fl r Oo Fl H Oc |
> +.Fl s |
> +.Fl S |
> +.Fl t |
> +.Fl v |
> +.Fl x
> +.Oc
> +.Nm
> +.Op Fl -libxo
> +.Fl L
> +.Op Fl h
> +.Op Fl M Ar core
> +.Op Fl N Ar system
> +.Op Fl w Ar interval
> +.Ar core ...
>  .Sh DESCRIPTION
> -The
>  .Nm
>  utility displays detailed information about the processes identified by
> the
>  .Ar pid
> @@ -51,49 +112,89 @@ flag is used, all processes.
>  It can also display information extracted from a process core file, if
>  the core file is specified as the argument.
>  .Pp
> -By default, basic process statistics are printed; one of the following
> -options may be specified in order to select more detailed process
> information
> -for printing:
> -.Bl -tag -width indent
> -.It Fl -libxo
> -Generate output via
> +If the
> +.Fl -libxo
> +flag is specified the output is generated via
>  .Xr libxo 3
>  in a selection of different human and machine readable formats.
>  See
>  .Xr xo_parse_args 3
>  for details on command line arguments.
> -.It Fl b
> +.Pp
> +The following commands are available:
> +.Bl -tag -width indent
> +.It Ar basic
> +Print basic process statistics (this is the default).
> +.It Ar binary | Fl b
>  Display binary information for the process.
> -.It Fl c
> +.Pp
> +Substring commands are accepted.
> +.It Ar argument(s) | Fl c
>  Display command line arguments for the process.
> -.It Fl e
> +.Pp
> +Substring commands are accepted.
> +.It Ar environment | Fl e
>  Display environment variables for the process.
> -.It Fl f
> +.Pp
> +Substring commands are accepted.
> +.It Ar file(s) | Ar fd(s) | Fl f
>  Display file descriptor information for the process.
> -.It Fl i
> +.Pp
> +If the
> +.Fl C
> +subcommand flag is used then additional capability information is printed.
> +.It Ar signal(s) | Fl i
>  Display signal pending and disposition information for the process.
> -.It Fl j
> +.Pp
> +If the
> +.Fl n
> +subcommand option is used, the signal numbers are shown instead of signal
> +names.
> +.Pp
> +Substring commands are accepted.
> +.It Ar tsignal(s) | Fl j
>  Display signal pending and blocked information for the process's threads.
> -.It Fl k
> +.Pp
> +If the
> +.Fl n
> +subcomman

Re: svn commit: r325386 - head/sys/kern

2017-11-05 Thread Oliver Pinter
On 11/5/17, Warner Losh  wrote:
> On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer  wrote:
>
>> E.g.,
>>
>> --- a/sys/ufs/ffs/ffs_alloc.c
>> +++ b/sys/ufs/ffs/ffs_alloc.c
>> @@ -304,8 +304,7 @@ retry:
>> }
>>
>> if (bp->b_blkno == bp->b_lblkno) {
>> -   if (lbprev >= UFS_NDADDR)
>> -   panic("ffs_realloccg: lbprev out of range");
>> +   ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out
>> of range");
>> bp->b_blkno = fsbtodb(fs, bprev);
>> }
>>
>
> Just a side point: All these should be programming errors.

Yes, they are programming errors, but the INVATIANTS and all of the
debugging kernel
facilities are disabled on -STABLE branches, and no one (except us)
running on system
with enabled debug stuffs.

So it would be nice to enable the debug facilities on -STABLE branches
and disable them
on -RELENG branch time. There was always several errors / patch, which
could be catch.

Now I don't want to search for them, but I uptreamed them one or two years ago.

> The bogus data
> that comes or could come from the FS itself should remain always-on panics.
> Well, actually, they should transition from always-on panics to some sort
> of degraded mount that would be more resilient in the face of such
> corruption. But failing that, they should remain always-on panics :)
>
> Warner
>
>
>
>> On Sun, Nov 5, 2017 at 9:30 AM, Konstantin Belousov 
>> wrote:
>> > On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote:
>> >> On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov <
>> kostik...@gmail.com> wrote:
>> >> > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote:
>> >> >> This is a functional change, because MPASS (via KASSERT) is only
>> >> >> enabled on DEBUG kernels.  Ideally we would have a kind of ASSERT
>> that
>> >> >> worked on NODEBUG kernels.
>> >> > Why would we need such thing ?
>> >> >
>> >> > Our conventions are clear: consistency checks are normally done with
>> >> > KASSERT() and enabled for DEBUG (INVARIANTS or harder)
>> >> > configurations.
>> >> > We only leave explicit panics in the production kernels when there
>> >> > continuation of operations is worse then abort, e.g. when UFS
>> >> > detects
>> >> > the metadata corruption.
>> >>
>> >> An always-on assert construct would be precisely for the latter
>> >> scenario.  Instead, we litter the tree with "if (!invariant) {
>> >> panic(); }."
>> > We do
>> >
>> > #ifdef INVARIANTS
>> > if (!condition) panic();
>> > #endif
>> >
>> > I do not understand what do you mean by 'instead'.
>>
>>
> ___
> svn-src-h...@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-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: r325378 - head/sys/dev/ipmi

2017-11-04 Thread Oliver Pinter
On 11/4/17, Xin Li  wrote:
>
>
> On 11/3/17 20:01, Warner Losh wrote:
>> Author: imp
>> Date: Sat Nov  4 03:01:58 2017
>> New Revision: 325378
>> URL: https://svnweb.freebsd.org/changeset/base/325378
>>
>> Log:
>>   Make the startup timeout 0 seconds by default rathern than 420s.  This
>>   makes the default fail safe when watchdogd is disabled (which is also
>>   the default).
>
> I'm not sure if this is good: what if watchdogd is enabled, but the
> system get stuck before watchdogd starts?

Like boot into single user mode? ;)

>
> Cheers,
>
>
___
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: r322720 - head/sys/amd64/amd64

2017-08-20 Thread Oliver Pinter
On Sunday, August 20, 2017, Konstantin Belousov  wrote:

> Author: kib
> Date: Sun Aug 20 09:52:25 2017
> New Revision: 322720
> URL: https://svnweb.freebsd.org/changeset/base/322720
>
> Log:
>   Simplify amd64 trap().
>
>   - Use more relevant name 'signo' instead of 'i' for the local variable
> which contains a signal number to send for the current exception.
>   - Eliminate two labels 'userout' and 'out' which point to the very end
> of the trap() function.  Instead use return directly.
>   - Re-indent the prot_fault_translation block by reducing if() nesting.
>   - Some more monor style changes.
>
>   Requested and reviewed by:bde
>   Tested by:pho
>   Sponsored by: The FreeBSD Foundation
>   MFC after:1 week
>
> Modified:
>   head/sys/amd64/amd64/trap.c
>
> Modified: head/sys/amd64/amd64/trap.c
> 
> ==
> --- head/sys/amd64/amd64/trap.c Sun Aug 20 09:42:09 2017(r322719)
> +++ head/sys/amd64/amd64/trap.c Sun Aug 20 09:52:25 2017(r322720)
> @@ -172,12 +172,12 @@ trap(struct trapframe *frame)
>  #ifdef KDB
> register_t dr6;
>  #endif
> -   int i, ucode;
> +   int signo, ucode;
> u_int type;
>
> td = curthread;
> p = td->td_proc;
> -   i = 0;
> +   signo = 0;
> ucode = 0;
> addr = 0;
>
> @@ -186,22 +186,20 @@ trap(struct trapframe *frame)
>
>  #ifdef SMP
> /* Handler for NMI IPIs used for stopping CPUs. */
> -   if (type == T_NMI) {
> -if (ipi_nmi_handler() == 0)
> -  goto out;
> -   }
> -#endif /* SMP */
> +   if (type == T_NMI && ipi_nmi_handler() == 0)
> +   return;
> +#endif
>
>  #ifdef KDB
> if (kdb_active) {
> kdb_reenter();
> -   goto out;
> +   return;
> }
>  #endif
>
> if (type == T_RESERVED) {
> trap_fatal(frame, 0);
> -   goto out;
> +   return;
> }
>
> if (type == T_NMI) {
> @@ -214,18 +212,18 @@ trap(struct trapframe *frame)
>  */
> if (pmc_intr != NULL &&
> (*pmc_intr)(PCPU_GET(cpuid), frame) != 0)
> -   goto out;
> +   return;
>  #endif
>
>  #ifdef STACK
> if (stack_nmi_handler(frame) != 0)
> -   goto out;
> +   return;
>  #endif
> }
>
> if (type == T_MCHK) {
> mca_intr();
> -   goto out;
> +   return;
> }
>
> if ((frame->tf_rflags & PSL_I) == 0) {
> @@ -269,7 +267,7 @@ trap(struct trapframe *frame)
>
> switch (type) {
> case T_PRIVINFLT:   /* privileged instruction fault */
> -   i = SIGILL;
> +   signo = SIGILL;
> ucode = ILL_PRVOPC;
> break;
>
> @@ -281,41 +279,41 @@ trap(struct trapframe *frame)
> fill_frame_regs(frame, ®s);
> if (dtrace_pid_probe_ptr != NULL &&
> dtrace_pid_probe_ptr(®s) == 0)
> -   goto out;
> +   return;
> }
>  #endif
> frame->tf_rflags &= ~PSL_T;
> -   i = SIGTRAP;
> +   signo = SIGTRAP;
> ucode = (type == T_TRCTRAP ? TRAP_TRACE :
> TRAP_BRKPT);
> break;
>
> case T_ARITHTRAP:   /* arithmetic trap */
> ucode = fputrap_x87();
> if (ucode == -1)
> -   goto userout;
> -   i = SIGFPE;
> +   return;
> +   signo = SIGFPE;
> break;
>
> case T_PROTFLT: /* general protection fault */
> -   i = SIGBUS;
> +   signo = SIGBUS;
> ucode = BUS_OBJERR;
> break;
> case T_STKFLT:  /* stack fault */
> case T_SEGNPFLT:/* segment not present fault */
> -   i = SIGBUS;
> +   signo = SIGBUS;
> ucode = BUS_ADRERR;
> break;
> case T_TSSFLT:  /* invalid TSS fault */
> -   i = SIGBUS;
> +   signo = SIGBUS;
> ucode = BUS_OBJERR;
> break;
> case T_ALIGNFLT:
> -   i = SIGBUS;
> +   signo = SIGBUS;
> ucode = BUS_ADRALN;
> break;
> case T_DOUBLE

Re: svn commit: r322041 - head/sys/kern

2017-08-04 Thread Oliver Pinter
On Friday, August 4, 2017, Alan Cox  wrote:

> Author: alc
> Date: Fri Aug  4 04:23:23 2017
> New Revision: 322041
> URL: https://svnweb.freebsd.org/changeset/base/322041
>
> Log:
>   In case readers are misled by expressions that combine multiplication and
>   division, add parentheses to make the precedence explicit.
>
>   Submitted by: Doug Moore >
>   Requested by: imp
>   Reviewed by:  imp
>   MFC after:1 week
>   X-MFC after:  r321840
>   Differential Revision:https://reviews.freebsd.org/D11815
>
> Modified:
>   head/sys/kern/subr_blist.c
>
> Modified: head/sys/kern/subr_blist.c
> 
> ==
> --- head/sys/kern/subr_blist.c  Fri Aug  4 04:20:11 2017(r322040)
> +++ head/sys/kern/subr_blist.c  Fri Aug  4 04:23:23 2017(r322041)
> @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$");
>  #definebitcount64(x)   __bitcount64((uint64_t)(x))
>  #define malloc(a,b,c)  calloc(a, 1)
>  #define free(a,b)  free(a)
> +#define CTASSERT(expr)


Is this dummy define intended?


>
>  #include 
>
> @@ -142,6 +143,8 @@ static void blst_radix_print(blmeta_t *scan, daddr_t b
>  static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space");
>  #endif
>
> +CTASSERT(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0);
> +
>  /*
>   * For a subtree that can represent the state of up to 'radix' blocks, the
>   * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX.  If
> 'm'
> @@ -151,17 +154,19 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space");
>   * in the 'meta' functions that process subtrees.  Since integer division
>   * discards remainders, we can express this computation as
>   * skip = (m * m**h) / (m - 1)
> - * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1)
> - * and if m divides BLIST_BMAP_RADIX, we can simplify further to
> - * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1))
> - * so that a simple integer division is enough for the calculation.
> + * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1)
> + * and since m divides BLIST_BMAP_RADIX, we can simplify further to
> + * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1)
> + * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1))
> + * so that simple integer division by a constant can safely be used for
> the
> + * calculation.
>   */
>  static inline daddr_t
>  radix_to_skip(daddr_t radix)
>  {
>
> return (radix /
> -   (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX -
> 1)));
> +   ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX -
> 1)));
>  }
>
>  /*
> ___
> svn-src-h...@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-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: r280455 - in stable/10: lib/libpmc sys/amd64/conf sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmcstudy

2017-06-20 Thread Oliver Pinter
On 6/20/17, Andriy Gapon  wrote:
> On 20/06/2017 01:37, Oliver Pinter wrote:
>> On 3/27/15, John Baldwin  wrote:
>>> On 3/24/15 1:00 PM, Randall Stewart wrote:
>>>> Author: rrs
>>>> Date: Tue Mar 24 20:00:11 2015
>>>> New Revision: 280455
>>>> URL: https://svnweb.freebsd.org/changeset/base/280455
>>>>
>>>> Log:
>>>>   MFC of r277177 and r279894 with the fixes for the PMC for Haswell.
>>>>
>>>>   Sponsored by:Netflix Inc.
>>>>
>>>> Added:
>>>>   stable/10/usr.sbin/pmcstudy/
>>>>  - copied from r277177, head/usr.sbin/pmcstudy/
>>>> Modified:
>>>>   stable/10/lib/libpmc/libpmc.c
>>>>   stable/10/sys/amd64/conf/GENERIC
>>
>> Hi!
>>
>> The MFC of 279833 was missing from this commit. I'm CCing avg@, since
>> he made a big bunch of hwpmc related MFCs yesterday.
>
> I've just merged that commit.
> Thank you all.

Thanks for the fast response and the MFC of all these things. (I was
already MFCd of these commits in HardenedBSD, and it's conflicted on
this line, and I observed in this way...)

>
>>>
>>> The change to GENERIC looks like it slipped in by accident?  Neither of
>>> the
>>> commits to HEAD enabled hwpmc in GENERIC AFAICT.
>
>
> --
> Andriy Gapon
>
___
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: r280455 - in stable/10: lib/libpmc sys/amd64/conf sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmcstudy

2017-06-19 Thread Oliver Pinter
On 3/27/15, John Baldwin  wrote:
> On 3/24/15 1:00 PM, Randall Stewart wrote:
>> Author: rrs
>> Date: Tue Mar 24 20:00:11 2015
>> New Revision: 280455
>> URL: https://svnweb.freebsd.org/changeset/base/280455
>>
>> Log:
>>   MFC of r277177 and r279894 with the fixes for the PMC for Haswell.
>>
>>   Sponsored by:  Netflix Inc.
>>
>> Added:
>>   stable/10/usr.sbin/pmcstudy/
>>  - copied from r277177, head/usr.sbin/pmcstudy/
>> Modified:
>>   stable/10/lib/libpmc/libpmc.c
>>   stable/10/sys/amd64/conf/GENERIC

Hi!

The MFC of 279833 was missing from this commit. I'm CCing avg@, since
he made a big bunch of hwpmc related MFCs yesterday.

>
> The change to GENERIC looks like it slipped in by accident?  Neither of the
> commits to HEAD enabled hwpmc in GENERIC AFAICT.
>
> --
> John Baldwin
> ___
> svn-src-stable...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
> To unsubscribe, send any mail to
> "svn-src-stable-10-unsubscr...@freebsd.org"
>
___
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: r316945 - in head: etc/defaults etc/periodic/daily share/man/man5

2017-04-14 Thread Oliver Pinter
On Saturday, April 15, 2017, Alan Somers  wrote:

> Author: asomers
> Date: Fri Apr 14 22:59:14 2017
> New Revision: 316945
> URL: https://svnweb.freebsd.org/changeset/base/316945
>
> Log:
>   Add 410.status-mfi, a periodic script for mfi(4) arrays
>
>   PR:   176049
>   Submitted by: docon...@gsoft.com.au 
>   Reviewed by:  scottl, Larry Rosenman >
>   MFC after:3 weeks
>   Relnotes: yes
>
> Added:
>   head/etc/periodic/daily/410.status-mfi   (contents, props changed)
> Modified:
>   head/etc/defaults/periodic.conf
>   head/etc/periodic/daily/Makefile
>   head/share/man/man5/periodic.conf.5
>
> Modified: head/etc/defaults/periodic.conf
> 
> ==
> --- head/etc/defaults/periodic.conf Fri Apr 14 22:02:08 2017
> (r316944)
> +++ head/etc/defaults/periodic.conf Fri Apr 14 22:59:14 2017
> (r316945)
> @@ -112,6 +112,9 @@ daily_status_gstripe_enable="NO"#
> Che
>  # 409.status-gconcat
>  daily_status_gconcat_enable="NO"   # Check gconcat(8)
>
> +# 410.status-mfi
> +daily_status_mfi_enable="NO"   # Check mfiutil(8)
> +
>  # 420.status-network
>  daily_status_network_enable="YES"  # Check network
> status
>  daily_status_network_usedns="YES"  # DNS lookups are
> ok
>
> Added: head/etc/periodic/daily/410.status-mfi
> 
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/etc/periodic/daily/410.status-mfi  Fri Apr 14 22:59:14 2017
>   (r316945)
> @@ -0,0 +1,33 @@
> +#!/bin/sh
> +#
> +# $FreeBSD$
> +#
> +
> +# If there is a global system configuration file, suck it in.
> +#
> +if [ -r /etc/defaults/periodic.conf ]
> +then
> +. /etc/defaults/periodic.conf
> +source_periodic_confs
> +fi
> +
> +case "$daily_status_mfi_enable" in
> +[Yy][Ee][Ss])
> +   echo
> +   echo 'Checking status of mfi(4) devices:'
> +
> +   if mfiutil show volumes; then
> +   if mfiutil show volumes | grep -q DEGRADED; then
> +   rc=3
> +   else
> +   rc=0
> +   fi
> +   else
> +   rc=2
> +   fi
> +   ;;
> +
> +*)  rc=0;;
> +esac
> +
> +exit $rc
>
> Modified: head/etc/periodic/daily/Makefile
> 
> ==
> --- head/etc/periodic/daily/MakefileFri Apr 14 22:02:08 2017
> (r316944)
> +++ head/etc/periodic/daily/MakefileFri Apr 14 22:59:14 2017
> (r316945)
> @@ -13,6 +13,7 @@ FILES=100.clean-disks \
> 400.status-disks \
> 401.status-graid \
> 406.status-gmirror \
> +   410.status-mfi \


This should be in different place, this list is ordered, as I see from this
context.


> 407.status-graid3 \
> 408.status-gstripe \
> 409.status-gconcat \
>
> Modified: head/share/man/man5/periodic.conf.5
> 
> ==
> --- head/share/man/man5/periodic.conf.5 Fri Apr 14 22:02:08 2017
> (r316944)
> +++ head/share/man/man5/periodic.conf.5 Fri Apr 14 22:59:14 2017
> (r316945)
> @@ -399,6 +399,15 @@ if you want to run
>  on your
>  .Xr gconcat 8
>  devices.
> +.It Va daily_status_mfi_enable
> +.Pq Vt bool
> +Set to
> +.Dq Li YES
> +if you want to run
> +.Nm mfiutil Cm status
> +on your
> +.Xr mfi 4
> +devices.
>  .It Va daily_status_network_enable
>  .Pq Vt bool
>  Set to
> ___
> svn-src-h...@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-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: r315418 - in head/sys/teken: . libteken

2017-03-16 Thread Oliver Pinter
On 3/16/17, Bruce Evans  wrote:
> On Thu, 16 Mar 2017, Oliver Pinter wrote:
>
>> On 3/16/17, Bruce Evans  wrote:
>>> On Thu, 16 Mar 2017, Bruce Evans wrote:
>>>
>>>> Log:
>>>>  Add teken_256to16() to convert xterm-256 256-color codes to xterm
>>>> 16-color
>>>>  codes.  This will be used to fix bright colors.
>>>>
>>>>  Improve teken_256to8().  Use a lookup table instead of calculations.
>>>> The
>>>>  ...
>>>
>>> A shell script for printing some text color maps is attached.  Also a
>>> sloppier one for printing some CSI sequences.
>>> ...
>>
>> If I'm not wrong, these scripts where made on OS X. They use \r\n line
>> endings,
>> and this triggers random cryptic runtime errors:
>>
>> op@opn /tmp> sh -x sc-vt-CSI
>> + printf $'\\033[m\r'
>> + printf $'\\033[x\r'
>> sc-vt-CSI: 5: Syntax error: word unexpected
>>
>> The simple fix is to delete the '\r's from the scripts:
>>
>> cat sc-vt-CSI | tr -d '\r' > trans.sh
>
> No OS X here.
>
> It means that some mailers mangle even attachments.
>
> Shells should probably accept \r\n as newline on systems where this is
> not the native newline.  Some C compilers do.

The problems stats with imgact_shell, you can easily verify this with
the following:

op@opn /tmp> printf '#\!/bin/sh\r\n' > test.sh
op@opn /tmp> chmod +x test.sh
op@opn /tmp> ./test.sh
./test.sh: Command not found.
op@opn /tmp> sh -x ./test.sh
op@opn /tmp>

A possible solution would be the following patch:

Xdiff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
Xindex aaf521cf251..7b3feb20a3c 100644
X--- a/sys/kern/imgact_shell.c
X+++ b/sys/kern/imgact_shell.c
X@@ -146,7 +146,7 @@ exec_shell_imgact(imgp)
X   ihp++;
X   interpb = ihp;
X   while (ihp < maxp && ((*ihp != ' ') && (*ihp != '\t') && (*ihp != '\n')
X-  && (*ihp != '\0')))
X+  && (*ihp != '\r') && (*ihp != '\0')))
X   ihp++;
X   interpe = ihp;
X   if (interpb == interpe)
X@@ -162,7 +162,7 @@ exec_shell_imgact(imgp)
X   while (ihp < maxp && ((*ihp == ' ') || (*ihp == '\t')))
X   ihp++;
X   optb = ihp;
X-  while (ihp < maxp && ((*ihp != '\n') && (*ihp != '\0')))
X+  while (ihp < maxp && ((*ihp != '\n') && (*ihp != '\r') &&
(*ihp != '\0')))
X   ihp++;
X   opte = ihp;
X   if (opte == maxp)

this is not tested, even nor compile tested, just a PoC.



>
> Bruce
>
___
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: r315418 - in head/sys/teken: . libteken

2017-03-16 Thread Oliver Pinter
On 3/16/17, Bruce Evans  wrote:
> On Thu, 16 Mar 2017, Bruce Evans wrote:
>
>> Log:
>>  Add teken_256to16() to convert xterm-256 256-color codes to xterm
>> 16-color
>>  codes.  This will be used to fix bright colors.
>>
>>  Improve teken_256to8().  Use a lookup table instead of calculations.
>> The
>>  ...
>
> A shell script for printing some text color maps is attached.  Also a
> sloppier one for printing some CSI sequences.
>
> The first one can easily be translated to xterm sequences.  I used syscons
> F and G sequences to print bright colors with sc and vt since pure xterm
> bright colors are too broken to display themselves without bold hacks.
> The F and G sequences generate bold hacks in the kernel, and further
> complications are needed to turn these off to test if bright colors
> are fixed.  Real xterm doesn't fake bold using brightness, so bold
> hacks on dark characters don't work for it.
>
> The first one needs the user to load a cp437 font for syscons and a
> unicode font for vt.  The script doesn't load a font since it is too
> hard to restore or reset fonts.  Similarly for colors.
>
> Run the first one on a kernel without this commit to see the old color
> map.  It looked just wrong (unstructured) before I found a good
> tabular format to print it.  I then wrote "improved" maps based on
> expanding the 2x2x2 and 3x3x3 maps.  These were too simple.  Some of
> the comments/printfs are out of date and still refer to this expansion.

If I'm not wrong, these scripts where made on OS X. They use \r\n line endings,
and this triggers random cryptic runtime errors:

op@opn /tmp> sh -x sc-vt-CSI
+ printf $'\\033[m\r'
+ printf $'\\033[x\r'
sc-vt-CSI: 5: Syntax error: word unexpected

The simple fix is to delete the '\r's from the scripts:

cat sc-vt-CSI | tr -d '\r' > trans.sh

op
>
> Bruce
___
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: r313965 - head/crypto/openssh

2017-02-19 Thread Oliver Pinter
On 2/20/17, Kurt Lidl  wrote:
> On 2/19/17 4:42 PM, Oliver Pinter wrote:
>> Hello!
>>
>> On 2/19/17, Kurt Lidl  wrote:
>>> Author: lidl
>>> Date: Sun Feb 19 20:35:39 2017
>>> New Revision: 313965
>>> URL: https://svnweb.freebsd.org/changeset/base/313965
>>>
>>> Log:
>>>   Only notify blacklistd for successful logins in auth.c
>>
>> What's the rationale behind this change?
>
> Without this change, every pass through auth.c results in a
> call to blacklist_notify().
>
> So, in a normal remote login, you'd get a failed
> login flagged for the printing of the "xxx login:" prompt,
> before the remote user could enter a password.
>
> If the user successfully entered a good password,
> you'd get a good login flagged, and everything would be OK.
>
> If the user entered an incorrect password, you'd get
> another failed login in auth1.c (or auth2.c), and finally,
> when sshd got around to issuing the second "xxx login:"
> prompt, you'd have yet another failed login notice sent
> to blacklistd.
>
> So, if you had 3 bad logins set to the limit, you'd actually
> be blocking the address after the first bad login attempt.
>
> -Kurt

Thanks for the detailed answer. Could you please include these
sentences when you MFC this change?


>
>>
>>>
>>>   Reported by:  Rick Adams
>>>   Reviewed by:  des
>>>   MFC after:3 days
>>>   Sponsored by: The FreeBSD Foundation
>>>
>>> Modified:
>>>   head/crypto/openssh/auth.c
>>>
>>> Modified: head/crypto/openssh/auth.c
>>> ==
>>> --- head/crypto/openssh/auth.c  Sun Feb 19 19:56:12 2017
>>> (r313964)
>>> +++ head/crypto/openssh/auth.c  Sun Feb 19 20:35:39 2017
>>> (r313965)
>>> @@ -295,8 +295,8 @@ auth_log(Authctxt *authctxt, int authent
>>> authmsg = "Partial";
>>> else {
>>> authmsg = authenticated ? "Accepted" : "Failed";
>>> -   BLACKLIST_NOTIFY(authenticated ?
>>> -   BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL);
>>> +   if (authenticated)
>>> +   BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK);
>>> }
>>>
>>> authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s",
>>> ___
>>> svn-src-h...@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-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: r313965 - head/crypto/openssh

2017-02-19 Thread Oliver Pinter
Hello!

On 2/19/17, Kurt Lidl  wrote:
> Author: lidl
> Date: Sun Feb 19 20:35:39 2017
> New Revision: 313965
> URL: https://svnweb.freebsd.org/changeset/base/313965
>
> Log:
>   Only notify blacklistd for successful logins in auth.c

What's the rationale behind this change?

>
>   Reported by:Rick Adams
>   Reviewed by:des
>   MFC after:  3 days
>   Sponsored by:   The FreeBSD Foundation
>
> Modified:
>   head/crypto/openssh/auth.c
>
> Modified: head/crypto/openssh/auth.c
> ==
> --- head/crypto/openssh/auth.cSun Feb 19 19:56:12 2017
> (r313964)
> +++ head/crypto/openssh/auth.cSun Feb 19 20:35:39 2017
> (r313965)
> @@ -295,8 +295,8 @@ auth_log(Authctxt *authctxt, int authent
>   authmsg = "Partial";
>   else {
>   authmsg = authenticated ? "Accepted" : "Failed";
> - BLACKLIST_NOTIFY(authenticated ?
> - BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL);
> + if (authenticated)
> + BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK);
>   }
>
>   authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s",
> ___
> svn-src-h...@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-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"


  1   2   3   >