svn commit: r271156 - head/sys/dev/usb/controller

2014-09-05 Thread Alexander Motin
Author: mav
Date: Fri Sep  5 07:42:34 2014
New Revision: 271156
URL: http://svnweb.freebsd.org/changeset/base/271156

Log:
  Add IDs for Intel Patsburg USB 2.0 controller.

Modified:
  head/sys/dev/usb/controller/ehci_pci.c

Modified: head/sys/dev/usb/controller/ehci_pci.c
==
--- head/sys/dev/usb/controller/ehci_pci.c  Fri Sep  5 05:36:32 2014
(r271155)
+++ head/sys/dev/usb/controller/ehci_pci.c  Fri Sep  5 07:42:34 2014
(r271156)
@@ -120,6 +120,10 @@ ehci_pci_match(device_t self)
case 0x43961002:
return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller");
 
+   case 0x1d268086:
+   return ("Intel Patsburg USB 2.0 controller");
+   case 0x1d2d8086:
+   return ("Intel Patsburg USB 2.0 controller");
case 0x1e268086:
return ("Intel Panther Point USB 2.0 controller");
case 0x1e2d8086:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-09-05 Thread Konstantin Belousov
On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote:
> On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote:
> > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote:
> > > I thought about that.  I could easily make a parallel array, or perhaps
> > > use a separate 'susppcb' structure that includes a pcb and the savefpu
> > > union and change susppcbs to be an array of those.  Which do you prefer? 
> > > If we want to move some state out of the PCB on amd64 into this, then a
> > > separate struct for susppcbs might be the sanest.
> > 
> > Yes, separate structure seems to be a way forward.
> 
> Please see www.freebsd.org/~jhb/patches/susppcb.patch  Note that I moved
> fpususpend() out into a C function on amd64 so that resumectx() could still 
> operate on just a pcb.  This also makes savectx and resumectx more symmetric
> and matches what I ended up doing on i386.  This is tested for suspend and
> resume on both i386 and amd64.

The implementation of fpuresume() in C is definitely an improvement.

You only moved the fpu context to the susppcb, I think this is good for
now, we will want to move other bits later.

Do we need to keep pcb layout for KBI compat ?  I remember that pcb
size is asserted to properly fit into pcpu area for percpu zones.
But why keep the layout ?  I.e. moving all padding bits to the end.

There is one weird detail, not touched by your patch.  Amd64 resume
path calls initializecpu(), while i386 does not.  I do not see any
use for the call, the reload of CRX registers by trampoline/resumectx
should already set everything to working state.  E.g., enabling XMM
in CR4 after fpu state is restored looks strange.

Overall, it looks fine.  Do you prefer to have alloc_fpusave() on i386 ?


pgpDxrz3ejOFq.pgp
Description: PGP signature


svn commit: r271157 - head/usr.sbin/ctld

2014-09-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep  5 11:10:44 2014
New Revision: 271157
URL: http://svnweb.freebsd.org/changeset/base/271157

Log:
  Fix typo.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/login.c

Modified: head/usr.sbin/ctld/login.c
==
--- head/usr.sbin/ctld/login.c  Fri Sep  5 07:42:34 2014(r271156)
+++ head/usr.sbin/ctld/login.c  Fri Sep  5 11:10:44 2014(r271157)
@@ -720,8 +720,8 @@ login_negotiate_key(struct pdu *request,
"MaxRecvDataSegmentLength");
}
if (tmp > MAX_DATA_SEGMENT_LENGTH) {
-   log_debugx("capping MaxDataSegmentLength from %d to %d",
-   tmp, MAX_DATA_SEGMENT_LENGTH);
+   log_debugx("capping MaxRecvDataSegmentLength "
+   "from %d to %d", tmp, MAX_DATA_SEGMENT_LENGTH);
tmp = MAX_DATA_SEGMENT_LENGTH;
}
conn->conn_max_data_segment_length = tmp;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled

2014-09-05 Thread Kevin Lo
Author: kevlo
Date: Fri Sep  5 11:25:58 2014
New Revision: 271159
URL: http://svnweb.freebsd.org/changeset/base/271159

Log:
  The USB LED driver for the Dream Cheeky WebMail Notifier.
  
  Reviewed by:  hselasky

Added:
  head/share/man/man4/uled.4   (contents, props changed)
  head/sys/dev/usb/misc/uled.c   (contents, props changed)
  head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
  head/sys/modules/usb/uled/
  head/sys/modules/usb/uled/Makefile   (contents, props changed)
Modified:
  head/Makefile
  head/share/man/man4/Makefile
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs
  head/sys/modules/usb/Makefile

Modified: head/Makefile
==
--- head/Makefile   Fri Sep  5 11:11:15 2014(r271158)
+++ head/Makefile   Fri Sep  5 11:25:58 2014(r271159)
@@ -1,6 +1,42 @@
 #
 # $FreeBSD$
 #
+# Copyright (c) 2014 Kevin Lo. 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.
+#
+
+S= ${.CURDIR}/../../..
+
+.PATH: $S/dev/usb/misc
+
+KMOD=  uled
+SRCS=  opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+   uled.c
+
+.include 
+#
+# $FreeBSD$
+#
 # The user-driven targets are:
 #
 # universe- *Really* build *everything* (buildworld and

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileFri Sep  5 11:11:15 2014
(r271158)
+++ head/share/man/man4/MakefileFri Sep  5 11:25:58 2014
(r271159)
@@ -527,6 +527,7 @@ MAN=aac.4 \
uhso.4 \
uipaq.4 \
ukbd.4 \
+   uled.4 \
ulpt.4 \
umass.4 \
umcs.4 \

Added: head/share/man/man4/uled.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/uled.4  Fri Sep  5 11:25:58 2014(r271159)
@@ -0,0 +1,95 @@
+.\"
+.\" Copyright (c) 2014 Kevin Lo
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 5, 2014
+.Dt ULED 4
+.Os
+.Sh NAME
+.Nm uled
+.Nd USB LED driver
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines into
+your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device uled"
+.Cd "dev

Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm

2014-09-05 Thread Andriy Gapon
on 04/09/2014 04:18 Steven Hartland said the following:
> Indeed that would be interesting, but we might find that its quite memory size
> dependent given the scaling so confirming HW details would be nice too.
> 
> I'd also be interested to know who wins the free race between the VM and ARC
> when using that value.

BTW, I've written a small silly program that tests for a problem that affected
me in the distant past: http://people.freebsd.org/~avg/arc-vs-swap.c

It gobbles almost all of the memory and then just sits on it never accessing it
again.  At the same time it repeatedly reads blocks of data from a large file.
The idea is that eventually the unused memory should be pushed out to the swap
and the ARC is allowed to grow to accommodate for the data being read.

I run this program on a freshly booted system without any other applications.
Prior to r270759 the system behaves as expected.  Although the pace of shifting
balance between the ARC and the swap-backed pages is quite slow.
After r270759 and with the default tuning the ARC always sits at its minimum
size.  To me this is a regression.

To summarize: I really appreciate the improvements that you are making here
https://reviews.freebsd.org/D702
Thanks!

P.S.
I wish there was an easy way to make the page cache and the ARC aware of each 
other.
-- 
Andriy Gapon
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled

