svn commit: r302315 - vendor/Juniper/libxo/0.6.3

2016-07-01 Thread Garrett Cooper
Author: ngie
Date: Sat Jul  2 05:31:59 2016
New Revision: 302315
URL: https://svnweb.freebsd.org/changeset/base/302315

Log:
  Copy .../dist to .../0.6.3

Added:
 - copied from r302314, vendor/Juniper/libxo/dist/
Directory Properties:
  vendor/Juniper/libxo/0.6.3/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302314 - in vendor/Juniper/libxo/dist: . tests/core

2016-07-01 Thread Garrett Cooper
Author: ngie
Date: Sat Jul  2 05:30:27 2016
New Revision: 302314
URL: https://svnweb.freebsd.org/changeset/base/302314

Log:
  Update libxo to 0.6.3
  
  Obtained from: https://github.com/Juniper/libxo/tree/0.6.3
  Sponsored by: EMC / Isilon Storage Division

Modified:
  vendor/Juniper/libxo/dist/configure.ac
  vendor/Juniper/libxo/dist/tests/core/test_02.c

Modified: vendor/Juniper/libxo/dist/configure.ac
==
--- vendor/Juniper/libxo/dist/configure.ac  Fri Jul  1 23:18:49 2016
(r302313)
+++ vendor/Juniper/libxo/dist/configure.ac  Sat Jul  2 05:30:27 2016
(r302314)
@@ -12,7 +12,7 @@
 #
 
 AC_PREREQ(2.2)
-AC_INIT([libxo], [0.6.2], [p...@juniper.net])
+AC_INIT([libxo], [0.6.3], [p...@juniper.net])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
 
 # Support silent build rules.  Requires at least automake-1.11.

Modified: vendor/Juniper/libxo/dist/tests/core/test_02.c
==
--- vendor/Juniper/libxo/dist/tests/core/test_02.c  Fri Jul  1 23:18:49 
2016(r302313)
+++ vendor/Juniper/libxo/dist/tests/core/test_02.c  Sat Jul  2 05:30:27 
2016(r302314)
@@ -70,7 +70,7 @@ main (int argc, char **argv)
 
 xo_emit(" {:lines/%7ju} {:words/%7ju} "
 "{:characters/%7ju} {d:filename/%s}\n",
-20, 30, 40, "file");
+(uintmax_t) 20, (uintmax_t) 30, (uintmax_t) 40, "file");
 
 int i;
 for (i = 0; i < 5; i++)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302312 - in head/sys/boot: fdt powerpc/ofw

2016-07-01 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Jul  1 21:09:30 2016
New Revision: 302312
URL: https://svnweb.freebsd.org/changeset/base/302312

Log:
  Clean up some FDT-related code in the PowerPC bootloader, improving error
  checking and robustness. Prevents errors and crashes in FDT commands on
  PowerMac G5 systems.
  
  Approved by:  re (gjb)

Modified:
  head/sys/boot/fdt/fdt_loader_cmd.c
  head/sys/boot/powerpc/ofw/ofwfdt.c

Modified: head/sys/boot/fdt/fdt_loader_cmd.c
==
--- head/sys/boot/fdt/fdt_loader_cmd.c  Fri Jul  1 20:25:59 2016
(r302311)
+++ head/sys/boot/fdt/fdt_loader_cmd.c  Fri Jul  1 21:09:30 2016
(r302312)
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #define FDT_CWD_LEN256
-#define FDT_MAX_DEPTH  6
+#define FDT_MAX_DEPTH  12
 
 #define FDT_PROP_SEP   " = "
 
@@ -1029,7 +1029,7 @@ fdt_cmd_ls(int argc, char *argv[])
const char *prevname[FDT_MAX_DEPTH] = { NULL };
const char *name;
char *path;
-   int i, o, depth, len;
+   int i, o, depth;
 
