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 Pedro Giffuni



On 02/03/2020 18:37, 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
   
   FreeBSD isn't an encyclopedia.


Wow, that was weird ... thank you for reverting.

Pedro.


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 to not build Capsicum support into system programs.
  When set, it enforces these options:

Modified: head/share/man/man7/h

svn commit: r358565 - head/sys/powerpc/powernv

2020-03-02 Thread Justin Hibbits
Author: jhibbits
Date: Tue Mar  3 03:22:00 2020
New Revision: 358565
URL: https://svnweb.freebsd.org/changeset/base/358565

Log:
  powerpc/powernv: powernv_node_numa_domain() fix non-NUMA case
  
  If NUMA is not enabled in the kernel config, or is disabled at boot, this
  function should just return domain 0 regardless of what's in the device
  tree.
  
  Fixes a panic in iflib with NUMA disabled.
  
  Reported by:  luporl

Modified:
  head/sys/powerpc/powernv/platform_powernv.c

Modified: head/sys/powerpc/powernv/platform_powernv.c
==
--- head/sys/powerpc/powernv/platform_powernv.c Tue Mar  3 01:46:35 2020
(r358564)
+++ head/sys/powerpc/powernv/platform_powernv.c Tue Mar  3 03:22:00 2020
(r358565)
@@ -517,6 +517,12 @@ powernv_node_numa_domain(platform_t platform, phandle_
cell_t associativity[5];
int i, res;
 
+#ifndef NUMA
+   return (0);
+#endif
+   if (vm_ndomains == 1)
+   return (0);
+
res = OF_getencprop(node, "ibm,associativity",
associativity, sizeof(associativity));
 
___
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: r358564 - head/sys/security/audit

2020-03-02 Thread Christian S.J. Peron
Author: csjp
Date: Tue Mar  3 01:46:35 2020
New Revision: 358564
URL: https://svnweb.freebsd.org/changeset/base/358564

Log:
  In r358471, we interrupted the case block that would eventually lead
  to the path related tokens not being processed. Restore this behavior and
  and move AUE_JAIL_SET in this block, as it may conditionally contain a
  path token.
  
  Discovered by:kevans
  PR:   244537
  Reviewed by:  kevans
  Differential Revision:https://reviews.freebsd.org/D23929

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

Modified: head/sys/security/audit/audit_bsm.c
==
--- head/sys/security/audit/audit_bsm.c Tue Mar  3 00:28:37 2020
(r358563)
+++ head/sys/security/audit/audit_bsm.c Tue Mar  3 01:46:35 2020
(r358564)
@@ -803,25 +803,26 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec
UPATH1_VNODE1_TOKENS;
break;
 
-   case AUE_CHDIR:
-   case AUE_CHROOT:
-   case AUE_FSTATAT:
-   case AUE_FUTIMESAT:
-   case AUE_GETATTRLIST:
-   case AUE_JAIL:
-   break;
-
/*
 * NB: We may want to verify that the appropriate
 * audit args are being processed here, but I think
 * a bit analysis is required.
+*
+* Process AUE_JAIL_SET in the next block so we can pickup any path
+* related tokens that might exist.
 */
case AUE_JAIL_GET:
-   case AUE_JAIL_SET:
case AUE_JAIL_ATTACH:
case AUE_JAIL_REMOVE:
break;
 
+   case AUE_JAIL_SET:
+   case AUE_CHDIR:
+   case AUE_CHROOT:
+   case AUE_FSTATAT:
+   case AUE_FUTIMESAT:
+   case AUE_GETATTRLIST:
+   case AUE_JAIL:
case AUE_LUTIMES:
case AUE_NFS_GETFH:
case AUE_LGETFH:
___
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: r358562 - 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 Steffen Nurpmeso
Conrad Meyer wrote in
<202003030020.0230k9h2002...@repo.freebsd.org>:
 |Author: cem
 |Date: Tue Mar  3 00:20:08 2020
 |New Revision: 358562
 |URL: https://svnweb.freebsd.org/changeset/base/358562
 |
 |Log:
 |  Add extremely useful calendar(1) application to FreeBSD
 |  
 |  It does extremely useful things like execute sendmail and spew dubiously
 |  accurate factoids.
 |  
 |  From the feedback, it seems like it is an essential utility in a \
 |  modern unix
 |  and not at all a useless bikeshed.  How do those Linux people live \
 |  without it?

They install the portable version as a package.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
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: r358563 - head/sys/kern

2020-03-02 Thread Mark Johnston
Author: markj
Date: Tue Mar  3 00:28:37 2020
New Revision: 358563
URL: https://svnweb.freebsd.org/changeset/base/358563

Log:
  Fix the malloc type used in sys_shm_unlink() after r354808.
  
  PR:   244563
  Reported by:  swills

Modified:
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cTue Mar  3 00:20:08 2020(r358562)
+++ head/sys/kern/uipc_shm.cTue Mar  3 00:28:37 2020(r358563)
@@ -961,7 +961,7 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_ar
sx_xlock(&shm_dict_lock);
error = shm_remove(path, fnv, td->td_ucred);
sx_xunlock(&shm_dict_lock);
-   free(path, M_TEMP);
+   free(path, M_SHMFD);
 
return (error);
 }
___
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: r358562 - 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.bin...

2020-03-02 Thread Conrad Meyer
/calendars/pt_BR.UTF-8/
 - copied from r358560, head/usr.bin/calendar/calendars/pt_BR.UTF-8/
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/
 - copied from r358560, head/usr.bin/calendar/calendars/ru_RU.KOI8-R/
  head/usr.bin/calendar/calendars/ru_RU.UTF-8/
 - copied from r358560, head/usr.bin/calendar/calendars/ru_RU.UTF-8/
  head/usr.bin/calendar/calendars/uk_UA.KOI8-U/
 - copied from r358560, head/usr.bin/calendar/calendars/uk_UA.KOI8-U/
  head/usr.bin/calendar/dates.c
 - copied unchanged from r358560, head/usr.bin/calendar/dates.c
  head/usr.bin/calendar/day.c
 - copied unchanged from r358560, head/usr.bin/calendar/day.c
  head/usr.bin/calendar/events.c
 - copied unchanged from r358560, head/usr.bin/calendar/events.c
  head/usr.bin/calendar/io.c
 - copied unchanged from r358560, head/usr.bin/calendar/io.c
  head/usr.bin/calendar/locale.c
 - copied unchanged from r358560, head/usr.bin/calendar/locale.c
  head/usr.bin/calendar/ostern.c
 - copied unchanged from r358560, head/usr.bin/calendar/ostern.c
  head/usr.bin/calendar/parsedata.c
 - copied unchanged from r358560, head/usr.bin/calendar/parsedata.c
  head/usr.bin/calendar/paskha.c
 - copied unchanged from r358560, head/usr.bin/calendar/paskha.c
  head/usr.bin/calendar/pathnames.h
 - copied unchanged from r358560, head/usr.bin/calendar/pathnames.h
  head/usr.bin/calendar/pom.c
 - copied unchanged from r358560, head/usr.bin/calendar/pom.c
  head/usr.bin/calendar/sunpos.c
 - copied unchanged from r358560, head/usr.bin/calendar/sunpos.c
  head/usr.bin/calendar/tests/
 - copied from r358560, head/usr.bin/calendar/tests/
  head/usr.sbin/periodic/etc/daily/300.calendar
 - copied unchanged from r358560, 
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:37:47 2020(r358561)
+++ head/ObsoleteFiles.inc  Tue Mar  3 00:20:08 2020(r358562)
@@ -36,11 +36,6 @@
 #   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:37:47 2020
(r358561)
+++ head/share/man/man5/periodic.conf.5 Tue Mar  3 00:20:08 2020
(r358562)
@@ -273,6 +273,13 @@ 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
@@ -963,6 +970,7 @@ 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:37:47 2020
(r358561)
+++ head/share/man/man5/src.conf.5  Tue Mar  3 00:20:08 2020
(r358562)
@@ -271,6 +271,9 @@ 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 to not build Capsicum support into system programs.
 When set, it enforces these options:

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Mon Mar  2 23:37:47 2020(r358561)
+++ head/share/man/man7/hier.7  Tue Mar  3 00:20:08 2020(r358562)
@@ -442,6 +442,10 @@ system daemons & system utilities (executed by users)
 architecture-independent files
 .Pp
 .Bl -tag -width Fl -compact
+.It Pa calendar/
+a variety of pre-fab calendar files;
+see
+.Xr calendar 1
 .It Pa dict/
 word lists;
 see

Copied: head/tools/build/options/WITHOUT_CALENDAR (from r358560, 
head/tools/build/options/WITHOUT_CALENDAR)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_CALENDAR   Tue Mar  3 00:20:08 2020
(r358562, copy of r358560, head/tools/build/options/WITHOUT_CALENDAR)
@@ -0,0 

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 John Baldwin
On 3/2/20 3:37 PM, 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
>   
>   FreeBSD isn't an encyclopedia.

This isn't a helpful log message, and you didn't post this for review, etc.
I actually use calendar in my .login, so it's not completely unused.  It was
a conscious decision, not a typo to keep calendar(1), and not one for you to
unilaterally revisit without at least some discussion.  I don't think we've
had any calendar CVEs or that it's been a maintenance burden?

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


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 Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> 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
>   
>   FreeBSD isn't an encyclopedia.

Hang on here, you just removed a base system tool without any discussion.. ???
This is far more than a typo fix.

> 
> 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.incMon Mar  2 23:25:02 2020(r358560)
> +++ head/ObsoleteFiles.incMon 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
> =

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 Warner Losh
Can you point me at the discussion where this was decided?

Warner

On Mon, Mar 2, 2020 at 4:38 PM 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
>
>   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/

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
> 
> ==
> ---

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.bin...

2020-03-02 Thread Conrad Meyer
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
  
  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 to not build Capsicum support into system programs.
 When set, it enforces these options:

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Mon Mar  2 23:25:02 2020(r358560)
+++ head/share/man/man7/hier.7  Mon Mar  2 23:37:47 2020(r3

svn commit: r358559 - head/sys/contrib/ipfilter/netinet

2020-03-02 Thread Cy Schubert
Author: cy
Date: Mon Mar  2 23:24:58 2020
New Revision: 358559
URL: https://svnweb.freebsd.org/changeset/base/358559

Log:
  Remove the now unused FREEBSD_GE_REV, FREEBSD_GT_REV, and FREEBSD_LT_REV
  macros.
  
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/ip_compat.h

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 23:24:53 
2020(r358558)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 23:24:58 
2020(r358559)
@@ -89,12 +89,6 @@
 (__NetBSD_Version__ > (x)))
 #defineNETBSD_LT_REV(x)(defined(__NetBSD_Version__) && \
 (__NetBSD_Version__ < (x)))
-#defineFREEBSD_GE_REV(x)   (defined(__FreeBSD_version) && \
-(__FreeBSD_version >= (x)))
-#defineFREEBSD_GT_REV(x)   (defined(__FreeBSD_version) && \
-(__FreeBSD_version > (x)))
-#defineFREEBSD_LT_REV(x)   (defined(__FreeBSD_version) && \
-(__FreeBSD_version < (x)))
 #defineBSD_GE_YEAR(x)  (defined(BSD) && (BSD >= (x)))
 #defineBSD_GT_YEAR(x)  (defined(BSD) && (BSD > (x)))
 #defineBSD_LT_YEAR(x)  (defined(BSD) && (BSD < (x)))
___
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: r358560 - head/sys/contrib/ipfilter/netinet

2020-03-02 Thread Cy Schubert
Author: cy
Date: Mon Mar  2 23:25:02 2020
New Revision: 358560
URL: https://svnweb.freebsd.org/changeset/base/358560

Log:
  Retire macros:
  
BSD_GE_YEAR
BSD_GT_YEAR
BSD_LT_YEAR
  
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/ip_compat.h
  head/sys/contrib/ipfilter/netinet/ip_nat.c
  head/sys/contrib/ipfilter/netinet/ip_sync.c

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 23:24:58 
2020(r358559)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 23:25:02 
2020(r358560)
@@ -89,9 +89,6 @@
 (__NetBSD_Version__ > (x)))
 #defineNETBSD_LT_REV(x)(defined(__NetBSD_Version__) && \
 (__NetBSD_Version__ < (x)))
-#defineBSD_GE_YEAR(x)  (defined(BSD) && (BSD >= (x)))
-#defineBSD_GT_YEAR(x)  (defined(BSD) && (BSD > (x)))
-#defineBSD_LT_YEAR(x)  (defined(BSD) && (BSD < (x)))
 
 
 /* --- */
@@ -439,7 +436,7 @@ extern  mb_t*allocmbt(size_t);
  * On BSD's use quad_t as a guarantee for getting at least a 64bit sized
  * object.
  */
-#if !defined(__amd64__) && BSD_GT_YEAR(199306)
+#if !defined(__amd64__) && !SOLARIS
 # define   USE_QUAD_T
 # define   U_QUAD_Tunsigned long long
 # define   QUAD_T  long long
@@ -733,7 +730,7 @@ typedef struct  tcpiphdrtcpiphdr_t;
 #defineTCPF_ALL(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|\
 TH_ECN|TH_CWR)
 
-#if BSD_GE_YEAR(199306) && !defined(m_act)
+#if !SOLARIS && !defined(m_act)
 # define   m_act   m_nextpkt
 #endif
 

Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- head/sys/contrib/ipfilter/netinet/ip_nat.c  Mon Mar  2 23:24:58 2020
(r358559)
+++ head/sys/contrib/ipfilter/netinet/ip_nat.c  Mon Mar  2 23:25:02 2020
(r358560)
@@ -1010,7 +1010,7 @@ ipf_nat_ioctl(softc, data, cmd, mode, uid, ctx)
ipnat_t natd;
SPL_INT(s);
 
-#if BSD_GE_YEAR(199306) && defined(_KERNEL)
+#if !SOLARIS && defined(_KERNEL)
 # if NETBSD_GE_REV(399002000)
if ((mode & FWRITE) &&
 kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_FIREWALL,

Modified: head/sys/contrib/ipfilter/netinet/ip_sync.c
==
--- head/sys/contrib/ipfilter/netinet/ip_sync.c Mon Mar  2 23:24:58 2020
(r358559)
+++ head/sys/contrib/ipfilter/netinet/ip_sync.c Mon Mar  2 23:25:02 2020
(r358560)
@@ -437,7 +437,7 @@ ipf_sync_write(softc, uio)
 
int err = 0;
 
-#  if BSD_GE_YEAR(199306) || defined(__FreeBSD__)
+#  if defined(__NetBSD__) || defined(__FreeBSD__)
uio->uio_rw = UIO_WRITE;
 #  endif
 
@@ -585,7 +585,7 @@ ipf_sync_read(softc, uio)
return EINVAL;
}
 
