svn commit: r339345 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-10-12 Thread Alexander Motin
Author: mav
Date: Sat Oct 13 03:12:57 2018
New Revision: 339345
URL: https://svnweb.freebsd.org/changeset/base/339345

Log:
  MFC r339288: Remove extra thread_exit() call left after r329802.
  
  spa_condense_indirect_thread() is no longer a thread function, but just
  a callback for new zthr KPI.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
Directory Properties:
  stable/11/   (props changed)

Modified: 
stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
Sat Oct 13 02:21:23 2018(r339344)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
Sat Oct 13 03:12:57 2018(r339345)
@@ -723,7 +723,6 @@ spa_condense_indirect_thread(void *arg, zthr_t *zthr)
ZFS_SPACE_CHECK_EXTRA_RESERVED));
 
return (0);
-   thread_exit();
 }
 
 /*
___
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: r339343 - head/lib/libc/sys

2018-10-12 Thread Allan Jude
Author: allanjude
Date: Sat Oct 13 02:20:16 2018
New Revision: 339343
URL: https://svnweb.freebsd.org/changeset/base/339343

Log:
  Document that sendfile(2) can return ENOTCAPABLE
  
  PR:   232207
  Submitted by: Enji Cooper 
  Approved by:  re (rgrimes)

Modified:
  head/lib/libc/sys/sendfile.2

Modified: head/lib/libc/sys/sendfile.2
==
--- head/lib/libc/sys/sendfile.2Sat Oct 13 00:13:24 2018
(r339342)
+++ head/lib/libc/sys/sendfile.2Sat Oct 13 02:20:16 2018
(r339343)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 17, 2016
+.Dd October 12, 2018
 .Dt SENDFILE 2
 .Os
 .Sh NAME
@@ -336,6 +336,12 @@ is negative.
 .It Bq Er EIO
 An error occurred while reading from
 .Fa fd .
+.It Bq Er ENOTCAPABLE
+The
+.Fa fd
+or the
+.Fa s
+argument has insufficient rights.
 .It Bq Er ENOBUFS
 The system was unable to allocate an internal buffer.
 .It Bq Er ENOTCONN
___
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: r339344 - head/usr.sbin/mfiutil

2018-10-12 Thread Allan Jude
Author: allanjude
Date: Sat Oct 13 02:21:23 2018
New Revision: 339344
URL: https://svnweb.freebsd.org/changeset/base/339344

Log:
  Make `mfiutil show progress` print out the elapsed time estimate in a
  more humanized way
  
  PR:   225993
  Submitted by: Enji Cooper 
  Reviewed by:  jhb (previous version)
  Approved by:  re (rgrimes)

Modified:
  head/usr.sbin/mfiutil/mfi_cmd.c

Modified: head/usr.sbin/mfiutil/mfi_cmd.c
==
--- head/usr.sbin/mfiutil/mfi_cmd.c Sat Oct 13 02:20:16 2018
(r339343)
+++ head/usr.sbin/mfiutil/mfi_cmd.c Sat Oct 13 02:21:23 2018
(r339344)
@@ -31,17 +31,18 @@
  * $FreeBSD$
  */
 
-#include 
-#include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "mfiutil.h"
@@ -311,24 +312,34 @@ mfi_open(int unit, int acs)
return (open(path, acs));
 }
 
+static void
+print_time_humanized(uint seconds)
+{
+
+   if (seconds > 3600) {
+   printf("%u:", seconds / 3600);
+   }
+   if (seconds > 60) {
+   seconds %= 3600;
+   printf("%02u:%02u", seconds / 60, seconds % 60);
+   } else {
+   printf("%us", seconds);
+   }
+}
+
 void
 mfi_display_progress(const char *label, struct mfi_progress *prog)
 {
uint seconds;
 
-   printf("%s: %.2f%% complete, after %ds", label,
-   (float)prog->progress * 100 / 0x, prog->elapsed_seconds);
+   printf("%s: %.2f%% complete after ", label,
+   (float)prog->progress * 100 / 0x);
+   print_time_humanized(prog->elapsed_seconds);
if (prog->progress != 0 && prog->elapsed_seconds > 10) {
printf(" finished in ");
seconds = (0x1 * (uint32_t)prog->elapsed_seconds) /
prog->progress - prog->elapsed_seconds;
-   if (seconds > 3600)
-   printf("%u:", seconds / 3600);
-   if (seconds > 60) {
-   seconds %= 3600;
-   printf("%02u:%02u", seconds / 60, seconds % 60);
-   } else
-   printf("%us", seconds);
+   print_time_humanized(seconds);
}
printf("\n");
 }
___
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: r339342 - head/sys/dev/cxgbe

2018-10-12 Thread Navdeep Parhar
Author: np
Date: Sat Oct 13 00:13:24 2018
New Revision: 339342
URL: https://svnweb.freebsd.org/changeset/base/339342

Log:
  cxgbe(4): Fix a divide-by-zero that occurs when hw.cxgbe.toecaps_allowed
  is set to 0 with a kernel that has both TCP_OFFLOAD and RATELIMIT.
  
  Approved by:  re@ (gjb@)
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Fri Oct 12 23:48:10 2018(r339341)
+++ head/sys/dev/cxgbe/t4_sge.c Sat Oct 13 00:13:24 2018(r339342)
@@ -1245,15 +1245,16 @@ t4_setup_vi_queues(struct vi_info *vi)
 
