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

2016-04-09 Thread Peter Grehan
Author: grehan
Date: Sun Apr 10 05:58:19 2016
New Revision: 297778
URL: https://svnweb.freebsd.org/changeset/base/297778

Log:
  Allow the location of the kernel source tree to be overridden.
  This makes it easier for the bhyve executable to be built
  out of the tree.

Modified:
  head/usr.sbin/bhyve/Makefile

Modified: head/usr.sbin/bhyve/Makefile
==
--- head/usr.sbin/bhyve/MakefileSun Apr 10 05:06:58 2016
(r29)
+++ head/usr.sbin/bhyve/MakefileSun Apr 10 05:58:19 2016
(r297778)
@@ -8,6 +8,8 @@ DEBUG_FLAGS= -g -O0
 
 MAN=   bhyve.8
 
+SYSDIR?=${.CURDIR}/../..
+
 SRCS=  \
atkbdc.c\
acpi.c  \
@@ -42,7 +44,7 @@ SRCS= \
xmsr.c  \
spinup_ap.c
 
-.PATH: ${.CURDIR}/../../sys/amd64/vmm
+.PATH:  ${SYSDIR}/sys/amd64/vmm
 SRCS+= vmm_instruction_emul.c
 
 LIBADD=vmmapi md pthread
___
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: r297777 - in head/sys: dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe

2016-04-09 Thread John Baldwin
Author: jhb
Date: Sun Apr 10 05:06:58 2016
New Revision: 29
URL: https://svnweb.freebsd.org/changeset/base/29

Log:
  Add a 'show t4 tcb  ' command to dump a TCB from DDB.
  
  This allows the contents of a TCB to be extracted from a T4/T5 card in
  DDB after a panic.

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_ddp.c
  head/sys/modules/cxgbe/if_cxgbe/Makefile

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSun Apr 10 05:05:02 2016
(r297776)
+++ head/sys/dev/cxgbe/t4_main.cSun Apr 10 05:06:58 2016
(r29)
@@ -28,6 +28,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ddb.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_rss.h"
@@ -63,6 +64,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #endif
+#ifdef DDB
+#include 
+#include 
+#endif
 
 #include "common/common.h"
 #include "common/t4_msg.h"
@@ -9163,6 +9168,86 @@ tweak_tunables(void)
t4_intr_types &= INTR_MSIX | INTR_MSI | INTR_INTX;
 }
 
+#ifdef DDB
+static void
+t4_dump_tcb(struct adapter *sc, int tid)
+{
+   uint32_t base, i, j, off, pf, reg, save, tcb_addr, win_pos;
+
+   reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2);
+   save = t4_read_reg(sc, reg);
+   base = sc->memwin[2].mw_base;
+
+   /* Dump TCB for the tid */
+   tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE);
+   tcb_addr += tid * TCB_SIZE;
+
+   if (is_t4(sc)) {
+   pf = 0;
+   win_pos = tcb_addr & ~0xf;  /* start must be 16B aligned */
+   } else {
+   pf = V_PFNUM(sc->pf);
+   win_pos = tcb_addr & ~0x7f; /* start must be 128B aligned */
+   }
+   t4_write_reg(sc, reg, win_pos | pf);
+   t4_read_reg(sc, reg);
+
+   off = tcb_addr - win_pos;
+   for (i = 0; i < 4; i++) {
+   uint32_t buf[8];
+   for (j = 0; j < 8; j++, off += 4)
+   buf[j] = htonl(t4_read_reg(sc, base + off));
+
+   db_printf("%08x %08x %08x %08x %08x %08x %08x %08x\n",
+   buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
+   buf[7]);
+   }
+
+   t4_write_reg(sc, reg, save);
+   t4_read_reg(sc, reg);
+}
+
+static struct command_table db_t4_table = LIST_HEAD_INITIALIZER(db_t4_table);
+_DB_SET(_show, t4, NULL, db_show_table, 0, _t4_table);
+
+DB_FUNC(tcb, db_show_t4tcb, db_t4_table, CS_OWN, NULL)
+{
+   device_t dev;
+   int radix, tid, t;
+   bool valid;
+
+   valid = false;
+   radix = db_radix;
+   db_radix = 10;
+   t = db_read_token();
+   if (t == tIDENT) {
+   dev = device_lookup_by_name(db_tok_string);
+   t = db_read_token();
+   if (t == tNUMBER) {
+   tid = db_tok_number;
+   valid = true;
+   }
+   }   
+   db_radix = radix;
+   db_skip_to_eol();
+   if (!valid) {
+   db_printf("usage: show t4 tcb  \n");
+   return;
+   }
+
+   if (dev == NULL) {
+   db_printf("device not found\n");
+   return;
+   }
+   if (tid < 0) {
+   db_printf("invalid tid\n");
+   return;
+   }
+
+   t4_dump_tcb(device_get_softc(dev), tid);
+}
+#endif
+
 static struct sx mlu;  /* mod load unload */
 SX_SYSINIT(cxgbe_mlu, , "cxgbe mod load/unload");
 

Modified: head/sys/dev/cxgbe/tom/t4_ddp.c
==
--- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 10 05:05:02 2016
(r297776)
+++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 10 05:06:58 2016
(r29)
@@ -80,31 +80,6 @@ static struct mbuf *get_ddp_mbuf(int len
 /* XXX: must match A_ULP_RX_TDDP_PSZ */
 static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6};
 
-#if 0
-static void
-t4_dump_tcb(struct adapter *sc, int tid)
-{
-   uint32_t tcb_base, off, i, j;
-
-   /* Dump TCB for the tid */
-   tcb_base = t4_read_reg(sc, A_TP_CMM_TCB_BASE);
-   t4_write_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2),
-   tcb_base + tid * TCB_SIZE);
-   t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2));
-   off = 0;
-   printf("\n");
-   for (i = 0; i < 4; i++) {
-   uint32_t buf[8];
-   for (j = 0; j < 8; j++, off += 4)
-   buf[j] = htonl(t4_read_reg(sc, MEMWIN2_BASE + off));
-
-   printf("%08x %08x %08x %08x %08x %08x %08x %08x\n",
-   buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6],
-   buf[7]);
-   }
-}
-#endif
-
 #define MAX_DDP_BUFFER_SIZE(M_TCB_RX_DDP_BUF0_LEN)
 static int
 alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr)

Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile

svn commit: r297776 - in head/sys: kern sys

2016-04-09 Thread John Baldwin
Author: jhb
Date: Sun Apr 10 05:05:02 2016
New Revision: 297776
URL: https://svnweb.freebsd.org/changeset/base/297776

Log:
  Add a function to lookup a device_t object by name.
  
  This just walks the global list of devices looking for one with the
  requested name.  The one use case outside of devctl2's implementation
  is for DDB commands that wish to lookup devices by name.

Modified:
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cSun Apr 10 04:16:34 2016(r297775)
+++ head/sys/kern/subr_bus.cSun Apr 10 05:05:02 2016(r297776)
@@ -5125,6 +5125,18 @@ bus_free_resource(device_t dev, int type
return (bus_release_resource(dev, type, rman_get_rid(r), r));
 }
 
+device_t
+device_lookup_by_name(const char *name)
+{
+   device_t dev;
+
+   TAILQ_FOREACH(dev, _data_devices, devlink) {
+   if (dev->nameunit != NULL && strcmp(dev->nameunit, name) == 0)
+   return (dev);
+   }
+   return (NULL);
+}
+
 /*
  * /dev/devctl2 implementation.  The existing /dev/devctl device has
  * implicit semantics on open, so it could not be reused for this.
@@ -5145,12 +5157,10 @@ find_device(struct devreq *req, device_t
 * Second, try to find an attached device whose name matches
 * 'name'.
 */
-   TAILQ_FOREACH(dev, _data_devices, devlink) {
-   if (dev->nameunit != NULL &&
-   strcmp(dev->nameunit, req->dr_name) == 0) {
-   *devp = dev;
-   return (0);
-   }
+   dev = device_lookup_by_name(req->dr_name);
+   if (dev != NULL) {
+   *devp = dev;
+   return (0);
}
 
/* Finally, give device enumerators a chance. */

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Sun Apr 10 04:16:34 2016(r297775)
+++ head/sys/sys/bus.h  Sun Apr 10 05:05:02 2016(r297776)
@@ -524,6 +524,7 @@ int device_is_attached(device_t dev);   /*
 intdevice_is_enabled(device_t dev);
 intdevice_is_suspended(device_t dev);
 intdevice_is_quiet(device_t dev);
+device_t device_lookup_by_name(const char *name);
 intdevice_print_prettyname(device_t dev);
 intdevice_printf(device_t dev, const char *, ...) __printflike(2, 3);
 intdevice_probe(device_t dev);
___
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: r297775 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
Author: adrian
Date: Sun Apr 10 04:16:34 2016
New Revision: 297775
URL: https://svnweb.freebsd.org/changeset/base/297775

Log:
  [net80211] correctly (i hope, wow) do a ticks comparison to limit A-MPDU 
attempts
  
  I was seeing the stack constantly attempt to renegotiate A-MPDU TX
  even after 3 failures.  My hunch is that the direct ticks comparison
  is failing around the ticks wrap-around point.
  
  This failure shouldn't /really/ happen normally, but it turns out being
  the IBSS master node on FreeBSD doesn't quite setup 11n right, so
  negotiating A-MPDU TX fails.

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cSun Apr 10 03:35:17 2016
(r297774)
+++ head/sys/net80211/ieee80211_ht.cSun Apr 10 04:16:34 2016
(r297775)
@@ -2157,7 +2157,7 @@ ieee80211_ampdu_enable(struct ieee80211_
return 0;
/* XXX check rssi? */
if (tap->txa_attempts >= ieee80211_addba_maxtries &&
-   ticks < tap->txa_nextrequest) {
+   ieee80211_time_after(ticks, tap->txa_nextrequest)) {
/*
 * Don't retry too often; txa_nextrequest is set
 * to the minimum interval we'll retry after
___
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: r297774 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
... sigh. I meant 'delete the #ifdef'. The code is still 100% here.


-a
___
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: r297774 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
Author: adrian
Date: Sun Apr 10 03:35:17 2016
New Revision: 297774
URL: https://svnweb.freebsd.org/changeset/base/297774

Log:
  [net80211] unconditionally do A-MPDU RX aging.
  
  It's 2016 and vendors (including us!) still have 802.11n TX/RX sequence
  handling bugs.  It's suboptimal, but I'd rather see us default to handling
  things in a sensible way.
  
  So, just delete the #ifdef'ed code for now.  I'll leave the option in
  so it doesn't break existing configurations.
  
  This all started because I've started getting reports about urtwn not
  working after I enabled 802.11n support, and it's because the ARM kernel
  configs don't include A-MPDU RX aging.

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cSun Apr 10 01:25:48 2016
(r297773)
+++ head/sys/net80211/ieee80211_ht.cSun Apr 10 03:35:17 2016
(r297774)
@@ -136,12 +136,10 @@ const struct ieee80211_mcs_rates ieee802
{ 429, 477,  891,  990 },   /* MCS 76 */
 };
 
-#ifdef IEEE80211_AMPDU_AGE
 static int ieee80211_ampdu_age = -1;   /* threshold for ampdu reorder q (ms) */
 SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT | CTLFLAG_RW,
_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, "I",
"AMPDU max reorder age (ms)");
-#endif
 
 static int ieee80211_recv_bar_ena = 1;
 SYSCTL_INT(_net_wlan, OID_AUTO, recv_bar, CTLFLAG_RW, _recv_bar_ena,
@@ -178,9 +176,7 @@ ieee80211_ht_init(void)
/*
 * Setup HT parameters that depends on the clock frequency.
 */
-#ifdef IEEE80211_AMPDU_AGE
ieee80211_ampdu_age = msecs_to_ticks(500);
-#endif
ieee80211_addba_timeout = msecs_to_ticks(250);
ieee80211_addba_backoff = msecs_to_ticks(10*1000);
ieee80211_bar_timeout = msecs_to_ticks(250);
@@ -671,7 +667,6 @@ ampdu_rx_dispatch(struct ieee80211_rx_am
vap->iv_stats.is_ampdu_rx_oor += i;
 }
 
-#ifdef IEEE80211_AMPDU_AGE
 /*
  * Dispatch all frames in the A-MPDU re-order queue.
  */
@@ -696,7 +691,6 @@ ampdu_rx_flush(struct ieee80211_node *ni
break;
}
 }
-#endif /* IEEE80211_AMPDU_AGE */
 
 /*
  * Dispatch all frames in the A-MPDU re-order queue
@@ -864,7 +858,7 @@ again:
 * Common case (hopefully): in the BA window.
 * Sec 9.10.7.6.2 a) (p.137)
 */
-#ifdef IEEE80211_AMPDU_AGE
+
/* 
 * Check for frames sitting too long in the reorder queue.
 * This should only ever happen if frames are not delivered
@@ -903,7 +897,7 @@ again:
 */
