svn commit: r365873 - head/usr.sbin/bhyve

2020-09-17 Thread Peter Grehan
Author: grehan
Date: Fri Sep 18 05:54:59 2020
New Revision: 365873
URL: https://svnweb.freebsd.org/changeset/base/365873

Log:
  Fix byte-reversal of language ID in string descriptor.
  
  The language id of String Descriptors in usb mouse is
  0x0904, while the spec require 0x0409 (English - United States)
  
  Submitted by: Wanpeng Qian
  Reviewed by:  grehan
  Approved by:  grehan (#bhyve)
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D26472

Modified:
  head/usr.sbin/bhyve/usb_mouse.c

Modified: head/usr.sbin/bhyve/usb_mouse.c
==
--- head/usr.sbin/bhyve/usb_mouse.c Fri Sep 18 03:11:47 2020
(r365872)
+++ head/usr.sbin/bhyve/usb_mouse.c Fri Sep 18 05:54:59 2020
(r365873)
@@ -74,7 +74,7 @@ enum {
 };
 
 static const char *umouse_desc_strings[] = {
-   "\x04\x09",
+   "\x09\x04",
"BHYVE",
"HID Tablet",
"01",
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365872 - head/sys/dev/cxgbe/firmware

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 03:11:47 2020
New Revision: 365872
URL: https://svnweb.freebsd.org/changeset/base/365872

Log:
  cxgbe(4): add the firmware binaries instead of the empty files that were added
  in r365861.
  
  Obtained from:Chelsio Communications
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin   (contents, props changed)

Modified: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin
==
Binary file (source and/or target). No diff available.

Modified: head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin
==
Binary file (source and/or target). No diff available.

Modified: head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin
==
Binary file (source and/or target). No diff available.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365871 - in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 03:01:47 2020
New Revision: 365871
URL: https://svnweb.freebsd.org/changeset/base/365871

Log:
  cxgbe(4): add support for stateless offloads for VXLAN traffic.
  
  Hardware assistance includes checksumming (tx and rx), TSO, and RSS on
  the inner traffic in a VXLAN tunnel.
  
  Relnotes: Yes
  Sponsored by: Chelsio Communications

Modified:
  head/share/man/man4/cxgbe.4
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Fri Sep 18 02:37:57 2020(r365870)
+++ head/share/man/man4/cxgbe.4 Fri Sep 18 03:01:47 2020(r365871)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Dec 10, 2019
+.Dd September 17, 2020
 .Dt CXGBE 4
 .Os
 .Sh NAME
@@ -61,8 +61,8 @@ driver provides support for PCI Express Ethernet adapt
 the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and 
T6).
 The driver supports Jumbo Frames, Transmit/Receive checksum offload,
 TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN
-tag insertion/extraction, VLAN checksum offload, VLAN TSO, and
-Receive Side Steering (RSS).
+tag insertion/extraction, VLAN checksum offload, VLAN TSO, VXLAN checksum
+offload, VXLAN TSO, and Receive Side Steering (RSS).
 For further hardware information and questions related to hardware
 requirements, see
 .Pa http://www.chelsio.com/ .

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hFri Sep 18 02:37:57 2020
(r365870)
+++ head/sys/dev/cxgbe/adapter.hFri Sep 18 03:01:47 2020
(r365871)
@@ -119,6 +119,7 @@ enum {
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
TX_SGL_SEGS_EO_TSO = 30,/* XXX: lower for IPv6. */
+   TX_SGL_SEGS_VXLAN_TSO = 37,
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
 };
 
@@ -286,6 +287,7 @@ struct port_info {
int nvi;
int up_vis;
int uld_vis;
+   bool vxlan_tcam_entry;
 
struct tx_sched_params *sched_params;
 
@@ -593,6 +595,8 @@ struct sge_txq {
uint64_t txpkts0_pkts;  /* # of frames in type0 coalesced tx WRs */
uint64_t txpkts1_pkts;  /* # of frames in type1 coalesced tx WRs */
uint64_t raw_wrs;   /* # of raw work requests (alloc_wr_mbuf) */
+   uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */
+   uint64_t vxlan_txcsum;
 
uint64_t kern_tls_records;
uint64_t kern_tls_short;
@@ -625,6 +629,7 @@ struct sge_rxq {
 
uint64_t rxcsum;/* # of times hardware assisted with checksum */
uint64_t vlan_extraction;/* # of times VLAN tag was extracted */
+   uint64_t vxlan_rxcsum;
 
/* stats for not-that-common events */
 
@@ -847,6 +852,11 @@ struct adapter {
struct sge sge;
int lro_timeout;
int sc_do_rxcopy;
+
+   int vxlan_port;
+   u_int vxlan_refcount;
+   int rawf_base;
+   int nrawf;
 
struct taskqueue *tq[MAX_NCHAN];/* General purpose taskqueues */
struct task async_event_task;

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Fri Sep 18 02:37:57 2020
(r365870)
+++ head/sys/dev/cxgbe/common/common.h  Fri Sep 18 03:01:47 2020
(r365871)
@@ -249,7 +249,7 @@ struct tp_params {
uint32_t max_rx_pdu;
uint32_t max_tx_pdu;
uint64_t hash_filter_mask;
-   __be16 err_vec_mask;
+   bool rx_pkt_encap;
 
int8_t fcoe_shift;
int8_t port_shift;

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Fri Sep 18 02:37:57 2020
(r365870)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Fri Sep 18 03:01:47 2020
(r365871)
@@ -9647,19 +9647,11 @@ int t4_init_tp_params(struct adapter *adap, bool sleep
 
read_filter_mode_and_ingress_config(adap, sleep_ok);
 
-   /*
-* Cache a mask of the bits that represent the error vector portion of
-* rx_pkt.err_vec.  T6+ can use a compressed error vector to make room
-* for information about outer encapsulation (GENEVE/VXLAN/NVGRE).
-*/
-   tpp->err_vec_mask = htobe16(0x);
if (chip_id(adap) > CHELSIO_T5) {
v = t4_read_reg(adap, A_TP_OUT_CONFIG);
-   if (v & F_CRXPKTENC) {
-   tpp->err_vec_mask =
-   htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC));
-   }
-   }
+   tpp->rx_pkt_encap = v & F_CRXPKTENC;
+   } else
+ 

svn commit: r365870 - in head: share/man/man4 share/man/man9 sys/net sys/netinet sys/netinet6

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 02:37:57 2020
New Revision: 365870
URL: https://svnweb.freebsd.org/changeset/base/365870

Log:
  if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS.
  
  This lets a VXLAN pseudo-interface take advantage of hardware checksumming (tx
  and rx), TSO, and RSS if the NIC is capable of performing these operations on
  inner VXLAN traffic.
  
  A VXLAN interface inherits the capabilities of its vxlandev interface if one 
is
  specified or of the interface that hosts the vxlanlocal address. If other
  interfaces will carry traffic for that VXLAN then they must have the same
  hardware capabilities.
  
  On transmit, if_vxlan verifies that the outbound interface has the required
  capabilities and then translates the CSUM_ flags to their inner equivalents.
  This tells the hardware ifnet that it needs to operate on the inner frame and
  not the outer VXLAN headers.
  
  An event is generated when a VXLAN ifnet starts. This allows hardware drivers 
to
  configure their devices to expect VXLAN traffic on the specified incoming 
port.
  
  On receive, the hardware does RSS and checksum verification on the inner 
frame.
  if_vxlan now does a direct netisr dispatch to take full advantage of RSS. It 
is
  not very clear why it didn't do this already.
  
  Future work:
  Rx: it should be possible to avoid the first trip up the protocol stack to get
  the frame to if_vxlan just so it can decapsulate and requeue for a second trip
  up the stack. The hardware NIC driver could directly call an if_vxlan receive
  routine for VXLAN traffic instead.
  
  Rx: LRO. depends on what happens with the previous item. There will have to to
  be a mechanism to indicate that it's time for if_vxlan to flush its LRO state.
  
  Reviewed by:  kib@
  Relnotes: Yes
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D25873

Modified:
  head/share/man/man4/vxlan.4
  head/share/man/man9/EVENTHANDLER.9
  head/sys/net/if_vxlan.c
  head/sys/net/if_vxlan.h
  head/sys/netinet/ip_output.c
  head/sys/netinet6/ip6_output.c

Modified: head/share/man/man4/vxlan.4
==
--- head/share/man/man4/vxlan.4 Fri Sep 18 02:21:15 2020(r365869)
+++ head/share/man/man4/vxlan.4 Fri Sep 18 02:37:57 2020(r365870)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 31, 2017
+.Dd September 17, 2020
 .Dt VXLAN 4
 .Os
 .Sh NAME
@@ -182,6 +182,39 @@ command may be used to reduce the MTU size on the
 .Nm
 interface to allow the encapsulated frame to fit in the
 current MTU of the physical network.
+.Sh HARDWARE
+The
+.Nm
+driver supports hardware checksum offload (receive and transmit) and TSO on the
+encapsulated traffic over physical interfaces that support these features.
+The
+.Nm
+interface examines the
+.Cm vxlandev
+interface, if one is specified, or the interface hosting the
+.Cm vxlanlocal
+address, and configures its capabilities based on the hardware offload
+capabilities of that physical interface.
+If multiple physical interfaces will transmit or receive traffic for the
+.Nm
+then they all must have the same hardware capabilities.
+The transmit routine of a
+.Nm
+interface may fail with
+.Er ENXIO
+if an outbound physical interface does not support
+an offload that the
+.Nm
+interface is requesting.
+This can happen if there are multiple physical interfaces involved, with
+different hardware capabilities, or an interface capability was disabled after
+the
+.Nm
+interface had already started.
+.Pp
+At present, these devices are capable of generating checksums and performing 
TSO
+on the inner frames in hardware:
+.Xr cxgbe 4 .
 .Sh EXAMPLES
 Create a
 .Nm
@@ -244,3 +277,7 @@ The
 .Nm
 driver was written by
 .An Bryan Venteicher Aq bry...@freebsd.org .
+Support for stateless hardware offloads was added by
+.An Navdeep Parhar Aq n...@freebsd.org
+in
+.Fx 13.0 .

Modified: head/share/man/man9/EVENTHANDLER.9
==
--- head/share/man/man9/EVENTHANDLER.9  Fri Sep 18 02:21:15 2020
(r365869)
+++ head/share/man/man9/EVENTHANDLER.9  Fri Sep 18 02:37:57 2020
(r365870)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\" $FreeBSD$
 .\"
-.Dd October 21, 2018
+.Dd September 17, 2020
 .Dt EVENTHANDLER 9
 .Os
 .Sh NAME
@@ -389,6 +389,10 @@ Callback invoked when the vlan configuration has chang
 Callback invoked when a vlan is destroyed.
 .It Vt vm_lowmem
 Callbacks invoked when virtual memory is low.
+.It Vt vxlan_start
+Callback invoked when a vxlan interface starts.
+.It Vt vxlan_stop
+Callback invoked when a vxlan interface stops.
 .It Vt watchdog_list
 Callbacks invoked when the system watchdog timer is reinitialized.
 .El

Modified: head/sys/net/if_vxlan.c
==
--- head/sys/net/if_vxlan.c Fri Sep 18 02:21:15 2020

svn commit: r365869 - in head/sys: netinet netinet6

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 02:21:15 2020
New Revision: 365869
URL: https://svnweb.freebsd.org/changeset/base/365869

Log:
  Add a knob to allow zero UDP checksums for UDP/IPv6 traffic on the given UDP 
port.
  
  This will be used by some upcoming changes to if_vxlan(4).  RFC 7348 (VXLAN)
  says that the UDP checksum "SHOULD be transmitted as zero.  When a packet is
  received with a UDP checksum of zero, it MUST be accepted for decapsulation."
  But the original IPv6 RFCs did not allow zero UDP checksum.  RFC 6935 attempts
  to resolve this.
  
  Reviewed by:  kib@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D25873

Modified:
  head/sys/netinet/udp_var.h
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet/udp_var.h
==
--- head/sys/netinet/udp_var.h  Fri Sep 18 02:10:28 2020(r365868)
+++ head/sys/netinet/udp_var.h  Fri Sep 18 02:21:15 2020(r365869)
@@ -154,6 +154,9 @@ VNET_DECLARE(int, udp_log_in_vain);
 #defineV_udp_blackhole VNET(udp_blackhole)
 #defineV_udp_log_in_vain   VNET(udp_log_in_vain)
 
+VNET_DECLARE(int, zero_checksum_port);
+#defineV_zero_checksum_portVNET(zero_checksum_port)
+
 static __inline struct inpcbinfo *
 udp_get_inpcbinfo(int protocol)
 {

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Fri Sep 18 02:10:28 2020
(r365868)
+++ head/sys/netinet6/udp6_usrreq.c Fri Sep 18 02:21:15 2020
(r365869)
@@ -124,6 +124,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+VNET_DEFINE(int, zero_checksum_port) = 0;
+#defineV_zero_checksum_portVNET(zero_checksum_port)
+SYSCTL_INT(_net_inet6_udp6, OID_AUTO, rfc6935_port, CTLFLAG_VNET | CTLFLAG_RW,
+_NAME(zero_checksum_port), 0,
+"Zero UDP checksum allowed for traffic to/from this port.");
 /*
  * UDP protocol implementation.
  * Per RFC 768, August, 1980.
@@ -267,7 +272,14 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
}
if (uh->uh_sum == 0) {
UDPSTAT_INC(udps_nosum);
-   goto badunlocked;
+   /*
+* dport 0 was rejected earlier so this is OK even if
+* zero_checksum_port is 0 (which is its default value).
+*/
+   if (ntohs(uh->uh_dport) == V_zero_checksum_port)
+   goto skip_checksum;
+   else
+   goto badunlocked;
}
}
 
@@ -287,6 +299,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
goto badunlocked;
}
 
+skip_checksum:
/*
 * Construct sockaddr format source address.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365868 - in head: sbin/ifconfig sys/net

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 02:10:28 2020
New Revision: 365868
URL: https://svnweb.freebsd.org/changeset/base/365868

Log:
  Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic.
  
  These are similar to the existing VLAN capabilities.
  
  Reviewed by:  kib@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D25873

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c
  head/sbin/ifconfig/ifvxlan.c
  head/sys/net/if.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Fri Sep 18 01:38:47 2020
(r365867)
+++ head/sbin/ifconfig/ifconfig.8   Fri Sep 18 02:10:28 2020
(r365868)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd June 4, 2020
+.Dd September 17, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -587,7 +587,7 @@ If the driver offers user-configurable VLAN support, e
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, checksum offloading, or TSO on VLAN,
 respectively.
-Note that this must be issued on a physical interface associated with
+Note that this must be configured on a physical interface associated with
 .Xr vlan 4 ,
 not on a
 .Xr vlan 4
@@ -597,6 +597,21 @@ If the driver offers user-configurable VLAN support, d
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, or TSO on VLAN,
 respectively.
+.It Cm vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, enable inner checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
+Note that this must be configured on a physical interface associated with
+.Xr vxlan 4 ,
+not on a
+.Xr vxlan 4
+interface itself.
+The physical interface is either the interface specified as the vxlandev
+or the interface hosting the vxlanlocal address.
+The driver will offload as much checksum work and TSO as it can reliably
+support, the exact level of offloading may vary between drivers.
+.It Fl vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, disable checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
 .It Cm vnet Ar jail
 Move the interface to the
 .Xr jail 8 ,

Modified: head/sbin/ifconfig/ifconfig.c
==
--- head/sbin/ifconfig/ifconfig.c   Fri Sep 18 01:38:47 2020
(r365867)
+++ head/sbin/ifconfig/ifconfig.c   Fri Sep 18 02:10:28 2020
(r365868)
@@ -1344,7 +1344,8 @@ unsetifdescr(const char *val, int value, int s, const 
 "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \
 "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \
 "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \
-"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6"
+"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" 
\
+"\36VXLAN_HWCSUM\37VXLAN_HWTSO"
 
 /*
  * Print the status of the interface.  If an address family was

Modified: head/sbin/ifconfig/ifvxlan.c
==
--- head/sbin/ifconfig/ifvxlan.cFri Sep 18 01:38:47 2020
(r365867)
+++ head/sbin/ifconfig/ifvxlan.cFri Sep 18 02:10:28 2020
(r365868)
@@ -620,6 +620,11 @@ static struct cmd vxlan_cmds[] = {
 
DEF_CMD("vxlanflush", 0,setvxlan_flush),
DEF_CMD("vxlanflushall", 1, setvxlan_flush),
+
+   DEF_CMD("vxlanhwcsum",  IFCAP_VXLAN_HWCSUM, setifcap),
+   DEF_CMD("-vxlanhwcsum", -IFCAP_VXLAN_HWCSUM,setifcap),
+   DEF_CMD("vxlanhwtso",   IFCAP_VXLAN_HWTSO,  setifcap),
+   DEF_CMD("-vxlanhwtso",  -IFCAP_VXLAN_HWTSO, setifcap),
 };
 
 static struct afswtch af_vxlan = {

Modified: head/sys/net/if.h
==
--- head/sys/net/if.h   Fri Sep 18 01:38:47 2020(r365867)
+++ head/sys/net/if.h   Fri Sep 18 02:10:28 2020(r365868)
@@ -248,6 +248,8 @@ struct if_data {
 #defineIFCAP_NOMAP 0x400 /* can TX unmapped mbufs */
 #defineIFCAP_TXTLS40x800 /* can do TLS encryption and 
segmentation for TCP */
 #defineIFCAP_TXTLS60x1000 /* can do TLS encryption and 
segmentation for TCP6 */
+#defineIFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
VXLANs */
+#defineIFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
VXLANs */
 
 #define IFCAP_HWCSUM_IPV6  (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to 

svn commit: r365867 - head/sys/sys

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Fri Sep 18 01:38:47 2020
New Revision: 365867
URL: https://svnweb.freebsd.org/changeset/base/365867

Log:
  mbuf checksum flags and fields to support tunneling protocols.
  
  These are being added to support VXLAN but will work for GENEVE as well.
  ENCAP_RSVD1 will likely become ENCAP_GENEVE in the future.
  
  The size of struct mbuf does not change and that means this change can be 
MFC'd.
  If size wasn't a constraint a cleaner way may have been to add 
inner_csum_flags
  and inner_csum_data to go with csum_flags and csum_data.
  
  Reviewed by:  kib@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D25873

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Fri Sep 18 01:11:11 2020(r365866)
+++ head/sys/sys/mbuf.h Fri Sep 18 01:38:47 2020(r365867)
@@ -171,7 +171,10 @@ struct pkthdr {
uint8_t  l3hlen;/* layer 3 hdr len */
uint8_t  l4hlen;/* layer 4 hdr len */
uint8_t  l5hlen;/* layer 5 hdr len */
-   uint32_t spare;
+   uint8_t  inner_l2hlen;
+   uint8_t  inner_l3hlen;
+   uint8_t  inner_l4hlen;
+   uint8_t  inner_l5hlen;
};
};
union {
@@ -616,7 +619,13 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof
  * Outbound flags that are set by upper protocol layers requesting lower
  * layers, or ideally the hardware, to perform these offloading tasks.
  * For outbound packets this field and its flags can be directly tested
- * against ifnet if_hwassist.
+ * against ifnet if_hwassist.  Note that the outbound and the inbound flags do
+ * not collide right now but they could be allowed to (as long as the flags are
+ * scrubbed appropriately when the direction of an mbuf changes).  CSUM_BITS
+ * would also have to split into CSUM_BITS_TX and CSUM_BITS_RX.
+ *
+ * CSUM_INNER_ is the same as CSUM_ but it applies to the inner frame.
+ * The CSUM_ENCAP_ bits identify the outer encapsulation.
  */
 #defineCSUM_IP 0x0001  /* IP header checksum 
offload */
 #defineCSUM_IP_UDP 0x0002  /* UDP checksum offload 
*/
@@ -625,13 +634,28 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof
 #defineCSUM_IP_TSO 0x0010  /* TCP segmentation 
offload */
 #defineCSUM_IP_ISCSI   0x0020  /* iSCSI checksum 
offload */
 
+#defineCSUM_INNER_IP6_UDP  0x0040
+#defineCSUM_INNER_IP6_TCP  0x0080
+#defineCSUM_INNER_IP6_TSO  0x0100
 #defineCSUM_IP6_UDP0x0200  /* UDP checksum offload 
*/
 #defineCSUM_IP6_TCP0x0400  /* TCP checksum offload 
*/
 #defineCSUM_IP6_SCTP   0x0800  /* SCTP checksum 
offload */
 #defineCSUM_IP6_TSO0x1000  /* TCP segmentation 
offload */
 #defineCSUM_IP6_ISCSI  0x2000  /* iSCSI checksum 
offload */
 
+#defineCSUM_INNER_IP   0x4000
+#defineCSUM_INNER_IP_UDP   0x8000
+#defineCSUM_INNER_IP_TCP   0x0001
+#defineCSUM_INNER_IP_TSO   0x0002
+
+#defineCSUM_ENCAP_VXLAN0x0004  /* VXLAN outer 
encapsulation */
+#defineCSUM_ENCAP_RSVD10x0008
+
 /* Inbound checksum support where the checksum was verified by hardware. */
+#defineCSUM_INNER_L3_CALC  0x0010
+#defineCSUM_INNER_L3_VALID 0x0020
+#defineCSUM_INNER_L4_CALC  0x0040
+#defineCSUM_INNER_L4_VALID 0x0080
 #defineCSUM_L3_CALC0x0100  /* calculated layer 3 
csum */
 #defineCSUM_L3_VALID   0x0200  /* checksum is correct 
*/
 #defineCSUM_L4_CALC0x0400  /* calculated layer 4 
csum */
@@ -642,16 +666,31 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof
 
 #defineCSUM_SND_TAG0x8000  /* Packet header has 
send tag */
 
+#define CSUM_FLAGS_TX (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP_SCTP | \
+CSUM_IP_TSO | CSUM_IP_ISCSI | CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | \
+CSUM_INNER_IP6_TSO | CSUM_IP6_UDP | CSUM_IP6_TCP | CSUM_IP6_SCTP | \
+CSUM_IP6_TSO | CSUM_IP6_ISCSI | CSUM_INNER_IP | CSUM_INNER_IP_UDP | \
+CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | CSUM_ENCAP_VXLAN | \
+CSUM_ENCAP_RSVD1 | CSUM_SND_TAG)
+
+#define CSUM_FLAGS_RX (CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | \
+CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID | CSUM_L3_CALC | CSUM_L3_VALID | \
+CSUM_L4_CALC | CSUM_L4_VALID | CSUM_L5_CALC | 

Re: svn commit: r365846 - head

2020-09-17 Thread Ed Maste
On Thu, 17 Sep 2020 at 18:35, Ed Maste  wrote:
>
> On Thu, 17 Sep 2020 at 15:07, Kyle Evans  wrote:
> >
> > Is there any way we can sneak a r/o src tree build in here? I've had a
> > PR open to do this in our Jenkins builds for a couple years, but
> > without any ability to test it myself I suspect it'll continue
> > unmerged.
>
> Cirrus-CI does the git clone for us and it is done as root, so we
> should in effect have a RO src tree here. I'll confirm sometime later
> on.

Indeed, Cirrus checks out the tree under /tmp/cirrus-ci-build as root,
and there are no files/directories writable by the unprivileged user
added by this change.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Steffen Nurpmeso
Warner Losh wrote in
 :
 |On Thu, Sep 17, 2020, 11:25 AM Jessica Clarke  wrote:
 |>> On 17 Sep 2020, at 18:23, Jessica Clarke  wrote:
 |>>
 |>>> On 17 Sep 2020, at 18:05, Rodney W. Grimes 
 |> wrote:
 |>>>
 | On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso 
 |> wrote:
 |
 |> Alex Richardson wrote in
 |> <202009171507.08hf7qns080...@repo.freebsd.org>:
 |>|Author: arichardson
 |>|Date: Thu Sep 17 15:07:25 2020
 |>|New Revision: 365836
 |>|URL: https://svnweb.freebsd.org/changeset/base/365836
 |>|
 |>|Log:
 |>|  Stop using lorder and ranlib when building libraries
 |>|
 |>|  Use of ranlib or lorder is no longer necessary with current linkers
 |>|  (probably anything newer than ~1990) and ar's ability to create an
 |> object
 |>|  index and symbol table in the archive.
 |>|  Currently the build system uses lorder+tsort to sort the .o files
 |> in
 |>|  dependency order so that a single-pass linker can use them.
 |> However,
 |>|  we can use the -s flag to ar to add an index to the .a file which
 |> makes
 |>|  lorder unnecessary.
 |>|  Running ar -s is equivalent to running ranlib afterwards, so we can
 |> also
 |>|  skip the ranlib invocation.
 |>
 |> That ranlib thing yes (for long indeed), but i have vague memories
 |> that the tsort/lorder ordering was also meant to keep the things
 |> which heavily interdepend nearby each other.  (Luckily Linux
 |> always had at least tsort available.)
 |> This no longer matters for all the platforms FreeBSD supports?
 |>
 |
 | tsort has no notion of how dependent the modules are, just an order
 |> that
 | allows a single pass through the .a file (otherwise you'd need to list
 |> the
 | .a file multiple times on the command line absent ranlib). That's the
 | original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
 | edition unix on a PDP-11, where size was more important than proximity
 |> to
 | locations (modulo overlays, which this doesn't affect at all).
 |
 | There were some issues of long vs short jumps on earlier architectures
 |> that
 | this helped (since you could only jump 16MB, for example). However,
 |> there
 | were workarounds for this issue on those platforms too. And if you
 |> have a
 | program that this does make a difference, then you can still use
 | tsort/lorder. They are still in the system.
 |
 | I doubt you could measure a difference here today. I doubt, honestly,
 |> that
 | anybody will notice at all.
 |>>>
 |>>> The x86 archicture has relative jmps of differning lengths, even in
 |> long mode
 |>>> there is support for rel8 and rel32.
 |>>
 |>> That's irrelevant though for several reasons:
 |>>
 |>> 1. The compiler has already decided on what jump instructions to use
 |> based on
 |>>   the requested code model (unless you're on RISC-V and using GNU bfd ld
 |> as
 |>>   that supports linker relaxations that actually delete instruction
 |> bytes).
 |>>
 |>> 2. The linker is still free to reorder input sections however it likes,
 |> it
 |>>   doesn't have to follow the order of the input files (and the files
 |> within
 |>>   any archive).
 |>
 |> Hm actually that's only true for archives; it needs to respect the \
 |> order of
 |> files on the command line for things like crti.o to work. But regardless,
 |> the
 |> other points (and this one, partially) still hold.
 |>
 |>> 3. If you care about those kinds of optimisations you should use
 |> link-time
 |>>   optimisation which will likely do far more useful things than just
 |> optimise
 |>>   branches, but again isn't constrained by the order of the input files,
 |> it
 |>>   can lay out the code exactly how it wants.
 |>>
 |>> Not to mention that this is just a topological sort, not a clustering
 |> sort.
 |>
 |
 |Yea. I doubt you'd be able to measure a difference on anything in our tree.

Very interesting, thank you all.
Profiling based sort order, impressive even.  I thought more about
cache hotness and, simply, keeping interdependent things together
as such.  But well, caches are so big today, and everything is
dynamically linked, i only jerk a bit due to that runtime cost
myself.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365449 - head/sbin/rcorder

2020-09-17 Thread John Baldwin
On 9/17/20 3:44 PM, Olivier Cochard-Labbé wrote:
> On Thu, Sep 17, 2020 at 10:21 PM John Baldwin  wrote:
>> I think long term we want OCF's notions of sessions to be a bit more
>> fluid such that "client" sessions for things like GELI and IPSec can
>> be backed by one or more "driver" sessions (including "driver" sessions
>> coming and going as devices come and go).  That's a fair bit more work
>> however.
>>
>>
> And why not simply add 'kld' into the REQUIRE part of /etc/rc.d/ipsec ?
> But this will fix only IPsec: What about other crypto consumers ?

The problem is that kld_list can be used to load all sorts of modules.
Perhaps some of them need to be loaded after the network is configured,
for example, but ipsec is probably before NETWORKING, so moving kld
earlier would break those modules.  The problem with 'kld' is that it is
super generic so there isn't a "right" place to put it.

I'm not sure of an easy solution.  In your case, if you put aesni_load=YES
in loader.conf instead of putting aesni in kld_list you would be fine
though.  I'm not sure it's really safe to assume that things loaded by
kld_list are available for any boot-time services.

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


Re: svn commit: r365449 - head/sbin/rcorder

2020-09-17 Thread Olivier Cochard-Labbé
On Thu, Sep 17, 2020 at 10:21 PM John Baldwin  wrote:

>
>
> I don't think the issue is with rcorder though.  I think the reason the
> ordering matters warrants further investigation.  Is aesni not getting
> used when ipsec is loaded first?  You can use dtrace with the script at
> https://github.com/bsdjhb/kdbg/blob/master/dtrace/crypto_drivers.d to see
> which driver is being used.
>
>
Hi,

The driver used is cryptosoft when ipsec keys are set before the aesni
module is loaded.

  I suspect
> btw that you could just do 'sh /etc/rc.d/ipsec restart' post-boot without
> unloading any modules which would also fix your benchmark.
>


Correct, just restarting ipsec fix the benchmark.
And once restarted, the driver used is aesni.


> I think long term we want OCF's notions of sessions to be a bit more
> fluid such that "client" sessions for things like GELI and IPSec can
> be backed by one or more "driver" sessions (including "driver" sessions
> coming and going as devices come and go).  That's a fair bit more work
> however.
>
>
And why not simply add 'kld' into the REQUIRE part of /etc/rc.d/ipsec ?
But this will fix only IPsec: What about other crypto consumers ?

Regards,

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


Re: svn commit: r365855 - head/share/man/man9

2020-09-17 Thread John Baldwin
On 9/17/20 1:50 PM, Gordon Bergling wrote:
> Author: gbe (doc committer)
> Date: Thu Sep 17 20:50:02 2020
> New Revision: 365855
> URL: https://svnweb.freebsd.org/changeset/base/365855
> 
> Log:
>   crypto_buffer(9): Sort the SEE ALSO section
>   
>   MFC after:  3 days

This manpage isn't in stable FWIW.

> Modified:
>   head/share/man/man9/crypto_buffer.9
> 
> Modified: head/share/man/man9/crypto_buffer.9
> ==
> --- head/share/man/man9/crypto_buffer.9   Thu Sep 17 20:42:41 2020
> (r365854)
> +++ head/share/man/man9/crypto_buffer.9   Thu Sep 17 20:50:02 2020
> (r365855)
> @@ -317,11 +317,10 @@ returns the length in bytes of a contiguous segment.
>  returns true if the request uses a separate output buffer.
>  .Sh SEE ALSO
>  .Xr ipsec 4 ,
> -.Xr bus_dma 9 ,

Did you mean to lose this one?  (Rest looks fine)

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


Re: svn commit: r365846 - head

2020-09-17 Thread Ed Maste
On Thu, 17 Sep 2020 at 15:07, Kyle Evans  wrote:
>
> Is there any way we can sneak a r/o src tree build in here? I've had a
> PR open to do this in our Jenkins builds for a couple years, but
> without any ability to test it myself I suspect it'll continue
> unmerged.

Cirrus-CI does the git clone for us and it is done as root, so we
should in effect have a RO src tree here. I'll confirm sometime later
on.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365863 - head/sys/kgssapi

2020-09-17 Thread Konstantin Belousov
Author: kib
Date: Thu Sep 17 22:29:38 2020
New Revision: 365863
URL: https://svnweb.freebsd.org/changeset/base/365863

Log:
  State kgssapi dependency on xdr.
  
  Submitted by: Dmitry Afanasiev
  PR:   249378
  MFC after:3 days

Modified:
  head/sys/kgssapi/gss_impl.c

Modified: head/sys/kgssapi/gss_impl.c
==
--- head/sys/kgssapi/gss_impl.c Thu Sep 17 22:27:07 2020(r365862)
+++ head/sys/kgssapi/gss_impl.c Thu Sep 17 22:29:38 2020(r365863)
@@ -342,5 +342,6 @@ static moduledata_t kgssapi_mod = {
NULL,
 };
 DECLARE_MODULE(kgssapi, kgssapi_mod, SI_SUB_VFS, SI_ORDER_ANY);
+MODULE_DEPEND(kgssapi, xdr, 1, 1, 1);
 MODULE_DEPEND(kgssapi, krpc, 1, 1, 1);
 MODULE_VERSION(kgssapi, 1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365861 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware

2020-09-17 Thread Navdeep Parhar
Author: np
Date: Thu Sep 17 22:14:11 2020
New Revision: 365861
URL: https://svnweb.freebsd.org/changeset/base/365861

Log:
  cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.
  
  Obtained from:Chelsio Communications
  MFC after:3 days
  Sponsored by: Chelsio Communications

Added:
  head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin   (contents, props changed)
Deleted:
  head/sys/dev/cxgbe/firmware/t4fw-1.24.12.0.bin
  head/sys/dev/cxgbe/firmware/t5fw-1.24.12.0.bin
  head/sys/dev/cxgbe/firmware/t6fw-1.24.12.0.bin
Modified:
  head/sys/conf/files
  head/sys/dev/cxgbe/firmware/t4fw_interface.h
  head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
  head/sys/modules/cxgbe/t4_firmware/Makefile
  head/sys/modules/cxgbe/t5_firmware/Makefile
  head/sys/modules/cxgbe/t6_firmware/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Sep 17 21:51:05 2020(r365860)
+++ head/sys/conf/files Thu Sep 17 22:14:11 2020(r365861)
@@ -1514,7 +1514,7 @@ t4fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t4fw.fwo"
 t4fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t4fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t4fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t4fw.fw"
@@ -1548,7 +1548,7 @@ t5fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t5fw.fwo"
 t5fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t5fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t5fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t5fw.fw"
@@ -1582,7 +1582,7 @@ t6fw.fwo  optional cxgbe  
\
no-implicit-rule\
clean   "t6fw.fwo"
 t6fw.fwoptional cxgbe  
\
-   dependency  "$S/dev/cxgbe/firmware/t6fw-1.24.12.0.bin"  \
+   dependency  "$S/dev/cxgbe/firmware/t6fw-1.25.0.0.bin"   \
compile-with"${CP} ${.ALLSRC} ${.TARGET}"   \
no-obj no-implicit-rule \
clean   "t6fw.fw"

Added: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin
==

Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h
==
--- head/sys/dev/cxgbe/firmware/t4fw_interface.hThu Sep 17 21:51:05 
2020(r365860)
+++ head/sys/dev/cxgbe/firmware/t4fw_interface.hThu Sep 17 22:14:11 
2020(r365861)
@@ -4690,6 +4690,7 @@ enum fw_caps_config_crypto {
FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x0001,
FW_CAPS_CONFIG_TLSKEYS = 0x0002,
FW_CAPS_CONFIG_IPSEC_INLINE = 0x0004,
+   FW_CAPS_CONFIG_TLS_HW = 0x0008,
 };
 
 enum fw_caps_config_fcoe {
@@ -4838,6 +4839,7 @@ enum fw_params_param_dev {
FW_PARAMS_PARAM_DEV_TCB_CACHE_FLUSH = 0x2D,
FW_PARAMS_PARAM_DEV_FILTER = 0x2E,
FW_PARAMS_PARAM_DEV_CLIP2_CMD = 0x2F,
+   FW_PARAMS_PARAM_DEV_KTLS_HW = 0x31,
 };
 
 /*
@@ -4874,6 +4876,13 @@ enum fw_params_param_dev_filter{
FW_PARAM_DEV_FILTER_MODE_MASK   = 0x01,
 };
 
+enum fw_params_param_dev_ktls_hw {
+   FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE = 0x00,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_ENABLE  = 0x01,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_USER_DISABLE = 0x00,
+   FW_PARAMS_PARAM_DEV_KTLS_HW_USER_ENABLE  = 0x01,
+};
+
 enum fw_params_param_dev_fwcache {
FW_PARAM_DEV_FWCACHE_FLUSH  = 0x00,
FW_PARAM_DEV_FWCACHE_FLUSHINV   = 0x01,
@@ -9638,6 +9647,7 @@ struct fw_debug_cmd {
 
 enum fw_diag_cmd_type {
FW_DIAG_CMD_TYPE_OFLDIAG = 0,
+   FW_DIAG_CMD_TYPE_MEM_TEST_DIAG,
 };
 
 enum fw_diag_cmd_ofldiag_op {
@@ -9654,6 +9664,22 @@ enum fw_diag_cmd_ofldiag_status {
FW_DIAG_CMD_OFLDIAG_STATUS_PASSED,
 };
 
+enum fw_diag_cmd_memdiag_op {
+   FW_DIAG_CMD_MEMDIAG_TEST_START=1,
+   FW_DIAG_CMD_MEMDIAG_TEST_STOP,
+   

svn commit: r365859 - head/share/man/man7

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 21:24:11 2020
New Revision: 365859
URL: https://svnweb.freebsd.org/changeset/base/365859

Log:
  arch(7): Some markup fixes
  
  - no blank before trailing delimiter
  
  MFC after:3 days

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Sep 17 21:08:11 2020(r365858)
+++ head/share/man/man7/arch.7  Thu Sep 17 21:24:11 2020(r365859)
@@ -86,7 +86,6 @@ This table shows the first
 .Fx
 release to support each architecture, and, for discontinued
 architectures, the final release.
-.Pp
 .Bl -column -offset indent "Architecture" "Initial Release" "Final Release"
 .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release
 .It aarch64 Ta 11.0
@@ -341,24 +340,24 @@ Architecture-specific macros:
 .Bl -column -offset indent "Architecture" "Predefined macros"
 .It Sy Architecture Ta Sy Predefined macros
 .It aarch64 Ta Dv __aarch64__
-.It amd64   Ta Dv __amd64__, Dv __x86_64__
-.It armv6   Ta Dv __arm__, Dv __ARM_ARCH >= 6
-.It armv7   Ta Dv __arm__, Dv __ARM_ARCH >= 7
+.It amd64   Ta Dv __amd64__ , Dv __x86_64__
+.It armv6   Ta Dv __arm__ , Dv __ARM_ARCH >= 6
+.It armv7   Ta Dv __arm__ , Dv __ARM_ARCH >= 7
 .It i386Ta Dv __i386__
-.It mipsTa Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
-.It mipsel  Ta Dv __mips__, Dv __mips_o32
-.It mipselhfTa Dv __mips__, Dv __mips_o32
-.It mipshf  Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
-.It mipsn32 Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n32
-.It mips64  Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
-.It mips64elTa Dv __mips__, Dv __mips_n64
-.It mips64elhf  Ta Dv __mips__, Dv __mips_n64
-.It mips64hfTa Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
+.It mipsTa Dv __mips__ , Dv __MIPSEB__ , Dv __mips_o32
+.It mipsel  Ta Dv __mips__ , Dv __mips_o32
+.It mipselhfTa Dv __mips__ , Dv __mips_o32
+.It mipshf  Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_o32
+.It mipsn32 Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n32
+.It mips64  Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n64
+.It mips64elTa Dv __mips__ , Dv __mips_n64
+.It mips64elhf  Ta Dv __mips__ , Dv __mips_n64
+.It mips64hfTa Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n64
 .It powerpc Ta Dv __powerpc__
-.It powerpcspe  Ta Dv __powerpc__, Dv __SPE__
-.It powerpc64   Ta Dv __powerpc__, Dv __powerpc64__
-.It riscv64 Ta Dv __riscv, Dv __riscv_xlen == 64
-.It riscv64sf   Ta Dv __riscv, Dv __riscv_xlen == 64, Dv __riscv_float_abi_soft
+.It powerpcspe  Ta Dv __powerpc__ , Dv __SPE__
+.It powerpc64   Ta Dv __powerpc__ , Dv __powerpc64__
+.It riscv64 Ta Dv __riscv , Dv __riscv_xlen == 64
+.It riscv64sf   Ta Dv __riscv , Dv __riscv_xlen == 64 , Dv 
__riscv_float_abi_soft
 .El
 .Pp
 Compilers may define additional variants of architecture-specific macros.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365858 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 21:08:11 2020
New Revision: 365858
URL: https://svnweb.freebsd.org/changeset/base/365858

Log:
  man(9): Some markup fixes
  
  - whitespace at end of input line
  - skipping paragraph macro: Pp after Sh
  
  MFC after:3 days

Modified:
  head/share/man/man9/EVENTHANDLER.9
  head/share/man/man9/OF_node_from_xref.9
  head/share/man/man9/ieee80211.9
  head/share/man/man9/socket.9
  head/share/man/man9/tcp_functions.9
  head/share/man/man9/ucred.9

Modified: head/share/man/man9/EVENTHANDLER.9
==
--- head/share/man/man9/EVENTHANDLER.9  Thu Sep 17 20:55:42 2020
(r365857)
+++ head/share/man/man9/EVENTHANDLER.9  Thu Sep 17 21:08:11 2020
(r365858)
@@ -299,7 +299,7 @@ Callback invoked when an interfance has been removed f
 .It Vt ifaddr_event
 Callbacks invoked when an address is set up on a network interface.
 .It Vt ifaddr_event_ext
-Callback invoked when an address has been added or removed from an interface. 
+Callback invoked when an address has been added or removed from an interface.
 .It Vt if_clone_event
 Callbacks invoked when an interface is cloned.
 .It Vt iflladdr_event

Modified: head/share/man/man9/OF_node_from_xref.9
==
--- head/share/man/man9/OF_node_from_xref.9 Thu Sep 17 20:55:42 2020
(r365857)
+++ head/share/man/man9/OF_node_from_xref.9 Thu Sep 17 21:08:11 2020
(r365858)
@@ -64,7 +64,7 @@ the values of "phandle" properties.
 and
 .Fn OF_xref_from_node
 are used to perform conversion between these two kinds of node
-identifiers. 
+identifiers.
 .Pp
 .Fn OF_node_from_xref
 returns the kernel phandle for the effective phandle

Modified: head/share/man/man9/ieee80211.9
==
--- head/share/man/man9/ieee80211.9 Thu Sep 17 20:55:42 2020
(r365857)
+++ head/share/man/man9/ieee80211.9 Thu Sep 17 21:08:11 2020
(r365858)
@@ -706,7 +706,7 @@ and were later ported to
 This man page was updated with the information from
 .Nx
 .Nm
-man page. 
+man page.
 .Sh AUTHORS
 .An -nosplit
 The original

Modified: head/share/man/man9/socket.9
==
--- head/share/man/man9/socket.9Thu Sep 17 20:55:42 2020
(r365857)
+++ head/share/man/man9/socket.9Thu Sep 17 21:08:11 2020
(r365858)
@@ -56,7 +56,7 @@
 .Fn sodisconnect "struct socket *so"
 .Ft void
 .Fo sodtor_set
-.Fa "struct socket *so" 
+.Fa "struct socket *so"
 .Fa "void (*func)(struct socket *)"
 .Fc
 .Ft struct  sockaddr *

Modified: head/share/man/man9/tcp_functions.9
==
--- head/share/man/man9/tcp_functions.9 Thu Sep 17 20:55:42 2020
(r365857)
+++ head/share/man/man9/tcp_functions.9 Thu Sep 17 21:08:11 2020
(r365858)
@@ -281,8 +281,9 @@ for that socket, the kernel will call the function poi
 .Va tfb_tcp_handoff_ok
 field.
 The function should return 0 if the user is allowed to switch the socket to use
-the TCP stack. Otherwise, the function should return an error code, which will
-be returned to the user.
+the TCP stack.
+Otherwise, the function should return an error code, which will be returned to
+the user.
 If the
 .Va tfb_tcp_handoff_ok
 field is

Modified: head/share/man/man9/ucred.9
==
--- head/share/man/man9/ucred.9 Thu Sep 17 20:55:42 2020(r365857)
+++ head/share/man/man9/ucred.9 Thu Sep 17 21:08:11 2020(r365858)
@@ -143,7 +143,6 @@ and appropriately sets fields in the latter that are n
 the former
 (e.g.,
 .Va cr_version ) .
-.Pp
 .Sh RETURN VALUES
 .Fn crget ,
 .Fn crhold ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365857 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:55:42 2020
New Revision: 365857
URL: https://svnweb.freebsd.org/changeset/base/365857

Log:
  pwmbus(9): some markup fixes
  
  - whitespace at end of input line
  
  MFC after:3 days

Modified:
  head/share/man/man9/pwmbus.9

Modified: head/share/man/man9/pwmbus.9
==
--- head/share/man/man9/pwmbus.9Thu Sep 17 20:53:24 2020
(r365856)
+++ head/share/man/man9/pwmbus.9Thu Sep 17 20:55:42 2020
(r365857)
@@ -68,11 +68,11 @@ argument is the duration in nanoseconds of the on port
 .Pp
 Some PWM hardware is organized as a single controller with multiple channels.
 Channel numbers count up from zero.
-When multiple channels are present, they sometimes share a common clock or 
+When multiple channels are present, they sometimes share a common clock or
 other resources.
-In such cases, changing the period or duty cycle of any one channel may affect 
+In such cases, changing the period or duty cycle of any one channel may affect
 other channels within the hardware which share the same resources.
-Consult the documentation for the underlying PWM hardware device driver for 
+Consult the documentation for the underlying PWM hardware device driver for
 details on channels that share resources.
 .Sh INTERFACE
 .Bl -tag -width indent
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365856 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:53:24 2020
New Revision: 365856
URL: https://svnweb.freebsd.org/changeset/base/365856

Log:
  mbuf(9): Some markup fixes
  
  - whitespace at end of input line
  - no blank before trailing delimiter: Dv MJUM16BYTES
  
  MFC after:3 days

Modified:
  head/share/man/man9/mbuf.9

Modified: head/share/man/man9/mbuf.9
==
--- head/share/man/man9/mbuf.9  Thu Sep 17 20:50:02 2020(r365855)
+++ head/share/man/man9/mbuf.9  Thu Sep 17 20:53:24 2020(r365856)
@@ -574,7 +574,7 @@ for non-critical paths.
 Allocate an
 .Vt mbuf
 with enough space to hold specified amount of data.
-If the size is is larger than 
+If the size is is larger than
 .Dv MJUMPAGESIZE , NULL
 will be returned.
 .It Fn m_getm orig len how type
@@ -640,7 +640,7 @@ but the specified
 of the cluster to be allocated must be one of
 .Dv MCLBYTES , MJUMPAGESIZE , MJUM9BYTES ,
 or
-.Dv MJUM16BYTES.
+.Dv MJUM16BYTES .
 .It Fn m_free mbuf
 Frees
 .Vt mbuf .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365855 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:50:02 2020
New Revision: 365855
URL: https://svnweb.freebsd.org/changeset/base/365855

Log:
  crypto_buffer(9): Sort the SEE ALSO section
  
  MFC after:3 days

Modified:
  head/share/man/man9/crypto_buffer.9

Modified: head/share/man/man9/crypto_buffer.9
==
--- head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:42:41 2020
(r365854)
+++ head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:50:02 2020
(r365855)
@@ -198,7 +198,7 @@ A scatter/gather list of kernel buffers as described i
 A network memory buffer as described in
 .Xr mbuf 9 .
 .It Dv CRYPTO_BUF_VMPAGE
-A scatter/gather list of 
+A scatter/gather list of
 .Vt vm_page_t
 structures describing pages in the kernel's address space.
 This buffer type is only available if
@@ -317,11 +317,10 @@ returns the length in bytes of a contiguous segment.
 returns true if the request uses a separate output buffer.
 .Sh SEE ALSO
 .Xr ipsec 4 ,
-.Xr bus_dma 9 ,
 .Xr crypto 7 ,
 .Xr crypto 9 ,
-.Xr crypto_request 9 ,
 .Xr crypto_driver 9 ,
+.Xr crypto_request 9 ,
 .Xr crypto_session 9 ,
-.Xr mbuf 9
+.Xr mbuf 9 ,
 .Xr uio 9
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365854 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:42:41 2020
New Revision: 365854
URL: https://svnweb.freebsd.org/changeset/base/365854

Log:
  VOP_INACTIVE(9): Remove trailing whitespace
  
  MFC after:3 days

Modified:
  head/share/man/man9/VOP_INACTIVE.9

Modified: head/share/man/man9/VOP_INACTIVE.9
==
--- head/share/man/man9/VOP_INACTIVE.9  Thu Sep 17 20:37:54 2020
(r365853)
+++ head/share/man/man9/VOP_INACTIVE.9  Thu Sep 17 20:42:41 2020
(r365854)
@@ -57,7 +57,7 @@ to exclusive without sleeping.
 This may be
 because the reference count reaches zero or it may be that the
 file system is being forcibly unmounted while there are open files.
-It can be used to reclaim space on the last close of an 
+It can be used to reclaim space on the last close of an
 .Sq open but deleted
 file.
 .Pp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365853 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:37:54 2020
New Revision: 365853
URL: https://svnweb.freebsd.org/changeset/base/365853

Log:
  domainset(9): Some markup fixes
  
  - new sentence, new line
  - whitespace at end of input line
  
  MFC after:3 days

Modified:
  head/share/man/man9/domainset.9

Modified: head/share/man/man9/domainset.9
==
--- head/share/man/man9/domainset.9 Thu Sep 17 20:35:45 2020
(r365852)
+++ head/share/man/man9/domainset.9 Thu Sep 17 20:37:54 2020
(r365853)
@@ -88,8 +88,9 @@ memory is accessed from many CPUs that are not in the 
 .It Dv DOMAINSET_POLICY_PREFER
 Memory is allocated from the node in the
 .Vt prefer
-member.  The preferred node must be set in the allowed mask.
-If the preferred node is out of memory the allocation falls back to 
+member.
+The preferred node must be set in the allowed mask.
+If the preferred node is out of memory the allocation falls back to
 round-robin among allowed sets.
 .It Dv DOMAINSET_POLICY_INTERLEAVE
 Memory is allocated in a striped fashion with multiple pages
@@ -128,8 +129,7 @@ function takes a partially filled in domainset as a ke
 valid domainset or NULL.
 It is critical that consumers not use domainsets that have not been
 returned by this function.
-.Vt
-domainset
+.Vt domainset
 is an immutable type that is shared among all matching keys and must
 not be modified after return.
 .Pp
@@ -138,9 +138,8 @@ The
 function is provided as a convenience for modifying or viewing domainsets
 that are not accessible via
 .Xr cpuset 2 .
-It is intended for use with 
+It is intended for use with
 .Xr sysctl 9 .
-.Pp
 .Sh SEE ALSO
 .Xr cpuset 1 ,
 .Xr cpuset 2 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365852 - head/usr.sbin/bsdinstall/scripts

2020-09-17 Thread Kyle Evans
Author: kevans
Date: Thu Sep 17 20:35:45 2020
New Revision: 365852
URL: https://svnweb.freebsd.org/changeset/base/365852

Log:
  Revert r361257: bsdinstall: do a `certctl rehash` upon installation [...]
  
  As of r365829, any given base distribution set will now include the /etc/ssl
  symlinks that this rehash would've otherwise installed. This extra step is
  no longer required.
  
  MFC after:1 week
  X-MFC-With:   r365837

Modified:
  head/usr.sbin/bsdinstall/scripts/config

Modified: head/usr.sbin/bsdinstall/scripts/config
==
--- head/usr.sbin/bsdinstall/scripts/config Thu Sep 17 20:32:10 2020
(r365851)
+++ head/usr.sbin/bsdinstall/scripts/config Thu Sep 17 20:35:45 2020
(r365852)
@@ -55,9 +55,6 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
 
 # Set up other things from installed config
 chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
-if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then
-   chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash
-fi
 
 exit 0
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365851 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:32:10 2020
New Revision: 365851
URL: https://svnweb.freebsd.org/changeset/base/365851

Log:
  rmlock(9): Some markup fixes
  
  - new sentence, new line
  
  MFC after:3 days

Modified:
  head/share/man/man9/rmlock.9

Modified: head/share/man/man9/rmlock.9
==
--- head/share/man/man9/rmlock.9Thu Sep 17 20:25:31 2020
(r365850)
+++ head/share/man/man9/rmlock.9Thu Sep 17 20:32:10 2020
(r365851)
@@ -138,13 +138,14 @@ to
 It changes lock ordering rules to the same as for
 .Xr sx 9
 locks.
-They do not propagate priority to writers, but they do propagate priority to
-readers. Note that readers are not permitted to sleep regardless of the flag.
+They do not propagate priority to writers, but they do propagate priority to 
readers.
+Note that readers are not permitted to sleep regardless of the flag.
 .Pp
 Sleepable read-mostly locks (created with
 .Fn rms_init )
 allow sleeping for both readers and writers, but don't do priority propagation
-for either. They follow
+for either.
+They follow
 .Xr sx 9
 lock ordering.
 .Ss Macros and Functions
@@ -350,8 +351,7 @@ lock must be unlocked.
 .Xr sleep 9 ,
 .Xr sx 9
 .Sh HISTORY
-These
-functions appeared in
+These functions appeared in
 .Fx 7.0 .
 .Sh AUTHORS
 .An -nosplit
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365850 - head/share/man/man9

2020-09-17 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Sep 17 20:25:31 2020
New Revision: 365850
URL: https://svnweb.freebsd.org/changeset/base/365850

Log:
  bus_dma(9): Some markup fixes
  
  - new sentence, new line
  - no blank before trailing delimiter
  - whitespace at end of input line
  
  MFC after:3 days

Modified:
  head/share/man/man9/bus_dma.9

Modified: head/share/man/man9/bus_dma.9
==
--- head/share/man/man9/bus_dma.9   Thu Sep 17 19:47:41 2020
(r365849)
+++ head/share/man/man9/bus_dma.9   Thu Sep 17 20:25:31 2020
(r365850)
@@ -63,8 +63,8 @@
 .Nm bus_dma_template_init ,
 .Nm bus_dma_template_tag ,
 .Nm bus_dma_template_clone ,
-.Nm bus_dma_template_fill,
-.Nm BUS_DMA_TEMPLATE_FILL,
+.Nm bus_dma_template_fill ,
+.Nm BUS_DMA_TEMPLATE_FILL ,
 .Nm bus_dmamap_create ,
 .Nm bus_dmamap_destroy ,
 .Nm bus_dmamap_load ,
@@ -707,11 +707,13 @@ on success.
 .It Fn bus_dma_template_init "*template" "parent"
 Initializes a
 .Fa bus_dma_template_t
-structure.  If the
-.Fa parent 
+structure.
+If the
+.Fa parent
 argument is non-NULL, this parent tag is associated with the template and
-will be compiled into the dma tag that is later created.  The values
-of the parent are not copied into the template.  During tag creation in
+will be compiled into the dma tag that is later created.
+The values of the parent are not copied into the template.
+During tag creation in
 .Fn bus_dma_tag_template ,
 any parameters from the parent tag that are more restrictive than what is
 in the provided template will overwrite what goes into the new tag.
@@ -724,21 +726,24 @@ The template is not modified by this function, and can
 freed upon return.
 .It Fn bus_dma_template_clone "*template" "dmat"
 Copies the fields from an existing tag to a template.
-The template does not need to be initialized first.  All of its fields will
-be overwritten by the values contained in the tag.  When paired with
+The template does not need to be initialized first.
+All of its fields will be overwritten by the values contained in the tag.
+When paired with
 .Fn bus_dma_template_tag ,
 this function is useful for creating copies of tags.
 .It Fn bus_dma_template_fill "*template" "params[]" "count"
 Fills in the selected fields of the template with the keyed values from the
 .Fa params
-array.  This is not meant to be called directly, use
+array.
+This is not meant to be called directly, use
 .Fn BUS_DMA_TEMPLATE_FILL
 instead.
 .It Fn BUS_DMA_TEMPLATE_FILL "*template" "param ..."
 Fills in the selected fields of the template with a variable number of
-key-value parameters.  The macros listed below take an argument of the
-specified type and encapsulate it into a key-value structure that is directly
-usable as a parameter argument.  Muliple parameters may be provided at once.
+key-value parameters.
+The macros listed below take an argument of the specified type and encapsulate
+it into a key-value structure that is directly usable as a parameter argument.
+Muliple parameters may be provided at once.
 .Bd -literal
BD_PARENT() void *
BD_ALIGNMENT()  uintmax_t
@@ -752,7 +757,6 @@ usable as a parameter argument.  Muliple parameters ma
BD_LOCKFUNC()   void *
BD_LOCKFUNCARG() void *
 .Ed
-.Pp
 .It Fn bus_dmamap_create "dmat" "flags" "*mapp"
 Allocates and initializes a DMA map.
 Arguments are as follows:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365449 - head/sbin/rcorder

2020-09-17 Thread John Baldwin
On 9/17/20 10:49 AM, Olivier Cochard-Labbé wrote:
> On Tue, Sep 8, 2020 at 12:36 PM Andrey V. Elsukov  wrote:
> 
>> Author: ae
>> Date: Tue Sep  8 10:36:11 2020
>> New Revision: 365449
>> URL: https://svnweb.freebsd.org/changeset/base/365449
>>
>> Log:
>>   Add a few features to rcorder:
>>
>>
>>
> Hi Andrey,
> 
> I've spent some time bisecting an IPSec gateway performance regression on
> -head that points to this commit.
> 
> So my bench uses a simple static IPSec aes-gcm-16 setup, and their results
> vary a lot between those 2 revisions:
> 
>- r365448: Estimated Equilibrium Ethernet throughput= 1413 Mb/s (maximum
>value seen: 1419 Mb/s)
>- r365449: Estimated Equilibrium Ethernet throughput= 469 Mb/s (maximum
>value seen: 469 Mb/s)
> 
> How could a modification to the rcoder be the source cause of that ?
> My rc.conf contains this:
> kld_list="aesni"
> ipsec_enable="YES"
> 
> So My first thought was that the aesni module wasn't loaded anymore:
> Before upgrade:
> [root@hp]~# uname -a
> FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #15 r365448M: Thu Sep 17
> 18:17:58 CEST 2020 oliv...@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64
>  amd64
> [root@hp]~# kldstat
> Id Refs AddressSize Name
>  1   11 0x8020  1ee58b0 kernel
>  21 0x82319000 34c8 fdescfs.ko
>  31 0x8231d000 a240 aesni.ko
>  41 0x82328000 8c98 ioat.ko
>  51 0x82331000 e350 ipsec.ko
> 
> Then after upgrade:
> 
> [root@hp]~# uname -a
> FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #14 r365449M: Thu Sep 17
> 17:01:35 CEST 2020 oliv...@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64
>  amd64
> [root@hp]~# kldstat
> Id Refs AddressSize Name
>  1   11 0x8020  1ee58b0 kernel
>  21 0x82319000 34c8 fdescfs.ko
>  31 0x8231d000 e350 ipsec.ko
>  41 0x8232c000 a240 aesni.ko
>  51 0x82337000 8c98 ioat.ko
> 
> => aesni.ko is correctly loaded, so it is not the problem, but notice the
> order of the kernel modules that have changed.
> Could be this the source of the problem ? Let's try:
> 
> [root@hp]~# service ipsec stop
> Clearing ipsec manual keys/policies.
> [root@hp]~# kld
> kldconfig kldload   kldstat   kldunload kldxref
> [root@hp]~# kldunload ioat
> [root@hp]~# kldunload aesni
> [root@hp]~# kldunload ipsec
> [root@hp]~# kldload aesni
> [root@hp]~# kldload ipsec
> [root@hp]~# service ipsec start
> Installing ipsec manual keys/policies.
> [root@hp]~# kldstat
> Id Refs AddressSize Name
>  1   11 0x8020  1ee58b0 kernel
>  21 0x82319000 34c8 fdescfs.ko
>  51 0x82337000 8c98 ioat.ko
>  61 0x8231d000 a240 aesni.ko
>  71 0x82328000 e350 ipsec.ko
> 
> And after that the IPSec bench results are back to their previous value :-)
> So rcorder needs to load aesni before ipsec.

I don't think the issue is with rcorder though.  I think the reason the
ordering matters warrants further investigation.  Is aesni not getting
used when ipsec is loaded first?  You can use dtrace with the script at
https://github.com/bsdjhb/kdbg/blob/master/dtrace/crypto_drivers.d to see
which driver is being used.

Hmm, the crypto driver gets selected when keys for SAs are set, so if
/etc/rc.d/ipsec is configuring SAs, then having it run before aesni is
loaded would indeed cause this.  However, that still isn't an issue with
this commit, per se, it just exposed the lack of an explicit ordering
requirement of /etc/rc.d/ipsec after loading aesni.  The problem though
is that kld_list is pretty generic, so it's hard to know when /etc/rc.d/kld
should run.  Possibly it should even run multiple times where subsequent
runs try to load any modules not loaded by the previous runs?  I suspect
btw that you could just do 'sh /etc/rc.d/ipsec restart' post-boot without
unloading any modules which would also fix your benchmark.

I think long term we want OCF's notions of sessions to be a bit more
fluid such that "client" sessions for things like GELI and IPSec can
be backed by one or more "driver" sessions (including "driver" sessions
coming and going as devices come and go).  That's a fair bit more work
however.

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


svn commit: r365849 - head/contrib/llvm-project/llvm/lib/Target/X86

2020-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 17 19:47:41 2020
New Revision: 365849
URL: https://svnweb.freebsd.org/changeset/base/365849

Log:
  Merge commit 46673763f from llvm git (by Craig Topper):
  
[X86] Place new constant node in topological order in
X86DAGToDAGISel::matchBitExtract
  
Fixes PR47482
  
  This should fix 'Assertion failed: (Op->getNodeId() != -1 && "Node has
  already selected predecessor node"), function DoInstructionSelection,
  file
  
/usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp,
  line 1149' when compiling part of the project_painter project, while
  targeting the bdver2 (or higher) CPU.
  
  Reported by:  jkim
  MFC after:6 weeks
  X-MFC-With:   r364284

Modified:
  head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
==
--- head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp   Thu Sep 
17 19:43:25 2020(r365848)
+++ head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp   Thu Sep 
17 19:47:41 2020(r365849)
@@ -3496,6 +3496,7 @@ bool X86DAGToDAGISel::matchBitExtract(SDNode *Node) {
   // Shift NBits left by 8 bits, thus producing 'control'.
   // This makes the low 8 bits to be zero.
   SDValue C8 = CurDAG->getConstant(8, DL, MVT::i8);
+  insertDAGNode(*CurDAG, SDValue(Node, 0), C8);
   SDValue Control = CurDAG->getNode(ISD::SHL, DL, MVT::i32, NBits, C8);
   insertDAGNode(*CurDAG, SDValue(Node, 0), Control);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365848 - in head/contrib/llvm-project/clang: include/clang/Basic include/clang/Sema lib/AST lib/Headers lib/Sema lib/Serialization

2020-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 17 19:43:25 2020
New Revision: 365848
URL: https://svnweb.freebsd.org/changeset/base/365848

Log:
  Merge commit e09107ab8 from llvm git (by Raul Tambre):
  
[Sema] Introduce BuiltinAttr, per-declaration builtin-ness
  
Instead of relying on whether a certain identifier is a builtin,
introduce BuiltinAttr to specify a declaration as having builtin
semantics.
  
This fixes incompatible redeclarations of builtins, as reverting the
identifier as being builtin due to one incompatible redeclaration
would have broken rest of the builtin calls.
Mostly-compatible redeclarations of builtins also no longer have
builtin semantics. They don't call the builtin nor inherit their
attributes.
A long-standing FIXME regarding builtins inside a namespace enclosed
in extern "C" not being recognized is also addressed.
  
Due to the more correct handling attributes for builtin functions are
added in more places, resulting in more useful warnings.
Tests are updated to reflect that.
  
Intrinsics without an inline definition in intrin.h had `inline` and
`static` removed as they had no effect and caused them to no longer
be recognized as builtins otherwise.
  
A pthread_create() related test is XFAIL-ed, as it relied on it being
recognized as a builtin based on its name.
The builtin declaration syntax is too restrictive and doesn't allow
custom structs, function pointers, etc.
It seems to be the only case and fixing this would require reworking
the current builtin syntax, so this seems acceptable.
  
Fixes PR45410.
  
Reviewed By: rsmith, yutsumi
  
Differential Revision: https://reviews.llvm.org/D77491
  
  This should fix 'Assertion failed: (i < getNumParams() && "Illegal
  param #"), function getParamDecl, file
  /usr/src/contrib/llvm-project/clang/include/clang/AST/Decl.h, line 2430'
  when building the graphics/pgplot port.
  
  Note that there may also have been other ports which triggered this
  assertion, if they redeclare standard functions with incompatible
  arguments.
  
  Reported by:  zeising
  MFC after:6 weeks
  X-MFC-With:   r364284

Modified:
  head/contrib/llvm-project/clang/include/clang/Basic/Attr.td
  head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def
  head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h
  head/contrib/llvm-project/clang/include/clang/Sema/Sema.h
  head/contrib/llvm-project/clang/lib/AST/Decl.cpp
  head/contrib/llvm-project/clang/lib/Headers/intrin.h
  head/contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp
  head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp
  head/contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp
  head/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp
  head/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp

Modified: head/contrib/llvm-project/clang/include/clang/Basic/Attr.td
==
--- head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Thu Sep 17 
19:41:10 2020(r365847)
+++ head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Thu Sep 17 
19:43:25 2020(r365848)
@@ -3444,3 +3444,11 @@ def ReleaseHandle : InheritableParamAttr {
   let Subjects = SubjectList<[ParmVar]>;
   let Documentation = [ReleaseHandleDocs];
 }
+
+def Builtin : InheritableAttr {
+  let Spellings = [];
+  let Args = [UnsignedArgument<"ID">];
+  let Subjects = SubjectList<[Function]>;
+  let SemaHandler = 0;
+  let Documentation = [Undocumented];
+}

Modified: head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def
==
--- head/contrib/llvm-project/clang/include/clang/Basic/Builtins.defThu Sep 
17 19:41:10 2020(r365847)
+++ head/contrib/llvm-project/clang/include/clang/Basic/Builtins.defThu Sep 
17 19:43:25 2020(r365848)
@@ -1017,6 +1017,7 @@ LIBBUILTIN(strncasecmp, "icC*cC*z", "f",   "strings.h"
 LIBBUILTIN(_exit, "vi",   "fr","unistd.h", ALL_GNU_LANGUAGES)
 LIBBUILTIN(vfork, "p","fj","unistd.h", ALL_LANGUAGES)
 // POSIX pthread.h
+// FIXME: Should specify argument types.
 LIBBUILTIN(pthread_create, "",  "fC<2,3>", "pthread.h", ALL_GNU_LANGUAGES)
 
 // POSIX setjmp.h

Modified: head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h
==
--- head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h   
Thu Sep 17 19:41:10 2020(r365847)
+++ head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h   
Thu Sep 17 19:43:25 2020(r365848)
@@ -225,18 +225,6 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo 
   }
   void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCOrBuiltinID = ID; }
 
-  /// True if setNotBuiltin() was called.
-  bool 

svn commit: r365847 - in head/usr.sbin/makefs: . cd9660

2020-09-17 Thread Ed Maste
Author: emaste
Date: Thu Sep 17 19:41:10 2020
New Revision: 365847
URL: https://svnweb.freebsd.org/changeset/base/365847

Log:
  makefs: connect cd9660 El Torito EFI boot image system type
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/makefs/cd9660/cd9660_eltorito.c
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c
==
--- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c   Thu Sep 17 18:47:23 
2020(r365846)
+++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c   Thu Sep 17 19:41:10 
2020(r365847)
@@ -107,9 +107,11 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons
else if (strcmp(sysname, "macppc") == 0 ||
 strcmp(sysname, "mac68k") == 0)
new_image->system = ET_SYS_MAC;
+   else if (strcmp(sysname, "efi") == 0)
+   new_image->system = ET_SYS_EFI;
else {
warnx("boot disk system must be "
- "i386, powerpc, macppc, or mac68k");
+ "i386, powerpc, macppc, mac68k, or efi");
free(temp);
free(new_image);
return 0;

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Thu Sep 17 18:47:23 2020
(r365846)
+++ head/usr.sbin/makefs/makefs.8   Thu Sep 17 19:41:10 2020
(r365847)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2019
+.Dd September 17, 2020
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -385,8 +385,9 @@ is one of
 .Ql i386 ,
 .Ql mac68k ,
 .Ql macppc ,
+.Ql powerpc ,
 or
-.Ql powerpc .
+.Ql efi .
 .It Sy generic-bootimage
 Load a generic boot image into the first 32K of the cd9660 image.
 .It Sy hard-disk-boot
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365846 - head

2020-09-17 Thread Kyle Evans
On Thu, Sep 17, 2020 at 1:47 PM Ed Maste  wrote:
>
> Author: emaste
> Date: Thu Sep 17 18:47:23 2020
> New Revision: 365846
> URL: https://svnweb.freebsd.org/changeset/base/365846
>
> Log:
>   Cirrus-CI: build as an unprivileged user
>
>   The Cirrus-CI-provided working tree is owned by root.  Leave that as is
>   for simplicity but build as an unprivileged user; this tests building
>   with an unmodifiable source tree as a side effect.
>
>   Continue running the smoke test as root for now, as it failed when run
>   as an unprivileged user - pkg reported "Fail to chmod
>   /usr/bin/.pkgtemp.lpq.dUHpEqPGJ9pq:Operation not permitted"
>
>   Sponsored by: The FreeBSD Foundation
>

Is there any way we can sneak a r/o src tree build in here? I've had a
PR open to do this in our Jenkins builds for a couple years, but
without any ability to test it myself I suspect it'll continue
unmerged.

Thanks,

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


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Warner Losh
On Thu, Sep 17, 2020, 11:25 AM Jessica Clarke  wrote:

> > On 17 Sep 2020, at 18:23, Jessica Clarke  wrote:
> >
> >> On 17 Sep 2020, at 18:05, Rodney W. Grimes 
> wrote:
> >>
> >>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso 
> wrote:
> >>>
>  Alex Richardson wrote in
>  <202009171507.08hf7qns080...@repo.freebsd.org>:
>  |Author: arichardson
>  |Date: Thu Sep 17 15:07:25 2020
>  |New Revision: 365836
>  |URL: https://svnweb.freebsd.org/changeset/base/365836
>  |
>  |Log:
>  |  Stop using lorder and ranlib when building libraries
>  |
>  |  Use of ranlib or lorder is no longer necessary with current linkers
>  |  (probably anything newer than ~1990) and ar's ability to create an
>  object
>  |  index and symbol table in the archive.
>  |  Currently the build system uses lorder+tsort to sort the .o files
> in
>  |  dependency order so that a single-pass linker can use them.
> However,
>  |  we can use the -s flag to ar to add an index to the .a file which
> makes
>  |  lorder unnecessary.
>  |  Running ar -s is equivalent to running ranlib afterwards, so we can
>  also
>  |  skip the ranlib invocation.
> 
>  That ranlib thing yes (for long indeed), but i have vague memories
>  that the tsort/lorder ordering was also meant to keep the things
>  which heavily interdepend nearby each other.  (Luckily Linux
>  always had at least tsort available.)
>  This no longer matters for all the platforms FreeBSD supports?
> 
> >>>
> >>> tsort has no notion of how dependent the modules are, just an order
> that
> >>> allows a single pass through the .a file (otherwise you'd need to list
> the
> >>> .a file multiple times on the command line absent ranlib). That's the
> >>> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
> >>> edition unix on a PDP-11, where size was more important than proximity
> to
> >>> locations (modulo overlays, which this doesn't affect at all).
> >>>
> >>> There were some issues of long vs short jumps on earlier architectures
> that
> >>> this helped (since you could only jump 16MB, for example). However,
> there
> >>> were workarounds for this issue on those platforms too. And if you
> have a
> >>> program that this does make a difference, then you can still use
> >>> tsort/lorder. They are still in the system.
> >>>
> >>> I doubt you could measure a difference here today. I doubt, honestly,
> that
> >>> anybody will notice at all.
> >>
> >> The x86 archicture has relative jmps of differning lengths, even in
> long mode
> >> there is support for rel8 and rel32.
> >
> > That's irrelevant though for several reasons:
> >
> > 1. The compiler has already decided on what jump instructions to use
> based on
> >   the requested code model (unless you're on RISC-V and using GNU bfd ld
> as
> >   that supports linker relaxations that actually delete instruction
> bytes).
> >
> > 2. The linker is still free to reorder input sections however it likes,
> it
> >   doesn't have to follow the order of the input files (and the files
> within
> >   any archive).
>
> Hm actually that's only true for archives; it needs to respect the order of
> files on the command line for things like crti.o to work. But regardless,
> the
> other points (and this one, partially) still hold.
>
> > 3. If you care about those kinds of optimisations you should use
> link-time
> >   optimisation which will likely do far more useful things than just
> optimise
> >   branches, but again isn't constrained by the order of the input files,
> it
> >   can lay out the code exactly how it wants.
> >
> > Not to mention that this is just a topological sort, not a clustering
> sort.
>

Yea. I doubt you'd be able to measure a difference on anything in our tree.

Warner

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


svn commit: r365846 - head

2020-09-17 Thread Ed Maste
Author: emaste
Date: Thu Sep 17 18:47:23 2020
New Revision: 365846
URL: https://svnweb.freebsd.org/changeset/base/365846

Log:
  Cirrus-CI: build as an unprivileged user
  
  The Cirrus-CI-provided working tree is owned by root.  Leave that as is
  for simplicity but build as an unprivileged user; this tests building
  with an unmodifiable source tree as a side effect.
  
  Continue running the smoke test as root for now, as it failed when run
  as an unprivileged user - pkg reported "Fail to chmod
  /usr/bin/.pkgtemp.lpq.dUHpEqPGJ9pq:Operation not permitted"
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/.cirrus.yml

Modified: head/.cirrus.yml
==
--- head/.cirrus.ymlThu Sep 17 18:24:51 2020(r365845)
+++ head/.cirrus.ymlThu Sep 17 18:47:23 2020(r365846)
@@ -12,9 +12,13 @@ task:
   timeout_in: 120m
   install_script:
   - pkg install -y qemu-devel uefi-edk2-qemu-x86_64
+  setup_user_script:
+  - pw useradd user
+  - mkdir -p /usr/obj/$(pwd -P)
+  - chown user:user /usr/obj/$(pwd -P)
   script:
-  - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel
+  - su user -c "make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld 
buildkernel"
   package_script:
-  - make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages
+  - su user -c "make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages"
   test_script:
   - sh tools/boot/ci-qemu-test.sh
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365845 - head/lib/libpmc/pmu-events

2020-09-17 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Sep 17 18:24:51 2020
New Revision: 365845
URL: https://svnweb.freebsd.org/changeset/base/365845

Log:
  Fix additional memory leak in process_mapfile
  
  Additional Coverity detected memory leak fix.
  
  Submitted by: bret_ketc...@dell.com
  Reported by:  Coverity
  Reviewed by:  cem, emaste
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D26462

Modified:
  head/lib/libpmc/pmu-events/jevents.c

Modified: head/lib/libpmc/pmu-events/jevents.c
==
--- head/lib/libpmc/pmu-events/jevents.cThu Sep 17 18:06:57 2020
(r365844)
+++ head/lib/libpmc/pmu-events/jevents.cThu Sep 17 18:24:51 2020
(r365845)
@@ -821,6 +821,8 @@ process_mapfile(FILE *outfp, char *fpath)
/* TODO Deal with lines longer than 16K */
pr_info("%s: Mapfile %s: line %d too long, aborting\n",
prog, fpath, line_num);
+   free(line);
+   fclose(mapfp);
return -1;
}
line[strlen(line)-1] = '\0';
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365844 - head/usr.sbin/bhyvectl

2020-09-17 Thread John Baldwin
Author: jhb
Date: Thu Sep 17 18:06:57 2020
New Revision: 365844
URL: https://svnweb.freebsd.org/changeset/base/365844

Log:
  Remove no longer used variable.
  
  Pointy hat to:jhb
  Reported by:  kevans
  MFC after:1 week

Modified:
  head/usr.sbin/bhyvectl/bhyvectl.c

Modified: head/usr.sbin/bhyvectl/bhyvectl.c
==
--- head/usr.sbin/bhyvectl/bhyvectl.c   Thu Sep 17 17:29:33 2020
(r365843)
+++ head/usr.sbin/bhyvectl/bhyvectl.c   Thu Sep 17 18:06:57 2020
(r365844)
@@ -317,7 +317,7 @@ static int get_vmcs_entry_interruption_info;
 static int get_vmcs_interruptibility;
 uint32_t vmcs_entry_interruption_info;
 static int get_vmcs_gpa, get_vmcs_gla;
-static int get_exception_bitmap, exception_bitmap;
+static int get_exception_bitmap;
 static int get_cr0_mask, get_cr0_shadow;
 static int get_cr4_mask, get_cr4_shadow;
 static int get_cr3_targets;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365449 - head/sbin/rcorder

2020-09-17 Thread Olivier Cochard-Labbé
On Tue, Sep 8, 2020 at 12:36 PM Andrey V. Elsukov  wrote:

> Author: ae
> Date: Tue Sep  8 10:36:11 2020
> New Revision: 365449
> URL: https://svnweb.freebsd.org/changeset/base/365449
>
> Log:
>   Add a few features to rcorder:
>
>
>
Hi Andrey,

I've spent some time bisecting an IPSec gateway performance regression on
-head that points to this commit.

So my bench uses a simple static IPSec aes-gcm-16 setup, and their results
vary a lot between those 2 revisions:

   - r365448: Estimated Equilibrium Ethernet throughput= 1413 Mb/s (maximum
   value seen: 1419 Mb/s)
   - r365449: Estimated Equilibrium Ethernet throughput= 469 Mb/s (maximum
   value seen: 469 Mb/s)

How could a modification to the rcoder be the source cause of that ?
My rc.conf contains this:
kld_list="aesni"
ipsec_enable="YES"

So My first thought was that the aesni module wasn't loaded anymore:
Before upgrade:
[root@hp]~# uname -a
FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #15 r365448M: Thu Sep 17
18:17:58 CEST 2020 oliv...@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64
 amd64
[root@hp]~# kldstat
Id Refs AddressSize Name
 1   11 0x8020  1ee58b0 kernel
 21 0x82319000 34c8 fdescfs.ko
 31 0x8231d000 a240 aesni.ko
 41 0x82328000 8c98 ioat.ko
 51 0x82331000 e350 ipsec.ko

Then after upgrade:

[root@hp]~# uname -a
FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #14 r365449M: Thu Sep 17
17:01:35 CEST 2020 oliv...@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64
 amd64
[root@hp]~# kldstat
Id Refs AddressSize Name
 1   11 0x8020  1ee58b0 kernel
 21 0x82319000 34c8 fdescfs.ko
 31 0x8231d000 e350 ipsec.ko
 41 0x8232c000 a240 aesni.ko
 51 0x82337000 8c98 ioat.ko

=> aesni.ko is correctly loaded, so it is not the problem, but notice the
order of the kernel modules that have changed.
Could be this the source of the problem ? Let's try:

[root@hp]~# service ipsec stop
Clearing ipsec manual keys/policies.
[root@hp]~# kld
kldconfig kldload   kldstat   kldunload kldxref
[root@hp]~# kldunload ioat
[root@hp]~# kldunload aesni
[root@hp]~# kldunload ipsec
[root@hp]~# kldload aesni
[root@hp]~# kldload ipsec
[root@hp]~# service ipsec start
Installing ipsec manual keys/policies.
[root@hp]~# kldstat
Id Refs AddressSize Name
 1   11 0x8020  1ee58b0 kernel
 21 0x82319000 34c8 fdescfs.ko
 51 0x82337000 8c98 ioat.ko
 61 0x8231d000 a240 aesni.ko
 71 0x82328000 e350 ipsec.ko

And after that the IPSec bench results are back to their previous value :-)
So rcorder needs to load aesni before ipsec.

Regards,

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


svn commit: r365843 - head/sys/kern

2020-09-17 Thread Warner Losh
Author: imp
Date: Thu Sep 17 17:29:33 2020
New Revision: 365843
URL: https://svnweb.freebsd.org/changeset/base/365843

Log:
  Move to a more robust and conservative alloation scheme for devctl messages
  
  Change the zone setup:
  - Allow slabs to be returned to the OS
  - Set the number of slots to the max devctl will queue before discarding
  - Reserve 2% of the max (capped at 100) for low memory allocations
  - Disable per-cpu caching since we don't need it and we avoid some pathologies
  
  Change the alloation strategiy a bit:
  - If a normal allocation fails, try to get the reserve
  - If a reserve allocation fails, re-use the oldest-queued entry for storage
  - If there's a weird race/failure and nothing on the queue to steal, return 
NULL
  
  This addresses two main issues in the old code:
  - If devd had died, and we're generating a lot of messages, we have an
unbounded leak. This new scheme avoids the issue that lead to this.
  - The MPASS that was 'sure' the allocation couldn't have failed turned out
to be wrong in some rare cases. The new code doesn't make this assumption.
  
  Since we reserve only 2% of the space, we go from about 1MB of
  allocation all the time to more like 50kB for the reserve.
  
  Reviewed by: markj@
  Differential Revision: https://reviews.freebsd.org/D26448

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Sep 17 17:07:04 2020(r365842)
+++ head/sys/kern/subr_bus.cThu Sep 17 17:29:33 2020(r365843)
@@ -426,6 +426,9 @@ static struct cdev *devctl_dev;
 static void
 devinit(void)
 {
+   int reserve;
+   uma_zone_t z;
+
devctl_dev = make_dev_credf(MAKEDEV_ETERNAL, _cdevsw, 0, NULL,
UID_ROOT, GID_WHEEL, 0600, "devctl");
mtx_init(, "dev mtx", "devd", MTX_DEF);
@@ -433,9 +436,21 @@ devinit(void)
STAILQ_INIT();
knlist_init_mtx(_note, );
if (devctl_queue_length > 0) {
-   devsoftc.zone = uma_zcreate("DEVCTL", sizeof(struct 
dev_event_info),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-   uma_prealloc(devsoftc.zone, devctl_queue_length);
+   /*
+* Allocate a zone for the messages. Preallocate 2% of these for
+* a reserve. Allow only devctl_queue_length slabs to cap memory
+* usage.  The reserve usually allows coverage of surges of
+* events during memory shortages. Normally we won't have to
+* re-use events from the queue, but will in extreme shortages.
+*/
+   z = devsoftc.zone = uma_zcreate("DEVCTL",
+   sizeof(struct dev_event_info), NULL, NULL, NULL, NULL,
+   UMA_ALIGN_PTR, 0);
+   reserve = max(devctl_queue_length / 50, 100);   /* 2% reserve */
+   uma_zone_set_max(z, devctl_queue_length);
+   uma_zone_set_maxcache(z, 0);
+   uma_zone_reserve(z, reserve);
+   uma_prealloc(z, reserve);
}
devctl2_init();
 }
@@ -598,15 +613,25 @@ devctl_alloc_dei(void)
mtx_lock();
if (devctl_queue_length == 0)
goto out;
-   if (devctl_queue_length == devsoftc.queued) {
+   dei = uma_zalloc(devsoftc.zone, M_NOWAIT);
+   if (dei == NULL)
+   dei = uma_zalloc(devsoftc.zone, M_NOWAIT | M_USE_RESERVE);
+   if (dei == NULL) {
+   /*
+* Guard against no items in the queue. Normally, this won't
+* happen, but if lots of events happen all at once and there's
+* a chance we're out of allocated space but none have yet been
+* queued when we get here, leaving nothing to steal. This can
+* also happen with error injection. Fail safe by returning
+* NULL in that case..
+*/
+   if (devsoftc.queued == 0)
+   goto out;
dei = STAILQ_FIRST();
STAILQ_REMOVE_HEAD(, dei_link);
devsoftc.queued--;
-   } else {
-   /* dei can't be NULL -- we know we have at least one in the 
zone */
-   dei = uma_zalloc(devsoftc.zone, M_NOWAIT);
-   MPASS(dei != NULL);
}
+   MPASS(dei != NULL);
*dei->dei_data = '\0';
 out:
mtx_unlock();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Jessica Clarke
> On 17 Sep 2020, at 18:23, Jessica Clarke  wrote:
> 
>> On 17 Sep 2020, at 18:05, Rodney W. Grimes  wrote:
>> 
>>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso  wrote:
>>> 
 Alex Richardson wrote in
 <202009171507.08hf7qns080...@repo.freebsd.org>:
 |Author: arichardson
 |Date: Thu Sep 17 15:07:25 2020
 |New Revision: 365836
 |URL: https://svnweb.freebsd.org/changeset/base/365836
 |
 |Log:
 |  Stop using lorder and ranlib when building libraries
 |
 |  Use of ranlib or lorder is no longer necessary with current linkers
 |  (probably anything newer than ~1990) and ar's ability to create an
 object
 |  index and symbol table in the archive.
 |  Currently the build system uses lorder+tsort to sort the .o files in
 |  dependency order so that a single-pass linker can use them. However,
 |  we can use the -s flag to ar to add an index to the .a file which makes
 |  lorder unnecessary.
 |  Running ar -s is equivalent to running ranlib afterwards, so we can
 also
 |  skip the ranlib invocation.
 
 That ranlib thing yes (for long indeed), but i have vague memories
 that the tsort/lorder ordering was also meant to keep the things
 which heavily interdepend nearby each other.  (Luckily Linux
 always had at least tsort available.)
 This no longer matters for all the platforms FreeBSD supports?
 
>>> 
>>> tsort has no notion of how dependent the modules are, just an order that
>>> allows a single pass through the .a file (otherwise you'd need to list the
>>> .a file multiple times on the command line absent ranlib). That's the
>>> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
>>> edition unix on a PDP-11, where size was more important than proximity to
>>> locations (modulo overlays, which this doesn't affect at all).
>>> 
>>> There were some issues of long vs short jumps on earlier architectures that
>>> this helped (since you could only jump 16MB, for example). However, there
>>> were workarounds for this issue on those platforms too. And if you have a
>>> program that this does make a difference, then you can still use
>>> tsort/lorder. They are still in the system.
>>> 
>>> I doubt you could measure a difference here today. I doubt, honestly, that
>>> anybody will notice at all.
>> 
>> The x86 archicture has relative jmps of differning lengths, even in long mode
>> there is support for rel8 and rel32.
> 
> That's irrelevant though for several reasons:
> 
> 1. The compiler has already decided on what jump instructions to use based on
>   the requested code model (unless you're on RISC-V and using GNU bfd ld as
>   that supports linker relaxations that actually delete instruction bytes).
> 
> 2. The linker is still free to reorder input sections however it likes, it
>   doesn't have to follow the order of the input files (and the files within
>   any archive).

Hm actually that's only true for archives; it needs to respect the order of
files on the command line for things like crti.o to work. But regardless, the
other points (and this one, partially) still hold.

> 3. If you care about those kinds of optimisations you should use link-time
>   optimisation which will likely do far more useful things than just optimise
>   branches, but again isn't constrained by the order of the input files, it
>   can lay out the code exactly how it wants.
> 
> Not to mention that this is just a topological sort, not a clustering sort.
> 
> Jess

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


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Jessica Clarke
> On 17 Sep 2020, at 18:05, Rodney W. Grimes  wrote:
> 
>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso  wrote:
>> 
>>> Alex Richardson wrote in
>>> <202009171507.08hf7qns080...@repo.freebsd.org>:
>>> |Author: arichardson
>>> |Date: Thu Sep 17 15:07:25 2020
>>> |New Revision: 365836
>>> |URL: https://svnweb.freebsd.org/changeset/base/365836
>>> |
>>> |Log:
>>> |  Stop using lorder and ranlib when building libraries
>>> |
>>> |  Use of ranlib or lorder is no longer necessary with current linkers
>>> |  (probably anything newer than ~1990) and ar's ability to create an
>>> object
>>> |  index and symbol table in the archive.
>>> |  Currently the build system uses lorder+tsort to sort the .o files in
>>> |  dependency order so that a single-pass linker can use them. However,
>>> |  we can use the -s flag to ar to add an index to the .a file which makes
>>> |  lorder unnecessary.
>>> |  Running ar -s is equivalent to running ranlib afterwards, so we can
>>> also
>>> |  skip the ranlib invocation.
>>> 
>>> That ranlib thing yes (for long indeed), but i have vague memories
>>> that the tsort/lorder ordering was also meant to keep the things
>>> which heavily interdepend nearby each other.  (Luckily Linux
>>> always had at least tsort available.)
>>> This no longer matters for all the platforms FreeBSD supports?
>>> 
>> 
>> tsort has no notion of how dependent the modules are, just an order that
>> allows a single pass through the .a file (otherwise you'd need to list the
>> .a file multiple times on the command line absent ranlib). That's the
>> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
>> edition unix on a PDP-11, where size was more important than proximity to
>> locations (modulo overlays, which this doesn't affect at all).
>> 
>> There were some issues of long vs short jumps on earlier architectures that
>> this helped (since you could only jump 16MB, for example). However, there
>> were workarounds for this issue on those platforms too. And if you have a
>> program that this does make a difference, then you can still use
>> tsort/lorder. They are still in the system.
>> 
>> I doubt you could measure a difference here today. I doubt, honestly, that
>> anybody will notice at all.
> 
> The x86 archicture has relative jmps of differning lengths, even in long mode
> there is support for rel8 and rel32.

That's irrelevant though for several reasons:

1. The compiler has already decided on what jump instructions to use based on
   the requested code model (unless you're on RISC-V and using GNU bfd ld as
   that supports linker relaxations that actually delete instruction bytes).

2. The linker is still free to reorder input sections however it likes, it
   doesn't have to follow the order of the input files (and the files within
   any archive).

3. If you care about those kinds of optimisations you should use link-time
   optimisation which will likely do far more useful things than just optimise
   branches, but again isn't constrained by the order of the input files, it
   can lay out the code exactly how it wants.

Not to mention that this is just a topological sort, not a clustering sort.

Jess

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


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Alexander Richardson
On Thu, 17 Sep 2020 at 18:05, Rodney W. Grimes
 wrote:
>
> > On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso  wrote:
> >
> > > Alex Richardson wrote in
> > >  <202009171507.08hf7qns080...@repo.freebsd.org>:
> > >  |Author: arichardson
> > >  |Date: Thu Sep 17 15:07:25 2020
> > >  |New Revision: 365836
> > >  |URL: https://svnweb.freebsd.org/changeset/base/365836
> > >  |
> > >  |Log:
> > >  |  Stop using lorder and ranlib when building libraries
> > >  |
> > >  |  Use of ranlib or lorder is no longer necessary with current linkers
> > >  |  (probably anything newer than ~1990) and ar's ability to create an
> > > object
> > >  |  index and symbol table in the archive.
> > >  |  Currently the build system uses lorder+tsort to sort the .o files in
> > >  |  dependency order so that a single-pass linker can use them. However,
> > >  |  we can use the -s flag to ar to add an index to the .a file which 
> > > makes
> > >  |  lorder unnecessary.
> > >  |  Running ar -s is equivalent to running ranlib afterwards, so we can
> > > also
> > >  |  skip the ranlib invocation.
> > >
> > > That ranlib thing yes (for long indeed), but i have vague memories
> > > that the tsort/lorder ordering was also meant to keep the things
> > > which heavily interdepend nearby each other.  (Luckily Linux
> > > always had at least tsort available.)
> > > This no longer matters for all the platforms FreeBSD supports?
> > >
> >
> > tsort has no notion of how dependent the modules are, just an order that
> > allows a single pass through the .a file (otherwise you'd need to list the
> > .a file multiple times on the command line absent ranlib). That's the
> > original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
> > edition unix on a PDP-11, where size was more important than proximity to
> > locations (modulo overlays, which this doesn't affect at all).
> >
> > There were some issues of long vs short jumps on earlier architectures that
> > this helped (since you could only jump 16MB, for example). However, there
> > were workarounds for this issue on those platforms too. And if you have a
> > program that this does make a difference, then you can still use
> > tsort/lorder. They are still in the system.
> >
> > I doubt you could measure a difference here today. I doubt, honestly, that
> > anybody will notice at all.
>
> The x86 archicture has relative jmps of differning lengths, even in long mode
> there is support for rel8 and rel32.

However, unless you have linker relaxations (e.g. RISC-V) the compiler
has to emit the large size anyway since the linker won't replace a
32-bit immediate with an 8-bit one since that changes all later
offsets.

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


svn commit: r365842 - head/usr.sbin/bhyvectl

2020-09-17 Thread John Baldwin
Author: jhb
Date: Thu Sep 17 17:07:04 2020
New Revision: 365842
URL: https://svnweb.freebsd.org/changeset/base/365842

Log:
  Remove support for setting some obscure fields.
  
  Don't permit setting the exception bitmap or VMCS entry interrupt
  information.  These are not generally useful to set.  If it is needed
  in the future, dedicated pseudo registers can be added for these that
  would be used with vm_set_register().
  
  Discussed with:   grehan
  MFC after:1 week

Modified:
  head/usr.sbin/bhyvectl/bhyvectl.c

Modified: head/usr.sbin/bhyvectl/bhyvectl.c
==
--- head/usr.sbin/bhyvectl/bhyvectl.c   Thu Sep 17 16:49:28 2020
(r365841)
+++ head/usr.sbin/bhyvectl/bhyvectl.c   Thu Sep 17 17:07:04 2020
(r365842)
@@ -313,11 +313,11 @@ static int get_vmcb_virq, get_avic_table;
  */
 static int get_pinbased_ctls, get_procbased_ctls, get_procbased_ctls2;
 static int get_eptp, get_io_bitmap, get_tsc_offset;
-static int get_vmcs_entry_interruption_info, set_vmcs_entry_interruption_info;
+static int get_vmcs_entry_interruption_info;
 static int get_vmcs_interruptibility;
 uint32_t vmcs_entry_interruption_info;
 static int get_vmcs_gpa, get_vmcs_gla;
-static int get_exception_bitmap, set_exception_bitmap, exception_bitmap;
+static int get_exception_bitmap, exception_bitmap;
 static int get_cr0_mask, get_cr0_shadow;
 static int get_cr4_mask, get_cr4_shadow;
 static int get_cr3_targets;
@@ -542,13 +542,6 @@ vm_get_vmcs_field(struct vmctx *ctx, int vcpu, int fie
 }
 
 static int
-vm_set_vmcs_field(struct vmctx *ctx, int vcpu, int field, uint64_t val)
-{
-
-   return (vm_set_register(ctx, vcpu, VMCS_IDENT(field), val));
-}
-
-static int
 vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
uint64_t *ret_val)
 {
@@ -556,14 +549,6 @@ vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off
return (vm_get_register(ctx, vcpu, VMCB_ACCESS(off, bytes), ret_val));
 }
 
-static int
-vm_set_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
-   uint64_t val)
-{
-   
-   return (vm_set_register(ctx, vcpu, VMCB_ACCESS(off, bytes), val));
-}
-
 enum {
VMNAME = 1000,  /* avoid collision with return values from getopt */
VCPU,
@@ -595,8 +580,6 @@ enum {
SET_TR,
SET_LDTR,
SET_X2APIC_STATE,
-   SET_EXCEPTION_BITMAP,
-   SET_VMCS_ENTRY_INTERRUPTION_INFO,
SET_CAP,
CAPNAME,
UNASSIGN_PPTDEV,
@@ -1379,8 +1362,6 @@ setup_options(bool cpu_intel)
{ "set-tr", REQ_ARG,0,  SET_TR },
{ "set-ldtr",   REQ_ARG,0,  SET_LDTR },
{ "set-x2apic-state",REQ_ARG,   0,  SET_X2APIC_STATE },
-   { "set-exception-bitmap",
-   REQ_ARG,0, SET_EXCEPTION_BITMAP },
{ "capname",REQ_ARG,0,  CAPNAME },
{ "unassign-pptdev", REQ_ARG,   0,  UNASSIGN_PPTDEV },
{ "setcap", REQ_ARG,0,  SET_CAP },
@@ -1514,8 +1495,6 @@ setup_options(bool cpu_intel)
{ "get-vmcs-host-pat",  NO_ARG, _host_pat,  1 },
{ "get-vmcs-host-cr0",
NO_ARG, _host_cr0,  1 },
-   { "set-vmcs-entry-interruption-info",
-   REQ_ARG, 0, SET_VMCS_ENTRY_INTERRUPTION_INFO },
{ "get-vmcs-exit-qualification",
NO_ARG, _vmcs_exit_qualification, 1 },
{ "get-vmcs-exit-inst-length",
@@ -1923,14 +1902,6 @@ main(int argc, char *argv[])
x2apic_state = strtol(optarg, NULL, 0);
set_x2apic_state = 1;
break;
-   case SET_EXCEPTION_BITMAP:
-   exception_bitmap = strtoul(optarg, NULL, 0);
-   set_exception_bitmap = 1;
-   break;
-   case SET_VMCS_ENTRY_INTERRUPTION_INFO:
-   vmcs_entry_interruption_info = strtoul(optarg, NULL, 0);
-   set_vmcs_entry_interruption_info = 1;
-   break;
case SET_CAP:
capval = strtoul(optarg, NULL, 0);
setcap = 1;
@@ -2123,22 +2094,6 @@ main(int argc, char *argv[])
 
if (!error && unassign_pptdev)
error = vm_unassign_pptdev(ctx, bus, slot, func);
-
-   if (!error && set_exception_bitmap) {
-   if (cpu_intel)
-   error = vm_set_vmcs_field(ctx, vcpu,
- VMCS_EXCEPTION_BITMAP,
- exception_bitmap);
-   else
-   error = vm_set_vmcb_field(ctx, vcpu,
- VMCB_OFF_EXC_INTERCEPT,
-

Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Rodney W. Grimes
> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso  wrote:
> 
> > Alex Richardson wrote in
> >  <202009171507.08hf7qns080...@repo.freebsd.org>:
> >  |Author: arichardson
> >  |Date: Thu Sep 17 15:07:25 2020
> >  |New Revision: 365836
> >  |URL: https://svnweb.freebsd.org/changeset/base/365836
> >  |
> >  |Log:
> >  |  Stop using lorder and ranlib when building libraries
> >  |
> >  |  Use of ranlib or lorder is no longer necessary with current linkers
> >  |  (probably anything newer than ~1990) and ar's ability to create an
> > object
> >  |  index and symbol table in the archive.
> >  |  Currently the build system uses lorder+tsort to sort the .o files in
> >  |  dependency order so that a single-pass linker can use them. However,
> >  |  we can use the -s flag to ar to add an index to the .a file which makes
> >  |  lorder unnecessary.
> >  |  Running ar -s is equivalent to running ranlib afterwards, so we can
> > also
> >  |  skip the ranlib invocation.
> >
> > That ranlib thing yes (for long indeed), but i have vague memories
> > that the tsort/lorder ordering was also meant to keep the things
> > which heavily interdepend nearby each other.  (Luckily Linux
> > always had at least tsort available.)
> > This no longer matters for all the platforms FreeBSD supports?
> >
> 
> tsort has no notion of how dependent the modules are, just an order that
> allows a single pass through the .a file (otherwise you'd need to list the
> .a file multiple times on the command line absent ranlib). That's the
> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
> edition unix on a PDP-11, where size was more important than proximity to
> locations (modulo overlays, which this doesn't affect at all).
> 
> There were some issues of long vs short jumps on earlier architectures that
> this helped (since you could only jump 16MB, for example). However, there
> were workarounds for this issue on those platforms too. And if you have a
> program that this does make a difference, then you can still use
> tsort/lorder. They are still in the system.
> 
> I doubt you could measure a difference here today. I doubt, honestly, that
> anybody will notice at all.

The x86 archicture has relative jmps of differning lengths, even in long mode
there is support for rel8 and rel32.

> 
> Warner

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


svn commit: r365841 - head/sys/vm

2020-09-17 Thread Mark Johnston
Author: markj
Date: Thu Sep 17 16:49:28 2020
New Revision: 365841
URL: https://svnweb.freebsd.org/changeset/base/365841

Log:
  Increase the default vm.max_user_wired value.
  
  Since r347532 (merged to stable/12) we only count user-wired pages
  towards the system limit.  However, we now also treat pages wired by
  hypervisors (bhyve and virtualbox) as user-wired, so starting VMs with
  large amounts of RAM tends to fail due to the low limit.
  
  The purpose of the limit is to provide a seatbelt, not to impose some
  policy on the use of wired memory.  Thus, increase the default limit to
  allow reasonable VM configurations to work without tuning.
  
  Reviewed by:  kib
  Discussed with:   dougm
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26424

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cThu Sep 17 16:44:12 2020(r365840)
+++ head/sys/vm/vm_pageout.cThu Sep 17 16:49:28 2020(r365841)
@@ -2295,7 +2295,7 @@ vm_pageout_init_domain(int domain)
 static void
 vm_pageout_init(void)
 {
-   u_int freecount;
+   u_long freecount;
int i;
 
/*
@@ -2328,8 +2328,13 @@ vm_pageout_init(void)
if (vm_pageout_update_period == 0)
vm_pageout_update_period = 600;
 
+   /*
+* Set the maximum number of user-wired virtual pages.  Historically the
+* main source of such pages was mlock(2) and mlockall(2).  Hypervisors
+* may also request user-wired memory.
+*/
if (vm_page_max_user_wired == 0)
-   vm_page_max_user_wired = freecount / 3;
+   vm_page_max_user_wired = 4 * freecount / 5;
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365840 - head/tests/sys/posixshm

2020-09-17 Thread Mark Johnston
Author: markj
Date: Thu Sep 17 16:44:12 2020
New Revision: 365840
URL: https://svnweb.freebsd.org/changeset/base/365840

Log:
  Add some basic regression tests for SHM_LARGEPAGE.
  
  Discussed with:   kib
  Sponsored by: Juniper Networks, Inc.
  Sponsored by: Klara, Inc.
  Differential Revision:https://reviews.freebsd.org/D25900

Modified:
  head/tests/sys/posixshm/posixshm_test.c

Modified: head/tests/sys/posixshm/posixshm_test.c
==
--- head/tests/sys/posixshm/posixshm_test.c Thu Sep 17 16:31:19 2020
(r365839)
+++ head/tests/sys/posixshm/posixshm_test.c Thu Sep 17 16:44:12 2020
(r365840)
@@ -28,10 +28,12 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -956,6 +958,720 @@ ATF_TC_BODY(fallocate, tc)
close(fd);
 }
 
+static int
+shm_open_large(int psind, int policy, size_t sz)
+{
+   int error, fd;
+
+   fd = shm_create_largepage(SHM_ANON, O_CREAT | O_RDWR, psind, policy, 0);
+   if (fd < 0 && errno == ENOTTY)
+   atf_tc_skip("no large page support");
+   ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; errno=%d", 
errno);
+
+   error = ftruncate(fd, sz);
+   if (error != 0 && errno == ENOMEM)
+   /*
+* The test system might not have enough memory to accommodate
+* the request.
+*/
+   atf_tc_skip("failed to allocate %zu-byte superpage", sz);
+   ATF_REQUIRE_MSG(error == 0, "ftruncate failed; errno=%d", errno);
+
+   return (fd);
+}
+
+static int
+pagesizes(size_t ps[MAXPAGESIZES])
+{
+   int pscnt;
+
+   pscnt = getpagesizes(ps, MAXPAGESIZES);
+   ATF_REQUIRE_MSG(pscnt != -1, "getpagesizes failed; errno=%d", errno);
+   ATF_REQUIRE_MSG(ps[0] == PAGE_SIZE, "psind 0 is %zu", ps[0]);
+   ATF_REQUIRE_MSG(pscnt <= MAXPAGESIZES, "invalid pscnt %d", pscnt);
+   if (pscnt == 1)
+   atf_tc_skip("no large page support");
+   return (pscnt);
+}
+
+ATF_TC_WITHOUT_HEAD(largepage_basic);
+ATF_TC_BODY(largepage_basic, tc)
+{
+   char zeroes[PAGE_SIZE];
+   char *addr, *vec;
+   size_t ps[MAXPAGESIZES];
+   int error, fd, pscnt;
+
+   memset(zeroes, 0, PAGE_SIZE);
+
+   pscnt = pagesizes(ps);
+   for (int i = 1; i < pscnt; i++) {
+   fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
+
+   addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
+   0);
+   ATF_REQUIRE_MSG(addr != MAP_FAILED,
+   "mmap(%zu bytes) failed; errno=%d", ps[i], errno);
+   ATF_REQUIRE_MSG(((uintptr_t)addr & (ps[i] - 1)) == 0,
+   "mmap(%zu bytes) returned unaligned mapping; addr=%p",
+   ps[i], addr);
+
+   /* Force a page fault. */
+   *(volatile char *)addr = 0;
+
+   vec = malloc(ps[i] / PAGE_SIZE);
+   ATF_REQUIRE(vec != NULL);
+   error = mincore(addr, ps[i], vec);
+   ATF_REQUIRE_MSG(error == 0, "mincore failed; errno=%d", errno);
+
+   /* Verify that all pages in the run are mapped. */
+   for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) {
+   ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0,
+   "page %zu is not mapped", p);
+   ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0,
+   "page %zu is not in a %zu-byte superpage",
+   p, ps[i]);
+   }
+
+   /* Validate zeroing. */
+   for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) {
+   ATF_REQUIRE_MSG(memcmp(addr + p * PAGE_SIZE, zeroes,
+   PAGE_SIZE) == 0, "page %zu miscompare", p);
+   }
+
+   free(vec);
+   ATF_REQUIRE(munmap(addr, ps[i]) == 0);
+   ATF_REQUIRE(close(fd) == 0);
+   }
+}
+
+extern int __sys_shm_open2(const char *, int, mode_t, int, const char *);
+
+ATF_TC_WITHOUT_HEAD(largepage_config);
+ATF_TC_BODY(largepage_config, tc)
+{
+   struct shm_largepage_conf lpc;
+   char *addr, *buf;
+   size_t ps[MAXPAGESIZES + 1]; /* silence warnings if MAXPAGESIZES == 1 */
+   int error, fd, pscnt;
+
+   pscnt = pagesizes(ps);
+
+   fd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0);
+   ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno);
+
+   /*
+* Configure a large page policy for an object created without
+* SHM_LARGEPAGE.
+*/
+   lpc.psind = 1;
+   lpc.alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT;
+   error = ioctl(fd, FIOSSHMLPGCNF, );
+   ATF_REQUIRE(error != 0);
+   ATF_REQUIRE_MSG(errno == ENOTTY, "ioctl(FIOSSHMLPGCNF) returned %d",
+   errno);
+   

svn commit: r365837 - head

2020-09-17 Thread Kyle Evans
Author: kevans
Date: Thu Sep 17 15:58:42 2020
New Revision: 365837
URL: https://svnweb.freebsd.org/changeset/base/365837

Log:
  Promote the installworld `certctl rehash` to distributeworld
  
  Contrary to my belief, installworld is not sufficient for getting certs
  installed into VM images. Promote the rehash to both installworld and
  distributeworld (notably: not stageworld) and rehash the base distdir so we
  end up with /etc/ssl/certs populated in the base dist archive. A future
  commit will remove the rehash from bsdinstall, which doesn't really need to
  happen if they're installed into base.txz.
  
  While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/
  
  MFC after:1 week

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Sep 17 15:07:25 2020(r365836)
+++ head/Makefile.inc1  Thu Sep 17 15:58:42 2020(r365837)
@@ -926,7 +926,7 @@ METALOG:=   ${METALOG:C,//+,/,g}
 IMAKE+=-DNO_ROOT METALOG=${METALOG}
 METALOG_INSTALLFLAGS=  -U -M ${METALOG} -D ${INSTALL_DDIR}
 INSTALLFLAGS+= ${METALOG_INSTALLFLAGS}
-CERTCLTFLAGS=  ${METALOG_INSTALLFLAGS}
+CERTCTLFLAGS=  ${METALOG_INSTALLFLAGS}
 MTREEFLAGS+=   -W
 .endif
 .if defined(BUILD_PKGS)
@@ -936,6 +936,11 @@ INSTALLFLAGS+= -h sha256
 IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}"
 IMAKE_MTREE=   MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"
 .endif
+.if make(distributeworld)
+CERTCTLDESTDIR=${DESTDIR}/${DISTDIR}/base
+.else
+CERTCTLDESTDIR=${DESTDIR}
+.endif
 
 DESTDIR_MTREEFLAGS=-deU
 # When creating worldtmp we don't need to set the directories as owned by root
@@ -1443,13 +1448,15 @@ distributeworld installworld stageworld: _installcheck
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
 .endfor
 .endif
-.elif make(installworld) && ${MK_CAROOT} != "no"
+.endif # make(distributeworld)
+.if !make(packageworld) && ${MK_CAROOT} != "no"
@if which openssl>/dev/null; then \
-   sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCLTFLAGS} rehash 
\
+   DESTDIR=${CERTCTLDESTDIR} \
+   sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} 
rehash \
else \
echo "No openssl on the host, not rehashing certificates target 
-- /etc/ssl may not be populated."; \
fi
-.endif # make(distributeworld)
+.endif
 
 packageworld: .PHONY
 .for dist in base ${EXTRA_DISTRIBUTIONS}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Warner Losh
