Re: svn commit: r359374 - in head: . share/man/man4 share/man/man7 share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe sys/dev/c

2020-04-12 Thread John-Mark Gurney
Alexey Dokuchaev wrote this message on Mon, Apr 13, 2020 at 04:32 +:
> On Sun, Apr 12, 2020 at 01:08:49PM -0700, Xin Li via svn-src-all wrote:
> > On 3/27/20 11:25 AM, John Baldwin wrote:
> > >   - Drivers no longer register a list of supported algorithms. [...]
> > 
> > For user-visible interface, it seems like we are essentially treating
> > "accelerated software" like AES-NI the same way of plain software.  For
> > example, geom_eli would now say:
> > 
> > GEOM_ELI: Encryption: AES-XTS 128
> > GEOM_ELI: Crypto: software
> > 
> > Instead of:
> > 
> > GEOM_ELI: Encryption: AES-XTS 128
> > GEOM_ELI: Crypto: hardware
> > 
> > [...] and it's much easier for system administrators if we expose the
> > fact that they are using some kind of acceleration than asking them to
> > run DTrace etc. to find out.  Personally, I think it's probably better
> > to change the notion to either "accelerated" (by either hardware or
> > software) and "software"...
> 
> +1 for "accelerated" vs. "software".  For most users "accelerated" would
> mean AES-NI (dedicated crypto cards are not as common), and since most
> modern CPUs have those, not being able to easily distinguish between that
> and "pure software" (unaccelerated) mode is rather frustrating.

Yeah, w/o a differentiation, people can't tell if the aesni.ko module
was loaded or not...  I use this to make sure things will go fast.. If
I see software, I know it'll be slow...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r359374 - in head: . share/man/man4 share/man/man7 share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe sys/dev/c

2020-04-12 Thread Alexey Dokuchaev
On Sun, Apr 12, 2020 at 01:08:49PM -0700, Xin Li via svn-src-all wrote:
> On 3/27/20 11:25 AM, John Baldwin wrote:
> >   - Drivers no longer register a list of supported algorithms. [...]
> 
> For user-visible interface, it seems like we are essentially treating
> "accelerated software" like AES-NI the same way of plain software.  For
> example, geom_eli would now say:
> 
> GEOM_ELI: Encryption: AES-XTS 128
> GEOM_ELI: Crypto: software
> 
> Instead of:
> 
> GEOM_ELI: Encryption: AES-XTS 128
> GEOM_ELI: Crypto: hardware
> 
> [...] and it's much easier for system administrators if we expose the
> fact that they are using some kind of acceleration than asking them to
> run DTrace etc. to find out.  Personally, I think it's probably better
> to change the notion to either "accelerated" (by either hardware or
> software) and "software"...

+1 for "accelerated" vs. "software".  For most users "accelerated" would
mean AES-NI (dedicated crypto cards are not as common), and since most
modern CPUs have those, not being able to easily distinguish between that
and "pure software" (unaccelerated) mode is rather frustrating.

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


svn commit: r359840 - head/sys/fs/nfs

2020-04-12 Thread Rick Macklem
Author: rmacklem
Date: Mon Apr 13 00:07:37 2020
New Revision: 359840
URL: https://svnweb.freebsd.org/changeset/base/359840

Log:
  Delete the mbuf macros that were used for the Mac OS/X port.
  
  When the code was ported to Mac OS/X, mbuf handling functions were
  converted to using the Mac OS/X accessor functions. For FreeBSD, they
  are a simple set of macros in sys/fs/nfs/nfskpiport.h.
  Since r359757, r359780, r359785, r359810, r359811 have removed all uses
  of these macros, this patch deleted the macros from the .h files.
  
  My eventual goal is deleting nfskpiport.h, but that will take some more
  editting to replace uses of the remaining macros.

Modified:
  head/sys/fs/nfs/nfskpiport.h
  head/sys/fs/nfs/nfsport.h

Modified: head/sys/fs/nfs/nfskpiport.h
==
--- head/sys/fs/nfs/nfskpiport.hSun Apr 12 22:22:53 2020
(r359839)
+++ head/sys/fs/nfs/nfskpiport.hMon Apr 13 00:07:37 2020
(r359840)
@@ -44,15 +44,6 @@ typedef struct vnode *   vnode_t;
 #definevnode_vtype(v)  ((v)->v_type)
 
 typedef struct mbuf *  mbuf_t;
