Re: svn commit: r360033 - head/tests/sys/kqueue/libkqueue

2020-04-16 Thread Kyle Evans
On Thu, Apr 16, 2020 at 9:33 PM Ian Lepore  wrote:
>
> On Fri, 2020-04-17 at 02:22 +, Kyle Evans wrote:
> > Author: kevans
> > Date: Fri Apr 17 02:22:15 2020
> > New Revision: 360033
> > URL: https://svnweb.freebsd.org/changeset/base/360033
> >
> > Log:
> >   tests: kqueue: use a more precise timer for the NOTE_ABSTIME test
> >
> >   Originally noticed while attempting to run the kqueue tests under
> >   qemu-user-static, this apparently just happens sometimes when running in a
> >   jail in general -- the timer will fire off "too early," but it's really 
> > just
> >   the result of imprecise measurements (noted by cem).
> >
> >   Kicking this over to NOTE_USECONDS still tests the correct thing while
> >   allowing it to work more consistently; a basic sanity test reveals that we
> >   often end up coming in just less than 200 microseconds after the timer
> >   fired off.
> >
> >   MFC after:  3 days
> >
> > Modified:
> >   head/tests/sys/kqueue/libkqueue/timer.c
> >
> > Modified: head/tests/sys/kqueue/libkqueue/timer.c
> > ==
> > --- head/tests/sys/kqueue/libkqueue/timer.c   Fri Apr 17 02:21:46 2020  
> >   (r360032)
> > +++ head/tests/sys/kqueue/libkqueue/timer.c   Fri Apr 17 02:22:15 2020  
> >   (r360033)
> > @@ -216,17 +216,17 @@ test_abstime(void)
> >  {
> >  const char *test_id = "kevent(EVFILT_TIMER, EV_ONESHOT, NOTE_ABSTIME)";
> >  struct kevent kev;
> > -time_t start;
> > -time_t stop;
> > -const int timeout = 3;
> > +long end, start, stop;
> > +const int timeout_sec = 3;
> >
> >  test_begin(test_id);
> >
> >  test_no_kevents();
> >
> > -start = time(NULL);
> > +start = now();
> > +end = start + SEC_TO_US(timeout_sec);
> >  EV_SET(, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT,
> > -  NOTE_ABSTIME | NOTE_SECONDS, start + timeout, NULL);
> > +  NOTE_ABSTIME | NOTE_USECONDS, end, NULL);
> >  if (kevent(kqfd, , 1, NULL, 0, NULL) < 0)
> >  err(1, "%s", test_id);
> >
> > @@ -235,10 +235,10 @@ test_abstime(void)
> >  kev.data = 1;
> >  kev.fflags = 0;
> >  kevent_cmp(, kevent_get(kqfd));
> > -stop = time(NULL);
> > -if (stop < start + timeout)
> > -err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + 
> > timeout));
> >
> > +stop = now();
> > +if (stop < end)
> > +err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)end);
> >  /* Check if the event occurs again */
> >  sleep(3);
> >  test_no_kevents();
>
> Not caused by you, but this change made me notice:  using 'long' to
> hold the number of microseconds since the unix epoch will only work on
> amd64 and arm64.  Everything involved with that needs to use uint64_t
> to work on all arches.
>
> -- Ian
>

Good point, I'll go fix that after arichardson's in-flight change near
these tests lands.

Thanks,

Kyle Evans
___
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: r360033 - head/tests/sys/kqueue/libkqueue

2020-04-16 Thread Ian Lepore
On Fri, 2020-04-17 at 02:22 +, Kyle Evans wrote:
> Author: kevans
> Date: Fri Apr 17 02:22:15 2020
> New Revision: 360033
> URL: https://svnweb.freebsd.org/changeset/base/360033
> 
> Log:
>   tests: kqueue: use a more precise timer for the NOTE_ABSTIME test
>   
>   Originally noticed while attempting to run the kqueue tests under
>   qemu-user-static, this apparently just happens sometimes when running in a
>   jail in general -- the timer will fire off "too early," but it's really just
>   the result of imprecise measurements (noted by cem).
>   
>   Kicking this over to NOTE_USECONDS still tests the correct thing while
>   allowing it to work more consistently; a basic sanity test reveals that we
>   often end up coming in just less than 200 microseconds after the timer
>   fired off.
>   
>   MFC after:  3 days
> 
> Modified:
>   head/tests/sys/kqueue/libkqueue/timer.c
> 
> Modified: head/tests/sys/kqueue/libkqueue/timer.c
> ==
> --- head/tests/sys/kqueue/libkqueue/timer.c   Fri Apr 17 02:21:46 2020
> (r360032)
> +++ head/tests/sys/kqueue/libkqueue/timer.c   Fri Apr 17 02:22:15 2020
> (r360033)
> @@ -216,17 +216,17 @@ test_abstime(void)
>  {
>  const char *test_id = "kevent(EVFILT_TIMER, EV_ONESHOT, NOTE_ABSTIME)";
>  struct kevent kev;
> -time_t start;
> -time_t stop;
> -const int timeout = 3;
> +long end, start, stop;
> +const int timeout_sec = 3;
>  
>  test_begin(test_id);
>  
>  test_no_kevents();
>  
> -start = time(NULL);
> +start = now();
> +end = start + SEC_TO_US(timeout_sec);
>  EV_SET(, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT,
> -  NOTE_ABSTIME | NOTE_SECONDS, start + timeout, NULL);
> +  NOTE_ABSTIME | NOTE_USECONDS, end, NULL);
>  if (kevent(kqfd, , 1, NULL, 0, NULL) < 0)
>  err(1, "%s", test_id);
>  
> @@ -235,10 +235,10 @@ test_abstime(void)
>  kev.data = 1;
>  kev.fflags = 0;
>  kevent_cmp(, kevent_get(kqfd));
> -stop = time(NULL);
> -if (stop < start + timeout)
> -err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + 
> timeout));
>  
> +stop = now();
> +if (stop < end)
> +err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)end);
>  /* Check if the event occurs again */
>  sleep(3);
>  test_no_kevents();

Not caused by you, but this change made me notice:  using 'long' to
hold the number of microseconds since the unix epoch will only work on
amd64 and arm64.  Everything involved with that needs to use uint64_t
to work on all arches.

-- Ian


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


svn commit: r360033 - head/tests/sys/kqueue/libkqueue

2020-04-16 Thread Kyle Evans
Author: kevans
Date: Fri Apr 17 02:22:15 2020
New Revision: 360033
URL: https://svnweb.freebsd.org/changeset/base/360033

Log:
  tests: kqueue: use a more precise timer for the NOTE_ABSTIME test
  
  Originally noticed while attempting to run the kqueue tests under
  qemu-user-static, this apparently just happens sometimes when running in a
  jail in general -- the timer will fire off "too early," but it's really just
  the result of imprecise measurements (noted by cem).
  
  Kicking this over to NOTE_USECONDS still tests the correct thing while
  allowing it to work more consistently; a basic sanity test reveals that we
  often end up coming in just less than 200 microseconds after the timer
  fired off.
  
  MFC after:3 days

Modified:
  head/tests/sys/kqueue/libkqueue/timer.c

Modified: head/tests/sys/kqueue/libkqueue/timer.c
==
--- head/tests/sys/kqueue/libkqueue/timer.c Fri Apr 17 02:21:46 2020
(r360032)
+++ head/tests/sys/kqueue/libkqueue/timer.c Fri Apr 17 02:22:15 2020
(r360033)
@@ -216,17 +216,17 @@ test_abstime(void)
 {
 const char *test_id = "kevent(EVFILT_TIMER, EV_ONESHOT, NOTE_ABSTIME)";
 struct kevent kev;
-time_t start;
-time_t stop;
-const int timeout = 3;
+long end, start, stop;
+const int timeout_sec = 3;
 
 test_begin(test_id);
 
 test_no_kevents();
 
-start = time(NULL);
+start = now();
+end = start + SEC_TO_US(timeout_sec);
 EV_SET(, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT,
-  NOTE_ABSTIME | NOTE_SECONDS, start + timeout, NULL);
+  NOTE_ABSTIME | NOTE_USECONDS, end, NULL);
 if (kevent(kqfd, , 1, NULL, 0, NULL) < 0)
 err(1, "%s", test_id);
 
@@ -235,10 +235,10 @@ test_abstime(void)
 kev.data = 1;
 kev.fflags = 0;
 kevent_cmp(, kevent_get(kqfd));
-stop = time(NULL);
-if (stop < start + timeout)
-err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)(start + 
timeout));
 
+stop = now();
+if (stop < end)
+err(1, "too early %jd %jd", (intmax_t)stop, (intmax_t)end);
 /* Check if the event occurs again */
 sleep(3);
 test_no_kevents();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360032 - head/sys/fs/nfsserver

2020-04-16 Thread Rick Macklem
Author: rmacklem
Date: Fri Apr 17 02:21:46 2020
New Revision: 360032
URL: https://svnweb.freebsd.org/changeset/base/360032