On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso  wrote:

> Alex Richardson wrote in
>  <202009171507.08hf7qns080...@repo.freebsd.org>:
>  |Author: arichardson
>  |Date: Thu Sep 17 15:07:25 2020
>  |New Revision: 365836
>  |URL: https://svnweb.freebsd.org/changeset/base/365836
>  |
>  |Log:
>  |  Stop using lorder and ranlib when building libraries
>  |
>  |  Use of ranlib or lorder is no longer necessary with current linkers
>  |  (probably anything newer than ~1990) and ar's ability to create an
> object
>  |  index and symbol table in the archive.
>  |  Currently the build system uses lorder+tsort to sort the .o files in
>  |  dependency order so that a single-pass linker can use them. However,
>  |  we can use the -s flag to ar to add an index to the .a file which makes
>  |  lorder unnecessary.
>  |  Running ar -s is equivalent to running ranlib afterwards, so we can
> also
>  |  skip the ranlib invocation.
>
> That ranlib thing yes (for long indeed), but i have vague memories
> that the tsort/lorder ordering was also meant to keep the things
> which heavily interdepend nearby each other.  (Luckily Linux
> always had at least tsort available.)
> This no longer matters for all the platforms FreeBSD supports?
>

tsort has no notion of how dependent the modules are, just an order that
allows a single pass through the .a file (otherwise you'd need to list the
.a file multiple times on the command line absent ranlib). That's the
original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th
edition unix on a PDP-11, where size was more important than proximity to
locations (modulo overlays, which this doesn't affect at all).

There were some issues of long vs short jumps on earlier architectures that
this helped (since you could only jump 16MB, for example). However, there
were workarounds for this issue on those platforms too. And if you have a
program that this does make a difference, then you can still use
tsort/lorder. They are still in the system.

I doubt you could measure a difference here today. I doubt, honestly, that
anybody will notice at all.

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


Re: svn commit: r365836 - head/share/mk

2020-09-17 Thread Steffen Nurpmeso
Alex Richardson wrote in
 <202009171507.08hf7qns080...@repo.freebsd.org>:
 |Author: arichardson
 |Date: Thu Sep 17 15:07:25 2020
 |New Revision: 365836
 |URL: https://svnweb.freebsd.org/changeset/base/365836
 |
 |Log:
 |  Stop using lorder and ranlib when building libraries
 |  
 |  Use of ranlib or lorder is no longer necessary with current linkers
 |  (probably anything newer than ~1990) and ar's ability to create an object
 |  index and symbol table in the archive.
 |  Currently the build system uses lorder+tsort to sort the .o files in
 |  dependency order so that a single-pass linker can use them. However,
 |  we can use the -s flag to ar to add an index to the .a file which makes
 |  lorder unnecessary.
 |  Running ar -s is equivalent to running ranlib afterwards, so we can also
 |  skip the ranlib invocation.

That ranlib thing yes (for long indeed), but i have vague memories
that the tsort/lorder ordering was also meant to keep the things
which heavily interdepend nearby each other.  (Luckily Linux
always had at least tsort available.)
This no longer matters for all the platforms FreeBSD supports?

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365836 - head/share/mk

2020-09-17 Thread Alex Richardson
Author: arichardson
Date: Thu Sep 17 15:07:25 2020
New Revision: 365836
URL: https://svnweb.freebsd.org/changeset/base/365836

Log:
  Stop using lorder and ranlib when building libraries
  
  Use of ranlib or lorder is no longer necessary with current linkers
  (probably anything newer than ~1990) and ar's ability to create an object
  index and symbol table in the archive.
  Currently the build system uses lorder+tsort to sort the .o files in
  dependency order so that a single-pass linker can use them. However,
  we can use the -s flag to ar to add an index to the .a file which makes
  lorder unnecessary.
  Running ar -s is equivalent to running ranlib afterwards, so we can also
  skip the ranlib invocation.
  
  Similarly, we don't have to pass the .o files for shared libraries in
  dependency order since both ld.bfd and ld.lld will correctly resolve
  references between the .o files.
  
  This removes many fork()+execve calls for each library so should speed up
  builds a bit. Additionally lorder.sh uses a regular expression that is not
  supported by the macOS libc or glibc and results in many warnings when
  cross-building (see D25989).
  
  There is one functional change: lorder.sh removed duplicated .o files
  from the linker command line which now no longer happens. I fixed the 
duplicates
  in the base system in r364649. I also checked the ports tree for uses of
  bsd.lib.mk and found one duplicate source file which I fixed in r548168.
  Most ports use CMake/autotools rather than bsd.lib.mk but if this breaks any
  ports that I missed in my search please let me know.
  
  Avoiding the shell script actually speeds up the linking step noticeably: I
  measured how long it takes to rebuild the .a and .so files for lib/libc using 
a
  basic benchmark: `rm $LIBC_OBJDIR/*.so* $LIBC_OBJDIR/*.a* && /usr/bin/time 
make -DWITHOUT_TESTS -s > /dev/null`
  Without this change ~4.5 seconds and afterwards ~3.1 seconds.
  Looking at truss -cf output we can see that the number fork() system
  calls goes down from 27 to 12 (and the speedup while tracing is more
  noticeable: 81 seconds -> 65 seconds).
  
  See also 
https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html
  for some more background:
  This whole procedure has been obsolete since about 1980, because Unix
  archives now contain a symbol table (traditionally built by ranlib, now
  generally built by ar itself), and the Unix linker uses the symbol table
  to effectively make multiple passes over an archive file.
  
  Or alternatively https://www.unix.com/man-page/osf1/1/lorder/:
  The lorder command is essentially obsolete.  Use the following command in
  its place: % ar -ts file.a
  
  Reviewed By:   emaste, imp, dim
  Differential Revision: https://reviews.freebsd.org/D26044

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/sys.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkThu Sep 17 14:58:30 2020(r365835)
+++ head/share/mk/bsd.lib.mkThu Sep 17 15:07:25 2020(r365836)
@@ -245,9 +245,7 @@ _LIBS=  lib${LIB_PRIVATE}${LIB}.a
 lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
@rm -f ${.TARGET}
-   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
-   ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
-   ${RANLIB} ${RANLIBFLAGS} ${.TARGET}
+   ${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD}
 .endif
 
 .if !defined(INTERNALLIB)
@@ -261,9 +259,7 @@ CLEANFILES+=${POBJS}
 lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
@${ECHO} building profiled ${LIB} library
@rm -f ${.TARGET}
-   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
-   ${LORDER} ${POBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
-   ${RANLIB} ${RANLIBFLAGS} ${.TARGET}
+   ${AR} ${ARFLAGS} ${.TARGET} ${POBJS} ${ARADD}
 .endif
 
 .if defined(LLVM_LINK)
@@ -319,9 +315,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
@${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} 
${SHLIB_LINK}
 .endif
${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-   -o ${.TARGET} -Wl,-soname,${SONAME} \
-   `NM='${NM}' NMFLAGS='${NMFLAGS}' ${LORDER} ${SOBJS} | \
-   ${TSORT} ${TSORTFLAGS}` ${LDADD}
+   -o ${.TARGET} -Wl,-soname,${SONAME} ${SOBJS} ${LDADD}
 .if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
 .endif
@@ -347,7 +341,6 @@ lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
@${ECHO} building special pic ${LIB} library
@rm -f ${.TARGET}
${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
-   ${RANLIB} ${RANLIBFLAGS} ${.TARGET}
 .endif
 
 .if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
@@ -360,7 +353,6 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS}
@${ECHO} building 

svn commit: r365835 - head/sys/modules/dtb/sifive

2020-09-17 Thread Mitchell Horne
Author: mhorne
Date: Thu Sep 17 14:58:30 2020
New Revision: 365835
URL: https://svnweb.freebsd.org/changeset/base/365835

Log:
  Add dtb/sifive module
  
  This allows building the HiFive Unleashed device tree blob.
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D26459

Added:
  head/sys/modules/dtb/sifive/
  head/sys/modules/dtb/sifive/Makefile   (contents, props changed)

Added: head/sys/modules/dtb/sifive/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/dtb/sifive/MakefileThu Sep 17 14:58:30 2020
(r365835)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+DTS=   \
+   sifive/hifive-unleashed-a00.dts
+
+.include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365834 - head/sys/compat/linux

2020-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Sep 17 12:14:24 2020
New Revision: 365834
URL: https://svnweb.freebsd.org/changeset/base/365834

Log:
  Reduce code duplication by introducing linux_copyout_sockaddr()
  helper function.  No functional changes.
  
  Reviewed by:  emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25804

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cThu Sep 17 11:44:45 2020
(r365833)
+++ head/sys/compat/linux/linux_socket.cThu Sep 17 12:14:24 2020
(r365834)
@@ -394,6 +394,22 @@ linux_set_socket_flags(int lflags, int *flags)
 }
 
 static int
+linux_copyout_sockaddr(const struct sockaddr *sa, void *uaddr, size_t len)
+{
+   struct l_sockaddr *lsa;
+   int error;
+
+   error = bsd_to_linux_sockaddr(sa, , len);
+   if (error != 0)
+   return (error);
+   
+   error = copyout(lsa, uaddr, len);
+   free(lsa, M_SONAME);
+
+   return (error);
+}
+
+static int
 linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags,
 struct mbuf *control, enum uio_seg segflg)
 {
@@ -609,7 +625,6 @@ static int
 linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
 l_uintptr_t namelen, int flags)
 {
-   struct l_sockaddr *lsa;
struct sockaddr *sa;
struct file *fp, *fp1;
int bflags, len;
@@ -665,10 +680,7 @@ linux_accept_common(struct thread *td, int s, l_uintpt
}
 
if (len != 0) {
-   error = bsd_to_linux_sockaddr(sa, , len);
-   if (error == 0)
-   error = copyout(lsa, PTRIN(addr), len);
-   free(lsa, M_SONAME);
+   error = linux_copyout_sockaddr(sa, PTRIN(addr), len);
 
/*
 * XXX: We should also copyout the len, shouldn't we?
@@ -704,7 +716,6 @@ linux_accept4(struct thread *td, struct linux_accept4_
 int
 linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
 {
-   struct l_sockaddr *lsa;
struct sockaddr *sa;
int len, error;
 
@@ -716,13 +727,8 @@ linux_getsockname(struct thread *td, struct linux_gets
if (error != 0)
return (error);
 
-   if (len != 0) {
-   error = bsd_to_linux_sockaddr(sa, , len);
-   if (error == 0)
-   error = copyout(lsa, PTRIN(args->addr),
-   len);
-   free(lsa, M_SONAME);
-   }
+   if (len != 0)
+   error = linux_copyout_sockaddr(sa, PTRIN(args->addr), len);
 
free(sa, M_SONAME);
if (error == 0)
@@ -733,7 +739,6 @@ linux_getsockname(struct thread *td, struct linux_gets
 int
 linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
 {
-   struct l_sockaddr *lsa;
struct sockaddr *sa;
int len, error;
 
@@ -747,13 +752,8 @@ linux_getpeername(struct thread *td, struct linux_getp
if (error != 0)
return (error);
 
-   if (len != 0) {
-   error = bsd_to_linux_sockaddr(sa, , len);
-   if (error == 0)
-   error = copyout(lsa, PTRIN(args->addr),
-   len);
-   free(lsa, M_SONAME);
-   }
+   if (len != 0)
+   error = linux_copyout_sockaddr(sa, PTRIN(args->addr), len);
 
free(sa, M_SONAME);
if (error == 0)
@@ -895,7 +895,6 @@ linux_sendto(struct thread *td, struct linux_sendto_ar
 int
 linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
 {
-   struct l_sockaddr *lsa;
struct sockaddr *sa;
struct msghdr msg;
struct iovec aiov;
@@ -927,13 +926,8 @@ linux_recvfrom(struct thread *td, struct linux_recvfro
if (error != 0)
goto out;
 
-   if (PTRIN(args->from) != NULL) {
-   error = bsd_to_linux_sockaddr(sa, , msg.msg_namelen);
-   if (error == 0)
-   error = copyout(lsa, PTRIN(args->from),
-   msg.msg_namelen);
-   free(lsa, M_SONAME);
-   }
+   if (PTRIN(args->from) != NULL)
+   error = linux_copyout_sockaddr(sa, PTRIN(args->from), 
msg.msg_namelen);
 
if (error == 0 && PTRIN(args->fromlen) != NULL)
error = copyout(_namelen, PTRIN(args->fromlen),
@@ -1170,7 +1164,6 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
struct mbuf *control = NULL;
struct mbuf **controlp;
struct timeval *ftmvl;
-   struct l_sockaddr *lsa;
struct sockaddr *sa;
l_timeval ltmvl;
caddr_t outbuf;
@@ -1216,11 +1209,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
 */
if (msg->msg_name != NULL && msg->msg_namelen > 0) {
  

svn commit: r365833 - head/sys/compat/linux

2020-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Sep 17 11:44:45 2020
New Revision: 365833
URL: https://svnweb.freebsd.org/changeset/base/365833

Log:
  Add support for SOUND_MIXER_WRITE_MONITOR ioctl.  Fixes alsamixer(1)
  on my x220.
  
  Reviewed by:  emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25806

Modified:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_ioctl.h

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Thu Sep 17 11:39:33 2020
(r365832)
+++ head/sys/compat/linux/linux_ioctl.c Thu Sep 17 11:44:45 2020
(r365833)
@@ -1794,6 +1794,10 @@ linux_ioctl_sound(struct thread *td, struct linux_ioct
args->cmd = SETDIR(SOUND_MIXER_WRITE_LINE3);
return (sys_ioctl(td, (struct ioctl_args *)args));
 
+   case LINUX_SOUND_MIXER_WRITE_MONITOR:
+   args->cmd = SETDIR(SOUND_MIXER_WRITE_MONITOR);
+   return (sys_ioctl(td, (struct ioctl_args *)args));
+
case LINUX_SOUND_MIXER_INFO: {
/* Key on encoded length */
switch ((args->cmd >> 16) & 0x1fff) {

Modified: head/sys/compat/linux/linux_ioctl.h
==
--- head/sys/compat/linux/linux_ioctl.h Thu Sep 17 11:39:33 2020
(r365832)
+++ head/sys/compat/linux/linux_ioctl.h Thu Sep 17 11:44:45 2020
(r365833)
@@ -278,6 +278,7 @@
 #defineLINUX_SOUND_MIXER_WRITE_LINE1   0x4d0E
 #defineLINUX_SOUND_MIXER_WRITE_LINE2   0x4d0F
 #defineLINUX_SOUND_MIXER_WRITE_LINE3   0x4d10
+#defineLINUX_SOUND_MIXER_WRITE_MONITOR 0x4d18
 #defineLINUX_SOUND_MIXER_INFO  0x4d65
 #defineLINUX_OSS_GETVERSION0x4d76
 #defineLINUX_SOUND_MIXER_READ_STEREODEVS   0x4dfb
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365832 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 compat/linux i386/i386 i386/linux kern mips/mips powerpc/powerpc riscv/riscv sys

2020-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Sep 17 11:39:33 2020
New Revision: 365832
URL: https://svnweb.freebsd.org/changeset/base/365832

Log:
  Get rid of sv_errtbl and SV_ABI_ERRNO().
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26388

Modified:
  head/sys/amd64/amd64/elf_machdep.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/elf_machdep.c
  head/sys/arm64/arm64/elf32_machdep.c
  head/sys/arm64/arm64/elf_machdep.c
  head/sys/arm64/linux/linux_sysvec.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/compat/linux/linux.h
  head/sys/compat/linux/linux_errno.c
  head/sys/compat/linux/linux_socket.c
  head/sys/i386/i386/elf_machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_aout.c
  head/sys/kern/init_main.c
  head/sys/mips/mips/elf_machdep.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/powerpc/powerpc/elf32_machdep.c
  head/sys/powerpc/powerpc/elf64_machdep.c
  head/sys/riscv/riscv/elf_machdep.c
  head/sys/sys/sysent.h

Modified: head/sys/amd64/amd64/elf_machdep.c
==
--- head/sys/amd64/amd64/elf_machdep.c  Thu Sep 17 07:13:41 2020
(r365831)
+++ head/sys/amd64/amd64/elf_machdep.c  Thu Sep 17 11:39:33 2020
(r365832)
@@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$");
 struct sysentvec elf64_freebsd_sysvec_la48 = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = sysent,
-   .sv_errsize = 0,
-   .sv_errtbl  = NULL,
.sv_transtrap   = NULL,
.sv_fixup   = __elfN(freebsd_fixup),
.sv_sendsig = sendsig,
@@ -89,8 +87,6 @@ struct sysentvec elf64_freebsd_sysvec_la48 = {
 struct sysentvec elf64_freebsd_sysvec_la57 = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = sysent,
-   .sv_errsize = 0,
-   .sv_errtbl  = NULL,
.sv_transtrap   = NULL,
.sv_fixup   = __elfN(freebsd_fixup),
.sv_sendsig = sendsig,

Modified: head/sys/amd64/linux/linux_sysvec.c
==
--- head/sys/amd64/linux/linux_sysvec.c Thu Sep 17 07:13:41 2020
(r365831)
+++ head/sys/amd64/linux/linux_sysvec.c Thu Sep 17 11:39:33 2020
(r365832)
@@ -221,7 +221,7 @@ linux_set_syscall_retval(struct thread *td, int error)
 
if (__predict_false(error != 0)) {
if (error != ERESTART && error != EJUSTRETURN)
-   frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error);
+   frame->tf_rax = linux_to_bsd_errno(error);
}
 
 /* Restore all registers. */
@@ -732,8 +732,6 @@ linux_vsyscall(struct thread *td)
 struct sysentvec elf_linux_sysvec = {
.sv_size= LINUX_SYS_MAXSYSCALL,
.sv_table   = linux_sysent,
-   .sv_errsize = ELAST + 1,
-   .sv_errtbl  = linux_errtbl,
.sv_transtrap   = linux_translate_traps,
.sv_fixup   = linux_fixup_elf,
.sv_sendsig = linux_rt_sendsig,

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Thu Sep 17 07:13:41 2020
(r365831)
+++ head/sys/amd64/linux32/linux32_sysvec.c Thu Sep 17 11:39:33 2020
(r365832)
@@ -679,7 +679,7 @@ linux32_set_syscall_retval(struct thread *td, int erro
 
if (__predict_false(error != 0)) {
if (error != ERESTART && error != EJUSTRETURN)
-   frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error);
+   frame->tf_rax = linux_to_bsd_errno(error);
}
 }
 
@@ -898,8 +898,6 @@ linux32_fixlimit(struct rlimit *rl, int which)
 struct sysentvec elf_linux_sysvec = {
.sv_size= LINUX32_SYS_MAXSYSCALL,
.sv_table   = linux32_sysent,
-   .sv_errsize = ELAST + 1,
-   .sv_errtbl  = linux_errtbl,
.sv_transtrap   = linux_translate_traps,
.sv_fixup   = linux_fixup_elf,
.sv_sendsig = linux_sendsig,

Modified: head/sys/arm/arm/elf_machdep.c
==
--- head/sys/arm/arm/elf_machdep.c  Thu Sep 17 07:13:41 2020
(r365831)
+++ head/sys/arm/arm/elf_machdep.c  Thu Sep 17 11:39:33 2020
(r365832)
@@ -65,8 +65,6 @@ u_long elf_hwcap2;
 struct sysentvec elf32_freebsd_sysvec = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = sysent,
-   .sv_errsize = 0,
-   .sv_errtbl  = NULL,
.sv_transtrap   = NULL,
.sv_fixup   = __elfN(freebsd_fixup),
.sv_sendsig = sendsig,

Modified: head/sys/arm64/arm64/elf32_machdep.c
==
--- head/sys/arm64/arm64/elf32_machdep.cThu Sep 17 07:13:41 2020   

svn commit: r365831 - head/contrib/netbsd-tests/fs/tmpfs

2020-09-17 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Sep 17 07:13:41 2020
New Revision: 365831
URL: https://svnweb.freebsd.org/changeset/base/365831

Log:
  Revert r249362, atime update in tmpfs is fixed in r365810
  
  PR:   249362
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/netbsd-tests/fs/tmpfs/t_times.sh

Modified: head/contrib/netbsd-tests/fs/tmpfs/t_times.sh
==
--- head/contrib/netbsd-tests/fs/tmpfs/t_times.sh   Thu Sep 17 04:39:39 
2020(r365830)
+++ head/contrib/netbsd-tests/fs/tmpfs/t_times.sh   Thu Sep 17 07:13:41 
2020(r365831)
@@ -36,10 +36,6 @@ empty_head() {
atf_set "require.user" "root"
 }
 empty_body() {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/249362;
-   fi
-
test_mount
 
atf_check -s eq:0 -o empty -e empty touch a
@@ -72,10 +68,6 @@ non_empty_head() {
atf_set "require.user" "root"
 }
 non_empty_body() {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/249362;
-   fi
-
test_mount
 
echo foo >b || atf_fail "Non-empty creation failed"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"