-#  if BSD_GE_YEAR(199306) || defined(__FreeBSD__)
+#  if defined(__NetBSD__) || defined(__FreeBSD__)
uio->uio_rw = UIO_READ;
 #  endif
 
___
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: r358558 - head/sys/contrib/ipfilter/netinet

2020-03-02 Thread Cy Schubert
Author: cy
Date: Mon Mar  2 23:24:53 2020
New Revision: 358558
URL: https://svnweb.freebsd.org/changeset/base/358558

Log:
  Continuing the effort started in r343701, #ifdef cleanup, checking for
  __FreeBSD_version > 3.0 and 5.0 is redundant.
  
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/ip_compat.h
  head/sys/contrib/ipfilter/netinet/ip_fil.h
  head/sys/contrib/ipfilter/netinet/ip_proxy.c
  head/sys/contrib/ipfilter/netinet/ip_state.c
  head/sys/contrib/ipfilter/netinet/ip_sync.c

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 22:54:32 
2020(r358557)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Mon Mar  2 23:24:53 
2020(r358558)
@@ -126,7 +126,7 @@
  * There may be other, safe, kernels but this is not extensively tested yet.
  */
 #   define HAVE_M_PULLDOWN
-#  if !defined(IPFILTER_LKM) && (__FreeBSD_version >= 30)
+#  if !defined(IPFILTER_LKM) && defined(__FreeBSD_version)
 #   include "opt_ipfilter.h"
 #  endif
 #  define  COPYIN(a,b,c)   copyin((caddr_t)(a), (caddr_t)(b), (c))

Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- head/sys/contrib/ipfilter/netinet/ip_fil.h  Mon Mar  2 22:54:32 2020
(r358557)
+++ head/sys/contrib/ipfilter/netinet/ip_fil.h  Mon Mar  2 23:24:53 2020
(r358558)
@@ -1420,8 +1420,7 @@ typedef   struct  ipftune {
 ** HPUX Port
 */
 
-#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version) && \
-(__FreeBSD_version >= 22)
+#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version)
 # define   CDEV_MAJOR  79
 #endif
 

Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.c
==
--- head/sys/contrib/ipfilter/netinet/ip_proxy.cMon Mar  2 22:54:32 
2020(r358557)
+++ head/sys/contrib/ipfilter/netinet/ip_proxy.cMon Mar  2 23:24:53 
2020(r358558)
@@ -51,7 +51,7 @@
 # include 
 # include 
 #endif
-#if __FreeBSD_version >= 30
+#ifdef __FreeBSD_version
 # include 
 #endif
 #include 

Modified: head/sys/contrib/ipfilter/netinet/ip_state.c
==
--- head/sys/contrib/ipfilter/netinet/ip_state.cMon Mar  2 22:54:32 
2020(r358557)
+++ head/sys/contrib/ipfilter/netinet/ip_state.cMon Mar  2 23:24:53 
2020(r358558)
@@ -82,7 +82,7 @@
 #ifdef USE_INET6
 #include 
 #endif
-#if FREEBSD_GE_REV(30)
+#ifdef __FreeBSD_version
 # include 
 # if defined(_KERNEL) && !defined(IPFILTER_LKM)
 #  include 
@@ -307,7 +307,7 @@ ipf_state_seed_alloc(u_int state_size, u_int state_max
/*
 * XXX - ipf_state_seed[X] should be a random number of sorts.
 */
-#if  FREEBSD_GE_REV(40)
+#ifdef __FreeBSD_version
state_seed[i] = arc4random();
 #else
state_seed[i] = ((u_long)state_seed + i) * state_size;

Modified: head/sys/contrib/ipfilter/netinet/ip_sync.c
==
--- head/sys/contrib/ipfilter/netinet/ip_sync.c Mon Mar  2 22:54:32 2020
(r358557)
+++ head/sys/contrib/ipfilter/netinet/ip_sync.c Mon Mar  2 23:24:53 2020
(r358558)
@@ -30,7 +30,7 @@
 #  include 
 # endif
 # include 
-# if __FreeBSD_version >= 50
+# ifdef __FreeBSD_version
 #  include 
 # endif
 #endif
___
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: r358557 - stable/12/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 22:54:32 2020
New Revision: 358557
URL: https://svnweb.freebsd.org/changeset/base/358557

Log:
  MFC r358297: Fix IPv6 checksums when exthdrs are present.
  
In two places in ip6_output we are doing (delayed) checksum calculations.
The initial logic came from SCTP in r205075,205104 and later I copied
and adjusted it for the TCP|UDP case in r235958.
The problem was that the original SCTP offsets were already wrong for any
case with extension headers present given IPv6 extension headers are not
part of the pseudo checksum calculations.
The later changes do not help in case there is checksum offloading as for
extension headers (incl. fragments) we do currrently never offload as we
have no infrastructure to know whether the NIC can handle these cases.
  
Correct the offsets for delayed checksum calculations and properly handle
mbuf flags.  In addition harmonize the almost identical duplicate code.
  
While here eliminate the now unneeded variable hlen and add an always
missing mtod() call in the 1-b and 3 cases after the introduction of
the mb_unmapped_to_ext() calls. [Keep code in sync with head]
  
  Reported by:  Francis Dupont (fdupont isc.org)
  PR:   243675

Modified:
  stable/12/sys/netinet6/ip6_output.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/ip6_output.c
==
--- stable/12/sys/netinet6/ip6_output.c Mon Mar  2 22:19:30 2020
(r358556)
+++ stable/12/sys/netinet6/ip6_output.c Mon Mar  2 22:54:32 2020
(r358557)
@@ -208,6 +208,36 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_sho
*(u_short *)mtodo(m, offset) = csum;
 }
 
+static int
+ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags,
+int plen, int optlen, bool frag __unused)
+{
+
+   KASSERT((plen >= optlen), ("%s:%d: plen %d < optlen %d, m %p, ifp %p "
+   "csum_flags %#x frag %d\n",
+   __func__, __LINE__, plen, optlen, m, ifp, csum_flags, frag));
+
+   if ((csum_flags & CSUM_DELAY_DATA_IPV6) ||
+#ifdef SCTP
+   (csum_flags & CSUM_SCTP_IPV6) ||
+#endif
+   false) {
+   if (csum_flags & CSUM_DELAY_DATA_IPV6) {
+   in6_delayed_cksum(m, plen - optlen,
+   sizeof(struct ip6_hdr) + optlen);
+   m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
+   }
+#ifdef SCTP
+   if (csum_flags & CSUM_SCTP_IPV6) {
+   sctp_delayed_cksum(m, sizeof(struct ip6_hdr) + optlen);
+   m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6;
+   }
+#endif
+   }
+
+   return (0);
+}
+
 int
 ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto,
 int fraglen , uint32_t id)
@@ -307,7 +337,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
struct ifnet *ifp, *origifp;
struct mbuf *m = m0;
struct mbuf *mprev;
-   int hlen, tlen, len;
+   int tlen, len;
struct route_in6 ip6route;
struct rtentry *rt = NULL;
struct sockaddr_in6 *dst, src_sa, dst_sa;
@@ -918,17 +948,10 @@ passout:
 * XXX-BZ  Need a framework to know when the NIC can handle it, even
 * with ext. hdrs.
 */
-   if (sw_csum & CSUM_DELAY_DATA_IPV6) {
-   sw_csum &= ~CSUM_DELAY_DATA_IPV6;
-   in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr));
-   }
-#ifdef SCTP
-   if (sw_csum & CSUM_SCTP_IPV6) {
-   sw_csum &= ~CSUM_SCTP_IPV6;
-   sctp_delayed_cksum(m, sizeof(struct ip6_hdr));
-   }
-#endif
-   m->m_pkthdr.csum_flags &= ifp->if_hwassist;
+   error = ip6_output_delayed_csum(m, ifp, sw_csum, plen, optlen, false);
+   if (error != 0)
+   goto bad;
+   /* XXX-BZ m->m_pkthdr.csum_flags &= ~ifp->if_hwassist; */
tlen = m->m_pkthdr.len;
 
if ((opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) || tso)
@@ -1008,11 +1031,10 @@ passout:
 * fragment if possible.
 * Must be able to put at least 8 bytes per fragment.
 */
-   hlen = unfragpartlen;
if (mtu > IPV6_MAXPACKET)
mtu = IPV6_MAXPACKET;
 
-   len = (mtu - hlen - sizeof(struct ip6_frag)) & ~7;
+   len = (mtu - unfragpartlen - sizeof(struct ip6_frag)) & ~7;
if (len < 8) {
error = EMSGSIZE;
in6_ifstat_inc(ifp, ifs6_out_fragfail);
@@ -1024,16 +1046,11 @@ passout:
 * fragmented packets, then do it here.
 * XXX-BZ handle the hw offloading case.  Need flags.
 */
-   if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
-   in6_delayed_cksum(m, plen, hlen);
-  

svn commit: r358556 - in head: libexec/tftpd libexec/tftpd/tests usr.bin/tftp

2020-03-02 Thread John Baldwin
Author: jhb
Date: Mon Mar  2 22:19:30 2020
New Revision: 358556
URL: https://svnweb.freebsd.org/changeset/base/358556

Log:
  Add support for the TFTP windowsize option described in RFC 7440.
  
  The windowsize option permits multiple blocks to be transmitted
  before the receiver sends an ACK improving throughput for larger
  files.
  
  Reviewed by:  asomers
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D23836

Modified:
  head/libexec/tftpd/tests/functional.c
  head/libexec/tftpd/tftp-file.c
  head/libexec/tftpd/tftp-file.h
  head/libexec/tftpd/tftp-options.c
  head/libexec/tftpd/tftp-options.h
  head/libexec/tftpd/tftp-transfer.c
  head/libexec/tftpd/tftp-utils.c
  head/libexec/tftpd/tftp-utils.h
  head/libexec/tftpd/tftpd.8
  head/usr.bin/tftp/main.c
  head/usr.bin/tftp/tftp.1

Modified: head/libexec/tftpd/tests/functional.c
==
--- head/libexec/tftpd/tests/functional.c   Mon Mar  2 21:19:51 2020
(r358555)
+++ head/libexec/tftpd/tests/functional.c   Mon Mar  2 22:19:30 2020
(r358556)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -89,6 +90,13 @@ recv_ack(uint16_t blocknum)
RECV(hdr, NULL, 0);
 }
 
+static void
+recv_oack(const char *options, size_t options_len)
+{
+   char hdr[] = {0, 6};
+   RECV(hdr, options, options_len);
+}
+
 /*
  * Receive a data packet from tftpd
  * @param  blocknumExpected block number to be received
@@ -159,6 +167,11 @@ send_ack(uint16_t blocknum)
 
 }
 
+/*
+ * build an option string
+ */
+#define OPTION_STR(name, value)name "\000" value "\000"
+
 /* 
  * send a read request to tftpd.
  * @param  filenamefilename as a string, absolute or relative
@@ -166,6 +179,11 @@ send_ack(uint16_t blocknum)
  */
 #define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode "\0")
 
+/*
+ * send a read request with options
+ */
+#define SEND_RRQ_OPT(filename, mode, options) SEND_STR("\0\001" filename "\0" 
mode "\000" options)
+
 /* 
  * send a write request to tftpd.
  * @param  filenamefilename as a string, absolute or relative
@@ -173,6 +191,11 @@ send_ack(uint16_t blocknum)
  */
 #define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode "\0")
 
+/*
+ * send a write request with options
+ */
+#define SEND_WRQ_OPT(filename, mode, options) SEND_STR("\0\002" filename "\0" 
mode "\000" options)
+
 /* Define a test case, for both IPv4 and IPv6 */
 #define TFTPD_TC_DEFINE(name, head, ...) \
 static void \
@@ -573,6 +596,32 @@ TFTPD_TC_DEFINE(rrq_medium,)
 }
 
 /*
+ * Read a medium file with a window size of 2.
+ */
+TFTPD_TC_DEFINE(rrq_medium_window,)
+{
+   int fd;
+   size_t i;
+   uint32_t contents[192];
+   char options[] = OPTION_STR("windowsize", "2");
+
+   for (i = 0; i < nitems(contents); i++)
+   contents[i] = i;
+
+   fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
+   ATF_REQUIRE(fd >= 0);
+   write_all(fd, contents, sizeof(contents));
+   close(fd);
+
+   SEND_RRQ_OPT("medium.txt", "octet", OPTION_STR("windowsize", "2"));
+   recv_oack(options, sizeof(options) - 1);
+   send_ack(0);
+   recv_data(1, (const char*)&contents[0], 512);
+   recv_data(2, (const char*)&contents[128], 256);
+   send_ack(2);
+}
+
+/*
  * Read a file in netascii format
  */
 TFTPD_TC_DEFINE(rrq_netascii,)