2014-09-05 Thread Konstantin Belousov
On Fri, Sep 05, 2014 at 11:25:58AM +, Kevin Lo wrote:
> Author: kevlo
> Date: Fri Sep  5 11:25:58 2014
> New Revision: 271159
> URL: http://svnweb.freebsd.org/changeset/base/271159
> 
> Log:
>   The USB LED driver for the Dream Cheeky WebMail Notifier.
>   
>   Reviewed by:hselasky
> 
> Added:
>   head/share/man/man4/uled.4   (contents, props changed)
>   head/sys/dev/usb/misc/uled.c   (contents, props changed)
>   head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
>   head/sys/modules/usb/uled/
>   head/sys/modules/usb/uled/Makefile   (contents, props changed)
> Modified:
>   head/Makefile
^

>   head/share/man/man4/Makefile
>   head/sys/conf/NOTES
>   head/sys/conf/files
>   head/sys/dev/usb/quirk/usb_quirk.c
>   head/sys/dev/usb/usbdevs
>   head/sys/modules/usb/Makefile
> 
> Modified: head/Makefile
> ==
> --- head/Makefile Fri Sep  5 11:11:15 2014(r271158)
> +++ head/Makefile Fri Sep  5 11:25:58 2014(r271159)
> @@ -1,6 +1,42 @@
>  #
>  # $FreeBSD$
>  #
> +# Copyright (c) 2014 Kevin Lo. 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.
> +#
> +
> +S= ${.CURDIR}/../../..
> +
> +.PATH: $S/dev/usb/misc
> +
> +KMOD=uled
> +SRCS=opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h 
> usbdevs.h \
> + uled.c
> +
> +.include 
> +#
> +# $FreeBSD$
> +#
>  # The user-driven targets are:
>  #
>  # universe- *Really* build *everything* (buildworld and
> 
It seems you mis-patched the commit tree.

> Modified: head/share/man/man4/Makefile
> ==
> --- head/share/man/man4/Makefile  Fri Sep  5 11:11:15 2014
> (r271158)
> +++ head/share/man/man4/Makefile  Fri Sep  5 11:25:58 2014
> (r271159)
> @@ -527,6 +527,7 @@ MAN=  aac.4 \
>   uhso.4 \
>   uipaq.4 \
>   ukbd.4 \
> + uled.4 \
>   ulpt.4 \
>   umass.4 \
>   umcs.4 \
> 
> Added: head/share/man/man4/uled.4
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/share/man/man4/uled.4Fri Sep  5 11:25:58 2014
> (r271159)
> @@ -0,0 +1,95 @@
> +.\"
> +.\" Copyright (c) 2014 Kevin Lo
> +.\" 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

svn commit: r271163 - head/sys/dev/ahci

2014-09-05 Thread Alexander Motin
Author: mav
Date: Fri Sep  5 13:45:14 2014
New Revision: 271163
URL: http://svnweb.freebsd.org/changeset/base/271163

Log:
  Invert AHCI_Q_NOBSYRES quirk meaning, waiting for readiness by default.
  
  I gave up to update list of Marvell chips that require this quirk.
  The final nail was growing number of PCIe/M.2 SSDs where Marvell chips
  have PCI IDs of different vendors.
  
  MFC after:1 week
  H/W donated by:   I/O Switch

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci_pci.c

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cFri Sep  5 13:25:27 2014(r271162)
+++ head/sys/dev/ahci/ahci.cFri Sep  5 13:45:14 2014(r271163)
@@ -187,10 +187,9 @@ ahci_attach(device_t dev)
ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI);
 