snprintf(name, sizeof(name), "%s ofld_txq%d",
device_get_nameunit(vi->dev), i);
-#ifdef TCP_OFFLOAD
-   iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq);
-   init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan,
-   sc->sge.ofld_rxq[iqidx].iq.cntxt_id, name);
-#else
-   iqidx = vi->first_rxq + (i % vi->nrxq);
-   init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan,
-   sc->sge.rxq[iqidx].iq.cntxt_id, name);
-#endif
+   if (vi->nofldrxq > 0) {
+   iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq);
+   init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq,
+   pi->tx_chan, sc->sge.ofld_rxq[iqidx].iq.cntxt_id,
+   name);
+   } else {
+   iqidx = vi->first_rxq + (i % vi->nrxq);
+   init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq,
+   pi->tx_chan, sc->sge.rxq[iqidx].iq.cntxt_id, name);
+   }
 
snprintf(name, sizeof(name), "%d", i);
oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
___
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: r339341 - in head/sys: kern sys

2018-10-12 Thread Mateusz Guzik
Author: mjg
Date: Fri Oct 12 23:48:10 2018
New Revision: 339341
URL: https://svnweb.freebsd.org/changeset/base/339341

Log:
  capsicum: provide cap_rights_fde_inline
  
  Reading caps is in the hot path (on each successful fd lookup), but
  completely unnecessarily requires a function call.
  
  Approved by:  re (gjb)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/sys_capability.c
  head/sys/sys/capsicum.h

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cFri Oct 12 22:57:52 2018
(r339340)
+++ head/sys/kern/kern_descrip.cFri Oct 12 23:48:10 2018
(r339341)
@@ -2560,7 +2560,7 @@ fget_cap_locked(struct filedesc *fdp, int fd, cap_righ
}
 
 #ifdef CAPABILITIES
-   error = cap_check(cap_rights_fde(fde), needrightsp);
+   error = cap_check(cap_rights_fde_inline(fde), needrightsp);
if (error != 0)
goto out;
 #endif
@@ -2651,7 +2651,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
 #ifdef CAPABILITIES
seq = seq_read(fd_seq(fdt, fd));
fde = &fdt->fdt_ofiles[fd];
-   haverights = *cap_rights_fde(fde);
+   haverights = *cap_rights_fde_inline(fde);
fp = fde->fde_file;
if (!seq_consistent(fd_seq(fdt, fd), seq))
continue;

Modified: head/sys/kern/sys_capability.c
==
--- head/sys/kern/sys_capability.c  Fri Oct 12 22:57:52 2018
(r339340)
+++ head/sys/kern/sys_capability.c  Fri Oct 12 23:48:10 2018
(r339341)
@@ -208,7 +208,7 @@ const cap_rights_t *
 cap_rights_fde(const struct filedescent *fdep)
 {
 
-   return (&fdep->fde_rights);
+   return (cap_rights_fde_inline(fdep));
 }
 
 const cap_rights_t *

Modified: head/sys/sys/capsicum.h
==
--- head/sys/sys/capsicum.h Fri Oct 12 22:57:52 2018(r339340)
+++ head/sys/sys/capsicum.h Fri Oct 12 23:48:10 2018(r339341)
@@ -465,7 +465,13 @@ u_char cap_rights_to_vmprot(const cap_rights_t *havep)
 /*
  * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to
  * extract the rights from a capability.
+ *
+ * Dereferencing fdep requires filedesc.h, but including it would cause
+ * significant pollution. Instead add a macro for consumers which want it,
+ * most notably kern_descrip.c.
  */
+#define cap_rights_fde_inline(fdep)(&(fdep)->fde_rights)
+
 const cap_rights_t *cap_rights_fde(const struct filedescent *fde);
 const cap_rights_t *cap_rights(struct filedesc *fdp, int fd);
 
___
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: r339340 - head/share/man/man4

2018-10-12 Thread Eric Joyner
Author: erj
Date: Fri Oct 12 22:57:52 2018
New Revision: 339340
URL: https://svnweb.freebsd.org/changeset/base/339340

Log:
  ixl/iavf: Update ixl(4) and iavf(4) [previously ixlv] man pages
  
  Since there have been major updates to both drivers in r339338,
  refresh the man pages with new and updated information.
  
  Reviewed by:sbruno@, 0mp@, jeffrey.e.pie...@intel.com, manpages
  Approved by:  re (gjb@, kib@)
  Sponsored by:   Intel Corporation
  Differential Revision:  https://reviews.freebsd.org/D15927

Added:
  head/share/man/man4/iavf.4   (contents, props changed)
Deleted:
  head/share/man/man4/ixlv.4
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/ixl.4

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileFri Oct 12 22:51:45 2018
(r339339)
+++ head/share/man/man4/MakefileFri Oct 12 22:57:52 2018
(r339340)
@@ -196,6 +196,7 @@ MAN=aac.4 \
${_hv_vmbus.4} \
${_hv_vss.4} \
hwpmc.4 \
+   iavf.4 \
ichsmb.4 \
${_ichwd.4} \
icmp.4 \
@@ -240,7 +241,6 @@ MAN=aac.4 \
iwnfw.4 \
ixgbe.4 \
ixl.4 \
-   ixlv.4 \
jedec_dimm.4 \
jme.4 \
joy.4 \
@@ -669,7 +669,7 @@ MLINKS+=ixgbe.4 ix.4
 MLINKS+=ixgbe.4 if_ix.4
 MLINKS+=ixgbe.4 if_ixgbe.4
 MLINKS+=ixl.4 if_ixl.4
-MLINKS+=ixlv.4 if_ixlv.4
+MLINKS+=iavf.4 if_iavf.4
 MLINKS+=jme.4 if_jme.4
 MLINKS+=kue.4 if_kue.4
 MLINKS+=lagg.4 trunk.4

