svn commit: r307219 - head/lib/libc/mips/string

2016-10-13 Thread Ruslan Bukin
Author: br
Date: Thu Oct 13 15:23:53 2016
New Revision: 307219
URL: https://svnweb.freebsd.org/changeset/base/307219

Log:
  Fix strchr, strrchr implementation: convert c to char
  (according to standard).
  
  Discussed with:   andrew
  Reviewed by:  emaste
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D8239

Modified:
  head/lib/libc/mips/string/strchr.S
  head/lib/libc/mips/string/strrchr.S

Modified: head/lib/libc/mips/string/strchr.S
==
--- head/lib/libc/mips/string/strchr.S  Thu Oct 13 14:41:05 2016
(r307218)
+++ head/lib/libc/mips/string/strchr.S  Thu Oct 13 15:23:53 2016
(r307219)
@@ -44,7 +44,12 @@ __FBSDID("$FreeBSD$");
.abicalls
 #endif
 
+/*
+ * char *
+ * strchr(const char *s, int c);
+ */
 LEAF(strchr)
+   and a1, a1, 0xff
 1:
lbu a2, 0(a0)   # get a byte
PTR_ADDUa0, a0, 1

Modified: head/lib/libc/mips/string/strrchr.S
==
--- head/lib/libc/mips/string/strrchr.S Thu Oct 13 14:41:05 2016
(r307218)
+++ head/lib/libc/mips/string/strrchr.S Thu Oct 13 15:23:53 2016
(r307219)
@@ -44,8 +44,13 @@ __FBSDID("$FreeBSD$");
.abicalls
 #endif
 
+/*
+ * char *
+ * strrchr(const char *s, int c);
+ */
 LEAF(strrchr)
movev0, zero# default if not found
+   and a1, a1, 0xff
 1:
lbu a3, 0(a0)   # get a byte
PTR_ADDUa0, a0, 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: r307218 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/i915 dev/drm2/ttm kern vm

2016-10-13 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 13 14:41:05 2016
New Revision: 307218
URL: https://svnweb.freebsd.org/changeset/base/307218

Log:
  Fix a race in vm_page_busy_sleep(9).
  
  Suppose that we have an exclusively busy page, and a thread which can
  accept shared-busy page.  In this case, typical code waiting for the
  page xbusy state to pass is
  again:
VM_OBJECT_WLOCK(object);
...
if (vm_page_xbusied(m)) {
vm_page_lock(m);
VM_OBJECT_WUNLOCK(object);<---1
vm_page_busy_sleep(p, "vmopax");
goto again;
}
  
  Suppose that the xbusy state owner locked the object, unbusied the
  page and unlocked the object after we are at the line [1], but before we
  executed the load of the busy_lock word in vm_page_busy_sleep().  If it
  happens that there is still no waiters recorded for the busy state,
  the xbusy owner did not acquired the page lock, so it proceeded.
  
  More, suppose that some other thread happen to share-busy the page
  after xbusy state was relinquished but before the m->busy_lock is read
  in vm_page_busy_sleep().  Again, that thread only needs vm_object lock
  to proceed.  Then, vm_page_busy_sleep() reads busy_lock value equal to
  the VPB_SHARERS_WORD(1).
  
  In this case, all tests in vm_page_busy_sleep(9) pass and we are going
  to sleep, despite the page being share-busied.
  
  Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9)
  to also accept shared-busy state if we only wait for the xbusy state to
  pass.
  
  Merge sequential if()s with the same 'then' clause in
  vm_page_busy_sleep().
  
  Note that the current code does not share-busy pages from parallel
  threads, the only way to have more that one sbusy owner is right now
  is to recurse.
  
  Reported and tested by:   pho (previous version)
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D8196

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c
  head/sys/kern/vfs_bio.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 
