svn commit: r360653 - in stable: 11/share/man/man9 12/share/man/man9

2020-05-04 Thread John Baldwin
Author: jhb
Date: Tue May  5 04:42:47 2020
New Revision: 360653
URL: https://svnweb.freebsd.org/changeset/base/360653

Log:
  MFC 357062: Correct the return types of fueword*().

Modified:
  stable/11/share/man/man9/fetch.9
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/share/man/man9/fetch.9
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/share/man/man9/fetch.9
==
--- stable/11/share/man/man9/fetch.9Tue May  5 04:37:05 2020
(r360652)
+++ stable/11/share/man/man9/fetch.9Tue May  5 04:42:47 2020
(r360653)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 29, 2014
+.Dd January 23, 2020
 .Dt FETCH 9
 .Os
 .Sh NAME
@@ -62,11 +62,11 @@
 .Fn fuword32 "volatile const void *base"
 .Ft int64_t
 .Fn fuword64 "volatile const void *base"
-.Ft long
+.Ft int
 .Fn fueword "volatile const void *base" "long *val"
-.Ft int32_t
+.Ft int
 .Fn fueword32 "volatile const void *base" "int32_t *val"
-.Ft int64_t
+.Ft int
 .Fn fueword64 "volatile const void *base" "int64_t *val"
 .In sys/resourcevar.h
 .Ft int
___
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: r360653 - in stable: 11/share/man/man9 12/share/man/man9

2020-05-04 Thread John Baldwin
Author: jhb
Date: Tue May  5 04:42:47 2020
New Revision: 360653
URL: https://svnweb.freebsd.org/changeset/base/360653

Log:
  MFC 357062: Correct the return types of fueword*().

Modified:
  stable/12/share/man/man9/fetch.9
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man9/fetch.9
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/share/man/man9/fetch.9
==
--- stable/12/share/man/man9/fetch.9Tue May  5 04:37:05 2020
(r360652)
+++ stable/12/share/man/man9/fetch.9Tue May  5 04:42:47 2020
(r360653)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 17, 2018
+.Dd January 23, 2020
 .Dt FETCH 9
 .Os
 .Sh NAME
@@ -61,11 +61,11 @@
 .Fn fuword32 "volatile const void *base"
 .Ft int64_t
 .Fn fuword64 "volatile const void *base"
-.Ft long
+.Ft int
 .Fn fueword "volatile const void *base" "long *val"
-.Ft int32_t
+.Ft int
 .Fn fueword32 "volatile const void *base" "int32_t *val"
-.Ft int64_t
+.Ft int
 .Fn fueword64 "volatile const void *base" "int64_t *val"
 .In sys/resourcevar.h
 .Sh DESCRIPTION
___
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: r360652 - stable/12/sys/opencrypto

2020-05-04 Thread John Baldwin
Author: jhb
Date: Tue May  5 04:37:05 2020
New Revision: 360652
URL: https://svnweb.freebsd.org/changeset/base/360652

Log:
  MFC 356508: Use falloc_noinstall + finstall for crypto file descriptors.

Modified:
  stable/12/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/opencrypto/cryptodev.c
==
--- stable/12/sys/opencrypto/cryptodev.cTue May  5 04:25:25 2020
(r360651)
+++ stable/12/sys/opencrypto/cryptodev.cTue May  5 04:37:05 2020
(r360652)
@@ -1498,20 +1498,21 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data
 
switch (cmd) {
case CRIOGET:
+   error = falloc_noinstall(td, );
+   if (error)
+   break;
+
fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO);
TAILQ_INIT(>csessions);
mtx_init(>lock, "fcrypt", NULL, MTX_DEF);
 
-   error = falloc(td, , , 0);
-
+   finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, );
+   error = finstall(td, f, , 0, NULL);
if (error) {
mtx_destroy(>lock);
free(fcr, M_XDATA);
-   return (error);
-   }
-   /* falloc automatically provides an extra reference to 'f'. */
-   finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, );
-   *(u_int32_t *)data = fd;
+   } else
+   *(uint32_t *)data = fd;
fdrop(f, td);
break;
case CRIOFINDDEV:
___
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: r360651 - stable/12/usr.sbin/bhyve

2020-05-04 Thread John Baldwin
Author: jhb
Date: Tue May  5 04:25:25 2020
New Revision: 360651
URL: https://svnweb.freebsd.org/changeset/base/360651

Log:
  MFC 355683: Don't call into the debug server if it isn't configured.

Modified:
  stable/12/usr.sbin/bhyve/bhyverun.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/bhyverun.c
==
--- stable/12/usr.sbin/bhyve/bhyverun.c Tue May  5 00:58:03 2020
(r360650)
+++ stable/12/usr.sbin/bhyve/bhyverun.c Tue May  5 04:25:25 2020
(r360651)
@@ -169,6 +169,7 @@ char *guest_uuid_str;
 
 int raw_stdio = 0;
 
+static int gdb_port = 0;
 static int guest_vmexit_on_hlt, guest_vmexit_on_pause;
 static int virtio_msix = 1;
 static int x2apic_mode = 0;/* default is xAPIC */
@@ -418,7 +419,8 @@ fbsdrun_start_thread(void *param)
snprintf(tname, sizeof(tname), "vcpu %d", vcpu);
pthread_set_name_np(mtp->mt_thr, tname);
 
-   gdb_cpu_add(vcpu);
+   if (gdb_port != 0)
+   gdb_cpu_add(vcpu);
 
vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip);
 
@@ -692,8 +694,11 @@ vmexit_mtrap(struct vmctx *ctx, struct vm_exit *vmexit
 
stats.vmexit_mtrap++;
 
+   if (gdb_port == 0) {
+   fprintf(stderr, "vm_loop: unexpected VMEXIT_MTRAP\n");
+   exit(4);
+   }
gdb_cpu_mtrap(*pvcpu);
-
return (VMEXIT_CONTINUE);
 }
 
@@ -772,6 +777,10 @@ static int
 vmexit_debug(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
 {
 
+   if (gdb_port == 0) {
+   fprintf(stderr, "vm_loop: unexpected VMEXIT_DEBUG\n");
+   exit(4);
+   }
gdb_cpu_suspend(*pvcpu);
return (VMEXIT_CONTINUE);
 }
___
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: r360650 - head/sys/fs/nfs

2020-05-04 Thread Rick Macklem
Author: rmacklem
Date: Tue May  5 00:58:03 2020
New Revision: 360650
URL: https://svnweb.freebsd.org/changeset/base/360650

Log:
  Revert r360514, to avoid unnecessary churn of the sources.
  
  r360514 prepared the NFS code for changes to handle ext_pgs mbufs on
  the receive side. However, at this time, KERN_TLS does not pass
  ext_pgs mbufs up through soreceive(). As such, as this time, only
  the send/build side of the NFS mbuf code needs to handle ext_pgs mbufs.
  Revert r360514 since the rather extensive changes required for receive
  side ext_pgs mbufs are not yet needed.
  This avoids unnecessary churn of the sources.

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfs_var.h

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cTue May  5 00:08:41 2020
(r360649)
+++ head/sys/fs/nfs/nfs_commonsubs.cTue May  5 00:58:03 2020
(r360650)
@@ -229,8 +229,6 @@ static void nfsrv_removeuser(struct nfsusrgrp *usrp, i
 static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **,
 int *, int *);
 static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *);
-static int nfsm_copyfrommbuf(struct nfsrv_descript *, char *, enum uio_seg,
-int);
 
 static struct {
int op;
@@ -703,49 +701,52 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho
caddr_t retp;
 
retp = NULL;
-   left = mtod(nd->nd_md, char *) + nd->nd_md->m_len -
-   nd->nd_dpos;
+   left = mtod(nd->nd_md, caddr_t) + nd->nd_md->m_len - nd->nd_dpos;
while (left == 0) {
-   if (!nfsm_shiftnext(nd, ))
-   return (NULL);
+   nd->nd_md = nd->nd_md->m_next;
+   if (nd->nd_md == NULL)
+   return (retp);
+   left = nd->nd_md->m_len;
+   nd->nd_dpos = mtod(nd->nd_md, caddr_t);
}
if (left >= siz) {
retp = nd->nd_dpos;
nd->nd_dpos += siz;
+   } else if (nd->nd_md->m_next == NULL) {
+   return (retp);
} else if (siz > ncl_mbuf_mhlen) {
panic("nfs S too big");
} else {
-   /* Allocate a new mbuf for the "siz" bytes of data. */
MGET(mp2, MT_DATA, how);
if (mp2 == NULL)
return (NULL);
-
-   /*
-* Link the new mp2 mbuf into the list then copy left
-* bytes from the mbuf before it and siz - left bytes
-* from the mbuf(s) after it.
-*/
mp2->m_next = nd->nd_md->m_next;
nd->nd_md->m_next = mp2;
nd->nd_md->m_len -= left;
-   retp = p = mtod(mp2, char *);
-   memcpy(p, nd->nd_dpos, left);   /* Copy what was left */
+   nd->nd_md = mp2;
+   retp = p = mtod(mp2, caddr_t);
+   NFSBCOPY(nd->nd_dpos, p, left); /* Copy what was left */
siz2 = siz - left;
p += left;
-   mp2->m_len = siz;
-   nd->nd_md = mp2->m_next;
+   mp2 = mp2->m_next;
/* Loop around copying up the siz2 bytes */
while (siz2 > 0) {
-   if (nd->nd_md == NULL)
+   if (mp2 == NULL)
return (NULL);
-   nfsm_set(nd, 0, false);
-   xfer = nfsm_copyfrommbuf(nd, p,
-   UIO_SYSSPACE, siz2);
-   p += xfer;
-   siz2 -= xfer;
+   xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2;
+   if (xfer > 0) {
+   NFSBCOPY(mtod(mp2, caddr_t), p, xfer);
+   mp2->m_data += xfer;
+   mp2->m_len -= xfer;
+   p += xfer;
+   siz2 -= xfer;
+   }
if (siz2 > 0)
-   nd->nd_md = nd->nd_md->m_next;
+   mp2 = mp2->m_next;
}
+   nd->nd_md->m_len = siz;
+   nd->nd_md = mp2;
+   nd->nd_dpos = mtod(mp2, caddr_t);
}
return (retp);
 }