@@ -652,6 +701,59 @@ TFTPD_TC_DEFINE(rrq_small,)
 }
 
 /*
+ * Read a file following the example in RFC 7440.
+ */
+TFTPD_TC_DEFINE(rrq_window_rfc7440,)
+{
+   int fd;
+   size_t i;
+   char options[] = OPTION_STR("windowsize", "4");
+   alignas(uint32_t) char contents[13 * 512 - 4];
+   uint32_t *u32p;
+
+   u32p = (uint32_t *)contents;
+   for (i = 0; i < sizeof(contents) / sizeof(uint32_t); i++)
+   u32p[i] = i;
+
+   fd = open("rfc7440.txt", O_RDWR | O_CREAT, 0644);
+   ATF_REQUIRE(fd >= 0);
+   write_all(fd, contents, sizeof(contents));
+   close(fd);
+
+   SEND_RRQ_OPT("rfc7440.txt", "octet", OPTION_STR("windowsize", "4"));
+   recv_oack(options, sizeof(options) - 1);
+   send_ack(0);
+   recv_data(1, &contents[0 * 512], 512);
+   recv_data(2, &contents[1 * 512], 512);
+   recv_data(3, &contents[2 * 512], 512);
+   recv_data(4, &contents[3 * 512], 512);
+   send_ack(4);
+   recv_data(5, &contents[4 * 512], 512);
+   recv_data(6, &contents[5 * 512], 512);
+   recv_data(7, &contents[6 * 512], 512);
+   recv_data(8, &contents[7 * 512], 512);
+
+   /* ACK 5 as if 6-8 were dropped. */
+   send_ack(5);
+   recv_data(6, &contents[5 * 512], 512);
+   recv_data(7, &contents[6 * 512], 512);
+   recv_data(8, &contents[7 * 512], 512);
+   recv_data(9, &contents[8 * 512], 512);
+   send_ack(9);
+   recv_dat

Re: svn commit: r358486 - head/sys/dev/bce

2020-03-02 Thread John Baldwin
On 3/1/20 9:27 AM, Warner Losh wrote:
> Author: imp
> Date: Sun Mar  1 17:27:30 2020
> New Revision: 358486
> URL: https://svnweb.freebsd.org/changeset/base/358486
> 
> Log:
>   Remove all the compatibility hacks for systems that predate FreeBSD 8. Some 
> of
>   these look to be cut and pasted from other drivers since this driver was
>   committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 
> 4
>   and 5 likely never were working...

You'd be surprised.  I had to backport this to 4.x for Y!BSD, so I do suspect
the 4.x bits worked fine.  Good to clean out the cruft regardless.

-- 
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: r358555 - head/sys/dev/cpufreq

2020-03-02 Thread Emmanuel Vadot
Author: manu
Date: Mon Mar  2 21:19:51 2020
New Revision: 358555
URL: https://svnweb.freebsd.org/changeset/base/358555

Log:
  cpufreq_dt: Improve multiple opp support
  
  When looking for cpu with the same OPP starts from the root /cpus node
  so each instance of cpufreq_dt will now each cpu with the same operating
  point.
  Also test that the node we are testing have the property "device_type" set
  to be equal to "cpu".
  While here add more debug printfs (off by defaults).
  
  MFC after:2 weeks

Modified:
  head/sys/dev/cpufreq/cpufreq_dt.c

Modified: head/sys/dev/cpufreq/cpufreq_dt.c
==
--- head/sys/dev/cpufreq/cpufreq_dt.c   Mon Mar  2 20:14:27 2020
(r358554)
+++ head/sys/dev/cpufreq/cpufreq_dt.c   Mon Mar  2 21:19:51 2020
(r358555)
@@ -81,6 +81,7 @@ struct cpufreq_dt_softc {
struct cpufreq_dt_opp *opp;
ssize_t nopp;
 
+   int cpu;
cpuset_t cpus;
 };
 
@@ -169,6 +170,13 @@ cpufreq_dt_set(device_t dev, const struct cf_setting *
 
sc = device_get_softc(dev);
 
+   DEBUG(dev, "Working on cpu %d\n", sc->cpu);
+   DEBUG(dev, "We have %d cpu on this dev\n", CPU_COUNT(&sc->cpus));
+   if (!CPU_ISSET(sc->cpu, &sc->cpus)) {
+   DEBUG(dev, "Not for this CPU\n");
+   return (0);
+   }
+
if (clk_get_freq(sc->clk, &freq) != 0) {
device_printf(dev, "Can't get current clk freq\n");
return (ENXIO);
@@ -190,7 +198,6 @@ cpufreq_dt_set(device_t dev, const struct cf_setting *
return (ENOENT);
}
uvolt = copp->uvolt_target;
-
}
 
opp = cpufreq_dt_find_opp(sc->dev, set->freq * 100);
@@ -449,14 +456,16 @@ cpufreq_dt_attach(device_t dev)
int cpu;
uint64_t freq;
int rv = 0;
+   char device_type[16];
enum opp_version version;
 
sc = device_get_softc(dev);
sc->dev = dev;
node = ofw_bus_get_node(device_get_parent(dev));
-   cpu = device_get_unit(device_get_parent(dev));
+   sc->cpu = device_get_unit(device_get_parent(dev));
 
-   if (cpu >= mp_ncpus) {
+   DEBUG(dev, "cpu=%d\n", sc->cpu);
+   if (sc->cpu >= mp_ncpus) {
device_printf(dev, "Not attaching as cpu is not present\n");
return (ENXIO);
}
@@ -502,7 +511,18 @@ cpufreq_dt_attach(device_t dev)
 * Find all CPUs that share the same opp table
 */
CPU_ZERO(&sc->cpus);
-   for (cnode = node; cnode > 0; cnode = OF_peer(cnode), cpu++) {
+   cnode = OF_parent(node);
+   for (cpu = 0, cnode = OF_child(cnode); cnode > 0; cnode = 
OF_peer(cnode)) {
+   if (OF_getprop(cnode, "device_type", device_type, 
sizeof(device_type)) <= 0)
+   continue;
+   if (strcmp(device_type, "cpu") != 0)
+   continue;
+   if (cpu == sc->cpu) {
+   DEBUG(dev, "Skipping our cpu\n");
+   cpu++;
+   continue;
+   }
+   DEBUG(dev, "Testing CPU %d\n", cpu);
copp = -1;
if (version == OPP_V1)
OF_getencprop(cnode, "operating-points", &copp,
@@ -510,8 +530,11 @@ cpufreq_dt_attach(device_t dev)
else if (version == OPP_V2)
OF_getencprop(cnode, "operating-points-v2",
&copp, sizeof(copp));
-   if (opp == copp)
+   if (opp == copp) {
+   DEBUG(dev, "CPU %d is using the same opp as this one 
(%d)\n", cpu, sc->cpu);
CPU_SET(cpu, &sc->cpus);
+   }
+   cpu++;
}
 
if (clk_get_freq(sc->clk, &freq) == 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: r358554 - in head: share/man/man4/man4.i386 sys/dev/ctau sys/dev/cx

2020-03-02 Thread Ed Maste
Author: emaste
Date: Mon Mar  2 20:14:27 2020
New Revision: 358554
URL: https://svnweb.freebsd.org/changeset/base/358554

Log:
  Add deprecation notices to ctau and cx drivers
  
  These support outdated or obsolete ISA WAN (T1/E1) sync serial cards,
  and these drivers haven't really been touched (other than in tree-wide
  sweeps to keep them building) for 15+ years.
  
  Related PCI devices ce and cp are still in the tree, with deprecation
  proposed in D23928.
  
  MFC after:1 week
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man4/man4.i386/ctau.4
  head/share/man/man4/man4.i386/cx.4
  head/sys/dev/ctau/if_ct.c
  head/sys/dev/cx/if_cx.c

Modified: head/share/man/man4/man4.i386/ctau.4
==
--- head/share/man/man4/man4.i386/ctau.4Mon Mar  2 18:40:34 2020
(r358553)
+++ head/share/man/man4/man4.i386/ctau.4Mon Mar  2 20:14:27 2020
(r358554)
@@ -13,7 +13,7 @@
 .\" Cronyx Id: ct.4,v 1.1.2.6 2004/06/21 17:56:40 rik Exp $
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2004
+.Dd March 2, 2020
 .Dt CTAU 4 i386
 .Os
 .Sh NAME
@@ -33,6 +33,12 @@ In
 .Cd hint.ctau.0.port="0x240"
 .Cd hint.ctau.0.irq="15"
 .Cd hint.ctau.0.drq="7"
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is not present in
+.Fx 13.0
+and later.
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/share/man/man4/man4.i386/cx.4
==
--- head/share/man/man4/man4.i386/cx.4  Mon Mar  2 18:40:34 2020
(r358553)
+++ head/share/man/man4/man4.i386/cx.4  Mon Mar  2 20:14:27 2020
(r358554)
@@ -13,7 +13,7 @@
 .\" Cronyx Id: cx.4,v 1.1.2.6 2004/06/21 17:56:40 rik Exp $
 .\" $FreeBSD$
 .\"
-.Dd July 16, 2005
+.Dd March 2, 2020
 .Dt CX 4 i386
 .Os
 .Sh NAME
@@ -45,6 +45,12 @@ In
 .Cd hint.cx.0.port="0x240"
 .Cd hint.cx.0.irq="15"
 .Cd hint.cx.0.drq="7"
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is not present in
+.Fx 13.0
+and later.
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/sys/dev/ctau/if_ct.c
==
--- head/sys/dev/ctau/if_ct.c   Mon Mar  2 18:40:34 2020(r358553)
+++ head/sys/dev/ctau/if_ct.c   Mon Mar  2 20:14:27 2020(r358554)
@@ -748,6 +748,7 @@ static int ct_attach (device_t dev)
}
splx (s);

+   gone_in_dev(dev, 13, "sync serial (T1/E1) ISA card drivers");
return 0;
 }
 

Modified: head/sys/dev/cx/if_cx.c
==
--- head/sys/dev/cx/if_cx.c Mon Mar  2 18:40:34 2020(r358553)
+++ head/sys/dev/cx/if_cx.c Mon Mar  2 20:14:27 2020(r358554)
@@ -871,6 +871,7 @@ static int cx_attach (device_t dev)
}
splx (s);
 
+   gone_in_dev(dev, 13, "sync serial (T1/E1) ISA card drivers");
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: r358553 - head/usr.bin/hexdump/tests

2020-03-02 Thread Kyle Evans
Author: kevans
Date: Mon Mar  2 18:40:34 2020
New Revision: 358553
URL: https://svnweb.freebsd.org/changeset/base/358553

Log:
  hexdump: tests: take into account byte order
  
  Hexdump test was failling on big endian systems when testing decimal, octal
  and hexa outputs as the tests were designed on a little endian system. This
  revision adds the two distinct flavors of output expected and determines at
  runtime which to compare against.
  
  Submitted by: Renato Riolino 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23191

Added:
  head/usr.bin/hexdump/tests/d_hexdump_dflag_a_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_dflag_a_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_dflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_dflag_b_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_dflag_b_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_dflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_dflag_c_eb.out   (contents, props 
changed)
 - copied, changed from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_dflag_c_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_a_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_oflag_a_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_oflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_b_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_oflag_b_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_oflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_c_eb.out   (contents, props 
changed)
 - copied, changed from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_c_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_a_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_xflag_a_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_xflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_b_eb.out   (contents, props 
changed)
  head/usr.bin/hexdump/tests/d_hexdump_xflag_b_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_xflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_c_eb.out   (contents, props 
changed)
 - copied, changed from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_c_el.out
 - copied unchanged from r358552, 
head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out
Deleted:
  head/usr.bin/hexdump/tests/d_hexdump_dflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_dflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_dflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_oflag_c.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_a.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_b.out
  head/usr.bin/hexdump/tests/d_hexdump_xflag_c.out
Modified:
  head/usr.bin/hexdump/tests/Makefile
  head/usr.bin/hexdump/tests/hexdump_test.sh

Modified: head/usr.bin/hexdump/tests/Makefile
==
--- head/usr.bin/hexdump/tests/Makefile Mon Mar  2 18:06:02 2020
(r358552)
+++ head/usr.bin/hexdump/tests/Makefile Mon Mar  2 18:40:34 2020
(r358553)
@@ -13,20 +13,29 @@ ${PACKAGE}FILES+=   d_hexdump_bflag_c.out
 ${PACKAGE}FILES+=  d_hexdump_cflag_a.out
 ${PACKAGE}FILES+=  d_hexdump_cflag_b.out
 ${PACKAGE}FILES+=  d_hexdump_cflag_c.out
-${PACKAGE}FILES+=  d_hexdump_dflag_a.out
-${PACKAGE}FILES+=  d_hexdump_dflag_b.out
-${PACKAGE}FILES+=  d_hexdump_dflag_c.out
+${PACKAGE}FILES+=  d_hexdump_dflag_a_el.out
+${PACKAGE}FILES+=  d_hexdump_dflag_b_el.out
+${PACKAGE}FILES+=  d_hexdump_dflag_c_el.out
+${PACKAGE}FILES+=  d_hexdump_dflag_a_eb.out
+${PACKAGE}FILES+=  d_hexdump_dflag_b_eb.out
+${PACKAGE}FILES+=  d_hexdump_dflag_c_eb.out
 ${PACKAGE}FILES+=  d_hexdump_nflag_a.out
-${PACKAGE}FILES+=  d_hexdump_oflag_a.out
-${PACKAGE}FILES+=  d_hexdump_oflag_b.out
-${PACKAGE}FILES+=  d_hexdump_oflag_c.out
+${PACKAGE}FILES+=  d_hexdump_oflag_a_el.out
+${PACKAGE}FILES+=  d_hexdump_oflag_b_el.out
+${PACKAGE}FILES+=  d_hexdump_oflag_c_el.out
+${PACKAGE}FILES+=  d_hexdump_oflag_a_eb.out
+${PACKAGE}FILES+=  d_hexdump_oflag_b_eb.out
+${PACKAGE}FILES+=  d_hexdump_oflag_c_eb.out
 ${PACKAGE}FILES+=  d_hexdump_sflag_a.out
 ${PACKAGE}FILES+=  d_hexdump_UCflag_a.out
 ${PACKAGE}FILES+=  d_hexdump_UCflag_b.out
 ${PACKAGE}FILES+=  d_hexd

Re: svn commit: r358439 - head/sys/amd64/include

2020-03-02 Thread Konstantin Belousov
On Mon, Mar 02, 2020 at 09:13:53AM -0800, Ryan Libby wrote:
> On Mon, Mar 2, 2020 at 12:45 AM Alexander V. Chernikov  
> wrote:
> >
> > 28.02.2020, 18:32, "Ryan Libby" :
> > > Author: rlibby
> > > Date: Fri Feb 28 18:32:36 2020
> > > New Revision: 358439
> > > URL: https://svnweb.freebsd.org/changeset/base/358439
> > >
> > > Log:
> > >   amd64 atomic.h: minor codegen optimization in flag access
> > >
> > >   Previously the pattern to extract status flags from inline assembly
> > >   blocks was to use setcc in the block to write the flag to a register.
> > >   This was suboptimal in a few ways:
> > >- It would lead to code like: sete %cl; test %cl; jne, i.e. a flag
> > >  would just be loaded into a register and then reloaded to a flag.
> > >- The setcc would force the block to use an additional register.
> > >- If the client code didn't care for the flag value then the setcc
> > >  would be entirely pointless but could not be eliminated by the
> > >  optimizer.
> > >
> > >   A more modern inline asm construct (since gcc 6 and clang 9) allows for
> > This effectively restricts kernel builds by all older compilers.
> > Is there any chance of making it conditional depending on the compiler 
> > version/features?
What is the older compiler you need to use for base system ?
And why ?

> 
> Yes, it is possible to test for __GCC_ASM_FLAG_OUTPUTS__.  It is more
> maintenance effort going forward.  If building current with an old cross
> compiler is an important scenario, we can either revert this and the
> following revision or work up a patch to make it conditional.  I'll see
> what that might look like.
___
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: r358552 - stable/11/sys/dev/uart

2020-03-02 Thread Justin Hibbits
Author: jhibbits
Date: Mon Mar  2 18:06:02 2020
New Revision: 358552
URL: https://svnweb.freebsd.org/changeset/base/358552

Log:
  MFC r358431:
  
  Add Denverton UART PCI ID
  
  Sponsored by: Juniper Networks, Inc

Modified:
  stable/11/sys/dev/uart/uart_bus_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/uart/uart_bus_pci.c
==
--- stable/11/sys/dev/uart/uart_bus_pci.c   Mon Mar  2 16:56:32 2020
(r358551)
+++ stable/11/sys/dev/uart/uart_bus_pci.c   Mon Mar  2 18:06:02 2020
(r358552)
@@ -128,6 +128,7 @@ static const struct pci_id pci_ns8250_ids[] = {
 { 0x8086, 0x0f0c, 0x, 0, "Intel ValleyView LPIO1 HSUART#2", 0x10,
24 * DEFAULT_RCLK, 2 },
 { 0x8086, 0x108f, 0x, 0, "Intel AMT - SOL", 0x10 },
+{ 0x8086, 0x19d8, 0x, 0, "Intel Denverton UART", 0x10 },
 { 0x8086, 0x1c3d, 0x, 0, "Intel AMT - KT Controller", 0x10 },
 { 0x8086, 0x1d3d, 0x, 0, "Intel C600/X79 Series Chipset KT Controller", 
0x10 },
 { 0x8086, 0x1e3d, 0x, 0, "Intel Panther Point KT Controller", 0x10 },
___
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: r358439 - head/sys/amd64/include

2020-03-02 Thread Ryan Libby
On Mon, Mar 2, 2020 at 12:45 AM Alexander V. Chernikov  wrote:
>
> 28.02.2020, 18:32, "Ryan Libby" :
> > Author: rlibby
> > Date: Fri Feb 28 18:32:36 2020
> > New Revision: 358439
> > URL: https://svnweb.freebsd.org/changeset/base/358439
> >
> > Log:
> >   amd64 atomic.h: minor codegen optimization in flag access
> >
> >   Previously the pattern to extract status flags from inline assembly
> >   blocks was to use setcc in the block to write the flag to a register.
> >   This was suboptimal in a few ways:
> >- It would lead to code like: sete %cl; test %cl; jne, i.e. a flag
> >  would just be loaded into a register and then reloaded to a flag.
> >- The setcc would force the block to use an additional register.
> >- If the client code didn't care for the flag value then the setcc
> >  would be entirely pointless but could not be eliminated by the
> >  optimizer.
> >
> >   A more modern inline asm construct (since gcc 6 and clang 9) allows for
> This effectively restricts kernel builds by all older compilers.
> Is there any chance of making it conditional depending on the compiler 
> version/features?

Yes, it is possible to test for __GCC_ASM_FLAG_OUTPUTS__.  It is more
maintenance effort going forward.  If building current with an old cross
compiler is an important scenario, we can either revert this and the
following revision or work up a patch to make it conditional.  I'll see
what that might look like.

> >   "flag output operands", where a C variable can be written directly from
> >   a flag. The optimizer can then use this to produce direct code where
> >   the flag does not take a trip through a register.
> >
> >   In practice this makes each affected operation sequence shorter by five
> >   bytes of instructions. It's unlikely this has a measurable performance
> >   impact.
> >
> >   Reviewed by: kib, markj, mjg
> >   Sponsored by: Dell EMC Isilon
> >   Differential Revision: https://reviews.freebsd.org/D23869
> >
> > Modified:
> >   head/sys/amd64/include/atomic.h
> >
> > Modified: head/sys/amd64/include/atomic.h
> > ==
> > --- head/sys/amd64/include/atomic.h Fri Feb 28 17:41:46 2020 (r358438)
> > +++ head/sys/amd64/include/atomic.h Fri Feb 28 18:32:36 2020 (r358439)
> > @@ -201,9 +201,8 @@ atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE
> >  __asm __volatile( \
> >  " " MPLOCKED " " \
> >  " cmpxchg %3,%1 ; " \
> > - " sete %0 ; " \
> >  "# atomic_cmpset_" #TYPE " " \
> > - : "=q" (res), /* 0 */ \
> > + : "=@cce" (res), /* 0 */ \
> >"+m" (*dst), /* 1 */ \
> >"+a" (expect) /* 2 */ \
> >  : "r" (src) /* 3 */ \
> > @@ -219,9 +218,8 @@ atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE
> >  __asm __volatile( \
> >  " " MPLOCKED " " \
> >  " cmpxchg %3,%1 ; " \
> > - " sete %0 ; " \
> >  "# atomic_fcmpset_" #TYPE " " \
> > - : "=q" (res), /* 0 */ \
> > + : "=@cce" (res), /* 0 */ \
> >"+m" (*dst), /* 1 */ \
> >"+a" (*expect) /* 2 */ \
> >  : "r" (src) /* 3 */ \
> > @@ -278,9 +276,8 @@ atomic_testandset_int(volatile u_int *p, u_int v)
> >  __asm __volatile(
> >  " " MPLOCKED " "
> >  " btsl %2,%1 ; "
> > - " setc %0 ; "
> >  "# atomic_testandset_int"
> > - : "=q" (res), /* 0 */
> > + : "=@ccc" (res), /* 0 */
> >"+m" (*p) /* 1 */
> >  : "Ir" (v & 0x1f) /* 2 */
> >  : "cc");
> > @@ -295,9 +292,8 @@ atomic_testandset_long(volatile u_long *p, u_int v)
> >  __asm __volatile(
> >  " " MPLOCKED " "
> >  " btsq %2,%1 ; "
> > - " setc %0 ; "
> >  "# atomic_testandset_long"
> > - : "=q" (res), /* 0 */
> > + : "=@ccc" (res), /* 0 */
> >"+m" (*p) /* 1 */
> >  : "Jr" ((u_long)(v & 0x3f)) /* 2 */
> >  : "cc");
> > @@ -312,9 +308,8 @@ atomic_testandclear_int(volatile u_int *p, u_int v)
> >  __asm __volatile(
> >  " " MPLOCKED " "
> >  " btrl %2,%1 ; "
> > - " setc %0 ; "
> >  "# atomic_testandclear_int"
> > - : "=q" (res), /* 0 */
> > + : "=@ccc" (res), /* 0 */
> >"+m" (*p) /* 1 */
> >  : "Ir" (v & 0x1f) /* 2 */
> >  : "cc");
> > @@ -329,9 +324,8 @@ atomic_testandclear_long(volatile u_long *p, u_int v)
> >  __asm __volatile(
> >  " " MPLOCKED " "
> >  " btrq %2,%1 ; "
> > - " setc %0 ; "
> >  "# atomic_testandclear_long"
> > - : "=q" (res), /* 0 */
> > + : "=@ccc" (res), /* 0 */
> >"+m" (*p) /* 1 */
> >  : "Jr" ((u_long)(v & 0x3f)) /* 2 */
> >  : "cc");
___
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: r358551 - stable/12/sys/dev/uart

2020-03-02 Thread Justin Hibbits
Author: jhibbits
Date: Mon Mar  2 16:56:32 2020
New Revision: 358551
URL: https://svnweb.freebsd.org/changeset/base/358551

Log:
  MFC r358431:
  
  Add Denverton UART PCI ID
  
  Sponsored by: Juniper Networks, Inc

Modified:
  stable/12/sys/dev/uart/uart_bus_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/uart/uart_bus_pci.c
==
--- stable/12/sys/dev/uart/uart_bus_pci.c   Mon Mar  2 16:11:25 2020
(r358550)
+++ stable/12/sys/dev/uart/uart_bus_pci.c   Mon Mar  2 16:56:32 2020
(r358551)
@@ -133,6 +133,7 @@ static const struct pci_id pci_ns8250_ids[] = {
 { 0x8086, 0x0f0c, 0x, 0, "Intel ValleyView LPIO1 HSUART#2", 0x10,
24 * DEFAULT_RCLK, 2 },
 { 0x8086, 0x108f, 0x, 0, "Intel AMT - SOL", 0x10 },
+{ 0x8086, 0x19d8, 0x, 0, "Intel Denverton UART", 0x10 },
 { 0x8086, 0x1c3d, 0x, 0, "Intel AMT - KT Controller", 0x10 },
 { 0x8086, 0x1d3d, 0x, 0, "Intel C600/X79 Series Chipset KT Controller", 
0x10 },
 { 0x8086, 0x1e3d, 0x, 0, "Intel Panther Point KT Controller", 0x10 },
___
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: r358550 - head/sys/dev/aacraid

2020-03-02 Thread Leandro Lupori
Author: luporl
Date: Mon Mar  2 16:11:25 2020
New Revision: 358550
URL: https://svnweb.freebsd.org/changeset/base/358550

Log:
  [aacraid] Prevent sense data from causing a buffer overflow
  
  This issue was observed on a PowerPC64 machine with an Adaptec RAID
  Controller with PCI device ID 0x028d, where sense data was causing a
  buffer overflow because of wrong max sense length logic.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D23667

Modified:
  head/sys/dev/aacraid/aacraid_cam.c

Modified: head/sys/dev/aacraid/aacraid_cam.c
==
--- head/sys/dev/aacraid/aacraid_cam.c  Mon Mar  2 15:58:50 2020
(r358549)
+++ head/sys/dev/aacraid/aacraid_cam.c  Mon Mar  2 16:11:25 2020
(r358550)
@@ -1182,7 +1182,7 @@ aac_cam_complete(struct aac_command *cm)
scsi_sense_len) ? scsi_sense_len :
srbr->sense_len;
bcopy(&srbr->sense[0], &ccb->csio.sense_data,
-   srbr->sense_len);
+   sense_len);
ccb->csio.sense_len = sense_len;
ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
// scsi_sense_print(&ccb->csio);
___
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: r358549 - head/release/packages

2020-03-02 Thread Kyle Evans
Author: kevans
Date: Mon Mar  2 15:58:50 2020
New Revision: 358549
URL: https://svnweb.freebsd.org/changeset/base/358549

Log:
  pkgbase: remove logic for _profile packages
  
  We don't produce these anymore as of r356797, remove the remnant in
  generate-ucl.sh that accounted for them. This isn't strictly necessary, but
  future work is needed for the various packages that can be generated on a
  lib build.
  
  Namely, we may produce -development packages for private/internal libs that
  should be installed but won't have the base FreeBSD-libfoo pkg to depend on
  because it's internal (e.g. liby, libpmcstat, libifconfig) but we want the
  headers installed. It may be a better move to just shove these into
  -runtime-development instead, but if not then we've just simplified the
  cases that need to take private/internal libs into account.

Modified:
  head/release/packages/generate-ucl.sh

Modified: head/release/packages/generate-ucl.sh
==
--- head/release/packages/generate-ucl.sh   Mon Mar  2 15:30:52 2020
(r358548)
+++ head/release/packages/generate-ucl.sh   Mon Mar  2 15:58:50 2020
(r358549)
@@ -71,11 +71,6 @@ main() {
_descr="32-bit Libraries, Debugging Symbols"
pkgdeps="${outname}"
;;
-   *_lib32_profile)
-   outname="${outname%%_lib32_profile}"
-   _descr="32-bit Libraries, Profiling"
-   pkgdeps="${outname}"
-   ;;
*_lib32)
outname="${outname%%_lib32}"
_descr="32-bit Libraries"
@@ -84,11 +79,6 @@ main() {
*_development)
outname="${outname%%_development}"
_descr="Development Files"
-   pkgdeps="${outname}"
-   ;;
-   *_profile)
-   outname="${outname%%_profile}"
-   _descr="Profiling Libraries"
pkgdeps="${outname}"
;;
*_debug)
___
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: r358497 - in head: . share/man/man4 sys/conf sys/dev/bktr sys/modules sys/modules/bktr sys/modules/bktr/bktr sys/modules/bktr/bktr_mem sys/sys

2020-03-02 Thread Rodney W. Grimes
[ Charset ISO-8859-1 unsupported, converting... ]
> On Sun, Mar 01, 2020 at 07:15:03PM +, Warner Losh wrote:
> > Author: imp
> > Date: Sun Mar  1 19:15:03 2020
> > New Revision: 358497
> > URL: https://svnweb.freebsd.org/changeset/base/358497
> > 
> > Log:
> >   Remove bktr(4)
> >   
> >   Remove the brooktree driver as discussed on arch@. Bump FreeBSD version to
> >   1300082, though I doubt anything will care.
> >   
> >   Relnote: yes
> > 
> > Deleted:
> >   head/share/man/man4/bktr.4
> >   head/sys/dev/bktr/CHANGELOG.TXT
> >   head/sys/dev/bktr/bktr_audio.c
> >   head/sys/dev/bktr/bktr_audio.h
> >   head/sys/dev/bktr/bktr_card.c
> >   head/sys/dev/bktr/bktr_card.h
> >   head/sys/dev/bktr/bktr_core.c
> >   head/sys/dev/bktr/bktr_core.h
> >   head/sys/dev/bktr/bktr_i2c.c
> >   head/sys/dev/bktr/bktr_i2c.h
> >   head/sys/dev/bktr/bktr_mem.c
> >   head/sys/dev/bktr/bktr_mem.h
> >   head/sys/dev/bktr/bktr_os.c
> >   head/sys/dev/bktr/bktr_os.h
> >   head/sys/dev/bktr/bktr_reg.h
> >   head/sys/dev/bktr/bktr_tuner.c
> >   head/sys/dev/bktr/bktr_tuner.h
> >   head/sys/dev/bktr/ioctl_bt848.h
> >   head/sys/dev/bktr/ioctl_meteor.h
> >   head/sys/dev/bktr/msp34xx.c
> >   head/sys/modules/bktr/Makefile
> >   head/sys/modules/bktr/Makefile.inc
> >   head/sys/modules/bktr/bktr/Makefile
> >   head/sys/modules/bktr/bktr_mem/Makefile
> > Modified:
> >   head/UPDATING
> >   head/share/man/man4/Makefile
> >   head/sys/conf/files
> >   head/sys/modules/Makefile
> >   head/sys/sys/param.h
> > 
> Hmm, /usr/src/share/man/man4/meteor.4 is still present,
> should that file be removed too?
> 
> Ren?

And there is also
/usr/src/sys/i386/include/ioctl_meteor.h


-- 
Rod Grimes rgri...@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: r358548 - head/sys/kern

2020-03-02 Thread Pawel Biernacki
Author: kaktus
Date: Mon Mar  2 15:30:52 2020
New Revision: 358548
URL: https://svnweb.freebsd.org/changeset/base/358548

Log:
  sys/: Document few more sysctls.
  
  Submitted by: Antranig Vartanian 
  Reviewed by:  kaktus
  Commented by: jhb
  Approved by:  kib (mentor)
  Sponsored by: illuria security
  Differential Revision:https://reviews.freebsd.org/D23759

Modified:
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_synch.c
  head/sys/kern/kern_umtx.c
  head/sys/kern/sched_4bsd.c
  head/sys/kern/sched_ule.c
  head/sys/kern/subr_kobj.c

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Mon Mar  2 14:36:15 2020(r358547)
+++ head/sys/kern/kern_exec.c   Mon Mar  2 15:30:52 2020(r358548)
@@ -123,18 +123,22 @@ static int do_execve(struct thread *td, struct image_a
 
 /* XXX This should be vm_size_t. */
 SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD|
-CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", "");
+CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU",
+"Location of process' ps_strings structure");
 
 /* XXX This should be vm_size_t. */
 SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD|
-CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", "");
+CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU",
+"Top of process stack");
 
 SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
-NULL, 0, sysctl_kern_stackprot, "I", "");
+NULL, 0, sysctl_kern_stackprot, "I",
+"Stack memory permissions");
 
 u_long ps_arg_cache_limit = PAGE_SIZE / 16;
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
-&ps_arg_cache_limit, 0, "");
+&ps_arg_cache_limit, 0,
+"Process' command line characters cache limit");
 
 static int disallow_high_osrel;
 SYSCTL_INT(_kern, OID_AUTO, disallow_high_osrel, CTLFLAG_RW,

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Mon Mar  2 14:36:15 2020
(r358547)
+++ head/sys/kern/kern_shutdown.c   Mon Mar  2 15:30:52 2020
(r358548)
@@ -167,7 +167,8 @@ static int show_busybufs;
 static int show_busybufs = 1;
 #endif
 SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW,
-   &show_busybufs, 0, "");
+&show_busybufs, 0,
+"Show busy buffers during shutdown");
 
 int suspend_blocked = 0;
 SYSCTL_INT(_kern, OID_AUTO, suspend_blocked, CTLFLAG_RW,

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Mon Mar  2 14:36:15 2020(r358547)
+++ head/sys/kern/kern_synch.c  Mon Mar  2 15:30:52 2020(r358548)
@@ -94,7 +94,8 @@ static fixpt_t cexp[3] = {
 };
 
 /* kernel uses `FSCALE', userland (SHOULD) use kern.fscale */
-SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, FSCALE, 
"");
+SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, FSCALE,
+"Fixed-point scale factor used for calculating load average values");
 
 static voidloadav(void *arg);
 

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Mon Mar  2 14:36:15 2020(r358547)
+++ head/sys/kern/kern_umtx.c   Mon Mar  2 15:30:52 2020(r358548)
@@ -240,7 +240,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, umtx_vnode_persistent,
 static int umtx_max_rb = 1000;
 SYSCTL_INT(_kern_ipc, OID_AUTO, umtx_max_robust, CTLFLAG_RWTUN,
 &umtx_max_rb, 0,
-"");
+"Maximum number of robust mutexes allowed for each thread");
 
 static uma_zone_t  umtx_pi_zone;
 static struct umtxq_chain  umtxq_chains[2][UMTX_CHAINS];

