svn commit: r300117 - in head/sys/boot: common efi/libefi efi/loader fdt i386/libi386 pc98/libpc98 uboot/lib zfs

2016-05-17 Thread Warner Losh
Author: imp
Date: Wed May 18 05:59:05 2016
New Revision: 300117
URL: https://svnweb.freebsd.org/changeset/base/300117

Log:
  Fix several instances where the boot loader ignored pager_output
  return value when it could return 1 (indicating we should stop).
  Fix a few instances of pager_open() / pager_close() not being called.
  Actually use these routines for the environment variable printing code
  I just committed.

Modified:
  head/sys/boot/common/disk.c
  head/sys/boot/common/disk.h
  head/sys/boot/common/module.c
  head/sys/boot/common/part.c
  head/sys/boot/common/part.h
  head/sys/boot/common/pnp.c
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/efi/loader/bootinfo.c
  head/sys/boot/efi/loader/main.c
  head/sys/boot/fdt/fdt_loader_cmd.c
  head/sys/boot/i386/libi386/bioscd.c
  head/sys/boot/i386/libi386/biosdisk.c
  head/sys/boot/pc98/libpc98/bioscd.c
  head/sys/boot/pc98/libpc98/biosdisk.c
  head/sys/boot/uboot/lib/disk.c
  head/sys/boot/zfs/zfs.c

Modified: head/sys/boot/common/disk.c
==
--- head/sys/boot/common/disk.c Wed May 18 05:58:58 2016(r300116)
+++ head/sys/boot/common/disk.c Wed May 18 05:59:05 2016(r300117)
@@ -183,13 +183,14 @@ ptblread(void *d, void *buf, size_t bloc
 }
 
 #definePWIDTH  35
-static void
+static int
 ptable_print(void *arg, const char *pname, const struct ptable_entry *part)
 {
struct print_args *pa, bsd;
struct open_disk *od;
struct ptable *table;
char line[80];
+   int res;
 
pa = (struct print_args *)arg;
od = (struct open_disk *)pa->dev->d_opendata;
@@ -200,25 +201,29 @@ ptable_print(void *arg, const char *pnam
display_size(part->end - part->start + 1,
od->sectorsize));
strcat(line, "\n");
-   pager_output(line);
+   if (pager_output(line))
+   return 1;
+   res = 0;
if (part->type == PART_FREEBSD) {
/* Open slice with BSD label */
pa->dev->d_offset = part->start;
table = ptable_open(pa->dev, part->end - part->start + 1,
od->sectorsize, ptblread);
if (table == NULL)
-   return;
+   return 0;
sprintf(line, "  %s%s", pa->prefix, pname);
bsd.dev = pa->dev;
bsd.prefix = line;
bsd.verbose = pa->verbose;
-   ptable_iterate(table, , ptable_print);
+   res = ptable_iterate(table, , ptable_print);
ptable_close(table);
}
+
+   return (res);
 }
 #undef PWIDTH
 
-void
+int
 disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
 {
struct open_disk *od;
@@ -229,7 +234,7 @@ disk_print(struct disk_devdesc *dev, cha
pa.dev = dev;
pa.prefix = prefix;
pa.verbose = verbose;
-   ptable_iterate(od->table, , ptable_print);
+   return (ptable_iterate(od->table, , ptable_print));
 }
 
 int

Modified: head/sys/boot/common/disk.h
==
--- head/sys/boot/common/disk.h Wed May 18 05:58:58 2016(r300116)
+++ head/sys/boot/common/disk.h Wed May 18 05:59:05 2016(r300117)
@@ -112,7 +112,7 @@ extern int ptblread(void *d, void *buf, 
 /*
  * Print information about slices on a disk.
  */
-extern void disk_print(struct disk_devdesc *dev, char *prefix, int verbose);
+extern int disk_print(struct disk_devdesc *dev, char *prefix, int verbose);
 extern char* disk_fmtdev(struct disk_devdesc *dev);
 extern int disk_parsedev(struct disk_devdesc *dev, const char *devspec,
 const char **path);

Modified: head/sys/boot/common/module.c
==
--- head/sys/boot/common/module.c   Wed May 18 05:58:58 2016
(r300116)
+++ head/sys/boot/common/module.c   Wed May 18 05:59:05 2016
(r300117)
@@ -277,7 +277,8 @@ command_lsmod(int argc, char *argv[])
if (fp->f_args != NULL) {
pager_output("args: ");
pager_output(fp->f_args);
-   pager_output("\n");
+   if (pager_output("\n"))
+   break;
}
if (fp->f_modules) {
pager_output("  modules: ");
@@ -285,13 +286,15 @@ command_lsmod(int argc, char *argv[])
sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version);
pager_output(lbuf);
}
-   pager_output("\n");
-   }
+   if (pager_output("\n"))
+   break;
+   }
if (verbose) {
/* XXX could add some formatting smarts here to display some better 
*/
for (md = fp->f_metadata; md != NULL; md = md->md_next) {
sprintf(lbuf, "  0x%04x, 

svn commit: r300116 - head/sys/boot/efi/loader

2016-05-17 Thread Warner Losh
Author: imp
Date: Wed May 18 05:58:58 2016
New Revision: 300116
URL: https://svnweb.freebsd.org/changeset/base/300116

Log:
  Fix build breakage on arm64 by papering over the problem. We implement
  a slightly non-standard %S that's more useful in the UEFI environment,
  so ignore printf errors. There's no good cast to use. We'll need to
  revisit this in the future.

Modified:
  head/sys/boot/efi/loader/Makefile

Modified: head/sys/boot/efi/loader/Makefile
==
--- head/sys/boot/efi/loader/Makefile   Wed May 18 05:58:57 2016
(r300115)
+++ head/sys/boot/efi/loader/Makefile   Wed May 18 05:58:58 2016
(r300116)
@@ -31,6 +31,13 @@ CWARNFLAGS.zfs.c+=   -Wno-array-bounds
 CWARNFLAGS.zfs.c+= -Wno-missing-prototypes
 .endif
 
+# We implement a slightly non-stadard %S in that it always takes a
+# CHAR16 that's common in UEFI-land instaed of a wchar_t. This only
+# seems to matter on arm64 where wchar_t defaults to a int instead of
+# a short. There's no good cast to use here, so just ignore the
+# warnings for now.
+CWARNFLAGS.main.c+=-Wno-format
+
 .PATH: ${.CURDIR}/arch/${MACHINE}
 # For smbios.c
 .PATH: ${.CURDIR}/../../i386/libi386
___
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: r300115 - head/sys/boot/forth

2016-05-17 Thread Warner Losh
Author: imp
Date: Wed May 18 05:58:57 2016
New Revision: 300115
URL: https://svnweb.freebsd.org/changeset/base/300115

Log:
  Explain why extra sutff always outputs even when it shouldn't for the
  '?' command. Wasted a bunch of time tracking it down tonight.

Modified:
  head/sys/boot/forth/loader.4th

Modified: head/sys/boot/forth/loader.4th
==
--- head/sys/boot/forth/loader.4th  Wed May 18 05:56:25 2016
(r300114)
+++ head/sys/boot/forth/loader.4th  Wed May 18 05:58:57 2016
(r300115)
@@ -230,6 +230,13 @@ only forth definitions also support-func
 
 : .? 2 spaces 2swap 15 #type 2 spaces type cr ;
 
+\ Execute the ? command to print all the commands defined in
+\ C, then list the ones we support here. Please note that this
+\ doesn't use pager_* routines that the C implementation of ?
+\ does, so these will always appear, even if you stop early
+\ there. And they may cause the commands to scroll off the
+\ screen if the number of commands modulus LINES is close
+\ to LINEs
 : ?
   ['] ? execute
   s" boot-conf" s" load kernel and modules, then autoboot" .?
___
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: r300114 - head/sys/dev/bwn

2016-05-17 Thread Adrian Chadd
Author: adrian
Date: Wed May 18 05:56:25 2016
New Revision: 300114
URL: https://svnweb.freebsd.org/changeset/base/300114

Log:
  [bwn] add initial 5xx firmware API support
  
  * Add the new TX/RX frame formats;
  * Use the right TX/RX format based on the frame info;
  * Disable the 5xx firmware check, since now it should
somewhat work (but note, we don't yet use it unless
you manually add ucode11/initvals11 from the 5.x driver
to bwn-kmod-firmware;
  
  * Misc: update some comments/debugging now I know what's
actually going on.
  
  Tested:
  
  * BCM4321MC, STA mode, both 4xx and 666 firmware, DMA mode
  
  TODO:
  
  * The newer firmware ends up logging "warn: firmware state (0)";
not sure yet what's going on there.  But, yes, it still works.
I'm committing this via a BCM4321MC, 11a station, firmware
rev 666.
  
  Obtained from:Linux b43 (TX/RX descriptor format for 5xx)

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnvar.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Wed May 18 04:35:58 2016(r300113)
+++ head/sys/dev/bwn/if_bwn.c   Wed May 18 05:56:25 2016(r300114)
@@ -1216,14 +1216,12 @@ bwn_attach_core(struct bwn_mac *mac)
}
 
/*
-* XXX turns off PHY A because it's not supported.
-* Implement PHY-A support so we can use it for PHY-G
-* dual-band support.
+* XXX The PHY-G support doesn't do 5GHz operation.
 */
if (mac->mac_phy.type != BWN_PHYTYPE_LP &&
mac->mac_phy.type != BWN_PHYTYPE_N) {
device_printf(sc->sc_dev,
-   "%s: forcing 2GHz only; missing PHY-A support\n",
+   "%s: forcing 2GHz only; no dual-band support for PHY\n",
__func__);
have_a = 0;
have_bg = 1;
@@ -3791,6 +3789,8 @@ bwn_psctl(struct bwn_mac *mac, uint32_t 
DELAY(10);
}
}
+   DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: ucstat=%d\n", __func__,
+   ucstat);
 }
 
 static int
@@ -4186,12 +4186,14 @@ bwn_fw_loaducode(struct bwn_mac *mac)
 * So, complain this is the case and exit out, rather
 * than attaching and then failing.
 */
+#if 0
if (mac->mac_fw.fw_hdr_format == BWN_FW_HDR_598) {
device_printf(sc->sc_dev,
"firmware is too new (>=598); not supported\n");
error = EOPNOTSUPP;
goto error;
}
+#endif
 
mac->mac_fw.patch = bwn_shm_read_2(mac, BWN_SHARED,
BWN_SHARED_UCODE_PATCH);
@@ -5351,7 +5353,17 @@ bwn_dma_rxeof(struct bwn_dma_ring *dr, i
   len, dr->dr_rx_bufsize, cnt);
return;
}
-   macstat = le32toh(rxhdr->mac_status);
+
+   switch (mac->mac_fw.fw_hdr_format) {
+   case BWN_FW_HDR_351:
+   case BWN_FW_HDR_410:
+   macstat = le32toh(rxhdr->ps4.r351.mac_status);
+   break;
+   case BWN_FW_HDR_598:
+   macstat = le32toh(rxhdr->ps4.r598.mac_status);
+   break;
+   }
+
if (macstat & BWN_RX_MAC_FCSERR) {
if (!(mac->mac_sc->sc_filters & BWN_MACCTL_PASS_BADFCS)) {
device_printf(sc->sc_dev, "RX drop\n");
@@ -5452,7 +5464,16 @@ ready:
goto error;
}
 
-   macstat = le32toh(rxhdr.mac_status);
+   switch (mac->mac_fw.fw_hdr_format) {
+   case BWN_FW_HDR_351:
+   case BWN_FW_HDR_410:
+   macstat = le32toh(rxhdr.ps4.r351.mac_status);
+   break;
+   case BWN_FW_HDR_598:
+   macstat = le32toh(rxhdr.ps4.r598.mac_status);
+   break;
+   }
+
if (macstat & BWN_RX_MAC_FCSERR) {
if (!(mac->mac_sc->sc_filters & BWN_MACCTL_PASS_BADFCS)) {
device_printf(sc->sc_dev, "%s: FCS error", __func__);
@@ -5706,11 +5727,25 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
BWN_ASSERT_LOCKED(sc);
 
phystat0 = le16toh(rxhdr->phy_status0);
-   phystat3 = le16toh(rxhdr->phy_status3);
 
-   /* XXX Note: mactime, macstat, chanstat need fixing for fw 598 */
-   macstat = le32toh(rxhdr->mac_status);
-   chanstat = le16toh(rxhdr->channel);
+   /*
+* XXX Note: phy_status3 doesn't exist for HT-PHY; it's only
+* used for LP-PHY.
+*/
+   phystat3 = le16toh(rxhdr->ps3.lp.phy_status3);
+
+   switch (mac->mac_fw.fw_hdr_format) {
+   case BWN_FW_HDR_351:
+   case BWN_FW_HDR_410:
+   macstat = le32toh(rxhdr->ps4.r351.mac_status);
+   chanstat = le16toh(rxhdr->ps4.r351.channel);
+   break;
+   case BWN_FW_HDR_598:
+   macstat = le32toh(rxhdr->ps4.r598.mac_status);
+   chanstat = le16toh(rxhdr->ps4.r598.channel);
+   

Re: svn commit: r300003 - head/share/man/man4

2016-05-17 Thread Glen Barber
On Wed, May 18, 2016 at 09:59:30AM +1000, Greg 'groggy' Lehey wrote:
> I wouldn't have expected such an underhand accusation from you.  I can
> be honest, but if you had taken the time to check, you would have seen
> that I was already eligible.  And clearly if I had wanted to become
> eligible, my commit would have been designed not to draw so much
> attention.
> 

Then let's resort to facts.

gjb@nucleus:~/freebsd/src/base % svn log --search grog \
-rHEAD:'{2013-05-01}' | grep -E '^r[0-9]{5}'
r33 | grog | 2016-05-16 22:40:00 -0600 (Mon, 16 May 2016) | 2 lines
r276434 | peterj | 2014-12-30 17:08:37 -0700 (Tue, 30 Dec 2014) | 14 lines
r276433 | peterj | 2014-12-30 16:52:48 -0700 (Tue, 30 Dec 2014) | 11 lines
r276328 | peterj | 2014-12-28 00:16:48 -0700 (Sun, 28 Dec 2014) | 13 lines
r276327 | peterj | 2014-12-28 00:14:38 -0700 (Sun, 28 Dec 2014) | 13 lines
r275298 | peterj | 2014-11-29 21:50:13 -0700 (Sat, 29 Nov 2014) | 7 lines
r264098 | grog | 2014-04-03 19:48:25 -0600 (Thu, 03 Apr 2014) | 2 lines
r264093 | grog | 2014-04-03 17:22:04 -0600 (Thu, 03 Apr 2014) | 4 lines
r264066 | grog | 2014-04-02 23:49:28 -0600 (Wed, 02 Apr 2014) | 4 lines
r264064 | grog | 2014-04-02 23:48:28 -0600 (Wed, 02 Apr 2014) | 21 lines
r251678 | grog | 2013-06-12 22:11:21 -0600 (Wed, 12 Jun 2013) | 4 lines
r251648 | grog | 2013-06-12 01:53:59 -0600 (Wed, 12 Jun 2013) | 4 lines
r251647 | grog | 2013-06-12 01:52:49 -0600 (Wed, 12 Jun 2013) | 11 lines
r250905 | grog | 2013-05-22 01:52:41 -0600 (Wed, 22 May 2013) | 12 lines
r250799 | grog | 2013-05-18 19:58:00 -0600 (Sat, 18 May 2013) | 4 lines
r250733 | grog | 2013-05-16 21:55:03 -0600 (Thu, 16 May 2013) | 2 lines
r250732 | grog | 2013-05-16 21:52:20 -0600 (Thu, 16 May 2013) | 2 lines

Glen



signature.asc
Description: PGP signature


Re: svn commit: r300110 - head/sys/kern

2016-05-17 Thread NGie Cooper

> On May 17, 2016, at 20:55, Mark Johnston  wrote:
> 
> Author: markj
> Date: Wed May 18 03:55:54 2016
> New Revision: 300110
> URL: https://svnweb.freebsd.org/changeset/base/300110
> 
> Log:
>  Do not acquire the thread lock in hardclock_cnt() unless needed.
> 
>  This function only sets thread flags if a SIGPROF or SIGVTALRM timer
>  has fired, which is almost never the case.
> 
>  MFC after:2 weeks
> 
> Modified:
>  head/sys/kern/kern_clock.c
> 
> Modified: head/sys/kern/kern_clock.c
> ==
> --- head/sys/kern/kern_clock.cWed May 18 03:50:21 2016(r300109)
> +++ head/sys/kern/kern_clock.cWed May 18 03:55:54 2016(r300110)
> @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode)
>flags |= TDF_PROFPEND | TDF_ASTPENDING;
>PROC_ITIMUNLOCK(p);
>}
> -thread_lock(td);
> -td->td_flags |= flags;
> -thread_unlock(td);
> +if (flags != 0) {
> +thread_lock(td);
> +td->td_flags |= flags;
> +thread_unlock(td);
> +}

Use predict_false?
> 
> #ifdefHWPMC_HOOKS
>if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
> 
___
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: r300003 - head/share/man/man4

2016-05-17 Thread Glen Barber
On Wed, May 18, 2016 at 03:13:22PM +1000, Greg 'groggy' Lehey wrote:
> On Tuesday, 17 May 2016 at 21:22:16 -0700, John Baldwin wrote:
> > On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote:
> >>
> >> - People seem to have lost any remnant sense of humour.
> >
> > I think a more accurate commit message might have averted much of
> > the reaction.
> 
> In retrospect, yes.  I hadn't really expected anybody to pay any
> attention.
> 

I think this reply is far worse to the reaction(s) from the original
commit overall.

You "didn't expect anyone to pay attention."  Ridiculous, unnecessary,
and still problematic change aside, this raises a far larger red flag
for me.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r300003 - head/share/man/man4

2016-05-17 Thread Greg 'groggy' Lehey
On Tuesday, 17 May 2016 at 21:22:16 -0700, John Baldwin wrote:
> On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote:
>>
>> - People seem to have lost any remnant sense of humour.
>
> I think a more accurate commit message might have averted much of
> the reaction.

In retrospect, yes.  I hadn't really expected anybody to pay any
attention.

Greg
--
Sent from my desktop computer.
Finger g...@freebsd.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA


signature.asc
Description: PGP signature


svn commit: r300113 - in head/sys: conf kern net sys

2016-05-17 Thread Scott Long
Author: scottl
Date: Wed May 18 04:35:58 2016
New Revision: 300113
URL: https://svnweb.freebsd.org/changeset/base/300113

Log:
  Import the 'iflib' API library for network drivers.  From the author:
  
  "iflib is a library to eliminate the need for frequently duplicated device
  independent logic propagated (poorly) across many network drivers."
  
  Participation is purely optional.  The IFLIB kernel config option is
  provided for drivers that want to transition between legacy and iflib
  modes of operation.  ixl and ixgbe driver conversions will be committed
  shortly.  We hope to see participation from the Broadcom and maybe
  Chelsio drivers in the near future.
  
  Submitted by:   mm...@nextbsd.org
  Reviewed by:gallatin
  Differential Revision:  D5211

Added:
  head/sys/net/ifdi_if.m   (contents, props changed)
  head/sys/net/iflib.c   (contents, props changed)
  head/sys/net/iflib.h   (contents, props changed)
  head/sys/net/mp_ring.c   (contents, props changed)
  head/sys/net/mp_ring.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/kern/device_if.m
  head/sys/kern/kern_mbuf.c
  head/sys/kern/subr_taskqueue.c
  head/sys/net/if.c
  head/sys/net/if_var.h
  head/sys/sys/_task.h
  head/sys/sys/mbuf.h
  head/sys/sys/taskqueue.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed May 18 04:04:14 2016(r300112)
+++ head/sys/conf/files Wed May 18 04:35:58 2016(r300113)
@@ -3523,6 +3523,9 @@ net/if_tun.c  optional tun
 net/if_tap.c   optional tap
 net/if_vlan.c  optional vlan
 net/if_vxlan.c optional vxlan inet | vxlan inet6
+net/ifdi_if.m  optional ether pci
+net/iflib.coptional ether pci
+net/mp_ring.c  optional ether
 net/mppcc.coptional netgraph_mppc_compression
 net/mppcd.coptional netgraph_mppc_compression
 net/netisr.c   standard

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed May 18 04:04:14 2016(r300112)
+++ head/sys/conf/options   Wed May 18 04:35:58 2016(r300113)
@@ -139,6 +139,7 @@ GEOM_VINUM  opt_geom.h
 GEOM_VIRSTOR   opt_geom.h
 GEOM_VOL   opt_geom.h
 GEOM_ZERO  opt_geom.h
+IFLIB  opt_iflib.h
 KDTRACE_HOOKS  opt_global.h
 KDTRACE_FRAME  opt_kdtrace.h
 KN_HASHSIZEopt_kqueue.h

Modified: head/sys/kern/device_if.m
==
--- head/sys/kern/device_if.m   Wed May 18 04:04:14 2016(r300112)
+++ head/sys/kern/device_if.m   Wed May 18 04:35:58 2016(r300113)
@@ -62,6 +62,11 @@ CODE {
{
return 0;
}
+
+   static void * null_register(device_t dev)
+   {
+   return NULL;
+   }
 };

 /**
@@ -316,3 +321,24 @@ METHOD int resume {
 METHOD int quiesce {
device_t dev;
 } DEFAULT null_quiesce;
+
+/**
+ * @brief This is called when the driver is asked to register handlers.
+ *
+ *
+ * To include this method in a device driver, use a line like this
+ * in the driver's method list:
+ *
+ * @code
+ * KOBJMETHOD(device_register, foo_register)
+ * @endcode
+ *
+ * @param dev  the device for which handlers are being registered
+ *
+ * @retval NULL method not implemented
+ * @retval non-NULLa pointer to implementation specific static driver state
+ *
+ */
+METHOD void * register {
+   device_t dev;
+} DEFAULT null_register;

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Wed May 18 04:04:14 2016(r300112)
+++ head/sys/kern/kern_mbuf.c   Wed May 18 04:35:58 2016(r300113)
@@ -444,7 +444,7 @@ mb_dtor_mbuf(void *mem, int size, void *
flags = (unsigned long)arg;
 
KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__));
-   if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(>m_pkthdr.tags))
+   if (!(flags & MB_DTOR_SKIP) && (m->m_flags & M_PKTHDR) && 
!SLIST_EMPTY(>m_pkthdr.tags))
m_tag_delete_chain(m, NULL);
 #ifdef INVARIANTS
trash_dtor(mem, size, arg);

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Wed May 18 04:04:14 2016
(r300112)
+++ head/sys/kern/subr_taskqueue.c  Wed May 18 04:35:58 2016
(r300113)
@@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -62,9 +64,11 @@ struct taskqueue {
STAILQ_HEAD(, task) tq_queue;

Re: svn commit: r300003 - head/share/man/man4

2016-05-17 Thread John Baldwin
On Wednesday, May 18, 2016 09:59:30 AM Greg 'groggy' Lehey wrote:
> Yes.  This wasn't a new change, just reverting a change made in
> r235317.  You'll notice that the expression is in quotes, indicating
> that it's, well, a quotation and not to be taken literally.  And if
> you quote, you should quote correctly.  I stumbled across this by
> accident doing Something Serious, and it grated.

I had read the quotes to mean it was colloquial language, not necessarily a
literary quotation.  Had the commit message said "restore correct quotation"
as similar commits to fortune have used in the past that would have helped
with the context as opposed to "Correct incorrect grammar" and then using a
word that doesn't exist in English.

> What I have learnt from this exchange is:
> 
> - Many Americans don't know the expression, though it's American.

There is quite a bit of literature in the world American and non.

> - Nobody seems to care that the rest of the page is out of date.

Actually not true, but of the things to fix in the manpage, "grown" vs
"growed" isn't exactly the most urgent thing to spend time on.

> - People seem to have lost any remnant sense of humour.

I think a more accurate commit message might have averted much of the
reaction.

-- 
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: r300112 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 04:04:14 2016
New Revision: 300112
URL: https://svnweb.freebsd.org/changeset/base/300112

Log:
  hyperv/vmbus: Function renaming vmbus_msg_swintr -> vmbus_msg_task
  
  It is not an SWI handler for a long time.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6409

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

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:58:04 
2016(r300111)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 04:04:14 
2016(r300112)
@@ -75,7 +75,7 @@ static hv_setup_args setup_args; /* only
 static char *vmbus_ids[] = { "VMBUS", NULL };
 
 static void
-vmbus_msg_swintr(void *arg, int pending __unused)
+vmbus_msg_task(void *arg __unused, int pending __unused)
 {
hv_vmbus_message *msg;
 
@@ -443,7 +443,7 @@ vmbus_bus_init(void)
taskqueue_start_threads_cpuset(_vmbus_g_context.hv_msg_tq[j],
1, PI_NET, _mask, "hvmsg%d", j);
TASK_INIT(_vmbus_g_context.hv_msg_task[j], 0,
-   vmbus_msg_swintr, NULL);
+   vmbus_msg_task, NULL);
 
/*
 * Prepare the per cpu msg and event pages to be called on each 
cpu.
___
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: r300111 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 03:58:04 2016
New Revision: 300111
URL: https://svnweb.freebsd.org/changeset/base/300111

Log:
  hyperv/vmbus: Utilize curcpu
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6408

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

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:55:54 
2016(r300110)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:58:04 
2016(r300111)
@@ -77,11 +77,9 @@ static char *vmbus_ids[] = { "VMBUS", NU
 static void
 vmbus_msg_swintr(void *arg, int pending __unused)
 {
-   int cpu;
hv_vmbus_message *msg;
 
-   cpu = (int)(long)arg;
-   msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[cpu]) +
+   msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[curcpu]) +
HV_VMBUS_MESSAGE_SINT;
for (;;) {
const hv_vmbus_channel_msg_table_entry *entry;
@@ -136,12 +134,10 @@ static inline int
 hv_vmbus_isr(struct trapframe *frame)
 {
struct vmbus_softc *sc = vmbus_get_softc();
-   int cpu;
+   int cpu = curcpu;
hv_vmbus_message *msg;
void *page_addr;
 
-   cpu = PCPU_GET(cpuid);
-
/*
 * The Windows team has advised that we check for events
 * before checking for messages. This is the way they do it
@@ -447,7 +443,7 @@ vmbus_bus_init(void)
taskqueue_start_threads_cpuset(_vmbus_g_context.hv_msg_tq[j],
1, PI_NET, _mask, "hvmsg%d", j);
TASK_INIT(_vmbus_g_context.hv_msg_task[j], 0,
-   vmbus_msg_swintr, (void *)(long)j);
+   vmbus_msg_swintr, NULL);
 
/*
 * Prepare the per cpu msg and event pages to be called on each 
cpu.
___
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: r300110 - head/sys/kern

2016-05-17 Thread Mark Johnston
Author: markj
Date: Wed May 18 03:55:54 2016
New Revision: 300110
URL: https://svnweb.freebsd.org/changeset/base/300110

Log:
  Do not acquire the thread lock in hardclock_cnt() unless needed.
  
  This function only sets thread flags if a SIGPROF or SIGVTALRM timer
  has fired, which is almost never the case.
  
  MFC after:2 weeks

Modified:
  head/sys/kern/kern_clock.c

Modified: head/sys/kern/kern_clock.c
==
--- head/sys/kern/kern_clock.c  Wed May 18 03:50:21 2016(r300109)
+++ head/sys/kern/kern_clock.c  Wed May 18 03:55:54 2016(r300110)
@@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode)
flags |= TDF_PROFPEND | TDF_ASTPENDING;
PROC_ITIMUNLOCK(p);
}
-   thread_lock(td);
-   td->td_flags |= flags;
-   thread_unlock(td);
+   if (flags != 0) {
+   thread_lock(td);
+   td->td_flags |= flags;
+   thread_unlock(td);
+   }
 
 #ifdef HWPMC_HOOKS
if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
___
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: r300108 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 03:50:18 2016
New Revision: 300108
URL: https://svnweb.freebsd.org/changeset/base/300108

Log:
  hyperv/vmbus: Minor white space and style cleanup
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6407

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

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:41:37 
2016(r300107)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:50:18 
2016(r300108)
@@ -74,28 +74,20 @@ static hv_setup_args setup_args; /* only
 
 static char *vmbus_ids[] = { "VMBUS", NULL };
 
-/**
- * @brief Software interrupt thread routine to handle channel messages from
- * the hypervisor.
- */
 static void
 vmbus_msg_swintr(void *arg, int pending __unused)
 {
-   int cpu;
-   void*   page_addr;
-   hv_vmbus_channel_msg_header  *hdr;
-   hv_vmbus_channel_msg_table_entry *entry;
-   hv_vmbus_channel_msg_type msg_type;
-   hv_vmbus_message*   msg;
+   int cpu;
+   hv_vmbus_message *msg;
 
cpu = (int)(long)arg;
-   KASSERT(cpu <= mp_maxid, ("VMBUS: vmbus_msg_swintr: "
-   "cpu out of range!"));
-
-   page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu];
-   msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT;
-
+   msg = ((hv_vmbus_message *)hv_vmbus_g_context.syn_ic_msg_page[cpu]) +
+   HV_VMBUS_MESSAGE_SINT;
for (;;) {
+   const hv_vmbus_channel_msg_table_entry *entry;
+   hv_vmbus_channel_msg_header *hdr;
+   hv_vmbus_channel_msg_type msg_type;
+
if (msg->header.message_type == HV_MESSAGE_TYPE_NONE)
break; /* no message */
 
@@ -108,32 +100,29 @@ vmbus_msg_swintr(void *arg, int pending 
}
 
entry = _channel_message_table[msg_type];
-
if (entry->messageHandler)
entry->messageHandler(hdr);
 handled:
-   msg->header.message_type = HV_MESSAGE_TYPE_NONE;
-
-   /*
-* Make sure the write to message_type (ie set to
-* HV_MESSAGE_TYPE_NONE) happens before we read the
-* message_pending and EOMing. Otherwise, the EOMing will
-* not deliver any more messages
-* since there is no empty slot
-*
-* NOTE:
-* mb() is used here, since atomic_thread_fence_seq_cst()
-* will become compiler fence on UP kernel.
-*/
-   mb();
-
-   if (msg->header.message_flags.u.message_pending) {
+   msg->header.message_type = HV_MESSAGE_TYPE_NONE;
+   /*
+* Make sure the write to message_type (ie set to
+* HV_MESSAGE_TYPE_NONE) happens before we read the
+* message_pending and EOMing. Otherwise, the EOMing will
+* not deliver any more messages
+* since there is no empty slot
+*
+* NOTE:
+* mb() is used here, since atomic_thread_fence_seq_cst()
+* will become compiler fence on UP kernel.
+*/
+   mb();
+   if (msg->header.message_flags.u.message_pending) {
/*
 * This will cause message queue rescan to possibly
 * deliver another msg from the hypervisor
 */
wrmsr(HV_X64_MSR_EOM, 0);
-   }
+   }
}
 }
 
@@ -147,9 +136,9 @@ static inline int
 hv_vmbus_isr(struct trapframe *frame)
 {
struct vmbus_softc *sc = vmbus_get_softc();
-   int cpu;
-   hv_vmbus_message*   msg;
-   void*   page_addr;
+   int cpu;
+   hv_vmbus_message *msg;
+   void *page_addr;
 
cpu = PCPU_GET(cpuid);
 
@@ -162,7 +151,7 @@ hv_vmbus_isr(struct trapframe *frame)
 
/* Check if there are actual msgs to be process */
page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu];
-   msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT;
+   msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_TIMER_SINT;
 
/* we call eventtimer process the message */
if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) {
@@ -193,7 +182,7 @@ hv_vmbus_isr(struct trapframe *frame)
}
}
 
