svn commit: r351068 - head/tests/sys/netpfil/pf

2019-08-15 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Thu Aug 15 12:00:59 2019
New Revision: 351068
URL: https://svnweb.freebsd.org/changeset/base/351068

Log:
  pf tests: Fix accidental duplication of content
  
  Some files got their contented duplicated in r345409. Some mistakes where
  fixed in r345430. The only file that was left with a duplicated content was
  CVE-2019-5598.py.
  
  Reviewed by:  kp
  Approved by:  src (kp)
  Differential Revision:https://reviews.freebsd.org/D21267

Modified:
  head/tests/sys/netpfil/pf/CVE-2019-5598.py

Modified: head/tests/sys/netpfil/pf/CVE-2019-5598.py
==
--- head/tests/sys/netpfil/pf/CVE-2019-5598.py  Thu Aug 15 06:00:55 2019
(r351067)
+++ head/tests/sys/netpfil/pf/CVE-2019-5598.py  Thu Aug 15 12:00:59 2019
(r351068)
@@ -63,68 +63,3 @@ def main():
 
 if __name__ == '__main__':
main()
-#!/usr/local/bin/python2.7
-
-import argparse
-import scapy.all as sp
-import sys
-from sniffer import Sniffer
-
-def check_icmp_error(args, packet):
-   ip = packet.getlayer(sp.IP)
-   if not ip:
-   return False
-   if ip.dst != args.to[0]:
-   return False
-
-   icmp = packet.getlayer(sp.ICMP)
-   if not icmp:
-   return False
-   if icmp.type != 3 or icmp.code != 3:
-   return False
-
-   return True
-
-def main():
-   parser = argparse.ArgumentParser("CVE-2019-icmp.py",
-   description="CVE-2019-icmp test tool")
-   parser.add_argument('--sendif', nargs=1,
-   required=True,
-   help='The interface through which the packet will be sent')
-   parser.add_argument('--recvif', nargs=1,
-   required=True,
-   help='The interface on which to check for the packet')
-   parser.add_argument('--src', nargs=1,
-   required=True,
-   help='The source IP address')
-   parser.add_argument('--to', nargs=1,
-   required=True,
-   help='The destination IP address')
-
-   args = parser.parse_args()
-
-# Send the allowed packet to establish state
-udp = sp.Ether() / \
-sp.IP(src=args.src[0], dst=args.to[0]) / \
-sp.UDP(dport=53, sport=1234)
-sp.sendp(udp, iface=args.sendif[0], verbose=False)
-
-   # Start sniffing on recvif
-   sniffer = Sniffer(args, check_icmp_error)
-
-   # Send the bad error packet
-   icmp_reachable = sp.Ether() / \
-sp.IP(src=args.src[0], dst=args.to[0]) / \
-   sp.ICMP(type=3, code=3) / \
-   sp.IP(src=args.src[0], dst=args.to[0]) / \
-   sp.UDP(dport=53, sport=1234)
-   sp.sendp(icmp_reachable, iface=args.sendif[0], verbose=False)
-
-   sniffer.join()
-   if sniffer.foundCorrectPacket:
-   sys.exit(1)
-
-   sys.exit(0)
-
-if __name__ == '__main__':
-   main()
___
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: r351069 - head/share/mk

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 12:48:17 2019
New Revision: 351069
URL: https://svnweb.freebsd.org/changeset/base/351069

Log:
  do not enable userland retpoline if not supported by compiler/linker
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21101

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

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkThu Aug 15 12:00:59 2019(r351068)
+++ head/share/mk/bsd.lib.mkThu Aug 15 12:48:17 2019(r351069)
@@ -3,6 +3,8 @@
 #
 
 .include 
+.include 
+.include 
 
 .if defined(LIB_CXX) || defined(SHLIB_CXX)
 _LD=   ${CXX}
@@ -74,9 +76,13 @@ TAG_ARGS=-T ${TAGS:[*]:S/ /,/g}
 LDFLAGS+= -Wl,-znow
 .endif
 .if ${MK_RETPOLINE} != "no"
+.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
 CFLAGS+= -mretpoline
 CXXFLAGS+= -mretpoline
 LDFLAGS+= -Wl,-zretpolineplt
+.else
+.warning Retpoline requested but not supported by compiler or linker
+.endif
 .endif
 
 .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Thu Aug 15 12:00:59 2019(r351068)
+++ head/share/mk/bsd.prog.mk   Thu Aug 15 12:48:17 2019(r351069)
@@ -3,6 +3,7 @@
 
 .include 
 .include 
+.include 
 
 .SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm
 
@@ -44,11 +45,15 @@ CXXFLAGS+= -fPIE
 LDFLAGS+= -pie
 .endif
 .if ${MK_RETPOLINE} != "no"
+.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
 CFLAGS+= -mretpoline
 CXXFLAGS+= -mretpoline
 # retpolineplt is broken with static linking (PR 26)
 .if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
 LDFLAGS+= -Wl,-zretpolineplt
+.endif
+.else
+.warning Retpoline requested but not supported by compiler or linker
 .endif
 .endif
 
___
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: r351070 - in head/contrib/telnet: arpa libtelnet telnet telnetd

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 13:27:57 2019
New Revision: 351070
URL: https://svnweb.freebsd.org/changeset/base/351070

Log:
  telnet: remove 3rd clause from Berkeley copyrights
  
  Per the July 22, 1999 letter (in /COPYRIGHT) from
  William Hoskins
  Director, Office of Technology Licensing
  University of California, Berkeley
  
  MFC after:1 week

Modified:
  head/contrib/telnet/arpa/telnet.h
  head/contrib/telnet/libtelnet/auth-proto.h
  head/contrib/telnet/libtelnet/auth.c
  head/contrib/telnet/libtelnet/auth.h
  head/contrib/telnet/libtelnet/enc-proto.h
  head/contrib/telnet/libtelnet/enc_des.c
  head/contrib/telnet/libtelnet/encrypt.c
  head/contrib/telnet/libtelnet/encrypt.h
  head/contrib/telnet/libtelnet/genget.c
  head/contrib/telnet/libtelnet/getent.c
  head/contrib/telnet/libtelnet/kerberos.c
  head/contrib/telnet/libtelnet/kerberos5.c
  head/contrib/telnet/libtelnet/key-proto.h
  head/contrib/telnet/libtelnet/krb4encpwd.c
  head/contrib/telnet/libtelnet/misc-proto.h
  head/contrib/telnet/libtelnet/misc.c
  head/contrib/telnet/libtelnet/misc.h
  head/contrib/telnet/libtelnet/read_password.c
  head/contrib/telnet/libtelnet/rsaencpwd.c
  head/contrib/telnet/telnet/authenc.c
  head/contrib/telnet/telnet/commands.c
  head/contrib/telnet/telnet/defines.h
  head/contrib/telnet/telnet/externs.h
  head/contrib/telnet/telnet/fdset.h
  head/contrib/telnet/telnet/general.h
  head/contrib/telnet/telnet/main.c
  head/contrib/telnet/telnet/network.c
  head/contrib/telnet/telnet/ring.c
  head/contrib/telnet/telnet/ring.h
  head/contrib/telnet/telnet/sys_bsd.c
  head/contrib/telnet/telnet/telnet.1
  head/contrib/telnet/telnet/telnet.c
  head/contrib/telnet/telnet/terminal.c
  head/contrib/telnet/telnet/types.h
  head/contrib/telnet/telnet/utilities.c
  head/contrib/telnet/telnetd/authenc.c
  head/contrib/telnet/telnetd/defs.h
  head/contrib/telnet/telnetd/ext.h
  head/contrib/telnet/telnetd/global.c
  head/contrib/telnet/telnetd/pathnames.h
  head/contrib/telnet/telnetd/slc.c
  head/contrib/telnet/telnetd/state.c
  head/contrib/telnet/telnetd/sys_term.c
  head/contrib/telnet/telnetd/telnetd.8
  head/contrib/telnet/telnetd/telnetd.c
  head/contrib/telnet/telnetd/telnetd.h
  head/contrib/telnet/telnetd/termstat.c
  head/contrib/telnet/telnetd/utility.c

Modified: head/contrib/telnet/arpa/telnet.h
==
--- head/contrib/telnet/arpa/telnet.h   Thu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/arpa/telnet.h   Thu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/contrib/telnet/libtelnet/auth-proto.h
==
--- head/contrib/telnet/libtelnet/auth-proto.h  Thu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/libtelnet/auth-proto.h  Thu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/contrib/telnet/libtelnet/auth.c
==
--- head/contrib/telnet/libtelnet/auth.cThu Aug 15 12:48:17 2019
(r351069)
+++ head/contrib/telnet/libtelnet/auth.cThu Aug 15 13:27:57 2019
(r351070)
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distributio

svn commit: r351071 - head/sys/netpfil/ipfw

2019-08-15 Thread Andrey V. Elsukov
Author: ae
Date: Thu Aug 15 13:44:33 2019
New Revision: 351071
URL: https://svnweb.freebsd.org/changeset/base/351071

Log:
  Fix rule truncation on external action module unloading.
  
  Obtained from:Yandex LLC
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/ip_fw_eaction.c

Modified: head/sys/netpfil/ipfw/ip_fw_eaction.c
==
--- head/sys/netpfil/ipfw/ip_fw_eaction.c   Thu Aug 15 13:27:57 2019
(r351070)
+++ head/sys/netpfil/ipfw/ip_fw_eaction.c   Thu Aug 15 13:44:33 2019
(r351071)
@@ -391,19 +391,19 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f
cmd->arg1 != eaction_id)
return (0);
/*
-* If instance_id is specified, we need to truncate the
-* rule length. Check if there is O_EXTERNAL_INSTANCE opcode.
+* Check if there is O_EXTERNAL_INSTANCE opcode, we need
+* to truncate the rule length.
 *
 * NOTE: F_LEN(cmd) must be 1 for O_EXTERNAL_ACTION opcode,
 *  and rule length should be enough to keep O_EXTERNAL_INSTANCE
 *  opcode, thus we do check for l > 1.
 */