-#definembuf_freem(m)   m_freem(m)
-#definembuf_data(m)mtod((m), void *)
-#definembuf_len(m) ((m)->m_len)
-#definembuf_next(m)((m)->m_next)
-#definembuf_setlen(m, l)   ((m)->m_len = (l))
-#definembuf_setnext(m, p)  ((m)->m_next = (p))
-#definembuf_pkthdr_len(m)  ((m)->m_pkthdr.len)
-#definembuf_pkthdr_setlen(m, l) ((m)->m_pkthdr.len = (l))
-#definembuf_pkthdr_setrcvif(m, p) ((m)->m_pkthdr.rcvif = (p))
 
 /*
  * This stuff is needed by Darwin for handling the uio structure.

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Sun Apr 12 22:22:53 2020(r359839)
+++ head/sys/fs/nfs/nfsport.h   Mon Apr 13 00:07:37 2020(r359840)
@@ -172,7 +172,6 @@
MGETHDR((m), M_WAITOK, MT_DATA);\
}   \
} while (0)
-#defineNFSMTOD mtod
 
 /*
  * Client side constant for size of a lockowner name.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r359839 - head/sys/sys

2020-04-12 Thread Kyle Evans
Author: kevans
Date: Sun Apr 12 22:22:53 2020
New Revision: 359839
URL: https://svnweb.freebsd.org/changeset/base/359839

Log:
  Bump __FreeBSD_version after r359836, close_range(2)
  
  Reported by:  cy

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSun Apr 12 22:11:29 2020(r359838)
+++ head/sys/sys/param.hSun Apr 12 22:22:53 2020(r359839)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300090  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300091  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r359836 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/file

2020-04-12 Thread Cy Schubert
In message <202004122123.03clnk82073...@repo.freebsd.org>, Kyle Evans 
writes:
> Author: kevans
> Date: Sun Apr 12 21:23:19 2020
> New Revision: 359836
> URL: https://svnweb.freebsd.org/changeset/base/359836
>
> Log:
>   Implement a close_range(2) syscall
>   
>   close_range(min, max, flags) allows for a range of descriptors to be
>   closed. The Python folk have indicated that they would much prefer this
>   interface to closefrom(2), as the case may be that they/someone have specia
> l
>   fds dup'd to higher in the range and they can't necessarily closefrom(min)
>   because they don't want to hit the upper range, but relocating them to lowe
> r
>   isn't necessarily feasible.
>   
>   sys_closefrom has been rewritten to use kern_close_range() using ~0U to
>   indicate closing to the end of the range. This was chosen rather than
>   requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
>   call to kern_close_range for simplicity.
>   
>   The flags argument of close_range(2) is currently unused, so any flags set
>   is currently EINVAL. It was added to the interface in Linux so that future
>   flags could be added for, e.g., "halt on first error" and things of this
>   nature.
>   
>   This patch is based on a syscall of the same design that is expected to be
>   merged into Linux.
>   
>   Reviewed by:kib, markj, vangyzen (all slightly earlier revisions)
>   Differential Revision:  https://reviews.freebsd.org/D21627
>
> Modified:
>   head/include/unistd.h
>   head/lib/libc/sys/Makefile.inc
>   head/lib/libc/sys/Symbol.map
>   head/lib/libc/sys/closefrom.2
>   head/sys/compat/freebsd32/syscalls.master
>   head/sys/kern/capabilities.conf
>   head/sys/kern/kern_descrip.c
>   head/sys/kern/syscalls.master
>   head/sys/sys/syscallsubr.h
>   head/tests/sys/file/closefrom_test.c

A __FreeBSD_version bump should be for ports to test for.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


svn commit: r359837 - in head/sys: compat/freebsd32 kern sys

2020-04-12 Thread Kyle Evans
Author: kevans
Date: Sun Apr 12 21:23:51 2020
New Revision: 359837
URL: https://svnweb.freebsd.org/changeset/base/359837

Log:
  sysent: re-roll after introduction of close_range in r359836

Modified:
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Apr 12 21:23:19 
2020(r359836)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Apr 12 21:23:51 
2020(r359837)
@@ -501,4 +501,5 @@
 #defineFREEBSD32_SYS_shm_rename572
 #defineFREEBSD32_SYS_sigfastblock  573
 #defineFREEBSD32_SYS___realpathat  574
-#defineFREEBSD32_SYS_MAXSYSCALL575
+#defineFREEBSD32_SYS_close_range   575
+#defineFREEBSD32_SYS_MAXSYSCALL576

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Sun Apr 12 21:23:19 
2020(r359836)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Sun Apr 12 21:23:51 
2020(r359837)
@@ -611,4 +611,5 @@ const char *freebsd32_syscallnames[] = {
"shm_rename",   /* 572 = shm_rename */
"sigfastblock", /* 573 = sigfastblock */
"__realpathat", /* 574 = __realpathat */
+   "close_range",  /* 575 = close_range */
 };

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cSun Apr 12 21:23:19 
2020(r359836)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cSun Apr 12 21:23:51 
2020(r359837)
@@ -664,4 +664,5 @@ struct sysent freebsd32_sysent[] = {
{ AS(shm_rename_args), (sy_call_t *)sys_shm_rename, AUE_SHMRENAME, 
NULL, 0, 0, 0, SY_THR_STATIC },  /* 572 = shm_rename */
{ AS(sigfastblock_args), (sy_call_t *)sys_sigfastblock, AUE_NULL, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },  /* 573 = sigfastblock */
{ AS(__realpathat_args), (sy_call_t *)sys___realpathat, AUE_REALPATHAT, 
NULL, 0, 0, 0, SY_THR_STATIC }, /* 574 = __realpathat */
+   { AS(close_range_args), (sy_call_t *)sys_close_range, AUE_NULL, NULL, 
0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 575 = close_range */
 };

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Apr 12 21:23:19 
2020(r359836)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Apr 12 21:23:51 
2020(r359837)
@@ -3374,6 +3374,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
*n_args = 5;
break;
}
+   /* close_range */
+   case 575: {
+   struct close_range_args *p = params;
+   uarg[0] = p->lowfd; /* u_int */
+   uarg[1] = p->highfd; /* u_int */
+   iarg[2] = p->flags; /* int */
+   *n_args = 3;
+   break;
+   }
default:
*n_args = 0;
break;
@@ -9095,6 +9104,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
break;
};
break;
+   /* close_range */
+   case 575:
+   switch(ndx) {
+   case 0:
+   p = "u_int";
+   break;
+   case 1:
+   p = "u_int";
+   break;
+   case 2:
+   p = "int";
+   break;
+   default:
+   break;
+   };
+   break;
default:
break;
};
@@ -10991,6 +11016,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
break;
/* __realpathat */
case 574:
+   if (ndx == 0 || ndx == 1)
+   p = "int";
+   break;
+   /* close_range */
+   case 575:
if (ndx == 0 || ndx == 1)
p = "int";
break;

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Sun Apr 12 21:23:19 2020(r359836)
+++ head/sys/kern/init_sysent.c Sun Apr 12 21:23:51 2020

svn commit: r359836 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/file

2020-04-12 Thread Kyle Evans
Author: kevans
Date: Sun Apr 12 21:23:19 2020
New Revision: 359836
URL: https://svnweb.freebsd.org/changeset/base/359836

Log:
  Implement a close_range(2) syscall
  
  close_range(min, max, flags) allows for a range of descriptors to be
  closed. The Python folk have indicated that they would much prefer this
  interface to closefrom(2), as the case may be that they/someone have special
  fds dup'd to higher in the range and they can't necessarily closefrom(min)
  because they don't want to hit the upper range, but relocating them to lower
  isn't necessarily feasible.
  
  sys_closefrom has been rewritten to use kern_close_range() using ~0U to
  indicate closing to the end of the range. This was chosen rather than
  requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
  call to kern_close_range for simplicity.
  
  The flags argument of close_range(2) is currently unused, so any flags set
  is currently EINVAL. It was added to the interface in Linux so that future
  flags could be added for, e.g., "halt on first error" and things of this
  nature.
  
  This patch is based on a syscall of the same design that is expected to be
  merged into Linux.
  
  Reviewed by:  kib, markj, vangyzen (all slightly earlier revisions)
  Differential Revision:https://reviews.freebsd.org/D21627

Modified:
  head/include/unistd.h
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/Symbol.map
  head/lib/libc/sys/closefrom.2
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/capabilities.conf
  head/sys/kern/kern_descrip.c
  head/sys/kern/syscalls.master
  head/sys/sys/syscallsubr.h
  head/tests/sys/file/closefrom_test.c