/* Identify and set separate quirks for HBA and RAID f/w Marvells. */
-   if ((ctlr->quirks & AHCI_Q_NOBSYRES) &&
-   (ctlr->quirks & AHCI_Q_ALTSIG) &&
+   if ((ctlr->quirks & AHCI_Q_ALTSIG) &&
(ctlr->caps & AHCI_CAP_SPM) == 0)
-   ctlr->quirks &= ~AHCI_Q_NOBSYRES;
+   ctlr->quirks |= AHCI_Q_NOBSYRES;
 
if (ctlr->quirks & AHCI_Q_1CH) {
ctlr->caps &= ~AHCI_CAP_NPMASK;
@@ -1533,9 +1532,15 @@ ahci_execute_transaction(struct ahci_slo
}
}
 
-   /* Marvell controllers do not wait for readyness. */
-   if ((ch->quirks & AHCI_Q_NOBSYRES) && softreset == 2 &&
-   et == AHCI_ERR_NONE) {
+   /*
+* Marvell HBAs with non-RAID firmware do not wait for
+* readiness after soft reset, so we have to wait here.
+* Marvell RAIDs have no this problem, but instead sometimes
+* forget to update FIS receive area, breaking this wait.
+*/
+   if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 &&
+   (ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 &&
+   softreset == 2 && et == AHCI_ERR_NONE) {
while ((val = fis[2]) & ATA_S_BUSY) {
DELAY(10);
if (count++ >= timeout)

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cFri Sep  5 13:25:27 2014
(r271162)
+++ head/sys/dev/ahci/ahci_pci.cFri Sep  5 13:45:14 2014
(r271163)
@@ -179,31 +179,31 @@ static struct {
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
{0x614511ab, 0x00, "Marvell 88SE6145",  AHCI_Q_NOFORCE | AHCI_Q_4CH |
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
-   {0x91201b4b, 0x00, "Marvell 88SE912x",  AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES},
-   {0x91231b4b, 0x11, "Marvell 88SE912x",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
-   {0x91231b4b, 0x00, "Marvell 88SE912x",  
AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES},
-   {0x91251b4b, 0x00, "Marvell 88SE9125",  AHCI_Q_NOBSYRES},
-   {0x91281b4b, 0x00, "Marvell 88SE9128",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
-   {0x91301b4b, 0x00, "Marvell 88SE9130",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
-   {0x91721b4b, 0x00, "Marvell 88SE9172",  AHCI_Q_NOBSYRES},
-   {0x91821b4b, 0x00, "Marvell 88SE9182",  AHCI_Q_NOBSYRES},
-   {0x91831b4b, 0x00, "Marvell 88SS9183",  AHCI_Q_NOBSYRES},
-   {0x91a01b4b, 0x00, "Marvell 88SE91Ax",  AHCI_Q_NOBSYRES},
-   {0x92151b4b, 0x00, "Marvell 88SE9215",  AHCI_Q_NOBSYRES},
-   {0x92201b4b, 0x00, "Marvell 88SE9220",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
-   {0x92301b4b, 0x00, "Marvell 88SE9230",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
-   {0x92351b4b, 0x00, "Marvell 88SE9235",  AHCI_Q_NOBSYRES},
-   {0x06201103, 0x00, "HighPoint RocketRAID 620",  AHCI_Q_NOBSYRES},
-   {0x06201b4b, 0x00, "HighPoint RocketRAID 620",  AHCI_Q_NOBSYRES},
-   {0x06221103, 0x00, "HighPoint RocketRAID 622",  AHCI_Q_NOBSYRES},
-   {0x06221b4b, 0x00, "HighPoint RocketRAID 622",  AHCI_Q_NOBSYRES},
-   {0x06401103, 0x00, "HighPoint RocketRAID 640",  AHCI_Q_NOBSYRES},
-   {0x06401b4b, 0x00, "HighPoint RocketRAID 640",  AHCI_Q_NOBSYRES},
-   {0x06441103, 0x00, "HighPoint RocketRAID 644",  AHCI_Q_NOBSYRES},
-   {0x06441b4b, 0x00, "HighPoint RocketRAID 644",  AHCI_Q_NOBSYRES},
-   {0x06411103, 0x00, "HighPoint RocketRAID 640L", AHCI_Q_NOBSYRES},
-   {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_NOBSYRES},
-   {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_NOBSYRES},
+   {0x91201b4b, 0x00, "Marvell 88SE912x",  AHCI_Q_EDGEIS},
+   {0x91231b4b, 0x11, "Marvell 88SE912x",  AHCI_Q_ALTSIG},
+   {0x91231b4b, 0x00, "Marvell 88SE912x",  AHCI_Q_EDGEIS|AHCI_Q_SATA2},
+   {0x91251b4b, 0x00, "Marvell 88SE9125",  0},
+   {0x91281b4b, 0x00, "Marvell 88SE9128",  AHCI_Q_ALTSIG},
+

svn commit: r271167 - head/usr.sbin/autofs

2014-09-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep  5 14:32:09 2014
New Revision: 271167
URL: http://svnweb.freebsd.org/changeset/base/271167

Log:
  Make it possible to quote names in autofs maps using double quotes.
  
  Note that this is a workaround, not a proper solution.  If you know
  lex well, and want to help - please let me know, I'll explain how it
  should work.
  
  PR:   192968
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/autofs/token.l

Modified: head/usr.sbin/autofs/token.l
==
--- head/usr.sbin/autofs/token.lFri Sep  5 14:19:02 2014
(r271166)
+++ head/usr.sbin/autofs/token.lFri Sep  5 14:32:09 2014
(r271167)
@@ -48,6 +48,7 @@ extern intyylex(void);
 %option noyywrap
 
 %%
+\"[^"]+\"  { yytext++; yytext[strlen(yytext) - 1] = '\0'; return 
STR; };
 [a-zA-Z0-9\.\+-_/\:\[\]$&{}]+ { return STR; }
 #.*\n  { lineno++; return NEWLINE; };
 \\\n   { lineno++; };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271168 - head

2014-09-05 Thread Kevin Lo
Author: kevlo
Date: Fri Sep  5 14:35:34 2014
New Revision: 271168
URL: http://svnweb.freebsd.org/changeset/base/271168

Log:
  Revert r271159, Mis-patched the tree.
  
  Pointed out by:   kib

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Fri Sep  5 14:32:09 2014(r271167)
+++ head/Makefile   Fri Sep  5 14:35:34 2014(r271168)
@@ -1,42 +1,6 @@
 #
 # $FreeBSD$
 #
-# Copyright (c) 2014 Kevin Lo. 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.
-#
-
-S= ${.CURDIR}/../../..
-
-.PATH: $S/dev/usb/misc
-
-KMOD=  uled
-SRCS=  opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
-   uled.c
-
-.include 
-#
-# $FreeBSD$
-#
 # The user-driven targets are:
 #
 # universe- *Really* build *everything* (buildworld and
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled

2014-09-05 Thread Hans Petter Selasky

On 09/05/14 15:08, Konstantin Belousov wrote:

On Fri, Sep 05, 2014 at 11:25:58AM +, Kevin Lo wrote:

Author: kevlo
Date: Fri Sep  5 11:25:58 2014
New Revision: 271159
URL: http://svnweb.freebsd.org/changeset/base/271159

Log:
   The USB LED driver for the Dream Cheeky WebMail Notifier.

   Reviewed by: hselasky

Added:
   head/share/man/man4/uled.4   (contents, props changed)
   head/sys/dev/usb/misc/uled.c   (contents, props changed)
   head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
   head/sys/modules/usb/uled/
   head/sys/modules/usb/uled/Makefile   (contents, props changed)
Modified:
   head/Makefile

^



Hi,

The "head/Makefile" was not part of the reviewed patch sent to me.
Anyway, USB modules rock also at toplevel ;-)

--HPS

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


Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled

2014-09-05 Thread Kevin Lo
On Fri, Sep 05, 2014 at 04:08:28PM +0300, Konstantin Belousov wrote:
> On Fri, Sep 05, 2014 at 11:25:58AM +, Kevin Lo wrote:
> > Author: kevlo
> > Date: Fri Sep  5 11:25:58 2014
> > New Revision: 271159
> > URL: http://svnweb.freebsd.org/changeset/base/271159
> > 
> > Log:
> >   The USB LED driver for the Dream Cheeky WebMail Notifier.
> >   
> >   Reviewed by:  hselasky
> > 
> > Added:
> >   head/share/man/man4/uled.4   (contents, props changed)
> >   head/sys/dev/usb/misc/uled.c   (contents, props changed)
> >   head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
> >   head/sys/modules/usb/uled/
> >   head/sys/modules/usb/uled/Makefile   (contents, props changed)
> > Modified:
> >   head/Makefile
> ^
> 
> >   head/share/man/man4/Makefile
> >   head/sys/conf/NOTES
> >   head/sys/conf/files
> >   head/sys/dev/usb/quirk/usb_quirk.c
> >   head/sys/dev/usb/usbdevs
> >   head/sys/modules/usb/Makefile
> > 
> > Modified: head/Makefile
> > ==
> > --- head/Makefile   Fri Sep  5 11:11:15 2014(r271158)
> > +++ head/Makefile   Fri Sep  5 11:25:58 2014(r271159)
> > @@ -1,6 +1,42 @@
> >  #
> >  # $FreeBSD$
> >  #
> > +# Copyright (c) 2014 Kevin Lo. 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.
> > +#
> > +
> > +S= ${.CURDIR}/../../..
> > +
> > +.PATH: $S/dev/usb/misc
> > +
> > +KMOD=  uled
> > +SRCS=  opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h 
> > usbdevs.h \
> > +   uled.c
> > +
> > +.include 
> > +#
> > +# $FreeBSD$
> > +#
> >  # The user-driven targets are:
> >  #
> >  # universe- *Really* build *everything* (buildworld and
> > 
> It seems you mis-patched the commit tree.

I'm sorry that was my damn fault.  Just committed a fix in r271168.
Thanks for spotting.

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


svn commit: r271169 - head/usr.sbin/ctld

2014-09-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep  5 14:48:06 2014
New Revision: 271169
URL: http://svnweb.freebsd.org/changeset/base/271169

Log:
  Turn two errors, which are possible to trigger only by bugs,
  into assertions.
  
  Discussed with:   mav@
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/ctld.c

Modified: head/usr.sbin/ctld/ctld.c
==
--- head/usr.sbin/ctld/ctld.c   Fri Sep  5 14:35:34 2014(r271168)
+++ head/usr.sbin/ctld/ctld.c   Fri Sep  5 14:48:06 2014(r271169)
@@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_f
client_salen = sizeof(client_sa);
kernel_accept(&connection_id, &portal_id,
(struct sockaddr *)&client_sa, &client_salen);
-   if (client_salen < client_sa.ss_len)
-   log_errx(1, "salen %u < %u",
-   client_salen, client_sa.ss_len);
+   assert(client_salen >= client_sa.ss_len);
 
log_debugx("incoming connection, id %d, portal id %d",
connection_id, portal_id);
@@ -1806,10 +1804,8 @@ found:
&client_salen);
if (client_fd < 0)
log_err(1, "accept");
-   if (client_salen < client_sa.ss_len)
-   log_errx(1, "salen %u < %u",
-   client_salen,
-   client_sa.ss_len);
+   assert(client_salen >= 
client_sa.ss_len);
+
handle_connection(portal, client_fd,
(struct sockaddr *)&client_sa,
dont_fork);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271170 - head/usr.sbin/ctld

2014-09-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Sep  5 14:58:24 2014
New Revision: 271170
URL: http://svnweb.freebsd.org/changeset/base/271170

Log:
  Document initiator-portal netmask support.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/ctl.conf.5

Modified: head/usr.sbin/ctld/ctl.conf.5
==
--- head/usr.sbin/ctld/ctl.conf.5   Fri Sep  5 14:48:06 2014
(r271169)
+++ head/usr.sbin/ctld/ctl.conf.5   Fri Sep  5 14:58:24 2014
(r271170)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2014
+.Dd September 5, 2014
 .Dt CTL.CONF 5
 .Os
 .Sh NAME
@@ -118,8 +118,9 @@ If not defined, there will be no restric
 name.
 Otherwise, only initiators with names matching one of defined
 ones will be allowed to connect.
-.It Ic initiator-portal Ao Ar address Ac
-Specifies iSCSI initiator portal - IPv4 or IPv6 address or network.
+.It Ic initiator-portal Ao Ar address Ac Ao Ar / prefixlen Ac
+Specifies the iSCSI initiator portal: an IPv4 or IPv6 address, optionally
+followed by slash and prefix length.
 If not defined, there will be no restrictions based on initiator
 address.
 Otherwise, only initiators with addresses matching one of defined
@@ -178,8 +179,9 @@ Otherwise, only initiators with names ma
 ones will be allowed to connect.
 This clause is mutually exclusive with auth-group; one cannot use
 both in a single target.
-.It Ic initiator-portal Ao Ar address Ac
-Specifies iSCSI initiator portal - IPv4 or IPv6 address.
+.It Ic initiator-portal Ao Ar address Ac Ao Ar / prefixlen Ac
+Specifies the iSCSI initiator portal: an IPv4 or IPv6 address, optionally
+followed by slash and prefix length.
 If not defined, there will be no restrictions based on initiator
 address.
 Otherwise, only initiators with addresses matching one of defined
@@ -234,6 +236,7 @@ pidfile /var/run/ctld.pid
 auth-group example2 {
chap-mutual "user" "secret" "mutualuser" "mutualsecret"
chap-mutual "user2" "secret2" "mutualuser" "mutualsecret"
+   initiator-portal 192.168.1.1/16
 }
 
 portal-group example2 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled

2014-09-05 Thread Kevin Lo
On Fri, Sep 05, 2014 at 04:41:36PM +0200, Hans Petter Selasky wrote:
> 
> On 09/05/14 15:08, Konstantin Belousov wrote:
> > On Fri, Sep 05, 2014 at 11:25:58AM +, Kevin Lo wrote:
> >> Author: kevlo
> >> Date: Fri Sep  5 11:25:58 2014
> >> New Revision: 271159
> >> URL: http://svnweb.freebsd.org/changeset/base/271159
> >>
> >> Log:
> >>The USB LED driver for the Dream Cheeky WebMail Notifier.
> >>
> >>Reviewed by:hselasky
> >>
> >> Added:
> >>head/share/man/man4/uled.4   (contents, props changed)
> >>head/sys/dev/usb/misc/uled.c   (contents, props changed)
> >>head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
> >>head/sys/modules/usb/uled/
> >>head/sys/modules/usb/uled/Makefile   (contents, props changed)
> >> Modified:
> >>head/Makefile
> > ^
> >
> 
> Hi,
> 
> The "head/Makefile" was not part of the reviewed patch sent to me.

Right.  There was something wrong with my tree :(

> Anyway, USB modules rock also at toplevel ;-)
> 
> --HPS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-09-05 Thread John Baldwin
On Friday, September 05, 2014 4:43:05 am Konstantin Belousov wrote:
> On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote:
> > On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote:
> > > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote:
> > > > I thought about that.  I could easily make a parallel array, or perhaps
> > > > use a separate 'susppcb' structure that includes a pcb and the savefpu
> > > > union and change susppcbs to be an array of those.  Which do you 
> > > > prefer? 
> > > > If we want to move some state out of the PCB on amd64 into this, then a
> > > > separate struct for susppcbs might be the sanest.
> > > 
> > > Yes, separate structure seems to be a way forward.
> > 
> > Please see www.freebsd.org/~jhb/patches/susppcb.patch  Note that I moved
> > fpususpend() out into a C function on amd64 so that resumectx() could still 
> > operate on just a pcb.  This also makes savectx and resumectx more symmetric
> > and matches what I ended up doing on i386.  This is tested for suspend and
> > resume on both i386 and amd64.
> 
> The implementation of fpuresume() in C is definitely an improvement.
> 
> You only moved the fpu context to the susppcb, I think this is good for
> now, we will want to move other bits later.
> 
> Do we need to keep pcb layout for KBI compat ?  I remember that pcb
> size is asserted to properly fit into pcpu area for percpu zones.
> But why keep the layout ?  I.e. moving all padding bits to the end.

I wasn't sure.  I thought the padding was there for ABI reasons.  If we don't
need KBI compat, I would much rather consolidate all the padding at the end.

> There is one weird detail, not touched by your patch.  Amd64 resume
> path calls initializecpu(), while i386 does not.  I do not see any
> use for the call, the reload of CRX registers by trampoline/resumectx
> should already set everything to working state.  E.g., enabling XMM
> in CR4 after fpu state is restored looks strange.

I can test that.

> Overall, it looks fine.  Do you prefer to have alloc_fpusave() on i386 ?

Well, it might be nice to have XSAVE on i386.  I'm not sure if Intel has
any 32-bit only chips planned that will use AVX or MPX, etc.  If they are,
then I do think AVX on i386 would be nice to have.  Barring XSAVE I think
we can just use a static savefpu on i386 for now.

We might also consider removing support for 486sx CPUs and requiring an
on-CPU FPU for i386.  If we do that we might able to use a common fpu.c
which would be even nicer.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271173 - in head/sys: conf gdb libkern sys

2014-09-05 Thread Benno Rice
Author: benno
Date: Fri Sep  5 16:40:47 2014
New Revision: 271173
URL: http://svnweb.freebsd.org/changeset/base/271173

Log:
  Add support for gdb's memory searching capabilities to our in-kernel gdb
  server.
  
  Submitted by: Daniel O'Connor 
  Reviewed by:  jhb
  Sponsored by: EMC Isilon Storage Division

Added:
  head/sys/libkern/memmem.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/gdb/gdb_int.h
  head/sys/gdb/gdb_main.c
  head/sys/gdb/gdb_packet.c
  head/sys/sys/libkern.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Sep  5 15:45:20 2014(r271172)
+++ head/sys/conf/files Fri Sep  5 16:40:47 2014(r271173)
@@ -3176,8 +3176,9 @@ libkern/inet_pton.c   standard
 libkern/jenkins_hash.c standard
 libkern/mcount.c   optional profiling-routine
 libkern/memcchr.c  standard
-libkern/memchr.c   optional fdt
+libkern/memchr.c   optional fdt | gdb
 libkern/memcmp.c   standard
+libkern/memmem.c   optional gdb
 libkern/qsort.cstandard
 libkern/qsort_r.c  standard
 libkern/random.c   standard

Modified: head/sys/gdb/gdb_int.h
==
--- head/sys/gdb/gdb_int.h  Fri Sep  5 15:45:20 2014(r271172)
+++ head/sys/gdb/gdb_int.h  Fri Sep  5 16:40:47 2014(r271173)
@@ -60,6 +60,9 @@ void gdb_tx_begin(char);
 int gdb_tx_end(void);
 int gdb_tx_mem(const unsigned char *, size_t);
 void gdb_tx_reg(int);
+int gdb_rx_bindata(unsigned char *data, size_t datalen, size_t *amt);
+int gdb_search_mem(const unsigned char *addr, size_t size,
+const unsigned char *pat, size_t patlen, const unsigned char **found);
 
 static __inline void
 gdb_tx_char(char c)

Modified: head/sys/gdb/gdb_main.c
==
--- head/sys/gdb/gdb_main.c Fri Sep  5 15:45:20 2014(r271172)
+++ head/sys/gdb/gdb_main.c Fri Sep  5 16:40:47 2014(r271173)
@@ -53,6 +53,8 @@ SET_DECLARE(gdb_dbgport_set, struct gdb_
 struct gdb_dbgport *gdb_cur = NULL;
 int gdb_listening = 0;
 
+static unsigned char gdb_bindata[64];
+
 static int
 gdb_init(void)
 {
@@ -254,6 +256,28 @@ gdb_trap(int type, int code)
gdb_tx_begin('l');
gdb_tx_end();
}
+   } else if (gdb_rx_equal("Search:memory:")) {
+   size_t patlen;
+   intmax_t addr, size;
+   const unsigned char *found;
+   if (gdb_rx_varhex(&addr) || gdb_rx_char() != 
';' ||
+   gdb_rx_varhex(&size) || gdb_rx_char() != 
';' ||
+   gdb_rx_bindata(gdb_bindata, 
sizeof(gdb_bindata), &patlen)) {
+   gdb_tx_err(EINVAL);
+   break;
+   }
+   if (gdb_search_mem((char *)(uintptr_t)addr, 
size, gdb_bindata, patlen, &found)) {
+   if (found == 0ULL)
+   gdb_tx_begin('0');
+   else {
+   gdb_tx_begin('1');
+   gdb_tx_char(',');
+   
gdb_tx_hex((intmax_t)(uintptr_t)found, 8);
+   }
+   gdb_tx_end();
+   } else
+   gdb_tx_err(EIO);
+   break;
} else if (!gdb_cpu_query())
gdb_tx_empty();
break;

Modified: head/sys/gdb/gdb_packet.c
==
--- head/sys/gdb/gdb_packet.c   Fri Sep  5 15:45:20 2014(r271172)
+++ head/sys/gdb/gdb_packet.c   Fri Sep  5 16:40:47 2014(r271173)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -320,3 +321,46 @@ gdb_tx_reg(int regnum)
} else
gdb_tx_mem(regp, regsz);
 }
+
+/* Read binary data up until the end of the packet or until we have datalen 
decoded bytes */
+int
+gdb_rx_bindata(unsigned char *data, size_t datalen, size_t *amt)
+{
+   int c;
+
+   *amt = 0;
+
+   while (*amt < datalen) {
+   c = gdb_rx_char();
+   /* End of packet? */
+   if (c == -1)
+   break;
+   /* Escaped character up next */
+ 

svn commit: r271174 - head/sys/sys

2014-09-05 Thread Robert Watson
Author: rwatson
Date: Fri Sep  5 16:46:28 2014
New Revision: 271174
URL: http://svnweb.freebsd.org/changeset/base/271174

Log:
  Clarify a diagnostic printf() in the mbuf code: M_EXT doesn't necessarily
  imply a cluster is attached; it could also refer to some other sort of
  external storage (e.g., an sf_buf).
  
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Fri Sep  5 16:40:47 2014(r271173)
+++ head/sys/sys/mbuf.h Fri Sep  5 16:46:28 2014(r271174)
@@ -672,7 +672,7 @@ m_clget(struct mbuf *m, int how)
 {
 
if (m->m_flags & M_EXT)
-   printf("%s: %p mbuf already has cluster\n", __func__, m);
+   printf("%s: %p mbuf already has external storage\n", __func__, 
m);
m->m_ext.ext_buf = (char *)NULL;
uma_zalloc_arg(zone_clust, m, how);
/*
@@ -698,7 +698,7 @@ m_cljget(struct mbuf *m, int how, int si
uma_zone_t zone;
 
if (m && m->m_flags & M_EXT)
-   printf("%s: %p mbuf already has cluster\n", __func__, m);
+   printf("%s: %p mbuf already has external storage\n", __func__, 
m);
if (m != NULL)
m->m_ext.ext_buf = NULL;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271175 - head/sys/fs/nfs

2014-09-05 Thread Robert Watson
Author: rwatson
Date: Fri Sep  5 17:05:51 2014
New Revision: 271175
URL: http://svnweb.freebsd.org/changeset/base/271175

Log:
  Garbage collect NFSMINOFF() from the NFS stack; this unused macro replicates
  mbuf-initialisation logic that is best left to centralised mbuf utility
  code rather than scattered around the kernel.
  
  MFC after:3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/fs/nfs/nfsm_subs.h

Modified: head/sys/fs/nfs/nfsm_subs.h
==
--- head/sys/fs/nfs/nfsm_subs.h Fri Sep  5 16:46:28 2014(r271174)
+++ head/sys/fs/nfs/nfsm_subs.h Fri Sep  5 17:05:51 2014(r271175)
@@ -47,13 +47,6 @@
  * First define what the actual subs. return
  */
 #defineM_HASCL(m)  ((m)->m_flags & M_EXT)
-#defineNFSMINOFF(m)
\
-   if (M_HASCL(m)) \
-   (m)->m_data = (m)->m_ext.ext_buf;   \
-   else if ((m)->m_flags & M_PKTHDR)   \
-   (m)->m_data = (m)->m_pktdat;\
-   else\
-   (m)->m_data = (m)->m_dat
 #defineNFSMSIZ(m)  ((M_HASCL(m))?MCLBYTES: 
\
(((m)->m_flags & M_PKTHDR)?MHLEN:MLEN))
 #defineNFSM_DATAP(m, s)(m)->m_data += (s)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271178 - head/contrib/llvm/patches

2014-09-05 Thread Ed Maste
Author: emaste
Date: Fri Sep  5 18:07:15 2014
New Revision: 271178
URL: http://svnweb.freebsd.org/changeset/base/271178

Log:
  Correct patch paths (remove contrib/llvm/)
  
  The example in contrib/llvm/patches/README.TXT fails otherwise.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff

Modified: 
head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff
==
--- head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff   
Fri Sep  5 17:44:10 2014(r271177)
+++ head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff   
Fri Sep  5 18:07:15 2014(r271178)
@@ -1,7 +1,7 @@
-Index: contrib/llvm/include/llvm/Support/ELF.h
+Index: include/llvm/Support/ELF.h
 ===
 contrib/llvm/include/llvm/Support/ELF.h(revision 270019)
-+++ contrib/llvm/include/llvm/Support/ELF.h(working copy)
+--- include/llvm/Support/ELF.h (revision 270019)
 include/llvm/Support/ELF.h (working copy)
 @@ -437,6 +437,7 @@
R_PPC_GOT16_LO  = 15,
R_PPC_GOT16_HI  = 16,
@@ -10,10 +10,10 @@ Index: contrib/llvm/include/llvm/Support
R_PPC_REL32 = 26,
R_PPC_TLS   = 67,
R_PPC_DTPMOD32  = 68,
-Index: contrib/llvm/lib/Object/ELF.cpp
+Index: lib/Object/ELF.cpp
 ===
 contrib/llvm/lib/Object/ELF.cpp(revision 270019)
-+++ contrib/llvm/lib/Object/ELF.cpp(working copy)
+--- lib/Object/ELF.cpp (revision 270019)
 lib/Object/ELF.cpp (working copy)
 @@ -507,6 +507,7 @@
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_GOT16_LO);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_GOT16_HI);
@@ -22,10 +22,10 @@ Index: contrib/llvm/lib/Object/ELF.cpp
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_REL32);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_TLS);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_DTPMOD32);
-Index: contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+Index: lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
 ===
 contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp 
(revision 270019)
-+++ contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp 
(working copy)
+--- lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp  (revision 270019)
 lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp  (working copy)
 @@ -18,6 +18,7 @@
  #include "llvm/MC/MCExpr.h"
  #include "llvm/MC/MCInst.h"
@@ -52,10 +52,10 @@ Index: contrib/llvm/lib/Target/PowerPC/I
  }
  
  
-Index: contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
+Index: lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
 ===
 contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
(revision 270019)
-+++ contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
(working copy)
+--- lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (revision 
270019)
 lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (working copy)
 @@ -64,7 +64,15 @@
llvm_unreachable("Unimplemented");
  case PPC::fixup_ppc_br24:
@@ -123,10 +123,10 @@ Index: contrib/llvm/lib/Target/PowerPC/M
  break;
}
break;
-Index: contrib/llvm/lib/Target/PowerPC/PPC.h
+Index: lib/Target/PowerPC/PPC.h
 ===
 contrib/llvm/lib/Target/PowerPC/PPC.h  (revision 270019)
