svn commit: r253380 - head/lib/libc/stdlib

2013-07-16 Thread Andriy Gapon
Author: avg
Date: Tue Jul 16 07:26:46 2013
New Revision: 253380
URL: http://svnweb.freebsd.org/changeset/base/253380

Log:
  libc: name passed into __setenv is not necessarily NUL-terminated
  
  That's particularly true when __setenv is called from __merge_environ.
  
  MFC after:4 days

Modified:
  head/lib/libc/stdlib/getenv.c

Modified: head/lib/libc/stdlib/getenv.c
==
--- head/lib/libc/stdlib/getenv.c   Tue Jul 16 06:50:22 2013
(r253379)
+++ head/lib/libc/stdlib/getenv.c   Tue Jul 16 07:26:46 2013
(r253380)
@@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLe
envVars[envNdx].valueSize = valueLen;
 
/* Save name of name/value pair. */
-   env = stpcpy(envVars[envNdx].name, name);
+   env = stpncpy(envVars[envNdx].name, name, nameLen);
if ((envVars[envNdx].name)[nameLen] != '=')
env = stpcpy(env, "=");
}
___
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: r253384 - head/tools/regression/pthread/cv_cancel1

2013-07-16 Thread Kevin Lo
Author: kevlo
Date: Tue Jul 16 09:22:50 2013
New Revision: 253384
URL: http://svnweb.freebsd.org/changeset/base/253384

Log:
  Add missing header needed by sleep(3).

Modified:
  head/tools/regression/pthread/cv_cancel1/cv_cancel1.c

Modified: head/tools/regression/pthread/cv_cancel1/cv_cancel1.c
==
--- head/tools/regression/pthread/cv_cancel1/cv_cancel1.c   Tue Jul 16 
08:54:19 2013(r253383)
+++ head/tools/regression/pthread/cv_cancel1/cv_cancel1.c   Tue Jul 16 
09:22:50 2013(r253384)
@@ -28,6 +28,7 @@
  */
 #include 
 #include 
+#include 
 
 #define NLOOPS 10
 
___
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: r253385 - head/tools/regression/priv

2013-07-16 Thread Kevin Lo
Author: kevlo
Date: Tue Jul 16 09:38:51 2013
New Revision: 253385
URL: http://svnweb.freebsd.org/changeset/base/253385

Log:
  Use MAN= instead of NO_MAN=
  
  For some reason it still tries to install a priv.1 when using NO_MAN,
  even though there isn't one yet.

Modified:
  head/tools/regression/priv/Makefile

Modified: head/tools/regression/priv/Makefile
==
--- head/tools/regression/priv/Makefile Tue Jul 16 09:22:50 2013
(r253384)
+++ head/tools/regression/priv/Makefile Tue Jul 16 09:38:51 2013
(r253385)
@@ -45,7 +45,7 @@ SRCS= main.c  \
priv_vm_mlock.c \
priv_vm_munlock.c
 
-NO_MAN=
+MAN=
 WARNS?=3
 
 DPADD+= ${LIBIPSEC}
___
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: r253386 - head/tools/regression/sbin/dhclient

2013-07-16 Thread Kevin Lo
Author: kevlo
Date: Tue Jul 16 09:40:59 2013
New Revision: 253386
URL: http://svnweb.freebsd.org/changeset/base/253386

Log:
  Need to define NO_MAN here.

Modified:
  head/tools/regression/sbin/dhclient/Makefile

Modified: head/tools/regression/sbin/dhclient/Makefile
==
--- head/tools/regression/sbin/dhclient/MakefileTue Jul 16 09:38:51 
2013(r253385)
+++ head/tools/regression/sbin/dhclient/MakefileTue Jul 16 09:40:59 
2013(r253386)
@@ -11,6 +11,7 @@ LDADD=-lutil
 
 PROG=  option-domain-search
 
+NO_MAN=
 WARNS?=2
 
 .include 
___
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: r253391 - head/usr.bin/netstat

2013-07-16 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jul 16 12:22:36 2013
New Revision: 253391
URL: http://svnweb.freebsd.org/changeset/base/253391