Modified: head/include/unistd.h
==
--- head/include/unistd.h   Sun Apr 12 20:54:35 2020(r359835)
+++ head/include/unistd.h   Sun Apr 12 21:23:19 2020(r359836)
@@ -494,6 +494,7 @@ struct crypt_data {
 int acct(const char *);
 int async_daemon(void);
 int check_utility_compat(const char *);
+int close_range(unsigned int, unsigned int, int);
 ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned 
int);
 const char *
 crypt_get_format(void);

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Sun Apr 12 20:54:35 2020
(r359835)
+++ head/lib/libc/sys/Makefile.inc  Sun Apr 12 21:23:19 2020
(r359836)
@@ -371,6 +371,7 @@ MLINKS+=chown.2 fchown.2 \
chown.2 lchown.2
 MLINKS+=clock_gettime.2 clock_getres.2 \
clock_gettime.2 clock_settime.2
+MLINKS+=closefrom.2 close_range.2
 MLINKS+=nanosleep.2 clock_nanosleep.2
 MLINKS+=cpuset.2 cpuset_getid.2 \
cpuset.2 cpuset_setid.2

Modified: head/lib/libc/sys/Symbol.map
==
--- head/lib/libc/sys/Symbol.mapSun Apr 12 20:54:35 2020
(r359835)
+++ head/lib/libc/sys/Symbol.mapSun Apr 12 21:23:19 2020
(r359836)
@@ -403,6 +403,7 @@ FBSD_1.5 {
 
 FBSD_1.6 {
__sysctlbyname;
+   close_range;
copy_file_range;
fhlink;
fhlinkat;

Modified: head/lib/libc/sys/closefrom.2
==
--- head/lib/libc/sys/closefrom.2   Sun Apr 12 20:54:35 2020
(r359835)
+++ head/lib/libc/sys/closefrom.2   Sun Apr 12 21:23:19 2020
(r359836)
@@ -25,11 +25,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 12, 2009
+.Dd April 12, 2020
 .Dt CLOSEFROM 2
 .Os
 .Sh NAME
-.Nm closefrom
+.Nm closefrom ,
+.Nm close_range
 .Nd delete open file descriptors
 .Sh LIBRARY
 .Lb libc
@@ -37,6 +38,8 @@
 .In unistd.h
 .Ft void
 .Fn closefrom "int lowfd"
+.Ft int
+.Fn close_range "u_int lowfd" "u_int highfd" "int flags"
 .Sh DESCRIPTION
 The
 .Fn closefrom
@@ -44,6 +47,40 @@ system call deletes all open file descriptors greater 
 .Fa lowfd
 from the per-process object reference table.
 Any errors encountered while closing file descriptors are ignored.
+.Pp
+The
+.Fn close_range
+system call deletes all open file descriptors between
+.Fa lowfd
+and
+.Fa highfd
+inclusive, clamped to the range of open file descriptors.
+Any errors encountered while closing file descriptors are ignored.
+There are currently no defined
+.Fa flags .
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn close_range
+returns a value
+of 0.
+Otherwise, a value of -1 is returned and the global variable
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+The
+.Fn close_range
+system call
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The
+.Fa highfd
+argument is lower than the
+.Fa lowfd
+argument.
+.It Bq Er EINVAL
+An invalid flag was set.
+.El
 .Sh SEE ALSO
 .Xr close 2
 .Sh HISTORY

Modified: head/sys/compat/freebsd32/syscalls.master

svn commit: r359835 - head/usr.sbin/bsdconfig

2020-04-12 Thread Chris Rees
Author: crees (doc,ports committer)
Date: Sun Apr 12 20:54:35 2020
New Revision: 359835
URL: https://svnweb.freebsd.org/changeset/base/359835

Log:
  Add mention of wireless option in bsdconfig
  
  Submitted by: debdrup
  Approved by:  dteske (maintainer)
  Differential Revision:https://reviews.freebsd.org/D24378

Modified:
  head/usr.sbin/bsdconfig/bsdconfig.8

Modified: head/usr.sbin/bsdconfig/bsdconfig.8
==
--- head/usr.sbin/bsdconfig/bsdconfig.8 Sun Apr 12 19:25:28 2020
(r359834)
+++ head/usr.sbin/bsdconfig/bsdconfig.8 Sun Apr 12 20:54:35 2020
(r359835)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 5, 2013
+.Dd April 12, 2020
 .Dt BSDCONFIG 8
 .Os
 .Sh NAME
@@ -148,8 +148,8 @@ Shortcut to the DNS Nameservers menu under networking.
 .It Cm netdev
 Shortcut to the Network Interfaces menu under networking.
 .It Cm networking
-Utilities to set/change Hostname/Domain, Network Interfaces, Default
-Router/Gateway, and DNS Nameservers.
+Utilities to set/change Hostname/Domain, Network Interfaces, Wireless
+Network, Default Router/Gateway, and DNS Nameservers.
 .It Cm packages
 Browse, install, uninstall, or re-install packaged software.
 .It Cm password
@@ -209,6 +209,8 @@ Shortcut to the Delete Users menu under usermgmt.
 Shortcut to the Edit/View Users menu under usermgmt.
 .It Cm usermgmt
 Utilities to Add/Edit/View/Delete User Accounts.
+.It Cm wireless
+Shortcut to the Wireless Networks menu under networking.
 .El
 .Sh INTERNATIONALIZATION
 i18n features are built into
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r359374 - in head: . share/man/man4 share/man/man7 share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe sys/dev/c

2020-04-12 Thread Xin Li via svn-src-head



On 3/27/20 11:25 AM, John Baldwin wrote:
[...]>   - Drivers no longer register a list of supported algorithms.  This
> doesn't quite work when you factor in modes (e.g. a driver might
> support both AES-CBC and SHA2-256-HMAC separately but not combined
> for ETA).  Instead, a new 'crypto_probesession' method has been
> added to the kobj interface for symmteric crypto drivers.  This
> method returns a negative value on success (similar to how
> device_probe works) and the crypto framework uses this value to pick
> the "best" driver.  There are three constants for hardware
> (e.g. ccr), accelerated software (e.g. aesni), and plain software
> (cryptosoft) that give preference in that order.  One effect of this
> is that if you request only hardware when creating a new session,
> you will no longer get a session using accelerated software.
> Another effect is that the default setting to disallow software
> crypto via /dev/crypto now disables accelerated software.

For user-visible interface, it seems like we are essentially treating
"accelerated software" like AES-NI the same way of plain software.  For
example, geom_eli would now say:

GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI: Crypto: software

Instead of:

GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI: Crypto: hardware

When AES-NI is used (which is because we only have two bits to represent
hardware and software, and have gave neither bits clear with its own
meaning (use specific driver)).

If we are not going to add a new bit to represent accelerated software,
why are they categorized as software providers?  Technically, all these
still requires hardware that implements the cryptographic primitives to
work, and it's much easier for system administrators if we expose the
fact that they are using some kind of acceleration than asking them to
run DTrace etc. to find out.  Personally, I think it's probably better
to change the notion to either "accelerated" (by either hardware or
software) and "software"...

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


Re: svn commit: r359829 - in head/sys: amd64/conf conf

2020-04-12 Thread Mark Millard via svn-src-head
> Author: cem
> Date: Sun Apr 12 18:04:20 2020
> New Revision: 359829
> URL: 
> https://svnweb.freebsd.org/changeset/base/359829
> 
> 
> Log:
>   Add queue(2) debug macros as build options
>   
>   Add QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH as proper kernel
>   options.  While here, alpha-sort the debug section of sys/conf/options.
>   
>   Enable QUEUE_MACRO_DEBUG_TRASH in amd64 GENERIC (but not GENERIC-NODEBUG)
>   kernels.  It is similar in nature and cost to other use-after-free pointer
>   trashing we do in GENERIC.  It is probably reasonable to enable in any arch
>   GENERIC kernel that defines INVARIANTS.

Going the other way: Is QUEUE_MACRO_DEBUG_TRASH unsafe when INVARIANTS
has been disabled?

I historically produce non-debug/less-debug kernels via including GENERIC
and then disabling various debugging options, including frequently
disabling INVARIANTS and INVARIANTS_SUPPORT.

Would the following be appropriate for the comments, with its extra
"required by" on the first line shown:

 optionsINVARIANTS  # Enable calls of extra sanity 
checking, required by QUEUE_MACRO_DEBUG_TRASH
 optionsINVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
 optionsQUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on 
invalidation

Should head/sys/conf/NOTES have material about avoiding
QUEUE_MACRO_DEBUG_TRASH with INVARIANTS disabled?



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

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


svn commit: r359829 - in head/sys: amd64/conf conf

2020-04-12 Thread Conrad Meyer
Author: cem
Date: Sun Apr 12 18:04:20 2020
New Revision: 359829
URL: https://svnweb.freebsd.org/changeset/base/359829

Log:
  Add queue(2) debug macros as build options
  
  Add QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH as proper kernel
  options.  While here, alpha-sort the debug section of sys/conf/options.
  
  Enable QUEUE_MACRO_DEBUG_TRASH in amd64 GENERIC (but not GENERIC-NODEBUG)
  kernels.  It is similar in nature and cost to other use-after-free pointer
  trashing we do in GENERIC.  It is probably reasonable to enable in any arch
  GENERIC kernel that defines INVARIANTS.

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/GENERIC-NODEBUG
  head/sys/conf/NOTES
  head/sys/conf/options

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Sun Apr 12 16:13:05 2020(r359828)
+++ head/sys/amd64/conf/GENERIC Sun Apr 12 18:04:20 2020(r359829)
@@ -96,6 +96,7 @@ options   GDB # Support remote GDB.
 optionsDEADLKRES   # Enable the deadlock resolver
 optionsINVARIANTS  # Enable calls of extra sanity checking
 optionsINVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
+optionsQUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on 
invalidation
 optionsWITNESS # Enable checks to detect deadlocks and 
cycles
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones

Modified: head/sys/amd64/conf/GENERIC-NODEBUG
==
--- head/sys/amd64/conf/GENERIC-NODEBUG Sun Apr 12 16:13:05 2020
(r359828)
+++ head/sys/amd64/conf/GENERIC-NODEBUG Sun Apr 12 18:04:20 2020
(r359829)
@@ -40,3 +40,4 @@ nooptions   FULL_BUF_TRACKING
 nooptions  COVERAGE
 nooptions  KCOV
 nooptions  MALLOC_DEBUG_MAXZONES
+nooptions  QUEUE_MACRO_DEBUG_TRASH

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Sun Apr 12 16:13:05 2020(r359828)
+++ head/sys/conf/NOTES Sun Apr 12 18:04:20 2020(r359829)
@@ -414,6 +414,18 @@ optionsDDB_NUMSYM
 optionsGDB
 
 #
+# Trashes list pointers when they become invalid (i.e., the element is
+# removed from a list).  Relatively inexpensive to enable.
+#
+optionsQUEUE_MACRO_DEBUG_TRASH
+
+#
+# Stores information about the last caller to modify the list object
+# in the list object.  Requires additional memory overhead.
+#
+optionsQUEUE_MACRO_DEBUG_TRACE
+
+#
 # SYSCTL_DEBUG enables a 'sysctl' debug tree that can be used to dump the
 # contents of the registered sysctl nodes on the console.  It is disabled by
 # default because it generates excessively verbose console output that can

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sun Apr 12 16:13:05 2020(r359828)
+++ head/sys/conf/options   Sun Apr 12 18:04:20 2020(r359829)
@@ -55,17 +55,19 @@ DDB_CAPTURE_DEFAULTBUFSIZE  opt_ddb.h
 DDB_CAPTURE_MAXBUFSIZE opt_ddb.h
 DDB_CTFopt_ddb.h
 DDB_NUMSYM opt_ddb.h
+EARLY_PRINTF   opt_global.h
 FULL_BUF_TRACKING  opt_global.h
 GDB
 KDBopt_global.h
 KDB_TRACE  opt_kdb.h
 KDB_UNATTENDED opt_kdb.h
 KLD_DEBUG  opt_kld.h
+NUM_CORE_FILES opt_global.h
+QUEUE_MACRO_DEBUG_TRACEopt_global.h
+QUEUE_MACRO_DEBUG_TRASHopt_global.h
 SYSCTL_DEBUG   opt_sysctl.h
-EARLY_PRINTF   opt_global.h
 TEXTDUMP_PREFERRED opt_ddb.h
 TEXTDUMP_VERBOSE   opt_ddb.h
-NUM_CORE_FILES opt_global.h
 TSLOG  opt_global.h
 TSLOGSIZE  opt_global.h
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r359809 - head/sys/netinet

2020-04-12 Thread Conrad Meyer
Hi Michael,

On Sun, Apr 12, 2020 at 2:33 AM Michael Tuexen  wrote:
> Yes. What I meant is that in the stream scheduler code (sctp_ss_functions.c)
> the pattern is
>
> TAILQ_REMOVE(>ss_data.out.list, sp, ss_next);
> sp->ss_next.tqe_next = NULL;
> sp->ss_next.tqe_prev = NULL;
>
> which I think is OK, since I'm clearing the pointers related to the remove
> operation. Do you agree?

It is harmless in the sense that it is not a functional change, but I
wouldn't suggest doing so.  First, in the location modified,
TAILQ_INSERT immediately subsequent will just overwrite the NULLs.
The compiler almost certainly just optimizes this out.  (If you used
TAILQ_CONCAT instead, you can avoid rewriting the pointer chain in the
linked list entirely and only update heads/tails.)

(By the way, I was mistaken about the queue.h TRASH feature being
included in INVARIANTS kernels — it is instead governed by
QUEUE_MACRO_DEBUG_TRASH.  IMO, we should go ahead and enabled
QUEUE_MACRO_DEBUG_TRASH in GENERIC/INVARIANTS — unlike "TRACE," TRASH
is inexpensive — and it catches use-after-frees.)

Second, generally one should not manipulate the implementation details
of sys/queue.h directly.  In QUEUE_MACRO_DEBUG_TRASH kernels, the
REMOVE operation already stores bogus values in these pointers
("TRASHIT()").

> I totally agree. I'm actually adding more INVARIANTS checks to the SCTP
> code to catch more places where the code does not behave as expected when
> running syzkaller (more on the API testing) and ossfuzz (for the userland
> stack, more on the packet injection side). So you will see more panics
> when using INVARIANTS, for example, now in the timer code. But this points
> me to places I need to look at.

That's good to hear.  I agree it is good to assert/panic more in
INVARIANTS, when invariants are violated — it's why we have it :-).

> > In this use, consider using
> > 'TAILQ_CONCAT(>asoc.strmout[i].outqueue, [i].outqueue,
> > next)' instead of the loop construct.
>
> Thanks for the hint. Wasn't aware of it and didn't consider it more moving 
> over a queue.