-+++ contrib/llvm/lib/Target/PowerPC/PPC.h  (working copy)
+--- lib/Target/PowerPC/PPC.h   (revision 270019)
 lib/Target/PowerPC/PPC.h   (working copy)
 @@ -53,10 +53,11 @@
  // PPC Specific MachineOperand flags.
  MO_NO_FLAG,
@@ -143,10 +143,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P
  
  /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
  /// the function's picbase, e.g. lo16(symbol-picbase).
-Index: contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+Index: lib/Target/PowerPC/PPCAsmPrinter.cpp
 ===
 contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  (revision 270019)
-+++ contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  (working copy)
+--- lib/Target/PowerPC/PPCAsmPrinter.cpp   (revision 270019)
 lib/Target/PowerPC/PPCAsmPrinter.cpp   (working copy)
 @@ -19,6 +19,7 @@
  #define DEBUG_TYPE "asmprinter"
  #include "PPC.h"
@@ -578,10 +578,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P
  }
}
  
-Index: contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+Index: lib/Target/PowerPC/PPCFrameLowering.cpp
 

Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-09-05 Thread Bruce Evans

On Fri, 5 Sep 2014, John Baldwin wrote:


We might also consider removing support for 486sx CPUs and requiring an
on-CPU FPU for i386.  If we do that we might able to use a common fpu.c
which would be even nicer.