rap->rxa_age = ticks;
}
-#endif /* IEEE80211_AMPDU_AGE */
+
/* save packet */
if (rap->rxa_m[off] == NULL) {
rap->rxa_m[off] = m;
@@ -1125,14 +1119,11 @@ ieee80211_ht_node_cleanup(struct ieee802
 void
 ieee80211_ht_node_age(struct ieee80211_node *ni)
 {
-#ifdef IEEE80211_AMPDU_AGE
struct ieee80211vap *vap = ni->ni_vap;
uint8_t tid;
-#endif
 
KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT sta"));
 
-#ifdef IEEE80211_AMPDU_AGE
for (tid = 0; tid < WME_NUM_TID; tid++) {
struct ieee80211_rx_ampdu *rap;
 
@@ -1155,7 +1146,6 @@ ieee80211_ht_node_age(struct ieee80211_n
ampdu_rx_flush(ni, rap);
}
}
-#endif /* IEEE80211_AMPDU_AGE */
 }
 
 static struct ieee80211_channel *
___
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: r297773 - in head: cddl/contrib/opensolaris/cmd/dtrace sys/cddl/contrib/opensolaris/uts/common/dtrace

2016-04-09 Thread Mark Johnston
Author: markj
Date: Sun Apr 10 01:25:48 2016
New Revision: 297773
URL: https://svnweb.freebsd.org/changeset/base/297773

Log:
  Implement support for boot-time DTrace.
  
  This allows one to enable DTrace probes relatively early during boot,
  during SI_SUB_DTRACE_ANON, before dtrace(1) can invoked. The desired
  enabling is created using dtrace -A, which writes a /boot/dtrace.dof
  file and uses nextboot(8) to ensure that DTrace kernel modules are loaded
  and that the DOF file describing the enabling is loaded by loader(8)
  during the subsequent boot. The trace output can then be fetched with
  dtrace -a.
  
  With this commit, boot-time DTrace is only functional on i386 and amd64: on
  other architectures, the high-resolution timer frequency is initialized
  during SI_SUB_CLOCKS and is thus not available when the anonymous
  tracing state is initialized. On x86, the TSC is used and is thus available
  earlier.
  
  MFC after:1 month
  Relnotes: yes

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Sun Apr 10 01:25:12 
2016(r297772)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Sun Apr 10 01:25:48 
2016(r297773)
@@ -50,6 +50,9 @@
 #ifdef illumos
 #include 
 #endif
+#ifdef __FreeBSD__
+#include 
+#endif
 
 typedef struct dtrace_cmd {
void (*dc_func)(struct dtrace_cmd *);   /* function to compile arg */
@@ -397,7 +400,41 @@ dof_prune(const char *fname)
free(buf);
 }
 
-#ifdef illumos
+#ifdef __FreeBSD__
+/*
+ * Use nextboot(8) to tell the loader to load DTrace kernel modules during
+ * the next boot of the system. The nextboot(8) configuration is removed during
+ * boot, so it will not persist indefinitely.
+ */
+static void
+bootdof_add(void)
+{
+   char * const nbargv[] = {
+   "nextboot", "-a",
+   "-e", "dtraceall_load=\"YES\"",
+   "-e", "dtrace_dof_load=\"YES\"",
+   "-e", "dtrace_dof_name=\"/boot/dtrace.dof\"",
+   "-e", "dtrace_dof_type=\"dtrace_dof\"",
+   NULL,
+   };
+   pid_t child;
+   int err, status;
+
+   err = posix_spawnp(, "nextboot", NULL, NULL, nbargv,
+   NULL);
+   if (err != 0) {
+   error("failed to execute nextboot: %s", strerror(err));
+   exit(E_ERROR);
+   }
+
+   if (waitpid(child, , 0) != child)
+   fatal("waiting for nextboot");
+   if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+   error("nextboot returned with status %d", status);
+   exit(E_ERROR);
+   }
+}
+#else
 static void
 etcsystem_prune(void)
 {
@@ -508,7 +545,7 @@ etcsystem_add(void)
 
error("added forceload directives to %s\n", g_ofile);
 }
-#endif /* illumos */
+#endif /* !__FreeBSD__ */
 
 static void
 print_probe_info(const dtrace_probeinfo_t *p)
@@ -643,24 +680,24 @@ anon_prog(const dtrace_cmd_t *dcp, dof_h
p = (uchar_t *)dof;
q = p + dof->dofh_loadsz;
 
-#ifdef illumos
-   oprintf("dof-data-%d=0x%x", n, *p++);
-
-   while (p < q)
-   oprintf(",0x%x", *p++);
-
-   oprintf(";\n");
-#else
+#ifdef __FreeBSD__
/*
-* On FreeBSD, the DOF data is handled as a kernel environment (kenv)
-* string. We use two hex characters per DOF byte.
+* On FreeBSD, the DOF file is read directly during boot - just write
+* two hex characters per byte.
 */
-   oprintf("dof-data-%d=%02x", n, *p++);
+   oprintf("dof-data-%d=", n);
 
while (p < q)
oprintf("%02x", *p++);
 
oprintf("\n");
+#else
+   oprintf("dof-data-%d=0x%x", n, *p++);
+
+   while (p < q)
+   oprintf(",0x%x", *p++);
+
+   oprintf(";\n");
 #endif
 
dtrace_dof_destroy(g_dtp, dof);
@@ -1725,8 +1762,7 @@ main(int argc, char *argv[])
 #else
/*
 * On FreeBSD, anonymous DOF data is written to
-* the DTrace DOF file that the boot loader will
-* read if booting with the DTrace option.
+* the DTrace DOF file.
 */
g_ofile = "/boot/dtrace.dof";
 #endif
@@ -1765,7 +1801,10 @@ main(int argc, char *argv[])
 * that itself contains a #pragma D option quiet.
 */
error("saved anonymous enabling in %s\n", g_ofile);
-#ifdef illumos
+
+#ifdef __FreeBSD__
+   bootdof_add();
+#else
etcsystem_add();
error("run update_drv(1M) or reboot to enable changes\n");
 #endif

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

svn commit: r297772 - head/sbin/reboot

2016-04-09 Thread Mark Johnston
Author: markj
Date: Sun Apr 10 01:25:12 2016
New Revision: 297772
URL: https://svnweb.freebsd.org/changeset/base/297772

Log:
  nextboot(8): add a -a option for appending to a configuration.
  
  By default, a nextboot invocation will clobber any existing nextboot
  configuration.
  
  MFC after:2 weeks
  Relnotes: yes

Modified:
  head/sbin/reboot/nextboot.8
  head/sbin/reboot/nextboot.sh

Modified: head/sbin/reboot/nextboot.8
==
--- head/sbin/reboot/nextboot.8 Sun Apr 10 01:24:27 2016(r297771)
+++ head/sbin/reboot/nextboot.8 Sun Apr 10 01:25:12 2016(r297772)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 17, 2015
+.Dd April 9, 2016
 .Dt NEXTBOOT 8
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 .Nd "specify an alternate kernel and boot flags for the next reboot"
 .Sh SYNOPSIS
 .Nm
+.Op Fl a
 .Op Fl e Ar variable=value
 .Op Fl f
 .Op Fl k Ar kernel
@@ -53,6 +54,12 @@ configuration.
 .Pp
 The options are as follows:
 .Bl -tag -width ".Fl o Ar options"
+.It Fl a
+This option causes
+.Nm
+to append to an existing configuration in
+.Pa /boot/nextboot.conf .
+By default any existing configuration is overwritten.
 .It Fl D
 Invoking
 .Nm

Modified: head/sbin/reboot/nextboot.sh
==
--- head/sbin/reboot/nextboot.shSun Apr 10 01:24:27 2016
(r297771)
+++ head/sbin/reboot/nextboot.shSun Apr 10 01:25:12 2016
(r297772)
@@ -26,6 +26,7 @@
 #
 # $FreeBSD$
 
+append="NO"
 delete="NO"
 kenv=
 force="NO"
@@ -48,12 +49,17 @@ add_kenv()
 }
 
 display_usage() {
-   echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]"
-   echo "   nextboot -D"
+   cat <<-EOF
+   Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]
+  nextboot -D
+   EOF
 }
 
-while getopts "De:fk:o:" argument ; do
+while getopts "aDe:fk:o:" argument ; do
case "${argument}" in
+   a)
+   append="YES"
+   ;;
D)
delete="YES"
;;
@@ -106,7 +112,19 @@ df -Tn "/boot/" 2>/dev/null | while read
EOF
 done
 
-cat > ${nextboot_file} << EOF
+set -e
+
+nextboot_tmp=$(mktemp $(dirname ${nextboot_file})/nextboot.XX)
+
+if [ ${append} = "YES" -a -f ${nextboot_file} ]; then
+   cp -f ${nextboot_file} ${nextboot_tmp}
+fi
+
+cat >> ${nextboot_tmp} << EOF
 nextboot_enable="YES"
 $kenv
 EOF
+
+fsync ${nextboot_tmp}
+
+mv ${nextboot_tmp} ${nextboot_file}
___
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: r297771 - head/sys/cddl/dev/sdt

2016-04-09 Thread Mark Johnston
Author: markj
Date: Sun Apr 10 01:24:27 2016
New Revision: 297771
URL: https://svnweb.freebsd.org/changeset/base/297771

Log:
  Initialize SDT probes during SI_SUB_DTRACE_PROVIDER.
  
  This is consistent with all other DTrace providers and ensures that
  SDT probes are available for boot-time tracing.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/dev/sdt/sdt.c

Modified: head/sys/cddl/dev/sdt/sdt.c
==
--- head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:23:39 2016(r297770)
+++ head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:24:27 2016(r297771)
@@ -384,28 +384,20 @@ sdt_unload()
 static int
 sdt_modevent(module_t mod __unused, int type, void *data __unused)
 {
-   int error = 0;
 
switch (type) {
case MOD_LOAD:
-   sdt_load();
-   break;
-
case MOD_UNLOAD:
-   error = sdt_unload();
-   break;
-
case MOD_SHUTDOWN:
-   break;
-
+   return (0);
default:
-   error = EOPNOTSUPP;
-   break;
+   return (EOPNOTSUPP);
}
-
-   return (error);
 }
 
+SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL);
+SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL);
+
 DEV_MODULE(sdt, sdt_modevent, NULL);
 MODULE_VERSION(sdt, 1);
 MODULE_DEPEND(sdt, dtrace, 1, 1, 1);
___
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: r297770 - in head/sys/cddl/dev/dtrace: amd64 i386

2016-04-09 Thread Mark Johnston
Author: markj
Date: Sun Apr 10 01:23:39 2016
New Revision: 297770
URL: https://svnweb.freebsd.org/changeset/base/297770

Log:
  Initialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64.
  
  This allows the hrtimer to be used earlier during boot. This is required
  for boot-time DTrace: anonymous enablings are created during
  SI_SUB_DTRACE_ANON, which runs before APs are started. In particular,
  the DTrace deadman timer requires that the hrtimer be functional.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSat Apr  9 22:01:32 
2016(r297769)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSun Apr 10 01:23:39 
2016(r297770)
@@ -246,24 +246,14 @@ static uint64_t   nsec_scale;
 /* See below for the explanation of this macro. */
 #define SCALE_SHIFT28
 
+/*
+ * Get the frequency and scale factor as early as possible so that they can be
+ * used for boot-time tracing.
+ */
 static void
-dtrace_gethrtime_init_cpu(void *arg)
-{
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu)
-   tgt_cpu_tsc = rdtsc();
-   else
-   hst_cpu_tsc = rdtsc();
-}
-
-static void
-dtrace_gethrtime_init(void *arg)
+dtrace_gethrtime_init_early(void *arg)
 {
-   struct pcpu *pc;
uint64_t tsc_f;
-   cpuset_t map;
-   int i;
 
/*
 * Get TSC frequency known at this moment.
@@ -279,7 +269,8 @@ dtrace_gethrtime_init(void *arg)
 * another 32-bit integer without overflowing 64-bit.
 * Thus minimum supported TSC frequency is 62.5MHz.
 */
-   KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too 
low"));
+   KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)),
+   ("TSC frequency is too low"));
 
/*
 * We scale up NANOSEC/tsc_f ratio to preserve as much precision
@@ -291,6 +282,27 @@ dtrace_gethrtime_init(void *arg)
 *   (terahertz) values;
 */
nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
+}
+SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY,
+dtrace_gethrtime_init_early, NULL);
+
+static void
+dtrace_gethrtime_init_cpu(void *arg)
+{
+   uintptr_t cpu = (uintptr_t) arg;
+
+   if (cpu == curcpu)
+   tgt_cpu_tsc = rdtsc();
+   else
+   hst_cpu_tsc = rdtsc();
+}
+
+static void
+dtrace_gethrtime_init(void *arg)
+{
+   struct pcpu *pc;
+   cpuset_t map;
+   int i;
 
/* The current CPU is the reference one. */
sched_pin();
@@ -311,8 +323,8 @@ dtrace_gethrtime_init(void *arg)
}
sched_unpin();
 }
-
-SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, 
dtrace_gethrtime_init, NULL);
+SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init,
+NULL);
 
 /*
  * DTrace needs a high resolution time function which can

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat Apr  9 22:01:32 2016
(r297769)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 10 01:23:39 2016
(r297770)
@@ -248,24 +248,14 @@ static uint64_t   nsec_scale;
 /* See below for the explanation of this macro. */
 #define SCALE_SHIFT28
 
+/*
+ * Get the frequency and scale factor as early as possible so that they can be
+ * used for boot-time tracing.
+ */
 static void
-dtrace_gethrtime_init_cpu(void *arg)
-{
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu)
-   tgt_cpu_tsc = rdtsc();
-   else
-   hst_cpu_tsc = rdtsc();
-}
-
-static void
-dtrace_gethrtime_init(void *arg)
+dtrace_gethrtime_init_early(void *arg)
 {
-   cpuset_t map;
-   struct pcpu *pc;
uint64_t tsc_f;
-   int i;
 
/*
 * Get TSC frequency known at this moment.
@@ -281,7 +271,8 @@ dtrace_gethrtime_init(void *arg)
 * another 32-bit integer without overflowing 64-bit.
 * Thus minimum supported TSC frequency is 62.5MHz.
 */
-   KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too 
low"));
+   KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)),
+   ("TSC frequency is too low"));
 
/*
 * We scale up NANOSEC/tsc_f ratio to preserve as much precision
@@ -293,6 +284,27 @@ dtrace_gethrtime_init(void *arg)
 *   (terahertz) values;
 */
nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
+}
+SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY,
+dtrace_gethrtime_init_early, NULL);
+
+static void
+dtrace_gethrtime_init_cpu(void *arg)
+{
+   uintptr_t cpu = (uintptr_t) 

svn commit: r297769 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
Author: adrian
Date: Sat Apr  9 22:01:32 2016
New Revision: 297769
URL: https://svnweb.freebsd.org/changeset/base/297769

Log:
  [net80211] log the node pointer when calling ht node init/cleanup
  
  This makes it easier to track which node is having what done do it
  during normal use.
  
  This is likely the eighth time I've done this since I started doing
  net80211 development, so I think it's about time I just committed it.

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cSat Apr  9 21:57:34 2016
(r297768)
+++ head/sys/net80211/ieee80211_ht.cSat Apr  9 22:01:32 2016
(r297769)
@@ -1063,8 +1063,9 @@ ieee80211_ht_node_init(struct ieee80211_
 
IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N,
ni,
-   "%s: called",
-   __func__);
+   "%s: called (%p)",
+   __func__,
+   ni);
 
if (ni->ni_flags & IEEE80211_NODE_HT) {
/*
@@ -1074,8 +1075,8 @@ ieee80211_ht_node_init(struct ieee80211_
 */
IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N,
ni,
-   "%s: calling cleanup",
-   __func__);
+   "%s: calling cleanup (%p)",
+   __func__, ni);
ieee80211_ht_node_cleanup(ni);
}
for (tid = 0; tid < WME_NUM_TID; tid++) {
@@ -1100,8 +1101,8 @@ ieee80211_ht_node_cleanup(struct ieee802
 
IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N,
ni,
-   "%s: called",
-   __func__);
+   "%s: called (%p)",
+   __func__, ni);
 
KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node"));
 
___
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: r297768 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
Author: adrian
Date: Sat Apr  9 21:57:34 2016
New Revision: 297768
URL: https://svnweb.freebsd.org/changeset/base/297768

Log:
  [net80211] add back in the ff/superg node init call that I accidentally
  deleted.
  
  It's mostly a no-op right now, so it shouldn't have changed behaviour.

Modified:
  head/sys/net80211/ieee80211_sta.c

Modified: head/sys/net80211/ieee80211_sta.c
==
--- head/sys/net80211/ieee80211_sta.c   Sat Apr  9 21:55:58 2016
(r297767)
+++ head/sys/net80211/ieee80211_sta.c   Sat Apr  9 21:57:34 2016
(r297768)
@@ -1706,6 +1706,14 @@ sta_recv_mgmt(struct ieee80211_node *ni,
}
 