Added: head/share/man/man4/iavf.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/iavf.4  Fri Oct 12 22:57:52 2018(r339340)
@@ -0,0 +1,138 @@
+.\" Copyright (c) 2013-2018, Intel Corporation
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions are met:
+.\"
+.\"  1. Redistributions of source code must retain the above copyright notice,
+.\" this list of conditions and the following disclaimer.
+.\"
+.\"  2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\"  3. Neither the name of the Intel Corporation nor the names of its
+.\" contributors may be used to endorse or promote products derived from
+.\" this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" * Other names and brands may be claimed as the property of others.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 5, 2018
+.Dt IAVF 4
+.Os
+.Sh NAME
+.Nm iavf
+.Nd "Intel Adaptive Virtual Function driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device iavf"
+.Ed
+.Pp
+To load the driver as a module at boot time, place the following lines in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_iavf_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the PCI Virtual Functions from the 700 Series of
+ethernet devices and newer product families.
+The driver supports Jumbo Frames, TX/RX checksum offload,
+TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN
+tag insertion/extraction, VLAN checksum offload, VLAN TSO, and
+Receive Side Steering (RSS), all for both IPv4 and IPv6.
+For further hardware information and questions related to hardware
+requirements, see
+.Pa http://support.intel.com/ .
+.Pp
+Support for Jumbo Frames is provided via the interface MTU setting.
+Selecting an MTU larger than 1500 bytes with the
+.Xr ifconfig 8
+utility configures the adapter to receive and transmit Jumbo Frames.
+The maximum MTU size for Jumbo Frames is 9706.
+.Pp
+Offloads are also controlled via the interface, for instance,
+checksumming for both IPv4 and IPv6 can be set and unset, TSO4
+and/or TSO6, and finally LRO can be set and unset.
+.Pp
+For more info

svn commit: r339339 - head/sys/netinet

2018-10-12 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Oct 12 22:51:45 2018
New Revision: 339339
URL: https://svnweb.freebsd.org/changeset/base/339339

Log:
  In udp_input() when walking the pcblist we can come across
  an inp marked FREED after the epoch(9) changes.
  Check once we hold the lock and skip the inp if it is the case.
  
  Contrary to IPv6 the locking of the inp is outside the multicast
  section and hence a single check seems to suffice.
  
  PR:   232192
  Reviewed by:  mmacy, markj
  Approved by:  re (kib)
  Differential Revision:https://reviews.freebsd.org/D17540

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Fri Oct 12 22:40:54 2018
(r339338)
+++ head/sys/netinet/udp_usrreq.c   Fri Oct 12 22:51:45 2018
(r339339)
@@ -551,6 +551,11 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 
INP_RLOCK(inp);
 