-   msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT;
+   msg = ((hv_vmbus_message *)page_addr) + HV_VMBUS_MESSAGE_SINT;
if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) {
taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu],
  

svn commit: r300109 - head/sys/kern

2016-05-17 Thread Mark Johnston
Author: markj
Date: Wed May 18 03:50:21 2016
New Revision: 300109
URL: https://svnweb.freebsd.org/changeset/base/300109

Log:
  Micro-optimize sleepq_broadcast().
  
  - Avoid a conditional branch on the return value of sleepq_resume_thread()
by ORing its return value into the boolean wakeup_swapper. This is
consistent with other sleepqueue functions which just pass this return
value to their caller.
  - sleepq_resume_thread() unconditionally removes the thread from its queue,
so there's no need to maintain a pointer to the next element in the queue.
  
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/kern/subr_sleepqueue.c
==
--- head/sys/kern/subr_sleepqueue.c Wed May 18 03:50:18 2016
(r300108)
+++ head/sys/kern/subr_sleepqueue.c Wed May 18 03:50:21 2016
(r300109)
@@ -865,7 +865,7 @@ int
 sleepq_broadcast(void *wchan, int flags, int pri, int queue)
 {
struct sleepqueue *sq;
-   struct thread *td, *tdn;
+   struct thread *td;
int wakeup_swapper;
 
CTR2(KTR_PROC, "sleepq_broadcast(%p, %d)", wchan, flags);
@@ -879,10 +879,9 @@ sleepq_broadcast(void *wchan, int flags,
 
/* Resume all blocked threads on the sleep queue. */
wakeup_swapper = 0;
-   TAILQ_FOREACH_SAFE(td, >sq_blocked[queue], td_slpq, tdn) {
+   while ((td = TAILQ_FIRST(>sq_blocked[queue])) != NULL) {
thread_lock(td);
-   if (sleepq_resume_thread(sq, td, pri))
-   wakeup_swapper = 1;
+   wakeup_swapper |= sleepq_resume_thread(sq, td, pri);
thread_unlock(td);
}
return (wakeup_swapper);
___
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: r300107 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 03:41:37 2016
New Revision: 300107
URL: https://svnweb.freebsd.org/changeset/base/300107

Log:
  hyperv/vmbus: Avoid two unnecessary protocol checks on isr handling path
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6405

Modified:
  head/sys/dev/hyperv/vmbus/hv_connection.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 03:34:02 2016
(r300106)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 03:41:37 2016
(r300107)
@@ -289,56 +289,20 @@ hv_vmbus_disconnect(void) {
return (ret);
 }
 
-/**
- * Handler for events
- */
-void
-hv_vmbus_on_events(int cpu)
+static __inline void
+vmbus_event_flags_proc(unsigned long *event_flags, int flag_cnt)
 {
-   unsigned long *intr_flags;
-   hv_vmbus_synic_event_flags *event;
-   void *page_addr;
-   int flag_cnt, f;
-
-   KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: "
-   "cpu out of range!"));
-
-   page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu];
-   event = (hv_vmbus_synic_event_flags *)
-   page_addr + HV_VMBUS_MESSAGE_SINT;
-   if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) ||
-   (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) {
-   flag_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >>
-   HV_CHANNEL_ULONG_SHIFT;
-   /*
-* receive size is 1/2 page and divide that by 4 bytes
-*/
-   if (atomic_testandclear_int(>flags32[0], 0))
-   intr_flags = hv_vmbus_g_connection.recv_interrupt_page;
-   else
-   return;
-   } else {
-   /*
-* On Host with Win8 or above, the event page can be
-* checked directly to get the id of the channel
-* that has the pending interrupt.
-*/
-   flag_cnt = VMBUS_PCPU_GET(event_flag_cnt, cpu);
-   intr_flags = event->flagsul;
-   }
+   int f;
 
-   /*
-* Check events
-*/
-   for (f = 0; f < flag_cnt; f++) {
+   for (f = 0; f < flag_cnt; ++f) {
uint32_t rel_id_base;
unsigned long flags;
int bit;
 
-   if (intr_flags[f] == 0)
+   if (event_flags[f] == 0)
continue;
 
-   flags = atomic_swap_long(_flags[f], 0);
+   flags = atomic_swap_long(_flags[f], 0);
rel_id_base = f << HV_CHANNEL_ULONG_SHIFT;
 
while ((bit = ffsl(flags)) != 0) {
@@ -362,6 +326,37 @@ hv_vmbus_on_events(int cpu)
}
 }
 
+void
+vmbus_event_proc(struct vmbus_softc *sc, int cpu)
+{
+   hv_vmbus_synic_event_flags *event;
+
+   event = ((hv_vmbus_synic_event_flags *)
+   hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT;
+
+   /*
+* On Host with Win8 or above, the event page can be checked directly
+* to get the id of the channel that has the pending interrupt.
+*/
+   vmbus_event_flags_proc(event->flagsul,
+   VMBUS_SC_PCPU_GET(sc, event_flag_cnt, cpu));
+}
+
+void
+vmbus_event_proc_compat(struct vmbus_softc *sc __unused, int cpu)
+{
+   hv_vmbus_synic_event_flags *event;
+
+   event = ((hv_vmbus_synic_event_flags *)
+   hv_vmbus_g_context.syn_ic_event_page[cpu]) + HV_VMBUS_MESSAGE_SINT;
+
+   if (atomic_testandclear_int(>flags32[0], 0)) {
+   vmbus_event_flags_proc(
+   hv_vmbus_g_connection.recv_interrupt_page,
+   HV_MAX_NUM_CHANNELS_SUPPORTED >> HV_CHANNEL_ULONG_SHIFT);
+   }
+}
+
 /**
  * Send a msg on the vmbus's message connection
  */

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:34:02 
2016(r300106)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed May 18 03:41:37 
2016(r300107)
@@ -146,6 +146,7 @@ handled:
 static inline int
 hv_vmbus_isr(struct trapframe *frame)
 {
+   struct vmbus_softc *sc = vmbus_get_softc();
int cpu;
hv_vmbus_message*   msg;
void*   page_addr;
@@ -157,8 +158,7 @@ hv_vmbus_isr(struct trapframe *frame)
 * before checking for messages. This is the way they do it
 * in Windows when running as a guest in Hyper-V
 */
-
-   hv_vmbus_on_events(cpu);
+   sc->vmbus_event_proc(sc, cpu);
 
/* Check 

svn commit: r300106 - in head/sys: conf kern

2016-05-17 Thread Mark Johnston
Author: markj
Date: Wed May 18 03:34:02 2016
New Revision: 300106
URL: https://svnweb.freebsd.org/changeset/base/300106

Log:
  Remove the MUTEX_DEBUG kernel option.
  
  It has no counterpart among the other lock primitives and has been a
  no-op for years. Mutex consistency checks are generally done whenver
  INVARIANTS is enabled.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/kern/kern_mutex.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed May 18 03:28:51 2016(r300105)
+++ head/sys/conf/NOTES Wed May 18 03:34:02 2016(r300106)
@@ -298,7 +298,6 @@ options SX_NOINLINE
 #performance and increase the frequency of kernel panics by
 #design.  If you aren't sure that you need it then you don't.
 #Relies on the PREEMPTION option.  DON'T TURN THIS ON.
-# MUTEX_DEBUG enables various extra assertions in the mutex code.
 # SLEEPQUEUE_PROFILING enables rudimentary profiling of the hash table
 #used to hold active sleep queues as well as sleep wait message
 #frequency.
@@ -314,7 +313,6 @@ options SX_NOINLINE
 # WITNESS_SKIPSPIN disables the witness checks on spin mutexes.
 optionsPREEMPTION
 optionsFULL_PREEMPTION
-optionsMUTEX_DEBUG
 optionsWITNESS
 optionsWITNESS_KDB
 optionsWITNESS_SKIPSPIN

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed May 18 03:28:51 2016(r300105)
+++ head/sys/conf/options   Wed May 18 03:34:02 2016(r300106)
@@ -590,7 +590,6 @@ MAXCPU  opt_global.h
 MAXMEMDOM  opt_global.h
 MAXPHYSopt_global.h
 MCLSHIFT   opt_global.h
-MUTEX_DEBUGopt_global.h
 MUTEX_NOINLINE opt_global.h
 LOCK_PROFILING opt_global.h
 LOCK_PROFILING_FASTopt_global.h

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Wed May 18 03:28:51 2016(r300105)
+++ head/sys/kern/kern_mutex.c  Wed May 18 03:34:02 2016(r300106)
@@ -845,37 +845,6 @@ __mtx_assert(const volatile uintptr_t *c
 #endif
 
 /*
- * The MUTEX_DEBUG-enabled mtx_validate()
- *
- * Most of these checks have been moved off into the LO_INITIALIZED flag
- * maintained by the witness code.
- */
-#ifdef MUTEX_DEBUG
-
-void   mtx_validate(struct mtx *);
-
-void
-mtx_validate(struct mtx *m)
-{
-
-/*
- * XXX: When kernacc() does not require Giant we can reenable this check
- */
-#ifdef notyet
-   /*
-* Can't call kernacc() from early init386(), especially when
-* initializing Giant mutex, because some stuff in kernacc()
-* requires Giant itself.
-*/
-   if (!cold)
-   if (!kernacc((caddr_t)m, sizeof(m),
-   VM_PROT_READ | VM_PROT_WRITE))
-   panic("Can't read and write to mutex %p", m);
-#endif
-}
-#endif
-
-/*
  * General init routine used by the MTX_SYSINIT() macro.
  */
 void
@@ -908,11 +877,6 @@ _mtx_init(volatile uintptr_t *c, const c
("%s: mtx_lock not aligned for %s: %p", __func__, name,
>mtx_lock));
 
-#ifdef MUTEX_DEBUG
-   /* Diagnostic and error correction */
-   mtx_validate(m);
-#endif
-
/* Determine lock class and lock flags. */
if (opts & MTX_SPIN)
class = _class_mtx_spin;
___
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: r300105 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 03:28:51 2016
New Revision: 300105
URL: https://svnweb.freebsd.org/changeset/base/300105

Log:
  hyperv/vmbus: Use atomic swap and flsl to process event flags
  
  Greatly reduce the locked instructions and reduce number of inner loops.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6404

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

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 03:23:07 2016
(r300104)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 03:28:51 2016
(r300105)
@@ -332,32 +332,32 @@ hv_vmbus_on_events(int cpu)
 */
for (f = 0; f < flag_cnt; f++) {
uint32_t rel_id_base;
+   unsigned long flags;
int bit;
 
if (intr_flags[f] == 0)
continue;
 
+   flags = atomic_swap_long(_flags[f], 0);
rel_id_base = f << HV_CHANNEL_ULONG_SHIFT;
-   for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) {
-   if (atomic_testandclear_long(_flags[f], bit)) {
-   struct hv_vmbus_channel *channel;
-   uint32_t rel_id;
-
-   rel_id = rel_id_base + bit;
-   channel =
-   hv_vmbus_g_connection.channels[rel_id];
-
-   /* if channel is closed or closing */
-   if (channel == NULL || channel->rxq == NULL)
-   continue;
-
-   if (channel->batched_reading) {
-   hv_ring_buffer_read_begin(
-   >inbound);
-   }
-   taskqueue_enqueue(channel->rxq,
-   >channel_task);
-   }
+
+   while ((bit = ffsl(flags)) != 0) {
+   struct hv_vmbus_channel *channel;
+   uint32_t rel_id;
+
+   --bit;  /* NOTE: ffsl is 1-based */
+   flags &= ~(1UL << bit);
+
+   rel_id = rel_id_base + bit;
+   channel = hv_vmbus_g_connection.channels[rel_id];
+
+   /* if channel is closed or closing */
+   if (channel == NULL || channel->rxq == NULL)
+   continue;
+
+   if (channel->batched_reading)
+   hv_ring_buffer_read_begin(>inbound);
+   taskqueue_enqueue(channel->rxq, >channel_task);
}
}
 }
___
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: r300104 - head/sys/kern

2016-05-17 Thread Mark Johnston
Author: markj
Date: Wed May 18 03:23:07 2016
New Revision: 300104
URL: https://svnweb.freebsd.org/changeset/base/300104

Log:
  Guard the lockstat:::thread-spin probe with KDTRACE_HOOKS.
  
  X-MFC-With:   r300103

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Wed May 18 03:21:21 2016(r300103)
+++ head/sys/kern/kern_mutex.c  Wed May 18 03:23:07 2016(r300104)
@@ -714,8 +714,10 @@ retry:
LOCK_LOG_LOCK("LOCK", >lock_object, opts, m->mtx_recurse, file,
line);
WITNESS_LOCK(>lock_object, opts | LOP_EXCLUSIVE, file, line);
+#ifdef KDTRACE_HOOKS
if (spin_time != 0)
LOCKSTAT_RECORD1(thread__spin, m, spin_time);
+#endif
 }
 
 struct mtx *
___
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: r300103 - head/sys/kern

2016-05-17 Thread Mark Johnston
Author: markj
Date: Wed May 18 03:21:21 2016
New Revision: 300103
URL: https://svnweb.freebsd.org/changeset/base/300103

Log:
  lockstat:::thread-spin should only fire after spinning for the lock.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Wed May 18 03:19:53 2016(r300102)
+++ head/sys/kern/kern_mutex.c  Wed May 18 03:21:21 2016(r300103)
@@ -714,7 +714,8 @@ retry:
LOCK_LOG_LOCK("LOCK", >lock_object, opts, m->mtx_recurse, file,
line);
WITNESS_LOCK(>lock_object, opts | LOP_EXCLUSIVE, file, line);
-   LOCKSTAT_RECORD1(thread__spin, m, spin_time);
+   if (spin_time != 0)
+   LOCKSTAT_RECORD1(thread__spin, m, spin_time);
 }
 
 struct mtx *
___
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: r300102 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 03:19:53 2016
New Revision: 300102
URL: https://svnweb.freebsd.org/changeset/base/300102

Log:
  hyperv/vmbus: Reduce the # of event loops by recording event flag count
  
  Use vmbus softc to save vmbus per-cpu data.  More stuffs will be moved
  into vmbus softc.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6403

Added:
  head/sys/dev/hyperv/vmbus/vmbus_var.h   (contents, props changed)