Log:
  Sweep unused nlist entries.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/usr.bin/netstat/main.c

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Tue Jul 16 11:54:44 2013(r253390)
+++ head/usr.bin/netstat/main.c Tue Jul 16 12:22:36 2013(r253391)
@@ -112,79 +112,57 @@ static struct nlist nl[] = {
{ .n_name = "_mif6table" },
 #defineN_PFKEYSTAT 20
{ .n_name = "_pfkeystat" },
-#defineN_MBSTAT21
-   { .n_name = "_mbstat" },
-#defineN_MBTYPES   22
-   { .n_name = "_mbtypes" },
-#defineN_NMBCLUSTERS   23
-   { .n_name = "_nmbclusters" },
-#defineN_NMBUFS24
-   { .n_name = "_nmbufs" },
-#defineN_MBHI  25
-   { .n_name = "_mbuf_hiwm" },
-#defineN_CLHI  26
-   { .n_name = "_clust_hiwm" },
-#defineN_NCPUS 27
-   { .n_name = "_smp_cpus" },
-#defineN_PAGESZ28
-   { .n_name = "_pagesize" },
-#defineN_MBPSTAT   29
-   { .n_name = "_mb_statpcpu" },
-#defineN_RTTRASH   30
+#defineN_RTTRASH   21
{ .n_name = "_rttrash" },
-#defineN_MBLO  31
-   { .n_name = "_mbuf_lowm" },
-#defineN_CLLO  32
-   { .n_name = "_clust_lowm" },
-#defineN_CARPSTAT  33
+#defineN_CARPSTAT  22
{ .n_name = "_carpstats" },
-#defineN_PFSYNCSTAT34
+#defineN_PFSYNCSTAT23
{ .n_name = "_pfsyncstats" },
-#defineN_AHSTAT35
+#defineN_AHSTAT24
{ .n_name = "_ahstat" },
-#defineN_ESPSTAT   36
+#defineN_ESPSTAT   25
{ .n_name = "_espstat" },
-#defineN_IPCOMPSTAT37
+#defineN_IPCOMPSTAT26
{ .n_name = "_ipcompstat" },
-#defineN_TCPSTAT   38
+#defineN_TCPSTAT   27
{ .n_name = "_tcpstat" },
-#defineN_UDPSTAT   39
+#defineN_UDPSTAT   28
{ .n_name = "_udpstat" },
-#defineN_IPSTAT40
+#defineN_IPSTAT29
{ .n_name = "_ipstat" },
-#defineN_ICMPSTAT  41
+#defineN_ICMPSTAT  30
{ .n_name = "_icmpstat" },
-#defineN_IGMPSTAT  42
+#defineN_IGMPSTAT  31
{ .n_name = "_igmpstat" },
-#defineN_PIMSTAT   43
+#defineN_PIMSTAT   32
{ .n_name = "_pimstat" },
-#defineN_TCBINFO   44
+#defineN_TCBINFO   33
{ .n_name = "_tcbinfo" },
-#defineN_UDBINFO   45
+#defineN_UDBINFO   34
{ .n_name = "_udbinfo" },
-#defineN_DIVCBINFO 46
+#defineN_DIVCBINFO 35
{ .n_name = "_divcbinfo" },
-#defineN_RIPCBINFO 47
+#defineN_RIPCBINFO 36
{ .n_name = "_ripcbinfo" },
-#defineN_UNP_COUNT 48
+#defineN_UNP_COUNT 37
{ .n_name = "_unp_count" },
-#defineN_UNP_GENCNT49
+#defineN_UNP_GENCNT38
{ .n_name = "_unp_gencnt" },
-#defineN_UNP_DHEAD 50
+#defineN_UNP_DHEAD 39
{ .n_name = "_unp_dhead" },
-#defineN_UNP_SHEAD 51
+#defineN_UNP_SHEAD 40
{ .n_name = "_unp_shead" },
-#defineN_RIP6STAT  52
+#defineN_RIP6STAT  41
{ .n_name = "_rip6stat" },
-#defineN_SCTPSTAT  53
+#defineN_SCTPSTAT  42
{ .n_name = "_sctpstat" },
-#defineN_MFCTABLESIZE  54
+#defineN_MFCTABLESIZE  43
{ .n_name = "_mfctablesize" },
-#define N_ARPSTAT   55
+#defineN_ARPSTAT   44
{ .n_name = "_arpstat" },
-#defineN_UNP_SPHEAD56
+#defineN_UNP_SPHEAD45
{ .n_name = "unp_sphead" },
-#defineN_SFSTAT57
+#defineN_SFSTAT46
{ .n_name = "_sfstat"},
{ .n_name = 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"


Re: svn commit: r253367 - in head/sys: i386/i386 mips/mips powerpc/powerpc sparc64/sparc64

2013-07-16 Thread John Baldwin
On Monday, July 15, 2013 11:40:58 am Andrey V. Elsukov wrote:
> Author: ae
> Date: Mon Jul 15 15:40:57 2013
> New Revision: 253367
> URL: http://svnweb.freebsd.org/changeset/base/253367
> 
> Log:
>   Include sys/systm.h after sys/param.h.
>   
>   Suggested by:   pluknet

Does this fix something?

The normal style rule IIUC is to put  or  first,
and then to sort alphabetically.

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


Re: svn commit: r253367 - in head/sys: i386/i386 mips/mips powerpc/powerpc sparc64/sparc64

2013-07-16 Thread Bruce Evans

On Tue, 16 Jul 2013, John Baldwin wrote:


On Monday, July 15, 2013 11:40:58 am Andrey V. Elsukov wrote:

Log:
  Include sys/systm.h after sys/param.h.

  Suggested by: pluknet


Does this fix something?


Style bugs at least.  sys/systm.h defines APIs which may be used in
other headers (in inline functions, typically for KASSERT(); otherwise
the order is not so important).  Sometimes no other header included
by the file has such uses at the time that the include of sys/systm.h
is sorted.  Then a sorting error is just a style bug.  It may become
a bug later when one of the other included headers grows a dependency
on sys/systm.h.


The normal style rule IIUC is to put  or  first,
and then to sort alphabetically.


The normal style rule doesn't apply to sys/systm.h.  It is almost as much
a prerequisite for everything in the kernel as sys/param.h.

Explicitly including sys/types.h at all in kernel files is normally at
least a style bug.  If sys/systm.h is included too, then it is just a
style bug to include both explicitly.  Otherwise, sys/types.h only works
if no other header included by the file has any dependencies on sys/systm.h
(or if one of the other headers satisifies such dependencies for itself and
for later includes by a polluting nested include of sys/systm.h).  Now
almost any use of an API in sys/systm.h gives a dependency (for example,
use of KASSERT() in another macro and not in an inline function gives a
dependency).  As for misordered includes of sys/systm.h, this may change
from a style bug to a bug later if one of the other included headers grows
a dependency on sys/systm.h.  Now it may also change from a style bug to a
bug later in more cases when pollution is removed from one of the other
headers.

sys/systm.h should probably be standard pollution in sys/param.h.  Then
explicitly including it at all would be a style bug, lile explicitly
including one of the other headers that are standard pollution in
sys/param.h.

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

2013-07-16 Thread John Baldwin
Author: jhb
Date: Tue Jul 16 14:42:16 2013
New Revision: 253392
URL: http://svnweb.freebsd.org/changeset/base/253392

Log:
  Workaround some broken BIOSes that specify edge-sensitive but active-low
  settings for ACPI-enumerated serial ports by forcing any IRQs that use
  an ISA IRQ value with these settings to active-high instead of active-low.
  
  This is known to occur with the BIOS on an Intel D2500CCE motherboard.
  
  Tested by:Robert Ames , lev
  Submitted by: Juergen Weiss weiss at uni-mainz.de (original patch)

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Tue Jul 16 12:22:36 2013
(r253391)
+++ head/sys/dev/acpica/acpi_resource.c Tue Jul 16 14:42:16 2013
(r253392)
@@ -135,6 +135,17 @@ acpi_config_intr(device_t dev, ACPI_RESO
 default:
panic("%s: bad resource type %u", __func__, res->Type);
 }
+
+#if defined(__amd64__) || defined(__i386__)
+/*
+ * XXX: Certain BIOSes have buggy AML that specify an IRQ that is
+ * edge-sensitive and active-lo.  However, edge-sensitive IRQs
+ * should be active-hi.  Force IRQs with an ISA IRQ value to be
+ * active-hi instead.
+ */
+if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW)
+   pol = ACPI_ACTIVE_HIGH;
+#endif
 BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ?
INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ?
INTR_POLARITY_HIGH : INTR_POLARITY_LOW);
___
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: r253367 - in head/sys: i386/i386 mips/mips powerpc/powerpc sparc64/sparc64