+   if (__predict_false(inp->inp_flags2 & INP_FREED)) {
+   INP_RUNLOCK(inp);
+   continue;
+   }
+
/*
 * XXXRW: Because we weren't holding either the inpcb
 * or the hash lock when we checked for a match
___
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: r339338 - in head/sys: amd64/conf conf dev/ixl modules modules/iavf modules/ixl modules/ixlv net

2018-10-12 Thread Eric Joyner
Author: erj
Date: Fri Oct 12 22:40:54 2018
New Revision: 339338
URL: https://svnweb.freebsd.org/changeset/base/339338

Log:
  ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9)
  
  Finishes the conversion of the 40Gb Intel Ethernet drivers to iflib(9) for
  FreeBSD 12.0, and fixes numerous bugs in both ixl(4) and iavf(4).
  
  This commit also re-adds the VF driver to GENERIC since it now compiles and
  functions.
  
  The VF driver name was changed from ixlv(4) to iavf(4) because the VF driver 
is
  now intended to be used with future products, not just with Fortville/Fort 
Park
  VFs.
  
  A man page update that documents these drivers is forthcoming in a separate
  commit.
  
  Reviewed by:sbruno@, kbowling@
  Tested by:  jeffrey.e.pie...@intel.com
  Approved by:  re (gjb@)
  Relnotes:   yes
  Sponsored by:   Intel Corporation
  Differential Revision: https://reviews.freebsd.org/D16429

Added:
  head/sys/modules/iavf/
  head/sys/modules/iavf/Makefile   (contents, props changed)
Deleted:
  head/sys/dev/ixl/README
  head/sys/dev/ixl/ixlv_vc_mgr.h
  head/sys/modules/ixlv/
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/conf/files.amd64
  head/sys/dev/ixl/i40e_osdep.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_debug.h
  head/sys/dev/ixl/ixl_pf.h
  head/sys/dev/ixl/ixl_pf_iov.c
  head/sys/dev/ixl/ixl_pf_iov.h
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixl_pf_qmgr.c
  head/sys/dev/ixl/ixl_pf_qmgr.h
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/ixl/ixlv.h
  head/sys/dev/ixl/ixlvc.c
  head/sys/modules/Makefile
  head/sys/modules/ixl/Makefile
  head/sys/net/iflib.c
  head/sys/net/iflib.h
  head/sys/net/iflib_private.h

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Fri Oct 12 21:59:09 2018(r339337)
+++ head/sys/amd64/conf/GENERIC Fri Oct 12 22:40:54 2018(r339338)
@@ -240,9 +240,8 @@ device  de  # DEC/Intel 
DC21x4x (``Tulip'')
 device em  # Intel PRO/1000 Gigabit Ethernet Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
-device ixl # Intel XL710 40Gbe PCIE Ethernet
-#options   IXL_IW  # Enable iWARP Client Interface 
in ixl(4)
-#deviceixlv# Intel XL710 40Gbe VF PCIE 
Ethernet
+device ixl # Intel 700 Series Physical Function
+device iavf# Intel Adaptive Virtual Function
 device le  # AMD Am7900 LANCE and Am79C9xx PCnet
 device ti  # Alteon Networks Tigon I/II gigabit 
Ethernet
 device txp # 3Com 3cR990 (``Typhoon'')

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Fri Oct 12 21:59:09 2018(r339337)
+++ head/sys/amd64/conf/NOTES   Fri Oct 12 22:40:54 2018(r339338)
@@ -313,8 +313,6 @@ options DRM_DEBUG   # Include debug printfs (slow)
 # iwn: Intel Wireless WiFi Link 1000/105/135/2000/4965/5000/6000/6050 abgn
 #  802.11 network adapters
 #  Requires the iwn firmware module
-# ixl: Intel XL710 40Gbe PCIE Ethernet
-# ixlv:Intel XL710 40Gbe VF PCIE Ethernet
 # mthca: Mellanox HCA InfiniBand
 # mlx4ib: Mellanox ConnectX HCA InfiniBand
 # mlx4en: Mellanox ConnectX HCA Ethernet
@@ -332,9 +330,8 @@ options ED_SIC
 device ipw # Intel 2100 wireless NICs.
 device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs.
 device iwn # Intel 4965/1000/5000/6000 wireless NICs.
-device ixl # Intel XL710 40Gbe PCIE Ethernet
-#options   IXL_IW  # Enable iWARP Client Interface in 
ixl(4)
-#deviceixlv# Intel XL710 40Gbe VF PCIE Ethernet
+device ixl # Intel 700 Series Physical Function
+device iavf# Intel Adaptive Virtual Function
 device mthca   # Mellanox HCA InfiniBand
 device mlx4# Shared code module between IB and Ethernet
 device mlx4ib  # Mellanox ConnectX HCA InfiniBand

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Fri Oct 12 21:59:09 2018(r339337)
+++ head/sys/conf/files.amd64   Fri Oct 12 22:40:54 2018(r339338)
@@ -271,25 +271,23 @@ dev/ixl/ixl_pf_iov.c  optionalixl pci 
 pci_iov \
compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixl_pf_i2c.c   optionalixl pci \
compile-with "${N

svn commit: r339337 - head/sys/amd64/amd64

2018-10-12 Thread Mateusz Guzik
Author: mjg
Date: Fri Oct 12 21:59:09 2018
New Revision: 339337
URL: https://svnweb.freebsd.org/changeset/base/339337

Log:
  amd64: employ MEMMOVE in copyin/copyout
  
  See r339205 for justification.
  
  Reviewed by:  kib
  Approved by:  re (gjb)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17526

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Fri Oct 12 19:44:19 2018
(r339336)
+++ head/sys/amd64/amd64/support.S  Fri Oct 12 21:59:09 2018
(r339337)
@@ -576,14 +576,27 @@ END(fillw)
 .endif
 .endm
 
+.macro COPYINOUT_BEGIN
+.endm
+
+.macro COPYINOUT_END
+   movq%rax,PCB_ONFAULT(%r11)
+   POP_FRAME_POINTER
+.endm
+
+.macro COPYINOUT_SMAP_END
+   SMAP_ENABLE smap=1
+   COPYINOUT_END
+.endm
+
 /*
  * copyout(from_kernel, to_user, len)
  * %rdi,%rsi,%rdx
  */
 .macro COPYOUT smap erms
PUSH_FRAME_POINTER
-   movqPCPU(CURPCB),%r9
-   movq$copy_fault,PCB_ONFAULT(%r9)
+   movqPCPU(CURPCB),%r11
+   movq$copy_fault,PCB_ONFAULT(%r11)
 
/*
 * Check explicitly for non-user addresses.  If 486 write protection
@@ -609,43 +622,27 @@ END(fillw)
ja  copy_fault
 
/*
-* Set up arguments for rep movs*.
+* Set return value to zero. Remaining failure mode goes through
+* copy_fault.
 */
+   xorl%eax,%eax
+
+   /*
+* Set up arguments for MEMMOVE.
+*/
movq%rdi,%r8
movq%rsi,%rdi
movq%r8,%rsi
movq%rdx,%rcx
 
-   /*
-* Set return value to zero. Remaining failure mode goes through
-* copy_fault.
-*/
-   xorl%eax,%eax
 
SMAP_DISABLE \smap
-.if\erms == 0
-   cmpq$15,%rcx
-   jbe 1f
-   shrq$3,%rcx
-   rep
-   movsq
-   movb%dl,%cl
-   andb$7,%cl
-   jne 1f
-   SMAP_ENABLE \smap
-   movq%rax,PCB_ONFAULT(%r9)
-   POP_FRAME_POINTER
-   ret
-   ALIGN_TEXT
-1:
+.if\smap == 1
+   MEMMOVE erms=\erms overlap=0 begin=COPYINOUT_BEGIN 
end=COPYINOUT_SMAP_END
+.else
+   MEMMOVE erms=\erms overlap=0 begin=COPYINOUT_BEGIN end=COPYINOUT_END
 .endif
-   rep
-   movsb
-
-   SMAP_ENABLE \smap
-   movq%rax,PCB_ONFAULT(%r9)
-   POP_FRAME_POINTER
-   ret
+   /* NOTREACHED */
 .endm
 
 ENTRY(copyout_nosmap_std)
@@ -670,8 +667,8 @@ END(copyout_smap_erms)
  */
 .macro COPYIN smap erms
PUSH_FRAME_POINTER
-   movqPCPU(CURPCB),%r9
-   movq$copy_fault,PCB_ONFAULT(%r9)
+   movqPCPU(CURPCB),%r11
+   movq$copy_fault,PCB_ONFAULT(%r11)
 