/*
+* Always initialise FF/superg state; we can use this
+* for doing A-MSDU encapsulation as well.
+*/
+#ifdef IEEE80211_SUPPORT_SUPERG
+   ieee80211_ff_node_init(ni);
+#endif
+
+   /*
 * Configure state now that we are associated.
 *
 * XXX may need different/additional driver callbacks?
___
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: r297767 - stable/10/bin/test

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 21:55:58 2016
New Revision: 297767
URL: https://svnweb.freebsd.org/changeset/base/297767

Log:
  MFC r259017: test: Avoid looking up again the type of a known binary
  operator.

Modified:
  stable/10/bin/test/test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/test/test.c
==
--- stable/10/bin/test/test.c   Sat Apr  9 21:49:57 2016(r297766)
+++ stable/10/bin/test/test.c   Sat Apr  9 21:55:58 2016(r297767)
@@ -172,7 +172,7 @@ static char **t_wp;
 static int parenlevel;
 
 static int aexpr(enum token);
-static int binop(void);
+static int binop(enum token);
 static int equalf(const char *, const char *);
 static int filstat(char *, enum token);
 static int getn(const char *);
@@ -312,21 +312,20 @@ primary(enum token n)
}
}
 
-   if (TOKEN_TYPE(t_lex(nargc > 0 ? t_wp[1] : NULL)) == BINOP)
-   return binop();
+   nn = t_lex(nargc > 0 ? t_wp[1] : NULL);
+   if (TOKEN_TYPE(nn) == BINOP)
+   return binop(nn);
 
return strlen(*t_wp) > 0;
 }
 
 static int
-binop(void)
+binop(enum token n)
 {
const char *opnd1, *op, *opnd2;
-   enum token n;
 
opnd1 = *t_wp;
-   op = nargc > 0 ? t_wp[1] : NULL;
-   n = t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL);
+   op = nargc > 0 ? (--nargc, *++t_wp) : NULL;
 
if ((opnd2 = nargc > 0 ? (--nargc, *++t_wp) : NULL) == NULL)
syntax(op, "argument expected");
___
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: r297766 - stable/10/bin/test

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 21:49:57 2016
New Revision: 297766
URL: https://svnweb.freebsd.org/changeset/base/297766

Log:
  MFC r258799: test: Simplify the code by unifying op_num and op_type.
  
  The global variable t_wp_op is no longer needed.

Modified:
  stable/10/bin/test/test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/test/test.c
==
--- stable/10/bin/test/test.c   Sat Apr  9 21:04:51 2016(r297765)
+++ stable/10/bin/test/test.c   Sat Apr  9 21:49:57 2016(r297766)
@@ -67,9 +67,18 @@ error(const char *msg, ...)
operand ::= 
 */
 