No problem.  It is often useful to manipulate entire lists cheaply
rather than individual elements.  Another common pattern is: under a
lock, TAILQ_SWAP the lock-protected list to an initialized (empty)
stack list-head, drop the lock, and clean up the list outside the
lock.

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


svn commit: r359828 - head/tests/sys/netinet

2020-04-12 Thread Kristof Provost
Author: kp
Date: Sun Apr 12 16:13:05 2020
New Revision: 359828
URL: https://svnweb.freebsd.org/changeset/base/359828

Log:
  carp tests: Basic functionality test
  
  Set up three vnet jails, bridged together. Run carp between two of them.
  Attempt to provoke locking / epoch issues.
  
  Reviewed by:  mav (previous version), melifaro, asomers
  Differential Revision:https://reviews.freebsd.org/D24303

Added:
  head/tests/sys/netinet/carp.sh   (contents, props changed)
Modified:
  head/tests/sys/netinet/Makefile

Modified: head/tests/sys/netinet/Makefile
==
--- head/tests/sys/netinet/Makefile Sun Apr 12 16:09:21 2020
(r359827)
+++ head/tests/sys/netinet/Makefile Sun Apr 12 16:13:05 2020
(r359828)
@@ -9,7 +9,7 @@ ATF_TESTS_C=ip_reass_test \
so_reuseport_lb_test \
socket_afinet
 