@@ -4824,76 +4825,5 @@ nfsv4_findmirror(struct nfsmount *nmp)
}
}
return (ds);
-}
-
-/*
- * Fill in the fields of "struct nfsrv_descript" for a new ext_pgs mbuf.
- * The build argument is true for build and false for dissect.
- */
-int
-nfsm_set(struct nfsrv_descript *nd, u_int offs, bool build)
-{
-   struct mbuf *m;
-   int rlen;
-
-   if (build)
-   m = nd->nd_mb;
-   else
-   m = nd->nd_md;
-   if (build) {
-   nd->nd_bpos = mtod(m, char *) + offs;
- 

svn commit: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti...

2020-05-04 Thread John Baldwin
Author: jhb
Date: Tue May  5 00:02:04 2020
New Revision: 360648
URL: https://svnweb.freebsd.org/changeset/base/360648

Log:
  Initial support for bhyve save and restore.
  
  Save and restore (also known as suspend and resume) permits a snapshot
  to be taken of a guest's state that can later be resumed.  In the
  current implementation, bhyve(8) creates a UNIX domain socket that is
  used by bhyvectl(8) to send a request to save a snapshot (and
  optionally exit after the snapshot has been taken).  A snapshot
  currently consists of two files: the first holds a copy of guest RAM,
  and the second file holds other guest state such as vCPU register
  values and device model state.
  
  To resume a guest, bhyve(8) must be started with a matching pair of
  command line arguments to instantiate the same set of device models as
  well as a pointer to the saved snapshot.
  
  While the current implementation is useful for several uses cases, it
  has a few limitations.  The file format for saving the guest state is
  tied to the ABI of internal bhyve structures and is not
  self-describing (in that it does not communicate the set of device
  models present in the system).  In addition, the state saved for some
  device models closely matches the internal data structures which might
  prove a challenge for compatibility of snapshot files across a range
  of bhyve versions.  The file format also does not currently support
  versioning of individual chunks of state.  As a result, the current
  file format is not a fixed binary format and future revisions to save
  and restore will break binary compatiblity of snapshot files.  The
  goal is to move to a more flexible format that adds versioning,
  etc. and at that point to commit to providing a reasonable level of
  compatibility.  As a result, the current implementation is not enabled
  by default.  It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
  for userland builds, and the kernel option BHYVE_SHAPSHOT.
  
  Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
  Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
  Relnotes: yes
  Sponsored by: University Politehnica of Bucharest
  Sponsored by: Matthew Grooms (student scholarships)
  Sponsored by: iXsystems
  Differential Revision:https://reviews.freebsd.org/D19495

Added:
  head/sys/amd64/include/vmm_snapshot.h   (contents, props changed)
  head/sys/amd64/vmm/vmm_snapshot.c   (contents, props changed)
  head/tools/build/options/WITH_BHYVE_SNAPSHOT   (contents, props changed)
  head/usr.sbin/bhyve/snapshot.c   (contents, props changed)
  head/usr.sbin/bhyve/snapshot.h   (contents, props changed)
Modified:
  head/lib/libvmmapi/vmmapi.c
  head/lib/libvmmapi/vmmapi.h
  head/share/man/man5/src.conf.5
  head/share/mk/src.opts.mk
  head/sys/amd64/include/vmm.h
  head/sys/amd64/include/vmm_dev.h
  head/sys/amd64/vmm/amd/svm.c
  head/sys/amd64/vmm/amd/svm.h
  head/sys/amd64/vmm/amd/svm_msr.c
  head/sys/amd64/vmm/amd/vmcb.c
  head/sys/amd64/vmm/amd/vmcb.h
  head/sys/amd64/vmm/intel/vmcs.c
  head/sys/amd64/vmm/intel/vmcs.h
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/io/vatpic.c
  head/sys/amd64/vmm/io/vatpic.h
  head/sys/amd64/vmm/io/vatpit.c
  head/sys/amd64/vmm/io/vatpit.h
  head/sys/amd64/vmm/io/vhpet.c
  head/sys/amd64/vmm/io/vhpet.h
  head/sys/amd64/vmm/io/vioapic.c
  head/sys/amd64/vmm/io/vioapic.h
  head/sys/amd64/vmm/io/vlapic.c
  head/sys/amd64/vmm/io/vlapic.h
  head/sys/amd64/vmm/io/vpmtmr.c
  head/sys/amd64/vmm/io/vpmtmr.h
  head/sys/amd64/vmm/io/vrtc.c
  head/sys/amd64/vmm/io/vrtc.h
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_dev.c
  head/sys/conf/config.mk
  head/sys/conf/kern.opts.mk
  head/sys/conf/options.amd64
  head/sys/modules/vmm/Makefile
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/Makefile.depend
  head/usr.sbin/bhyve/atkbdc.c
  head/usr.sbin/bhyve/atkbdc.h
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/bhyverun.h
  head/usr.sbin/bhyve/block_if.c
  head/usr.sbin/bhyve/block_if.h
  head/usr.sbin/bhyve/mevent.c
  head/usr.sbin/bhyve/pci_ahci.c
  head/usr.sbin/bhyve/pci_e82545.c
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/pci_emul.h
  head/usr.sbin/bhyve/pci_fbuf.c
  head/usr.sbin/bhyve/pci_lpc.c
  head/usr.sbin/bhyve/pci_virtio_block.c
  head/usr.sbin/bhyve/pci_virtio_net.c
  head/usr.sbin/bhyve/pci_xhci.c
  head/usr.sbin/bhyve/ps2kbd.c
  head/usr.sbin/bhyve/ps2kbd.h
  head/usr.sbin/bhyve/ps2mouse.c
  head/usr.sbin/bhyve/ps2mouse.h
  head/usr.sbin/bhyve/uart_emul.c
  head/usr.sbin/bhyve/uart_emul.h
  head/usr.sbin/bhyve/usb_emul.h
  head/usr.sbin/bhyve/usb_mouse.c
  head/usr.sbin/bhyve/virtio.c
  head/usr.sbin/bhyve/virtio.h
  head/usr.sbin/bhyvectl/Makefile
  head/usr.sbin/bhyvectl/bhyvectl.8
  head/usr.sbin/bhyvectl/bhyvectl.c

Modified: head/lib/libvmmapi/vmmapi.c
==
--- head/lib/libvmmapi/vmmapi.c Mon May  4 

svn commit: r360645 - head/sys/netinet/tcp_stacks

2020-05-04 Thread Michael Tuexen
Author: tuexen
Date: Mon May  4 23:05:11 2020
New Revision: 360645
URL: https://svnweb.freebsd.org/changeset/base/360645

Log:
  Add net epoch support back, which was taken out by accident in
  https://svnweb.freebsd.org/changeset/base/360639
  
  Reviewed by:  rrs
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24694

Modified:
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Mon May  4 23:02:58 2020
(r360644)
+++ head/sys/netinet/tcp_stacks/rack.c  Mon May  4 23:05:11 2020
(r360645)
@@ -12012,6 +12012,7 @@ rack_output(struct tcpcb *tp)
hw_tls = (so->so_snd.sb_flags & SB_TLS_IFNET) != 0;
 #endif
 
+   NET_EPOCH_ASSERT();
INP_WLOCK_ASSERT(inp);
 #ifdef TCP_OFFLOAD
if (tp->t_flags & TF_TOE)
@@ -14212,6 +14213,7 @@ static int
 rack_set_sockopt(struct socket *so, struct sockopt *sopt,
 struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack)
 {
+   struct epoch_tracker et;
uint64_t val;
int32_t error = 0, optval;
uint16_t ca, ss;
@@ -14719,7 +14721,9 @@ rack_set_sockopt(struct socket *so, struct sockopt *so
if (tp->t_flags & TF_DELACK) {
tp->t_flags &= ~TF_DELACK;
tp->t_flags |= TF_ACKNOW;
+   NET_EPOCH_ENTER(et);
rack_output(tp);
+   NET_EPOCH_EXIT(et);
}
break;
 
___
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: r360644 - head/sys/netinet/tcp_stacks

2020-05-04 Thread Randall Stewart
Author: rrs
Date: Mon May  4 23:02:58 2020
New Revision: 360644
URL: https://svnweb.freebsd.org/changeset/base/360644

Log:
  This fixes two issues found by ankitrahej...@gmail.com
  1) When BBR retransmits the syn it was messing up the snd_max
  2) When we need to send a RST we might not send it when we should
  
  Reported by:  ankitrahej...@gmail.com
  Sponsored by:  Netflix.com
  Differential Revision: https://reviews.freebsd.org/D24693

Modified:
  head/sys/netinet/tcp_stacks/bbr.c

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 22:59:39 2020
(r360643)
+++ head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 23:02:58 2020
(r360644)
@@ -12159,6 +12159,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva
recwin = min(max(sbspace(>so_rcv), 0),
TCP_MAXWIN << tp->rcv_scale);
if ((bbr_window_update_needed(tp, so, recwin, maxseg) 
== 0) &&
+   ((tcp_outflags[tp->t_state] & TH_RST) == 0) &&
((sbavail(sb) + ((tcp_outflags[tp->t_state] & 
TH_FIN) ? 1 : 0)) <=
(tp->snd_max - tp->snd_una))) {
/*
@@ -12916,9 +12917,13 @@ recheck_resend:
if (tp->t_flags & TF_ACKNOW) {
goto send;
}
-   if (((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) {
+   if (flags & TH_RST) {
+   /* Always send a RST if one is due */
goto send;
}
+   if ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0) {
+   goto send;
+   }
/*
 * If our state indicates that FIN should be sent and we have not
 * yet done so, then we need to send.
@@ -14029,7 +14034,11 @@ out:
}
if (flags & (TH_SYN | TH_FIN) && (rsm == NULL)) {
if (flags & TH_SYN) {
-   tp->snd_max++;
+   /*
+* Smack the snd_max to iss + 1
+* if its a FO we will add len below.
+*/
+   tp->snd_max = tp->iss + 1;
}
if ((flags & TH_FIN) && ((tp->t_flags & TF_SENTFIN) == 
0)) {
tp->snd_max++;
___
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: r360643 - in stable/11: . gnu/lib gnu/lib/libgcc lib lib/libgcc_eh lib/libgcc_s

2020-05-04 Thread Dimitry Andric
Author: dim
Date: Mon May  4 22:59:39 2020
New Revision: 360643
URL: https://svnweb.freebsd.org/changeset/base/360643

Log:
  Merge additions of LLVM libunwind libgcc_eh and libgcc_s. This is in
  preparation of further LLVM merges.
  
  MFC r307230 (by emaste):
  
  Introduce lib/libgcc_eh and lib/libgcc_s for LLVM's implementation
  
  They are not yet connected to the build, but I am adding them to allow
  for easier testing, ports exp-runs, etc.
  
  Reviewed by:  ed
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8188
  
  MFC r307231 (by emaste):
  
  libgcc_s: add libm dependencies from div{d,s,x}c3
  
  compiler-rt's complex division support routines contain calls to
  compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
  turns these back into a call to `scalbnl`.
  
  For now link libm's C version of the required support routines.
  
  Reviewed by:  ed
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8190
  
  MFC r307864 (by emaste):
  
  Move the LLVM-based libgcc_s to /lib
  
  When enabled, it should install in the same location as the existing
  library.
  
  Reported by:  antoine
  
  MFC r308001 (by emaste):
  
  libgcc_eh/libgcc_s: apply hidden visibility only to static libs
  
  MFC r308100 (by emaste):
  
  compile libunwind c source with -fexceptions
  
  When an exception is thrown the unwinder must unwind its own C source
  (starting with _Unwind_RaiseException in UnwindLevel1.c), so it needs to
  be built with unwinding data.
  
  MFC r308294 (by emaste):
  
  libgcc_s: make unspecified shlib symbols local
  
  We want only symbols explicitly specified in the Version.map.
  
  Sponsored by: The FreeBSD Foundation
  
  MFC r308308 (by emaste):
  
  Connect new LLVM-based libgcc_eh & libgcc_s to the build
  
  Compiler-rt and LLVM's libunwind provide a suitable replacement for
  libgcc.a, libgcc_eh.a, and libgcc_s.so.
  
  Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.
  
  PR:   213480 [exp-run]
  Reviewed by:  brooks, ed
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8189
  
  MFC r308379 (by emaste):
  
  add __divdi3 and __udivdi3 to libgcc_s symbol version map
  
  After r308294 they were missing on i386 (and previously were exported
  only accidentally).
  
  Reported by:  antoine
  
  MFC r308445 (by emaste):
  
  add missing i386 symbols libgcc_s symbol version map
  
  After r308294 they were missing on i386 (and previously were exported
  only accidentally).
  
  Reported by:  antoine
  
  MFC r312076 (by emaste):
  
  libgcc_s: add libc DT_NEEDED to fix underlinking
  
  PR:   216012
  Reported by:  jbeich
  Sponsored by: The FreeBSD Foundation
  
  MFC r316101 (by ngie):
  
  Apply r315689 to lib/libgcc_s as well to unbreak the gcc xtoolchain build
  
  lib/libgcc_s consumes lib/libcompiler_rt/Makefile*. The NO_WERROR.gcc in
  lib/libcompiler_rt/Makefile doesn't seem to have made a difference in being
  able to build this, so sprinkle NO_WERROR.gcc here as well.
  
  Reported by:  Jenkins (FreeBSD-head-amd64-gcc)
  Tested with:  amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
  Sponsored by: Dell EMC Isilon
  
  MFC r320673 (by emaste):
  
  Sort entries in libgcc_s Version.map
  
  MFC r337585 (by dim):
  
  In r308100, an explicit -fexceptions flag was added for the C sources
  from LLVM's libunwind, which end up in libgcc_eh.a and libgcc_s.so.
  This is because the unwinder needs the unwinder data for its own
  functions.
  
  However, for the C++ sources in libunwind, -fexceptions is already the
  default, and this can have the side effect of generating a reference to
  __gxx_personality_v0, the so-called personality function, which is
  normally provided by the C++ ABI library (libcxxrt or libsupc++).
  
  If the reference ends up in the eventual libgcc_s.so, linking any
  non-C++ programs against it will fail with "undefined reference to
  `__gxx_personality_v0'".
  
  Note that at high optimization levels, the reference is usually
  optimized away, which is why we have never noticed this problem before.
  
  With clang 7.0.0 though, higher optimization levels don't help anymore,
  since the addition of address-significance tables [1] in
  .  Effectively, this always causes a
  reference to __gxx_personality_v0.
  
  After discussion with the upstream author of that change, it turns out
  that we should compile libunwind sources with the -fno-exceptions
  -funwind-tables flags instead.  This ensures unwind tables are
  generated, but no references to any personality functions are emitted.
  
  [1] https://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html
  
  Reported by:  jbeich
  PR:   230399

Added:
  stable/11/lib/libgcc_eh/
 - copied from r307230, head/lib/libgcc_eh/
  stable/11/lib/libgcc_s/
 - copied from 

svn commit: r360642 - head/sys/opencrypto

2020-05-04 Thread John Baldwin
Author: jhb
Date: Mon May  4 22:31:38 2020
New Revision: 360642
URL: https://svnweb.freebsd.org/changeset/base/360642

Log:
  Use a lookup table of algorithm types for alg_is_* helpers.
  
  This makes it easier to maintain these functions as algorithms are
  added or removed.
  
  Reviewed by:  cem
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D24668

Modified:
  head/sys/opencrypto/crypto.c

Modified: head/sys/opencrypto/crypto.c
==
--- head/sys/opencrypto/crypto.cMon May  4 22:02:49 2020
(r360641)
+++ head/sys/opencrypto/crypto.cMon May  4 22:31:38 2020
(r360642)
@@ -684,85 +684,96 @@ crypto_select_driver(const struct crypto_session_param
return best;
 }
 
+static enum alg_type {
+   ALG_NONE = 0,
+   ALG_CIPHER,
+   ALG_DIGEST,
+   ALG_KEYED_DIGEST,
+   ALG_COMPRESSION,
+   ALG_AEAD
+} alg_types[] = {
+   [CRYPTO_DES_CBC] = ALG_CIPHER,
+   [CRYPTO_3DES_CBC] = ALG_CIPHER,
+   [CRYPTO_BLF_CBC] = ALG_CIPHER,
+   [CRYPTO_CAST_CBC] = ALG_CIPHER,
+   [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER,
+   [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_MD5_KPDK] = ALG_KEYED_DIGEST,
+   [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST,
+   [CRYPTO_AES_CBC] = ALG_CIPHER,
+   [CRYPTO_ARC4] = ALG_CIPHER,
+   [CRYPTO_MD5] = ALG_DIGEST,
+   [CRYPTO_SHA1] = ALG_DIGEST,
+   [CRYPTO_NULL_HMAC] = ALG_DIGEST,
+   [CRYPTO_NULL_CBC] = ALG_CIPHER,
+   [CRYPTO_DEFLATE_COMP] = ALG_COMPRESSION,
+   [CRYPTO_SHA2_256_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_SHA2_384_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_SHA2_512_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_CAMELLIA_CBC] = ALG_CIPHER,
+   [CRYPTO_AES_XTS] = ALG_CIPHER,
+   [CRYPTO_AES_ICM] = ALG_CIPHER,
+   [CRYPTO_AES_NIST_GMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_AES_NIST_GCM_16] = ALG_AEAD,
+   [CRYPTO_BLAKE2B] = ALG_KEYED_DIGEST,
+   [CRYPTO_BLAKE2S] = ALG_KEYED_DIGEST,
+   [CRYPTO_CHACHA20] = ALG_CIPHER,
+   [CRYPTO_SHA2_224_HMAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_RIPEMD160] = ALG_DIGEST,
+   [CRYPTO_SHA2_224] = ALG_DIGEST,
+   [CRYPTO_SHA2_256] = ALG_DIGEST,
+   [CRYPTO_SHA2_384] = ALG_DIGEST,
+   [CRYPTO_SHA2_512] = ALG_DIGEST,
+   [CRYPTO_POLY1305] = ALG_KEYED_DIGEST,
+   [CRYPTO_AES_CCM_CBC_MAC] = ALG_KEYED_DIGEST,
+   [CRYPTO_AES_CCM_16] = ALG_AEAD,
+};
+
+static enum alg_type
+alg_type(int alg)
+{
+
+   if (alg < nitems(alg_types))
+   return (alg_types[alg]);
+   return (ALG_NONE);
+}
+
 static bool
 alg_is_compression(int alg)
 {
 
-   if (alg == CRYPTO_DEFLATE_COMP)
-   return (true);
-   return (false);
+   return (alg_type(alg) == ALG_COMPRESSION);
 }
 
 static bool
 alg_is_cipher(int alg)
 {
 
-   if (alg >= CRYPTO_DES_CBC && alg <= CRYPTO_SKIPJACK_CBC)
-   return (true);
-   if (alg >= CRYPTO_AES_CBC && alg <= CRYPTO_ARC4)
-   return (true);
-   if (alg == CRYPTO_NULL_CBC)
-   return (true);
-   if (alg >= CRYPTO_CAMELLIA_CBC && alg <= CRYPTO_AES_ICM)
-   return (true);
-   if (alg == CRYPTO_CHACHA20)
-   return (true);
-   return (false);
+   return (alg_type(alg) == ALG_CIPHER);
 }
 
 static bool
 alg_is_digest(int alg)
 {
 
-   if (alg >= CRYPTO_MD5_HMAC && alg <= CRYPTO_SHA1_KPDK)
-   return (true);
-   if (alg >= CRYPTO_MD5 && alg <= CRYPTO_SHA1)
-   return (true);
-   if (alg == CRYPTO_NULL_HMAC)
-   return (true);
-   if (alg >= CRYPTO_SHA2_256_HMAC && alg <= CRYPTO_SHA2_512_HMAC)
-   return (true);
-   if (alg == CRYPTO_AES_NIST_GMAC)
-   return (true);
-   if (alg >= CRYPTO_BLAKE2B && alg <= CRYPTO_BLAKE2S)
-   return (true);
-   if (alg >= CRYPTO_SHA2_224_HMAC && alg <= CRYPTO_POLY1305)
-   return (true);
-   if (alg == CRYPTO_AES_CCM_CBC_MAC)
-   return (true);
-   return (false);
+   return (alg_type(alg) == ALG_DIGEST ||
+   alg_type(alg) == ALG_KEYED_DIGEST);
 }
 
 static bool
 alg_is_keyed_digest(int alg)
 {
 
-   if (alg >= CRYPTO_MD5_HMAC && alg <= CRYPTO_SHA1_KPDK)
-   return (true);
-   if (alg >= CRYPTO_SHA2_256_HMAC && alg <= CRYPTO_SHA2_512_HMAC)
-   return (true);
-   if (alg == CRYPTO_AES_NIST_GMAC)
-   return (true);
-   if (alg >= CRYPTO_BLAKE2B && alg <= CRYPTO_BLAKE2S)
-   return (true);
-   if (alg == CRYPTO_SHA2_224_HMAC)
-   return (true);
-   if (alg == CRYPTO_POLY1305)
-   return (true);
-   if (alg == CRYPTO_AES_CCM_CBC_MAC)
-   return (true);
-   return 

svn commit: r360641 - head/sys/netinet/tcp_stacks

2020-05-04 Thread Michael Tuexen
Author: tuexen
Date: Mon May  4 22:02:49 2020
New Revision: 360641
URL: https://svnweb.freebsd.org/changeset/base/360641

Log:
  Enter the net epoch before calling the output routine in TCP BBR.
  This was only triggered when setting the IPPROTO_TCP level socket
  option TCP_DELACK.
  This issue was found by runnning an instance of SYZKALLER.
  Reviewed by:  rrs
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24690

Modified:
  head/sys/netinet/tcp_stacks/bbr.c

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 21:09:35 2020
(r360640)
+++ head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 22:02:49 2020
(r360641)
@@ -14418,6 +14418,7 @@ static int
 bbr_set_sockopt(struct socket *so, struct sockopt *sopt,
struct inpcb *inp, struct tcpcb *tp, struct tcp_bbr *bbr)
 {
+   struct epoch_tracker et;
int32_t error = 0, optval;
 
switch (sopt->sopt_name) {
@@ -14710,7 +14711,9 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sop
if (tp->t_flags & TF_DELACK) {
tp->t_flags &= ~TF_DELACK;
tp->t_flags |= TF_ACKNOW;
+   NET_EPOCH_ENTER(et);
bbr_output(tp);
+   NET_EPOCH_EXIT(et);
}
} else
error = EINVAL;
___
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: r360640 - in stable/12/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/executer include

2020-05-04 Thread Jung-uk Kim
Author: jkim
Date: Mon May  4 21:09:35 2020
New Revision: 360640
URL: https://svnweb.freebsd.org/changeset/base/360640

Log:
  MFC:  r360517
  
  Merge ACPICA 20200430.

Modified:
  stable/12/sys/contrib/dev/acpica/changes.txt
  stable/12/sys/contrib/dev/acpica/common/acgetline.c
  stable/12/sys/contrib/dev/acpica/common/dmtbdump2.c
  stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.l
  stable/12/sys/contrib/dev/acpica/compiler/aslload.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c
  stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h
  stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c
  stable/12/sys/contrib/dev/acpica/compiler/aslxref.c
  stable/12/sys/contrib/dev/acpica/compiler/dtutils.c
  stable/12/sys/contrib/dev/acpica/components/debugger/dbhistry.c
  stable/12/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
  stable/12/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
  stable/12/sys/contrib/dev/acpica/components/executer/exfield.c
  stable/12/sys/contrib/dev/acpica/include/acglobal.h
  stable/12/sys/contrib/dev/acpica/include/acpixf.h
  stable/12/sys/contrib/dev/acpica/include/acpredef.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/contrib/dev/acpica/changes.txt
==
--- stable/12/sys/contrib/dev/acpica/changes.txtMon May  4 20:28:53 
2020(r360639)
+++ stable/12/sys/contrib/dev/acpica/changes.txtMon May  4 21:09:35 
2020(r360640)
@@ -1,4 +1,61 @@
 
+
+
+30 April 2020. Summary of changes for version 20200430:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Cleaned up the coding style of a couple of global variables 
+(AcpiGbl_NextCmdNum and AcpiProtocolLengths) caught by static analyzers. 
+AcpiProtocolLengths was made static, and the definition of 
+AcpiGbl_NextCmdNum was moved to acglobal.h.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools: 
+
+iASL DataTable Compiler:  Fixed a segfault on errors that aren't directly 
+associated with a field.
+
+Disassembler: has been made more resilient so that it will continue to 
+parse AML even if the AML generates ACPI namespace errors. This enables 
+iASL to disassemble some AML that may have been compiled using older 
+versions of iASL that no longer compile with newer versions of iASL.
+
+iASL: Fixed the required parameters for _NIH and _NIG. Previously, there 
+was a mixup where _NIG required one parameter and _NIH required zero 
+parameters. This change swaps these parameter requirements. Now it is 
+required that _NIH must be called with one parameter and _NIG requires 
+zero parameters.
+
+iASL: Allow use of undefined externals as long as they are protected by 
+an if (CondRefOf (...)) block when compiling multiple definition blocks.
+
+iASL: Fixed the type override behavior of named objects that are declared 
+as External. External declarations will no longer override the type of 
+the actual definition if it already exists.
+
+AcpiNames: Added setargv.obj to the MSVC 2017 link sequence to enable 
+command line wildcard support on Windows. Note: the AcpiNames utility is 
+essentially redundant with the AcpiExec utility (using the "namespace" 
+command) and is therefore deprecated. It will be removed in future 
+releases of ACPICA.
+
+Disassembler: ignore AE_ALREADY_EXISTS status when parsing create* 
+operators. The disassembler is intended to emit existing ASL code as-is. 
+Therefore, error messages emitted during disassembly should be ignored or 
+handled in a way such that the disassembler can continue to parse the 
+AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op 
+parsing for create operators in order to complete parsing ASL termlists.
+
+iASL DataTable Compiler: IVRS table: fix potentially uninitialized 
+variable warning. Some compilers catch potential uninitialized variables. 
+This is done by examining branches of if/else statements. This change 
+replaces an "else if" with an "else" to fix the uninitialized variable 
+warning.
+
+
+
 26 March 2020. Summary of changes for version 20200326:
 
 
@@ -674,7 +731,7 @@ temporary.
 
 iASL: Emit error for creation of a zero-length operation region. Such a 
 region is rather pointless. If encountered, a runtime error is also 
-implemented in the interpeter.
+implemented in the interpreter.
 
 Debugger: Fix a possible fault with the "test objects" command.
 

Modified: stable/12/sys/contrib/dev/acpica/common/acgetline.c
==
--- stable/12/sys/contrib/dev/acpica/common/acgetline.c Mon May  4 20:28:53 
2020(r360639)
+++ stable/12/sys/contrib/dev/acpica/common/acgetline.c Mon May  4 21:09:35 
2020(r360640)
@@ -189,8 +189,6 @@ AcpiAcClearLine (
 #define _ASCII_LEFT_ARROW   'D'
 #define _ASCII_NEWLINE  '\n'
 
-extern 

svn commit: r360639 - head/sys/netinet/tcp_stacks

2020-05-04 Thread Randall Stewart
Author: rrs
Date: Mon May  4 20:28:53 2020
New Revision: 360639
URL: https://svnweb.freebsd.org/changeset/base/360639

Log:
  This commit brings things into sync with the advancements that
  have been made in rack and adds a few fixes in BBR. This also
  removes any possibility of incorrectly doing OOB data the stacks
  do not support it. Should fix the skyzaller crashes seen in the
  past. Still to fix is the BBR issue just reported this weekend
  with the SYN and on sending a RST. Note that this version of
  rack can now do pacing as well.
  
  Sponsored by:Netflix Inc
  Differential Revision:https://reviews.freebsd.org/D24576

Modified:
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.h
  head/sys/netinet/tcp_stacks/tcp_bbr.h
  head/sys/netinet/tcp_stacks/tcp_rack.h

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 20:19:57 2020
(r360638)
+++ head/sys/netinet/tcp_stacks/bbr.c   Mon May  4 20:28:53 2020
(r360639)
@@ -1,7 +1,5 @@
 /*-
- * Copyright (c) 2016-9
- * Netflix Inc.
- *  All rights reserved.
+ * Copyright (c) 2016-2020 Netflix, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -72,6 +70,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1853,28 +1852,6 @@ bbr_init_sysctls(void)
_clear_lost, 0, sysctl_bbr_clear_lost, "IU", "Clear lost 
counters");
 }
 
-static inline int32_t
-bbr_progress_timeout_check(struct tcp_bbr *bbr)
-{
-   if (bbr->rc_tp->t_maxunacktime && bbr->rc_tp->t_acktime &&
-   TSTMP_GT(ticks, bbr->rc_tp->t_acktime)) {
-   if uint32_t)ticks - bbr->rc_tp->t_acktime)) >= 
bbr->rc_tp->t_maxunacktime) {
-   /*
-* There is an assumption here that the caller will
-* drop the connection, so we increment the
-* statistics.
-*/
-   bbr_log_progress_event(bbr, bbr->rc_tp, ticks, 
PROGRESS_DROP, __LINE__);
-   BBR_STAT_INC(bbr_progress_drops);
-#ifdef NETFLIX_STATS
-   KMOD_TCPSTAT_INC(tcps_progdrops);
-#endif
-   return (1);
-   }
-   }
-   return (0);
-}
-
 static void
 bbr_counter_destroy(void)
 {
@@ -1884,6 +1861,8 @@ bbr_counter_destroy(void)
COUNTER_ARRAY_FREE(bbr_state_lost, BBR_MAX_STAT);
COUNTER_ARRAY_FREE(bbr_state_time, BBR_MAX_STAT);
COUNTER_ARRAY_FREE(bbr_state_resend, BBR_MAX_STAT);
+   counter_u64_free(bbr_nohdwr_pacing_enobuf);
+   counter_u64_free(bbr_hdwr_pacing_enobuf);
counter_u64_free(bbr_flows_whdwr_pacing);
counter_u64_free(bbr_flows_nohdwr_pacing);
 
@@ -4643,7 +4622,8 @@ bbr_timeout_tlp(struct tcpcb *tp, struct tcp_bbr *bbr,
/* Its not time yet */
return (0);
}
-   if (bbr_progress_timeout_check(bbr)) {
+   if (ctf_progress_timeout_check(tp, true)) {
+   bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__);
tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT);
return (1);
}
@@ -4815,9 +4795,8 @@ bbr_timeout_delack(struct tcpcb *tp, struct tcp_bbr *b
 }
 
 /*
- * Persists timer, here we simply need to setup the
- * FORCE-DATA flag the output routine will send
- * the one byte send.
+ * Here we send a KEEP-ALIVE like probe to the
+ * peer, we do not send data.
  *
  * We only return 1, saying don't proceed, if all timers
  * are stopped (destroyed PCB?).
@@ -4845,7 +4824,8 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
/*
 * Have we exceeded the user specified progress time?
 */
-   if (bbr_progress_timeout_check(bbr)) {
+   if (ctf_progress_timeout_check(tp, true)) {
+   bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__);
tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT);
goto out;
}
@@ -4859,6 +4839,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
(ticks - tp->t_rcvtime >= tcp_maxpersistidle ||
ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) {
KMOD_TCPSTAT_INC(tcps_persistdrop);
+   tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX);
tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT);
goto out;
}
@@ -4875,6 +4856,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *
if (tp->t_state > TCPS_CLOSE_WAIT &&
(ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) {
KMOD_TCPSTAT_INC(tcps_persistdrop);
+   

svn commit: r360638 - head/sys/netinet

2020-05-04 Thread Randall Stewart
Author: rrs
Date: Mon May  4 20:19:57 2020
New Revision: 360638
URL: https://svnweb.freebsd.org/changeset/base/360638

Log:
  Adjust the fb to have a way to ask the underlying stack
  if it can support the PRUS option (OOB). And then have
  the new function call that to validate and give the
  correct error response if needed to the user (rack
  and bbr do not support obsoleted OOB data).
  
  Sponsoered by: Netflix Inc.
  Differential Revision: https://reviews.freebsd.org/D24574

Modified:
  head/sys/netinet/tcp_usrreq.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Mon May  4 18:40:56 2020
(r360637)
+++ head/sys/netinet/tcp_usrreq.c   Mon May  4 20:19:57 2020
(r360638)
@@ -133,6 +133,8 @@ static void tcp_disconnect(struct tcpcb *);
 static voidtcp_usrclosed(struct tcpcb *);
 static voidtcp_fill_info(struct tcpcb *, struct tcp_info *);
 
+static int tcp_pru_options_support(struct tcpcb *tp, int flags);
+
 #ifdef TCPDEBUG
 #defineTCPDEBUG0   int ostate = 0
 #defineTCPDEBUG1() ostate = tp ? tp->t_state : 0
@@ -979,6 +981,15 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf
goto out;
}
tp = intotcpcb(inp);
+   if (flags & PRUS_OOB) {
+   if ((error = tcp_pru_options_support(tp, PRUS_OOB)) != 0) {
+   if (control)
+   m_freem(control);
+   if (m && (flags & PRUS_NOTREADY) == 0)
+   m_freem(m);
+   goto out;
+   }
+   }
TCPDEBUG1();
if (nam != NULL && tp->t_state < TCPS_SYN_SENT) {
switch (nam->sa_family) {
@@ -1362,6 +1373,24 @@ tcp_usr_close(struct socket *so)
NET_EPOCH_EXIT(et);
 }
 
+static int 
+tcp_pru_options_support(struct tcpcb *tp, int flags)
+{
+   /*
+* If the specific TCP stack has a pru_options
+* specified then it does not always support
+* all the PRU_XX options and we must ask it.
+* If the function is not specified then all
+* of the PRU_XX options are supported.
+*/
+   int ret = 0;
+
+   if (tp->t_fb->tfb_pru_options) {
+   ret = (*tp->t_fb->tfb_pru_options)(tp, flags);
+   }
+   return (ret);
+}
+
 /*
  * Receive out-of-band data.
  */
@@ -1381,6 +1410,10 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int 
goto out;
}
tp = intotcpcb(inp);
+   error = tcp_pru_options_support(tp, PRUS_OOB);
+   if (error) {
+   goto out;
+   }
TCPDEBUG1();
if ((so->so_oobmark == 0 &&
 (so->so_rcv.sb_state & SBS_RCVATMARK) == 0) ||

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Mon May  4 18:40:56 2020(r360637)
+++ head/sys/netinet/tcp_var.h  Mon May  4 20:19:57 2020(r360638)
@@ -345,6 +345,7 @@ struct tcp_function_block {
void(*tfb_tcp_rexmit_tmr)(struct tcpcb *);
int (*tfb_tcp_handoff_ok)(struct tcpcb *);
void(*tfb_tcp_mtu_chg)(struct tcpcb *);
+   int (*tfb_pru_options)(struct tcpcb *, int);
volatile uint32_t tfb_refcnt;
uint32_t  tfb_flags;
uint8_t tfb_id;
___
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: r360637 - stable/12/sys/dev/evdev

2020-05-04 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Mon May  4 18:40:56 2020
New Revision: 360637
URL: https://svnweb.freebsd.org/changeset/base/360637

Log:
  MFC r360126, r360132: Change kern.evdev.rcpt_mask to 12 by default
  
  Original commit messages:
  Change kern.evdev.rcpt_mask from 3 to 12 by default.  This makes us much
  more evdev-friendly, and will prevent everyone using xorg and wayland with
  evdev devices (the default) from needing to change this locally.
  
  powerpc32 still uses the old value for the keyboard part, becaues the adb
  keyboard driver used there is not evdev compatible.
  
  In r360126, I meant to have a different mask only on powerpc, not powerpc64.
  Update the check to check that we're not compiling for powerpc64.
  
  Approved by:  wulf (implicit, mfc)
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D24370

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

Modified: stable/12/sys/dev/evdev/evdev.c
==
--- stable/12/sys/dev/evdev/evdev.c Mon May  4 17:45:04 2020
(r360636)
+++ stable/12/sys/dev/evdev/evdev.c Mon May  4 18:40:56 2020
(r360637)
@@ -66,7 +66,12 @@ enum evdev_sparse_result
 
 MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory");
 
-int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX;
+/* adb keyboard driver used on powerpc does not support evdev yet */
+#if defined(__powerpc__) && !defined(__powerpc64__)
+int evdev_rcpt_mask = EVDEV_RCPT_KBDMUX | EVDEV_RCPT_HW_MOUSE;
+#else
+int evdev_rcpt_mask = EVDEV_RCPT_HW_MOUSE | EVDEV_RCPT_HW_KBD;
+#endif
 int evdev_sysmouse_t_axis = 0;
 
 SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args");
___
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: r360568 - head/sys/dev/nvme

2020-05-04 Thread Gunther Nikl
Hello,

> Modified: head/sys/dev/nvme/nvme_test.c
> ==
> --- head/sys/dev/nvme/nvme_test.c Sat May  2 20:14:592020 (r360567)
> +++ head/sys/dev/nvme/nvme_test.c Sat May  2 20:47:582020 (r360568)
> @@ -100,7 +100,7 @@ nvme_ns_bio_test(void *arg)
>   idx = atomic_fetchadd_int(_test->td_idx, 1);
>   dev = io_test->ns->cdev; 
> - offset = idx * 2048 * nvme_ns_get_sector_size(io_test->ns);
> + offset = idx * 2048ULL * nvme_ns_get_sector_size(io_test->ns);
> 
>   while (1) {

I have read the differential where a cast was used on the 2048. AFAICT, the
"ULL" is only correct if uint64 is a "unsigned long long". On a LP64 system
it is normally a simple "unsigned long" and then the correct suffix would
be "UL". In that sense the cast was probably more correct. 

my 2c
Gunther
___
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: r360636 - stable/11/usr.bin/clang

2020-05-04 Thread Dimitry Andric
Author: dim
Date: Mon May  4 17:45:04 2020
New Revision: 360636
URL: https://svnweb.freebsd.org/changeset/base/360636

Log:
  Correctly finish up MFC of r310840:
  
  Move llvm-objdump from CLANG_EXTRAS to installed by default
  
  The SUBDIR entry was not actually moved to the right location in
  usr.bin/clang/Makefile.

Modified:
  stable/11/usr.bin/clang/Makefile

Modified: stable/11/usr.bin/clang/Makefile
==
--- stable/11/usr.bin/clang/MakefileMon May  4 17:16:30 2020
(r360635)
+++ stable/11/usr.bin/clang/MakefileMon May  4 17:45:04 2020
(r360636)
@@ -7,6 +7,7 @@ SUBDIR+=clang-tblgen
 SUBDIR+=   llvm-tblgen
 
 .if !defined(TOOLS_PREFIX)
+SUBDIR+=   llvm-objdump
 SUBDIR+=   llvm-symbolizer
 
 .if ${MK_CLANG_EXTRAS} != "no"
@@ -31,7 +32,6 @@ SUBDIR+=  llvm-mca
 SUBDIR+=   llvm-modextract
 SUBDIR+=   llvm-nm
 SUBDIR+=   llvm-objcopy
-SUBDIR+=   llvm-objdump
 SUBDIR+=   llvm-pdbutil
 SUBDIR+=   llvm-rtdyld
 SUBDIR+=   llvm-xray
___
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: r360635 - in head/contrib/jemalloc: . include/jemalloc

2020-05-04 Thread Brooks Davis
Author: brooks
Date: Mon May  4 17:16:30 2020
New Revision: 360635
URL: https://svnweb.freebsd.org/changeset/base/360635

Log:
  Set LG_VADDR to 48 on RISC-V.
  
  The Sv48 PTE format is the largest currently defined address space for
  RISC-V. It makes no sense to define a larger size and doing so (at
  least for 64-bits) forces rtrees down a slow path.
  
  Reviewed by:  vangyzen, jhb, mhorne
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D24658

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Mon May  4 16:50:01 2020
(r360634)
+++ head/contrib/jemalloc/FREEBSD-diffs Mon May  4 17:16:30 2020
(r360635)
@@ -233,7 +233,7 @@ index ..b752b0e7
 +#  define LG_SIZEOF_PTR   2
 +#endif
 +#ifdef __riscv
-+#  define LG_VADDR64
++#  define LG_VADDR48
 +#  define LG_SIZEOF_PTR   3
 +#endif
 +

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Mon May  4 
16:50:01 2020(r360634)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Mon May  4 
17:16:30 2020(r360635)
@@ -68,7 +68,7 @@
 #  define LG_SIZEOF_PTR2
 #endif
 #ifdef __riscv
-#  define LG_VADDR 64
+#  define LG_VADDR 48
 #  define LG_SIZEOF_PTR3
 #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: r360634 - head/sbin/setkey

2020-05-04 Thread John Baldwin
Author: jhb
Date: Mon May  4 16:50:01 2020
New Revision: 360634
URL: https://svnweb.freebsd.org/changeset/base/360634

Log:
  Add RFC reference for AES-CTR with IPsec.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Mon May  4 16:30:36 2020(r360633)
+++ head/sbin/setkey/setkey.8   Mon May  4 16:50:01 2020(r360634)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 01, 2020
+.Dd May 04, 2020
 .Dt SETKEY 8
 .Os
 .\"
@@ -613,7 +613,7 @@ parameter:
 algorithm  keylen (bits)   comment
 null   0 to 2048   rfc2410
 rijndael-cbc   128/192/256 rfc3602
-aes-ctr160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03
+aes-ctr160/224/288 rfc3686
 aes-gcm-16 160/224/288 rfc4106
 .Ed
 .Pp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360633 - in stable: 11/share/man/man9 11/sys/kern 11/sys/sys 12/share/man/man9 12/sys/kern 12/sys/sys

2020-05-04 Thread John Baldwin
Author: jhb
Date: Mon May  4 16:30:36 2020
New Revision: 360633
URL: https://svnweb.freebsd.org/changeset/base/360633

Log:
  MFC 355600: Add a callout_func_t typedef for functions used with callout_*().
  
  This typedef is the same as timeout_t except that it is in the callout
  namespace and header.
  
  Use this typedef in various places of the callout implementation that
  were either using the raw type or timeout_t.
  
  While here, add  to the manpage.

Modified:
  stable/11/share/man/man9/timeout.9
  stable/11/sys/kern/kern_timeout.c
  stable/11/sys/sys/_callout.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/share/man/man9/timeout.9
  stable/12/sys/kern/kern_timeout.c
  stable/12/sys/sys/_callout.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/share/man/man9/timeout.9
==
--- stable/11/share/man/man9/timeout.9  Mon May  4 15:57:13 2020
(r360632)
+++ stable/11/share/man/man9/timeout.9  Mon May  4 16:30:36 2020
(r360633)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 27, 2016
+.Dd December 10, 2019
 .Dt TIMEOUT 9
 .Os
 .Sh NAME
@@ -62,8 +62,10 @@
 .Nd execute a function after a specified length of time
 .Sh SYNOPSIS
 .In sys/types.h
+.In sys/callout.h
 .In sys/systm.h
 .Bd -literal
+typedef void callout_func_t (void *);
 typedef void timeout_t (void *);
 .Ed
 .Ft int
@@ -71,7 +73,7 @@ typedef void timeout_t (void *);
 .Ft void
 .Fn callout_deactivate "struct callout *c"
 .Ft int
-.Fn callout_async_drain "struct callout *c" "timeout_t *drain"
+.Fn callout_async_drain "struct callout *c" "callout_func_t *drain"
 .Ft int
 .Fn callout_drain "struct callout *c"
 .Ft void
@@ -90,19 +92,24 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Ft int
 .Fn callout_pending "struct callout *c"
 .Ft int
-.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg"
+.Fo callout_reset
+.Fa "struct callout *c"
+.Fa "int ticks"
+.Fa "callout_func_t *func"
+.Fa "void *arg"
+.Fc
 .Ft int
 .Fo callout_reset_curcpu
 .Fa "struct callout *c"
 .Fa "int ticks"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fc
 .Ft int
 .Fo callout_reset_on
 .Fa "struct callout *c"
 .Fa "int ticks"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int cpu"
 .Fc
@@ -111,7 +118,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int flags"
 .Fc
@@ -120,7 +127,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int flags"
 .Fc
@@ -129,7 +136,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int cpu"
 .Fa "int flags"

Modified: stable/11/sys/kern/kern_timeout.c
==
--- stable/11/sys/kern/kern_timeout.c   Mon May  4 15:57:13 2020
(r360632)
+++ stable/11/sys/kern/kern_timeout.c   Mon May  4 16:30:36 2020
(r360633)
@@ -140,9 +140,9 @@ u_int callwheelsize, callwheelmask;
  */
 struct cc_exec {
struct callout  *cc_curr;
-   void(*cc_drain)(void *);
+   callout_func_t  *cc_drain;
 #ifdef SMP
-   void(*ce_migration_func)(void *);
+   callout_func_t  *ce_migration_func;
void*ce_migration_arg;
int ce_migration_cpu;
sbintime_t  ce_migration_time;
@@ -642,7 +642,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
 int direct)
 {
struct rm_priotracker tracker;
-   void (*c_func)(void *);
+   callout_func_t *c_func, *drain;
void *c_arg;
struct lock_class *class;
struct lock_object *c_lock;
@@ -650,7 +650,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
int c_iflags;
 #ifdef SMP
struct callout_cpu *new_cc;
-   void (*new_func)(void *);
+   callout_func_t *new_func;
void *new_arg;
int flags, new_cpu;
sbintime_t new_prec, new_time;
@@ -659,7 +659,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
sbintime_t sbt1, sbt2;
struct timespec ts2;
static sbintime_t maxdt = 2 * SBT_1MS;  /* 2 msec */
-   static timeout_t *lastfunc;
+   static callout_func_t *lastfunc;
 #endif
 
KASSERT((c->c_iflags & CALLOUT_PENDING) == CALLOUT_PENDING,
@@ -752,8 +752,6 @@ skip:
KASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr"));

svn commit: r360633 - in stable: 11/share/man/man9 11/sys/kern 11/sys/sys 12/share/man/man9 12/sys/kern 12/sys/sys

2020-05-04 Thread John Baldwin
Author: jhb
Date: Mon May  4 16:30:36 2020
New Revision: 360633
URL: https://svnweb.freebsd.org/changeset/base/360633

Log:
  MFC 355600: Add a callout_func_t typedef for functions used with callout_*().
  
  This typedef is the same as timeout_t except that it is in the callout
  namespace and header.
  
  Use this typedef in various places of the callout implementation that
  were either using the raw type or timeout_t.
  
  While here, add  to the manpage.

Modified:
  stable/12/share/man/man9/timeout.9
  stable/12/sys/kern/kern_timeout.c
  stable/12/sys/sys/_callout.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man9/timeout.9
  stable/11/sys/kern/kern_timeout.c
  stable/11/sys/sys/_callout.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/share/man/man9/timeout.9
==
--- stable/12/share/man/man9/timeout.9  Mon May  4 15:57:13 2020
(r360632)
+++ stable/12/share/man/man9/timeout.9  Mon May  4 16:30:36 2020
(r360633)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 27, 2016
+.Dd December 10, 2019
 .Dt TIMEOUT 9
 .Os
 .Sh NAME
@@ -62,8 +62,10 @@
 .Nd execute a function after a specified length of time
 .Sh SYNOPSIS
 .In sys/types.h
+.In sys/callout.h
 .In sys/systm.h
 .Bd -literal
+typedef void callout_func_t (void *);
 typedef void timeout_t (void *);
 .Ed
 .Ft int
@@ -71,7 +73,7 @@ typedef void timeout_t (void *);
 .Ft void
 .Fn callout_deactivate "struct callout *c"
 .Ft int
-.Fn callout_async_drain "struct callout *c" "timeout_t *drain"
+.Fn callout_async_drain "struct callout *c" "callout_func_t *drain"
 .Ft int
 .Fn callout_drain "struct callout *c"
 .Ft void
@@ -90,19 +92,24 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Ft int
 .Fn callout_pending "struct callout *c"
 .Ft int
-.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg"
+.Fo callout_reset
+.Fa "struct callout *c"
+.Fa "int ticks"
+.Fa "callout_func_t *func"
+.Fa "void *arg"
+.Fc
 .Ft int
 .Fo callout_reset_curcpu
 .Fa "struct callout *c"
 .Fa "int ticks"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fc
 .Ft int
 .Fo callout_reset_on
 .Fa "struct callout *c"
 .Fa "int ticks"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int cpu"
 .Fc
@@ -111,7 +118,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int flags"
 .Fc
@@ -120,7 +127,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int flags"
 .Fc
@@ -129,7 +136,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI
 .Fa "struct callout *c"
 .Fa "sbintime_t sbt"
 .Fa "sbintime_t pr"
-.Fa "timeout_t *func"
+.Fa "callout_func_t *func"
 .Fa "void *arg"
 .Fa "int cpu"
 .Fa "int flags"

Modified: stable/12/sys/kern/kern_timeout.c
==
--- stable/12/sys/kern/kern_timeout.c   Mon May  4 15:57:13 2020
(r360632)
+++ stable/12/sys/kern/kern_timeout.c   Mon May  4 16:30:36 2020
(r360633)
@@ -144,9 +144,9 @@ static u_int __read_mostly callwheelmask;
  */
 struct cc_exec {
struct callout  *cc_curr;
-   void(*cc_drain)(void *);
+   callout_func_t  *cc_drain;
 #ifdef SMP
-   void(*ce_migration_func)(void *);
+   callout_func_t  *ce_migration_func;
void*ce_migration_arg;
int ce_migration_cpu;
sbintime_t  ce_migration_time;
@@ -647,7 +647,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
 int direct)
 {
struct rm_priotracker tracker;
-   void (*c_func)(void *);
+   callout_func_t *c_func, *drain;
void *c_arg;
struct lock_class *class;
struct lock_object *c_lock;
@@ -655,7 +655,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
int c_iflags;
 #ifdef SMP
struct callout_cpu *new_cc;
-   void (*new_func)(void *);
+   callout_func_t *new_func;
void *new_arg;
int flags, new_cpu;
sbintime_t new_prec, new_time;
@@ -664,7 +664,7 @@ softclock_call_cc(struct callout *c, struct callout_cp
sbintime_t sbt1, sbt2;
struct timespec ts2;
static sbintime_t maxdt = 2 * SBT_1MS;  /* 2 msec */
-   static timeout_t *lastfunc;
+   static callout_func_t *lastfunc;
 #endif
 
KASSERT((c->c_iflags & CALLOUT_PENDING) == CALLOUT_PENDING,
@@ -757,8 +757,6 @@ skip:
KASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr"));

Re: svn commit: r360574 - in head: share/man/man9 sys/dev/cxgbe sys/dev/cxgbe/crypto sys/dev/cxgbe/tom sys/kern sys/sys

2020-05-04 Thread John Baldwin
On 5/2/20 4:46 PM, Gleb Smirnoff wrote:
> Author: glebius
> Date: Sat May  2 23:46:29 2020
> New Revision: 360574
> URL: https://svnweb.freebsd.org/changeset/base/360574
> 
> Log:
>   Step 2.2:
>   o Shrink sglist(9) functions to work with multipage mbufs down from
> four functions to two.
>   o Don't use 'struct mbuf_ext_pgs *' as argument, use struct mbuf.
>   o Rename to something matching _epg.
>   
>   Reviewed by:gallatin
>   Differential Revision:  https://reviews.freebsd.org/D24598

MLINKS in share/man/man9/Makefile need to be updated and old links added
to ObsoleteFiles.inc?

-- 
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: r360632 - stable/12/lib/csu/common

2020-05-04 Thread Ed Maste
Author: emaste
Date: Mon May  4 15:57:13 2020
New Revision: 360632
URL: https://svnweb.freebsd.org/changeset/base/360632

Log:
  MFC r340701: Add NT_FREEBSD_FEATURE_CTL ELF note to csu
  
  This note will be used to allow binaries to opt out of, or in to,
  upcoming vulnerability mitigation and other features.  It is not yet
  connected but being added now to facilitate testing and ensure
  compatibility with existing kernels and tools.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/lib/csu/common/crtbrand.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/csu/common/crtbrand.c
==
--- stable/12/lib/csu/common/crtbrand.c Mon May  4 15:07:57 2020
(r360631)
+++ stable/12/lib/csu/common/crtbrand.c Mon May  4 15:57:13 2020
(r360632)
@@ -67,3 +67,18 @@ static const struct {
.name = NOTE_FREEBSD_VENDOR,
.desc = __FreeBSD_version
 };
+
+static const struct {
+   int32_t namesz;
+   int32_t descsz;
+   int32_t type;
+   charname[sizeof(NOTE_FREEBSD_VENDOR)];
+   uint32_tdesc[1];
+} crt_feature_ctl __attribute__ ((section (NOTE_SECTION),
+aligned(4))) __used = {
+   .namesz = sizeof(NOTE_FREEBSD_VENDOR),
+   .descsz = sizeof(uint32_t),
+   .type = NT_FREEBSD_FEATURE_CTL,
+   .name = NOTE_FREEBSD_VENDOR,
+   .desc = { 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: r360631 - head/sys/net/route

2020-05-04 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon May  4 15:07:57 2020
New Revision: 360631
URL: https://svnweb.freebsd.org/changeset/base/360631

Log:
  Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().
  
  Eliminate the last rtalloc1() call to finish transition to the new routing
  KPI defined in r359823.
  
  Differential Revision:https://reviews.freebsd.org/D24663

Modified:
  head/sys/net/route/route_ddb.c

Modified: head/sys/net/route/route_ddb.c
==
--- head/sys/net/route/route_ddb.c  Mon May  4 15:00:19 2020
(r360630)
+++ head/sys/net/route/route_ddb.c  Mon May  4 15:07:57 2020
(r360631)
@@ -208,6 +208,8 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd)
 _DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL)
 {
char abuf[INET6_ADDRSTRLEN], *buf, *end;
+   struct rib_head *rh;
+   struct radix_node *rn;
void *dst_addrp;
struct rtentry *rt;
union {
@@ -244,8 +246,15 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl
if (inet_ntop(af, dst_addrp, abuf, sizeof(abuf)) != NULL)
db_printf("Looking up route to destination '%s'\n", abuf);
 
+   rt = NULL;
CURVNET_SET(vnet0);
-   rt = rtalloc1((struct sockaddr *), 0, RTF_RNH_LOCKED);
+
+   rh = rt_tables_get_rnh(RT_DEFAULT_FIB, af);
+
+   rn = rh->rnh_matchaddr(, >head);
+   if (rn && ((rn->rn_flags & RNF_ROOT) == 0))
+   rt = (struct rtentry *)rn;
+
CURVNET_RESTORE();
 
if (rt == NULL) {
@@ -254,7 +263,6 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl
}
 
rt_dumpentry_ddb((void *)rt, NULL);
-   RTFREE_LOCKED(rt);
 
return;
 usage:
___
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: r360630 - head/sys/net/route

2020-05-04 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon May  4 15:00:19 2020
New Revision: 360630
URL: https://svnweb.freebsd.org/changeset/base/360630

Log:
  Simplify address parsing in DDB show route command.
  
  Use db_get_line() to overcome parser limitation.
  
  Differential Revision:https://reviews.freebsd.org/D24662

Modified:
  head/sys/net/route/route_ddb.c

Modified: head/sys/net/route/route_ddb.c
==
--- head/sys/net/route/route_ddb.c  Mon May  4 14:31:45 2020
(r360629)
+++ head/sys/net/route/route_ddb.c  Mon May  4 15:00:19 2020
(r360630)
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
+#include 
 #include 
 #include 
 #include 
@@ -206,239 +207,45 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd)
 
 _DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL)
 {
-   char buf[INET6_ADDRSTRLEN], *bp;
-   const void *dst_addrp;
-   struct sockaddr *dstp;
+   char abuf[INET6_ADDRSTRLEN], *buf, *end;
+   void *dst_addrp;
struct rtentry *rt;
union {
struct sockaddr_in dest_sin;
struct sockaddr_in6 dest_sin6;
} u;
-   uint16_t hextets[8];
-   unsigned i, tets;
-   int t, af, exp, tokflags;
+   int af;
 
-   /*
-* Undecoded address family.  No double-colon expansion seen yet.
-*/
-   af = -1;
-   exp = -1;
-   /* Assume INET6 to start; we can work back if guess was wrong. */
-   tokflags = DRT_WSPACE | DRT_HEX | DRT_HEXADECIMAL;
+   buf = db_get_line();
 
-   /*
-* db_command has lexed 'show route' for us.
-*/
-   t = db_read_token_flags(tokflags);
-   if (t == tWSPACE)
-   t = db_read_token_flags(tokflags);
+   /* Remove whitespaces from both ends */
+   end = buf + strlen(buf) - 1;
+   for (; (end >= buf) && (*end=='\n' || isspace(*end)); end--)
+   *end = '\0';
+   while (isspace(*buf))
+   buf++;
 
-   /*
-* tEOL: Just 'show route' isn't a valid mode.
-* tMINUS: It's either '-h' or some invalid option.  Regardless, usage.
-*/
-   if (t == tEOL || t == tMINUS)
-   goto usage;
-
-   db_unread_token(t);
-
-   tets = nitems(hextets);
-
-   /*
-* Each loop iteration, we expect to read one octet (v4) or hextet
-* (v6), followed by an appropriate field separator ('.' or ':' or
-* '::').
-*
-* At the start of each loop, we're looking for a number (octet or
-* hextet).
-*
-* INET6 addresses have a special case where they may begin with '::'.
-*/
-   for (i = 0; i < tets; i++) {
-   t = db_read_token_flags(tokflags);
-
-   if (t == tCOLONCOLON) {
-   /* INET6 with leading '::' or invalid. */
-   if (i != 0) {
-   db_printf("Parse error: unexpected extra "
-   "colons.\n");
-   goto exit;
-   }
-
-   af = AF_INET6;
-   exp = i;
-   hextets[i] = 0;
-   continue;
-   } else if (t == tNUMBER) {
-   /*
-* Lexer separates out '-' as tMINUS, but make the
-* assumption explicit here.
-*/
-   MPASS(db_tok_number >= 0);
-
-   if (af == AF_INET && db_tok_number > UINT8_MAX) {
-   db_printf("Not a valid v4 octet: %ld\n",
-   (long)db_tok_number);
-   goto exit;
-   }
-   hextets[i] = db_tok_number;
-   } else if (t == tEOL) {
-   /*
-* We can only detect the end of an IPv6 address in
-* compact representation with EOL.
-*/
-   if (af != AF_INET6 || exp < 0) {
-   db_printf("Parse failed.  Got unexpected EOF "
-   "when the address is not a compact-"
-   "representation IPv6 address.\n");
-   goto exit;
-   }
-   break;
-   } else {
-   db_printf("Parse failed.  Unexpected token %d.\n", t);
-   goto exit;
-   }
-
-   /* Next, look for a separator, if appropriate. */
-   if (i == tets - 1)
-   continue;
-
-   t = db_read_token_flags(tokflags);
-   if (af < 0) {
-   if (t == tCOLON) {
-  

svn commit: r360629 - in head/sys: net net/route netinet netinet6

2020-05-04 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon May  4 14:31:45 2020
New Revision: 360629
URL: https://svnweb.freebsd.org/changeset/base/360629

Log:
  Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.
  
  After converting routing subsystem customers to use nexthop objects
   defined in r359823, some fields in struct rtentry became unused.
  
  This commit removes rt_ifp, rt_ifa, rt_gateway and rt_mtu from struct rtentry
   along with the code initializing and updating these fields.
  
  Cleanup of the remaining fields will be addressed by D24669.
  
  This commit also changes the implementation of the RTM_CHANGE handling.
  Old implementation tried to perform the whole operation under radix WLOCK,
   resulting in slow performance and hacks like using RTF_RNH_LOCKED flag.
  New implementation looks up the route nexthop under radix RLOCK, creates new
   nexthop and tries to update rte nhop pointer. Only last part is done under
   WLOCK.
  In the hypothetical scenarious where multiple rtsock clients
   repeatedly issue RTM_CHANGE requests for the same route, route may get
   updated between read and update operation. This is addressed by retrying
   the operation multiple (3) times before returning failure back to the
   caller.
  
  Differential Revision:https://reviews.freebsd.org/D24666

Modified:
  head/sys/net/route.c
  head/sys/net/route/route_var.h
  head/sys/netinet/in_rmx.c
  head/sys/netinet6/in6_rmx.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cMon May  4 12:28:44 2020(r360628)
+++ head/sys/net/route.cMon May  4 14:31:45 2020(r360629)
@@ -162,14 +162,6 @@ static int del_route(struct rib_head *rnh, struct rt_a
 static int change_route(struct rib_head *, struct rt_addrinfo *,
 struct rtentry **);
 
-struct if_mtuinfo
-{
-   struct ifnet*ifp;
-   int mtu;
-};
-
-static int if_updatemtu_cb(struct radix_node *, void *);
-
 /*
  * handler for net.my_fibnum
  */
@@ -560,12 +552,6 @@ rtfree(struct rtentry *rt)
}
 #endif
/*
-* release references on items we hold them on..
-* e.g other routes and ifaddrs.
-*/
-   if (rt->rt_ifa)
-   ifa_free(rt->rt_ifa);
-   /*
 * The key is separatly alloc'd so free it (see rt_setgate()).
 * This also frees the gateway, as they are always malloc'd
 * together.
@@ -1346,66 +1332,25 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum)
return (error);
 }
 
-static int
-if_updatemtu_cb(struct radix_node *rn, void *arg)
-{
-   struct rtentry *rt;
-   struct if_mtuinfo *ifmtu;
-
-   rt = (struct rtentry *)rn;
-   ifmtu = (struct if_mtuinfo *)arg;
-
-   if (rt->rt_ifp != ifmtu->ifp)
-   return (0);
-
-   if (rt->rt_mtu >= ifmtu->mtu) {
-   /* We have to decrease mtu regardless of flags */
-   rt->rt_mtu = ifmtu->mtu;
-   return (0);
-   }
-
-   /*
-* New MTU is bigger. Check if are allowed to alter it
-*/
-   if ((rt->rt_flags & (RTF_FIXEDMTU | RTF_GATEWAY | RTF_HOST)) != 0) {
-
-   /*
-* Skip routes with user-supplied MTU and
-* non-interface routes
-*/
-   return (0);
-   }
-
-   /* We are safe to update route MTU */
-   rt->rt_mtu = ifmtu->mtu;
-
-   return (0);
-}
-
 void
 rt_updatemtu(struct ifnet *ifp)
 {
-   struct if_mtuinfo ifmtu;
struct rib_head *rnh;
+   int mtu;
int i, j;
 
-   ifmtu.ifp = ifp;
-
/*
 * Try to update rt_mtu for all routes using this interface
 * Unfortunately the only way to do this is to traverse all
 * routing tables in all fibs/domains.
 */
for (i = 1; i <= AF_MAX; i++) {
-   ifmtu.mtu = if_getmtu_family(ifp, i);
+   mtu = if_getmtu_family(ifp, i);
for (j = 0; j < rt_numfibs; j++) {
rnh = rt_tables_get_rnh(j, i);
if (rnh == NULL)
continue;
-   RIB_WLOCK(rnh);
-   rnh->rnh_walktree(>head, if_updatemtu_cb, );
-   RIB_WUNLOCK(rnh);
-   nhops_update_ifmtu(rnh, ifp, ifmtu.mtu);
+   nhops_update_ifmtu(rnh, ifp, mtu);
}
}
 }
@@ -1550,7 +1495,6 @@ int
 rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
u_int fibnum)
 {
-   struct epoch_tracker et;
const struct sockaddr *dst;
struct rib_head *rnh;
int error;
@@ -1599,11 +1543,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru
error = add_route(rnh, info, ret_nrt);
 

svn commit: r360628 - stable/12/sys/dev/iwm

2020-05-04 Thread Mark Johnston
Author: markj
Date: Mon May  4 12:28:44 2020
New Revision: 360628
URL: https://svnweb.freebsd.org/changeset/base/360628

Log:
  MFC r360373:
  iwm: Print the command code for any unhandled commands.

Modified:
  stable/12/sys/dev/iwm/if_iwm.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/iwm/if_iwm.c
==
--- stable/12/sys/dev/iwm/if_iwm.c  Mon May  4 12:27:46 2020
(r360627)
+++ stable/12/sys/dev/iwm/if_iwm.c  Mon May  4 12:28:44 2020
(r360628)
@@ -5618,9 +5618,8 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m)
 
default:
device_printf(sc->sc_dev,
-   "frame %d/%d %x UNHANDLED (this should "
-   "not happen)\n", qid & ~0x80, idx,
-   pkt->len_n_flags);
+   "code %x, frame %d/%d %x unhandled\n",
+   code, qid & ~0x80, idx, pkt->len_n_flags);
break;
}
 
___
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: r360627 - stable/12/lib/libc/sys

2020-05-04 Thread Mark Johnston
Author: markj
Date: Mon May  4 12:27:46 2020
New Revision: 360627
URL: https://svnweb.freebsd.org/changeset/base/360627

Log:
  MFC r360384:
  Document handling of connection-mode sockets by sendto(2).
  
  PR:   245817

Modified:
  stable/12/lib/libc/sys/send.2
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/sys/send.2
==
--- stable/12/lib/libc/sys/send.2   Mon May  4 11:23:55 2020
(r360626)
+++ stable/12/lib/libc/sys/send.2   Mon May  4 12:27:46 2020
(r360627)
@@ -28,7 +28,7 @@
 .\" From: @(#)send.2   8.2 (Berkeley) 2/21/94
 .\" $FreeBSD$
 .\"
-.Dd January 4, 2019
+.Dd April 27, 2020
 .Dt SEND 2
 .Os
 .Sh NAME
@@ -69,18 +69,35 @@ The
 function
 may be used only when the socket is in a
 .Em connected
-state, while
+state.
+The functions
 .Fn sendto ,
 .Fn sendmsg
 and
 .Fn sendmmsg
-may be used at any time.
+may be used at any time if the socket is connectionless-mode.
+If the socket is connection-mode, the protocol
+must support implied connect (currently
+.Xr tcp 4
+is the only protocol with support) or the socket must be in a
+connected state before use.
 .Pp
 The address of the target is given by
 .Fa to
 with
 .Fa tolen
-specifying its size.
+specifying its size, or the equivalent
+.Fa msg_name
+and
+.Fa msg_namelen
+in
+.Fa struct msghdr .
+If the socket is in a connected state, the target address passed to
+.Fn sendto ,
+.Fn sendmsg
+or
+.Fn sendmmsg
+is ignored.
 The length of the message is given by
 .Fa len .
 If the message is too long to pass atomically through the
@@ -195,6 +212,8 @@ An invalid descriptor was specified.
 The destination address is a broadcast address, and
 .Dv SO_BROADCAST
 has not been set on the socket.
+.It Bq Er ENOTCONN
+The socket is connection-mode but is not connected.
 .It Bq Er ENOTSOCK
 The argument
 .Fa s
@@ -242,6 +261,7 @@ This typically means that the socket
 is not connected.
 .El
 .Sh SEE ALSO
+.Xr connect 2 ,
 .Xr fcntl 2 ,
 .Xr getsockopt 2 ,
 .Xr recv 2 ,
___
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: r360626 - head/tests/sys/netipsec/tunnel

2020-05-04 Thread Li-Wen Hsu
Author: lwhsu
Date: Mon May  4 11:23:55 2020
New Revision: 360626
URL: https://svnweb.freebsd.org/changeset/base/360626

Log:
  Revert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560
  
  PR:   245832
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/netipsec/tunnel/empty.sh

Modified: head/tests/sys/netipsec/tunnel/empty.sh
==
--- head/tests/sys/netipsec/tunnel/empty.sh Mon May  4 11:00:24 2020
(r360625)
+++ head/tests/sys/netipsec/tunnel/empty.sh Mon May  4 11:23:55 2020
(r360626)
@@ -11,10 +11,6 @@ v4_head()
 
 v4_body()
 {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/245832;
-   fi
-
# Can't use filename "null" for this script: PR 223564
ist_test 4 null ""
 }
@@ -33,10 +29,6 @@ v6_head()
 
 v6_body()
 {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/245832;
-   fi
-
ist_test 6 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: r360625 - head/sys/dev/evdev

2020-05-04 Thread Vladimir Kondratyev
Author: wulf
Date: Mon May  4 11:00:24 2020
New Revision: 360625
URL: https://svnweb.freebsd.org/changeset/base/360625

Log:
  [evdev] Sync event codes with Linux kernel 5.6
  
  MFC after:2 weeks

Modified:
  head/sys/dev/evdev/input-event-codes.h
  head/sys/dev/evdev/input.h

Modified: head/sys/dev/evdev/input-event-codes.h
==
--- head/sys/dev/evdev/input-event-codes.h  Mon May  4 10:59:17 2020
(r360624)
+++ head/sys/dev/evdev/input-event-codes.h  Mon May  4 11:00:24 2020
(r360625)
@@ -453,10 +453,12 @@
 #defineKEY_TITLE   0x171
 #defineKEY_SUBTITLE0x172
 #defineKEY_ANGLE   0x173
-#defineKEY_ZOOM0x174
+#defineKEY_FULL_SCREEN 0x174   /* AC View Toggle */
+#defineKEY_ZOOMKEY_FULL_SCREEN
 #defineKEY_MODE0x175
 #defineKEY_KEYBOARD0x176
-#defineKEY_SCREEN  0x177
+#defineKEY_ASPECT_RATIO0x177   /* HUTRR37: Aspect */
+#defineKEY_SCREEN  KEY_ASPECT_RATIO
 #defineKEY_PC  0x178   /* Media Select Computer */
 #defineKEY_TV  0x179   /* Media Select TV */
 #defineKEY_TV2 0x17a   /* Media Select Cable */
@@ -618,6 +620,7 @@
 #defineKEY_SCREENSAVER 0x245   /* AL Screen Saver */
 #defineKEY_VOICECOMMAND0x246   /* Listening Voice 
Command */
 #defineKEY_ASSISTANT   0x247   /* AL Context-aware desktop 
assistant */
+#defineKEY_KBD_LAYOUT_NEXT 0x248   /* AC Next Keyboard Layout 
Select */
 
 #defineKEY_BRIGHTNESS_MIN  0x250   /* Set Brightness to 
Minimum */
 #defineKEY_BRIGHTNESS_MAX  0x251   /* Set Brightness to 
Maximum */
@@ -660,7 +663,87 @@
  */
 #defineKEY_DATA0x277
 #defineKEY_ONSCREEN_KEYBOARD   0x278
+/* Electronic privacy screen control */
+#defineKEY_PRIVACY_SCREEN_TOGGLE   0x279
 
+/* Select an area of screen to be copied */
+#defineKEY_SELECTIVE_SCREENSHOT0x27a
+
+/*
+ * Some keyboards have keys which do not have a defined meaning, these keys
+ * are intended to be programmed / bound to macros by the user. For most
+ * keyboards with these macro-keys the key-sequence to inject, or action to
+ * take, is all handled by software on the host side. So from the kernel's
+ * point of view these are just normal keys.
+ *
+ * The KEY_MACRO# codes below are intended for such keys, which may be labeled
+ * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys
+ * where the marking on the key does indicate a defined meaning / purpose.
+ *
+ * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing
+ * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO
+ * define MUST be added.
+ */
+#defineKEY_MACRO1  0x290
+#defineKEY_MACRO2  0x291
+#defineKEY_MACRO3  0x292
+#defineKEY_MACRO4  0x293
+#defineKEY_MACRO5  0x294
+#defineKEY_MACRO6  0x295
+#defineKEY_MACRO7  0x296
+#defineKEY_MACRO8  0x297
+#defineKEY_MACRO9  0x298
+#defineKEY_MACRO10 0x299
+#defineKEY_MACRO11 0x29a
+#defineKEY_MACRO12 0x29b
+#defineKEY_MACRO13 0x29c
+#defineKEY_MACRO14 0x29d
+#defineKEY_MACRO15 0x29e
+#defineKEY_MACRO16 0x29f
+#defineKEY_MACRO17 0x2a0
+#defineKEY_MACRO18 0x2a1
+#defineKEY_MACRO19 0x2a2
+#defineKEY_MACRO20 0x2a3
+#defineKEY_MACRO21 0x2a4
+#defineKEY_MACRO22 0x2a5
+#defineKEY_MACRO23 0x2a6
+#defineKEY_MACRO24 0x2a7
+#defineKEY_MACRO25 0x2a8
+#defineKEY_MACRO26 0x2a9
+#defineKEY_MACRO27 0x2aa
+#defineKEY_MACRO28 0x2ab
+#defineKEY_MACRO29 0x2ac
+#defineKEY_MACRO30 0x2ad
+
+/*
+ * Some keyboards with the macro-keys described above have some extra keys
+ * for controlling the host-side software responsible for the macro handling:
+ * -A macro recording start/stop key. Note that not all keyboards which emit
+ *  KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if
+ *  

svn commit: r360624 - head/sys/dev/evdev

2020-05-04 Thread Vladimir Kondratyev
Author: wulf
Date: Mon May  4 10:59:17 2020
New Revision: 360624
URL: https://svnweb.freebsd.org/changeset/base/360624

Log:
  [evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.
  
  "F lock" is a switch between two sets of scancodes for function keys F1-F12
  found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
  pressed, then F1-F12 act as function keys and produce usual keyscans for
  these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
  but prefixed with E0.
  Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.
  
  [1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
  [2] https://reviews.freebsd.org/D21565
  
  MFC after:2 weeks

Modified:
  head/sys/dev/evdev/evdev_utils.c

Modified: head/sys/dev/evdev/evdev_utils.c
==
--- head/sys/dev/evdev/evdev_utils.cMon May  4 10:10:07 2020
(r360623)
+++ head/sys/dev/evdev/evdev_utils.cMon May  4 10:59:17 2020
(r360624)
@@ -166,16 +166,16 @@ static uint16_t evdev_at_set1_scancodes[] = {
NONE,   NONE,   KEY_VOLUMEDOWN, NONE,
KEY_VOLUMEUP,   NONE,   KEY_HOMEPAGE,   NONE,
NONE,   KEY_KPSLASH,NONE,   KEY_SYSRQ,
-   KEY_RIGHTALT,   NONE,   NONE,   NONE,
-   NONE,   NONE,   NONE,   NONE,
+   KEY_RIGHTALT,   NONE,   NONE,   KEY_F13,
+   KEY_F14,KEY_F15,KEY_F16,KEY_F17,
/* 0x40 - 0x5f. 0xE0 prefixed */
-   NONE,   NONE,   NONE,   NONE,
-   NONE,   NONE,   KEY_PAUSE,  KEY_HOME,
+   KEY_F18,KEY_F19,KEY_F20,KEY_F21,
+   KEY_F22,NONE,   KEY_PAUSE,  KEY_HOME,
KEY_UP, KEY_PAGEUP, NONE,   KEY_LEFT,
NONE,   KEY_RIGHT,  NONE,   KEY_END,
KEY_DOWN,   KEY_PAGEDOWN,   KEY_INSERT, KEY_DELETE,
-   NONE,   NONE,   NONE,   NONE,
-   NONE,   NONE,   NONE,   KEY_LEFTMETA,
+   NONE,   NONE,   NONE,   KEY_F23,
+   KEY_F24,NONE,   NONE,   KEY_LEFTMETA,
KEY_RIGHTMETA,  KEY_MENU,   KEY_POWER,  KEY_SLEEP,
/* 0x60 - 0x7f. 0xE0 prefixed */
NONE,   NONE,   NONE,   KEY_WAKEUP,
___
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: r360623 - head/sys/compat/linuxkpi/common/include/linux

2020-05-04 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  4 10:10:07 2020
New Revision: 360623
URL: https://svnweb.freebsd.org/changeset/base/360623

Log:
  Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI.
  No need to compute value twice.
  
  No functional change intended.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/scatterlist.h

Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h
==
--- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May  4 
09:58:45 2020(r360622)
+++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May  4 
10:10:07 2020(r360623)
@@ -416,6 +416,8 @@ sg_page_count(struct scatterlist *sg)
 static inline bool
 __sg_page_iter_next(struct sg_page_iter *piter)
 {
+   unsigned int pgcount;
+
if (piter->internal.nents == 0)
return (0);
if (piter->sg == NULL)
@@ -424,8 +426,11 @@ __sg_page_iter_next(struct sg_page_iter *piter)
piter->sg_pgoffset += piter->internal.pg_advance;
piter->internal.pg_advance = 1;
 
-   while (piter->sg_pgoffset >= sg_page_count(piter->sg)) {
-   piter->sg_pgoffset -= sg_page_count(piter->sg);
+   while (1) {
+   pgcount = sg_page_count(piter->sg);
+   if (likely(piter->sg_pgoffset < pgcount))
+   break;
+   piter->sg_pgoffset -= pgcount;
piter->sg = sg_next(piter->sg);
if (--piter->internal.nents == 0)
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: r360622 - head/sys/compat/linuxkpi/common/include/linux

2020-05-04 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  4 09:58:45 2020
New Revision: 360622
URL: https://svnweb.freebsd.org/changeset/base/360622

Log:
  Implement more scatter and gather functions in the LinuxKPI.
  
  Differential Revision:https://reviews.freebsd.org/D24611
  Submitted by: ashafer_badland.io (Austin Shafer)
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/scatterlist.h

Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h
==
--- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May  4 
08:05:01 2020(r360621)
+++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May  4 
09:58:45 2020(r360622)
@@ -66,6 +66,10 @@ struct sg_page_iter {
} internal;
 };
 
+struct sg_dma_page_iter {
+   struct sg_page_iter base;
+};
+
 #defineSCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1))
 
 #defineSG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist))
@@ -85,6 +89,8 @@ struct sg_page_iter {
 #definefor_each_sg_page(sgl, iter, nents, pgoffset)
\
for (_sg_iter_init(sgl, iter, nents, pgoffset); \
 (iter)->sg; _sg_iter_next(iter))
+#definefor_each_sg_dma_page(sgl, iter, nents, pgoffset)
\
+   for_each_sg_page(sgl, &(iter)->base, nents, pgoffset)
 
 #definefor_each_sg(sglist, sg, sgmax, iter)
\
for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg))
@@ -404,6 +410,8 @@ sg_page_count(struct scatterlist *sg)
 {
return (PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT);
 }
+#definesg_dma_page_count(sg) \
+   sg_page_count(sg)
 
 static inline bool
 __sg_page_iter_next(struct sg_page_iter *piter)
@@ -426,6 +434,8 @@ __sg_page_iter_next(struct sg_page_iter *piter)
}
return (1);
 }
+#define__sg_page_iter_dma_next(itr) \
+   __sg_page_iter_next(&(itr)->base)
 
 static inline void
 _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter,
@@ -443,11 +453,20 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_
}
 }
 
-static inline dma_addr_t
-sg_page_iter_dma_address(struct sg_page_iter *spi)
-{
-   return (spi->sg->dma_address + (spi->sg_pgoffset << PAGE_SHIFT));
-}
+/*
+ * sg_page_iter_dma_address() is implemented as a macro because it
+ * needs to accept two different and identical structure types. This
+ * allows both old and new code to co-exist. The compile time assert
+ * adds some safety, that the structure sizes match.
+ */
+#definesg_page_iter_dma_address(spi) ({\
+   struct sg_page_iter *__spi = (void *)(spi); \
+   dma_addr_t __dma_address;   \
+   CTASSERT(sizeof(*(spi)) == sizeof(*__spi)); \
+   __dma_address = __spi->sg->dma_address +\
+   (__spi->sg_pgoffset << PAGE_SHIFT); \
+   __dma_address;  \
+})
 
 static inline struct page *
 sg_page_iter_page(struct sg_page_iter *piter)
___
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: r360621 - head/sys/compat/linuxkpi/common/src

2020-05-04 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  4 08:05:01 2020
New Revision: 360621
URL: https://svnweb.freebsd.org/changeset/base/360621

Log:
  Fix warning about sleeping with non-sleepable lock when allocating
  "current" from linux_cdev_pager_populate() in the LinuxKPI:
  
  Backtrace:
  witness_debugger()
  witness_warn()
  uma_zalloc_arg()
  malloc()
  linux_alloc_current()
  linux_cdev_pager_populate()
  vm_fault()
  vm_fault_trap()
  trap_pfault()
  trap()
  calltrap()
  
  Suggested by: avg@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon May  4 07:57:55 
2020(r360620)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Mon May  4 08:05:01 
2020(r360621)
@@ -525,14 +525,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde
struct vm_area_struct *vmap;
int err;
 
-   linux_set_current(curthread);
-
/* get VM area structure */
vmap = linux_cdev_handle_find(vm_obj->handle);
MPASS(vmap != NULL);
MPASS(vmap->vm_private_data == vm_obj->handle);
 
VM_OBJECT_WUNLOCK(vm_obj);
+
+   linux_set_current(curthread);
 
down_write(>vm_mm->mmap_sem);
if (unlikely(vmap->vm_ops == 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: r360620 - in stable/12/sys: sys x86/include

2020-05-04 Thread Hans Petter Selasky
Author: hselasky
Date: Mon May  4 07:57:55 2020
New Revision: 360620
URL: https://svnweb.freebsd.org/changeset/base/360620

Log:
  Move id_mapped to end of bus_dma_impl structure to preserve KPI for 12-stable.
  
  This is a direct commit.
  
  Bump the __FreeBSD_version to force recompilation of external kernel modules.
  
  Reported by:  kib @
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/sys/param.h
  stable/12/sys/x86/include/busdma_impl.h

Modified: stable/12/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Mon May  4 05:49:11 2020(r360619)
+++ stable/12/sys/sys/param.h   Mon May  4 07:57:55 2020(r360620)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1201515  /* Master, propagated to newvers */
+#define __FreeBSD_version 1201516  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: stable/12/sys/x86/include/busdma_impl.h
==
--- stable/12/sys/x86/include/busdma_impl.h Mon May  4 05:49:11 2020
(r360619)
+++ stable/12/sys/x86/include/busdma_impl.h Mon May  4 07:57:55 2020
(r360620)
@@ -62,7 +62,6 @@ struct bus_dma_impl {
void *lockfuncarg, bus_dma_tag_t *dmat);
int (*tag_destroy)(bus_dma_tag_t dmat);
int (*tag_set_domain)(bus_dma_tag_t);
-   bool (*id_mapped)(bus_dma_tag_t, vm_paddr_t, bus_size_t);
int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp);
int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map);
int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags,
@@ -85,6 +84,7 @@ struct bus_dma_impl {
void (*map_unload)(bus_dma_tag_t dmat, bus_dmamap_t map);
void (*map_sync)(bus_dma_tag_t dmat, bus_dmamap_t map,
bus_dmasync_op_t op);
+   bool (*id_mapped)(bus_dma_tag_t, vm_paddr_t, bus_size_t);
 };
 
 void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op);
___
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: r360569 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys

2020-05-04 Thread Li-Wen Hsu
On Sun, May 3, 2020 at 6:39 AM Gleb Smirnoff  wrote:
>
> Author: glebius
> Date: Sat May  2 22:39:26 2020
> New Revision: 360569
> URL: https://svnweb.freebsd.org/changeset/base/360569
...
> Modified: head/sys/kern/uipc_mbuf.c
> ==
> --- head/sys/kern/uipc_mbuf.c   Sat May  2 20:47:58 2020(r360568)
> +++ head/sys/kern/uipc_mbuf.c   Sat May  2 22:39:26 2020(r360569)
> @@ -163,11 +163,11 @@ CTASSERT(offsetof(struct mbuf, m_pktdat) % 8 == 0);
>  #if defined(__LP64__)
>  CTASSERT(offsetof(struct mbuf, m_dat) == 32);
>  CTASSERT(sizeof(struct pkthdr) == 56);
> -CTASSERT(sizeof(struct m_ext) == 168);
> +CTASSERT(sizeof(struct m_ext) == 160);
>  #else
>  CTASSERT(offsetof(struct mbuf, m_dat) == 24);
>  CTASSERT(sizeof(struct pkthdr) == 48);
> -CTASSERT(sizeof(struct m_ext) == 184);
> +CTASSERT(sizeof(struct m_ext) == 180);
>  #endif

This assertion is failing on powerpc and powerpcspe, can you check if
the constant needs adjustment?

Thanks,
Li-Wen
___
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"