2013-07-16 Thread John Baldwin
On Tuesday, July 16, 2013 10:35:21 am Bruce Evans wrote:
> On Tue, 16 Jul 2013, John Baldwin wrote:
> 
> > On Monday, July 15, 2013 11:40:58 am Andrey V. Elsukov wrote:
> >> Log:
> >>   Include sys/systm.h after sys/param.h.
> >>
> >>   Suggested by:pluknet
> >
> > Does this fix something?
> 
> Style bugs at least.  sys/systm.h defines APIs which may be used in
> other headers (in inline functions, typically for KASSERT(); otherwise
> the order is not so important).  Sometimes no other header included
> by the file has such uses at the time that the include of sys/systm.h
> is sorted.  Then a sorting error is just a style bug.  It may become
> a bug later when one of the other included headers grows a dependency
> on sys/systm.h.
> 
> > The normal style rule IIUC is to put  or  first,
> > and then to sort alphabetically.
> 
> The normal style rule doesn't apply to sys/systm.h.  It is almost as much
> a prerequisite for everything in the kernel as sys/param.h.
> 
> Explicitly including sys/types.h at all in kernel files is normally at
> least a style bug.  If sys/systm.h is included too, then it is just a
> style bug to include both explicitly.  Otherwise, sys/types.h only works
> if no other header included by the file has any dependencies on sys/systm.h
> (or if one of the other headers satisifies such dependencies for itself and
> for later includes by a polluting nested include of sys/systm.h).  Now
> almost any use of an API in sys/systm.h gives a dependency (for example,
> use of KASSERT() in another macro and not in an inline function gives a
> dependency).  As for misordered includes of sys/systm.h, this may change
> from a style bug to a bug later if one of the other included headers grows
> a dependency on sys/systm.h.  Now it may also change from a style bug to a
> bug later in more cases when pollution is removed from one of the other
> headers.
> 
> sys/systm.h should probably be standard pollution in sys/param.h.  Then
> explicitly including it at all would be a style bug, lile explicitly
> including one of the other headers that are standard pollution in
> sys/param.h.

I would be fine by codifying this via a nested include in  in
the _KERNEL case of  if you think that is the best fix.

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


Re: svn commit: r253367 - in head/sys: i386/i386 mips/mips powerpc/powerpc sparc64/sparc64

2013-07-16 Thread Sergey Kandaurov
On 16 July 2013 18:02, John Baldwin  wrote:
> On Monday, July 15, 2013 11:40:58 am Andrey V. Elsukov wrote:
>> Author: ae
>> Date: Mon Jul 15 15:40:57 2013
>> New Revision: 253367
>> URL: http://svnweb.freebsd.org/changeset/base/253367
>>
>> Log:
>>   Include sys/systm.h after sys/param.h.
>>
>>   Suggested by:   pluknet
>
> Does this fix something?
>
> The normal style rule IIUC is to put  or  first,
> and then to sort alphabetically.

In addition to the style bug mentioned by Bruce, this also fixes build error
on i386. See r252434, r253351 for details.

In file included from /src/sys/i386/i386/uio_machdep.c:48:
/src/sys/sys/systm.h:190:6: error: conflicting types for 'critical_exit'
voidcritical_exit(void);
^
./machine/counter.h:172:3: note: previous implicit declaration is here
critical_exit();
^
JFYI.

-- 
wbr,
pluknet
___
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: r253393 - head/sbin/nvmecontrol

2013-07-16 Thread Jim Harris
Author: jimharris
Date: Tue Jul 16 15:45:37 2013
New Revision: 253393
URL: http://svnweb.freebsd.org/changeset/base/253393

Log:
  Do not throw an error if the user requests to activate the image from
  an empty firmware slot, as long as the user has specified a firmware
  image to download into the empty firmware slot.
  
  Sponsored by: Intel
  Reported by:  Joe Golio 
  MFC after:3 days

Modified:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cTue Jul 16 14:42:16 2013
(r253392)
+++ head/sbin/nvmecontrol/firmware.cTue Jul 16 15:45:37 2013
(r253393)
@@ -246,7 +246,7 @@ firmware(int argc, char *argv[])
"slot %d specified but controller only supports %d slots",
slot, cdata.frmw.num_slots);
 