-ATF_TESTS_SH=  fibs_test redirect divert forward output
+ATF_TESTS_SH=  carp fibs_test redirect divert forward output
 
 PROGS= udp_dontroute tcp_user_cookie
 

Added: head/tests/sys/netinet/carp.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netinet/carp.sh  Sun Apr 12 16:13:05 2020
(r359828)
@@ -0,0 +1,152 @@
+# $FreeBSD$
+#
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
+# Copyright (c) 2020 Kristof Provost 
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+. $(atf_get_srcdir)/../common/vnet.subr
+
+is_master()
+{
+   jail=$1
+   itf=$2
+
+   jexec ${jail} ifconfig ${itf} | grep carp | grep MASTER
+}
+
+wait_for_carp()
+{
+   jail1=$1
+   itf1=$2
+   jail2=$3
+   itf2=$4
+
+   while [ -z "$(is_master ${jail1} ${itf1})" ] &&
+   [ -z "$(is_master ${jail2} ${itf2})" ]; do
+   sleep 1
+   done
+}
+
+atf_test_case "basic_v4" "cleanup"
+basic_v4_head()
+{
+   atf_set descr 'Basic CARP test (IPv4)'
+   atf_set require.user root
+}
+
+basic_v4_body()
+{
+   if ! kldstat -q -m carp; then
+   atf_skip "This test requires carp"
+   fi
+
+   vnet_init
+   bridge=$(vnet_mkbridge)
+   epair_one=$(vnet_mkepair)
+   epair_two=$(vnet_mkepair)
+
+   vnet_mkjail carp_basic_v4_one ${bridge} ${epair_one}a ${epair_two}a
+   vnet_mkjail carp_basic_v4_two ${epair_one}b
+   vnet_mkjail carp_basic_v4_three ${epair_two}b
+
+   jexec carp_basic_v4_one ifconfig ${bridge} 192.0.2.4/29 up
+   jexec carp_basic_v4_one ifconfig ${bridge} addm ${epair_one}a \
+   addm ${epair_two}a
+   jexec carp_basic_v4_one ifconfig ${epair_one}a up
+   jexec carp_basic_v4_one ifconfig ${epair_two}a up
+
+   jexec carp_basic_v4_two ifconfig ${epair_one}b 192.0.2.202/29 up
+   jexec carp_basic_v4_two ifconfig ${epair_one}b add vhid 1 192.0.2.1/29
+
+   jexec carp_basic_v4_three ifconfig ${epair_two}b 192.0.2.203/29 up
+   jexec carp_basic_v4_three ifconfig ${epair_two}b add vhid 1 \
+   192.0.2.1/29
+
+   wait_for_carp carp_basic_v4_two ${epair_one}b \
+   carp_basic_v4_three ${epair_two}b
+
+   atf_check -s exit:0 -o ignore jexec carp_basic_v4_one \
+   ping -c 3 192.0.2.1
+}
+
+basic_v4_cleanup()
+{
+   vnet_cleanup
+}
+
+atf_test_case "basic_v6" "cleanup"
+basic_v6_head()
+{
+   atf_set descr 'Basic CARP test (IPv6)'
+   atf_set require.user root
+}
+
+basic_v6_body()
+{
+   if ! kldstat -q -m carp; then
+   atf_skip "This test requires carp"
+   fi
+
+   vnet_init
+   bridge=$(vnet_mkbridge)
+   epair_one=$(vnet_mkepair)
+   epair_two=$(vnet_mkepair)

svn commit: r359827 - head/sys/netinet

2020-04-12 Thread Kristof Provost
Author: kp
Date: Sun Apr 12 16:09:21 2020
New Revision: 359827
URL: https://svnweb.freebsd.org/changeset/base/359827

Log:
  carp: Widen epoch coverage
  
  Fix panics related to calling code which expects to be running inside
  the NET_EPOCH from outside that epoch.
  
  This leads to panics (with INVARIANTS) such as this one:
  
  panic: Assertion in_epoch(net_epoch_preempt) failed at 
/usr/src/sys/netinet/if_ether.c:373
  cpuid = 7
  time = 1586095719
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 
0xfe0090819700
  vpanic() at vpanic+0x182/frame 0xfe0090819750
  panic() at panic+0x43/frame 0xfe00908197b0
  arprequest_internal() at arprequest_internal+0x59e/frame 
0xfe00908198c0
  arp_announce_ifaddr() at arp_announce_ifaddr+0x20/frame 0xfe00908198e0
  carp_master_down_locked() at carp_master_down_locked+0x10d/frame 
0xfe0090819910
  carp_master_down() at carp_master_down+0x79/frame 0xfe0090819940
  softclock_call_cc() at softclock_call_cc+0x13f/frame 0xfe00908199f0
  softclock() at softclock+0x7c/frame 0xfe0090819a20
  ithread_loop() at ithread_loop+0x279/frame 0xfe0090819ab0
  fork_exit() at fork_exit+0x80/frame 0xfe0090819af0
  fork_trampoline() at fork_trampoline+0xe/frame 0xfe0090819af0
  --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
  
  Widen the NET_EPOCH to cover the relevant (callback / task) code.
  
  Differential Revision:https://reviews.freebsd.org/D24302

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==
--- head/sys/netinet/ip_carp.c  Sun Apr 12 16:06:59 2020(r359826)
+++ head/sys/netinet/ip_carp.c  Sun Apr 12 16:09:21 2020(r359827)
@@ -817,7 +817,9 @@ static void
 carp_send_ad_all(void *ctx __unused, int pending __unused)
 {
struct carp_softc *sc;
+   struct epoch_tracker et;
 
+   NET_EPOCH_ENTER(et);
mtx_lock(_mtx);
LIST_FOREACH(sc, _list, sc_next)
if (sc->sc_state == MASTER) {
@@ -828,6 +830,7 @@ carp_send_ad_all(void *ctx __unused, int pending __unu
CARP_UNLOCK(sc);
}
mtx_unlock(_mtx);
+   NET_EPOCH_EXIT(et);
 }
 
 /* Send a periodic advertisement, executed in callout context. */
@@ -835,12 +838,15 @@ static void
 carp_send_ad(void *v)
 {
struct carp_softc *sc = v;
+   struct epoch_tracker et;
 
+   NET_EPOCH_ENTER(et);
CARP_LOCK_ASSERT(sc);
CURVNET_SET(sc->sc_carpdev->if_vnet);
carp_send_ad_locked(sc);
CURVNET_RESTORE();
CARP_UNLOCK(sc);
+   NET_EPOCH_EXIT(et);
 }
 
 static void
@@ -907,12 +913,12 @@ carp_send_ad_locked(struct carp_softc *sc)
 {
struct carp_header ch;
struct timeval tv;
-   struct epoch_tracker et;
struct ifaddr *ifa;
struct carp_header *ch_ptr;
struct mbuf *m;
int len, advskew;
 
+   NET_EPOCH_ASSERT();
CARP_LOCK_ASSERT(sc);
 
advskew = DEMOTE_ADVSKEW(sc);
@@ -976,10 +982,8 @@ carp_send_ad_locked(struct carp_softc *sc)
 
CARPSTATS_INC(carps_opackets);
 
-   NET_EPOCH_ENTER(et);
carp_send_ad_error(sc, ip_output(m, NULL, NULL, IP_RAWOUTPUT,
>sc_carpdev->if_carp->cif_imo, NULL));
-   NET_EPOCH_EXIT(et);
}
 #endif /* INET */
 #ifdef INET6
@@ -1037,10 +1041,8 @@ carp_send_ad_locked(struct carp_softc *sc)
 
CARPSTATS_INC(carps_opackets6);
 
-   NET_EPOCH_ENTER(et);
carp_send_ad_error(sc, ip6_output(m, NULL, NULL, 0,
>sc_carpdev->if_carp->cif_im6o, NULL, NULL));
-   NET_EPOCH_EXIT(et);
}
 #endif /* INET6 */
 
@@ -1130,6 +1132,8 @@ carp_send_arp(struct carp_softc *sc)
struct ifaddr *ifa;
struct in_addr addr;
 
+   NET_EPOCH_ASSERT();
+
CARP_FOREACH_IFA(sc, ifa) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
@@ -1258,7 +1262,9 @@ static void
 carp_master_down(void *v)
 {
struct carp_softc *sc = v;
+   struct epoch_tracker et;
 
+   NET_EPOCH_ENTER(et);
CARP_LOCK_ASSERT(sc);
 
CURVNET_SET(sc->sc_carpdev->if_vnet);
@@ -1268,12 +1274,14 @@ carp_master_down(void *v)
CURVNET_RESTORE();
 
CARP_UNLOCK(sc);
+   NET_EPOCH_EXIT(et);
 }
 
 static void
 carp_master_down_locked(struct carp_softc *sc, const char *reason)
 {
 
+   NET_EPOCH_ASSERT();
CARP_LOCK_ASSERT(sc);
 
switch (sc->sc_state) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r359826 - head/contrib/llvm-project/clang/lib/CodeGen

2020-04-12 Thread Dimitry Andric
Author: dim
Date: Sun Apr 12 16:06:59 2020
New Revision: 359826
URL: https://svnweb.freebsd.org/changeset/base/359826

Log:
  Merge commit 30588a739 from llvm git (by Erich Keane):
  
Make target features check work with ctor and dtor-
  
The problem was reported in PR45468, applying target features to an
always_inline constructor/destructor runs afoul of GlobalDecl
construction assert when checking for target-feature compatibility.
  
The core problem is fixed by using the version of the check that
takes a FunctionDecl rather than the GlobalDecl. However, while
writing the test, I discovered that source locations weren't properly
set for this check on ctors/dtors. This patch also fixes constructors
and CALLED destructors.
  
Unfortunately, it doesn't seem too possible to get a meaningful
source location for a 'cleanup' destructor, so those are still
'frontend' level errors unfortunately. A fixme was added to the test
to cover that situation.
  
  This should fix 'Assertion failed: (!isa(D) && "Use
  other ctor with ctor decls!"), function Init, file
  /usr/src/contrib/llvm-project/clang/include/clang/AST/GlobalDecl.h, line
  45' when compiling the security/botan2 port.
  
  PR:   245550
  MFC after:6 weeks
  X-MFC-With:   358851

Modified:
  head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp
  head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp
  head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp

Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp
==
--- head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp Sun Apr 12 
15:30:00 2020(r359825)
+++ head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp Sun Apr 12 
16:06:59 2020(r359826)
@@ -2157,7 +2157,7 @@ void CodeGenFunction::EmitCXXConstructorCall(const CXX
   const CGFunctionInfo  = CGM.getTypes().arrangeCXXConstructorCall(
   Args, D, Type, ExtraArgs.Prefix, ExtraArgs.Suffix, PassPrototypeArgs);
   CGCallee Callee = CGCallee::forDirect(CalleePtr, GlobalDecl(D, Type));
-  EmitCall(Info, Callee, ReturnValueSlot(), Args);
+  EmitCall(Info, Callee, ReturnValueSlot(), Args, nullptr, Loc);
 
   // Generate vtable assumptions if we're constructing a complete object
   // with a vtable.  We don't do this for base subobjects for two reasons:

Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp
==
--- head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp   Sun Apr 12 
15:30:00 2020(r359825)
+++ head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp   Sun Apr 12 
16:06:59 2020(r359826)
@@ -112,7 +112,8 @@ RValue CodeGenFunction::EmitCXXDestructorCall(
   commonEmitCXXMemberOrOperatorCall(*this, DtorDecl, This, ImplicitParam,
 ImplicitParamTy, CE, Args, nullptr);
   return EmitCall(CGM.getTypes().arrangeCXXStructorDeclaration(Dtor), Callee,
-  ReturnValueSlot(), Args);
+  ReturnValueSlot(), Args, nullptr,
+  CE ? CE->getExprLoc() : SourceLocation{});
 }
 
 RValue CodeGenFunction::EmitCXXPseudoDestructorExpr(
@@ -380,7 +381,7 @@ RValue CodeGenFunction::EmitCXXMemberOrOperatorMemberC
   IsArrow ? Base->getType()->getPointeeType() : Base->getType();
   EmitCXXDestructorCall(GD, Callee, This.getPointer(*this), ThisTy,
 /*ImplicitParam=*/nullptr,
-/*ImplicitParamTy=*/QualType(), nullptr);
+/*ImplicitParamTy=*/QualType(), CE);
 }
 return RValue::get(nullptr);
   }