You mean a common npx.c.  The 'x' part of npx.c is much more descriptive
now than it was when the only extension was the floating point one.  The 
'n' part of npx.c is now too specific, but not as specific as the 'fp'

part of fpu.c.

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


svn commit: r271179 - head/lib/libc/arm

2014-09-05 Thread Andrew Turner
Author: andrew
Date: Fri Sep  5 18:11:36 2014
New Revision: 271179
URL: http://svnweb.freebsd.org/changeset/base/271179

Log:
  Add the fp{get,set}{mask,round} functions to the public symbols in the map.
  These are only exported for armv6hf as the soft-float ABIs have these in
  the softfloat Symbol.map file.

Added:
  head/lib/libc/arm/Symbol_vfp.map   (contents, props changed)
Modified:
  head/lib/libc/arm/Makefile.inc

Modified: head/lib/libc/arm/Makefile.inc
==
--- head/lib/libc/arm/Makefile.inc  Fri Sep  5 18:07:15 2014
(r271178)
+++ head/lib/libc/arm/Makefile.inc  Fri Sep  5 18:11:36 2014
(r271179)
@@ -16,3 +16,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi
 .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc"
 .endif
 
+.if ${MACHINE_ARCH} == "armv6hf"
+SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map
+.endif
+

Added: head/lib/libc/arm/Symbol_vfp.map
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/arm/Symbol_vfp.mapFri Sep  5 18:11:36 2014
(r271179)
@@ -0,0 +1,10 @@
+/*
+ * $FreeBSD$
+ */
+
+FBSD_1.0 {
+   fpgetmask;
+   fpgetround;
+   fpsetmask;
+   fpsetround;
+};
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271180 - head/sys/dev/vt/hw/vga