Log:
  Add a sanity check for nes_numsecflavor to the NFS server.
  
  Ryan Moeller reported crashes in the NFS server that appear to be
  caused by stack corruption in nfsrv_compound(). It appears that
  the stack got corrupted just after a NFSv4.1 Lookup that crosses
  a server mount point.
  Although it is just a "theory" at this point, the most obvious way
  the stack could get corrupted would be if nfsvno_checkexp() somehow
  acquires an export with a bogus nes_numsecflavor value. This would
  cause the copying of the secflavors to run off the end of the array,
  which is allocated on the stack below where the corruption occurs.
  
  This sanity check is simple to do and would stop the stack corruption
  if the theory is correct. Otherwise, doing the sanity check seems to
  be a reasonable safety belt to add to the code.
  
  Reported by:  freqlabs
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 17 02:09:31 2020
(r360031)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Apr 17 02:21:46 2020
(r360032)
@@ -3066,6 +3066,11 @@ nfsvno_checkexp(struct mount *mp, struct sockaddr *nam
exp->nes_numsecflavor = 0;
error = 0;
}
+   } else if (exp->nes_numsecflavor < 1 || exp->nes_numsecflavor >
+   MAXSECFLAVORS) {
+   printf("nfsvno_checkexp: numsecflavors out of range\n");
+   exp->nes_numsecflavor = 0;
+   error = EACCES;
} else {
/* Copy the security flavors. */
for (i = 0; i < exp->nes_numsecflavor; i++)
@@ -3102,6 +3107,12 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct
} else {
vput(*vpp);
}
+   } else if (exp->nes_numsecflavor < 1 || exp->nes_numsecflavor >
+   MAXSECFLAVORS) {
+   printf("nfsvno_fhtovp: numsecflavors out of range\n");
+   exp->nes_numsecflavor = 0;
+   error = EACCES;
+   vput(*vpp);
} else {
/* Copy the security flavors. */
for (i = 0; i < exp->nes_numsecflavor; i++)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360031 - head/sys/security/audit

2020-04-16 Thread Kyle Evans
Author: kevans
Date: Fri Apr 17 02:09:31 2020
New Revision: 360031
URL: https://svnweb.freebsd.org/changeset/base/360031

Log:
  audit_canon_path_vp: don't panic if cdir == NULL
  
  cdir may have simply failed to resolve (e.g. fget_cap failure in namei
  leading to NULL dp passed to AUDIT_ARG_UPATH*_VP); restore the pre-rS358191
  behavior of setting cpath[0] = '\0' and bailing out instead of panicking.
  
  This was found by inadvertently running the libc/c063 tests with auditing
  enabled, resulting in a panic.
  
  Reviewed by:  mjg (committed version actually his)
  Differential Revision:https://reviews.freebsd.org/D24445

Modified:
  head/sys/security/audit/audit_bsm_klib.c

Modified: head/sys/security/audit/audit_bsm_klib.c
==
--- head/sys/security/audit/audit_bsm_klib.cFri Apr 17 01:52:27 2020
(r360030)
+++ head/sys/security/audit/audit_bsm_klib.cFri Apr 17 02:09:31 2020
(r360031)
@@ -433,10 +433,15 @@ audit_canon_path_vp(struct thread *td, struct vnode *r
__func__,  __FILE__, __LINE__);
 
copy = path;
-   if (*path == '/')
+   if (*path == '/') {
vp = rdir;
-   else
+   } else {
+   if (cdir == NULL) {
+   cpath[0] = '\0';
+   return;
+   }
vp = cdir;
+   }
MPASS(vp != NULL);
/*
 * NB: We require that the supplied array be at least MAXPATHLEN bytes
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360030 - stable/11/sys/ufs/ffs

2020-04-16 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 17 01:52:27 2020
New Revision: 360030
URL: https://svnweb.freebsd.org/changeset/base/360030

Log:
  MFC r359766:
  ufs: apply suspension for non-forced rw unmounts.

Modified:
  stable/11/sys/ufs/ffs/ffs_vfsops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ufs/ffs/ffs_vfsops.c
==
--- stable/11/sys/ufs/ffs/ffs_vfsops.c  Fri Apr 17 01:06:51 2020
(r360029)
+++ stable/11/sys/ufs/ffs/ffs_vfsops.c  Fri Apr 17 01:52:27 2020
(r360030)
@@ -1252,11 +1252,9 @@ ffs_unmount(mp, mntflags)
flags = 0;
td = curthread;
fs = ump->um_fs;
-   susp = 0;
-   if (mntflags & MNT_FORCE) {
+   if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
-   susp = fs->fs_ronly == 0;
-   }
+   susp = fs->fs_ronly == 0;
 #ifdef UFS_EXTATTR
if ((error = ufs_extattr_stop(mp, td))) {
if (error != EOPNOTSUPP)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360029 - stable/12/sys/ufs/ffs

2020-04-16 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 17 01:06:51 2020
New Revision: 360029
URL: https://svnweb.freebsd.org/changeset/base/360029

Log:
  MFC r359766:
  ufs: apply suspension for non-forced rw unmounts.

Modified:
  stable/12/sys/ufs/ffs/ffs_vfsops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/ufs/ffs/ffs_vfsops.c
==
--- stable/12/sys/ufs/ffs/ffs_vfsops.c  Thu Apr 16 23:31:39 2020
(r360028)
+++ stable/12/sys/ufs/ffs/ffs_vfsops.c  Fri Apr 17 01:06:51 2020
(r360029)
@@ -1225,11 +1225,9 @@ ffs_unmount(mp, mntflags)
flags = 0;
td = curthread;
fs = ump->um_fs;
-   susp = 0;
-   if (mntflags & MNT_FORCE) {
+   if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
-   susp = fs->fs_ronly == 0;
-   }
+   susp = fs->fs_ronly == 0;
 #ifdef UFS_EXTATTR
if ((error = ufs_extattr_stop(mp, td))) {
if (error != EOPNOTSUPP)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360028 - head/bin/sh

2020-04-16 Thread Adrian Chadd
Author: adrian
Date: Thu Apr 16 23:31:39 2020
New Revision: 360028
URL: https://svnweb.freebsd.org/changeset/base/360028

Log:
  [sh] Fix a "may be unused" warning on mips-gcc
  
  mips-gcc for mips32 was complaining that c was potentially used before
  being set.  Setting it to 0 before calling fdgetsc() looks like the right
  thing to do in this instance; there's an explicit check for c == 0 later
  on.
  
  Tested: mips-gcc mips32 build, running /bin/sh on mips32

Modified:
  head/bin/sh/miscbltin.c

Modified: head/bin/sh/miscbltin.c
==
--- head/bin/sh/miscbltin.c Thu Apr 16 23:29:49 2020(r360027)
+++ head/bin/sh/miscbltin.c Thu Apr 16 23:31:39 2020(r360028)
@@ -245,6 +245,7 @@ readcmd(int argc __unused, char **argv __unused)
lastnonifs = lastnonifsws = -1;
fdctx_init(STDIN_FILENO, );
for (;;) {
+   c = 0;
nread = fdgetc(, );
if (nread == -1) {
if (errno == EINTR) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360027 - head/stand/libsa

2020-04-16 Thread Adrian Chadd
Author: adrian
Date: Thu Apr 16 23:29:49 2020
New Revision: 360027
URL: https://svnweb.freebsd.org/changeset/base/360027

Log:
  [libsa] Fix typecast of pointer for st_dev
  
  This code was trying to use a pointer value for st_dev, which is definitely
  not a pointer.  Instead, cast to uintptr_t so it becomes a non-pointer value
  before casting it.
  
  Tested: mips-gcc cross compile, mips32 build

Modified:
  head/stand/libsa/pkgfs.c

Modified: head/stand/libsa/pkgfs.c
==
--- head/stand/libsa/pkgfs.cThu Apr 16 23:28:47 2020(r360026)
+++ head/stand/libsa/pkgfs.cThu Apr 16 23:29:49 2020(r360027)
@@ -399,7 +399,7 @@ pkg_stat(struct open_file *f, struct stat *sb)
sb->st_size = tf->tf_size;
sb->st_blocks = (tf->tf_size + 511) / 512;
sb->st_mtime = pkg_atol(tf->tf_hdr.ut_mtime, 12);
-   sb->st_dev = (off_t)tf->tf_pkg;
+   sb->st_dev = (off_t)((uintptr_t)tf->tf_pkg);
sb->st_ino = tf->tf_ofs;/* unique per tf_pkg */
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360026 - in head/sys/net: . route

2020-04-16 Thread Adrian Chadd
Author: adrian
Date: Thu Apr 16 23:28:47 2020
New Revision: 360026
URL: https://svnweb.freebsd.org/changeset/base/360026

Log:
  Remove an duplicate definition of nhops_dump_sysctl()
  
  One of the source files included both nhop.h and shared.h, leading to this
  clashing.
  
  Tested with: mips-gcc cross toolchain

Modified:
  head/sys/net/route/nhop.h
  head/sys/net/rtsock.c

Modified: head/sys/net/route/nhop.h
==
--- head/sys/net/route/nhop.h   Thu Apr 16 21:56:52 2020(r360025)
+++ head/sys/net/route/nhop.h   Thu Apr 16 23:28:47 2020(r360026)
@@ -177,8 +177,6 @@ uint32_t nhop_get_idx(const struct nhop_object *nh);
 enum nhop_type nhop_get_type(const struct nhop_object *nh);
 int nhop_get_rtflags(const struct nhop_object *nh);
 
-int nhops_dump_sysctl(struct rib_head *rh, struct sysctl_req *w);
-
 #endif /* _KERNEL */
 
 /* Kernel <> userland structures */

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Thu Apr 16 21:56:52 2020(r360025)
+++ head/sys/net/rtsock.c   Thu Apr 16 23:28:47 2020(r360026)
@@ -78,6 +78,7 @@
 #include 
 #endif
 #include 
+#include 
 
 #ifdef COMPAT_FREEBSD32
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r360025 - head/sys/dev/acpica

2020-04-16 Thread Colin Percival
On 2020-04-16 15:05, Oliver Pinter wrote:
> On Thursday, April 16, 2020, Colin Percival  > wrote:
> Log:
>   Alert devd when acpi_video brightness changes
> 
> Please add this to release notes! 
I considered that, but so far I don't have any evidence that other systems
exist with the same half-working ACPI.  Unless you're aware of people who
are seeing the same "hw.apci.video.lcd0.brightness changes but the backlight
doesn't" syndrome?

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
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"


svn commit: r360025 - head/sys/dev/acpica

2020-04-16 Thread Colin Percival
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

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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360024 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux kern powerpc/powerpc sys

2020-04-16 Thread Brooks Davis
Author: brooks
Date: Thu Apr 16 21:53:17 2020
New Revision: 360024
URL: https://svnweb.freebsd.org/changeset/base/360024

Log:
  Convert canary, execpathp, and pagesizes to pointers.
  
  Use AUXARGS_ENTRY_PTR to export these pointers.  This is a followup to
  r359987 and r359988.
  
  Reviewed by:  jhb
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24446

Modified:
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm64/linux/linux_sysvec.c
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/powerpc/powerpc/elf_common.c
  head/sys/sys/imgact.h

Modified: head/sys/amd64/linux/linux_sysvec.c
==
--- head/sys/amd64/linux/linux_sysvec.c Thu Apr 16 20:46:35 2020
(r360023)
+++ head/sys/amd64/linux/linux_sysvec.c Thu Apr 16 21:53:17 2020
(r360024)
@@ -254,9 +254,9 @@ linux_copyout_auxargs(struct image_params *imgp, uintp
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid);
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
-   AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+   AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
-   AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+   AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -315,8 +315,8 @@ linux_copyout_strings(struct image_params *imgp, uintp
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(void *));
-   imgp->execpathp = destp;
-   error = copyout(imgp->execpath, (void *)destp, execpath_len);
+   imgp->execpathp = (void *)destp;
+   error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -324,8 +324,8 @@ linux_copyout_strings(struct image_params *imgp, uintp
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(void *));
-   imgp->canary = destp;
-   error = copyout(canary, (void *)destp, sizeof(canary));
+   imgp->canary = (void *)destp;
+   error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
 

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 16 20:46:35 2020
(r360023)
+++ head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 16 21:53:17 2020
(r360024)
@@ -742,8 +742,8 @@ linux_copyout_strings(struct image_params *imgp, uintp
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(uint32_t));
-   imgp->execpathp = destp;
-   error = copyout(imgp->execpath, (void *)destp, execpath_len);
+   imgp->execpathp = (void *)destp;
+   error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -751,8 +751,8 @@ linux_copyout_strings(struct image_params *imgp, uintp
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(uint32_t));
-   imgp->canary = destp;
-   error = copyout(canary, (void *)destp, sizeof(canary));
+   imgp->canary = (void *)destp;
+   error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
 

Modified: head/sys/arm64/linux/linux_sysvec.c
==
--- head/sys/arm64/linux/linux_sysvec.c Thu Apr 16 20:46:35 2020
(r360023)
+++ head/sys/arm64/linux/linux_sysvec.c Thu Apr 16 21:53:17 2020
(r360024)
@@ -180,9 +180,9 @@ linux_copyout_auxargs(struct image_params *imgp, uintp
 #if 0  /* LINUXTODO: implement arm64 LINUX_AT_PLATFORM */
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
 #endif
-   AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+   AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
-   AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+   AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);

svn commit: r360023 - head/sys/powerpc/aim

2020-04-16 Thread John Baldwin
Author: jhb
Date: Thu Apr 16 20:46:35 2020
New Revision: 360023
URL: https://svnweb.freebsd.org/changeset/base/360023

Log:
  Use %zu to print a size_t value instead of %ju.
  
  This fixes the build for 32-bit kernels.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cThu Apr 16 20:45:54 2020
(r360022)
+++ head/sys/powerpc/aim/mmu_oea64.cThu Apr 16 20:46:35 2020
(r360023)
@@ -928,7 +928,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta
}
 