Modified:
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_connection.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel.c  Wed May 18 02:59:46 2016
(r300101)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c  Wed May 18 03:19:53 2016
(r300102)
@@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "hv_vmbus_priv.h"
+#include 
+#include 
 
 static int vmbus_channel_create_gpadl_header(
/* must be phys and virt contiguous*/
@@ -199,6 +200,8 @@ hv_vmbus_channel_open(
new_channel->on_channel_callback = pfn_on_channel_callback;
new_channel->channel_callback_context = context;
 
+   vmbus_on_channel_open(new_channel);
+
new_channel->rxq = 
hv_vmbus_g_context.hv_event_queue[new_channel->target_cpu];
TASK_INIT(_channel->channel_task, 0, VmbusProcessChannelEvent, 
new_channel);
 

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 02:59:46 2016
(r300101)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 03:19:53 2016
(r300102)
@@ -38,7 +38,8 @@
 #include 
 #include 
 
-#include "hv_vmbus_priv.h"
+#include 
+#include 
 
 /*
  * Globals
@@ -294,10 +295,10 @@ hv_vmbus_disconnect(void) {
 void
 hv_vmbus_on_events(int cpu)
 {
-   unsigned long *intr_page;
+   unsigned long *intr_flags;
hv_vmbus_synic_event_flags *event;
void *page_addr;
-   int page_cnt, pg;
+   int flag_cnt, f;
 
KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: "
"cpu out of range!"));
@@ -307,13 +308,13 @@ hv_vmbus_on_events(int cpu)
page_addr + HV_VMBUS_MESSAGE_SINT;
if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) ||
(hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) {
-   page_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >>
+   flag_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >>
HV_CHANNEL_ULONG_SHIFT;
/*
 * receive size is 1/2 page and divide that by 4 bytes
 */
if (atomic_testandclear_int(>flags32[0], 0))
-   intr_page = hv_vmbus_g_connection.recv_interrupt_page;
+   intr_flags = hv_vmbus_g_connection.recv_interrupt_page;
else
return;
} else {
@@ -322,23 +323,23 @@ hv_vmbus_on_events(int cpu)
 * checked directly to get the id of the channel
 * that has the pending interrupt.
 */
-   page_cnt = HV_EVENT_FLAGS_ULONG_COUNT;
-   intr_page = event->flagsul;
+   flag_cnt = VMBUS_PCPU_GET(event_flag_cnt, cpu);
+   intr_flags = event->flagsul;
}
 
/*
 * Check events
 */
-   for (pg = 0; pg < page_cnt; pg++) {
+   for (f = 0; f < flag_cnt; f++) {
uint32_t rel_id_base;
int bit;
 
-   if (intr_page[pg] == 0)
+   if (intr_flags[f] == 0)
continue;
 
-   rel_id_base = pg << HV_CHANNEL_ULONG_SHIFT;
+   rel_id_base = f << HV_CHANNEL_ULONG_SHIFT;
for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) {
-   if (atomic_testandclear_long(_page[pg], bit)) {
+   if (atomic_testandclear_long(_flags[f], bit)) {
struct hv_vmbus_channel *channel;
uint32_t rel_id;
 
@@ -412,3 +413,30 @@ hv_vmbus_set_event(hv_vmbus_channel *cha
 
return (ret);
 }
+
+void
+vmbus_on_channel_open(const struct hv_vmbus_channel *chan)
+{
+   volatile int *flag_cnt_ptr;
+   int flag_cnt;
+
+   flag_cnt = (chan->offer_msg.child_rel_id / HV_CHANNEL_ULONG_LEN) + 1;
+   flag_cnt_ptr = VMBUS_PCPU_PTR(event_flag_cnt, chan->target_cpu);
+
+   for (;;) {
+   int old_flag_cnt;
+
+   old_flag_cnt = *flag_cnt_ptr;
+   if (old_flag_cnt >= flag_cnt)
+   break;
+   if (atomic_cmpset_int(flag_cnt_ptr, old_flag_cnt, flag_cnt)) {
+   if 

svn commit: r300101 - head/sys/dev/hyperv/vmbus

2016-05-17 Thread Sepherosa Ziehau
Author: sephe
Date: Wed May 18 02:59:46 2016
New Revision: 300101
URL: https://svnweb.freebsd.org/changeset/base/300101

Log:
  hyperv/vmbus: Use unsigned long for event bits.
  
  And move base channel id calculation out of inner loop.  This prepares
  for more event processing optimization.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6384

Modified:
  head/sys/dev/hyperv/vmbus/hv_connection.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 02:10:05 2016
(r300100)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Wed May 18 02:59:46 2016
(r300101)
@@ -294,13 +294,10 @@ hv_vmbus_disconnect(void) {
 void
 hv_vmbus_on_events(int cpu)
 {
-   int bit;
-   int dword;
-   void *page_addr;
-   uint32_t* recv_interrupt_page = NULL;
-   int rel_id;
-   int maxdword;
+   unsigned long *intr_page;
hv_vmbus_synic_event_flags *event;
+   void *page_addr;
+   int page_cnt, pg;
 
KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: "
"cpu out of range!"));
@@ -310,39 +307,42 @@ hv_vmbus_on_events(int cpu)
page_addr + HV_VMBUS_MESSAGE_SINT;
if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) ||
(hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) {
-   maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5;
+   page_cnt = HV_MAX_NUM_CHANNELS_SUPPORTED >>
+   HV_CHANNEL_ULONG_SHIFT;
/*
 * receive size is 1/2 page and divide that by 4 bytes
 */
-   if (atomic_testandclear_int(>flags32[0], 0)) {
-   recv_interrupt_page =
-   hv_vmbus_g_connection.recv_interrupt_page;
-   } else {
+   if (atomic_testandclear_int(>flags32[0], 0))
+   intr_page = hv_vmbus_g_connection.recv_interrupt_page;
+   else
return;
-   }
} else {
/*
 * On Host with Win8 or above, the event page can be
 * checked directly to get the id of the channel
 * that has the pending interrupt.
 */
-   maxdword = HV_EVENT_FLAGS_DWORD_COUNT;
-   recv_interrupt_page = event->flags32;
+   page_cnt = HV_EVENT_FLAGS_ULONG_COUNT;
+   intr_page = event->flagsul;
}
 
/*
 * Check events
 */
-   for (dword = 0; dword < maxdword; dword++) {
-   if (recv_interrupt_page[dword] == 0)
+   for (pg = 0; pg < page_cnt; pg++) {
+   uint32_t rel_id_base;
+   int bit;
+
+   if (intr_page[pg] == 0)
continue;
 
-   for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) {
-   if (atomic_testandclear_int(
-   _interrupt_page[dword], bit)) {
+   rel_id_base = pg << HV_CHANNEL_ULONG_SHIFT;
+   for (bit = 0; bit < HV_CHANNEL_ULONG_LEN; bit++) {
+   if (atomic_testandclear_long(_page[pg], bit)) {
struct hv_vmbus_channel *channel;
+   uint32_t rel_id;
 
-   rel_id = (dword << 5) + bit;
+   rel_id = rel_id_base + bit;
channel =
hv_vmbus_g_connection.channels[rel_id];
 
@@ -357,7 +357,7 @@ hv_vmbus_on_events(int cpu)
taskqueue_enqueue(channel->rxq,
>channel_task);
}
-   }
+   }
}
 }
 

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Wed May 18 02:10:05 2016
(r300100)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Wed May 18 02:59:46 2016
(r300101)
@@ -57,10 +57,18 @@ typedef uint16_t hv_vmbus_status;
 #define HV_EVENT_FLAGS_COUNT(256 * 8)
 #define HV_EVENT_FLAGS_BYTE_COUNT   (256)
 #define HV_EVENT_FLAGS_DWORD_COUNT  (256 / sizeof(uint32_t))
+#define HV_EVENT_FLAGS_ULONG_COUNT  (256 / sizeof(unsigned long))
 
 /**
  * max channel count <== event_flags_dword_count * bit_of_dword
  */
+#ifdef __LP64__
+#define HV_CHANNEL_ULONG_LEN   (64)
+#define HV_CHANNEL_ULONG_SHIFT (6)
+#else
+#define HV_CHANNEL_ULONG_LEN   (32)
+#define HV_CHANNEL_ULONG_SHIFT (5)
+#endif
 #define HV_CHANNEL_DWORD_LEN(32)
 #define HV_CHANNEL_MAX_COUNT\
((HV_EVENT_FLAGS_DWORD_COUNT) * 

Re: svn commit: r300088 - in releng/9.3: . sys/conf sys/dev/kbd

2016-05-17 Thread Bruce Evans

On Tue, 17 May 2016, Bryan Drewery wrote:


On 5/17/16 4:07 PM, Gleb Smirnoff wrote:

On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote:
B> > Author: glebius
B> > Date: Tue May 17 22:28:36 2016
B> > New Revision: 300088
B> > URL: https://svnweb.freebsd.org/changeset/base/300088
B> >
B> > Log:
B> >   - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
B> >   - Validate that user supplied control message length in sendmsg(2)
B> > is not negative.
B>
B> The sendmsg(2) change is not included here (9.3) nor in the advisory but
B> is in the commit log.  Was it intended to be changed in 9.3?

That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't
apply to 9.x.

B> Plus the only consumer I see is sendit() which seems to be protected
B> already from negative values when not using COMPAT_43:
B>
B> >  if (mp->msg_controllen < sizeof(struct cmsghdr)
B> >  #ifdef COMPAT_OLDSOCK
B> >  && mp->msg_flags != MSG_COMPAT
B> >  #endif
B> >  ) {
B> >  error = EINVAL;
B> >  goto bad;
B> >  }
B> >  error = sockargs(, mp->msg_control,
B> >  mp->msg_controllen, MT_CONTROL);

No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct 
cmsghdr))
both values are unsigned. Later in sockargs() it is treated as signed.


But it is protected (except on exotic unsupported arches).  The above is
a complete bounds check for mp->msg_controllen, written in an obfuscated
way using an unsigned type botch/hack.  Negative values are normally
promoted to large unsigned values, so they fail this check and sockargs()
is never called with them.

On exotic arches, the analysis is more complicated and the hack doesn't
work.  It isn't true in general that both values are unsigned (after
promotion).  E.g., size_t might be uint31_t and int int32_t.  Then the
binary promotions give int for both operands.  Negative values always
pass the bounds check then.

Part of the botch is the design error that sizeof() is unsigned.  This
makes it hard to use.  It poisons nearby signed types worse than const
poisons pointer types.


Ah, I see the (u_int)buflen casts on the older code now.  Thanks.


That is a different way of writing the botch/hack.  It ensures that the
hack works for a left operand that has signed type int or small and a
right operand that is >= 0 and is representable as u_int.  It ensures
that both operands are promoted to u_int, with negative values becoming
large unsigned ones.  I think.  This requires int to not have a very
large negative range.  (u_int)-1 is UINT_MAX, but it isn't so clear
what (u_int)INT_MIN is.  In fact, I think it can by 0 with 31-bit u_int
padded to 32 bits and 32-bit int with INT_MIN = 0x8000.  If this is
allowed, then (u_int)INT_MIN is 0.

The botch/hack should never be used.  Just check for negative values
like sockargs() now does.  But it is probably better to check in the
caller (not using the botch/hack).

I also don't like the change from imin() to min() in kbd.c.  One of
the args is a small integer (MAXFK = 16).  Since this doesn't use
sizeof(), it doesn't encourage an unsigned botch.  The other arg is
'char flen'.  char should never be used for numeric values, but this
is an old API written before int8_t was available.  Using int8_t
instead of simply int might be reasonable packing.  flen seems to
be only initialized once, from .len.  This already gives
undefined behaviour from overflow, since len has type u_char.  The
bounds check should be before this assignment, or just use the same
type.  Using the unsigned botch for len is probably not justified,
but u_char is good for packing.  If the common type is int8_t or
signed char (or plain char to maximise complications),  then a
check that the length >= 0 will be needed later if the table is
under user control.  Perhaps the length needs to be strictly > 0
so you need to check the lower bound even using the unsigned botch.

The packing using chars is actually just at the end.  struct fkeytab
is uchar [16] followed by 1 u_char for 'len' at the end.  4 bytes
would be natural.  On x86, this gives a 17-byte struct which gives
a bad layout in arrays, and on other arches it gives portaility
problems.  struct fkeyarg is u_short, then char [16], then 1 char
for 'flen' at the end.  2 bytes would be natural.

Bruce
___
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: r300100 - head/sys/dev/ntb/ntb_hw

2016-05-17 Thread Conrad E. Meyer
Author: cem
Date: Wed May 18 02:10:05 2016
New Revision: 300100
URL: https://svnweb.freebsd.org/changeset/base/300100

Log:
  ntb_hw(4): Add sysctls for administrative/test link config, state
  
  dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN.
  dev.ntb_hw.0.active=0/1:   Like ifconfig 'status'
  
  Reviewed by:  ngie
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D6429

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

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw.cWed May 18 00:33:08 2016
(r300099)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.cWed May 18 02:10:05 2016
(r300100)
@@ -364,6 +364,8 @@ static bool ntb_poll_link(struct ntb_sof
 static void save_bar_parameters(struct ntb_pci_bar_info *bar);
 static void ntb_sysctl_init(struct ntb_softc *);
 static int sysctl_handle_features(SYSCTL_HANDLER_ARGS);
+static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS);
+static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_register(SYSCTL_HANDLER_ARGS);
 
@@ -2132,6 +2134,8 @@ ntb_link_enable(struct ntb_softc *ntb, e
 {
uint32_t cntl;
 
+   ntb_printf(2, "%s\n", __func__);
+
if (ntb->type == NTB_ATOM) {
pci_write_config(ntb->device, NTB_PPD_OFFSET,
ntb->ppd | ATOM_PPD_INIT_LINK, 4);
@@ -2170,6 +2174,8 @@ ntb_link_disable(struct ntb_softc *ntb)
 {
uint32_t cntl;
 
+   ntb_printf(2, "%s\n", __func__);
+
if (ntb->conn_type == NTB_CONN_TRANSPARENT) {
ntb_link_event(ntb);
return (0);
@@ -2185,6 +2191,23 @@ ntb_link_disable(struct ntb_softc *ntb)
return (0);
 }
 
+bool
+ntb_link_enabled(struct ntb_softc *ntb)
+{
+   uint32_t cntl;
+
+   if (ntb->type == NTB_ATOM) {
+   cntl = pci_read_config(ntb->device, NTB_PPD_OFFSET, 4);
+   return ((cntl & ATOM_PPD_INIT_LINK) != 0);
+   }
+
+   if (ntb->conn_type == NTB_CONN_TRANSPARENT)
+   return (true);
+
+   cntl = ntb_reg_read(4, ntb->reg->ntb_ctl);
+   return ((cntl & NTB_CNTL_LINK_DISABLE) == 0);
+}
+
 static void
 recover_atom_link(void *arg)
 {
@@ -2304,16 +2327,26 @@ SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_inf
 static void
 ntb_sysctl_init(struct ntb_softc *ntb)
 {
-   struct sysctl_oid_list *tree_par, *regpar, *statpar, *errpar;
+   struct sysctl_oid_list *globals, *tree_par, *regpar, *statpar, *errpar;
struct sysctl_ctx_list *ctx;
struct sysctl_oid *tree, *tmptree;
 
ctx = device_get_sysctl_ctx(ntb->device);
+   globals = SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device));
 
-   tree = SYSCTL_ADD_NODE(ctx,
-   SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)), OID_AUTO,
-   "debug_info", CTLFLAG_RD, NULL,
-   "Driver state, statistics, and HW registers");
+   SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "link_status",
+   CTLFLAG_RD | CTLTYPE_STRING, ntb, 0,
+   sysctl_handle_link_status_human, "A",
+   "Link status (human readable)");
+   SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "active",
+   CTLFLAG_RD | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_status,
+   "IU", "Link status (1=active, 0=inactive)");
+   SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "admin_up",
+   CTLFLAG_RW | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_admin,
+   "IU", "Set/get interface status (1=UP, 0=DOWN)");
+
+   tree = SYSCTL_ADD_NODE(ctx, globals, OID_AUTO, "debug_info",
+   CTLFLAG_RD, NULL, "Driver state, statistics, and HW registers");
tree_par = SYSCTL_CHILDREN(tree);
 
SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD,
@@ -2343,10 +2376,6 @@ ntb_sysctl_init(struct ntb_softc *ntb)
__DEVOLATILE(uint32_t *, >lnk_sta), 0,
"LNK STA register (cached)");
 
-   SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status",
-   CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status,
-   "A", "Link status");
-
SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "mw_count", CTLFLAG_RD,
>mw_count, 0, "MW count");
SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "spad_count", CTLFLAG_RD,
@@ -2592,7 +2621,37 @@ sysctl_handle_features(SYSCTL_HANDLER_AR
 }
 
 static int
-sysctl_handle_link_status(SYSCTL_HANDLER_ARGS)
+sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS)
+{
+   struct ntb_softc *ntb;
+   unsigned old, new;
+   int error;
+
+   error = 0;
+   ntb = arg1;
+
+   old = ntb_link_enabled(ntb);
+
+   error = SYSCTL_OUT(req, , sizeof(old));
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+
+   error = SYSCTL_IN(req, , sizeof(new));
+   if 

Re: svn commit: r300098 - head/usr.sbin/makefs

2016-05-17 Thread Ed Maste
On 18 May 2016 at 00:22, Pedro F. Giffuni  wrote:
> Author: pfg
> Date: Wed May 18 00:22:52 2016
> New Revision: 300098
> URL: https://svnweb.freebsd.org/changeset/base/300098
>
> Log:
>   makefs(8): Clarify the comment concerning seeding.
>
>   Avoid giving the impression makefs currently supports reproduceable
>   builds.

Thanks!

It might make sense to seed based on SOURCE_DATE_EPOCH
(https://reproducible-builds.org/specs/source-date-epoch/) if set, and
later on we ought to add an option to set the seed on the command
line.

But, there are a lot of other reproducible build tasks that are
probably more important to tackle before this.
___
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: r300099 - stable/10/sbin/fsck_msdosfs

2016-05-17 Thread Pedro F. Giffuni
Author: pfg
Date: Wed May 18 00:33:08 2016
New Revision: 300099
URL: https://svnweb.freebsd.org/changeset/base/300099

Log:
  MFC r299089:
  fsck_msdosfs: Adjust a check.
  
  The on-disk FAT array does not include anything before CLUST_FIRST,
  compensate in size check.
  
  Obtained from:NetBSD (CVS Rev. 1.20)

Modified:
  stable/10/sbin/fsck_msdosfs/boot.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/fsck_msdosfs/boot.c
==
--- stable/10/sbin/fsck_msdosfs/boot.c  Wed May 18 00:22:52 2016
(r300098)
+++ stable/10/sbin/fsck_msdosfs/boot.c  Wed May 18 00:33:08 2016
(r300099)
@@ -221,7 +221,7 @@ readboot(int dosfs, struct bootblock *bo
break;
}
 
-   if (boot->NumFatEntries < boot->NumClusters) {
+   if (boot->NumFatEntries < boot->NumClusters - CLUST_FIRST) {
pfatal("FAT size too small, %u entries won't fit into %u 
sectors\n",
   boot->NumClusters, boot->FATsecs);
return FSFATAL;
___
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: r300098 - head/usr.sbin/makefs

2016-05-17 Thread Pedro F. Giffuni
Author: pfg
Date: Wed May 18 00:22:52 2016
New Revision: 300098
URL: https://svnweb.freebsd.org/changeset/base/300098

Log:
  makefs(8): Clarify the comment concerning seeding.
  
  Avoid giving the impression makefs currently supports reproduceable
  builds.

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Tue May 17 23:15:16 2016(r300097)
+++ head/usr.sbin/makefs/ffs.c  Wed May 18 00:22:52 2016(r300098)
@@ -1125,7 +1125,10 @@ ffs_write_inode(union dinode *dp, uint32
initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
memset(buf, 0, fs->fs_bsize);
dip = (struct ufs2_dinode *)buf;
-   /* Seeding affects reproducible builds. */
+   /*
+* XXX: Time-based seeds should be avoided for
+* reproduceable builds.
+*/
srandom(time(NULL));
for (i = 0; i < INOPB(fs); i++) {
dip->di_gen = random();
___
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: r300003 - head/share/man/man4

2016-05-17 Thread Greg 'groggy' Lehey
On Tuesday, 17 May 2016 at 12:05:09 -0400, George Neville-Neil wrote:
> On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote:
>> On Tuesday, 17 May 2016 at  0:04:51 -0700, John Baldwin wrote:
>>> On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote:
 Author: grog
 Date: Tue May 17 04:40:00 2016
 New Revision: 33
 URL: https://svnweb.freebsd.org/changeset/base/33

 Log:
   Correct use of incorrect grammar.

  .Pp
  The debugging macros
 -.Dq "just grown" .
 +.Dq "just growed" .
>>>
>>> "grew"?
>>
>> "Just growed".  Did you never read Uncle Tom's Cabin?  Check Topsy.
>>
>> Of course, what this page really needs is a good overhaul.  I'll see
>> if I can muster the energy.
>
> Can you just be honest and admit that this is a trivial commit to
> you can vote in the core elections?

No.

I wouldn't have expected such an underhand accusation from you.  I can
be honest, but if you had taken the time to check, you would have seen
that I was already eligible.  And clearly if I had wanted to become
eligible, my commit would have been designed not to draw so much
attention.

> And Seriously?

Yes.  This wasn't a new change, just reverting a change made in
r235317.  You'll notice that the expression is in quotes, indicating
that it's, well, a quotation and not to be taken literally.  And if
you quote, you should quote correctly.  I stumbled across this by
accident doing Something Serious, and it grated.

"Just growed" was in this man page from its first commit until
2003-12-30 until 2012-5-12.  According to the commit log, the original
was reviewed by jkoshy, des, gallatin and njl.

> Uncle Toms Cabin?

To be fair, I didn't know where it came from either.  I only
discovered that when searching for the origin of this expression,
which until yesterday I had thought well-known.

What I have learnt from this exchange is:

- Many Americans don't know the expression, though it's American.
- Nobody seems to care that the rest of the page is out of date.
- People seem to have lost any remnant sense of humour.
- You still can't tune a fish.
- The bikeshed is blue.

Greg
--
Sent from my desktop computer.
Finger g...@freebsd.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA


signature.asc
Description: PGP signature


svn commit: r300097 - head/sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 23:15:16 2016
New Revision: 300097
URL: https://svnweb.freebsd.org/changeset/base/300097

Log:
  Add a comment and KASSERT that a M_NOFREE mbuf has always EXT_EXTREF ext.
  
  Submitted by: kmacy

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Tue May 17 23:14:17 2016(r300096)
+++ head/sys/kern/kern_mbuf.c   Tue May 17 23:15:16 2016(r300097)
@@ -638,9 +638,16 @@ mb_free_ext(struct mbuf *m)
 * Check if the header is embedded in the cluster.  It is
 * important that we can't touch any of the mbuf fields
 * after we have freed the external storage, since mbuf
-* could have been embedded in it.
+* could have been embedded in it.  For now, the mbufs
+* embedded into the cluster are always of type EXT_EXTREF,
+* and for this type we won't free the mref.
 */
-   freembuf = (m->m_flags & M_NOFREE) ? 0 : 1;
+   if (m->m_flags & M_NOFREE) {
+   freembuf = 0;
+   KASSERT(m->m_ext.ext_type == EXT_EXTREF,
+   ("%s: no-free mbuf %p has wrong type", __func__, m));
+   } else
+   freembuf = 1;
 
/* Free attached storage if this mbuf is the only reference to it. */
if (*refcnt == 1 || atomic_fetchadd_int(refcnt, -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: r300096 - head/sys/netinet

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 23:14:17 2016
New Revision: 300096
URL: https://svnweb.freebsd.org/changeset/base/300096

Log:
  Tiny refactor of r294869/r296881: use defines to mask the VNET() macro.
  
  Suggested by: bz

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue May 17 22:52:42 2016
(r300095)
+++ head/sys/netinet/tcp_input.cTue May 17 23:14:17 2016
(r300096)
@@ -250,7 +250,7 @@ static void
 tcp_vnet_init(const void *unused)
 {
 
-   COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK);
+   COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK);
VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK);
 }
 VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
@@ -261,7 +261,7 @@ static void
 tcp_vnet_uninit(const void *unused)
 {
 
-   COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES);
+   COUNTER_ARRAY_FREE(V_tcps_states, TCP_NSTATES);
VNET_PCPUSTAT_FREE(tcpstat);
 }
 VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Tue May 17 22:52:42 2016(r300095)
+++ head/sys/netinet/tcp_subr.c Tue May 17 23:14:17 2016(r300096)
@@ -1642,7 +1642,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
 */
if (req->oldptr == NULL) {
n = V_tcbinfo.ipi_count +
-   counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]);
+   counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]);
n += imax(n / 8, 10);
req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb);
return (0);
@@ -1659,7 +1659,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
n = V_tcbinfo.ipi_count;
INP_LIST_RUNLOCK(_tcbinfo);
 
-   m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]);
+   m = counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]);
 
error = sysctl_wire_old_buffer(req, 2 * (sizeof xig)
+ (n + m) * sizeof(struct xtcpcb));

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Tue May 17 22:52:42 2016(r300095)
+++ head/sys/netinet/tcp_var.h  Tue May 17 23:14:17 2016(r300096)
@@ -629,8 +629,9 @@ voidkmod_tcpstat_inc(int statnum);
  * Running TCP connection count by state.
  */
 VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]);
