svn commit: r353336 - head/sys/netinet6

2019-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Wed Oct  9 05:52:07 2019
New Revision: 353336
URL: https://svnweb.freebsd.org/changeset/base/353336

Log:
  Revert changes to rip6_bind() from r353292.  This function is always
  called in syscall context, so it must enter epoch itself.  This
  changeset originates from early version of the patch, and somehow
  slipped to the final version.
  
  Reported by:  pho

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==
--- head/sys/netinet6/raw_ip6.c Wed Oct  9 05:28:10 2019(r353335)
+++ head/sys/netinet6/raw_ip6.c Wed Oct  9 05:52:07 2019(r353336)
@@ -734,12 +734,12 @@ rip6_disconnect(struct socket *so)
 static int
 rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 {
+   struct epoch_tracker et;
struct inpcb *inp;
struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam;
struct ifaddr *ifa = NULL;
int error = 0;
 
-   NET_EPOCH_ASSERT();
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("rip6_bind: inp == NULL"));
 
@@ -752,14 +752,20 @@ rip6_bind(struct socket *so, struct sockaddr *nam, str
if ((error = sa6_embedscope(addr, V_ip6_use_defzone)) != 0)
return (error);
 
+   NET_EPOCH_ENTER(et);
if (!IN6_IS_ADDR_UNSPECIFIED(>sin6_addr) &&
-   (ifa = ifa_ifwithaddr((struct sockaddr *)addr)) == NULL)
+   (ifa = ifa_ifwithaddr((struct sockaddr *)addr)) == NULL) {
+   NET_EPOCH_EXIT(et);
return (EADDRNOTAVAIL);
+   }
if (ifa != NULL &&
((struct in6_ifaddr *)ifa)->ia6_flags &
(IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|
-IN6_IFF_DETACHED|IN6_IFF_DEPRECATED))
+IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) {
+   NET_EPOCH_EXIT(et);
return (EADDRNOTAVAIL);
+   }
+   NET_EPOCH_EXIT(et);
INP_INFO_WLOCK(_ripcbinfo);
INP_WLOCK(inp);
inp->in6p_laddr = addr->sin6_addr;
___
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: r353335 - head/usr.sbin/bsdinstall/scripts

2019-10-08 Thread Yuri Pankov
Author: yuripv
Date: Wed Oct  9 05:28:10 2019
New Revision: 353335
URL: https://svnweb.freebsd.org/changeset/base/353335

Log:
  bsdinstall: fix ESP detection for auto ZFS layout
  
  Pass the list of user selected disks from zfsboot to bootconfig so that
  the latter doesn't rely on ESP autodetection that apparently fails for
  some cases, e.g. memstick installation with nvme (boot) and sata drives.
  
  While here, fix printing of debug messages in bootconfig.
  
  Reviewed by:  bcran, imp, tsoome
  Differential Revision:https://reviews.freebsd.org/D21930

Modified:
  head/usr.sbin/bsdinstall/scripts/bootconfig
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/bootconfig
==
--- head/usr.sbin/bsdinstall/scripts/bootconfig Wed Oct  9 02:02:22 2019
(r353334)
+++ head/usr.sbin/bsdinstall/scripts/bootconfig Wed Oct  9 05:28:10 2019
(r353335)
@@ -27,6 +27,9 @@
 #
 # $FreeBSD$
 
+BSDCFG_SHARE="/usr/share/bsdconfig"
+. $BSDCFG_SHARE/common.subr || exit 1
+
 die() {
echo $*
exit 1
@@ -47,7 +50,8 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i
 fi
 
 if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then
-   UFSBOOT_ESPS=$(cat /tmp/bsdinstall-esps)
+   UFSBOOT_ESPS=$(cat /tmp/bsdinstall-esps 2>/dev/null)
+   ZFSBOOT_DISKS=$(cat /tmp/bsdinstall-zfsboot 2>/dev/null)
num_esps=0
 
if [ -n "$ZFSBOOT_DISKS" ]; then
@@ -119,20 +123,20 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" 
fi
 
for esp in $ESPS; do
-   echo "Formatting /dev/${esp} as FAT32"
+   f_dprintf "Formatting /dev/${esp} as FAT32"
newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1
if [ $? -ne 0 ]; then
die "Failed to format ESP $esp as FAT32"
fi
 
mntpt=$(mktemp -d /tmp/stand-test.XX)
-   echo "Mounting ESP /dev/${esp}"
+   f_dprintf "Mounting ESP /dev/${esp}"
mount -t msdosfs "/dev/${esp}" "${mntpt}"
if [ $? -ne 0 ]; then
die "Failed to mount ESP ${dev} on ${mntpt}"
fi
 
-   echo "Installing loader.efi onto ESP"
+   f_dprintf "Installing loader.efi onto ESP"
mkdir -p "$mntpt/EFI/freebsd"
cp "$BSDINSTALL_CHROOT/boot/loader.efi" 
"${mntpt}/EFI/freebsd/loader.efi"
 
@@ -142,14 +146,14 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" 
bootlabel="FreeBSD"
fi
 
-   echo "Creating UEFI boot entry"
+   f_dprintf "Creating UEFI boot entry"
efibootmgr --create --activate --label "$bootlabel" --loader 
"${mntpt}/EFI/freebsd/loader.efi" > /dev/null
 
-   echo "Unmounting ESP"
+   f_dprintf "Unmounting ESP"
umount "${mntpt}"
rmdir "${mntpt}"
 
-   echo "Finished configuring /dev/${esp} as ESP"
+   f_dprintf "Finished configuring /dev/${esp} as ESP"
done
 fi
 

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootWed Oct  9 02:02:22 2019
(r353334)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootWed Oct  9 05:28:10 2019
(r353335)
@@ -1656,6 +1656,9 @@ while :; do
zfs_create_boot "$ZFSBOOT_POOL_NAME" \
"$vdev_type" $ZFSBOOT_DISKS || continue
 
+   # To be reused by bootconfig
+   echo "$ZFSBOOT_DISKS" > /tmp/bsdinstall-zfsboot
+
break # to success
;;
?" $msg_pool_type_disks")
___
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: r353334 - head/lib/libthr/arch/riscv/include

2019-10-08 Thread Mitchell Horne
Author: mhorne
Date: Wed Oct  9 02:02:22 2019
New Revision: 353334
URL: https://svnweb.freebsd.org/changeset/base/353334

Log:
  RISC-V: Fix an alignment warning in libthr
  
  Compiling with clang gives a loss-of-alignment error due the cast to
  uint8_t *. Since the TLS is always tcb aligned and TP_OFFSET is defined
  as sizeof(struct tcb) we can guarantee there is no misalignment. Silence
  the error by moving the offset into the inline assembly.
  
  Reviewed by:  br
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D21926

Modified:
  head/lib/libthr/arch/riscv/include/pthread_md.h

Modified: head/lib/libthr/arch/riscv/include/pthread_md.h
==
--- head/lib/libthr/arch/riscv/include/pthread_md.h Tue Oct  8 23:52:04 
2019(r35)
+++ head/lib/libthr/arch/riscv/include/pthread_md.h Wed Oct  9 02:02:22 
2019(r353334)
@@ -62,7 +62,7 @@ static __inline void
 _tcb_set(struct tcb *tcb)
 {
 
-   __asm __volatile("mv tp, %0" :: "r"((uint8_t *)tcb + TP_OFFSET));
+   __asm __volatile("addi tp, %0, %1" :: "r"(tcb), "I"(TP_OFFSET));
 }
 
 /*
@@ -71,11 +71,11 @@ _tcb_set(struct tcb *tcb)
 static __inline struct tcb *
 _tcb_get(void)
 {
-   register uint8_t *_tp;
+   struct tcb *_tcb;
 
-   __asm __volatile("mv %0, tp" : "=r"(_tp));
+   __asm __volatile("addi %0, tp, %1" : "=r"(_tcb) : "I"(-TP_OFFSET));
 
-   return ((struct tcb *)(_tp - TP_OFFSET));
+   return (_tcb);
 }
 
 static __inline struct pthread *
___
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: r353333 - head/tests/sys/kern

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 23:52:04 2019
New Revision: 35
URL: https://svnweb.freebsd.org/changeset/base/35

Log:
  Fix a bug in r353332 that snuck in with a last-minute adjustment.
  
  Reported by:  Jenkins
  MFC with: r353332
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/kern/unix_passfd_test.c

Modified: head/tests/sys/kern/unix_passfd_test.c
==
--- head/tests/sys/kern/unix_passfd_test.c  Tue Oct  8 23:35:23 2019
(r353332)
+++ head/tests/sys/kern/unix_passfd_test.c  Tue Oct  8 23:52:04 2019
(r35)
@@ -659,7 +659,7 @@ ATF_TC_BODY(empty_rights_message, tc)
len = recvmsg(fd[1], , 0);
ATF_REQUIRE_MSG(len == 0, "recvmsg failed: %s", strerror(errno));
ATF_REQUIRE(msghdr.msg_controllen = CMSG_SPACE(sizeof(int)));
-   error = close((int *)CMSG_DATA(msghdr.msg_control));
+   error = close(*(int *)CMSG_DATA(msghdr.msg_control));
ATF_REQUIRE_MSG(error == 0, "close failed: %s", strerror(errno));
 
/*
@@ -685,7 +685,7 @@ ATF_TC_BODY(empty_rights_message, tc)
len = recvmsg(fd[1], , 0);
ATF_REQUIRE_MSG(len == 0, "recvmsg failed: %s", strerror(errno));
ATF_REQUIRE(msghdr.msg_controllen = CMSG_SPACE(sizeof(int)));
-   error = close((int *)CMSG_DATA(msghdr.msg_control));
+   error = close(*(int *)CMSG_DATA(msghdr.msg_control));
ATF_REQUIRE_MSG(error == 0, "close failed: %s", strerror(errno));
 
(void)close(putfd);
___
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: r353332 - head/tests/sys/kern

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 23:35:23 2019
New Revision: 353332
URL: https://svnweb.freebsd.org/changeset/base/353332

Log:
  Add a regression test for r353331.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/kern/unix_passfd_test.c

Modified: head/tests/sys/kern/unix_passfd_test.c
==
--- head/tests/sys/kern/unix_passfd_test.c  Tue Oct  8 23:34:48 2019
(r353331)
+++ head/tests/sys/kern/unix_passfd_test.c  Tue Oct  8 23:35:23 2019
(r353332)
@@ -620,6 +620,77 @@ ATF_TC_BODY(copyout_rights_error, tc)
closesocketpair(fd);
 }
 
+/*
+ * Verify that we can handle empty rights messages.  Try sending two SCM_RIGHTS
+ * messages with a single call, one empty and one containing a single FD.
+ */
+ATF_TC_WITHOUT_HEAD(empty_rights_message);
+ATF_TC_BODY(empty_rights_message, tc)
+{
+   struct iovec iov;
+   struct msghdr msghdr;
+   char *cm, message[CMSG_SPACE(0) + CMSG_SPACE(sizeof(int))];
+   ssize_t len;
+   int error, fd[2], putfd;
+
+   domainsocketpair(fd);
+   devnull();
+
+   /*
+* First, try sending an empty message followed by a non-empty message.
+*/
+   cm = message;
+   putfds(cm, -1, 0);
+   cm += CMSG_SPACE(0);
+   putfds(cm, putfd, 1);
+
+   memset(, 0, sizeof(msghdr));
+   iov.iov_base = NULL;
+   iov.iov_len = 0;
+   msghdr.msg_control = message;
+   msghdr.msg_controllen = sizeof(message);
+   msghdr.msg_iov = 
+   msghdr.msg_iovlen = 1;
+
+   len = sendmsg(fd[0], , 0);
+   ATF_REQUIRE_MSG(len == 0, "sendmsg failed: %s", strerror(errno));
+
+   /* Only the non-empty message should be received. */
+   len = recvmsg(fd[1], , 0);
+   ATF_REQUIRE_MSG(len == 0, "recvmsg failed: %s", strerror(errno));
+   ATF_REQUIRE(msghdr.msg_controllen = CMSG_SPACE(sizeof(int)));
+   error = close((int *)CMSG_DATA(msghdr.msg_control));
+   ATF_REQUIRE_MSG(error == 0, "close failed: %s", strerror(errno));
+
+   /*
+* Now try sending with the non-empty message before the empty message.
+*/
+   cm = message;
+   putfds(cm, putfd, 1);
+   cm += CMSG_SPACE(sizeof(int));
+   putfds(cm, -1, 0);
+
+   memset(, 0, sizeof(msghdr));
+   iov.iov_base = NULL;
+   iov.iov_len = 0;
+   msghdr.msg_control = message;
+   msghdr.msg_controllen = CMSG_SPACE(sizeof(int));
+   msghdr.msg_iov = 
+   msghdr.msg_iovlen = 1;
+
+   len = sendmsg(fd[0], , 0);
+   ATF_REQUIRE_MSG(len == 0, "sendmsg failed: %s", strerror(errno));
+
+   /* Only the non-empty message should be received. */
+   len = recvmsg(fd[1], , 0);
+   ATF_REQUIRE_MSG(len == 0, "recvmsg failed: %s", strerror(errno));
+   ATF_REQUIRE(msghdr.msg_controllen = CMSG_SPACE(sizeof(int)));
+   error = close((int *)CMSG_DATA(msghdr.msg_control));
+   ATF_REQUIRE_MSG(error == 0, "close failed: %s", strerror(errno));
+
+   (void)close(putfd);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -633,6 +704,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, rights_creds_payload);
ATF_TP_ADD_TC(tp, truncated_rights);
ATF_TP_ADD_TC(tp, copyout_rights_error);
+   ATF_TP_ADD_TC(tp, empty_rights_message);
 
return (atf_no_error());
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r353331 - head/sys/kern

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 23:34:48 2019
New Revision: 353331
URL: https://svnweb.freebsd.org/changeset/base/353331

Log:
  Fix handling of empty SCM_RIGHTS messages.
  
  As unp_internalize() processes the input control messages, it builds
  an output mbuf chain containing the internalized representations of
  those messages.  In one special case, that of an empty SCM_RIGHTS
  message, the message is simply discarded.  However, the loop which
  appends mbufs to the output chain assumed that each iteration would
  produce an mbuf, resulting in a null pointer dereference if an empty
  SCM_RIGHTS message was followed by a non-empty message.
  
  Fix this by advancing the output mbuf chain tail pointer only if an
  internalized control message was produced.
  
  Reported by:  syzbot+1b5cced0f7fad26ae...@syzkaller.appspotmail.com
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Tue Oct  8 21:40:42 2019(r353330)
+++ head/sys/kern/uipc_usrreq.c Tue Oct  8 23:34:48 2019(r353331)
@@ -2318,7 +2318,8 @@ unp_internalize(struct mbuf **controlp, struct thread 
goto out;
}
 
-   controlp = &(*controlp)->m_next;
+   if (*controlp != NULL)
+   controlp = &(*controlp)->m_next;
if (CMSG_SPACE(datalen) < clen) {
clen -= CMSG_SPACE(datalen);
cm = (struct cmsghdr *)
___
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: r353330 - head/sys/dev/cxgbe/tom

2019-10-08 Thread John Baldwin
Author: jhb
Date: Tue Oct  8 21:40:42 2019
New Revision: 353330
URL: https://svnweb.freebsd.org/changeset/base/353330

Log:
  Add support for KTLS in the Chelsio TOE module.
  
  This adds a TOE hook to allocate a KTLS session.  It also recognizes
  TLS mbufs in the socket buffer and sends those to the NIC using a TLS
  work request to encrypt the record before segmenting it.
  
  TOE TLS support must be enabled via the dev.t6nex..tls sysctl in
  addition to enabling KTLS.
  
  Reviewed by:  np, gallatin
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D21891

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/cxgbe/tom/t4_tls.h
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Tue Oct  8 21:39:51 2019
(r353329)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Tue Oct  8 21:40:42 2019
(r353330)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
+#include "opt_kern_tls.h"
 #include "opt_ratelimit.h"
 
 #ifdef TCP_OFFLOAD
@@ -728,9 +729,20 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep
for (m = sndptr; m != NULL; m = m->m_next) {
int n;
 
-   if (m->m_flags & M_NOMAP)
+   if (m->m_flags & M_NOMAP) {
+#ifdef KERN_TLS
+   if (m->m_ext.ext_pgs->tls != NULL) {
+   toep->flags |= TPF_KTLS;
+   if (plen == 0) {
+   SOCKBUF_UNLOCK(sb);
+   t4_push_ktls(sc, toep, 0);
+   return;
+   }
+   break;
+   }
+#endif
n = sglist_count_mb_ext_pgs(m);
-   else
+   } else
n = sglist_count(mtod(m, void *), m->m_len);
 
nsegs += n;
@@ -1086,6 +1098,22 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, 
t4_close_conn(sc, toep);
 }
 
+static inline void
+t4_push_data(struct adapter *sc, struct toepcb *toep, int drop)
+{
+
+   if (ulp_mode(toep) == ULP_MODE_ISCSI)
+   t4_push_pdus(sc, toep, drop);
+   else if (tls_tx_key(toep) && toep->tls.mode == TLS_MODE_TLSOM)
+   t4_push_tls_records(sc, toep, drop);
+#ifdef KERN_TLS
+   else if (toep->flags & TPF_KTLS)
+   t4_push_ktls(sc, toep, drop);
+#endif
+   else
+   t4_push_frames(sc, toep, drop);
+}
+
 int
 t4_tod_output(struct toedev *tod, struct tcpcb *tp)
 {
@@ -1100,12 +1128,7 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp)
("%s: inp %p dropped.", __func__, inp));
KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
 
-   if (ulp_mode(toep) == ULP_MODE_ISCSI)
-   t4_push_pdus(sc, toep, 0);
-   else if (tls_tx_key(toep))
-   t4_push_tls_records(sc, toep, 0);
-   else
-   t4_push_frames(sc, toep, 0);
+   t4_push_data(sc, toep, 0);
 
return (0);
 }
@@ -1125,14 +1148,8 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp)
KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
 
toep->flags |= TPF_SEND_FIN;
-   if (tp->t_state >= TCPS_ESTABLISHED) {
-   if (ulp_mode(toep) == ULP_MODE_ISCSI)
-   t4_push_pdus(sc, toep, 0);
-   else if (tls_tx_key(toep))
-   t4_push_tls_records(sc, toep, 0);
-   else
-   t4_push_frames(sc, toep, 0);
-   }
+   if (tp->t_state >= TCPS_ESTABLISHED)
+   t4_push_data(sc, toep, 0);
 
return (0);
 }
@@ -1742,12 +1759,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header 
 #endif