Modified: head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp
==
--- head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Sun Apr 
12 15:30:00 2020(r359825)
+++ head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Sun Apr 
12 16:06:59 2020(r359826)
@@ -2324,8 +2324,7 @@ void CodeGenFunction::checkTargetFeatures(SourceLocati
 
 SmallVector ReqFeatures;
 llvm::StringMap CalleeFeatureMap;
-CGM.getContext().getFunctionFeatureMap(CalleeFeatureMap,
-   GlobalDecl(TargetDecl));
+CGM.getContext().getFunctionFeatureMap(CalleeFeatureMap, TargetDecl);
 
 for (const auto  : ParsedAttr.Features) {
   if (F[0] == '+' && CalleeFeatureMap.lookup(F.substr(1)))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r359824 - head/usr.bin/netstat

2020-04-12 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Apr 12 15:16:34 2020
New Revision: 359824
URL: https://svnweb.freebsd.org/changeset/base/359824

Log:
  Fix string format error missed in r359823.

Modified:
  head/usr.bin/netstat/nhops.c

Modified: head/usr.bin/netstat/nhops.c
==
--- head/usr.bin/netstat/nhops.cSun Apr 12 14:30:00 2020
(r359823)
+++ head/usr.bin/netstat/nhops.cSun Apr 12 15:16:34 2020
(r359824)
@@ -219,7 +219,7 @@ nhop_map_update(struct nhop_map *map, uint32_t idx, ch
 
sz = new_size * (sizeof(struct nhop_entry));
if ((map->ptr = realloc(map->ptr, sz)) == NULL)
-   errx(2, "realloc(%lu) failed", sz);
+   errx(2, "realloc(%zu) failed", sz);
 
memset(>ptr[map->size], 0, (new_size - map->size) * 
sizeof(struct nhop_entry));
map->size = new_size;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r359823 - in head: etc/mtree include lib/libc/gen sys/conf sys/net sys/net/route sys/netinet sys/netinet6 sys/sys usr.bin/netstat

2020-04-12 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Apr 12 14:30:00 2020
New Revision: 359823
URL: https://svnweb.freebsd.org/changeset/base/359823

Log:
  Introduce nexthop objects and new routing KPI.
  
  This is the foundational change for the routing subsytem rearchitecture.
   More details and goals are available in https://reviews.freebsd.org/D24141 .
  
  This patch introduces concept of nexthop objects and new nexthop-based
   routing KPI.
  
  Nexthops are objects, containing all necessary information for performing
   the packet output decision. Output interface, mtu, flags, gw address goes
   there. For most of the cases, these objects will serve the same role as
   the struct rtentry is currently serving.
  Typically there will be low tens of such objects for the router even with
   multiple BGP full-views, as these objects will be shared between routing
   entries. This allows to store more information in the nexthop.
  
  New KPI:
  
  struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
uint32_t scopeid, uint32_t flags, uint32_t flowid);
  struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
uint32_t scopeid, uint32_t flags, uint32_t flowid);
  
  These 2 function are intended to replace all all flavours of
   rtalloc[1]<_ign><_fib>, mpath functions  and the previous
   fib[46]-generation functions.
  
  Upon successful lookup, they return nexthop object which is guaranteed to
   exist within current NET_EPOCH. If longer lifetime is desired, one can
   specify NHR_REF as a flag and get a referenced version of the nexthop.
   Reference semantic closely resembles rtentry one, allowing sed-style 
conversion.
  
  Additionally, another 2 functions are introduced to support uRPF functionality
   inside variety of our firewalls. Their primary goal is to hide the multipath
   implementation details inside the routing subsystem, greatly simplifying
   firewalls implementation:
  
  int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
uint32_t flags, const struct ifnet *src_if);
  int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t 