-#defineTCPSTATES_INC(state)
counter_u64_add(VNET(tcps_states)[state], 1)
-#defineTCPSTATES_DEC(state)
counter_u64_add(VNET(tcps_states)[state], -1)
+#defineV_tcps_states   VNET(tcps_states)
+#defineTCPSTATES_INC(state)counter_u64_add(V_tcps_states[state], 1)
+#defineTCPSTATES_DEC(state)counter_u64_add(V_tcps_states[state], 
-1)
 
 /*
  * TCP specific helper hook point identifiers.
___
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: r300088 - in releng/9.3: . sys/conf sys/dev/kbd

2016-05-17 Thread Bryan Drewery
On 5/17/16 4:07 PM, Gleb Smirnoff wrote:
> On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote:
> B> > Author: glebius
> B> > Date: Tue May 17 22:28:36 2016
> B> > New Revision: 300088
> B> > URL: https://svnweb.freebsd.org/changeset/base/300088
> B> > 
> B> > Log:
> B> >   - Use unsigned version of min() when handling arguments of SETFKEY 
> ioctl.
> B> >   - Validate that user supplied control message length in sendmsg(2)
> B> > is not negative.
> B> 
> B> The sendmsg(2) change is not included here (9.3) nor in the advisory but
> B> is in the commit log.  Was it intended to be changed in 9.3?
> 
> That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't
> apply to 9.x.
> 
> B> Plus the only consumer I see is sendit() which seems to be protected
> B> already from negative values when not using COMPAT_43:
> B> 
> B> >  if (mp->msg_controllen < sizeof(struct cmsghdr)
> B> >  #ifdef COMPAT_OLDSOCK
> B> >  && mp->msg_flags != MSG_COMPAT
> B> >  #endif
> B> >  ) {
> B> >  error = EINVAL;
> B> >  goto bad;
> B> >  }
> B> >  error = sockargs(, mp->msg_control,
> B> >  mp->msg_controllen, MT_CONTROL);
> 
> No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct 
> cmsghdr))
> both values are unsigned. Later in sockargs() it is treated as signed.

Ah, I see the (u_int)buflen casts on the older code now.  Thanks.

-- 
Regards,
Bryan Drewery
___
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: r300088 - in releng/9.3: . sys/conf sys/dev/kbd

2016-05-17 Thread Gleb Smirnoff
On Tue, May 17, 2016 at 03:59:26PM -0700, Bryan Drewery wrote:
B> > Author: glebius
B> > Date: Tue May 17 22:28:36 2016
B> > New Revision: 300088
B> > URL: https://svnweb.freebsd.org/changeset/base/300088
B> > 
B> > Log:
B> >   - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
B> >   - Validate that user supplied control message length in sendmsg(2)
B> > is not negative.
B> 
B> The sendmsg(2) change is not included here (9.3) nor in the advisory but
B> is in the commit log.  Was it intended to be changed in 9.3?

That was my failure to mention SA-16:19 in commit message for 9.3. It doesn't
apply to 9.x.

B> Plus the only consumer I see is sendit() which seems to be protected
B> already from negative values when not using COMPAT_43:
B> 
B> >  if (mp->msg_controllen < sizeof(struct cmsghdr)
B> >  #ifdef COMPAT_OLDSOCK
B> >  && mp->msg_flags != MSG_COMPAT
B> >  #endif
B> >  ) {
B> >  error = EINVAL;
B> >  goto bad;
B> >  }
B> >  error = sockargs(, mp->msg_control,
B> >  mp->msg_controllen, MT_CONTROL);

No, it isn't protected. In the comparison (mp->msg_controllen < sizeof(struct 
cmsghdr))
both values are unsigned. Later in sockargs() it is treated as signed.

-- 
Totus tuus, Glebius.
___
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: r300088 - in releng/9.3: . sys/conf sys/dev/kbd

2016-05-17 Thread Bryan Drewery
On 5/17/2016 3:28 PM, Gleb Smirnoff wrote:
> Author: glebius
> Date: Tue May 17 22:28:36 2016
> New Revision: 300088
> URL: https://svnweb.freebsd.org/changeset/base/300088
> 
> Log:
>   - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
>   - Validate that user supplied control message length in sendmsg(2)
> is not negative.

The sendmsg(2) change is not included here (9.3) nor in the advisory but
is in the commit log.  Was it intended to be changed in 9.3?

Plus the only consumer I see is sendit() which seems to be protected
already from negative values when not using COMPAT_43:

>  if (mp->msg_controllen < sizeof(struct cmsghdr)
>  #ifdef COMPAT_OLDSOCK
>  && mp->msg_flags != MSG_COMPAT
>  #endif
>  ) {
>  error = EINVAL;
>  goto bad;
>  }
>  error = sockargs(, mp->msg_control,
>  mp->msg_controllen, MT_CONTROL);

...

>   
>   Security:   SA-16:18
>   Security:   CVE-2016-1886
>   Security:   SA-16:19
>   Security:   CVE-2016-1887
>   Submitted by:   C Turt 
>   Approved by:so
> 
> Modified:
>   releng/9.3/UPDATING
>   releng/9.3/sys/conf/newvers.sh
>   releng/9.3/sys/dev/kbd/kbd.c
> 
> Modified: releng/9.3/UPDATING
> ==
> --- releng/9.3/UPDATING   Tue May 17 22:28:27 2016(r300087)
> +++ releng/9.3/UPDATING   Tue May 17 22:28:36 2016(r300088)
> @@ -11,6 +11,10 @@ handbook:
>  Items affecting the ports and packages system can be found in
>  /usr/ports/UPDATING.  Please read that file before running portupgrade.
>  
> +20160517 p42 FreeBSD-SA-16:18.atkbd
> +
> + Fix buffer overflow in keyboard driver. [SA-16:18]
> +
>  20160504 p41 FreeBSD-SA-16:17.openssl
>   FreeBSD-EN-16:08.zfs
>  
> 
> Modified: releng/9.3/sys/conf/newvers.sh
> ==
> --- releng/9.3/sys/conf/newvers.shTue May 17 22:28:27 2016
> (r300087)
> +++ releng/9.3/sys/conf/newvers.shTue May 17 22:28:36 2016
> (r300088)
> @@ -32,7 +32,7 @@
>  
>  TYPE="FreeBSD"
>  REVISION="9.3"
> -BRANCH="RELEASE-p41"
> +BRANCH="RELEASE-p42"
>  if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
>   BRANCH=${BRANCH_OVERRIDE}
>  fi
> 
> Modified: releng/9.3/sys/dev/kbd/kbd.c
> ==
> --- releng/9.3/sys/dev/kbd/kbd.c  Tue May 17 22:28:27 2016
> (r300087)
> +++ releng/9.3/sys/dev/kbd/kbd.c  Tue May 17 22:28:36 2016
> (r300088)
> @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
>   splx(s);
>   return (error);
>   }
> - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
> + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
>   bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
>   kbd->kb_fkeytab[fkeyp->keynum].len);
>   break;
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r300095 - head/sys/kern

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 22:52:42 2016
New Revision: 300095
URL: https://svnweb.freebsd.org/changeset/base/300095

Log:
  Don't forget to quote \ characters with \.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cTue May 17 22:41:49 2016(r300094)
+++ head/sys/kern/subr_bus.cTue May 17 22:52:42 2016(r300095)
@@ -862,7 +862,7 @@ devctl_safe_quote(char *dst, const char 
return;
while (src != NULL && walker < ep)
{
-   if (*src == '"') {
+   if (*src == '"' || *src == '\\') {
if (ep - walker < 2)
break;
*walker++ = '\\';
___
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: r299994 - in head/sys/mips: broadcom conf

2016-05-17 Thread Adrian Chadd
Yeah, I think it's part of another commit. I'll go bug the submitter
and find which patch it's sitting in.

Ah, the downsides of trying to do things with phabricator and git,
with individual reviews for each piece


-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"


Re: svn commit: r299994 - in head/sys/mips: broadcom conf

2016-05-17 Thread Adrian Chadd
lemme go see what's missing..



-a


On 17 May 2016 at 10:48, Bjoern A. Zeeb  wrote:
>
>> On 17 May 2016, at 00:00 , Adrian Chadd  wrote:
>>
>> Author: adrian
>> Date: Tue May 17 00:00:01 2016
>> New Revision: 24
>> URL: https://svnweb.freebsd.org/changeset/base/24
>>
>> Log:
>>  [mips/broadcom] Add initial support for Broadcom MIPS processor
>>
>>  Relies on BHND(4) driver.
>>
>>  There files contains machine-dependent code for Broadcom MIPS processor and
>>  provide UART driver.
>>
>>  This is a work in progress; it and the current bhnd code is enough to boot
>>  on the ASUS RT-N16 and RT-N53 platforms.
>>
>>  Submitted by:Michael Zhilin 
>>  Differential Revision:   https://reviews.freebsd.org/D6251
>>
>> Added:
>>  head/sys/mips/broadcom/bcm_machdep.c   (contents, props changed)
>>  head/sys/mips/broadcom/bcm_socinfo.c   (contents, props changed)
>>  head/sys/mips/broadcom/bcm_socinfo.h   (contents, props changed)
>>  head/sys/mips/broadcom/files.broadcom   (contents, props changed)
>>  head/sys/mips/broadcom/std.broadcom   (contents, props changed)
>>  head/sys/mips/broadcom/uart_bus_chipc.c   (contents, props changed)
>>  head/sys/mips/broadcom/uart_cpu_chipc.c   (contents, props changed)
>>  head/sys/mips/conf/BCM   (contents, props changed)
>>  head/sys/mips/conf/BCM.hints   (contents, props changed)
>
> Seems you missed a file..
>
> bz@zoo:/tank/users/bz/head.svn% grep -r bcma_nexus.c sys/
> sys/mips/broadcom/files.broadcom:dev/bhnd/bcma/bcma_nexus.c 
> standard
> bz@zoo:/tank/users/bz/head.svn% find sys/ -name bcma_nexus.c
> bz@zoo:/tank/users/bz/head.svn%
>
> /bz
>
>
> —
> Bjoern A. Zeeb  Charles Haddon Spurgeon:
> "Friendship is one of the sweetest joys of life.  Many might have failed
>  beneath the bitterness of their trial  had they not found a friend."
>
___
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: r300093 - stable/9/sys/dev/kbd

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:31:12 2016
New Revision: 300093
URL: https://svnweb.freebsd.org/changeset/base/300093

Log:
  Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  
  Submitted by: C Turt 
  Security: SA-16:18
  Security: CVE-2016-1886

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

Modified: stable/9/sys/dev/kbd/kbd.c
==
--- stable/9/sys/dev/kbd/kbd.c  Tue May 17 22:30:43 2016(r300092)
+++ stable/9/sys/dev/kbd/kbd.c  Tue May 17 22:31:12 2016(r300093)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;
___
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: r300092 - stable/10/sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:30:43 2016
New Revision: 300092
URL: https://svnweb.freebsd.org/changeset/base/300092

Log:
  Validate that user supplied control message length is not negative.
  
  Submitted by: C Turt 
  Security: SA-16:19
  Security: CVE-2016-1887

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

Modified: stable/10/sys/kern/uipc_syscalls.c
==
--- stable/10/sys/kern/uipc_syscalls.c  Tue May 17 22:29:59 2016
(r300091)
+++ stable/10/sys/kern/uipc_syscalls.c  Tue May 17 22:30:43 2016
(r300092)
@@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
 
+   if (buflen < 0)
+   return (EINVAL);
+
if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
___
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: r300091 - stable/10/sys/dev/kbd

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:29:59 2016
New Revision: 300091
URL: https://svnweb.freebsd.org/changeset/base/300091

Log:
  Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  
  Submitted by: C Turt 
  Security: SA-16:18
  Security: CVE-2016-1886

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

Modified: stable/10/sys/dev/kbd/kbd.c
==
--- stable/10/sys/dev/kbd/kbd.c Tue May 17 22:28:53 2016(r300090)
+++ stable/10/sys/dev/kbd/kbd.c Tue May 17 22:29:59 2016(r300091)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;
___
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: r300090 - head/sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:53 2016
New Revision: 300090
URL: https://svnweb.freebsd.org/changeset/base/300090

Log:
  Validate that user supplied control message length is not negative.
  
  Submitted by: C Turt 
  Security: SA-16:19
  Security: CVE-2016-1887

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue May 17 22:28:42 2016
(r300089)
+++ head/sys/kern/uipc_syscalls.c   Tue May 17 22:28:53 2016
(r300090)
@@ -1699,6 +1699,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
 
+   if (buflen < 0)
+   return (EINVAL);
+
if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
___
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: r300089 - head/sys/dev/kbd

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:42 2016
New Revision: 300089
URL: https://svnweb.freebsd.org/changeset/base/300089

Log:
  Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  
  Submitted by: C Turt 
  Security: SA-16:18
  Security: CVE-2016-1886

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

Modified: head/sys/dev/kbd/kbd.c
==
--- head/sys/dev/kbd/kbd.c  Tue May 17 22:28:36 2016(r300088)
+++ head/sys/dev/kbd/kbd.c  Tue May 17 22:28:42 2016(r300089)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;
___
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: r300087 - in releng/10.3: . sys/conf sys/dev/kbd sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:27 2016
New Revision: 300087
URL: https://svnweb.freebsd.org/changeset/base/300087

Log:
  - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  - Validate that user supplied control message length in sendmsg(2)
is not negative.
  
  Security: SA-16:18
  Security: CVE-2016-1886
  Security: SA-16:19
  Security: CVE-2016-1887
  Submitted by: C Turt 
  Approved by:  so

Modified:
  releng/10.3/UPDATING
  releng/10.3/sys/conf/newvers.sh
  releng/10.3/sys/dev/kbd/kbd.c
  releng/10.3/sys/kern/uipc_syscalls.c

Modified: releng/10.3/UPDATING
==
--- releng/10.3/UPDATINGTue May 17 22:28:20 2016(r300086)
+++ releng/10.3/UPDATINGTue May 17 22:28:27 2016(r300087)
@@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160517   p3  FreeBSD-SA-16:18.atkbd
+   FreeBSD-SA-16:19.sendmsg
+
+   Fix buffer overflow in keyboard driver. [SA-16:18]
+
+   Fix incorrect argument handling in sendmsg(2). [SA-16:19]
+
 20160504   p2  FreeBSD-SA-16:17.openssl
FreeBSD-EN-16:06.libc
FreeBSD-EN-16:07.ipi

Modified: releng/10.3/sys/conf/newvers.sh
==
--- releng/10.3/sys/conf/newvers.sh Tue May 17 22:28:20 2016
(r300086)
+++ releng/10.3/sys/conf/newvers.sh Tue May 17 22:28:27 2016
(r300087)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.3"
-BRANCH="RELEASE-p2"
+BRANCH="RELEASE-p3"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.3/sys/dev/kbd/kbd.c
==
--- releng/10.3/sys/dev/kbd/kbd.c   Tue May 17 22:28:20 2016
(r300086)
+++ releng/10.3/sys/dev/kbd/kbd.c   Tue May 17 22:28:27 2016
(r300087)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;

Modified: releng/10.3/sys/kern/uipc_syscalls.c
==
--- releng/10.3/sys/kern/uipc_syscalls.cTue May 17 22:28:20 2016
(r300086)
+++ releng/10.3/sys/kern/uipc_syscalls.cTue May 17 22:28:27 2016
(r300087)
@@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
 
+   if (buflen < 0)
+   return (EINVAL);
+
if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
___
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: r300088 - in releng/9.3: . sys/conf sys/dev/kbd

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:36 2016
New Revision: 300088
URL: https://svnweb.freebsd.org/changeset/base/300088

Log:
  - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  - Validate that user supplied control message length in sendmsg(2)
is not negative.
  
  Security: SA-16:18
  Security: CVE-2016-1886
  Security: SA-16:19
  Security: CVE-2016-1887
  Submitted by: C Turt 
  Approved by:  so

Modified:
  releng/9.3/UPDATING
  releng/9.3/sys/conf/newvers.sh
  releng/9.3/sys/dev/kbd/kbd.c

Modified: releng/9.3/UPDATING
==
--- releng/9.3/UPDATING Tue May 17 22:28:27 2016(r300087)
+++ releng/9.3/UPDATING Tue May 17 22:28:36 2016(r300088)
@@ -11,6 +11,10 @@ handbook:
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20160517   p42 FreeBSD-SA-16:18.atkbd
+
+   Fix buffer overflow in keyboard driver. [SA-16:18]
+
 20160504   p41 FreeBSD-SA-16:17.openssl
FreeBSD-EN-16:08.zfs
 

Modified: releng/9.3/sys/conf/newvers.sh
==
--- releng/9.3/sys/conf/newvers.sh  Tue May 17 22:28:27 2016
(r300087)
+++ releng/9.3/sys/conf/newvers.sh  Tue May 17 22:28:36 2016
(r300088)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.3"
-BRANCH="RELEASE-p41"
+BRANCH="RELEASE-p42"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/9.3/sys/dev/kbd/kbd.c
==
--- releng/9.3/sys/dev/kbd/kbd.cTue May 17 22:28:27 2016
(r300087)
+++ releng/9.3/sys/dev/kbd/kbd.cTue May 17 22:28:36 2016
(r300088)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;
___
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: r300086 - in releng/10.2: . sys/conf sys/dev/kbd sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:20 2016
New Revision: 300086
URL: https://svnweb.freebsd.org/changeset/base/300086

Log:
  - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  - Validate that user supplied control message length in sendmsg(2)
is not negative.
  
  Security: SA-16:18
  Security: CVE-2016-1886
  Security: SA-16:19
  Security: CVE-2016-1887
  Submitted by: C Turt 
  Approved by:  so

Modified:
  releng/10.2/UPDATING
  releng/10.2/sys/conf/newvers.sh
  releng/10.2/sys/dev/kbd/kbd.c
  releng/10.2/sys/kern/uipc_syscalls.c

Modified: releng/10.2/UPDATING
==
--- releng/10.2/UPDATINGTue May 17 22:28:11 2016(r300085)
+++ releng/10.2/UPDATINGTue May 17 22:28:20 2016(r300086)
@@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160517   p17 FreeBSD-SA-16:18.atkbd
+   FreeBSD-SA-16:19.sendmsg
+
+   Fix buffer overflow in keyboard driver. [SA-16:18]
+
+   Fix incorrect argument handling in sendmsg(2). [SA-16:19]
+
 20160504   p16 FreeBSD-SA-16:17.openssl
FreeBSD-EN-16:07.ipi
FreeBSD-EN-16:08.zfs

Modified: releng/10.2/sys/conf/newvers.sh
==
--- releng/10.2/sys/conf/newvers.sh Tue May 17 22:28:11 2016
(r300085)
+++ releng/10.2/sys/conf/newvers.sh Tue May 17 22:28:20 2016
(r300086)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.2"
-BRANCH="RELEASE-p16"
+BRANCH="RELEASE-p17"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.2/sys/dev/kbd/kbd.c
==
--- releng/10.2/sys/dev/kbd/kbd.c   Tue May 17 22:28:11 2016
(r300085)
+++ releng/10.2/sys/dev/kbd/kbd.c   Tue May 17 22:28:20 2016
(r300086)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;

Modified: releng/10.2/sys/kern/uipc_syscalls.c
==
--- releng/10.2/sys/kern/uipc_syscalls.cTue May 17 22:28:11 2016
(r300085)
+++ releng/10.2/sys/kern/uipc_syscalls.cTue May 17 22:28:20 2016
(r300086)
@@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
 
+   if (buflen < 0)
+   return (EINVAL);
+
if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
___
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: r300085 - in releng/10.1: . sys/conf sys/dev/kbd sys/kern

2016-05-17 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 17 22:28:11 2016
New Revision: 300085
URL: https://svnweb.freebsd.org/changeset/base/300085

Log:
  - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
  - Validate that user supplied control message length in sendmsg(2)
is not negative.
  
  Security: SA-16:18
  Security: CVE-2016-1886
  Security: SA-16:19
  Security: CVE-2016-1887
  Submitted by: C Turt 
  Approved by:  so

Modified:
  releng/10.1/UPDATING
  releng/10.1/sys/conf/newvers.sh
  releng/10.1/sys/dev/kbd/kbd.c
  releng/10.1/sys/kern/uipc_syscalls.c

Modified: releng/10.1/UPDATING
==
--- releng/10.1/UPDATINGTue May 17 21:35:35 2016(r300084)
+++ releng/10.1/UPDATINGTue May 17 22:28:11 2016(r300085)
@@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160517   p34 FreeBSD-SA-16:18.atkbd
+   FreeBSD-SA-16:19.sendmsg
+
+   Fix buffer overflow in keyboard driver. [SA-16:18]
+
+   Fix incorrect argument handling in sendmsg(2). [SA-16:19]
+
 20160504   p33 FreeBSD-SA-16:17.openssl
FreeBSD-EN-16:08.zfs
 

Modified: releng/10.1/sys/conf/newvers.sh
==
--- releng/10.1/sys/conf/newvers.sh Tue May 17 21:35:35 2016
(r300084)
+++ releng/10.1/sys/conf/newvers.sh Tue May 17 22:28:11 2016
(r300085)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.1"
-BRANCH="RELEASE-p33"
+BRANCH="RELEASE-p34"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.1/sys/dev/kbd/kbd.c
==
--- releng/10.1/sys/dev/kbd/kbd.c   Tue May 17 21:35:35 2016
(r300084)
+++ releng/10.1/sys/dev/kbd/kbd.c   Tue May 17 22:28:11 2016
(r300085)
@@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo
splx(s);
return (error);
}
-   kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
+   kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK);
bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
kbd->kb_fkeytab[fkeyp->keynum].len);
break;

Modified: releng/10.1/sys/kern/uipc_syscalls.c
==
--- releng/10.1/sys/kern/uipc_syscalls.cTue May 17 21:35:35 2016
(r300084)
+++ releng/10.1/sys/kern/uipc_syscalls.cTue May 17 22:28:11 2016
(r300085)
@@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
 
+   if (buflen < 0)
+   return (EINVAL);
+
if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
___
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: r300071 - in head: . share/man/man5 sys/boot/forth

2016-05-17 Thread John Baldwin
On Tuesday, May 17, 2016 06:42:39 PM John Baldwin wrote:
> Author: jhb
> Date: Tue May 17 18:42:38 2016
> New Revision: 300071
> URL: https://svnweb.freebsd.org/changeset/base/300071
> 
> Log:
>   Remove the reiserfs(5) manpage and an example of loading the kernel module.

There is also a glabel backend that parses reiserfs volume labels.  It is
not GPL'd and might still be useful for someone using a fuse-based reiserfs
implementation.

-- 
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: r300084 - head/sys/ufs/ffs

2016-05-17 Thread Konstantin Belousov
Author: kib
Date: Tue May 17 21:35:35 2016
New Revision: 300084
URL: https://svnweb.freebsd.org/changeset/base/300084

Log:
  Do enable io accounting for read-only mounts and mounts which are
  remounted to writeable after initial read-only.  Assign to
  dev->si_mountpt earlier to account the accesses done at the mount
  time.
  
  Based on submission by:   bde
  MFC after:1 week

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Tue May 17 21:30:58 2016
(r300083)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Tue May 17 21:35:35 2016
(r300084)
@@ -780,6 +780,8 @@ ffs_mountfs(devvp, mp, td)
mp->mnt_iosize_max = MAXPHYS;
 
devvp->v_bufobj.bo_ops = _ops;
+   if (devvp->v_type == VCHR)
+   devvp->v_rdev->si_mountpt = mp;
 
fs = NULL;
sblockloc = 0;
@@ -1049,8 +1051,6 @@ ffs_mountfs(devvp, mp, td)
ffs_flushfiles(mp, FORCECLOSE, td);
goto out;
}
-   if (devvp->v_type == VCHR && devvp->v_rdev != NULL)
-   devvp->v_rdev->si_mountpt = mp;
if (fs->fs_snapinum[0] != 0)
ffs_snapshot_mount(mp);
fs->fs_fmod = 1;
@@ -1083,6 +1083,8 @@ ffs_mountfs(devvp, mp, td)
 out:
if (bp)
brelse(bp);
+   if (devvp->v_type == VCHR && devvp->v_rdev != NULL)
+   devvp->v_rdev->si_mountpt = NULL;
if (cp != NULL) {
DROP_GIANT();
g_topology_lock();
___
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: r300083 - head/sys/ufs/ffs

2016-05-17 Thread Konstantin Belousov
Author: kib
Date: Tue May 17 21:30:58 2016
New Revision: 300083
URL: https://svnweb.freebsd.org/changeset/base/300083

Log:
  If IO_SYNC was passed to ffs_truncate(), request synchronous inode
  update from the final ffs_update().
  
  Noted by: bde
  MFC after:1 week

Modified:
  head/sys/ufs/ffs/ffs_inode.c

Modified: head/sys/ufs/ffs/ffs_inode.c
==
--- head/sys/ufs/ffs/ffs_inode.cTue May 17 21:28:28 2016
(r300082)
+++ head/sys/ufs/ffs/ffs_inode.cTue May 17 21:30:58 2016
(r300083)
@@ -610,7 +610,7 @@ extclean:
softdep_journal_freeblocks(ip, cred, length, IO_EXT);
else
softdep_setup_freeblocks(ip, length, IO_EXT);
-   return (ffs_update(vp, !DOINGASYNC(vp)));
+   return (ffs_update(vp, (flags & IO_SYNC) != 0 || !DOINGASYNC(vp)));
 }
 
 /*
___
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: r300082 - head/sys/ufs/ufs

2016-05-17 Thread Konstantin Belousov
Author: kib
Date: Tue May 17 21:28:28 2016
New Revision: 300082
URL: https://svnweb.freebsd.org/changeset/base/300082

Log:
  For async UFS mounts, shrink the directory asynchronously, at least do
  not pass IO_SYNC to ffs_truncate() unneccessary.
  
  Submitted by: bde
  MFC after:1 week

Modified:
  head/sys/ufs/ufs/ufs_lookup.c

Modified: head/sys/ufs/ufs/ufs_lookup.c
==
--- head/sys/ufs/ufs/ufs_lookup.c   Tue May 17 21:25:20 2016
(r300081)
+++ head/sys/ufs/ufs/ufs_lookup.c   Tue May 17 21:28:28 2016
(r300082)
@@ -1131,7 +1131,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir
if (tvp != NULL)
VOP_UNLOCK(tvp, 0);
error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff,
-   IO_NORMAL | IO_SYNC, cr);
+   IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr);
if (error != 0)
vprint("ufs_direnter: failed to truncate", dvp);
 #ifdef UFS_DIRHASH
___
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: r300081 - in head/sys/boot: efi/libefi efi/loader ficl

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 21:25:20 2016
New Revision: 300081
URL: https://svnweb.freebsd.org/changeset/base/300081

Log:
  Implement UEFI set environment variable, as well as exporting the EFI
  version. This is also scriptable, though additional scripting will be
  needed.
  
  Differential Review: https://reviews.freebsd.org/D4494
  MFC After: 3 days

Added:
  head/sys/boot/efi/libefi/env.c   (contents, props changed)
  head/sys/boot/ficl/efi.c   (contents, props changed)
Modified:
  head/sys/boot/efi/libefi/Makefile
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/libefi/Makefile
==
--- head/sys/boot/efi/libefi/Makefile   Tue May 17 21:25:18 2016
(r300080)
+++ head/sys/boot/efi/libefi/Makefile   Tue May 17 21:25:20 2016
(r300081)
@@ -4,7 +4,7 @@ LIB=efi
 INTERNALLIB=
 WARNS?=2
 
-SRCS=  delay.c efi_console.c efinet.c efipart.c errno.c handles.c \
+SRCS=  delay.c efi_console.c efinet.c efipart.c env.c errno.c handles.c \
libefi.c time.c
 
 .if ${MACHINE_CPUARCH} == "aarch64"

Added: head/sys/boot/efi/libefi/env.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/efi/libefi/env.c  Tue May 17 21:25:20 2016
(r300081)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015 Netflix, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+/*
+ * Simple wrappers to the underlying UEFI functions.
+ * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES
+ * for details.
+ */
+EFI_STATUS
+efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, 
EFI_GUID *vendor_guid)
+{
+   return RS->GetNextVariableName(variable_name_size, variable_name, 
vendor_guid);
+}
+
+EFI_STATUS
+efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 
*attributes, UINTN *data_size,
+void *data)
+{
+   return RS->GetVariable(variable_name, vendor_guid, attributes, 
data_size, data);
+}
+
+EFI_STATUS
+efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 
attributes, UINTN data_size,
+void *data)
+{
+   return RS->SetVariable(variable_name, vendor_guid, attributes, 
data_size, data);
+}

Modified: head/sys/boot/efi/loader/main.c
==
--- head/sys/boot/efi/loader/main.c Tue May 17 21:25:18 2016
(r300080)
+++ head/sys/boot/efi/loader/main.c Tue May 17 21:25:20 2016
(r300081)
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -336,11 +338,8 @@ main(int argc, CHAR16 *argv[])
printf("Image base: 0x%lx\n", (u_long)img->ImageBase);
printf("EFI version: %d.%02d\n", ST->Hdr.Revision >> 16,
ST->Hdr.Revision & 0x);
-   printf("EFI Firmware: ");
-   /* printf doesn't understand EFI Unicode */
-   ST->ConOut->OutputString(ST->ConOut, ST->FirmwareVendor);
-   printf(" (rev %d.%02d)\n", ST->FirmwareRevision >> 16,
-   ST->FirmwareRevision & 0x);
+   printf("EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor,
+   ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0x);
 
printf("\n");
printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
@@ -394,6 +393,9 @@ main(int argc, CHAR16 *argv[])
}
}
 
+   snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16,
+   ST->Hdr.Revision & 0x);
+   env_setenv("efi-version", EV_VOLATILE, var, 

svn commit: r300080 - head/sys/boot/ficl

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 21:25:18 2016
New Revision: 300080
URL: https://svnweb.freebsd.org/changeset/base/300080

Log:
  Implement uuid-to-string and uuid-from-string. uuid-from-string takes
  a string, interprets it as a standard UUID, and returns a binary from
  of the UUID. uuid-to-string does the reverse. The binary UUID is in
  allocated memory, so you'll need to free it with 'free' after you are
  done using it. It won't be automatically garbage collected. Likewise
  with the string...
  
  MFC After: 3 days

Modified:
  head/sys/boot/ficl/loader.c

Modified: head/sys/boot/ficl/loader.c
==
--- head/sys/boot/ficl/loader.c Tue May 17 21:24:10 2016(r300079)
+++ head/sys/boot/ficl/loader.c Tue May 17 21:25:18 2016(r300080)
@@ -45,6 +45,7 @@
 #endif
 #include "bootstrap.h"
 #include 
+#include 
 #include "ficl.h"
 
 /* FreeBSD's loader interaction words and extras
@@ -59,6 +60,8 @@
  * pnpdevices  ( -- addr )
  * pnphandlers ( -- addr )
  * ccall   ( [[...[p10] p9] ... p1] n addr -- result )
+ * uuid-from-string ( addr n -- addr' )
+ * uuid-to-string ( addr' -- addr n )
  * .#  ( value -- )
  */
 
@@ -350,6 +353,75 @@ ficlCcall(FICL_VM *pVM)
return;
 }
 
+void
+ficlUuidFromString(FICL_VM *pVM)
+{
+#ifndefTESTMAIN
+   char*uuid;
+   uint32_t status;
+#endif
+   char*uuidp;
+   int uuids;
+   uuid_t  *u;
+
+#if FICL_ROBUST > 1
+   vmCheckStack(pVM, 2, 0);
+#endif
+
+   uuids = stackPopINT(pVM->pStack);
+   uuidp = (char *) stackPopPtr(pVM->pStack);
+
+#ifndefTESTMAIN
+   uuid = (char *)ficlMalloc(uuids + 1);
+   if (!uuid)
+   vmThrowErr(pVM, "Error: out of memory");
+   strncpy(uuid, uuidp, uuids);
+   uuid[uuids] = '\0';
+
+   u = (uuid_t *)ficlMalloc(sizeof (*u));
+
+   uuid_from_string(uuid, u, );
+   ficlFree(uuid);
+   if (status != uuid_s_ok) {
+   ficlFree(u);
+   u = NULL;
+   }
+#else
+   u = NULL;
+#endif
+   stackPushPtr(pVM->pStack, u);
+
+
+   return;
+}
+
+void
+ficlUuidToString(FICL_VM *pVM)
+{
+#ifndefTESTMAIN
+   char*uuid;
+   uint32_t status;
+#endif
+   uuid_t  *u;
+
+#if FICL_ROBUST > 1
+   vmCheckStack(pVM, 1, 0);
+#endif
+
+   u = (uuid_t *)stackPopPtr(pVM->pStack);
+
+#ifndefTESTMAIN
+   uuid_to_string(u, , );
+   if (status != uuid_s_ok) {
+   stackPushPtr(pVM->pStack, uuid);
+   stackPushINT(pVM->pStack, strlen(uuid));
+   } else
+#endif
+   stackPushINT(pVM->pStack, -1);
+
+   return;
+}
+
 /**
 f i c l E x e c F D
 ** reads in text from file fd and passes it to ficlExec()
@@ -920,6 +992,8 @@ void ficlCompilePlatform(FICL_SYSTEM *pS
 dictAppendWord(dp, "copyout",   ficlCopyout,FW_DEFAULT);
 dictAppendWord(dp, "findfile",  ficlFindfile,   FW_DEFAULT);
 dictAppendWord(dp, "ccall",ficlCcall,  FW_DEFAULT);
+dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT);
+dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT);
 #ifndef TESTMAIN
 #ifdef __i386__
 dictAppendWord(dp, "outb",  ficlOutb,   FW_DEFAULT);
___
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: r300079 - head/sys/dev/bwn

2016-05-17 Thread Adrian Chadd
Author: adrian
Date: Tue May 17 21:24:10 2016
New Revision: 300079
URL: https://svnweb.freebsd.org/changeset/base/300079

Log:
  [bwn] correctly calculate RSSI level.
  
  Tested:
  
  * BCM4311, PHY-G, STA mode
  * BCM4312, PHY-LP, STA mode
  * BCM4321, PHY-N, STA moe

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue May 17 21:23:13 2016(r300078)
+++ head/sys/dev/bwn/if_bwn.c   Tue May 17 21:24:10 2016(r300079)
@@ -5770,13 +5770,25 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
rssi = max(rxhdr->phy.n.power1, rxhdr->ps2.n.power2);
else
rssi = max(rxhdr->phy.n.power0, rxhdr->phy.n.power1);
+#if 0
+   DPRINTF(mac->mac_sc, BWN_DEBUG_RECV,
+   "%s: power0=%d, power1=%d, power2=%d\n",
+   __func__,
+   rxhdr->phy.n.power0,
+   rxhdr->phy.n.power1,
+   rxhdr->ps2.n.power2);
+#endif
break;
default:
/* XXX TODO: implement rssi for other PHYs */
break;
}
 
+   /*
+* RSSI here is absolute, not relative to the noise floor.
+*/
noise = mac->mac_stats.link_noise;
+   rssi = rssi - noise;
 
/* RX radio tap */
if (ieee80211_radiotap_active(ic))
___
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: r300078 - head/lib/libstand

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 21:23:13 2016
New Revision: 300078
URL: https://svnweb.freebsd.org/changeset/base/300078

Log:
  Add support for %S to libstand as well so /boot/loader and friends can
  use it.

Modified:
  head/lib/libstand/printf.c

Modified: head/lib/libstand/printf.c
==
--- head/lib/libstand/printf.c  Tue May 17 20:53:56 2016(r300077)
+++ head/lib/libstand/printf.c  Tue May 17 21:23:13 2016(r300078)
@@ -204,6 +204,7 @@ kvprintf(char const *fmt, kvprintf_fn_t 
char nbuf[MAXNBUF];
char *d;
const char *p, *percent, *q;
+   uint16_t *S;
u_char *up;
int ch, n;
uintmax_t num;
@@ -398,6 +399,10 @@ reswitch:  switch (ch = (u_char)*fmt++) {
while (width--)
PCHAR(padc);
break;
+   case 'S':   /* Assume console can cope with wide chars */
+   for (S = va_arg(ap, uint16_t *); *S != 0; S++)
+   PCHAR(*S);
+   break;
case 't':
tflag = 1;
goto reswitch;
___
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: r300077 - head/sys/dev/mwl

2016-05-17 Thread Andriy Voskoboinyk
Author: avos
Date: Tue May 17 20:53:56 2016
New Revision: 300077
URL: https://svnweb.freebsd.org/changeset/base/300077

Log:
  mwl: drop unneeded NULL pointer check.
  
  mh_streams[] is a fixed-length array, not a pointer.

Modified:
  head/sys/dev/mwl/mwlhal.c

Modified: head/sys/dev/mwl/mwlhal.c
==
--- head/sys/dev/mwl/mwlhal.c   Tue May 17 20:21:39 2016(r300076)
+++ head/sys/dev/mwl/mwlhal.c   Tue May 17 20:53:56 2016(r300077)
@@ -1440,7 +1440,7 @@ mwl_hal_bastream_alloc(struct mwl_hal_va
sp->setup = 0;
sp->ba_policy = ba_policy;
MWL_HAL_UNLOCK(mh);
-   return sp != NULL ? >public : NULL;
+   return >public;
 }
 
 const MWL_HAL_BASTREAM *
___
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: r300076 - head/sys/dev/bwn

2016-05-17 Thread Adrian Chadd
Author: adrian
Date: Tue May 17 20:21:39 2016
New Revision: 300076
URL: https://svnweb.freebsd.org/changeset/base/300076

Log:
  [bwn] print out a very obvious notice that GPLv2 code is compiled in if it is.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue May 17 20:18:23 2016(r300075)
+++ head/sys/dev/bwn/if_bwn.c   Tue May 17 20:21:39 2016(r300076)
@@ -564,6 +564,11 @@ bwn_attach(device_t dev)
else
device_printf(sc->sc_dev, "PIO\n");
 
+#ifdef BWN_GPL_PHY
+   device_printf(sc->sc_dev,
+   "Note: compiled with BWN_GPL_PHY; includes GPLv2 code\n");
+#endif
+
/*
 * setup PCI resources and interrupt.
 */
___
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: r300075 - head/sys/dev/bwn

2016-05-17 Thread Adrian Chadd
Author: adrian
Date: Tue May 17 20:18:23 2016
New Revision: 300075
URL: https://svnweb.freebsd.org/changeset/base/300075

Log:
  [bwn] always allocate maximum size txhdr entries; prepare for fw 598
  
  * always allocate maximum size txhdr entries
  * set the right rx header offset/framesize based on firmware
  
  This still isn't what's completely required for fw 598 support; there's
  more to come.
  
  Tested:
  
  * Apple BCM94321MC 11abgn NIC, 11a STA mode, firmware version 4xx.
  
  Obtained from:DragonflyBSD (txhdr entry sizing), fw 598 RX header 
size (linux b43)

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnreg.h
  head/sys/dev/bwn/if_bwnvar.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue May 17 19:48:28 2016(r300074)
+++ head/sys/dev/bwn/if_bwn.c   Tue May 17 20:18:23 2016(r300075)
@@ -2656,8 +2656,21 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i
dr->dr_curslot = -1;
} else {
if (dr->dr_index == 0) {
-   dr->dr_rx_bufsize = BWN_DMA0_RX_BUFFERSIZE;
-   dr->dr_frameoffset = BWN_DMA0_RX_FRAMEOFFSET;
+   switch (mac->mac_fw.fw_hdr_format) {
+   case BWN_FW_HDR_351:
+   case BWN_FW_HDR_410:
+   dr->dr_rx_bufsize =
+   BWN_DMA0_RX_BUFFERSIZE_FW351;
+   dr->dr_frameoffset =
+   BWN_DMA0_RX_FRAMEOFFSET_FW351;
+   break;
+   case BWN_FW_HDR_598:
+   dr->dr_rx_bufsize =
+   BWN_DMA0_RX_BUFFERSIZE_FW598;
+   dr->dr_frameoffset =
+   BWN_DMA0_RX_FRAMEOFFSET_FW598;
+   break;
+   }
} else
KASSERT(0 == 1, ("%s:%d: fail", __func__, __LINE__));
}
@@ -2676,7 +2689,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, i
 
dr->dr_txhdr_cache = contigmalloc(
(dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) *
-   BWN_HDRSIZE(mac), M_DEVBUF, M_ZERO,
+   BWN_MAXTXHDRSIZE, M_DEVBUF, M_ZERO,
0, BUS_SPACE_MAXADDR, 8, 0);
if (dr->dr_txhdr_cache == NULL) {
device_printf(sc->sc_dev,
@@ -2773,7 +2786,7 @@ fail2:
if (dr->dr_txhdr_cache != NULL) {
contigfree(dr->dr_txhdr_cache,
(dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) *
-   BWN_HDRSIZE(mac), M_DEVBUF);
+   BWN_MAXTXHDRSIZE, M_DEVBUF);
}
 fail1:
free(dr->dr_meta, M_DEVBUF);
@@ -2795,7 +2808,7 @@ bwn_dma_ringfree(struct bwn_dma_ring **d
if ((*dr)->dr_txhdr_cache != NULL) {
contigfree((*dr)->dr_txhdr_cache,
((*dr)->dr_numslots / BWN_TX_SLOTS_PER_FRAME) *
-   BWN_HDRSIZE((*dr)->dr_mac), M_DEVBUF);
+   BWN_MAXTXHDRSIZE, M_DEVBUF);
}
free((*dr)->dr_meta, M_DEVBUF);
free(*dr, M_DEVBUF);

Modified: head/sys/dev/bwn/if_bwnreg.h
==
--- head/sys/dev/bwn/if_bwnreg.hTue May 17 19:48:28 2016
(r300074)
+++ head/sys/dev/bwn/if_bwnreg.hTue May 17 20:18:23 2016
(r300075)
@@ -453,11 +453,13 @@
 #defineBWN_DMA64_RXSTAT0xf000
 #defineBWN_DMA64_RXSTAT_DISABLED   0x
 #defineBWN_DMA_RINGMEMSIZE PAGE_SIZE
-#defineBWN_DMA0_RX_FRAMEOFFSET 30
+#defineBWN_DMA0_RX_FRAMEOFFSET_FW351   30
+#defineBWN_DMA0_RX_FRAMEOFFSET_FW598   38
 
 #defineBWN_TXRING_SLOTS64
 #defineBWN_RXRING_SLOTS64
-#defineBWN_DMA0_RX_BUFFERSIZE  IEEE80211_MAX_LEN
+#defineBWN_DMA0_RX_BUFFERSIZE_FW351(IEEE80211_MAX_LEN + 
BWN_DMA0_RX_FRAMEOFFSET_FW351)
+#defineBWN_DMA0_RX_BUFFERSIZE_FW598(IEEE80211_MAX_LEN + 
BWN_DMA0_RX_FRAMEOFFSET_FW598)
 
 #defineBWN_PHYROUTE_BASE   0x
 #defineBWN_PHYROUTE_MASK   0x0c00