toep->flags &= ~TPF_TX_SUSPENDED;
CURVNET_SET(toep->vnet);
-   if (ulp_mode(toep) == ULP_MODE_ISCSI)
-   t4_push_pdus(sc, toep, plen);
-   else if (tls_tx_key(toep))
-   t4_push_tls_records(sc, toep, plen);
-   else
-   t4_push_frames(sc, toep, plen);
+   t4_push_data(sc, toep, plen);
CURVNET_RESTORE();
} else if (plen > 0) {
struct sockbuf *sb = >so_snd;
@@ -1775,7 +1787,8 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header 
tid, plen);
 #endif
sbdrop_locked(sb, plen);
-   if (tls_tx_key(toep)) {
+   if (tls_tx_key(toep) &&
+  

svn commit: r353329 - head/lib/msun/src

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 21:39:51 2019
New Revision: 353329
URL: https://svnweb.freebsd.org/changeset/base/353329

Log:
  msun: Silence new harmless -Wimplicit-int-float-conversion warnings
  
  Clang from trunk recently added a warning for when implicit int-to-float
  conversions cause a loss of precision. The code in question is designed
  to be able to handle that, so add explicit casts to silence this.
  
  Submitted by: James Clarke 
  Reviewed by:  dim
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D21913

Modified:
  head/lib/msun/src/s_lround.c

Modified: head/lib/msun/src/s_lround.c
==
--- head/lib/msun/src/s_lround.cTue Oct  8 21:34:06 2019
(r353328)
+++ head/lib/msun/src/s_lround.cTue Oct  8 21:39:51 2019
(r353329)
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
  * that everything is in range.  At compile time, INRANGE(x) should reduce to
  * two floating-point comparisons in the former case, or TRUE otherwise.
  */
-static const type dtype_min = DTYPE_MIN - 0.5;
-static const type dtype_max = DTYPE_MAX + 0.5;
-#defineINRANGE(x)  (dtype_max - DTYPE_MAX != 0.5 || \
+static const type dtype_min = (type)DTYPE_MIN - 0.5;
+static const type dtype_max = (type)DTYPE_MAX + 0.5;
+#defineINRANGE(x)  (dtype_max - (type)DTYPE_MAX != 0.5 || \
 ((x) > dtype_min && (x) < dtype_max))
 
 dtype
___
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: r353328 - in head/sys: kern netinet sys

2019-10-08 Thread John Baldwin
Author: jhb
Date: Tue Oct  8 21:34:06 2019
New Revision: 353328
URL: https://svnweb.freebsd.org/changeset/base/353328

Log:
  Add a TOE KTLS mode and a TOE hook for allocating TLS sessions.
  
  This adds the glue to allocate TLS sessions and invokes it from
  the TLS enable socket option handler.  This also adds some counters
  for active TOE sessions.
  
  The TOE KTLS mode is returned by getsockopt(TLSTX_TLS_MODE) when
  TOE KTLS is in use on a socket, but cannot be set via setsockopt().
  
  To simplify various checks, a TLS session now includes an explicit
  'mode' member set to the value returned by TLSTX_TLS_MODE.  Various
  places that used to check 'sw_encrypt' against NULL to determine
  software vs ifnet (NIC) TLS now check 'mode' instead.
  
  Reviewed by:  np, gallatin
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D21891

Modified:
  head/sys/kern/kern_sendfile.c
  head/sys/kern/uipc_ktls.c
  head/sys/kern/uipc_socket.c
  head/sys/netinet/tcp.h
  head/sys/netinet/tcp_offload.c
  head/sys/netinet/tcp_offload.h
  head/sys/netinet/tcp_usrreq.c
  head/sys/netinet/toecore.c
  head/sys/netinet/toecore.h
  head/sys/sys/ktls.h

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Tue Oct  8 21:14:11 2019
(r353327)
+++ head/sys/kern/kern_sendfile.c   Tue Oct  8 21:34:06 2019
(r353328)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -295,7 +296,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i
 
mb_free_notready(sfio->m, sfio->npages);
 #ifdef KERN_TLS
-   } else if (sfio->tls != NULL && sfio->tls->sw_encrypt != NULL) {
+   } else if (sfio->tls != NULL && sfio->tls->mode == TCP_TLS_MODE_SW) {
/*
 * I/O operation is complete, but we still need to
 * encrypt.  We cannot do this in the interrupt thread
@@ -1028,7 +1029,7 @@ prepend_header:
 */
free(sfio, M_TEMP);
 #ifdef KERN_TLS
-   if (tls != NULL && tls->sw_encrypt != NULL) {
+   if (tls != NULL && tls->mode == TCP_TLS_MODE_SW) {
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, PRUS_NOTREADY, m, NULL, NULL, td);
soref(so);

Modified: head/sys/kern/uipc_ktls.c
==
--- head/sys/kern/uipc_ktls.c   Tue Oct  8 21:14:11 2019(r353327)
+++ head/sys/kern/uipc_ktls.c   Tue Oct  8 21:34:06 2019(r353328)
@@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 #include 
+#ifdef TCP_OFFLOAD
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -161,6 +164,10 @@ SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, sw, CTLFLAG_RD, 0
 "Software TLS session stats");
 SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, ifnet, CTLFLAG_RD, 0,
 "Hardware (ifnet) TLS session stats");
+#ifdef TCP_OFFLOAD
+SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, toe, CTLFLAG_RD, 0,
+"TOE TLS session stats");
+#endif
 
 static counter_u64_t ktls_sw_cbc;
 SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, cbc, CTLFLAG_RD, _sw_cbc,
@@ -199,6 +206,18 @@ SYSCTL_UINT(_kern_ipc_tls_ifnet, OID_AUTO, permitted, 
 _ifnet_permitted, 1,
 "Whether to permit hardware (ifnet) TLS sessions");
 
+#ifdef TCP_OFFLOAD
+static counter_u64_t ktls_toe_cbc;
+SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, cbc, CTLFLAG_RD,
+_toe_cbc,
+"Active number of TOE TLS sessions using AES-CBC");
+
+static counter_u64_t ktls_toe_gcm;
+SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, gcm, CTLFLAG_RD,
+_toe_gcm,
+"Active number of TOE TLS sessions using AES-GCM");
+#endif
+
 static MALLOC_DEFINE(M_KTLS, "ktls", "Kernel TLS");
 
 static void ktls_cleanup(struct ktls_session *tls);
@@ -325,6 +344,10 @@ ktls_init(void *dummy __unused)
ktls_ifnet_reset = counter_u64_alloc(M_WAITOK);
ktls_ifnet_reset_dropped = counter_u64_alloc(M_WAITOK);
ktls_ifnet_reset_failed = counter_u64_alloc(M_WAITOK);
+#ifdef TCP_OFFLOAD
+   ktls_toe_cbc = counter_u64_alloc(M_WAITOK);
+   ktls_toe_gcm = counter_u64_alloc(M_WAITOK);
+#endif
 