scopeid,
uint32_t flags, const struct ifnet *src_if);
  
  All functions have a separate scopeid argument, paving way to eliminating 
IPv6 scope
   embedding and allowing to support IPv4 link-locals in the future.
  
  Structure changes:
   * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
   * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall 
sz.
  
  Old KPI:
  During the transition state old and new KPI will coexists. As there are 
another 4-5
   decent-sized conversion patches, it will probably take a couple of weeks.
  To support both KPIs, fields not required by the new KPI (most of rtentry) 
has to be
   kept, resulting in the temporary size increase.
  Once conversion is finished, rtentry will notably shrink.
  
  More details:
  * architectural overview: https://reviews.freebsd.org/D24141
  * list of the next changes: https://reviews.freebsd.org/D24232
  
  Reviewed by:  ae,glebius(initial version)
  Differential Revision:https://reviews.freebsd.org/D24232

Added:
  head/sys/net/route/
  head/sys/net/route/nhop.c   (contents, props changed)
  head/sys/net/route/nhop.h   (contents, props changed)
  head/sys/net/route/nhop_ctl.c   (contents, props changed)
  head/sys/net/route/nhop_utils.c   (contents, props changed)
  head/sys/net/route/nhop_utils.h   (contents, props changed)
  head/sys/net/route/nhop_var.h   (contents, props changed)
  head/sys/net/route/route_ctl.c   (contents, props changed)
  head/sys/net/route/route_helpers.c   (contents, props changed)
  head/sys/net/route/shared.h   (contents, props changed)
  head/usr.bin/netstat/common.c   (contents, props changed)
  head/usr.bin/netstat/common.h   (contents, props changed)
  head/usr.bin/netstat/nhops.c   (contents, props changed)
Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/lib/libc/gen/sysctl.3
  head/sys/conf/files
  head/sys/net/radix_mpath.c
  head/sys/net/radix_mpath.h
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/route_var.h
  head/sys/net/rtsock.c
  head/sys/netinet/in_fib.c
  head/sys/netinet/in_fib.h
  head/sys/netinet/in_rmx.c
  head/sys/netinet6/in6_fib.c
  head/sys/netinet6/in6_fib.h
  head/sys/netinet6/in6_rmx.c
  head/sys/sys/socket.h
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Sun Apr 12 09:31:36 2020
(r359822)
+++ head/etc/mtree/BSD.include.dist Sun Apr 12 14:30:00 2020
(r359823)
@@ -208,6 +208,8 @@
 net
 altq
 ..