-   if (!slot_has_valid_firmware(fd, slot))
+   if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot))
errx(1,
"slot %d does not contain valid firmware,\n"
"try 'nvmecontrol logpage -p 3 %s' to get a list "
___
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: r253395 - head/sys/netinet

2013-07-16 Thread Andre Oppermann
Author: andre
Date: Tue Jul 16 16:37:08 2013
New Revision: 253395
URL: http://svnweb.freebsd.org/changeset/base/253395

Log:
  Free the non-fatal "timestamp missing" debug string manually as it is
  not covered by the catch-all free for the error cases.
  
  Found by: Coverity

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Tue Jul 16 15:51:32 2013
(r253394)
+++ head/sys/netinet/tcp_syncache.c Tue Jul 16 16:37:08 2013
(r253395)
@@ -1041,9 +1041,12 @@ syncache_expand(struct in_conninfo *inc,
 * reports of non-compliants stacks.
 */
if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) {
-   if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
+   if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
log(LOG_DEBUG, "%s; %s: Timestamp missing, "
"no action\n", s, __func__);
+   free(s, M_TCPLOG);
+   s = 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: r253396 - in head: . share/mk sys/conf sys/sys tools/build/options

2013-07-16 Thread Andrew Turner
Author: andrew
Date: Tue Jul 16 19:15:19 2013
New Revision: 253396
URL: http://svnweb.freebsd.org/changeset/base/253396

Log:
  2 years, 10 months, 22 days after the projects/arm_eabi branch was created
  make the ARM EABI the default ABI on arm, armeb, armv6 and armv6eb.
  
  This is intended to be the default ABI from now on with the old ABI to be
  retired. Because of this all users are strongly suggested to upgrade to the
  ARM EABI.
  
  As the two ABIs are incompatible it is unlikely upgrading in place will
  work. Users should perform a full backup and either use an external machine
  to upgrade, or install to an alternative location on their media. They
  should also reinstall all ports or packages when these are available.
  
  The only known issues are:
   - pkg incorrectly detects the ABI. This is fixed upstream, and will a
 patch will be made to the port.
   - GDB can have issues with executables built with clang.
  
  __FreeBSD_version has been bumped.

Added:
  head/tools/build/options/WITHOUT_ARM_EABI
 - copied, changed from r253395, head/tools/build/options/WITH_ARM_EABI
Deleted:
  head/tools/build/options/WITH_ARM_EABI
Modified:
  head/UPDATING
  head/share/mk/bsd.own.mk
  head/sys/conf/Makefile.arm
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jul 16 16:37:08 2013(r253395)
+++ head/UPDATING   Tue Jul 16 19:15:19 2013(r253396)
@@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20130716:
+   The default ARM ABI has changed to the ARM EABI. The old ABI is
+   incompatible with the ARM EABI and all programs and modules will
+   need to be rebuilt to work with a new kernel.
+
+   To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set.
+
+   NOTE: Support for the old ABI will be removed in the future and
+   users are advised to upgrade.
+
 20130709:
pkg_install has been disconnected from the build if you really need it
you should add WITH_PKGTOOLS in your src.conf(5).

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Jul 16 16:37:08 2013(r253395)
+++ head/share/mk/bsd.own.mkTue Jul 16 19:15:19 2013(r253396)
@@ -245,6 +245,7 @@ __DEFAULT_YES_OPTIONS = \
 ACPI \
 AMD \
 APM \
+ARM_EABI \
 ASSERT_DEBUG \
 AT \
 ATF \
@@ -363,7 +364,6 @@ __DEFAULT_YES_OPTIONS = \
 ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
-ARM_EABI \
 BSD_PATCH \
 BIND_IDN \
 BIND_LARGE_FILE \

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Tue Jul 16 16:37:08 2013(r253395)
+++ head/sys/conf/Makefile.arm  Tue Jul 16 19:15:19 2013(r253396)
@@ -44,10 +44,10 @@ CFLAGS += -mno-thumb-interwork
 .endif
 
 .if empty(DDB_ENABLED)
-.if !defined(WITH_ARM_EABI) && ${COMPILER_TYPE} != "clang"
+.if defined(WITHOUT_ARM_EABI) && ${COMPILER_TYPE} != "clang"
 CFLAGS += -mno-apcs-frame
 .endif
-.elif defined(WITH_ARM_EABI)
+.elif !defined(WITHOUT_ARM_EABI)
 CFLAGS += -funwind-tables
 .if ${COMPILER_TYPE} == "clang"
 # clang requires us to tell it to emit assembly with unwind information

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Jul 16 16:37:08 2013(r253395)
+++ head/sys/sys/param.hTue Jul 16 19:15:19 2013(r253396)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 137  /* Master, propagated to newvers */
+#define __FreeBSD_version 138  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Copied and modified: head/tools/build/options/WITHOUT_ARM_EABI (from r253395, 
head/tools/build/options/WITH_ARM_EABI)
==
--- head/tools/build/options/WITH_ARM_EABI  Tue Jul 16 16:37:08 2013
(r253395, copy source)
+++ head/tools/build/options/WITHOUT_ARM_EABI   Tue Jul 16 19:15:19 2013
(r253396)
@@ -1,2 +1,2 @@
 .\" $FreeBSD$
-Set the ARM ABI to EABI.
+Set the ARM ABI to OABI.
___
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: r253397 - head/share/man/man5

2013-07-16 Thread Andrew Turner
Author: andrew
Date: Tue Jul 16 19:20:50 2013
New Revision: 253397
URL: http://svnweb.freebsd.org/changeset/base/253397

Log:
  Regen.

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Jul 16 19:15:19 2013
(r253396)
+++ head/share/man/man5/src.conf.5  Tue Jul 16 19:20:50 2013
(r253397)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z 
bapt
 .\" $FreeBSD$
-.Dd July 13, 2013
+.Dd July 16, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -100,9 +100,9 @@ Set to not build
 .Xr apm 8 ,
 .Xr apmd 8
 and related programs.
-.It Va WITH_ARM_EABI
-.\" from FreeBSD: head/tools/build/options/WITH_ARM_EABI 245539 2013-01-17 
05:56:28Z andrew
-Set the ARM ABI to EABI.
+.It Va WITHOUT_ARM_EABI
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 
19:15:19Z andrew
+Set the ARM ABI to OABI.
 .It Va WITHOUT_ASSERT_DEBUG
 .\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 
2006-09-11 13:55:27Z ru
 Set to compile programs and libraries without the
___
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: r253398 - head/sys/dev/usb/controller

2013-07-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jul 16 20:14:23 2013
New Revision: 253398
URL: http://svnweb.freebsd.org/changeset/base/253398

Log:
  Add a tunable to force disable MSI use for xhci(4).
  
  Requested and tested by:  delphij
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

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

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Tue Jul 16 19:20:50 2013
(r253397)
+++ head/sys/dev/usb/controller/xhci_pci.c  Tue Jul 16 20:14:23 2013
(r253398)
@@ -132,6 +132,9 @@ xhci_pci_probe(device_t self)
}
 }
 
+static int xhci_use_msi = 1;
+TUNABLE_INT("hw.usb.xhci.msi", &xhci_use_msi);
+
 static void
 xhci_interrupt_poll(void *_sc)
 {
@@ -171,13 +174,15 @@ xhci_pci_attach(device_t self)
usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0);
 