/*
 * make sure address is valid
@@ -683,37 +680,20 @@ END(copyout_smap_erms)
cmpq%rcx,%rax
ja  copy_fault
 
+   xorl%eax,%eax
+
movq%rdi,%r8
movq%rsi,%rdi
movq%r8,%rsi
movq%rdx,%rcx
 
-   xorl%eax,%eax
-
SMAP_DISABLE \smap
-.if \erms == 0
-   cmpq$15,%rcx
-   jbe 1f
-   shrq$3,%rcx /* copy longword-wise */
-   rep
-   movsq
-   movb%dl,%cl
-   andb$7,%cl  /* copy remaining bytes */
-   jne 1f
-   SMAP_ENABLE \smap
-   movq%rax,PCB_ONFAULT(%r9)
-   POP_FRAME_POINTER
-   ret
-   ALIGN_TEXT
-1:
+.if\smap == 1
+   MEMMOVE erms=\erms overlap=0 begin=COPYINOUT_BEGIN 
end=COPYINOUT_SMAP_END
+.else
+   MEMMOVE erms=\erms overlap=0 begin=COPYINOUT_BEGIN end=COPYINOUT_END
 .endif
-   rep
-   movsb
-
-   SMAP_ENABLE \smap
-   movq%rax,PCB_ONFAULT(%r9)
-   POP_FRAME_POINTER
-   ret
+   /* NOTREACHED */
 .endm
 
 ENTRY(copyin_nosmap_std)
@@ -735,7 +715,7 @@ END(copyin_smap_erms)
ALIGN_TEXT
/* Trap entry clears PSL.AC */
 copy_fault:
-   movq$0,PCB_ONFAULT(%r9)
+   movq$0,PCB_ONFAULT(%r11)
movl$EFAULT,%eax
POP_FRAME_POINTER
ret
___
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: r339336 - stable/11/sys/cam/scsi

2018-10-12 Thread Kenneth D. Merry
Author: ken
Date: Fri Oct 12 19:44:19 2018
New Revision: 339336
URL: https://svnweb.freebsd.org/changeset/base/339336

Log:
  MFC r339076
  
  This has been edited slightly from the version in head.  In head, the probe
  sections of dadone() were split out into separate functions.  In stable/11,
  dadone() is still a single function.
  
  So, for stable/11, this describes the change:
  
  sys/cam/scsi/scsi_da.c:
In the DA_CCB_PROBE_DONE case in dadone(), free the data pointer
before returning.
  

r339076 | ken | 2018-10-01 13:00:46 -0600 (Mon, 01 Oct 2018) | 12 lines
  
Fix a da(4) driver memory leak for SCSI SMR devices.
  
In the probe case for SCSI SMR Host Aware or Most Managed drives, be sure
to free allocated memory.
  
sys/cam/scsi/scsi_da.c:
In dadone_probezone(), free the data pointer before returning.
  
Sponsored by:   Spectra Logic
  

  
  Sponsored by: Spectra Logic

Modified:
  stable/11/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_da.c
==
--- stable/11/sys/cam/scsi/scsi_da.cFri Oct 12 16:55:28 2018
(r339335)
+++ stable/11/sys/cam/scsi/scsi_da.cFri Oct 12 19:44:19 2018
(r339336)
@@ -5354,6 +5354,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
}
}
}
+
+   free(csio->data_ptr, M_SCSIDA);
+
daprobedone(periph, done_ccb);
return;
}
___
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: r339335 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-10-12 Thread Alexander Motin
Author: mav
Date: Fri Oct 12 16:55:28 2018
New Revision: 339335
URL: https://svnweb.freebsd.org/changeset/base/339335

Log:
  Avoid zero-sized kmem_alloc() in vdev_compact_children().
  
  The device evacuation code adds a dependency that
  vdev_compact_children() be able to properly empty the vdev_child
  array by setting it to NULL and zeroing vdev_children.  Under Linux,
  kmem_alloc() and related functions return a sentinel pointer rather
  than NULL for zero-sized allocations.
  
  This is a part of ZoL port of device removal patch:
  
  commit a1d477c24c7badc89c60955995fd84d311938486
  Author: Matthew Ahrens 
  Ported-by: Tim Chase 
  
  Approved by:  re (kib)
  MFC after:1 week

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Fri Oct 12 
16:24:49 2018(r339334)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Fri Oct 12 
16:55:28 2018(r339335)
@@ -505,17 +505,24 @@ vdev_compact_children(vdev_t *pvd)
 