Modified: head/sys/dev/bwn/if_bwnvar.h
==
--- head/sys/dev/bwn/if_bwnvar.hTue May 17 19:48:28 2016
(r300074)
+++ head/sys/dev/bwn/if_bwnvar.hTue May 17 20:18:23 2016
(r300075)
@@ -59,6 +59,7 @@ struct bwn_mac;
 #defineBWN_TSSI2DBM(num, den)  
\
((int32_t)((num < 0) ? num / den : (num + den / 2) / den))
 #defineBWN_HDRSIZE(mac)bwn_tx_hdrsize(mac)
+#define

svn commit: r300074 - head/sys/dev/pci

2016-05-17 Thread John Baldwin
Author: jhb
Date: Tue May 17 19:48:28 2016
New Revision: 300074
URL: https://svnweb.freebsd.org/changeset/base/300074

Log:
  Rework managing hotplug commands with command completions.
  
  Previously the command completion interrupt would post any pending
  command immediately before pcib_pcie_hotplug_update() had been
  run to inspect the current status.  Now, the command completion
  interrupt merely clears the flag and stops the timer assuming that
  the caller is always going to call pcib_pcie_hotplug_update() to
  generate the next hotplug command if one is needed.
  
  While here, fix a bug for systems with command completion where the
  old (existing) value was written to the slot control register instead
  of the new value.  This fixes the complaint about a missing hotplug
  interrupt on my T400.
  
  Differential Revision:https://reviews.freebsd.org/D6363

Modified:
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_private.h

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Tue May 17 19:34:07 2016(r300073)
+++ head/sys/dev/pci/pci_pci.c  Tue May 17 19:48:28 2016(r300074)
@@ -874,8 +874,11 @@ pcib_probe_hotplug(struct pcib_softc *sc
 
 /*
  * Send a HotPlug command to the slot control register.  If this slot
- * uses command completion interrupts, these updates will be buffered
- * while a previous command is completing.
+ * uses command completion interrupts and a previous command is still
+ * in progress, then the command is dropped.  Once the previous
+ * command completes or times out, pcib_pcie_hotplug_update() will be
+ * invoked to post a new command based on the slot's state at that
+ * time.
  */
 static void
 pcib_pcie_hotplug_command(struct pcib_softc *sc, uint16_t val, uint16_t mask)
@@ -884,28 +887,20 @@ pcib_pcie_hotplug_command(struct pcib_so
uint16_t ctl, new;
 
dev = sc->dev;
-   if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) {
-   ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
-   new = (ctl & ~mask) | val;
-   if (new != ctl)
-   pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
+
+   if (sc->flags & PCIB_HOTPLUG_CMD_PENDING)
return;
-   }
 
-   if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) {
-   sc->pcie_pending_link_ctl_val &= ~mask;
-   sc->pcie_pending_link_ctl_val |= val;
-   sc->pcie_pending_link_ctl_mask |= mask;
-   } else {
-   ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
-   new = (ctl & ~mask) | val;
-   if (new != ctl) {
-   pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2);
-   sc->flags |= PCIB_HOTPLUG_CMD_PENDING;
-   if (!cold)
-   callout_reset(>pcie_cc_timer, hz,
-   pcib_pcie_cc_timeout, sc);
-   }
+   ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
+   new = (ctl & ~mask) | val;
+   if (new == ctl)
+   return;
+   pcie_write_config(dev, PCIER_SLOT_CTL, new, 2);
+   if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS)) {
+   sc->flags |= PCIB_HOTPLUG_CMD_PENDING;
+   if (!cold)
+   callout_reset(>pcie_cc_timer, hz,
+   pcib_pcie_cc_timeout, sc);
}
 }
 
@@ -913,7 +908,6 @@ static void
 pcib_pcie_hotplug_command_completed(struct pcib_softc *sc)
 {
device_t dev;
-   uint16_t ctl, new;
 
dev = sc->dev;
 
@@ -921,23 +915,8 @@ pcib_pcie_hotplug_command_completed(stru
device_printf(dev, "Command Completed\n");
if (!(sc->flags & PCIB_HOTPLUG_CMD_PENDING))
return;
-   if (sc->pcie_pending_link_ctl_mask != 0) {
-   ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
-   new = ctl & ~sc->pcie_pending_link_ctl_mask;
-   new |= sc->pcie_pending_link_ctl_val;
-   if (new != ctl) {
-   pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2);
-   if (!cold)
-   callout_reset(>pcie_cc_timer, hz,
-   pcib_pcie_cc_timeout, sc);
-   } else
-   sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
-   sc->pcie_pending_link_ctl_mask = 0;
-   sc->pcie_pending_link_ctl_val = 0;
-   } else {
-   callout_stop(>pcie_cc_timer);
-   sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
-   }
+   callout_stop(>pcie_cc_timer);
+   sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
 }
 
 /*
@@ -1041,11 +1020,10 @@ pcib_pcie_hotplug_update(struct pcib_sof
 * Interlock.
 */
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
+   mask |= PCIEM_SLOT_CTL_EIC;
if 

svn commit: r300073 - head/sys/kern

2016-05-17 Thread John Baldwin
Author: jhb
Date: Tue May 17 19:34:07 2016
New Revision: 300073
URL: https://svnweb.freebsd.org/changeset/base/300073

Log:
  Document the formatting requirements of location and pnpinfo strings.
  
  devd requires location and pnpinfo strings generated by bus drivers
  to be formatted as a list of name=value keypairs.  Non-conforming
  bus drivers cause devd to mis-parse device events for these buses.
  
  Note that this documents the desired requirements.  devctl_safe_quote()
  doesn't yet escape backslash characters, and devd doesn't handle escaped
  characters in quoted values.
  
  Differential Revision:https://reviews.freebsd.org/D6252

Modified:
  head/sys/kern/bus_if.m