+enum token_types {
+   UNOP = 0x100,
+   BINOP = 0x200,
+   BUNOP = 0x300,
+   BBINOP = 0x400,
+   PAREN = 0x500
+};
+
 enum token {
EOI,
-   FILRD,
+   OPERAND,
+   FILRD = UNOP + 1,
FILWR,
FILEX,
FILEXIST,
@@ -85,13 +94,13 @@ enum token {
FILSUID,
FILSGID,
FILSTCK,
-   FILNT,
-   FILOT,
-   FILEQ,
-   FILUID,
-   FILGID,
STREZ,
STRNZ,
+   FILUID,
+   FILGID,
+   FILNT = BINOP + 1,
+   FILOT,
+   FILEQ,
STREQ,
STRNE,
STRLT,
@@ -102,70 +111,62 @@ enum token {
INTGT,
INTLE,
INTLT,
-   UNOT,
-   BAND,
+   UNOT = BUNOP + 1,
+   BAND = BBINOP + 1,
BOR,
-   LPAREN,
-   RPAREN,
-   OPERAND
+   LPAREN = PAREN + 1,
+   RPAREN
 };
 
-enum token_types {
-   UNOP,
-   BINOP,
-   BUNOP,
-   BBINOP,
-   PAREN
-};
+#define TOKEN_TYPE(token) ((token) & 0xff00)
 
 static struct t_op {
char op_text[4];
-   short op_num, op_type;
+   short op_num;
 } const ops [] = {
-   {"-r",  FILRD,  UNOP},
-   {"-w",  FILWR,  UNOP},
-   {"-x",  FILEX,  UNOP},
-   {"-e",  FILEXIST,UNOP},
-   {"-f",  FILREG, UNOP},
-   {"-d",  FILDIR, UNOP},
-   {"-c",  FILCDEV,UNOP},
-   {"-b",  FILBDEV,UNOP},
-   {"-p",  FILFIFO,UNOP},
-   {"-u",  FILSUID,UNOP},
-   {"-g",  FILSGID,UNOP},
-   {"-k",  FILSTCK,UNOP},
-   {"-s",  FILGZ,  UNOP},
-   {"-t",  FILTT,  UNOP},
-   {"-z",  STREZ,  UNOP},
-   {"-n",  STRNZ,  UNOP},
-   {"-h",  FILSYM, UNOP},  /* for backwards compat */
-   {"-O",  FILUID, UNOP},
-   {"-G",  FILGID, UNOP},
-   {"-L",  FILSYM, UNOP},
-   {"-S",  FILSOCK,UNOP},
-   {"=",   STREQ,  BINOP},
-   {"==",  STREQ,  BINOP},
-   {"!=",  STRNE,  BINOP},
-   {"<",   STRLT,  BINOP},
-   {">",   STRGT,  BINOP},
-   {"-eq", INTEQ,  BINOP},
-   {"-ne", INTNE,  BINOP},
-   {"-ge", INTGE,  BINOP},
-   {"-gt", INTGT,  BINOP},
-   {"-le", INTLE,  BINOP},
-   {"-lt", INTLT,  BINOP},
-   {"-nt", FILNT,  BINOP},
-   {"-ot", FILOT,  BINOP},
-   {"-ef", FILEQ,  BINOP},
-   {"!",   UNOT,   BUNOP},
-   {"-a",  BAND,   BBINOP},
-   {"-o",  BOR,BBINOP},
-   {"(",   LPAREN, PAREN},
-   {")",   RPAREN, PAREN},
-   {"",0,  0}
+   {"-r",  FILRD},
+   {"-w",  FILWR},
+   {"-x",  FILEX},
+   {"-e",  FILEXIST},
+   {"-f",  FILREG},
+   {"-d",  FILDIR},
+   {"-c",  FILCDEV},
+   {"-b",  FILBDEV},
+   {"-p",  FILFIFO},
+   {"-u",  FILSUID},
+   {"-g",  FILSGID},
+   {"-k",  FILSTCK},
+   {"-s",  FILGZ},
+   {"-t",  FILTT},
+   {"-z",  STREZ},
+   {"-n",  STRNZ},
+   {"-h",  FILSYM},/* for backwards compat */
+   {"-O",  FILUID},
+   {"-G",  FILGID},
+   {"-L",  FILSYM},
+   {"-S",  FILSOCK},
+   {"=",   STREQ},
+   {"==",  STREQ},
+   {"!=",  STRNE},
+   {"<",   STRLT},
+   {">",   STRGT},
+   {"-eq", INTEQ},
+   {"-ne", INTNE},
+   {"-ge", INTGE},
+   {"-gt", INTGT},
+   {"-le", INTLE},
+   {"-lt", INTLT},
+   {"-nt", FILNT},
+   {"-ot", FILOT},
+   {"-ef", FILEQ},
+   {"!",   UNOT},
+   {"-a",  BAND},
+   {"-o",  BOR},
+   {"(",   LPAREN},
+   {")",   RPAREN},
+   {"",0}
 };
 
-static struct t_op const *t_wp_op;
 static int nargc;
 static char **t_wp;
 static int parenlevel;
@@ -295,10 +296,10 @@ primary(enum token n)
parenlevel--;
return res;
}
-   if (t_wp_op && t_wp_op->op_type == UNOP) {
+   if (TOKEN_TYPE(n) == UNOP) {
/* unary expression */
if (--nargc == 0)
-   syntax(t_wp_op->op_text, "argument expected");
+   syntax(NULL, "argument expected"); /* impossible */
switch (n) {
case STREZ:
return strlen(*++t_wp) == 0;
@@ -311,10 +312,8 @@ primary(enum token n)
}
}
 
-   if (t_lex(nargc > 0 ? t_wp[1] : NULL), t_wp_op && t_wp_op->op_type ==
-   BINOP) {
+  

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

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 21:04:51 2016
New Revision: 297765
URL: https://svnweb.freebsd.org/changeset/base/297765

Log:
  MFC r281086: utimensat: Correct Capsicum required capability rights.

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

Modified: stable/10/sys/kern/vfs_syscalls.c
==
--- stable/10/sys/kern/vfs_syscalls.c   Sat Apr  9 20:36:07 2016
(r297764)
+++ stable/10/sys/kern/vfs_syscalls.c   Sat Apr  9 21:04:51 2016
(r297765)
@@ -3405,6 +3405,7 @@ kern_utimensat(struct thread *td, int fd
 {
struct nameidata nd;
struct timespec ts[2];
+   cap_rights_t rights;
int error, flags;
 
if (flag & ~AT_SYMLINK_NOFOLLOW)
@@ -3412,8 +3413,9 @@ kern_utimensat(struct thread *td, int fd
 
if ((error = getutimens(tptr, tptrseg, ts, )) != 0)
return (error);
-   NDINIT_AT(, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW :
-   FOLLOW) | AUDITVNODE1, pathseg, path, fd, td);
+   NDINIT_ATRIGHTS(, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW :
+   FOLLOW) | AUDITVNODE1, pathseg, path, fd,
+   cap_rights_init(, CAP_FUTIMES), td);
if ((error = namei()) != 0)
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: r297742 - head/sys/netinet

2016-04-09 Thread John Baldwin
On Saturday, April 09, 2016 06:31:24 PM Bjoern A. Zeeb wrote:
> On Sat, 9 Apr 2016, John Baldwin wrote:
> > trash user data.  In the rest of the tree, we tend to prefer marking items
> > as NOFREE instead of this approach putting a priority on stability and
> > reliability over memory efficiency.
> >
> > For all of the zones that you removed NOFREE from, do you know why that was
> > added in the first place (e.g. which stale pointers to pcbs could be
> > referenced after free)?  Did you verify that those conditions have been
> > fixed?
> 
> I did check.  I did check a few years ago (and I think you had
> reviewed that; maybe it was trouble).  And the TCP bits here were
> the last ones that were problematic back then.  With the changes from
> r281599 this should no longer be a problem.
> 
> As for the others, a few years ago Andre already removed the NOFREE
> and we unconditionally made him back the change out, which was a
> mistake as otherwise some of these zones would have been "clean" for
> years.  Others have had KASSERTs ensuring that on VNET stack they were
> actually empty.

Ok.  I believe one of the old ones fixed long ago were the pcb sysctls.
I couldn't recall any other cases that required NOFREE.  The network stack
is often fairly loose with references especially those that add per-packet
overhead (at least historically, the ifnet reference in m_pkthdr is one of
the "big" remaining issues IIRC), so I sort of assume it still needs NOFREE
as a general rule.

-- 
John Baldwin
___
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: r297764 - in head: lib/libusb lib/libusbhid sys/dev/usb sys/dev/usb/net

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 20:36:07 2016
New Revision: 297764
URL: https://svnweb.freebsd.org/changeset/base/297764

Log:
  USB: replace 0 with NULL for pointers.
  
  Found with devel/coccinelle.
  
  Reviewed by:  hselasky

Modified:
  head/lib/libusb/libusb20.c
  head/lib/libusbhid/descr.c
  head/lib/libusbhid/usage.c
  head/sys/dev/usb/net/if_urndis.c
  head/sys/dev/usb/usb_transfer.c

Modified: head/lib/libusb/libusb20.c
==
--- head/lib/libusb/libusb20.c  Sat Apr  9 20:30:50 2016(r297763)
+++ head/lib/libusb/libusb20.c  Sat Apr  9 20:36:07 2016(r297764)
@@ -139,8 +139,8 @@ libusb20_tr_close(struct libusb20_transf
free(xfer->ppBuffer);
}
/* reset variable fields in case the transfer is opened again */
-   xfer->priv_sc0 = 0;
-   xfer->priv_sc1 = 0;
+   xfer->priv_sc0 = NULL;
+   xfer->priv_sc1 = NULL;
xfer->is_opened = 0;
xfer->is_pending = 0;
xfer->is_cancel = 0;

Modified: head/lib/libusbhid/descr.c
==
--- head/lib/libusbhid/descr.c  Sat Apr  9 20:30:50 2016(r297763)
+++ head/lib/libusbhid/descr.c  Sat Apr  9 20:36:07 2016(r297764)
@@ -159,7 +159,7 @@ hid_use_report_desc(unsigned char *data,
report_desc_t r;
 
r = malloc(sizeof(*r) + size);
-   if (r == 0) {
+   if (r == NULL) {
errno = ENOMEM;
return (NULL);
}

Modified: head/lib/libusbhid/usage.c
==
--- head/lib/libusbhid/usage.c  Sat Apr  9 20:30:50 2016(r297763)
+++ head/lib/libusbhid/usage.c  Sat Apr  9 20:36:07 2016(r297764)
@@ -77,9 +77,9 @@ hid_init(const char *hidname)
char line[100], name[100], *p, *n;
int no;
int lineno;
-   struct usage_page *curpage = 0;
+   struct usage_page *curpage = NULL;
 
-   if (hidname == 0)
+   if (hidname == NULL)
hidname = _PATH_HIDTABLE;
 
f = fopen(hidname, "r");
@@ -124,7 +124,7 @@ hid_init(const char *hidname)
curpage->pagesize++;
} else {
if (npages >= npagesmax) {
-   if (pages == 0) {
+   if (pages == NULL) {
npagesmax = 5;
pages = malloc(npagesmax *
  sizeof (struct usage_page));

Modified: head/sys/dev/usb/net/if_urndis.c
==
--- head/sys/dev/usb/net/if_urndis.cSat Apr  9 20:30:50 2016
(r297763)
+++ head/sys/dev/usb/net/if_urndis.cSat Apr  9 20:36:07 2016
(r297764)
@@ -235,7 +235,7 @@ urndis_attach(device_t dev)
 
cmd = usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex,
UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_CM, 0xFF);
-   if (cmd != 0) {
+   if (cmd != NULL) {
DPRINTF("Call Mode Descriptor found, dataif=%d\n", 
cmd->bDataInterface);
iface_index[0] = cmd->bDataInterface;
}

Modified: head/sys/dev/usb/usb_transfer.c
==
--- head/sys/dev/usb/usb_transfer.c Sat Apr  9 20:30:50 2016
(r297763)
+++ head/sys/dev/usb/usb_transfer.c Sat Apr  9 20:36:07 2016
(r297764)
@@ -925,7 +925,7 @@ usbd_transfer_setup(struct usb_device *u
DPRINTFN(6, "setup array has zero length!\n");
return (USB_ERR_INVAL);
}
-   if (ifaces == 0) {
+   if (ifaces == NULL) {
DPRINTFN(6, "ifaces array is NULL!\n");
return (USB_ERR_INVAL);
}
___
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: r297763 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/sys/fs

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 20:30:50 2016
New Revision: 297763
URL: https://svnweb.freebsd.org/changeset/base/297763

Log:
  MFV r297760: 6418 zpool should have a label clearing command
  
  Reviewed by: Yuri Pankov 
  Reviewed by: Matthew Ahrens 
  Reviewed by: George Wilson 
  Author: Will Andrews 
  
  Closes #83
  Closes #32
  
  openzfs/openzfs@9663688425131744221ea99f9e66b9ed964492ae
  
  FreeBSD already had `zpool labelclear` functionality, so this is mostly
  just a diff reduction.
  
  MFC after:1 month

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Apr  9 20:18:34 2016
(r297762)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Apr  9 20:30:50 2016
(r297763)
@@ -2156,10 +2156,11 @@ dump_label(const char *dev)
uint64_t psize, ashift;
int len = strlen(dev) + 1;
 
-   if (strncmp(dev, "/dev/dsk/", 9) == 0) {
+   if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) {
len++;
path = malloc(len);
-   (void) snprintf(path, len, "%s%s", "/dev/rdsk/", dev + 9);
+   (void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD,
+   dev + strlen(ZFS_DISK_ROOTD));
} else {
path = strdup(dev);
}

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSat Apr  9 
20:18:34 2016(r297762)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cSat Apr  9 
20:30:50 2016(r297763)
@@ -21,12 +21,12 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
  * Copyright (c) 2012 Martin Matuska . All rights reserved.
  * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
  * Copyright 2016 Igor Kozhukhov .
+ * Copyright 2016 Nexenta Systems, Inc.
  */
 
 #include 
@@ -626,7 +626,10 @@ zpool_do_remove(int argc, char **argv)
 }
 
 /*
- * zpool labelclear 
+ * zpool labelclear [-f] 
+ *
+ * -f  Force clearing the label for the vdevs which are members of
+ * the exported or foreign pools.
  *
  * Verifies that the vdev is not active and zeros out the label information
  * on the device.
@@ -634,8 +637,11 @@ zpool_do_remove(int argc, char **argv)
 int
 zpool_do_labelclear(int argc, char **argv)
 {
-   char *vdev, *name;
-   int c, fd = -1, ret = 0;
+   char vdev[MAXPATHLEN];
+   char *name = NULL;
+   struct stat st;
+   int c, fd, ret = 0;
+   nvlist_t *config;
pool_state_t state;
boolean_t inuse = B_FALSE;
boolean_t force = B_FALSE;
@@ -658,88 +664,110 @@ zpool_do_labelclear(int argc, char **arg
 
/* get vdev name */
if (argc < 1) {
-   (void) fprintf(stderr, gettext("missing vdev device name\n"));
+   (void) fprintf(stderr, gettext("missing vdev name\n"));
usage(B_FALSE);
}
+   if (argc > 1) {
+   (void) fprintf(stderr, gettext("too many arguments\n"));
+   usage(B_FALSE);
+   }
+
+   /*
+* Check if we were given absolute path and use it as is.
+* Otherwise if the provided vdev name doesn't point to a file,
+* try prepending dsk path and appending s0.
+*/
+   (void) strlcpy(vdev, argv[0], sizeof (vdev));
+   if (vdev[0] != '/' && stat(vdev, ) != 0) {
+   char *s;
+
+   (void) snprintf(vdev, sizeof (vdev), "%s/%s",
+#ifdef illumos
+   ZFS_DISK_ROOT, argv[0]);
+   if ((s = strrchr(argv[0], 's')) == NULL ||
+   !isdigit(*(s + 1)))
+   (void) strlcat(vdev, "s0", sizeof (vdev));
+#else
+   "/dev", argv[0]);
+#endif
+   if (stat(vdev, ) != 0) {
+   (void) fprintf(stderr, gettext(
+   "failed to find device %s, 

svn commit: r297762 - head/sys/dev/ichiic

2016-04-09 Thread John Baldwin
Author: jhb
Date: Sat Apr  9 20:18:34 2016
New Revision: 297762
URL: https://svnweb.freebsd.org/changeset/base/297762

Log:
  Use DELAY() instead of sleeping during boot-time attach.
  
  Tested by:Wolfgang Zenker 

Modified:
  head/sys/dev/ichiic/ig4_iic.c

Modified: head/sys/dev/ichiic/ig4_iic.c
==
--- head/sys/dev/ichiic/ig4_iic.c   Sat Apr  9 20:05:39 2016
(r297761)
+++ head/sys/dev/ichiic/ig4_iic.c   Sat Apr  9 20:18:34 2016
(r297762)
@@ -117,7 +117,10 @@ set_controller(ig4iic_softc_t *sc, uint3
error = 0;
break;
}
-   mtx_sleep(sc, >io_lock, 0, "i2cslv", 1);
+   if (cold)
+   DELAY(1000);
+   else
+   mtx_sleep(sc, >io_lock, 0, "i2cslv", 1);
}
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: r297761 - head/bin/sh

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 20:05:39 2016
New Revision: 297761
URL: https://svnweb.freebsd.org/changeset/base/297761

Log:
  sh(1): replace 0 with NULL for pointers.
  
  Found with devel/coccinelle.
  
  Reviewed by:  jilles

Modified:
  head/bin/sh/miscbltin.c
  head/bin/sh/parser.c

Modified: head/bin/sh/miscbltin.c
==
--- head/bin/sh/miscbltin.c Sat Apr  9 19:49:40 2016(r297760)
+++ head/bin/sh/miscbltin.c Sat Apr  9 20:05:39 2016(r297761)
@@ -341,7 +341,7 @@ umaskcmd(int argc __unused, char **argv 
} else {
void *set;
INTOFF;
-   if ((set = setmode (ap)) == 0)
+   if ((set = setmode (ap)) == NULL)
error("Illegal number: %s", ap);
 
mask = getmode (set, ~mask & 0777);

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cSat Apr  9 19:49:40 2016(r297760)
+++ head/bin/sh/parser.cSat Apr  9 20:05:39 2016(r297761)
@@ -628,7 +628,7 @@ simplecmd(union node **rpp, union node *
 
/* If we don't have any redirections already, then we must reset */
/* rpp to be the address of the local redir variable.  */
-   if (redir == 0)
+   if (redir == NULL)
rpp = 
 
args = NULL;
___
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: r297760 - vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/libzfs/common

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 19:49:40 2016
New Revision: 297760
URL: https://svnweb.freebsd.org/changeset/base/297760

Log:
  6418 zpool should have a label clearing command
  
  Reviewed by: Yuri Pankov 
  Reviewed by: Matthew Ahrens 
  Reviewed by: George Wilson 
  Author: Will Andrews 
  
  Closes #83
  Closes #32

Modified:
  vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/cmd/zpool/zpool_vdev.c
  vendor/illumos/dist/lib/libzfs/common/libzfs.h
  vendor/illumos/dist/lib/libzfs/common/libzfs_import.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c

Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h
==
--- vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Sat Apr  9 19:29:39 
2016(r297759)
+++ vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Sat Apr  9 19:49:40 
2016(r297760)
@@ -767,6 +767,10 @@ typedef struct ddt_histogram {
 #defineZVOL_DRIVER "zvol"
 #defineZFS_DRIVER  "zfs"
 #defineZFS_DEV "/dev/zfs"
+#defineZFS_DISK_ROOT   "/dev/dsk"
+#defineZFS_DISK_ROOTD  ZFS_DISK_ROOT "/"
+#defineZFS_RDISK_ROOT  "/dev/rdsk"
+#defineZFS_RDISK_ROOTD ZFS_RDISK_ROOT "/"
 
 /* general zvol path */
 #defineZVOL_DIR"/dev/zvol"
___
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: r297760 - vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/libzfs/common

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 19:49:40 2016
New Revision: 297760
URL: https://svnweb.freebsd.org/changeset/base/297760

Log:
  6418 zpool should have a label clearing command
  
  Reviewed by: Yuri Pankov 
  Reviewed by: Matthew Ahrens 
  Reviewed by: George Wilson 
  Author: Will Andrews 
  
  Closes #83
  Closes #32

Modified:
  vendor/illumos/dist/cmd/zdb/zdb.c
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/cmd/zpool/zpool_vdev.c
  vendor/illumos/dist/lib/libzfs/common/libzfs.h
  vendor/illumos/dist/lib/libzfs/common/libzfs_import.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h

Modified: vendor/illumos/dist/cmd/zdb/zdb.c
==
--- vendor/illumos/dist/cmd/zdb/zdb.c   Sat Apr  9 19:29:39 2016
(r297759)
+++ vendor/illumos/dist/cmd/zdb/zdb.c   Sat Apr  9 19:49:40 2016
(r297760)
@@ -2131,10 +2131,11 @@ dump_label(const char *dev)
uint64_t psize, ashift;
int len = strlen(dev) + 1;
 
-   if (strncmp(dev, "/dev/dsk/", 9) == 0) {
+   if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) {
len++;
path = malloc(len);
-   (void) snprintf(path, len, "%s%s", "/dev/rdsk/", dev + 9);
+   (void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD,
+   dev + strlen(ZFS_DISK_ROOTD));
} else {
path = strdup(dev);
}

Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c
==
--- vendor/illumos/dist/cmd/zpool/zpool_main.c  Sat Apr  9 19:29:39 2016
(r297759)
+++ vendor/illumos/dist/cmd/zpool/zpool_main.c  Sat Apr  9 19:49:40 2016
(r297760)
@@ -21,11 +21,11 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
  * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
  * Copyright 2016 Igor Kozhukhov .
+ * Copyright 2016 Nexenta Systems, Inc.
  */
 
 #include 
@@ -62,6 +62,7 @@ static int zpool_do_destroy(int, char **
 
 static int zpool_do_add(int, char **);
 static int zpool_do_remove(int, char **);
+static int zpool_do_labelclear(int, char **);
 
 static int zpool_do_list(int, char **);
 static int zpool_do_iostat(int, char **);
@@ -121,6 +122,7 @@ typedef enum {
HELP_HISTORY,
HELP_IMPORT,
HELP_IOSTAT,
+   HELP_LABELCLEAR,
HELP_LIST,
HELP_OFFLINE,
HELP_ONLINE,
@@ -159,6 +161,8 @@ static zpool_command_t command_table[] =
{ "add",zpool_do_add,   HELP_ADD},
{ "remove", zpool_do_remove,HELP_REMOVE },
{ NULL },
+   { "labelclear", zpool_do_labelclear,HELP_LABELCLEAR },
+   { NULL },
{ "list",   zpool_do_list,  HELP_LIST   },
{ "iostat", zpool_do_iostat,HELP_IOSTAT },
{ "status", zpool_do_status,HELP_STATUS },
@@ -228,6 +232,8 @@ get_usage(zpool_help_t idx)
case HELP_IOSTAT:
return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
"[count]]\n"));
+   case HELP_LABELCLEAR:
+   return (gettext("\tlabelclear [-f] \n"));
case HELP_LIST:
return (gettext("\tlist [-Hp] [-o property[,...]] "
"[-T d|u] [pool] ... [interval [count]]\n"));
@@ -618,6 +624,149 @@ zpool_do_remove(int argc, char **argv)
 }
 
 /*
+ * zpool labelclear [-f] 
+ *
+ * -f  Force clearing the label for the vdevs which are members of
+ * the exported or foreign pools.
+ *
+ * Verifies that the vdev is not active and zeros out the label information
+ * on the device.
+ */
+int
+zpool_do_labelclear(int argc, char **argv)
+{
+   char vdev[MAXPATHLEN];
+   char *name = NULL;
+   struct stat st;
+   int c, fd, ret = 0;
+   nvlist_t *config;
+   pool_state_t state;
+   boolean_t inuse = B_FALSE;
+   boolean_t force = B_FALSE;
+
+   /* check options */
+   while ((c = getopt(argc, argv, "f")) != -1) {
+   switch (c) {
+   case 'f':
+   force = B_TRUE;
+   break;
+   default:
+   (void) fprintf(stderr, gettext("invalid option '%c'\n"),
+   optopt);
+   usage(B_FALSE);
+   }
+   }
+
+   argc -= optind;
+   argv += optind;
+
+  

svn commit: r297759 - stable/10/lib/libc/sys

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 19:29:39 2016
New Revision: 297759
URL: https://svnweb.freebsd.org/changeset/base/297759

Log:
  MFC r287753: setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD).

Modified:
  stable/10/lib/libc/sys/setuid.2
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/sys/setuid.2
==
--- stable/10/lib/libc/sys/setuid.2 Sat Apr  9 19:09:06 2016
(r297758)
+++ stable/10/lib/libc/sys/setuid.2 Sat Apr  9 19:29:39 2016
(r297759)
@@ -28,7 +28,7 @@
 .\" @(#)setuid.2   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd September 13, 2015
 .Dt SETUID 2
 .Os
 .Sh NAME
@@ -178,15 +178,10 @@ pseudocode(void)
int fd;
/* ... */
 
-   fd = open("/path/to/sensitive/data", O_RDWR);
+   fd = open("/path/to/sensitive/data", O_RDWR | O_CLOEXEC);
if (fd == -1)
err(1, "open");
 
-   /*
-* Set close-on-exec flag; see fcntl(2) for more information.
-*/
-   if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
-   err(1, "fcntl(F_SETFD)");
/* ... */
execve(path, argv, environ);
 }
___
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: r297758 - head/sys/boot/arm/uboot

2016-04-09 Thread Ian Lepore
Author: ian
Date: Sat Apr  9 19:09:06 2016
New Revision: 297758
URL: https://svnweb.freebsd.org/changeset/base/297758

Log:
  Align the start of the text segment to an 8-byte boundary.  This fixes
  alignment aborts in ubldr.bin for RPi that started happening with clang 3.8
  (earlier clang apparently didn't generate strd instructions that trigger
  the alignment fault).  The abort happened in ubldr.bin and not ubldr (elf
  version) because the elf headers are 0xf4 bytes long, and stripping them
  off left everything 4-byte aligned.
  
  While here, also stop aligning the data segment to a page boundary, align
  it to 8 bytes instead (aligning to a page just needlessly makes the file
  bigger); pointed out by andrew@.

Modified:
  head/sys/boot/arm/uboot/ldscript.arm

Modified: head/sys/boot/arm/uboot/ldscript.arm
==
--- head/sys/boot/arm/uboot/ldscript.armSat Apr  9 18:52:09 2016
(r297757)
+++ head/sys/boot/arm/uboot/ldscript.armSat Apr  9 19:09:06 2016
(r297758)
@@ -6,6 +6,7 @@ SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   . = UBLDR_LOADADDR + SIZEOF_HEADERS;
+  . = ALIGN(8);
   .text  :
   {
 *(.text)
@@ -47,8 +48,8 @@ SECTIONS
   .rodata1   : { *(.rodata1) }
   .sdata2: { *(.sdata2)  }
   .sbss2 : { *(.sbss2)   }
-  /* Adjust the address for the data segment to the next page up. */
-  . = ((. + 0x1000) & ~(0x1000 - 1));
+  /* Adjust the address for the data segment to the doubleword boundary. */
+  . = ALIGN(8);
   .data:
   {
 *(.data)
___
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: r297757 - head/lib/libedit

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 18:52:09 2016
New Revision: 297757
URL: https://svnweb.freebsd.org/changeset/base/297757

Log:
  libedit: replace 0 with NULL for pointers.
  
  Found with devel/coccinelle.
  
  Reviewed by:  Christos Zoulas

Modified:
  head/lib/libedit/filecomplete.c
  head/lib/libedit/vi.c

Modified: head/lib/libedit/filecomplete.c
==
--- head/lib/libedit/filecomplete.c Sat Apr  9 18:39:57 2016
(r297756)
+++ head/lib/libedit/filecomplete.c Sat Apr  9 18:52:09 2016
(r297757)
@@ -471,7 +471,7 @@ fn_complete(EditLine *el,
 
/* these can be used by function called in completion_matches() */
/* or (*attempted_completion_function)() */
-   if (point != 0)
+   if (point != NULL)
*point = (int)(li->cursor - li->buffer);
if (end != NULL)
*end = (int)(li->lastchar - li->buffer);
@@ -483,7 +483,7 @@ fn_complete(EditLine *el,
>el_scratch),
cur_off - (int)len, cur_off);
} else
-   matches = 0;
+   matches = NULL;
if (!attempted_completion_function || 
(over != NULL && !*over && !matches))
matches = completion_matches(

Modified: head/lib/libedit/vi.c
==
--- head/lib/libedit/vi.c   Sat Apr  9 18:39:57 2016(r297756)
+++ head/lib/libedit/vi.c   Sat Apr  9 18:52:09 2016(r297757)
@@ -1088,7 +1088,7 @@ vi_history_word(EditLine *el, Int c __at
if (wp == NULL)
return CC_ERROR;
 
-   wep = wsp = 0;
+   wep = wsp = NULL;
do {
while (Isspace(*wp))
wp++;
@@ -1101,7 +1101,7 @@ vi_history_word(EditLine *el, Int c __at
} while ((!el->el_state.doingarg || --el->el_state.argument > 0)
&& *wp != 0);
 
-   if (wsp == 0 || (el->el_state.doingarg && el->el_state.argument != 0))
+   if (wsp == NULL || (el->el_state.doingarg && el->el_state.argument != 
0))
return CC_ERROR;
 
cv_undo(el);
___
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: r297756 - head/sys/cam/scsi

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 18:39:57 2016
New Revision: 297756
URL: https://svnweb.freebsd.org/changeset/base/297756

Log:
  Add couple new constants from SPC5r08.

Modified:
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hSat Apr  9 18:09:10 2016
(r297755)
+++ head/sys/cam/scsi/scsi_all.hSat Apr  9 18:39:57 2016
(r297756)
@@ -2291,6 +2291,8 @@ struct scsi_vpd_id_descriptor
 #defineSVPD_ID_TYPE_LUNGRP 0x06
 #defineSVPD_ID_TYPE_MD5_LUN_ID 0x07
 #defineSVPD_ID_TYPE_SCSI_NAME  0x08
+#defineSVPD_ID_TYPE_PROTO  0x09
+#defineSVPD_ID_TYPE_UUID   0x0a
 #defineSVPD_ID_TYPE_MASK   0x0f
u_int8_treserved;
u_int8_tlength;
___
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: r297742 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb

On Sat, 9 Apr 2016, John Baldwin wrote:


On Saturday, April 09, 2016 12:05:24 PM Bjoern A. Zeeb wrote:

Author: bz
Date: Sat Apr  9 12:05:23 2016
New Revision: 297742
URL: https://svnweb.freebsd.org/changeset/base/297742

Log:
  Mfp: r296310,r296343

  It looks like as with the safety belt of DELAY() fastened (*) we can
  completely tear down and free all memory for TCP (after r281599).

  (*) in theory a few ticks should be good enough to make sure the timers
  are all really gone. Could we use a better matric here and check a
  tcbcb count as an optimization?


In theory, no amount of DELAY() is ever enough to close a theoretical race
window.  In practice you might get lucky, but you might also panic and


Yes I do understand.  Thus saying a better metric should do the right
thing.  I am aware of the consequences of removing type stability.
Should there be reports I'll make sure that DELAY becomes something
more proper sooner than later.



trash user data.  In the rest of the tree, we tend to prefer marking items
as NOFREE instead of this approach putting a priority on stability and
reliability over memory efficiency.

For all of the zones that you removed NOFREE from, do you know why that was
added in the first place (e.g. which stale pointers to pcbs could be
referenced after free)?  Did you verify that those conditions have been
fixed?


I did check.  I did check a few years ago (and I think you had
reviewed that; maybe it was trouble).  And the TCP bits here were
the last ones that were problematic back then.  With the changes from
r281599 this should no longer be a problem.

As for the others, a few years ago Andre already removed the NOFREE
and we unconditionally made him back the change out, which was a
mistake as otherwise some of these zones would have been "clean" for
years.  Others have had KASSERTs ensuring that on VNET stack they were
actually empty.


___
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: r297755 - in head/lib/libpam/modules: pam_krb5 pam_login_access

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 18:09:10 2016
New Revision: 297755
URL: https://svnweb.freebsd.org/changeset/base/297755

Log:
  libpam: replace 0 with NULL for pointers.
  
  Found with devel/coccinelle.
  
  Reviewed by:  des

Modified:
  head/lib/libpam/modules/pam_krb5/pam_krb5.c
  head/lib/libpam/modules/pam_login_access/login_access.c

Modified: head/lib/libpam/modules/pam_krb5/pam_krb5.c
==
--- head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Apr  9 18:08:21 2016
(r297754)
+++ head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Apr  9 18:09:10 2016
(r297755)
@@ -860,7 +860,7 @@ verify_krb_v5_tgt(krb5_context context, 
services[0] = "host";
services[1] = pam_service;
services[2] = NULL;
-   keyblock = 0;
+   keyblock = NULL;
retval = -1;
for (service = [0]; *service != NULL; service++) {
retval = krb5_sname_to_principal(context, NULL, *service,

Modified: head/lib/libpam/modules/pam_login_access/login_access.c
==
--- head/lib/libpam/modules/pam_login_access/login_access.c Sat Apr  9 
18:08:21 2016(r297754)
+++ head/lib/libpam/modules/pam_login_access/login_access.c Sat Apr  9 
18:09:10 2016(r297755)
@@ -124,7 +124,7 @@ list_match(char *list, const char *item,
  * the match is affected by any exceptions.
  */
 
-for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) {
+for (tok = strtok(list, sep); tok != NULL; tok = strtok((char *) 0, sep)) {
if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */
break;
if ((match = (*match_fn)(tok, item)) != 0)  /* YES */
@@ -135,7 +135,7 @@ list_match(char *list, const char *item,
 if (match != NO) {
while ((tok = strtok((char *) 0, sep)) && strcasecmp(tok, "EXCEPT"))
 /* VOID */ ;
-   if (tok == 0 || list_match((char *) 0, item, match_fn) == NO)
+   if (tok == NULL || list_match((char *) 0, item, match_fn) == NO)
return (match);
 }
 return (NO);
___
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: r297754 - head/lib/libfetch

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 18:08:21 2016
New Revision: 297754
URL: https://svnweb.freebsd.org/changeset/base/297754

Log:
  libfetch: replace 0 with NULL for pointers.
  
  Found with devel/coccinelle.
  
  Reviewed by:  des

Modified:
  head/lib/libfetch/ftp.c

Modified: head/lib/libfetch/ftp.c
==
--- head/lib/libfetch/ftp.c Sat Apr  9 17:37:36 2016(r297753)
+++ head/lib/libfetch/ftp.c Sat Apr  9 18:08:21 2016(r297754)
@@ -929,7 +929,7 @@ ftp_authenticate(conn_t *conn, struct ur
if (*pwd == '\0')
pwd = getenv("FTP_PASSWORD");
if (pwd == NULL || *pwd == '\0') {
-   if ((logname = getlogin()) == 0)
+   if ((logname = getlogin()) == NULL)
logname = FTP_ANONYMOUS_USER;
if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", 
logname)) < 0)
len = 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: r297753 - head/sys/dev/ixl

2016-04-09 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  9 17:37:36 2016
New Revision: 297753
URL: https://svnweb.freebsd.org/changeset/base/297753

Log:
  ixl(4): replace 0 with NULL for pointers.
  
  Found by devel/coccinelle.
  
  Differential Revision:https://reviews.freebsd.org/D5894
  Reviewed by:  erj

Modified:
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Sat Apr  9 16:06:13 2016(r297752)
+++ head/sys/dev/ixl/if_ixl.c   Sat Apr  9 17:37:36 2016(r297753)
@@ -3380,7 +3380,7 @@ ixl_add_sysctls_eth_stats(struct sysctl_
};
 
struct ixl_sysctl_info *entry = ctls;
-   while (entry->stat != 0)
+   while (entry->stat != NULL)
{
SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, entry->name,
CTLFLAG_RD, entry->stat,
@@ -3439,7 +3439,7 @@ ixl_add_sysctls_mac_stats(struct sysctl_
};
 
struct ixl_sysctl_info *entry = ctls;
-   while (entry->stat != 0)
+   while (entry->stat != NULL)
{
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, entry->name,
CTLFLAG_RD, entry->stat,

Modified: head/sys/dev/ixl/if_ixlv.c
==
--- head/sys/dev/ixl/if_ixlv.c  Sat Apr  9 16:06:13 2016(r297752)
+++ head/sys/dev/ixl/if_ixlv.c  Sat Apr  9 17:37:36 2016(r297753)
@@ -2832,7 +2832,7 @@ ixlv_add_sysctls(struct ixlv_sc *sc)
{0,0,0}
};
struct ixl_sysctl_info *entry = ctls;
-   while (entry->stat != 0)
+   while (entry->stat != NULL)
{
SYSCTL_ADD_QUAD(ctx, child, OID_AUTO, entry->name,
CTLFLAG_RD, entry->stat,
___
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: r297685 - in head/sys: conf dev/kbdmux modules/kbdmux

2016-04-09 Thread Ed Maste
On 9 April 2016 at 11:03, Oliver Pinter  wrote:
> Hi Ed!
>
> On Thu, Apr 7, 2016 at 10:12 PM, Ed Maste  wrote:
>> Author: emaste
>> Date: Thu Apr  7 20:12:45 2016
>> New Revision: 297685
>> URL: https://svnweb.freebsd.org/changeset/base/297685
>>
>> Log:
>>   Add option to specify built-in keymap for kbdmux
>>
>>   PR:   153459
>>   Submitted by: swel...@gmail.com
>>
[...]
>
> It would be nice to MFC this change to 10-STABLE.

Yes, I plan to merge all of the compiled-in keymap changes to
stable/10 in a little while.
___
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: r297752 - head/bin/sh/tests/builtins

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 16:06:13 2016
New Revision: 297752
URL: https://svnweb.freebsd.org/changeset/base/297752

Log:
  sh: Fix some unquoted variables in tests.
  
  The builtins/getopts1.0 test failed if a single-character file existed in
  the current directory.

Modified:
  head/bin/sh/tests/builtins/getopts1.0
  head/bin/sh/tests/builtins/getopts2.0
  head/bin/sh/tests/builtins/getopts9.0

Modified: head/bin/sh/tests/builtins/getopts1.0
==
--- head/bin/sh/tests/builtins/getopts1.0   Sat Apr  9 14:50:47 2016
(r297751)
+++ head/bin/sh/tests/builtins/getopts1.0   Sat Apr  9 16:06:13 2016
(r297752)
@@ -3,7 +3,7 @@
 printf -- '-1-\n'
 set -- -abc
 getopts "ab:" OPTION
-echo ${OPTION}
+printf '%s\n' "${OPTION}"
 
 # In this case 'getopts' should realize that we have not provided the
 # required argument for "-b".
@@ -14,12 +14,12 @@ echo ${OPTION}
 printf -- '-2-\n'
 set -- -ab
 getopts "ab:" OPTION
-echo ${OPTION}
+printf '%s\n' "${OPTION}"
 getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&-
-echo ${OPTION}
+printf '%s\n' "${OPTION}"
 
 # The 'shift' is aimed at causing an error.
 printf -- '-3-\n'
 shift 1
 getopts "ab:" OPTION
-echo ${OPTION}
+printf '%s\n' "${OPTION}"

Modified: head/bin/sh/tests/builtins/getopts2.0
==
--- head/bin/sh/tests/builtins/getopts2.0   Sat Apr  9 14:50:47 2016
(r297751)
+++ head/bin/sh/tests/builtins/getopts2.0   Sat Apr  9 16:06:13 2016
(r297752)
@@ -3,4 +3,4 @@ set - -ax
 getopts ax option
 set -C
 getopts ax option
-echo $option
+printf '%s\n' "$option"

Modified: head/bin/sh/tests/builtins/getopts9.0
==
--- head/bin/sh/tests/builtins/getopts9.0   Sat Apr  9 14:50:47 2016
(r297751)
+++ head/bin/sh/tests/builtins/getopts9.0   Sat Apr  9 16:06:13 2016
(r297752)
@@ -2,8 +2,8 @@
 
 args='-ab'
 getopts ab opt $args
-echo $?:$opt:$OPTARG
+printf '%s\n' "$?:$opt:$OPTARG"
 for dummy in dummy1 dummy2; do
getopts ab opt $args
-   echo $?:$opt:$OPTARG
+   printf '%s\n' "$?:$opt:$OPTARG"
 done
___
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: r297742 - head/sys/netinet

2016-04-09 Thread John Baldwin
On Saturday, April 09, 2016 12:05:24 PM Bjoern A. Zeeb wrote:
> Author: bz
> Date: Sat Apr  9 12:05:23 2016
> New Revision: 297742
> URL: https://svnweb.freebsd.org/changeset/base/297742
> 
> Log:
>   Mfp: r296310,r296343
>   
>   It looks like as with the safety belt of DELAY() fastened (*) we can
>   completely tear down and free all memory for TCP (after r281599).
>   
>   (*) in theory a few ticks should be good enough to make sure the timers
>   are all really gone. Could we use a better matric here and check a
>   tcbcb count as an optimization?

In theory, no amount of DELAY() is ever enough to close a theoretical race
window.  In practice you might get lucky, but you might also panic and
trash user data.  In the rest of the tree, we tend to prefer marking items
as NOFREE instead of this approach putting a priority on stability and
reliability over memory efficiency.

For all of the zones that you removed NOFREE from, do you know why that was
added in the first place (e.g. which stale pointers to pcbs could be
referenced after free)?  Did you verify that those conditions have been
fixed?

-- 
John Baldwin
___
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: r297748 - in head/sys: conf dev/acpica kern vm x86/acpica

2016-04-09 Thread John Baldwin
On Saturday, April 09, 2016 07:03:55 AM Conrad Meyer wrote:
> On Sat, Apr 9, 2016 at 6:58 AM, John Baldwin  wrote:
> > Author: jhb
> > Date: Sat Apr  9 13:58:04 2016
> > New Revision: 297748
> > URL: https://svnweb.freebsd.org/changeset/base/297748
> >
> > Log:
> >   Add more fine-grained kernel options for NUMA support.
> > ...
> >
> >   MAXMEMDOM must still be set to a value greater than for any NUMA support
> 
> a value greater than one :)

Oops, yes. :)

-- 
John Baldwin
___
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: r297733 - head/sys/net80211

2016-04-09 Thread Adrian Chadd
thanks! Sorry, I'm in the middle of trying to figure out why IBSS
isn't working anymore for me and I missed this :(


-a


On 9 April 2016 at 02:31, Bjoern A. Zeeb  wrote:
> Author: bz
> Date: Sat Apr  9 09:31:28 2016
> New Revision: 297733
> URL: https://svnweb.freebsd.org/changeset/base/297733
>
> Log:
>   Try to unbreak the build: the 'vap' variable is only used if ieee80211
>   debugging compile is on.
>
> Modified:
>   head/sys/net80211/ieee80211_node.c
>
> Modified: head/sys/net80211/ieee80211_node.c
> ==
> --- head/sys/net80211/ieee80211_node.c  Sat Apr  9 09:24:05 2016
> (r297732)
> +++ head/sys/net80211/ieee80211_node.c  Sat Apr  9 09:31:28 2016
> (r297733)
> @@ -599,8 +599,8 @@ ieee80211_ibss_merge_check(struct ieee80
>  int
>  ieee80211_ibss_merge(struct ieee80211_node *ni)
>  {
> -   struct ieee80211vap *vap = ni->ni_vap;
>  #ifdef IEEE80211_DEBUG
> +   struct ieee80211vap *vap = ni->ni_vap;
> struct ieee80211com *ic = ni->ni_ic;
>  #endif
>
>
___
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: r297751 - head/sys/dev/isp

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 14:50:47 2016
New Revision: 297751
URL: https://svnweb.freebsd.org/changeset/base/297751

Log:
  Register symbolic port/node names in FC name server.
  
  This is cosmetics that simplifies identification of new ports on FC switch.
  
  It would be good to use target name from CTL here instead of hostname, but
  it is not passed here through CAM now.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/isp_library.h
  head/sys/dev/isp/isp_stds.h
  head/sys/dev/isp/ispmbox.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Sat Apr  9 14:24:17 2016(r297750)
+++ head/sys/dev/isp/isp.c  Sat Apr  9 14:50:47 2016(r297751)
@@ -126,6 +126,8 @@ static int isp_send_change_request(ispso
 static int isp_register_fc4_type(ispsoftc_t *, int);
 static int isp_register_fc4_type_24xx(ispsoftc_t *, int);
 static int isp_register_fc4_features_24xx(ispsoftc_t *, int);
+static int isp_register_port_name_24xx(ispsoftc_t *, int);
+static int isp_register_node_name_24xx(ispsoftc_t *, int);
 static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *);
 static int isp_fw_state(ispsoftc_t *, int);
 static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int);
@@ -3073,6 +3075,8 @@ isp_fclink_test(ispsoftc_t *isp, int cha
r = isp_register_fc4_type_24xx(isp, chan);
if (r == 0)
isp_register_fc4_features_24xx(isp, chan);
+   isp_register_port_name_24xx(isp, chan);
+   isp_register_node_name_24xx(isp, chan);
} else {
fcp->isp_sns_hdl = SNS_ID;
r = isp_register_fc4_type(isp, chan);
@@ -3577,8 +3581,6 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, 
 
/*
 * Build the CT header and command in memory.
-*
-* Note that the CT header has to end up as Big Endian format in memory.
 */
ISP_MEMZERO(, sizeof (ct));
ct.ct_revision = CT_REVISION;
@@ -3982,8 +3984,6 @@ isp_register_fc4_type_24xx(ispsoftc_t *i
 
/*
 * Build the CT header and command in memory.
-*
-* Note that the CT header has to end up as Big Endian format in memory.
 */
ISP_MEMZERO(, sizeof(rp));
ct = _hdr;
@@ -4034,8 +4034,6 @@ isp_register_fc4_features_24xx(ispsoftc_
 
/*
 * Build the CT header and command in memory.
-*
-* Note that the CT header has to end up as Big Endian format in memory.
 */
ISP_MEMZERO(, sizeof(rp));
ct = _hdr;
@@ -4079,6 +4077,130 @@ isp_register_fc4_features_24xx(ispsoftc_
return (0);
 }
 
+static int
+isp_register_port_name_24xx(ispsoftc_t *isp, int chan)
+{
+   fcparam *fcp = FCPARAM(isp, chan);
+   ct_hdr_t *ct;
+   rspn_id_t rp;
+   uint8_t *scp = fcp->isp_scratch;
+   int len;
+
+   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
+   isp_prt(isp, ISP_LOGERR, sacq);
+   return (-1);
+   }
+
+   /*
+* Build the CT header and command in memory.
+*/
+   ISP_MEMZERO(, sizeof(rp));
+   ct = _hdr;
+   ct->ct_revision = CT_REVISION;
+   ct->ct_fcs_type = CT_FC_TYPE_FC;
+   ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS;
+   ct->ct_cmd_resp = SNS_RSPN_ID;
+   rp.rspnid_portid[0] = fcp->isp_portid >> 16;
+   rp.rspnid_portid[1] = fcp->isp_portid >> 8;
+   rp.rspnid_portid[2] = fcp->isp_portid;
+   rp.rspnid_length = 0;
+   len = offsetof(rspn_id_t, rspnid_name);
+   mtx_lock(_mtx);
+   rp.rspnid_length += sprintf([XTXOFF + len + rp.rspnid_length],
+   "%s", prison0.pr_hostname[0] ? prison0.pr_hostname : "FreeBSD");
+   mtx_unlock(_mtx);
+   rp.rspnid_length += sprintf([XTXOFF + len + rp.rspnid_length],
+   ":%s", device_get_nameunit(isp->isp_dev));
+   if (chan != 0) {
+   rp.rspnid_length += sprintf([XTXOFF + len +
+   rp.rspnid_length], "/%d", chan);
+   }
+   len += rp.rspnid_length;
+   ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2;
+   isp_put_rspn_id(isp, , (rspn_id_t *)[XTXOFF]);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "CT request", len, [XTXOFF]);
+
+   if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) {
+   FC_SCRATCH_RELEASE(isp, chan);
+   return (-1);
+   }
+
+   isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct);
+   FC_SCRATCH_RELEASE(isp, chan);
+   if (ct->ct_cmd_resp == LS_RJT) {
+   isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1,
+   "Chan %d Register Symbolic Port Name rejected", chan);
+   return (-1);
+   } else if (ct->ct_cmd_resp == LS_ACC) {
+   

svn commit: r297750 - in stable/10/bin/sh: . tests/builtins

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 14:24:17 2016
New Revision: 297750
URL: https://svnweb.freebsd.org/changeset/base/297750

Log:
  MFC r297360: sh: Fix use-after-free if a trap replaces itself.
  
  The mergeinfo for this commit was accidentally added to the previous commit.

Added:
  stable/10/bin/sh/tests/builtins/trap17.0
 - copied unchanged from r297360, head/bin/sh/tests/builtins/trap17.0
Modified:
  stable/10/bin/sh/tests/builtins/Makefile
  stable/10/bin/sh/trap.c

Modified: stable/10/bin/sh/tests/builtins/Makefile
==
--- stable/10/bin/sh/tests/builtins/MakefileSat Apr  9 14:09:14 2016
(r297749)
+++ stable/10/bin/sh/tests/builtins/MakefileSat Apr  9 14:24:17 2016
(r297750)
@@ -127,6 +127,7 @@ FILES+= trap11.0
 FILES+=trap12.0
 FILES+=trap13.0
 FILES+=trap14.0
+FILES+=trap17.0
 FILES+=trap2.0
 FILES+=trap3.0
 FILES+=trap4.0

Copied: stable/10/bin/sh/tests/builtins/trap17.0 (from r297360, 
head/bin/sh/tests/builtins/trap17.0)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/bin/sh/tests/builtins/trap17.0Sat Apr  9 14:24:17 2016
(r297750, copy of r297360, head/bin/sh/tests/builtins/trap17.0)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+# This use-after-free bug probably needs non-default settings to show up.
+
+v1=nothing v2=nothing
+trap 'trap "echo bad" USR1
+v1=trap_received
+v2=trap_invoked
+:' USR1
+kill -USR1 "$$"
+[ "$v1.$v2" = trap_received.trap_invoked ]

Modified: stable/10/bin/sh/trap.c
==
--- stable/10/bin/sh/trap.c Sat Apr  9 14:09:14 2016(r297749)
+++ stable/10/bin/sh/trap.c Sat Apr  9 14:24:17 2016(r297750)
@@ -403,6 +403,7 @@ onsig(int signo)
 void
 dotrap(void)
 {
+   struct stackmark smark;
int i;
int savestatus, prev_evalskip, prev_skipcount;
 
@@ -436,7 +437,9 @@ dotrap(void)
 
last_trapsig = i;
savestatus = exitstatus;
-   evalstring(trap[i], 0);
+   setstackmark();
+   evalstring(stsavestr(trap[i]), 0);
+   popstackmark();
 
/*
 * If such a command was not
___
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: r297749 - stable/10/bin/sh

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 14:09:14 2016
New Revision: 297749
URL: https://svnweb.freebsd.org/changeset/base/297749

Log:
  MFC r278818: sh: Add stsavestr(), like savestr() but allocates using
  stalloc().

Modified:
  stable/10/bin/sh/cd.c
  stable/10/bin/sh/expand.c
  stable/10/bin/sh/memalloc.c
  stable/10/bin/sh/memalloc.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/sh/cd.c
==
--- stable/10/bin/sh/cd.c   Sat Apr  9 13:58:04 2016(r297748)
+++ stable/10/bin/sh/cd.c   Sat Apr  9 14:09:14 2016(r297749)
@@ -182,7 +182,6 @@ cdlogical(char *dest)
struct stat statb;
int first;
int badstat;
-   size_t len;
 
/*
 *  Check each component of the path. If we find a symlink or
@@ -190,9 +189,7 @@ cdlogical(char *dest)
 *  next time we get the value of the current directory.
 */
badstat = 0;
-   len = strlen(dest);
-   cdcomppath = stalloc(len + 1);
-   memcpy(cdcomppath, dest, len + 1);
+   cdcomppath = stsavestr(dest);
STARTSTACKSTR(p);
if (*dest == '/') {
STPUTC('/', p);
@@ -277,7 +274,6 @@ findcwd(char *dir)
 {
char *new;
char *p;
-   size_t len;
 
/*
 * If our argument is NULL, we don't know the current directory
@@ -286,9 +282,7 @@ findcwd(char *dir)
 */
if (dir == NULL || curdir == NULL)
return getpwd2();
-   len = strlen(dir);
-   cdcomppath = stalloc(len + 1);
-   memcpy(cdcomppath, dir, len + 1);
+   cdcomppath = stsavestr(dir);
STARTSTACKSTR(new);
if (*dir != '/') {
STPUTS(curdir, new);

Modified: stable/10/bin/sh/expand.c
==
--- stable/10/bin/sh/expand.c   Sat Apr  9 13:58:04 2016(r297748)
+++ stable/10/bin/sh/expand.c   Sat Apr  9 14:09:14 2016(r297749)
@@ -1281,11 +1281,8 @@ addfname(char *name)
 {
char *p;
struct strlist *sp;
-   size_t len;
 
-   len = strlen(name);
-   p = stalloc(len + 1);
-   memcpy(p, name, len + 1);
+   p = stsavestr(name);
sp = (struct strlist *)stalloc(sizeof *sp);
sp->text = p;
*exparg.lastp = sp;

Modified: stable/10/bin/sh/memalloc.c
==
--- stable/10/bin/sh/memalloc.c Sat Apr  9 13:58:04 2016(r297748)
+++ stable/10/bin/sh/memalloc.c Sat Apr  9 14:09:14 2016(r297749)
@@ -180,6 +180,18 @@ stunalloc(pointer p)
 }
 
 
+char *
+stsavestr(const char *s)
+{
+   char *p;
+   size_t len;
+
+   len = strlen(s);
+   p = stalloc(len + 1);
+   memcpy(p, s, len + 1);
+   return p;
+}
+
 
 void
 setstackmark(struct stackmark *mark)

Modified: stable/10/bin/sh/memalloc.h
==
--- stable/10/bin/sh/memalloc.h Sat Apr  9 13:58:04 2016(r297748)
+++ stable/10/bin/sh/memalloc.h Sat Apr  9 14:09:14 2016(r297749)
@@ -52,6 +52,7 @@ void ckfree(pointer);
 char *savestr(const char *);
 pointer stalloc(int);
 void stunalloc(pointer);
+char *stsavestr(const char *);
 void setstackmark(struct stackmark *);
 void popstackmark(struct stackmark *);
 char *growstackstr(void);
___
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: r297748 - in head/sys: conf dev/acpica kern vm x86/acpica

2016-04-09 Thread Conrad Meyer
On Sat, Apr 9, 2016 at 6:58 AM, John Baldwin  wrote:
> Author: jhb
> Date: Sat Apr  9 13:58:04 2016
> New Revision: 297748
> URL: https://svnweb.freebsd.org/changeset/base/297748
>
> Log:
>   Add more fine-grained kernel options for NUMA support.
> ...
>
>   MAXMEMDOM must still be set to a value greater than for any NUMA support

a value greater than one :)

>   to be effective.  Note that 'cpuset -gd' always works if MAXMEMDOM is
>   enabled and the system supports NUMA.

Best,
Conrad
___
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: r297748 - in head/sys: conf dev/acpica kern vm x86/acpica

2016-04-09 Thread John Baldwin
Author: jhb
Date: Sat Apr  9 13:58:04 2016
New Revision: 297748
URL: https://svnweb.freebsd.org/changeset/base/297748

Log:
  Add more fine-grained kernel options for NUMA support.
  
  VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in
  the virtual memory system.  DEVICE_NUMA is used to enable affinity
  reporting for devices such as bus_get_domain().
  
  MAXMEMDOM must still be set to a value greater than for any NUMA support
  to be effective.  Note that 'cpuset -gd' always works if MAXMEMDOM is
  enabled and the system supports NUMA.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D5782

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpivar.h
  head/sys/kern/kern_cpuset.c
  head/sys/vm/vm_domain.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_phys.c
  head/sys/vm/vm_phys.h
  head/sys/x86/acpica/srat.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Sat Apr  9 13:32:42 2016(r297747)
+++ head/sys/conf/NOTES Sat Apr  9 13:58:04 2016(r297748)
@@ -229,7 +229,15 @@ optionsMAXCPU=32
 
 # MAXMEMDOM defines the maximum number of memory domains that can boot in the
 # system.  A default value should already be defined by every architecture.
-optionsMAXMEMDOM=1
+optionsMAXMEMDOM=2
+
+# VM_NUMA_ALLOC enables use of memory domain-aware allocation in the VM
+# system.
+optionsVM_NUMA_ALLOC
+
+# DEVICE_NUMA enables reporting of domain affinity of I/O devices via
+# bus_get_domain(), etc.
+optionsDEVICE_NUMA
 
 # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin
 # if the thread that currently owns the mutex is executing on another

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sat Apr  9 13:32:42 2016(r297747)
+++ head/sys/conf/options   Sat Apr  9 13:58:04 2016(r297748)
@@ -90,6 +90,7 @@ COMPAT_LINUXKPI   opt_compat.h
 COMPILING_LINT opt_global.h
 CY_PCI_FASTINTR
 DEADLKRES  opt_watchdog.h
+DEVICE_NUMA
 EXT_RESOURCES  opt_global.h
 DIRECTIO
 FILEMONopt_dontuse.h
@@ -603,6 +604,7 @@ VM_KMEM_SIZEopt_vm.h
 VM_KMEM_SIZE_SCALE opt_vm.h
 VM_KMEM_SIZE_MAX   opt_vm.h
 VM_NRESERVLEVELopt_vm.h
+VM_NUMA_ALLOC  opt_vm.h
 VM_LEVEL_0_ORDER   opt_vm.h
 NO_SWAPPINGopt_vm.h
 MALLOC_MAKE_FAILURES   opt_vm.h

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Sat Apr  9 13:32:42 2016(r297747)
+++ head/sys/dev/acpica/acpi.c  Sat Apr  9 13:58:04 2016(r297748)
@@ -31,6 +31,8 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_device_numa.h"
+
 #include 
 #include 
 #include 
@@ -1083,7 +1085,7 @@ acpi_hint_device_unit(device_t acdev, de
 int
 acpi_parse_pxm(device_t dev, int *domain)
 {
-#if MAXMEMDOM > 1
+#ifdef DEVICE_NUMA
ACPI_HANDLE h;
int d, pxm;
 

Modified: head/sys/dev/acpica/acpivar.h
==
--- head/sys/dev/acpica/acpivar.h   Sat Apr  9 13:32:42 2016
(r297747)
+++ head/sys/dev/acpica/acpivar.h   Sat Apr  9 13:58:04 2016
(r297748)
@@ -502,9 +502,7 @@ SYSCTL_DECL(_debug_acpi);
  *
  * Returns the VM domain ID if found, or -1 if not found / invalid.
  */
-#if MAXMEMDOM > 1
 extern int acpi_map_pxm_to_vm_domainid(int pxm);
-#endif
 extern int acpi_get_domain(device_t dev, device_t child, int *domain);
 extern int acpi_parse_pxm(device_t dev, int *domain);
 

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Sat Apr  9 13:32:42 2016(r297747)
+++ head/sys/kern/kern_cpuset.c Sat Apr  9 13:58:04 2016(r297748)
@@ -831,7 +831,7 @@ struct cpuset *
 cpuset_thread0(void)
 {
struct cpuset *set;
-   int error;
+   int error, i;
 
cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL,
NULL, NULL, UMA_ALIGN_PTR, 0);
@@ -863,9 +863,15 @@ cpuset_thread0(void)
 */
cpuset_unr = new_unrhdr(2, INT_MAX, NULL);
 
-   /* MD Code is responsible for initializing sets if vm_ndomains > 1. */
-   if (vm_ndomains == 1)
-   CPU_COPY(_cpus, _domain[0]);
+   /*
+* If MD code has not initialized per-domain cpusets, place all
+* CPUs in domain 0.
+*/
+   for (i = 0; i < MAXMEMDOM; i++)
+   if (!CPU_EMPTY(_domain[i]))
+   goto domains_set;
+   CPU_COPY(_cpus, _domain[0]);
+domains_set:
 
return (set);
 }
@@ -1118,7 +1124,7 @@ sys_cpuset_getaffinity(struct thread *td
  

svn commit: r297747 - in stable/10: sys/kern tools/regression/sysvsem

2016-04-09 Thread Jilles Tjoelker
Author: jilles
Date: Sat Apr  9 13:32:42 2016
New Revision: 297747
URL: https://svnweb.freebsd.org/changeset/base/297747

Log:
  MFC r295385: semget(): Check for [EEXIST] error first.
  
  Although POSIX literally permits failing with [EINVAL] if IPC_CREAT and
  IPC_EXCL were both passed, the semaphore set already exists and has fewer
  semaphores than nsems, this does not allow an application to retry safely:
  if the [EINVAL] is actually because of the semmsl limit, an infinite loop
  would result.
  
  PR:   206927

Modified:
  stable/10/sys/kern/sysv_sem.c
  stable/10/tools/regression/sysvsem/semtest.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/sysv_sem.c
==
--- stable/10/sys/kern/sysv_sem.c   Sat Apr  9 13:15:34 2016
(r297746)
+++ stable/10/sys/kern/sysv_sem.c   Sat Apr  9 13:32:42 2016
(r297747)
@@ -877,6 +877,11 @@ sys_semget(struct thread *td, struct sem
}
if (semid < seminfo.semmni) {
DPRINTF(("found public key\n"));
+   if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) {
+   DPRINTF(("not exclusive\n"));
+   error = EEXIST;
+   goto done2;
+   }
if ((error = ipcperm(td, [semid].u.sem_perm,
semflg & 0700))) {
goto done2;
@@ -886,11 +891,6 @@ sys_semget(struct thread *td, struct sem
error = EINVAL;
goto done2;
}
-   if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) {
-   DPRINTF(("not exclusive\n"));
-   error = EEXIST;
-   goto done2;
-   }
 #ifdef MAC
error = mac_sysvsem_check_semget(cred, [semid]);
if (error != 0)

Modified: stable/10/tools/regression/sysvsem/semtest.c
==
--- stable/10/tools/regression/sysvsem/semtest.cSat Apr  9 13:15:34 
2016(r297746)
+++ stable/10/tools/regression/sysvsem/semtest.cSat Apr  9 13:32:42 
2016(r297747)
@@ -152,6 +152,15 @@ main(int argc, char *argv[])
 
print_semid_ds(_ds, 0600);
 
+   errno = 0;
+   if (semget(semkey, 1, IPC_CREAT | IPC_EXCL | 0600) != -1 ||
+   errno != EEXIST)
+   err(1, "semget IPC_EXCL 1 did not fail with [EEXIST]");
+   errno = 0;
+   if (semget(semkey, 2, IPC_CREAT | IPC_EXCL | 0600) != -1 ||
+   errno != EEXIST)
+   err(1, "semget IPC_EXCL 2 did not fail with [EEXIST]");
+
for (child_count = 0; child_count < 5; child_count++) {
switch ((child_pid = fork())) {
case -1:
___
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: r297746 - head/sys/dev/ioat

2016-04-09 Thread Conrad E. Meyer
Author: cem
Date: Sat Apr  9 13:15:34 2016
New Revision: 297746
URL: https://svnweb.freebsd.org/changeset/base/297746

Log:
  ioat(4): ioat_get_dmaengine(): Add M_WAITOK mode
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat.h
  head/sys/dev/ioat/ioat_internal.h
  head/sys/dev/ioat/ioat_test.c

Modified: head/sys/dev/ioat/ioat.c
==
--- head/sys/dev/ioat/ioat.cSat Apr  9 13:01:40 2016(r297745)
+++ head/sys/dev/ioat/ioat.cSat Apr  9 13:15:34 2016(r297746)
@@ -314,6 +314,9 @@ ioat_detach(device_t device)
 
mtx_lock(IOAT_REFLK);
ioat->quiescing = TRUE;
+   ioat->destroying = TRUE;
+   wakeup(>quiescing);
+
ioat_channel[ioat->chan_idx] = NULL;
 
ioat_drain_locked(ioat);
@@ -739,18 +742,40 @@ ioat_reset_hw_task(void *ctx, int pendin
  * User API functions
  */
 bus_dmaengine_t
-ioat_get_dmaengine(uint32_t index)
+ioat_get_dmaengine(uint32_t index, int flags)
 {
-   struct ioat_softc *sc;
+   struct ioat_softc *ioat;
+
+   KASSERT((flags & ~(M_NOWAIT | M_WAITOK)) == 0,
+   ("invalid flags: 0x%08x", flags));
+   KASSERT((flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK),
+   ("invalid wait | nowait"));
 
if (index >= ioat_channel_index)
return (NULL);
 
-   sc = ioat_channel[index];
-   if (sc == NULL || sc->quiescing)
+   ioat = ioat_channel[index];
+   if (ioat == NULL || ioat->destroying)
return (NULL);
 
-   return (_get(sc, IOAT_DMAENGINE_REF)->dmaengine);
+   if (ioat->quiescing) {
+   if ((flags & M_NOWAIT) != 0)
+   return (NULL);
+
+   mtx_lock(IOAT_REFLK);
+   while (ioat->quiescing && !ioat->destroying)
+   msleep(>quiescing, IOAT_REFLK, 0, "getdma", 0);
+   mtx_unlock(IOAT_REFLK);
+
+   if (ioat->destroying)
+   return (NULL);
+   }
+
+   /*
+* There's a race here between the quiescing check and HW reset or
+* module destroy.
+*/
+   return (_get(ioat, IOAT_DMAENGINE_REF)->dmaengine);
 }
 
 void
@@ -1571,6 +1596,7 @@ ioat_reset_hw(struct ioat_softc *ioat)
 out:
mtx_lock(IOAT_REFLK);
ioat->quiescing = FALSE;
+   wakeup(>quiescing);
mtx_unlock(IOAT_REFLK);
 
if (error == 0)

Modified: head/sys/dev/ioat/ioat.h
==
--- head/sys/dev/ioat/ioat.hSat Apr  9 13:01:40 2016(r297745)
+++ head/sys/dev/ioat/ioat.hSat Apr  9 13:15:34 2016(r297746)
@@ -68,8 +68,10 @@ typedef void (*bus_dmaengine_callback_t)
 
 /*
  * Called first to acquire a reference to the DMA channel
+ *
+ * Flags may be M_WAITOK or M_NOWAIT.
  */
-bus_dmaengine_t ioat_get_dmaengine(uint32_t channel_index);
+bus_dmaengine_t ioat_get_dmaengine(uint32_t channel_index, int flags);
 
 /* Release the DMA channel */
 void ioat_put_dmaengine(bus_dmaengine_t dmaengine);

Modified: head/sys/dev/ioat/ioat_internal.h
==
--- head/sys/dev/ioat/ioat_internal.h   Sat Apr  9 13:01:40 2016
(r297745)
+++ head/sys/dev/ioat/ioat_internal.h   Sat Apr  9 13:15:34 2016
(r297746)
@@ -410,6 +410,7 @@ struct ioat_softc {
struct task reset_task;
 
boolean_t   quiescing;
+   boolean_t   destroying;
boolean_t   is_resize_pending;
boolean_t   is_completion_pending;
boolean_t   is_reset_pending;

Modified: head/sys/dev/ioat/ioat_test.c
==
--- head/sys/dev/ioat/ioat_test.c   Sat Apr  9 13:01:40 2016
(r297745)
+++ head/sys/dev/ioat/ioat_test.c   Sat Apr  9 13:15:34 2016
(r297746)
@@ -388,7 +388,7 @@ ioat_dma_test(void *arg)
return;
}
 
-   dmaengine = ioat_get_dmaengine(test->channel_index);
+   dmaengine = ioat_get_dmaengine(test->channel_index, M_NOWAIT);
if (dmaengine == NULL) {
ioat_test_log(0, "Couldn't acquire dmaengine\n");
test->status[IOAT_TEST_NO_DMA_ENGINE]++;
___
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: r297742 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 12:05:23 2016
New Revision: 297742
URL: https://svnweb.freebsd.org/changeset/base/297742

Log:
  Mfp: r296310,r296343
  
  It looks like as with the safety belt of DELAY() fastened (*) we can
  completely tear down and free all memory for TCP (after r281599).
  
  (*) in theory a few ticks should be good enough to make sure the timers
  are all really gone. Could we use a better matric here and check a
  tcbcb count as an optimization?
  
  PR:   164763
  Reviewed by:  gnn, emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5734

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Sat Apr  9 11:54:09 2016(r297741)
+++ head/sys/netinet/tcp_subr.c Sat Apr  9 12:05:23 2016(r297742)
@@ -660,7 +660,7 @@ tcp_init(void)
 * These have to be type stable for the benefit of the timers.
 */
V_tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(V_tcpcb_zone, maxsockets);
uma_zone_set_warning(V_tcpcb_zone, "kern.ipc.maxsockets limit reached");
 
@@ -670,7 +670,7 @@ tcp_init(void)
 
TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", _tcp_do_sack);
V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 
/* Skip initialization of globals for non-default instances. */
if (!IS_DEFAULT_VNET(curvnet))
@@ -737,10 +737,21 @@ tcp_destroy(void)
 {
int error;
 
+   /*
+* All our processes are gone, all our sockets should be cleaned
+* up, which means, we should be past the tcp_discardcb() calls.
+* Sleep to let all tcpcb timers really disappear and then cleanup.
+* Timewait will cleanup its queue and will be ready to go.
+* XXX-BZ In theory a few ticks should be good enough to make sure
+* the timers are all really gone.  We should see if we could use a
+* better metric here and, e.g., check a tcbcb count as an optimization?
+*/
+   DELAY(100 / hz);
tcp_hc_destroy();
syncache_destroy();
tcp_tw_destroy();
in_pcbinfo_destroy(_tcbinfo);
+   /* tcp_discardcb() clears the sack_holes up. */
uma_zdestroy(V_sack_hole_zone);
uma_zdestroy(V_tcpcb_zone);
 
___
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: r297741 - head/sys/dev/isp

2016-04-09 Thread Alexander Motin
Author: mav
Date: Sat Apr  9 11:54:09 2016
New Revision: 297741
URL: https://svnweb.freebsd.org/changeset/base/297741

Log:
  Reduce code duplication when executing Passthrough IOCB.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Sat Apr  9 11:27:47 2016(r297740)
+++ head/sys/dev/isp/isp.c  Sat Apr  9 11:54:09 2016(r297741)
@@ -3494,26 +3494,17 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan
 }
 
 static int
-isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan)
+isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t 
rsp_bcnt)
 {
mbreg_t mbs;
fcparam *fcp = FCPARAM(isp, chan);
union {
isp_ct_pt_t plocal;
-   ct_hdr_t clocal;
uint8_t q[QENTRY_LEN];
} un;
isp_ct_pt_t *pt;
-   ct_hdr_t *ct;
-   uint32_t *rp;
uint8_t *scp = fcp->isp_scratch;
 
-   isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan);
-   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
-   isp_prt(isp, ISP_LOGERR, sacq);
-   return (-1);
-   }
-
/*
 * Build a Passthrough IOCB in memory.
 */
@@ -3527,39 +3518,21 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, 
pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan);
pt->ctp_time = 10;
pt->ctp_rsp_cnt = 1;
-   pt->ctp_rsp_bcnt = GIDLEN;
-   pt->ctp_cmd_bcnt = sizeof (*ct) + sizeof (uint32_t);
+   pt->ctp_rsp_bcnt = rsp_bcnt;
+   pt->ctp_cmd_bcnt = cmd_bcnt;
pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF);
pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF);
-   pt->ctp_dataseg[0].ds_count = sizeof (*ct) + sizeof (uint32_t);
+   pt->ctp_dataseg[0].ds_count = cmd_bcnt;
pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma);
pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma);
-   pt->ctp_dataseg[1].ds_count = GIDLEN;
-   if (isp->isp_dblev & ISP_LOGDEBUG1) {
-   isp_print_bytes(isp, "ct IOCB", QENTRY_LEN, pt);
-   }
-   isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) [CTXOFF]);
+   pt->ctp_dataseg[1].ds_count = rsp_bcnt;
+   isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)[CTXOFF]);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, 
[CTXOFF]);
 
/*
-* Build the CT header and command in memory.
-*
-* Note that the CT header has to end up as Big Endian format in memory.
+* Execute the Passthrough IOCB.
 */
-   ct = 
-   ISP_MEMZERO(ct, sizeof (*ct));
-   ct->ct_revision = CT_REVISION;
-   ct->ct_fcs_type = CT_FC_TYPE_FC;
-   ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS;
-   ct->ct_cmd_resp = SNS_GID_FT;
-   ct->ct_bcnt_resid = (GIDLEN - 16) >> 2;
-
-   isp_put_ct_hdr(isp, ct, (ct_hdr_t *) [XTXOFF]);
-   rp = (uint32_t *) [XTXOFF+sizeof (*ct)];
-   ISP_IOZPUT_32(isp, FC4_SCSI, rp);
-   if (isp->isp_dblev & ISP_LOGDEBUG1) {
-   isp_print_bytes(isp, "CT HDR + payload after put",
-   sizeof (*ct) + sizeof (uint32_t), [XTXOFF]);
-   }
ISP_MEMZERO([ZTXOFF], QENTRY_LEN);
MBSINIT(, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL,
MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 100);
@@ -3574,18 +3547,58 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, 
return (-1);
}
MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, 
[ZTXOFF]);
pt = 
isp_get_ct_pt(isp, (isp_ct_pt_t *) [ZTXOFF], pt);
-   if (isp->isp_dblev & ISP_LOGDEBUG1) {
-   isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt);
-   }
-
if (pt->ctp_status && pt->ctp_status != RQCS_DATA_UNDERRUN) {
isp_prt(isp, ISP_LOGWARN,
"Chan %d GID_FT CT Passthrough returned 0x%x",
chan, pt->ctp_status);
return (-1);
}
+
+   return (0);
+}
+
+static int
+isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan)
+{
+   fcparam *fcp = FCPARAM(isp, chan);
+   ct_hdr_t ct;
+   uint32_t *rp;
+   uint8_t *scp = fcp->isp_scratch;
+
+   isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan);
+   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
+   isp_prt(isp, ISP_LOGERR, sacq);
+   return (-1);
+   }
+
+   /*
+* Build the CT header and command in memory.
+*
+* Note that the CT header has to end up as Big Endian format in memory.
+*/
+   ISP_MEMZERO(, sizeof (ct));
+   ct.ct_revision = CT_REVISION;
+   ct.ct_fcs_type = CT_FC_TYPE_FC;
+   ct.ct_fcs_subtype = 

svn commit: r297740 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 11:27:47 2016
New Revision: 297740
URL: https://svnweb.freebsd.org/changeset/base/297740

Log:
  Mfp: r296260
  
  The tcp_inpcb (pcbinfo) zone should be safe to destroy.
  
  PR:   164763
  Reviewed by:  gnn
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5732

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Sat Apr  9 11:23:46 2016(r297739)
+++ head/sys/netinet/tcp_subr.c Sat Apr  9 11:27:47 2016(r297740)
@@ -654,8 +654,7 @@ tcp_init(void)
hashsize);
}
in_pcbinfo_init(_tcbinfo, "tcp", _tcb, hashsize, hashsize,
-   "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE,
-   IPI_HASHFIELDS_4TUPLE);
+   "tcp_inpcb", tcp_inpcb_init, NULL, 0, IPI_HASHFIELDS_4TUPLE);
 
/*
 * These have to be type stable for the benefit of the timers.
___
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: r297739 - head/sys/arm/allwinner/a20

2016-04-09 Thread Jared McNeill
Author: jmcneill
Date: Sat Apr  9 11:23:46 2016
New Revision: 297739
URL: https://svnweb.freebsd.org/changeset/base/297739

Log:
  Enable PHY regulator when the optional "phy-supply" property is present.
  
  Submitted by: Emmanuel Vadot 

Modified:
  head/sys/arm/allwinner/a20/a20_if_dwc.c

Modified: head/sys/arm/allwinner/a20/a20_if_dwc.c
==
--- head/sys/arm/allwinner/a20/a20_if_dwc.c Sat Apr  9 10:58:08 2016
(r297738)
+++ head/sys/arm/allwinner/a20/a20_if_dwc.c Sat Apr  9 11:23:46 2016
(r297739)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include "if_dwc_if.h"
 
@@ -64,6 +65,7 @@ a20_if_dwc_init(device_t dev)
const char *tx_parent_name;
char *phy_type;
clk_t clk_tx, clk_tx_parent;
+   regulator_t reg;
phandle_t node;
int error;
 
@@ -96,6 +98,15 @@ a20_if_dwc_init(device_t dev)
}
}
 
+   /* Enable PHY regulator if applicable */
+   if (regulator_get_by_ofw_property(dev, "phy-supply", ) == 0) {
+   error = regulator_enable(reg);
+   if (error != 0) {
+   device_printf(dev, "could not enable PHY regulator\n");
+   return (error);
+   }
+   }
+
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"


Re: svn commit: r297685 - in head/sys: conf dev/kbdmux modules/kbdmux

2016-04-09 Thread Oliver Pinter
Hi Ed!

On Thu, Apr 7, 2016 at 10:12 PM, Ed Maste  wrote:
> Author: emaste
> Date: Thu Apr  7 20:12:45 2016
> New Revision: 297685
> URL: https://svnweb.freebsd.org/changeset/base/297685
>
> Log:
>   Add option to specify built-in keymap for kbdmux
>
>   PR:   153459
>   Submitted by: swel...@gmail.com
>
> Modified:
>   head/sys/conf/NOTES
>   head/sys/conf/files
>   head/sys/conf/options
>   head/sys/dev/kbdmux/kbdmux.c
>   head/sys/modules/kbdmux/Makefile
>
> Modified: head/sys/conf/NOTES
>

It would be nice to MFC this change to 10-STABLE.
___
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: r297738 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 10:58:08 2016
New Revision: 297738
URL: https://svnweb.freebsd.org/changeset/base/297738

Log:
  Mfp: r296259
  
  We attach the "counter" to the tcpcbs. Thus don't free the
  TCP Fastopen zone before the tcpcbs are gone, as otherwise
  the zone won't be empty.
  With that it should be safe to destroy the "tfo" zone without
  leaking the memory.
  
  PR:   164763
  Reviewed by:  gnn
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5731

Modified:
  head/sys/netinet/tcp_fastopen.c
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_fastopen.c
==
--- head/sys/netinet/tcp_fastopen.c Sat Apr  9 10:53:21 2016
(r297737)
+++ head/sys/netinet/tcp_fastopen.c Sat Apr  9 10:58:08 2016
(r297738)
@@ -204,7 +204,7 @@ void
 tcp_fastopen_init(void)
 {
V_counter_zone = uma_zcreate("tfo", sizeof(unsigned int),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
rm_init(_tcp_fastopen_keylock, "tfo_keylock");
callout_init_rm(_tcp_fastopen_autokey_ctx.c,
_tcp_fastopen_keylock, 0);

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Sat Apr  9 10:53:21 2016(r297737)
+++ head/sys/netinet/tcp_subr.c Sat Apr  9 10:58:08 2016(r297738)
@@ -738,9 +738,6 @@ tcp_destroy(void)
 {
int error;
 
-#ifdef TCP_RFC7413
-   tcp_fastopen_destroy();
-#endif
tcp_hc_destroy();
syncache_destroy();
tcp_tw_destroy();
@@ -748,6 +745,14 @@ tcp_destroy(void)
uma_zdestroy(V_sack_hole_zone);
uma_zdestroy(V_tcpcb_zone);
 
+#ifdef TCP_RFC7413
+   /*
+* Cannot free the zone until all tcpcbs are released as we attach
+* the allocations to them.
+*/
+   tcp_fastopen_destroy();
+#endif
+
error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]);
if (error != 0) {
printf("%s: WARNING: unable to deregister helper hook "
___
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: r297737 - head/tools/tools/nanobsd

2016-04-09 Thread Poul-Henning Kamp
Author: phk
Date: Sat Apr  9 10:53:21 2016
New Revision: 297737
URL: https://svnweb.freebsd.org/changeset/base/297737

Log:
  Create /usr/local/etc before filling things into it.
  
  Only run mtree if the NANO_CUST_FILES_MTREE is nonempty
  
  Also umount the packages on non-signal failure

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shSat Apr  9 10:51:07 2016
(r297736)
+++ head/tools/tools/nanobsd/defaults.shSat Apr  9 10:53:21 2016
(r297737)
@@ -915,7 +915,7 @@ cust_install_files ( ) (
cd "${NANO_TOOLS}/Files"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv 
${NANO_WORLDDIR}
 
-   if [ -f ${NANO_CUST_FILES_MTREE} ]; then
+   if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; 
then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
fi
 )
@@ -925,6 +925,7 @@ cust_install_files ( ) (
 
 cust_pkgng ( ) (
 
+   mkdir -p ${NANO_WORLDDIR}/usr/local/etc
local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf"
local PKGCMD="env ASSUME_ALWAYS_YES=YES 
PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg"
 
@@ -956,7 +957,7 @@ cust_pkgng ( ) (
mkdir -p ${NANO_WORLDDIR}/_.p
mount -t nullfs -o noatime -o ro ${NANO_PACKAGE_DIR} 
${NANO_WORLDDIR}/_.p
 
-   trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15
+   trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 
EXIT
 
# Install packages
todo="$(echo "${NANO_PACKAGE_LIST}" | awk '{ print NF }')"
___
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: r297736 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 10:51:07 2016
New Revision: 297736
URL: https://svnweb.freebsd.org/changeset/base/297736

Log:
  Mfp: r296309
  
  While there is no dependency interaction, stopping the timer before
  freeing the rest of the resources seems more natural and avoids it
  being scheduled an extra time when it is no longer needed.
  
  Reviewed by:  gnn, emaste
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5733

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Sat Apr  9 10:44:57 2016
(r297735)
+++ head/sys/netinet/tcp_syncache.c Sat Apr  9 10:51:07 2016
(r297736)
@@ -281,6 +281,12 @@ syncache_destroy(void)
struct syncache *sc, *nsc;
int i;
 
+   /*
+* Stop the re-seed timer before freeing resources.  No need to
+* possibly schedule it another time.
+*/
+   callout_drain(_tcp_syncache.secret.reseed);
+
/* Cleanup hash buckets: stop timers, free entries, destroy locks. */
for (i = 0; i < V_tcp_syncache.hashsize; i++) {
 
@@ -304,8 +310,6 @@ syncache_destroy(void)
/* Free the allocated global resources. */
uma_zdestroy(V_tcp_syncache.zone);
free(V_tcp_syncache.hashbase, M_SYNCACHE);
-
-   callout_drain(_tcp_syncache.secret.reseed);
 }
 #endif
 
___
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: r297735 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 10:44:57 2016
New Revision: 297735
URL: https://svnweb.freebsd.org/changeset/base/297735

Log:
  Mfp: r296345
  
  No need to keep type stability on raw sockets zone.
  We've also been running with a KASSERT since r222488 to make sure the
  ipi_count is 0 on destroy.
  
  PR:   164763
  Reviewed by:  gnn
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5735

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==
--- head/sys/netinet/raw_ip.c   Sat Apr  9 10:39:54 2016(r297734)
+++ head/sys/netinet/raw_ip.c   Sat Apr  9 10:44:57 2016(r297735)
@@ -209,8 +209,7 @@ rip_init(void)
 {
 
in_pcbinfo_init(_ripcbinfo, "rip", _ripcb, INP_PCBHASH_RAW_SIZE,
-   1, "ripcb", rip_inpcb_init, NULL, UMA_ZONE_NOFREE,
-   IPI_HASHFIELDS_NONE);
+   1, "ripcb", rip_inpcb_init, NULL, 0, IPI_HASHFIELDS_NONE);
EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL,
EVENTHANDLER_PRI_ANY);
 }
___
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: r297734 - head/sys/netinet

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 10:39:54 2016
New Revision: 297734
URL: https://svnweb.freebsd.org/changeset/base/297734

Log:
  Mfp: r296346
  
  No reason identified to keep UMA_ZONE_NOFREE here.
  
  Reviewed by:  gnn
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5736

Modified:
  head/sys/netinet/ip_divert.c

Modified: head/sys/netinet/ip_divert.c
==
--- head/sys/netinet/ip_divert.cSat Apr  9 09:31:28 2016
(r297733)
+++ head/sys/netinet/ip_divert.cSat Apr  9 10:39:54 2016
(r297734)
@@ -158,8 +158,7 @@ div_init(void)
 * place for hashbase == NULL.
 */
in_pcbinfo_init(_divcbinfo, "div", _divcb, 1, 1, "divcb",
-   div_inpcb_init, div_inpcb_fini, UMA_ZONE_NOFREE,
-   IPI_HASHFIELDS_NONE);
+   div_inpcb_init, div_inpcb_fini, 0, IPI_HASHFIELDS_NONE);
 }
 
 static void
___
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: r297733 - head/sys/net80211

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 09:31:28 2016
New Revision: 297733
URL: https://svnweb.freebsd.org/changeset/base/297733

Log:
  Try to unbreak the build: the 'vap' variable is only used if ieee80211
  debugging compile is on.

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==
--- head/sys/net80211/ieee80211_node.c  Sat Apr  9 09:24:05 2016
(r297732)
+++ head/sys/net80211/ieee80211_node.c  Sat Apr  9 09:31:28 2016
(r297733)
@@ -599,8 +599,8 @@ ieee80211_ibss_merge_check(struct ieee80
 int
 ieee80211_ibss_merge(struct ieee80211_node *ni)
 {
-   struct ieee80211vap *vap = ni->ni_vap;
 #ifdef IEEE80211_DEBUG
+   struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
 #endif
 
___
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: r297732 - head/sys/kern

2016-04-09 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Apr  9 09:24:05 2016
New Revision: 297732
URL: https://svnweb.freebsd.org/changeset/base/297732

Log:
  Make the KASSERT message in hash destroy more informative.
  While the pointer might not be too helpful, the malloc type might at
  least give a good hint about which hashtbl we are talking.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  gnn, emaste
  Differential Revision:https://reviews.freebsd.org/D5802

Modified:
  head/sys/kern/subr_hash.c

Modified: head/sys/kern/subr_hash.c
==
--- head/sys/kern/subr_hash.c   Sat Apr  9 04:57:25 2016(r297731)
+++ head/sys/kern/subr_hash.c   Sat Apr  9 09:24:05 2016(r297732)
@@ -93,7 +93,8 @@ hashdestroy(void *vhashtbl, struct mallo
 
hashtbl = vhashtbl;
for (hp = hashtbl; hp <= [hashmask]; hp++)
-   KASSERT(LIST_EMPTY(hp), ("%s: hash not empty", __func__));
+   KASSERT(LIST_EMPTY(hp), ("%s: hashtbl %p not empty "
+   "(malloc type %s)", __func__, hashtbl, type->ks_shortdesc));
free(hashtbl, type);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"