l = rule->cmd + rule->cmd_len - cmd;
-   if (instance_id != 0 && l > 1) {
+   if (l > 1) {
MPASS(F_LEN(cmd) == 1);
icmd = cmd + 1;
-   if (icmd->opcode != O_EXTERNAL_INSTANCE ||
-   icmd->arg1 != instance_id)
+   if (icmd->opcode == O_EXTERNAL_INSTANCE &&
+   instance_id != 0 && icmd->arg1 != instance_id)
return (0);
/*
 * Since named_object related to this instance will be
___
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: r351072 - head/sys/dev/ntb/ntb_hw

2019-08-15 Thread Alexander Motin
Author: mav
Date: Thu Aug 15 14:11:11 2019
New Revision: 351072
URL: https://svnweb.freebsd.org/changeset/base/351072

Log:
  Implement new methods for Intel and PLX NTB.
  
  This restores parity with AMD NTB driver.  Though without any drivers
  supporting more then one peer and respective KPI modification to pass
  peer index to most of the calls this addition is pretty useless now.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c  Thu Aug 15 13:44:33 2019
(r351071)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c  Thu Aug 15 14:11:11 2019
(r351072)
@@ -1978,6 +1978,44 @@ atom_perform_link_restart(struct ntb_softc *ntb)
 }
 
 static int
+intel_ntb_port_number(device_t dev)
+{
+   struct ntb_softc *ntb = device_get_softc(dev);
+
+   return (ntb->dev_type == NTB_DEV_USD ? 0 : 1);
+}
+
+static int
+intel_ntb_peer_port_count(device_t dev)
+{
+
+   return (1);
+}
+
+static int
+intel_ntb_peer_port_number(device_t dev, int pidx)
+{
+   struct ntb_softc *ntb = device_get_softc(dev);
+
+   if (pidx != 0)
+   return (-EINVAL);
+
+   return (ntb->dev_type == NTB_DEV_USD ? 1 : 0);
+}
+
+static int
+intel_ntb_peer_port_idx(device_t dev, int port)
+{
+   int peer_port;
+
+   peer_port = intel_ntb_peer_port_number(dev, 0);
+   if (peer_port == -EINVAL || port != peer_port)
+   return (-EINVAL);
+
+   return (0);
+}
+
+static int
 intel_ntb_link_enable(device_t dev, enum ntb_speed speed __unused,
 enum ntb_width width __unused)
 {
@@ -3087,6 +3125,10 @@ static device_method_t ntb_intel_methods[] = {
DEVMETHOD(bus_child_location_str, ntb_child_location_str),
DEVMETHOD(bus_print_child,  ntb_print_child),
/* NTB interface */
+   DEVMETHOD(ntb_port_number,  intel_ntb_port_number),
+   DEVMETHOD(ntb_peer_port_count,  intel_ntb_peer_port_count),
+   DEVMETHOD(ntb_peer_port_number, intel_ntb_peer_port_number),
+   DEVMETHOD(ntb_peer_port_idx,intel_ntb_peer_port_idx),
DEVMETHOD(ntb_link_is_up,   intel_ntb_link_is_up),
DEVMETHOD(ntb_link_enable,  intel_ntb_link_enable),
DEVMETHOD(ntb_link_disable, intel_ntb_link_disable),

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 15 13:44:33 2019
(r351071)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 15 14:11:11 2019
(r351072)
@@ -470,7 +470,44 @@ ntb_plx_detach(device_t dev)
return (0);
 }
 
+static int
+ntb_plx_port_number(device_t dev)
+{
+   struct ntb_plx_softc *sc = device_get_softc(dev);
 
+   return (sc->link ? 1 : 0);
+}
+
+static int
+ntb_plx_peer_port_count(device_t dev)
+{
+
+   return (1);
+}
+
+static int
+ntb_plx_peer_port_number(device_t dev, int pidx)
+{
+   struct ntb_plx_softc *sc = device_get_softc(dev);
+
+   if (pidx != 0)
+   return (-EINVAL);
+
+   return (sc->link ? 0 : 1);
+}
+
+static int
+ntb_plx_peer_port_idx(device_t dev, int port)
+{
+   int peer_port;
+
+   peer_port = ntb_plx_peer_port_number(dev, 0);
+   if (peer_port == -EINVAL || port != peer_port)
+   return (-EINVAL);
+
+   return (0);
+}
+
 static bool
 ntb_plx_link_is_up(device_t dev, enum ntb_speed *speed, enum ntb_width *width)
 {
@@ -974,6 +1011,10 @@ static device_method_t ntb_plx_methods[] = {
DEVMETHOD(bus_child_location_str, ntb_child_location_str),
DEVMETHOD(bus_print_child,  ntb_print_child),
/* NTB interface */
+   DEVMETHOD(ntb_port_number,  ntb_plx_port_number),
+   DEVMETHOD(ntb_peer_port_count,  ntb_plx_peer_port_count),
+   DEVMETHOD(ntb_peer_port_number, ntb_plx_peer_port_number),
+   DEVMETHOD(ntb_peer_port_idx,ntb_plx_peer_port_idx),
DEVMETHOD(ntb_link_is_up,   ntb_plx_link_is_up),
DEVMETHOD(ntb_link_enable,  ntb_plx_link_enable),
DEVMETHOD(ntb_link_disable, ntb_plx_link_disable),
___
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: r351073 - head/stand/i386/boot2

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 14:54:18 2019
New Revision: 351073
URL: https://svnweb.freebsd.org/changeset/base/351073

Log:
  stand: remove CLANG_NO_IAS from boot2
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
  gained support quite some time ago, and we can now build stand/ with
  IAS.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  boot2, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of boot2 the difference is that IAS produces a larger
  encoding for one instruction (the testb at the beginning of read).
  
  GNU as produces:
  
  2ef6 06 b0 08   80
  
  while IAS includes an address size override prefix (67) and produces:
  
  2e 67 f6 05 b3 08 00 00 80
  
  This results in three fewer NOPs elsewhere in boot2 but no functional
  change, so switch to IAS for boot2.
  
  (We can separately pursue improved 16-bit IAS support with the LLVM
  developers.)
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/stand/i386/boot2/Makefile

Modified: head/stand/i386/boot2/Makefile
==
--- head/stand/i386/boot2/Makefile  Thu Aug 15 14:11:11 2019
(r351072)
+++ head/stand/i386/boot2/Makefile  Thu Aug 15 14:54:18 2019
(r351073)
@@ -91,6 +91,3 @@ boot2.h: boot1.out
REL1=`printf "%d" ${REL1}` > ${.TARGET}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.boot1.S=${CLANG_NO_IAS}
___
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: r351074 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/...

2019-08-15 Thread Andriy Gapon
Author: avg
Date: Thu Aug 15 14:57:27 2019
New Revision: 351074
URL: https://svnweb.freebsd.org/changeset/base/351074

Log:
  MFV r350898: 8423 8199 7432 Implement large_dnode pool feature
  
  8423 8199 7432 Implement large_dnode pool feature
  
  8423 Implement large_dnode pool feature
  8199 multi-threaded dmu_object_alloc()
  7432 Large dnode pool feature
  
  llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0
  
https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0
  https://www.illumos.org/issues/8423
  https://www.illumos.org/issues/8199
  https://www.illumos.org/issues/7432
  
ZoL issues:
Improved dnode allocation #6564
Clean up large dnode code #6262
Fix dnode_hold() freeing dnode behavior #8172
Fix dnode allocation race #6414, #6439
Partial: Raw sends must be able to decrease nlevels #6821, #6864
Remove unnecessary txg syncs from receive_object() Closes #7197
  
  This updates FreeBSD large_dnode code (that was imported from ZoL) to a 
version
  that was committed to illumos.  It has some cleanups, improvements and fixes
  comparing to what we have in FreeBSD now.  I think that the most significant
  update is 8199 multi-threaded dmu_object_alloc().
  
  Obtained from:illumos
  MFC after:3 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
  head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Aug 15 14:54:18 2019
(r351073)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Aug 15 14:57:27 2019
(r351074)
@@ -2134,7 +2134,8 @@ static object_viewer_t *object_viewer[DMU_OT_NUMTYPES 
 };
 
 static void
-dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
+dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header,
+uint64_t *dnode_slots_used)
 {
dmu_buf_t *db = NULL;
dmu_object_info_t doi;
@@ -2154,7 +2155,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi
CTASSERT(sizeof (bonus_size) >= NN_NUMBUF_SZ);
 
if (*print_header) {
-   (void) printf("\n%10s  %3s  %5s  %5s  %5s  %6s %5s  %6s  %s\n",
+   (void) printf("\n%10s  %3s  %5s  %5s  %5s  %6s  %5s  %6s  %s\n",
"Object", "lvl", "iblk", "dblk", "dsize", "dnsize",
"lsize", "%full", "type");
*print_header = 0;
@@ -2173,6 +2174,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi
}
dmu_object_info_from_dnode(dn, &doi);
 
+   if (dnode_slots_used != NULL)
+   *dnode_slots_used = doi.doi_dnodesize / DNODE_MIN_SIZE;
+
zdb_nicenum(doi.doi_metadata_block_size, iblk, sizeof (iblk));
zdb_nicenum(doi.doi_data_block_size, dblk, sizeof (dblk));
zdb_nicenum(doi.doi_max_offset, lsize, sizeof (lsize));
@@ -2195,8 +2199,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi
ZDB_COMPRESS_NAME(doi.doi_compress));
  

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

2019-08-15 Thread Andriy Gapon
Author: avg
Date: Thu Aug 15 15:11:20 2019
New Revision: 351076
URL: https://svnweb.freebsd.org/changeset/base/351076

Log:
  MFV r351075: 10406 large_dnode changes broke zfs recv of legacy stream
  
  illumos/illumos-gate@811964cd9f1fbae0fc3b93d116269e9b1fca090a
  
https://github.com/illumos/illumos-gate/commit/811964cd9f1fbae0fc3b93d116269e9b1fca090a
  
  https://www.illumos.org/issues/10406
The large dnode changes from 8423 caused problems in zfs recv for a legacy
stream. This manifests when attempting to mount the received stream, but the
problem is in the receive code. We missed the following commit from ZoL 
which
fixes this.
commit da2feb42fb5c7a8c1e1cc67f7a880da9d8e97bc2
Author: Tom Caputi 
Date: Thu Jun 28 17:55:11 2018 -0400
Fix 'zfs recv' of non large_dnode send streams
Currently, there is a bug where older send streams without the
DMU_BACKUP_FEATURE_LARGE_DNODE flag are not handled correctly.
The code in receive_object() fails to handle cases where
drro->drr_dn_slots is set to 0, which is always the case when the
sending code does not support this feature flag. This patch fixes
the issue by ensuring that that a value of 0 is treated as
DNODE_MIN_SLOTS.
  
  Author: Tom Caputi 
  
  MFC after:3 weeks
  X-MFC after:  r351074

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.cThu Aug 
15 15:07:17 2019(r351075)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.cThu Aug 
15 15:11:20 2019(r351076)
@@ -275,6 +275,9 @@ dmu_object_reclaim_dnsize(objset_t *os, uint64_t objec
int dn_slots = dnodesize >> DNODE_SHIFT;
int err;
 
+   if (dn_slots == 0)
+   dn_slots = DNODE_MIN_SLOTS;
+
if (object == DMU_META_DNODE_OBJECT)
return (SET_ERROR(EBADF));
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Thu Aug 
15 15:07:17 2019(r351075)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Thu Aug 
15 15:11:20 2019(r351076)
@@ -2153,6 +2153,8 @@ receive_object(struct receive_writer_arg *rwa, struct 
dmu_tx_t *tx;
uint64_t object;
int err;
+   uint8_t dn_slots = drro->drr_dn_slots != 0 ?
+   drro->drr_dn_slots : DNODE_MIN_SLOTS;
 
if (drro->drr_type == DMU_OT_NONE ||
!DMU_OT_IS_VALID(drro->drr_type) ||
@@ -2164,7 +2166,7 @@ receive_object(struct receive_writer_arg *rwa, struct 
drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(rwa->os)) ||
drro->drr_bonuslen >
DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os))) ||
-   drro->drr_dn_slots >
+   dn_slots >
(spa_maxdnodesize(dmu_objset_spa(rwa->os)) >> DNODE_SHIFT)) {
return (SET_ERROR(EINVAL));
}
@@ -2192,7 +2194,7 @@ receive_object(struct receive_writer_arg *rwa, struct 
 
if (drro->drr_blksz != doi.doi_data_block_size ||
nblkptr < doi.doi_nblkptr ||
-   drro->drr_dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) {
+   dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) {
err = dmu_free_long_range(rwa->os, drro->drr_object,
0, DMU_OBJECT_END);
if (err != 0)
@@ -2219,11 +2221,11 @@ receive_object(struct receive_writer_arg *rwa, struct 
 * another object from the previous snapshot. We must free
 * these objects before we attempt to allocate the new dnode.
 */
-   if (drro->drr_dn_slots > 1) {
+   if (dn_slots > 1) {
boolean_t need_sync = B_FALSE;
 
for (uint64_t slot = drro->drr_object + 1;
-   slot < drro->drr_object + drro->drr_dn_slots;
+   slot < drro->drr_object + dn_slots;
slot++) {
dmu_object_info_t slot_doi;
 
@@ -2258,7 +2260,7 @@ receive_object(struct receive_writer_arg *rwa, struct 
err = dmu_object_claim_dnsize(rwa->os, drro->drr_object,
drro->drr_type, drro->drr_blksz,
drro->drr_bonustype, drro->drr_bonuslen,
-   drro->drr_dn_slots << DNODE_SHIFT, tx);
+   dn_slots << DNODE_SHIFT, tx);
} else if (drro->drr_type != doi.doi_type ||
drro->drr_blksz != doi.doi_data_

svn commit: r351077 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/...

2019-08-15 Thread Andriy Gapon
Author: avg
Date: Thu Aug 15 15:27:58 2019
New Revision: 351077
URL: https://svnweb.freebsd.org/changeset/base/351077

Log:
  Revert r351076 and r351074 because of atomic_swap_64 on 32-bit platforms
  
  Trying to sort it out.

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
  head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Aug 15 15:11:20 2019
(r351076)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Aug 15 15:27:58 2019
(r351077)
@@ -2134,8 +2134,7 @@ static object_viewer_t *object_viewer[DMU_OT_NUMTYPES 
 };
 
 static void
-dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header,
-uint64_t *dnode_slots_used)
+dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
 {
dmu_buf_t *db = NULL;
dmu_object_info_t doi;
@@ -2155,7 +2154,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi
CTASSERT(sizeof (bonus_size) >= NN_NUMBUF_SZ);
 
if (*print_header) {
-   (void) printf("\n%10s  %3s  %5s  %5s  %5s  %6s  %5s  %6s  %s\n",
+   (void) printf("\n%10s  %3s  %5s  %5s  %5s  %6s %5s  %6s  %s\n",
"Object", "lvl", "iblk", "dblk", "dsize", "dnsize",
"lsize", "%full", "type");
*print_header = 0;
@@ -2174,9 +2173,6 @@ dump_object(objset_t *os, uint64_t object, int verbosi
}
dmu_object_info_from_dnode(dn, &doi);
 
-   if (dnode_slots_used != NULL)
-   *dnode_slots_used = doi.doi_dnodesize / DNODE_MIN_SIZE;
-
zdb_nicenum(doi.doi_metadata_block_size, iblk, sizeof (iblk));
zdb_nicenum(doi.doi_data_block_size, dblk, sizeof (dblk));
zdb_nicenum(doi.doi_max_offset, lsize, sizeof (lsize));
@@ -2199,9 +2195,8 @@ dump_object(objset_t *os, uint64_t object, int verbosi
ZDB_COMPRESS_NAME(doi.doi_compress));
}
 
-   (void) printf("%10" PRIu64
-   "  %3u  %5s  %5s  %5s  %5s  %5s  %6s  %s%s\n",
-   object, doi.doi_indirection, iblk, dblk,
+   (void) printf("%10lld  %3u  %5s  %5s  %5s  %6s  %5s  %6s  %s%s\n",
+   (u_longlong_t)object, doi.doi_indirection, iblk, dblk,
asize, dnsize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux);
 
if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) {
@@ -2310,9 +2305,6 @@ dump_dir(objset_t *os)
int print_header = 1;
unsigned i;
int error;
-   uint64_t total_slots_used = 0;
-   uint64_t max_slot_used = 0;
-   uint64_t dnode_slots;
 
/* make sure nicenum has enough space */
CTASSERT(sizeof (numbuf) >= NN_NUMBUF_SZ);
@@ -2357,7 +2349,7 @@ dump_dir(objset_t *os)
if (zopt_objects != 0) {
for (i = 0; i < zopt_objects; i++)
dump_object(os, zopt_object[i], verbosity,
-   &print_header, NULL);
+   &print_header);
(void) printf("

svn commit: r351078 - in head: lib/libc/quad stand/libsa

2019-08-15 Thread Kyle Evans
Author: kevans
Date: Thu Aug 15 15:47:48 2019
New Revision: 351078
URL: https://svnweb.freebsd.org/changeset/base/351078

Log:
  stand: kick out quad.h
  
  Use quad.h from libc instead for the time being. This reduces the number of
  nearly-identical-quad.h we have in tree to two with only minor changes.
  
  Prototypes for some *sh*di3 have been added to match the copy in libkern.
  The differences between the two are likely few enough that they can perhaps
  be merged with little additional effort to bring us down to 1.
  
  MFC after:3 days

Deleted:
  head/stand/libsa/quad.h
Modified:
  head/lib/libc/quad/quad.h
  head/stand/libsa/Makefile

Modified: head/lib/libc/quad/quad.h
==
--- head/lib/libc/quad/quad.h   Thu Aug 15 15:27:58 2019(r351077)
+++ head/lib/libc/quad/quad.h   Thu Aug 15 15:47:48 2019(r351078)
@@ -55,6 +55,11 @@
 #include 
 #include 
 
+#ifdef _STANDALONE
+_Static_assert(sizeof(quad_t) == sizeof(int) * 2,
+   "Bitwise function in libstand are broken on this architecture\n");
+#endif
+
 /*
  * Depending on the desired operation, we view a `long long' (aka quad_t) in
  * one or more of the following formats.
@@ -79,7 +84,14 @@ union uu {
  */
 #defineQUAD_BITS   (sizeof(quad_t) * CHAR_BIT)
 #defineLONG_BITS   (sizeof(long) * CHAR_BIT)
+#ifdef _STANDALONE
+/*
+ * libsa assumes sizeof(int) for qdivrem
+ */
+#defineHALF_BITS   (sizeof(int) * CHAR_BIT / 2)
+#else
 #defineHALF_BITS   (sizeof(long) * CHAR_BIT / 2)
+#endif
 
 /*
  * Extract high and low shortwords from longword, and move low shortword of
@@ -103,3 +115,7 @@ u_quad_t__udivdi3(u_quad_t a, u_quad_t b);
 u_quad_t   __umoddi3(u_quad_t a, u_quad_t b);
 
 typedef unsigned int   qshift_t;
+
+quad_t __ashldi3(quad_t, qshift_t);
+quad_t __ashrdi3(quad_t, qshift_t);
+quad_t __lshrdi3(quad_t, qshift_t);

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Thu Aug 15 15:27:58 2019(r351077)
+++ head/stand/libsa/Makefile   Thu Aug 15 15:47:48 2019(r351078)
@@ -121,6 +121,7 @@ beforedepend:
ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \
ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
+   ln -sf ${LIBC_SRC}/quad/quad.h quad.h; \
for i in _time.h _strings.h _string.h; do \
[ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
done; \
___
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: r351079 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 15:49:01 2019
New Revision: 351079
URL: https://svnweb.freebsd.org/changeset/base/351079

Log:
  ping6: quiet warning about unused copyright variable
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21270

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 15:47:48 2019(r351078)
+++ head/sbin/ping6/ping6.c Thu Aug 15 15:49:01 2019(r351079)
@@ -65,6 +65,7 @@
  * SUCH DAMAGE.
  */
 
+#if 0
 #ifndef lint
 static const char copyright[] =
 "@(#) Copyright (c) 1989, 1993\n\
@@ -72,10 +73,9 @@ static const char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
-#if 0
 static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
-#endif
 #endif /* not lint */
+#endif
 
 #include 
 __FBSDID("$FreeBSD$");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r351080 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 15:55:01 2019
New Revision: 351080
URL: https://svnweb.freebsd.org/changeset/base/351080

Log:
  ping6: quiet an undefined variable warning
  
  GCC 4.2 isn't smart enough to know that this variable is already defined by
  the time it's used.
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21269

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 15:49:01 2019(r351079)
+++ head/sbin/ping6/ping6.c Thu Aug 15 15:55:01 2019(r351080)
@@ -2082,7 +2082,7 @@ pr_nodeaddr(struct icmp6_nodeinfo *ni, int nilen)
if (nilen % (sizeof(u_int32_t) + sizeof(struct in6_addr)) == 0)
withttl = 1;
while (nilen > 0) {
-   u_int32_t ttl;
+   u_int32_t ttl = 0;
 
if (withttl) {
/* XXX: alignment? */
___
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: r351081 - head/sys/contrib/dev/acpica/include/platform

2019-08-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Aug 15 16:04:22 2019
New Revision: 351081
URL: https://svnweb.freebsd.org/changeset/base/351081

Log:
  Enable ACPICA mutex debugging in INVARIANTS case.
  
  This lets us detect lock order reversal in ACPICA code to avoid deadlock.

Modified:
  head/sys/contrib/dev/acpica/include/platform/acfreebsd.h

Modified: head/sys/contrib/dev/acpica/include/platform/acfreebsd.h
==
--- head/sys/contrib/dev/acpica/include/platform/acfreebsd.hThu Aug 15 
15:55:01 2019(r351080)
+++ head/sys/contrib/dev/acpica/include/platform/acfreebsd.hThu Aug 15 
16:04:22 2019(r351081)
@@ -203,6 +203,10 @@
 
 #define DEBUGGER_THREADING  0   /* integrated with DDB */
 
+#ifdef INVARIANTS
+#define ACPI_MUTEX_DEBUG
+#endif
+
 #else /* _KERNEL */
 
 #if __STDC_HOSTED__
___
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: r351082 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 16:09:27 2019
New Revision: 351082
URL: https://svnweb.freebsd.org/changeset/base/351082

Log:
  ping6: fix uninitialized variable warning for intvl
  
  GCC isn't smart enough to realize that this variable was always initialized.
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21271

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 16:04:22 2019(r351081)
+++ head/sbin/ping6/ping6.c Thu Aug 15 16:09:27 2019(r351082)
@@ -333,6 +333,9 @@ main(int argc, char *argv[])
memset(&smsghdr, 0, sizeof(smsghdr));
memset(&smsgiov, 0, sizeof(smsgiov));
 
+   intvl.tv_sec = interval / 1000;
+   intvl.tv_nsec = interval % 1000 * 100;
+
alarmtimeout = preload = 0;
datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN];
capdns = capdns_setup();
@@ -1121,9 +1124,6 @@ main(int argc, char *argv[])
if (options & F_FLOOD) {
intvl.tv_sec = 0;
intvl.tv_nsec = 1000;
-   } else if ((options & F_INTERVAL) == 0) {
-   intvl.tv_sec = interval / 1000;
-   intvl.tv_nsec = interval % 1000 * 100;
}
 
almost_done = 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: r351083 - head/sys/dev/ntb/ntb_hw

2019-08-15 Thread Alexander Motin
Author: mav
Date: Thu Aug 15 16:22:15 2019
New Revision: 351083
URL: https://svnweb.freebsd.org/changeset/base/351083

Log:
  Fix i386 LINT build after r351056.
  
  MFC after:13 days

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_amd.cThu Aug 15 16:09:27 2019
(r351082)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_amd.cThu Aug 15 16:22:15 2019
(r351083)
@@ -385,14 +385,14 @@ amd_ntb_mw_set_trans(device_t dev, unsigned mw_idx, bu
 
/* Make sure the range fits in the usable mw size. */
if (size > bar_info->size) {
-   amd_ntb_printf(0, "%s: size 0x%x greater than mw_size 0x%x\n",
-   __func__, (uint32_t)size, (uint32_t)bar_info->size);
+   amd_ntb_printf(0, "%s: size 0x%jx greater than mw_size 0x%jx\n",
+   __func__, (uintmax_t)size, (uintmax_t)bar_info->size);
return (EINVAL);
}
 
-   amd_ntb_printf(1, "%s: mw %d mw_size 0x%x size 0x%x base %p\n",
-   __func__, mw_idx, (uint32_t)bar_info->size,
-   (uint32_t)size, (void *)bar_info->pci_bus_handle);
+   amd_ntb_printf(1, "%s: mw %d mw_size 0x%jx size 0x%jx base %p\n",
+   __func__, mw_idx, (uintmax_t)bar_info->size,
+   (uintmax_t)size, (void *)bar_info->pci_bus_handle);
 
/*
 * AMD NTB XLAT and Limit registers needs to be written only after
@@ -413,17 +413,17 @@ amd_ntb_mw_set_trans(device_t dev, unsigned mw_idx, bu
 * cases all use 64-bit bar.
 */
if ((mw_idx == 0) && (ntb->hw_info->quirks & QUIRK_MW0_32BIT)) {
-   amd_ntb_reg_write(4, bar_info->limit_off, (uint64_t)size);
+   amd_ntb_reg_write(4, bar_info->limit_off, (uint32_t)size);
amd_ntb_printf(1, "%s: limit_off 0x%x cur_val 0x%x limit 
0x%x\n",
__func__, bar_info->limit_off,
amd_ntb_peer_reg_read(4, bar_info->limit_off),
(uint32_t)size);
} else {
amd_ntb_reg_write(8, bar_info->limit_off, (uint64_t)size);
-   amd_ntb_printf(1, "%s: limit_off 0x%x cur_val 0x%lx limit 
0x%x\n",
+   amd_ntb_printf(1, "%s: limit_off 0x%x cur_val 0x%jx limit 
0x%jx\n",
__func__, bar_info->limit_off,
amd_ntb_peer_reg_read(8, bar_info->limit_off),
-   (uint32_t)size);
+   (uintmax_t)size);
}
 
return (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: r351084 - in head: share/man/man4 sys/modules

2019-08-15 Thread Alexander Motin
Author: mav
Date: Thu Aug 15 16:27:04 2019
New Revision: 351084
URL: https://svnweb.freebsd.org/changeset/base/351084

Log:
  Add NTB modules to i386 build.
  
  There is no reason why NTB should not be usable on i386 if memory windows
  are small enough.

Modified:
  head/share/man/man4/Makefile
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Aug 15 16:22:15 2019
(r351083)
+++ head/share/man/man4/MakefileThu Aug 15 16:27:04 2019
(r351084)
@@ -790,6 +790,11 @@ _nda.4=nda.4
 _ndis.4=   ndis.4
 _nfe.4=nfe.4
 _nfsmb.4=  nfsmb.4
+_if_ntb.4= if_ntb.4
+_ntb.4=ntb.4
+_ntb_hw_intel.4=   ntb_hw_intel.4
+_ntb_hw_plx.4= ntb_hw_plx.4
+_ntb_transport.4=ntb_transport.4
 _nvd.4=nvd.4
 _nvme.4=   nvme.4
 _nvram.4=  nvram.4
@@ -817,12 +822,7 @@ _xnb.4=xnb.4
 .endif
 
 .if ${MACHINE_CPUARCH} == "amd64"
-_if_ntb.4= if_ntb.4
 _ioat.4=   ioat.4
-_ntb.4=ntb.4
-_ntb_hw_intel.4=   ntb_hw_intel.4
-_ntb_hw_plx.4= ntb_hw_plx.4
-_ntb_transport.4=ntb_transport.4
 _qlxge.4=  qlxge.4
 _qlxgb.4=  qlxgb.4
 _qlxgbe.4= qlxgbe.4

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Aug 15 16:22:15 2019(r351083)
+++ head/sys/modules/Makefile   Thu Aug 15 16:27:04 2019(r351084)
@@ -594,6 +594,7 @@ _lio=   lio
 .endif
 _nctgpio=  nctgpio
 _ndis= ndis
+_ntb=  ntb
 _ocs_fc=   ocs_fc
 _pccard=   pccard
 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
@@ -691,7 +692,6 @@ _ioat=  ioat
 _ixl=  ixl
 _linux64=  linux64
 _linux_common= linux_common
-_ntb=  ntb
 _nvdimm=   nvdimm
 _pms=  pms
 _qlxge=qlxge
___
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: r351085 - head/lib/libc/quad

2019-08-15 Thread Kyle Evans
Author: kevans
Date: Thu Aug 15 16:28:05 2019
New Revision: 351085
URL: https://svnweb.freebsd.org/changeset/base/351085

Log:
  libc quad.h: one last _STANDALONE correction

Modified:
  head/lib/libc/quad/quad.h

Modified: head/lib/libc/quad/quad.h
==
--- head/lib/libc/quad/quad.h   Thu Aug 15 16:27:04 2019(r351084)
+++ head/lib/libc/quad/quad.h   Thu Aug 15 16:28:05 2019(r351085)
@@ -67,8 +67,13 @@ _Static_assert(sizeof(quad_t) == sizeof(int) * 2,
 union uu {
quad_t  q;  /* as a (signed) quad */
quad_t  uq; /* as an unsigned quad */
+#ifdef _STANDALONE
+   int sl[2];  /* as two signed longs */
+   u_int   ul[2];  /* as two unsigned longs */
+#else
longsl[2];  /* as two signed longs */
u_long  ul[2];  /* as two unsigned longs */
+#endif
 };
 
 /*
___
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: r351086 - head/sbin/ifconfig

2019-08-15 Thread John-Mark Gurney
Author: jmg
Date: Thu Aug 15 16:58:00 2019
New Revision: 351086
URL: https://svnweb.freebsd.org/changeset/base/351086

Log:
  finish the pcp feature, but documenting it in the man page...

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Thu Aug 15 16:28:05 2019
(r351085)
+++ head/sbin/ifconfig/ifconfig.8   Thu Aug 15 16:58:00 2019
(r351086)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd June 28, 2019
+.Dd August 15, 2019
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -705,6 +705,13 @@ No packets are transmitted, and received packets are d
 processing.
 .It Fl monitor
 Take the interface out of monitor mode.
+.It Cm pcp Ar priority_code_point
+Priority code point
+.Pq Dv PCP
+is an 3-bit field which refers to the IEEE 802.1p
+class of service and maps to the frame priority level.
+.It Fl pcp
+Stop tagging packets on the interface w/ the priority code point.
 .It Cm up
 Mark an interface
 .Dq up .
___
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: r351087 - head/usr.sbin/config

2019-08-15 Thread Warner Losh
Author: imp
Date: Thu Aug 15 17:06:53 2019
New Revision: 351087
URL: https://svnweb.freebsd.org/changeset/base/351087

Log:
  Sort getopt(3) options and case statements per style(9)
  
  Alphebetize the options and cases without regard for case.

Modified:
  head/usr.sbin/config/main.c

Modified: head/usr.sbin/config/main.c
==
--- head/usr.sbin/config/main.c Thu Aug 15 16:58:00 2019(r351086)
+++ head/usr.sbin/config/main.c Thu Aug 15 17:06:53 2019(r351087)
@@ -120,11 +120,20 @@ main(int argc, char **argv)
printmachine = 0;
kernfile = NULL;
SLIST_INIT(&includepath);
-   while ((ch = getopt(argc, argv, "CI:d:gmps:Vx:")) != -1)
+   while ((ch = getopt(argc, argv, "Cd:gI:mps:Vx:")) != -1)
switch (ch) {
case 'C':
filebased = 1;
break;
+   case 'd':
+   if (*destdir == '\0')
+   strlcpy(destdir, optarg, sizeof(destdir));
+   else
+   errx(EXIT_FAILURE, "directory already set");
+   break;
+   case 'g':
+   debugging++;
+   break;
case 'I':
ipath = (struct includepath *) \
calloc(1, sizeof (struct includepath));
@@ -135,15 +144,6 @@ main(int argc, char **argv)
break;
case 'm':
printmachine = 1;
-   break;
-   case 'd':
-   if (*destdir == '\0')
-   strlcpy(destdir, optarg, sizeof(destdir));
-   else
-   errx(EXIT_FAILURE, "directory already set");
-   break;
-   case 'g':
-   debugging++;
break;
case 'p':
profiling++;
___
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: r351088 - in head: lib/libc/quad stand/libsa

2019-08-15 Thread Kyle Evans
Author: kevans
Date: Thu Aug 15 17:15:32 2019
New Revision: 351088
URL: https://svnweb.freebsd.org/changeset/base/351088

Log:
  Revert r351078, r351085: stand/quad.h eviction
  
  It did not go well; further examination is required...

Added:
  head/stand/libsa/quad.h
 - copied unchanged from r351077, head/stand/libsa/quad.h
Modified:
  head/lib/libc/quad/quad.h
  head/stand/libsa/Makefile

Modified: head/lib/libc/quad/quad.h
==
--- head/lib/libc/quad/quad.h   Thu Aug 15 17:06:53 2019(r351087)
+++ head/lib/libc/quad/quad.h   Thu Aug 15 17:15:32 2019(r351088)
@@ -55,11 +55,6 @@
 #include 
 #include 
 
-#ifdef _STANDALONE
-_Static_assert(sizeof(quad_t) == sizeof(int) * 2,
-   "Bitwise function in libstand are broken on this architecture\n");
-#endif
-
 /*
  * Depending on the desired operation, we view a `long long' (aka quad_t) in
  * one or more of the following formats.
@@ -67,13 +62,8 @@ _Static_assert(sizeof(quad_t) == sizeof(int) * 2,
 union uu {
quad_t  q;  /* as a (signed) quad */
quad_t  uq; /* as an unsigned quad */
-#ifdef _STANDALONE
-   int sl[2];  /* as two signed longs */
-   u_int   ul[2];  /* as two unsigned longs */
-#else
longsl[2];  /* as two signed longs */
u_long  ul[2];  /* as two unsigned longs */
-#endif
 };
 
 /*
@@ -89,14 +79,7 @@ union uu {
  */
 #defineQUAD_BITS   (sizeof(quad_t) * CHAR_BIT)
 #defineLONG_BITS   (sizeof(long) * CHAR_BIT)
-#ifdef _STANDALONE
-/*
- * libsa assumes sizeof(int) for qdivrem
- */
-#defineHALF_BITS   (sizeof(int) * CHAR_BIT / 2)
-#else
 #defineHALF_BITS   (sizeof(long) * CHAR_BIT / 2)
-#endif
 
 /*
  * Extract high and low shortwords from longword, and move low shortword of
@@ -120,7 +103,3 @@ u_quad_t__udivdi3(u_quad_t a, u_quad_t b);
 u_quad_t   __umoddi3(u_quad_t a, u_quad_t b);
 
 typedef unsigned int   qshift_t;
-
-quad_t __ashldi3(quad_t, qshift_t);
-quad_t __ashrdi3(quad_t, qshift_t);
-quad_t __lshrdi3(quad_t, qshift_t);

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Thu Aug 15 17:06:53 2019(r351087)
+++ head/stand/libsa/Makefile   Thu Aug 15 17:15:32 2019(r351088)
@@ -121,7 +121,6 @@ beforedepend:
ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \
ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \
ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \
-   ln -sf ${LIBC_SRC}/quad/quad.h quad.h; \
for i in _time.h _strings.h _string.h; do \
[ -f xlocale/$$i ] || cp /dev/null xlocale/$$i; \
done; \

Copied: head/stand/libsa/quad.h (from r351077, head/stand/libsa/quad.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/libsa/quad.h Thu Aug 15 17:15:32 2019(r351088, copy 
of r351077, head/stand/libsa/quad.h)
@@ -0,0 +1,114 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California.  All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAM

svn commit: r351089 - head/usr.sbin/config

2019-08-15 Thread Warner Losh
Author: imp
Date: Thu Aug 15 17:21:38 2019
New Revision: 351089
URL: https://svnweb.freebsd.org/changeset/base/351089

Log:
  Catch mkheaders.c up to the removal of counted device support in 2005.
  
  mkheaders.c hasn't made headers in ~15 years. Belatedly update the comments to
  reflect that all it does these days is warn about 'device foo' lines in the
  config where we don't know what a 'foo' is.
  
  Remove extra includes too. These also haven't been needed for 15 years and
  weren't removed at the time the comment wasn't updated...

Modified:
  head/usr.sbin/config/mkheaders.c

Modified: head/usr.sbin/config/mkheaders.c
==
--- head/usr.sbin/config/mkheaders.cThu Aug 15 17:15:32 2019
(r351088)
+++ head/usr.sbin/config/mkheaders.cThu Aug 15 17:21:38 2019
(r351089)
@@ -38,14 +38,14 @@ static const char rcsid[] =
 #endif /* not lint */
 
 /*
- * Make all the .h files for the optional entries
+ * This used to generate a bunch of hearders files related to devices when
+ * device counters were supported. Support for that was removed in 2005.
+ * Since then, all we've done is to report unknown devices in this file.
+ * It's kept its historical name, despite no longer generating headers.
  */
 
-#include 
 #include 
 #include 
-#include 
-#include 
 #include "config.h"
 #include "y.tab.h"
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r351090 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 17:24:10 2019
New Revision: 351090
URL: https://svnweb.freebsd.org/changeset/base/351090

Log:
  ping6: Fix data type of the buffer for ancillary data of a received message
  
  The old code worked, but wasted some stack space.
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21275

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 17:21:38 2019(r351089)
+++ head/sbin/ping6/ping6.c Thu Aug 15 17:24:10 2019(r351090)
@@ -307,7 +307,7 @@ main(int argc, char *argv[])
int ip6optlen = 0;
struct cmsghdr *scmsgp = NULL;
/* For control (ancillary) data received from recvmsg() */
-   struct cmsghdr cm[CONTROLLEN];
+   u_char cm[CONTROLLEN];
 #if defined(SO_SNDBUF) && defined(SO_RCVBUF)
u_long lsockbufsize;
int sockbufsize = 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: r351092 - head/stand/i386/cdboot

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 17:32:39 2019
New Revision: 351092
URL: https://svnweb.freebsd.org/changeset/base/351092

Log:
  stand: remove CLANG_NO_IAS from cdboot
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
  gained support quite some time ago, and we can now build stand/ with
  IAS.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  cdboot, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of cdboot the difference is that IAS adds a size override
  prefix (67h) to many instructions to specify a 32-bit address, even
  though the two high bytes are zero.  This wastes three bytes per
  instance, but as cdboot is not size-constrained it doesn't matter.
  Padding is also different in one case; Clang used two one-byte nops
  while GNU as used a single two-byte xchg %eax, %eax.  In any case, there
  is no functional change.
  
  Sponsored by:   The FreeBSD Foundation

Modified:
  head/stand/i386/cdboot/Makefile

Modified: head/stand/i386/cdboot/Makefile
==
--- head/stand/i386/cdboot/Makefile Thu Aug 15 17:31:11 2019
(r351091)
+++ head/stand/i386/cdboot/Makefile Thu Aug 15 17:32:39 2019
(r351092)
@@ -14,6 +14,3 @@ ORG=  0x7c00
 LDFLAGS+=${LDFLAGS_BIN}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.cdboot.S=   ${CLANG_NO_IAS}
___
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: r351093 - head/libexec/rtld-elf/rtld-libc

2019-08-15 Thread Kyle Evans
Author: kevans
Date: Thu Aug 15 17:35:24 2019
New Revision: 351093
URL: https://svnweb.freebsd.org/changeset/base/351093

Log:
  rtld-elf: fix build with xtoolchain-llvm90
  
  strstr ends up using bcmp when compiled with llvm90; pull it in from libc
  as well.
  
  MFC after:3 days

Modified:
  head/libexec/rtld-elf/rtld-libc/Makefile.inc

Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc
==
--- head/libexec/rtld-elf/rtld-libc/Makefile.incThu Aug 15 17:32:39 
2019(r351092)
+++ head/libexec/rtld-elf/rtld-libc/Makefile.incThu Aug 15 17:35:24 
2019(r351093)
@@ -40,7 +40,7 @@ CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include
 
 # Use the string and memory .o files from libc instead of rebuilding them (they
 # might be using optimized assembly and duplicating that logic here is 
awkward).
-_libc_string_objects=  bcopy memchr memcmp memcpy memmove stpncpy strcat \
+_libc_string_objects=  bcmp bcopy memchr memcmp memcpy memmove stpncpy strcat \
 strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy strlen strncmp \
 strncpy strrchr strsep strspn strstr strtok
 # Also use all the syscall .o files from libc_nossp_pic:
___
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: r351093 - head/libexec/rtld-elf/rtld-libc

2019-08-15 Thread Kyle Evans
On Thu, Aug 15, 2019 at 12:35 PM Kyle Evans  wrote:
>
> Author: kevans
> Date: Thu Aug 15 17:35:24 2019
> New Revision: 351093
> URL: https://svnweb.freebsd.org/changeset/base/351093
>
> Log:
>   rtld-elf: fix build with xtoolchain-llvm90
>
>   strstr ends up using bcmp when compiled with llvm90; pull it in from libc
>   as well.
>
>   MFC after:3 days
>

Reviewed by: arichardson, kib
Differential Revision: https://reviews.freebsd.org/D21274
___
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: r351095 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include

2019-08-15 Thread Jung-uk Kim
Author: jkim
Date: Thu Aug 15 17:43:36 2019
New Revision: 351095
URL: https://svnweb.freebsd.org/changeset/base/351095

Log:
  MFV:  r351091
  
  Fix the reported boot failures and revert r350510.
  
  Note this commit is effectively merging ACPICA 20190703 again and applying
  an upstream patch.
  
  https://github.com/acpica/acpica/commit/73f6372
  
  Tested by:scottl

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslglobal.h
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslstubs.c
  head/sys/contrib/dev/acpica/compiler/aslsupport.l
  head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
  head/sys/contrib/dev/acpica/components/events/evgpe.c
  head/sys/contrib/dev/acpica/components/events/evgpeblk.c
  head/sys/contrib/dev/acpica/components/events/evxface.c
  head/sys/contrib/dev/acpica/components/events/evxfgpe.c
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/namespace/nsaccess.c
  head/sys/contrib/dev/acpica/components/namespace/nseval.c
  head/sys/contrib/dev/acpica/components/namespace/nsinit.c
  head/sys/contrib/dev/acpica/components/namespace/nsload.c
  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
  head/sys/contrib/dev/acpica/components/tables/tbdata.c
  head/sys/contrib/dev/acpica/components/tables/tbxfload.c
  head/sys/contrib/dev/acpica/components/utilities/utinit.c
  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
  head/sys/contrib/dev/acpica/include/acevents.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acnamesp.h
  head/sys/contrib/dev/acpica/include/acpixf.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Thu Aug 15 17:40:48 2019
(r351094)
+++ head/sys/contrib/dev/acpica/changes.txt Thu Aug 15 17:43:36 2019
(r351095)
@@ -1,4 +1,53 @@
 
+03 July 2019. Summary of changes for version 20190703:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Remove legacy module-level support code. There were still some remnants 
+of the legacy module-level code executions. Since we no longer support 
+this option, this is essentially dead code and has been removed from the 
+ACPICA source.
+
+iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
+scope. If these named objects are declared outside the root scope, they 
+will not be invoked by any host Operating System.
+
+Clear status of GPEs on first direct enable. ACPI GPEs (other than the EC 
+one) can be enabled in two situations. First, the GPEs with existing _Lxx 
+and _Exx methods are enabled implicitly by ACPICA during system 
+initialization.  Second, the GPEs without these methods (like GPEs listed 
+by _PRW objects for wakeup devices) need to be enabled directly by the 
+code that is going to use them (e.g. ACPI power management or device 
+drivers).
+
+In the former case, if the status of a given GPE is set to start with, 
+its handler method (either _Lxx or _Exx) needs to be invoked to take care 
+of the events (possibly) signaled before the GPE was enabled. In the 
+latter case, however, the first caller of AcpiEnableGpe() for a given GPE 
+should not be expected to care about any events that might be signaled 
+through it earlier.  In that case, it is better to clear the status of 
+the GPE before enabling it, to prevent stale events from triggering 
+unwanted actions (like spurious system resume, for example).
+
+For this reason, modify AcpiEvAddGpeReference() to take an additional 
+boolean argument indicating whether or not the GPE status needs to be 
+cleared when its reference counter changes from zero to one and make 
+AcpiEnableGpe() pass TRUE to it through that new argument.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools:
+
+The tool generation process has been migrated to MSVC 2017, and all 
+project files have been upgraded. The new project files appear in the 
+directory \acpica\generate\msvc2017. This change effectively deprecates 
+the older project files in \acpica\generate\msvc9.
+
+iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
+scope. If these named objects are declared outside the root scope, they 
+will not be invoked by any host Operating System
+
+
 09 May 2019. Summary of changes for version 20190509:
 
 

Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
==
--- head/sys/contrib/dev/acpica/compiler/asldefine.hThu Aug 15 1

svn commit: r351096 - head/stand/i386/pxeldr

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 17:59:22 2019
New Revision: 351096
URL: https://svnweb.freebsd.org/changeset/base/351096

Log:
  stand: remove CLANG_NO_IAS from pxeldr
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
  gained support quite some time ago, and we can now build stand/ with
  IAS.  In most cases IAS- and GNU as-assembled boot components were
  identical, and CLANG_NO_IAS was already removed from other components.
  
  Clang IAS produces different output for some components, including
  pxeldr, so CLANG_NO_IAS was not previously removed for those.
  
  In the case of pxeldr the difference is that IAS adds a size override
  prefix (67h) to three instructions to specify a 32-bit address, even
  though the two high bytes are zero and the address fits in 16 bits.
  this wastes three bytes per instruction and causes some additional nop
  npadding to be required elsewhere in the object, but pxeboot is not
  size-constrained so it doesn't matter.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/stand/i386/pxeldr/Makefile

Modified: head/stand/i386/pxeldr/Makefile
==
--- head/stand/i386/pxeldr/Makefile Thu Aug 15 17:43:36 2019
(r351095)
+++ head/stand/i386/pxeldr/Makefile Thu Aug 15 17:59:22 2019
(r351096)
@@ -43,6 +43,3 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN}
-b ${BTXKERN} ${LOADERBIN}
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.pxeldr.S=   ${CLANG_NO_IAS}
___
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: r351097 - head/stand/i386/gptzfsboot

2019-08-15 Thread Ed Maste
Author: emaste
Date: Thu Aug 15 18:43:01 2019
New Revision: 351097
URL: https://svnweb.freebsd.org/changeset/base/351097

Log:
  gptzfsboot: remove CLANG_NO_IAS
  
  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler did not handle .codeNN directives.  Clang gained
  support quite some time ago, so we can build stand/ with IAS.
  
  In some cases there were small differences in generated object output.
  In the case of gptzfsboot however using GNU as or Clang IAS to assemble
  gptldr.S resulted in identical final gptzfsboot binary output.
  
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5

Modified:
  head/stand/i386/gptzfsboot/Makefile

Modified: head/stand/i386/gptzfsboot/Makefile
==
--- head/stand/i386/gptzfsboot/Makefile Thu Aug 15 17:59:22 2019
(r351096)
+++ head/stand/i386/gptzfsboot/Makefile Thu Aug 15 18:43:01 2019
(r351097)
@@ -71,6 +71,3 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o 
 zfsboot.o: ${ZFSSRC}/zfsimpl.c
 
 .include 
-
-# XXX: clang integrated-as doesn't grok .codeNN directives yet
-CFLAGS.gptldr.S=   ${CLANG_NO_IAS}
___
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: r351098 - head/usr.bin/calendar/calendars

2019-08-15 Thread Kirk McKusick
Author: mckusick
Date: Thu Aug 15 18:46:27 2019
New Revision: 351098
URL: https://svnweb.freebsd.org/changeset/base/351098

Log:
  Add missing comma in calendar.freebsd

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 15 18:43:01 
2019(r351097)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 15 18:46:27 
2019(r351098)
@@ -245,7 +245,7 @@
 06/07  Benjamin Close  born in Adelaide, Australia, 1978
 06/07  Roger Pau Monne  born in Reus, Catalunya, Spain, 
1986
 06/08  Ravi Pokala  born in Royal Oak, Michigan, United 
States, 1980
-06/09  Stanislav Galabov  born in Sofia, Bulgaria 1978
+06/09  Stanislav Galabov  born in Sofia, Bulgaria, 1978
 06/11  Alonso Cardenas Marquez  born in Arequipa, Peru, 1979
 06/14  Josh Paetzel  born in Minneapolis, Minnesota, 
United States, 1973
 06/17  Tilman Linneweh  born in Weinheim, 
Baden-Wuerttemberg, Germany, 1978
___
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: r351099 - head/sys/arm/allwinner

2019-08-15 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 15 18:57:48 2019
New Revision: 351099
URL: https://svnweb.freebsd.org/changeset/base/351099

Log:
  arm: allwinner: Set aw_ccu to BUS_PASS_BUS
  
  In r350842 I've switched the bus pass to resource so it matches the other
  clock drivers but this cannot work as this drivers is meant to match
  the dts node '/clocks' and if we don't do it at this pass simplebus is
  catching this node and we cannot attach.
  This solve booting on Allwinner boards that are still using /clocks (A20 SoC)
  
  MFC after:3 days

Modified:
  head/sys/arm/allwinner/aw_ccu.c

Modified: head/sys/arm/allwinner/aw_ccu.c
==
--- head/sys/arm/allwinner/aw_ccu.c Thu Aug 15 18:46:27 2019
(r351098)
+++ head/sys/arm/allwinner/aw_ccu.c Thu Aug 15 18:57:48 2019
(r351099)
@@ -250,6 +250,6 @@ DEFINE_CLASS_1(aw_ccu, aw_ccu_driver, aw_ccu_methods,
 static devclass_t aw_ccu_devclass;
 
 EARLY_DRIVER_MODULE(aw_ccu, simplebus, aw_ccu_driver, aw_ccu_devclass,
-0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
+0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
 
 MODULE_VERSION(aw_ccu, 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: r351100 - head/sys/dev/iicbus/twsi

2019-08-15 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 15 18:59:52 2019
New Revision: 351100
URL: https://svnweb.freebsd.org/changeset/base/351100

Log:
  twsi: Fix build when DEBUG is used on 32bits arch.
  
  MFC after:3 days

Modified:
  head/sys/dev/iicbus/twsi/twsi.c

Modified: head/sys/dev/iicbus/twsi/twsi.c
==
--- head/sys/dev/iicbus/twsi/twsi.c Thu Aug 15 18:57:48 2019
(r351099)
+++ head/sys/dev/iicbus/twsi/twsi.c Thu Aug 15 18:59:52 2019
(r351100)
@@ -261,7 +261,7 @@ twsi_calc_baud_rate(struct twsi_softc *sc, const u_int
if (clk_get_freq(sc->clk_core, &clk) < 0)
return (-1);
 
-   debugf(sc->dev, "Bus clock is at %lu\n", clk);
+   debugf(sc->dev, "Bus clock is at %ju\n", clk);
 
for (n = 0; n < 8; n++) {
for (m = 0; m < 16; m++) {
___
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: r351101 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 19:27:36 2019
New Revision: 351101
URL: https://svnweb.freebsd.org/changeset/base/351101

Log:
  ping6: fix uninitialized variable warnings when MK_CASPER=no
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21273

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 18:59:52 2019(r351100)
+++ head/sbin/ping6/ping6.c Thu Aug 15 19:27:36 2019(r351101)
@@ -961,6 +961,7 @@ main(int argc, char *argv[])
}
 
/* From now on we will use only reverse DNS lookups. */
+#ifdef WITH_CASPER
if (capdns != NULL) {
const char *types[1];
 
@@ -968,7 +969,7 @@ main(int argc, char *argv[])
if (cap_dns_type_limit(capdns, types, nitems(types)) < 0)
err(1, "unable to limit access to system.dns service");
}
-
+#endif
if (!(options & F_SRCADDR)) {
/*
 * get the source address. XXX since we revoked the root
@@ -2780,9 +2781,10 @@ static cap_channel_t *
 capdns_setup(void)
 {
cap_channel_t *capcas, *capdnsloc;
+#ifdef WITH_CASPER
const char *types[2];
int families[1];
-
+#endif
capcas = cap_init();
if (capcas == NULL)
err(1, "unable to create casper process");
@@ -2791,6 +2793,7 @@ capdns_setup(void)
cap_close(capcas);
if (capdnsloc == NULL)
err(1, "unable to open system.dns service");
+#ifdef WITH_CASPER
types[0] = "NAME2ADDR";
types[1] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, nitems(types)) < 0)
@@ -2798,6 +2801,6 @@ capdns_setup(void)
families[0] = AF_INET6;
if (cap_dns_family_limit(capdnsloc, families, nitems(families)) < 0)
err(1, "unable to limit access to system.dns service");
-
+#endif
return (capdnsloc);
 }
___
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: r351102 - head/sbin/ping6

2019-08-15 Thread Alan Somers
Author: asomers
Date: Thu Aug 15 19:52:32 2019
New Revision: 351102
URL: https://svnweb.freebsd.org/changeset/base/351102

Log:
  ping6: Fix alignment errors
  
  This fixes -Wcast-align errors when compiled with WARNS=6.
  
  Submitted by: Ján Sučan 
  MFC after:2 weeks
  Sponsored by: Google, inc. (Google Summer of Code 2019)
  Differential Revision:https://reviews.freebsd.org/D21217

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Thu Aug 15 19:27:36 2019(r351101)
+++ head/sbin/ping6/ping6.c Thu Aug 15 19:52:32 2019(r351102)
@@ -313,7 +313,8 @@ main(int argc, char *argv[])
int sockbufsize = 0;
 #endif
int usepktinfo = 0;
-   struct in6_pktinfo *pktinfo = NULL;
+   struct in6_pktinfo pktinfo;
+   char *cmsg_pktinfo = NULL;
struct ip6_rthdr *rthdr = NULL;
 #ifdef IPSEC_POLICY_IPSEC
char *policy_in = NULL;
@@ -332,6 +333,7 @@ main(int argc, char *argv[])
/* just to be sure */
memset(&smsghdr, 0, sizeof(smsghdr));
memset(&smsgiov, 0, sizeof(smsgiov));
+   memset(&pktinfo, 0, sizeof(pktinfo));
 
intvl.tv_sec = interval / 1000;
intvl.tv_nsec = interval % 1000 * 100;
@@ -896,11 +898,10 @@ main(int argc, char *argv[])
errx(1, "can't allocate enough memory");
smsghdr.msg_control = (caddr_t)scmsg;
smsghdr.msg_controllen = ip6optlen;
-   scmsgp = (struct cmsghdr *)scmsg;
+   scmsgp = CMSG_FIRSTHDR(&smsghdr);
}
if (usepktinfo) {
-   pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp));
-   memset(pktinfo, 0, sizeof(*pktinfo));
+   cmsg_pktinfo = CMSG_DATA(scmsgp);
scmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
scmsgp->cmsg_level = IPPROTO_IPV6;
scmsgp->cmsg_type = IPV6_PKTINFO;
@@ -911,7 +912,7 @@ main(int argc, char *argv[])
if (ifname) {
 #ifndef USE_SIN6_SCOPE_ID
/* pktinfo must have already been allocated */
-   if ((pktinfo->ipi6_ifindex = if_nametoindex(ifname)) == 0)
+   if ((pktinfo.ipi6_ifindex = if_nametoindex(ifname)) == 0)
errx(1, "%s: invalid interface name", ifname);
 #else
if ((dst.sin6_scope_id = if_nametoindex(ifname)) == 0)
@@ -922,7 +923,7 @@ main(int argc, char *argv[])
scmsgp->cmsg_len = CMSG_LEN(sizeof(int));
scmsgp->cmsg_level = IPPROTO_IPV6;
scmsgp->cmsg_type = IPV6_HOPLIMIT;
-   *(int *)(CMSG_DATA(scmsgp)) = hoplimit;
+   memcpy(CMSG_DATA(scmsgp), &hoplimit, sizeof(hoplimit));
 
scmsgp = CMSG_NXTHDR(&smsghdr, scmsgp);
}
@@ -986,9 +987,9 @@ main(int argc, char *argv[])
src.sin6_port = ntohs(DUMMY_PORT);
src.sin6_scope_id = dst.sin6_scope_id;
 
-   if (pktinfo &&
+   if (usepktinfo &&
setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTINFO,
-   (void *)pktinfo, sizeof(*pktinfo)))
+   (void *)&pktinfo, sizeof(pktinfo)))
err(1, "UDP setsockopt(IPV6_PKTINFO)");
 
if (hoplimit != -1 &&
@@ -1015,6 +1016,10 @@ main(int argc, char *argv[])
close(dummy);
}
 
+   /* Save pktinfo in the ancillary data. */
+   if (usepktinfo)
+   memcpy(cmsg_pktinfo, &pktinfo, sizeof(pktinfo));
+
if (connect(ssend, (struct sockaddr *)&dst, sizeof(dst)) != 0)
err(1, "connect() ssend");
 
@@ -1310,6 +1315,8 @@ pinger(void)
CLR(seq % mx_dup_ck);
 
if (options & F_FQDN) {
+   uint16_t s;
+
icp->icmp6_type = ICMP6_NI_QUERY;
icp->icmp6_code = ICMP6_NI_SUBJ_IPV6;
nip->ni_qtype = htons(NI_QTYPE_FQDN);
@@ -1317,13 +1324,15 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce = htons(seq);
+   s = htons(seq);
+   memcpy(nip->icmp6_ni_nonce, &s, sizeof(s));
 
memcpy(&outpack[ICMP6_NIQLEN], &dst.sin6_addr,
sizeof(dst.sin6_addr));
cc = ICMP6_NIQLEN + sizeof(dst.sin6_addr);
datalen = 0;
} else if (options & F_FQDNOLD) {
+   uint16_t s;
/* packet format in 03 draft - no Subject data on queries */
icp->icmp6_type = ICMP6_NI_QUERY;
icp->icmp6_code = 0;/* code field is always 0 */
@@ -1332,11 +1341,14 @@ pinger(void)
 
memcpy(nip->icmp6_ni_nonce, nonce,
sizeof(nip->icmp6_ni_nonce));
-   *(u_int16_t *)nip->icmp6_ni_nonce =

svn commit: r351104 - head/lib/libpmc

2019-08-15 Thread Matt Macy
Author: mmacy
Date: Thu Aug 15 21:51:11 2019
New Revision: 351104
URL: https://svnweb.freebsd.org/changeset/base/351104

Log:
  pmc: restore "unhalted-cycles" alias
  
  Reported by:  mav@

Modified:
  head/lib/libpmc/libpmc_pmu_util.c

Modified: head/lib/libpmc/libpmc_pmu_util.c
==
--- head/lib/libpmc/libpmc_pmu_util.c   Thu Aug 15 21:39:21 2019
(r351103)
+++ head/lib/libpmc/libpmc_pmu_util.c   Thu Aug 15 21:51:11 2019
(r351104)
@@ -69,6 +69,7 @@ static struct pmu_alias pmu_intel_alias_table[] = {
{"BRANCH_MISSES_RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"},
{"BRANCH-MISSES-RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"},
{"cycles", "tsc-tsc"},
+   {"unhalted-cycles", "CPU_CLK_UNHALTED.THREAD_P_ANY"},
{"instructions", "inst-retired.any_p"},
{"branch-mispredicts", "br_misp_retired.all_branches"},
{"branches", "br_inst_retired.all_branches"},
___
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: r351105 - in head: share/man/man4 sys/dev/ntb

2019-08-15 Thread Alexander Motin
Author: mav
Date: Thu Aug 15 22:55:59 2019
New Revision: 351105
URL: https://svnweb.freebsd.org/changeset/base/351105

Log:
  Limit memory window usage in ntb_transport to 256MB.
  
  This adds safety net for the case of misconfigured NTB with too big
  memory window, for which we may be unable to allocate a memory buffer,
  which does not make much sense for the network interface.  While there,
  fix the code to really work with asymmetric window sizes setup.
  
  This makes driver just print warning message on boot instead of hanging
  if too large memory window is configured.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/share/man/man4/ntb_transport.4
  head/sys/dev/ntb/ntb_transport.c

Modified: head/share/man/man4/ntb_transport.4
==
--- head/share/man/man4/ntb_transport.4 Thu Aug 15 21:51:11 2019
(r351104)
+++ head/share/man/man4/ntb_transport.4 Thu Aug 15 22:55:59 2019
(r351105)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2016-2017 Alexander Motin 
+.\" Copyright (c) 2016-2019 Alexander Motin 
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 2, 2017
+.Dd August 15, 2019
 .Dt NTB_TRANSPORT 4
 .Os
 .Sh NAME
@@ -51,6 +51,10 @@ The following tunables are settable from the
 .It Va hw.ntb_transport.debug_level
 Driver debug level.
 The default value is 0, higher means more verbose.
+.It Va hw.ntb_transport.max_mw_size
+Limits maximum memory window usage.
+Allocation of big physically contiguous memory buffer may be a problem,
+while too big buffers makes no much sense for low latency network interface.
 .It Va hint.ntb_transport. Ns Ar X Ns Va .config
 Configures a set of the transport consumers, separated by commas.
 Each consumer can be configured as: "[][:]", where:

Modified: head/sys/dev/ntb/ntb_transport.c
==
--- head/sys/dev/ntb/ntb_transport.cThu Aug 15 21:51:11 2019
(r351104)
+++ head/sys/dev/ntb/ntb_transport.cThu Aug 15 22:55:59 2019
(r351105)
@@ -81,7 +81,7 @@ SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, debug_level, 
 
 static unsigned transport_mtu = 0x1;
 
-static uint64_t max_mw_size;
+static uint64_t max_mw_size = 256*1024*1024;
 SYSCTL_UQUAD(_hw_ntb_transport, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, 
&max_mw_size, 0,
 "If enabled (non-zero), limit the size of large memory windows. "
 "Both sides of the NTB MUST set the same value here.");
@@ -177,14 +177,17 @@ struct ntb_transport_mw {
size_t  xlat_align;
size_t  xlat_align_size;
bus_addr_t  addr_limit;
-   /* Tx buff is off vbase / phys_addr */
+   /* Tx buff is vbase / phys_addr / tx_size */
caddr_t vbase;
-   size_t  buff_size;
-   /* Rx buff is off virt_addr / dma_addr */
+   size_t  tx_size;
+   /* Rx buff is virt_addr / dma_addr / rx_size */
bus_dma_tag_t   dma_tag;
bus_dmamap_tdma_map;
caddr_t virt_addr;
bus_addr_t  dma_addr;
+   size_t  rx_size;
+   /* rx_size increased to size alignment requirements of the hardware. */
+   size_t  buff_size;
 };
 
 struct ntb_transport_child {
@@ -331,7 +334,7 @@ ntb_transport_attach(device_t dev)
struct ntb_transport_child **cpp = &nt->child;
struct ntb_transport_child *nc;
struct ntb_transport_mw *mw;
-   uint64_t db_bitmap, size;
+   uint64_t db_bitmap;
int rc, i, db_count, spad_count, qp, qpu, qpo, qpt;
char cfg[128] = "";
char buf[32];
@@ -374,6 +377,14 @@ ntb_transport_attach(device_t dev)
if (rc != 0)
goto err;
 
+   mw->tx_size = mw->phys_size;
+   if (max_mw_size != 0 && mw->tx_size > max_mw_size) {
+   device_printf(dev, "Memory window %d limited from "
+   "%ju to %ju\n", i, mw->phys_size, max_mw_size);
+   mw->tx_size = max_mw_size;
+   }
+
+   mw->rx_size = 0;
mw->buff_size = 0;
mw->virt_addr = NULL;
mw->dma_addr = 0;
@@ -388,10 +399,7 @@ ntb_transport_attach(device_t dev)
 * that NTB windows are symmetric and this allocation remain,
 * but even if not, we will just reallocate it later.
 */
-   size = mw->phys_size;
-   if (max_mw_size != 0 && size > max_mw_size)
-   size = max_mw_size;
-   ntb_set_mw(nt, i, size);
+   ntb_set_mw(nt, i, mw->tx_size);
}
 
qpu = 0;
@@ -556,7 +564,7 @@ ntb_transport_init_queue(struct ntb_transport_ctx *nt,
struct ntb_transport_mw *mw;
struct ntb_transpor

svn commit: r351106 - head/sys/kern

2019-08-15 Thread Rick Macklem
Author: rmacklem
Date: Thu Aug 15 23:21:41 2019
New Revision: 351106
URL: https://svnweb.freebsd.org/changeset/base/351106

Log:
  Fix copy_file_range(2) so that unneeded blocks are not allocated to the 
output file.
  
  When the byte range for copy_file_range(2) doesn't go to EOF on the
  output file and there is a hole in the input file, a hole must be
  "punched" in the output file. This is done by writing a block of bytes
  all set to 0.
  Without this patch, the write is done unconditionally which means that,
  if the output file already has a hole in that byte range, a unneeded data 
block
  of all 0 bytes would be allocated.
  This patch adds code to check for a hole in the output file, so that it can
  skip doing the write if there is already a hole in that byte range of
  the output file. This avoids unnecessary allocation of blocks to the
  output file.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D21155

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Thu Aug 15 22:55:59 2019(r351105)
+++ head/sys/kern/vfs_vnops.c   Thu Aug 15 23:21:41 2019(r351106)
@@ -2713,18 +2713,92 @@ mem_iszero(void *dat, int len)
 }
 
 /*
+ * Look for a hole in the output file and, if found, adjust *outoffp
+ * and *xferp to skip past the hole.
+ * *xferp is the entire hole length to be written and xfer2 is how many bytes
+ * to be written as 0's upon return.
+ */
+static off_t
+vn_skip_hole(struct vnode *outvp, off_t xfer2, off_t *outoffp, off_t *xferp,
+off_t *dataoffp, off_t *holeoffp, struct ucred *cred)
+{
+   int error;
+   off_t delta;
+
+   if (*holeoffp == 0 || *holeoffp <= *outoffp) {
+   *dataoffp = *outoffp;
+   error = VOP_IOCTL(outvp, FIOSEEKDATA, dataoffp, 0, cred,
+   curthread);
+   if (error == 0) {
+   *holeoffp = *dataoffp;
+   error = VOP_IOCTL(outvp, FIOSEEKHOLE, holeoffp, 0, cred,
+   curthread);
+   }
+   if (error != 0 || *holeoffp == *dataoffp) {
+   /*
+* Since outvp is unlocked, it may be possible for
+* another thread to do a truncate(), lseek(), write()
+* creating a hole at startoff between the above
+* VOP_IOCTL() calls, if the other thread does not do
+* rangelocking.
+* If that happens, *holeoffp == *dataoffp and finding
+* the hole has failed, so disable vn_skip_hole().
+*/
+   *holeoffp = -1; /* Disable use of vn_skip_hole(). */
+   return (xfer2);
+   }
+   KASSERT(*dataoffp >= *outoffp,
+   ("vn_skip_hole: dataoff=%jd < outoff=%jd",
+   (intmax_t)*dataoffp, (intmax_t)*outoffp));
+   KASSERT(*holeoffp > *dataoffp,
+   ("vn_skip_hole: holeoff=%jd <= dataoff=%jd",
+   (intmax_t)*holeoffp, (intmax_t)*dataoffp));
+   }
+
+   /*
+* If there is a hole before the data starts, advance *outoffp and
+* *xferp past the hole.
+*/
+   if (*dataoffp > *outoffp) {
+   delta = *dataoffp - *outoffp;
+   if (delta >= *xferp) {
+   /* Entire *xferp is a hole. */
+   *outoffp += *xferp;
+   *xferp = 0;
+   return (0);
+   }
+   *xferp -= delta;
+   *outoffp += delta;
+   xfer2 = MIN(xfer2, *xferp);
+   }
+
+   /*
+* If a hole starts before the end of this xfer2, reduce this xfer2 so
+* that the write ends at the start of the hole.
+* *holeoffp should always be greater than *outoffp, but for the
+* non-INVARIANTS case, check this to make sure xfer2 remains a sane
+* value.
+*/
+   if (*holeoffp > *outoffp && *holeoffp < *outoffp + xfer2)
+   xfer2 = *holeoffp - *outoffp;
+   return (xfer2);
+}
+
+/*
  * Write an xfer sized chunk to outvp in blksize blocks from dat.
  * dat is a maximum of blksize in length and can be written repeatedly in
  * the chunk.
  * If growfile == true, just grow the file via vn_truncate_locked() instead
  * of doing actual writes.
+ * If checkhole == true, a hole is being punched, so skip over any hole
+ * already in the output file.
  */
 static int
 vn_write_outvp(struct vnode *outvp, char *dat, off_t outoff, off_t xfer,
-u_long blksize, bool growfile, struct ucred *cred)
+u_long blksize, bool growfile, bool checkhole, struct ucred *cred)
 {
struct mount *mp;
-   off_t xfer2;
+   off_t dataoff, holeoff, xfer2

svn commit: r351107 - head/sys/dev/ntb

2019-08-15 Thread Alexander Motin
Author: mav
Date: Thu Aug 15 23:56:19 2019
New Revision: 351107
URL: https://svnweb.freebsd.org/changeset/base/351107

Log:
  Fix i386 build.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/ntb/ntb_transport.c

Modified: head/sys/dev/ntb/ntb_transport.c
==
--- head/sys/dev/ntb/ntb_transport.cThu Aug 15 23:21:41 2019
(r351106)
+++ head/sys/dev/ntb/ntb_transport.cThu Aug 15 23:56:19 2019
(r351107)
@@ -380,7 +380,8 @@ ntb_transport_attach(device_t dev)
mw->tx_size = mw->phys_size;
if (max_mw_size != 0 && mw->tx_size > max_mw_size) {
device_printf(dev, "Memory window %d limited from "
-   "%ju to %ju\n", i, mw->phys_size, max_mw_size);
+   "%ju to %ju\n", i, (uintmax_t)mw->phys_size,
+   max_mw_size);
mw->tx_size = max_mw_size;
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r351108 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include i386/i386 i386/include kern mips/atheros mips/atheros/ar531x mips/beri mips/broadcom mips/cavium mips/...

2019-08-15 Thread Jeff Roberson
Author: jeff
Date: Fri Aug 16 00:45:14 2019
New Revision: 351108
URL: https://svnweb.freebsd.org/changeset/base/351108

Log:
  Move phys_avail definition into MI code.  It is consumed in the MI layer and
  doing so adds more flexibility with less redundant code.
  
  Reviewed by:  jhb, markj, kib
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D21250

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/include/pmap.h
  head/sys/arm/arm/busdma_machdep-v4.c
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/mem.c
  head/sys/arm/arm/minidump_machdep.c
  head/sys/arm/arm/physmem.c
  head/sys/arm/include/pmap.h
  head/sys/arm64/include/pmap.h
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/minidump_machdep_base.c
  head/sys/i386/include/pmap.h
  head/sys/kern/kern_dump.c
  head/sys/mips/atheros/ar531x/ar5315_machdep.c
  head/sys/mips/atheros/ar71xx_machdep.c
  head/sys/mips/beri/beri_machdep.c
  head/sys/mips/broadcom/bcm_machdep.c
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/include/pmap.h
  head/sys/mips/ingenic/jz4780_machdep.c
  head/sys/mips/malta/malta_machdep.c
  head/sys/mips/mediatek/mtk_machdep.c
  head/sys/mips/mips/busdma_machdep.c
  head/sys/mips/mips/machdep.c
  head/sys/mips/mips/pmap.c
  head/sys/mips/nlm/xlp_machdep.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/include/pmap.h
  head/sys/powerpc/include/vmparam.h
  head/sys/powerpc/powerpc/machdep.c
  head/sys/powerpc/powerpc/pmap_dispatch.c
  head/sys/riscv/include/pmap.h
  head/sys/riscv/riscv/machdep.c
  head/sys/sparc64/include/pmap.h
  head/sys/sparc64/sparc64/pmap.c
  head/sys/vm/vm_param.h
  head/sys/vm/vm_phys.c
  head/sys/vm/vm_phys.h
  head/sys/x86/x86/nexus.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Thu Aug 15 23:56:19 2019
(r351107)
+++ head/sys/amd64/amd64/machdep.c  Fri Aug 16 00:45:14 2019
(r351108)
@@ -210,21 +210,6 @@ int cold = 1;
 long Maxmem = 0;
 long realmem = 0;
 
-/*
- * The number of PHYSMAP entries must be one less than the number of
- * PHYSSEG entries because the PHYSMAP entry that spans the largest
- * physical address that is accessible by ISA DMA is split into two
- * PHYSSEG entries.
- */
-#definePHYSMAP_SIZE(2 * (VM_PHYSSEG_MAX - 1))
-
-vm_paddr_t phys_avail[PHYSMAP_SIZE + 2];
-vm_paddr_t dump_avail[PHYSMAP_SIZE + 2];
-
-/* must be 2 less so 0 0 can signal end of chunks */
-#definePHYS_AVAIL_ARRAY_END (nitems(phys_avail) - 2)
-#defineDUMP_AVAIL_ARRAY_END (nitems(dump_avail) - 2)
-
 struct kva_md_info kmi;
 
 static struct trapframe proc0_tf;
@@ -1036,7 +1021,7 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_p
 
physmap_idx += 2;
*physmap_idxp = physmap_idx;
-   if (physmap_idx == PHYSMAP_SIZE) {
+   if (physmap_idx == PHYS_AVAIL_ENTRIES) {
printf(
"Too many segments in the physical address map, giving up\n");
return (0);
@@ -1229,7 +1214,7 @@ static void
 getmemsize(caddr_t kmdp, u_int64_t first)
 {
int i, physmap_idx, pa_indx, da_indx;
-   vm_paddr_t pa, physmap[PHYSMAP_SIZE];
+   vm_paddr_t pa, physmap[PHYS_AVAIL_ENTRIES];
u_long physmem_start, physmem_tunable, memtest;
pt_entry_t *pte;
quad_t dcons_addr, dcons_size;
@@ -1446,7 +1431,7 @@ skip_memtest:
phys_avail[pa_indx] += PAGE_SIZE;
} else {
pa_indx++;
-   if (pa_indx == PHYS_AVAIL_ARRAY_END) {
+   if (pa_indx == PHYS_AVAIL_ENTRIES) {
printf(
"Too many holes in the physical address space, giving up\n");
pa_indx--;
@@ -1462,7 +1447,7 @@ do_dump_avail:
dump_avail[da_indx] += PAGE_SIZE;
} else {
da_indx++;
-   if (da_indx == DUMP_AVAIL_ARRAY_END) {
+   if (da_indx == PHYS_AVAIL_ENTRIES) {
da_indx--;
goto do_next;
}

Modified: head/sys/amd64/include/pmap.h
==
--- head/sys/amd64/include/pmap.h   Thu Aug 15 23:56:19 2019
(r351107)
+++ head/sys/amd64/include/pmap.h   Fri Aug 16 00:45:14 2019
(r351108)
@@ -408,8 +408,6 @@ struct pv_chunk {
 
 extern caddr_t CADDR1;
 extern pt_entry_t *CMAP1;
-extern vm_paddr_t phys_avail[];
-extern vm_paddr_t dump_avail[];
 extern vm_offset_t virtual_avail;
 extern vm_offset_t virtual_end;
 extern vm_paddr_t dmaplimit;

Modifie

svn commit: r351113 - in head: sys/fs/fuse tests/sys/fs/fusefs

2019-08-15 Thread Alan Somers
Author: asomers
Date: Fri Aug 16 05:06:54 2019
New Revision: 351113
URL: https://svnweb.freebsd.org/changeset/base/351113

Log:
  fusefs: don't send the namespace during listextattr
  
  The FUSE_LISTXATTR operation always returns the full list of a file's
  extended attributes, in all namespaces. There's no way to filter the list
  server-side. However, currently FreeBSD's fusefs driver sends a namespace
  string with the FUSE_LISTXATTR request. That behavior was probably copied
  from fuse_vnop_getextattr, which has an attribute name argument. It's
  been there ever since extended attribute support was added in r324620. This
  commit removes it.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D21280

Modified:
  head/sys/fs/fuse/fuse_vnops.c
  head/tests/sys/fs/fusefs/mockfs.cc

Modified: head/sys/fs/fuse/fuse_vnops.c
==
--- head/sys/fs/fuse/fuse_vnops.c   Fri Aug 16 04:54:38 2019
(r351112)
+++ head/sys/fs/fuse/fuse_vnops.c   Fri Aug 16 05:06:54 2019
(r351113)
@@ -2246,9 +2246,7 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
struct mount *mp = vnode_mount(vp);
struct thread *td = ap->a_td;
struct ucred *cred = ap->a_cred;
-   size_t len;
char *prefix;
-   char *attr_str;
char *bsd_list = NULL;
char *linux_list;
int bsd_list_len;
@@ -2274,9 +2272,7 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
else
prefix = EXTATTR_NAMESPACE_USER_STRING;
 
-   len = strlen(prefix) + sizeof(extattr_namespace_separator) + 1;
-
-   fdisp_init(&fdi, sizeof(*list_xattr_in) + len);
+   fdisp_init(&fdi, sizeof(*list_xattr_in));
fdisp_make_vp(&fdi, FUSE_LISTXATTR, vp, td, cred);
 
/*
@@ -2284,8 +2280,6 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
 */
list_xattr_in = fdi.indata;
list_xattr_in->size = 0;
-   attr_str = (char *)fdi.indata + sizeof(*list_xattr_in);
-   snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator);
 
err = fdisp_wait_answ(&fdi);
if (err != 0) {
@@ -2310,8 +2304,6 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap)
fdisp_refresh_vp(&fdi, FUSE_LISTXATTR, vp, td, cred);
list_xattr_in = fdi.indata;
list_xattr_in->size = linux_list_len + sizeof(*list_xattr_out);
-   attr_str = (char *)fdi.indata + sizeof(*list_xattr_in);
-   snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator);
 
err = fdisp_wait_answ(&fdi);
if (err != 0)

Modified: head/tests/sys/fs/fusefs/mockfs.cc
==
--- head/tests/sys/fs/fusefs/mockfs.cc  Fri Aug 16 04:54:38 2019
(r351112)
+++ head/tests/sys/fs/fusefs/mockfs.cc  Fri Aug 16 05:06:54 2019
(r351113)
@@ -554,16 +554,13 @@ void MockFS::audit_request(const mockfs_buf_in &in) {
"Missing request attribute name";
break;
case FUSE_GETXATTR:
-   ASSERT_GE(inlen, fih + sizeof(in.body.setxattr)) <<
+   ASSERT_GE(inlen, fih + sizeof(in.body.getxattr)) <<
"Missing request body";
-   ASSERT_GT(inlen, fih + sizeof(in.body.setxattr)) <<
+   ASSERT_GT(inlen, fih + sizeof(in.body.getxattr)) <<
"Missing request attribute name";
break;
case FUSE_LISTXATTR:
-   ASSERT_GE(inlen, fih + sizeof(in.body.listxattr)) <<
-   "Missing request body";
-   ASSERT_GT(inlen, fih + sizeof(in.body.listxattr)) <<
-   "Missing namespace";
+   ASSERT_EQ(inlen, fih + sizeof(in.body.listxattr));
break;
case FUSE_REMOVEXATTR:
ASSERT_GT(inlen, fih) << "Missing request attribute name";
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"