Modified: head/sys/kern/sched_4bsd.c
==
--- head/sys/kern/sched_4bsd.c  Mon Mar  2 14:36:15 2020(r358547)
+++ head/sys/kern/sched_4bsd.c  Mon Mar  2 15:30:52 2020(r358548)
@@ -437,7 +437,8 @@ maybe_preempt(struct thread *td)
 
 /* decay 95% of `ts_pctcpu' in 60 seconds; see CCPU_SHIFT before changing */
 static fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */
-SYSCTL_UINT(_kern, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0, "");
+SYSCTL_UINT(_kern, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0,
+"Decay factor used for updating %CPU");
 
 /*
  * If `ccpu' is not equal to `exp(-1/20)' and you still want to use the

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Mon Mar  2 14:36:15 2020(r358547)
+++ head/sys/kern/sched_ule.c   Mon Mar  2 15:30:52 2020(r358548)
@@ -3128,4 +3128,5 @@ SYSCTL_PROC(_

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

2020-03-02 Thread Andrew Turner
Author: andrew
Date: Mon Mar  2 14:36:15 2020
New Revision: 358547
URL: https://svnweb.freebsd.org/changeset/base/358547

Log:
  Add a space missed in r358545
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/genassym.c

Modified: head/sys/arm64/arm64/genassym.c
==
--- head/sys/arm64/arm64/genassym.c Mon Mar  2 14:34:26 2020
(r358546)
+++ head/sys/arm64/arm64/genassym.c Mon Mar  2 14:36:15 2020
(r358547)
@@ -44,7 +44,7 @@ ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, mo
 ASSYM(BP_KERN_L1PT, offsetof(struct arm64_bootparams, kern_l1pt));
 ASSYM(BP_KERN_DELTA, offsetof(struct arm64_bootparams, kern_delta));
 ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack));
-ASSYM(BP_KERN_L0PT, offsetof(struct arm64_bootparams,kern_l0pt));
+ASSYM(BP_KERN_L0PT, offsetof(struct arm64_bootparams, kern_l0pt));
 
 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
___
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: r358546 - head/usr.bin/elfctl

2020-03-02 Thread Ed Maste
Author: emaste
Date: Mon Mar  2 14:34:26 2020
New Revision: 358546
URL: https://svnweb.freebsd.org/changeset/base/358546

Log:
  elfctl: tiny style(9) cleanup, use bool where appropriate

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

Modified: head/usr.bin/elfctl/elfctl.c
==
--- head/usr.bin/elfctl/elfctl.cMon Mar  2 14:06:50 2020
(r358545)
+++ head/usr.bin/elfctl/elfctl.cMon Mar  2 14:34:26 2020
(r358546)
@@ -85,12 +85,12 @@ main(int argc, char **argv)
GElf_Ehdr ehdr;
Elf *elf;
Elf_Kind kind;
-   int ch, fd, editfeatures, retval;
+   int ch, fd, retval;
char *features;
-   bool lflag;
+   bool editfeatures, lflag;
 
lflag = 0;
-   editfeatures = 0;
+   editfeatures = false;
retval = 0;
features = NULL;
 
@@ -105,7 +105,7 @@ main(int argc, char **argv)
break;
case 'e':
features = optarg;
-   editfeatures = 1;
+   editfeatures = true;
break;
case 'h':
default:
___
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: r358545 - head/sys/arm64/arm64

2020-03-02 Thread Andrew Turner
Author: andrew
Date: Mon Mar  2 14:06:50 2020
New Revision: 358545
URL: https://svnweb.freebsd.org/changeset/base/358545

Log:
  Generate the offsets for struct arm64_bootparams and use it in locore.S
  
  This removes one place with hard coded offsets in locore.S
  
  Sponsored by: Innovate UK

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

Modified: head/sys/arm64/arm64/genassym.c
==
--- head/sys/arm64/arm64/genassym.c Mon Mar  2 14:04:09 2020
(r358544)
+++ head/sys/arm64/arm64/genassym.c Mon Mar  2 14:06:50 2020
(r358545)
@@ -34,7 +34,17 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
+
+/* Sizeof arm64_bootparams, rounded to keep stack alignment */
+ASSYM(BOOTPARAMS_SIZE, roundup2(sizeof(struct arm64_bootparams),
+STACKALIGNBYTES + 1));
+ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, modulep));
+ASSYM(BP_KERN_L1PT, offsetof(struct arm64_bootparams, kern_l1pt));
+ASSYM(BP_KERN_DELTA, offsetof(struct arm64_bootparams, kern_delta));
+ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack));
+ASSYM(BP_KERN_L0PT, offsetof(struct arm64_bootparams,kern_l0pt));
 
 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);