path = (argc > 2) ? argv[2] : NULL;
if (path == NULL)
@@ -1045,7 +1045,7 @@ fdt_cmd_ls(int argc, char *argv[])
(o >= 0) && (depth >= 0);
o = fdt_next_node(fdtp, o, )) {
 
-   name = fdt_get_name(fdtp, o, );
+   name = fdt_get_name(fdtp, o, NULL);
 
if (depth > FDT_MAX_DEPTH) {
printf("max depth exceeded: %d\n", depth);

Modified: head/sys/boot/powerpc/ofw/ofwfdt.c
==
--- head/sys/boot/powerpc/ofw/ofwfdt.c  Fri Jul  1 20:25:59 2016
(r302311)
+++ head/sys/boot/powerpc/ofw/ofwfdt.c  Fri Jul  1 21:09:30 2016
(r302312)
@@ -33,24 +33,37 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "bootstrap.h"
 
+extern int command_fdt_internal(int argc, char *argv[]);
+
 static int
 OF_hasprop(phandle_t node, const char *prop)
 {
-   return (OF_getproplen(node, prop) > 0);
+   return (OF_getproplen(node, (char *)prop) > 0);
 }
 
 static void
 add_node_to_fdt(void *buffer, phandle_t node, int fdt_offset)
 {
-int i, child_offset, error;
-char name[2048], *lastprop, *subname;
+   int i, child_offset, error;
+   char name[255], *lastprop, *subname;
void *propbuf;
-   size_t proplen;
+   ssize_t proplen;
 
lastprop = NULL;
while (OF_nextprop(node, lastprop, name) > 0) {
proplen = OF_getproplen(node, name);
+
+   /* Detect and correct for errors and strangeness */
+   if (proplen < 0)
+   proplen = 0;
+   if (proplen > 1024)
+   proplen = 1024;
+
propbuf = malloc(proplen);
+   if (propbuf == NULL) {
+   printf("Cannot allocate memory for prop %s\n", name);
+   return;
+   }
OF_getprop(node, name, propbuf, proplen);
error = fdt_setprop(buffer, fdt_offset, name, propbuf, proplen);
free(propbuf);
@@ -64,7 +77,7 @@ add_node_to_fdt(void *buffer, phandle_t 
&& !OF_hasprop(node, "ibm,phandle"))
fdt_setprop(buffer, fdt_offset, "phandle", , sizeof(node));
 
-for (node = OF_child(node); node > 0; node = OF_peer(node)) {
+   for (node = OF_child(node); node > 0; node = OF_peer(node)) {
OF_package_to_path(node, name, sizeof(name));
subname = strrchr(name, '/');
subname++;
@@ -76,7 +89,7 @@ add_node_to_fdt(void *buffer, phandle_t 
}

 add_node_to_fdt(buffer, node, child_offset);
-}
+   }
 }
 
 static void
@@ -123,18 +136,16 @@ ofwfdt_fixups(void *fdtp)
fdt_add_mem_rsv(fdtp, base, len);
} else {
/*
-* Remove /memory/available properties, which reflect long-gone 
OF
-* state. Note that this doesn't work if we need RTAS still, 
since
-* that's part of the firmware.
+* Remove /memory/available properties, which reflect long-gone
+* OF state. Note that this doesn't work if we need RTAS still,
+* since that's part of the firmware.
 */
-
offset = fdt_path_offset(fdtp, "/memory@0");
if (offset > 0)
fdt_delprop(fdtp, offset, "available");
}
-   
-   /*
 
+   
/*
 * Convert stored ihandles under /chosen to xref phandles
 */
@@ -158,7 +169,8 @@ ofwfdt_fixups(void *fdtp)
OF_getprop(node, "ibm,phandle", ,
sizeof(node));
node = cpu_to_fdt32(node);
-   fdt_setprop(fdtp, offset, 

svn commit: r302311 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-01 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Fri Jul  1 20:25:59 2016
New Revision: 302311
URL: https://svnweb.freebsd.org/changeset/base/302311

Log:
  Document 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC
  
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jul  1 
20:19:02 2016(r302310)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jul  1 
20:25:59 2016(r302311)
@@ -1516,6 +1516,10 @@
Support for the Allwinner H3 SoC
has been added.
 
+  Support for GPIO, Sensors and
+   interrupts on AXP209 power management integrated circuits have been
+   added.
+
 
   
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302310 - head/release/doc/en_US.ISO8859-1/relnotes

2016-07-01 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Fri Jul  1 20:19:02 2016
New Revision: 302310
URL: https://svnweb.freebsd.org/changeset/base/302310

Log:
  Document r299688, Add support for H3 SoC
  
  Approved by:  re (gjb, implicit, relnotes)

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jul  1 
20:16:35 2016(r302309)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jul  1 
20:19:02 2016(r302310)
@@ -1513,6 +1513,9 @@
   The second CPU core on
Allwinner A20 SoC have been enabled.
 
+   Support for the Allwinner H3 SoC
+   has been added.
+
 
   
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302308 - head/sys/kern

2016-07-01 Thread Konstantin Belousov
Author: kib
Date: Fri Jul  1 20:11:28 2016
New Revision: 302308
URL: https://svnweb.freebsd.org/changeset/base/302308

Log:
  When a process knote was attached to the process which is already exiting,
  the knote is activated immediately.  If the exit1() later activates
  knotes, such knote is attempted to be activated second time.  Detect
  the condition by zeroed kn_ptr.p_proc pointer, and avoid excessive
  activation.
  
  Before r302235, such knotes were removed from the knlist immediately
  upon activation.
  
  Reported by:  truckman
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb)

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Fri Jul  1 19:58:13 2016(r302307)
+++ head/sys/kern/kern_event.c  Fri Jul  1 20:11:28 2016(r302308)
@@ -451,6 +451,9 @@ filt_proc(struct knote *kn, long hint)
u_int event;
 
p = kn->kn_ptr.p_proc;
+   if (p == NULL) /* already activated, from attach filter */
+   return (0);
+
/* Mask off extra data. */
event = (u_int)hint & NOTE_PCTRLMASK;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-01 Thread Bruce Evans

On Fri, 1 Jul 2016, Konstantin Belousov wrote:


On Thu, Jun 30, 2016 at 09:01:06PM +0300, Konstantin Belousov wrote:

Yes, timehands for bootimebin should be the solution, but
not in the scope of this patch.  I will work on this right after the
current changeset lands in svn.


Well, there is the move of boottimebin into timehands.  I also reduced
the number of timehands to two, this was discussed many times before.
The feed-forward code is probably broken right now, I did not even
compile it.


That was fast.

It seems simple and clean enough, but is too much during a re freeze.

I will only make some minor comments about style.


diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 56b2ade..a0dce47 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS)
struct pcpu *pcpu;
long cp_time[CPUSTATES];
long *cp;
+   struct timeval boottime;
int i;

read_cpu_time(cp_time);
+   getboottime();


This is used surprisingly often by too many subsystems.  With the value still
broken so that locking it doesn't help much, I would leave it as a global.


diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 0f015b3..1c2d562 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -70,31 +70,36 @@ struct timehands {
...
-static struct timehands th9 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, 
};
...
+static struct timehands th1 = {
+   .th_counter = NULL,
+   .th_adjustment = 0,
+   .th_scale = 0,
+   .th_offset_count = 0,
+   .th_offset = {0, 0},
+   .th_microtime = {0, 0},
+   .th_nanotime = {0, 0},
+   .th_boottime = {0, 0},
+   .th_generation = 0,
+   .th_next = 
+};


This shouldn't spell out all the 0 initializers.  That was only needed to
reach the non-0 initializer at the end of the initializer.


static struct timehands th0 = {
-   _timecounter,
-   0,
-   (uint64_t)-1 / 100,
-   0,
-   {1, 0},
-   {0, 0},
-   {0, 0},
-   1,
-   
+   .th_counter = _timecounter,
+   .th_adjustment = 0,
+   .th_scale = (uint64_t)-1 / 100,
+   .th_offset_count = 0,
+   .th_offset = {1, 0},
+   .th_microtime = {0, 0},
+   .th_nanotime = {0, 0},
+   .th_boottime = {0, 0},
+   .th_generation = 1,
+   .th_next = 
};



@@ -135,14 +138,22 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, alloweddeviation,
...
static int
sysctl_kern_boottime(SYSCTL_HANDLER_ARGS)
{
+   struct bintime boottimebin;
+   struct timeval boottime;
+
+   binuptime1(NULL, );
+   bintime2timeval(, );


Use the wrapper function getboottime() if you keep it.


@@ -342,8 +365,8 @@ fbclock_getmicrotime(struct timeval *tvp)
} while (gen == 0 || gen != th->th_generation);
}
#else /* !FFCLOCK */
-void
-binuptime(struct bintime *bt)
+static void
+binuptime1(struct bintime *bt, struct bintime *boottimebin)
{
struct timehands *th;
u_int gen;
@@ -351,13 +374,24 @@ binuptime(struct bintime *bt)
do {
th = timehands;
gen = atomic_load_acq_int(>th_generation);
-   *bt = th->th_offset;
-   bintime_addx(bt, th->th_scale * tc_delta(th));
+   if (bt != NULL) {
+   *bt = th->th_offset;
+   bintime_addx(bt, th->th_scale * tc_delta(th));
+   }
+   if (boottimebin != NULL)
+   *boottimebin = th->th_boottime;
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
}

void
+binuptime(struct bintime *bt)
+{
+
+   binuptime1(bt, NULL);
+}


Uptime functions don't use boottimebin, so it is ugly for the general
binuptime1() function to return it.

This is also pessimal.  Maybe the compiler can optimize away the
boottimebin == NULL case for the uptime functions, but none of the
functions is explicitly inlined.  I like functions not being inlined
when this is not explicit.  gcc only inlines ones that are static
and called once.  I don't like this, and turn it off using
-fno-inline-functions-called-once.  clang is too broken to support
this flag.

So maybe use a new general function that returns boottimebin for the
non-uptime functions only.  Possibly it can add the offset directly.


@@ -1116,8 +1170,10 @@ sysclock_snap2bintime(struct sysclock_snap *cs, struct 
bintime *bt,
if (cs->delta > 0)
bintime_addx(bt, cs->fb_info.th_scale * cs->delta);

-   if ((flags & FBCLOCK_UPTIME) == 0)
+   if ((flags & FBCLOCK_UPTIME) == 0) {
+   binuptime1(NULL, );


Perhaps use a more direct way to get boottimebin().  binuptime1() is
pessimized by null pointer checks for both its args.  Use the new
function getboottimebin() even if is not direct.


...
diff --git a/sys/net/bpf.c b/sys/net/bpf.c

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

2016-07-01 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jul  1 07:27:33 2016
New Revision: 302306
URL: https://svnweb.freebsd.org/changeset/base/302306

Log:
  Fix detection of USB device disconnects in USB host mode when the USB
  device is connected directly to the USB port of the DWC OTG, in this
  case a RPI-zero.
  
  PR:   210695
  Approved by:  re (gjb)
  MFC after:1 week

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

Modified: head/sys/dev/usb/controller/dwc_otg.c
==
--- head/sys/dev/usb/controller/dwc_otg.c   Fri Jul  1 05:48:45 2016
(r302305)
+++ head/sys/dev/usb/controller/dwc_otg.c   Fri Jul  1 07:27:33 2016
(r302306)
@@ -2985,7 +2985,8 @@ dwc_otg_interrupt(void *arg)
else
sc->sc_flags.status_bus_reset = 0;
 
-   if (hprt & HPRT_PRTENCHNG)
+   if ((hprt & HPRT_PRTENCHNG) &&
+   (hprt & HPRT_PRTENA) == 0)
sc->sc_flags.change_enabled = 1;
 
if (hprt & HPRT_PRTENA)
@@ -4745,6 +4746,8 @@ tr_handle_get_port_status:
 
value = 0;
 
+   if (sc->sc_flags.change_enabled)
+   value |= UPS_C_PORT_ENABLED;
if (sc->sc_flags.change_connect)
value |= UPS_C_CONNECT_STATUS;
if (sc->sc_flags.change_suspend)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302305 - in head/contrib/expat: . doc examples lib tests tests/benchmark xmlwf

2016-07-01 Thread Xin LI
Author: delphij
Date: Fri Jul  1 05:48:45 2016
New Revision: 302305
URL: https://svnweb.freebsd.org/changeset/base/302305

Log:
  MFV r302260: expat 2.2.0
  
  Approved by:  re (kib)

Added:
  head/contrib/expat/configure.ac
 - copied unchanged from r302260, vendor/expat/dist/configure.ac
  head/contrib/expat/doc/xmlwf.xml
 - copied unchanged from r302260, vendor/expat/dist/doc/xmlwf.xml
Deleted:
  head/contrib/expat/configure.in
  head/contrib/expat/doc/xmlwf.sgml
Modified:
  head/contrib/expat/COPYING
  head/contrib/expat/Changes
  head/contrib/expat/MANIFEST
  head/contrib/expat/Makefile.in
  head/contrib/expat/README
  head/contrib/expat/doc/expat.png   (contents, props changed)
  head/contrib/expat/doc/reference.html
  head/contrib/expat/doc/xmlwf.1
  head/contrib/expat/examples/elements.c
  head/contrib/expat/examples/outline.c
  head/contrib/expat/expat_config.h.in
  head/contrib/expat/lib/expat.h
  head/contrib/expat/lib/expat_external.h
  head/contrib/expat/lib/internal.h
  head/contrib/expat/lib/xmlparse.c
  head/contrib/expat/lib/xmlrole.c
  head/contrib/expat/lib/xmltok.c
  head/contrib/expat/lib/xmltok.h
  head/contrib/expat/lib/xmltok_impl.c
  head/contrib/expat/tests/benchmark/README.txt
  head/contrib/expat/tests/chardata.c
  head/contrib/expat/tests/minicheck.c
  head/contrib/expat/tests/minicheck.h
  head/contrib/expat/tests/runtests.c
  head/contrib/expat/tests/xmltest.sh
  head/contrib/expat/xmlwf/codepage.c
  head/contrib/expat/xmlwf/readfilemap.c
  head/contrib/expat/xmlwf/unixfilemap.c
  head/contrib/expat/xmlwf/xmlfile.c
  head/contrib/expat/xmlwf/xmlwf.c
Directory Properties:
  head/contrib/expat/   (props changed)

Modified: head/contrib/expat/COPYING
==
--- head/contrib/expat/COPYING  Fri Jul  1 03:21:51 2016(r302304)
+++ head/contrib/expat/COPYING  Fri Jul  1 05:48:45 2016(r302305)
@@ -1,6 +1,5 @@
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
-   and Clark Cooper
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
+Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
+Copyright (c) 2001-2016 Expat maintainers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

Modified: head/contrib/expat/Changes
==
--- head/contrib/expat/Changes  Fri Jul  1 03:21:51 2016(r302304)
+++ head/contrib/expat/Changes  Fri Jul  1 05:48:45 2016(r302305)
@@ -1,3 +1,67 @@
+Release 2.2.0 Tue June 21 2016
+Security fixes:
+#537  CVE-2016-0718 -- Fix crash on malformed input
+  CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
+   CVE-2015-2716 introduced with Expat 2.1.1
+#499  CVE-2016-5300 -- Use more entropy for hash initialization
+   than the original fix to CVE-2012-0876
+#519  CVE-2012-6702 -- Resolve troublesome internal call to srand
+   that was introduced with Expat 2.1.0
+   when addressing CVE-2012-0876 (issue #496)
+
+Bug fixes:
+  Fix uninitialized reads of size 1
+(e.g. in little2_updatePosition)
+  Fix detection of UTF-8 character boundaries
+
+Other changes:
+#532  Fix compilation for Visual Studio 2010 (keyword "C99")
+  Autotools: Resolve use of "$<" to better support bmake
+  Autotools: Add QA script "qa.sh" (and make target "qa")
+  Autotools: Respect CXXFLAGS if given
+  Autotools: Fix "make run-xmltest"
+  Autotools: Have "make run-xmltest" check for expected output
+ p90  CMake: Fix static build (BUILD_shared=OFF) on Windows
+#536  CMake: Add soversion, support -DNO_SONAME=yes to bypass
+#323  CMake: Add suffix "d" to differentiate debug from release
+  CMake: Define WIN32 with CMake on Windows
+  Annotate memory allocators for GCC
+  Address all currently known compile warnings
+  Make sure that API symbols remain visible despite
+-fvisibility=hidden
+  Remove executable flag from source files
+  Resolve COMPILED_FROM_DSP in favor of WIN32
+
+Special thanks to:
+Björn Lindahl
+Christian Heimes
+Cristian Rodríguez
+Daniel Krügler
+Gustavo Grieco
+Karl Waclawek
+László Böszörményi
+Marco Grassi
+Pascal Cuoq
+Sergei Nikulov
+Thomas Beutlich
+Warren Young
+