+route
+..
 ..
 net80211
 ..

Modified: head/include/Makefile

Re: svn commit: r359809 - head/sys/netinet

2020-04-12 Thread Michael Tuexen
> On 11. Apr 2020, at 23:35, Conrad Meyer  wrote:
> 
> Hi Michael,
> 
> On Sat, Apr 11, 2020 at 1:37 PM Michael Tuexen  wrote:
>> 
>> Author: tuexen
>> Date: Sat Apr 11 20:36:54 2020
>> New Revision: 359809
>> URL: https://svnweb.freebsd.org/changeset/base/359809
>> 
>> Log:
>>  Zero out pointers for consistency.
>> 
>>  This was found by running syzkaller on an INVARIANTS kernel.
> 
Hi Conrad,
> For consistency?  If syzkaller found something due to INVARIANTS
Yes. What I meant is that in the stream scheduler code (sctp_ss_functions.c)
the pattern is

TAILQ_REMOVE(>ss_data.out.list, sp, ss_next);
sp->ss_next.tqe_next = NULL;
sp->ss_next.tqe_prev = NULL;

which I think is OK, since I'm clearing the pointers related to the remove
operation. Do you agree?

While looking at the code

TAILQ_FOREACH_SAFE(sp, [i].outqueue, next, nsp) {
TAILQ_REMOVE([i].outqueue, sp, next);
TAILQ_INSERT_TAIL(>asoc.strmout[i].outqueue, sp, next);
}

I observed that I don't clear the pointers after the remove operation.
The intended change was adding

sp->next.tqe_next = NULL;
sp->next.tqe_prev = NULL;

which I guess would be fine. Do you agree?

Due to a copy/paste error the change was (but not intended) adding

sp->ss_next.tqe_next = NULL;
sp->ss_next.tqe_prev = NULL;

Unfortunately testing this incorrect and unintended fix, resolved the
kernel panic. BTW, the intended fix doesn't fix the panic.

Therefore I've reverted the fix: 
https://svnweb.freebsd.org/changeset/base/359822

Thanks a lot for making me aware of my mistake!
> sys/queue.h debugging trashing the pointer values, masking them by
> writing zeroes doesn't help.  Generally, defeating the kernel's
> INVARIANTS system is not wise or useful.
I totally agree. I'm actually adding more INVARIANTS checks to the SCTP
code to catch more places where the code does not behave as expected when
running syzkaller (more on the API testing) and ossfuzz (for the userland
stack, more on the packet injection side). So you will see more panics
when using INVARIANTS, for example, now in the timer code. But this points
me to places I need to look at.
> 
> In this use, consider using
> 'TAILQ_CONCAT(>asoc.strmout[i].outqueue, [i].outqueue,
> next)' instead of the loop construct.
Thanks for the hint. Wasn't aware of it and didn't consider it more moving over 
a queue.

Best regards
Michael
> 
> Conrad

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


svn commit: r359822 - head/sys/netinet

2020-04-12 Thread Michael Tuexen
Author: tuexen
Date: Sun Apr 12 09:31:36 2020
New Revision: 359822
URL: https://svnweb.freebsd.org/changeset/base/359822

Log:
  Revert https://svnweb.freebsd.org/changeset/base/359809
  
  The intended change was
sp->next.tqe_next = NULL;
sp->next.tqe_prev = NULL;
  which doesn't fix the issue I'm seeing and the committed fix is
  not the intended fix due to copy-and-paste.
  
  Thanks a lot to Conrad Meyer for making me aware of the problem.
  
  Reported by:  cem

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sun Apr 12 06:01:03 2020
(r359821)
+++ head/sys/netinet/sctp_output.c  Sun Apr 12 09:31:36 2020
(r359822)
@@ -12275,8 +12275,6 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
/* now anything on those queues? */
TAILQ_FOREACH_SAFE(sp, [i].outqueue, next, 
nsp) {
TAILQ_REMOVE([i].outqueue, sp, next);
-   sp->ss_next.tqe_next = NULL;
-   sp->ss_next.tqe_prev = NULL;

TAILQ_INSERT_TAIL(>asoc.strmout[i].outqueue, sp, next);
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"