Modified: head/sys/arm64/arm64/locore.S
==
--- head/sys/arm64/arm64/locore.S   Mon Mar  2 14:04:09 2020
(r358544)
+++ head/sys/arm64/arm64/locore.S   Mon Mar  2 14:06:50 2020
(r358545)
@@ -153,18 +153,18 @@ virtdone:
sub x26, x26, x29
sub x24, x24, x29
 
-   sub sp, sp, #(64 * 4)
+   sub sp, sp, #BOOTPARAMS_SIZE
mov x0, sp
 
/* Degate the delda so it is VA -> PA */
neg x29, x29
 
-   str x1,  [x0]   /* modulep */
-   str x26, [x0, 8]/* kern_l1pt */
-   str x29, [x0, 16]   /* kern_delta */
+   str x1,  [x0, #BP_MODULEP]
+   str x26, [x0, #BP_KERN_L1PT]
+   str x29, [x0, #BP_KERN_DELTA]
adr x25, initstack
-   str x25, [x0, 24]   /* kern_stack */
-   str x24, [x0, 32]   /* kern_l0pt */
+   str x25, [x0, #BP_KERN_STACK]
+   str x24, [x0, #BP_KERN_L0PT]
 
/* trace back starts here */
mov fp, #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"


Re: svn commit: r358497 - in head: . share/man/man4 sys/conf sys/dev/bktr sys/modules sys/modules/bktr sys/modules/bktr/bktr sys/modules/bktr/bktr_mem sys/sys

2020-03-02 Thread Rene Ladan
On Sun, Mar 01, 2020 at 07:15:03PM +, Warner Losh wrote:
> Author: imp
> Date: Sun Mar  1 19:15:03 2020
> New Revision: 358497
> URL: https://svnweb.freebsd.org/changeset/base/358497
> 
> Log:
>   Remove bktr(4)
>   
>   Remove the brooktree driver as discussed on arch@. Bump FreeBSD version to
>   1300082, though I doubt anything will care.
>   
>   Relnote: yes
> 
> Deleted:
>   head/share/man/man4/bktr.4
>   head/sys/dev/bktr/CHANGELOG.TXT
>   head/sys/dev/bktr/bktr_audio.c
>   head/sys/dev/bktr/bktr_audio.h
>   head/sys/dev/bktr/bktr_card.c
>   head/sys/dev/bktr/bktr_card.h
>   head/sys/dev/bktr/bktr_core.c
>   head/sys/dev/bktr/bktr_core.h
>   head/sys/dev/bktr/bktr_i2c.c
>   head/sys/dev/bktr/bktr_i2c.h
>   head/sys/dev/bktr/bktr_mem.c
>   head/sys/dev/bktr/bktr_mem.h
>   head/sys/dev/bktr/bktr_os.c
>   head/sys/dev/bktr/bktr_os.h
>   head/sys/dev/bktr/bktr_reg.h
>   head/sys/dev/bktr/bktr_tuner.c
>   head/sys/dev/bktr/bktr_tuner.h
>   head/sys/dev/bktr/ioctl_bt848.h
>   head/sys/dev/bktr/ioctl_meteor.h
>   head/sys/dev/bktr/msp34xx.c
>   head/sys/modules/bktr/Makefile
>   head/sys/modules/bktr/Makefile.inc
>   head/sys/modules/bktr/bktr/Makefile
>   head/sys/modules/bktr/bktr_mem/Makefile
> Modified:
>   head/UPDATING
>   head/share/man/man4/Makefile
>   head/sys/conf/files
>   head/sys/modules/Makefile
>   head/sys/sys/param.h
> 
Hmm, /usr/src/share/man/man4/meteor.4 is still present,
should that file be removed too?

René
___
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: r358544 - head/contrib/libstdc++

2020-03-02 Thread Ed Maste
Author: emaste
Date: Mon Mar  2 14:04:09 2020
New Revision: 358544
URL: https://svnweb.freebsd.org/changeset/base/358544

Log:
  Remove old contrib/libstdc++, unused since r358454
  
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/contrib/libstdc++/
___
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: r358543 - stable/11/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:23:51 2020
New Revision: 358543
URL: https://svnweb.freebsd.org/changeset/base/358543

Log:
  MFC r358427:  initialize oifp to avoid bogus results/panics in edge cases
  
In certain cases (probably not during normal operation but observed in
the lab during development) ip6_ouput() could return without error
and ifpp (&oifp) not updated.
Given oifp was never initialized we would take the later branch
as oifp was not NULL, and when calling icmp6_ifstat_inc() we would
panic dereferencing a garbage pointer.
For code stability initialize oifp to NULL before first use to always
have a deterministic value and not rely on a called function to behave
and always and for ever do the work for us as we hope for.
  
Sponsored by: Netflix

Modified:
  stable/11/sys/netinet6/mld6.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/mld6.c
==
--- stable/11/sys/netinet6/mld6.c   Mon Mar  2 13:23:28 2020
(r358542)
+++ stable/11/sys/netinet6/mld6.c   Mon Mar  2 13:23:51 2020
(r358543)
@@ -3124,6 +3124,7 @@ mld_dispatch_packet(struct mbuf *m)
mld = (struct mld_hdr *)(mtod(md, uint8_t *) + off);
type = mld->mld_type;
 
+   oifp = NULL;
error = ip6_output(m0, &mld_po, NULL, IPV6_UNSPECSRC, &im6o,
&oifp, NULL);
if (error) {
___
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: r358542 - stable/12/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:23:28 2020
New Revision: 358542
URL: https://svnweb.freebsd.org/changeset/base/358542

Log:
  MFC r358427:  initialize oifp to avoid bogus results/panics in edge cases
  
In certain cases (probably not during normal operation but observed in
the lab during development) ip6_ouput() could return without error
and ifpp (&oifp) not updated.
Given oifp was never initialized we would take the later branch
as oifp was not NULL, and when calling icmp6_ifstat_inc() we would
panic dereferencing a garbage pointer.
For code stability initialize oifp to NULL before first use to always
have a deterministic value and not rely on a called function to behave
and always and for ever do the work for us as we hope for.
  
Sponsored by:   Netflix

Modified:
  stable/12/sys/netinet6/mld6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/mld6.c
==
--- stable/12/sys/netinet6/mld6.c   Mon Mar  2 13:16:40 2020
(r358541)
+++ stable/12/sys/netinet6/mld6.c   Mon Mar  2 13:23:28 2020
(r358542)
@@ -3155,6 +3155,7 @@ mld_dispatch_packet(struct mbuf *m)
mld = (struct mld_hdr *)(mtod(md, uint8_t *) + off);
type = mld->mld_type;
 
+   oifp = NULL;
error = ip6_output(m0, &mld_po, NULL, IPV6_UNSPECSRC, &im6o,
&oifp, NULL);
if (error) {
___
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: r358541 - stable/11/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:16:40 2020
New Revision: 358541
URL: https://svnweb.freebsd.org/changeset/base/358541

Log:
  MFC r358167,358311: ip6_output: improve extension header handling
  
Move IPv6 source address checks from after extension header heandling
to the top of the function. If we do not pass these checks there is
no reason to do a lot of work upfront.
  
Fold extension header preparations and length calculations together into
a single branch and macro rather than doing them sequentially.
Likewise move extension header concatination into a single branch block
only doing it if we recorded any extension header length length.
  
Sponsored by: Netflix (partially, originally)

Modified:
  stable/11/sys/netinet6/ip6_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/ip6_output.c
==
--- stable/11/sys/netinet6/ip6_output.c Mon Mar  2 13:16:18 2020
(r358540)
+++ stable/11/sys/netinet6/ip6_output.c Mon Mar  2 13:16:40 2020
(r358541)
@@ -155,10 +155,10 @@ static int copypktopts(struct ip6_pktopts *, struct ip
 
 
 /*
- * Make an extension header from option data.  hp is the source, and
- * mp is the destination.
+ * Make an extension header from option data.  hp is the source,
+ * mp is the destination, and _ol is the optlen.
  */
-#define MAKE_EXTHDR(hp, mp)\
+#defineMAKE_EXTHDR(hp, mp, _ol)
\
 do {   \
if (hp) {   \
struct ip6_ext *eh = (struct ip6_ext *)(hp);\
@@ -166,6 +166,7 @@ static int copypktopts(struct ip6_pktopts *, struct ip
((eh)->ip6e_len + 1) << 3); \
if (error)  \
goto freehdrs;  \
+   (_ol) += (*(mp))->m_len;\
}   \
 } while (/*CONSTCOND*/ 0)
 
@@ -306,22 +307,23 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
struct ip6_hdr *ip6;
struct ifnet *ifp, *origifp;
struct mbuf *m = m0;
-   struct mbuf *mprev = NULL;
+   struct mbuf *mprev;
int hlen, tlen, len;
struct route_in6 ip6route;
struct rtentry *rt = NULL;
struct sockaddr_in6 *dst, src_sa, dst_sa;
struct in6_addr odst;
+   u_char *nexthdrp;
int error = 0;
struct in6_ifaddr *ia = NULL;
u_long mtu;
int alwaysfrag, dontfrag;
-   u_int32_t optlen = 0, plen = 0, unfragpartlen = 0;
+   u_int32_t optlen, plen = 0, unfragpartlen;
struct ip6_exthdrs exthdrs;
struct in6_addr src0, dst0;
u_int32_t zone;
struct route_in6 *ro_pmtu = NULL;
-   int hdrsplit = 0;
+   bool hdrsplit;
int sw_csum, tso;
int needfiblookup;
uint32_t fibnum;
@@ -353,13 +355,50 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
}
 #endif /* IPSEC */
 
+   /* Source address validation. */
+   ip6 = mtod(m, struct ip6_hdr *);
+   if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) &&
+   (flags & IPV6_UNSPECSRC) == 0) {
+   error = EOPNOTSUPP;
+   IP6STAT_INC(ip6s_badscope);
+   goto bad;
+   }
+   if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src)) {
+   error = EOPNOTSUPP;
+   IP6STAT_INC(ip6s_badscope);
+   goto bad;
+   }
+
+   /*
+* If we are given packet options to add extension headers prepare them.
+* Calculate the total length of the extension header chain.
+* Keep the length of the unfragmentable part for fragmentation.
+*/
bzero(&exthdrs, sizeof(exthdrs));
+   optlen = 0;
+   unfragpartlen = sizeof(struct ip6_hdr);
if (opt) {
/* Hop-by-Hop options header. */
-   MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh);
+   MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh, optlen);
+
/* Destination options header (1st part). */
if (opt->ip6po_rthdr) {
+#ifndef RTHDR_SUPPORT_IMPLEMENTED
/*
+* If there is a routing header, discard the packet
+* right away here. RH0/1 are obsolete and we do not
+* currently support RH2/3/4.
+* People trying to use RH253/254 may want to disable
+* this check.
+* The moment we do support any routing header (again)
+* this block should check the routing type more
+ 

svn commit: r358540 - stable/12/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:16:18 2020
New Revision: 358540
URL: https://svnweb.freebsd.org/changeset/base/358540

Log:
  MFC r358167,358311: ip6_output: improve extension header handling
  
Move IPv6 source address checks from after extension header heandling
to the top of the function. If we do not pass these checks there is
no reason to do a lot of work upfront.
  
Fold extension header preparations and length calculations together into
a single branch and macro rather than doing them sequentially.
Likewise move extension header concatination into a single branch block
only doing it if we recorded any extension header length length.
  
Sponsored by:   Netflix (partially, originally)

Modified:
  stable/12/sys/netinet6/ip6_output.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/ip6_output.c
==
--- stable/12/sys/netinet6/ip6_output.c Mon Mar  2 13:13:42 2020
(r358539)
+++ stable/12/sys/netinet6/ip6_output.c Mon Mar  2 13:16:18 2020
(r358540)
@@ -154,10 +154,10 @@ static int copypktopts(struct ip6_pktopts *, struct ip
 
 
 /*
- * Make an extension header from option data.  hp is the source, and
- * mp is the destination.
+ * Make an extension header from option data.  hp is the source,
+ * mp is the destination, and _ol is the optlen.
  */
-#define MAKE_EXTHDR(hp, mp)\
+#defineMAKE_EXTHDR(hp, mp, _ol)
\
 do {   \
if (hp) {   \
struct ip6_ext *eh = (struct ip6_ext *)(hp);\
@@ -165,6 +165,7 @@ static int copypktopts(struct ip6_pktopts *, struct ip
((eh)->ip6e_len + 1) << 3); \
if (error)  \
goto freehdrs;  \
+   (_ol) += (*(mp))->m_len;\
}   \
 } while (/*CONSTCOND*/ 0)
 
@@ -305,22 +306,23 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
struct ip6_hdr *ip6;
struct ifnet *ifp, *origifp;
struct mbuf *m = m0;
-   struct mbuf *mprev = NULL;
+   struct mbuf *mprev;
int hlen, tlen, len;
struct route_in6 ip6route;
struct rtentry *rt = NULL;
struct sockaddr_in6 *dst, src_sa, dst_sa;
struct in6_addr odst;
+   u_char *nexthdrp;
int error = 0;
struct in6_ifaddr *ia = NULL;
u_long mtu;
int alwaysfrag, dontfrag;
-   u_int32_t optlen = 0, plen = 0, unfragpartlen = 0;
+   u_int32_t optlen, plen = 0, unfragpartlen;
struct ip6_exthdrs exthdrs;
struct in6_addr src0, dst0;
u_int32_t zone;
struct route_in6 *ro_pmtu = NULL;
-   int hdrsplit = 0;
+   bool hdrsplit;
int sw_csum, tso;
int needfiblookup;
uint32_t fibnum;
@@ -352,13 +354,50 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
}
 #endif /* IPSEC */
 
+   /* Source address validation. */
+   ip6 = mtod(m, struct ip6_hdr *);
+   if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) &&
+   (flags & IPV6_UNSPECSRC) == 0) {
+   error = EOPNOTSUPP;
+   IP6STAT_INC(ip6s_badscope);
+   goto bad;
+   }
+   if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src)) {
+   error = EOPNOTSUPP;
+   IP6STAT_INC(ip6s_badscope);
+   goto bad;
+   }
+
+   /*
+* If we are given packet options to add extension headers prepare them.
+* Calculate the total length of the extension header chain.
+* Keep the length of the unfragmentable part for fragmentation.
+*/
bzero(&exthdrs, sizeof(exthdrs));
+   optlen = 0;
+   unfragpartlen = sizeof(struct ip6_hdr);
if (opt) {
/* Hop-by-Hop options header. */
-   MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh);
+   MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh, optlen);
+
/* Destination options header (1st part). */
if (opt->ip6po_rthdr) {
+#ifndef RTHDR_SUPPORT_IMPLEMENTED
/*
+* If there is a routing header, discard the packet
+* right away here. RH0/1 are obsolete and we do not
+* currently support RH2/3/4.
+* People trying to use RH253/254 may want to disable
+* this check.
+* The moment we do support any routing header (again)
+* this block should check the routing type more
+   

svn commit: r358539 - stable/11/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:13:42 2020
New Revision: 358539
URL: https://svnweb.freebsd.org/changeset/base/358539

Log:
  MFC r358071: ip6_output: update comments.
  
Clear up some comments and improve to panic messages.
  
No functional changes.

Modified:
  stable/11/sys/netinet6/ip6_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/ip6_output.c
==
--- stable/11/sys/netinet6/ip6_output.c Mon Mar  2 13:12:45 2020
(r358538)
+++ stable/11/sys/netinet6/ip6_output.c Mon Mar  2 13:13:42 2020
(r358539)
@@ -180,7 +180,9 @@ static int copypktopts(struct ip6_pktopts *, struct ip
 do {\
if (m) {\
if (!hdrsplit) \
-   panic("assumption failed: hdr not split"); \
+   panic("%s:%d: assumption failed: "\
+   "hdr not split: hdrsplit %d exthdrs %p",\
+   __func__, __LINE__, hdrsplit, &exthdrs);\
*mtod((m), u_char *) = *(p);\
*(p) = (i);\
p = mtod((m), u_char *);\
@@ -278,8 +280,9 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
 }
 
 /*
- * IP6 output. The packet in mbuf chain m contains a skeletal IP6
- * header (with pri, len, nxt, hlim, src, dst).
+ * IP6 output.
+ * The packet in mbuf chain m contains a skeletal IP6 header (with pri, len,
+ * nxt, hlim, src, dst).
  * This function may modify ver and hlim only.
  * The mbuf chain containing the packet will be freed.
  * The mbuf opt, if present, will not be freed.
@@ -287,9 +290,8 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
  * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL,
  * then result of route lookup is stored in ro->ro_rt.
  *
- * type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and
- * nd_ifinfo.linkmtu is u_int32_t.  so we use u_long to hold largest one,
- * which is rt_mtu.
+ * Type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and nd_ifinfo.linkmtu
+ * is uint32_t.  So we use u_long to hold largest one, which is rt_mtu.
  *
  * ifpp - XXX: just for statistics
  */
@@ -330,7 +332,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
INP_LOCK_ASSERT(inp);
M_SETFIB(m, inp->inp_inc.inc_fibnum);
if ((flags & IP_NODEFAULTFLOWID) == 0) {
-   /* unconditionally set flowid */
+   /* Unconditionally set flowid. */
m->m_pkthdr.flowid = inp->inp_flowid;
M_HASHTYPE_SET(m, inp->inp_flowtype);
}
@@ -353,12 +355,12 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 
bzero(&exthdrs, sizeof(exthdrs));
if (opt) {
-   /* Hop-by-Hop options header */
+   /* Hop-by-Hop options header. */
MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh);
-   /* Destination options header(1st part) */
+   /* Destination options header (1st part). */
if (opt->ip6po_rthdr) {
/*
-* Destination options header(1st part)
+* Destination options header (1st part).
 * This only makes sense with a routing header.
 * See Section 9.2 of RFC 3542.
 * Disabling this part just for MIP6 convenience is
@@ -369,9 +371,9 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 */
MAKE_EXTHDR(opt->ip6po_dest1, &exthdrs.ip6e_dest1);
}
-   /* Routing header */
+   /* Routing header. */
MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr);
-   /* Destination options header(2nd part) */
+   /* Destination options header (2nd part). */
MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2);
}
 