rm_init(_backends_lock, "ktls backends");
LIST_INIT(_backends);
@@ -607,7 +630,8 @@ ktls_cleanup(struct ktls_session *tls)
 {
 
counter_u64_add(ktls_offload_active, -1);
-   if (tls->free != NULL) {
+   switch (tls->mode) {
+   case TCP_TLS_MODE_SW:
MPASS(tls->be != NULL);
switch (tls->params.cipher_algorithm) {
case CRYPTO_AES_CBC:
@@ -618,7 +642,8 @@ ktls_cleanup(struct ktls_session *tls)
break;
}
tls->free(tls);
-   } else if (tls->snd_tag != NULL) {
+ 

svn commit: r353326 - in head: contrib/sendmail/mail.local lib/libc/tests/nss usr.bin/tip/tip usr.sbin/fwcontrol

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 21:14:09 2019
New Revision: 353326
URL: https://svnweb.freebsd.org/changeset/base/353326

Log:
  Fix various -Wpointer-compare warnings
  
  This warning (comparing a pointer against a zero character literal
  rather than NULL) has existed since GCC 7.1.0, and was recently added to
  Clang trunk.
  
  Almost all of these are harmless, except for fwcontrol's str2node, which
  needs to both guard against dereferencing a NULL pointer (though in
  practice it appears none of the callers will ever pass one in), as well
  as ensure it doesn't parse the empty string as node 0 due to strtol's
  awkward interface.
  
  Submitted by: James Clarke 
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D21914

Modified:
  head/contrib/sendmail/mail.local/mail.local.c
  head/lib/libc/tests/nss/getgr_test.c
  head/lib/libc/tests/nss/getproto_test.c
  head/lib/libc/tests/nss/getrpc_test.c
  head/lib/libc/tests/nss/getserv_test.c
  head/usr.bin/tip/tip/acu.c
  head/usr.sbin/fwcontrol/fwcontrol.c

Modified: head/contrib/sendmail/mail.local/mail.local.c
==
--- head/contrib/sendmail/mail.local/mail.local.c   Tue Oct  8 20:59:31 
2019(r353325)
+++ head/contrib/sendmail/mail.local/mail.local.c   Tue Oct  8 21:14:09 
2019(r353326)
@@ -393,7 +393,7 @@ main(argc, argv)
}
 
/* Non-LMTP from here on out */
-   if (*argv == '\0')
+   if (*argv == NULL)
usage();
 
/*

Modified: head/lib/libc/tests/nss/getgr_test.c
==
--- head/lib/libc/tests/nss/getgr_test.cTue Oct  8 20:59:31 2019
(r353325)
+++ head/lib/libc/tests/nss/getgr_test.cTue Oct  8 21:14:09 2019
(r353326)
@@ -153,7 +153,7 @@ compare_group(struct group *grp1, struct group *grp2, 
if (strcmp(*c1, *c2) != 0)
goto errfin;
 
-   if (*c1 != '\0' || *c2 != '\0')
+   if (*c1 != NULL || *c2 != NULL)
goto errfin;
 
return 0;
@@ -182,7 +182,7 @@ sdump_group(struct group *grp, char *buffer, size_t bu
buflen -= written;
 
if (grp->gr_mem != NULL) {
-   if (*(grp->gr_mem) != '\0') {
+   if (*(grp->gr_mem) != NULL) {
for (cp = grp->gr_mem; *cp; ++cp) {
written = snprintf(buffer, buflen, "%s%s",
cp == grp->gr_mem ? "" : ",", *cp);

Modified: head/lib/libc/tests/nss/getproto_test.c
==
--- head/lib/libc/tests/nss/getproto_test.c Tue Oct  8 20:59:31 2019
(r353325)
+++ head/lib/libc/tests/nss/getproto_test.c Tue Oct  8 21:14:09 2019
(r353326)
@@ -148,7 +148,7 @@ compare_protoent(struct protoent *pe1, struct protoent
if (strcmp(*c1, *c2) != 0)
goto errfin;
 
-   if ((*c1 != '\0') || (*c2 != '\0'))
+   if ((*c1 != NULL) || (*c2 != NULL))
goto errfin;
 
return 0;
@@ -177,7 +177,7 @@ sdump_protoent(struct protoent *pe, char *buffer, size
buflen -= written;
 
if (pe->p_aliases != NULL) {
-   if (*(pe->p_aliases) != '\0') {
+   if (*(pe->p_aliases) != NULL) {
for (cp = pe->p_aliases; *cp; ++cp) {
written = snprintf(buffer, buflen, " %s", *cp);
buffer += written;

Modified: head/lib/libc/tests/nss/getrpc_test.c
==
--- head/lib/libc/tests/nss/getrpc_test.c   Tue Oct  8 20:59:31 2019
(r353325)
+++ head/lib/libc/tests/nss/getrpc_test.c   Tue Oct  8 21:14:09 2019
(r353326)
@@ -147,7 +147,7 @@ compare_rpcent(struct rpcent *rpc1, struct rpcent *rpc
if (strcmp(*c1, *c2) != 0)
goto errfin;
 
-   if ((*c1 != '\0') || (*c2 != '\0'))
+   if ((*c1 != NULL) || (*c2 != NULL))
goto errfin;
 
return 0;
@@ -176,7 +176,7 @@ sdump_rpcent(struct rpcent *rpc, char *buffer, size_t 
buflen -= written;
 
if (rpc->r_aliases != NULL) {
-   if (*(rpc->r_aliases) != '\0') {
+   if (*(rpc->r_aliases) != NULL) {
for (cp = rpc->r_aliases; *cp; ++cp) {
written = snprintf(buffer, buflen, " %s", *cp);
buffer += written;

Modified: head/lib/libc/tests/nss/getserv_test.c
==
--- head/lib/libc/tests/nss/getserv_test.c  Tue Oct  8 20:59:31 2019
(r353325)
+++ head/lib/libc/tests/nss/getserv_test.c  Tue Oct  8 

svn commit: r353327 - in head/sys: amd64/include x86/include

2019-10-08 Thread Mateusz Guzik
Author: mjg
Date: Tue Oct  8 21:14:11 2019
New Revision: 353327
URL: https://svnweb.freebsd.org/changeset/base/353327

Log:
  amd64: plug spurious cld instructions
  
  ABI already guarantees the direction is forward. Note this does not take care
  of i386-specific cld's.
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21906

Modified:
  head/sys/amd64/include/cpufunc.h
  head/sys/x86/include/bus.h

Modified: head/sys/amd64/include/cpufunc.h
==
--- head/sys/amd64/include/cpufunc.hTue Oct  8 21:14:09 2019
(r353326)
+++ head/sys/amd64/include/cpufunc.hTue Oct  8 21:14:11 2019
(r353327)
@@ -231,7 +231,7 @@ inl(u_int port)
 static __inline void
 insb(u_int port, void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; insb"
+   __asm __volatile("rep; insb"
 : "+D" (addr), "+c" (count)
 : "d" (port)
 : "memory");
@@ -240,7 +240,7 @@ insb(u_int port, void *addr, size_t count)
 static __inline void
 insw(u_int port, void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; insw"
+   __asm __volatile("rep; insw"
 : "+D" (addr), "+c" (count)
 : "d" (port)
 : "memory");
@@ -249,7 +249,7 @@ insw(u_int port, void *addr, size_t count)
 static __inline void
 insl(u_int port, void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; insl"
+   __asm __volatile("rep; insl"
 : "+D" (addr), "+c" (count)
 : "d" (port)
 : "memory");
@@ -285,7 +285,7 @@ outl(u_int port, u_int data)
 static __inline void
 outsb(u_int port, const void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; outsb"
+   __asm __volatile("rep; outsb"
 : "+S" (addr), "+c" (count)
 : "d" (port));
 }
@@ -293,7 +293,7 @@ outsb(u_int port, const void *addr, size_t count)
 static __inline void
 outsw(u_int port, const void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; outsw"
+   __asm __volatile("rep; outsw"
 : "+S" (addr), "+c" (count)
 : "d" (port));
 }
@@ -301,7 +301,7 @@ outsw(u_int port, const void *addr, size_t count)
 static __inline void
 outsl(u_int port, const void *addr, size_t count)
 {
-   __asm __volatile("cld; rep; outsl"
+   __asm __volatile("rep; outsl"
 : "+S" (addr), "+c" (count)
 : "d" (port));
 }

Modified: head/sys/x86/include/bus.h
==
--- head/sys/x86/include/bus.h  Tue Oct  8 21:14:09 2019(r353326)
+++ head/sys/x86/include/bus.h  Tue Oct  8 21:14:11 2019(r353327)
@@ -280,7 +280,6 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_
else {
 #ifdef __GNUCLIKE_ASM
__asm __volatile("  \n\
-   cld \n\
1:  movb (%2),%%al  \n\
stosb   \n\
loop 1b":
@@ -301,7 +300,6 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_
else {
 #ifdef __GNUCLIKE_ASM
__asm __volatile("  \n\
-   cld \n\
1:  movw (%2),%%ax  \n\
stosw   \n\
loop 1b":
@@ -322,7 +320,6 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_
else {
 #ifdef __GNUCLIKE_ASM
__asm __volatile("  \n\
-   cld \n\
1:  movl (%2),%%eax \n\
stosl   \n\
loop 1b":
@@ -367,7 +364,6 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space
int _port_ = bsh + offset;
 #ifdef __GNUCLIKE_ASM
__asm __volatile("  \n\
-   cld \n\
1:  inb %w2,%%al\n\
stosb   \n\
incl %2 \n\
@@ -380,7 +376,6 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space
bus_space_handle_t _port_ = bsh + offset;
 #ifdef __GNUCLIKE_ASM
__asm __volatile("   

svn commit: r353325 - in head/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 20:59:31 2019
New Revision: 353325
URL: https://svnweb.freebsd.org/changeset/base/353325

Log:
  Update tcsh to 6.21.00.
  
  This is a bugfix release with no new features.  A number of these fixes
  were previously merged into our tree.
  
  Sponsored by: DARPA, AFRL

Added:
  head/contrib/tcsh/README.md
 - copied unchanged from r353317, vendor/tcsh/dist/README.md
Deleted:
  head/contrib/tcsh/README
  head/contrib/tcsh/README.imake
Modified:
  head/contrib/tcsh/Fixes
  head/contrib/tcsh/Imakefile
  head/contrib/tcsh/MAKEDIFFS
  head/contrib/tcsh/MAKESHAR
  head/contrib/tcsh/Makefile.in
  head/contrib/tcsh/Makefile.std
  head/contrib/tcsh/Makefile.vms
  head/contrib/tcsh/Ported
  head/contrib/tcsh/complete.tcsh
  head/contrib/tcsh/config_f.h
  head/contrib/tcsh/configure
  head/contrib/tcsh/dotlock.c
  head/contrib/tcsh/ed.chared.c
  head/contrib/tcsh/ed.decls.h
  head/contrib/tcsh/ed.defns.c
  head/contrib/tcsh/ed.h
  head/contrib/tcsh/ed.init.c
  head/contrib/tcsh/ed.inputl.c
  head/contrib/tcsh/ed.refresh.c
  head/contrib/tcsh/ed.screen.c
  head/contrib/tcsh/ed.term.c
  head/contrib/tcsh/ed.term.h
  head/contrib/tcsh/ed.xmap.c
  head/contrib/tcsh/eight-bit.me
  head/contrib/tcsh/gethost.c
  head/contrib/tcsh/glob.3
  head/contrib/tcsh/glob.c
  head/contrib/tcsh/glob.h
  head/contrib/tcsh/host.defs
  head/contrib/tcsh/imake.config
  head/contrib/tcsh/ma.setp.c
  head/contrib/tcsh/mi.termios.c
  head/contrib/tcsh/mi.varargs.h
  head/contrib/tcsh/nls/C/set1
  head/contrib/tcsh/nls/C/set10
  head/contrib/tcsh/nls/C/set11
  head/contrib/tcsh/nls/C/set12
  head/contrib/tcsh/nls/C/set13
  head/contrib/tcsh/nls/C/set14
  head/contrib/tcsh/nls/C/set15
  head/contrib/tcsh/nls/C/set16
  head/contrib/tcsh/nls/C/set17
  head/contrib/tcsh/nls/C/set18
  head/contrib/tcsh/nls/C/set19
  head/contrib/tcsh/nls/C/set2
  head/contrib/tcsh/nls/C/set20
  head/contrib/tcsh/nls/C/set21
  head/contrib/tcsh/nls/C/set22
  head/contrib/tcsh/nls/C/set23
  head/contrib/tcsh/nls/C/set24
  head/contrib/tcsh/nls/C/set25
  head/contrib/tcsh/nls/C/set26
  head/contrib/tcsh/nls/C/set27
  head/contrib/tcsh/nls/C/set29
  head/contrib/tcsh/nls/C/set3
  head/contrib/tcsh/nls/C/set30
  head/contrib/tcsh/nls/C/set31
  head/contrib/tcsh/nls/C/set4
  head/contrib/tcsh/nls/C/set5
  head/contrib/tcsh/nls/C/set6
  head/contrib/tcsh/nls/C/set7
  head/contrib/tcsh/nls/C/set8
  head/contrib/tcsh/nls/C/set9
  head/contrib/tcsh/nls/Makefile.in
  head/contrib/tcsh/nls/catgen
  head/contrib/tcsh/nls/et/set1
  head/contrib/tcsh/nls/et/set10
  head/contrib/tcsh/nls/et/set11
  head/contrib/tcsh/nls/et/set12
  head/contrib/tcsh/nls/et/set13
  head/contrib/tcsh/nls/et/set14
  head/contrib/tcsh/nls/et/set15
  head/contrib/tcsh/nls/et/set16
  head/contrib/tcsh/nls/et/set17
  head/contrib/tcsh/nls/et/set18
  head/contrib/tcsh/nls/et/set19
  head/contrib/tcsh/nls/et/set2
  head/contrib/tcsh/nls/et/set20
  head/contrib/tcsh/nls/et/set21
  head/contrib/tcsh/nls/et/set22
  head/contrib/tcsh/nls/et/set23
  head/contrib/tcsh/nls/et/set24
  head/contrib/tcsh/nls/et/set25
  head/contrib/tcsh/nls/et/set26
  head/contrib/tcsh/nls/et/set27
  head/contrib/tcsh/nls/et/set29
  head/contrib/tcsh/nls/et/set3
  head/contrib/tcsh/nls/et/set30
  head/contrib/tcsh/nls/et/set31
  head/contrib/tcsh/nls/et/set4
  head/contrib/tcsh/nls/et/set5
  head/contrib/tcsh/nls/et/set6
  head/contrib/tcsh/nls/et/set7
  head/contrib/tcsh/nls/et/set8
  head/contrib/tcsh/nls/et/set9
  head/contrib/tcsh/nls/finnish/set1
  head/contrib/tcsh/nls/finnish/set10
  head/contrib/tcsh/nls/finnish/set11
  head/contrib/tcsh/nls/finnish/set12
  head/contrib/tcsh/nls/finnish/set13
  head/contrib/tcsh/nls/finnish/set14
  head/contrib/tcsh/nls/finnish/set15
  head/contrib/tcsh/nls/finnish/set16
  head/contrib/tcsh/nls/finnish/set17
  head/contrib/tcsh/nls/finnish/set18
  head/contrib/tcsh/nls/finnish/set19
  head/contrib/tcsh/nls/finnish/set2
  head/contrib/tcsh/nls/finnish/set20
  head/contrib/tcsh/nls/finnish/set21
  head/contrib/tcsh/nls/finnish/set22
  head/contrib/tcsh/nls/finnish/set23
  head/contrib/tcsh/nls/finnish/set24
  head/contrib/tcsh/nls/finnish/set25
  head/contrib/tcsh/nls/finnish/set26
  head/contrib/tcsh/nls/finnish/set27
  head/contrib/tcsh/nls/finnish/set29
  head/contrib/tcsh/nls/finnish/set3
  head/contrib/tcsh/nls/finnish/set30
  head/contrib/tcsh/nls/finnish/set31
  head/contrib/tcsh/nls/finnish/set4
  head/contrib/tcsh/nls/finnish/set5
  head/contrib/tcsh/nls/finnish/set6
  head/contrib/tcsh/nls/finnish/set7
  head/contrib/tcsh/nls/finnish/set8
  head/contrib/tcsh/nls/finnish/set9
  head/contrib/tcsh/nls/french/set1
  head/contrib/tcsh/nls/french/set10
  head/contrib/tcsh/nls/french/set11
  head/contrib/tcsh/nls/french/set12
  head/contrib/tcsh/nls/french/set13
  head/contrib/tcsh/nls/french/set14
  head/contrib/tcsh/nls/french/set15
  head/contrib/tcsh/nls/french/set16
  head/contrib/tcsh/nls/french/set17
  head/contrib/tcsh/nls/french/set18
  

svn commit: r353324 - head

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 20:26:51 2019
New Revision: 353324
URL: https://svnweb.freebsd.org/changeset/base/353324

Log:
  Allow -DNO_CLEAN build across r352689.
  
  Split the LIBCOMPAT case because the usual egrep only matches in
  LIBCOMPAT on amd64.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Oct  8 20:22:05 2019(r353323)
+++ head/Makefile.inc1  Tue Oct  8 20:26:51 2019(r353324)
@@ -950,6 +950,21 @@ _sanity_check: .PHONY .MAKE
 _cleanobj_fast_depend_hack: .PHONY
 # Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls
+# 20190925  r352689  removal of obsolete i386 memchr.S
+.for f in memchr
+   @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \
+   egrep -qw 'i386/string/memchr\.S' 
${OBJTOP}/lib/libc/.depend.${f}.o; then \
+   echo "Removing stale dependencies for memchr"; \
+   rm -f ${OBJTOP}/lib/libc/.depend.${f}.*; \
+   fi
+.if defined(LIBCOMPAT)
+   @if [ -e "${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o" ] && \
+   egrep -qw 'i386/string/memchr\.S' 
${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o; then \
+   echo "Removing stale dependencies for memchr"; \
+   rm -f ${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*; \
+   fi
+.endif
+.endfor
 # 20180604  r334626  brk sbrk
 # 20190916  r352703  shm_open
 .for f in brk sbrk shm_open
___
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: r353323 - head/sys/dev/cxgbe/crypto

2019-10-08 Thread John Baldwin
Author: jhb
Date: Tue Oct  8 20:22:05 2019
New Revision: 353323
URL: https://svnweb.freebsd.org/changeset/base/353323

Log:
  Set the FID field in lookaside crypto requests to the rx queue ID.
  
  The PCI block in the adapter requires this field to be set to a valid
  queue ID.  It is not clear why it did not fail on all machines, but
  the effect was that crypto operations reading input data via DMA
  failed with an internal PCI read error on machines with 128G or more
  of RAM.
  
  Reported by:  gallatin
  Reviewed by:  np
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/crypto/t4_crypto.c

Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c
==
--- head/sys/dev/cxgbe/crypto/t4_crypto.c   Tue Oct  8 20:14:33 2019
(r353322)
+++ head/sys/dev/cxgbe/crypto/t4_crypto.c   Tue Oct  8 20:22:05 2019
(r353323)
@@ -419,7 +419,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr
crwr->ulptx.cmd_dest = htobe32(V_ULPTX_CMD(ULP_TX_PKT) |
V_ULP_TXPKT_DATAMODIFY(0) |
V_ULP_TXPKT_CHANNELID(sc->tx_channel_id) | V_ULP_TXPKT_DEST(0) |
-   V_ULP_TXPKT_FID(0) | V_ULP_TXPKT_RO(1));
+   V_ULP_TXPKT_FID(sc->rxq->iq.abs_id) | V_ULP_TXPKT_RO(1));
crwr->ulptx.len = htobe32(
((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16));
 
___
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: r353322 - stable/12/share/mk

2019-10-08 Thread Simon J. Gerraty
Author: sjg
Date: Tue Oct  8 20:14:33 2019
New Revision: 353322
URL: https://svnweb.freebsd.org/changeset/base/353322

Log:
  Need to use ${${_${group}DIR_${file}}} for STAGE_DIR
  
  STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
  ${STAGE_OBJTOP}BINDIR rather than
  ${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR
  
  MFC of r352942
  
  Reviewed by:  stevek
  Differential Revision:https://reviews.freebsd.org/D21858

Modified:
  stable/12/share/mk/bsd.files.mk

Modified: stable/12/share/mk/bsd.files.mk
==
--- stable/12/share/mk/bsd.files.mk Tue Oct  8 19:49:25 2019
(r353321)
+++ stable/12/share/mk/bsd.files.mk Tue Oct  8 20:14:33 2019
(r353322)
@@ -105,7 +105,7 @@ STAGE_AS_${file}= ${${group}NAME_${file}}
 # we need to expand ${group}DIR_${file} and replace
 # all '/' and '*' with '_' to make a safe target name.
 STAGE_AS_SETS+=${${_${group}DIR_${file}}:C,[/*],_,g}
-STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${group}DIR_${file}}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= 
${STAGE_OBJTOP}${${_${group}DIR_${file}}}
 stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
___
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: r353321 - head/sys/dev/mlx5/mlx5_en

2019-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Oct  8 19:49:25 2019
New Revision: 353321
URL: https://svnweb.freebsd.org/changeset/base/353321

Log:
  Fix regression issue after r352989:
  
  As noted by the commit message, callouts are now persistant
  and should not be in the auto-zero section of the RQ's and SQ's.
  This fixes an assert when using the TX completion event
  factor feature with mlx5en(4).
  
  Found by: gallatin@
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Tue Oct  8 18:58:23 2019
(r353320)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Tue Oct  8 19:49:25 2019
(r353321)
@@ -748,6 +748,7 @@ struct mlx5e_rq {
/* persistant fields */
struct mtx mtx;
struct mlx5e_rq_stats stats;
+   struct callout watchdog;
 
/* data path */
 #definemlx5e_rq_zero_start wq
@@ -769,7 +770,6 @@ struct mlx5e_rq {
struct mlx5_wq_ctrl wq_ctrl;
u32 rqn;
struct mlx5e_channel *channel;
-   struct callout watchdog;
 } __aligned(MLX5E_CACHELINE_SIZE);
 
 struct mlx5e_sq_mbuf {
@@ -794,6 +794,7 @@ struct mlx5e_sq {
struct  mtx lock;
struct  mtx comp_lock;
struct  mlx5e_sq_stats stats;
+   struct  callout cev_callout;
 
/* data path */
 #definemlx5e_sq_zero_start dma_tag
@@ -812,7 +813,6 @@ struct mlx5e_sq {
 #defineMLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */
 #defineMLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */
u16 running;/* set if SQ is running */
-   struct callout cev_callout;
union {
u32 d32[2];
u64 d64;
___
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: r353320 - head/usr.sbin/pkg

2019-10-08 Thread Glen Barber
Author: gjb
Date: Tue Oct  8 18:58:23 2019
New Revision: 353320
URL: https://svnweb.freebsd.org/changeset/base/353320

Log:
  Rework the logic for installing the pkg(8) configuration.
  
  'quarterly' package sets do not exist for head, so explicitly
  install the 'latest' configuration file there.  Otherwise,
  fall back to the original conditional evaluation to determine
  if the 'latest' or 'quarterly' configuration file should be
  installed.
  
  Reported by:  manu
  Reviewed by:  manu
  MFC after:3 days
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/usr.sbin/pkg/Makefile

Modified: head/usr.sbin/pkg/Makefile
==
--- head/usr.sbin/pkg/Makefile  Tue Oct  8 18:21:44 2019(r353319)
+++ head/usr.sbin/pkg/Makefile  Tue Oct  8 18:58:23 2019(r353320)
@@ -1,14 +1,18 @@
 # $FreeBSD$
 
-.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
-PKGCONFBRANCH?=quarterly
-.else
 _BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
 BRANCH?=   ${_BRANCH}
+.if ${BRANCH:MCURRENT} != ""
+PKGCONFBRANCH?=latest
+.else
 . if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
 PKGCONFBRANCH?=quarterly
 . else
+.  if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
+PKGCONFBRANCH?=quarterly
+.  else
 PKGCONFBRANCH?=latest
+.  endif
 . endif
 .endif
 CONFS= FreeBSD.conf.${PKGCONFBRANCH}
___
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: r353319 - vendor/tcsh/6.21.00

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 18:21:44 2019
New Revision: 353319
URL: https://svnweb.freebsd.org/changeset/base/353319

Log:
  Tag 6.21.00 import.

Added:
  vendor/tcsh/6.21.00/
 - copied from r353318, vendor/tcsh/dist/
___
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: r353317 - in vendor/tcsh/dist: . config nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/pl nls/russian nls/spanish nls/ukrainian tests win32

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 18:20:02 2019
New Revision: 353317
URL: https://svnweb.freebsd.org/changeset/base/353317

Log:
  Import 6.21.00.

Added:
  vendor/tcsh/dist/README.md   (contents, props changed)
Deleted:
  vendor/tcsh/dist/README
  vendor/tcsh/dist/README.imake
Modified:
  vendor/tcsh/dist/BUGS
  vendor/tcsh/dist/Fixes
  vendor/tcsh/dist/Imakefile
  vendor/tcsh/dist/MAKEDIFFS
  vendor/tcsh/dist/MAKESHAR
  vendor/tcsh/dist/Makefile.in
  vendor/tcsh/dist/Makefile.std
  vendor/tcsh/dist/Makefile.vms
  vendor/tcsh/dist/Ported
  vendor/tcsh/dist/aclocal.m4
  vendor/tcsh/dist/complete.tcsh
  vendor/tcsh/dist/config/cygwin
  vendor/tcsh/dist/config/win32
  vendor/tcsh/dist/config_f.h
  vendor/tcsh/dist/configure
  vendor/tcsh/dist/configure.ac
  vendor/tcsh/dist/dotlock.c
  vendor/tcsh/dist/ed.chared.c
  vendor/tcsh/dist/ed.decls.h
  vendor/tcsh/dist/ed.defns.c
  vendor/tcsh/dist/ed.h
  vendor/tcsh/dist/ed.init.c
  vendor/tcsh/dist/ed.inputl.c
  vendor/tcsh/dist/ed.refresh.c
  vendor/tcsh/dist/ed.screen.c
  vendor/tcsh/dist/ed.term.c
  vendor/tcsh/dist/ed.term.h
  vendor/tcsh/dist/ed.xmap.c
  vendor/tcsh/dist/eight-bit.me
  vendor/tcsh/dist/gethost.c
  vendor/tcsh/dist/glob.3
  vendor/tcsh/dist/glob.c
  vendor/tcsh/dist/glob.h
  vendor/tcsh/dist/host.defs
  vendor/tcsh/dist/imake.config
  vendor/tcsh/dist/ma.setp.c
  vendor/tcsh/dist/mi.termios.c
  vendor/tcsh/dist/mi.varargs.h
  vendor/tcsh/dist/nls/C/set1
  vendor/tcsh/dist/nls/C/set10
  vendor/tcsh/dist/nls/C/set11
  vendor/tcsh/dist/nls/C/set12
  vendor/tcsh/dist/nls/C/set13
  vendor/tcsh/dist/nls/C/set14
  vendor/tcsh/dist/nls/C/set15
  vendor/tcsh/dist/nls/C/set16
  vendor/tcsh/dist/nls/C/set17
  vendor/tcsh/dist/nls/C/set18
  vendor/tcsh/dist/nls/C/set19
  vendor/tcsh/dist/nls/C/set2
  vendor/tcsh/dist/nls/C/set20
  vendor/tcsh/dist/nls/C/set21
  vendor/tcsh/dist/nls/C/set22
  vendor/tcsh/dist/nls/C/set23
  vendor/tcsh/dist/nls/C/set24
  vendor/tcsh/dist/nls/C/set25
  vendor/tcsh/dist/nls/C/set26
  vendor/tcsh/dist/nls/C/set27
  vendor/tcsh/dist/nls/C/set29
  vendor/tcsh/dist/nls/C/set3
  vendor/tcsh/dist/nls/C/set30
  vendor/tcsh/dist/nls/C/set31
  vendor/tcsh/dist/nls/C/set4
  vendor/tcsh/dist/nls/C/set5
  vendor/tcsh/dist/nls/C/set6
  vendor/tcsh/dist/nls/C/set7
  vendor/tcsh/dist/nls/C/set8
  vendor/tcsh/dist/nls/C/set9
  vendor/tcsh/dist/nls/Makefile.in
  vendor/tcsh/dist/nls/catgen
  vendor/tcsh/dist/nls/et/set1
  vendor/tcsh/dist/nls/et/set10
  vendor/tcsh/dist/nls/et/set11
  vendor/tcsh/dist/nls/et/set12
  vendor/tcsh/dist/nls/et/set13
  vendor/tcsh/dist/nls/et/set14
  vendor/tcsh/dist/nls/et/set15
  vendor/tcsh/dist/nls/et/set16
  vendor/tcsh/dist/nls/et/set17
  vendor/tcsh/dist/nls/et/set18
  vendor/tcsh/dist/nls/et/set19
  vendor/tcsh/dist/nls/et/set2
  vendor/tcsh/dist/nls/et/set20
  vendor/tcsh/dist/nls/et/set21
  vendor/tcsh/dist/nls/et/set22
  vendor/tcsh/dist/nls/et/set23
  vendor/tcsh/dist/nls/et/set24
  vendor/tcsh/dist/nls/et/set25
  vendor/tcsh/dist/nls/et/set26
  vendor/tcsh/dist/nls/et/set27
  vendor/tcsh/dist/nls/et/set29
  vendor/tcsh/dist/nls/et/set3
  vendor/tcsh/dist/nls/et/set30
  vendor/tcsh/dist/nls/et/set31
  vendor/tcsh/dist/nls/et/set4
  vendor/tcsh/dist/nls/et/set5
  vendor/tcsh/dist/nls/et/set6
  vendor/tcsh/dist/nls/et/set7
  vendor/tcsh/dist/nls/et/set8
  vendor/tcsh/dist/nls/et/set9
  vendor/tcsh/dist/nls/finnish/set1
  vendor/tcsh/dist/nls/finnish/set10
  vendor/tcsh/dist/nls/finnish/set11
  vendor/tcsh/dist/nls/finnish/set12
  vendor/tcsh/dist/nls/finnish/set13
  vendor/tcsh/dist/nls/finnish/set14
  vendor/tcsh/dist/nls/finnish/set15
  vendor/tcsh/dist/nls/finnish/set16
  vendor/tcsh/dist/nls/finnish/set17
  vendor/tcsh/dist/nls/finnish/set18
  vendor/tcsh/dist/nls/finnish/set19
  vendor/tcsh/dist/nls/finnish/set2
  vendor/tcsh/dist/nls/finnish/set20
  vendor/tcsh/dist/nls/finnish/set21
  vendor/tcsh/dist/nls/finnish/set22
  vendor/tcsh/dist/nls/finnish/set23
  vendor/tcsh/dist/nls/finnish/set24
  vendor/tcsh/dist/nls/finnish/set25
  vendor/tcsh/dist/nls/finnish/set26
  vendor/tcsh/dist/nls/finnish/set27
  vendor/tcsh/dist/nls/finnish/set29
  vendor/tcsh/dist/nls/finnish/set3
  vendor/tcsh/dist/nls/finnish/set30
  vendor/tcsh/dist/nls/finnish/set31
  vendor/tcsh/dist/nls/finnish/set4
  vendor/tcsh/dist/nls/finnish/set5
  vendor/tcsh/dist/nls/finnish/set6
  vendor/tcsh/dist/nls/finnish/set7
  vendor/tcsh/dist/nls/finnish/set8
  vendor/tcsh/dist/nls/finnish/set9
  vendor/tcsh/dist/nls/french/set1
  vendor/tcsh/dist/nls/french/set10
  vendor/tcsh/dist/nls/french/set11
  vendor/tcsh/dist/nls/french/set12
  vendor/tcsh/dist/nls/french/set13
  vendor/tcsh/dist/nls/french/set14
  vendor/tcsh/dist/nls/french/set15
  vendor/tcsh/dist/nls/french/set16
  vendor/tcsh/dist/nls/french/set17
  vendor/tcsh/dist/nls/french/set18
  vendor/tcsh/dist/nls/french/set19
  vendor/tcsh/dist/nls/french/set2
  vendor/tcsh/dist/nls/french/set20
  vendor/tcsh/dist/nls/french/set21
  vendor/tcsh/dist/nls/french/set22
  

svn commit: r353315 - stable/12

2019-10-08 Thread Brooks Davis
Author: brooks
Date: Tue Oct  8 18:06:02 2019
New Revision: 353315
URL: https://svnweb.freebsd.org/changeset/base/353315

Log:
  MFC r352919:
  
  Update cloudabi(32|64) sysents with "make sysent".

Modified:
  stable/12/Makefile.inc1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/Makefile.inc1
==
--- stable/12/Makefile.inc1 Tue Oct  8 17:55:45 2019(r353314)
+++ stable/12/Makefile.inc1 Tue Oct  8 18:06:02 2019(r353315)
@@ -1425,6 +1425,8 @@ packageworld: .PHONY
 
 _sysent_dirs=  sys/kern
 _sysent_dirs+= sys/compat/freebsd32
+_sysent_dirs+= sys/compat/cloudabi32   \
+   sys/compat/cloudabi64
 _sysent_dirs+= sys/i386/ibcs2
 _sysent_dirs+= sys/amd64/linux \
sys/amd64/linux32   \
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Glen Barber
On Tue, Oct 08, 2019 at 07:19:03PM +0200, Emmanuel Vadot wrote:
> On Tue, 8 Oct 2019 15:52:52 +
> Glen Barber  wrote:
> 
> > On Tue, Oct 08, 2019 at 09:18:40AM -0600, Warner Losh wrote:
> > > On Tue, Oct 8, 2019 at 8:33 AM Emmanuel Vadot  
> > > wrote:
> > > >  Anyway it's still need to be reverted as all arches should use latest
> > > > on CURRENT.
> > > >
> > > 
> > > Agreed. -current is moving too quickly to use the quarterly, and this 100%
> > > breaks all the graphics .ko's since those *MUST* be compiled against the
> > > latest kernel. Things are already wonky enough there without introducing
> > > this new (bad) behavior to the mix. It should be fixed in other ways, but
> > > until those are in place this change makes a bad situation much, much 
> > > worse.
> > > 
> > 
> > There is nothing to fix regarding 'latest' and 'quarterly' for CURRENT.
> > It works as expected.
> > 
> >  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=CURRENT -V PKGCONFBRANCH
> >  latest
> >  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=BETA3 -V PKGCONFBRANCH
> >  quarterly
> >  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=STABLE -V PKGCONFBRANCH
> >  latest
> > 
> > Glen
> > 
> 
>  Please have a look at the latest image generated for armv7 and
> aarch64, you will see that it doesn't work as expected.
> 

You're right, something is off here.  I'm looking into it.

Glen



signature.asc
Description: PGP signature


svn commit: r353314 - head/sys/net

2019-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct  8 17:55:45 2019
New Revision: 353314
URL: https://svnweb.freebsd.org/changeset/base/353314

Log:
  Remove epoch assertion from if_setlladdr().  Originally this function was
  protected by IF_ADDR_LOCK(), which was a mutex, so that two simultaneous
  if_setlladdr() can't execute. Later it was switched to IF_ADDR_RLOCK(),
  likely by a mistake. Later it was switched to NET_EPOCH_ENTER(). Then I
  incorrectly added NET_EPOCH_ASSERT() here.
  
  In reality ifp->if_addr never goes away and never changes its length. So,
  doing bcopy() in it is always "safe", meaning it won't dereference a wrong
  pointer or write into someone's else memory. Of course doing two bcopy() in
  parallel would result in a mess of two addresses, but net epoch doesn't
  protect against that, neither IF_ADDR_RLOCK() did.
  
  So for now, just remove the assertion and leave for later a proper fix.
  
  Reported by:  markj

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Tue Oct  8 16:59:17 2019(r353313)
+++ head/sys/net/if.c   Tue Oct  8 17:55:45 2019(r353314)
@@ -3822,26 +3822,18 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, 
struct sockaddr_dl *sdl;
struct ifaddr *ifa;
struct ifreq ifr;
-   int rc;
 
-   NET_EPOCH_ASSERT();
-
-   rc = 0;
ifa = ifp->if_addr;
-   if (ifa == NULL) {
-   rc = EINVAL;
-   goto out;
-   }
+   if (ifa == NULL)
+   return (EINVAL);
 
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
-   if (sdl == NULL) {
-   rc = EINVAL;
-   goto out;
-   }
-   if (len != sdl->sdl_alen) { /* don't allow length to change */
-   rc = EINVAL;
-   goto out;
-   }
+   if (sdl == NULL)
+   return (EINVAL);
+
+   if (len != sdl->sdl_alen)   /* don't allow length to change */
+   return (EINVAL);
+
switch (ifp->if_type) {
case IFT_ETHER:
case IFT_XETHER:
@@ -3851,8 +3843,7 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, 
bcopy(lladdr, LLADDR(sdl), len);
break;
default:
-   rc = ENODEV;
-   goto out;
+   return (ENODEV);
}
 
/*
@@ -3873,9 +3864,8 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, 
}
}
EVENTHANDLER_INVOKE(iflladdr_event, ifp);
+
return (0);
-out:
-   return (rc);
 }
 
 /*
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Emmanuel Vadot
On Tue, 8 Oct 2019 15:52:52 +
Glen Barber  wrote:

> On Tue, Oct 08, 2019 at 09:18:40AM -0600, Warner Losh wrote:
> > On Tue, Oct 8, 2019 at 8:33 AM Emmanuel Vadot  wrote:
> > >  Anyway it's still need to be reverted as all arches should use latest
> > > on CURRENT.
> > >
> > 
> > Agreed. -current is moving too quickly to use the quarterly, and this 100%
> > breaks all the graphics .ko's since those *MUST* be compiled against the
> > latest kernel. Things are already wonky enough there without introducing
> > this new (bad) behavior to the mix. It should be fixed in other ways, but
> > until those are in place this change makes a bad situation much, much worse.
> > 
> 
> There is nothing to fix regarding 'latest' and 'quarterly' for CURRENT.
> It works as expected.
> 
>  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=CURRENT -V PKGCONFBRANCH
>  latest
>  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=BETA3 -V PKGCONFBRANCH
>  quarterly
>  root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=STABLE -V PKGCONFBRANCH
>  latest
> 
> Glen
> 

 Please have a look at the latest image generated for armv7 and
aarch64, you will see that it doesn't work as expected.

-- 
Emmanuel Vadot  
___
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: r353313 - head/sys/netinet

2019-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct  8 16:59:17 2019
New Revision: 353313
URL: https://svnweb.freebsd.org/changeset/base/353313

Log:
  Quickly plug another regression from r353292. Again, multicast locking needs
  lots of work...
  
  Reported by:  pho

Modified:
  head/sys/netinet/in_mcast.c

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Tue Oct  8 16:45:56 2019(r353312)
+++ head/sys/netinet/in_mcast.c Tue Oct  8 16:59:17 2019(r353313)
@@ -2195,12 +2195,14 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
 * Begin state merge transaction at IGMP layer.
 */
if (is_new) {
+   struct epoch_tracker et;
+
in_pcbref(inp);
INP_WUNLOCK(inp);
-
+   NET_EPOCH_ENTER(et);
error = in_joingroup_locked(ifp, >sin.sin_addr, imf,
>imf_inm);
-
+   NET_EPOCH_EXIT(et);
INP_WLOCK(inp);
if (in_pcbrele_wlocked(inp)) {
error = ENXIO;
___
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: r353312 - head/sys/net

2019-10-08 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct  8 16:45:56 2019
New Revision: 353312
URL: https://svnweb.freebsd.org/changeset/base/353312

Log:
  In DIAGNOSTIC block of if_delmulti_ifma_flags() enter the network epoch.
  This quickly plugs the regression from r353292. The locking of multicast
  definitely needs a broader review today...
  
  Reported by:  pho, dhw

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Tue Oct  8 16:42:50 2019(r353311)
+++ head/sys/net/if.c   Tue Oct  8 16:45:56 2019(r353312)
@@ -3689,13 +3689,14 @@ if_delmulti_ifma_flags(struct ifmultiaddr *ifma, int f
if (ifp == NULL) {
printf("%s: ifma_ifp seems to be detached\n", __func__);
} else {
+   struct epoch_tracker et;
struct ifnet *oifp;
 
-   NET_EPOCH_ASSERT();
-
+   NET_EPOCH_ENTER(et);
CK_STAILQ_FOREACH(oifp, _ifnet, if_link)
if (ifp == oifp)
break;
+   NET_EPOCH_EXIT(et);
if (ifp != oifp)
ifp = 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: r353311 - head/sys/amd64/amd64

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 16:42:50 2019
New Revision: 353311
URL: https://svnweb.freebsd.org/changeset/base/353311

Log:
  Simplify pmap_page_array_startup() a bit.
  
  No functional change intended.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Oct  8 15:48:28 2019(r353310)
+++ head/sys/amd64/amd64/pmap.c Tue Oct  8 16:42:50 2019(r353311)
@@ -3947,9 +3947,9 @@ pmap_page_array_startup(long pages)
 
vm_page_array_size = pages;
 
-   start = va = VM_MIN_KERNEL_ADDRESS;
-   end = va + pages * sizeof(struct vm_page);
-   while (va < end) {
+   start = VM_MIN_KERNEL_ADDRESS;
+   end = start + pages * sizeof(struct vm_page);
+   for (va = start; va < end; va += NBPDR) {
pfn = first_page + (va - start) / sizeof(struct vm_page);
domain = _vm_phys_domain(ptoa(pfn));
pdpe = pmap_pdpe(kernel_pmap, va);
@@ -3969,7 +3969,6 @@ pmap_page_array_startup(long pages)
newpdir = (pd_entry_t)(pa | X86_PG_V | X86_PG_RW | X86_PG_A |
X86_PG_M | PG_PS | pg_g | pg_nx);
pde_store(pde, newpdir);
-   va += NBPDR;
}
vm_page_array = (vm_page_t)start;
 }
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Glen Barber
On Tue, Oct 08, 2019 at 09:18:40AM -0600, Warner Losh wrote:
> On Tue, Oct 8, 2019 at 8:33 AM Emmanuel Vadot  wrote:
> >  Anyway it's still need to be reverted as all arches should use latest
> > on CURRENT.
> >
> 
> Agreed. -current is moving too quickly to use the quarterly, and this 100%
> breaks all the graphics .ko's since those *MUST* be compiled against the
> latest kernel. Things are already wonky enough there without introducing
> this new (bad) behavior to the mix. It should be fixed in other ways, but
> until those are in place this change makes a bad situation much, much worse.
> 

There is nothing to fix regarding 'latest' and 'quarterly' for CURRENT.
It works as expected.

 root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=CURRENT -V PKGCONFBRANCH
 latest
 root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=BETA3 -V PKGCONFBRANCH
 quarterly
 root@releng3:/usr/src/usr.sbin/pkg # make BRANCH=STABLE -V PKGCONFBRANCH
 latest

Glen



signature.asc
Description: PGP signature


svn commit: r353310 - head/tests/sys/cddl/zfs/tests/zfsd

2019-10-08 Thread Alan Somers
Author: asomers
Date: Tue Oct  8 15:48:28 2019
New Revision: 353310
URL: https://svnweb.freebsd.org/changeset/base/353310

Log:
  zfs: fix the zfsd_hotspare_007_pos test
  
  It was trying to destroy the pool while zfsd was detaching the spare, and
  "zpool destroy" failed.  Fix by waiting until the spare has fully detached.
  
  MFC after:2 weeks
  Sponsored by: Axcient

Modified:
  head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh

Modified: head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh
==
--- head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.kshTue Oct 
 8 15:33:11 2019(r353309)
+++ head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.kshTue Oct 
 8 15:48:28 2019(r353310)
@@ -82,6 +82,9 @@ function verify_assertion # spare_dev
 
# Re-enable the  missing disk
log_must create_gnop $REMOVAL_DISK $PHYSPATH
+
+   # And now the spare should be released
+   wait_for_pool_dev_state_change 20 $spare_dev AVAIL
 }
 
 typeset PHYSPATH="some_physical_path"
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Glen Barber
On Tue, Oct 08, 2019 at 08:22:33AM -0600, Ian Lepore wrote:
> On Tue, 2019-10-08 at 12:26 +0200, Emmanuel Vadot wrote:
> >  Hi Glen,
> > 
> > On Thu, 19 Sep 2019 16:43:12 + (UTC)
> > Glen Barber  wrote:
> > 
> > > Author: gjb
> > > Date: Thu Sep 19 16:43:12 2019
> > > New Revision: 352520
> > > URL: https://svnweb.freebsd.org/changeset/base/352520
> > > 
> > > Log:
> > >   Apply r346792 (cperciva) from stable/12 to head.  The original commit
> > >   message:
> > >   
> > >On non-x86 systems, use "quarterly" packages.
> > >   
> > >x86 architectures have "latest" package builds on stable/*, so keep 
> > > using
> > >those (they'll get switched over to "quarterly" during releases).
> > >   
> > >   The original commit was a direct commit to stable/12, as at the time it
> > >   was presumed it would not be necessary for head.  However, when it is 
> > > time
> > >   to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, 
> > > the
> > >   pkg(7) Makefile needs further adjusting.  This commit includes those
> > >   further adjustments, evaluating the BRANCH variable from 
> > > release/Makefile
> > >   to determine the pkg(7) repository to use.
> > >   
> > >   MFC after:  immediate (if possible)
> > >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> > > 
> > > Modified:
> > >   head/usr.sbin/pkg/Makefile
> > > 
> > > Modified: head/usr.sbin/pkg/Makefile
> > > ==
> > > --- head/usr.sbin/pkg/MakefileThu Sep 19 15:12:32 2019
> > > (r352519)
> > > +++ head/usr.sbin/pkg/MakefileThu Sep 19 16:43:12 2019
> > > (r352520)
> > > @@ -1,6 +1,16 @@
> > >  # $FreeBSD$
> > >  
> > > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > > +PKGCONFBRANCH?=  quarterly
> > > +.else
> > > +_BRANCH!=${MAKE} -C ${SRCTOP}/release -V BRANCH
> > > +BRANCH?= ${_BRANCH}
> > > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > > +PKGCONFBRANCH?=  quarterly
> > > +. else
> > >  PKGCONFBRANCH?=  latest
> > > +. endif
> > > +.endif
> > >  CONFS=   FreeBSD.conf.${PKGCONFBRANCH}
> > >  CONFSNAME=   FreeBSD.conf
> > >  CONFSDIR=/etc/pkg
> > 
> >  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> > this doesn't work.
> >  Also this depends on MACHINE and iirc MACHINE is always the host when
> > cross compiling.
> >  I think this need to be reverted.
> > 
> >  Cheers,
> > 
> 
> MACHINE is the build host when you first launch make(1), but the
> crossbuild code in Makefile.inc1 overrides MACHINE to TARGET (and
> MACHINE_ARCH to TARGET_ARCH) and launches a sub-make that way.
> 

Ah, yes.  That explains why when I first looked, my 'make -V [...]' in
usr.sbin/pkg did not work correctly.  Thank you for pointing this out.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Glen Barber
On Tue, Oct 08, 2019 at 12:26:52PM +0200, Emmanuel Vadot wrote:
> 
>  Hi Glen,
> 
> On Thu, 19 Sep 2019 16:43:12 + (UTC)
> Glen Barber  wrote:
> 
> > Author: gjb
> > Date: Thu Sep 19 16:43:12 2019
> > New Revision: 352520
> > URL: https://svnweb.freebsd.org/changeset/base/352520
> > 
> > Log:
> >   Apply r346792 (cperciva) from stable/12 to head.  The original commit
> >   message:
> >   
> >On non-x86 systems, use "quarterly" packages.
> >   
> >x86 architectures have "latest" package builds on stable/*, so keep using
> >those (they'll get switched over to "quarterly" during releases).
> >   
> >   The original commit was a direct commit to stable/12, as at the time it
> >   was presumed it would not be necessary for head.  However, when it is time
> >   to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, the
> >   pkg(7) Makefile needs further adjusting.  This commit includes those
> >   further adjustments, evaluating the BRANCH variable from release/Makefile
> >   to determine the pkg(7) repository to use.
> >   
> >   MFC after:immediate (if possible)
> >   Sponsored by: Rubicon Communications, LLC (Netgate)
> > 
> > Modified:
> >   head/usr.sbin/pkg/Makefile
> > 
> > Modified: head/usr.sbin/pkg/Makefile
> > ==
> > --- head/usr.sbin/pkg/Makefile  Thu Sep 19 15:12:32 2019
> > (r352519)
> > +++ head/usr.sbin/pkg/Makefile  Thu Sep 19 16:43:12 2019
> > (r352520)
> > @@ -1,6 +1,16 @@
> >  # $FreeBSD$
> >  
> > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > +PKGCONFBRANCH?=quarterly
> > +.else
> > +_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
> > +BRANCH?=   ${_BRANCH}
> > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > +PKGCONFBRANCH?=quarterly
> > +. else
> >  PKGCONFBRANCH?=latest
> > +. endif
> > +.endif
> >  CONFS= FreeBSD.conf.${PKGCONFBRANCH}
> >  CONFSNAME= FreeBSD.conf
> >  CONFSDIR=  /etc/pkg
> 
>  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> this doesn't work.

It does.

 root@releng3:/usr/src/usr.sbin/pkg # make _BRANCH=CURRENT -V PKGCONFBRANCH
 latest
 root@releng3:/usr/src/usr.sbin/pkg # make _BRANCH=STABLE -V PKGCONFBRANCH
 latest
 root@releng3:/usr/src/usr.sbin/pkg # make _BRANCH=RC1 -V PKGCONFBRANCH
 quarterly

>  Also this depends on MACHINE and iirc MACHINE is always the host when
> cross compiling.

You are correct.  I'll fix this.

>  I think this need to be reverted.
> 

No, I'll implement a proper fix.

Glen



signature.asc
Description: PGP signature


svn commit: r353309 - head/tests/sys/cddl/zfs/tests/zfsd

2019-10-08 Thread Alan Somers
Author: asomers
Date: Tue Oct  8 15:33:11 2019
New Revision: 353309
URL: https://svnweb.freebsd.org/changeset/base/353309

Log:
  zfs: fix the zfsd_autoreplace_003_pos test
  
  The test declared that it only needed 5 disks, but actually tried to use 6.
  Fix it to use just 5, which is all it really needs.
  
  MFC after:2 weeks
  Sponsored by: Axcient

Modified:
  head/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh

Modified: head/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh
==
--- head/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh Tue Oct 
 8 15:03:48 2019(r353308)
+++ head/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh Tue Oct 
 8 15:33:11 2019(r353309)
@@ -78,11 +78,11 @@ function verify_assertion
 typeset PHYSPATH="some_physical_path"
 typeset REMOVAL_DISK=$DISK0
 typeset REMOVAL_NOP=${DISK0}.nop
-typeset NEW_DISK=$DISK4
-typeset NEW_NOP=${DISK4}.nop
-typeset SPARE_DISK=${DISK5}
-typeset SPARE_NOP=${DISK5}.nop
-typeset OTHER_DISKS="${DISK1} ${DISK2} ${DISK3}"
+typeset NEW_DISK=$DISK3
+typeset NEW_NOP=${DISK3}.nop
+typeset SPARE_DISK=${DISK4}
+typeset SPARE_NOP=${DISK4}.nop
+typeset OTHER_DISKS="${DISK1} ${DISK2}"
 typeset OTHER_NOPS=${OTHER_DISKS//~(E)([[:space:]]+|$)/.nop\1}
 set -A MY_KEYWORDS "mirror" "raidz1" "raidz2"
 ensure_zfsd_running
___
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: r353292 - in head/sys: contrib/ipfilter/netinet dev/firewire dev/iicbus dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf ofed/drivers/infiniband/ulp/ipoi

2019-10-08 Thread Gleb Smirnoff
On Tue, Oct 08, 2019 at 08:56:34AM +0200, Peter Holm wrote:
P> On Mon, Oct 07, 2019 at 10:40:06PM +, Gleb Smirnoff wrote:
P> > Author: glebius
P> > Date: Mon Oct  7 22:40:05 2019
P> > New Revision: 353292
P> > URL: https://svnweb.freebsd.org/changeset/base/353292
P> > 
P> > Log:
P> >   Widen NET_EPOCH coverage.
P> >   
P> 
P> This seems to trigger this:

Ack. Will fix all regressions ASAP.

-- 
Gleb Smirnoff
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Warner Losh
On Tue, Oct 8, 2019 at 8:33 AM Emmanuel Vadot  wrote:

> On Tue, 08 Oct 2019 08:22:33 -0600
> Ian Lepore  wrote:
>
> > On Tue, 2019-10-08 at 12:26 +0200, Emmanuel Vadot wrote:
> > >  Hi Glen,
> > >
> > > On Thu, 19 Sep 2019 16:43:12 + (UTC)
> > > Glen Barber  wrote:
> > >
> > > > Author: gjb
> > > > Date: Thu Sep 19 16:43:12 2019
> > > > New Revision: 352520
> > > > URL: https://svnweb.freebsd.org/changeset/base/352520
> > > >
> > > > Log:
> > > >   Apply r346792 (cperciva) from stable/12 to head.  The original
> commit
> > > >   message:
> > > >
> > > >On non-x86 systems, use "quarterly" packages.
> > > >
> > > >x86 architectures have "latest" package builds on stable/*, so
> keep using
> > > >those (they'll get switched over to "quarterly" during releases).
> > > >
> > > >   The original commit was a direct commit to stable/12, as at the
> time it
> > > >   was presumed it would not be necessary for head.  However, when it
> is time
> > > >   to create a releng branch or switch from PRERELEASE/STABLE to
> BETA/RC, the
> > > >   pkg(7) Makefile needs further adjusting.  This commit includes
> those
> > > >   further adjustments, evaluating the BRANCH variable from
> release/Makefile
> > > >   to determine the pkg(7) repository to use.
> > > >
> > > >   MFC after:  immediate (if possible)
> > > >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> > > >
> > > > Modified:
> > > >   head/usr.sbin/pkg/Makefile
> > > >
> > > > Modified: head/usr.sbin/pkg/Makefile
> > > >
> ==
> > > > --- head/usr.sbin/pkg/MakefileThu Sep 19 15:12:32 2019
> (r352519)
> > > > +++ head/usr.sbin/pkg/MakefileThu Sep 19 16:43:12 2019
> (r352520)
> > > > @@ -1,6 +1,16 @@
> > > >  # $FreeBSD$
> > > >
> > > > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > > > +PKGCONFBRANCH?=  quarterly
> > > > +.else
> > > > +_BRANCH!=${MAKE} -C ${SRCTOP}/release -V BRANCH
> > > > +BRANCH?= ${_BRANCH}
> > > > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > > > +PKGCONFBRANCH?=  quarterly
> > > > +. else
> > > >  PKGCONFBRANCH?=  latest
> > > > +. endif
> > > > +.endif
> > > >  CONFS=   FreeBSD.conf.${PKGCONFBRANCH}
> > > >  CONFSNAME=   FreeBSD.conf
> > > >  CONFSDIR=/etc/pkg
> > >
> > >  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> > > this doesn't work.
> > >  Also this depends on MACHINE and iirc MACHINE is always the host when
> > > cross compiling.
> > >  I think this need to be reverted.
> > >
> > >  Cheers,
> > >
> >
> > MACHINE is the build host when you first launch make(1), but the
> > crossbuild code in Makefile.inc1 overrides MACHINE to TARGET (and
> > MACHINE_ARCH to TARGET_ARCH) and launches a sub-make that way.
> >
> > -- Ian
>
>  Ah ok, thanks for this info.
>
>  Anyway it's still need to be reverted as all arches should use latest
> on CURRENT.
>

Agreed. -current is moving too quickly to use the quarterly, and this 100%
breaks all the graphics .ko's since those *MUST* be compiled against the
latest kernel. Things are already wonky enough there without introducing
this new (bad) behavior to the mix. It should be fixed in other ways, but
until those are in place this change makes a bad situation much, much worse.

Warner
___
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: r353296 - head/sys/powerpc/include

2019-10-08 Thread Konstantin Belousov
On Tue, Oct 08, 2019 at 09:14:14AM -0500, Justin Hibbits wrote:
> On Tue, 8 Oct 2019 11:16:04 +0300
> Konstantin Belousov  wrote:
> 
> > On Tue, Oct 08, 2019 at 01:36:34AM +, Justin Hibbits wrote:
> > > Author: jhibbits
> > > Date: Tue Oct  8 01:36:34 2019
> > > New Revision: 353296
> > > URL: https://svnweb.freebsd.org/changeset/base/353296
> > > 
> > > Log:
> > >   powerpc: Implement atomic_(f)cmpset_ for short and char
> > >   |
> > >   This adds two implementations for each atomic_fcmpset_ and
> > > atomic_cmpset_ short and char functions, selectable at compile time
> > > for the target architecture.  By default, it uses a generic
> > > shift-and-mask to perform atomic updates to sub-components of
> > > 32-bit words from . However, if
> > > ISA_206_ATOMICS is defined it uses the ll/sc instructions for
> > > halfword and bytes, introduced in PowerISA 2.06.  These
> > > instructions are supported by all IBM processors from POWER7 on, as
> > > well as the Freescale/NXP e6500 core.  Although the e5500 and
> > > e500mc both implement PowerISA 2.06 they do not implement these
> > > instructions. As part of this, clean up the atomic_(f)cmpset_acq
> > > and _rel wrappers, by using macros to reduce code duplication.
> > >   
> > >   ISA_206_ATOMICS requires clang or newer binutils (2.20 or later).
> > >  
> > Why don't you use normal word-sized ll/sc tlwarx/stwcx, and only
> > modifying the part of the register as needed ?  This would work on
> > all supported CPUs, right ?
> > 
> > When kevans did the _atomic_subword.h, one of the arches involved was
> > sparc64, which does not have ll/sc.  Also for MIPS there are some fine
> > details which might mean that C implementation is less work than using
> > word-sized ll/sc.  But why for power ?
> 
> No real significant reason.  In fact, the review's diff has exactly
> what you're asking for.  The only reason I modified it for commit with
> Kyle's work was purely readability, I thought using the C wrapper with
> atomic_fcmpset_() was just marginally cleaner. I haven't checked, but I
> don't think the inline code difference is too great, but I'll have to do
> another review of it to be sure.  It's easy enough to commit the
> original diff over top instead, if that's the better way to go.

If the generated code difference is not significant, it is a strong
argument to keep the committed version.  But I find it quite surprising.
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Warner Losh
On Tue, Oct 8, 2019 at 8:22 AM Ian Lepore  wrote:

> On Tue, 2019-10-08 at 12:26 +0200, Emmanuel Vadot wrote:
> >  Hi Glen,
> >
> > On Thu, 19 Sep 2019 16:43:12 + (UTC)
> > Glen Barber  wrote:
> >
> > > Author: gjb
> > > Date: Thu Sep 19 16:43:12 2019
> > > New Revision: 352520
> > > URL: https://svnweb.freebsd.org/changeset/base/352520
> > >
> > > Log:
> > >   Apply r346792 (cperciva) from stable/12 to head.  The original commit
> > >   message:
> > >
> > >On non-x86 systems, use "quarterly" packages.
> > >
> > >x86 architectures have "latest" package builds on stable/*, so keep
> using
> > >those (they'll get switched over to "quarterly" during releases).
> > >
> > >   The original commit was a direct commit to stable/12, as at the time
> it
> > >   was presumed it would not be necessary for head.  However, when it
> is time
> > >   to create a releng branch or switch from PRERELEASE/STABLE to
> BETA/RC, the
> > >   pkg(7) Makefile needs further adjusting.  This commit includes those
> > >   further adjustments, evaluating the BRANCH variable from
> release/Makefile
> > >   to determine the pkg(7) repository to use.
> > >
> > >   MFC after:immediate (if possible)
> > >   Sponsored by: Rubicon Communications, LLC (Netgate)
> > >
> > > Modified:
> > >   head/usr.sbin/pkg/Makefile
> > >
> > > Modified: head/usr.sbin/pkg/Makefile
> > >
> ==
> > > --- head/usr.sbin/pkg/Makefile  Thu Sep 19 15:12:32 2019
> (r352519)
> > > +++ head/usr.sbin/pkg/Makefile  Thu Sep 19 16:43:12 2019
> (r352520)
> > > @@ -1,6 +1,16 @@
> > >  # $FreeBSD$
> > >
> > > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > > +PKGCONFBRANCH?=quarterly
> > > +.else
> > > +_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
> > > +BRANCH?=   ${_BRANCH}
> > > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > > +PKGCONFBRANCH?=quarterly
> > > +. else
> > >  PKGCONFBRANCH?=latest
> > > +. endif
> > > +.endif
> > >  CONFS= FreeBSD.conf.${PKGCONFBRANCH}
> > >  CONFSNAME= FreeBSD.conf
> > >  CONFSDIR=  /etc/pkg
> >
> >  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> > this doesn't work.
> >  Also this depends on MACHINE and iirc MACHINE is always the host when
> > cross compiling.
> >  I think this need to be reverted.
> >
> >  Cheers,
> >
>
> MACHINE is the build host when you first launch make(1), but the
> crossbuild code in Makefile.inc1 overrides MACHINE to TARGET (and
> MACHINE_ARCH to TARGET_ARCH) and launches a sub-make that way.
>

MACHINE_ARCH likely should be used in the above, since MACHINE is the
KERNEL architecture and MACHINE_ARCH is the user-land architecture.
Packages are almost exclusively for user-land, and we normally test
MACHINE_ARCH outside of sys except for some very narrow cases (that likely
could go away now that we no longer have pc98). In this case, it likely
doesn't matter. It might for arm, though, since armv7 may have packages,
but armv6 or plain arm might not and we may want to configure them
differently as a result.

Ian is right that during a buildworld, we specify TARGET/TARGET_ARCH which
use use in Makefile.inc1 for various things, but for the actual building
MACHINE and MACHINE_ARCH are what are used/tested.

Warner
___
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: r353305 - head/tests/sys/kern

2019-10-08 Thread Konstantin Belousov
On Tue, Oct 08, 2019 at 01:43:05PM +, Eric van Gyzen wrote:
> Author: vangyzen
> Date: Tue Oct  8 13:43:05 2019
> New Revision: 353305
> URL: https://svnweb.freebsd.org/changeset/base/353305
> 
> Log:
>   Fix problems in the kern_maxfiles__increase test
>   
>   ATF functions such as ATF_REQUIRE do not work correctly in child processes.
>   Use plain C functions to report errors instead.
There are much more tests that fork and use ATF_ in children.
Look e.g. at most ptrace(2) tests.

>   
>   In the parent, check for the untimely demise of children.  Without this,
>   the test hung until the framework's timeout.
>   
>   Raise the resource limit on the number of open files.  If this was too low,
>   the test hit the two problems above.
>   
>   Restore the kern.maxfiles sysctl OID in the cleanup function.
>   The body prematurely removed the symlink in which the old value was saved.
>   
>   Make the test more robust by opening more files.  In fact, due to the
>   integer division by 4, this was necessary to make the test valid with
>   some initial values of maxfiles.  Thanks, asomers@.
>   
>   wait() for children instead of sleeping.
>   
>   Clean up a temporary file created by the test ("afile").
>   
>   Reviewed by:asomers
>   MFC after:  1 week
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D21900
> 
> Modified:
>   head/tests/sys/kern/kern_descrip_test.c
> 
> Modified: head/tests/sys/kern/kern_descrip_test.c
> ==
> --- head/tests/sys/kern/kern_descrip_test.c   Tue Oct  8 11:27:48 2019
> (r353304)
> +++ head/tests/sys/kern/kern_descrip_test.c   Tue Oct  8 13:43:05 2019
> (r353305)
> @@ -28,16 +28,22 @@
>  __FBSDID("$FreeBSD$");
>  
>  #include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> -#include 
> -#include 
> -#include 
>  #include 
> +
>  #include 
>  
>  static volatile sig_atomic_t done;
> @@ -92,8 +98,13 @@ openfiles2(size_t n)
>   int r;
>  
>   errno = 0;
> - for (i = 0; i < n; i++)
> - ATF_REQUIRE((r = open(AFILE, O_RDONLY)) != -1);
> + for (i = 0; i < n; i++) {
> + r = open(AFILE, O_RDONLY);
> + if (r < 0) {
> + fprintf(stderr, "open: %s\n", strerror(errno));
> + _exit(1);
> + }
> + }
>   kill(getppid(), SIGUSR1);
>  
>   for (;;) {
> @@ -118,10 +129,14 @@ openfiles(size_t n)
>   for (i = 0; i < PARALLEL; i++)
>   if (fork() == 0)
>   openfiles2(n / PARALLEL);
> - while (done != PARALLEL)
> + while (done != PARALLEL) {
>   usleep(1000);
> + ATF_REQUIRE_EQ_MSG(0, waitpid(-1, NULL, WNOHANG),
> + "a child exited unexpectedly");
> + }
>   unlink(RENDEZVOUS);
> - usleep(4);
> + for (i = 0; i < PARALLEL; i++)
> + ATF_CHECK_MSG(wait(NULL) > 0, "wait: %s", strerror(errno));
>  }
>  
>  ATF_TC_WITH_CLEANUP(kern_maxfiles__increase);
> @@ -138,6 +153,7 @@ ATF_TC_BODY(kern_maxfiles__increase, tc)
>   size_t oldlen;
>   int maxfiles, oldmaxfiles, current;
>   char buf[80];
> + struct rlimit rl;
>  
>   oldlen = sizeof(maxfiles);
>   if (sysctlbyname("kern.maxfiles", , , NULL, 0) == -1)
> @@ -160,8 +176,11 @@ ATF_TC_BODY(kern_maxfiles__increase, tc)
>   atf_tc_fail("getsysctlbyname(%s): %s", "kern.maxfiles",
>   strerror(errno));
>  
> - openfiles(oldmaxfiles - current + 1);
> - (void)unlink(VALUE);
> + rl.rlim_cur = rl.rlim_max = maxfiles;
> + ATF_REQUIRE_EQ_MSG(0, setrlimit(RLIMIT_NOFILE, ),
> + "setrlimit(RLIMIT_NOFILE, %d): %s", maxfiles, strerror(errno));
> +
> + openfiles(oldmaxfiles - current + EXPANDBY / 2);
>  }
>  
>  ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
> @@ -178,6 +197,8 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
>   , oldlen);
>   }
>   }
> + (void)unlink(VALUE);
> + (void)unlink(AFILE);
>  }
>  
>  ATF_TP_ADD_TCS(tp)
___
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: r353308 - head/sys/riscv/riscv

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 15:03:48 2019
New Revision: 353308
URL: https://svnweb.freebsd.org/changeset/base/353308

Log:
  Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().
  
  During a CoW fault, we must check for both 4KB and 2MB mappings before
  clearing PGA_WRITEABLE on the old mapping's page.  Previously we were
  only checking for 4KB mappings.  This was missed in r344106.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Tue Oct  8 14:59:50 2019(r353307)
+++ head/sys/riscv/riscv/pmap.c Tue Oct  8 15:03:48 2019(r353308)
@@ -2833,7 +2833,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
if ((new_l3 & PTE_SW_MANAGED) == 0)
free_pv_entry(pmap, pv);
if ((om->aflags & PGA_WRITEABLE) != 0 &&
-   TAILQ_EMPTY(>md.pv_list))
+   TAILQ_EMPTY(>md.pv_list) &&
+   ((om->flags & PG_FICTITIOUS) != 0 ||
+   TAILQ_EMPTY(_to_pvh(opa)->pv_list)))
vm_page_aflag_clear(om, PGA_WRITEABLE);
}
pmap_invalidate_page(pmap, va);
___
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: r353307 - head/sys/amd64/amd64

2019-10-08 Thread Mateusz Guzik
Author: mjg
Date: Tue Oct  8 14:59:50 2019
New Revision: 353307
URL: https://svnweb.freebsd.org/changeset/base/353307

Log:
  amd64 pmap: allocate pv table entries for gaps in PA
  
  This matches the state prior to r353149 and fixes crashes with DRM
  modules.
  
  Reported and tested by:   cy, garga, Krasznai Andras
  Fixes: r353149 ("amd64 pmap: implement per-superpage locks")
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Oct  8 14:54:35 2019(r353306)
+++ head/sys/amd64/amd64/pmap.c Tue Oct  8 14:59:50 2019(r353307)
@@ -1864,26 +1864,14 @@ pmap_init_pv_table(void)
highest = -1;
s = 0;
for (i = 0; i < vm_phys_nsegs; i++) {
-   start = vm_phys_segs[i].start / NBPDR;
end = vm_phys_segs[i].end / NBPDR;
domain = vm_phys_segs[i].domain;
 
if (highest >= end)
continue;
 
-   if (start < highest) {
-   start = highest + 1;
-   pvd = _table[start];
-   } else {
-   /*
-* The lowest address may land somewhere in the middle
-* of our page. Simplify the code by pretending it is
-* at the beginning.
-*/
-   pvd = pa_to_pmdp(vm_phys_segs[i].start);
-   pvd = (struct pmap_large_md_page *)trunc_page(pvd);
-   start = pvd - pv_table;
-   }
+   start = highest + 1;
+   pvd = _table[start];
 
pages = end - start + 1;
s = round_page(pages * sizeof(*pvd));
___
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: r353306 - head/sys/riscv/riscv

2019-10-08 Thread Mark Johnston
Author: markj
Date: Tue Oct  8 14:54:35 2019
New Revision: 353306
URL: https://svnweb.freebsd.org/changeset/base/353306

Log:
  Clear PGA_WRITEABLE in riscv's pmap_remove_l3().
  
  pmap_remove_l3() may remove the last mapping of a page, in which case
  it must clear PGA_WRITEABLE.
  
  Reported by:  Jenkins, via lwhsu
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Tue Oct  8 13:43:05 2019(r353305)
+++ head/sys/riscv/riscv/pmap.c Tue Oct  8 14:54:35 2019(r353306)
@@ -2085,6 +2085,7 @@ static int
 pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, 
 pd_entry_t l2e, struct spglist *free, struct rwlock **lockp)
 {
+   struct md_page *pvh;
pt_entry_t old_l3;
vm_paddr_t phys;
vm_page_t m;
@@ -2104,6 +2105,12 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_
vm_page_aflag_set(m, PGA_REFERENCED);
CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m);
pmap_pvh_free(>md, pmap, va);
+   if (TAILQ_EMPTY(>md.pv_list) &&
+   (m->flags & PG_FICTITIOUS) == 0) {
+   pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
+   if (TAILQ_EMPTY(>pv_list))
+   vm_page_aflag_clear(m, PGA_WRITEABLE);
+   }
}
 
return (pmap_unuse_pt(pmap, va, l2e, free));
___
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: r353149 - head/sys/amd64/amd64

2019-10-08 Thread Cy Schubert
Agreed. Yes, this fixes it. Thank you for all your work and persistence.


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

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


In message 
, Mateusz Guzik writes:
> It's definitely drm, I noted it does not like the sparse array.
>
> This one should do thet trick then:
> https://people.freebsd.org/~mjg/pmap-nosparse.diff
>
> On 10/8/19, Cy Schubert  wrote:
> > Still no joy.
> >
> > I still think drm-current-kmod is involved because these are produced just
> > prior to the panic whereas the dmesg buffer is clean of them without
> > r353149.
> >
> > Unread portion of the kernel message buffer:
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 577
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 577
> > WARNING !drm_modeset_is_locked(>mode_config.connection_mutex) failed
> > at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper
> > .c:622
> > WARNING !drm_modeset_is_locked(>mode_config.connection_mutex) failed
> > at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper
> > .c:622
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > WARNING !drm_modeset_is_locked(>mutex) failed at
> > /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c
> :
> > 821
> > <4>WARN_ON(!mutex_is_locked(>struct_mutex))WARN_ON(!mutex_is_locked(
> e
> > v->struct_mutex))
> >
> > <4>WARN_ON(!mutex_is_locked(>lock))WARN_ON(!mutex_is_locked(>
> > lock))
> >
> > My servers (no X11) work well with this. It's only drm-current-kmod that
> > has gas with this rev.
> >
> > I've cc'd the maintainer of drm-current-kmod (x11@).
> >
> >
> > --
> > Cheers,
> > Cy Schubert 
> > FreeBSD UNIX: Web:  http://www.FreeBSD.org
> >
> > The need of the many outweighs the greed of the few.
> >
> >
> >
> > In message
> >  > om>
> > , Mateusz Guzik writes:
> >> Does this fix it for you?
> >>
> >> https://people.freebsd.org/~mjg/pmap-fict.diff
> >>
> >> On 10/7/19, Mateusz Guzik  wrote:
> >> > Ok, looks ilke it does not like the sparse array for fictitious
> >> > mappings. I'll see about a patch.
> >> >
> >> > On 10/7/19, Cy Schubert  wrote:
> >> >> In message
> >> >>  >> >> om>
> >> >> , Mateusz Guzik writes:
> >> >>> Can you show:
> >> >>>
> >> >>> sysctl vm.phys_segso
> >> >>
> >> >> vm.phys_segs:
> >> >> SEGMENT 0:
> >> >>
> >> >> start: 0x1
> >> >> end:   0x9d000
> >> >> domain:0
> >> >> free list: 0x80f31070
> >> >>
> >> >> SEGMENT 1:
> >> >>
> >> >> start: 0x10
> >> >> end:   0x100
> >> >> domain:0
> >> >> free list: 0x80f31070
> >> >>
> >> >> SEGMENT 2:
> >> >>
> >> >> start: 0x100
> >> >> end:   0x1ca4000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 3:
> >> >>
> >> >> start: 0x1cb3000
> >> >> end:   0x1ce3000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 4:
> >> >>
> >> >> start: 0x1f0
> >> >> end:   0x2000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 5:
> >> >>
> >> >> start: 0x2020
> >> >> end:   0x4000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 6:
> >> >>
> >> >> start: 0x40203000
> >> >> end:   0xd4993000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 7:
> >> >>
> >> >> start: 0xd6fff000
> >> >> end:   0xd700
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 8:
> >> >>
> >> >> start: 0x11000
> >> >> end:   0x211d4d000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >> SEGMENT 9:
> >> >>
> >> >> start: 0x21fc0
> >> >> end:   0x21fd44000
> >> >> domain:0
> >> >> free list: 0x80f30e00
> >> >>
> >> >>
> >> >>
> >> >>>
> >> >>> and from the crashdump:
> >> >>> p pv_table
> >> >>
> >> >> $1 = (struct pmap_large_md_page *) 0xfe000e00
> >> >>
> >> >> kgdb) p *pv_table
> >> >> $1 = {pv_lock = {lock_object = {lo_name = 0x80b0a9ce "pmap pv
> 

Re: svn commit: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Emmanuel Vadot
On Tue, 08 Oct 2019 08:22:33 -0600
Ian Lepore  wrote:

> On Tue, 2019-10-08 at 12:26 +0200, Emmanuel Vadot wrote:
> >  Hi Glen,
> > 
> > On Thu, 19 Sep 2019 16:43:12 + (UTC)
> > Glen Barber  wrote:
> > 
> > > Author: gjb
> > > Date: Thu Sep 19 16:43:12 2019
> > > New Revision: 352520
> > > URL: https://svnweb.freebsd.org/changeset/base/352520
> > > 
> > > Log:
> > >   Apply r346792 (cperciva) from stable/12 to head.  The original commit
> > >   message:
> > >   
> > >On non-x86 systems, use "quarterly" packages.
> > >   
> > >x86 architectures have "latest" package builds on stable/*, so keep 
> > > using
> > >those (they'll get switched over to "quarterly" during releases).
> > >   
> > >   The original commit was a direct commit to stable/12, as at the time it
> > >   was presumed it would not be necessary for head.  However, when it is 
> > > time
> > >   to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, 
> > > the
> > >   pkg(7) Makefile needs further adjusting.  This commit includes those
> > >   further adjustments, evaluating the BRANCH variable from 
> > > release/Makefile
> > >   to determine the pkg(7) repository to use.
> > >   
> > >   MFC after:  immediate (if possible)
> > >   Sponsored by:   Rubicon Communications, LLC (Netgate)
> > > 
> > > Modified:
> > >   head/usr.sbin/pkg/Makefile
> > > 
> > > Modified: head/usr.sbin/pkg/Makefile
> > > ==
> > > --- head/usr.sbin/pkg/MakefileThu Sep 19 15:12:32 2019
> > > (r352519)
> > > +++ head/usr.sbin/pkg/MakefileThu Sep 19 16:43:12 2019
> > > (r352520)
> > > @@ -1,6 +1,16 @@
> > >  # $FreeBSD$
> > >  
> > > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > > +PKGCONFBRANCH?=  quarterly
> > > +.else
> > > +_BRANCH!=${MAKE} -C ${SRCTOP}/release -V BRANCH
> > > +BRANCH?= ${_BRANCH}
> > > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > > +PKGCONFBRANCH?=  quarterly
> > > +. else
> > >  PKGCONFBRANCH?=  latest
> > > +. endif
> > > +.endif
> > >  CONFS=   FreeBSD.conf.${PKGCONFBRANCH}
> > >  CONFSNAME=   FreeBSD.conf
> > >  CONFSDIR=/etc/pkg
> > 
> >  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> > this doesn't work.
> >  Also this depends on MACHINE and iirc MACHINE is always the host when
> > cross compiling.
> >  I think this need to be reverted.
> > 
> >  Cheers,
> > 
> 
> MACHINE is the build host when you first launch make(1), but the
> crossbuild code in Makefile.inc1 overrides MACHINE to TARGET (and
> MACHINE_ARCH to TARGET_ARCH) and launches a sub-make that way.
> 
> -- Ian

 Ah ok, thanks for this info.

 Anyway it's still need to be reverted as all arches should use latest
on CURRENT.

-- 
Emmanuel Vadot  
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Ian Lepore
On Tue, 2019-10-08 at 12:26 +0200, Emmanuel Vadot wrote:
>  Hi Glen,
> 
> On Thu, 19 Sep 2019 16:43:12 + (UTC)
> Glen Barber  wrote:
> 
> > Author: gjb
> > Date: Thu Sep 19 16:43:12 2019
> > New Revision: 352520
> > URL: https://svnweb.freebsd.org/changeset/base/352520
> > 
> > Log:
> >   Apply r346792 (cperciva) from stable/12 to head.  The original commit
> >   message:
> >   
> >On non-x86 systems, use "quarterly" packages.
> >   
> >x86 architectures have "latest" package builds on stable/*, so keep using
> >those (they'll get switched over to "quarterly" during releases).
> >   
> >   The original commit was a direct commit to stable/12, as at the time it
> >   was presumed it would not be necessary for head.  However, when it is time
> >   to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, the
> >   pkg(7) Makefile needs further adjusting.  This commit includes those
> >   further adjustments, evaluating the BRANCH variable from release/Makefile
> >   to determine the pkg(7) repository to use.
> >   
> >   MFC after:immediate (if possible)
> >   Sponsored by: Rubicon Communications, LLC (Netgate)
> > 
> > Modified:
> >   head/usr.sbin/pkg/Makefile
> > 
> > Modified: head/usr.sbin/pkg/Makefile
> > ==
> > --- head/usr.sbin/pkg/Makefile  Thu Sep 19 15:12:32 2019
> > (r352519)
> > +++ head/usr.sbin/pkg/Makefile  Thu Sep 19 16:43:12 2019
> > (r352520)
> > @@ -1,6 +1,16 @@
> >  # $FreeBSD$
> >  
> > +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> > +PKGCONFBRANCH?=quarterly
> > +.else
> > +_BRANCH!=  ${MAKE} -C ${SRCTOP}/release -V BRANCH
> > +BRANCH?=   ${_BRANCH}
> > +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> > +PKGCONFBRANCH?=quarterly
> > +. else
> >  PKGCONFBRANCH?=latest
> > +. endif
> > +.endif
> >  CONFS= FreeBSD.conf.${PKGCONFBRANCH}
> >  CONFSNAME= FreeBSD.conf
> >  CONFSDIR=  /etc/pkg
> 
>  Tier 2 (and weird tier1 like aarch64) only have latest for current so
> this doesn't work.
>  Also this depends on MACHINE and iirc MACHINE is always the host when
> cross compiling.
>  I think this need to be reverted.
> 
>  Cheers,
> 

MACHINE is the build host when you first launch make(1), but the
crossbuild code in Makefile.inc1 overrides MACHINE to TARGET (and
MACHINE_ARCH to TARGET_ARCH) and launches a sub-make that way.

-- Ian


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


Re: svn commit: r353296 - head/sys/powerpc/include

2019-10-08 Thread Justin Hibbits
On Tue, 8 Oct 2019 11:16:04 +0300
Konstantin Belousov  wrote:

> On Tue, Oct 08, 2019 at 01:36:34AM +, Justin Hibbits wrote:
> > Author: jhibbits
> > Date: Tue Oct  8 01:36:34 2019
> > New Revision: 353296
> > URL: https://svnweb.freebsd.org/changeset/base/353296
> > 
> > Log:
> >   powerpc: Implement atomic_(f)cmpset_ for short and char
> >   |
> >   This adds two implementations for each atomic_fcmpset_ and
> > atomic_cmpset_ short and char functions, selectable at compile time
> > for the target architecture.  By default, it uses a generic
> > shift-and-mask to perform atomic updates to sub-components of
> > 32-bit words from . However, if
> > ISA_206_ATOMICS is defined it uses the ll/sc instructions for
> > halfword and bytes, introduced in PowerISA 2.06.  These
> > instructions are supported by all IBM processors from POWER7 on, as
> > well as the Freescale/NXP e6500 core.  Although the e5500 and
> > e500mc both implement PowerISA 2.06 they do not implement these
> > instructions. As part of this, clean up the atomic_(f)cmpset_acq
> > and _rel wrappers, by using macros to reduce code duplication.
> >   
> >   ISA_206_ATOMICS requires clang or newer binutils (2.20 or later).
> >  
> Why don't you use normal word-sized ll/sc tlwarx/stwcx, and only
> modifying the part of the register as needed ?  This would work on
> all supported CPUs, right ?
> 
> When kevans did the _atomic_subword.h, one of the arches involved was
> sparc64, which does not have ll/sc.  Also for MIPS there are some fine
> details which might mean that C implementation is less work than using
> word-sized ll/sc.  But why for power ?

No real significant reason.  In fact, the review's diff has exactly
what you're asking for.  The only reason I modified it for commit with
Kyle's work was purely readability, I thought using the C wrapper with
atomic_fcmpset_() was just marginally cleaner. I haven't checked, but I
don't think the inline code difference is too great, but I'll have to do
another review of it to be sure.  It's easy enough to commit the
original diff over top instead, if that's the better way to go.

- Justin
___
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: r353305 - head/tests/sys/kern

2019-10-08 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Oct  8 13:43:05 2019
New Revision: 353305
URL: https://svnweb.freebsd.org/changeset/base/353305

Log:
  Fix problems in the kern_maxfiles__increase test
  
  ATF functions such as ATF_REQUIRE do not work correctly in child processes.
  Use plain C functions to report errors instead.
  
  In the parent, check for the untimely demise of children.  Without this,
  the test hung until the framework's timeout.
  
  Raise the resource limit on the number of open files.  If this was too low,
  the test hit the two problems above.
  
  Restore the kern.maxfiles sysctl OID in the cleanup function.
  The body prematurely removed the symlink in which the old value was saved.
  
  Make the test more robust by opening more files.  In fact, due to the
  integer division by 4, this was necessary to make the test valid with
  some initial values of maxfiles.  Thanks, asomers@.
  
  wait() for children instead of sleeping.
  
  Clean up a temporary file created by the test ("afile").
  
  Reviewed by:  asomers
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D21900

Modified:
  head/tests/sys/kern/kern_descrip_test.c

Modified: head/tests/sys/kern/kern_descrip_test.c
==
--- head/tests/sys/kern/kern_descrip_test.c Tue Oct  8 11:27:48 2019
(r353304)
+++ head/tests/sys/kern/kern_descrip_test.c Tue Oct  8 13:43:05 2019
(r353305)
@@ -28,16 +28,22 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
-#include 
-#include 
 #include 
+
 #include 
 
 static volatile sig_atomic_t done;
@@ -92,8 +98,13 @@ openfiles2(size_t n)
int r;
 
errno = 0;
-   for (i = 0; i < n; i++)
-   ATF_REQUIRE((r = open(AFILE, O_RDONLY)) != -1);
+   for (i = 0; i < n; i++) {
+   r = open(AFILE, O_RDONLY);
+   if (r < 0) {
+   fprintf(stderr, "open: %s\n", strerror(errno));
+   _exit(1);
+   }
+   }
kill(getppid(), SIGUSR1);
 
for (;;) {
@@ -118,10 +129,14 @@ openfiles(size_t n)
for (i = 0; i < PARALLEL; i++)
if (fork() == 0)
openfiles2(n / PARALLEL);
-   while (done != PARALLEL)
+   while (done != PARALLEL) {
usleep(1000);
+   ATF_REQUIRE_EQ_MSG(0, waitpid(-1, NULL, WNOHANG),
+   "a child exited unexpectedly");
+   }
unlink(RENDEZVOUS);
-   usleep(4);
+   for (i = 0; i < PARALLEL; i++)
+   ATF_CHECK_MSG(wait(NULL) > 0, "wait: %s", strerror(errno));
 }
 
 ATF_TC_WITH_CLEANUP(kern_maxfiles__increase);
@@ -138,6 +153,7 @@ ATF_TC_BODY(kern_maxfiles__increase, tc)
size_t oldlen;
int maxfiles, oldmaxfiles, current;
char buf[80];
+   struct rlimit rl;
 
oldlen = sizeof(maxfiles);
if (sysctlbyname("kern.maxfiles", , , NULL, 0) == -1)
@@ -160,8 +176,11 @@ ATF_TC_BODY(kern_maxfiles__increase, tc)
atf_tc_fail("getsysctlbyname(%s): %s", "kern.maxfiles",
strerror(errno));
 
-   openfiles(oldmaxfiles - current + 1);
-   (void)unlink(VALUE);
+   rl.rlim_cur = rl.rlim_max = maxfiles;
+   ATF_REQUIRE_EQ_MSG(0, setrlimit(RLIMIT_NOFILE, ),
+   "setrlimit(RLIMIT_NOFILE, %d): %s", maxfiles, strerror(errno));
+
+   openfiles(oldmaxfiles - current + EXPANDBY / 2);
 }
 
 ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
@@ -178,6 +197,8 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, tc)
, oldlen);
}
}
+   (void)unlink(VALUE);
+   (void)unlink(AFILE);
 }
 
 ATF_TP_ADD_TCS(tp)
___
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: r353274 - in head/sys: net sys

2019-10-08 Thread Bjoern A. Zeeb

On 8 Oct 2019, at 12:50, Hans Petter Selasky wrote:


On 2019-10-08 14:48, Bjoern A. Zeeb wrote:

On 7 Oct 2019, at 14:15, Hans Petter Selasky wrote:


Author: hselasky
Date: Mon Oct  7 14:15:41 2019
New Revision: 353274
URL: https://svnweb.freebsd.org/changeset/base/353274

Log:
  Factor out VNET shutdown check into an own vnet structure field.
  Remove the now obsolete vnet_state field. This greatly simplifies 
the

  detection of VNET shutdown and avoids code duplication.


I think I tried to say that the vnet_state is extremely helpful for 
debugging as you know where each of the stacks is during 
initialisation/shutdown, especially with loadable  modules and that 
it should stay and I cannot remember that I removed it in the patch 
that I suggested.


I didn’t re-used a field but extended the structure.  What you did 
means you cannot MFC this easily.  Also it means that all previous 
vnet consumers got invalidated and the VNET_MAGIC_N should have been 
bumped and all modules need a re-compile.





OK I can fix that, but should VNET_MAGIC_N be bumped when adding the 
new vnet_shutdown boolean to this structure?


Thanks!

Yes, I guess it should be though it is technically not needed.

But also see my other follow-up email to the bool flag.  I think we are 
back to the point of “is the vnet in a stable state or not?”  
whereas for your further frag6 change your question only is “is the 
vnet shutting down or not because resources might be freed already 
otherwise?”.


For your https://reviews.freebsd.org/D19622 the boolean shutdown flag as 
it was originally in my patch should be fine.  The fact that if_vmove() 
and related are not happy is my fault. Sorry.


There’s yet another problem by the fact that the interfaces go away 
first, as that doesn’t allow us to properly shutdown connections 
anymore.  However if they do not go first packets will continue to come 
in and a clean shutdown without any packet processing will be even 
harder.  I think (in a quite moment of a day or two, maybe with a 
whiteboard) we should re-hash that decision I had to make a few years 
ago in the light of epoch(9) now.  Probably that will almost be the same 
problem as the mbuf carrying the ifp along.  (for another day…).



/bz
___
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: r353302 - head/sys/net

2019-10-08 Thread Bjoern A. Zeeb

On 8 Oct 2019, at 11:06, Hans Petter Selasky wrote:


Author: hselasky
Date: Tue Oct  8 11:06:24 2019
New Revision: 353302
URL: https://svnweb.freebsd.org/changeset/base/353302

Log:
  Fix regression issue after r353274:

  Make sure the vnet_shutdown field is not set until after all
  VNET_SYSUNINIT()'s in the SI_SUB_VNET_DONE subsystem have been
  executed. Especially the vnet_if_return() functions requires that
  if_move() is still operational.


Which basically means that the boolean suggestion I suggested to you in 
the end isn’t right either as now some parts of the shutdown run 
without shutdown being set and checking state boundaries was the right 
thing.  Now to know whether it is a startup or a shutdown you probably 
need both together?




  Reported by:  lwhsu@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/vnet.c

Modified: head/sys/net/vnet.c
==
--- head/sys/net/vnet.c Tue Oct  8 10:50:16 2019(r353301)
+++ head/sys/net/vnet.c Tue Oct  8 11:06:24 2019(r353302)
@@ -279,9 +279,6 @@ vnet_destroy(struct vnet *vnet)
LIST_REMOVE(vnet, vnet_le);
VNET_LIST_WUNLOCK();

-   /* Signal that VNET is being shutdown. */
-   vnet->vnet_shutdown = 1;
-
CURVNET_SET_QUIET(vnet);
vnet_sysuninit();
CURVNET_RESTORE();
@@ -353,15 +350,15 @@ vnet_data_startup(void *dummy __unused)
 }
 SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, 
NULL);


-/* Dummy VNET_SYSINIT to make sure we always reach the final end 
state. */

 static void
-vnet_sysinit_done(void *unused __unused)
+vnet_sysuninit_shutdown(void *unused __unused)
 {

-   return;
+   /* Signal that VNET is being shutdown. */
+   curvnet->vnet_shutdown = 1;
 }
-VNET_SYSINIT(vnet_sysinit_done, SI_SUB_VNET_DONE, SI_ORDER_ANY,
-vnet_sysinit_done, NULL);
+VNET_SYSUNINIT(vnet_sysuninit_shutdown, SI_SUB_VNET_DONE, 
SI_ORDER_FIRST,

+vnet_sysuninit_shutdown, NULL);

 /*
  * When a module is loaded and requires storage for a virtualized 
global

___
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: r353149 - head/sys/amd64/amd64

2019-10-08 Thread Mateusz Guzik
It's definitely drm, I noted it does not like the sparse array.

This one should do thet trick then:
https://people.freebsd.org/~mjg/pmap-nosparse.diff

On 10/8/19, Cy Schubert  wrote:
> Still no joy.
>
> I still think drm-current-kmod is involved because these are produced just
> prior to the panic whereas the dmesg buffer is clean of them without
> r353149.
>
> Unread portion of the kernel message buffer:
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 577
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 577
> WARNING !drm_modeset_is_locked(>mode_config.connection_mutex) failed
> at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper
> .c:622
> WARNING !drm_modeset_is_locked(>mode_config.connection_mutex) failed
> at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper
> .c:622
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> WARNING !drm_modeset_is_locked(>mutex) failed at
> /usr/local/sys/modules/drm-current-kmod/drivers/gpu/drm/drm_atomic_helper.c:
> 821
> <4>WARN_ON(!mutex_is_locked(>struct_mutex))WARN_ON(!mutex_is_locked(
> v->struct_mutex))
>
> <4>WARN_ON(!mutex_is_locked(>lock))WARN_ON(!mutex_is_locked(>
> lock))
>
> My servers (no X11) work well with this. It's only drm-current-kmod that
> has gas with this rev.
>
> I've cc'd the maintainer of drm-current-kmod (x11@).
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  http://www.FreeBSD.org
>
>   The need of the many outweighs the greed of the few.
>
>
>
> In message
>  om>
> , Mateusz Guzik writes:
>> Does this fix it for you?
>>
>> https://people.freebsd.org/~mjg/pmap-fict.diff
>>
>> On 10/7/19, Mateusz Guzik  wrote:
>> > Ok, looks ilke it does not like the sparse array for fictitious
>> > mappings. I'll see about a patch.
>> >
>> > On 10/7/19, Cy Schubert  wrote:
>> >> In message
>> >> > >> om>
>> >> , Mateusz Guzik writes:
>> >>> Can you show:
>> >>>
>> >>> sysctl vm.phys_segso
>> >>
>> >> vm.phys_segs:
>> >> SEGMENT 0:
>> >>
>> >> start: 0x1
>> >> end:   0x9d000
>> >> domain:0
>> >> free list: 0x80f31070
>> >>
>> >> SEGMENT 1:
>> >>
>> >> start: 0x10
>> >> end:   0x100
>> >> domain:0
>> >> free list: 0x80f31070
>> >>
>> >> SEGMENT 2:
>> >>
>> >> start: 0x100
>> >> end:   0x1ca4000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 3:
>> >>
>> >> start: 0x1cb3000
>> >> end:   0x1ce3000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 4:
>> >>
>> >> start: 0x1f0
>> >> end:   0x2000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 5:
>> >>
>> >> start: 0x2020
>> >> end:   0x4000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 6:
>> >>
>> >> start: 0x40203000
>> >> end:   0xd4993000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 7:
>> >>
>> >> start: 0xd6fff000
>> >> end:   0xd700
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 8:
>> >>
>> >> start: 0x11000
>> >> end:   0x211d4d000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >> SEGMENT 9:
>> >>
>> >> start: 0x21fc0
>> >> end:   0x21fd44000
>> >> domain:0
>> >> free list: 0x80f30e00
>> >>
>> >>
>> >>
>> >>>
>> >>> and from the crashdump:
>> >>> p pv_table
>> >>
>> >> $1 = (struct pmap_large_md_page *) 0xfe000e00
>> >>
>> >> kgdb) p *pv_table
>> >> $1 = {pv_lock = {lock_object = {lo_name = 0x80b0a9ce "pmap pv
>> >> list",
>> >>   lo_flags = 623050752, lo_data = 0, lo_witness =
>> >> 0x8201f163},
>> >> rw_lock = 1}, pv_page = {pv_list = {tqh_first = 0x0,
>> >>   tqh_last = 0xfe000e20}, pv_gen = 0, pat_mode = 0},
>> >>   pv_invl_gen = 0}
>> >> (kgdb)
>> >>
>> >>
>> >> --
>> >> Cheers,
>> >> Cy Schubert 
>> >> FreeBSD UNIX: Web:  http://www.FreeBSD.org
>> >>
>> >>   The need of the many outweighs the greed of the few.
>> >>
>> >>
>> >>>
>> >>> On 10/7/19, Cy Schubert  wrote:
>> >>> > In message <201910070406.x9746n0u009...@slippy.cwsent.com>, Cy
>> >>> > Schubert
>> >>> > 

Re: svn commit: r353274 - in head/sys: net sys

2019-10-08 Thread Hans Petter Selasky

On 2019-10-08 14:48, Bjoern A. Zeeb wrote:

On 7 Oct 2019, at 14:15, Hans Petter Selasky wrote:


Author: hselasky
Date: Mon Oct  7 14:15:41 2019
New Revision: 353274
URL: https://svnweb.freebsd.org/changeset/base/353274

Log:
  Factor out VNET shutdown check into an own vnet structure field.
  Remove the now obsolete vnet_state field. This greatly simplifies the
  detection of VNET shutdown and avoids code duplication.


I think I tried to say that the vnet_state is extremely helpful for 
debugging as you know where each of the stacks is during 
initialisation/shutdown, especially with loadable  modules and that it 
should stay and I cannot remember that I removed it in the patch that I 
suggested.


I didn’t re-used a field but extended the structure.  What you did means 
you cannot MFC this easily.  Also it means that all previous vnet 
consumers got invalidated and the VNET_MAGIC_N should have been bumped 
and all modules need a re-compile.





OK I can fix that, but should VNET_MAGIC_N be bumped when adding the new 
vnet_shutdown boolean to this structure?


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


Re: svn commit: r353274 - in head/sys: net sys

2019-10-08 Thread Bjoern A. Zeeb

On 7 Oct 2019, at 14:15, Hans Petter Selasky wrote:


Author: hselasky
Date: Mon Oct  7 14:15:41 2019
New Revision: 353274
URL: https://svnweb.freebsd.org/changeset/base/353274

Log:
  Factor out VNET shutdown check into an own vnet structure field.
  Remove the now obsolete vnet_state field. This greatly simplifies 
the

  detection of VNET shutdown and avoids code duplication.


I think I tried to say that the vnet_state is extremely helpful for 
debugging as you know where each of the stacks is during 
initialisation/shutdown, especially with loadable  modules and that it 
should stay and I cannot remember that I removed it in the patch that I 
suggested.


I didn’t re-used a field but extended the structure.  What you did 
means you cannot MFC this easily.  Also it means that all previous vnet 
consumers got invalidated and the VNET_MAGIC_N should have been bumped 
and all modules need a re-compile.





  Discussed with:   bz@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/if.c
  head/sys/net/vnet.c
  head/sys/net/vnet.h
  head/sys/sys/param.h

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Oct  7 13:40:29 2019(r353273)
+++ head/sys/net/if.c   Mon Oct  7 14:15:41 2019(r353274)
@@ -1088,10 +1088,9 @@ if_detach_internal(struct ifnet *ifp, int 
vmove, struc

struct ifnet *iter;
int found = 0;
 #ifdef VIMAGE
-   int shutdown;
+   bool shutdown;

-   shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET &&
-ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0;
+   shutdown = ifp->if_vnet->vnet_shutdown;
 #endif
IFNET_WLOCK();
CK_STAILQ_FOREACH(iter, _ifnet, if_link)
@@ -1341,7 +1340,6 @@ if_vmove_loan(struct thread *td, struct ifnet 
*ifp, ch

 {
struct prison *pr;
struct ifnet *difp;
-   int shutdown;

/* Try to find the prison within our visibility. */
sx_slock(_lock);
@@ -1369,9 +1367,7 @@ if_vmove_loan(struct thread *td, struct ifnet 
*ifp, ch

}

/* Make sure the VNET is stable. */
-   shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET &&
-ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0;
-   if (shutdown) {
+   if (ifp->if_vnet->vnet_shutdown) {
CURVNET_RESTORE();
prison_free(pr);
return (EBUSY);
@@ -1394,7 +1390,6 @@ if_vmove_reclaim(struct thread *td, char 
*ifname, int

struct prison *pr;
struct vnet *vnet_dst;
struct ifnet *ifp;
-   int shutdown;

/* Try to find the prison within our visibility. */
sx_slock(_lock);
@@ -1423,9 +1418,7 @@ if_vmove_reclaim(struct thread *td, char 
*ifname, int

}

/* Make sure the VNET is stable. */
-   shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET &&
-ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0;
-   if (shutdown) {
+   if (ifp->if_vnet->vnet_shutdown) {
CURVNET_RESTORE();
prison_free(pr);
return (EBUSY);
@@ -2996,16 +2989,11 @@ ifioctl(struct socket *so, u_long cmd, caddr_t 
data, s

struct ifreq *ifr;
int error;
int oif_flags;
-#ifdef VIMAGE
-   int shutdown;
-#endif

CURVNET_SET(so->so_vnet);
 #ifdef VIMAGE
/* Make sure the VNET is stable. */
-   shutdown = (so->so_vnet->vnet_state > SI_SUB_VNET &&
-so->so_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0;
-   if (shutdown) {
+   if (so->so_vnet->vnet_shutdown) {
CURVNET_RESTORE();
return (EBUSY);
}

Modified: head/sys/net/vnet.c
==
--- head/sys/net/vnet.c Mon Oct  7 13:40:29 2019(r353273)
+++ head/sys/net/vnet.c Mon Oct  7 14:15:41 2019(r353274)
@@ -235,7 +235,6 @@ vnet_alloc(void)
SDT_PROBE1(vnet, functions, vnet_alloc, entry, __LINE__);
vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO);
vnet->vnet_magic_n = VNET_MAGIC_N;
-   vnet->vnet_state = 0;
SDT_PROBE2(vnet, functions, vnet_alloc, alloc, __LINE__, vnet);

/*
@@ -280,6 +279,9 @@ vnet_destroy(struct vnet *vnet)
LIST_REMOVE(vnet, vnet_le);
VNET_LIST_WUNLOCK();

+   /* Signal that VNET is being shutdown. */
+   vnet->vnet_shutdown = 1;
+
CURVNET_SET_QUIET(vnet);
vnet_sysuninit();
CURVNET_RESTORE();
@@ -573,10 +575,8 @@ vnet_sysinit(void)
struct vnet_sysinit *vs;

VNET_SYSINIT_RLOCK();
-   TAILQ_FOREACH(vs, _constructors, link) {
-   curvnet->vnet_state = vs->subsystem;
+   TAILQ_FOREACH(vs, _constructors, link)
vs->func(vs->arg);
-   }
VNET_SYSINIT_RUNLOCK();
 }

@@ -592,10 +592,8 @@ vnet_sysuninit(void)


svn commit: r353304 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-10-08 Thread Andriy Gapon
Author: avg
Date: Tue Oct  8 11:27:48 2019
New Revision: 353304
URL: https://svnweb.freebsd.org/changeset/base/353304

Log:
  zfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl
  
  As long as we support ZFS on 32-bit platforms we should do this for all
  64-bit variables that are modified in a lockless fashion using atomic
  operations.  Otherwise, there is a risk of a reading a torn value.
  
  Here is a rationale for why I am doing this in dmu_object_alloc_impl:
  - it's very recent code
  - the code deals with object IDs and a number of objects in a file
system can overflow 32 bits
  - incorrect allocation of an object ID may result in hard to debug
problems
  - fixing all plain reads of 64-bit atomic variables is not a trivial
undertaking to do in one shot, so I chose to do it incrementally
  
  MFC after:3 weeks
  X-MFC after:  r353301, r353176

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.cTue Oct 
 8 11:07:16 2019(r353303)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.cTue Oct 
 8 11:27:48 2019(r353304)
@@ -76,7 +76,11 @@ dmu_object_alloc_impl(objset_t *os, dmu_object_type_t 
if (dnodes_per_chunk > L1_dnode_count)
dnodes_per_chunk = L1_dnode_count;
 
+#ifdef __FreeBSD__
+   object = atomic_load_64(cpuobj);
+#else
object = *cpuobj;
+#endif
 
for (;;) {
/*
___
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: r353303 - head/sys/netinet

2019-10-08 Thread Michael Tuexen
Author: tuexen
Date: Tue Oct  8 11:07:16 2019
New Revision: 353303
URL: https://svnweb.freebsd.org/changeset/base/353303

Log:
  Validate length before use it, not vice versa.
  r353060 should have contained this...
  This fixes
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18070
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_asconf.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Tue Oct  8 11:06:24 2019
(r353302)
+++ head/sys/netinet/sctp_asconf.c  Tue Oct  8 11:07:16 2019
(r353303)
@@ -334,11 +334,11 @@ sctp_process_asconf_delete_ip(struct sockaddr *src,
 #endif
 
aparam_length = ntohs(aph->ph.param_length);
-   ph = (struct sctp_paramhdr *)(aph + 1);
-   param_type = ntohs(ph->param_type);
if (aparam_length < sizeof(struct sctp_asconf_paramhdr) + sizeof(struct 
sctp_paramhdr)) {
return (NULL);
}
+   ph = (struct sctp_paramhdr *)(aph + 1);
+   param_type = ntohs(ph->param_type);
 #if defined(INET) || defined(INET6)
param_length = ntohs(ph->param_length);
if (param_length + sizeof(struct sctp_asconf_paramhdr) != 
aparam_length) {
___
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: r353302 - head/sys/net

2019-10-08 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Oct  8 11:06:24 2019
New Revision: 353302
URL: https://svnweb.freebsd.org/changeset/base/353302

Log:
  Fix regression issue after r353274:
  
  Make sure the vnet_shutdown field is not set until after all
  VNET_SYSUNINIT()'s in the SI_SUB_VNET_DONE subsystem have been
  executed. Especially the vnet_if_return() functions requires that
  if_move() is still operational.
  
  Reported by:  lwhsu@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/vnet.c

Modified: head/sys/net/vnet.c
==
--- head/sys/net/vnet.c Tue Oct  8 10:50:16 2019(r353301)
+++ head/sys/net/vnet.c Tue Oct  8 11:06:24 2019(r353302)
@@ -279,9 +279,6 @@ vnet_destroy(struct vnet *vnet)
LIST_REMOVE(vnet, vnet_le);
VNET_LIST_WUNLOCK();
 
-   /* Signal that VNET is being shutdown. */
-   vnet->vnet_shutdown = 1;
-
CURVNET_SET_QUIET(vnet);
vnet_sysuninit();
CURVNET_RESTORE();
@@ -353,15 +350,15 @@ vnet_data_startup(void *dummy __unused)
 }
 SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, NULL);
 
-/* Dummy VNET_SYSINIT to make sure we always reach the final end state. */
 static void
-vnet_sysinit_done(void *unused __unused)
+vnet_sysuninit_shutdown(void *unused __unused)
 {
 
-   return;
+   /* Signal that VNET is being shutdown. */
+   curvnet->vnet_shutdown = 1;
 }
-VNET_SYSINIT(vnet_sysinit_done, SI_SUB_VNET_DONE, SI_ORDER_ANY,
-vnet_sysinit_done, NULL);
+VNET_SYSUNINIT(vnet_sysuninit_shutdown, SI_SUB_VNET_DONE, SI_ORDER_FIRST,
+vnet_sysuninit_shutdown, NULL);
 
 /*
  * When a module is loaded and requires storage for a virtualized global
___
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: r353301 - head/sys/i386/include

2019-10-08 Thread Andriy Gapon
Author: avg
Date: Tue Oct  8 10:50:16 2019
New Revision: 353301
URL: https://svnweb.freebsd.org/changeset/base/353301

Log:
  i386: hide more of atomic 64-bit definitions under _KERNEL
  
  At the moment i386 does not provide 64-bit atomic operations in
  userland.  Exposing some atomic_*_64 defines can cause unnecessary
  confusion.
  
  Discussed with:   kib
  MFC after:2 weeks

Modified:
  head/sys/i386/include/atomic.h

Modified: head/sys/i386/include/atomic.h
==
--- head/sys/i386/include/atomic.h  Tue Oct  8 10:24:48 2019
(r353300)
+++ head/sys/i386/include/atomic.h  Tue Oct  8 10:50:16 2019
(r353301)
@@ -880,6 +880,7 @@ u_long  atomic_swap_long(volatile u_long *p, u_long v);
 #defineatomic_testandset_32atomic_testandset_int
 #defineatomic_testandclear_32  atomic_testandclear_int
 
+#ifdef _KERNEL
 /* Operations on 64-bit quad words. */
 #defineatomic_cmpset_acq_64 atomic_cmpset_64
 #defineatomic_cmpset_rel_64 atomic_cmpset_64
@@ -893,6 +894,7 @@ u_long  atomic_swap_long(volatile u_long *p, u_long v);
 #defineatomic_subtract_rel_64 atomic_subtract_64
 #defineatomic_load_64 atomic_load_acq_64
 #defineatomic_store_64 atomic_store_rel_64
+#endif
 
 /* Operations on pointers. */
 #defineatomic_set_ptr(p, v) \
___
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: r353283 - in head: lib lib/libstats share/man/man3 share/mk sys/amd64/conf sys/conf sys/kern sys/sys tools/build/options

2019-10-08 Thread Edward Napierala
On Mon, 7 Oct 2019 at 22:39, John Baldwin  wrote:
>
> On 10/7/19 12:05 PM, Edward Tomasz Napierala wrote:
> > Author: trasz
> > Date: Mon Oct  7 19:05:05 2019
> > New Revision: 353283
> > URL: https://svnweb.freebsd.org/changeset/base/353283
> >
> > Log:
> >   Introduce stats(3), a flexible statistics gathering API.
> >
> >   This provides a framework to define a template describing
> >   a set of "variables of interest" and the intended way for
> >   the framework to maintain them (for example the maximum, sum,
> >   t-digest, or a combination thereof).  Afterwards the user
> >   code feeds in the raw data, and the framework maintains
> >   these variables inside a user-provided, opaque stats blobs.
> >   The framework also provides a way to selectively extract the
> >   stats from the blobs.  The stats(3) framework can be used in
> >   both userspace and the kernel.
> >
> >   See the stats(3) manual page for details.
> >
> >   This will be used by the upcoming TCP statistics gathering code,
> >   https://reviews.freebsd.org/D20655.
> >
> >   The stats(3) framework is disabled by default for now, except
> >   in the NOTES kernel (for QA); it is expected to be enabled
> >   in amd64 GENERIC after a cool down period.
>
> Why sys/amd64/conf/NOTES instead of sys/conf/NOTES?  The userland
> library seems to be enabled for all architectures rather than only
> amd64?

Good point.  My original thinking was to only enable it by default on
amd64, since, well, it's "server-y stuff", but now I think of it, it doesn't
make sense.

> > Modified: head/share/man/man3/arb.3
> > ==
> > --- head/share/man/man3/arb.3 Mon Oct  7 18:55:40 2019(r353282)
> > +++ head/share/man/man3/arb.3 Mon Oct  7 19:05:05 2019(r353283)
> > @@ -30,7 +30,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd September 28, 2019
> > +.Dd October 2, 2019
> >  .Dt ARB 3
> >  .Os
> >  .Sh NAME
> > @@ -94,7 +94,8 @@
> >  .Nm ARB_INIT ,
> >  .Nm ARB_INSERT ,
> >  .Nm ARB_REMOVE ,
> > -.Nm ARB_REINSERT
> > +.Nm ARB_REINSERT ,
> > +.Nm ARB_RESET_TREE
> >  .Nd "array-based red-black trees"
> >  .Sh SYNOPSIS
> >  .In sys/arb.h
>
> Are these changes related?  Perhaps it would have been nice to commit this
> change separately with its own description before the stats(3) commit if so.

Which is exactly what I was intending to do, sigh.  But yes, this chunk
is specific to stats(3); in fact up until the last Phab revision it's been done
directly in kern_stats.c.
___
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: r352520 - head/usr.sbin/pkg

2019-10-08 Thread Emmanuel Vadot


 Hi Glen,

On Thu, 19 Sep 2019 16:43:12 + (UTC)
Glen Barber  wrote:

> Author: gjb
> Date: Thu Sep 19 16:43:12 2019
> New Revision: 352520
> URL: https://svnweb.freebsd.org/changeset/base/352520
> 
> Log:
>   Apply r346792 (cperciva) from stable/12 to head.  The original commit
>   message:
>   
>On non-x86 systems, use "quarterly" packages.
>   
>x86 architectures have "latest" package builds on stable/*, so keep using
>those (they'll get switched over to "quarterly" during releases).
>   
>   The original commit was a direct commit to stable/12, as at the time it
>   was presumed it would not be necessary for head.  However, when it is time
>   to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, the
>   pkg(7) Makefile needs further adjusting.  This commit includes those
>   further adjustments, evaluating the BRANCH variable from release/Makefile
>   to determine the pkg(7) repository to use.
>   
>   MFC after:  immediate (if possible)
>   Sponsored by:   Rubicon Communications, LLC (Netgate)
> 
> Modified:
>   head/usr.sbin/pkg/Makefile
> 
> Modified: head/usr.sbin/pkg/Makefile
> ==
> --- head/usr.sbin/pkg/MakefileThu Sep 19 15:12:32 2019
> (r352519)
> +++ head/usr.sbin/pkg/MakefileThu Sep 19 16:43:12 2019
> (r352520)
> @@ -1,6 +1,16 @@
>  # $FreeBSD$
>  
> +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
> +PKGCONFBRANCH?=  quarterly
> +.else
> +_BRANCH!=${MAKE} -C ${SRCTOP}/release -V BRANCH
> +BRANCH?= ${_BRANCH}
> +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*}
> +PKGCONFBRANCH?=  quarterly
> +. else
>  PKGCONFBRANCH?=  latest
> +. endif
> +.endif
>  CONFS=   FreeBSD.conf.${PKGCONFBRANCH}
>  CONFSNAME=   FreeBSD.conf
>  CONFSDIR=/etc/pkg

 Tier 2 (and weird tier1 like aarch64) only have latest for current so
this doesn't work.
 Also this depends on MACHINE and iirc MACHINE is always the host when
cross compiling.
 I think this need to be reverted.

 Cheers,

-- 
Emmanuel Vadot  
___
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: r353300 - stable/12/sys/compat/linsysfs

2019-10-08 Thread Tijl Coosemans
Author: tijl
Date: Tue Oct  8 10:24:48 2019
New Revision: 353300
URL: https://svnweb.freebsd.org/changeset/base/353300

Log:
  MFC r352618:
  
  Create a "drm" subdirectory for drm devices in linsysfs.  Recent versions of
  linux libdrm check for the existence of this directory:
  
  
https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d

Modified:
  stable/12/sys/compat/linsysfs/linsysfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linsysfs/linsysfs.c
==
--- stable/12/sys/compat/linsysfs/linsysfs.cTue Oct  8 10:24:01 2019
(r353299)
+++ stable/12/sys/compat/linsysfs/linsysfs.cTue Oct  8 10:24:48 2019
(r353300)
@@ -520,6 +520,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s
device_get_unit(dev) >= 0) {
dinfo = device_get_ivars(parent);
if (dinfo != NULL && dinfo->cfg.baseclass == 
PCIC_DISPLAY) {
+   pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0);
sprintf(devname, "226:%d",
device_get_unit(dev));
sub_dir = pfs_create_dir(chardev,
___
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: r353299 - stable/11/sys/compat/linsysfs

2019-10-08 Thread Tijl Coosemans
Author: tijl
Date: Tue Oct  8 10:24:01 2019
New Revision: 353299
URL: https://svnweb.freebsd.org/changeset/base/353299

Log:
  MFC r352618:
  
  Create a "drm" subdirectory for drm devices in linsysfs.  Recent versions of
  linux libdrm check for the existence of this directory:
  
  
https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d

Modified:
  stable/11/sys/compat/linsysfs/linsysfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linsysfs/linsysfs.c
==
--- stable/11/sys/compat/linsysfs/linsysfs.cTue Oct  8 07:14:21 2019
(r353298)
+++ stable/11/sys/compat/linsysfs/linsysfs.cTue Oct  8 10:24:01 2019
(r353299)
@@ -373,6 +373,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s
device_get_unit(dev) >= 0) {
dinfo = device_get_ivars(parent);
if (dinfo != NULL && dinfo->cfg.baseclass == 
PCIC_DISPLAY) {
+   pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0);
sprintf(devname, "226:%d",
device_get_unit(dev));
sub_dir = pfs_create_dir(chardev,
___
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: r353296 - head/sys/powerpc/include

2019-10-08 Thread Konstantin Belousov
On Tue, Oct 08, 2019 at 01:36:34AM +, Justin Hibbits wrote:
> Author: jhibbits
> Date: Tue Oct  8 01:36:34 2019
> New Revision: 353296
> URL: https://svnweb.freebsd.org/changeset/base/353296
> 
> Log:
>   powerpc: Implement atomic_(f)cmpset_ for short and char
>   |
>   This adds two implementations for each atomic_fcmpset_ and atomic_cmpset_
>   short and char functions, selectable at compile time for the target
>   architecture.  By default, it uses a generic shift-and-mask to perform 
> atomic
>   updates to sub-components of 32-bit words from .
>   However, if ISA_206_ATOMICS is defined it uses the ll/sc instructions for
>   halfword and bytes, introduced in PowerISA 2.06.  These instructions are
>   supported by all IBM processors from POWER7 on, as well as the Freescale/NXP
>   e6500 core.  Although the e5500 and e500mc both implement PowerISA 2.06 they
>   do not implement these instructions.
>   
>   As part of this, clean up the atomic_(f)cmpset_acq and _rel wrappers, by
>   using macros to reduce code duplication.
>   
>   ISA_206_ATOMICS requires clang or newer binutils (2.20 or later).
Why don't you use normal word-sized ll/sc tlwarx/stwcx, and only modifying
the part of the register as needed ?  This would work on all supported
CPUs, right ?

When kevans did the _atomic_subword.h, one of the arches involved was
sparc64, which does not have ll/sc.  Also for MIPS there are some fine
details which might mean that C implementation is less work than using
word-sized ll/sc.  But why for power ?
___
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: r353298 - in head/sys: compat/linprocfs dev/hwpmc fs/procfs fs/tmpfs kern security/mac vm

2019-10-08 Thread Doug Moore
Author: dougm
Date: Tue Oct  8 07:14:21 2019
New Revision: 353298
URL: https://svnweb.freebsd.org/changeset/base/353298

Log:
  Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map.
  In case the implementation ever changes from using a chain of next pointers,
  then changing the macro definition will be necessary, but changing all the
  files that iterate over vm_map entries will not.
  
  Drop a counter in vm_object.c that would have an effect only if the
  vm_map entry count was wrong.
  
  Discussed with: alc
  Reviewed by: markj
  Tested by: pho (earlier version)
  Differential Revision:https://reviews.freebsd.org/D21882

Modified:
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/fs/procfs/procfs_map.c
  head/sys/fs/tmpfs/tmpfs_vfsops.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_proc.c
  head/sys/kern/sys_process.c
  head/sys/security/mac/mac_process.c
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_object.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_swapout.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Tue Oct  8 02:36:53 2019
(r353297)
+++ head/sys/compat/linprocfs/linprocfs.c   Tue Oct  8 07:14:21 2019
(r353298)
@@ -1174,8 +1174,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
l_map_str = l32_map_str;
map = >vm_map;
vm_map_lock_read(map);
-   for (entry = map->header.next; entry != >header;
-   entry = entry->next) {
+   VM_MAP_ENTRY_FOREACH(entry, map) {
name = "";
freename = NULL;
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Tue Oct  8 02:36:53 2019
(r353297)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Tue Oct  8 07:14:21 2019
(r353298)
@@ -1884,7 +1884,7 @@ pmc_log_process_mappings(struct pmc_owner *po, struct 
map = >vm_map;
vm_map_lock_read(map);
 
-   for (entry = map->header.next; entry != >header; entry = 
entry->next) {
+   VM_MAP_ENTRY_FOREACH(entry, map) {
 
if (entry == NULL) {
PMCDBG2(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly "
@@ -1988,7 +1988,7 @@ pmc_log_process_mappings(struct pmc_owner *po, struct 
 * new lookup for this entry.  If there is no entry
 * for this address range, vm_map_lookup_entry() will
 * return the previous one, so we always want to go to
-* entry->next on the next loop iteration.
+* the next entry on the next loop iteration.
 * 
 * There is an edge condition here that can occur if
 * there is no entry at or before this address.  In

Modified: head/sys/fs/procfs/procfs_map.c
==
--- head/sys/fs/procfs/procfs_map.c Tue Oct  8 02:36:53 2019
(r353297)
+++ head/sys/fs/procfs/procfs_map.c Tue Oct  8 07:14:21 2019
(r353298)
@@ -118,8 +118,7 @@ procfs_doprocmap(PFS_FILL_ARGS)
return (ESRCH);
map = >vm_map;
vm_map_lock_read(map);
-   for (entry = map->header.next; entry != >header;
-entry = entry->next) {
+   VM_MAP_ENTRY_FOREACH(entry, map) {
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
 

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cTue Oct  8 02:36:53 2019
(r353297)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cTue Oct  8 07:14:21 2019
(r353298)
@@ -262,8 +262,7 @@ again:
vm_map_lock(map);
if (map->busy)
vm_map_wait_busy(map);
-   for (entry = map->header.next; entry != >header;
-   entry = entry->next) {
+   VM_MAP_ENTRY_FOREACH(entry, map) {
if ((entry->eflags & (MAP_ENTRY_GUARD |
MAP_ENTRY_IS_SUB_MAP | MAP_ENTRY_COW)) != 0 ||
(entry->max_protection & VM_PROT_WRITE) == 0)

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Tue Oct  8 02:36:53 2019(r353297)
+++ head/sys/kern/imgact_elf.c  Tue Oct  8 07:14:21 2019(r353298)
@@ -1738,8 +1738,7 @@ each_dumpable_segment(struct thread *td, segment_callb
boolean_t ignore_entry;
 
vm_map_lock_read(map);
-   for (entry = map->header.next; entry != >header;
-   entry = entry->next) {
+   

Re: svn commit: r353292 - in head/sys: contrib/ipfilter/netinet dev/firewire dev/iicbus dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf ofed/drivers/infiniband/ulp/ipoi

2019-10-08 Thread Peter Holm
On Mon, Oct 07, 2019 at 10:40:06PM +, Gleb Smirnoff wrote:
> Author: glebius
> Date: Mon Oct  7 22:40:05 2019
> New Revision: 353292
> URL: https://svnweb.freebsd.org/changeset/base/353292
> 
> Log:
>   Widen NET_EPOCH coverage.
>   

This seems to trigger this:

Autoloading module: uhid.ko
Autoloading module: ums.ko
ums0 on uhub4
ums0:  on usbus0
ums0: 3 buttons and [Z] coordinates ID=0
Starting dhclient.
DHCPREQUEST on igb0 to 255.255.255.255 port 67
DHCPACK from 192panic: Assertion in_epoch(net_epoch_preempt) failed at 
../../../net/if.c:3694
cpuid = 1
time = 1570517532
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe00addc28b0
vpanic() at vpanic+0x19d/frame 0xfe00addc2900
panic() at panic+0x43/frame 0xfe00addc2960
if_delmulti_ifma_flags() at if_delmulti_ifma_flags+0x141/frame 
0xfe00addc2990
inm_release_task() at inm_release_task+0x1ac/frame 0xfe00addc29f0
gtaskqueue_run_locked() at gtaskqueue_run_locked+0xf9/frame 0xfe00addc2a40
gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0x88/frame 0xfe00addc2a70
fork_exit() at fork_exit+0x84/frame 0xfe00addc2ab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe00addc2ab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
KDB: enter: panic
[ thread pid 0 tid 100019 ]
Stopped at  kdb_enter+0x3b: movq$0,kdb_why
db> x/s version
version:FreeBSD 13.0-CURRENT #0 r353292: Tue Oct  8 08:45:15 CEST 
2019\012p...@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012
db>

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