13 13:53:01 2016(r307217)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 
13 14:41:05 2016(r307218)
@@ -421,7 +421,7 @@ page_busy(vnode_t *vp, int64_t start, in
vm_page_reference(pp);
vm_page_lock(pp);
zfs_vmobject_wunlock(obj);
-   vm_page_busy_sleep(pp, "zfsmwb");
+   vm_page_busy_sleep(pp, "zfsmwb", true);
zfs_vmobject_wlock(obj);
continue;
}
@@ -476,7 +476,7 @@ page_hold(vnode_t *vp, int64_t start)
vm_page_reference(pp);
vm_page_lock(pp);
zfs_vmobject_wunlock(obj);
-   vm_page_busy_sleep(pp, "zfsmwb");
+   vm_page_busy_sleep(pp, "zfsmwb", true);
zfs_vmobject_wlock(obj);
continue;
}

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Thu Oct 13 13:53:01 2016
(r307217)
+++ head/sys/dev/drm2/i915/i915_gem.c   Thu Oct 13 14:41:05 2016
(r307218)
@@ -1533,7 +1533,7 @@ retry:
DRM_UNLOCK(dev);
vm_page_lock(page);
VM_OBJECT_WUNLOCK(vm_obj);
-   vm_page_busy_sleep(page, "915pee");
+   vm_page_busy_sleep(page, "915pee", false);
goto retry;
}
goto have_page;
@@ -1575,7 +1575,7 @@ retry:
DRM_UNLOCK(dev);
vm_page_lock(page);
VM_OBJECT_WUNLOCK(vm_obj);
-   vm_page_busy_sleep(page, "915pbs");
+   vm_page_busy_sleep(page, "915pbs", false);
goto retry;
}
if (vm_page_insert(page, vm_obj, OFF_TO_IDX(offset))) {

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c   Thu Oct 13 13:53:01 2016
(r307217)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c   Thu Oct 13 14:41:05 2016
(r307218)
@@ -236,7 +236,7 @@ reserve:
if (vm_page_busied(m)) {
 

svn commit: r307220 - head/lib/libc/tests/stdio

2016-10-13 Thread Ruslan Bukin
Author: br
Date: Thu Oct 13 15:26:51 2016
New Revision: 307220
URL: https://svnweb.freebsd.org/changeset/base/307220

Log:
  Fix typos: use correct string format and value to compare.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D8226

Modified:
  head/lib/libc/tests/stdio/printbasic_test.c

Modified: head/lib/libc/tests/stdio/printbasic_test.c
==
--- head/lib/libc/tests/stdio/printbasic_test.c Thu Oct 13 15:23:53 2016
(r307219)
+++ head/lib/libc/tests/stdio/printbasic_test.c Thu Oct 13 15:26:51 2016
(r307220)
@@ -124,10 +124,10 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt(S_ULONGMAX, "%lu", ULONG_MAX);
 
testfmt("-1", "%lld", (long long)-1);
-   testfmt(S_ULONGMAX, "%lu", ULLONG_MAX);
+   testfmt(S_ULLONGMAX, "%llu", ULLONG_MAX);
 
testfmt("-1", "%d", -1);
-   testfmt(S_UINT32MAX, "%lu", UINT32_MAX);
+   testfmt(S_UINT32MAX, "%u", UINT32_MAX);
 
testfmt("-1", "%hd", -1);
testfmt("65535", "%hu", USHRT_MAX);
___
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: r307223 - head/sys/contrib/octeon-sdk

2016-10-13 Thread Ed Maste
Author: emaste
Date: Thu Oct 13 16:57:19 2016
New Revision: 307223
URL: https://svnweb.freebsd.org/changeset/base/307223

Log:
  Convert ­ U+00AD soft hyphen to - in Cavium Octeon SDK
  
  Linux's copy of the Cavium SDK does not have these non-ASCII characters
  and this reduces noise in diffs when comparing the two.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/contrib/octeon-sdk/cvmx-dma-engine.h
  head/sys/contrib/octeon-sdk/cvmx-higig.h
  head/sys/contrib/octeon-sdk/cvmx-pcie.c
  head/sys/contrib/octeon-sdk/cvmx-raid.h

Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.h
==
--- head/sys/contrib/octeon-sdk/cvmx-dma-engine.h   Thu Oct 13 16:45:01 
2016(r307222)
+++ head/sys/contrib/octeon-sdk/cvmx-dma-engine.h   Thu Oct 13 16:57:19 
2016(r307223)
@@ -87,7 +87,7 @@ typedef union
 PCIe memory space pointers in 
the LAST POINTERS block in the
 OUTBOUND, INBOUND, and 
EXTERNAL-ONLY cases. Must be zero in the
 INTERNAL-ONLY case. Must be 
zero on chips with PCI */
-cvmx_dma_engine_transfer_t type :  2; /**< Type � A given PCI DMA 
transfer is either OUTBOUND (read from L2/DRAM,
+cvmx_dma_engine_transfer_t type :  2; /**< Type - A given PCI DMA 
transfer is either OUTBOUND (read from L2/DRAM,
 write into PCI / PCIe memory 
space), INBOUND (read from PCI / PCIe memory space, write
 into L2/DRAM), INTERNAL-ONLY 
(read from L2/DRAM, write into L2/DRAM), or
 EXTERNAL-ONLY (read from PCIe 
memory space, write into PCIe memory space). */
@@ -95,14 +95,14 @@ typedef union
 work-queue entry that is 
submitted by the hardware after completing the DMA;
 when WQP = 0, PTR (if 
non-zero) is a pointer to a byte in local memory that
 is written to 0 by the 
hardware after completing the DMA. */
-uint64_tc   :  1;   /**< C � Counter. 1 = use counter 
1, 0 = use counter 0.
+uint64_tc   :  1;   /**< C - Counter. 1 = use counter 
1, 0 = use counter 0.
 The C bit selects between the 
two counters (NPEI_DMA_CNTS[DMA0,DMA1])
 that can optionally be updated 
after an OUTBOUND or EXTERNAL-ONLY
 transfer, and also selects 
between the two forced-interrupt bits
 (NPEI_INT_SUMn[DMA0_FI, 
DMA1_FI]) that can optionally be set after an
 OUTBOUND or EXTERNAL-ONLY 
transfer. C must be zero for INBOUND or
 INTERNAL-ONLY transfers. */
-uint64_tca  :  1;   /**< CA � Counter add.
+uint64_tca  :  1;   /**< CA - Counter add.
 When CA = 1, the hardware 
updates the selected counter after it completes the
 PCI DMA OUTBOUND or 
EXTERNAL-ONLY Instruction.
 - If C = 0, PCIE_DMA_CNT0 
is updated
@@ -117,13 +117,13 @@ typedef union
 When CA = 0, the hardware does 
not update any counters.
 For an INBOUND or 
INTERNAL-ONLY PCI DMA transfer, CA must never be
 set, and the hardware never 
adds to the counters. */
-uint64_tfi  :  1;   /**< FI � Force interrupt.
+uint64_tfi  :  1;   /**< FI - Force interrupt.
 When FI is set for an OUTBOUND 
or EXTERNAL-ONLY transfer, the hardware
 sets a forced interrupt bit 
after it completes the PCI DMA Instruction. If C = 0,
 NPEI_INT_SUMn[DMA0_FI] is set, 
else NPEI_INT_SUMn[DMA1_FI] is set. For
 an INBOUND or INTERNAL-ONLY 
PCI DMA operation, FI must never be set,
 and the hardware never 
generates interrupts. */
-uint64_tii  :  1;   /**< II� Ignore the I bit (i.e. 
the I bit of the PCI DMA instruction local pointer).
+uint64_tii  :  1;   /**< II- Ignore the I bit (i.e. 
the I bit of the PCI DMA instruction local pointer).

svn commit: r307221 - head/sys/net80211

2016-10-13 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 13 16:41:34 2016
New Revision: 307221
URL: https://svnweb.freebsd.org/changeset/base/307221

Log:
  [net80211] add some more QoS frame subtypes.

Modified:
  head/sys/net80211/ieee80211.h

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Thu Oct 13 15:26:51 2016
(r307220)
+++ head/sys/net80211/ieee80211.h   Thu Oct 13 16:41:34 2016
(r307221)
@@ -157,8 +157,17 @@ struct ieee80211_qosframe_addr4 {
 #defineIEEE80211_FC0_SUBTYPE_CFPOLL0x60
 #defineIEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
 #defineIEEE80211_FC0_SUBTYPE_QOS   0x80
+#defineIEEE80211_FC0_SUBTYPE_QOS_CFACK 0x90
+#defineIEEE80211_FC0_SUBTYPE_QOS_CFPOLL0xa0
+#defineIEEE80211_FC0_SUBTYPE_QOS_CFACKPOLL 0xb0
 #defineIEEE80211_FC0_SUBTYPE_QOS_NULL  0xc0
 
+#defineIEEE80211_FC0_QOSDATA \
+   
(IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_VERSION_0)
+
+#defineIEEE80211_IS_QOSDATA(wh) \
+   ((wh)->i_fc[0] == IEEE80211_FC0_QOSDATA)
+
 #defineIEEE80211_FC1_DIR_MASK  0x03
 #defineIEEE80211_FC1_DIR_NODS  0x00/* STA->STA */
 #defineIEEE80211_FC1_DIR_TODS  0x01/* STA->AP  */
@@ -199,6 +208,8 @@ struct ieee80211_qosframe_addr4 {
 #defineIEEE80211_NWID_LEN  32
 #defineIEEE80211_MESHID_LEN32
 
+#defineIEEE80211_QOS_CTL_LEN   2
+
 #defineIEEE80211_QOS_TXOP  0x00ff
 /* bit 8 is reserved */
 #defineIEEE80211_QOS_AMSDU 0x80
___
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: r307224 - head/usr.sbin/efivar

2016-10-13 Thread Warner Losh
Author: imp
Date: Thu Oct 13 17:03:54 2016
New Revision: 307224
URL: https://svnweb.freebsd.org/changeset/base/307224

Log:
  'b' is short for --binary, it isn't 'a'.
  
  PR: 213437
  Submitted by: Ganael LAPLANCHE

Modified:
  head/usr.sbin/efivar/efivar.8

Modified: head/usr.sbin/efivar/efivar.8
==
--- head/usr.sbin/efivar/efivar.8   Thu Oct 13 16:57:19 2016
(r307223)
+++ head/usr.sbin/efivar/efivar.8   Thu Oct 13 17:03:54 2016
(r307224)
@@ -98,7 +98,7 @@ UEFI Specification for hex values to use
 Display the variable data as modified ascii: All printable characters
 are printed, while unprintable characters are rendered as a two-digit
 hexadecimal number preceeded by a % character.
-.It Fl A Fl -binary
+.It Fl b Fl -binary
 Display the variable data as binary data.
 Usually will be used with the
 .Fl N
___
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: r307222 - head/sys/net80211

2016-10-13 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 13 16:45:01 2016
New Revision: 307222
URL: https://svnweb.freebsd.org/changeset/base/307222

Log:
  [net80211] remove now duplicate copy of the QOSDATA check macro.

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cThu Oct 13 16:41:34 2016
(r307221)
+++ head/sys/net80211/ieee80211_ht.cThu Oct 13 16:45:01 2016
(r307222)
@@ -779,8 +779,6 @@ ampdu_rx_flush_upto(struct ieee80211_nod
 int
 ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m)
 {
-#defineIEEE80211_FC0_QOSDATA \
-   
(IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_VERSION_0)
 #definePROCESS 0   /* caller should process frame */
 #defineCONSUMED1   /* frame consumed, caller does nothing 
*/
struct ieee80211vap *vap = ni->ni_vap;
@@ -966,7 +964,6 @@ again:
}
 #undef CONSUMED
 #undef PROCESS
-#undef IEEE80211_FC0_QOSDATA
 }
 
 /*
___
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: r307225 - head/sys/contrib/octeon-sdk

2016-10-13 Thread Ed Maste
Author: emaste
Date: Thu Oct 13 17:16:32 2016
New Revision: 307225
URL: https://svnweb.freebsd.org/changeset/base/307225

Log:
  Fix octeon model comparison in Cavium SDK
  
  buildkernel failed with GCC 5.3 with
  error: comparison of constant '852736' with boolean expression is always true
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/contrib/octeon-sdk/cvmx-pcie.c

Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c
==
--- head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 17:03:54 2016
(r307224)
+++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 17:16:32 2016
(r307225)
@@ -981,7 +981,7 @@ static int __cvmx_pcie_rc_initialize_gen
 
 /* Make sure we aren't trying to setup a target mode interface in host 
mode */
 mio_rst_ctl.u64 = cvmx_read_csr(CVMX_MIO_RST_CTLX(pcie_port));
-ep_mode = (OCTEON_IS_MODEL(OCTEON_CN61XX || 
OCTEON_IS_MODEL(OCTEON_CNF71XX)) ? (mio_rst_ctl.s.prtmode != 1) : 
(!mio_rst_ctl.s.host_mode));
+ep_mode = ((OCTEON_IS_MODEL(OCTEON_CN61XX) || 
OCTEON_IS_MODEL(OCTEON_CNF71XX)) ? (mio_rst_ctl.s.prtmode != 1) : 
(!mio_rst_ctl.s.host_mode));
 if (ep_mode)
 {
 cvmx_dprintf("PCIe: Port %d in endpoint mode.\n", pcie_port);
___
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: r307226 - head/sys/netinet/tcp_stacks

2016-10-13 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 13 18:02:29 2016
New Revision: 307226
URL: https://svnweb.freebsd.org/changeset/base/307226

Log:
  With build without TCP_HHOOK and with INVARIANTS.  Before mutex.h came
  via sys/hhook.h -> sys/rmlock.h -> sys/mutex.h.

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

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Thu Oct 13 17:16:32 2016
(r307225)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Thu Oct 13 18:02:29 2016
(r307226)
@@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$");
 #include "opt_tcpdebug.h"
 
 #include 
+#include 
 #include 
+#include 
 #include 
 #ifdef TCP_HHOOK
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307233 - head/sys/dev/cxgbe

2016-10-13 Thread Navdeep Parhar
Author: np
Date: Thu Oct 13 19:40:21 2016
New Revision: 307233
URL: https://svnweb.freebsd.org/changeset/base/307233

Log:
  cxgbe(4): Allow the interface MTU to be set as high as the actual
  hardware limit.
  
  Submitted by: jpaetzel@
  Differential Revision:https://reviews.freebsd.org/D8237

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Oct 13 19:33:07 2016
(r307232)
+++ head/sys/dev/cxgbe/t4_main.cThu Oct 13 19:40:21 2016
(r307233)
@@ -1567,7 +1567,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned 
switch (cmd) {
case SIOCSIFMTU:
mtu = ifr->ifr_mtu;
-   if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO))
+   if (mtu < ETHERMIN || mtu > MAX_MTU)
return (EINVAL);
 
rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu");
___
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: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib

2016-10-13 Thread Ed Schouten
Author: ed
Date: Thu Oct 13 18:25:40 2016
New Revision: 307227
URL: https://svnweb.freebsd.org/changeset/base/307227

Log:
  Improve typing of POSIX search tree functions.
  
  Back in 2015 when I reimplemented these functions to use an AVL tree, I
  was annoyed by the weakness of the typing of these functions. Both tree
  nodes and keys are represented by 'void *', meaning that things like the
  documentation for these functions are an absolute train wreck.
  
  To make things worse, users of these functions need to cast the return
  value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to
  access the key. Technically speaking such casts violate aliasing rules.
  I've observed actual breakages as a result of this by enabling features
  like LTO.
  
  I've filed a bug report at the Austin Group. Looking at the way the bug
  got resolved, they made a pretty good step in the right direction. A new
  type 'posix_tnode' has been added to correspond to tree nodes. It is
  still defined as 'void' for source-level compatibility, but in the very
  far future it could be replaced by a proper structure type containing a
  key pointer.
  
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D8205

Modified:
  head/include/search.h
  head/lib/libc/stdlib/tdelete.c
  head/lib/libc/stdlib/tfind.c
  head/lib/libc/stdlib/tsearch.3
  head/lib/libc/stdlib/tsearch.c
  head/lib/libc/stdlib/twalk.c
  head/lib/libc/tests/stdlib/tsearch_test.c

Modified: head/include/search.h
==
--- head/include/search.h   Thu Oct 13 18:02:29 2016(r307226)
+++ head/include/search.h   Thu Oct 13 18:25:40 2016(r307227)
@@ -34,16 +34,18 @@ typedef enum {
 } VISIT;
 
 #ifdef _SEARCH_PRIVATE
-typedefstruct node {
-   void *key;
-   struct node  *llink, *rlink;
-   signed char   balance;
-} node_t;
+typedef struct __posix_tnode {
+   void*key;
+   struct __posix_tnode*llink, *rlink;
+   signed char  balance;
+} posix_tnode;
 
 struct que_elem {
struct que_elem *next;
struct que_elem *prev;
 };
+#else
+typedef void posix_tnode;
 #endif
 
 #if __BSD_VISIBLE
@@ -62,12 +64,15 @@ void*lfind(const void *, const void *, 
 void   *lsearch(const void *, void *, size_t *, size_t,
int (*)(const void *, const void *));
 voidremque(void *);
-void   *tdelete(const void * __restrict, void ** __restrict,
+void   *tdelete(const void * __restrict, posix_tnode ** __restrict,
int (*)(const void *, const void *));
-void   *tfind(const void *, void * const *,
+posix_tnode *
+tfind(const void *, posix_tnode * const *,
int (*)(const void *, const void *));
-void   *tsearch(const void *, void **, int (*)(const void *, const void *));
-voidtwalk(const void *, void (*)(const void *, VISIT, int));
+posix_tnode *
+tsearch(const void *, posix_tnode **,
+   int (*)(const void *, const void *));
+voidtwalk(const posix_tnode *, void (*)(const posix_tnode *, VISIT, int));
 
 #if __BSD_VISIBLE
 int hcreate_r(size_t, struct hsearch_data *);

Modified: head/lib/libc/stdlib/tdelete.c
==
--- head/lib/libc/stdlib/tdelete.c  Thu Oct 13 18:02:29 2016
(r307226)
+++ head/lib/libc/stdlib/tdelete.c  Thu Oct 13 18:25:40 2016
(r307227)
@@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$");
 * that we won't need to perform any rotations above\
 * this point. In this case rotations are always\
 * capable of keeping the subtree in balance. Make  \
-* this the base node and reset the path.   \
+* this the root node and reset the path.   \
 */ \
-   base = leaf;\
+   rootp = leaf;   \
path_init();   \
}   \
path_taking_left();\
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #defineGO_RIGHT() do { 
\
if ((*leaf)->balance == 0 ||\
((*leaf)->balance > 0 && (*leaf)->llink->balance == 0)) {   \
-   base = leaf;\
+   rootp = leaf;   \
path_init();   \
}   \
path_taking_right();   

svn commit: r307230 - in head/lib: libgcc_eh libgcc_s

2016-10-13 Thread Ed Maste
Author: emaste
Date: Thu Oct 13 18:57:18 2016
New Revision: 307230
URL: https://svnweb.freebsd.org/changeset/base/307230

Log:
  Introduce lib/libgcc_eh and lib/libgcc_s for LLVM's implementation
  
  They are not yet connected to the build, but I am adding them to allow
  for easier testing, ports exp-runs, etc.
  
  Reviewed by:  ed
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8188

Added:
  head/lib/libgcc_eh/
  head/lib/libgcc_eh/Makefile   (contents, props changed)
  head/lib/libgcc_eh/Makefile.inc   (contents, props changed)
  head/lib/libgcc_s/
  head/lib/libgcc_s/Makefile   (contents, props changed)
  head/lib/libgcc_s/Version.map   (contents, props changed)

Added: head/lib/libgcc_eh/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libgcc_eh/Makefile Thu Oct 13 18:57:18 2016(r307230)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.include 
+
+PACKAGE=   clibs
+LIB=   gcc_eh
+NO_PIC=
+WARNS?=2
+
+.include "Makefile.inc"
+
+.include 

Added: head/lib/libgcc_eh/Makefile.inc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libgcc_eh/Makefile.inc Thu Oct 13 18:57:18 2016
(r307230)
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+COMPILERRTDIR= ${SRCTOP}/contrib/compiler-rt
+UNWINDINCDIR=  ${SRCTOP}/contrib/llvm/projects/libunwind/include
+UNWINDSRCDIR=  ${SRCTOP}/contrib/llvm/projects/libunwind/src
+
+CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
+
+.PATH: ${COMPILERRTDIR}/lib/builtins
+.PATH: ${UNWINDSRCDIR}
+SRCS+= gcc_personality_v0.c
+SRCS+= int_util.c
+SRCS+= Unwind-EHABI.cpp
+SRCS+= Unwind-sjlj.c
+SRCS+= UnwindLevel1-gcc-ext.c
+SRCS+= UnwindLevel1.c
+SRCS+= UnwindRegistersRestore.S
+SRCS+= UnwindRegistersSave.S
+SRCS+= libunwind.cpp
+
+CFLAGS+=   -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY
+.if empty(CXXFLAGS:M-std=*)
+CXXFLAGS+= -std=c++11
+.endif
+CXXFLAGS+= -fno-rtti
+STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
+.if ${MK_DIRDEPS_BUILD} == "yes"
+# Avoid dependency on lib/libc++
+CFLAGS+=   -I${SRCTOP}/contrib/libc++/include
+.endif

Added: head/lib/libgcc_s/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libgcc_s/Makefile  Thu Oct 13 18:57:18 2016(r307230)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+PKG=   clibs
+SHLIB_NAME=libgcc_s.so.1
+
+WARNS?=2
+
+LDFLAGS+=  -nodefaultlibs
+VERSION_MAP=   ${.CURDIR}/Version.map
+
+.include "../libcompiler_rt/Makefile.inc"
+.include "../libgcc_eh/Makefile.inc"
+
+.include 

Added: head/lib/libgcc_s/Version.map
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libgcc_s/Version.map   Thu Oct 13 18:57:18 2016
(r307230)
@@ -0,0 +1,123 @@
+/*
+ * $FreeBSD$
+ */
+
+GCC_3.0 {
+   __absvdi2;
+   __absvsi2;
+   __addvdi3;
+   __addvsi3;
+   __ashlti3;
+   __ashrti3;
+   __clear_cache;
+   __cmpti2;
+   __deregister_frame;
+   __deregister_frame_info;
+   __deregister_frame_info_bases;
+   __divti3;
+   __ffsdi2;
+   __ffsti2;
+   __fixdfti;
+   __fixsfti;
+   __fixunsdfdi;
+   __fixunsdfti;
+   __fixunssfdi;
+   __fixunssfti;
+   __fixunsxfdi;
+   __fixunsxfti;
+   __fixxfti;
+   __floattidf;
+   __floattisf;
+   __floattixf;
+   __lshrti3;
+   __modti3;
+   __mulvdi3;
+   __mulvsi3;
+   __multi3;
+   __negti2;
+   __negvdi2;
+   __negvsi2;
+   __register_frame;
+   __register_frame_info;
+   __register_frame_info_bases;
+   __register_frame_info_table;
+   __register_frame_info_table_bases;
+   __register_frame_table;
+   __subvdi3;
+   __subvsi3;
+   __ucmpti2;
+   __udivmodti4;
+   __udivti3;
+   __umodti3;
+   _Unwind_DeleteException;
+   _Unwind_Find_FDE;
+   _Unwind_ForcedUnwind;
+   _Unwind_GetDataRelBase;
+   _Unwind_GetGR;
+   _Unwind_GetIP;
+   _Unwind_GetLanguageSpecificData;
+   _Unwind_GetRegionStart;
+   _Unwind_GetTextRelBase;
+   _Unwind_RaiseException;
+   _Unwind_Resume;
+   _Unwind_SetGR;
+   _Unwind_SetIP;
+};
+
+GCC_3.3 {
+   _Unwind_Backtrace;
+   _Unwind_FindEnclosingFunction;
+   _Unwind_GetCFA;
+   _Unwind_Resume_or_Rethrow;
+} GCC_3.0;
+
+GCC_3.3.1 {
+   __gcc_personality_v0;
+} GCC_3.3;
+
+GCC_3.4 {
+   __clzdi2;
+   __clzti2;
+   __ctzdi2;
+   __ctzti2;
+   __paritydi2;
+   __parityti2;
+   __popcountdi2;
+   __popcountti2;
+} GCC_3.3.1;
+
+GCC_3.4.2 {
+ 

svn commit: r307231 - head/lib/libgcc_s

2016-10-13 Thread Ed Maste
Author: emaste
Date: Thu Oct 13 19:18:00 2016
New Revision: 307231
URL: https://svnweb.freebsd.org/changeset/base/307231

Log:
  libgcc_s: add libm dependencies from div{d,s,x}c3
  
  compiler-rt's complex division support routines contain calls to
  compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
  turns these back into a call to `scalbnl`.
  
  For now link libm's C version of the required support routines.
  
  Reviewed by:  ed
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8190

Modified:
  head/lib/libgcc_s/Makefile

Modified: head/lib/libgcc_s/Makefile
==
--- head/lib/libgcc_s/Makefile  Thu Oct 13 18:57:18 2016(r307230)
+++ head/lib/libgcc_s/Makefile  Thu Oct 13 19:18:00 2016(r307231)
@@ -11,4 +11,22 @@ VERSION_MAP= ${.CURDIR}/Version.map
 .include "../libcompiler_rt/Makefile.inc"
 .include "../libgcc_eh/Makefile.inc"
 
+LIBCSRCDIR=${SRCTOP}/lib/libc
+LIBMSRCDIR=${SRCTOP}/lib/msun/src
+CFLAGS+=   -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/${MACHINE_CPUARCH}
+CFLAGS+=   -I${LIBMSRCDIR}
+.PATH: ${LIBMSRCDIR}
+SRCS+= s_fabs.c
+SRCS+= s_fabsf.c
+SRCS+= s_fabsl.c
+SRCS+= s_fmax.c
+SRCS+= s_fmaxf.c
+SRCS+= s_fmaxl.c
+SRCS+= s_logb.c
+SRCS+= s_logbf.c
+SRCS+= s_logbl.c
+SRCS+= s_scalbn.c
+SRCS+= s_scalbnf.c
+SRCS+= s_scalbnl.c
+
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-10-13 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 13 20:15:47 2016
New Revision: 307234
URL: https://svnweb.freebsd.org/changeset/base/307234

Log:
  - Revert r300854, r303657 which tried to fix regression from r297225.
  - Fix the regression proper way using RO_RTFREE().
  
  Submitted by: ae

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Oct 13 19:40:21 2016(r307233)
+++ head/sys/netinet/in_pcb.c   Thu Oct 13 20:15:47 2016(r307234)
@@ -1299,10 +1299,7 @@ in_pcbfree(struct inpcb *inp)
if (inp->inp_moptions != NULL)
inp_freemoptions(inp->inp_moptions);
 #endif
-   if (inp->inp_route.ro_rt) {
-   RTFREE(inp->inp_route.ro_rt);
-   inp->inp_route.ro_rt = (struct rtentry *)NULL;
-   }
+   RO_RTFREE(>inp_route);
if (inp->inp_route.ro_lle)
LLE_FREE(inp->inp_route.ro_lle);/* zeros ro_lle */
 
@@ -2242,10 +2239,7 @@ void
 in_losing(struct inpcb *inp)
 {
 
-   if (inp->inp_route.ro_rt) {
-   RTFREE(inp->inp_route.ro_rt);
-   inp->inp_route.ro_rt = (struct rtentry *)NULL;
-   }
+   RO_RTFREE(>inp_route);
if (inp->inp_route.ro_lle)
LLE_FREE(inp->inp_route.ro_lle);/* zeros ro_lle */
return;

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cThu Oct 13 19:40:21 2016
(r307233)
+++ head/sys/netinet/ip_output.cThu Oct 13 20:15:47 2016
(r307234)
@@ -704,11 +704,7 @@ sendit:
IPSTAT_INC(ips_fragmented);
 
 done:
-   /*
-* Release the route if using our private route, or if
-* (with flowtable) we don't have our own reference.
-*/
-   if (ro ==  || ro->ro_flags & RT_NORTREF)
+   if (ro == )
RO_RTFREE(ro);
else if (rte == NULL)
/*

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Thu Oct 13 19:40:21 2016
(r307233)
+++ head/sys/netinet6/ip6_output.c  Thu Oct 13 20:15:47 2016
(r307234)
@@ -1064,12 +1064,7 @@ sendorfree:
IP6STAT_INC(ip6s_fragmented);
 
 done:
-   /*
-* Release the route if using our private route, or if
-* (with flowtable) we don't have our own reference.
-*/
-   if (ro ==  ||
-   (ro != NULL && ro->ro_flags & RT_NORTREF))
+   if (ro == )
RO_RTFREE(ro);
return (error);
 
___
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: r307232 - head/sys/fs/nandfs

2016-10-13 Thread Ganael LAPLANCHE
Author: martymac (ports committer)
Date: Thu Oct 13 19:33:07 2016
New Revision: 307232
URL: https://svnweb.freebsd.org/changeset/base/307232

Log:
  Fix panic() message reporting ufs instead of nandfs
  
  PR:   213438
  Approved by:  kib

Modified:
  head/sys/fs/nandfs/nandfs_vnops.c

Modified: head/sys/fs/nandfs/nandfs_vnops.c
==
--- head/sys/fs/nandfs/nandfs_vnops.c   Thu Oct 13 19:18:00 2016
(r307231)
+++ head/sys/fs/nandfs/nandfs_vnops.c   Thu Oct 13 19:33:07 2016
(r307232)
@@ -2211,7 +2211,7 @@ nandfs_whiteout(struct vop_whiteout_args
/* Create a new directory whiteout */
 #ifdef INVARIANTS
if ((cnp->cn_flags & SAVENAME) == 0)
-   panic("ufs_whiteout: missing name");
+   panic("nandfs_whiteout: missing name");
 #endif
error = nandfs_add_dirent(dvp, NANDFS_WHT_INO, cnp->cn_nameptr,
cnp->cn_namelen, DT_WHT);
___
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: r307236 - head/sys/vm

2016-10-13 Thread Conrad Meyer
On Thu, Oct 13, 2016 at 1:39 PM, Mark Johnston  wrote:
> Author: markj
> Date: Thu Oct 13 20:39:34 2016
> New Revision: 307236
> URL: https://svnweb.freebsd.org/changeset/base/307236
>
> Log:
>   Plug a potential vnode lock leak in vm_fault_hold().

This isn't just potential, right?  I believe we hit this one
empirically with an assert in place of this if/vput.

Best,
Conrad
___
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: r307235 - in head: sbin/pfctl share/man/man5 sys/netpfil/pf

2016-10-13 Thread Kristof Provost
Author: kp
Date: Thu Oct 13 20:34:44 2016
New Revision: 307235
URL: https://svnweb.freebsd.org/changeset/base/307235

Log:
  pf: port extended DSCP support from OpenBSD
  
  Ignore the ECN bits on 'tos' and 'set-tos' and allow to use
  DCSP names instead of having to embed their TOS equivalents
  as plain numbers.
  
  Obtained from:OpenBSD
  Sponsored by: OPNsense
  Differential Revision:https://reviews.freebsd.org/D8165

Modified:
  head/sbin/pfctl/parse.y
  head/share/man/man5/pf.conf.5
  head/sys/netpfil/pf/pf.c
  head/sys/netpfil/pf/pf_norm.c

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Thu Oct 13 20:15:47 2016(r307234)
+++ head/sbin/pfctl/parse.y Thu Oct 13 20:34:44 2016(r307235)
@@ -351,6 +351,8 @@ void decide_address_family(struct node_
 voidremove_invalid_hosts(struct node_host **, sa_family_t *);
 int invalid_redirect(struct node_host *, sa_family_t);
 u_int16_t parseicmpspec(char *, sa_family_t);
+int kw_casecmp(const void *, const void *);
+int map_tos(char *string, int *);
 
 static TAILQ_HEAD(loadanchorshead, loadanchors)
 loadanchorshead = TAILQ_HEAD_INITIALIZER(loadanchorshead);
@@ -3584,15 +3586,17 @@ icmp6type   : STRING{
;
 
 tos: STRING{
-   if (!strcmp($1, "lowdelay"))
-   $$ = IPTOS_LOWDELAY;
-   else if (!strcmp($1, "throughput"))
-   $$ = IPTOS_THROUGHPUT;
-   else if (!strcmp($1, "reliability"))
-   $$ = IPTOS_RELIABILITY;
-   else if ($1[0] == '0' && $1[1] == 'x')
-   $$ = strtoul($1, NULL, 16);
-   else
+   int val;
+   char *end;
+
+   if (map_tos($1, ))
+   $$ = val;
+   else if ($1[0] == '0' && $1[1] == 'x') {
+   errno = 0;
+   $$ = strtoul($1, , 16);
+   if (errno || *end != '\0')
+   $$ = 256;
+   } else
$$ = 256;   /* flag bad argument */
if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
@@ -6250,6 +6254,57 @@ pfctl_load_anchors(int dev, struct pfctl
 }
 
 int
+kw_casecmp(const void *k, const void *e)
+{
+   return (strcasecmp(k, ((const struct keywords *)e)->k_name));
+}
+
+int
+map_tos(char *s, int *val)
+{
+   /* DiffServ Codepoints and other TOS mappings */
+   const struct keywordstoswords[] = {
+   { "af11",   IPTOS_DSCP_AF11 },
+   { "af12",   IPTOS_DSCP_AF12 },
+   { "af13",   IPTOS_DSCP_AF13 },
+   { "af21",   IPTOS_DSCP_AF21 },
+   { "af22",   IPTOS_DSCP_AF22 },
+   { "af23",   IPTOS_DSCP_AF23 },
+   { "af31",   IPTOS_DSCP_AF31 },
+   { "af32",   IPTOS_DSCP_AF32 },
+   { "af33",   IPTOS_DSCP_AF33 },
+   { "af41",   IPTOS_DSCP_AF41 },
+   { "af42",   IPTOS_DSCP_AF42 },
+   { "af43",   IPTOS_DSCP_AF43 },
+   { "critical",   IPTOS_PREC_CRITIC_ECP },
+   { "cs0",IPTOS_DSCP_CS0 },
+   { "cs1",IPTOS_DSCP_CS1 },
+   { "cs2",IPTOS_DSCP_CS2 },
+   { "cs3",IPTOS_DSCP_CS3 },
+   { "cs4",IPTOS_DSCP_CS4 },
+   { "cs5",IPTOS_DSCP_CS5 },
+   { "cs6",IPTOS_DSCP_CS6 },
+   { "cs7",IPTOS_DSCP_CS7 },
+   { "ef", IPTOS_DSCP_EF },
+   { "inetcontrol",IPTOS_PREC_INTERNETCONTROL },
+   { "lowdelay",   IPTOS_LOWDELAY },
+   { "netcontrol", IPTOS_PREC_NETCONTROL },
+   { "reliability",IPTOS_RELIABILITY },
+   { "throughput", IPTOS_THROUGHPUT }
+   };
+   const struct keywords   *p;
+
+   p = bsearch(s, toswords, sizeof(toswords)/sizeof(toswords[0]),
+   sizeof(toswords[0]), kw_casecmp);
+
+   if (p) {
+   *val = p->k_val;
+   return (1);
+   }
+   return (0);
+}
+
+int
 rt_tableid_max(void)
 {
 #ifdef __FreeBSD__

Modified: head/share/man/man5/pf.conf.5
==
--- head/share/man/man5/pf.conf.5   Thu 

Re: svn commit: r307236 - head/sys/vm

2016-10-13 Thread Mark Johnston
On Thu, Oct 13, 2016 at 01:49:29PM -0700, Conrad Meyer wrote:
> On Thu, Oct 13, 2016 at 1:39 PM, Mark Johnston  wrote:
> > Author: markj
> > Date: Thu Oct 13 20:39:34 2016
> > New Revision: 307236
> > URL: https://svnweb.freebsd.org/changeset/base/307236
> >
> > Log:
> >   Plug a potential vnode lock leak in vm_fault_hold().
> 
> This isn't just potential, right?  I believe we hit this one
> empirically with an assert in place of this if/vput.

Sorry, right, that was bad wording. I meant that the lock is not always
leaked in this error path - the map lookup needs to succeed initially,
after which we need to block for the vnode lock, restart the fault
handler, and then get an error from vm_map_lookup(). If the initial
lookup fails, there's no leak.
___
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: r307237 - head/lib

2016-10-13 Thread Ed Maste
Author: emaste
Date: Thu Oct 13 21:35:48 2016
New Revision: 307237
URL: https://svnweb.freebsd.org/changeset/base/307237

Log:
  garbage collect _libatm, missed in r179308

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Thu Oct 13 20:39:34 2016(r307236)
+++ head/lib/Makefile   Thu Oct 13 21:35:48 2016(r307237)
@@ -26,7 +26,6 @@ SUBDIR=   ${SUBDIR_BOOTSTRAP} \
.WAIT \
libalias \
libarchive \
-   ${_libatm} \
libauditd \
libbegemot \
${_libblacklist} \
@@ -134,7 +133,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
 # libraries, those libraries should be listed as build order dependencies here.
 
 SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
-SUBDIR_DEPEND_libatm= libmd
 SUBDIR_DEPEND_libauditdm= libbsm
 SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
 SUBDIR_DEPEND_libc++:= libcxxrt
___
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: r307236 - head/sys/vm

2016-10-13 Thread Mark Johnston
Author: markj
Date: Thu Oct 13 20:39:34 2016
New Revision: 307236
URL: https://svnweb.freebsd.org/changeset/base/307236

Log:
  Plug a potential vnode lock leak in vm_fault_hold().
  
  Reviewed by:  alc, kib
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8242

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Thu Oct 13 20:34:44 2016(r307235)
+++ head/sys/vm/vm_fault.c  Thu Oct 13 20:39:34 2016(r307236)
@@ -321,6 +321,8 @@ RetryFault:;
growstack = FALSE;
goto RetryFault;
}
+   if (fs.vp != NULL)
+   vput(fs.vp);
return (result);
}
 
___
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: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb

2016-10-13 Thread Alan Somers
On Thu, Jul 2, 2015 at 11:31 AM, Renato Botelho  wrote:
> Author: garga (ports committer)
> Date: Thu Jul  2 17:30:59 2015
> New Revision: 285050
> URL: https://svnweb.freebsd.org/changeset/base/285050
>
> Log:
>   When passwd or group information is changed (by pw, vipw, chpass, ...)
>   temporary file is created and then a rename() call move it to official file.
>   This operation didn't have any check to make sure data was written to disk
>   and if a power cycle happens system could end up with a 0 length passwd
>   or group database.
>
>   There is a pfSense bug with more infor about it:
>
>   https://redmine.pfsense.org/issues/4523
>
>   The following changes were made to protect passwd and group operations:
>
>   * lib/libutil/gr_util.c:
>- Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
>- After rename(), fsync() call on directory for faster result
>
>   * lib/libutil/pw_util.c
>- Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
>
>   * usr.sbin/pwd_mkdb/pwd_mkdb.c
>- Added O_SYNC flag on dbopen() calls
>- After rename(), fsync() call on directory for faster result
>
>   * lib/libutil/pw_util.3
>- pw_lock() returns a file descriptor to master password file on success
>
>   Differential Revision:https://reviews.freebsd.org/D2978
>   Approved by:  bapt
>   Sponsored by: Netgate
>
> Modified:
>   head/lib/libutil/gr_util.c
>   head/lib/libutil/pw_util.3
>   head/lib/libutil/pw_util.c
>   head/usr.sbin/pwd_mkdb/pwd_mkdb.c

This change is making certain pw operations very slow on ZFS root
systems.  The problem is that when you open a file with O_SYNC, every
single write(2) call turns into a zil_commit on ZFS, which is fairly
expensive.  Did you consider using fsync(2) on the temporary files
instead of opening them with O_SYNC?  I just tried that now, and I see
a considerable speedup when running the tests in
/usr/tests/usr.sbin/pw:

Using O_SYNC, as CURRENT does: 4 minutes 5.2 seconds
No synchronous operations at all: 49.5 seconds
Using fsync(2): 56.0 seconds

-Alan
___
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: r307238 - in head/sys/boot: arm/uboot common mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 sparc64/loader

2016-10-13 Thread Baptiste Daroussin
Author: bapt
Date: Thu Oct 13 22:43:49 2016
New Revision: 307238
URL: https://svnweb.freebsd.org/changeset/base/307238

Log:
  Stop closing the network device when netbooting for loaders using the common
  dev_net.c code.
  
  The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
  on some architectures (sparc64 and powerpc64) the default was left to always
  open and close the device for each open and close of a file by the loader
  because it was necessary for u-boot on arm.
  
  Since it has been added, the flag was turned on for every arches including the
  u-boot loader for arm.
  
  This also fixes netbooting on RPi3 (tested by gonzo@)
  
  For the loader.efi it greatly speeds up netbooting
  
  Reviewed by:  emaste, gonzo, tsoome
  Approved by:  gonzo
  MFC after:1 month
  Sponsored by: Gandi.net
  Differential Revision:https://reviews.freebsd.org/D8230

Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/common/dev_net.c
  head/sys/boot/mips/uboot/Makefile
  head/sys/boot/powerpc/kboot/Makefile
  head/sys/boot/powerpc/ofw/Makefile
  head/sys/boot/powerpc/ps3/Makefile
  head/sys/boot/sparc64/loader/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileThu Oct 13 21:35:48 2016
(r307237)
+++ head/sys/boot/arm/uboot/MakefileThu Oct 13 22:43:49 2016
(r307238)
@@ -77,8 +77,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt
 LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
 .endif
 
-CFLAGS+=   -DNETIF_OPEN_CLOSE_ONCE
-
 .if ${MK_FORTH} != "no"
 # Enable BootForth
 BOOT_FORTH=yes

Modified: head/sys/boot/common/dev_net.c
==
--- head/sys/boot/common/dev_net.c  Thu Oct 13 21:35:48 2016
(r307237)
+++ head/sys/boot/common/dev_net.c  Thu Oct 13 22:43:49 2016
(r307238)
@@ -120,11 +120,9 @@ net_open(struct open_file *f, ...)
devname = va_arg(args, char*);
va_end(args);
 
-#ifdef NETIF_OPEN_CLOSE_ONCE
/* Before opening another interface, close the previous one first. */
if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0)
net_cleanup();
-#endif
 
/* On first open, do netif open, mount, etc. */
if (netdev_opens == 0) {
@@ -198,21 +196,6 @@ net_close(struct open_file *f)
 
f->f_devdata = NULL;
 
-#ifndefNETIF_OPEN_CLOSE_ONCE
-   /* Extra close call? */
-   if (netdev_opens <= 0)
-   return (0);
-   netdev_opens--;
-   /* Not last close? */
-   if (netdev_opens > 0)
-   return (0);
-   /* On last close, do netif close, etc. */
-#ifdef NETIF_DEBUG
-   if (debug)
-   printf("net_close: calling net_cleanup()\n");
-#endif
-   net_cleanup();
-#endif
return (0);
 }
 

Modified: head/sys/boot/mips/uboot/Makefile
==
--- head/sys/boot/mips/uboot/Makefile   Thu Oct 13 21:35:48 2016
(r307237)
+++ head/sys/boot/mips/uboot/Makefile   Thu Oct 13 22:43:49 2016
(r307238)
@@ -81,8 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt
 LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
 .endif
 
-CFLAGS+=   -DNETIF_OPEN_CLOSE_ONCE
-
 .if ${MK_FORTH} != "no"
 # Enable BootForth
 BOOT_FORTH=yes

Modified: head/sys/boot/powerpc/kboot/Makefile
==
--- head/sys/boot/powerpc/kboot/MakefileThu Oct 13 21:35:48 2016
(r307237)
+++ head/sys/boot/powerpc/kboot/MakefileThu Oct 13 22:43:49 2016
(r307238)
@@ -68,10 +68,7 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../..
 LIBFICL=   ${.OBJDIR}/../../ficl/libficl.a
 .endif
 
-# Avoid the open-close-dance for every file access as some firmwares perform
-# an auto-negotiation on every open of the network interface and thus causes
-# netbooting to take horribly long.
-CFLAGS+=   -DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64
+CFLAGS+=   -mcpu=powerpc64
 
 # Always add MI sources
 .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern

Modified: head/sys/boot/powerpc/ofw/Makefile
==
--- head/sys/boot/powerpc/ofw/Makefile  Thu Oct 13 21:35:48 2016
(r307237)
+++ head/sys/boot/powerpc/ofw/Makefile  Thu Oct 13 22:43:49 2016
(r307238)
@@ -67,11 +67,6 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../..
 LIBFICL=   ${.OBJDIR}/../../ficl/libficl.a
 .endif
 
-# Avoid the open-close-dance for every file access as some firmwares perform
-# an auto-negotiation on every open of the network interface and thus causes
-# netbooting to take horribly long.
-CFLAGS+=   -DNETIF_OPEN_CLOSE_ONCE
-
 # Always add MI sources
 .PATH: ${.CURDIR}/../../common 

svn commit: r307239 - head/sys/arm/broadcom/bcm2835

2016-10-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Oct 13 23:29:24 2016
New Revision: 307239
URL: https://svnweb.freebsd.org/changeset/base/307239

Log:
  Fix BCM283x(Raspberry Pi) SDHCI driver for ARM64 build
  
  - Revert BUS_SPACE_PHYSADDR back to rman_get_start. BUS_SPACE_PHYSADDR was
  introduced in 2013 as temporary wrapper until proper solution appears.
  It's ARM only and since we need this file for ARM64 build and no proper
  API has been introduced - just revert the change and make sure it's
  going to appear when people grep for BUS_SPACE_PHYSADDR in sources.
  
  - Fix printf format for size_t variables

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Oct 13 22:43:49 
2016(r307238)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Thu Oct 13 23:29:24 
2016(r307239)
@@ -246,8 +246,9 @@ bcm_sdhci_attach(device_t dev)
goto fail;
}
 
-   sc->sc_sdhci_buffer_phys = BUS_SPACE_PHYSADDR(sc->sc_mem_res, 
-   SDHCI_BUFFER);
+   /* FIXME: Fix along with other BUS_SPACE_PHYSADDR instances */
+   sc->sc_sdhci_buffer_phys = rman_get_start(sc->sc_mem_res) +
+   SDHCI_BUFFER;
 
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -552,7 +553,7 @@ bcm_sdhci_read_dma(device_t dev, struct 
slot->curcmd->data->len - slot->offset);
 
KASSERT((left & 3) == 0,
-   ("%s: len = %d, not word-aligned", __func__, left));
+   ("%s: len = %zu, not word-aligned", __func__, left));
 
if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, 
(uint8_t *)slot->curcmd->data->data + slot->offset, left, 
@@ -581,7 +582,7 @@ bcm_sdhci_write_dma(device_t dev, struct
slot->curcmd->data->len - slot->offset);
 
KASSERT((left & 3) == 0,
-   ("%s: len = %d, not word-aligned", __func__, left));
+   ("%s: len = %zu, not word-aligned", __func__, left));
 
if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map,
(uint8_t *)slot->curcmd->data->data + slot->offset, left, 
___
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: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb

2016-10-13 Thread Don Lewis
On 13 Oct, Alan Somers wrote:
> On Thu, Jul 2, 2015 at 11:31 AM, Renato Botelho  wrote:
>> Author: garga (ports committer)
>> Date: Thu Jul  2 17:30:59 2015
>> New Revision: 285050
>> URL: https://svnweb.freebsd.org/changeset/base/285050
>>
>> Log:
>>   When passwd or group information is changed (by pw, vipw, chpass, ...)
>>   temporary file is created and then a rename() call move it to official 
>> file.
>>   This operation didn't have any check to make sure data was written to disk
>>   and if a power cycle happens system could end up with a 0 length passwd
>>   or group database.
>>
>>   There is a pfSense bug with more infor about it:
>>
>>   https://redmine.pfsense.org/issues/4523
>>
>>   The following changes were made to protect passwd and group operations:
>>
>>   * lib/libutil/gr_util.c:
>>- Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
>>- After rename(), fsync() call on directory for faster result
>>
>>   * lib/libutil/pw_util.c
>>- Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
>>
>>   * usr.sbin/pwd_mkdb/pwd_mkdb.c
>>- Added O_SYNC flag on dbopen() calls
>>- After rename(), fsync() call on directory for faster result
>>
>>   * lib/libutil/pw_util.3
>>- pw_lock() returns a file descriptor to master password file on success
>>
>>   Differential Revision:https://reviews.freebsd.org/D2978
>>   Approved by:  bapt
>>   Sponsored by: Netgate
>>
>> Modified:
>>   head/lib/libutil/gr_util.c
>>   head/lib/libutil/pw_util.3
>>   head/lib/libutil/pw_util.c
>>   head/usr.sbin/pwd_mkdb/pwd_mkdb.c
> 
> This change is making certain pw operations very slow on ZFS root
> systems.  The problem is that when you open a file with O_SYNC, every
> single write(2) call turns into a zil_commit on ZFS, which is fairly
> expensive.  Did you consider using fsync(2) on the temporary files
> instead of opening them with O_SYNC?  I just tried that now, and I see
> a considerable speedup when running the tests in
> /usr/tests/usr.sbin/pw:
> 
> Using O_SYNC, as CURRENT does: 4 minutes 5.2 seconds
> No synchronous operations at all: 49.5 seconds
> Using fsync(2): 56.0 seconds

pwd_mkdb was fixed back in February with by switching to fsync() in
r295925.  It looks like libutil was not fixed, though.


___
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: r307261 - head/sys/dev/hyperv/storvsc

2016-10-13 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Oct 14 05:32:47 2016
New Revision: 307261
URL: https://svnweb.freebsd.org/changeset/base/307261

Log:
  hyperv/stor: Fix off-by-one bug; this brings back TRIM support.
  
  Submitted by: Hongjiang Zhang 
  Reported by:  Lili Deng 
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8238

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cFri Oct 14 
05:05:23 2016(r307260)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cFri Oct 14 
05:32:47 2016(r307261)
@@ -2210,7 +2210,7 @@ storvsc_io_done(struct hv_storvsc_reques
resp_buf[3], resp_buf[4]);
}
if (vm_srb->srb_status == SRB_STATUS_SUCCESS &&
-   data_len > SHORT_INQUIRY_LENGTH) {
+   data_len >= SHORT_INQUIRY_LENGTH) {
char vendor[16];
 
cam_strvis(vendor, inq_data->vendor,
___
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: r307262 - head/sys/dev/hyperv/netvsc

2016-10-13 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Oct 14 05:41:51 2016
New Revision: 307262
URL: https://svnweb.freebsd.org/changeset/base/307262

Log:
  hyperv/hn: Management parts always need suspend and resume.
  
  MFC after:3 days
  Sponsored by: Microsoft

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Oct 14 05:32:47 
2016(r307261)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Oct 14 05:41:51 
2016(r307262)
@@ -354,6 +354,8 @@ static void hn_suspend(struct hn_softc *
 static void hn_suspend_data(struct hn_softc *);
 static void hn_suspend_mgmt(struct hn_softc *);
 static void hn_resume(struct hn_softc *);
+static void hn_resume_data(struct hn_softc *);
+static void hn_resume_mgmt(struct hn_softc *);
 static void hn_rx_drain(struct vmbus_channel *);
 static void hn_tx_resume(struct hn_softc *, int);
 static void hn_tx_ring_qflush(struct hn_tx_ring *);
@@ -1689,8 +1691,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp));
 #endif
 
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-   hn_suspend(sc);
+   /*
+* Suspend this interface before the synthetic parts
+* are ripped.
+*/
+   hn_suspend(sc);
 
/*
 * Detach the synthetics parts, i.e. NVS and RNDIS.
@@ -1708,9 +1713,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
hn_set_chim_size(sc, sc->hn_chim_szmax);
hn_set_tso_maxsize(sc, hn_tso_maxlen, ifr->ifr_mtu);
 
-   /* All done!  Resume now. */
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-   hn_resume(sc);
+   /*
+* All done!  Resume the interface now.
+*/
+   hn_resume(sc);
 
HN_UNLOCK(sc);
break;
@@ -3717,7 +3723,8 @@ static void
 hn_suspend(struct hn_softc *sc)
 {
 
-   hn_suspend_data(sc);
+   if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING)
+   hn_suspend_data(sc);
hn_suspend_mgmt(sc);
 }
 
@@ -3739,7 +3746,7 @@ hn_tx_resume(struct hn_softc *sc, int tx
 }
 
 static void
-hn_resume(struct hn_softc *sc)
+hn_resume_data(struct hn_softc *sc)
 {
int i;
 
@@ -3779,6 +3786,11 @@ hn_resume(struct hn_softc *sc)
 */
taskqueue_enqueue(txr->hn_tx_taskq, >hn_txeof_task);
}
+}
+
+static void
+hn_resume_mgmt(struct hn_softc *sc)
+{
 
/*
 * Kick off link status check.
@@ -3788,6 +3800,15 @@ hn_resume(struct hn_softc *sc)
 }
 
 static void
+hn_resume(struct hn_softc *sc)
+{
+
+   if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING)
+   hn_resume_data(sc);
+   hn_resume_mgmt(sc);
+}
+
+static void
 hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt)
 {
const struct hn_nvs_hdr *hdr;
___
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: r307231 - head/lib/libgcc_s

2016-10-13 Thread Bruce Evans

On Fri, 14 Oct 2016, Ed Maste wrote:


Hi Bruce, thank you for the detailed response.

On 14 October 2016 at 01:53, Bruce Evans  wrote:

 compiler-rt's complex division support routines contain calls to
 compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
 turns these back into a call to `scalbnl`.


gcc-4.2 has the same bug.


Oh, interesting. Do you know off hand if it's resolved in later GCC?


Don't know.


It seems particularly unfortunate for the compiler to report (by
whatever mechanism) that a builtin exists, and then just turn that
builtin into a library call.


Since there is no documentation, I sometimes use strings -a | grep builtin
on the compiler binary to find builtins.  This finds that there are too
many for clang (4655 lines starting with __builtin for the amd64 binary).
Then write some code to see if they are actual builtins.


 For now link libm's C version of the required support routines.


Even libm doesn't use these in some cases.  i386 mostly uses asm
versions.  Hopefully the rt division routines don't need to be efficient
because they are rarely called.


Most likely I'll switch to the asm versions across suitable
architectures in a subsequent change, mirroring the choices made in
libm.  I just wanted to get a version in, to enable further testing
(ports exp-runs, etc.) of this libunwind / compiler-rt combination.


The ifdefs in the makefiles might get complicated sonce it was not
designed for this.

I usually build libm stand-alone, often with older compilers, and don't
like any dependencies on other libraries or includes in it (I use stub
libraries and includes).

scalbn() is also in libc under the name ldexp().  This causes various
messes.  It used to have clones of a C implementation in alpha, amd64,
arm, i386, ia64, powerpc and sparc64 (where at least the i386 version
is in inline asm).  This was cleaned up by removing all the MD
implementations and using 1 generic C implementation with no inline
asm.  Then it was uncleaned by adding an extern asm version for mips.
But the mips Makefile doesn't use this, except possibly by a magic
.c.S suffix translation.  The msun Makefiles have the relatively
minor magic for suffixes.  (They list the .c and .S file and then
remove the .c file from the final list.)

Bruce
___
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: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf

2016-10-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 14 03:37:35 2016
New Revision: 307257
URL: https://svnweb.freebsd.org/changeset/base/307257

Log:
  Add initial Raspberry Pi 3 support
  
  RPI3 kernel config builds kernel compatible with latest upstream device
  tree and firmware: https://github.com/raspberrypi/firmware/tree/master/boot
  As of today it's 597c662a613df1144a6bc43e5f4505d83bd748ca
  
  Default console is PL01x, so pi3-disable-bt dt overlay should be configured
  in config.txt and stock U-Boot should be patched to use proper serial port.
  
  Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due to
  upstream device tree incompatibility.
  
  Multiple people contributed to this work over time: db@, loos@, manu@

Added:
  head/sys/arm64/broadcom/
  head/sys/arm64/broadcom/bcm2837/
  head/sys/arm64/broadcom/bcm2837/files.bcm2837   (contents, props changed)
  head/sys/arm64/conf/RPI3   (contents, props changed)
Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
  head/sys/conf/options.arm64

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h   Fri Oct 14 03:32:20 
2016(r307256)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h   Fri Oct 14 03:37:35 
2016(r307257)
@@ -37,7 +37,7 @@
 #defineBCM2835_VCBUS_IO_BASE   0x7E00
 #defineBCM2835_VCBUS_SDRAM_UNCACHED0xC000
 
-#ifdef SOC_BCM2836
+#if defined(SOC_BCM2836) || defined(SOC_BCM2837)
 #defineBCM2835_ARM_IO_BASE 0x3f00
 #defineBCM2835_VCBUS_SDRAM_BASEBCM2835_VCBUS_SDRAM_UNCACHED
 #else

Added: head/sys/arm64/broadcom/bcm2837/files.bcm2837
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/broadcom/bcm2837/files.bcm2837   Fri Oct 14 03:37:35 
2016(r307257)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+arm/broadcom/bcm2835/bcm2836.c standard
+kern/kern_clocksource.cstandard

Added: head/sys/arm64/conf/RPI3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/conf/RPI3Fri Oct 14 03:37:35 2016(r307257)
@@ -0,0 +1,160 @@
+#
+#
+# RPI3 -- Custom configuration for the Raspberry Pi 3 
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+cpuARM64
+ident  RPI3
+
+files  "../../arm/broadcom/bcm2835/files.bcm283x"
+files  "../broadcom/bcm2837/files.bcm2837"
+
+makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols
+#makeoptions   WITH_CTF=1  # Run ctfconvert(1) for DTrace support
+
+optionsSCHED_ULE   # ULE scheduler
+optionsPREEMPTION  # Enable kernel thread preemption
+optionsINET# InterNETworking
+optionsINET6   # IPv6 communications protocols
+optionsIPSEC   # IP (v4/v6) security
+optionsTCP_HHOOK   # hhook(9) framework for TCP
+optionsTCP_OFFLOAD # TCP offload
+optionsSCTP# Stream Control Transmission Protocol
+optionsFFS # Berkeley Fast Filesystem
+optionsSOFTUPDATES # Enable FFS soft updates support
+optionsUFS_ACL # Support for access control lists
+optionsUFS_DIRHASH # Improve performance on big directories
+optionsUFS_GJOURNAL# Enable gjournal-based UFS journaling
+optionsQUOTA   # Enable disk quotas for UFS
+optionsMD_ROOT # MD is a potential root device
+optionsNFSCL   # Network Filesystem Client
+optionsNFSD# Network Filesystem Server
+optionsNFSLOCKD# Network Lock Manager
+optionsNFS_ROOT# NFS usable as /, requires NFSCL
+optionsMSDOSFS # MSDOS Filesystem
+optionsCD9660  # ISO 9660 Filesystem
+optionsPROCFS  # Process filesystem 

svn commit: r307241 - head/sys/arm/broadcom/bcm2835

2016-10-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 14 01:23:21 2016
New Revision: 307241
URL: https://svnweb.freebsd.org/changeset/base/307241

Log:
  Do not set FB_FLAG_MEMATTR if VM_MEMATTR_WRITE_COMBINING is not available
  
  Pintyhat to: gonzo
  Spotted by: jmallett

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 00:42:08 2016
(r307240)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 01:23:21 2016
(r307241)
@@ -119,8 +119,8 @@ bcm_fb_setup_fbd(struct bcmsc_softc *sc)
sc->info.fb_stride = fb.pitch;
sc->info.fb_width = fb.xres;
sc->info.fb_height = fb.yres;
-   sc->info.fb_flags = FB_FLAG_MEMATTR;
 #ifdef VM_MEMATTR_WRITE_COMBINING
+   sc->info.fb_flags = FB_FLAG_MEMATTR;
sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING;
 #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: r307240 - head/sys/arm/broadcom/bcm2835

2016-10-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 14 00:42:08 2016
New Revision: 307240
URL: https://svnweb.freebsd.org/changeset/base/307240

Log:
  Fix BCM238x framebuffer driver build for ARM64
  
  VM_MEMATTR_WRITE_COMBINING can be undefined for some platforms, use it only
  if it's defined

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu Oct 13 23:29:24 2016
(r307239)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 00:42:08 2016
(r307240)
@@ -120,7 +120,9 @@ bcm_fb_setup_fbd(struct bcmsc_softc *sc)
sc->info.fb_width = fb.xres;
sc->info.fb_height = fb.yres;
sc->info.fb_flags = FB_FLAG_MEMATTR;
+#ifdef VM_MEMATTR_WRITE_COMBINING
sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING;
+#endif
 
if (sc->fbswap) {
switch (sc->info.fb_bpp) {
___
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: r307252 - head/sys/arm/broadcom/bcm2835

2016-10-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Oct 14 03:00:53 2016
New Revision: 307252
URL: https://svnweb.freebsd.org/changeset/base/307252

Log:
  Make bcm2835_machdep.c optional
  
  bcm2835_machdep.c contains only bits enabled by "options PLATFORM", this
  option available only on ARM, not ARM64

Modified:
  head/sys/arm/broadcom/bcm2835/files.bcm283x

Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x
==
--- head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 02:58:31 2016
(r307251)
+++ head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 03:00:53 2016
(r307252)
@@ -9,7 +9,7 @@ arm/broadcom/bcm2835/bcm2835_fbd.c  opti
 arm/broadcom/bcm2835/bcm2835_ft5406.c  optional evdev bcm2835_ft5406
 arm/broadcom/bcm2835/bcm2835_gpio.coptional gpio
 arm/broadcom/bcm2835/bcm2835_intr.cstandard
-arm/broadcom/bcm2835/bcm2835_machdep.c standard
+arm/broadcom/bcm2835/bcm2835_machdep.c optional platform
 arm/broadcom/bcm2835/bcm2835_mbox.cstandard
 arm/broadcom/bcm2835/bcm2835_rng.c optional random
 arm/broadcom/bcm2835/bcm2835_sdhci.c   optional sdhci
___
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: r307243 - head/lib

2016-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 14 01:53:15 2016
New Revision: 307243
URL: https://svnweb.freebsd.org/changeset/base/307243

Log:
  partially convert lib/Makefile to SUBDIR.${MK_FOO} style
  
  Cases other than MK_* (e.g. ${MACHINE_CPUARCH} == "i386") have been left
  as is.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8246

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Fri Oct 14 01:38:29 2016(r307242)
+++ head/lib/Makefile   Fri Oct 14 01:53:15 2016(r307243)
@@ -28,106 +28,69 @@ SUBDIR=${SUBDIR_BOOTSTRAP} \
libarchive \
libauditd \
libbegemot \
-   ${_libblacklist} \
libblocksruntime \
-   ${_libbluetooth} \
-   ${_libbsnmp} \
libbsdstat \
libbsm \
libbz2 \
libcalendar \
libcam \
libcapsicum \
-   ${_libcasper} \
-   ${_libcom_err} \
libcompat \
libcrypt \
libdevctl \
-   ${_libdevdctl} \
libdevinfo \
libdevstat \
libdwarf \
libedit \
-   ${_libefivar} \
-   ${_libelftc} \
libevent \
libexecinfo \
libexpat \
libfetch \
libfigpar \
libgeom \
-   ${_libgpio} \
-   ${_libgssapi} \
-   ${_librpcsec_gss} \
-   ${_libiconv_modules} \
libifconfig \
libipsec \
libjail \
libkiconv \
libkvm \
-   ${_libldns} \
liblzma \
-   ${_libmagic} \
libmemstat \
libmd \
-   ${_libmilter} \
-   ${_libmp} \
libmt \
-   ${_libnandfs} \
lib80211 \
libnetbsd \
-   ${_libnetgraph} \
-   ${_libngatm} \
libnv \
libopenbsd \
libopie \
libpam \
libpcap \
-   ${_libpe} \
libpjdlog \
-   ${_libpmc} \
${_libproc} \
libprocstat \
-   ${_libradius} \
librpcsvc \
librss \
librt \
${_librtld_db} \
libsbuf \
-   ${_libsdp} \
-   ${_libsm} \
libsmb \
-   ${_libsmdb} \
-   ${_libsmutil} \
libsqlite3 \
libstand \
libstdbuf \
libstdthreads \
libsysdecode \
libtacplus \
-   ${_libtelnet} \
-   ${_libthr} \
libthread_db \
libucl \
libufs \
libugidfw \
libulog \
-   ${_libunbound} \
-   ${_libusbhid} \
-   ${_libusb} \
libutil \
${_libvgl} \
-   ${_libvmmapi} \
libwrap \
libxo \
liby \
-   ${_libypclnt} \
libz \
-   ncurses \
-   ${_atf} \
-   ${_clang} \
-   ${_cuse} \
-   ${_tests}
+   ncurses
 
 # Inter-library dependencies.  When the makefile for a library contains LDADD
 # libraries, those libraries should be listed as build order dependencies here.
@@ -159,70 +122,26 @@ SUBDIR_DEPEND_liblzma= ${_libthr}
 
 # NB: keep these sorted by MK_* knobs
 
-.if ${MK_ATM} != "no"
-_libngatm= libngatm
-.endif
-
-.if ${MK_BLACKLIST} != "no"
-_libblacklist= libblacklist
-.endif
-
-.if ${MK_BLUETOOTH} != "no"
-_libbluetooth= libbluetooth
-_libsdp=   libsdp
-.endif
-
-.if ${MK_BSNMP} != "no"
-_libbsnmp= libbsnmp
-.endif
-
-.if ${MK_CASPER} != "no"
-_libcasper=libcasper
-.endif
-
-.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
-_clang=clang
-.endif
-
-.if ${MK_CUSE} != "no"
-_cuse= libcuse
-.endif
-
-.if ${MK_CXX} != "no"
-_libdevdctl=   libdevdctl
-.endif
-
-.if ${MK_TOOLCHAIN} != "no"
-_libelftc= libelftc
-_libpe=libpe
+SUBDIR.${MK_ATM}+= libngatm
+SUBDIR.${MK_BLACKLIST}+=libblacklist
+SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
+SUBDIR.${MK_BSNMP}+=   libbsnmp
+SUBDIR.${MK_CASPER}+=  libcasper
+
+.if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
+SUBDIR.${MK_CLANG}+=   clang
 .endif
 
+SUBDIR.${MK_CUSE}+=libcuse
+SUBDIR.${MK_CXX}+= libdevdctl
+SUBDIR.${MK_TOOLCHAIN}+=libelftc libpe
 SUBDIR.${MK_DIALOG}+=  libdpv
-
-.if ${MK_FILE} != "no"
-_libmagic= libmagic
-.endif
-
-.if ${MK_GPIO} != "no"
-_libgpio=  libgpio
-.endif
-
-.if ${MK_GSSAPI} != "no"
-_libgssapi=libgssapi
-_librpcsec_gss=librpcsec_gss
-.endif
-
-.if ${MK_ICONV} != "no"
-_libiconv_modules= libiconv_modules
-.endif
-
-.if ${MK_KERBEROS_SUPPORT} != "no"
-_libcom_err= libcom_err
-.endif
-
-.if ${MK_LDNS} != "no"
-_libldns=  libldns
-.endif
+SUBDIR.${MK_FILE}+=libmagic
+SUBDIR.${MK_GPIO}+=libgpio
+SUBDIR.${MK_GSSAPI}+=  libgssapi librpcsec_gss
+SUBDIR.${MK_ICONV}+=   libiconv_modules
+SUBDIR.${MK_KERBEROS_SUPPORT}+=libcom_err
+SUBDIR.${MK_LDNS}+=libldns
 
 # The libraries under libclang_rt can only be built by clang, and only make
 # sense to build when clang is enabled at all.  

Re: svn commit: r307231 - head/lib/libgcc_s

2016-10-13 Thread Bruce Evans

On Thu, 13 Oct 2016, Ed Maste wrote:


Log:
 libgcc_s: add libm dependencies from div{d,s,x}c3

 compiler-rt's complex division support routines contain calls to
 compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
 turns these back into a call to `scalbnl`.


gcc-4.2 has the same bug.

This causes problems in the implementation of libm (and other
libraries).  The implementation can never (but sometimes does) use
__builtin_foo() to get a possibly-better optimized or MD or
CFLAGS-dependent version, because when the compiler doesn't have a
better version it usually has the bug if of calling the library version
which calls just itself when it is misimplemented as the builtin.

The __has_builtin() macro is worse than useless for determining if the
builtin is better.  First, it doesn't really exist so is a dummy version
with value 0 on some compilers that have have some better builtins.
clang has the opposite problem -- it has squillions of builtins, but
most of them just call the standard function.  Next, even if the compiler
has a real builtin, there is no way except a benchmark to tell if it is
worth using.  The ones that are always worth using are usually used
automatically, but -ffreestanding and -fno-builtin often turns this off.

In libm, the most interesting builtin is __builtin_fma[fl](), but this
is unusable and not used.  fma*() even has a standard macro
FP_FAST_FMA[FL] to tell you if it is any good.  It is only any good if
it is in pure hardware, but libm hard-codes FP_FAST_FMAF = true and has
special a not-very-fast implementation for the float case.  On x86, it
takes later SSE and/or AVX to give fma*() in hardware, and unportable
CFLGS to use this hardware, and a compiler that supports this and the
__builtin_fma*() spelling to use the instruction (even clang is
excessively IEEE/C conformant on x86 -- it never turns x*y+z into
fma(x,y,z)).  So *fma*() is unusuable for efficiency in practice.  It
gives extra accuracy in some cases and is specified to do that, but
implementing this in software makes using it just a pessimization in
most cases.


 For now link libm's C version of the required support routines.


Even libm doesn't use these in some cases.  i386 mostly uses asm
versions.  Hopefully the rt division routines don't need to be efficient
because they are rarely called.


 Reviewed by:   ed
 Sponsored by:  The FreeBSD Foundation
 Differential Revision: https://reviews.freebsd.org/D8190

Modified:
 head/lib/libgcc_s/Makefile

Modified: head/lib/libgcc_s/Makefile
==
--- head/lib/libgcc_s/Makefile  Thu Oct 13 18:57:18 2016(r307230)
+++ head/lib/libgcc_s/Makefile  Thu Oct 13 19:18:00 2016(r307231)
@@ -11,4 +11,22 @@ VERSION_MAP= ${.CURDIR}/Version.map
.include "../libcompiler_rt/Makefile.inc"
.include "../libgcc_eh/Makefile.inc"

+LIBCSRCDIR=${SRCTOP}/lib/libc
+LIBMSRCDIR=${SRCTOP}/lib/msun/src
+CFLAGS+=   -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/${MACHINE_CPUARCH}
+CFLAGS+=   -I${LIBMSRCDIR}
+.PATH: ${LIBMSRCDIR}
+SRCS+= s_fabs.c
+SRCS+= s_fabsf.c
+SRCS+= s_fabsl.c


The fabs functions cause a smaller set of problems for builtins:
- normally they are automatically inlined as a builtin if they are
  spelled fabs*()
- -ffreestanding turns this off, so rt might need to spell them
  __builtin_fabs*(), but on arches where they aren't real builtins
  the above is still needed
- i386 doesn't bother implementing these in asm since they are usually
  builtins
- the C implementations are good, but are often very badly optimized
  by compilers, due to problems with compilers not understanding
  load/store penalties for the current arch or the compile-time arch
  not matching the runtime arch
- the builtins have the same problem with arch mismatches.


+SRCS+= s_fmax.c
+SRCS+= s_fmaxf.c
+SRCS+= s_fmaxl.c


These are exotic functions which should rarely be used, especially in
portable code that doesn't need to be efficient.  They just give subtle
behaviour for NaNs.  I checked recently that the special builtins for
comparing possible NaNs are insignificantly faster than the generic
code which starts with isnan(), on x86 (this depends on isnan() being
a fast builtin).  The implementation of these functions is basically
to start with an inline C implementation of isnan().  This is likely
to be just slower than the natural max(x, y) code using a comparison,
after adding some isnan()s to the latter.  Division code should have
classified NaNs up front and never use these functions.

i386 doesn't bother to optimize these functions.  I think it can't
do any better than the C code using a builtin relop (x86 has special
relops that behave differently for NaNs, but IIRC these functions
treat NaNs too unusually for either the normal relop or a special
relop to work directly).


+SRCS+= s_logb.c
+SRCS+= s_logbf.c
+SRCS+=   

Re: svn commit: r307231 - head/lib/libgcc_s

2016-10-13 Thread Ed Maste
Hi Bruce, thank you for the detailed response.

On 14 October 2016 at 01:53, Bruce Evans  wrote:
>>  compiler-rt's complex division support routines contain calls to
>>  compiler builtins such as `__builtin_scalbnl`.  Unfortunately Clang
>>  turns these back into a call to `scalbnl`.
>
> gcc-4.2 has the same bug.

Oh, interesting. Do you know off hand if it's resolved in later GCC?

It seems particularly unfortunate for the compiler to report (by
whatever mechanism) that a builtin exists, and then just turn that
builtin into a library call.

>>  For now link libm's C version of the required support routines.
>
> Even libm doesn't use these in some cases.  i386 mostly uses asm
> versions.  Hopefully the rt division routines don't need to be efficient
> because they are rarely called.

Most likely I'll switch to the asm versions across suitable
architectures in a subsequent change, mirroring the choices made in
libm.  I just wanted to get a version in, to enable further testing
(ports exp-runs, etc.) of this libunwind / compiler-rt combination.

[Details about specific groups of functions omitted -- I'll try to
take a look at these later.]

> libcompiler_rt.a now on amd64 now has the following namespace bugs:
>
>  U compilerrt_abort_impl
>  U fflush
>  U fprintf
>  U mprotect
>  U sysconf
>  U fmaxl
>  U logbl
>  U scalbnl
>  U logbf
>  U scalbnf
>  U logb
>  U scalbn
>  U abort
>
> These are bugs since division must be available with -ffreestanding and
> the freestanding library shouldn't have to reimplement it.

Yes, these libcompiler_rt.a issues seem rather surprising to me, but
presumably they aren't causing much of an issue in practice in the
static lib. In any case, my hope is that once I try disentangling
these libraries I can take a look at these issues across the set of
libraries (libcompiler_rt.a aka libgcc.a, libgcc_eh.a, libgcc_s.so).
___
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: r307263 - head/sys/dev/hyperv/vmbus

2016-10-13 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Oct 14 05:47:59 2016
New Revision: 307263
URL: https://svnweb.freebsd.org/changeset/base/307263

Log:
  hyperv/vmbus: Add __FBSDID
  
  Sponsored by: Microsoft

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_br.c

Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c
==
--- head/sys/dev/hyperv/vmbus/vmbus_br.cFri Oct 14 05:41:51 2016
(r307262)
+++ head/sys/dev/hyperv/vmbus/vmbus_br.cFri Oct 14 05:47:59 2016
(r307263)
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Julio Merino
On Thu, Oct 13, 2016 at 3:29 AM, Ngie Cooper (yaneurabeya) <
yaneurab...@gmail.com> wrote:

>
> > On Oct 13, 2016, at 00:20, Julio Merino  wrote:
> >
> > On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper  wrote:
> > Author: ngie
> > Date: Thu Oct 13 07:02:54 2016
> > New Revision: 307190
> > URL: https://svnweb.freebsd.org/changeset/base/307190
> >
> > Log:
> >   Skip :uchg on FreeBSD
> >
> >   Unfortunately removing files with uchg set always succeeds with root on
> >   FreeBSD. Unfortunately running the test as an unprivileged user isn't
> doable
> >   because mounting tmpfs requires root
> >
> >   PR:   212861
> >   Sponsored by: Dell EMC Isilon
> >
> > Modified:
> >   head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
> >
> > Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
> > 
> ==
> > --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13
> 06:56:23 2016(r307189)
> > +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13
> 07:02:54 2016(r307190)
> > @@ -53,6 +53,10 @@ uchg_head() {
> > atf_set "require.user" "root"
> >  }
> >  uchg_body() {
> > +   # Begin FreeBSD
> > +   atf_skip "this fails on FreeBSD with root - bug 212861"
> > +   # End FreeBSD
> >
> > This is a bad way of disabling a test due to a known bug because, when
> the bug is resolved, the test won't notice. You should be using the
> "expected failures" functionality if possible, and based on the change
> description, I think you can do this here easily. Try:
> >
> > atf_expect_fail "FreeBSD bug 213861 blah blah"
> >
> > right before the line that triggers the test failure.
>
> The problem is that this leaves tmpfs mounts lying around, which atf won’t
> cleanup. Otherwise, I would totally agree with you.
>

Replace:

atf_test_case uchg

with:

atf_test_case uchg cleanup

and then add:

uchg_cleanup() {
umount foo/bar 2>/dev/null || true
}

This is actually *necessary* regardless of how you skip the test to ensure
the mount point is cleaned up on any failure of the test. If the tests are
not doing that yet, they are bogus.

-- 
Julio Merino -- http://julio.meroh.net/
___
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: r307192 - head/tools/build/mk

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 07:12:20 2016
New Revision: 307192
URL: https://svnweb.freebsd.org/changeset/base/307192

Log:
  Also, remove etc/rc.d/zfsbe when MK_ZFS == no
  
  X-MFC with:   r307182, r307191
  Sponsored by: Dell EMC Isilon

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 13 07:10:27 
2016(r307191)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 13 07:12:20 
2016(r307192)
@@ -1089,6 +1089,7 @@ OLD_FILES+=boot/gptzfsboot
 OLD_FILES+=boot/zfsboot
 OLD_FILES+=boot/zfsloader
 OLD_FILES+=etc/rc.d/zfs
+OLD_FILES+=etc/rc.d/zfsbe
 OLD_FILES+=etc/rc.d/zvol
 OLD_FILES+=etc/devd/zfs.conf
 OLD_FILES+=etc/periodic/daily/404.status-zfs
___
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: r307196 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 07:32:25 2016
New Revision: 307196
URL: https://svnweb.freebsd.org/changeset/base/307196

Log:
  Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD
  
  - Add inttypes.h #include for PRId64 macro
  - Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
fhandle_t, unlike NetBSD's copy of fhp, which is void*.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/fs/tmpfs/h_tools.c

Modified: head/contrib/netbsd-tests/fs/tmpfs/h_tools.c
==
--- head/contrib/netbsd-tests/fs/tmpfs/h_tools.cThu Oct 13 07:25:18 
2016(r307195)
+++ head/contrib/netbsd-tests/fs/tmpfs/h_tools.cThu Oct 13 07:32:25 
2016(r307196)
@@ -50,6 +50,10 @@
 #include 
 #include 
 
+#ifdef __FreeBSD__
+#include 
+#endif
+
 /* - */
 
 static int getfh_main(int, char **);
@@ -70,7 +74,12 @@ getfh_main(int argc, char **argv)
if (argc < 2)
return EXIT_FAILURE;
 
+#ifdef __FreeBSD__
+   fh_size = sizeof(fhandle_t);
+#else
fh_size = 0;
+#endif
+
fh = NULL;
for (;;) {
if (fh_size) {
@@ -85,7 +94,11 @@ getfh_main(int argc, char **argv)
 * but it may change if someone moves things around,
 * so retry untill we have enough memory.
 */
+#ifdef __FreeBSD__
+   error = getfh(argv[1], fh);
+#else
error = getfh(argv[1], fh, _size);
+#endif
if (error == 0) {
break;
} else {
___
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: r307191 - head/etc/rc.d

2016-10-13 Thread Andriy Gapon
On 13/10/2016 10:10, Ngie Cooper wrote:
> Author: ngie
> Date: Thu Oct 13 07:10:27 2016
> New Revision: 307191
> URL: https://svnweb.freebsd.org/changeset/base/307191
> 
> Log:
>   Install etc/rc.d/zfsbe when MK_ZFS != no
>   
>   X-MFC with: r307182
>   Sponsored by:   Dell EMC Isilon

Oh!  Thank you!

> Modified:
>   head/etc/rc.d/Makefile
> 
> Modified: head/etc/rc.d/Makefile
> ==
> --- head/etc/rc.d/MakefileThu Oct 13 07:02:54 2016(r307190)
> +++ head/etc/rc.d/MakefileThu Oct 13 07:10:27 2016(r307191)
> @@ -314,6 +314,7 @@ FILES+=   wpa_supplicant
>  .if ${MK_ZFS} != "no"
>  FILESGROUPS+=ZFS
>  ZFS+=zfs
> +ZFS+=zfsbe
>  ZFS+=zfsd
>  ZFS+=zvol
>  ZFSPACKAGE=  zfs
> 


-- 
Andriy Gapon
___
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: r307195 - head/sys/dev/iicbus

2016-10-13 Thread Andriy Gapon
On 13/10/2016 10:25, Andriy Gapon wrote:
> Author: avg
> Date: Thu Oct 13 07:25:18 2016
> New Revision: 307195
> URL: https://svnweb.freebsd.org/changeset/base/307195
> 
> Log:
>   convert iicsmb to use iicbus_transfer for all operations
>   
>   Previously the driver used more low level operations like iicbus_start
>   and iicbus_write.  The problem is that those operations are not
>   implemented by iicbus(4) and the calls were effectively routed to
>   a driver to which the bus is attached.
>   But not all of the controllers implement such low level operations
>   while all of the drivers are expected to have iicbus_transfer.
>   
>   While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread.
>   The former should send a byte count before the actual bytes, while the
>   latter should first receive the byte count and then receive the bytes.

Just a thought.  It would be much easier to implement iicsmb_bread() if we had a
flag like I2C_M_RECV_LEN in Linux.  The flag signals that the first byte
received from slave is a count of how many more bytes we should read from that
slave.  But adding support for a new flag to all controller drivers is not fun.

>   I have tested only these commands:
>   - quick (r/w)
>   - send byte
>   - receive byte
>   - read byte
>   - write byte
>   
>   MFC after:  1 month
>   Differential Revision: https://reviews.freebsd.org/D8170
> 
> Modified:
>   head/sys/dev/iicbus/iicsmb.c
> 
> Modified: head/sys/dev/iicbus/iicsmb.c
> ==
> --- head/sys/dev/iicbus/iicsmb.c  Thu Oct 13 07:22:13 2016
> (r307194)
> +++ head/sys/dev/iicbus/iicsmb.c  Thu Oct 13 07:25:18 2016
> (r307195)
> @@ -131,8 +131,6 @@ static driver_t iicsmb_driver = {
>   sizeof(struct iicsmb_softc),
>  };
>  
> -#define IICBUS_TIMEOUT   100 /* us */
> -
>  static void
>  iicsmb_identify(driver_t *driver, device_t parent)
>  {
> @@ -276,237 +274,213 @@ iicsmb_callback(device_t dev, int index,
>  }
>  
>  static int
> +iic2smb_error(int error)
> +{
> + switch (error) {
> + case IIC_NOERR:
> + return (SMB_ENOERR);
> + case IIC_EBUSERR:
> + return (SMB_EBUSERR);
> + case IIC_ENOACK:
> + return (SMB_ENOACK);
> + case IIC_ETIMEOUT:
> + return (SMB_ETIMEOUT);
> + case IIC_EBUSBSY:
> + return (SMB_EBUSY);
> + case IIC_ESTATUS:
> + return (SMB_EBUSERR);
> + case IIC_EUNDERFLOW:
> + return (SMB_EBUSERR);
> + case IIC_EOVERFLOW:
> + return (SMB_EBUSERR);
> + case IIC_ENOTSUPP:
> + return (SMB_ENOTSUPP);
> + case IIC_ENOADDR:
> + return (SMB_EBUSERR);
> + case IIC_ERESOURCE:
> + return (SMB_EBUSERR);
> + default:
> + return (SMB_EBUSERR);
> + }
> +}
> +
> +#define  TRANSFER_MSGS(dev, msgs)iicbus_transfer(dev, msgs, 
> nitems(msgs))
> +
> +static int
>  iicsmb_quick(device_t dev, u_char slave, int how)
>  {
> - device_t parent = device_get_parent(dev);
> + struct iic_msg msgs[] = {
> +  { slave, how == SMB_QWRITE ? IIC_M_WR : IIC_M_RD, 0, NULL },
> + };
>   int error;
>  
>   switch (how) {
>   case SMB_QWRITE:
> - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT);
> - break;
> -
>   case SMB_QREAD:
> - error = iicbus_start(parent, slave | LSB, IICBUS_TIMEOUT);
>   break;
> -
>   default:
> - error = EINVAL;
> - break;
> + return (SMB_EINVAL);
>   }
>  
> - if (!error)
> - error = iicbus_stop(parent);
> - 
> - return (error);
> + error = TRANSFER_MSGS(dev, msgs);
> + return (iic2smb_error(error));
>  }
>  
>  static int
>  iicsmb_sendb(device_t dev, u_char slave, char byte)
>  {
> - device_t parent = device_get_parent(dev);
> - int error, sent;
> -
> - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT);
> -
> - if (!error) {
> - error = iicbus_write(parent, , 1, , IICBUS_TIMEOUT);
> -
> - iicbus_stop(parent);
> - }
> + struct iic_msg msgs[] = {
> +  { slave, IIC_M_WR, 1,  },
> + };
> + int error;
>  
> - return (error);
> + error = TRANSFER_MSGS(dev, msgs);
> + return (iic2smb_error(error));
>  }
>  
>  static int
>  iicsmb_recvb(device_t dev, u_char slave, char *byte)
>  {
> - device_t parent = device_get_parent(dev);
> - int error, read;
> -
> - error = iicbus_start(parent, slave | LSB, 0);
> -
> - if (!error) {
> - error = iicbus_read(parent, byte, 1, , IIC_LAST_READ, 
> IICBUS_TIMEOUT);
> -
> - iicbus_stop(parent);
> - }
> + struct iic_msg msgs[] = {
> +  { slave, IIC_M_RD, 1, byte },
> + };
> + int error;
>  
> - return (error);
> + error = TRANSFER_MSGS(dev, 

svn commit: r307189 - in head: lib lib/libefivar sys/arm/include sys/arm64/include sys/dev/efidev sys/i386/include sys/mips/include sys/pc98/include sys/powerpc/include sys/riscv/include sys/sparc6...

2016-10-13 Thread Warner Losh
Author: imp
Date: Thu Oct 13 06:56:23 2016
New Revision: 307189
URL: https://svnweb.freebsd.org/changeset/base/307189

Log:
  Fix building on i386 and arm. But 'public domain' headers on the files
  with no creative content. Include "lost" changes from git:
  o Use /dev/efi instead of /dev/efidev
  o Remove redundant NULL checks.
  
  Submitted by: kib@, dim@, zbb@, emaste@

Modified:
  head/lib/Makefile
  head/lib/libefivar/efivar.c
  head/sys/arm/include/efi.h
  head/sys/arm64/include/efi.h
  head/sys/dev/efidev/efidev.c
  head/sys/i386/include/efi.h
  head/sys/mips/include/efi.h
  head/sys/pc98/include/efi.h
  head/sys/powerpc/include/efi.h
  head/sys/riscv/include/efi.h
  head/sys/sparc64/include/efi.h
  head/usr.sbin/Makefile
  head/usr.sbin/efivar/efivar.8
  head/usr.sbin/efivar/efivar.c

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Thu Oct 13 06:55:51 2016(r307188)
+++ head/lib/Makefile   Thu Oct 13 06:56:23 2016(r307189)
@@ -241,7 +241,7 @@ _libcxxrt=  libcxxrt
 _libcplusplus= libc++
 .endif
 
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MK_EFI} != "no"
 _libefivar=libefivar
 .endif
 

Modified: head/lib/libefivar/efivar.c
==
--- head/lib/libefivar/efivar.c Thu Oct 13 06:55:51 2016(r307188)
+++ head/lib/libefivar/efivar.c Thu Oct 13 06:56:23 2016(r307189)
@@ -108,7 +108,7 @@ efi_open_dev(void)
 {
 
if (efi_fd == -2)
-   efi_fd = open("/dev/efidev", O_RDWR);
+   efi_fd = open("/dev/efi", O_RDWR);
if (efi_fd < 0)
efi_fd = -1;
else

Modified: head/sys/arm/include/efi.h
==
--- head/sys/arm/include/efi.h  Thu Oct 13 06:55:51 2016(r307188)
+++ head/sys/arm/include/efi.h  Thu Oct 13 06:56:23 2016(r307189)
@@ -1,30 +1,5 @@
 /*-
- * Copyright (c) 2016 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Konstantin Belousov 
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * This file is in the public domain since it's just boilerplate.
  *
  * $FreeBSD$
  */

Modified: head/sys/arm64/include/efi.h
==
--- head/sys/arm64/include/efi.hThu Oct 13 06:55:51 2016
(r307188)
+++ head/sys/arm64/include/efi.hThu Oct 13 06:56:23 2016
(r307189)
@@ -1,30 +1,5 @@
 /*-
- * Copyright (c) 2016 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Konstantin Belousov 
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 

Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Ngie Cooper (yaneurabeya)

> On Oct 13, 2016, at 00:20, Julio Merino  wrote:
> 
> On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper  wrote:
> Author: ngie
> Date: Thu Oct 13 07:02:54 2016
> New Revision: 307190
> URL: https://svnweb.freebsd.org/changeset/base/307190
> 
> Log:
>   Skip :uchg on FreeBSD
> 
>   Unfortunately removing files with uchg set always succeeds with root on
>   FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
>   because mounting tmpfs requires root
> 
>   PR:   212861
>   Sponsored by: Dell EMC Isilon
> 
> Modified:
>   head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
> 
> Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
> ==
> --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 06:56:23 
> 2016(r307189)
> +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 07:02:54 
> 2016(r307190)
> @@ -53,6 +53,10 @@ uchg_head() {
> atf_set "require.user" "root"
>  }
>  uchg_body() {
> +   # Begin FreeBSD
> +   atf_skip "this fails on FreeBSD with root - bug 212861"
> +   # End FreeBSD
> 
> This is a bad way of disabling a test due to a known bug because, when the 
> bug is resolved, the test won't notice. You should be using the "expected 
> failures" functionality if possible, and based on the change description, I 
> think you can do this here easily. Try:
> 
> atf_expect_fail "FreeBSD bug 213861 blah blah"
> 
> right before the line that triggers the test failure.

The problem is that this leaves tmpfs mounts lying around, which atf won’t 
cleanup. Otherwise, I would totally agree with you.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r307210 - head/sys/arm64/arm64

2016-10-13 Thread Andrew Turner
Author: andrew
Date: Thu Oct 13 09:06:29 2016
New Revision: 307210
URL: https://svnweb.freebsd.org/changeset/base/307210

Log:
  Move printing the AArch64 ID registers to a new SYSINIT, the previous
  location only prints them when booting on SMP with multiple cores.
  
  MFC after:1 week
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/identcpu.c
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Thu Oct 13 09:00:44 2016
(r307209)
+++ head/sys/arm64/arm64/identcpu.c Thu Oct 13 09:06:29 2016
(r307210)
@@ -33,7 +33,9 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 
@@ -151,6 +153,17 @@ const struct cpu_implementers cpu_implem
CPU_IMPLEMENTER_NONE,
 };
 
+static void
+identify_cpu_sysinit(void *dummy __unused)
+{
+   int cpu;
+
+   CPU_FOREACH(cpu) {
+   print_cpu_features(cpu);
+   }
+}
+SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identify_cpu_sysinit, NULL);
+
 void
 print_cpu_features(u_int cpu)
 {

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Thu Oct 13 09:00:44 2016
(r307209)
+++ head/sys/arm64/arm64/mp_machdep.c   Thu Oct 13 09:06:29 2016
(r307210)
@@ -201,7 +201,7 @@ arm64_cpu_attach(device_t dev)
 static void
 release_aps(void *dummy __unused)
 {
-   int cpu, i;
+   int i;
 
intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL);
intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL);
@@ -217,14 +217,8 @@ release_aps(void *dummy __unused)
printf("Release APs\n");
 
for (i = 0; i < 2000; i++) {
-   if (smp_started) {
-   for (cpu = 0; cpu <= mp_maxid; cpu++) {
-   if (CPU_ABSENT(cpu))
-   continue;
-   print_cpu_features(cpu);
-   }
+   if (smp_started)
return;
-   }
DELAY(1000);
}
 
___
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: r307072 - in head/usr.sbin: . efivar

2016-10-13 Thread Warner Losh
All these issues should be fixed. Sorry for the mixup. I'm learning
git and mis-merged trees from two different laptops :(.

Warner

On Wed, Oct 12, 2016 at 6:22 PM, Warner Losh  wrote:
> I'll look into it. It worked just fine for me for all the builds I did
> on many different machines. Ugg.
>
> Warner
>
> On Wed, Oct 12, 2016 at 5:41 PM, Cy Schubert  wrote:
>> In message > om>
>> , Ed Maste writes:
>>> On 12 October 2016 at 12:55, Zbigniew Bodek  wrote:
>>> > Hello Warner,
>>> >
>>> > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and 
>>> > the
>>> > issues seems to be related to this commit (missing efivar.h file).
>>>
>>> Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6,
>>> arm64.aarch64, pc98.i386, i386.i386 with
>>>
>>> /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal
>>> error: 'efivar.h' file not found
>>> #include 
>>>  ^
>>>
>>> I temporarily unhooked it from the build in r307157.
>>>
>>>
>>
>> I had the same on amd64.
>>
>>
>> --
>> Cheers,
>> Cy Schubert 
>> FreeBSD UNIX:     Web:  http://www.FreeBSD.org
>>
>> The need of the many outweighs the greed of the few.
>>
>>
___
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: r307182 - head/etc/rc.d

2016-10-13 Thread Ngie Cooper (yaneurabeya)

> On Oct 12, 2016, at 23:19, Andriy Gapon  wrote:
> 
> Author: avg
> Date: Thu Oct 13 06:19:54 2016
> New Revision: 307182
> URL: https://svnweb.freebsd.org/changeset/base/307182
> 
> Log:
>  rc.d/zfsbe: a new script designed for boot environment support
> 
>  Currently zfsbe ensures that subordinate filesystems are mounted at the
>  right mount points.
>  The script assumes that the subordinate filesystems of a boot environment
>  have their canmount property set to noauto, so that they are not
>  automatically mounted on boot.  Whereas the root filesystem is mounted
>  by the kernel, there was nothing to mount its subordinates.
>  rc.d/zfsbe fills that gap.
> 
>  Discussed with:  allanjude, will
>  MFC after:   3 weeks
>  Differential Revision: https://reviews.freebsd.org/D7797

I committed the Makefile changes in r307191/r307192.
Cheers!
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Julio Merino
On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper  wrote:

> Author: ngie
> Date: Thu Oct 13 07:02:54 2016
> New Revision: 307190
> URL: https://svnweb.freebsd.org/changeset/base/307190
>
> Log:
>   Skip :uchg on FreeBSD
>
>   Unfortunately removing files with uchg set always succeeds with root on
>   FreeBSD. Unfortunately running the test as an unprivileged user isn't
> doable
>   because mounting tmpfs requires root
>
>   PR:   212861
>   Sponsored by: Dell EMC Isilon
>
> Modified:
>   head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
>
> Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
> 
> ==
> --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13
> 06:56:23 2016(r307189)
> +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13
> 07:02:54 2016(r307190)
> @@ -53,6 +53,10 @@ uchg_head() {
> atf_set "require.user" "root"
>  }
>  uchg_body() {
> +   # Begin FreeBSD
> +   atf_skip "this fails on FreeBSD with root - bug 212861"
> +   # End FreeBSD
>

This is a bad way of disabling a test due to a known bug because, when the
bug is resolved, the test won't notice. You should be using the "expected
failures" functionality if possible, and based on the change description, I
think you can do this here easily. Try:

atf_expect_fail "FreeBSD bug 213861 blah blah"

right before the line that triggers the test failure.

-- 
Julio Merino -- http://julio.meroh.net/
___
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: r307182 - head/etc/rc.d

2016-10-13 Thread Andriy Gapon
On 13/10/2016 10:12, Ngie Cooper (yaneurabeya) wrote:
> 
>> On Oct 12, 2016, at 23:19, Andriy Gapon  wrote:
>>
>> Author: avg
>> Date: Thu Oct 13 06:19:54 2016
>> New Revision: 307182
>> URL: https://svnweb.freebsd.org/changeset/base/307182
>>
>> Log:
>>  rc.d/zfsbe: a new script designed for boot environment support
>>
>>  Currently zfsbe ensures that subordinate filesystems are mounted at the
>>  right mount points.
>>  The script assumes that the subordinate filesystems of a boot environment
>>  have their canmount property set to noauto, so that they are not
>>  automatically mounted on boot.  Whereas the root filesystem is mounted
>>  by the kernel, there was nothing to mount its subordinates.
>>  rc.d/zfsbe fills that gap.
>>
>>  Discussed with: allanjude, will
>>  MFC after:  3 weeks
>>  Differential Revision: https://reviews.freebsd.org/D7797
> 
> I committed the Makefile changes in r307191/r307192.
> Cheers!

Thank you!
Next time I make a change like this I'll make sure to add you as a reviewer :-)


-- 
Andriy Gapon
___
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: r307195 - head/sys/dev/iicbus

2016-10-13 Thread Andriy Gapon
Author: avg
Date: Thu Oct 13 07:25:18 2016
New Revision: 307195
URL: https://svnweb.freebsd.org/changeset/base/307195

Log:
  convert iicsmb to use iicbus_transfer for all operations
  
  Previously the driver used more low level operations like iicbus_start
  and iicbus_write.  The problem is that those operations are not
  implemented by iicbus(4) and the calls were effectively routed to
  a driver to which the bus is attached.
  But not all of the controllers implement such low level operations
  while all of the drivers are expected to have iicbus_transfer.
  
  While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread.
  The former should send a byte count before the actual bytes, while the
  latter should first receive the byte count and then receive the bytes.
  
  I have tested only these commands:
  - quick (r/w)
  - send byte
  - receive byte
  - read byte
  - write byte
  
  MFC after:1 month
  Differential Revision: https://reviews.freebsd.org/D8170

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

Modified: head/sys/dev/iicbus/iicsmb.c
==
--- head/sys/dev/iicbus/iicsmb.cThu Oct 13 07:22:13 2016
(r307194)
+++ head/sys/dev/iicbus/iicsmb.cThu Oct 13 07:25:18 2016
(r307195)
@@ -131,8 +131,6 @@ static driver_t iicsmb_driver = {
sizeof(struct iicsmb_softc),
 };
 
-#define IICBUS_TIMEOUT 100 /* us */
-
 static void
 iicsmb_identify(driver_t *driver, device_t parent)
 {
@@ -276,237 +274,213 @@ iicsmb_callback(device_t dev, int index,
 }
 
 static int
+iic2smb_error(int error)
+{
+   switch (error) {
+   case IIC_NOERR:
+   return (SMB_ENOERR);
+   case IIC_EBUSERR:
+   return (SMB_EBUSERR);
+   case IIC_ENOACK:
+   return (SMB_ENOACK);
+   case IIC_ETIMEOUT:
+   return (SMB_ETIMEOUT);
+   case IIC_EBUSBSY:
+   return (SMB_EBUSY);
+   case IIC_ESTATUS:
+   return (SMB_EBUSERR);
+   case IIC_EUNDERFLOW:
+   return (SMB_EBUSERR);
+   case IIC_EOVERFLOW:
+   return (SMB_EBUSERR);
+   case IIC_ENOTSUPP:
+   return (SMB_ENOTSUPP);
+   case IIC_ENOADDR:
+   return (SMB_EBUSERR);
+   case IIC_ERESOURCE:
+   return (SMB_EBUSERR);
+   default:
+   return (SMB_EBUSERR);
+   }
+}
+
+#defineTRANSFER_MSGS(dev, msgs)iicbus_transfer(dev, msgs, 
nitems(msgs))
+
+static int
 iicsmb_quick(device_t dev, u_char slave, int how)
 {
-   device_t parent = device_get_parent(dev);
+   struct iic_msg msgs[] = {
+{ slave, how == SMB_QWRITE ? IIC_M_WR : IIC_M_RD, 0, NULL },
+   };
int error;
 
switch (how) {
case SMB_QWRITE:
-   error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT);
-   break;
-
case SMB_QREAD:
-   error = iicbus_start(parent, slave | LSB, IICBUS_TIMEOUT);
break;
-
default:
-   error = EINVAL;
-   break;
+   return (SMB_EINVAL);
}
 
-   if (!error)
-   error = iicbus_stop(parent);
-   
-   return (error);
+   error = TRANSFER_MSGS(dev, msgs);
+   return (iic2smb_error(error));
 }
 
 static int
 iicsmb_sendb(device_t dev, u_char slave, char byte)
 {
-   device_t parent = device_get_parent(dev);
-   int error, sent;
-
-   error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT);
-
-   if (!error) {
-   error = iicbus_write(parent, , 1, , IICBUS_TIMEOUT);
-
-   iicbus_stop(parent);
-   }
+   struct iic_msg msgs[] = {
+{ slave, IIC_M_WR, 1,  },
+   };
+   int error;
 
-   return (error);
+   error = TRANSFER_MSGS(dev, msgs);
+   return (iic2smb_error(error));
 }
 
 static int
 iicsmb_recvb(device_t dev, u_char slave, char *byte)
 {
-   device_t parent = device_get_parent(dev);
-   int error, read;
-
-   error = iicbus_start(parent, slave | LSB, 0);
-
-   if (!error) {
-   error = iicbus_read(parent, byte, 1, , IIC_LAST_READ, 
IICBUS_TIMEOUT);
-
-   iicbus_stop(parent);
-   }
+   struct iic_msg msgs[] = {
+{ slave, IIC_M_RD, 1, byte },
+   };
+   int error;
 
-   return (error);
+   error = TRANSFER_MSGS(dev, msgs);
+   return (iic2smb_error(error));
 }
 
 static int
 iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
 {
-   device_t parent = device_get_parent(dev);
-   int error, sent;
-
-   error = iicbus_start(parent, slave & ~LSB, 0);
-
-   if (!error) {
-   if (!(error = iicbus_write(parent, , 1, , 
IICBUS_TIMEOUT)))
-   error = iicbus_write(parent, , 1, , 
IICBUS_TIMEOUT);
-
-   iicbus_stop(parent);
-   }
+   uint8_t bytes[] = { 

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

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 07:02:54 2016
New Revision: 307190
URL: https://svnweb.freebsd.org/changeset/base/307190

Log:
  Skip :uchg on FreeBSD
  
  Unfortunately removing files with uchg set always succeeds with root on
  FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
  because mounting tmpfs requires root
  
  PR:   212861
  Sponsored by: Dell EMC Isilon

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

Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
==
--- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 06:56:23 
2016(r307189)
+++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 07:02:54 
2016(r307190)
@@ -53,6 +53,10 @@ uchg_head() {
atf_set "require.user" "root"
 }
 uchg_body() {
+   # Begin FreeBSD
+   atf_skip "this fails on FreeBSD with root - bug 212861"
+   # End FreeBSD
+
test_mount
 
atf_check -s eq:0 -o empty -e empty touch a
___
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: r307191 - head/etc/rc.d

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 07:10:27 2016
New Revision: 307191
URL: https://svnweb.freebsd.org/changeset/base/307191

Log:
  Install etc/rc.d/zfsbe when MK_ZFS != no
  
  X-MFC with:   r307182
  Sponsored by: Dell EMC Isilon

Modified:
  head/etc/rc.d/Makefile

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Thu Oct 13 07:02:54 2016(r307190)
+++ head/etc/rc.d/Makefile  Thu Oct 13 07:10:27 2016(r307191)
@@ -314,6 +314,7 @@ FILES+= wpa_supplicant
 .if ${MK_ZFS} != "no"
 FILESGROUPS+=  ZFS
 ZFS+=  zfs
+ZFS+=  zfsbe
 ZFS+=  zfsd
 ZFS+=  zvol
 ZFSPACKAGE=zfs
___
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: r307204 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 08:27:19 2016
New Revision: 307204
URL: https://svnweb.freebsd.org/changeset/base/307204

Log:
  Expect :large to fail on FreeBSD
  
  FreeBSD doesn't appear to validate large -o size values like
  NetBSD does
  
  MFC after:2 weeks
  PR:   212862
  Sponsored by: Dell EMC Isilon

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

Modified: head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
==
--- head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh   Thu Oct 13 08:09:40 
2016(r307203)
+++ head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh   Thu Oct 13 08:27:19 
2016(r307204)
@@ -93,7 +93,18 @@ negative_body() {
test_unmount
 }
 
+# Begin FreeBSD
+if true; then
+atf_test_case large cleanup
+large_cleanup() {
+   umount -f tmp 2>/dev/null
+}
+else
+# End FreeBSD
 atf_test_case large
+# Begin FreeBSD
+fi
+# End FreeBSD
 large_head() {
atf_set "descr" "Tests that extremely long values passed to -s" \
"are handled correctly"
@@ -103,6 +114,10 @@ large_body() {
test_mount -o -s9223372036854775807
test_unmount
 
+   # Begin FreeBSD
+   atf_expect_fail "-o -s succeeds unexpectedly on FreeBSD - 
bug 212862"
+   # End FreeBSD
+
mkdir tmp
atf_check -s eq:1 -o empty -e ignore \
mount -t tmpfs -o -s9223372036854775808 tmpfs tmp
___
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: r307205 - head/contrib/netbsd-tests/fs/tmpfs

2016-10-13 Thread Ngie Cooper
Author: ngie
Date: Thu Oct 13 08:35:08 2016
New Revision: 307205
URL: https://svnweb.freebsd.org/changeset/base/307205

Log:
  Change atf_skip call to atf_expect_fail to make it clear that a failure is
  expected
  
  MFC after:2 weeks
  PR:   212861
  Suggested by: jmmv
  Sponsored by: Dell EMC Isilon

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

Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
==
--- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 08:27:19 
2016(r307204)
+++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh  Thu Oct 13 08:35:08 
2016(r307205)
@@ -46,7 +46,18 @@ single_body() {
test_unmount
 }
 
+# Begin FreeBSD
+if true; then
+atf_test_case uchg cleanup
+uchg_cleanup() {
+   Mount_Point=$(pwd)/mntpt test_unmount || :
+}
+else
+# End FreeBSD
 atf_test_case uchg
+# Begin FreeBSD
+fi
+# End FreeBSD
 uchg_head() {
atf_set "descr" "Checks that files with the uchg flag set cannot" \
"be removed"
@@ -54,7 +65,7 @@ uchg_head() {
 }
 uchg_body() {
# Begin FreeBSD
-   atf_skip "this fails on FreeBSD with root - bug 212861"
+   atf_expect_fail "this fails on FreeBSD with root - bug 212861"
# End FreeBSD
 
test_mount
___
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: r307215 - in head/contrib/libarchive: cpio/test libarchive libarchive/test tar/test

2016-10-13 Thread Martin Matuska
Author: mm
Date: Thu Oct 13 11:40:34 2016
New Revision: 307215
URL: https://svnweb.freebsd.org/changeset/base/307215

Log:
  MFV r307214:
  Sync libarchive with vendor. Style and tests fixes.
  
  Important vendor bugfixes (relevant to FreeBSD):
  #801: FreeBSD Coverity report: resource leak in libarchive/tar/test/main.c
  
  MFC after:1 week

Modified:
  head/contrib/libarchive/cpio/test/main.c
  head/contrib/libarchive/cpio/test/test.h
  head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
  head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c
  head/contrib/libarchive/libarchive/test/main.c
  head/contrib/libarchive/libarchive/test/test.h
  head/contrib/libarchive/libarchive/test/test_read_set_format.c
  head/contrib/libarchive/tar/test/main.c
  head/contrib/libarchive/tar/test/test.h
  head/contrib/libarchive/tar/test/test_missing_file.c
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/cpio/test/main.c
==
--- head/contrib/libarchive/cpio/test/main.cThu Oct 13 11:34:23 2016
(r307214)
+++ head/contrib/libarchive/cpio/test/main.cThu Oct 13 11:40:34 2016
(r307215)
@@ -130,6 +130,13 @@ __FBSDID("$FreeBSD$");
 # include 
 #endif
 
+mode_t umasked(mode_t expected_mode)
+{
+   mode_t mode = umask(0);
+   umask(mode);
+   return expected_mode & ~mode;
+}
+
 /* Path to working directory for current test */
 const char *testworkdir;
 #ifdef PROGRAM
@@ -1294,6 +1301,11 @@ assertion_file_time(const char *file, in
switch (type) {
case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
case 'b': filet = st.st_birthtime;
+   /* FreeBSD filesystems that don't support birthtime
+* (e.g., UFS1) always return -1 here. */
+   if (filet == -1) {
+   return (1);
+   }
filet_nsec = st.st_birthtimespec.tv_nsec; break;
case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
@@ -1425,7 +1437,7 @@ assertion_file_nlinks(const char *file, 
assertion_count(file, line);
r = lstat(pathname, );
if (r == 0 && (int)st.st_nlink == nlinks)
-   return (1);
+   return (1);
failure_start(file, line, "File %s has %d links, expected %d",
pathname, st.st_nlink, nlinks);
failure_finish(NULL);
@@ -1661,6 +1673,7 @@ assertion_make_file(const char *file, in
if (0 != chmod(path, mode)) {
failure_start(file, line, "Could not chmod %s", path);
failure_finish(NULL);
+   close(fd);
return (0);
}
if (contents != NULL) {
@@ -1675,6 +1688,7 @@ assertion_make_file(const char *file, in
failure_start(file, line,
"Could not write to %s", path);
failure_finish(NULL);
+   close(fd);
return (0);
}
}

Modified: head/contrib/libarchive/cpio/test/test.h
==
--- head/contrib/libarchive/cpio/test/test.hThu Oct 13 11:34:23 2016
(r307214)
+++ head/contrib/libarchive/cpio/test/test.hThu Oct 13 11:40:34 2016
(r307215)
@@ -182,6 +182,8 @@
   assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
 #define assertFileSize(pathname, size)  \
   assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertFileMode(pathname, mode)  \
+  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
 #define assertTextFileContents(text, pathname) \
   assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
 #define assertFileContainsLinesAnyOrder(pathname, lines)   \
@@ -327,6 +329,9 @@ void copy_reference_file(const char *);
  */
 void extract_reference_files(const char **);
 
+/* Subtract umask from mode */
+mode_t umasked(mode_t expected_mode);
+
 /* Path to working directory for current test */
 extern const char *testworkdir;
 

Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
==
--- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Thu Oct 13 11:34:23 2016(r307214)
+++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Thu Oct 13 11:40:34 2016(r307215)
@@ -627,7 +627,6 @@ translate_acl(struct archive_read_disk *
archive_set_error(>archive, ARCHIVE_ERRNO_MISC,
"Unknown ACL brand");
return (ARCHIVE_WARN);
-   break;
}
 #endif
 

Modified: 

svn commit: r307216 - head/sys/netinet

2016-10-13 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct 13 13:38:14 2016
New Revision: 307216
URL: https://svnweb.freebsd.org/changeset/base/307216

Log:
  Whitespace changes.
  
  MFC after: 1 month

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Thu Oct 13 11:40:34 2016(r307215)
+++ head/sys/netinet/sctp_pcb.c Thu Oct 13 13:38:14 2016(r307216)
@@ -77,7 +77,6 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6
}
return (IN6_ARE_ADDR_EQUAL(_a.sin6_addr, _b.sin6_addr));
 }
-
 #endif
 
 void
@@ -837,14 +836,11 @@ static int
 sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
 {
int loopback_scope;
-
 #if defined(INET)
int ipv4_local_scope, ipv4_addr_legal;
-
 #endif
 #if defined(INET6)
int local_scope, site_scope, ipv6_addr_legal;
-
 #endif
struct sctp_vrf *vrf;
struct sctp_ifn *sctp_ifn;
@@ -1216,10 +1212,8 @@ sctp_tcb_special_locate(struct sctp_inpc
if (netp != NULL) {
*netp = net;
}
-   /*
-* Update the endpoint
-* pointer
-*/
+   /* Update the endpoint
+* pointer */
*inp_p = inp;
SCTP_INP_RUNLOCK(inp);
return (stcb);
@@ -1240,10 +1234,8 @@ sctp_tcb_special_locate(struct sctp_inpc
if (netp != NULL) {
*netp = net;
}
-   /*
-* Update the endpoint
-* pointer
-*/
+   /* Update the endpoint
+* pointer */
*inp_p = inp;
SCTP_INP_RUNLOCK(inp);
return (stcb);
@@ -1622,15 +1614,12 @@ sctp_endpoint_probe(struct sockaddr *nam
 {
struct sctp_inpcb *inp;
struct sctp_laddr *laddr;
-
 #ifdef INET
struct sockaddr_in *sin;
-
 #endif
 #ifdef INET6
struct sockaddr_in6 *sin6;
struct sockaddr_in6 *intf_addr6;
-
 #endif
int fnd;
 
@@ -1673,10 +1662,8 @@ sctp_endpoint_probe(struct sockaddr *nam
case AF_INET:
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) 
&&
SCTP_IPV6_V6ONLY(inp)) {
-   /*
-* IPv4 on a IPv6 socket with ONLY
-* IPv6 set
-*/
+   /* IPv4 on a IPv6 socket with ONLY
+* IPv6 set */
SCTP_INP_RUNLOCK(inp);
continue;
}
@@ -1689,10 +1676,8 @@ sctp_endpoint_probe(struct sockaddr *nam
 #endif
 #ifdef INET6
case AF_INET6:
-   /*
-* A V6 address and the endpoint is NOT
-* bound V6
-*/
+   /* A V6 address and the endpoint is NOT
+* bound V6 */
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) 
== 0) {
SCTP_INP_RUNLOCK(inp);
continue;
@@ -1926,14 +1911,11 @@ sctp_pcb_findep(struct sockaddr *nam, in
struct sctppcbhead *head;
int lport;
unsigned int i;
-
 #ifdef INET
struct sockaddr_in *sin;
-
 #endif
 #ifdef INET6
struct sockaddr_in6 *sin6;
-
 #endif
 
switch (nam->sa_family) {
@@ -2057,21 +2039,16 @@ sctp_findassociation_special_addr(struct
 struct sockaddr *dst)
 {
struct sctp_paramhdr *phdr, parm_buf;
-
 #if defined(INET) || defined(INET6)
struct sctp_tcb *stcb;
uint16_t ptype;
-
 #endif
uint16_t plen;
-
 #ifdef INET
struct sockaddr_in sin4;
-
 #endif
 #ifdef INET6
struct sockaddr_in6 sin6;
-
 #endif
 
 #ifdef 

svn commit: r307217 - head/sys/netinet

2016-10-13 Thread Michael Tuexen
Author: tuexen
Date: Thu Oct 13 13:53:01 2016
New Revision: 307217
URL: https://svnweb.freebsd.org/changeset/base/307217

Log:
  Mark the socket as un-writable when it is 1-to-1 and the SCTP association
  is freed.
  
  MFC after:1 month

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Thu Oct 13 13:38:14 2016(r307216)
+++ head/sys/netinet/sctp_pcb.c Thu Oct 13 13:53:01 2016(r307217)
@@ -4870,6 +4870,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
SS_ISCONNECTED);
}
socantrcvmore_locked(so);
+   socantsendmore(so);
sctp_sowwakeup(inp, so);
sctp_sorwakeup(inp, so);
SCTP_SOWAKEUP(so);
___
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: r307148 - in head/lib/libc: gen stdlib

2016-10-13 Thread Ed Maste
On 13 October 2016 at 02:05, Bruce Evans  wrote:
> On Wed, 12 Oct 2016, Ed Maste wrote:
>
> The comment starts by being just wrong:
>
> 1. "The" sysctl is not used here.  Instead, a wrapper arc4_sysctl() is used.
>The wrapper handles some but not all errors.

Fixed in my WIP tree.

> 2. The sysctl can and does fail.  It fails on:
>- all old kernels mixed with new userlands

We don't support new userlands on very old kernels, and I think there
are many other things in libc that will fail on kernels old enough to
lack kern.arandom.

>- with new kernels, at boot time, before the random device is seeded.

If that is indeed still possible it's a bug we need to fix before 12.0.

> 3. The sysctl can, or at least used to, return short reads with nonzero
>counts.

That was addressed in markm's 2015 random work, I think. Presumably
random() was silently broken for the rand_type != TYPE_0 case prior to
that.

>The documentation for this is well hidden, but the
>arc4_sysctl() wrapper exists to support short reads, or perhaps just
>the special case of short reads of 0, which it handles poorly by
>possibly spinning forever.

I suspect we can just remove the arc4_sysctl wrapper too.

> Then the excuse is wrong.  abort() never makes sense in library functions.

arc4random must not return without good quality random data. The other
option would be for it to loop indefinitely.

> Here it gives very confusing errors for the delicate boot-time fandago
> case.

The "delicate boot-time fandango case" was a bug.

> Style bugs:
> - sentence breaks are 2 spaces in KNF, and all old code in this file follows
>   that rule.

Fixed in my WIP tree.

> - 'abort' is not marked up

Fixed in my WIP tree.

> This is even more broken, since it doesn't have the wrapper.

This and the other issues predate my changes; I'll take a look at the
history soon.
___
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: r307182 - head/etc/rc.d

2016-10-13 Thread Andriy Gapon
Author: avg
Date: Thu Oct 13 06:19:54 2016
New Revision: 307182
URL: https://svnweb.freebsd.org/changeset/base/307182

Log:
  rc.d/zfsbe: a new script designed for boot environment support
  
  Currently zfsbe ensures that subordinate filesystems are mounted at the
  right mount points.
  The script assumes that the subordinate filesystems of a boot environment
  have their canmount property set to noauto, so that they are not
  automatically mounted on boot.  Whereas the root filesystem is mounted
  by the kernel, there was nothing to mount its subordinates.
  rc.d/zfsbe fills that gap.
  
  Discussed with:   allanjude, will
  MFC after:3 weeks
  Differential Revision: https://reviews.freebsd.org/D7797

Added:
  head/etc/rc.d/zfsbe   (contents, props changed)
Modified:
  head/etc/rc.d/zfs

Modified: head/etc/rc.d/zfs
==
--- head/etc/rc.d/zfs   Thu Oct 13 06:17:33 2016(r307181)
+++ head/etc/rc.d/zfs   Thu Oct 13 06:19:54 2016(r307182)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: zfs
-# REQUIRE: mountcritlocal
+# REQUIRE: zfsbe
 # BEFORE: FILESYSTEMS var
 
 . /etc/rc.subr

Added: head/etc/rc.d/zfsbe
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/rc.d/zfsbe Thu Oct 13 06:19:54 2016(r307182)
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: zfsbe
+# REQUIRE: mountcritlocal
+
+# Handle boot environment subordinate filesystems
+# that may have canmount property set to noauto.
+# For these filesystems mountpoint relative to /
+# must be the same as their dataset name relative
+# to BE root dataset.
+
+. /etc/rc.subr
+
+name="zfsbe"
+rcvar="zfs_enable"
+start_cmd="be_start"
+stop_cmd="be_stop"
+required_modules="zfs"
+
+mount_subordinate()
+{
+   local _be
+
+   _be=$1
+   zfs list -rH -o mountpoint,name,canmount,mounted -s mountpoint -t 
filesystem $_be | \
+   while read _mp _name _canmount _mounted ; do
+   # skip filesystems that must not be mounted
+   [ "$_canmount" = "off" ] && continue
+   # skip filesystems that are already mounted
+   [ "$_mounted" = "yes" ] && continue
+   case "$_mp" in
+   "none" | "legacy" | "/" | "/$_be")
+   # do nothing for filesystems with unset or legacy 
mountpoint
+   # or those that would be mounted over /
+   ;;
+   "/$_be/"*)
+   # filesystems with mountpoint relative to BE
+   mount -t zfs $_name ${_mp#/$_be}
+   ;;
+   *)
+   # filesystems with mountpoint elsewhere
+   zfs mount $_name
+   ;;
+   esac
+   done
+}
+
+be_start()
+{
+   if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then
+   :
+   else
+   mount -p | while read _dev _mp _type _rest; do
+   [ $_mp  = "/" ] || continue
+   if [ $_type = "zfs" ] ; then
+   mount_subordinate $_dev
+   fi
+   break
+   done
+   fi
+}
+
+be_stop()
+{
+}
+
+load_rc_config $name
+run_rc_command "$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"