sc->sc_irq_rid = 0;
-   count = pci_msi_count(self);
-   if (count >= 1) {
-   count = 1;
-   if (pci_alloc_msi(self, &count) == 0) {
-   if (bootverbose)
-   device_printf(self, "MSI enabled\n");
-   sc->sc_irq_rid = 1;
+   if (xhci_use_msi) {
+   count = pci_msi_count(self);
+   if (count >= 1) {
+   count = 1;
+   if (pci_alloc_msi(self, &count) == 0) {
+   if (bootverbose)
+   device_printf(self, "MSI enabled\n");
+   sc->sc_irq_rid = 1;
+   }
}
}
sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ,
___
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: r253396 - in head: . share/mk sys/conf sys/sys tools/build/options

2013-07-16 Thread Roman Divacky
>- GDB can have issues with executables built with clang.

Can you clarify that?

Thanks, Roman
___
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: r253400 - head/sys/arm/arm

2013-07-16 Thread Andrew Turner
Author: andrew
Date: Tue Jul 16 23:19:05 2013
New Revision: 253400
URL: http://svnweb.freebsd.org/changeset/base/253400

Log:
  Fix vfp:
   - We should check is_d32 to see howmany registers we have
   - In vfp_restore mark vfpscr as an output register
  
  Without the second part it appears we can return the incorrect value from
  vfp_bounce if the VFP condition flags are set as it may override the
  register holding the return value.

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

Modified: head/sys/arm/arm/vfp.c
==
--- head/sys/arm/arm/vfp.c  Tue Jul 16 22:14:26 2013(r253399)
+++ head/sys/arm/arm/vfp.c  Tue Jul 16 23:19:05 2013(r253400)
@@ -202,21 +202,20 @@ vfp_restore(struct vfp_state *vfpsave)
 * form ldcl, and similar for stcleq.
 */
 #ifdef __clang__
-#defineldcleq  "ldcleq"
-#definestcleq  "stcleq"
+#defineldclne  "ldclne"
+#definestclne  "stclne"
 #else
-#defineldcleq  "ldceql"
-#definestcleq  "stceql"
+#defineldclne  "ldcnel"
+#definestclne  "stcnel"
 #endif
if (vfpsave) {
-   __asm __volatile("ldc   p10, c0, [%0], #128\n" /* d0-d15 */
-   "cmp%0, #0\n"   /* -D16 or -D32? */
-   ldcleq" p11, c0, [%0], #128\n"  /* d16-d31 */
-   "addne  %0, %0, #128\n" /* skip missing regs */
-   "ldr%1, [%0]\n" /* set old vfpscr */
-   "mcrp10, 7, %1, cr1, c0, 0\n"
-   :: "r" (vfpsave), "r" (vfpscr), "r" (is_d32)
-   : "cc");
+   __asm __volatile("ldc   p10, c0, [%1], #128\n" /* d0-d15 */
+   "cmp%2, #0\n"   /* -D16 or -D32? */
+   ldclne" p11, c0, [%1], #128\n"  /* d16-d31 */
+   "addeq  %1, %1, #128\n" /* skip missing regs */
+   "ldr%0, [%1]\n" /* set old vfpscr */
+   "mcrp10, 7, %0, cr1, c0, 0\n"
+   : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc");
PCPU_SET(vfpcthread, PCPU_GET(curthread));
}
 }
@@ -238,12 +237,12 @@ vfp_store(struct vfp_state *vfpsave)
tmp = fmrx(VFPEXC); /* Is the vfp enabled? */
if (vfpsave && tmp & VFPEXC_EN) {
__asm __volatile("stc   p11, c0, [%1], #128\n" /* d0-d15 */
-   "cmp%0, #0\n"   /* -D16 or -D32? */
-   stcleq" p11, c0, [%1], #128\n"  /* d16-d31 */
-   "addne  %1, %1, #128\n" /* skip missing regs */
+   "cmp%2, #0\n"   /* -D16 or -D32? */
+   stclne" p11, c0, [%1], #128\n"  /* d16-d31 */
+   "addeq  %1, %1, #128\n" /* skip missing regs */
"mrcp10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */
"str%0, [%1]\n" /* save vfpscr */
-   :  "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc");
+   : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc");
}
 #undef ldcleq
 #undef stcleq
___
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: r253402 - head/tools/regression/aio/aiop

2013-07-16 Thread Kevin Lo
Author: kevlo
Date: Wed Jul 17 00:54:21 2013
New Revision: 253402
URL: http://svnweb.freebsd.org/changeset/base/253402

Log:
  Use PRId64 instead of %gd to print an int64_t.

Modified:
  head/tools/regression/aio/aiop/aiop.c

Modified: head/tools/regression/aio/aiop/aiop.c
==
--- head/tools/regression/aio/aiop/aiop.c   Tue Jul 16 23:29:24 2013
(r253401)
+++ head/tools/regression/aio/aiop/aiop.c   Wed Jul 17 00:54:21 2013
(r253402)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -186,7 +187,7 @@ main(int argc, char *argv[])
perror("unknown file type\n");
exit(1);
}
-   printf("File: %s; File size %qd bytes\n", fn, file_size);
+   printf("File: %s; File size %"PRId64" bytes\n", fn, file_size);
 
aio = calloc(aio_len, sizeof(struct aiocb));
abuf = calloc(aio_len, sizeof(char *));
___
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: r253403 - head/tools/regression/lib/libc/gen

2013-07-16 Thread Kevin Lo
Author: kevlo
Date: Wed Jul 17 00:58:23 2013
New Revision: 253403
URL: http://svnweb.freebsd.org/changeset/base/253403

Log:
  Add missing headers.

Modified:
  head/tools/regression/lib/libc/gen/test-fpclassify.c
  head/tools/regression/lib/libc/gen/test-ftw.c

Modified: head/tools/regression/lib/libc/gen/test-fpclassify.c
==
--- head/tools/regression/lib/libc/gen/test-fpclassify.cWed Jul 17 
00:54:21 2013(r253402)
+++ head/tools/regression/lib/libc/gen/test-fpclassify.cWed Jul 17 
00:58:23 2013(r253403)
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 int

Modified: head/tools/regression/lib/libc/gen/test-ftw.c
==
--- head/tools/regression/lib/libc/gen/test-ftw.c   Wed Jul 17 00:54:21 
2013(r253402)
+++ head/tools/regression/lib/libc/gen/test-ftw.c   Wed Jul 17 00:58:23 
2013(r253403)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 extern char **environ;
 
___
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: r253404 - head/sys/dev/ae

2013-07-16 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jul 17 01:24:23 2013
New Revision: 253404
URL: http://svnweb.freebsd.org/changeset/base/253404

Log:
   o TxD ring requires 8 bytes alignment to work so change alignment
 constraint to 8. Previously it may have triggered watchdog
 timeouts.
   o Check whether interrupt is ours or not.
   o Enable interrupts before attemping to transmit queued packets.
 This will slightly improve TX performance.
   o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is
 used to know whether there are enough available TxD ring space.
   o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged
 code to avoid unncessary register access.
   o Make sure to clear TxD, TxS, RxD rings in driver initialization.
 Otherwise some data in these rings could be interpreted as
 'updated' which in turn will advance internally maintained
 pointers and can trigger watchdog timeouts.
  
  PR:   kern/180382

Modified:
  head/sys/dev/ae/if_ae.c

Modified: head/sys/dev/ae/if_ae.c
==
--- head/sys/dev/ae/if_ae.c Wed Jul 17 00:58:23 2013(r253403)
+++ head/sys/dev/ae/if_ae.c Wed Jul 17 01:24:23 2013(r253404)
@@ -585,6 +585,9 @@ ae_init_locked(ae_softc_t *sc)
val = eaddr[0] << 8 | eaddr[1];
AE_WRITE_4(sc, AE_EADDR1_REG, val);
 
+   bzero(sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + 120);
+   bzero(sc->txd_base, AE_TXD_BUFSIZE_DEFAULT);
+   bzero(sc->txs_base, AE_TXS_COUNT_DEFAULT * 4);
/*
 * Set ring buffers base addresses.
 */
@@ -1115,7 +1118,7 @@ ae_alloc_rings(ae_softc_t *sc)
 * Create DMA tag for TxD.
 */
error = bus_dma_tag_create(sc->dma_parent_tag,
-   4, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+   8, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
NULL, NULL, AE_TXD_BUFSIZE_DEFAULT, 1,
AE_TXD_BUFSIZE_DEFAULT, 0, NULL, NULL,
&sc->dma_txd_tag);
@@ -1128,7 +1131,7 @@ ae_alloc_rings(ae_softc_t *sc)
 * Create DMA tag for TxS.
 */
error = bus_dma_tag_create(sc->dma_parent_tag,
-   4, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+   8, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
NULL, NULL, AE_TXS_COUNT_DEFAULT * 4, 1,
AE_TXS_COUNT_DEFAULT * 4, 0, NULL, NULL,
&sc->dma_txs_tag);
@@ -1761,6 +1764,10 @@ ae_int_task(void *arg, int pending)
ifp = sc->ifp;
 
val = AE_READ_4(sc, AE_ISR_REG);/* Read interrupt status. */
+   if (val == 0) {
+   AE_UNLOCK(sc);
+   return;
+   }
 
/*
 * Clear interrupts and disable them.
@@ -1783,12 +1790,16 @@ ae_int_task(void *arg, int pending)
ae_tx_intr(sc);
if ((val & AE_ISR_RX_EVENT) != 0)
ae_rx_intr(sc);
-   }
+   /*
+* Re-enable interrupts.
+*/
+   AE_WRITE_4(sc, AE_ISR_REG, 0);
 
-   /*
-* Re-enable interrupts.
-*/
-   AE_WRITE_4(sc, AE_ISR_REG, 0);
+   if ((sc->flags & AE_FLAG_TXAVAIL) != 0) {
+   if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+   ae_start_locked(ifp);
+   }
+   }
 