2014-09-05 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Fri Sep  5 18:11:39 2014
New Revision: 271180
URL: http://svnweb.freebsd.org/changeset/base/271180

Log:
  vt_vga: vd_setpixel_t and vd_drawrect_t are noop in text mode
  
  MFC after:3 days

Modified:
  head/sys/dev/vt/hw/vga/vt_vga.c

Modified: head/sys/dev/vt/hw/vga/vt_vga.c
==
--- head/sys/dev/vt/hw/vga/vt_vga.c Fri Sep  5 18:11:36 2014
(r271179)
+++ head/sys/dev/vt/hw/vga/vt_vga.c Fri Sep  5 18:11:39 2014
(r271180)
@@ -352,6 +352,9 @@ static void
 vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color)
 {
 
+   if (vd->vd_flags & VDF_TEXTMODE)
+   return;
+
vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color,
0x80 >> (x % 8));
 }
@@ -362,6 +365,9 @@ vga_drawrect(struct vt_device *vd, int x
 {
int x, y;
 
+   if (vd->vd_flags & VDF_TEXTMODE)
+   return;
+
for (y = y1; y <= y2; y++) {
if (fill || (y == y1) || (y == y2)) {
for (x = x1; x <= x2; x++)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271181 - head/sys/arm/arm

2014-09-05 Thread Andrew Turner
Author: andrew
Date: Fri Sep  5 19:00:30 2014
New Revision: 271181
URL: http://svnweb.freebsd.org/changeset/base/271181

Log:
  Add the virtual timer irq to the list of interrupts we enable on secondary
  cores.

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

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Fri Sep  5 18:11:39 2014(r271180)
+++ head/sys/arm/arm/gic.c  Fri Sep  5 19:00:30 2014(r271181)
@@ -166,7 +166,10 @@ gic_init_secondary(void)
/* Enable interrupt distribution */
gic_d_write_4(GICD_CTLR, 0x01);
 
-   /* Activate IRQ 29-30, ie private timer (secure & non-secure) IRQs */
+   /*
+* Activate the timer interrupts: virtual, secure, and non-secure.
+*/
+   gic_d_write_4(GICD_ISENABLER(27 >> 5), (1UL << (27 & 0x1F)));
gic_d_write_4(GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F)));
gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F)));
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271182 - head/sys/kern