ASSERT(spa_config_held(pvd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
 
+   if (oldc == 0)
+   return;
+
for (int c = newc = 0; c < oldc; c++)
if (pvd->vdev_child[c])
newc++;
 
-   newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_SLEEP);
+   if (newc > 0) {
+   newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_SLEEP);
 
-   for (int c = newc = 0; c < oldc; c++) {
-   if ((cvd = pvd->vdev_child[c]) != NULL) {
-   newchild[newc] = cvd;
-   cvd->vdev_id = newc++;
+   for (int c = newc = 0; c < oldc; c++) {
+   if ((cvd = pvd->vdev_child[c]) != NULL) {
+   newchild[newc] = cvd;
+   cvd->vdev_id = newc++;
+   }
}
+   } else {
+   newchild = NULL;
}
 
kmem_free(pvd->vdev_child, oldc * sizeof (vdev_t *));
___
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: r339334 - head/stand/efi/loader

2018-10-12 Thread Toomas Soome
Author: tsoome
Date: Fri Oct 12 16:24:49 2018
New Revision: 339334
URL: https://svnweb.freebsd.org/changeset/base/339334

Log:
  loader.efi: add poweroff command
  
  Add poweroff command to make life a bit easier.
  
  Reviewed by:  imp, allanjude
  Approved by:  re (kib)
  Differential Revision:https://reviews.freebsd.org/D17535

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cFri Oct 12 16:00:21 2018
(r339333)
+++ head/stand/efi/loader/main.cFri Oct 12 16:24:49 2018
(r339334)
@@ -993,6 +993,23 @@ main(int argc, CHAR16 *argv[])
return (EFI_SUCCESS);   /* keep compiler happy */
 }
 
+COMMAND_SET(poweroff, "poweroff", "power off the system", command_poweroff);
+
+static int
+command_poweroff(int argc __unused, char *argv[] __unused)
+{
+   int i;
+
+   for (i = 0; devsw[i] != NULL; ++i)
+   if (devsw[i]->dv_cleanup != NULL)
+   (devsw[i]->dv_cleanup)();
+
+   RS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+
+   /* NOTREACHED */
+   return (CMD_ERROR);
+}
+
 COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339333 - head/sys/amd64/amd64

2018-10-12 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 12 16:00:21 2018
New Revision: 339333
URL: https://svnweb.freebsd.org/changeset/base/339333

Log:
  Call initializecpucache() before ifuncs are resolved.
  
  The function tweaks CPU capabilities based on the VM platform and
  tunables, which affected selection of the cache flush method before
  ifuncs were used, and should affect the cache flush in the same way
  after ifunc.
  
  PR:   232081
  Reported by:  phk
  Analyzed by:  avg
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb)

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

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Fri Oct 12 15:51:41 2018
(r339332)
+++ head/sys/amd64/amd64/machdep.c  Fri Oct 12 16:00:21 2018
(r339333)
@@ -1575,11 +1575,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
identify_cpu1();
identify_hypervisor();
-   /*
-* hw.cpu_stdext_disable is ignored by the call, it will be
-* re-evaluted by the below call to finishidentcpu().
-*/
identify_cpu2();
+   initializecpucache();
 
/*
 * Check for pti, pcid, and invpcid before ifuncs are
@@ -1727,7 +1724,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */
-   initializecpucache();
 
/* doublefault stack space, runs on ist1 */
common_tss[0].tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)];
___
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: r339332 - head/sys/riscv/riscv

2018-10-12 Thread Ruslan Bukin
Author: br
Date: Fri Oct 12 15:51:41 2018
New Revision: 339332
URL: https://svnweb.freebsd.org/changeset/base/339332

Log:
  Initialize interrupt priority to 0 on all sources.
  
  Without this hardware raises an interrupt regardless of any
  pending bits set.
  
  This fixes operation on RocketChip and derivatives (e.g. lowRISC).
  
  Approved by:  re (kib)
  Sponsored by: DARPA, AFRL

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

Modified: head/sys/riscv/riscv/plic.c
==
--- head/sys/riscv/riscv/plic.c Fri Oct 12 15:30:15 2018(r339331)
+++ head/sys/riscv/riscv/plic.c Fri Oct 12 15:51:41 2018(r339332)
@@ -218,6 +218,7 @@ plic_attach(device_t dev)
if (error != 0)
return (error);
 
+   WR4(sc, PLIC_PRIORITY(irq), 0);
WR4(sc, PLIC_ENABLE(irq, cpu), 0);
}
WR4(sc, PLIC_THRESHOLD(cpu), 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339331 - head/sys/amd64/vmm

2018-10-12 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 12 15:30:15 2018
New Revision: 339331
URL: https://svnweb.freebsd.org/changeset/base/339331

Log:
  bhyve: emulate CLFLUSH and CLFLUSHOPT.
  
  Apparently CLFLUSH on mmio can cause VM exit, as reported in the PR.
  I do not see that anything useful can be done except emulating page
  faults on invalid addresses.
  
  Due to the instruction encoding pecularity, also emulate SFENCE.
  
  PR:   232081
  Reported by:  phk
  Reviewed by:  araujo, avg, jhb (all: previous version)
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb)
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D17482

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

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Fri Oct 12 15:19:41 2018
(r339330)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Fri Oct 12 15:30:15 2018
(r339331)
@@ -76,6 +76,7 @@ enum {
VIE_OP_TYPE_GROUP1,
VIE_OP_TYPE_STOS,
VIE_OP_TYPE_BITTEST,
+   VIE_OP_TYPE_TWOB_GRP15,
VIE_OP_TYPE_LAST
 };
 