@@ -388,7 +390,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
optlen += exthdrs.ip6e_rthdr->m_len;
unfragpartlen = optlen + sizeof(struct ip6_hdr);
 
-   /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output) */
+   /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output). */
if (exthdrs.ip6e_dest2)
optlen += exthdrs.ip6e_dest2->m_len;
 
@@ -407,7 +409,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 
ip6 = mtod(m, struct ip6_hdr *);
 
-   /* adjust mbuf packet header length */
+   /* Adjust mbuf packet header length. */
m->m_pkthdr.len += optlen;
plen = m->m_pkthdr.len - sizeof(*ip6);
 
@@ -421,7 +423,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
m = exthdrs.ip6e_ip6;
hdrsplit++;
}
-   /* adjust pointer */
+ 

Re: svn commit: r358518 - head/usr.bin/elfctl

2020-03-02 Thread Ed Maste
On Sun, 1 Mar 2020 at 23:22, Kyle Evans  wrote:
>
> Author: kevans
> Date: Mon Mar  2 04:22:38 2020
> New Revision: 358518
> URL: https://svnweb.freebsd.org/changeset/base/358518
>
> Log:
>   elfctl: initialize features
>
>   GCC points out a couple levels down in convert_to_features that this may be
>   used uninitialized. Indeed, this is true- initialize it to NULL so that we
>   at least deref a null pointer.

Note that features is only used in the case that editfeatures = 1, so
I believe this is a false positive from GCC.

But, thank you for fixing the warning / build. This code code
definitely use some style(9) and tidying; I'll try to get to that
shortly.
___
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: r358538 - stable/12/sys/netinet6

2020-03-02 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Mar  2 13:12:45 2020
New Revision: 358538
URL: https://svnweb.freebsd.org/changeset/base/358538

Log:
  MFC r358071: ip6_output: update comments.
  
Clear up some comments and improve to panic messages.
  
No functional changes.

Modified:
  stable/12/sys/netinet6/ip6_output.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/ip6_output.c