2014-09-05 Thread Gleb Smirnoff
Author: glebius
Date: Fri Sep  5 19:50:18 2014
New Revision: 271182
URL: http://svnweb.freebsd.org/changeset/base/271182

Log:
  Set vnet context before accessing V_socket_hhh[].
  
  Submitted by: "Hiroo Ono (小野寛生)" 

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Fri Sep  5 19:00:30 2014(r271181)
+++ head/sys/kern/uipc_socket.c Fri Sep  5 19:50:18 2014(r271182)
@@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint)
return 1;
}
 
+   CURVNET_SET(so->so_vnet);
if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
/* This hook returning non-zero indicates an event, not error */
return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
+   CURVNET_RESTORE();

return (0);
 }
@@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint
SOCKBUF_LOCK_ASSERT(&so->so_snd);
kn->kn_data = sbspace(&so->so_snd);
 
+   CURVNET_SET(so->so_vnet);
if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0)
hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE);
+   CURVNET_RESTORE();
 
if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
kn->kn_flags |= EV_EOF;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

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

2014-09-05 Thread Mateusz Guzik
On Fri, Sep 05, 2014 at 07:50:18PM +, Gleb Smirnoff wrote:
> Author: glebius
> Date: Fri Sep  5 19:50:18 2014
> New Revision: 271182
> URL: http://svnweb.freebsd.org/changeset/base/271182
> 
> Log:
>   Set vnet context before accessing V_socket_hhh[].
>   
>   Submitted by:   "Hiroo Ono (小野寛生)" 
> 
> Modified:
>   head/sys/kern/uipc_socket.c
> 
> Modified: head/sys/kern/uipc_socket.c
> ==
> --- head/sys/kern/uipc_socket.c   Fri Sep  5 19:00:30 2014
> (r271181)
> +++ head/sys/kern/uipc_socket.c   Fri Sep  5 19:50:18 2014
> (r271182)
> @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint)
>   return 1;
>   }
>  
> + CURVNET_SET(so->so_vnet);
>   if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
>   /* This hook returning non-zero indicates an event, not error */
>   return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
> + CURVNET_RESTORE();
>   

should not this be something like:
error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD);
CURVNET_RESTORE();
return (error);
?

>   return (0);
>  }
> @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint
>   SOCKBUF_LOCK_ASSERT(&so->so_snd);
>   kn->kn_data = sbspace(&so->so_snd);
>  
> + CURVNET_SET(so->so_vnet);
>   if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0)
>   hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE);
> + CURVNET_RESTORE();
>  
>   if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
>   kn->kn_flags |= EV_EOF;
> 

-- 
Mateusz Guzik 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

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

2014-09-05 Thread Garrett Cooper

> On Sep 5, 2014, at 12:54, Mateusz Guzik  wrote:
> 
>> On Fri, Sep 05, 2014 at 07:50:18PM +, Gleb Smirnoff wrote:
>> Author: glebius
>> Date: Fri Sep  5 19:50:18 2014
>> New Revision: 271182
>> URL: http://svnweb.freebsd.org/changeset/base/271182
>> 
>> Log:
>>  Set vnet context before accessing V_socket_hhh[].
>> 
>>  Submitted by:"Hiroo Ono (小野寛生)" 
>> 
>> Modified:
>>  head/sys/kern/uipc_socket.c
>> 
>> Modified: head/sys/kern/uipc_socket.c
>> ==
>> --- head/sys/kern/uipc_socket.cFri Sep  5 19:00:30 2014(r271181)
>> +++ head/sys/kern/uipc_socket.cFri Sep  5 19:50:18 2014(r271182)
>> @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint)
>>return 1;
>>}
>> 
>> +CURVNET_SET(so->so_vnet);
>>if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
>>/* This hook returning non-zero indicates an event, not error */
>>return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
>> +CURVNET_RESTORE();
> 
> should not this be something like:
>error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD);
>CURVNET_RESTORE();
>return (error);
> ?

Probably :/..


>>return (0);
>> }
>> @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint
>>SOCKBUF_LOCK_ASSERT(&so->so_snd);
>>kn->kn_data = sbspace(&so->so_snd);
>> 
>> +CURVNET_SET(so->so_vnet);
>>if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0)
>>hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE);
>> +CURVNET_RESTORE();
>> 
>>if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
>>kn->kn_flags |= EV_EOF;
> 
> -- 
> Mateusz Guzik 
> 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-09-05 Thread Adrian Chadd
I'm building a vimage kernel now to at least compile test a fix.

Thanks,


-a


On 5 September 2014 12:59, Garrett Cooper  wrote:
>
>> On Sep 5, 2014, at 12:54, Mateusz Guzik  wrote:
>>
>>> On Fri, Sep 05, 2014 at 07:50:18PM +, Gleb Smirnoff wrote:
>>> Author: glebius
>>> Date: Fri Sep  5 19:50:18 2014
>>> New Revision: 271182
>>> URL: http://svnweb.freebsd.org/changeset/base/271182
>>>
>>> Log:
>>>  Set vnet context before accessing V_socket_hhh[].
>>>
>>>  Submitted by:"Hiroo Ono (小野寛生)" 
>>>
>>> Modified:
>>>  head/sys/kern/uipc_socket.c
>>>
>>> Modified: head/sys/kern/uipc_socket.c
>>> ==
>>> --- head/sys/kern/uipc_socket.cFri Sep  5 19:00:30 2014(r271181)
>>> +++ head/sys/kern/uipc_socket.cFri Sep  5 19:50:18 2014(r271182)
>>> @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint)
>>>return 1;
>>>}
>>>
>>> +CURVNET_SET(so->so_vnet);
>>>if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
>>>/* This hook returning non-zero indicates an event, not error */
>>>return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
>>> +CURVNET_RESTORE();
>>
>> should not this be something like:
>>error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD);
>>CURVNET_RESTORE();
>>return (error);
>> ?
>
> Probably :/..
>
>
>>>return (0);
>>> }
>>> @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint
>>>SOCKBUF_LOCK_ASSERT(&so->so_snd);
>>>kn->kn_data = sbspace(&so->so_snd);
>>>
>>> +CURVNET_SET(so->so_vnet);
>>>if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0)
>>>hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE);
>>> +CURVNET_RESTORE();
>>>
>>>if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
>>>kn->kn_flags |= EV_EOF;
>>
>> --
>> Mateusz Guzik 
>>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r271141 - in head/sys: kern sys