if (boothowto & RB_VERBOSE) {
-   printf("mmu_oea64: bpvo pool entries = %d, bpvo pool size = %ju 
MB\n",
+   printf("mmu_oea64: bpvo pool entries = %d, bpvo pool size = %zu 
MB\n",
moea64_bpvo_pool_size,
moea64_bpvo_pool_size*sizeof(struct pvo_entry) / 1048576);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360022 - head/sys/mips/conf

2020-04-16 Thread John Baldwin
Author: jhb
Date: Thu Apr 16 20:45:54 2020
New Revision: 360022
URL: https://svnweb.freebsd.org/changeset/base/360022

Log:
  Add 'gpio' since mmc now requires gpio_if.h.

Modified:
  head/sys/mips/conf/std.XLP

Modified: head/sys/mips/conf/std.XLP
==
--- head/sys/mips/conf/std.XLP  Thu Apr 16 20:44:23 2020(r360021)
+++ head/sys/mips/conf/std.XLP  Thu Apr 16 20:45:54 2020(r360022)
@@ -113,6 +113,7 @@ device  cfi
 device cfid
 
 # MMC/SD
+device gpio
 device mmc # MMC/SD bus
 device mmcsd   # MMC/SD memory card
 device sdhci   # Generic PCI SD Host Controller
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360021 - head/sys/arm/nvidia

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 20:44:23 2020
New Revision: 360021
URL: https://svnweb.freebsd.org/changeset/base/360021

Log:
  arm: nvidia: pcie: Rename class name to pcib
  
  Reported by:  jhb

Modified:
  head/sys/arm/nvidia/tegra_pcie.c

Modified: head/sys/arm/nvidia/tegra_pcie.c
==
--- head/sys/arm/nvidia/tegra_pcie.cThu Apr 16 20:17:24 2020
(r360020)
+++ head/sys/arm/nvidia/tegra_pcie.cThu Apr 16 20:44:23 2020
(r360021)
@@ -1630,7 +1630,7 @@ static device_method_t tegra_pcib_methods[] = {
 };
 
 static devclass_t pcib_devclass;
-DEFINE_CLASS_1(tegra_pcib, tegra_pcib_driver, tegra_pcib_methods,
+DEFINE_CLASS_1(pcib, tegra_pcib_driver, tegra_pcib_methods,
 sizeof(struct tegra_pcib_softc), ofw_pci_driver);
 DRIVER_MODULE(tegra_pcib, simplebus, tegra_pcib_driver, pcib_devclass,
 NULL, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360020 - in head/sys: netinet netinet6

2020-04-16 Thread Jonathan T. Looney
Author: jtl
Date: Thu Apr 16 20:17:24 2020
New Revision: 360020
URL: https://svnweb.freebsd.org/changeset/base/360020

Log:
  Avoid calling protocol drain routines more than once per reclamation event.
  
  mb_reclaim() calls the protocol drain routines for each protocol in each
  domain. Some protocols exist in more than one domain and share drain
  routines. In the case of SCTP, it also uses the same drain routine for
  its SOCK_SEQPACKET and SOCK_STREAM entries in the same domain.
  
  On systems with INET, INET6, and SCTP all defined, mb_reclaim() calls
  sctp_drain() four times. On systems with INET and INET6 defined,
  mb_reclaim() calls tcp_drain() twice. mb_reclaim() is the only in-tree
  caller of the pr_drain protocol entry.
  
  Eliminate this duplication by ensuring that each pr_drain routine is only
  specified for one protocol entry in one domain.
  
  Reviewed by:  tuexen
  MFC after:2 weeks
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24418

Modified:
  head/sys/netinet/in_proto.c
  head/sys/netinet6/in6_proto.c

Modified: head/sys/netinet/in_proto.c
==
--- head/sys/netinet/in_proto.c Thu Apr 16 20:07:34 2020(r360019)
+++ head/sys/netinet/in_proto.c Thu Apr 16 20:17:24 2020(r360020)
@@ -163,7 +163,7 @@ struct protosw inetsw[] = {
.pr_input = sctp_input,
.pr_ctlinput =  sctp_ctlinput,
.pr_ctloutput = sctp_ctloutput,
-   .pr_drain = sctp_drain,
+   .pr_drain = NULL, /* Covered by the SOCK_SEQPACKET entry. */
.pr_usrreqs =   _usrreqs
 },
 #endif /* SCTP */

Modified: head/sys/netinet6/in6_proto.c
==
--- head/sys/netinet6/in6_proto.c   Thu Apr 16 20:07:34 2020
(r360019)
+++ head/sys/netinet6/in6_proto.c   Thu Apr 16 20:17:24 2020
(r360020)
@@ -172,11 +172,11 @@ struct protosw inet6sw[] = {
.pr_input = tcp6_input,
.pr_ctlinput =  tcp6_ctlinput,
.pr_ctloutput = tcp_ctloutput,
-#ifndef INET   /* don't call initialization and timeout routines twice */
+#ifndef INET   /* don't call initialization, timeout, and drain routines twice 
*/
.pr_init =  tcp_init,
.pr_slowtimo =  tcp_slowtimo,
-#endif
.pr_drain = tcp_drain,
+#endif
.pr_usrreqs =   _usrreqs,
 },
 #ifdef SCTP
@@ -188,8 +188,8 @@ struct protosw inet6sw[] = {
.pr_input = sctp6_input,
.pr_ctlinput =  sctp6_ctlinput,
.pr_ctloutput = sctp_ctloutput,
+#ifndef INET   /* Do not call initialization and drain routines twice. */
.pr_drain = sctp_drain,
-#ifndef INET   /* Do not call initialization twice. */
.pr_init =  sctp_init,
 #endif
.pr_usrreqs =   _usrreqs
@@ -202,7 +202,7 @@ struct protosw inet6sw[] = {
.pr_input = sctp6_input,
.pr_ctlinput =  sctp6_ctlinput,
.pr_ctloutput = sctp_ctloutput,
-   .pr_drain = sctp_drain,
+   .pr_drain = NULL, /* Covered by the SOCK_SEQPACKET entry. */
.pr_usrreqs =   _usrreqs
 },
 #endif /* SCTP */
___
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: r360018 - in head/sys/arm: mv nvidia

2020-04-16 Thread John Baldwin
On 4/16/20 11:37 AM, Emmanuel Vadot wrote:
> Author: manu
> Date: Thu Apr 16 18:37:11 2020
> New Revision: 360018
> URL: https://svnweb.freebsd.org/changeset/base/360018
> 
> Log:
>   arm: Fix duplicate pcib DRIVER_MODULE
>   
>   Name each pcib driver uniquely.
>   This remove the warning printed at each arm boot :
>   module_register: cannot register simplebus/pcib from kernel; already loaded 
> from kernel
> 
> Modified: head/sys/arm/nvidia/tegra_pcie.c
> ==
> --- head/sys/arm/nvidia/tegra_pcie.c  Thu Apr 16 17:53:23 2020
> (r360017)
> +++ head/sys/arm/nvidia/tegra_pcie.c  Thu Apr 16 18:37:11 2020
> (r360018)
> @@ -1630,7 +1630,7 @@ static device_method_t tegra_pcib_methods[] = {
>  };
>  
>  static devclass_t pcib_devclass;
> -DEFINE_CLASS_1(pcib, tegra_pcib_driver, tegra_pcib_methods,
> +DEFINE_CLASS_1(tegra_pcib, tegra_pcib_driver, tegra_pcib_methods,
>  sizeof(struct tegra_pcib_softc), ofw_pci_driver);

I think this line you want to revert.  The first argument to DEFINE_CLASS_*
is the class name (the string name in a manual driver_t) and that needs to
stay "pcib" here.

The change to DRIVER_MODULE() in this file is correct though.

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


svn commit: r360019 - head/tests/sys/kern

2020-04-16 Thread Jonathan T. Looney
Author: jtl
Date: Thu Apr 16 20:07:34 2020
New Revision: 360019
URL: https://svnweb.freebsd.org/changeset/base/360019

Log:
  Add a regression test for the changes in r359922 and r359923.
  
  Note that the Python code has been tested on both Python 2.7 and 3.7.
  
  Reviewed by:  olivier
  MFC after:2 weeks
  Sponsored by: Netflix, Inc.

Added:
  head/tests/sys/kern/sonewconn_overflow.py   (contents, props changed)
  head/tests/sys/kern/sonewconn_overflow.sh   (contents, props changed)
Modified:
  head/tests/sys/kern/Makefile

Modified: head/tests/sys/kern/Makefile
==
--- head/tests/sys/kern/MakefileThu Apr 16 18:37:11 2020
(r360018)
+++ head/tests/sys/kern/MakefileThu Apr 16 20:07:34 2020
(r360019)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+PACKAGE=   tests
+
 TESTSRC=   ${SRCTOP}/contrib/netbsd-tests/kernel
 .PATH: ${SRCTOP}/sys/kern
 
@@ -24,6 +26,12 @@ ATF_TESTS_C+=waitpid_nohang
 ATF_TESTS_C+=  pdeathsig
 
 ATF_TESTS_SH+= coredump_phnum_test
+ATF_TESTS_SH+= sonewconn_overflow
+TEST_METADATA.sonewconn_overflow+= required_programs="python"
+TEST_METADATA.sonewconn_overflow+= required_user="root"
+
+${PACKAGE}FILES+=  sonewconn_overflow.py
+${PACKAGE}FILESMODE_sonewconn_overflow.py=0555
 
 BINDIR=${TESTSDIR}
 PROGS+=coredump_phnum_helper

Added: head/tests/sys/kern/sonewconn_overflow.py
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/kern/sonewconn_overflow.py   Thu Apr 16 20:07:34 2020
(r360019)
@@ -0,0 +1,156 @@
+#!/usr/bin/env python
+#-
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2020 Netflix, Inc.
+#
+# 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$
+#
+
+import socket
+import os
+import sys
+from subprocess import check_output
+from time import sleep
+
+V4HOST = '127.0.0.1'
+V6HOST = '::1'
+TCPPORT = 65432
+UNIXSOCK = '/tmp/testsock'
+TYPE = socket.SOCK_STREAM
+
+class GenericTest(object):
+def __init__(self):
+raise NotImplementedError("Subclass must override the __init__ method")
+def setup(self, af, addr):
+self.sockets = []
+self.ls = None
+self.ls = socket.socket(af, TYPE)
+self.ls.bind(addr)
+self.ls.listen(2)
+self.af = af
+self.addr = addr
+def doTest(self, cnt):
+rv = 0
+for i in range(0, cnt):
+try:
+s = socket.socket(self.af, TYPE)
+s.connect(self.addr)
+except:
+continue
+self.sockets.append(s)
+rv += 1
+return rv
+def __del__(self):
+for s in self.sockets:
+s.close()
+if self.ls is not None:
+self.ls.close()
+
+class IPv4Test(GenericTest):
+def __init__(self):
+super(IPv4Test, self).setup(socket.AF_INET, (V4HOST, TCPPORT))
+
+class IPv6Test(GenericTest):
+def __init__(self):
+super(IPv6Test, self).setup(socket.AF_INET6, (V6HOST, TCPPORT))
+
+class UnixTest(GenericTest):
+def __init__(self):
+super(UnixTest, self).setup(socket.AF_UNIX, UNIXSOCK)
+def __del__(self):
+super(UnixTest, self).__del__()
+os.remove(UNIXSOCK)
+
+class LogChecker():
+def __init__(self):
+# Figure out how big the dmesg buffer is.
+self.dmesgOff = len(check_output("/sbin/dmesg"))
+
+def checkForMsg(self, expected):
+newOff = self.dmesgOff
+for i in range(0, 3):
+dmesg = check_output("/sbin/dmesg")
+newOff = len(dmesg)
+

svn commit: r360018 - in head/sys/arm: mv nvidia

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 18:37:11 2020
New Revision: 360018
URL: https://svnweb.freebsd.org/changeset/base/360018

Log:
  arm: Fix duplicate pcib DRIVER_MODULE
  
  Name each pcib driver uniquely.
  This remove the warning printed at each arm boot :
  module_register: cannot register simplebus/pcib from kernel; already loaded 
from kernel

Modified:
  head/sys/arm/mv/mv_pci.c
  head/sys/arm/nvidia/tegra_pcie.c

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cThu Apr 16 17:53:23 2020(r360017)
+++ head/sys/arm/mv/mv_pci.cThu Apr 16 18:37:11 2020(r360018)
@@ -409,8 +409,8 @@ static driver_t mv_pcib_driver = {
 
 devclass_t pcib_devclass;
 
-DRIVER_MODULE(pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0);
-DRIVER_MODULE(pcib, pcib_ctrl, mv_pcib_driver, pcib_devclass, 0, 0);
+DRIVER_MODULE(mv_pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0);
+DRIVER_MODULE(mv_pcib, pcib_ctrl, mv_pcib_driver, pcib_devclass, 0, 0);
 
 static struct mtx pcicfg_mtx;
 

Modified: head/sys/arm/nvidia/tegra_pcie.c
==
--- head/sys/arm/nvidia/tegra_pcie.cThu Apr 16 17:53:23 2020
(r360017)
+++ head/sys/arm/nvidia/tegra_pcie.cThu Apr 16 18:37:11 2020
(r360018)
@@ -1630,7 +1630,7 @@ static device_method_t tegra_pcib_methods[] = {
 };
 
 static devclass_t pcib_devclass;
-DEFINE_CLASS_1(pcib, tegra_pcib_driver, tegra_pcib_methods,
+DEFINE_CLASS_1(tegra_pcib, tegra_pcib_driver, tegra_pcib_methods,
 sizeof(struct tegra_pcib_softc), ofw_pci_driver);
-DRIVER_MODULE(pcib, simplebus, tegra_pcib_driver, pcib_devclass,
+DRIVER_MODULE(tegra_pcib, simplebus, tegra_pcib_driver, pcib_devclass,
 NULL, NULL);
___
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: r359511 - head/bin/sh

2020-04-16 Thread Adrian Chadd
hi!

This broke compiling using external gcc toolchain for mips32. I'm
going to go poke at it a bit more but it looks like there's a /lot/ of
warnings. :-)



-adrian

On Wed, 1 Apr 2020 at 08:13, Edward Tomasz Napierala  wrote:
>
> Author: trasz
> Date: Wed Apr  1 15:12:51 2020
> New Revision: 359511
> URL: https://svnweb.freebsd.org/changeset/base/359511
>
> Log:
>   Bump WARNS for sh(1).
>
>   Reviewed by:  jilles
>   MFC after:2 weeks
>   Sponsored by: DARPA
>   Differential Revision:https://reviews.freebsd.org/D24181
>
> Modified:
>   head/bin/sh/Makefile
>
> Modified: head/bin/sh/Makefile
> ==
> --- head/bin/sh/MakefileWed Apr  1 15:10:26 2020(r359510)
> +++ head/bin/sh/MakefileWed Apr  1 15:12:51 2020(r359511)
> @@ -30,8 +30,6 @@ LIBADD=   edit
>  CFLAGS+=-DSHELL -I. -I${.CURDIR}
>  # for debug:
>  # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
> -WARNS?=2
> -WFORMAT=0
>
>  .PATH: ${.CURDIR}/bltin \
> ${.CURDIR:H}/kill \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360017 - head/sys/net

2020-04-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Apr 16 17:53:23 2020
New Revision: 360017
URL: https://svnweb.freebsd.org/changeset/base/360017

Log:
  Fix userland build broken by r360014.

Modified:
  head/sys/net/route.h

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hThu Apr 16 17:41:32 2020(r360016)
+++ head/sys/net/route.hThu Apr 16 17:53:23 2020(r360017)
@@ -346,6 +346,7 @@ struct rt_msghdr {
 #define RTAX_BRD   7   /* for NEWADDR, broadcast or p-p dest addr */
 #define RTAX_MAX   8   /* size of array to allocate */
 
+struct nhop_object;
 typedef int rt_filter_f_t(const struct rtentry *, const struct nhop_object *,
 void *);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360016 - head/share/man/man4

2020-04-16 Thread John Baldwin
Author: jhb
Date: Thu Apr 16 17:41:32 2020
New Revision: 360016
URL: https://svnweb.freebsd.org/changeset/base/360016

Log:
  Document TCP_TLS_MODE_TOE.

Modified:
  head/share/man/man4/tcp.4

Modified: head/share/man/man4/tcp.4
==
--- head/share/man/man4/tcp.4   Thu Apr 16 17:24:13 2020(r360015)
+++ head/share/man/man4/tcp.4   Thu Apr 16 17:41:32 2020(r360016)
@@ -34,7 +34,7 @@
 .\" From: @(#)tcp.48.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd March 31, 2020
+.Dd April 16, 2020
 .Dt TCP 4
 .Os
 .Sh NAME
@@ -341,6 +341,8 @@ socket buffer.
 Typically this encryption is performed in software.
 .It Dv TCP_TLS_MODE_IFNET
 TLS records are encrypted by the network interface card (NIC).
+.It Dv TCP_TLS_MODE_TOE
+TLS records are encrypted by the NIC using a TCP offload engine (TOE).
 .El
 .El
 .Pp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360015 - head/sys/kern

2020-04-16 Thread Brooks Davis
Author: brooks
Date: Thu Apr 16 17:24:13 2020
New Revision: 360015
URL: https://svnweb.freebsd.org/changeset/base/360015

Log:
  style(9): end continued line with operator.

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Thu Apr 16 17:20:18 2020(r360014)
+++ head/sys/kern/kern_sysctl.c Thu Apr 16 17:24:13 2020(r360015)
@@ -1655,8 +1655,8 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS)
 * string.  In ddb, don't worry about trying to make a malloced
 * snapshot.
 */
-   if ((oidp->oid_kind & (CTLFLAG_WR | CTLFLAG_TUN)) == 0 || arg2 == 0
-   || kdb_active) {
+   if ((oidp->oid_kind & (CTLFLAG_WR | CTLFLAG_TUN)) == 0 ||
+   arg2 == 0 || kdb_active) {
arg2 = strlen((char *)arg1) + 1;
ro_string = 1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360014 - in head/sys: net netinet netinet6

2020-04-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Apr 16 17:20:18 2020
New Revision: 360014
URL: https://svnweb.freebsd.org/changeset/base/360014

Log:
  Add nhop parameter to rti_filter callback.
  
  One of the goals of the new routing KPI defined in r359823 is to
   entirely hide`struct rtentry` from the consumers. It will allow to
   improve routing subsystem internals and deliver more features much faster.
  This change is one of the ongoing changes to eliminate direct
   struct rtentry field accesses.
  
  Additionally, with the followup multipath changes, single rtentry can point
   to multiple nexthops.
  
  With that in mind, convert rti_filter callback used when traversing the
   routing table to accept pair (rt, nhop) instead of nexthop.
  
  Reviewed by:  ae
  Differential Revision:https://reviews.freebsd.org/D24440

Modified:
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/route_temporal.c
  head/sys/netinet/in_rmx.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Apr 16 16:59:37 2020(r360013)
+++ head/sys/net/route.cThu Apr 16 17:20:18 2020(r360014)
@@ -143,7 +143,8 @@ EVENTHANDLER_LIST_DEFINE(rt_addrmsg);
 
 static int rt_getifa_fib(struct rt_addrinfo *, u_int);
 static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *);
-static int rt_ifdelroute(const struct rtentry *rt, void *arg);
+static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *,
+void *arg);
 static struct rtentry *rt_unlinkrte(struct rib_head *rnh,
 struct rt_addrinfo *info, int *perror);
 static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info);
@@ -1124,6 +1125,7 @@ rt_foreach_fib_walk_del(int family, rt_filter_f_t *fil
  *
  * Arguments:
  * rt  pointer to rtentry
+ * nh  pointer to nhop
  * arg argument passed to rnh->rnh_walktree() - detaching interface
  *
  * Returns:
@@ -1131,11 +1133,11 @@ rt_foreach_fib_walk_del(int family, rt_filter_f_t *fil
  * errno   failed - reason indicated
  */
 static int
-rt_ifdelroute(const struct rtentry *rt, void *arg)
+rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *nh, void 
*arg)
 {
struct ifnet*ifp = arg;
 
-   if (rt->rt_ifp != ifp)
+   if (nh->nh_ifp != ifp)
return (0);
 
/*
@@ -1203,7 +1205,7 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo 
}
 
if (info->rti_filter != NULL) {
-   if (info->rti_filter(rt, info->rti_filterdata) == 0) {
+   if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){
/* Not matched */
*perror = ENOENT;
return (NULL);

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hThu Apr 16 16:59:37 2020(r360013)
+++ head/sys/net/route.hThu Apr 16 17:20:18 2020(r360014)
@@ -346,7 +346,8 @@ struct rt_msghdr {
 #define RTAX_BRD   7   /* for NEWADDR, broadcast or p-p dest addr */
 #define RTAX_MAX   8   /* size of array to allocate */
 
-typedef int rt_filter_f_t(const struct rtentry *, void *);
+typedef int rt_filter_f_t(const struct rtentry *, const struct nhop_object *,
+void *);
 
 struct rt_addrinfo {
int rti_addrs;  /* Route RTF_ flags */

Modified: head/sys/net/route_temporal.c
==
--- head/sys/net/route_temporal.c   Thu Apr 16 16:59:37 2020
(r360013)
+++ head/sys/net/route_temporal.c   Thu Apr 16 17:20:18 2020
(r360014)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
  * Updates time of the next nearest route expiration as a side effect.
  */
 static int
-expire_route(const struct rtentry *rt, void *arg)
+expire_route(const struct rtentry *rt, const struct nhop_object *nh, void *arg)
 {
time_t *next_callout;
 

Modified: head/sys/netinet/in_rmx.c
==
--- head/sys/netinet/in_rmx.c   Thu Apr 16 16:59:37 2020(r360013)
+++ head/sys/netinet/in_rmx.c   Thu Apr 16 17:20:18 2020(r360014)
@@ -228,14 +228,15 @@ struct in_ifadown_arg {
 };
 
 static int
-in_ifadownkill(const struct rtentry *rt, void *xap)
+in_ifadownkill(const struct rtentry *rt, const struct nhop_object *nh,
+void *xap)
 {
struct in_ifadown_arg *ap = xap;
 
-   if (rt->rt_ifa != ap->ifa)
+   if (nh->nh_ifa != ap->ifa)
return (0);
 
-   if ((rt->rt_flags & RTF_STATIC) != 0 && ap->del == 0)
+   if ((nhop_get_rtflags(nh) & RTF_STATIC) != 0 && ap->del == 0)
return (0);
 
return (1);

Modified: head/sys/netinet6/nd6.c

svn commit: r360013 - head/sys/dev/usb/controller

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 16:59:37 2020
New Revision: 360013
URL: https://svnweb.freebsd.org/changeset/base/360013

Log:
  arm: Fix duplicate ehci DRIVER_MODULE
  
  Name each ehci driver uniquely.
  This remove the warning printed at each arm boot :
  module_register: cannot register simplebus/ehci from kernel; already loaded 
from kernel
  
  A similar fix was done in r333074 but imx_ehci wasn't renamed and 
generic_ehci wasn't
  present at that time.

Modified:
  head/sys/dev/usb/controller/ehci_imx.c
  head/sys/dev/usb/controller/generic_ehci_fdt.c

Modified: head/sys/dev/usb/controller/ehci_imx.c
==
--- head/sys/dev/usb/controller/ehci_imx.c  Thu Apr 16 16:50:33 2020
(r360012)
+++ head/sys/dev/usb/controller/ehci_imx.c  Thu Apr 16 16:59:37 2020
(r360013)
@@ -510,5 +510,5 @@ static driver_t ehci_driver = {
 
 static devclass_t ehci_devclass;
 
-DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0);
-MODULE_DEPEND(ehci, usb, 1, 1, 1);
+DRIVER_MODULE(imx_ehci, simplebus, ehci_driver, ehci_devclass, 0, 0);
+MODULE_DEPEND(imx_ehci, usb, 1, 1, 1);

Modified: head/sys/dev/usb/controller/generic_ehci_fdt.c
==
--- head/sys/dev/usb/controller/generic_ehci_fdt.c  Thu Apr 16 16:50:33 
2020(r360012)
+++ head/sys/dev/usb/controller/generic_ehci_fdt.c  Thu Apr 16 16:59:37 
2020(r360013)
@@ -252,5 +252,5 @@ DEFINE_CLASS_1(ehci, ehci_fdt_driver, ehci_fdt_methods
 
 static devclass_t ehci_fdt_devclass;
 
-DRIVER_MODULE(ehci, simplebus, ehci_fdt_driver, ehci_fdt_devclass, 0, 0);
-MODULE_DEPEND(ehci, usb, 1, 1, 1);
+DRIVER_MODULE(generic_ehci, simplebus, ehci_fdt_driver, ehci_fdt_devclass, 0, 
0);
+MODULE_DEPEND(generic_ehci, usb, 1, 1, 1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360012 - in head/sys/amd64: include vmm

2020-04-16 Thread Conrad Meyer
Author: cem
Date: Thu Apr 16 16:50:33 2020
New Revision: 360012
URL: https://svnweb.freebsd.org/changeset/base/360012

Log:
  vmm(4): Expose instruction decode to userspace build
  
  Permit instruction decoding logic to be compiled outside of the kernel for
  rapid iteration and validation.
  
  Reviewed by:  grehan
  Differential Revision:https://reviews.freebsd.org/D24439

Modified:
  head/sys/amd64/include/vmm_instruction_emul.h
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/include/vmm_instruction_emul.h
==
--- head/sys/amd64/include/vmm_instruction_emul.h   Thu Apr 16 16:00:21 
2020(r360011)
+++ head/sys/amd64/include/vmm_instruction_emul.h   Thu Apr 16 16:50:33 
2020(r360012)
@@ -103,6 +103,7 @@ int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_gu
  */
 int vm_gla2gpa_nofault(struct vm *vm, int vcpuid, struct vm_guest_paging 
*paging,
 uint64_t gla, int prot, uint64_t *gpa, int *is_fault);
+#endif /* _KERNEL */
 
 void vie_init(struct vie *vie, const char *inst_bytes, int inst_length);
 
@@ -117,9 +118,17 @@ void vie_init(struct vie *vie, const char *inst_bytes,
  * To skip the 'gla' verification for this or any other reason pass
  * in VIE_INVALID_GLA instead.
  */
+#ifdef _KERNEL
 #defineVIE_INVALID_GLA (1UL << 63) /* a non-canonical 
address */
 int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla,
   enum vm_cpu_mode cpu_mode, int csd, struct vie *vie);
+#else /* !_KERNEL */
+/*
+ * Permit instruction decoding logic to be compiled outside of the kernel for
+ * rapid iteration and validation.  No GLA validation is performed, obviously.
+ */
+int vmm_decode_instruction(enum vm_cpu_mode cpu_mode, int csd,
+struct vie *vie);
 #endif /* _KERNEL */
 
 #endif /* _VMM_INSTRUCTION_EMUL_H_ */

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Apr 16 16:00:21 2020
(r360011)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Apr 16 16:50:33 2020
(r360012)
@@ -50,9 +50,14 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #defineKASSERT(exp,msg)assert((exp))
+#definepanic(...)  errx(4, __VA_ARGS__)
 #endif /* _KERNEL */
 
 #include 
@@ -1896,7 +1901,6 @@ vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_r
return (0);
 }
 
-#ifdef _KERNEL
 void
 vie_init(struct vie *vie, const char *inst_bytes, int inst_length)
 {
@@ -1915,6 +1919,7 @@ vie_init(struct vie *vie, const char *inst_bytes, int 
}
 }
 
+#ifdef _KERNEL
 static int
 pf_error_code(int usermode, int prot, int rsvd, uint64_t pte)
 {
@@ -2189,6 +2194,7 @@ vmm_fetch_instruction(struct vm *vm, int vcpuid, struc
vie->num_valid = inst_length;
return (0);
 }
+#endif /* _KERNEL */
 
 static int
 vie_peek(struct vie *vie, uint8_t *x)
@@ -2611,6 +2617,7 @@ decode_moffset(struct vie *vie)
return (0);
 }
 
+#ifdef _KERNEL
 /*
  * Verify that the 'guest linear address' provided as collateral of the nested
  * page table fault matches with our instruction decoding.
@@ -2702,10 +2709,15 @@ verify_gla(struct vm *vm, int cpuid, uint64_t gla, str
 
return (0);
 }
+#endif /* _KERNEL */
 
 int
+#ifdef _KERNEL
 vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla,
   enum vm_cpu_mode cpu_mode, int cs_d, struct vie *vie)
+#else
+vmm_decode_instruction(enum vm_cpu_mode cpu_mode, int cs_d, struct vie *vie)
+#endif
 {
 
if (decode_prefixes(vie, cpu_mode, cs_d))
@@ -2729,13 +2741,14 @@ vmm_decode_instruction(struct vm *vm, int cpuid, uint6
if (decode_moffset(vie))
return (-1);
 
+#ifdef _KERNEL
if ((vie->op.op_flags & VIE_OP_F_NO_GLA_VERIFICATION) == 0) {
if (verify_gla(vm, cpuid, gla, vie, cpu_mode))
return (-1);
}
+#endif
 
vie->decoded = 1;   /* success */
 
return (0);
 }
-#endif /* _KERNEL */
___
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: r360004 - head/sys/i386/i386

2020-04-16 Thread Scott Long


> On Apr 16, 2020, at 10:01 AM, Brooks Davis  wrote:
> 
> On Thu, Apr 16, 2020 at 05:27:14AM +, Scott Long wrote:
>> Author: scottl
>> Date: Thu Apr 16 05:27:13 2020
>> New Revision: 360004
>> URL: https://svnweb.freebsd.org/changeset/base/360004
>> 
>> Log:
>>  Fix ps_strings type change for i386
> 
> Thanks for the fix.  I did do a make tinderbox, but missed this failure
> due to an unrelated riscv failure.
> 

Y/w, no worries.

Scott


___
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: r360004 - head/sys/i386/i386

2020-04-16 Thread Brooks Davis
On Thu, Apr 16, 2020 at 05:27:14AM +, Scott Long wrote:
> Author: scottl
> Date: Thu Apr 16 05:27:13 2020
> New Revision: 360004
> URL: https://svnweb.freebsd.org/changeset/base/360004
> 
> Log:
>   Fix ps_strings type change for i386

Thanks for the fix.  I did do a make tinderbox, but missed this failure
due to an unrelated riscv failure.

-- Brooks


signature.asc
Description: PGP signature


svn commit: r360011 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_mmc

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 16:00:21 2020
New Revision: 360011
URL: https://svnweb.freebsd.org/changeset/base/360011

Log:
  arm: allwinner: aw_mmc: Make it possible to unload the module
  
  While here, add a makefile in sys/modules/allwinner so it is built.
  Also add the PNP info so devmatch will load this module automatically.
  
  MFC after:1 month

Added:
  head/sys/modules/allwinner/aw_mmc/
  head/sys/modules/allwinner/aw_mmc/Makefile   (contents, props changed)
Modified:
  head/sys/arm/allwinner/aw_mmc.c
  head/sys/modules/allwinner/Makefile

Modified: head/sys/arm/allwinner/aw_mmc.c
==
--- head/sys/arm/allwinner/aw_mmc.c Thu Apr 16 15:59:23 2020
(r360010)
+++ head/sys/arm/allwinner/aw_mmc.c Thu Apr 16 16:00:21 2020
(r360011)
@@ -163,6 +163,7 @@ static int aw_mmc_probe(device_t);
 static int aw_mmc_attach(device_t);
 static int aw_mmc_detach(device_t);
 static int aw_mmc_setup_dma(struct aw_mmc_softc *);
+static void aw_mmc_teardown_dma(struct aw_mmc_softc *sc);
 static int aw_mmc_reset(struct aw_mmc_softc *);
 static int aw_mmc_init(struct aw_mmc_softc *);
 static void aw_mmc_intr(void *);
@@ -559,8 +560,46 @@ fail:
 static int
 aw_mmc_detach(device_t dev)
 {
+   struct aw_mmc_softc *sc;
+   device_t d;
 
-   return (EBUSY);
+   sc = device_get_softc(dev);
+
+   clk_disable(sc->aw_clk_mmc);
+   clk_disable(sc->aw_clk_ahb);
+   hwreset_assert(sc->aw_rst_ahb);
+
+   mmc_fdt_gpio_teardown(>mmc_helper);
+
+   callout_drain(>aw_timeoutc);
+
+   AW_MMC_LOCK(sc);
+   d = sc->child;
+   sc->child = NULL;
+   AW_MMC_UNLOCK(sc);
+   if (d != NULL)
+   device_delete_child(sc->aw_dev, d);
+
+   aw_mmc_teardown_dma(sc);
+
+   mtx_destroy(>aw_mtx);
+
+   bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand);
+   bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res);
+
+#ifdef MMCCAM
+   if (sc->sim != NULL) {
+   mtx_lock(>sim_mtx);
+   xpt_bus_deregister(cam_sim_path(sc->sim));
+   cam_sim_free(sc->sim, FALSE);
+   mtx_unlock(>sim_mtx);
+   }
+
+   if (sc->devq != NULL)
+   cam_simq_free(sc->devq);
+#endif
+
+   return (0);
 }
 
 static void
@@ -635,6 +674,21 @@ aw_mmc_setup_dma(struct aw_mmc_softc *sc)
 }
 
 static void
+aw_mmc_teardown_dma(struct aw_mmc_softc *sc)
+{
+
+   bus_dmamap_unload(sc->aw_dma_tag, sc->aw_dma_map);
+   bus_dmamem_free(sc->aw_dma_tag, sc->aw_dma_desc, sc->aw_dma_map);
+   if (bus_dma_tag_destroy(sc->aw_dma_tag) != 0)
+   device_printf(sc->aw_dev, "Cannot destroy the dma tag\n");
+
+   bus_dmamap_unload(sc->aw_dma_buf_tag, sc->aw_dma_buf_map);
+   bus_dmamap_destroy(sc->aw_dma_buf_tag, sc->aw_dma_buf_map);
+   if (bus_dma_tag_destroy(sc->aw_dma_buf_tag) != 0)
+   device_printf(sc->aw_dev, "Cannot destroy the dma buf tag\n");
+}
+
+static void
 aw_dma_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int err)
 {
int i;
@@ -1519,3 +1573,4 @@ DRIVER_MODULE(aw_mmc, simplebus, aw_mmc_driver, aw_mmc
 #ifndef MMCCAM
 MMC_DECLARE_BRIDGE(aw_mmc);
 #endif
+SIMPLEBUS_PNP_INFO(compat_data);

Modified: head/sys/modules/allwinner/Makefile
==
--- head/sys/modules/allwinner/Makefile Thu Apr 16 15:59:23 2020
(r360010)
+++ head/sys/modules/allwinner/Makefile Thu Apr 16 16:00:21 2020
(r360011)
@@ -2,6 +2,7 @@
 # Build modules specific to Allwinner.
 
 SUBDIR = \
+   aw_mmc \
aw_pwm \
aw_rtc \
aw_rsb \

Added: head/sys/modules/allwinner/aw_mmc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/allwinner/aw_mmc/Makefile  Thu Apr 16 16:00:21 2020
(r360011)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD=  aw_mmc
+SRCS=  aw_mmc.c
+
+SRCS+= \
+   bus_if.h \
+   clknode_if.h \
+   device_if.h \
+   ofw_bus_if.h
+
+.include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360009 - head/sys/dev/mmc

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 15:58:58 2020
New Revision: 360009
URL: https://svnweb.freebsd.org/changeset/base/360009

Log:
  mmc_fdt_helpers: Drain the cd pin taskqueue in mmc_fdt_gpio_teardown
  
  We have no use for it now.
  
  MFC after:1 month

Modified:
  head/sys/dev/mmc/mmc_fdt_helpers.c

Modified: head/sys/dev/mmc/mmc_fdt_helpers.c
==
--- head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 12:32:28 2020
(r360008)
+++ head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 15:58:58 2020
(r360009)
@@ -381,6 +381,8 @@ mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper)
gpio_pin_release(helper->cd_pin);
if (helper->cd_ires != NULL)
bus_release_resource(helper->dev, SYS_RES_IRQ, 0, 
helper->cd_ires);
+
+   taskqueue_drain_timeout(taskqueue_swi_giant, >cd_delayed_task);
 }
 
 bool
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360010 - in head: share/man/man7 sys/netinet

2020-04-16 Thread Richard Scheffenegger
Author: rscheff
Date: Thu Apr 16 15:59:23 2020
New Revision: 360010
URL: https://svnweb.freebsd.org/changeset/base/360010

Log:
  Reduce default TCP delayed ACK timeout to 40ms.
  
  Reviewed by:  kbowling, tuexen
  Approved by:  tuexen (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23281

Modified:
  head/share/man/man7/tuning.7
  head/sys/netinet/tcp_timer.h

Modified: head/share/man/man7/tuning.7
==
--- head/share/man/man7/tuning.7Thu Apr 16 15:58:58 2020
(r360009)
+++ head/share/man/man7/tuning.7Thu Apr 16 15:59:23 2020
(r360010)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2017
+.Dd April 16, 2020
 .Dt TUNING 7
 .Os
 .Sh NAME
@@ -435,7 +435,7 @@ number of tiny packets flowing across the network in h
 The
 .Fx
 delayed ACK implementation also follows the TCP protocol rule that
-at least every other packet be acknowledged even if the standard 100ms
+at least every other packet be acknowledged even if the standard 40ms
 timeout has not yet passed.
 Normally the worst a delayed ACK can do is
 slightly delay the teardown of a connection, or slightly delay the ramp-up

Modified: head/sys/netinet/tcp_timer.h
==
--- head/sys/netinet/tcp_timer.hThu Apr 16 15:58:58 2020
(r360009)
+++ head/sys/netinet/tcp_timer.hThu Apr 16 15:59:23 2020
(r360010)
@@ -119,7 +119,7 @@
 
 #defineTCP_MAXRXTSHIFT 12  /* maximum retransmits 
*/
 
-#defineTCPTV_DELACK( hz/10 )   /* 100ms timeout */
+#defineTCPTV_DELACK( hz/25 )   /* 40ms timeout */
 
 /*
  * If we exceed this number of retransmits for a single segment, we'll consider
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360008 - head/sys/dev/mmc

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 12:32:28 2020
New Revision: 360008
URL: https://svnweb.freebsd.org/changeset/base/360008

Log:
  mmc_fdt_helpers: Always init the timout
  
  We use the taskqueue to schedule card detection so always init it.
  This is a proper solution instead of r359965.
  
  MFC after:1 month
  MFH:  r359924

Modified:
  head/sys/dev/mmc/mmc_fdt_helpers.c

Modified: head/sys/dev/mmc/mmc_fdt_helpers.c
==
--- head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 12:31:12 2020
(r360007)
+++ head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 12:32:28 2020
(r360008)
@@ -225,6 +225,10 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node
const char *cd_mode_str;
 
dev = helper->dev;
+
+   TIMEOUT_TASK_INIT(taskqueue_swi_giant, >cd_delayed_task, 0,
+   cd_card_task, helper);
+
/*
 * If the device is flagged as non-removable, set that slot option, and
 * set a flag to make sdhci_fdt_gpio_get_present() always return true.
@@ -294,9 +298,6 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node
}
 
 without_interrupts:
-   TIMEOUT_TASK_INIT(taskqueue_swi_giant, >cd_delayed_task, 0,
-   cd_card_task, helper);
-
/*
 * If we have a readable gpio pin, but didn't successfully configure
 * gpio interrupts, setup a timeout task to poll the pin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360007 - head/sys/dev/mmc

2020-04-16 Thread Emmanuel Vadot
Author: manu
Date: Thu Apr 16 12:31:12 2020
New Revision: 360007
URL: https://svnweb.freebsd.org/changeset/base/360007

Log:
  Revert r359965
  
  This cause board without a cd-gpio to not schedule a card detection.

Modified:
  head/sys/dev/mmc/mmc_fdt_helpers.c

Modified: head/sys/dev/mmc/mmc_fdt_helpers.c
==
--- head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 11:49:13 2020
(r360006)
+++ head/sys/dev/mmc/mmc_fdt_helpers.c  Thu Apr 16 12:31:12 2020
(r360007)
@@ -217,7 +217,7 @@ cd_card_task(void *arg, int pending __unused)
 /*
  * Card detect setup.
  */
-static bool
+static void
 cd_setup(struct mmc_fdt_helper *helper, phandle_t node)
 {
int pincaps;
@@ -233,7 +233,7 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node
helper->cd_disabled = true;
if (bootverbose)
device_printf(dev, "Non-removable media\n");
-   return (false);
+   return;
}
 
/*
@@ -246,14 +246,14 @@ cd_setup(struct mmc_fdt_helper *helper, phandle_t node
 */
if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios",
>cd_pin))
-   return (false);
+   return;
 
if (gpio_pin_getcaps(helper->cd_pin, ) != 0 ||
!(pincaps & GPIO_PIN_INPUT)) {
device_printf(dev, "Cannot read card-detect gpio pin; "
"setting card-always-present flag.\n");
helper->cd_disabled = true;
-   return (false);
+   return;
}
 
/*
@@ -313,8 +313,6 @@ without_interrupts:
device_get_nameunit(helper->cd_pin->dev), 
helper->cd_pin->pin,
cd_mode_str);
}
-
-   return (true);
 }
 
 /*
@@ -356,16 +354,14 @@ mmc_fdt_gpio_setup(device_t dev, phandle_t node, struc
 
helper->dev = dev;
helper->cd_handler = handler;
+   cd_setup(helper, node);
wp_setup(helper, node);
 
-   if (cd_setup(helper, node)) {
-   /* 
-* Schedule a card detection
-*/
-   taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant,
-   >cd_delayed_task, mstosbt(500), 0, C_PREL(2));
-   }
-
+   /* 
+* Schedule a card detection
+*/
+   taskqueue_enqueue_timeout_sbt(taskqueue_swi_giant,
+   >cd_delayed_task, mstosbt(500), 0, C_PREL(2));
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360006 - stable/11/usr.bin/wc

2020-04-16 Thread Eugene Grosbein
Author: eugen
Date: Thu Apr 16 11:49:13 2020
New Revision: 360006
URL: https://svnweb.freebsd.org/changeset/base/360006

Log:
  MFC r359801: wc(1): document SIGINFO handling in the manual page.

Modified:
  stable/11/usr.bin/wc/wc.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/wc/wc.1
==
--- stable/11/usr.bin/wc/wc.1   Thu Apr 16 11:47:53 2020(r360005)
+++ stable/11/usr.bin/wc/wc.1   Thu Apr 16 11:49:13 2020(r360006)
@@ -31,7 +31,7 @@
 .\" @(#)wc.1   8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd December 1, 2015
+.Dd April 11, 2020
 .Dt WC 1
 .Os
 .Sh NAME
@@ -123,6 +123,18 @@ file name is displayed.
 The prompt will accept input until receiving EOF, or
 .Bq ^D
 in most environments.
+.Pp
+If
+.Nm
+receives a
+.Dv SIGINFO
+(see the
+.Cm status
+argument for
+.Xr stty 1 )
+signal, the interim data will be written
+to the standard error output in the same format
+as the standard completion message.
 .Sh ENVIRONMENT
 The
 .Ev LANG , LC_ALL
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360005 - stable/12/usr.bin/wc

2020-04-16 Thread Eugene Grosbein
Author: eugen
Date: Thu Apr 16 11:47:53 2020
New Revision: 360005
URL: https://svnweb.freebsd.org/changeset/base/360005

Log:
  MFC r359801: wc(1): document SIGINFO handling in the manual page.

Modified:
  stable/12/usr.bin/wc/wc.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/wc/wc.1
==
--- stable/12/usr.bin/wc/wc.1   Thu Apr 16 05:27:13 2020(r360004)
+++ stable/12/usr.bin/wc/wc.1   Thu Apr 16 11:47:53 2020(r360005)
@@ -31,7 +31,7 @@
 .\" @(#)wc.1   8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd August 2, 2018
+.Dd April 11, 2020
 .Dt WC 1
 .Os
 .Sh NAME
@@ -126,6 +126,18 @@ file name is displayed.
 The prompt will accept input until receiving EOF, or
 .Bq ^D
 in most environments.
+.Pp
+If
+.Nm
+receives a
+.Dv SIGINFO
+(see the
+.Cm status
+argument for
+.Xr stty 1 )
+signal, the interim data will be written
+to the standard error output in the same format
+as the standard completion message.
 .Sh ENVIRONMENT
 The
 .Ev LANG , LC_ALL
___
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: r328242 - head/lib/libregex

2020-04-16 Thread Hans Petter Selasky

On 2020-04-16 10:58, Hans Petter Selasky wrote:

Hi Kyle,

There is a sed regression between older 12.1 and 13-current likely 
caused by libregex changes. I will try to bisect:


Can you have a look at this:

Expected result:

printf "#define MEDIA_BUS_FMT_SRGGB16_1X16\t\t\t0x3020\n" | sed -e 
's/.*FMT_//; s/\t.*//; s/.*/{ \"&\", MEDIA_BUS_FMT_& },/;'

{ "SRGGB16_1X16", MEDIA_BUS_FMT_SRGGB16_1X16 },


Bad result:

printf "#define MEDIA_BUS_FMT_SRGGB16_1X16\t\t\t0x3020\n" | sed -e 
's/.*FMT_//; s/\t.*//; s/.*/{ \"&\", MEDIA_BUS_FMT_& },/;'
{ "SRGGB16_1X16    0x3020", 
MEDIA_BUS_FMT_SRGGB16_1X16    0x3020 },


A little further inspection shows \t does not work like expected in:

s/\t.*//;

Trying to quickly bisect.


Hi,

Running 13-current, this issues seems fixed, but there appears to be an 
issue with the binary pkg build cluster:


http://package18.nyi.freebsd.org/data/121amd64-default-PR244494/2020-04-14_14h07m24s/logs/errors/v4l-utils-1.18.0.log

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245501

--HPS
___
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: r328242 - head/lib/libregex

2020-04-16 Thread Hans Petter Selasky

Hi Kyle,

There is a sed regression between older 12.1 and 13-current likely 
caused by libregex changes. I will try to bisect:


Can you have a look at this:

Expected result:


printf "#define MEDIA_BUS_FMT_SRGGB16_1X16\t\t\t0x3020\n" | sed -e 's/.*FMT_//; s/\t.*//; s/.*/{ 
\"&\", MEDIA_BUS_FMT_& },/;'
{ "SRGGB16_1X16", MEDIA_BUS_FMT_SRGGB16_1X16 },


Bad result:


printf "#define MEDIA_BUS_FMT_SRGGB16_1X16\t\t\t0x3020\n" | sed -e 's/.*FMT_//; s/\t.*//; s/.*/{ 
\"&\", MEDIA_BUS_FMT_& },/;'
{ "SRGGB16_1X160x3020", MEDIA_BUS_FMT_SRGGB16_1X16  
  0x3020 },


A little further inspection shows \t does not work like expected in:

s/\t.*//;

Trying to quickly bisect.

--HPS
___
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"