==
--- stable/12/sys/netinet6/ip6_output.c Mon Mar  2 09:45:06 2020
(r358537)
+++ stable/12/sys/netinet6/ip6_output.c Mon Mar  2 13:12:45 2020
(r358538)
@@ -179,7 +179,9 @@ static int copypktopts(struct ip6_pktopts *, struct ip
 do {\
if (m) {\
if (!hdrsplit) \
-   panic("assumption failed: hdr not split"); \
+   panic("%s:%d: assumption failed: "\
+   "hdr not split: hdrsplit %d exthdrs %p",\
+   __func__, __LINE__, hdrsplit, &exthdrs);\
*mtod((m), u_char *) = *(p);\
*(p) = (i);\
p = mtod((m), u_char *);\
@@ -277,8 +279,9 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
 }
 
 /*
- * IP6 output. The packet in mbuf chain m contains a skeletal IP6
- * header (with pri, len, nxt, hlim, src, dst).
+ * IP6 output.
+ * The packet in mbuf chain m contains a skeletal IP6 header (with pri, len,
+ * nxt, hlim, src, dst).
  * This function may modify ver and hlim only.
  * The mbuf chain containing the packet will be freed.
  * The mbuf opt, if present, will not be freed.
@@ -286,9 +289,8 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h
  * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL,
  * then result of route lookup is stored in ro->ro_rt.
  *
- * type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and
- * nd_ifinfo.linkmtu is u_int32_t.  so we use u_long to hold largest one,
- * which is rt_mtu.
+ * Type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and nd_ifinfo.linkmtu
+ * is uint32_t.  So we use u_long to hold largest one, which is rt_mtu.
  *
  * ifpp - XXX: just for statistics
  */
@@ -329,7 +331,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
INP_LOCK_ASSERT(inp);
M_SETFIB(m, inp->inp_inc.inc_fibnum);
if ((flags & IP_NODEFAULTFLOWID) == 0) {
-   /* unconditionally set flowid */
+   /* Unconditionally set flowid. */
m->m_pkthdr.flowid = inp->inp_flowid;
M_HASHTYPE_SET(m, inp->inp_flowtype);
}
@@ -352,12 +354,12 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 
bzero(&exthdrs, sizeof(exthdrs));
if (opt) {
-   /* Hop-by-Hop options header */
+   /* Hop-by-Hop options header. */
MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh);
-   /* Destination options header(1st part) */
+   /* Destination options header (1st part). */
if (opt->ip6po_rthdr) {
/*
-* Destination options header(1st part)
+* Destination options header (1st part).
 * This only makes sense with a routing header.
 * See Section 9.2 of RFC 3542.
 * Disabling this part just for MIP6 convenience is
@@ -368,9 +370,9 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 */
MAKE_EXTHDR(opt->ip6po_dest1, &exthdrs.ip6e_dest1);
}
-   /* Routing header */
+   /* Routing header. */
MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr);
-   /* Destination options header(2nd part) */
+   /* Destination options header (2nd part). */
MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2);
}
 
@@ -387,7 +389,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
optlen += exthdrs.ip6e_rthdr->m_len;
unfragpartlen = optlen + sizeof(struct ip6_hdr);
 
-   /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output) */
+   /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output). */
if (exthdrs.ip6e_dest2)
optlen += exthdrs.ip6e_dest2->m_len;
 
@@ -406,7 +408,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 
ip6 = mtod(m, struct ip6_hdr *);
 
-   /* adjust mbuf packet header length */
+   /* Adjust mbuf packet header length. */
m->m_pkthdr.len += optlen;
plen = m->m_pkthdr.len - sizeof(*ip6);
 
@@ -420,7 +422,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
m = exthdrs.ip6e_ip6;
hdrsplit++;
}
-   /* adjust pointer */
+ 

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

2020-03-02 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Mar  2 09:45:06 2020
New Revision: 358537
URL: https://svnweb.freebsd.org/changeset/base/358537

Log:
  Expose the ACPI power button, sleep button and LID state as evdev's.
  
  This allows libinput to disable touchpads when the lid is closed and
  various desktop environments can show power-off dialogs when the power
  button is pressed. While the latter is doable with devd a
  cross-platform solution is nicer.
  
  Submitted by: Greg V 
  Differential Revision:https://reviews.freebsd.org/D23863
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/acpica/acpi_button.c
  head/sys/dev/acpica/acpi_lid.c

Modified: head/sys/dev/acpica/acpi_button.c
==
--- head/sys/dev/acpica/acpi_button.c   Mon Mar  2 09:16:48 2020
(r358536)
+++ head/sys/dev/acpica/acpi_button.c   Mon Mar  2 09:45:06 2020
(r358537)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -40,6 +41,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("BUTTON")
@@ -51,6 +57,9 @@ struct acpi_button_softc {
 #defineACPI_POWER_BUTTON   0
 #defineACPI_SLEEP_BUTTON   1
 boolean_t  fixed;
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *button_evdev;
+#endif
 };
 
 #defineACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP0x80
@@ -142,6 +151,20 @@ acpi_button_attach(device_t dev)
 event = (sc->button_type == ACPI_SLEEP_BUTTON) ?
ACPI_EVENT_SLEEP_BUTTON : ACPI_EVENT_POWER_BUTTON;
 
+#ifdef EVDEV_SUPPORT
+sc->button_evdev = evdev_alloc();
+evdev_set_name(sc->button_evdev, device_get_desc(dev));
+evdev_set_phys(sc->button_evdev, device_get_nameunit(dev));
+evdev_set_id(sc->button_evdev, BUS_HOST, 0, 0, 1);
+evdev_support_event(sc->button_evdev, EV_SYN);
+evdev_support_event(sc->button_evdev, EV_KEY);
+evdev_support_key(sc->button_evdev,
+   (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER);
+
+if (evdev_register(sc->button_evdev))
+return (ENXIO);
+#endif
+
 /* 
  * Install the new handler.  We could remove any fixed handlers added
  * from the FADT once we have a duplicate from the AML but some systems
@@ -248,6 +271,9 @@ static void 
 acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context)
 {
 struct acpi_button_softc   *sc;
+#ifdef EVDEV_SUPPORT
+uint16_t key;
+#endif
 
 ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify);
 
@@ -263,6 +289,14 @@ acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notif
device_printf(sc->button_dev, "unknown notify %#x\n", notify);
break;
 }
+
+#ifdef EVDEV_SUPPORT
+key = (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER;
+evdev_push_key(sc->button_evdev, key, 1);
+evdev_sync(sc->button_evdev);
+evdev_push_key(sc->button_evdev, key, 0);
+evdev_sync(sc->button_evdev);
+#endif
 }
 
 static ACPI_STATUS 

Modified: head/sys/dev/acpica/acpi_lid.c
==
--- head/sys/dev/acpica/acpi_lid.c  Mon Mar  2 09:16:48 2020
(r358536)
+++ head/sys/dev/acpica/acpi_lid.c  Mon Mar  2 09:45:06 2020
(r358537)
@@ -31,6 +31,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -43,6 +44,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("LID")
@@ -51,6 +57,9 @@ struct acpi_lid_softc {
 device_t   lid_dev;
 ACPI_HANDLElid_handle;
 intlid_status; /* open or closed */
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *lid_evdev;
+#endif
 };
 
 ACPI_HANDLE acpi_lid_handle;
@@ -104,6 +113,12 @@ acpi_lid_status_update(struct acpi_lid_softc *sc)
 
/* range check value */
sc->lid_status = lid_status ? 1 : 0;
+
+#ifdef EVDEV_SUPPORT
+   /* Notify evdev about lid status */
+   evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1);
+   evdev_sync(sc->lid_evdev);
+#endif
 }
 
 static int
@@ -131,6 +146,20 @@ acpi_lid_attach(device_t dev)
 sc = device_get_softc(dev);
 sc->lid_dev = dev;
 acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev);
+
+#ifdef EVDEV_SUPPORT
+/* Register evdev device before initial status update */
+sc->lid_evdev = evdev_alloc();
+evdev_set_name(sc->lid_evdev, device_get_desc(dev));
+evdev_set_phys(sc->lid_evdev, device_get_nameunit(dev));
+evdev_set_id(sc->lid_evdev, BUS_HOST, 0, 0, 1);
+evdev_support_event(sc->lid_evdev, EV_SYN);
+ 

svn commit: r358536 - stable/11/sys/dev/acpica

2020-03-02 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Mar  2 09:16:48 2020
New Revision: 358536
URL: https://svnweb.freebsd.org/changeset/base/358536

Log:
  MFC r358219 and r358270:
  Make sure the ACPI lid state is updated during boot and after resume.
  While at it update the sysctl(9) description for the lid state.
  
  Always check return value from acpi_GetInteger().
  If a failure happens reading the lid state, assume the lid is opened.
  
  Differential Revision:https://reviews.freebsd.org/D23724
  PR:   240881
  Submitted by: Yuri Pankov 
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpica/acpi_lid.c
==
--- stable/11/sys/dev/acpica/acpi_lid.c Mon Mar  2 09:13:26 2020
(r358535)
+++ stable/11/sys/dev/acpica/acpi_lid.c Mon Mar  2 09:16:48 2020
(r358536)
@@ -84,6 +84,27 @@ static devclass_t acpi_lid_devclass;
 DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0);
 MODULE_DEPEND(acpi_lid, acpi, 1, 1, 1);
 
+static void
+acpi_lid_status_update(struct acpi_lid_softc *sc)
+{
+   ACPI_STATUS status;
+   int lid_status;
+
+   ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
+
+   /*
+* Evaluate _LID and check the return value, update lid status.
+*  Zero:   The lid is closed
+*  Non-zero:   The lid is open
+*/
+   status = acpi_GetInteger(sc->lid_handle, "_LID", &lid_status);
+   if (ACPI_FAILURE(status))
+   lid_status = 1; /* assume lid is opened */
+
+   /* range check value */
+   sc->lid_status = lid_status ? 1 : 0;
+}
+
 static int
 acpi_lid_probe(device_t dev)
 {
@@ -122,13 +143,16 @@ acpi_lid_attach(device_t dev)
 if (acpi_parse_prw(sc->lid_handle, &prw) == 0)
AcpiEnableGpe(prw.gpe_handle, prw.gpe_bit);
 
+/* Get the initial lid status */
+acpi_lid_status_update(sc);
+
 /*
  * Export the lid status
  */
 SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"state", CTLFLAG_RD, &sc->lid_status, 0,
-   "Device set to wake the system");
+   "Device state (0 = closed, 1 = open)");
 
 return (0);
 }
@@ -142,6 +166,13 @@ acpi_lid_suspend(device_t dev)
 static int
 acpi_lid_resume(device_t dev)
 {
+struct acpi_lid_softc  *sc;
+
+sc = device_get_softc(dev);
+
+/* Update lid status, if any */
+acpi_lid_status_update(sc);
+
 return (0);
 }
 
@@ -150,21 +181,14 @@ acpi_lid_notify_status_changed(void *arg)
 {
 struct acpi_lid_softc  *sc;
 struct acpi_softc  *acpi_sc;
-ACPI_STATUSstatus;
 
 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
 sc = (struct acpi_lid_softc *)arg;
 ACPI_SERIAL_BEGIN(lid);
 
-/*
- * Evaluate _LID and check the return value, update lid status.
- * Zero:   The lid is closed
- * Non-zero:   The lid is open
- */
-status = acpi_GetInteger(sc->lid_handle, "_LID", &sc->lid_status);
-if (ACPI_FAILURE(status))
-   goto out;
+/* Update lid status, if any */
+acpi_lid_status_update(sc);
 
 acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
 if (acpi_sc == 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: r358535 - stable/11/sys/dev/acpica

2020-03-02 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Mar  2 09:13:26 2020
New Revision: 358535
URL: https://svnweb.freebsd.org/changeset/base/358535

Log:
  MFC r315166:
  Export the actual LID state via sysctl. This allows more complex
  policies about when to suspend based on other events happening AND the
  lid being closed through the use of clever devd or other scripts.

Modified:
  stable/11/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpica/acpi_lid.c
==
--- stable/11/sys/dev/acpica/acpi_lid.c Mon Mar  2 09:09:16 2020
(r358534)
+++ stable/11/sys/dev/acpica/acpi_lid.c Mon Mar  2 09:13:26 2020
(r358535)
@@ -122,6 +122,14 @@ acpi_lid_attach(device_t dev)
 if (acpi_parse_prw(sc->lid_handle, &prw) == 0)
AcpiEnableGpe(prw.gpe_handle, prw.gpe_bit);
 
+/*
+ * Export the lid status
+ */
+SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "state", CTLFLAG_RD, &sc->lid_status, 0,
+   "Device set to wake the system");
+
 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: r358534 - stable/12/sys/dev/acpica

2020-03-02 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Mar  2 09:09:16 2020
New Revision: 358534
URL: https://svnweb.freebsd.org/changeset/base/358534

Log:
  MFC r358219 and r358270:
  Make sure the ACPI lid state is updated during boot and after resume.
  While at it update the sysctl(9) description for the lid state.
  
  Always check return value from acpi_GetInteger().
  If a failure happens reading the lid state, assume the lid is opened.
  
  Differential Revision:https://reviews.freebsd.org/D23724
  PR:   240881
  Submitted by: Yuri Pankov 
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpica/acpi_lid.c
==
--- stable/12/sys/dev/acpica/acpi_lid.c Mon Mar  2 08:44:58 2020
(r358533)
+++ stable/12/sys/dev/acpica/acpi_lid.c Mon Mar  2 09:09:16 2020
(r358534)
@@ -84,6 +84,27 @@ static devclass_t acpi_lid_devclass;
 DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0);
 MODULE_DEPEND(acpi_lid, acpi, 1, 1, 1);
 
+static void
+acpi_lid_status_update(struct acpi_lid_softc *sc)
+{
+   ACPI_STATUS status;
+   int lid_status;
+
+   ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
+
+   /*
+* Evaluate _LID and check the return value, update lid status.
+*  Zero:   The lid is closed
+*  Non-zero:   The lid is open
+*/
+   status = acpi_GetInteger(sc->lid_handle, "_LID", &lid_status);
+   if (ACPI_FAILURE(status))
+   lid_status = 1; /* assume lid is opened */
+
+   /* range check value */
+   sc->lid_status = lid_status ? 1 : 0;
+}
+
 static int
 acpi_lid_probe(device_t dev)
 {
@@ -122,13 +143,16 @@ acpi_lid_attach(device_t dev)
 if (acpi_parse_prw(sc->lid_handle, &prw) == 0)
AcpiEnableGpe(prw.gpe_handle, prw.gpe_bit);
 
+/* Get the initial lid status */
+acpi_lid_status_update(sc);
+
 /*
  * Export the lid status
  */
 SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"state", CTLFLAG_RD, &sc->lid_status, 0,
-   "Device set to wake the system");
+   "Device state (0 = closed, 1 = open)");
 
 return (0);
 }
@@ -142,6 +166,13 @@ acpi_lid_suspend(device_t dev)
 static int
 acpi_lid_resume(device_t dev)
 {
+struct acpi_lid_softc  *sc;
+
+sc = device_get_softc(dev);
+
+/* Update lid status, if any */
+acpi_lid_status_update(sc);
+
 return (0);
 }
 