AE_UNLOCK(sc);
 }
@@ -1849,10 +1860,10 @@ ae_tx_intr(ae_softc_t *sc)
ifp->if_oerrors++;
 
sc->tx_inproc--;
-
-   ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
}
 
+   if ((sc->flags & AE_FLAG_TXAVAIL) != 0)
+   ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
if (sc->tx_inproc < 0) {
if_printf(ifp, "Received stray Tx interrupt(s).\n");
sc->tx_inproc = 0;
@@ -1860,11 +1871,6 @@ ae_tx_intr(ae_softc_t *sc)
 
if (sc->tx_inproc == 0)
sc->wd_timer = 0;   /* Unarm watchdog. */
-   
-   if ((sc->flags & AE_FLAG_TXAVAIL) != 0) {
-   if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-   ae_start_locked(ifp);
-   }
 
/*
 * Syncronize DMA buffers.
@@ -1923,7 +1929,7 @@ ae_rx_intr(ae_softc_t *sc)
ae_rxd_t *rxd;
struct ifnet *ifp;
uint16_t flags;
-   int error;
+   int count, error;
 
KASSERT(sc != NULL, ("[ae, %d]: sc is NULL!", __LINE__));
 
@@ -1937,7 +1943,7 @@ ae_rx_intr(ae_softc_t *sc)
bus_dmamap_sync(sc->dma_rxd_tag, sc->dma_rxd_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
-   for (;;) {
+   for (count = 0;; count++) {
rxd = (ae_rxd_t *)(sc->rxd_base + sc->rxd_cur);
flags = le16toh(rxd->flags);
if ((flags & AE_RXD_UPDATE) == 0)
@@ -1964,10 +1970,14 @@ ae_rx_intr(ae_softc_t *sc)
}
}
 
-   /*
-* Update Rx index.
-*/
-   AE_WRITE_2(sc, AE_MB_RXD_IDX_REG, s

svn commit: r253406 - head/sys/dev/ae

2013-07-16 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jul 17 01:34:25 2013
New Revision: 253406
URL: http://svnweb.freebsd.org/changeset/base/253406

Log:
  Avoid magic constant.
  No functional change.

Modified:
  head/sys/dev/ae/if_ae.c
  head/sys/dev/ae/if_aereg.h

Modified: head/sys/dev/ae/if_ae.c
==
--- head/sys/dev/ae/if_ae.c Wed Jul 17 01:32:29 2013(r253405)
+++ head/sys/dev/ae/if_ae.c Wed Jul 17 01:34:25 2013(r253406)
@@ -585,7 +585,7 @@ ae_init_locked(ae_softc_t *sc)
val = eaddr[0] << 8 | eaddr[1];
AE_WRITE_4(sc, AE_EADDR1_REG, val);
 
-   bzero(sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + 120);
+   bzero(sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING);
bzero(sc->txd_base, AE_TXD_BUFSIZE_DEFAULT);
bzero(sc->txs_base, AE_TXS_COUNT_DEFAULT * 4);
/*
@@ -1145,8 +1145,8 @@ ae_alloc_rings(ae_softc_t *sc)
 */
error = bus_dma_tag_create(sc->dma_parent_tag,
128, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
-   NULL, NULL, AE_RXD_COUNT_DEFAULT * 1536 + 120, 1,
-   AE_RXD_COUNT_DEFAULT * 1536 + 120, 0, NULL, NULL,
+   NULL, NULL, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING, 1,
+   AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING, 0, NULL, NULL,
&sc->dma_rxd_tag);
if (error != 0) {
device_printf(sc->dev, "could not creare TxS DMA tag.\n");
@@ -1205,15 +1205,15 @@ ae_alloc_rings(ae_softc_t *sc)
return (error);
}
error = bus_dmamap_load(sc->dma_rxd_tag, sc->dma_rxd_map,
-   sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + 120, ae_dmamap_cb,
-   &busaddr, BUS_DMA_NOWAIT);
+   sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING,
+   ae_dmamap_cb, &busaddr, BUS_DMA_NOWAIT);
if (error != 0 || busaddr == 0) {
device_printf(sc->dev,
"could not load DMA map for RxD ring.\n");
return (error);
}
-   sc->dma_rxd_busaddr = busaddr + 120;
-   sc->rxd_base = (ae_rxd_t *)(sc->rxd_base_dma + 120);
+   sc->dma_rxd_busaddr = busaddr + AE_RXD_PADDING;
+   sc->rxd_base = (ae_rxd_t *)(sc->rxd_base_dma + AE_RXD_PADDING);
 
return (0);
 }