@@ -87,6 +88,10 @@ enum {
 #defineVIE_OP_F_NO_GLA_VERIFICATION (1 << 4)
 
 static const struct vie_op two_byte_opcodes[256] = {
+   [0xAE] = {
+ .op_byte = 0xAE,
+ .op_type = VIE_OP_TYPE_TWOB_GRP15,
+   },
[0xB6] = {
.op_byte = 0xB6,
.op_type = VIE_OP_TYPE_MOVZX,
@@ -1443,6 +1448,37 @@ emulate_bittest(void *vm, int vcpuid, uint64_t gpa, st
return (0);
 }
 
+static int
+emulate_twob_group15(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
+mem_region_read_t memread, mem_region_write_t memwrite, void *memarg)
+{
+   int error;
+   uint64_t buf;
+
+   switch (vie->reg & 7) {
+   case 0x7:   /* CLFLUSH, CLFLUSHOPT, and SFENCE */
+   if (vie->mod == 0x3) {
+   /*
+* SFENCE.  Ignore it, VM exit provides enough
+* barriers on its own.
+*/
+   error = 0;
+   } else {
+   /*
+* CLFLUSH, CLFLUSHOPT.  Only check for access
+* rights.
+*/
+   error = memread(vm, vcpuid, gpa, &buf, 1, memarg);
+   }
+   break;
+   default:
+   error = EINVAL;
+   break;
+   }
+
+   return (error);
+}
+
 int
 vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 struct vm_guest_paging *paging, mem_region_read_t memread,
@@ -1501,6 +1537,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t
break;
case VIE_OP_TYPE_BITTEST:
error = emulate_bittest(vm, vcpuid, gpa, vie,
+   memread, memwrite, memarg);
+   break;
+   case VIE_OP_TYPE_TWOB_GRP15:
+   error = emulate_twob_group15(vm, vcpuid, gpa, vie,
memread, memwrite, memarg);
break;
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339330 - in head/sys: conf dev/uart riscv/conf

2018-10-12 Thread Ruslan Bukin
Author: br
Date: Fri Oct 12 15:19:41 2018
New Revision: 339330
URL: https://svnweb.freebsd.org/changeset/base/339330

Log:
  Add support for the UART device found in lowRISC system-on-a-chip.
  
  The only source of documentation for this device is verilog,
  so driver is minimalistic.
  
  Reviewed by:  Dr Jonathan Kimmitt 
  Approved by:  re (kib)
  Sponsored by: DARPA, AFRL

Added:
  head/sys/dev/uart/uart_dev_lowrisc.c   (contents, props changed)
  head/sys/dev/uart/uart_dev_lowrisc.h   (contents, props changed)
Modified:
  head/sys/conf/files.riscv
  head/sys/riscv/conf/GENERIC

Modified: head/sys/conf/files.riscv
==
--- head/sys/conf/files.riscv   Fri Oct 12 15:14:22 2018(r339329)
+++ head/sys/conf/files.riscv   Fri Oct 12 15:19:41 2018(r339330)
@@ -7,6 +7,7 @@ crypto/blowfish/bf_enc.coptionalcrypto | ipsec 
| ips
 crypto/des/des_enc.c   optionalcrypto | ipsec | ipsec_support 
| netsmb
 dev/ofw/ofw_cpu.c  optionalfdt
 dev/uart/uart_cpu_fdt.coptionaluart fdt
+dev/uart/uart_dev_lowrisc.coptionaluart_lowrisc
 dev/xilinx/axi_quad_spi.c  optionalxilinx_spi
 kern/kern_clocksource.cstandard
 kern/msi_if.m  standard

Added: head/sys/dev/uart/uart_dev_lowrisc.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/uart/uart_dev_lowrisc.cFri Oct 12 15:19:41 2018
(r339330)
@@ -0,0 +1,393 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2018 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory (Department of Computer Science and
+ * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+ * DARPA SSITH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_ddb.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "uart_if.h"
+
+#defineDEFAULT_BAUD_RATE   115200
+
+/*
+ * Low-level UART interface.
+ */
+static int lowrisc_uart_probe(struct uart_bas *bas);
+static void lowrisc_uart_init(struct uart_bas *bas, int, int, int, int);
+static void lowrisc_uart_term(struct uart_bas *bas);
+static void lowrisc_uart_putc(struct uart_bas *bas, int);
+static int lowrisc_uart_rxready(struct uart_bas *bas);
+static int lowrisc_uart_getc(struct uart_bas *bas, struct mtx *);
+
+static struct uart_ops uart_lowrisc_uart_ops = {
+   .probe = lowrisc_uart_probe,
+   .init = lowrisc_uart_init,
+   .term = lowrisc_uart_term,
+   .putc = lowrisc_uart_putc,
+   .rxready = lowrisc_uart_rxready,
+   .getc = lowrisc_uart_getc,
+};
+
+static int
+lowrisc_uart_probe(struct uart_bas *bas)
+{
+
+   return (0);
+}
+
+static u_int
+lowrisc_uart_getbaud(struct uart_bas *bas)
+{
+
+   return (DEFAULT_BAUD_RATE);
+}
+
+static void
+lowrisc_uart_init(struct uart_bas *bas, int baudrate, int databits, 
+int stopbits, int parity)
+{
+
+   /* TODO */
+}
+
+static void
+lowrisc_uart_term(struct uart_bas *bas)
+{
+
+   /* TODO */
+}
+
+static void
+lowrisc_uart_putc(struct uart_bas *bas, int c)
+{
+
+   while (GETREG(bas, UART_DR) & DR_TX_FIFO_FULL)
+   ;
+
+   SETREG(bas, UART_DR, c);
+}
+
+static int
+lowrisc_uart_rxready(struct uart_bas *bas)
+{
+
+   if (GETREG(bas, UART_DR) & DR_RX_FIFO

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

2018-10-12 Thread Alexander Motin
Author: mav
Date: Fri Oct 12 15:14:22 2018
New Revision: 339329
URL: https://svnweb.freebsd.org/changeset/base/339329

Log:
  Add ZIO_TYPE_FREE support for indirect vdevs.
  
  Upstream code expects only ZIO_TYPE_READ and some ZIO_TYPE_WRITE
  requests to removed (indirect) vdevs, while on FreeBSD there is also
  ZIO_TYPE_FREE (TRIM).  ZIO_TYPE_FREE requests do not have the data
  buffers, so don't need the pointer adjustment.
  
  PR:   228750, 229007
  Reviewed by:  allanjude, sef
  Approved by:  re (kib)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D17523

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c Fri Oct 
12 13:01:17 2018(r339328)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c Fri Oct 
12 15:14:22 2018(r339329)
@@ -1147,6 +1147,9 @@ vdev_indirect_child_io_done(zio_t *zio)
pio->io_error = zio_worst_error(pio->io_error, zio->io_error);
mutex_exit(&pio->io_lock);
 
+#ifdef __FreeBSD__
+   if (zio->io_abd != NULL)
+#endif
abd_put(zio->io_abd);
 }
 
@@ -1262,8 +1265,12 @@ vdev_indirect_io_start(zio_t *zio)
zio->io_vsd_ops = &vdev_indirect_vsd_ops;
 
ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0);
+#ifdef __FreeBSD__
+   if (zio->io_type == ZIO_TYPE_WRITE) {
+#else
if (zio->io_type != ZIO_TYPE_READ) {
ASSERT3U(zio->io_type, ==, ZIO_TYPE_WRITE);
+#endif
/*
 * Note: this code can handle other kinds of writes,
 * but we don't expect them.
@@ -1295,6 +1302,9 @@ vdev_indirect_io_start(zio_t *zio)
ASSERT3P(list_next(&iv->iv_splits, first), ==, NULL);
zio_nowait(zio_vdev_child_io(zio, zio->io_bp,
first->is_vdev, first->is_target_offset,
+#ifdef __FreeBSD__
+   zio->io_abd == NULL ? NULL :
+#endif
abd_get_offset(zio->io_abd, 0),
zio->io_size, zio->io_type, zio->io_priority, 0,
vdev_indirect_child_io_done, zio));
@@ -1321,6 +1331,9 @@ vdev_indirect_io_start(zio_t *zio)
is != NULL; is = list_next(&iv->iv_splits, is)) {
zio_nowait(zio_vdev_child_io(zio, NULL,
is->is_vdev, is->is_target_offset,
+#ifdef __FreeBSD__
+   zio->io_abd == NULL ? NULL :
+#endif
abd_get_offset(zio->io_abd,
is->is_split_offset),
is->is_size, zio->io_type,
___
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: r339328 - head

2018-10-12 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Oct 12 13:01:17 2018
New Revision: 339328
URL: https://svnweb.freebsd.org/changeset/base/339328

Log:
  Replace libldns's bootstrap dependency on libcrypto with one on libssl
  (which in turn has a bootstrap dependency on libcrypto).
  
  Submitted by: jkim
  Approved by:  re (gjb)

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Oct 12 11:30:46 2018(r339327)
+++ head/Makefile.inc1  Fri Oct 12 13:01:17 2018(r339328)
@@ -2631,9 +2631,10 @@ lib/librtld_db__L: lib/libprocstat__L
 _secure_lib_libcrypto= secure/lib/libcrypto
 _secure_lib_libssl= secure/lib/libssl
 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
+secure/lib/libcrypto__L: lib/libthr__L
 .if ${MK_LDNS} != "no"
 _lib_libldns= lib/libldns
-lib/libldns__L: secure/lib/libcrypto__L
+lib/libldns__L: secure/lib/libssl__L
 .endif
 .if ${MK_OPENSSH} != "no"
 _secure_lib_libssh= secure/lib/libssh
___
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: r339326 - head

2018-10-12 Thread Kyle Evans
On Fri, Oct 12, 2018 at 12:43 AM Dag-Erling Smørgrav  wrote:
>
> Author: des
> Date: Fri Oct 12 05:42:38 2018
> New Revision: 339326
> URL: https://svnweb.freebsd.org/changeset/base/339326
>
> Log:
>   Move libssl up in the bootstrap order.
>
>   Submitted by: jkim
>   Approved by:  re (gjb)
>
> Modified:
>   head/Makefile.inc1
>
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1  Fri Oct 12 05:27:58 2018(r339325)
> +++ head/Makefile.inc1  Fri Oct 12 05:42:38 2018(r339326)
> @@ -2534,8 +2534,8 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1} \
> ${_cddl_lib_libctf} \
> lib/libufs \
> lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun 
> \
> -   ${_secure_lib_libcrypto} ${_lib_libldns} \
> -   ${_secure_lib_libssh} ${_secure_lib_libssl}
> +   ${_secure_lib_libcrypto} ${_secure_lib_libssl} \
> +   ${_lib_libldns} ${_secure_lib_libssh}
>
>  .if ${MK_GNUCXX} != "no"
>  _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
> ___

Hmm... doesn't this kind of situation also require an __L rule down
below to prevent the race, since they're both in prebuild_libs?

Thanks,

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


svn commit: r339327 - head/sys/netinet

2018-10-12 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Oct 12 11:30:46 2018
New Revision: 339327
URL: https://svnweb.freebsd.org/changeset/base/339327

Log:
  r217592 moved the check for imo in udp_input() into the conditional block
  but leaving the variable assignment outside the block, where it is no longer
  used. Move both the variable and the assignment one block further in.
  
  This should result in no functional changes. It will however make upcoming
  changes slightly easier to apply.
  
  Reviewed by:  markj, jtl, tuexen
  Approved by:  re (kib)
  Differential Revision:https://reviews.freebsd.org/D17525

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Fri Oct 12 05:42:38 2018
(r339326)
+++ head/sys/netinet/udp_usrreq.c   Fri Oct 12 11:30:46 2018
(r339327)
@@ -528,7 +528,6 @@ udp_input(struct mbuf **mp, int *offp, int proto)
in_broadcast(ip->ip_dst, ifp)) {
struct inpcb *last;
struct inpcbhead *pcblist;
-   struct ip_moptions *imo;
 
INP_INFO_RLOCK_ET(pcbinfo, et);
pcblist = udp_get_pcblist(proto);
@@ -563,10 +562,12 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 * Handle socket delivery policy for any-source
 * and source-specific multicast. [RFC3678]
 */
-   imo = inp->inp_moptions;
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
+   struct ip_moptions  *imo;
struct sockaddr_in   group;
int  blocked;
+
+   imo = inp->inp_moptions;
if (imo == NULL) {
INP_RUNLOCK(inp);
continue;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"