@@ -150,21 +181,14 @@ acpi_lid_notify_status_changed(void *arg)
 {
 struct acpi_lid_softc  *sc;
 struct acpi_softc  *acpi_sc;
-ACPI_STATUSstatus;
 
 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
 sc = (struct acpi_lid_softc *)arg;
 ACPI_SERIAL_BEGIN(lid);
 
-/*
- * Evaluate _LID and check the return value, update lid status.
- * Zero:   The lid is closed
- * Non-zero:   The lid is open
- */
-status = acpi_GetInteger(sc->lid_handle, "_LID", &sc->lid_status);
-if (ACPI_FAILURE(status))
-   goto out;
+/* Update lid status, if any */
+acpi_lid_status_update(sc);
 
 acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
 if (acpi_sc == 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: r358439 - head/sys/amd64/include

2020-03-02 Thread Alexander V . Chernikov
28.02.2020, 18:32, "Ryan Libby" :
> Author: rlibby
> Date: Fri Feb 28 18:32:36 2020
> New Revision: 358439
> URL: https://svnweb.freebsd.org/changeset/base/358439
>
> Log:
>   amd64 atomic.h: minor codegen optimization in flag access
>
>   Previously the pattern to extract status flags from inline assembly
>   blocks was to use setcc in the block to write the flag to a register.
>   This was suboptimal in a few ways:
>    - It would lead to code like: sete %cl; test %cl; jne, i.e. a flag
>  would just be loaded into a register and then reloaded to a flag.
>    - The setcc would force the block to use an additional register.
>    - If the client code didn't care for the flag value then the setcc
>  would be entirely pointless but could not be eliminated by the
>  optimizer.
>
>   A more modern inline asm construct (since gcc 6 and clang 9) allows for
This effectively restricts kernel builds by all older compilers.
Is there any chance of making it conditional depending on the compiler 
version/features?
>   "flag output operands", where a C variable can be written directly from
>   a flag. The optimizer can then use this to produce direct code where
>   the flag does not take a trip through a register.
>
>   In practice this makes each affected operation sequence shorter by five
>   bytes of instructions. It's unlikely this has a measurable performance
>   impact.
>
>   Reviewed by: kib, markj, mjg
>   Sponsored by: Dell EMC Isilon
>   Differential Revision: https://reviews.freebsd.org/D23869
>
> Modified:
>   head/sys/amd64/include/atomic.h
>
> Modified: head/sys/amd64/include/atomic.h
> ==
> --- head/sys/amd64/include/atomic.h Fri Feb 28 17:41:46 2020 (r358438)
> +++ head/sys/amd64/include/atomic.h Fri Feb 28 18:32:36 2020 (r358439)
> @@ -201,9 +201,8 @@ atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE
>  __asm __volatile( \
>  " " MPLOCKED " " \
>  " cmpxchg %3,%1 ; " \
> - " sete %0 ; " \
>  "# atomic_cmpset_" #TYPE " " \
> - : "=q" (res), /* 0 */ \
> + : "=@cce" (res), /* 0 */ \
>    "+m" (*dst), /* 1 */ \
>    "+a" (expect) /* 2 */ \
>  : "r" (src) /* 3 */ \
> @@ -219,9 +218,8 @@ atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE
>  __asm __volatile( \
>  " " MPLOCKED " " \
>  " cmpxchg %3,%1 ; " \
> - " sete %0 ; " \
>  "# atomic_fcmpset_" #TYPE " " \
> - : "=q" (res), /* 0 */ \
> + : "=@cce" (res), /* 0 */ \
>    "+m" (*dst), /* 1 */ \
>    "+a" (*expect) /* 2 */ \
>  : "r" (src) /* 3 */ \
> @@ -278,9 +276,8 @@ atomic_testandset_int(volatile u_int *p, u_int v)
>  __asm __volatile(
>  " " MPLOCKED " "
>  " btsl %2,%1 ; "
> - " setc %0 ; "
>  "# atomic_testandset_int"
> - : "=q" (res), /* 0 */
> + : "=@ccc" (res), /* 0 */
>    "+m" (*p) /* 1 */
>  : "Ir" (v & 0x1f) /* 2 */
>  : "cc");
> @@ -295,9 +292,8 @@ atomic_testandset_long(volatile u_long *p, u_int v)
>  __asm __volatile(
>  " " MPLOCKED " "
>  " btsq %2,%1 ; "
> - " setc %0 ; "
>  "# atomic_testandset_long"
> - : "=q" (res), /* 0 */
> + : "=@ccc" (res), /* 0 */
>    "+m" (*p) /* 1 */
>  : "Jr" ((u_long)(v & 0x3f)) /* 2 */
>  : "cc");
> @@ -312,9 +308,8 @@ atomic_testandclear_int(volatile u_int *p, u_int v)
>  __asm __volatile(
>  " " MPLOCKED " "
>  " btrl %2,%1 ; "
> - " setc %0 ; "
>  "# atomic_testandclear_int"
> - : "=q" (res), /* 0 */
> + : "=@ccc" (res), /* 0 */
>    "+m" (*p) /* 1 */
>  : "Ir" (v & 0x1f) /* 2 */
>  : "cc");
> @@ -329,9 +324,8 @@ atomic_testandclear_long(volatile u_long *p, u_int v)
>  __asm __volatile(
>  " " MPLOCKED " "
>  " btrq %2,%1 ; "
> - " setc %0 ; "
>  "# atomic_testandclear_long"
> - : "=q" (res), /* 0 */
> + : "=@ccc" (res), /* 0 */
>    "+m" (*p) /* 1 */
>  : "Jr" ((u_long)(v & 0x3f)) /* 2 */
>  : "cc");
___
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: r358533 - in head: contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2020-03-02 Thread Martin Matuska
Author: mm
Date: Mon Mar  2 08:44:58 2020
New Revision: 358533
URL: https://svnweb.freebsd.org/changeset/base/358533

Log:
  MFV r358511,r358532:
  
  Sync libarchive with vendor.
  
  Relevant vendor changes:
Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
PR #1331: cpio.5: fix hard link description
Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
Issue #1338: XAR reader: fix UBSan warning about undefined behavior
Issue #1339: bsdcpio_test: fix datatype in from_hex()
Issue #1341: Safe writes: delete temporary file if rename fails.
Issue #1341: Safe writes: improve error handling
  
  MFC after:1 week

Added:
  
head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
 - copied unchanged from r358511, 
vendor/libarchive/dist/libarchive/test/test_read_format_zip_lzma_stream_end.zipx.uu
Modified:
  head/contrib/libarchive/cpio/cpio.c
  head/contrib/libarchive/cpio/cpio.h
  head/contrib/libarchive/cpio/test/test_format_newc.c
  head/contrib/libarchive/libarchive/archive_read.c
  head/contrib/libarchive/libarchive/archive_read_open_filename.c
  head/contrib/libarchive/libarchive/archive_read_support_format_xar.c
  head/contrib/libarchive/libarchive/archive_util.c
  head/contrib/libarchive/libarchive/archive_write_disk_posix.c
  head/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  head/contrib/libarchive/libarchive/cpio.5
  head/contrib/libarchive/libarchive/test/test_read_format_zip.c
  head/lib/libarchive/tests/Makefile
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/cpio/cpio.c
==
--- head/contrib/libarchive/cpio/cpio.c Mon Mar  2 08:30:59 2020
(r358532)
+++ head/contrib/libarchive/cpio/cpio.c Mon Mar  2 08:44:58 2020
(r358533)
@@ -737,7 +737,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath
 */
destpath = srcpath;
if (cpio->destdir) {
-   len = strlen(cpio->destdir) + strlen(srcpath) + 8;
+   len = cpio->destdir_len + strlen(srcpath) + 8;
if (len >= cpio->pass_destpath_alloc) {
while (len >= cpio->pass_destpath_alloc) {
cpio->pass_destpath_alloc += 512;
@@ -1228,15 +1228,14 @@ mode_pass(struct cpio *cpio, const char *destdir)
struct lafe_line_reader *lr;
const char *p;
int r;
-   size_t destdir_len;
 
/* Ensure target dir has a trailing '/' to simplify path surgery. */
-   destdir_len = strlen(destdir);
-   cpio->destdir = malloc(destdir_len + 8);
-   memcpy(cpio->destdir, destdir, destdir_len);
-   if (destdir_len == 0 || destdir[destdir_len - 1] != '/')
-   cpio->destdir[destdir_len++] = '/';
-   cpio->destdir[destdir_len++] = '\0';
+   cpio->destdir_len = strlen(destdir);
+   cpio->destdir = malloc(cpio->destdir_len + 8);
+   memcpy(cpio->destdir, destdir, cpio->destdir_len);
+   if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/')
+   cpio->destdir[cpio->destdir_len++] = '/';
+   cpio->destdir[cpio->destdir_len] = '\0';
 
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)

Modified: head/contrib/libarchive/cpio/cpio.h
==
--- head/contrib/libarchive/cpio/cpio.h Mon Mar  2 08:30:59 2020
(r358532)
+++ head/contrib/libarchive/cpio/cpio.h Mon Mar  2 08:44:58 2020
(r358533)
@@ -64,6 +64,7 @@ struct cpio {
int   option_numeric_uid_gid; /* -n */
int   option_rename; /* -r */
char *destdir;
+   size_tdestdir_len;
size_tpass_destpath_alloc;
char *pass_destpath;
int   uid_override;

Modified: head/contrib/libarchive/cpio/test/test_format_newc.c
==
--- head/contrib/libarchive/cpio/test/test_format_newc.cMon Mar  2 
08:30:59 2020(r358532)
+++ head/contrib/libarchive/cpio/test/test_format_newc.cMon Mar  2 
08:44:58 2020(r358533)
@@ -49,10 +49,11 @@ is_hex(const char *p, size_t l)
return (1);
 }
 
-static int
+/* Convert up to 8 hex characters to unsigned 32-bit decimal integer */
+static uint32_t
 from_hex(const char *p, size_t l)
 {
-   int r = 0;
+   uint32_t r = 0;
 
while (l > 0) {
r *= 16;
@@ -82,11 +83,11 @@ DEFINE_TEST(test_format_newc)
 {
FILE *list;
int r;
-   int devmajor, devminor, ino, gid;
-   int uid = -1;
+   uint32_t devmajor, devminor, ino, gid, uid;
time_t t, t2, now;
char *p, *e;
-   size_t s, fs, ns;
+   size_t s;
+   uint64_t fs, ns;

svn commit: r358532 - vendor/libarchive/dist/libarchive

2020-03-02 Thread Martin Matuska
Author: mm
Date: Mon Mar  2 08:30:59 2020
New Revision: 358532
URL: https://svnweb.freebsd.org/changeset/base/358532

Log:
  Update vendor/libarchive/dist to git f001f3b0e6a66a7eb989ed3783791c0316831202
  
  Relevant vendor changes:
Issue #1341: Safe writes: improve error handling

Modified:
  vendor/libarchive/dist/libarchive/archive_util.c
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_disk_windows.c

Modified: vendor/libarchive/dist/libarchive/archive_util.c
==
--- vendor/libarchive/dist/libarchive/archive_util.cMon Mar  2 07:40:08 
2020(r358531)
+++ vendor/libarchive/dist/libarchive/archive_util.cMon Mar  2 08:30:59 
2020(r358532)
@@ -365,6 +365,7 @@ __archive_mktempx(const char *tmpdir, wchar_t *templat
}
fd = _open_osfhandle((intptr_t)h, _O_BINARY | _O_RDWR);
if (fd == -1) {
+   la_dosmaperr(GetLastError());
CloseHandle(h);
goto exit_tmpfile;
} else

Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
==
--- vendor/libarchive/dist/libarchive/archive_write_disk_posix.cMon Mar 
 2 07:40:08 2020(r358531)
+++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.cMon Mar 
 2 08:30:59 2020(r358532)
@@ -1654,7 +1654,6 @@ _archive_write_disk_finish_entry(struct archive *_a)
 {
struct archive_write_disk *a = (struct archive_write_disk *)_a;
int ret = ARCHIVE_OK;
-   int oerrno;
 
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
@@ -1856,12 +1855,10 @@ finish_metadata:
a->fd = -1;
if (a->tmpname) {
if (rename(a->tmpname, a->name) == -1) {
-   oerrno = errno;
-   unlink(a->tmpname);
-   errno = oerrno;
archive_set_error(&a->archive, errno,
-   "Failed to safe write");
-   ret = ARCHIVE_FATAL;
+   "Failed to rename temporary file");
+   ret = ARCHIVE_FAILED;
+   unlink(a->tmpname);
}
a->tmpname = NULL;
}
@@ -2148,8 +2145,11 @@ restore_entry(struct archive_write_disk *a)
if ((a->flags & ARCHIVE_EXTRACT_SAFE_WRITES) &&
S_ISREG(a->st.st_mode)) {
/* Use a temporary file to extract */
-   if ((a->fd = la_mktemp(a)) == -1)
+   if ((a->fd = la_mktemp(a)) == -1) {
+   archive_set_error(&a->archive, errno,
+   "Can't create temporary file");
return ARCHIVE_FAILED;
+   }
a->pst = NULL;
en = 0;
} else {

Modified: vendor/libarchive/dist/libarchive/archive_write_disk_windows.c
==
--- vendor/libarchive/dist/libarchive/archive_write_disk_windows.c  Mon Mar 
 2 07:40:08 2020(r358531)
+++ vendor/libarchive/dist/libarchive/archive_write_disk_windows.c  Mon Mar 
 2 08:30:59 2020(r358532)
@@ -549,6 +549,8 @@ la_mktemp(struct archive_write_disk *a)
a->tmpname = a->_tmpname_data.s;
 
fd = __archive_mkstemp(a->tmpname);
+   if (fd == -1)
+   return -1;
 
mode = a->mode & 0777 & ~a->user_umask;
if (la_chmod(a->tmpname, mode) == -1) {
@@ -1174,7 +1176,6 @@ _archive_write_disk_finish_entry(struct archive *_a)
 {
struct archive_write_disk *a = (struct archive_write_disk *)_a;
int ret = ARCHIVE_OK;
-   int oerrno;
 
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
@@ -1282,12 +1283,11 @@ _archive_write_disk_finish_entry(struct archive *_a)
/* Windows does not support atomic rename */
disk_unlink(a->name);
if (_wrename(a->tmpname, a->name) != 0) {
-   oerrno = errno;
-   disk_unlink(a->tmpname);
-   errno = oerrno;
+   la_dosmaperr(GetLastError());
archive_set_error(&a->archive, errno,
-   "Failed to