svn commit: r303811 - in head/sys: net net80211

2016-08-06 Thread Adrian Chadd
Author: adrian
Date: Sun Aug  7 03:48:33 2016
New Revision: 303811
URL: https://svnweb.freebsd.org/changeset/base/303811

Log:
  Extract out the various local definitions of ETHER_IS_BROADCAST() and
  turn them into a shared definition.
  
  Set M_MCAST/M_BCAST appropriately upon packet reception in net80211, just
  before they are delivered up to the ethernet stack.
  
  Submitted by: rstone

Modified:
  head/sys/net/ethernet.h
  head/sys/net/if_ethersubr.c
  head/sys/net/if_gif.c
  head/sys/net80211/ieee80211_input.c

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Sun Aug  7 01:32:37 2016(r303810)
+++ head/sys/net/ethernet.h Sun Aug  7 03:48:33 2016(r303811)
@@ -71,6 +71,9 @@ struct ether_addr {
 } __packed;
 
 #defineETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address 
mcast/bcast? */
+#defineETHER_IS_BROADCAST(addr) \
+   (((addr)[0] & (addr)[1] & (addr)[2] & \
+ (addr)[3] & (addr)[4] & (addr)[5]) == 0xff)
 
 /*
  * 802.1q Virtual LAN header.

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Sun Aug  7 01:32:37 2016(r303810)
+++ head/sys/net/if_ethersubr.c Sun Aug  7 03:48:33 2016(r303811)
@@ -115,8 +115,6 @@ static  void ether_reassign(struct ifnet 
 #endif
 static int ether_requestencap(struct ifnet *, struct if_encap_req *);
 
-#defineETHER_IS_BROADCAST(addr) \
-   (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0)
 
 #define senderr(e) do { error = (e); goto bad;} while (0)
 

Modified: head/sys/net/if_gif.c
==
--- head/sys/net/if_gif.c   Sun Aug  7 01:32:37 2016(r303810)
+++ head/sys/net/if_gif.c   Sun Aug  7 03:48:33 2016(r303811)
@@ -166,14 +166,6 @@ SYSCTL_INT(_net_link_gif, OID_AUTO, para
 CTLFLAG_VNET | CTLFLAG_RW, _NAME(parallel_tunnels), 0,
 "Allow parallel tunnels?");
 
-/* copy from src/sys/net/if_ethersubr.c */
-static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] =
-   { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-#ifndef ETHER_IS_BROADCAST
-#define ETHER_IS_BROADCAST(addr) \
-   (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0)
-#endif
-
 static int
 gif_clone_create(struct if_clone *ifc, int unit, caddr_t params)
 {

Modified: head/sys/net80211/ieee80211_input.c
==
--- head/sys/net80211/ieee80211_input.c Sun Aug  7 01:32:37 2016
(r303810)
+++ head/sys/net80211/ieee80211_input.c Sun Aug  7 03:48:33 2016
(r303811)
@@ -283,7 +283,10 @@ ieee80211_deliver_data(struct ieee80211v
IEEE80211_NODE_STAT(ni, rx_data);
IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len);
if (ETHER_IS_MULTICAST(eh->ether_dhost)) {
-   m->m_flags |= M_MCAST;  /* XXX M_BCAST? */
+   if (ETHER_IS_BROADCAST(eh->ether_dhost))
+   m->m_flags |= M_BCAST;
+   else
+   m->m_flags |= M_MCAST;
IEEE80211_NODE_STAT(ni, rx_mcast);
} else
IEEE80211_NODE_STAT(ni, rx_ucast);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303810 - head/sys/dev/etherswitch/arswitch

2016-08-06 Thread Adrian Chadd
Author: adrian
Date: Sun Aug  7 01:32:37 2016
New Revision: 303810
URL: https://svnweb.freebsd.org/changeset/base/303810

Log:
  [arswitch] extend the debug support to be configurable at runtime.
  
  * remove the DEBUG ifdef; defining it is too far reaching throughout
the whole system;
  * add a bitmask in the softc for controlling debugging;
  * .. enable said debugging as a sysctl;
  * add bitmaps for register access, reset and vlans.
  
  TODO:
  
  * Now that the debug statements are configurable, we definitely could
do with more debugging
  * Move the debugging into the top-level etherswitch driver and have
sub-drivers obey.

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch.c
  head/sys/dev/etherswitch/arswitch/arswitch_8327.c
  head/sys/dev/etherswitch/arswitch/arswitch_phy.c
  head/sys/dev/etherswitch/arswitch/arswitch_reg.c
  head/sys/dev/etherswitch/arswitch/arswitchvar.h

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==
--- head/sys/dev/etherswitch/arswitch/arswitch.cSun Aug  7 01:29:55 
2016(r303809)
+++ head/sys/dev/etherswitch/arswitch/arswitch.cSun Aug  7 01:32:37 
2016(r303810)
@@ -73,10 +73,6 @@
 #include "miibus_if.h"
 #include "etherswitch_if.h"
 
-#ifdefined(DEBUG)
-static SYSCTL_NODE(_debug, OID_AUTO, arswitch, CTLFLAG_RD, 0, "arswitch");
-#endif
-
 /* Map ETHERSWITCH_PORT_LED_* to Atheros pattern codes */
 static int led_pattern_table[] = {
[ETHERSWITCH_PORT_LED_DEFAULT] = 0x3,
@@ -156,7 +152,7 @@ arswitch_probe(device_t dev)
 
 done:
 
-   DPRINTF(dev, "chipname=%s, id=%08x\n", chipname, id);
+   DPRINTF(sc, ARSWITCH_DBG_ANY, "chipname=%s, id=%08x\n", chipname, id);
if (chipname != NULL) {
snprintf(desc, sizeof(desc),
"Atheros %s Ethernet Switch (ver %d rev %d)",
@@ -309,12 +305,12 @@ ar8xxx_atu_flush(struct arswitch_softc *
 static int
 arswitch_attach(device_t dev)
 {
-   struct arswitch_softc *sc;
+   struct arswitch_softc *sc = device_get_softc(dev);
+   struct sysctl_ctx_list *ctx;
+   struct sysctl_oid *tree;
int err = 0;
int port;
 
-   sc = device_get_softc(dev);
-
/* sc->sc_switchtype is already decided in arswitch_probe() */
sc->sc_dev = dev;
mtx_init(>sc_mtx, "arswitch", NULL, MTX_DEF);
@@ -322,6 +318,13 @@ arswitch_attach(device_t dev)
strlcpy(sc->info.es_name, device_get_desc(dev),
sizeof(sc->info.es_name));
 
+   /* Debugging */
+   ctx = device_get_sysctl_ctx(sc->sc_dev);
+   tree = device_get_sysctl_tree(sc->sc_dev);
+   SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+   "debug", CTLFLAG_RW, >sc_debug, 0,
+   "control debugging printfs");
+
/* Default HAL methods */
sc->hal.arswitch_port_init = ar8xxx_port_init;
sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup;
@@ -363,7 +366,8 @@ arswitch_attach(device_t dev)
else if (AR8X16_IS_SWITCH(sc, AR8327))
ar8327_attach(sc);
else {
-   DPRINTF(dev, "%s: unknown switch (%d)?\n", __func__, 
sc->sc_switchtype);
+   DPRINTF(sc, ARSWITCH_DBG_ANY,
+   "%s: unknown switch (%d)?\n", __func__, sc->sc_switchtype);
return (ENXIO);
}
 
@@ -393,19 +397,24 @@ arswitch_attach(device_t dev)
 
/* Reset the switch. */
if (arswitch_reset(dev)) {
-   DPRINTF(dev, "%s: arswitch_reset: failed\n", __func__);
+   DPRINTF(sc, ARSWITCH_DBG_ANY,
+   "%s: arswitch_reset: failed\n", __func__);
return (ENXIO);
}
 
err = sc->hal.arswitch_hw_setup(sc);
-   DPRINTF(dev, "%s: hw_setup: err=%d\n", __func__, err);
-   if (err != 0)
+   if (err != 0) {
+   DPRINTF(sc, ARSWITCH_DBG_ANY,
+   "%s: hw_setup: err=%d\n", __func__, err);
return (err);
+   }
 
err = sc->hal.arswitch_hw_global_setup(sc);
-   DPRINTF(dev, "%s: hw_global_setup: err=%d\n", __func__, err);
-   if (err != 0)
+   if (err != 0) {
+   DPRINTF(sc, ARSWITCH_DBG_ANY,
+   "%s: hw_global_setup: err=%d\n", __func__, err);
return (err);
+   }
 
/* Initialize the switch ports. */
for (port = 0; port <= sc->numphys; port++) {
@@ -416,22 +425,28 @@ arswitch_attach(device_t dev)
 * Attach the PHYs and complete the bus enumeration.
 */
err = arswitch_attach_phys(sc);
-   DPRINTF(dev, "%s: attach_phys: err=%d\n", __func__, err);
-   if (err != 0)
+   if (err != 0) {
+   DPRINTF(sc, ARSWITCH_DBG_ANY,
+   "%s: attach_phys: err=%d\n", __func__, err);
return (err);
+   }
 
/* Default to ingress filters off. */
err = arswitch_set_vlan_mode(sc, 0);

svn commit: r303809 - in head: lib/libthr/arch/mips/include libexec/rtld-elf/mips sys/mips/include sys/mips/mips

2016-08-06 Thread Adrian Chadd
Author: adrian
Date: Sun Aug  7 01:29:55 2016
New Revision: 303809
URL: https://svnweb.freebsd.org/changeset/base/303809

Log:
  [mips] add support for using the MIPS user register for TLS data.
  
  This work, originally from Stacey Son, uses the MIPS UserReg for
  reading the TLS data, and will fall back to the normal syscall path
  when it isn't supported.
  
  This code dynamically patches cpu_switch() to bypass the UserReg
  instruction so to avoid generating a machine exception.
  
  Thanks to sson for the original work, and to Dan Nelson for
  bringing it to date and testing it on MIPS32 with me.
  
  Tested:
  
  * mips64 (sson)
  * mips74k (dnelson_1...@yahoo.com) - AR9344 SoC, UserReg support
  * mips24k (adrian) - AR9331 SoC, no UserReg support
  
  Obtained from:sson, dnelson_1...@yahoo.com

Modified:
  head/lib/libthr/arch/mips/include/pthread_md.h
  head/libexec/rtld-elf/mips/reloc.c
  head/sys/mips/include/cpufunc.h
  head/sys/mips/include/cpuinfo.h
  head/sys/mips/include/cpuregs.h
  head/sys/mips/mips/cpu.c
  head/sys/mips/mips/genassym.c
  head/sys/mips/mips/swtch.S
  head/sys/mips/mips/sys_machdep.c
  head/sys/mips/mips/vm_machdep.c

Modified: head/lib/libthr/arch/mips/include/pthread_md.h
==
--- head/lib/libthr/arch/mips/include/pthread_md.h  Sat Aug  6 23:53:33 
2016(r303808)
+++ head/lib/libthr/arch/mips/include/pthread_md.h  Sun Aug  7 01:29:55 
2016(r303809)
@@ -61,6 +61,7 @@ _tcb_set(struct tcb *tcb)
 /*
  * Get the current tcb.
  */
+#ifdef TLS_USE_SYSARCH
 static __inline struct tcb *
 _tcb_get(void)
 {
@@ -70,6 +71,55 @@ _tcb_get(void)
return tcb;
 }
 
+#else /* ! TLS_USE_SYSARCH */
+
+#  if defined(__mips_n64)
+static __inline struct tcb *
+_tcb_get(void)
+{
+   uint64_t _rv;
+
+   __asm__ __volatile__ (
+   ".set\tpush\n\t"
+   ".set\tmips64r2\n\t"
+   "rdhwr\t%0, $29\n\t"
+   ".set\tpop"
+   : "=v" (_rv));
+
+   /*
+* XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
+*
+* Remove the offset since this really a request to get the TLS
+* pointer via sysarch() (in theory).  Of course, this may go away
+* once the TLS code is rewritten.
+*/
+   return (struct tcb *)(_rv - TLS_TP_OFFSET - TLS_TCB_SIZE);
+}
+#  else /* mips 32 */
+static __inline struct tcb *
+_tcb_get(void)
+{
+   uint32_t _rv;
+
+   __asm__ __volatile__ (
+   ".set\tpush\n\t"
+   ".set\tmips32r2\n\t"
+   "rdhwr\t%0, $29\n\t"
+   ".set\tpop"
+   : "=v" (_rv));
+
+   /*
+* XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
+*
+* Remove the offset since this really a request to get the TLS
+* pointer via sysarch() (in theory).  Of course, this may go away
+* once the TLS code is rewritten.
+*/
+   return (struct tcb *)(_rv - TLS_TP_OFFSET - TLS_TCB_SIZE);
+}
+#  endif /* ! __mips_n64 */
+#endif /* ! TLS_USE_SYSARCH */
+
 extern struct pthread *_thr_initial;
 
 static __inline struct pthread *

Modified: head/libexec/rtld-elf/mips/reloc.c
==
--- head/libexec/rtld-elf/mips/reloc.c  Sat Aug  6 23:53:33 2016
(r303808)
+++ head/libexec/rtld-elf/mips/reloc.c  Sun Aug  7 01:29:55 2016
(r303809)
@@ -634,13 +634,67 @@ allocate_initial_tls(Obj_Entry *objs)
sysarch(MIPS_SET_TLS, tls);
 }
 
+#ifdef __mips_n64
+void *
+_mips_get_tls(void)
+{
+   uint64_t _rv;
+
+   __asm__ __volatile__ (
+   ".set\tpush\n\t"
+   ".set\tmips64r2\n\t"
+   "rdhwr\t%0, $29\n\t"
+   ".set\tpop"
+   : "=v" (_rv));
+   /*
+* XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
+*
+* Remove the offset since this really a request to get the TLS
+* pointer via sysarch() (in theory).  Of course, this may go away
+* once the TLS code is rewritten.
+*/
+   _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE;
+
+   return (void *)_rv;
+}
+
+#else /* mips 32 */
+
+void *
+_mips_get_tls(void)
+{
+   uint32_t _rv;
+
+   __asm__ __volatile__ (
+   ".set\tpush\n\t"
+   ".set\tmips32r2\n\t"
+   "rdhwr\t%0, $29\n\t"
+   ".set\tpop"
+   : "=v" (_rv));
+   /*
+* XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
+*
+* Remove the offset since this really a request to get the TLS
+* pointer via sysarch() (in theory).  Of course, this may go away
+* once the TLS code is rewritten.
+*/
+   _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE;
+
+   return (void *)_rv;
+}
+#endif /* ! __mips_n64 */
+
 void *
 __tls_get_addr(tls_index* ti)
 {
Elf_Addr** tls;
char *p;
 
+#ifdef TLS_USE_SYSARCH

svn commit: r303808 - in stable: 10/sys/dev/fb 9/sys/dev/fb

2016-08-06 Thread John Baldwin
Author: jhb
Date: Sat Aug  6 23:53:33 2016
New Revision: 303808
URL: https://svnweb.freebsd.org/changeset/base/303808

Log:
  MFC 303076,303225: Use MTX_SYSINIT for the VESA lock.
  
  303076:
  vesa: fix panic on suspend
  
  Fix the following panic seen when migrating a FreeBSD guest on Xen:
  
  panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
  cpuid = 0
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe001d2fa4f0
  vpanic() at vpanic+0x182/frame 0xfe001d2fa570
  kassert_panic() at kassert_panic+0x126/frame 0xfe001d2fa5e0
  __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfe001d2fa630
  vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 
0xfe001d2fa680
  vga_suspend() at vga_suspend+0xa3/frame 0xfe001d2fa6b0
  isavga_suspend() at isavga_suspend+0x1d/frame 0xfe001d2fa6d0
  bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
  [...]
  
  This is caused because vga_sub_configure (which is called if the VGA adapter
  is attached after VESA tried to initialize), points to vesa_configure, which
  doesn't initialize the VESA mutex. In order to fix it, make sure
  vga_sub_configure points to vesa_load, so that all the needed vesa
  components are properly initialized.
  
  303225:
  Use MTX_SYSINIT for the VESA lock.
  
  vesa_init_done isn't a reliable guard for the mutex init.  If
  vesa_configure() doesn't find valid VESA info it will not set
  vesa_init_done, but the lock will remain initialized.  Revert r303076
  and use MTX_SYSINIT to deterministically init the lock.
  
  PR:   209203

Modified:
  stable/10/sys/dev/fb/vesa.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/sys/dev/fb/vesa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/10/sys/dev/fb/vesa.c
==
--- stable/10/sys/dev/fb/vesa.c Sat Aug  6 23:52:09 2016(r303807)
+++ stable/10/sys/dev/fb/vesa.c Sat Aug  6 23:53:33 2016(r303808)
@@ -79,6 +79,7 @@ struct adp_state {
 typedef struct adp_state adp_state_t;
 
 static struct mtx vesa_lock;
+MTX_SYSINIT(vesa_lock, _lock, "VESA lock", MTX_DEF);
 
 static int vesa_state;
 static void *vesa_state_buf;
@@ -1915,8 +1916,6 @@ vesa_load(void)
if (vesa_init_done)
return (0);
 
-   mtx_init(_lock, "VESA lock", NULL, MTX_DEF);
-
/* locate a VGA adapter */
vesa_adp = NULL;
error = vesa_configure(0);
@@ -1955,7 +1954,6 @@ vesa_unload(void)
}
 
vesa_bios_uninit();
-   mtx_destroy(_lock);
 
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303808 - in stable: 10/sys/dev/fb 9/sys/dev/fb

2016-08-06 Thread John Baldwin
Author: jhb
Date: Sat Aug  6 23:53:33 2016
New Revision: 303808
URL: https://svnweb.freebsd.org/changeset/base/303808

Log:
  MFC 303076,303225: Use MTX_SYSINIT for the VESA lock.
  
  303076:
  vesa: fix panic on suspend
  
  Fix the following panic seen when migrating a FreeBSD guest on Xen:
  
  panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
  cpuid = 0
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe001d2fa4f0
  vpanic() at vpanic+0x182/frame 0xfe001d2fa570
  kassert_panic() at kassert_panic+0x126/frame 0xfe001d2fa5e0
  __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfe001d2fa630
  vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 
0xfe001d2fa680
  vga_suspend() at vga_suspend+0xa3/frame 0xfe001d2fa6b0
  isavga_suspend() at isavga_suspend+0x1d/frame 0xfe001d2fa6d0
  bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
  [...]
  
  This is caused because vga_sub_configure (which is called if the VGA adapter
  is attached after VESA tried to initialize), points to vesa_configure, which
  doesn't initialize the VESA mutex. In order to fix it, make sure
  vga_sub_configure points to vesa_load, so that all the needed vesa
  components are properly initialized.
  
  303225:
  Use MTX_SYSINIT for the VESA lock.
  
  vesa_init_done isn't a reliable guard for the mutex init.  If
  vesa_configure() doesn't find valid VESA info it will not set
  vesa_init_done, but the lock will remain initialized.  Revert r303076
  and use MTX_SYSINIT to deterministically init the lock.
  
  PR:   209203

Modified:
  stable/9/sys/dev/fb/vesa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/fb/vesa.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/sys/dev/fb/vesa.c
==
--- stable/9/sys/dev/fb/vesa.c  Sat Aug  6 23:52:09 2016(r303807)
+++ stable/9/sys/dev/fb/vesa.c  Sat Aug  6 23:53:33 2016(r303808)
@@ -79,6 +79,7 @@ struct adp_state {
 typedef struct adp_state adp_state_t;
 
 static struct mtx vesa_lock;
+MTX_SYSINIT(vesa_lock, _lock, "VESA lock", MTX_DEF);
 
 static int vesa_state;
 static void *vesa_state_buf;
@@ -1903,8 +1904,6 @@ vesa_load(void)
if (vesa_init_done)
return (0);
 
-   mtx_init(_lock, "VESA lock", NULL, MTX_DEF);
-
/* locate a VGA adapter */
vesa_adp = NULL;
error = vesa_configure(0);
@@ -1943,7 +1942,6 @@ vesa_unload(void)
}
 
vesa_bios_uninit();
-   mtx_destroy(_lock);
 
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303807 - stable/11/sys/dev/fb

2016-08-06 Thread John Baldwin
Author: jhb
Date: Sat Aug  6 23:52:09 2016
New Revision: 303807
URL: https://svnweb.freebsd.org/changeset/base/303807

Log:
  MFC 303076,303225: Use MTX_SYSINIT for the VESA lock.
  
  303076:
  vesa: fix panic on suspend
  
  Fix the following panic seen when migrating a FreeBSD guest on Xen:
  
  panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
  cpuid = 0
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe001d2fa4f0
  vpanic() at vpanic+0x182/frame 0xfe001d2fa570
  kassert_panic() at kassert_panic+0x126/frame 0xfe001d2fa5e0
  __mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfe001d2fa630
  vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 
0xfe001d2fa680
  vga_suspend() at vga_suspend+0xa3/frame 0xfe001d2fa6b0
  isavga_suspend() at isavga_suspend+0x1d/frame 0xfe001d2fa6d0
  bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
  [...]
  
  This is caused because vga_sub_configure (which is called if the VGA adapter
  is attached after VESA tried to initialize), points to vesa_configure, which
  doesn't initialize the VESA mutex. In order to fix it, make sure
  vga_sub_configure points to vesa_load, so that all the needed vesa
  components are properly initialized.
  
  303225:
  Use MTX_SYSINIT for the VESA lock.
  
  vesa_init_done isn't a reliable guard for the mutex init.  If
  vesa_configure() doesn't find valid VESA info it will not set
  vesa_init_done, but the lock will remain initialized.  Revert r303076
  and use MTX_SYSINIT to deterministically init the lock.
  
  PR:   209203
  Approved by:  re (gjb)

Modified:
  stable/11/sys/dev/fb/vesa.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/fb/vesa.c
==
--- stable/11/sys/dev/fb/vesa.c Sat Aug  6 20:27:12 2016(r303806)
+++ stable/11/sys/dev/fb/vesa.c Sat Aug  6 23:52:09 2016(r303807)
@@ -79,6 +79,7 @@ struct adp_state {
 typedef struct adp_state adp_state_t;
 
 static struct mtx vesa_lock;
+MTX_SYSINIT(vesa_lock, _lock, "VESA lock", MTX_DEF);
 
 static int vesa_state;
 static void *vesa_state_buf;
@@ -1914,8 +1915,6 @@ vesa_load(void)
if (vesa_init_done)
return (0);
 
-   mtx_init(_lock, "VESA lock", NULL, MTX_DEF);
-
/* locate a VGA adapter */
vesa_adp = NULL;
error = vesa_configure(0);
@@ -1954,7 +1953,6 @@ vesa_unload(void)
}
 
vesa_bios_uninit();
-   mtx_destroy(_lock);
 
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303746 - head/usr.bin/indent

2016-08-06 Thread Pedro Giffuni



On 06/08/2016 15:13, Ed Schouten wrote:

Hi Pedro,

2016-08-04 17:27 GMT+02:00 Pedro F. Giffuni :

Log:
   indent(1): Use bsearch() for looking up type keywords.

You're never doing any deletions, right? Would it make more sense to
use hsearch_r() in that case?

Indeed, good idea, although it may be an issue if portability to Windows 
is desired.


BCC'ing author.

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


svn commit: r303806 - head/sys/dev/usb

2016-08-06 Thread Cy Schubert
Author: cy
Date: Sat Aug  6 20:27:12 2016
New Revision: 303806
URL: https://svnweb.freebsd.org/changeset/base/303806

Log:
  Add Logitech Unifying receiver.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSat Aug  6 19:12:23 2016(r303805)
+++ head/sys/dev/usb/usbdevsSat Aug  6 20:27:12 2016(r303806)
@@ -2729,6 +2729,7 @@ product LOGITECH BB13 0xc401  USB-PS/2 T
 product LOGITECH RK53  0xc501  Cordless mouse
 product LOGITECH RB6   0xc503  Cordless keyboard
 product LOGITECH MX700 0xc506  Cordless optical mouse
+product LOGITECH UNIFYING  0xc52b  Logitech Unifying Receiver
 product LOGITECH QUICKCAMPRO2  0xd001  QuickCam Pro
 
 /* Logitec Corp. products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303746 - head/usr.bin/indent

2016-08-06 Thread Ed Schouten
Hi Pedro,

2016-08-04 17:27 GMT+02:00 Pedro F. Giffuni :
> Log:
>   indent(1): Use bsearch() for looking up type keywords.

You're never doing any deletions, right? Would it make more sense to
use hsearch_r() in that case?

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303801 - head/share/man/man3

2016-08-06 Thread Benjamin Kaduk
Indeed; it seems I was not checking what I thought I was checking in
sys/queue.h; fix incoming.

-Ben

On Sat, 6 Aug 2016, Conrad Meyer wrote:

> Hey Benjamin,
>
> The submitter notes that this wider change isn't quite right in
> https://reviews.freebsd.org/D7428 — LIST_SWAP and TAILQ_SWAP both need
> the "entry" parameter.
>
> Best,
> Conrad
>
> On Sat, Aug 6, 2016 at 10:27 AM, Benjamin Kaduk  wrote:
> > Author: bjk (doc committer)
> > Date: Sat Aug  6 17:27:07 2016
> > New Revision: 303801
> > URL: https://svnweb.freebsd.org/changeset/base/303801
> >
> > Log:
> >   Correct the documentation of the 'type' parameter for the _SWAP
> >   macros from sys/queue.h
> >
> >   Submitted by: akshay1994.leo_gmail.com (for STAILQ)
> >   Differential Revision:https://reviews.freebsd.org/D7428
> >
> > Modified:
> >   head/share/man/man3/queue.3
> >
> > Modified: head/share/man/man3/queue.3
> > ==
> > --- head/share/man/man3/queue.3 Sat Aug  6 17:24:35 2016(r303800)
> > +++ head/share/man/man3/queue.3 Sat Aug  6 17:27:07 2016(r303801)
> > @@ -141,7 +141,7 @@ lists and tail queues
> >  .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
> >  .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
> >  .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
> > -.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
> > +.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE"
> >  .\"
> >  .Fn STAILQ_CLASS_ENTRY "CLASSTYPE"
> >  .Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> > @@ -164,7 +164,7 @@ lists and tail queues
> >  .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY 
> > NAME"
> >  .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
> >  .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
> > -.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY 
> > NAME"
> > +.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "TYPE"
> >  .\"
> >  .Fn LIST_CLASS_ENTRY "CLASSTYPE"
> >  .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> > @@ -184,7 +184,7 @@ lists and tail queues
> >  .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
> >  .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
> >  .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
> > -.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY 
> > NAME"
> > +.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE"
> >  .\"
> >  .Fn TAILQ_CLASS_ENTRY "CLASSTYPE"
> >  .Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> > @@ -211,7 +211,7 @@ lists and tail queues
> >  .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME"
> >  .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME"
> >  .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
> > -.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY 
> > NAME"
> > +.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE"
> >  .\"
> >  .Sh DESCRIPTION
> >  These macros define and operate on four types of data structures which
> >
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r303805 - head/share/man/man3

2016-08-06 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Sat Aug  6 19:12:23 2016
New Revision: 303805
URL: https://svnweb.freebsd.org/changeset/base/303805

Log:
  Re-correct the documentation for the 'type' parameter of the _SWAP
  macros from sys/queue.h -- only the singly-linked forms do not need
  the 'field' argument.
  
  Pointy Hat to:bjk
  Reported by:  akshay1994.leo_gmail.com

Modified:
  head/share/man/man3/queue.3

Modified: head/share/man/man3/queue.3
==
--- head/share/man/man3/queue.3 Sat Aug  6 19:05:01 2016(r303804)
+++ head/share/man/man3/queue.3 Sat Aug  6 19:12:23 2016(r303805)
@@ -184,7 +184,7 @@ lists and tail queues
 .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
 .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
 .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
-.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE"
+.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
 .\"
 .Fn TAILQ_CLASS_ENTRY "CLASSTYPE"
 .Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
@@ -211,7 +211,7 @@ lists and tail queues
 .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME"
 .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME"
 .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
-.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE"
+.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY 
NAME"
 .\"
 .Sh DESCRIPTION
 These macros define and operate on four types of data structures which
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303801 - head/share/man/man3

2016-08-06 Thread Conrad Meyer
Hey Benjamin,

The submitter notes that this wider change isn't quite right in
https://reviews.freebsd.org/D7428 — LIST_SWAP and TAILQ_SWAP both need
the "entry" parameter.

Best,
Conrad

On Sat, Aug 6, 2016 at 10:27 AM, Benjamin Kaduk  wrote:
> Author: bjk (doc committer)
> Date: Sat Aug  6 17:27:07 2016
> New Revision: 303801
> URL: https://svnweb.freebsd.org/changeset/base/303801
>
> Log:
>   Correct the documentation of the 'type' parameter for the _SWAP
>   macros from sys/queue.h
>
>   Submitted by: akshay1994.leo_gmail.com (for STAILQ)
>   Differential Revision:https://reviews.freebsd.org/D7428
>
> Modified:
>   head/share/man/man3/queue.3
>
> Modified: head/share/man/man3/queue.3
> ==
> --- head/share/man/man3/queue.3 Sat Aug  6 17:24:35 2016(r303800)
> +++ head/share/man/man3/queue.3 Sat Aug  6 17:27:07 2016(r303801)
> @@ -141,7 +141,7 @@ lists and tail queues
>  .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
>  .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
>  .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
> -.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
> +.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE"
>  .\"
>  .Fn STAILQ_CLASS_ENTRY "CLASSTYPE"
>  .Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> @@ -164,7 +164,7 @@ lists and tail queues
>  .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
>  .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
>  .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
> -.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME"
> +.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "TYPE"
>  .\"
>  .Fn LIST_CLASS_ENTRY "CLASSTYPE"
>  .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> @@ -184,7 +184,7 @@ lists and tail queues
>  .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
>  .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
>  .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
> -.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
> +.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE"
>  .\"
>  .Fn TAILQ_CLASS_ENTRY "CLASSTYPE"
>  .Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
> @@ -211,7 +211,7 @@ lists and tail queues
>  .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME"
>  .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME"
>  .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
> -.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY 
> NAME"
> +.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE"
>  .\"
>  .Sh DESCRIPTION
>  These macros define and operate on four types of data structures which
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r303804 - head/usr.bin/tar/tests

2016-08-06 Thread Garrett Cooper
Author: ngie
Date: Sat Aug  6 19:05:01 2016
New Revision: 303804
URL: https://svnweb.freebsd.org/changeset/base/303804

Log:
  Fix building usr.bin/tar/tests with PIE symbol building enabled by
  removing CFLAGS+= -static
  
  `CFLAGS+= -static` was a carryover from pre-r289195 with
  usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
  There doesn't seem to be an apparent need for static compilation
  of the test binaries.
  
  Differential Revision:https://reviews.freebsd.org/D7430
  MFC after:1 week
  Obtained-from:opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)
  Submitted by: op
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.bin/tar/tests/Makefile

Modified: head/usr.bin/tar/tests/Makefile
==
--- head/usr.bin/tar/tests/Makefile Sat Aug  6 18:48:47 2016
(r303803)
+++ head/usr.bin/tar/tests/Makefile Sat Aug  6 19:05:01 2016
(r303804)
@@ -9,7 +9,6 @@ ATF_TESTS_SH+=  functional_test
 BINDIR=${TESTSDIR}
 
 CFLAGS+=   
-DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
-CFLAGS+=   -static
 CFLAGS+=   -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
 CFLAGS+=   -I${_LIBARCHIVEDIR}/tar -I${_LIBARCHIVEDIR}/test_utils
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303803 - in head/sys/dev: fdt ofw

2016-08-06 Thread Stephen J. Kiernan
Author: stevek
Date: Sat Aug  6 18:48:47 2016
New Revision: 303803
URL: https://svnweb.freebsd.org/changeset/base/303803

Log:
  Add hw.fdt sysctl node.
  Make FDT blob available via opaque hw.fdt.dtb sysctl, if a DTB has been
  installed by the time sysctls are registered.
  
  Reviewed by:  andrew
  Approved by:  sjg (mentor)
  Sponsored by: Juniper Networks, Inc.
  Differential Revision:https://reviews.freebsd.org/D7411

Modified:
  head/sys/dev/fdt/fdt_common.c
  head/sys/dev/fdt/fdt_common.h
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/fdt/fdt_common.c
==
--- head/sys/dev/fdt/fdt_common.c   Sat Aug  6 17:53:53 2016
(r303802)
+++ head/sys/dev/fdt/fdt_common.c   Sat Aug  6 18:48:47 2016
(r303803)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -60,6 +61,8 @@ __FBSDID("$FreeBSD$");
 
 #define FDT_REG_CELLS  4
 
+SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD, 0, "Flattened Device Tree");
+
 vm_paddr_t fdt_immr_pa;
 vm_offset_t fdt_immr_va;
 vm_offset_t fdt_immr_size;

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Sat Aug  6 17:53:53 2016
(r303802)
+++ head/sys/dev/fdt/fdt_common.h   Sat Aug  6 18:48:47 2016
(r303803)
@@ -32,6 +32,7 @@
 #ifndef _FDT_COMMON_H_
 #define _FDT_COMMON_H_
 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +81,8 @@ extern struct fdt_pm_mask_entry fdt_pm_m
 extern u_char fdt_static_dtb;
 #endif
 
+SYSCTL_DECL(_hw_fdt);
+
 int fdt_addrsize_cells(phandle_t, int *, int *);
 u_long fdt_data_get(void *, int);
 int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Sat Aug  6 17:53:53 2016(r303802)
+++ head/sys/dev/ofw/ofw_fdt.c  Sat Aug  6 18:48:47 2016(r303803)
@@ -96,6 +96,27 @@ OFW_DEF(ofw_fdt);
 static void *fdtp = NULL;
 
 static int
+sysctl_handle_dtb(SYSCTL_HANDLER_ARGS)
+{
+
+return (sysctl_handle_opaque(oidp, fdtp, fdt_totalsize(fdtp), req));
+}
+
+static void
+sysctl_register_fdt_oid(void *arg)
+{
+
+   /* If there is no FDT registered, skip adding the sysctl */
+   if (fdtp == NULL)
+   return;
+
+   SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), OID_AUTO, "dtb",
+   CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_handle_dtb, "",
+   "Device Tree Blob");
+}
+SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, 0);
+
+static int
 ofw_fdt_init(ofw_t ofw, void *data)
 {
int err;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303802 - head/share/misc

2016-08-06 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Sat Aug  6 17:53:53 2016
New Revision: 303802
URL: https://svnweb.freebsd.org/changeset/base/303802

Log:
  Update with the members of the 9th core team.

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==
--- head/share/misc/organization.dotSat Aug  6 17:27:07 2016
(r303801)
+++ head/share/misc/organization.dotSat Aug  6 17:53:53 2016
(r303802)
@@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"]
 
 # Development teams go here alphabetically sorted
 
-core [label="Core Team\nc...@freebsd.org\nbapt, emaste, gavin,\nglebius, gnn, 
hrs,\npeter, rwatson, theraven"]
+core [label="Core Team\nc...@freebsd.org\nallanjude, bapt, bcr,\nbenno, 
emaste, gnn,\nhrs, jhb, kmoore"]
 coresecretary [label="Core Team 
Secretary\ncore-secret...@freebsd.org\nmatthew"]
 doccommitters [label="Doc/www Committers\ndoc-committ...@freebsd.org"]
 doceng [label="Documentation Engineering Team\ndoc...@freebsd.org\ngjb, 
blackend,\ngabor, hrs"]
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303801 - head/share/man/man3

2016-08-06 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Sat Aug  6 17:27:07 2016
New Revision: 303801
URL: https://svnweb.freebsd.org/changeset/base/303801

Log:
  Correct the documentation of the 'type' parameter for the _SWAP
  macros from sys/queue.h
  
  Submitted by: akshay1994.leo_gmail.com (for STAILQ)
  Differential Revision:https://reviews.freebsd.org/D7428

Modified:
  head/share/man/man3/queue.3

Modified: head/share/man/man3/queue.3
==
--- head/share/man/man3/queue.3 Sat Aug  6 17:24:35 2016(r303800)
+++ head/share/man/man3/queue.3 Sat Aug  6 17:27:07 2016(r303801)
@@ -141,7 +141,7 @@ lists and tail queues
 .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
 .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
 .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
-.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
+.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE"
 .\"
 .Fn STAILQ_CLASS_ENTRY "CLASSTYPE"
 .Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
@@ -164,7 +164,7 @@ lists and tail queues
 .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
 .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
 .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
-.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME"
+.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "TYPE"
 .\"
 .Fn LIST_CLASS_ENTRY "CLASSTYPE"
 .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE"
@@ -184,7 +184,7 @@ lists and tail queues
 .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
 .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
 .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
-.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
+.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE"
 .\"
 .Fn TAILQ_CLASS_ENTRY "CLASSTYPE"
 .Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
@@ -211,7 +211,7 @@ lists and tail queues
 .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME"
 .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME"
 .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
-.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY 
NAME"
+.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE"
 .\"
 .Sh DESCRIPTION
 These macros define and operate on four types of data structures which
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303800 - head/sys/fs/ext2fs

2016-08-06 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Aug  6 17:24:35 2016
New Revision: 303800
URL: https://svnweb.freebsd.org/changeset/base/303800

Log:
  ext2fs:   Add defines for some missing ext4 feature flags.
  
  These are currently unused in our implementation and some even appear to
  have not been implemented yet on linux but it is good to keep them for
  reference.
  
  Obtained from:NetBSD (CVS Rev. 1.41)
  MFC after:1 month

Modified:
  head/sys/fs/ext2fs/ext2fs.h

Modified: head/sys/fs/ext2fs/ext2fs.h
==
--- head/sys/fs/ext2fs/ext2fs.h Sat Aug  6 16:48:40 2016(r303799)
+++ head/sys/fs/ext2fs/ext2fs.h Sat Aug  6 17:24:35 2016(r303800)
@@ -206,6 +206,7 @@ struct csum {
 #defineEXT2F_COMPAT_HASJOURNAL 0x0004
 #defineEXT2F_COMPAT_RESIZE 0x0010
 #defineEXT2F_COMPAT_DIRHASHINDEX   0x0020
+#defineEXT2F_COMPAT_SPARSESUPER2   0x0200
 
 #defineEXT2F_ROCOMPAT_SPARSESUPER  0x0001
 #defineEXT2F_ROCOMPAT_LARGEFILE0x0002
@@ -214,6 +215,11 @@ struct csum {
 #defineEXT2F_ROCOMPAT_GDT_CSUM 0x0010
 #defineEXT2F_ROCOMPAT_DIR_NLINK0x0020
 #defineEXT2F_ROCOMPAT_EXTRA_ISIZE  0x0040
+#defineEXT2F_ROCOMPAT_QUOTA0x0100
+#defineEXT2F_ROCOMPAT_BIGALLOC 0x0200
+#defineEXT2F_ROCOMPAT_METADATA_CKSUM   0x0400
+#defineEXT2F_ROCOMPAT_READONLY 0x1000
+#defineEXT2F_ROCOMPAT_PROJECT  0x2000
 
 #defineEXT2F_INCOMPAT_COMP 0x0001
 #defineEXT2F_INCOMPAT_FTYPE0x0002
@@ -223,6 +229,12 @@ struct csum {
 #defineEXT2F_INCOMPAT_64BIT0x0080
 #defineEXT2F_INCOMPAT_MMP  0x0100
 #defineEXT2F_INCOMPAT_FLEX_BG  0x0200
+#defineEXT2F_INCOMPAT_EA_INODE 0x0400
+#defineEXT2F_INCOMPAT_DIRDATA  0x1000
+#defineEXT2F_INCOMPAT_CSUM_SEED0x2000
+#defineEXT2F_INCOMPAT_LARGEDIR 0x4000
+#defineEXT2F_INCOMPAT_INLINE_DATA  0x8000
+#defineEXT2F_INCOMPAT_ENCRYPT  0x1
 
 /*
  * Features supported in this implementation
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303799 - head/sys/fs/ext2fs

2016-08-06 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Aug  6 16:48:40 2016
New Revision: 303799
URL: https://svnweb.freebsd.org/changeset/base/303799

Log:
  ext2fs:   Add some more inode flags.
  
  These are currently unused in out implementation but it is good to keep
  them for reference.
  
  Obtained from:NetBSD (CVS Rev. 1.35)
  MFC after:1 month

Modified:
  head/sys/fs/ext2fs/ext2_dinode.h

Modified: head/sys/fs/ext2fs/ext2_dinode.h
==
--- head/sys/fs/ext2fs/ext2_dinode.hSat Aug  6 15:29:46 2016
(r303798)
+++ head/sys/fs/ext2fs/ext2_dinode.hSat Aug  6 16:48:40 2016
(r303799)
@@ -71,7 +71,10 @@
 #defineEXT4_TOPDIR 0x0002 /* Top of directory 
hierarchies*/
 #defineEXT4_HUGE_FILE  0x0004  /* Set to each huge 
file */
 #defineEXT4_EXTENTS0x0008  /* Inode uses extents */
+#defineEXT4_EA_INODE   0x0020  /* Inode used for large 
EA */
 #defineEXT4_EOFBLOCKS  0x0040 /* Blocks allocated beyond 
EOF */
+#defineEXT4_INLINE_DATA0x1000 /* Inode has inline data */
+#defineEXT4_PROJINHERIT0x2000 /* Children inherit project 
ID */
 
 /*
  * Definitions for nanosecond timestamps.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303798 - head/sys/netinet

2016-08-06 Thread Michael Tuexen
Author: tuexen
Date: Sat Aug  6 15:29:46 2016
New Revision: 303798
URL: https://svnweb.freebsd.org/changeset/base/303798

Log:
  Don't modify a structure without holding a reference count on it.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Sat Aug  6 15:10:14 2016(r303797)
+++ head/sys/netinet/sctputil.c Sat Aug  6 15:29:46 2016(r303798)
@@ -6098,9 +6098,9 @@ out:
goto stage_left;
 #endif
}
-   atomic_add_int(>asoc.refcnt, -1);
/* Save the value back for next time */
stcb->freed_by_sorcv_sincelast = freed_so_far;
+   atomic_add_int(>asoc.refcnt, -1);
}
if (SCTP_BASE_SYSCTL(sctp_logging_level) & 
SCTP_RECV_RWND_LOGGING_ENABLE) {
if (stcb) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303797 - head/contrib/binutils/bfd

2016-08-06 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug  6 15:10:14 2016
New Revision: 303797
URL: https://svnweb.freebsd.org/changeset/base/303797

Log:
  Check the first byte of the array for NUL, instead of the array as a NULL 
pointer
  
  The partition_name field is an array, so can never be NULL itself.  Check only
  the first byte instead.
  
  This was found when test building with clang, but I'm not sure how it passes
  gcc's warnings either.

Modified:
  head/contrib/binutils/bfd/ppcboot.c

Modified: head/contrib/binutils/bfd/ppcboot.c
==
--- head/contrib/binutils/bfd/ppcboot.c Sat Aug  6 15:06:19 2016
(r303796)
+++ head/contrib/binutils/bfd/ppcboot.c Sat Aug  6 15:10:14 2016
(r303797)
@@ -419,7 +419,7 @@ ppcboot_bfd_print_private_bfd_data (abfd
   if (tdata->header.os_id)
 fprintf (f, "OS_ID   = 0x%.2x\n", tdata->header.os_id);
 
-  if (tdata->header.partition_name)
+  if (tdata->header.partition_name[0])
 fprintf (f, _("Partition name  = \"%s\"\n"), 
tdata->header.partition_name);
 
   for (i = 0; i < 4; i++)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303796 - head/sys/cddl/dev/dtrace/powerpc

2016-08-06 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug  6 15:06:19 2016
New Revision: 303796
URL: https://svnweb.freebsd.org/changeset/base/303796

Log:
  Two fixups for dtrace
  
  * Use the right incantation to get the next stack pointer.  Since powerpc uses
special frames for traps, dereferencing the stack pointer straight up won't
get us the next stack pointer in every case.
  * Clear EE using the correct instruction sequence.  The PowerISA states that
'andi.' ANDs the register with 0||, instead of sign extending or 
filling
out the unavailable bits with 1.  Even if it did sign extend, PSL_EE is
0x8000, so ~PSL_EE is 0x7fff, and the upper bits would be cleared.  Use 
rlwinm
in the 32-bit case, and a two-rotate sequence in the 64-bit case, the latter
chosen to follow the output generated by gcc.
  
  MFC after:1 week

Modified:
  head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
  head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S   Sat Aug  6 13:32:40 
2016(r303795)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S   Sat Aug  6 15:06:19 
2016(r303796)
@@ -67,7 +67,13 @@ dtrace_icookie_t dtrace_interrupt_disabl
 */
 ASENTRY_NOPROF(dtrace_interrupt_disable)
mfmsr   %r3
-   andi.   %r0,%r3,~PSL_EE@l
+#ifdef __powerpc64__
+   /* Two-instruction sequence to clear EE flag */
+   rldicl  %r0,%r3,48,1
+   rotldi  %r0,%r0,16
+#else
+   rlwinm  %r0,%r3,0,~PSL_EE /* Clear EE flag */
+#endif
mtmsr   %r0
blr
 END(dtrace_interrupt_disable)

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c   Sat Aug  6 13:32:40 
2016(r303795)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c   Sat Aug  6 15:06:19 
2016(r303796)
@@ -545,7 +545,7 @@ dtrace_getstackdepth(int aframes)
else
aframes--;
osp = sp;
-   sp = *(uintptr_t *)sp;
+   sp = dtrace_next_sp(sp);
}
if (depth < aframes)
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303795 - in head/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread

2016-08-06 Thread Konstantin Belousov
Author: kib
Date: Sat Aug  6 13:32:40 2016
New Revision: 303795
URL: https://svnweb.freebsd.org/changeset/base/303795

Log:
  Add __cxa_thread_atexit(3) API implementation.
  
  This is the backing feature to implement C++11 thread storage duration
  specified by the thread_local keyword.  A destructor for given
  thread-local object is registered to be executed at the thread
  termination time using __cxa_thread_atexit().  Libc calls the
  __cxa_thread_calls_dtors() during exit(3), before finalizers and
  atexit functions, and libthr calls the function at the thread
  termination time, after the stack unwinding and thread-specific key
  destruction.
  
  There are several uncertainties in the API which lacks a formal
  specification.  Among them:
  - is it allowed to register destructors during destructing;
we allow, but limiting the nesting level.  If too many iterations
detected, a diagnostic is issued to stderr and thread forcibly
terminates for now.
  - how to handle destructors which belong to an unloading dso;
for now, we ignore destructor calls for such entries, and
issue a diagnostic.  Linux does prevent dso unload until all
threads with destructors from the dso terminated.
  It is supposed that the diagnostics allow to detect real-world
  applications relying on the above details and possibly adjust
  our implementation.  Right now the choices were to provide the slim
  API (but that rarely stands the practice test).
  
  Tests are added to check generic functionality and to specify some of
  the above implementation choices.
  
  Submitted by: Mahdi Mokhtari 
  Reviewed by:  theraven
  Discussed with:   dim (detection of -std=c++11 supoort for tests)
  Sponsored by: The FreeBSD Foundation (my involvement)
  MFC after:2 weeks
  Differential revisions:   https://reviews.freebsd.org/D7224,
  https://reviews.freebsd.org/D7427

Added:
  head/lib/libc/stdlib/cxa_thread_atexit.c   (contents, props changed)
  head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc   (contents, props 
changed)
  head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc   (contents, props 
changed)
Modified:
  head/lib/libc/include/libc_private.h
  head/lib/libc/stdlib/Makefile.inc
  head/lib/libc/stdlib/Symbol.map
  head/lib/libc/stdlib/exit.c
  head/lib/libc/tests/stdlib/Makefile
  head/lib/libc/tests/stdlib/Makefile.depend
  head/lib/libthr/thread/thr_exit.c

Modified: head/lib/libc/include/libc_private.h
==
--- head/lib/libc/include/libc_private.hSat Aug  6 13:28:58 2016
(r303794)
+++ head/lib/libc/include/libc_private.hSat Aug  6 13:32:40 2016
(r303795)
@@ -267,6 +267,12 @@ extern const char *__progname;
 void _malloc_thread_cleanup(void);
 
 /*
+ * This function is used by the threading libraries to notify libc that a
+ * thread is exiting, so its thread-local dtors should be called.
+ */
+void __cxa_thread_call_dtors(void);
+
+/*
  * These functions are used by the threading libraries in order to protect
  * malloc across fork().
  */

Modified: head/lib/libc/stdlib/Makefile.inc
==
--- head/lib/libc/stdlib/Makefile.inc   Sat Aug  6 13:28:58 2016
(r303794)
+++ head/lib/libc/stdlib/Makefile.inc   Sat Aug  6 13:32:40 2016
(r303795)
@@ -5,7 +5,7 @@
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib
 
 MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
-   bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \
+   bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c 
getopt_long.c \
getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \
hsearch_r.c imaxabs.c imaxdiv.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \

Modified: head/lib/libc/stdlib/Symbol.map
==
--- head/lib/libc/stdlib/Symbol.map Sat Aug  6 13:28:58 2016
(r303794)
+++ head/lib/libc/stdlib/Symbol.map Sat Aug  6 13:32:40 2016
(r303795)
@@ -116,8 +116,13 @@ FBSD_1.4 {
reallocarray;
 };
 
+FBSD_1.5 {
+   __cxa_thread_atexit;
+};
+
 FBSDprivate_1.0 {
__system;
_system;
__libc_system;
+   __cxa_thread_call_dtors;
 };

Added: head/lib/libc/stdlib/cxa_thread_atexit.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/stdlib/cxa_thread_atexit.cSat Aug  6 13:32:40 2016
(r303795)
@@ -0,0 +1,140 @@
+/*-
+ * Copyright (c) 2016 Mahdi Mokhtari 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 

svn commit: r303794 - head/lib/libc

2016-08-06 Thread Konstantin Belousov
Author: kib
Date: Sat Aug  6 13:28:58 2016
New Revision: 303794
URL: https://svnweb.freebsd.org/changeset/base/303794

Log:
  Create namespace for the symbols added during 12-CURRENT cycle.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/lib/libc/Versions.def

Modified: head/lib/libc/Versions.def
==
--- head/lib/libc/Versions.def  Sat Aug  6 12:51:07 2016(r303793)
+++ head/lib/libc/Versions.def  Sat Aug  6 13:28:58 2016(r303794)
@@ -27,6 +27,10 @@ FBSD_1.3 {
 FBSD_1.4 {
 } FBSD_1.3;
 
+# This version was first added to 12.0-current.
+FBSD_1.5 {
+} FBSD_1.4;
+
 
 # This is our private namespace.  Any global interfaces that are
 # strictly for use only by other FreeBSD applications and libraries
@@ -35,4 +39,4 @@ FBSD_1.4 {
 #
 # Please do NOT increment the version of this namespace.
 FBSDprivate_1.0 {
-} FBSD_1.4;
+} FBSD_1.5;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303793 - head/sys/netinet

2016-08-06 Thread Michael Tuexen
Author: tuexen
Date: Sat Aug  6 12:51:07 2016
New Revision: 303793
URL: https://svnweb.freebsd.org/changeset/base/303793

Log:
  Mark an unused parameter as such.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cSat Aug  6 12:33:15 2016
(r303792)
+++ head/sys/netinet/sctp_ss_functions.cSat Aug  6 12:51:07 2016
(r303793)
@@ -221,9 +221,11 @@ default_again:
 }
 
 static void
-sctp_ss_default_scheduled(struct sctp_tcb *stcb, struct sctp_nets *net 
SCTP_UNUSED,
+sctp_ss_default_scheduled(struct sctp_tcb *stcb,
+struct sctp_nets *net SCTP_UNUSED,
 struct sctp_association *asoc,
-struct sctp_stream_out *strq, int moved_how_much)
+struct sctp_stream_out *strq,
+int moved_how_much SCTP_UNUSED)
 {
struct sctp_stream_queue_pending *sp;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303792 - head/sys/netinet

2016-08-06 Thread Michael Tuexen
Author: tuexen
Date: Sat Aug  6 12:33:15 2016
New Revision: 303792
URL: https://svnweb.freebsd.org/changeset/base/303792

Log:
  Fix various bugs in relation to the I-DATA chunk support
  
  This is joint work with rrs.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_ss_functions.c
  head/sys/netinet/sctp_structs.h
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Sat Aug  6 11:02:07 2016
(r303791)
+++ head/sys/netinet/sctp_indata.c  Sat Aug  6 12:33:15 2016
(r303792)
@@ -64,7 +64,7 @@ sctp_add_chk_to_control(struct sctp_queu
 struct sctp_stream_in *strm,
 struct sctp_tcb *stcb,
 struct sctp_association *asoc,
-struct sctp_tmit_chunk *chk);
+struct sctp_tmit_chunk *chk, int lock_held);
 
 
 void
@@ -448,7 +448,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stc
 }
 
 static void
-clean_up_control(struct sctp_tcb *stcb, struct sctp_queued_to_read *control)
+sctp_clean_up_control(struct sctp_tcb *stcb, struct sctp_queued_to_read 
*control)
 {
/*
 * The control could not be placed and must be cleaned.
@@ -612,7 +612,7 @@ protocol_error:
snprintf(msg, sizeof(msg),
"Queue to str msg_id: %u duplicate",
control->msg_id);
-   clean_up_control(stcb, control);
+   sctp_clean_up_control(stcb, control);
op_err = 
sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA 
+ SCTP_LOC_3;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, 
SCTP_SO_NOT_LOCKED);
@@ -739,9 +739,28 @@ sctp_build_readq_entry_from_ctl(struct s
nc->port_from = control->port_from;
 }
 
+static void
+sctp_reset_a_control(struct sctp_queued_to_read *control,
+struct sctp_inpcb *inp, uint32_t tsn)
+{
+   control->fsn_included = tsn;
+   if (control->on_read_q) {
+   /*
+* We have to purge it from there, hopefully this will work
+* :-)
+*/
+   TAILQ_REMOVE(>read_queue, control, next);
+   control->on_read_q = 0;
+   }
+}
+
 static int
-sctp_handle_old_data(struct sctp_tcb *stcb, struct sctp_association *asoc, 
struct sctp_stream_in *strm,
-struct sctp_queued_to_read *control, uint32_t pd_point)
+sctp_handle_old_unordered_data(struct sctp_tcb *stcb,
+struct sctp_association *asoc,
+struct sctp_stream_in *strm,
+struct sctp_queued_to_read *control,
+uint32_t pd_point,
+int inp_read_lock_held)
 {
/*
 * Special handling for the old un-ordered data chunk. All the
@@ -774,7 +793,7 @@ restart:
}
memset(nc, 0, sizeof(struct sctp_queued_to_read));
TAILQ_REMOVE(>reasm, chk, sctp_next);
-   sctp_add_chk_to_control(control, strm, stcb, asoc, chk);
+   sctp_add_chk_to_control(control, strm, stcb, asoc, chk, 
SCTP_READ_LOCK_NOT_HELD);
fsn++;
cnt_added++;
chk = NULL;
@@ -793,6 +812,8 @@ restart:
nc->first_frag_seen = 1;
nc->fsn_included = 
tchk->rec.data.fsn_num;
nc->data = tchk->data;
+   nc->sinfo_ppid = 
tchk->rec.data.payloadtype;
+   nc->sinfo_tsn = 
tchk->rec.data.TSN_seq;
sctp_mark_non_revokable(asoc, 
tchk->rec.data.TSN_seq);
tchk->data = NULL;
sctp_free_a_chunk(stcb, tchk, 
SCTP_SO_NOT_LOCKED);
@@ -828,7 +849,7 @@ restart:
if (control->on_read_q == 0) {
sctp_add_to_readq(stcb->sctp_ep, stcb, 
control,
>sctp_socket->so_rcv, 
control->end_added,
-   SCTP_READ_LOCK_NOT_HELD, 
SCTP_SO_NOT_LOCKED);
+   inp_read_lock_held, 
SCTP_SO_NOT_LOCKED);
}
sctp_wakeup_the_read_socket(stcb->sctp_ep, 
stcb, SCTP_SO_NOT_LOCKED);
if ((nc->first_frag_seen) && 
!TAILQ_EMPTY(>reasm)) {
@@ -839,7 +860,9 @@ restart:
control = nc;
goto restart;
  

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

2016-08-06 Thread Andriy Gapon
Author: avg
Date: Sat Aug  6 11:02:07 2016
New Revision: 303791
URL: https://svnweb.freebsd.org/changeset/base/303791

Log:
  fix .zfs-related cases in zfs_lookup that were broken by r303763
  
  The problem is that the special .zfs nodes are not represented by
  znodes but by special gfs-based nodes.
  r303763 changed interface of zfs_dirlook such that started operating on
  znodes rather than on vnodes and, thus, the function became unsuitable
  for handling .zfs entities.
  The solution is to move the handling of the special cases to zfs_lookup,
  the only consumer of zfs_dirlook.
  I already had this solution applied in D7421, but for different reasons.
  
  Reported by:  asomers
  MFC after:3 days
  X-MFC with:   r303763

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c   Sat Aug 
 6 08:23:36 2016(r303790)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c   Sat Aug 
 6 11:02:07 2016(r303791)
@@ -173,7 +173,6 @@ zfs_dd_lookup(znode_t *dzp, znode_t **zp
 {
zfsvfs_t *zfsvfs = dzp->z_zfsvfs;
znode_t *zp;
-   vnode_t *vp;
uint64_t parent;
int error;
 
@@ -187,19 +186,7 @@ zfs_dd_lookup(znode_t *dzp, znode_t **zp
SA_ZPL_PARENT(zfsvfs), , sizeof (parent))) != 0)
return (error);
 
-   /*
-* If we are a snapshot mounted under .zfs, return
-* the snapshot directory.
-*/
-   if (parent == dzp->z_id && zfsvfs->z_parent != zfsvfs) {
-   error = zfsctl_root_lookup(zfsvfs->z_parent->z_ctldir,
-   "snapshot", , NULL, 0, NULL, kcred,
-   NULL, NULL, NULL);
-   if (error == 0)
-   zp = VTOZ(vp);
-   } else {
-   error = zfs_zget(zfsvfs, parent, );
-   }
+   error = zfs_zget(zfsvfs, parent, );
if (error == 0)
*zpp = zp;
return (error);
@@ -222,8 +209,6 @@ zfs_dirlook(znode_t *dzp, const char *na
*zpp = dzp;
} else if (name[0] == '.' && name[1] == '.' && name[2] == 0) {
error = zfs_dd_lookup(dzp, zpp);
-   } else if (zfs_has_ctldir(dzp) && strcmp(name, ZFS_CTLDIR_NAME) == 0) {
-   *zpp = VTOZ(zfsctl_root(dzp));
} else {
error = zfs_dirent_lookup(dzp, name, , ZEXISTS);
if (error == 0) {

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 Sat Aug 
 6 08:23:36 2016(r303790)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Aug 
 6 11:02:07 2016(r303791)
@@ -1605,6 +1605,39 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
return (SET_ERROR(EILSEQ));
}
 
+
+   /*
+* First handle the special cases.
+*/
+   if ((cnp->cn_flags & ISDOTDOT) != 0) {
+   /*
+* If we are a snapshot mounted under .zfs, return
+* the vp for the snapshot directory.
+*/
+   if (zdp->z_id == zfsvfs->z_root && zfsvfs->z_parent != zfsvfs) {
+   error = zfsctl_root_lookup(zfsvfs->z_parent->z_ctldir,
+   "snapshot", vpp, NULL, 0, NULL, kcred,
+   NULL, NULL, NULL);
+   ZFS_EXIT(zfsvfs);
+   if (error == 0) {
+   error = zfs_lookup_lock(dvp, *vpp, nm,
+   cnp->cn_lkflags);
+   }
+   goto out;
+   }
+   }
+   if (zfs_has_ctldir(zdp) && strcmp(nm, ZFS_CTLDIR_NAME) == 0) {
+   error = 0;
+   if ((cnp->cn_flags & ISLASTCN) != 0 && nameiop != LOOKUP)
+   error = SET_ERROR(ENOTSUP);
+   else
+   *vpp = zfsctl_root(zdp);
+   ZFS_EXIT(zfsvfs);
+   if (error == 0)
+   error = zfs_lookup_lock(dvp, *vpp, nm, cnp->cn_lkflags);
+   goto out;
+   }
+
/*
 * The loop is retry the lookup if the parent-child relationship
 * changes during the dot-dot locking complexities.
@@ -1653,6 +1686,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
vput(ZTOV(zp));
}
 
+out:
if (error != 0)
*vpp = NULL;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

svn commit: r303790 - stable/10/sys/kern

2016-08-06 Thread Konstantin Belousov
Author: kib
Date: Sat Aug  6 08:23:36 2016
New Revision: 303790
URL: https://svnweb.freebsd.org/changeset/base/303790

Log:
  MFC r303702:
  Remove mention of Giant from the fork_return() description.

Modified:
  stable/10/sys/kern/kern_fork.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_fork.c
==
--- stable/10/sys/kern/kern_fork.c  Sat Aug  6 08:20:58 2016
(r303789)
+++ stable/10/sys/kern/kern_fork.c  Sat Aug  6 08:23:36 2016
(r303790)
@@ -1044,9 +1044,9 @@ fork_exit(void (*callout)(void *, struct
 
 /*
  * Simplified back end of syscall(), used when returning from fork()
- * directly into user mode.  Giant is not held on entry, and must not
- * be held on return.  This function is passed in to fork_exit() as the
- * first parameter and is called when returning to a new userland process.
+ * directly into user mode.  This function is passed in to fork_exit()
+ * as the first parameter and is called when returning to a new
+ * userland process.
  */
 void
 fork_return(struct thread *td, struct trapframe *frame)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303789 - stable/11/sys/kern

2016-08-06 Thread Konstantin Belousov
Author: kib
Date: Sat Aug  6 08:20:58 2016
New Revision: 303789
URL: https://svnweb.freebsd.org/changeset/base/303789

Log:
  MFC r303702:
  Remove mention of Giant from the fork_return() description.
  
  Approved by:  re (gjb)

Modified:
  stable/11/sys/kern/kern_fork.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_fork.c
==
--- stable/11/sys/kern/kern_fork.c  Fri Aug  5 23:23:48 2016
(r303788)
+++ stable/11/sys/kern/kern_fork.c  Sat Aug  6 08:20:58 2016
(r303789)
@@ -1055,9 +1055,9 @@ fork_exit(void (*callout)(void *, struct
 
 /*
  * Simplified back end of syscall(), used when returning from fork()
- * directly into user mode.  Giant is not held on entry, and must not
- * be held on return.  This function is passed in to fork_exit() as the
- * first parameter and is called when returning to a new userland process.
+ * directly into user mode.  This function is passed in to fork_exit()
+ * as the first parameter and is called when returning to a new
+ * userland process.
  */
 void
 fork_return(struct thread *td, struct trapframe *frame)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"