Modified: head/sys/kern/bus_if.m
==
--- head/sys/kern/bus_if.m  Tue May 17 19:00:09 2016(r300072)
+++ head/sys/kern/bus_if.m  Tue May 17 19:34:07 2016(r300073)
@@ -532,6 +532,13 @@ METHOD int child_present {
  *
  * Return it as a string.  If the string is insufficient for the
  * storage, then return EOVERFLOW.
+ *
+ * The string must be formatted as a space-separated list of
+ * name=value pairs.  Names may only contain alphanumeric characters,
+ * underscores ('_') and hyphens ('-').  Values can contain any
+ * non-whitespace characters.  Values containing whitespace can be
+ * quoted with double quotes ('"').  Double quotes and backslashes in
+ * quoted values can be escaped with backslashes ('\').
  * 
  * @param _dev the parent device of @p _child
  * @param _child   the device which is being examined
@@ -551,7 +558,14 @@ METHOD int child_pnpinfo_str {
  *
  * Return it as a string.  If the string is insufficient for the
  * storage, then return EOVERFLOW.
- * 
+ *
+ * The string must be formatted as a space-separated list of
+ * name=value pairs.  Names may only contain alphanumeric characters,
+ * underscores ('_') and hyphens ('-').  Values can contain any
+ * non-whitespace characters.  Values containing whitespace can be
+ * quoted with double quotes ('"').  Double quotes and backslashes in
+ * quoted values can be escaped with backslashes ('\').
+ *
  * @param _dev the parent device of @p _child
  * @param _child   the device which is being examined
  * @param _buf the address of a buffer to receive the location
___
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: r300072 - head/sys/dev/fb

2016-05-17 Thread Alexander Motin
Author: mav
Date: Tue May 17 19:00:09 2016
New Revision: 300072
URL: https://svnweb.freebsd.org/changeset/base/300072

Log:
  Fix NULL-dereference panic if VESA reports zero modes.
  
  MFC after:1 week

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Tue May 17 18:42:38 2016(r300071)
+++ head/sys/dev/fb/vesa.c  Tue May 17 19:00:09 2016(r300072)
@@ -1025,7 +1025,8 @@ vesa_bios_init(void)
 
++modes;
}
-   vesa_vmode[modes].vi_mode = EOT;
+   if (vesa_vmode != NULL)
+   vesa_vmode[modes].vi_mode = EOT;
 
if (bootverbose)
printf("VESA: %d mode(s) found\n", modes);
___
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: r300071 - in head: . share/man/man5 sys/boot/forth

2016-05-17 Thread John Baldwin
Author: jhb
Date: Tue May 17 18:42:38 2016
New Revision: 300071
URL: https://svnweb.freebsd.org/changeset/base/300071

Log:
  Remove the reiserfs(5) manpage and an example of loading the kernel module.

Deleted:
  head/share/man/man5/reiserfs.5
Modified:
  head/ObsoleteFiles.inc
  head/share/man/man5/Makefile
  head/sys/boot/forth/loader.conf

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue May 17 18:25:09 2016(r300070)
+++ head/ObsoleteFiles.inc  Tue May 17 18:42:38 2016(r300071)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20160517: ReiserFS removed
+OLD_FILES+=usr/share/man/man5/reiserfs.5.gz
 # 20160430: kvm_getfiles(3) removed from kvm(3)
 OLD_LIBS+=usr/lib/libkvm.so.6
 OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileTue May 17 18:25:09 2016
(r300070)
+++ head/share/man/man5/MakefileTue May 17 18:42:38 2016
(r300071)
@@ -57,7 +57,6 @@ MAN=  acct.5 \
rc.conf.5 \
rctl.conf.5 \
regdomain.5 \
-   reiserfs.5 \
remote.5 \
resolver.5 \
services.5 \

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Tue May 17 18:25:09 2016
(r300070)
+++ head/sys/boot/forth/loader.conf Tue May 17 18:42:38 2016
(r300071)
@@ -215,7 +215,6 @@ nfsclient_load="NO" # NFS client
 nfsserver_load="NO"# NFS server
 nullfs_load="NO"   # Null filesystem
 procfs_load="NO"   # Process filesystem
-reiserfs_load="NO" # ReiserFS
 unionfs_load="NO"  # Union filesystem
 zfs_load="NO"  # ZFS
 
___
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: r300069 - head/usr.sbin/makefs

2016-05-17 Thread Pedro F. Giffuni
Author: pfg
Date: Tue May 17 18:20:33 2016
New Revision: 300069
URL: https://svnweb.freebsd.org/changeset/base/300069

Log:
  makefs(1): use all the random(3) range.
  
  The generation number is uint32_t so we can fit the complete range
  of random(3). We could have used arc4random() but the result would
  be unpredictable and it would prohibit reproducible builds.
  
  While here add a comment where seeding is done: this affects
  reproducible builds and might have to be re-visited to use a
  release dependent value.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Tue May 17 17:46:12 2016(r300068)
+++ head/usr.sbin/makefs/ffs.c  Tue May 17 18:20:33 2016(r300069)
@@ -1125,9 +1125,10 @@ ffs_write_inode(union dinode *dp, uint32
initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
memset(buf, 0, fs->fs_bsize);
dip = (struct ufs2_dinode *)buf;
+   /* Seeding affects reproducible builds. */
srandom(time(NULL));
for (i = 0; i < INOPB(fs); i++) {
-   dip->di_gen = random() / 2 + 1;
+   dip->di_gen = random();
dip++;
}
ffs_wtfs(fsbtodb(fs, ino_to_fsba(fs,
___
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: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi

2016-05-17 Thread Warner Losh
On Tue, May 10, 2016 at 11:33 AM, Edward Tomasz Napierala  wrote:

> On 0510T1020, Alan Somers wrote:
> > On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala <
> tr...@freebsd.org>
> > wrote:
> >
> > > Author: trasz
> > > Date: Tue May 10 15:46:33 2016
> > > New Revision: 299371
> > > URL: https://svnweb.freebsd.org/changeset/base/299371
> > >
> > > Log:
> > >   Add "camcontrol reprobe" subcommand, and implement it for da(4).
> > >   This makes it possible to manually force updating capacity data
> > >   after the disk got resized. Without it it might be neccessary to
> > >   reboot before FreeBSD notices updated disk size under eg VMWare.
> > >
> > >   Discussed with:   imp@
> > >   MFC after:1 month
> > >   Sponsored by: The FreeBSD Foundation
> > >   Differential Revision:https://reviews.freebsd.org/D6108
> > >
> > > Modified:
> > >   head/sbin/camcontrol/camcontrol.8
> > >   head/sbin/camcontrol/camcontrol.c
> > >   head/sys/cam/cam_ccb.h
> > >   head/sys/cam/cam_xpt.c
> > >   head/sys/cam/scsi/scsi_da.c
> > >
> > >
> >
> > I too have been annoyed that "camcontrol rescan" won't update capacity
> > data.  But could we solve the problem by simply adding logic to
> "camcontrol
> > rescan" instead of adding an entirely new command?  Would a user ever
> want
> > to rescan a device without reprobing it too?
>
> Two reasons.  First, I want to be able to pass the device name (like
> 'da0') and not the CAM path (like 1:0:0) for usability reasons - it seems
> easy to figure out the latter from the former, using "camcontrol devlist",
> but it suddenly becomes complicated when you try to explain it in a man
> page.


You can look up one or the other. fwdownload uses the daX name.


> Second - I don't understand the "camcontrol rescan" logic well
> enough, and "camcontrol rescan all" sometimes fails for me anyway,
> in a way I'm not sure how to debug.
>

That's a cop-out. CAM is hard, but if you aren't willing to figure itout,
adding hacks that the other CAM maintainers have to cope with doesn't
help.

Also, to be honest I'm not sure those two are actually that related.
> Rescanning is about discovering new devices on the bus.  "Reprobe"
> is about updating... well, mostly updating the capacity.  The former
> requires enumerating the bus using a mechanism built into XPT; the
> latter is just notifying the periph driver (in this case da(4)) that
> it needs to query the capacity and call disk_resize(4).
>

The two are very related. Now we have two stupid paths in CAM instead of
one.

and you didn't do ada like I asked.

Not happy with this at all, but not asking for a back out.

Warner
___
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: r299994 - in head/sys/mips: broadcom conf

2016-05-17 Thread Bjoern A. Zeeb

> On 17 May 2016, at 00:00 , Adrian Chadd  wrote:
> 
> Author: adrian
> Date: Tue May 17 00:00:01 2016
> New Revision: 24
> URL: https://svnweb.freebsd.org/changeset/base/24
> 
> Log:
>  [mips/broadcom] Add initial support for Broadcom MIPS processor
> 
>  Relies on BHND(4) driver.
> 
>  There files contains machine-dependent code for Broadcom MIPS processor and
>  provide UART driver.
> 
>  This is a work in progress; it and the current bhnd code is enough to boot
>  on the ASUS RT-N16 and RT-N53 platforms.
> 
>  Submitted by:Michael Zhilin 
>  Differential Revision:   https://reviews.freebsd.org/D6251
> 
> Added:
>  head/sys/mips/broadcom/bcm_machdep.c   (contents, props changed)
>  head/sys/mips/broadcom/bcm_socinfo.c   (contents, props changed)
>  head/sys/mips/broadcom/bcm_socinfo.h   (contents, props changed)
>  head/sys/mips/broadcom/files.broadcom   (contents, props changed)
>  head/sys/mips/broadcom/std.broadcom   (contents, props changed)
>  head/sys/mips/broadcom/uart_bus_chipc.c   (contents, props changed)
>  head/sys/mips/broadcom/uart_cpu_chipc.c   (contents, props changed)
>  head/sys/mips/conf/BCM   (contents, props changed)
>  head/sys/mips/conf/BCM.hints   (contents, props changed)

Seems you missed a file..

bz@zoo:/tank/users/bz/head.svn% grep -r bcma_nexus.c sys/
sys/mips/broadcom/files.broadcom:dev/bhnd/bcma/bcma_nexus.c standard
bz@zoo:/tank/users/bz/head.svn% find sys/ -name bcma_nexus.c
bz@zoo:/tank/users/bz/head.svn%

/bz


— 
Bjoern A. Zeeb  Charles Haddon Spurgeon:
"Friendship is one of the sweetest joys of life.  Many might have failed
 beneath the bitterness of their trial  had they not found a friend."

___
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: r300068 - in head/sys: arm/allwinner arm/conf dev/usb/controller

2016-05-17 Thread Emmanuel Vadot
Author: manu
Date: Tue May 17 17:46:12 2016
New Revision: 300068
URL: https://svnweb.freebsd.org/changeset/base/300068

Log:
  Add driver for "generic-ohci" as defined by FDT.
  If platform support EXT_RESOURCES, clocks and resets are handled out of
  the box.
  If not driver can be subclassed using the generic_usb interface.
  generic_usb name was choosed because at one point I'll add generic-ehci
  FDT driver.
  
  Reviewed by:  jmcneill, hselasky
  Approved by:  andrew (mentor)
  Differential Revision:https://reviews.freebsd.org/D5481

Added:
  head/sys/dev/usb/controller/generic_ohci.c   (contents, props changed)
  head/sys/dev/usb/controller/generic_usb_if.m   (contents, props changed)
Modified:
  head/sys/arm/allwinner/files.allwinner
  head/sys/arm/conf/A10
  head/sys/arm/conf/ALLWINNER

Modified: head/sys/arm/allwinner/files.allwinner
==
--- head/sys/arm/allwinner/files.allwinner  Tue May 17 17:09:45 2016
(r300067)
+++ head/sys/arm/allwinner/files.allwinner  Tue May 17 17:46:12 2016
(r300068)
@@ -24,6 +24,8 @@ arm/allwinner/if_awg.coptional
awg
 arm/allwinner/if_emac.coptionalemac
 arm/allwinner/sunxi_dma_if.m   standard
 dev/iicbus/twsi/a10_twsi.c optionaltwsi
+dev/usb/controller/generic_ohci.c  optionalohci
+dev/usb/controller/generic_usb_if.moptionalohci
 arm/allwinner/aw_sid.c standard
 arm/allwinner/aw_thermal.c standard
 #arm/allwinner/console.c   standard

Modified: head/sys/arm/conf/A10
==
--- head/sys/arm/conf/A10   Tue May 17 17:09:45 2016(r300067)
+++ head/sys/arm/conf/A10   Tue May 17 17:46:12 2016(r300068)
@@ -98,7 +98,7 @@ options   USB_DEBUG
 #options   USB_REQ_DEBUG
 #options   USB_VERBOSE
 #deviceuhci
-#deviceohci
+device ohci
 device ehci
 
 device umass

Modified: head/sys/arm/conf/ALLWINNER
==
--- head/sys/arm/conf/ALLWINNER Tue May 17 17:09:45 2016(r300067)
+++ head/sys/arm/conf/ALLWINNER Tue May 17 17:46:12 2016(r300068)
@@ -113,7 +113,7 @@ options USB_DEBUG
 #options   USB_REQ_DEBUG
 #options   USB_VERBOSE
 #deviceuhci
-#deviceohci
+device ohci
 device ehci
 
 device umass

Added: head/sys/dev/usb/controller/generic_ohci.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/usb/controller/generic_ohci.c  Tue May 17 17:46:12 2016
(r300068)
@@ -0,0 +1,308 @@
+/*-
+ * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
+ * Copyright (c) 2016 Emmanuel Vadot 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Generic OHCI driver based on AT91 OHCI
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#ifdef EXT_RESOURCES
+#include 
+#include 
+#endif
+
+#include "generic_usb_if.h"
+
+#ifdef EXT_RESOURCES
+struct clk_list {
+   TAILQ_ENTRY(clk_list)   next;
+   clk_t   clk;
+};
+#endif
+
+struct generic_ohci_softc {
+   ohci_softc_t

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

2016-05-17 Thread Ravi Pokala
-Original Message-
From:  on behalf of Warner Losh 

Date: 2016-05-17, Tuesday at 10:08
To: , , 

Subject: svn commit: r300066 - head/share/man/man9

>Author: imp
>Date: Tue May 17 17:08:13 2016
>New Revision: 300066
>URL: https://svnweb.freebsd.org/changeset/base/300066
>
>Log:
>  Per Ravi Pokala's suggestion, rewrite the g_reset_bio description to
>  be clearer. It also describes it with more nuance. Add missing MLINKS
>  noticed by trasz@. Bump the date.

Much clearer. Thank you sir.

-Ravi (rpokala@)


___
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: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-17 Thread Pedro Giffuni



On 05/17/16 11:50, Conrad Meyer wrote:

On Tue, May 17, 2016 at 9:29 AM, Pedro Giffuni  wrote:

Log:
  Kill off ReiserFS as it is no longer supported, for obvious reasons.



It's not so obvious since the fs worked and could've been useful for
people migrating from ancient linux.


This may still be possible through e.g. sysutils/fusefs-lkl (ReiserFS
isn't included in the port yet, but it's possible that it could be).



And that's a pretty cool port but since it's not base it involves
adding a package and some digging for documentation.

Quite honestly, it's a pretty hypothetical situation. By far the most 
common migration cases are ext4 (which is covered by base) and XFS.


We should make fusefs-lkl more visible.

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


svn commit: r300067 - head/sys/conf

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 17:09:45 2016
New Revision: 300067
URL: https://svnweb.freebsd.org/changeset/base/300067

Log:
  Final nit in ReiserFS removal.

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue May 17 17:08:13 2016(r300066)
+++ head/sys/conf/options   Tue May 17 17:09:45 2016(r300067)
@@ -242,7 +242,6 @@ NANDFS  opt_dontuse.h
 NULLFS opt_dontuse.h
 PROCFS opt_dontuse.h
 PSEUDOFS   opt_dontuse.h
-REISERFS   opt_dontuse.h
 SMBFS  opt_dontuse.h
 TMPFS  opt_dontuse.h
 UDFopt_dontuse.h
___
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: r300066 - head/share/man/man9

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 17:08:13 2016
New Revision: 300066
URL: https://svnweb.freebsd.org/changeset/base/300066

Log:
  Per Ravi Pokala's suggestion, rewrite the g_reset_bio description to
  be clearer. It also describes it with more nuance. Add missing MLINKS
  noticed by trasz@. Bump the date.

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/g_bio.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue May 17 16:59:53 2016
(r300065)
+++ head/share/man/man9/MakefileTue May 17 17:08:13 2016
(r300066)
@@ -787,7 +787,8 @@ MLINKS+=g_bio.9 g_alloc_bio.9 \
g_bio.9 g_destroy_bio.9 \
g_bio.9 g_duplicate_bio.9 \
g_bio.9 g_new_bio.9 \
-   g_bio.9 g_print_bio.9
+   g_bio.9 g_print_bio.9 \
+   g_bio.9 g_reset_bio.9
 MLINKS+=g_consumer.9 g_destroy_consumer.9 \
g_consumer.9 g_new_consumer.9
 MLINKS+=g_data.9 g_read_data.9 \

Modified: head/share/man/man9/g_bio.9
==
--- head/share/man/man9/g_bio.9 Tue May 17 16:59:53 2016(r300065)
+++ head/share/man/man9/g_bio.9 Tue May 17 17:08:13 2016(r300066)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 9, 2016
+.Dd May 17, 2016
 .Dt G_BIO 9
 .Os
 .Sh NAME
@@ -213,27 +213,27 @@ The
 .Fn g_reset_bio
 function resets the given
 .Vt bio
-for reuse.
-Prior to
-.Fx 11
-a
-.Vt bio
-was reset for reuse with
-.Xr bzero 3 .
+structure back to its initial state.
 .Fn g_reset_bio
-preserves internal data structures, while resetting all
-user visible values.
-Its use is required for any
+preserves internal data structures, while setting all
+user visible fields to their initial values.
+When reusing a
 .Vt bio
-that has been returned by
+obtained from
 .Fn g_new_bio ,
 .Fn g_alloc_bio ,
 .Fn g_clone_bio ,
 or
-.Fn g_duplicate_bio .
-It may be used for a
+.Fn g_duplicate_bio
+for multiple transactions,
+.Fn g_reset_bio
+must be called between the transactions in lieu of
+.Fn bzero .
+While not strictly required for a
 .Vt bio
-created in another way, but that is not required.
+structure created by other means,
+.Fn g_reset_bio
+should be used to initialize it and between transactions.
 .Sh RETURN VALUES
 The
 .Fn g_new_bio
___
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: r300065 - head/sys/conf

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 16:59:53 2016
New Revision: 300065
URL: https://svnweb.freebsd.org/changeset/base/300065

Log:
  Finish cleaning up after killing ReiserFS.
  
  Remove LINT/NOTES option and file linkages.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/files

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue May 17 16:58:39 2016(r300064)
+++ head/sys/conf/NOTES Tue May 17 16:59:53 2016(r300065)
@@ -1139,12 +1139,6 @@ options  NFS_DEBUG   # Enable NFS Debuggi
 #
 optionsEXT2FS
 
-#
-# Add support for the ReiserFS filesystem (used in Linux). Currently,
-# this is limited to read-only access.
-#
-optionsREISERFS
-
 # Cryptographically secure random number generator; /dev/random
 device random
 
@@ -3063,4 +3057,4 @@ options   EM_MULTIQUEUE # Activate multiq
 optionsGZIO
 
 # BHND(4) drivers
-optionsBHND_LOGLEVEL   # Logging threshold level
\ No newline at end of file
+optionsBHND_LOGLEVEL   # Logging threshold level

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue May 17 16:58:39 2016(r300064)
+++ head/sys/conf/files Tue May 17 16:59:53 2016(r300065)
@@ -3155,15 +3155,6 @@ fs/ext2fs/ext2_lookup.c  optional ext2fs
 fs/ext2fs/ext2_subr.c  optional ext2fs
 fs/ext2fs/ext2_vfsops.coptional ext2fs
 fs/ext2fs/ext2_vnops.c optional ext2fs
-gnu/fs/reiserfs/reiserfs_hashes.c  optional reiserfs \
-   warning "kernel contains GPL contaminated ReiserFS filesystem"
-gnu/fs/reiserfs/reiserfs_inode.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_item_ops.coptional reiserfs
-gnu/fs/reiserfs/reiserfs_namei.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_prints.c  optional reiserfs
-gnu/fs/reiserfs/reiserfs_stree.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_vfsops.c  optional reiserfs
-gnu/fs/reiserfs/reiserfs_vnops.c   optional reiserfs
 #
 isa/isa_if.m   standard
 isa/isa_common.c   optional isa
___
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: r300064 - head/usr.sbin/makefs

2016-05-17 Thread Pedro F. Giffuni
Author: pfg
Date: Tue May 17 16:58:39 2016
New Revision: 300064
URL: https://svnweb.freebsd.org/changeset/base/300064

Log:
  makefs(8): use NULL instead of zero for pointers.

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

Modified: head/usr.sbin/makefs/cd9660.c
==
--- head/usr.sbin/makefs/cd9660.c   Tue May 17 16:38:18 2016
(r300063)
+++ head/usr.sbin/makefs/cd9660.c   Tue May 17 16:58:39 2016
(r300064)
@@ -774,7 +774,7 @@ cd9660_setup_volume_descriptors(void)
temp->next = t;
memset(t->volumeDescriptorData, 0, 2048);
t->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_TERMINATOR;
-   t->next = 0;
+   t->next = NULL;
t->volumeDescriptorData[6] = 1;
t->sector = sector;
memcpy(t->volumeDescriptorData + 1,
@@ -1403,7 +1403,7 @@ cd9660_convert_structure(fsnode *root, c
this_node->level =
working_level - 1;
if (cd9660_rrip_move_directory(
-   this_node) == 0) {
+   this_node) == NULL) {
warnx("Failure in "
  "cd9660_rrip_"
  "move_directory"
@@ -1416,7 +1416,7 @@ cd9660_convert_structure(fsnode *root, c
}
 
/* Do the recursive call on the children */
-   if (iterator->child != 0) {
+   if (iterator->child != NULL) {
cd9660_convert_structure(
iterator->child, this_node,
working_level,
@@ -1445,7 +1445,7 @@ cd9660_convert_structure(fsnode *root, c
}
 
/*Allocate new temp_node */
-   if (iterator->next != 0) {
+   if (iterator->next != NULL) {
this_node = cd9660_allocate_cd9660node();
if (this_node == NULL)
CD9660_MEM_ALLOC_ERROR(__func__);
@@ -1733,7 +1733,7 @@ cd9660_convert_filename(const char *oldn
 {
assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2);
/* NEW */
-   cd9660_filename_conversion_functor conversion_function = 0;
+   cd9660_filename_conversion_functor conversion_function = NULL;
if (diskStructure.isoLevel == 1)
conversion_function = _level1_convert_filename;
else if (diskStructure.isoLevel == 2)
___
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: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-17 Thread Conrad Meyer
On Tue, May 17, 2016 at 9:29 AM, Pedro Giffuni  wrote:
>> Log:
>>   Kill off ReiserFS as it is no longer supported, for obvious reasons.
>>
>
> It's not so obvious since the fs worked and could've been useful for
> people migrating from ancient linux.

This may still be possible through e.g. sysutils/fusefs-lkl (ReiserFS
isn't included in the port yet, but it's possible that it could be).

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: r300063 - head/sys/net80211

2016-05-17 Thread Andriy Voskoboinyk
Author: avos
Date: Tue May 17 16:38:18 2016
New Revision: 300063
URL: https://svnweb.freebsd.org/changeset/base/300063

Log:
  net80211: unbreak 'show all vaps(/a)' ddb command
  
  Replace ifnet list lookup (which is broken since r287197, because
  IFT_IEEE80211 type is not used anymore) with iteration on
  ieee80211com list.
  
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D6419

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_ddb.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Tue May 17 15:36:40 2016
(r300062)
+++ head/sys/net80211/ieee80211.c   Tue May 17 16:38:18 2016
(r300063)
@@ -406,6 +406,17 @@ ieee80211_find_com(const char *name)
return (ic);
 }
 
+void
+ieee80211_iterate_coms(ieee80211_com_iter_func *f, void *arg)
+{
+   struct ieee80211com *ic;
+
+   mtx_lock(_list_mtx);
+   LIST_FOREACH(ic, _head, ic_next)
+   (*f)(arg, ic);
+   mtx_unlock(_list_mtx);
+}
+
 /*
  * Default reset method for use with the ioctl support.  This
  * method is invoked after any state change in the 802.11

Modified: head/sys/net80211/ieee80211_ddb.c
==
--- head/sys/net80211/ieee80211_ddb.c   Tue May 17 15:36:40 2016
(r300062)
+++ head/sys/net80211/ieee80211_ddb.c   Tue May 17 16:38:18 2016
(r300063)
@@ -69,6 +69,8 @@ static void _db_show_vap(const struct ie
 static void _db_show_com(const struct ieee80211com *,
int showvaps, int showsta, int showmesh, int showprocs);
 
+static void _db_show_all_vaps(void *, struct ieee80211com *);
+
 static void _db_show_node_table(const char *tag,
const struct ieee80211_node_table *);
 static void _db_show_channel(const char *tag, const struct ieee80211_channel 
*);
@@ -161,8 +163,6 @@ DB_SHOW_COMMAND(com, db_show_com)
 
 DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps)
 {
-   VNET_ITERATOR_DECL(vnet_iter);
-   const struct ifnet *ifp;
int i, showall = 0;
 
for (i = 0; modif[i] != '\0'; i++)
@@ -172,24 +172,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va
break;
}
 
-   VNET_FOREACH(vnet_iter) {
-   TAILQ_FOREACH(ifp, _ifnet, if_list)
-   if (ifp->if_type == IFT_IEEE80211) {
-   const struct ieee80211com *ic = ifp->if_l2com;
-
-   if (!showall) {
-   const struct ieee80211vap *vap;
-   db_printf("%s: com %p vaps:",
-   ifp->if_xname, ic);
-   TAILQ_FOREACH(vap, >ic_vaps,
-   iv_next)
-   db_printf(" %s(%p)",
-   vap->iv_ifp->if_xname, vap);
-   db_printf("\n");
-   } else
-   _db_show_com(ic, 1, 1, 1, 1);
-   }
-   }
+   ieee80211_iterate_coms(_db_show_all_vaps, );
 }
 
 #ifdef IEEE80211_SUPPORT_MESH
@@ -683,6 +666,21 @@ _db_show_com(const struct ieee80211com *
 }
 
 static void
+_db_show_all_vaps(void *arg, struct ieee80211com *ic)
+{
+   int showall = *(int *)arg;
+
+   if (!showall) {
+   const struct ieee80211vap *vap;
+   db_printf("%s: com %p vaps:", ic->ic_name, ic);
+   TAILQ_FOREACH(vap, >ic_vaps, iv_next)
+   db_printf(" %s(%p)", vap->iv_ifp->if_xname, vap);
+   db_printf("\n");
+   } else
+   _db_show_com(ic, 1, 1, 1, 1);
+}
+
+static void
 _db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
 {
int i;

Modified: head/sys/net80211/ieee80211_var.h
==
--- head/sys/net80211/ieee80211_var.h   Tue May 17 15:36:40 2016
(r300062)
+++ head/sys/net80211/ieee80211_var.h   Tue May 17 16:38:18 2016
(r300063)
@@ -714,6 +714,8 @@ voidieee80211_drain(struct ieee80211com
 void   ieee80211_chan_init(struct ieee80211com *);
 struct ieee80211com *ieee80211_find_vap(const uint8_t mac[IEEE80211_ADDR_LEN]);
 struct ieee80211com *ieee80211_find_com(const char *name);
+typedef void ieee80211_com_iter_func(void *, struct ieee80211com *);
+void   ieee80211_iterate_coms(ieee80211_com_iter_func *, void *);
 intieee80211_media_change(struct ifnet *);
 void   ieee80211_media_status(struct ifnet *, struct ifmediareq *);
 intieee80211_ioctl(struct ifnet *, u_long, caddr_t);
___
svn-src-all@freebsd.org mailing list

Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern

2016-05-17 Thread Warner Losh
I've updated the g_bio man page with all the info presented here. Please
let me know if I missed anything, or if you have suggestions for
improvement.

Warner


On Mon, May 9, 2016 at 12:21 PM, Steven Hartland 
wrote:

> On 09/05/2016 18:21, Warner Losh wrote:
>
> On May 9, 2016, at 11:14 AM, Steven Hartland  
>  wrote:
>
>
>
> On 09/05/2016 18:04, Alan Somers wrote:
>
>
> On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh  
>  wrote:
> Author: imp
> Date: Wed Feb 17 17:16:02 2016
> New Revision: 295707
> URL: https://svnweb.freebsd.org/changeset/base/295707
>
> Log:
>   Create an API to reset a struct bio (g_reset_bio). This is mandatory
>   for all struct bio you get back from g_{new,alloc}_bio. Temporary
>   bios that you create on the stack or elsewhere should use this before
>   first use of the bio, and between uses of the bio. At the moment, it
>   is nothing more than a wrapper around bzero, but that may change in
>   the future. The wrapper also removes one place where we encode the
>   size of struct bio in the KBI.
>
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
>   head/sys/dev/mmc/mmcsd.c
>   head/sys/dev/virtio/block/virtio_blk.c
>   head/sys/geom/geom.h
>   head/sys/geom/geom_io.c
>   head/sys/geom/journal/g_journal.c
>   head/sys/geom/mirror/g_mirror.c
>   head/sys/geom/raid/g_raid.c
>   head/sys/geom/raid3/g_raid3.c
>   head/sys/kern/kern_physio.c
>
> smh noticed that while your commit message says that g_reset_bio is mandatory 
> after g_{new,alloc}_bio, your diff only replaced existing calls to bzero.  
> You didn't insert g_reset_bio calls after all g_alloc_bio calls, for example 
> in vdev_geom_io_start.  Do you intend to follow up this change with a 
> g_reset_bio everywhere that g_alloc_bio is called, or did you mean that 
> g_reset_bio is optional after all bios returned by g_{new,alloc}_bio?
>
>
> Yer I was just penning this too:
> This commit was just referenced in https://reviews.freebsd.org/D6153
> It seems rather odd to require all callers to g_{new,alloc}_bio to also call 
> g_reset_bio.
>
> I don’t. Please see my other reply. It’s only when you *RE*use the bio that 
> you need to call g_reset_bio(), not when you use it in the first place. You 
> can no longer call bzero() on the bio to reset it.
>
>
> I assume this is because uma can return an existing object instead of fresh 
> one hence its not guaranteed to be bzeroed? If so why have the caller 
> responsible, seems petty error prone. A quick look at users of g_alloc_bio it 
> seems like this is something that's not done currently done in all places, 
> even some usages of memset still hanging around, are these cases a bug?
>
> No. That’s not the case at all. There’s going to be contents of the BIO that 
> cannot be blithely cleared by the users of the memory. Many other structures 
> in the kernel are like this, but bio wasn’t previously.
>
>
> If the concept of this was to ensure correctly initialised objects from uma 
> would the callback handers to uma_zcreate not be a better option as that 
> would guarantee things are correct instead of leaving it to the caller?
>
> No. It’s to ensure internal state to the bio isn’t blown away by a subsequent 
> bzero() call before calling g_destroy_bio().
>
>
> As a side matter, this area really needs some man pages so the its clear to 
> all what is needed and when.
>
> Agreed. The whole storage stack, however, is wonderfully under-documented. 
> I’ve started documenting CAM, but handn’t worked my way back to geom…
>
>
> Thanks for the clarifications Warner, appreciated :)
>
> Regards
> Steve
>
___
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: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-17 Thread Pedro Giffuni

Hello;

On 05/17/16 10:36, George V. Neville-Neil wrote:

Author: gnn
Date: Tue May 17 15:36:40 2016
New Revision: 300062
URL: https://svnweb.freebsd.org/changeset/base/300062

Log:
  Kill off ReiserFS as it is no longer supported, for obvious reasons.



It's not so obvious since the fs worked and could've been useful for
people migrating from ancient linux.

It's a welcome move though.


Deleted:
  head/sys/gnu/fs/
  head/sys/modules/reiserfs/
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue May 17 15:21:17 2016(r300061)
+++ head/sys/modules/Makefile   Tue May 17 15:36:40 2016(r300062)
@@ -312,7 +312,6 @@ SUBDIR= \
${_rdma} \
${_rdrand_rng} \
re \
-   reiserfs \
rl \
rtwn \
${_rtwnfw} \



You will have to cleanup sys/conf/files (at least lines 3158-3166) as well.

If you are cleaning old cruft, can we please kill ctm(1)?

Regards,

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


Re: svn commit: r300003 - head/share/man/man4

2016-05-17 Thread Ian Lepore
On Tue, 2016-05-17 at 12:05 -0400, George Neville-Neil wrote:
> 
> On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote:
> 
> > On Tuesday, 17 May 2016 at  0:04:51 -0700, John Baldwin wrote:
> > > On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote:
> > > > Author: grog
> > > > Date: Tue May 17 04:40:00 2016
> > > > New Revision: 33
> > > > URL: https://svnweb.freebsd.org/changeset/base/33
> > > > 
> > > > Log:
> > > >   Correct use of incorrect grammar.
> > > > 
> > > > Modified:
> > > >   head/share/man/man4/gdb.4
> > > > 
> > > > Modified: head/share/man/man4/gdb.4
> > > > ===
> > > > ===
> > > > --- head/share/man/man4/gdb.4   Tue May 17 04:03:45 2016
> > > > (r32)
> > > > +++ head/share/man/man4/gdb.4   Tue May 17 04:40:00 2016
> > > > (r33)
> > > > @@ -595,7 +595,7 @@ run the link at more than 9600 bps.
> > > >  Firewire connections do not have this problem.
> > > >  .Pp
> > > >  The debugging macros
> > > > -.Dq "just grown" .
> > > > +.Dq "just growed" .
> > > 
> > > "grew"?
> > 
> > "Just growed".  Did you never read Uncle Tom's Cabin?  Check Topsy.
> > 
> > Of course, what this page really needs is a good overhaul.  I'll
> > see
> > if I can muster the energy.
> > 
> 
> Can you just be honest and admit that this is a trivial commit to you
> can vote in the core elections?
> 
> And Seriously?  Uncle Toms Cabin?
> 
> Best,
> George

I hadn't heard that our manpage style guidelines had changed to 1850s
U.S. southern colloquial.  I applaud the bold move, it's going to make
the mundane task of reading manpages much more entertaining, and is
sure to bring new attention to the FreeBSD project in general as the
word of the change spreads.

-- Ian

___
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: r300003 - head/share/man/man4

2016-05-17 Thread George Neville-Neil


On 17 May 2016, at 3:16, Greg 'groggy' Lehey wrote:

> On Tuesday, 17 May 2016 at  0:04:51 -0700, John Baldwin wrote:
>> On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote:
>>> Author: grog
>>> Date: Tue May 17 04:40:00 2016
>>> New Revision: 33
>>> URL: https://svnweb.freebsd.org/changeset/base/33
>>>
>>> Log:
>>>   Correct use of incorrect grammar.
>>>
>>> Modified:
>>>   head/share/man/man4/gdb.4
>>>
>>> Modified: head/share/man/man4/gdb.4
>>> ==
>>> --- head/share/man/man4/gdb.4   Tue May 17 04:03:45 2016
>>> (r32)
>>> +++ head/share/man/man4/gdb.4   Tue May 17 04:40:00 2016
>>> (r33)
>>> @@ -595,7 +595,7 @@ run the link at more than 9600 bps.
>>>  Firewire connections do not have this problem.
>>>  .Pp
>>>  The debugging macros
>>> -.Dq "just grown" .
>>> +.Dq "just growed" .
>>
>> "grew"?
>
> "Just growed".  Did you never read Uncle Tom's Cabin?  Check Topsy.
>
> Of course, what this page really needs is a good overhaul.  I'll see
> if I can muster the energy.
>

Can you just be honest and admit that this is a trivial commit to you can vote 
in the core elections?

And Seriously?  Uncle Toms Cabin?

Best,
George


signature.asc
Description: OpenPGP digital signature


Re: svn commit: r300003 - head/share/man/man4

2016-05-17 Thread John Baldwin
On Tuesday, May 17, 2016 05:16:19 PM Greg 'groggy' Lehey wrote:
> On Tuesday, 17 May 2016 at  0:04:51 -0700, John Baldwin wrote:
> > On Tuesday, May 17, 2016 04:40:01 AM Greg Lehey wrote:
> >> Author: grog
> >> Date: Tue May 17 04:40:00 2016
> >> New Revision: 33
> >> URL: https://svnweb.freebsd.org/changeset/base/33
> >>
> >> Log:
> >>   Correct use of incorrect grammar.
> >>
> >> Modified:
> >>   head/share/man/man4/gdb.4
> >>
> >> Modified: head/share/man/man4/gdb.4
> >> ==
> >> --- head/share/man/man4/gdb.4  Tue May 17 04:03:45 2016
> >> (r32)
> >> +++ head/share/man/man4/gdb.4  Tue May 17 04:40:00 2016
> >> (r33)
> >> @@ -595,7 +595,7 @@ run the link at more than 9600 bps.
> >>  Firewire connections do not have this problem.
> >>  .Pp
> >>  The debugging macros
> >> -.Dq "just grown" .
> >> +.Dq "just growed" .
> >
> > "grew"?
> 
> "Just growed".  Did you never read Uncle Tom's Cabin?  Check Topsy.

http://www.dictionary.com/browse/grow?s=t

We attempt to write our documentation in English.  If you're going to do a
token commit to fix incorrect grammar, you should at least use correct
grammar.  Alternatively, if you want to make a token commit, at least pick
a patch in a docs PR and do something a bit more substantial.

-- 
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: r299977 - head/sys/dev/acpica/Osd

2016-05-17 Thread Jim Harris
On Mon, May 16, 2016 at 2:33 PM, John Baldwin  wrote:

> Author: jhb
> Date: Mon May 16 21:33:31 2016
> New Revision: 299977
> URL: https://svnweb.freebsd.org/changeset/base/299977
>
> Log:
>   Use polling spin loops for timeouts during early boot.
>
>   Some ACPI operations such as mutex acquires and event waits accept a
>   timeout.  The ACPI OSD layer implements these timeouts by using regular
>   sleep timeouts.  However, this doesn't work during early boot before
>   event timers are setup.  Instead, use polling combined with DELAY()
>   to spin.
>
>   This fixes booting on upcoming Intel systems with Kaby Lake processors.
>

Thanks!


>
>   Tested by:"Jeffrey E Pieper" 
>   Reviewed by:  jimharris
>   MFC after:1 week
>
> Modified:
>   head/sys/dev/acpica/Osd/OsdSynch.c
>
> Modified: head/sys/dev/acpica/Osd/OsdSynch.c
>
> ==
> --- head/sys/dev/acpica/Osd/OsdSynch.c  Mon May 16 20:26:30 2016
> (r299976)
> +++ head/sys/dev/acpica/Osd/OsdSynch.c  Mon May 16 21:33:31 2016
> (r299977)
> @@ -188,6 +188,23 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl
> }
> break;
> default:
> +   if (cold) {
> +   /*
> +* Just spin polling the semaphore once a
> +* millisecond.
> +*/
> +   while (!ACPISEM_AVAIL(as, Units)) {
> +   if (Timeout == 0) {
> +   status = AE_TIME;
> +   break;
> +   }
> +   Timeout--;
> +   mtx_unlock(>as_lock);
> +   DELAY(1000);
> +   mtx_lock(>as_lock);
> +   }
> +   break;
> +   }
> tmo = timeout2hz(Timeout);
> while (!ACPISEM_AVAIL(as, Units)) {
> prevtick = ticks;
> @@ -381,6 +398,23 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI
> }
> break;
> default:
> +   if (cold) {
> +   /*
> +* Just spin polling the mutex once a
> +* millisecond.
> +*/
> +   while (!ACPIMTX_AVAIL(am)) {
> +   if (Timeout == 0) {
> +   status = AE_TIME;
> +   break;
> +   }
> +   Timeout--;
> +   mtx_unlock(>am_lock);
> +   DELAY(1000);
> +   mtx_lock(>am_lock);
> +   }
> +   break;
> +   }
> tmo = timeout2hz(Timeout);
> while (!ACPIMTX_AVAIL(am)) {
> prevtick = ticks;
>
>
___
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: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 15:36:40 2016
New Revision: 300062
URL: https://svnweb.freebsd.org/changeset/base/300062

Log:
  Kill off ReiserFS as it is no longer supported, for obvious reasons.

Deleted:
  head/sys/gnu/fs/
  head/sys/modules/reiserfs/
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue May 17 15:21:17 2016(r300061)
+++ head/sys/modules/Makefile   Tue May 17 15:36:40 2016(r300062)
@@ -312,7 +312,6 @@ SUBDIR= \
${_rdma} \
${_rdrand_rng} \
re \
-   reiserfs \
rl \
rtwn \
${_rtwnfw} \
___
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: r300061 - in head/sys: conf dev/iscsi modules/iscsi

2016-05-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 17 15:21:17 2016
New Revision: 300061
URL: https://svnweb.freebsd.org/changeset/base/300061

Log:
  Rename icl_proxy.c to icl_soft_proxy.c, to make it clear it's a part
  of software ICL backend.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/dev/iscsi/icl_soft_proxy.c
 - copied unchanged from r300060, head/sys/dev/iscsi/icl_proxy.c
Deleted:
  head/sys/dev/iscsi/icl_proxy.c
Modified:
  head/sys/conf/files
  head/sys/dev/iscsi/icl.h
  head/sys/modules/iscsi/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue May 17 15:18:01 2016(r300060)
+++ head/sys/conf/files Tue May 17 15:21:17 2016(r300061)
@@ -1629,8 +1629,8 @@ ipw_monitor.fwoptional ipwmonitorfw |
clean   "ipw_monitor.fw"
 dev/iscsi/icl.coptional iscsi | ctl
 dev/iscsi/icl_conn_if.moptional iscsi | ctl
-dev/iscsi/icl_proxy.c  optional iscsi | ctl
 dev/iscsi/icl_soft.c   optional iscsi | ctl
+dev/iscsi/icl_soft_proxy.c optional iscsi | ctl
 dev/iscsi/iscsi.c  optional iscsi scbus
 dev/iscsi_initiator/iscsi.coptional iscsi_initiator scbus
 dev/iscsi_initiator/iscsi_subr.c   optional iscsi_initiator scbus

Modified: head/sys/dev/iscsi/icl.h
==
--- head/sys/dev/iscsi/icl.hTue May 17 15:18:01 2016(r300060)
+++ head/sys/dev/iscsi/icl.hTue May 17 15:21:17 2016(r300061)
@@ -150,7 +150,8 @@ int icl_listen_add(struct icl_listen *
 inticl_listen_remove(struct icl_listen *il, struct 
sockaddr *sa);
 
 /*
- * Those two are not a public API; only to be used between icl_soft.c and 
icl_proxy.c.
+ * Those two are not a public API; only to be used between icl_soft.c
+ * and icl_soft_proxy.c.
  */
 inticl_soft_handoff_sock(struct icl_conn *ic, struct 
socket *so);
 inticl_soft_proxy_connect(struct icl_conn *ic, int domain,

Copied: head/sys/dev/iscsi/icl_soft_proxy.c (from r300060, 
head/sys/dev/iscsi/icl_proxy.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/iscsi/icl_soft_proxy.c Tue May 17 15:21:17 2016
(r300061, copy of r300060, head/sys/dev/iscsi/icl_proxy.c)
@@ -0,0 +1,375 @@
+/*-
+ * Copyright (c) 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1990, 1993
+ * The Regents of the University of California.  All rights reserved.
+ *
+ * sendfile(2) and related extensions:
+ * Copyright (c) 1998, David Greenman. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior 

svn commit: r300060 - in stable/10/sys: dev/aic7xxx dev/aic7xxx/aicasm dev/ciss dev/drm2/radeon dev/drm2/ttm dev/hptiop dev/hwpmc dev/isci/scil dev/pccbb dev/wbwd dev/wtap dev/wtap/plugins sys

2016-05-17 Thread Pedro F. Giffuni
Author: pfg
Date: Tue May 17 15:18:01 2016
New Revision: 300060
URL: https://svnweb.freebsd.org/changeset/base/300060

Log:
  MFC r298931, r298981, r299375:
  
  Minor spelling fixes in:
  sys/dev, sys/sys
  
  Many of these have user-visible strings.

Modified:
  stable/10/sys/dev/aic7xxx/aic79xx.c
  stable/10/sys/dev/aic7xxx/aic79xx.h
  stable/10/sys/dev/aic7xxx/aic79xx.reg
  stable/10/sys/dev/aic7xxx/aic79xx.seq
  stable/10/sys/dev/aic7xxx/aic79xx_inline.h
  stable/10/sys/dev/aic7xxx/aic79xx_pci.c
  stable/10/sys/dev/aic7xxx/aic7xxx.c
  stable/10/sys/dev/aic7xxx/aic7xxx.h
  stable/10/sys/dev/aic7xxx/aic7xxx.reg
  stable/10/sys/dev/aic7xxx/aic7xxx.seq
  stable/10/sys/dev/aic7xxx/aic7xxx_inline.h
  stable/10/sys/dev/aic7xxx/aic7xxx_pci.c
  stable/10/sys/dev/aic7xxx/aicasm/aicasm.c
  stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y
  stable/10/sys/dev/ciss/ciss.c
  stable/10/sys/dev/drm2/radeon/radeon_fb.c
  stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c
  stable/10/sys/dev/hptiop/hptiop.c
  stable/10/sys/dev/hwpmc/hwpmc_mod.c
  stable/10/sys/dev/isci/scil/scic_phy.h
  stable/10/sys/dev/isci/scil/scic_sds_phy.c
  stable/10/sys/dev/pccbb/pccbb_pci.c
  stable/10/sys/dev/wbwd/wbwd.c
  stable/10/sys/dev/wtap/if_wtap.c
  stable/10/sys/dev/wtap/if_wtap_module.c
  stable/10/sys/dev/wtap/plugins/visibility.c
  stable/10/sys/sys/ata.h
  stable/10/sys/sys/buf.h
  stable/10/sys/sys/buf_ring.h
  stable/10/sys/sys/iconv.h
  stable/10/sys/sys/imgact_binmisc.h
  stable/10/sys/sys/imgact_elf.h
  stable/10/sys/sys/ipc.h
  stable/10/sys/sys/ipmi.h
  stable/10/sys/sys/linker.h
  stable/10/sys/sys/memrange.h
  stable/10/sys/sys/pmc.h
  stable/10/sys/sys/priority.h
  stable/10/sys/sys/priv.h
  stable/10/sys/sys/proc.h
  stable/10/sys/sys/procctl.h
  stable/10/sys/sys/shm.h
  stable/10/sys/sys/sockio.h
  stable/10/sys/sys/soundcard.h
  stable/10/sys/sys/sx.h
  stable/10/sys/sys/sysctl.h
  stable/10/sys/sys/user.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/aic7xxx/aic79xx.c
==
--- stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:17:23 2016
(r300059)
+++ stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:18:01 2016
(r300060)
@@ -1209,7 +1209,7 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 * that requires host assistance for completion.
 * While handling the message phase(s), we will be
 * notified by the sequencer after each byte is
-* transfered so we can track bus phase changes.
+* transferred so we can track bus phase changes.
 *
 * If this is the first time we've seen a HOST_MSG_LOOP
 * interrupt, initialize the state of the host message
@@ -1623,7 +1623,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd
/*
 * Although the driver does not care about the
 * 'Selection in Progress' status bit, the busy
-* LED does.  SELINGO is only cleared by a sucessfull
+* LED does.  SELINGO is only cleared by a successful
 * selection, so we must manually clear it to insure
 * the LED turns off just incase no future successful
 * selections occur (e.g. no devices on the bus).
@@ -2699,7 +2699,7 @@ ahd_clear_critical_section(struct ahd_so
ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP);
ahd_outb(ahd, SIMODE1, simode1);
/*
-* SCSIINT seems to glitch occassionally when
+* SCSIINT seems to glitch occasionally when
 * the interrupt masks are restored.  Clear SCSIINT
 * one more time so that only persistent errors
 * are seen as a real interrupt.
@@ -3029,7 +3029,7 @@ ahd_validate_width(struct ahd_softc *ahd
 
 /*
  * Update the bitmask of targets for which the controller should
- * negotiate with at the next convenient oportunity.  This currently
+ * negotiate with at the next convenient opportunity.  This currently
  * means the next time we send the initial identify messages for
  * a new transaction.
  */
@@ -3380,7 +3380,7 @@ ahd_update_neg_table(struct ahd_softc *a
 
/*
 * During packetized transfers, the target will
-* give us the oportunity to send command packets
+* give us the opportunity to send command packets
 * without us asserting attention.
 */
if ((tinfo->ppr_options & MSG_EXT_PPR_IU_REQ) == 0)
@@ -4845,7 +4845,7 @@ ahd_handle_msg_reject(struct ahd_softc *
 
/*
 * Requeue all tagged commands for this target
-* currently in our posession so they can be
+* currently in our possession so they can be
 * converted to untagged commands.
 */
ahd_search_qinfifo(ahd, 

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

2016-05-17 Thread Alan Somers
Author: asomers
Date: Tue May 17 15:17:23 2016
New Revision: 300059
URL: https://svnweb.freebsd.org/changeset/base/300059

Log:
  Speed up vdev_geom_open_by_guids
  
  Speedup is hard to measure because the only time vdev_geom_open_by_guids
  gets called on many drives at the same time is during boot. But with
  vdev_geom_open hacked to always call vdev_geom_open_by_guids, operations
  like "zpool create" speed up by 65%.
  
  sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  
* Read all of a vdev's labels in parallel instead of sequentially.
* In vdev_geom_read_config, don't read the entire label, including
  the uberblock.  That's a waste of RAM.  Just read the vdev config
  nvlist.  Reduces the IO and RAM involved with tasting from 1MB to
  448KB.
  
  Reviewed by:  avg
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D6153

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 
17 15:12:57 2016(r300058)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 
17 15:17:23 2016(r300059)
@@ -325,52 +325,82 @@ nvlist_get_guids(nvlist_t *list, uint64_
(void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid);
 }
 
-static int
-vdev_geom_io(struct g_consumer *cp, int cmd, void *data, off_t offset, off_t 
size)
+/*
+ * Issue one or more bios to the vdev in parallel
+ * cmds, datas, offsets, errors, and sizes are arrays of length ncmds.  Each IO
+ * operation is described by parallel entries from each array.  There may be
+ * more bios actually issued than entries in the array
+ */
+static void
+vdev_geom_io(struct g_consumer *cp, int *cmds, void **datas, off_t *offsets,
+off_t *sizes, int *errors, int ncmds)
 {
-   struct bio *bp;
+   struct bio **bios;
u_char *p;
-   off_t off, maxio;
-   int error;
+   off_t off, maxio, s, end;
+   int i, n_bios, j;
+   size_t bios_size;
 
-   ASSERT((offset % cp->provider->sectorsize) == 0);
-   ASSERT((size % cp->provider->sectorsize) == 0);
-
-   bp = g_alloc_bio();
-   off = offset;
-   offset += size;
-   p = data;
maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize);
-   error = 0;
+   n_bios = 0;
 
-   for (; off < offset; off += maxio, p += maxio, size -= maxio) {
-   g_reset_bio(bp);
-   bp->bio_cmd = cmd;
-   bp->bio_done = NULL;
-   bp->bio_offset = off;
-   bp->bio_length = MIN(size, maxio);
-   bp->bio_data = p;
-   g_io_request(bp, cp);
-   error = biowait(bp, "vdev_geom_io");
-   if (error != 0)
-   break;
+   /* How many bios are required for all commands ? */
+   for (i = 0; i < ncmds; i++)
+   n_bios += (sizes[i] + maxio - 1) / maxio;
+
+   /* Allocate memory for the bios */
+   bios_size = n_bios * sizeof(struct bio*);
+   bios = kmem_zalloc(bios_size, KM_SLEEP);
+
+   /* Prepare and issue all of the bios */
+   for (i = j = 0; i < ncmds; i++) {
+   off = offsets[i];
+   p = datas[i];
+   s = sizes[i];
+   end = off + s;
+   ASSERT((off % cp->provider->sectorsize) == 0);
+   ASSERT((s % cp->provider->sectorsize) == 0);
+
+   for (; off < end; off += maxio, p += maxio, s -= maxio, j++) {
+   bios[j] = g_alloc_bio();
+   bios[j]->bio_cmd = cmds[i];
+   bios[j]->bio_done = NULL;
+   bios[j]->bio_offset = off;
+   bios[j]->bio_length = MIN(s, maxio);
+   bios[j]->bio_data = p;
+   g_io_request(bios[j], cp);
+   }
+   }
+   ASSERT(j == n_bios);
+
+   /* Wait for all of the bios to complete, and clean them up */
+   for (i = j = 0; i < ncmds; i++) {
+   off = offsets[i];
+   s = sizes[i];
+   end = off + s;
+
+   for (; off < end; off += maxio, s -= maxio, j++) {
+   errors[i] = biowait(bios[j], "vdev_geom_io") || 
errors[i];
+   g_destroy_bio(bios[j]);
+   }
}
-
-   g_destroy_bio(bp);
-   return (error);
+   kmem_free(bios, bios_size);
 }
 
 static int
 vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config)
 {
struct g_provider *pp;
-   vdev_label_t *label;
+   vdev_phys_t *vdev_lists[VDEV_LABELS];
char *p, *buf;
size_t buflen;
-   uint64_t psize;
-   off_t offset, size;
-  

svn commit: r300058 - head/sys/dev/isp

2016-05-17 Thread Alexander Motin
Author: mav
Date: Tue May 17 15:12:57 2016
New Revision: 300058
URL: https://svnweb.freebsd.org/changeset/base/300058

Log:
  Make RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable.
  
  It is normal for ZOMBIE ports to be logged out.  This status is not really
  an error until Gone Device Timeout expires, so make CAM retry after delay.
  
  MFC after:1 week

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

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue May 17 14:52:05 2016(r300057)
+++ head/sys/dev/isp/isp.c  Tue May 17 15:12:57 2016(r300058)
@@ -6517,6 +6517,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta
{
const char *reason;
uint8_t sts = sp->req_completion_status & 0xff;
+   fcparam *fcp = FCPARAM(isp, 0);
+   fcportdb_t *lp;
 
/*
 * It was there (maybe)- treat as a selection timeout.
@@ -6534,8 +6536,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta
 * to force a re-login of this unit. If we're on fabric,
 * then we'll have to log in again as a matter of course.
 */
-   if (FCPARAM(isp, 0)->isp_topo == TOPO_NL_PORT ||
-   FCPARAM(isp, 0)->isp_topo == TOPO_FL_PORT) {
+   if (fcp->isp_topo == TOPO_NL_PORT ||
+   fcp->isp_topo == TOPO_FL_PORT) {
mbreg_t mbs;
MBSINIT(, MBOX_INIT_LIP, MBLOGALL, 0);
if (ISP_CAP_2KLOGIN(isp)) {
@@ -6544,7 +6546,12 @@ isp_parse_status(ispsoftc_t *isp, ispsta
isp_mboxcmd_qnw(isp, , 1);
}
if (XS_NOERR(xs)) {
-   XS_SETERR(xs, HBA_SELTIMEOUT);
+   lp = >portdb[XS_TGT(xs)];
+   if (lp->state == FC_PORTDB_STATE_ZOMBIE) {
+   *XS_STSP(xs) = SCSI_BUSY;
+   XS_SETERR(xs, HBA_TGTBSY);
+   } else
+   XS_SETERR(xs, HBA_SELTIMEOUT);
}
return;
}
@@ -6668,6 +6675,8 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
{
const char *reason;
uint8_t sts = sp->req_completion_status & 0xff;
+   fcparam *fcp = FCPARAM(isp, XS_CHANNEL(xs));
+   fcportdb_t *lp;
 
/*
 * It was there (maybe)- treat as a selection timeout.
@@ -6685,7 +6694,12 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
 * There is no MBOX_INIT_LIP for the 24XX.
 */
if (XS_NOERR(xs)) {
-   XS_SETERR(xs, HBA_SELTIMEOUT);
+   lp = >portdb[XS_TGT(xs)];
+   if (lp->state == FC_PORTDB_STATE_ZOMBIE) {
+   *XS_STSP(xs) = SCSI_BUSY;
+   XS_SETERR(xs, HBA_TGTBSY);
+   } else
+   XS_SETERR(xs, HBA_SELTIMEOUT);
}
return;
}
___
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: r300057 - stable/10/sbin/reboot

2016-05-17 Thread Renato Botelho
Author: garga (ports committer)
Date: Tue May 17 14:52:05 2016
New Revision: 300057
URL: https://svnweb.freebsd.org/changeset/base/300057

Log:
  MFC r299196:
  
  Add missing parameters -N and -l to reroot and halt usage()
  
  Approved by:  bapt
  Sponsored by: Rubicon Communications (Netgate)
  Differential Revision:https://reviews.freebsd.org/D6173

Modified:
  stable/10/sbin/reboot/reboot.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/reboot/reboot.c
==
--- stable/10/sbin/reboot/reboot.c  Tue May 17 14:10:45 2016
(r300056)
+++ stable/10/sbin/reboot/reboot.c  Tue May 17 14:52:05 2016
(r300057)
@@ -248,8 +248,8 @@ usage(void)
 {
 
(void)fprintf(stderr, dohalt ?
-   "usage: halt [-lnpq] [-k kernel]\n" :
-   "usage: reboot [-dlnpq] [-k kernel]\n");
+   "usage: halt [-lNnpq] [-k kernel]\n" :
+   "usage: reboot [-dlNnpqr] [-k kernel]\n");
exit(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: r300056 - in head/sys/boot: common efi/libefi

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 14:10:45 2016
New Revision: 300056
URL: https://svnweb.freebsd.org/changeset/base/300056

Log:
  It sure would be nice to use printf with wide strings. Implement %S to
  do that. The C_WIDEOUT flag indicates that the console supports
  it. Mark the EFI console as supporting this.
  
  MFC After: 3 days

Modified:
  head/sys/boot/common/bootstrap.h
  head/sys/boot/common/util.c
  head/sys/boot/efi/libefi/efi_console.c

Modified: head/sys/boot/common/bootstrap.h
==
--- head/sys/boot/common/bootstrap.hTue May 17 14:10:44 2016
(r300055)
+++ head/sys/boot/common/bootstrap.hTue May 17 14:10:45 2016
(r300056)
@@ -102,6 +102,7 @@ struct console 
 #define C_PRESENTOUT   (1<<1)  /* console can provide output */
 #define C_ACTIVEIN (1<<2)  /* user wants input from console */
 #define C_ACTIVEOUT(1<<3)  /* user wants output to console */
+#defineC_WIDEOUT   (1<<4)  /* c_out routine groks wide chars */
 void   (* c_probe)(struct console *cp);/* set c_flags to match 
hardware */
 int(* c_init)(int arg);/* reinit XXX 
may need more args */
 void   (* c_out)(int c);   /* emit c */

Modified: head/sys/boot/common/util.c
==
--- head/sys/boot/common/util.c Tue May 17 14:10:44 2016(r300055)
+++ head/sys/boot/common/util.c Tue May 17 14:10:45 2016(r300056)
@@ -120,6 +120,7 @@ printf(const char *fmt, ...)
va_list ap;
const char *hex = "0123456789abcdef";
char buf[32], *s;
+   uint16_t *S;
unsigned long long u;
int c, l;
 
@@ -143,6 +144,10 @@ nextfmt:
for (s = va_arg(ap, char *); *s != '\0'; s++)
putchar(*s);
break;
+   case 'S':   /* Assume console can cope with wide chars */
+   for (S = va_arg(ap, uint16_t *); *S != 0; S++)
+   putchar(*S);
+   break;
case 'd':   /* A lie, always prints unsigned */
case 'u':
case 'x':

Modified: head/sys/boot/efi/libefi/efi_console.c
==
--- head/sys/boot/efi/libefi/efi_console.c  Tue May 17 14:10:44 2016
(r300055)
+++ head/sys/boot/efi/libefi/efi_console.c  Tue May 17 14:10:45 2016
(r300056)
@@ -61,7 +61,7 @@ int efi_cons_poll(void);
 struct console efi_console = {
"efi",
"EFI console",
-   0,
+   C_WIDEOUT,
efi_cons_probe,
efi_cons_init,
efi_cons_putchar,
___
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: r300055 - head/sys/boot/ficl

2016-05-17 Thread Warner Losh
Author: imp
Date: Tue May 17 14:10:44 2016
New Revision: 300055
URL: https://svnweb.freebsd.org/changeset/base/300055

Log:
  Minor space tweak to make things consistent.
  
  MFC After: 3 days

Modified:
  head/sys/boot/ficl/words.c

Modified: head/sys/boot/ficl/words.c
==
--- head/sys/boot/ficl/words.c  Tue May 17 14:06:55 2016(r300054)
+++ head/sys/boot/ficl/words.c  Tue May 17 14:10:44 2016(r300055)
@@ -5198,12 +5198,11 @@ void ficlCompileCore(FICL_SYSTEM *pSys)
 /*
 ** Set up system's outer interpreter loop - maybe this should be in 
initSystem?
 */
-   pSys->pInterp[0] = pSys->pInterpret;
-   pSys->pInterp[1] = pSys->pBranchParen;
-   pSys->pInterp[2] = (FICL_WORD *)(void *)(-2);
+pSys->pInterp[0] = pSys->pInterpret;
+pSys->pInterp[1] = pSys->pBranchParen;
+pSys->pInterp[2] = (FICL_WORD *)(void *)(-2);
 
 assert(dictCellsAvail(dp) > 0);
 
 return;
 }
-
___
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: r300053 - stable/9/sys/amd64/include

2016-05-17 Thread Andriy Gapon
Author: avg
Date: Tue May 17 14:02:05 2016
New Revision: 300053
URL: https://svnweb.freebsd.org/changeset/base/300053

Log:
  pick up specialreg.h changes from r273338 to fix r300037
  
  The original change applies to x86 family of platforms, in this branch
  it's only for amd64 where it is really required.
  
  This is a direct commit.
  
  Reported by:  Eugene Grosbein 

Modified:
  stable/9/sys/amd64/include/specialreg.h

Modified: stable/9/sys/amd64/include/specialreg.h
==
--- stable/9/sys/amd64/include/specialreg.h Tue May 17 13:18:57 2016
(r300052)
+++ stable/9/sys/amd64/include/specialreg.h Tue May 17 14:02:05 2016
(r300053)
@@ -81,6 +81,7 @@
 #defineEFER_LME 0x00100/* Long mode enable (R/W) */
 #defineEFER_LMA 0x00400/* Long mode active (R) */
 #defineEFER_NXE 0x00800/* PTE No-Execute bit enable (R/W) */
+#defineEFER_SVM 0x01000/* SVM enable bit for AMD, reserved for 
Intel */
 
 /*
  * Intel Extended Features registers
@@ -580,8 +581,21 @@
 #defineMSR_IORRMASK1   0xc0010019
 #defineMSR_TOP_MEM 0xc001001a  /* boundary for ram below 4G */
 #defineMSR_TOP_MEM20xc001001d  /* boundary for ram above 4G */
+#defineMSR_NB_CFG1 0xc001001f  /* NB configuration 1 */
+#defineMSR_P_STATE_LIMIT 0xc0010061/* P-state Current Limit 
Register */
+#defineMSR_P_STATE_CONTROL 0xc0010062  /* P-state Control Register */
+#defineMSR_P_STATE_STATUS 0xc0010063   /* P-state Status Register */
+#defineMSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */
+#defineMSR_SMM_ADDR0xc0010112  /* SMM TSEG base address */
+#defineMSR_SMM_MASK0xc0010113  /* SMM TSEG address mask */
+#defineMSR_IC_CFG  0xc0011021  /* Instruction Cache 
Configuration */
 #defineMSR_K8_UCODE_UPDATE 0xc0010020  /* update microcode */
 #defineMSR_MC0_CTL_MASK0xc0010044
+#defineMSR_VM_CR   0xc0010114 /* SVM: feature control */
+#defineMSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area 
address */
+
+/* MSR_VM_CR related */
+#defineVM_CR_SVMDIS0x10/* SVM: disabled by BIOS */
 
 /* VIA ACE crypto featureset: for via_feature_rng */
 #defineVIA_HAS_RNG 1   /* cpu has RNG */
___
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: r300054 - head/sys/netinet6

2016-05-17 Thread Andrey V. Elsukov
Author: ae
Date: Tue May 17 14:06:55 2016
New Revision: 300054
URL: https://svnweb.freebsd.org/changeset/base/300054

Log:
  Call RO_RTFREE() when we have detected the change of destination
  address, otherwise the old route will be used with new destination.
  
  MFC after:1 week

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Tue May 17 14:02:05 2016
(r300053)
+++ head/sys/netinet6/ip6_output.c  Tue May 17 14:06:55 2016
(r300054)
@@ -826,8 +826,10 @@ again:
 #endif
error = netisr_queue(NETISR_IPV6, m);
goto done;
-   } else
+   } else {
+   RO_RTFREE(ro);
needfiblookup = 1; /* Redo the routing table lookup. */
+   }
}
/* See if fib was changed by packet filter. */
if (fibnum != M_GETFIB(m)) {
___
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: r300052 - head/sys/dev/isp

2016-05-17 Thread Alexander Motin
Author: mav
Date: Tue May 17 13:18:57 2016
New Revision: 300052
URL: https://svnweb.freebsd.org/changeset/base/300052

Log:
  Completely remove broken now autologin port flag.
  
  Firmware automatically logs in only to local loop ports, and those ports
  can be easily identified without extra flag by zero domain and area IDs.
  
  MFC after:1 week

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue May 17 13:12:26 2016(r300051)
+++ head/sys/dev/isp/isp.c  Tue May 17 13:18:57 2016(r300052)
@@ -3206,7 +3206,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
case FC_PORTDB_STATE_DEAD:
lp->state = FC_PORTDB_STATE_NIL;
isp_async(isp, ISPASYNC_DEV_GONE, chan, lp);
-   if (lp->autologin == 0) {
+   if ((lp->portid & 0x00) != 0) {
(void) isp_plogx(isp, chan, lp->handle,
lp->portid,
PLOGX_FLG_CMD_LOGO |
@@ -3304,7 +3304,6 @@ isp_pdb_add_update(ispsoftc_t *isp, int 
}
 
ISP_MEMZERO(lp, sizeof (fcportdb_t));
-   lp->autologin = 1;
lp->probational = 0;
lp->state = FC_PORTDB_STATE_NEW;
lp->portid = lp->new_portid = pdb->portid;

Modified: head/sys/dev/isp/isp_library.c
==
--- head/sys/dev/isp/isp_library.c  Tue May 17 13:12:26 2016
(r300051)
+++ head/sys/dev/isp/isp_library.c  Tue May 17 13:18:57 2016
(r300052)
@@ -437,8 +437,8 @@ isp_dump_portdb(ispsoftc_t *isp, int cha
}
isp_gen_role_str(buf1, sizeof (buf1), lp->prli_word3);
isp_gen_role_str(buf2, sizeof (buf2), lp->new_prli_word3);
-   isp_prt(isp, ISP_LOGALL, "Chan %d [%d]: hdl 0x%x %s al%d %s 
0x%06x =>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x",
-   chan, i, lp->handle, dbs[lp->state], lp->autologin, buf1, 
lp->portid, buf2, lp->new_portid,
+   isp_prt(isp, ISP_LOGALL, "Chan %d [%d]: hdl 0x%x %s %s 0x%06x 
=>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x",
+   chan, i, lp->handle, dbs[lp->state], buf1, lp->portid, 
buf2, lp->new_portid,
(uint32_t) (lp->node_wwn >> 32), (uint32_t) (lp->node_wwn), 
(uint32_t) (lp->port_wwn >> 32), (uint32_t) (lp->port_wwn));
}
 }

Modified: head/sys/dev/isp/ispvar.h
==
--- head/sys/dev/isp/ispvar.h   Tue May 17 13:12:26 2016(r300051)
+++ head/sys/dev/isp/ispvar.h   Tue May 17 13:18:57 2016(r300052)
@@ -380,9 +380,6 @@ typedef struct {
uint16_thandle;
 
/*
-* A device is 'autologin' if the firmware automatically logs into
-* it (re-logins as needed). Basically, local private loop devices.
-*
 * PRLI word 3 parameters contains role as well as other things.
 *
 * The state is the current state of this entry.
@@ -396,8 +393,7 @@ typedef struct {
 */
uint16_tprli_word3; /* PRLI parameters */
uint16_tnew_prli_word3; /* Incoming new PRLI parameters 
*/
-   uint16_t: 11,
-   autologin   : 1,/* F/W does PLOGI/PLOGO */
+   uint16_t: 12,
probational : 1,
state   : 3;
uint32_t: 6,
___
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: r300051 - in head/sys: arm/arm arm64/arm64

2016-05-17 Thread Bjoern A. Zeeb
Author: bz
Date: Tue May 17 13:12:26 2016
New Revision: 300051
URL: https://svnweb.freebsd.org/changeset/base/300051

Log:
  The GIC (v2 at least) has a bit in the TYPER register to indicate whether the 
GIC
  supports the Security Extensions or not. This bit is not the same as the CPU 
one.
  Currently we are not checking for either before trying to write to the special
  registers.  This can lead to problems on hardware or simulators that do not
  provide the security extensions.  Add the missing checks. Their interactions 
with
  the CPU flag is not entirely clear to me but using a macro will make it easier
  to quickly adjust the condition once the CPU bits are sorted as well.
  
  Reviewed by:  br
  Sponsored by: DARPA/AFRL
  Differential Revision:https://reviews.freebsd.org/D6397

Modified:
  head/sys/arm/arm/gic.c
  head/sys/arm64/arm64/gic.c
  head/sys/arm64/arm64/gic.h

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Tue May 17 12:52:31 2016(r300050)
+++ head/sys/arm/arm/gic.c  Tue May 17 13:12:26 2016(r300051)
@@ -108,6 +108,11 @@ __FBSDID("$FreeBSD$");
 #defineGIC_LAST_PPI31  /* core) peripheral interrupts. 
*/
 #defineGIC_FIRST_SPI   32  /* Irqs 32+ are shared 
peripherals. */
 
+/* TYPER Registers */
+#defineGICD_TYPER_SECURITYEXT  0x400
+#defineGIC_SUPPORT_SECEXT(_sc) \
+((_sc->typer & GICD_TYPER_SECURITYEXT) == GICD_TYPER_SECURITYEXT)
+
 /* First bit is a polarity bit (0 - low, 1 - high) */
 #define GICD_ICFGR_POL_LOW (0 << 0)
 #define GICD_ICFGR_POL_HIGH(1 << 0)
@@ -172,6 +177,7 @@ struct arm_gic_softc {
uint8_t ver;
struct mtx  mutex;
uint32_tnirqs;
+   uint32_ttyper;
 #ifdef GIC_DEBUG_SPURIOUS
uint32_tlast_irq[MAXCPU];
 #endif
@@ -299,7 +305,7 @@ arm_gic_init_secondary(device_t dev)
gic_d_write_4(sc, GICD_IPRIORITYR(irq >> 2), 0);
 
/* Set all the interrupts to be in Group 0 (secure) */
-   for (irq = 0; irq < sc->nirqs; irq += 32) {
+   for (irq = 0; GIC_SUPPORT_SECEXT(sc) && irq < sc->nirqs; irq += 32) {
gic_d_write_4(sc, GICD_IGROUPR(irq >> 5), 0);
}
 
@@ -336,7 +342,7 @@ arm_gic_init_secondary(device_t dev)
gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0);
 
/* Set all the interrupts to be in Group 0 (secure) */
-   for (i = 0; i < sc->nirqs; i += 32) {
+   for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) {
gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0);
}
 
@@ -639,8 +645,8 @@ arm_gic_attach(device_t dev)
gic_d_write_4(sc, GICD_CTLR, 0x00);
 
/* Get the number of interrupts */
-   nirqs = gic_d_read_4(sc, GICD_TYPER);
-   nirqs = 32 * ((nirqs & 0x1f) + 1);
+   sc->typer = gic_d_read_4(sc, GICD_TYPER);
+   nirqs = 32 * ((sc->typer & 0x1f) + 1);
 
 #ifdef INTRNG
if (arm_gic_register_isrcs(sc, nirqs)) {
@@ -686,7 +692,7 @@ arm_gic_attach(device_t dev)
}
 
/* Set all the interrupts to be in Group 0 (secure) */
-   for (i = 0; i < sc->nirqs; i += 32) {
+   for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) {
gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0);
}
 

Modified: head/sys/arm64/arm64/gic.c
==
--- head/sys/arm64/arm64/gic.c  Tue May 17 12:52:31 2016(r300050)
+++ head/sys/arm64/arm64/gic.c  Tue May 17 13:12:26 2016(r300051)
@@ -94,6 +94,11 @@ __FBSDID("$FreeBSD$");
 #defineGIC_LAST_PPI31  /* core) peripheral interrupts. 
*/
 #defineGIC_FIRST_SPI   32  /* Irqs 32+ are shared 
peripherals. */
 
+/* TYPER Registers */
+#defineGICD_TYPER_SECURITYEXT  0x400
+#defineGIC_SUPPORT_SECEXT(_sc) \
+((_sc->typer & GICD_TYPER_SECURITYEXT) == GICD_TYPER_SECURITYEXT)
+
 /* First bit is a polarity bit (0 - low, 1 - high) */
 #define GICD_ICFGR_POL_LOW (0 << 0)
 #define GICD_ICFGR_POL_HIGH(1 << 0)
@@ -164,7 +169,7 @@ gic_init_secondary(device_t dev)
gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0);
 
/* Set all the interrupts to be in Group 0 (secure) */
-   for (i = 0; i < sc->nirqs; i += 32) {
+   for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) {
gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0);
}
 
@@ -221,8 +226,8 @@ arm_gic_attach(device_t dev)
gic_d_write_4(sc, GICD_CTLR, 0x00);
 
/* Get the number of interrupts */
-   sc->nirqs = gic_d_read_4(sc, GICD_TYPER);
-   sc->nirqs = 32 * ((sc->nirqs & 0x1f) + 1);
+   sc->typer = gic_d_read_4(sc, GICD_TYPER);
+   sc->nirqs = 32 * ((sc->typer & 0x1f) + 1);
 

svn commit: r300050 - in head: share/doc/usd/07.mail share/man/man9 sys/amd64/vmm/io sys/arm/allwinner sys/arm/freescale/imx sys/arm/include sys/cam sys/dev/bhnd sys/dev/bxe sys/dev/drm2/i915 sys/d...

2016-05-17 Thread Eitan Adler
Author: eadler
Date: Tue May 17 12:52:31 2016
New Revision: 300050
URL: https://svnweb.freebsd.org/changeset/base/300050

Log:
  Don't repeat the the word 'the'
  
  (one manual change to fix grammar)
  
  Confirmed With: db
  Approved by: secteam (not really, but this is a comment typo fix)

Modified:
  head/share/doc/usd/07.mail/mail6.nr
  head/share/man/man9/BUS_GET_CPUS.9
  head/sys/amd64/vmm/io/vhpet.c
  head/sys/arm/allwinner/a10_ahci.c
  head/sys/arm/freescale/imx/imx_sdhci.c
  head/sys/arm/include/asm.h
  head/sys/cam/cam_periph.c
  head/sys/dev/bhnd/bhnd.c
  head/sys/dev/bxe/ecore_hsi.h
  head/sys/dev/drm2/i915/intel_crt.c
  head/sys/dev/drm2/i915/intel_display.c
  head/sys/dev/drm2/radeon/atombios.h
  head/sys/dev/drm2/radeon/r300_reg.h
  head/sys/dev/drm2/radeon/radeon_device.c
  head/sys/dev/drm2/radeon/radeon_fence.c
  head/sys/dev/drm2/radeon/radeon_gart.c
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  head/sys/dev/iwm/if_iwmreg.h
  head/sys/dev/netmap/netmap.c
  head/sys/dev/ow/ow.c
  head/sys/dev/pms/RefTisa/sallsdk/spc/mpi.c
  head/sys/dev/pms/RefTisa/sat/src/smsat.c
  head/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c
  head/sys/dev/random/fortuna.c
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/mips/conf/DIR-825C1.hints
  head/sys/net/altq/altq_cbq.c
  head/sys/ofed/drivers/infiniband/debug/memtrack.c
  head/sys/ofed/drivers/infiniband/debug/memtrack.h
  head/sys/ofed/drivers/net/mlx4/main.c
  head/sys/xen/interface/io/blkif.h
  head/usr.bin/numactl/numactl.1
  head/usr.sbin/bsdconfig/share/dialog.subr
  head/usr.sbin/pciconf/pciconf.8

Modified: head/share/doc/usd/07.mail/mail6.nr
==
--- head/share/doc/usd/07.mail/mail6.nr Tue May 17 12:48:30 2016
(r300049)
+++ head/share/doc/usd/07.mail/mail6.nr Tue May 17 12:52:31 2016
(r300050)
@@ -75,7 +75,7 @@ is a shorthand way of doing
 Use the
 .b \-v
 flag when invoking sendmail. This feature may also be enabled
-by setting the the option "verbose".
+by setting the option "verbose".
 .pp
 The following command line flags are also recognized, but are
 intended for use by programs invoking

Modified: head/share/man/man9/BUS_GET_CPUS.9
==
--- head/share/man/man9/BUS_GET_CPUS.9  Tue May 17 12:48:30 2016
(r300049)
+++ head/share/man/man9/BUS_GET_CPUS.9  Tue May 17 12:52:31 2016
(r300050)
@@ -62,7 +62,7 @@ argument specifies the size in bytes of 
 .Fa cpuset .
 .Pp
 .Fn BUS_GET_CPUS
-supports querying different types of CPU sets via the the
+supports querying different types of CPU sets via the
 .Fa op argument.
 Not all set types are supported for every device.
 If a set type is not supported,

Modified: head/sys/amd64/vmm/io/vhpet.c
==
--- head/sys/amd64/vmm/io/vhpet.c   Tue May 17 12:48:30 2016
(r300049)
+++ head/sys/amd64/vmm/io/vhpet.c   Tue May 17 12:52:31 2016
(r300050)
@@ -163,7 +163,7 @@ vhpet_counter(struct vhpet *vhpet, sbint
/*
 * The sbinuptime corresponding to the 'countbase' is
 * meaningless when the counter is disabled. Make sure
-* that the the caller doesn't want to use it.
+* that the caller doesn't want to use it.
 */
KASSERT(nowptr == NULL, ("vhpet_counter: nowptr must be NULL"));
}

Modified: head/sys/arm/allwinner/a10_ahci.c
==
--- head/sys/arm/allwinner/a10_ahci.c   Tue May 17 12:48:30 2016
(r300049)
+++ head/sys/arm/allwinner/a10_ahci.c   Tue May 17 12:52:31 2016
(r300050)
@@ -158,7 +158,7 @@ ahci_a10_phy_reset(device_t dev)
struct ahci_controller *ctlr = device_get_softc(dev);
 
/*
-* Here start the the magic -- most of the comments are based
+* Here starts the magic -- most of the comments are based
 * on guesswork, names of routines and printf error
 * messages.  The code works, but it will do that even if the
 * comments are 100% BS.

Modified: head/sys/arm/freescale/imx/imx_sdhci.c
==
--- head/sys/arm/freescale/imx/imx_sdhci.c  Tue May 17 12:48:30 2016
(r300049)
+++ head/sys/arm/freescale/imx/imx_sdhci.c  Tue May 17 12:52:31 2016
(r300050)
@@ -625,7 +625,7 @@ imx_sdhci_intr(void *arg)
 * out of the hardware now so that we can present it later when the DAT0
 * line is released.
 *
-* If we need to wait for the the DAT0 line to be released, we set up a
+* If we need to wait for the DAT0 line to be released, we set up a
 * timeout point 250ms in the 

svn commit: r300049 - head/sys/arm64/conf

2016-05-17 Thread Andrew Turner
Author: andrew
Date: Tue May 17 12:48:30 2016
New Revision: 300049
URL: https://svnweb.freebsd.org/changeset/base/300049

Log:
  Add an arm64 kernel config to help testing intrng. It is expected this
  config will only last a few weeks until we switch to this interrupt
  framework.
  
  Obtained from: ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/arm64/conf/GENERIC-INTRNG   (contents, props changed)

Added: head/sys/arm64/conf/GENERIC-INTRNG
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/conf/GENERIC-INTRNG  Tue May 17 12:48:30 2016
(r300049)
@@ -0,0 +1,15 @@
+#
+# GENERIC-INTRNG -- intrng testing kernel for FreeBSD/arm64
+#
+# This config adds intrng support for testing, and to ensure intrng is not
+# broken before switching to it. The config is expected to be removed soon
+# when intrng becomes the default on arm64.
+#
+# $FreeBSD$
+#
+
+includeGENERIC
+
+ident  GENERIC-INTRNG
+
+optionsINTRNG
___
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: r300048 - head/sys/arm64/arm64

2016-05-17 Thread Andrew Turner
Author: andrew
Date: Tue May 17 12:46:50 2016
New Revision: 300048
URL: https://svnweb.freebsd.org/changeset/base/300048

Log:
  Clean up the GICv3 intrng code:
   * In gic_v3_attach free the correct data on failure.
   * Implement gic_v3_teardown_intr.
   * Update the panic string when enabling/disabling an invalid interrupt.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/gic_v3.c

Modified: head/sys/arm64/arm64/gic_v3.c
==
--- head/sys/arm64/arm64/gic_v3.c   Tue May 17 12:04:39 2016
(r300047)
+++ head/sys/arm64/arm64/gic_v3.c   Tue May 17 12:46:50 2016
(r300048)
@@ -267,7 +267,7 @@ gic_v3_attach(device_t dev)
}
if (err != 0) {
/* XXX call intr_isrc_deregister() */
-   free(irqs, M_DEVBUF);
+   free(sc->gic_irqs, M_DEVBUF);
return (err);
}
}
@@ -611,8 +611,14 @@ static int
 gic_v3_teardown_intr(device_t dev, struct intr_irqsrc *isrc,
 struct resource *res, struct intr_map_data *data)
 {
+   struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc;
+
+   if (isrc->isrc_handlers == 0) {
+   gi->gi_pol = INTR_POLARITY_CONFORM;
+   gi->gi_trig = INTR_TRIGGER_CONFORM;
+   }
 
-   panic("gic_v3_teardown_intr");
+   return (0);
 }
 
 static void
@@ -636,7 +642,7 @@ gic_v3_disable_intr(device_t dev, struct
gic_d_write(sc, 4, GICD_ICENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, DIST);
} else
-   panic("gic_v3_disable_intr");
+   panic("%s: Unsupported IRQ %u", __func__, irq);
 }
 
 static void
@@ -660,7 +666,7 @@ gic_v3_enable_intr(device_t dev, struct 
gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq));
gic_v3_wait_for_rwp(sc, DIST);
} else
-   panic("gic_v3_enable_intr");
+   panic("%s: Unsupported IRQ %u", __func__, irq);
 }
 
 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"


Re: svn commit: r299944 - in head/sys: arm64/arm64 conf

2016-05-17 Thread Andrew Turner
On Mon, 16 May 2016 18:08:49 +0200
Zbigniew Bodek  wrote:

> Hello Andrew,
> 
> I think committing this code should be preceded by at least brief
> review. Few remarks to the code found on the first glance below.

See below for comments.

> 
> Kind regards
> zbb
> 
> 2016-05-16 16:07 GMT+02:00 Andrew Turner :
> 
> > Author: andrew
> > Date: Mon May 16 14:07:43 2016
> > New Revision: 299944
> > URL: https://svnweb.freebsd.org/changeset/base/299944
> >
> > Log:
> >   Add intrng support to the GICv3 driver. It lacks ITS support so
> > won't handle
> >   MSI or MSI-X interrupts, however this is enought to boot FreeBSD
> > under the
> >   ARM Foundation Model with a GICv3 interrupt controller.
> >
> >   Approved by:  ABT Systems Ltd
> >   Relnotes: yes
> >   Sponsored by: The FreeBSD Foundation
...
> > +#ifdef INTRNG
> > +int
> > +arm_gic_v3_intr(void *arg)
> > +{
> > +   struct gic_v3_softc *sc = arg;
> > +   struct gic_v3_irqsrc *gi;
> > +   uint64_t active_irq;
> > +   struct trapframe *tf;
> > +   bool first;
> > +
> > +   first = true;
> > +
> > +   while (1) {
> > +   if (CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) {
> > +   /*
> > +* Hardware:Cavium ThunderX
> > +* Chip revision:   Pass 1.0 (early
> > version)
> > +*  Pass 1.1
> > (production)
> > +* ERRATUM: 22978, 23154
> > +*/
> > +   __asm __volatile(
> > +   "nop;nop;nop;nop;nop;nop;nop;nop;   \n"
> > +   "mrs %0, ICC_IAR1_EL1   \n"
> > +   "nop;nop;nop;nop;   \n"
> > +   "dsb sy \n"
> > +   : "=" (active_irq));
> > +   } else {
> > +   active_irq = gic_icc_read(IAR1);
> > +   }
> > +
> > +   if (__predict_false(active_irq >= sc->gic_nirqs))
> > +   return (FILTER_HANDLED);
> >  
> 
> IMHO this is not true. Active IRQ could be much bigger than number of
> supported IRQs. We are asking for debugging in the future when we
> enable ITS.

It is correct, the ITS change to this file is missing so we are unable
to enable ITS interrupts.

...
> > +
> > +#ifdef FDT
> > +static int
> > +gic_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int
> > *irqp,
> > +enum intr_polarity *polp, enum intr_trigger *trigp)
> >  
> 
> All other functions are called gic_v3 and this one is just gic_
> Why can't we move as much FDT code to the dedicated file which is
> gic_v3_fdt.c?

Unfortunately due to the current code in subr_intr.c this is needed for
simplicity. It it my understanding there is work to fix this, so for
now I would prefer to keep this.

...
> > +   /* Set the trigger and polarity */
> > +   if (irq <= GIC_LAST_PPI)
> > +   reg = gic_r_read(sc, 4,
> > +   GICR_SGI_BASE_SIZE + GICD_ICFGR(irq));
> > +   else
> > +   reg = gic_d_read(sc, 4, GICD_ICFGR(irq));
> > +   if (trig == INTR_TRIGGER_LEVEL)
> > +   reg &= ~(2 << ((irq % 16) * 2));
> > +   else
> > +   reg |= 2 << ((irq % 16) * 2);
> >  
> 
> The rule of not using magic numbers does not apply here ;-) ?

This is partially why this is still disabled by default, the code still
needs a little polish, however it will be needed to help with a future
review for changes to subr_intr.c.

...
> > +static void
> > +gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc)
> > +{
> > +   struct gic_v3_softc *sc;
> > +   struct gic_v3_irqsrc *gi;
> > +   u_int irq;
> > +
> > +   sc = device_get_softc(dev);
> > +   gi = (struct gic_v3_irqsrc *)isrc;
> > +   irq = gi->gi_irq;
> > +
> > +   if (irq <= GIC_LAST_PPI) {
> > +   /* SGIs and PPIs in corresponding Re-Distributor */
> > +   gic_r_write(sc, 4, GICR_SGI_BASE_SIZE +
> > GICD_ICENABLER(irq),
> > +   GICD_I_MASK(irq));
> > +   gic_v3_wait_for_rwp(sc, REDIST);
> > +   } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) {
> > +   /* SPIs in distributor */
> > +   gic_d_write(sc, 4, GICD_ICENABLER(irq),
> > GICD_I_MASK(irq));
> > +   gic_v3_wait_for_rwp(sc, DIST);
> >  
> 
> In gic_v3_setup_intr() we need spin lock and here we don't ?

The locking was based on the existing intrng gic driver, I think they
are both bogus.

...

> > +static void
> > +gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t
> > cpus,
> > +u_int ipi)
> >  
> 
> What exactly is the functional difference between the current
> implementation and this one?
> 

svn commit: r300047 - head/sys/fs/autofs

2016-05-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 17 12:04:39 2016
New Revision: 300047
URL: https://svnweb.freebsd.org/changeset/base/300047

Log:
  Silence down the "insmntque() failed" autofs error; it happens
  on shutdown and is perfectly normal.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/autofs/autofs_vnops.c

Modified: head/sys/fs/autofs/autofs_vnops.c
==
--- head/sys/fs/autofs/autofs_vnops.c   Tue May 17 11:59:38 2016
(r300046)
+++ head/sys/fs/autofs/autofs_vnops.c   Tue May 17 12:04:39 2016
(r300047)
@@ -686,7 +686,7 @@ autofs_node_vn(struct autofs_node *anp, 
 
error = insmntque(vp, mp);
if (error != 0) {
-   AUTOFS_WARN("insmntque() failed with error %d", error);
+   AUTOFS_DEBUG("insmntque() failed with error %d", error);
sx_xunlock(>an_vnode_lock);
return (error);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300046 - head/sys/dev/iscsi

2016-05-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 17 11:59:38 2016
New Revision: 300046
URL: https://svnweb.freebsd.org/changeset/base/300046

Log:
  Make iscsi_ioctl_daemon_send() actually work by adding missing locking.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Tue May 17 11:22:08 2016(r300045)
+++ head/sys/dev/iscsi/iscsi.c  Tue May 17 11:59:38 2016(r300046)
@@ -1620,7 +1620,9 @@ iscsi_ioctl_daemon_send(struct iscsi_sof
KASSERT(error == 0, ("icl_pdu_append_data(..., M_WAITOK) 
failed"));
free(data, M_ISCSI);
}
+   ISCSI_SESSION_LOCK(is);
icl_pdu_queue(ip);
+   ISCSI_SESSION_UNLOCK(is);
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300045 - head/sbin/ipfw

2016-05-17 Thread Andrey V. Elsukov
Author: ae
Date: Tue May 17 11:22:08 2016
New Revision: 300045
URL: https://svnweb.freebsd.org/changeset/base/300045

Log:
  Make `ipfw internal olist` output more user friendly.
  Print object type as string for known types.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Tue May 17 11:10:44 2016(r300044)
+++ head/sbin/ipfw/ipfw2.c  Tue May 17 11:22:08 2016(r300045)
@@ -5131,11 +5131,35 @@ static struct _s_x intcmds[] = {
   { NULL, 0 }
 };
 
+static struct _s_x otypes[] = {
+   { "EACTION",IPFW_TLV_EACTION },
+   { NULL, 0 }
+};
+
+static const char*
+lookup_eaction_name(ipfw_obj_ntlv *ntlv, int cnt, uint16_t type)
+{
+   const char *name;
+   int i;
+
+   name = NULL;
+   for (i = 0; i < cnt; i++) {
+   if (ntlv[i].head.type != IPFW_TLV_EACTION)
+   continue;
+   if (IPFW_TLV_EACTION_NAME(ntlv[i].idx) != type)
+   continue;
+   name = ntlv[i].name;
+   break;
+   }
+   return (name);
+}
+
 static void
 ipfw_list_objects(int ac, char *av[])
 {
ipfw_obj_lheader req, *olh;
ipfw_obj_ntlv *ntlv;
+   const char *name;
size_t sz;
int i;
 
@@ -5161,8 +5185,17 @@ ipfw_list_objects(int ac, char *av[])
printf("There are no objects\n");
ntlv = (ipfw_obj_ntlv *)(olh + 1);
for (i = 0; i < olh->count; i++) {
-   printf(" kidx: %4d\ttype: %6d\tname: %s\n", ntlv->idx,
-   ntlv->head.type, ntlv->name);
+   name = match_value(otypes, ntlv->head.type);
+   if (name == NULL)
+   name = lookup_eaction_name(
+   (ipfw_obj_ntlv *)(olh + 1), olh->count,
+   ntlv->head.type);
+   if (name == NULL)
+   printf(" kidx: %4d\ttype: %10d\tname: %s\n",
+   ntlv->idx, ntlv->head.type, ntlv->name);
+   else
+   printf(" kidx: %4d\ttype: %10s\tname: %s\n",
+   ntlv->idx, name, ntlv->name);
ntlv++;
}
free(olh);
___
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: r300044 - in head/sys: cam/ctl dev/iscsi

2016-05-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 17 11:10:44 2016
New Revision: 300044
URL: https://svnweb.freebsd.org/changeset/base/300044

Log:
  Add icl_conn_connect() ICL method, required for iSER.
  
  Obtained from:Mellanox Technologies (earlier version)
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/icl.h
  head/sys/dev/iscsi/icl_conn_if.m
  head/sys/dev/iscsi/icl_proxy.c
  head/sys/dev/iscsi/icl_soft.c
  head/sys/dev/iscsi/icl_wrappers.h
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue May 17 09:56:22 2016
(r300043)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue May 17 11:10:44 2016
(r300044)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/iscsi/icl.c
==
--- head/sys/dev/iscsi/icl.cTue May 17 09:56:22 2016(r300043)
+++ head/sys/dev/iscsi/icl.cTue May 17 11:10:44 2016(r300044)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/iscsi/icl.h
==
--- head/sys/dev/iscsi/icl.hTue May 17 09:56:22 2016(r300043)
+++ head/sys/dev/iscsi/icl.hTue May 17 11:10:44 2016(r300044)
@@ -139,12 +139,6 @@ struct sockaddr;
 struct icl_listen;
 
 /*
- * Initiator part.
- */
-inticl_conn_connect(struct icl_conn *ic, bool rdma,
-   int domain, int socktype, int protocol,
-   struct sockaddr *from_sa, struct sockaddr *to_sa);
-/*
  * Target part.
  */
 struct icl_listen  *icl_listen_new(void (*accept_cb)(struct socket *,
@@ -156,9 +150,11 @@ inticl_listen_add(struct 
icl_listen *
 inticl_listen_remove(struct icl_listen *il, struct 
sockaddr *sa);
 
 /*
- * This one is not a public API; only to be used by icl_proxy.c.
+ * Those two are not a public API; only to be used between icl_soft.c and 
icl_proxy.c.
  */
-inticl_conn_handoff_sock(struct icl_conn *ic, struct 
socket *so);
-
+inticl_soft_handoff_sock(struct icl_conn *ic, struct 
socket *so);
+inticl_soft_proxy_connect(struct icl_conn *ic, int domain,
+   int socktype, int protocol, struct sockaddr 
*from_sa,
+   struct sockaddr *to_sa);
 #endif /* ICL_KERNEL_PROXY */
 #endif /* !ICL_H */

Modified: head/sys/dev/iscsi/icl_conn_if.m
==
--- head/sys/dev/iscsi/icl_conn_if.mTue May 17 09:56:22 2016
(r300043)
+++ head/sys/dev/iscsi/icl_conn_if.mTue May 17 11:10:44 2016
(r300044)
@@ -29,6 +29,7 @@
 # $FreeBSD$
 #
 
+#include 
 #include 
 
 INTERFACE icl_conn;
@@ -106,3 +107,15 @@ METHOD void transfer_done {
struct icl_conn *_ic;
void *_prv;
 };
+
+#
+# The function below is only used with ICL_KERNEL_PROXY.
+#
+METHOD int connect {
+   struct icl_conn *_ic;
+   int _domain;
+   int _socktype;
+   int _protocol;
+   struct sockaddr *_from_sa;
+   struct sockaddr *_to_sa;
+};

Modified: head/sys/dev/iscsi/icl_proxy.c
==
--- head/sys/dev/iscsi/icl_proxy.c  Tue May 17 09:56:22 2016
(r300043)
+++ head/sys/dev/iscsi/icl_proxy.c  Tue May 17 11:10:44 2016
(r300044)
@@ -105,8 +105,8 @@ struct icl_listen   {
 
 static MALLOC_DEFINE(M_ICL_PROXY, "ICL_PROXY", "iSCSI common layer proxy");
 
-static int
-icl_conn_connect_tcp(struct icl_conn *ic, int domain, int socktype,
+int
+icl_soft_proxy_connect(struct icl_conn *ic, int domain, int socktype,
 int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa)
 {
struct socket *so;
@@ -153,26 +153,13 @@ icl_conn_connect_tcp(struct icl_conn *ic
return (error);
}
 
-   error = icl_conn_handoff_sock(ic, so);
+   error = icl_soft_handoff_sock(ic, so);
if (error != 0)
soclose(so);
 
return (error);
 }
 
-int
-icl_conn_connect(struct icl_conn *ic, bool rdma, int domain, int socktype,
-int protocol, struct sockaddr *from_sa, struct sockaddr *to_sa)
-{
-
-   if (rdma) {
-   ICL_DEBUG("RDMA not supported");
-   return (EOPNOTSUPP);
-   }
-
-   return (icl_conn_connect_tcp(ic, domain, socktype, protocol, from_sa, 
to_sa));
-}
-
 struct icl_listen *
 icl_listen_new(void (*accept_cb)(struct socket *, struct sockaddr *, int))
 {


svn commit: r300043 - in head: include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread share/man/man3 sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/vm

2016-05-17 Thread Konstantin Belousov
Author: kib
Date: Tue May 17 09:56:22 2016
New Revision: 300043
URL: https://svnweb.freebsd.org/changeset/base/300043

Log:
  Add implementation of robust mutexes, hopefully close enough to the
  intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.
  
  A robust mutex is guaranteed to be cleared by the system upon either
  thread or process owner termination while the mutex is held.  The next
  mutex locker is then notified about inconsistent mutex state and can
  execute (or abandon) corrective actions.
  
  The patch mostly consists of small changes here and there, adding
  neccessary checks for the inconsistent and abandoned conditions into
  existing paths.  Additionally, the thread exit handler was extended to
  iterate over the userspace-maintained list of owned robust mutexes,
  unlocking and marking as terminated each of them.
  
  The list of owned robust mutexes cannot be maintained atomically
  synchronous with the mutex lock state (it is possible in kernel, but
  is too expensive).  Instead, for the duration of lock or unlock
  operation, the current mutex is remembered in a special slot that is
  also checked by the kernel at thread termination.
  
  Kernel must be aware about the per-thread location of the heads of
  robust mutex lists and the current active mutex slot.  When a thread
  touches a robust mutex for the first time, a new umtx op syscall is
  issued which informs about location of lists heads.
  
  The umtx sleep queues for PP and PI mutexes are split between
  non-robust and robust.
  
  Somewhat unrelated changes in the patch:
  1. Style.
  2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared
 pi mutexes.
  3. Removal of the userspace struct pthread_mutex m_owner field.
  4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls
 the lifetime of the shared mutex associated with a vnode' page.
  
  Reviewed by:  jilles (previous version, supposedly the objection was fixed)
  Discussed with:   brooks, Martin Simmons  (some 
aspects)
  Tested by:pho
  Sponsored by: The FreeBSD Foundation

Added:
  head/share/man/man3/pthread_mutex_consistent.3   (contents, props changed)
Modified:
  head/include/pthread.h
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/_pthread_stubs.c
  head/lib/libc/include/libc_private.h
  head/lib/libthr/pthread.map
  head/lib/libthr/thread/thr_cond.c
  head/lib/libthr/thread/thr_init.c
  head/lib/libthr/thread/thr_mutex.c
  head/lib/libthr/thread/thr_mutexattr.c
  head/lib/libthr/thread/thr_private.h
  head/lib/libthr/thread/thr_umtx.c
  head/lib/libthr/thread/thr_umtx.h
  head/share/man/man3/Makefile
  head/share/man/man3/pthread_cond_wait.3
  head/share/man/man3/pthread_mutex_lock.3
  head/share/man/man3/pthread_mutex_timedlock.3
  head/share/man/man3/pthread_mutex_trylock.3
  head/share/man/man3/pthread_mutex_unlock.3
  head/share/man/man3/pthread_mutexattr.3
  head/sys/compat/cloudabi/cloudabi_thread.c
  head/sys/compat/linux/linux_fork.c
  head/sys/kern/kern_exit.c
  head/sys/kern/kern_thr.c
  head/sys/kern/kern_thread.c
  head/sys/kern/kern_umtx.c
  head/sys/sys/_umtx.h
  head/sys/sys/proc.h
  head/sys/sys/umtx.h
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h
  head/sys/vm/vnode_pager.c

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Tue May 17 09:53:22 2016(r300042)
+++ head/include/pthread.h  Tue May 17 09:56:22 2016(r300043)
@@ -135,6 +135,9 @@ enum pthread_mutextype {
 
 #definePTHREAD_MUTEX_DEFAULT   PTHREAD_MUTEX_ERRORCHECK
 
+#definePTHREAD_MUTEX_STALLED   0
+#definePTHREAD_MUTEX_ROBUST1
+
 struct _pthread_cleanup_info {
__uintptr_t pthread_cleanup_pad[8];
 };
@@ -229,6 +232,8 @@ int pthread_mutexattr_settype(pthread_m
__nonnull(1);
 intpthread_mutexattr_setpshared(pthread_mutexattr_t *, int)
__nonnull(1);
+intpthread_mutex_consistent(pthread_mutex_t *__mutex)
+   __nonnull(1) __requires_exclusive(*__mutex);
 intpthread_mutex_destroy(pthread_mutex_t *__mutex)
__nonnull(1) __requires_unlocked(*__mutex);
 intpthread_mutex_init(pthread_mutex_t *__mutex,
@@ -310,6 +315,11 @@ intpthread_mutex_setprioceiling(pthrea
 intpthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *);
 intpthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
 
+intpthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict,
+   int *__restrict) __nonnull_all;
+intpthread_mutexattr_setrobust(pthread_mutexattr_t *, int)
+   __nonnull(1);
+
 intpthread_attr_getinheritsched(const pthread_attr_t *, int *);
 intpthread_attr_getschedparam(const 

svn commit: r300042 - in head/sys/netinet: . tcp_stacks

2016-05-17 Thread Randall Stewart
Author: rrs
Date: Tue May 17 09:53:22 2016
New Revision: 300042
URL: https://svnweb.freebsd.org/changeset/base/300042

Log:
  This small change adopts the excellent suggestion for using named
  structures in the add of a new tcp-stack that came in late to me
  via email after the last commit. It also makes it so that a new
  stack may optionally get a callback during a retransmit
  timeout. This allows the new stack to clear specific state (think
  sack scoreboards or other such structures).
  
  Sponsored by: Netflix Inc.
  Differential Revision:http://reviews.freebsd.org/D6303

Modified:
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Tue May 17 09:24:54 2016
(r300041)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Tue May 17 09:53:22 2016
(r300042)
@@ -2375,34 +2375,17 @@ tcp_do_segment_fastack(struct mbuf *m, s
 }
 
 struct tcp_function_block __tcp_fastslow = {
-   "fastslow",
-   tcp_output,
-   tcp_do_segment_fastslow,
-   tcp_default_ctloutput,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   0,
-   0
-
+   .tfb_tcp_block_name = "fastslow",
+   .tfb_tcp_output = tcp_output,
+   .tfb_tcp_do_segment = tcp_do_segment_fastslow,
+   .tfb_tcp_ctloutput = tcp_default_ctloutput,
 };
 
 struct tcp_function_block __tcp_fastack = {
-   "fastack",
-   tcp_output,
-   tcp_do_segment_fastack,
-   tcp_default_ctloutput,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   NULL,
-   0,
-   0
+   .tfb_tcp_block_name = "fastack",
+   .tfb_tcp_output = tcp_output,
+   .tfb_tcp_do_segment = tcp_do_segment_fastack,
+   .tfb_tcp_ctloutput = tcp_default_ctloutput
 };
 
 static int

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cTue May 17 09:24:54 2016
(r300041)
+++ head/sys/netinet/tcp_timer.cTue May 17 09:53:22 2016
(r300042)
@@ -604,6 +604,10 @@ tcp_timer_rexmt(void * xtp)
KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0,
("%s: tp %p rexmt callout should be running", __func__, tp));
tcp_free_sackholes(tp);
+   if (tp->t_fb->tfb_tcp_rexmit_tmr) {
+   /* The stack has a timer action too. */
+   (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp);
+   }
/*
 * Retransmission timer went off.  Message has not
 * been acked within retransmit interval.  Back off

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Tue May 17 09:24:54 2016(r300041)
+++ head/sys/netinet/tcp_var.h  Tue May 17 09:53:22 2016(r300042)
@@ -135,6 +135,7 @@ struct tcp_function_block {
uint32_t, u_int);
int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t);
void(*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t);
+   void(*tfb_tcp_rexmit_tmr)(struct tcpcb *);
volatile uint32_t tfb_refcnt;
uint32_t  tfb_flags;
 };
___
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"


  1   2   >