Modified: head/sys/dev/ae/if_aereg.h
==
--- head/sys/dev/ae/if_aereg.h  Wed Jul 17 01:32:29 2013(r253405)
+++ head/sys/dev/ae/if_aereg.h  Wed Jul 17 01:34:25 2013(r253406)
@@ -104,6 +104,8 @@
 #defineAE_RXD_COUNT_MIN16
 #defineAE_RXD_COUNT_MAX512
 #defineAE_RXD_COUNT_DEFAULT64
+/* Padding to align frames on a 128-byte boundary. */
+#defineAE_RXD_PADDING  120
 
 #defineAE_TXD_BUFSIZE_MIN  4096
 #defineAE_TXD_BUFSIZE_MAX  65536
___
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: r253407 - head/sys/dev/cxgbe/firmware

2013-07-16 Thread Navdeep Parhar
Author: np
Date: Wed Jul 17 02:37:40 2013
New Revision: 253407
URL: http://svnweb.freebsd.org/changeset/base/253407

Log:
  Specify a timeout for the PL block.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/firmware/t5fw_cfg.txt

Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt
==
--- head/sys/dev/cxgbe/firmware/t5fw_cfg.txtWed Jul 17 01:34:25 2013
(r253406)
+++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txtWed Jul 17 02:37:40 2013
(r253407)
@@ -12,6 +12,9 @@
rss_glb_config_mode = basicvirtual
rss_glb_config_options = tnlmapen, hashtoeplitz, tnlalllkp
 
+   # PL_TIMEOUT register
+   pl_timeout_value = 200  # the timeout value in units of us
+
sge_timer_value = 1, 5, 10, 50, 100, 200# usecs
 
# TP_SHIFT_CNT
@@ -145,7 +148,7 @@
 
 [fini]
version = 0x1
-   checksum = 0xb2417251
+   checksum = 0x93f11b53
 #
 # $FreeBSD$
 #
___
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: r253380 - head/lib/libc/stdlib

2013-07-16 Thread Andrey Chernov
On 16.07.2013 11:26, Andriy Gapon wrote:
> Modified: head/lib/libc/stdlib/getenv.c
> ==
> --- head/lib/libc/stdlib/getenv.c Tue Jul 16 06:50:22 2013
> (r253379)
> +++ head/lib/libc/stdlib/getenv.c Tue Jul 16 07:26:46 2013
> (r253380)
> @@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLe
>   envVars[envNdx].valueSize = valueLen;
>  
>   /* Save name of name/value pair. */
> - env = stpcpy(envVars[envNdx].name, name);
> + env = stpncpy(envVars[envNdx].name, name, nameLen);
>   if ((envVars[envNdx].name)[nameLen] != '=')
>   env = stpcpy(env, "=");
>   }
> 

I am not sure what you are trying to fix, but you just made next line
condition unpredictable random, since (envVars[envNdx].name)[nameLen] is
never filled now and there is freshly malloced memory content, which is
picked for != '=' comparison.

Please back it out or fix. Bug demonstration example added will be nice
too, I see no bug in the original code at first glance.

-- 
http://ache.vniz.net/
bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r
___
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: r253408 - head/sys/dev/bge

2013-07-16 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jul 17 04:53:53 2013
New Revision: 253408
URL: http://svnweb.freebsd.org/changeset/base/253408

Log:
  Implement workaround for BCM5719/BCM5720 TX hang.
  The read DMA request logic operation is based on having sufficient
  available space in the transmit data buffer (TXMBUF) before a read
  DMA can be requested.  There are four read DMA channels that use
  the TXMBUF, and the logic checks if the available free space in the
  TXMBUF is large enough for all the data in the four Send Buffers
  for which buffer descriptors have been fetched.  The Enable_Request
  signal is asserted only if the free TXMBUF space is larger than the
  sum of the four DMA length registers.  The power-up default value
  of BGE_RDMA_LSO_CRPTEN_CTRL register bit 25 (bit 21 on BCM5720) is
  zero, which selects the DMA length registers to connect to the
  input of the adder block.  The DMA length registers are
  asynchronously reset following BCM5719/BCM5720 power-up, and due to
  the lack of synchronous deassertion of the length registers reset
  signal these resisters may contain uninitialized values following
  the reset deassertion.
  In the case of the failure the uninitialized DMA length register
  values added up to more than the TXMBUF size, which prevented the
  assertion of the Enable_Request signal and any subsequent read DMA
  to start.  This lockup condition is the root cause of failing to
  generate any transmit traffic.
  
  To workaround the issue, select alternate output of multiplexers
  and transmit the first four Ethernet frames. This overwrites the
  DMA length registers with valid values.
  
  Reported by:  Geans Pin 
  Reviewed by:  Geans Pin 

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Wed Jul 17 02:37:40 2013(r253407)
+++ head/sys/dev/bge/if_bge.c   Wed Jul 17 04:53:53 2013(r253408)
@@ -2508,6 +2508,24 @@ bge_blockinit(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
DELAY(40);
 
+   if (sc->bge_flags & BGE_FLAG_RDMA_BUG) {
+   for (i = 0; i < BGE_NUM_RDMA_CHANNELS / 2; i++) {
+   val = CSR_READ_4(sc, BGE_RDMA_LENGTH + i * 4);
+   if ((val & 0x) > BGE_FRAMELEN)
+   break;
+   if (((val >> 16) & 0x) > BGE_FRAMELEN)
+   break;
+   }
+   if (i != BGE_NUM_RDMA_CHANNELS / 2) {
+   val = CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL);
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5719)
+   val |= BGE_RDMA_TX_LENGTH_WA_5719;
+   else
+   val |= BGE_RDMA_TX_LENGTH_WA_5720;
+   CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, val);
+   }
+   }
+
/* Turn on RX data completion state machine */
CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);
 