2014-09-05 Thread Mateusz Guzik
On Thu, Sep 04, 2014 at 09:31:25PM +, Sean Bruno wrote:
> Author: sbruno
> Date: Thu Sep  4 21:31:25 2014
> New Revision: 271141
> URL: http://svnweb.freebsd.org/changeset/base/271141
> 
> Log:
>   Allow multiple image activators to run on the same execution by changing
>   imgp->interpreted to a bitmask instead of, functionally, a bool. Each
>   imgactivator now requires its own flag in interpreted to indicate whether
>   or not it has already examined argv[0].
>   
>   Change imgp->interpreted to an unsigned char to add one extra bit for
>   future use.
>   
>   With this change, one can execute a shell script from a 64bit host native
>   make and still get the binmisc image activator to fire for the script
>   interpreter.  Prior to this, execution would fail.
>   
>   Phabric:https://reviews.freebsd.org/D696
>   Reviewed by:jhb@
>   MFC after:  4 weeks
> 
> Modified:
>   head/sys/kern/imgact_binmisc.c
>   head/sys/kern/imgact_shell.c
>   head/sys/sys/imgact.h
> 
> Modified: head/sys/kern/imgact_binmisc.c
> ==
> --- head/sys/kern/imgact_binmisc.cThu Sep  4 21:28:25 2014
> (r271140)
> +++ head/sys/kern/imgact_binmisc.cThu Sep  4 21:31:25 2014
> (r271141)
> @@ -600,12 +600,12 @@ imgact_binmisc_exec(struct image_params 
>   }
>  
>   /* No interpreter nesting allowed. */
> - if (imgp->interpreted) {
> + if (imgp->interpreted & IMGACT_BINMISC) {
>   mtx_unlock(&interp_list_mtx);
>   return (ENOEXEC);
>   }
>  

Unrealated, but I have to ask: can't this be converted to an rmlock?

-- 
Mateusz Guzik 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-09-05 Thread Adrian Chadd
How's this look?


adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/

Index: sys/kern/uipc_socket.c

===

--- sys/kern/uipc_socket.c  (revision 271182)

+++ sys/kern/uipc_socket.c  (working copy)

@@ -448,10 +448,12 @@

mac_socket_destroy(so);

 #endif

CURVNET_SET(so->so_vnet);

-   if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0)

+   if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) {

hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE);

-   CURVNET_RESTORE();

-

+   CURVNET_RESTORE();

+   } else {

+   CURVNET_RESTORE();

+   }

crfree(so->so_cred);

khelp_destroy_osd(&so->osd);

sx_destroy(&so->so_snd.sb_sx);

@@ -3245,6 +3247,7 @@

 filt_soread(struct knote *kn, long hint)

 {

struct socket *so;

+   int ret;



so = kn->kn_fp->f_data;

SOCKBUF_LOCK_ASSERT(&so->so_rcv);

@@ -3266,11 +3269,15 @@

}



CURVNET_SET(so->so_vnet);

-   if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)

+   if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) {

/* This hook returning non-zero indicates an event, not error */

-   return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));

-   CURVNET_RESTORE();

-

+   ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));

+   CURVNET_RESTORE();

+   return (ret);

+   } else {

+   CURVNET_RESTORE();

+   }

+

return (0);

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


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

2014-09-05 Thread Mateusz Guzik
On Fri, Sep 05, 2014 at 04:30:24PM -0700, Adrian Chadd wrote:
> How's this look?
> 

Malformed. :-P

I would prefer:
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index c6c3152..de72da5 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -3245,6 +3245,7 @@ static int
 filt_soread(struct knote *kn, long hint)
 {
struct socket *so;
+   int ret;
 
so = kn->kn_fp->f_data;
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
@@ -3267,11 +3268,12 @@ filt_soread(struct knote *kn, long hint)
 
CURVNET_SET(so->so_vnet);
if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
-   /* This hook returning non-zero indicates an event, not error */
-   return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
+   ret = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD);
+   else
+   ret = 0;
CURVNET_RESTORE();

-   return (0);
+   return (ret);
 }
 
 static void


But I'm fine either way.

> 
> adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/
> 
> Index: sys/kern/uipc_socket.c
> 
> ===
> 
> --- sys/kern/uipc_socket.c  (revision 271182)
> 
> +++ sys/kern/uipc_socket.c  (working copy)
> 
> @@ -448,10 +448,12 @@
> 
> mac_socket_destroy(so);
> 
>  #endif
> 
> CURVNET_SET(so->so_vnet);
> 
> -   if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0)
> 
> +   if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) {
> 
> hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE);
> 
> -   CURVNET_RESTORE();
> 
> -
> 
> +   CURVNET_RESTORE();
> 
> +   } else {
> 
> +   CURVNET_RESTORE();
> 
> +   }
> 
> crfree(so->so_cred);
> 
> khelp_destroy_osd(&so->osd);
> 
> sx_destroy(&so->so_snd.sb_sx);
> 
> @@ -3245,6 +3247,7 @@
> 
>  filt_soread(struct knote *kn, long hint)
> 
>  {
> 
> struct socket *so;
> 
> +   int ret;
> 
> 
> 
> so = kn->kn_fp->f_data;
> 
> SOCKBUF_LOCK_ASSERT(&so->so_rcv);
> 
> @@ -3266,11 +3269,15 @@
> 
> }
> 
> 
> 
> CURVNET_SET(so->so_vnet);
> 
> -   if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
> 
> +   if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) {
> 
> /* This hook returning non-zero indicates an event, not error 
> */
> 
> -   return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
> 
> -   CURVNET_RESTORE();
> 
> -
> 
> +   ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
> 
> +   CURVNET_RESTORE();
> 
> +   return (ret);
> 
> +   } else {
> 
> +   CURVNET_RESTORE();
> 
> +   }
> 
> +
> 
> return (0);
> 
>  }

-- 
Mateusz Guzik 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271183 - head/sys/kern

2014-09-05 Thread Mateusz Guzik
Author: mjg
Date: Fri Sep  5 23:56:25 2014
New Revision: 271183
URL: http://svnweb.freebsd.org/changeset/base/271183

Log:
  Plug unnecessary fp assignments in kern_fcntl.
  
  No functional changes.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cFri Sep  5 19:50:18 2014
(r271182)
+++ head/sys/kern/kern_descrip.cFri Sep  5 23:56:25 2014
(r271183)
@@ -509,7 +509,7 @@ kern_fcntl(struct thread *td, int fd, in
 
case F_GETFD:
FILEDESC_SLOCK(fdp);
-   if ((fp = fget_locked(fdp, fd)) == NULL) {
+   if (fget_locked(fdp, fd) == NULL) {
FILEDESC_SUNLOCK(fdp);
error = EBADF;
break;
@@ -522,7 +522,7 @@ kern_fcntl(struct thread *td, int fd, in
 
case F_SETFD:
FILEDESC_XLOCK(fdp);
-   if ((fp = fget_locked(fdp, fd)) == NULL) {
+   if (fget_locked(fdp, fd) == NULL) {
FILEDESC_XUNLOCK(fdp);
error = EBADF;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"