@@ -3319,10 +3337,18 @@ bge_attach(device_t dev)
sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS |
BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO |
BGE_FLAG_JUMBO_FRAME;
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5719 &&
-   sc->bge_chipid == BGE_CHIPID_BCM5719_A0) {
-   /* Jumbo frame on BCM5719 A0 does not work. */
-   sc->bge_flags &= ~BGE_FLAG_JUMBO;
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
+   sc->bge_asicrev == BGE_ASICREV_BCM5720) {
+   /*
+* Enable work around for DMA engine miscalculation
+* of TXMBUF available space.
+*/
+   sc->bge_flags |= BGE_FLAG_RDMA_BUG;
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5719 &&
+   sc->bge_chipid == BGE_CHIPID_BCM5719_A0) {
+   /* Jumbo frame on BCM5719 A0 does not work. */
+   sc->bge_flags &= ~BGE_FLAG_JUMBO;
+   }
}
break;
case BGE_ASICREV_BCM5755:
@@ -4740,6 +4766,7 @@ bge_stats_update_regs(struct bge_softc *
 {
struct ifnet *ifp;
struct bge_mac_stats *stats;
+   uint32_t val;
 
ifp = sc->bge_ifp;
stats = &sc->bge_mac_stats;
@@ -4840,6 +4867,24 @@ bge_stats_update_regs(struct bge_softc *
ifp->if_collisions = (u_long)stats->etherStatsCollisions;
ifp->if_ierrors = (u_long)(stats->NoMoreRxBDs + stats->InputDiscards +
stats->InputErrors);
+
+   if (sc->bge_flags & BGE_FLAG_RDMA_BUG) {
+   /*
+* If controller transmitted more than BGE_NUM_RDMA_CHANNELS
+   

Re: svn commit: r253380 - head/lib/libc/stdlib

2013-07-16 Thread Andrey Chernov
On 17.07.2013 8:48, Andrey Chernov wrote:
> On 17.07.2013 8:10, Andrey Chernov wrote:
>> On 16.07.2013 11:26, Andriy Gapon wrote:
>>> Modified: head/lib/libc/stdlib/getenv.c
>>> ==
>>> --- head/lib/libc/stdlib/getenv.c   Tue Jul 16 06:50:22 2013
>>> (r253379)
>>> +++ head/lib/libc/stdlib/getenv.c   Tue Jul 16 07:26:46 2013
>>> (r253380)
>>> @@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLe
>>> envVars[envNdx].valueSize = valueLen;
>>>  
>>> /* Save name of name/value pair. */
>>> -   env = stpcpy(envVars[envNdx].name, name);
>>> +   env = stpncpy(envVars[envNdx].name, name, nameLen);
>>> if ((envVars[envNdx].name)[nameLen] != '=')
>>> env = stpcpy(env, "=");
>>> }
>>>
>>
>> I am not sure what you are trying to fix, but you just made next line
>> condition unpredictable random, since (envVars[envNdx].name)[nameLen] is
>> never filled now and there is freshly malloced memory content, which is
>> picked for != '=' comparison.
>>
>> Please back it out or fix.
> 
> If I understand that right, correct version will be:
> 
> env = stpncpy(envVars[envNdx].name, name, nameLen);
> env = stpcpy(env, "=");
> 
> Condition check is not needed.

Microoptimized:

env = stpncpy(envVars[envNdx].name, name, nameLen);
*env++ = '=';

-- 
http://ache.vniz.net/
bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r
___
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: r253380 - head/lib/libc/stdlib

2013-07-16 Thread Andrey Chernov
On 17.07.2013 8:10, Andrey Chernov wrote:
> On 16.07.2013 11:26, Andriy Gapon wrote:
>> Modified: head/lib/libc/stdlib/getenv.c
>> ==
>> --- head/lib/libc/stdlib/getenv.cTue Jul 16 06:50:22 2013
>> (r253379)
>> +++ head/lib/libc/stdlib/getenv.cTue Jul 16 07:26:46 2013
>> (r253380)
>> @@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLe
>>  envVars[envNdx].valueSize = valueLen;
>>  
>>  /* Save name of name/value pair. */
>> -env = stpcpy(envVars[envNdx].name, name);
>> +env = stpncpy(envVars[envNdx].name, name, nameLen);
>>  if ((envVars[envNdx].name)[nameLen] != '=')
>>  env = stpcpy(env, "=");
>>  }
>>
> 
> I am not sure what you are trying to fix, but you just made next line
> condition unpredictable random, since (envVars[envNdx].name)[nameLen] is
> never filled now and there is freshly malloced memory content, which is
> picked for != '=' comparison.
> 
> Please back it out or fix.

If I understand that right, correct version will be:

env = stpncpy(envVars[envNdx].name, name, nameLen);
env = stpcpy(env, "=");

Condition check is not needed.

-- 
http://ache.vniz.net/
bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r
___
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: r253048 - in head/sys/ofed: drivers/net/mlx4 include/linux

2013-07-16 Thread Garrett Cooper
On Thu, Jul 11, 2013 at 5:26 AM, John Baldwin  wrote:
> On Wednesday, July 10, 2013 7:58:30 pm Garrett Cooper wrote:
>> On Tue, Jul 9, 2013 at 8:20 AM, John Baldwin  wrote:
>>
>> ...
>>
>> > I hadn't seen it.  I had wondered if the '\n' issue was a generic sysfs 
>> > thing.
>> > It sounds like it is and I'd be happy to revert the mlx4 change and alter 
>> > the
>> > sysfs bits to manage the newline directly if that is more appropriate.
>>
>> I'll doublecheck this, but basically I'm really adverse to diverging
>> from Linux in this area -- hence that's why I did what I did in the PR
>> I mentioned.
>
> I checked the other sysfs attributes under sys/ofed and all the ones that deal
> with strings expect the newline.  There might be some that are "blobs" that do
> not expect newlines, but it wasn't clear.  I do agree that it would be best to
> avoid diffs for this case if possible in all the sysfs handlers.
>
> (It would be even nicer if ofed used a more abstract notion for device 
> attributes
> in its drivers that could map to sysctl on FreeBSD and sysfs device 
> attributes on
> Linux, but that's a much larger change, and one OFED would have to want to 
> do.)
>
>> > I'd also like this to use sysctl_handle_string() if at all possible.  Are 
>> > you in
>> > a position to test patches still?
>>
>> Unfortunately I'm not right now :(. Anthony may or may not be able to
>> test this out (I used his machine when we were hacking around on IB
>> stuff).
>>
>> > If so, maybe give this a whirl.  It's similar to yours except it uses
>> > sysctl_handle_string() and strlcat() rather than continuing to do things
>> > by hand.  It also outputs an empty string to userland if the attribute
>> > doesn't have a show method (your version would never pass out an old
>> > string in that case unlike the original code).
>>
>> Can you please pass along a patch to Anthony and me so we can try and
>> apply it to test it out (Gmail's going to taint the inline patch, as
>> is the EMC Exchange server with the patch attachment)? If Anthony
>> still has the machine setup, then I'd be more than happy to test out
>> the patch :).
>
> Ok, I've put the patch at a URL.  Note that it is relative to what was just
> committed to HEAD, so to test on 9 you'd have to apply both patches.
>
> http://www.freebsd.org/~jhb/patches/ofed_sysfs.patch

Sorry, but it seems that neither Anthony nor I have time to work on
this... FWIW my patch might have been ok for text, but not for binary
blobs (I didn't test that out before because I didn't have an easy
testcase for it).
___
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"