svn commit: r306752 - head/sbin/savecore

2016-10-05 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct  6 05:16:44 2016
New Revision: 306752
URL: https://svnweb.freebsd.org/changeset/base/306752

Log:
  savecore(8): Fix buffer overrun inspecting disks with varying sector size
  
  A premature optimization lead to caching a native-sector sized memory
  allocation.  If the program examined a 512 byte sector disk, then a 4096
  byte sector disk, the program would overrun the cached 512 byte buffer.
  
  Just remove the optimization to fix the bug.  This was introduced with the 4Kn
  dump support in r298076.
  
  Reported by:  markj
  Reviewed by:  markj, rpokala
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8162

Modified:
  head/sbin/savecore/savecore.c

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Thu Oct  6 03:32:30 2016
(r306751)
+++ head/sbin/savecore/savecore.c   Thu Oct  6 05:16:44 2016
(r306752)
@@ -436,7 +436,8 @@ DoFile(const char *savedir, const char *
 {
xo_handle_t *xostdout, *xoinfo;
static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX];
-   static char *buf = NULL, *temp = NULL;
+   static char *buf = NULL;
+   char *temp = NULL;
struct kerneldumpheader kdhf, kdhl;
off_t mediasize, dumpsize, firsthd, lasthd;
FILE *info, *fp;
@@ -498,12 +499,10 @@ DoFile(const char *savedir, const char *
}
 
lasthd = mediasize - sectorsize;
+   temp = malloc(sectorsize);
if (temp == NULL) {
-   temp = malloc(sectorsize);
-   if (temp == NULL) {
-   syslog(LOG_ERR, "%m");
-   goto closefd;
-   }
+   syslog(LOG_ERR, "%m");
+   goto closefd;
}
if (lseek(fd, lasthd, SEEK_SET) != lasthd ||
read(fd, temp, sectorsize) != (ssize_t)sectorsize) {
@@ -749,6 +748,7 @@ nuke:
}
xo_close_container_h(xostdout, "crashdump");
xo_finish_h(xostdout);
+   free(temp);
close(fd);
return;
 
@@ -756,6 +756,7 @@ closeall:
fclose(fp);
 
 closefd:
+   free(temp);
close(fd);
 }
 
___
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: r306751 - in head/sys/boot: efi/boot1 efi/loader i386/gptzfsboot i386/zfsboot userboot/zfs zfs

2016-10-05 Thread Allan Jude
Author: allanjude
Date: Thu Oct  6 03:32:30 2016
New Revision: 306751
URL: https://svnweb.freebsd.org/changeset/base/306751

Log:
  Disable loop unrolling in skein for sys/boot
  
  When tsoome@ added skein support to the ZFS boot code and zfsloader, it
  resulted in an explosion in code size, running close to a number of
  limits.
  
  The default for the C version of skein is to unroll all loops for
  skein-256 and 512
  
  Disabling the loop unrolling saves 20-28kb from each binary
  boot1.efi
  gptzfsboot
  loader.efi
  userboot.so
  zfsloader
  
  Reviewed by:  emaste, tsoome
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D7826

Modified:
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/loader/Makefile
  head/sys/boot/i386/gptzfsboot/Makefile
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/userboot/zfs/Makefile
  head/sys/boot/zfs/Makefile

Modified: head/sys/boot/efi/boot1/Makefile
==
--- head/sys/boot/efi/boot1/MakefileThu Oct  6 03:20:47 2016
(r306750)
+++ head/sys/boot/efi/boot1/MakefileThu Oct  6 03:32:30 2016
(r306751)
@@ -28,6 +28,8 @@ SRCS= boot1.c self_reloc.c start.S ufs_m
 .if ${MK_ZFS} != "no"
 SRCS+= zfs_module.c
 SRCS+= skein.c skein_block.c
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
 .PATH: ${.CURDIR}/../../../crypto/skein
 .endif
 

Modified: head/sys/boot/efi/loader/Makefile
==
--- head/sys/boot/efi/loader/Makefile   Thu Oct  6 03:20:47 2016
(r306750)
+++ head/sys/boot/efi/loader/Makefile   Thu Oct  6 03:32:30 2016
(r306751)
@@ -25,6 +25,8 @@ SRCS= autoload.c \
 SRCS+= zfs.c
 .PATH: ${.CURDIR}/../../zfs
 SRCS+= skein.c skein_block.c
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
 .PATH: ${.CURDIR}/../../../crypto/skein
 
 # Disable warnings that are currently incompatible with the zfs boot code

Modified: head/sys/boot/i386/gptzfsboot/Makefile
==
--- head/sys/boot/i386/gptzfsboot/Makefile  Thu Oct  6 03:20:47 2016
(r306750)
+++ head/sys/boot/i386/gptzfsboot/Makefile  Thu Oct  6 03:32:30 2016
(r306751)
@@ -36,6 +36,9 @@ CFLAGS=   -DBOOTPROG=\"gptzfsboot\" \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
-Winline -Wno-tentative-definition-incomplete-type -Wno-pointer-sign
 
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
+
 .if !defined(LOADER_NO_GELI_SUPPORT)
 CFLAGS+=   -DLOADER_GELI_SUPPORT
 CFLAGS+=   -I${.CURDIR}/../../geli

Modified: head/sys/boot/i386/zfsboot/Makefile
==
--- head/sys/boot/i386/zfsboot/Makefile Thu Oct  6 03:20:47 2016
(r306750)
+++ head/sys/boot/i386/zfsboot/Makefile Thu Oct  6 03:32:30 2016
(r306751)
@@ -35,6 +35,8 @@ CFLAGS=   -DBOOTPROG=\"zfsboot\" \
-Winline
 
 CFLAGS.gcc+=   --param max-inline-insns-single=100
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
 
 LD_FLAGS=${LD_FLAGS_BIN}
 

Modified: head/sys/boot/userboot/zfs/Makefile
==
--- head/sys/boot/userboot/zfs/Makefile Thu Oct  6 03:20:47 2016
(r306750)
+++ head/sys/boot/userboot/zfs/Makefile Thu Oct  6 03:32:30 2016
(r306751)
@@ -8,6 +8,9 @@ INTERNALLIB=
 
 SRCS+= zfs.c skein.c skein_block.c
 
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
+
 CFLAGS+=   -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
 CFLAGS+=   -I${.CURDIR}/../../../../lib/libstand
 CFLAGS+=   -I${.CURDIR}/../../../cddl/boot/zfs

Modified: head/sys/boot/zfs/Makefile
==
--- head/sys/boot/zfs/Makefile  Thu Oct  6 03:20:47 2016(r306750)
+++ head/sys/boot/zfs/Makefile  Thu Oct  6 03:32:30 2016(r306751)
@@ -6,6 +6,8 @@ INTERNALLIB=
 SRCS+= zfs.c
 
 SRCS+= skein.c skein_block.c
+# Do not unroll skein loops, reduce code size
+CFLAGS+=   -DSKEIN_LOOP=111
 .PATH: ${.CURDIR}/../../crypto/skein
 
 CFLAGS+=   -DBOOTPROG=\"zfsloader\"
___
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: r306346 - head/sys/kern

2016-10-05 Thread Bruce Evans

On Wed, 5 Oct 2016, Slawa Olhovchenkov wrote:


On Wed, Oct 05, 2016 at 11:19:10AM +1100, Bruce Evans wrote:


On Tue, 4 Oct 2016, Gleb Smirnoff wrote:


On Mon, Sep 26, 2016 at 03:30:30PM +, Eric van Gyzen wrote:
E> ...
E> Modified: head/sys/kern/kern_mutex.c
E> 
==
E> --- head/sys/kern/kern_mutex.cMon Sep 26 15:03:31 2016(r306345)
E> +++ head/sys/kern/kern_mutex.cMon Sep 26 15:30:30 2016(r306346)
E> @@ -924,7 +924,7 @@ __mtx_assert(const volatile uintptr_t *c
E>  {
E>   const struct mtx *m;
E>
E> - if (panicstr != NULL || dumping)
E> + if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
E>   return;

I wonder if all this disjunct can be reduced just to SCHEDULER_STOPPED()?
Positive panicstr and dumping imply scheduler stopped.


'dumping' doesn't imply SCHEDULER_STOPPED().

Checking 'dumping' here seems to be just an old bug.  It just breaks
__mtx_assert(), while all other mutex operations work normally for dumping
without panicing.


[...]

Is this related to halted (not reboted) 11.0 after ~^B and `panic`?


There might be related problems, but I don't see any here.


What I see on serial console:
=
db> panic
panic: from debugger


I wouldn't trust panic from the debugger, but it is safer than dump
from the debugger (both are ddb commands, but this is another bug).


cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at 0x8031fadb = 
db_trace_self_wrapper+0x2b/frame 0xfe1f9e198120
vpanic() at 0x804a0302 = vpanic+0x182/frame 0xfe1f9e1981a0
panic() at 0x804a0383 = panic+0x43/frame 0xfe1f9e198200
db_panic() at 0x8031d987 = db_panic+0x17/frame 0xfe1f9e198210
db_command() at 0x8031d019 = db_command+0x299/frame 0xfe1f9e1982e0
db_command_loop() at 0x8031cd74 = db_command_loop+0x64/frame 
0xfe1f9e1982f0
db_trap() at 0x8031fc1b = db_trap+0xdb/frame 0xfe1f9e198380
kdb_trap() at 0x804dd8c3 = kdb_trap+0x193/frame 0xfe1f9e198410
trap() at 0x806e3065 = trap+0x255/frame 0xfe1f9e198620
calltrap() at 0x806cafd1 = calltrap+0x8/frame 0xfe1f9e198620
--- trap 0x3, rip = 0x804dd11e, rsp = 0xfe1f9e1986f0, rbp = 
0xfe1f9e198710 ---
kdb_alt_break_internal() at 0x804dd11e = 
kdb_alt_break_internal+0x18e/frame 0xfe1f9e198710
kdb_alt_break() at 0x804dcf8b = kdb_alt_break+0xb/frame 
0xfe1f9e198720
uart_intr_rxready() at 0x803e38a8 = uart_intr_rxready+0x98/frame 
0xfe1f9e198750
uart_intr() at 0x803e4621 = uart_intr+0x121/frame 0xfe1f9e198790
intr_event_handle() at 0x8046c74b = intr_event_handle+0x9b/frame 
0xfe1f9e1987e0
intr_execute_handlers() at 0x8076d2d8 = 
intr_execute_handlers+0x48/frame 0xfe1f9e198810
lapic_handle_intr() at 0x8077163f = lapic_handle_intr+0x3f/frame 
0xfe1f9e198830
Xapic_isr1() at 0x806cb6b7 = Xapic_isr1+0xb7/frame 0xfe1f9e198830
--- interrupt, rip = 0x8032fedf, rsp = 0xfe1f9e198900, rbp = 
0xfe1f9e198940 ---
acpi_cpu_idle() at 0x8032fedf = acpi_cpu_idle+0x2af/frame 
0xfe1f9e198940
cpu_idle_acpi() at 0x8076ad1f = cpu_idle_acpi+0x3f/frame 
0xfe1f9e198960
cpu_idle() at 0x8076adc5 = cpu_idle+0x95/frame 0xfe1f9e198980
sched_idletd() at 0x804cbbe5 = sched_idletd+0x495/frame 
0xfe1f9e198a70
fork_exit() at 0x8046a211 = fork_exit+0x71/frame 0xfe1f9e198ab0
fork_trampoline() at 0x806cb50e = fork_trampoline+0xe/frame 
0xfe1f9e198ab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---


This looks like a normal kdb entry then a not so normal panic from ddb,
but no problems.


Uptime: 1d4h53m19s
Dumping 12148 out of 131020 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%
Dump complete
mps2: Sending StopUnit: path (xpt0:mps2:0:14:):  handle 12
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
=

This is normal reboot (by /sbin/reboot):


Is the above just a hung dump from reboot, before going near ddb?  That
case should work, but perhaps it needs to be more careful about waiting
for the other CPUs.  Just stopping them is no good since it gives an
even more fragile environment, like panicing or entering ddb.



===
Sending StopUnit: path (xpt0:mps2:0:14:):  handle 13
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:18:):
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:14:):
===


mps2: lagg0: link state changed to DOWN
Sending StopUnit: path (xpt0:mps2:0:14:):  handle 12
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
mps2: 

svn commit: r306750 - stable/10/sys/cam

2016-10-05 Thread Alexander Motin
Author: mav
Date: Thu Oct  6 03:20:47 2016
New Revision: 306750
URL: https://svnweb.freebsd.org/changeset/base/306750

Log:
  Fix ABI compat shims for FreeBSD 9.0-9.1 binaries (CAM_VERSION 0x16).
  
  This is a direct commit to stable/10, inspired by some commits to later
  branches.

Modified:
  stable/10/sys/cam/cam_compat.c
  stable/10/sys/cam/cam_compat.h

Modified: stable/10/sys/cam/cam_compat.c
==
--- stable/10/sys/cam/cam_compat.c  Thu Oct  6 03:14:08 2016
(r306749)
+++ stable/10/sys/cam/cam_compat.c  Thu Oct  6 03:20:47 2016
(r306750)
@@ -63,28 +63,28 @@ cam_compat_ioctl(struct cdev *dev, u_lon
switch (cmd) {
case CAMIOCOMMAND_0x16:
{
-   union ccb *ccb;
+   struct ccb_hdr_0x17 *hdr17;
 
-   ccb = (union ccb *)addr;
-   if (ccb->ccb_h.flags & CAM_SG_LIST_PHYS_0x16) {
-   ccb->ccb_h.flags &= ~CAM_SG_LIST_PHYS_0x16;
-   ccb->ccb_h.flags |= CAM_DATA_SG_PADDR;
+   hdr17 = (struct ccb_hdr_0x17 *)addr;
+   if (hdr17->flags & CAM_SG_LIST_PHYS_0x16) {
+   hdr17->flags &= ~CAM_SG_LIST_PHYS_0x16;
+   hdr17->flags |= CAM_DATA_SG_PADDR;
}
-   if (ccb->ccb_h.flags & CAM_DATA_PHYS_0x16) {
-   ccb->ccb_h.flags &= ~CAM_DATA_PHYS_0x16;
-   ccb->ccb_h.flags |= CAM_DATA_PADDR;
+   if (hdr17->flags & CAM_DATA_PHYS_0x16) {
+   hdr17->flags &= ~CAM_DATA_PHYS_0x16;
+   hdr17->flags |= CAM_DATA_PADDR;
}
-   if (ccb->ccb_h.flags & CAM_SCATTER_VALID_0x16) {
-   ccb->ccb_h.flags &= CAM_SCATTER_VALID_0x16;
-   ccb->ccb_h.flags |= CAM_DATA_SG;
+   if (hdr17->flags & CAM_SCATTER_VALID_0x16) {
+   hdr17->flags &= CAM_SCATTER_VALID_0x16;
+   hdr17->flags |= CAM_DATA_SG;
}
cmd = CAMIOCOMMAND;
-   error = (cbfnp)(dev, cmd, addr, flag, td);
+   error = cam_compat_handle_0x17(dev, cmd, addr, flag, td, cbfnp);
break;
}
case CAMGETPASSTHRU_0x16:
cmd = CAMGETPASSTHRU;
-   error = (cbfnp)(dev, cmd, addr, flag, td);
+   error = cam_compat_handle_0x17(dev, cmd, addr, flag, td, cbfnp);
break;
case CAMIOCOMMAND_0x17:
cmd = CAMIOCOMMAND;

Modified: stable/10/sys/cam/cam_compat.h
==
--- stable/10/sys/cam/cam_compat.h  Thu Oct  6 03:14:08 2016
(r306749)
+++ stable/10/sys/cam/cam_compat.h  Thu Oct  6 03:20:47 2016
(r306750)
@@ -43,8 +43,8 @@ int cam_compat_ioctl(struct cdev *dev, u
 #define CAM_VERSION_0x16   0x16
 
 /* The size of the union ccb didn't change when going to 0x17 */
-#define CAMIOCOMMAND_0x16  _IOWR(CAM_VERSION_0x16, 2, union ccb)
-#define CAMGETPASSTHRU_0x16_IOWR(CAM_VERSION_0x16, 3, union ccb)
+#defineCAMIOCOMMAND_0x16   _IOC(IOC_INOUT, CAM_VERSION_0x16, 2, 
CAM_0X17_LEN)
+#defineCAMGETPASSTHRU_0x16 _IOC(IOC_INOUT, CAM_VERSION_0x16, 3, 
CAM_0X17_LEN)
 
 #define CAM_SCATTER_VALID_0x16 0x0010
 #define CAM_SG_LIST_PHYS_0x16  0x0004
@@ -110,8 +110,8 @@ struct ccb_pathinq_0x17 {
u_int16_t   hba_subdevice;  /* HBA subdevice ID */
 };
 
-#define CAM_0X17_LEN   (sizeof(union ccb) - sizeof(struct ccb_hdr) + 
sizeof(struct ccb_hdr_0x17))
-#define CAM_0X17_DATA_LEN (sizeof(union ccb) - sizeof(struct ccb_hdr_0x17))
+#defineCAM_0X17_DATA_LEN   (sizeof(union ccb) - sizeof(struct 
ccb_hdr))
+#defineCAM_0X17_LEN(sizeof(struct ccb_hdr_0x17) + 
CAM_0X17_DATA_LEN)
 
 #defineCAMIOCOMMAND_0x17   _IOC(IOC_INOUT, CAM_VERSION_0x17, 2, 
CAM_0X17_LEN)
 #define CAMGETPASSTHRU_0x17_IOC(IOC_INOUT, CAM_VERSION_0x17, 3, 
CAM_0X17_LEN)
___
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: r306748 - head/share/man/man9

2016-10-05 Thread Conrad E. Meyer
Author: cem
Date: Thu Oct  6 01:52:00 2016
New Revision: 306748
URL: https://svnweb.freebsd.org/changeset/base/306748

Log:
  style(9): Some additional clarification
  
  Prompted by an email from bde@.
  
  Reviewed by:  emaste, imp (earlier version)
  With input from:  wblock
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7983

Modified:
  head/share/man/man9/style.9

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Thu Oct  6 01:14:10 2016(r306747)
+++ head/share/man/man9/style.9 Thu Oct  6 01:52:00 2016(r306748)
@@ -26,7 +26,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd December 5, 2015
+.Dd October 5, 2016
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -114,20 +114,28 @@ static char sccsid[] = "@(#)style 1.14 (
 __FBSDID("$FreeBSD$");
 .Ed
 .Pp
-Leave another blank line before the header files.
+Leave one blank line before the header files.
 .Pp
-Kernel include files (i.e.\&
-.Pa sys/*.h )
-come first sorted alphabetically where possible.
-Include
-.In sys/types.h
-OR
-.In sys/param.h ,
-but not both and include it first.
+Kernel include files
+.Pa ( sys/*.h )
+come first.
+If
+.In sys/cdefs.h
+is needed for
+.Fn __FBSDID ,
+include it first.
+If either
 .In sys/types.h
+or
+.In sys/param.h
+is needed, include it before other include files.
+.Po
+.In sys/param.h
 includes
-.In sys/cdefs.h ,
-and it is okay to depend on that.
+.In sys/types.h ;
+do not include both.
+.Pc
+The remaining kernel headers should be sorted alphabetically.
 .Bd -literal
 #include  /* Non-local includes in angle brackets. */
 #include 
@@ -144,9 +152,9 @@ For a network program, put the network i
 #include 
 .Ed
 .Pp
-Do not use files in
+Do not include files from
 .Pa /usr/include
-for files in the kernel.
+in the kernel.
 .Pp
 Leave a blank line before the next group, the
 .Pa /usr/include
@@ -166,7 +174,7 @@ in the local directory.
 #include 
 .Ed
 .Pp
-Leave another blank line before the user include files.
+Leave another blank line before the local include files.
 .Bd -literal
 #include "pathnames.h" /* Local includes in double quotes. */
 .Ed
___
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: r306747 - head/sys/cam

2016-10-05 Thread Alexander Motin
Author: mav
Date: Thu Oct  6 01:14:10 2016
New Revision: 306747
URL: https://svnweb.freebsd.org/changeset/base/306747

Log:
  Fix ABI compat shims, broken by adding NVMe support.
  
  MFC after:1 week

Modified:
  head/sys/cam/cam_compat.c
  head/sys/cam/cam_compat.h

Modified: head/sys/cam/cam_compat.c
==
--- head/sys/cam/cam_compat.c   Thu Oct  6 01:01:00 2016(r306746)
+++ head/sys/cam/cam_compat.c   Thu Oct  6 01:14:10 2016(r306747)
@@ -149,7 +149,24 @@ cam_compat_handle_0x17(struct cdev *dev,
 
ccbb = (uint8_t *)[1];
ccbb17 = (uint8_t *)[1];
-   bcopy(ccbb17, ccbb, CAM_0X17_DATA_LEN);
+   if (ccb->ccb_h.func_code == XPT_SET_TRAN_SETTINGS) {
+   struct ccb_trans_settings *cts;
+   struct ccb_trans_settings_0x17 *cts17;
+
+   cts = >cts;
+   cts17 = (struct ccb_trans_settings_0x17 *)hdr17;
+   cts->type = cts17->type;
+   cts->protocol = cts17->protocol;
+   cts->protocol_version = cts17->protocol_version;
+   cts->transport = cts17->transport;
+   cts->transport_version = cts17->transport_version;
+   bcopy(>proto_specific, >proto_specific,
+   sizeof(cts17->proto_specific));
+   bcopy(>xport_specific, >xport_specific,
+   sizeof(cts17->xport_specific));
+   } else {
+   bcopy(ccbb17, ccbb, CAM_0X17_DATA_LEN);
+   }
 
error = (cbfnp)(dev, cmd, (caddr_t)ccb, flag, td);
 
@@ -205,6 +222,21 @@ cam_compat_handle_0x17(struct cdev *dev,
cpi17->hba_device = cpi->hba_device;
cpi17->hba_subvendor = cpi->hba_subvendor;
cpi17->hba_subdevice = cpi->hba_subdevice;
+   } else if (ccb->ccb_h.func_code == XPT_GET_TRAN_SETTINGS) {
+   struct ccb_trans_settings *cts;
+   struct ccb_trans_settings_0x17 *cts17;
+
+   cts = >cts;
+   cts17 = (struct ccb_trans_settings_0x17 *)hdr17;
+   cts17->type = cts17->type;
+   cts17->protocol = cts->protocol;
+   cts17->protocol_version = cts->protocol_version;
+   cts17->transport = cts->transport;
+   cts17->transport_version = cts->transport_version;
+   bcopy(>proto_specific, >proto_specific,
+   sizeof(cts17->proto_specific));
+   bcopy(>xport_specific, >xport_specific,
+   sizeof(cts17->xport_specific));
} else if (ccb->ccb_h.func_code == XPT_DEV_MATCH) {
/* Copy the rest of the header over */
bcopy(ccbb, ccbb17, CAM_0X17_DATA_LEN);
@@ -257,7 +289,24 @@ cam_compat_handle_0x18(struct cdev *dev,
 
ccbb = (uint8_t *)[1];
ccbb18 = (uint8_t *)[1];
-   bcopy(ccbb18, ccbb, CAM_0X18_DATA_LEN);
+   if (ccb->ccb_h.func_code == XPT_SET_TRAN_SETTINGS) {
+   struct ccb_trans_settings *cts;
+   struct ccb_trans_settings_0x18 *cts18;
+
+   cts = >cts;
+   cts18 = (struct ccb_trans_settings_0x18 *)hdr18;
+   cts->type = cts18->type;
+   cts->protocol = cts18->protocol;
+   cts->protocol_version = cts18->protocol_version;
+   cts->transport = cts18->transport;
+   cts->transport_version = cts18->transport_version;
+   bcopy(>proto_specific, >proto_specific,
+   sizeof(cts18->proto_specific));
+   bcopy(>xport_specific, >xport_specific,
+   sizeof(cts18->xport_specific));
+   } else {
+   bcopy(ccbb18, ccbb, CAM_0X18_DATA_LEN);
+   }
 
error = (cbfnp)(dev, cmd, (caddr_t)ccb, flag, td);
 
@@ -280,10 +329,27 @@ cam_compat_handle_0x18(struct cdev *dev,
hdr18->sim_priv = hdr->sim_priv;
hdr18->timeout = hdr->timeout;
 
-   bcopy(ccbb, ccbb18, CAM_0X18_DATA_LEN);
-
-   if (ccb->ccb_h.func_code == XPT_DEV_MATCH)
+   if (ccb->ccb_h.func_code == XPT_GET_TRAN_SETTINGS) {
+   struct ccb_trans_settings *cts;
+   struct ccb_trans_settings_0x18 *cts18;
+
+   cts = >cts;
+   cts18 = (struct ccb_trans_settings_0x18 *)hdr18;
+   cts18->type = cts18->type;
+   cts18->protocol = cts->protocol;
+   cts18->protocol_version = cts->protocol_version;
+   cts18->transport = cts->transport;
+   cts18->transport_version = cts->transport_version;
+   bcopy(>proto_specific, >proto_specific,
+   sizeof(cts18->proto_specific));
+   bcopy(>xport_specific, >xport_specific,
+   sizeof(cts18->xport_specific));
+   } else if (ccb->ccb_h.func_code == XPT_DEV_MATCH) {
+   bcopy(ccbb, ccbb18, CAM_0X18_DATA_LEN);

svn commit: r306746 - head/sys/dev/atkbdc

2016-10-05 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Oct  6 01:01:00 2016
New Revision: 306746
URL: https://svnweb.freebsd.org/changeset/base/306746

Log:
  Fix extended buttons support on synaptic clickpad
  
  Fix regression introduced by r306355 on synaptic clickpads with
  extended buttons (buttons stopped working)
  
  PR:   205690
  Submitted by: Vladimir Kondratyev 

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Thu Oct  6 00:51:27 2016(r306745)
+++ head/sys/dev/atkbdc/psm.c   Thu Oct  6 01:01:00 2016(r306746)
@@ -2750,7 +2750,9 @@ proc_synaptics(struct psm_softc *sc, pac
static int touchpad_buttons;
static int guest_buttons;
static finger_t f[PSM_FINGERS];
-   int w, id, nfingers, ewcode;
+   int w, id, nfingers, ewcode, extended_buttons;
+
+   extended_buttons = 0;
 
/* TouchPad PS/2 absolute mode message format with capFourButtons:
 *
@@ -2863,7 +2865,8 @@ proc_synaptics(struct psm_softc *sc, pac
if (pb->ipacket[1] & 0x02)
guest_buttons |= MOUSE_BUTTON3DOWN;
 
-   ms->button = touchpad_buttons | guest_buttons;
+   ms->button = touchpad_buttons | guest_buttons |
+   sc->extended_buttons;
}
goto SYNAPTICS_END;
 
@@ -2933,30 +2936,26 @@ proc_synaptics(struct psm_softc *sc, pac
/* Middle Button */
if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)
touchpad_buttons |= MOUSE_BUTTON2DOWN;
-   } else if (sc->synhw.capExtended && sc->synhw.capClickPad) {
-   /* ClickPad Button */
-   if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)
-   touchpad_buttons = MOUSE_BUTTON1DOWN;
} else if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) {
/* Extended Buttons */
if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x02) {
if (sc->syninfo.directional_scrolls) {
if (pb->ipacket[4] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON4DOWN;
+   extended_buttons |= MOUSE_BUTTON4DOWN;
if (pb->ipacket[5] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON5DOWN;
+   extended_buttons |= MOUSE_BUTTON5DOWN;
if (pb->ipacket[4] & 0x02)
-   touchpad_buttons |= MOUSE_BUTTON6DOWN;
+   extended_buttons |= MOUSE_BUTTON6DOWN;
if (pb->ipacket[5] & 0x02)
-   touchpad_buttons |= MOUSE_BUTTON7DOWN;
+   extended_buttons |= MOUSE_BUTTON7DOWN;
} else {
if (pb->ipacket[4] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON1DOWN;
+   extended_buttons |= MOUSE_BUTTON1DOWN;
if (pb->ipacket[5] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON3DOWN;
+   extended_buttons |= MOUSE_BUTTON3DOWN;
if (pb->ipacket[4] & 0x02)
-   touchpad_buttons |= MOUSE_BUTTON2DOWN;
-   sc->extended_buttons = touchpad_buttons;
+   extended_buttons |= MOUSE_BUTTON2DOWN;
+   sc->extended_buttons = extended_buttons;
}
 
/*
@@ -2984,9 +2983,13 @@ proc_synaptics(struct psm_softc *sc, pac
 * Keep reporting MOUSE DOWN until we get a new packet
 * indicating otherwise.
 */
-   touchpad_buttons |= sc->extended_buttons;
+   extended_buttons |= sc->extended_buttons;
}
}
+   /* Handle ClickPad */
+   if (sc->synhw.capClickPad &&
+   ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01))
+   touchpad_buttons |= MOUSE_BUTTON1DOWN;
 
if (sc->synhw.capReportsV && nfingers > 1)
f[0] = (finger_t) {
@@ -3023,7 +3026,7 @@ proc_synaptics(struct psm_softc *sc, pac
if (id >= nfingers)
PSM_FINGER_RESET(f[id]);
 
-   ms->button = touchpad_buttons | guest_buttons;
+   ms->button = touchpad_buttons;
 
/* Palm detection doesn't terminate the current action. */
if (!psmpalmdetect(sc, [0], nfingers)) {
@@ -3034,6 +3037,8 @@ 

svn commit: r306745 - in head/sys: net net/altq netinet

2016-10-05 Thread Kevin Lo
Author: kevlo
Date: Thu Oct  6 00:51:27 2016
New Revision: 306745
URL: https://svnweb.freebsd.org/changeset/base/306745

Log:
  Remove an alias if_list, use if_link consistently.
  
  Reviewed by:  tuexen
  Differential Revision:https://reviews.freebsd.org/D8075

Modified:
  head/sys/net/altq/altq_subr.c
  head/sys/net/if_var.h
  head/sys/netinet/sctp_bsd_addr.c

Modified: head/sys/net/altq/altq_subr.c
==
--- head/sys/net/altq/altq_subr.c   Thu Oct  6 00:13:55 2016
(r306744)
+++ head/sys/net/altq/altq_subr.c   Thu Oct  6 00:51:27 2016
(r306745)
@@ -435,7 +435,7 @@ tbr_timeout(arg)
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
for (ifp = TAILQ_FIRST(_ifnet); ifp;
-   ifp = TAILQ_NEXT(ifp, if_list)) {
+   ifp = TAILQ_NEXT(ifp, if_link)) {
/* read from if_snd unlocked */
if (!TBR_IS_ENABLED(>if_snd))
continue;

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Thu Oct  6 00:13:55 2016(r306744)
+++ head/sys/net/if_var.h   Thu Oct  6 00:51:27 2016(r306745)
@@ -313,7 +313,6 @@ struct ifnet {
 };
 
 /* for compatibility with other BSDs */
-#defineif_list if_link
 #defineif_name(ifp)((ifp)->if_xname)
 
 /*

Modified: head/sys/netinet/sctp_bsd_addr.c
==
--- head/sys/netinet/sctp_bsd_addr.cThu Oct  6 00:13:55 2016
(r306744)
+++ head/sys/netinet/sctp_bsd_addr.cThu Oct  6 00:51:27 2016
(r306745)
@@ -208,7 +208,7 @@ sctp_init_ifns_for_vrf(int vrfid)
 #endif
 
IFNET_RLOCK();
-   TAILQ_FOREACH(ifn, _GLOBAL(ifnet), if_list) {
+   TAILQ_FOREACH(ifn, _GLOBAL(ifnet), if_link) {
if (sctp_is_desired_interface_type(ifn) == 0) {
/* non desired type */
continue;
@@ -361,7 +361,7 @@ void
struct ifaddr *ifa;
 
IFNET_RLOCK();
-   TAILQ_FOREACH(ifn, _GLOBAL(ifnet), if_list) {
+   TAILQ_FOREACH(ifn, _GLOBAL(ifnet), if_link) {
if (!(*pred) (ifn)) {
continue;
}
___
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: r306744 - head/sys/geom/mirror

2016-10-05 Thread Mark Johnston
Author: markj
Date: Thu Oct  6 00:13:55 2016
New Revision: 306744
URL: https://svnweb.freebsd.org/changeset/base/306744

Log:
  gmirror: Write an updated syncid before queuing writes.
  
  When a syncid bump is pending, any write to the mirror results in the
  updated syncid being written to each component's metadata block. However,
  the update was only being performed after the writes to the mirror
  componenents were queued. Instead, synchronously update the metadata block
  first.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Thu Oct  6 00:05:45 2016
(r306743)
+++ head/sys/geom/mirror/g_mirror.c Thu Oct  6 00:13:55 2016
(r306744)
@@ -1676,6 +1676,14 @@ g_mirror_register_request(struct bio *bp
sc->sc_last_write = time_uptime;
 
/*
+* Bump syncid on first write.
+*/
+   if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID) != 0) {
+   sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID;
+   g_mirror_bump_syncid(sc);
+   }
+
+   /*
 * Allocate all bios before sending any request, so we can
 * return ENOMEM in nice and clean way.
 */
@@ -1730,13 +1738,6 @@ g_mirror_register_request(struct bio *bp
 * synchronization requests don't collide with it.
 */
bioq_insert_tail(>sc_inflight, bp);
-   /*
-* Bump syncid on first write.
-*/
-   if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID) != 0) {
-   sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID;
-   g_mirror_bump_syncid(sc);
-   }
return;
}
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306743 - head/sys/geom/mirror

2016-10-05 Thread Mark Johnston
Author: markj
Date: Thu Oct  6 00:05:45 2016
New Revision: 306743
URL: https://svnweb.freebsd.org/changeset/base/306743

Log:
  gmirror: Bump the syncid if broken disks are found during startup.
  
  Consider a mirror with two components, m1 and m2. Suppose a hardware error
  results in the removal of m2, with m1's genid bumped. Suppose further that
  a replacement mirror component m3 is created and synchronized, after which
  the system is shut down uncleanly. During a subsequent bootup, if gmirror
  tastes m1 and m2 first, m2 will be removed from the mirror because it is
  broken, but the mirror will be started without bumping the syncid on m1
  because all elements of the mirror are accounted for. Then m3 will be
  added to the already-running mirror with the same syncid as m1, so the
  components will not be synchronized despite the unclean shutdown.
  
  Handle this scenario by bumping the syncid of healthy components if any
  broken mirrors are discovered during mirror startup.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Wed Oct  5 23:55:01 2016
(r306742)
+++ head/sys/geom/mirror/g_mirror.c Thu Oct  6 00:05:45 2016
(r306743)
@@ -2255,6 +2255,7 @@ g_mirror_update_device(struct g_mirror_s
{
struct g_mirror_disk *pdisk, *tdisk;
u_int dirty, ndisks, genid, syncid;
+   bool broken;
 
KASSERT(sc->sc_provider == NULL,
("Non-NULL provider in STARTING state (%s).", sc->sc_name));
@@ -2322,12 +2323,18 @@ g_mirror_update_device(struct g_mirror_s
/*
 * Remove all disks without the biggest genid.
 */
+   broken = false;
LIST_FOREACH_SAFE(disk, >sc_disks, d_next, tdisk) {
if (disk->d_genid < genid) {
G_MIRROR_DEBUG(0,
"Component %s (device %s) broken, 
skipping.",
g_mirror_get_diskname(disk), sc->sc_name);
g_mirror_destroy_disk(disk);
+   /*
+* Bump the syncid in case we discover a healthy
+* replacement disk after starting the mirror.
+*/
+   broken = true;
}
}
 
@@ -2418,7 +2425,7 @@ g_mirror_update_device(struct g_mirror_s
/* Reset hint. */
sc->sc_hint = NULL;
sc->sc_syncid = syncid;
-   if (force) {
+   if (force || broken) {
/* Remember to bump syncid on first write. */
sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID;
}
___
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: r306742 - head/sys/geom/mirror

2016-10-05 Thread Mark Johnston
Author: markj
Date: Wed Oct  5 23:55:01 2016
New Revision: 306742
URL: https://svnweb.freebsd.org/changeset/base/306742

Log:
  gmirror: Use bool instead of boolean_t.
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Wed Oct  5 23:42:02 2016
(r306741)
+++ head/sys/geom/mirror/g_mirror.c Wed Oct  5 23:55:01 2016
(r306742)
@@ -100,7 +100,7 @@ struct g_class g_mirror_class = {
 
 static void g_mirror_destroy_provider(struct g_mirror_softc *sc);
 static int g_mirror_update_disk(struct g_mirror_disk *disk, u_int state);
-static void g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force);
+static void g_mirror_update_device(struct g_mirror_softc *sc, bool force);
 static void g_mirror_dumpconf(struct sbuf *sb, const char *indent,
 struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp);
 static void g_mirror_sync_stop(struct g_mirror_disk *disk, int type);
@@ -1837,7 +1837,7 @@ g_mirror_worker(void *arg)
"Running event for device %s.",
sc->sc_name);
ep->e_error = 0;
-   g_mirror_update_device(sc, 1);
+   g_mirror_update_device(sc, true);
} else {
/* Update disk status. */
G_MIRROR_DEBUG(3, "Running event for disk %s.",
@@ -1845,7 +1845,7 @@ g_mirror_worker(void *arg)
ep->e_error = g_mirror_update_disk(ep->e_disk,
ep->e_state);
if (ep->e_error == 0)
-   g_mirror_update_device(sc, 0);
+   g_mirror_update_device(sc, false);
}
if ((ep->e_flags & G_MIRROR_EVENT_DONTWAIT) != 0) {
KASSERT(ep->e_error == 0,
@@ -2243,7 +2243,7 @@ g_mirror_determine_state(struct g_mirror
  * Update device state.
  */
 static void
-g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force)
+g_mirror_update_device(struct g_mirror_softc *sc, bool force)
 {
struct g_mirror_disk *disk;
u_int state;
___
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: r306741 - head/sys/kern

2016-10-05 Thread Conrad E. Meyer
Author: cem
Date: Wed Oct  5 23:42:02 2016
New Revision: 306741
URL: https://svnweb.freebsd.org/changeset/base/306741

Log:
  vfs_bio: Remove a leading space (style)
  
  Introduced in r282085.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Oct  5 23:25:29 2016(r306740)
+++ head/sys/kern/vfs_bio.c Wed Oct  5 23:42:02 2016(r306741)
@@ -3113,7 +3113,7 @@ flushbufqueues(struct vnode *lvp, int ta
if (bp->b_qindex == QUEUE_SENTINEL || (lvp != NULL &&
bp->b_vp != lvp)) {
mtx_unlock([queue]);
-   continue;
+   continue;
}
error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL);
mtx_unlock([queue]);
___
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: r306740 - head/gnu/usr.bin/groff

2016-10-05 Thread Ed Maste
Author: emaste
Date: Wed Oct  5 23:25:29 2016
New Revision: 306740
URL: https://svnweb.freebsd.org/changeset/base/306740

Log:
  groff: use changelog date rather than file modification date in man pages
  
  The source checkout date is not particularly relevant, and this makes
  groff man pages build reproducibly.
  
  Reviewed by:  bapt
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8158

Added:
  head/gnu/usr.bin/groff/mdate.sh   (contents, props changed)
Modified:
  head/gnu/usr.bin/groff/Makefile.inc

Modified: head/gnu/usr.bin/groff/Makefile.inc
==
--- head/gnu/usr.bin/groff/Makefile.inc Wed Oct  5 22:26:48 2016
(r306739)
+++ head/gnu/usr.bin/groff/Makefile.inc Wed Oct  5 23:25:29 2016
(r306740)
@@ -119,7 +119,7 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9]
-e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \
-e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
-e "s;@VERSION@;$(version)$(revision);g" \
-   -e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \
+   -e "s;@MDATE@;$(MDATE);g" \
-e "s;@g@;$(g);g" \
-e "s;@G@;`echo $(g) | LC_ALL=C tr a-z A-Z`;g" \
$< >$@
@@ -141,4 +141,5 @@ TOPREL?=..
 GROFF_DIST=${.CURDIR}/${TOPREL}/../../../contrib/groff
 DIST_SUBDIR?=  ${.CURDIR:T}
 DIST_DIR=  ${GROFF_DIST}/${DIST_SUBDIR}
+MDATE!=sh ${.CURDIR}/${TOPREL}/mdate.sh ${GROFF_DIST}/ChangeLog
 .PATH: ${DIST_DIR}

Added: head/gnu/usr.bin/groff/mdate.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/gnu/usr.bin/groff/mdate.sh Wed Oct  5 23:25:29 2016
(r306740)
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $FreeBSD$
+
+set -e
+test -r "$1"
+export LC_ALL=C
+changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\
+head -n 1)
+echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date)
___
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: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys

2016-10-05 Thread Gleb Smirnoff
On Wed, Oct 05, 2016 at 11:20:58AM +0800, Kevin Lo wrote:
K> > On Thu, Sep 15, 2016 at 07:41:48AM +, Kevin Lo wrote:
K> > K> Log:
K> > K>   Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead.
K> > ...
K> > K> Modified: head/sys/contrib/ipfilter/netinet/fil.c
K> > K> 
==
K> > K> --- head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 02:48:56 
2016(r305823)
K> > K> +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 07:41:48 
2016(r305824)
K> > K> @@ -3226,7 +3226,7 @@ filterdone:
K> > K> fdp = fin->fin_dif;
K> > K> if ((fdp != NULL) && (fdp->fd_ptr != NULL) &&
K> > K> (fdp->fd_ptr != (void *)-1)) {
K> > K> -   mc = M_COPY(fin->fin_m);
K> > K> +   mc = M_COPYM(fin->fin_m);
K> > K> if (mc != NULL)
K> > K> ipf_fastroute(mc, , fin, fdp);
K> > K> }
K> > K> 
K> > K> Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
K> > K> 
==
K> > K> --- head/sys/contrib/ipfilter/netinet/ip_compat.h   Thu Sep 15 
02:48:56 2016(r305823)
K> > K> +++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Thu Sep 15 
07:41:48 2016(r305824)
K> > K> @@ -211,7 +211,7 @@ struct  ether_addr {
K> > K>  #  define  MSGDSIZE(m) mbufchainlen(m)
K> > K>  #  define  M_LEN(m)(m)->m_len
K> > K>  #  define  M_ADJ(m,x)  m_adj(m, x)
K> > K> -#  define  M_COPY(x)   m_copy((x), 0, M_COPYALL)
K> > K> +#  define  M_COPYM(x)  m_copym((x), 0, M_COPYALL, M_NOWAIT)
K> > K>  #  define  M_DUP(m)m_dup(m, M_NOWAIT)
K> > K>  #  define  IPF_PANIC(x,y)  if (x) { printf y; panic("ipf_panic"); }
K> > K>  typedef struct mbuf mb_t;
K> > K> @@ -366,7 +366,7 @@ typedef struct  mb_s{
K> > K>  # define   MSGDSIZE(m) msgdsize(m)
K> > K>  # define   M_LEN(m)(m)->mb_len
K> > K>  # define   M_ADJ(m,x)  (m)->mb_len += x
K> > K> -# define   M_COPY(m)   dupmbt(m)
K> > K> +# define   M_COPYM(m)  dupmbt(m)
K> > K>  # define   M_DUP(m)dupmbt(m)
K> > K>  # define   GETKTIME(x) gettimeofday((struct timeval *)(x), 
NULL)
K> > K>  # define   MTOD(m, t)  ((t)(m)->mb_data)
K> > 
K> > IMHO, for contributed ipfilter we should only modify ip_compat.h and 
ip_fil_freebsd.c.
K> > In case of removal of m_copy() the macro should remain named M_COPY(), but 
it should be
K> > defined to call to function of m_copym(). So fil.c can be left unmodified, 
and ip_compat.h
K> > will have only 1 line change. The userland part of ip_compat.h which 
defines M_COPY() to
K> > dupmbt() doesn't need to be renamed as well.
K> 
K> Actually your comments were addressed in my original patch, but rwatson@
K> pointed out that switching M_COPY() to M_COPYM() for consistency:
K> https://reviews.freebsd.org/D7878#163304

This looks more like a general comment, not comment to ipfilter part. Robert,
can you confirm please?

The ipfilter part should have modifications only in ip_compat.h and 
ip_fil_freebsd.c.

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


svn commit: r306739 - stable/11/sys/kern

2016-10-05 Thread John Baldwin
Author: jhb
Date: Wed Oct  5 22:26:48 2016
New Revision: 306739
URL: https://svnweb.freebsd.org/changeset/base/306739

Log:
  MFC 305922: Fix LINT building.

Modified:
  stable/11/sys/kern/kern_lockf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_lockf.c
==
--- stable/11/sys/kern/kern_lockf.c Wed Oct  5 22:04:22 2016
(r306738)
+++ stable/11/sys/kern/kern_lockf.c Wed Oct  5 22:26:48 2016
(r306739)
@@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$");
 #ifdef LOCKF_DEBUG
 #include 
 
+#include 
 #include 
+#include 
 #include 
 
 static int lockf_debug = 0; /* control debug output */
@@ -2500,7 +2502,7 @@ lf_print(char *tag, struct lockf_entry *
if (lock->lf_inode != (struct inode *)0)
printf(" in ino %ju on dev <%s>,",
(uintmax_t)lock->lf_inode->i_number,
-   devtoname(lock->lf_inode->i_dev));
+   devtoname(ITODEV(lock->lf_inode)));
printf(" %s, start %jd, end ",
lock->lf_type == F_RDLCK ? "shared" :
lock->lf_type == F_WRLCK ? "exclusive" :
@@ -2528,7 +2530,7 @@ lf_printlist(char *tag, struct lockf_ent
 
printf("%s: Lock list for ino %ju on dev <%s>:\n",
tag, (uintmax_t)lock->lf_inode->i_number,
-   devtoname(lock->lf_inode->i_dev));
+   devtoname(ITODEV(lock->lf_inode)));
LIST_FOREACH(lf, >lf_vnode->v_lockf->ls_active, lf_link) {
printf("\tlock %p for ",(void *)lf);
lf_print_owner(lock->lf_owner);
___
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: r306738 - stable/11/sys/boot/efi/loader/arch/amd64

2016-10-05 Thread Konstantin Belousov
Author: kib
Date: Wed Oct  5 22:04:22 2016
New Revision: 306738
URL: https://svnweb.freebsd.org/changeset/base/306738

Log:
  MFC r306090:
  Simple post-mortem reporter for amd64 loader.efi.

Added:
  stable/11/sys/boot/efi/loader/arch/amd64/exc.S
 - copied unchanged from r306090, head/sys/boot/efi/loader/arch/amd64/exc.S
  stable/11/sys/boot/efi/loader/arch/amd64/trap.c
 - copied unchanged from r306090, head/sys/boot/efi/loader/arch/amd64/trap.c
Modified:
  stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc
==
--- stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc   Wed Oct  5 
22:02:36 2016(r306737)
+++ stable/11/sys/boot/efi/loader/arch/amd64/Makefile.inc   Wed Oct  5 
22:04:22 2016(r306738)
@@ -3,7 +3,9 @@
 SRCS+= amd64_tramp.S \
start.S \
framebuffer.c \
-   elf64_freebsd.c
+   elf64_freebsd.c \
+   trap.c \
+   exc.S
 
 .PATH: ${.CURDIR}/../../i386/libi386
 SRCS+= nullconsole.c \

Copied: stable/11/sys/boot/efi/loader/arch/amd64/exc.S (from r306090, 
head/sys/boot/efi/loader/arch/amd64/exc.S)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/sys/boot/efi/loader/arch/amd64/exc.S  Wed Oct  5 22:04:22 
2016(r306738, copy of r306090, 
head/sys/boot/efi/loader/arch/amd64/exc.S)
@@ -0,0 +1,165 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+   .macro  EH  N, err=1
+   .align  8
+   .globl  EXC\N\()_handler
+EXC\N\()_handler:
+   .if \err != 1
+   pushq   $0
+   .endif
+   pushq   %rax
+   pushq   %rdx
+   pushq   %rcx
+   movl$\N,%ecx
+   jmp all_handlers
+   .endm
+
+   .text
+   EH  0,0
+   EH  1,0
+   EH  2,0
+   EH  3,0
+   EH  4,0
+   EH  5,0
+   EH  6,0
+   EH  7,0
+   EH  8
+   EH  9,0
+   EH  10
+   EH  11
+   EH  12
+   EH  13
+   EH  14
+   EH  16,0
+   EH  17
+   EH  18,0
+   EH  19,0
+   EH  20,0
+
+   .globl  exc_rsp
+all_handlers:
+   cmpq%rsp,exc_rsp(%rip)
+   je  exception
+
+   /*
+* Interrupt, not exception.
+* First, copy the hardware interrupt frame to the previous stack.
+* Our handler always has private IST stack.
+*/
+   movq(6*8)(%rsp),%rax/* saved %rsp value, AKA old stack */
+   subq(5*8),%rax
+   movq(3*8)(%rsp),%rdx/* copy %rip to old stack */
+   movq%rdx,(%rax)
+   movq(4*8)(%rsp),%rdx/* copy %cs */
+   movq%rdx,(1*8)(%rax)
+   movq(5*8)(%rsp),%rdx/* copy %rflags */
+   movq%rdx,(2*8)(%rax)
+   movq(6*8)(%rsp),%rdx/* copy %rsp */
+   movq%rdx,(3*8)(%rax)
+   movq(7*8)(%rsp),%rdx/* copy %ss */
+   movq%rdx,(4*8)(%rax)
+
+   /*
+* Now simulate invocation of the original interrupt handler
+* with retq.  We switch stacks and execute retq from the old
+* stack since there is no free registers at the last moment.
+*/
+   subq$16,%rax
+   leaqfw_intr_handlers(%rip),%rdx
+   movq

svn commit: r306737 - in stable/11/sys: amd64/amd64 amd64/conf amd64/include conf modules modules/efirt

2016-10-05 Thread Konstantin Belousov
Author: kib
Date: Wed Oct  5 22:02:36 2016
New Revision: 306737
URL: https://svnweb.freebsd.org/changeset/base/306737

Log:
  MFC r306097:
  Add kernel interfaces to call EFI Runtime Services.
  
  MFC r306104:
  Fix build of the module outside the kernel tree.
  
  MFC r306209 (by imp):
  Change the efi_get_table interface to a void **.
  
  MFC r306351:
  Handle TLB shootdown IPI during the EFI runtime calls, on SandyBridges.

Added:
  stable/11/sys/amd64/amd64/efirt.c   (contents, props changed)
 - copied, changed from r306097, head/sys/amd64/amd64/efirt.c
  stable/11/sys/modules/efirt/
 - copied from r306097, head/sys/modules/efirt/
Modified:
  stable/11/sys/amd64/conf/NOTES
  stable/11/sys/amd64/include/efi.h
  stable/11/sys/conf/files.amd64
  stable/11/sys/conf/options.amd64
  stable/11/sys/modules/Makefile
  stable/11/sys/modules/efirt/Makefile
Directory Properties:
  stable/11/   (props changed)

Copied and modified: stable/11/sys/amd64/amd64/efirt.c (from r306097, 
head/sys/amd64/amd64/efirt.c)
==
--- head/sys/amd64/amd64/efirt.cWed Sep 21 11:31:58 2016
(r306097, copy source)
+++ stable/11/sys/amd64/amd64/efirt.c   Wed Oct  5 22:02:36 2016
(r306737)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -301,6 +302,17 @@ efi_enter(void)
PMAP_UNLOCK(curpmap);
return (error);
}
+
+   /*
+* IPI TLB shootdown handler invltlb_pcid_handler() reloads
+* %cr3 from the curpmap->pm_cr3, which would disable runtime
+* segments mappings.  Block the handler's action by setting
+* curpmap to impossible value.  See also comment in
+* pmap.c:pmap_activate_sw().
+*/
+   if (pmap_pcid_enabled && !invpcid_works)
+   PCPU_SET(curpmap, NULL);
+
load_cr3(VM_PAGE_TO_PHYS(efi_pml4_page) | (pmap_pcid_enabled ?
curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0));
/*
@@ -317,7 +329,9 @@ efi_leave(void)
 {
pmap_t curpmap;
 
-   curpmap = PCPU_GET(curpmap);
+   curpmap = >p_vmspace->vm_pmap;
+   if (pmap_pcid_enabled && !invpcid_works)
+   PCPU_SET(curpmap, curpmap);
load_cr3(curpmap->pm_cr3 | (pmap_pcid_enabled ?
curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0));
if (!pmap_pcid_enabled)
@@ -405,7 +419,7 @@ efi_uninit(void)
 }
 
 int
-efi_get_table(struct uuid *uuid, void *ptr)
+efi_get_table(struct uuid *uuid, void **ptr)
 {
struct efi_cfgtbl *ct;
u_long count;
@@ -416,7 +430,7 @@ efi_get_table(struct uuid *uuid, void *p
ct = efi_cfgtbl;
while (count--) {
if (!bcmp(>ct_uuid, uuid, sizeof(*uuid))) {
-   ptr = (void *)PHYS_TO_DMAP(ct->ct_data);
+   *ptr = (void *)PHYS_TO_DMAP(ct->ct_data);
return (0);
}
ct++;

Modified: stable/11/sys/amd64/conf/NOTES
==
--- stable/11/sys/amd64/conf/NOTES  Wed Oct  5 20:45:21 2016
(r306736)
+++ stable/11/sys/amd64/conf/NOTES  Wed Oct  5 22:02:36 2016
(r306737)
@@ -599,6 +599,9 @@ options ENABLE_ALART# Control alarm o
 #
 optionsNKPT=31
 
+# EFI Runtime Services support (not functional yet).
+optionsEFIRT
+
 
 #
 # ABI Emulation

Modified: stable/11/sys/amd64/include/efi.h
==
--- stable/11/sys/amd64/include/efi.h   Wed Oct  5 20:45:21 2016
(r306736)
+++ stable/11/sys/amd64/include/efi.h   Wed Oct  5 22:02:36 2016
(r306737)
@@ -39,4 +39,21 @@
  */
 #defineEFIABI_ATTR __attribute__((ms_abi))
 
+#ifdef _KERNEL
+struct uuid;
+struct efi_tm;
+
+int efi_get_table(struct uuid *uuid, void **ptr);
+int efi_get_time(struct efi_tm *tm);
+int efi_get_time_locked(struct efi_tm *tm);
+int efi_reset_system(void);
+int efi_set_time(struct efi_tm *tm);
+int efi_set_time_locked(struct efi_tm *tm);
+int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
+size_t *datasize, void *data);
+int efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor);
+int efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t attrib,
+size_t datasize, void *data);
+#endif
+
 #endif /* __AMD64_INCLUDE_EFI_H_ */

Modified: stable/11/sys/conf/files.amd64
==
--- stable/11/sys/conf/files.amd64  Wed Oct  5 20:45:21 2016
(r306736)
+++ stable/11/sys/conf/files.amd64  Wed Oct  5 22:02:36 2016
(r306737)
@@ -110,6 +110,7 @@ amd64/amd64/cpu_switch.Sstandard
 amd64/amd64/db_disasm.c

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

2016-10-05 Thread Slawa Olhovchenkov
On Wed, Oct 05, 2016 at 11:19:10AM +1100, Bruce Evans wrote:

> On Tue, 4 Oct 2016, Gleb Smirnoff wrote:
> 
> > On Mon, Sep 26, 2016 at 03:30:30PM +, Eric van Gyzen wrote:
> > E> ...
> > E> Modified: head/sys/kern/kern_mutex.c
> > E> 
> > ==
> > E> --- head/sys/kern/kern_mutex.c   Mon Sep 26 15:03:31 2016
> > (r306345)
> > E> +++ head/sys/kern/kern_mutex.c   Mon Sep 26 15:30:30 2016
> > (r306346)
> > E> @@ -924,7 +924,7 @@ __mtx_assert(const volatile uintptr_t *c
> > E>  {
> > E>  const struct mtx *m;
> > E>
> > E> -if (panicstr != NULL || dumping)
> > E> +if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
> > E>  return;
> >
> > I wonder if all this disjunct can be reduced just to SCHEDULER_STOPPED()?
> > Positive panicstr and dumping imply scheduler stopped.
> 
> 'dumping' doesn't imply SCHEDULER_STOPPED().
> 
> Checking 'dumping' here seems to be just an old bug.  It just breaks
> __mtx_assert(), while all other mutex operations work normally for dumping
> without panicing.

[...]

Is this related to halted (not reboted) 11.0 after ~^B and `panic`?
What I see on serial console:
=
db> panic
panic: from debugger
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at 0x8031fadb = 
db_trace_self_wrapper+0x2b/frame 0xfe1f9e198120
vpanic() at 0x804a0302 = vpanic+0x182/frame 0xfe1f9e1981a0
panic() at 0x804a0383 = panic+0x43/frame 0xfe1f9e198200
db_panic() at 0x8031d987 = db_panic+0x17/frame 0xfe1f9e198210
db_command() at 0x8031d019 = db_command+0x299/frame 0xfe1f9e1982e0
db_command_loop() at 0x8031cd74 = db_command_loop+0x64/frame 
0xfe1f9e1982f0
db_trap() at 0x8031fc1b = db_trap+0xdb/frame 0xfe1f9e198380
kdb_trap() at 0x804dd8c3 = kdb_trap+0x193/frame 0xfe1f9e198410
trap() at 0x806e3065 = trap+0x255/frame 0xfe1f9e198620
calltrap() at 0x806cafd1 = calltrap+0x8/frame 0xfe1f9e198620
--- trap 0x3, rip = 0x804dd11e, rsp = 0xfe1f9e1986f0, rbp = 
0xfe1f9e198710 ---
kdb_alt_break_internal() at 0x804dd11e = 
kdb_alt_break_internal+0x18e/frame 0xfe1f9e198710
kdb_alt_break() at 0x804dcf8b = kdb_alt_break+0xb/frame 
0xfe1f9e198720
uart_intr_rxready() at 0x803e38a8 = uart_intr_rxready+0x98/frame 
0xfe1f9e198750
uart_intr() at 0x803e4621 = uart_intr+0x121/frame 0xfe1f9e198790
intr_event_handle() at 0x8046c74b = intr_event_handle+0x9b/frame 
0xfe1f9e1987e0
intr_execute_handlers() at 0x8076d2d8 = 
intr_execute_handlers+0x48/frame 0xfe1f9e198810
lapic_handle_intr() at 0x8077163f = lapic_handle_intr+0x3f/frame 
0xfe1f9e198830
Xapic_isr1() at 0x806cb6b7 = Xapic_isr1+0xb7/frame 0xfe1f9e198830
--- interrupt, rip = 0x8032fedf, rsp = 0xfe1f9e198900, rbp = 
0xfe1f9e198940 ---
acpi_cpu_idle() at 0x8032fedf = acpi_cpu_idle+0x2af/frame 
0xfe1f9e198940
cpu_idle_acpi() at 0x8076ad1f = cpu_idle_acpi+0x3f/frame 
0xfe1f9e198960
cpu_idle() at 0x8076adc5 = cpu_idle+0x95/frame 0xfe1f9e198980
sched_idletd() at 0x804cbbe5 = sched_idletd+0x495/frame 
0xfe1f9e198a70
fork_exit() at 0x8046a211 = fork_exit+0x71/frame 0xfe1f9e198ab0
fork_trampoline() at 0x806cb50e = fork_trampoline+0xe/frame 
0xfe1f9e198ab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
Uptime: 1d4h53m19s
Dumping 12148 out of 131020 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%
Dump complete
mps2: Sending StopUnit: path (xpt0:mps2:0:14:):  handle 12
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
=

This is normal reboot (by /sbin/reboot):

===
Sending StopUnit: path (xpt0:mps2:0:14:):  handle 13
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:18:): 
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:14:): 
===


mps2: lagg0: link state changed to DOWN
Sending StopUnit: path (xpt0:mps2:0:14:):  handle 12
mps2: Incrementing SSU count
mps2: Sending StopUnit: path (xpt0:mps2:0:18:):  handle 9
mps2: Incrementing SSU count
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:18:): 
mps2: Decrementing SSU count.
mps2: Completing stop unit for (xpt0:mps2:0:14:): 

___
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: r306736 - head/sbin/nos-tun

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:45:21 2016
New Revision: 306736
URL: https://svnweb.freebsd.org/changeset/base/306736

Log:
  Add history section to nos-tun(8)
  
  PR:   212545
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/nos-tun/nos-tun.8

Modified: head/sbin/nos-tun/nos-tun.8
==
--- head/sbin/nos-tun/nos-tun.8 Wed Oct  5 20:42:35 2016(r306735)
+++ head/sbin/nos-tun/nos-tun.8 Wed Oct  5 20:45:21 2016(r306736)
@@ -8,7 +8,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 11, 1998
+.Dd October 5, 2016
 .Dt NOS-TUN 8
 .Os
 .Sh NAME
@@ -80,6 +80,11 @@ tunnel mode nos
 tunnel destination 192.168.59.34
 tunnel source 192.168.56.45
 .Ed
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Fx 3.0 .
 .Sh AUTHORS
 .An -nosplit
 .An Nickolay N. Dudorov Aq Mt n...@itfs.nsk.su
___
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: r306364 - in head: lib/libc/tests share/mk

2016-10-05 Thread Ed Maste
On 27 September 2016 at 09:44, Ruslan Bukin  wrote:
> Author: br
> Date: Tue Sep 27 09:44:30 2016
> New Revision: 306364
> URL: https://svnweb.freebsd.org/changeset/base/306364
>
> Log:
>   Mark SSP broken on MIPS.

This needs an adjustment in sys/conf/kern.opts.mk as well it seems;
'make showconfig' (as used by makeman to generate src.conf.5) now
reports SSP is both 'no' and 'yes' on mips:

% make TARGET=mips TARGET_ARCH=mips showconfig | grep SSP
MK_SSP   = no
MK_SSP   = yes
___
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: r306735 - head/sbin/natd

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:42:35 2016
New Revision: 306735
URL: https://svnweb.freebsd.org/changeset/base/306735

Log:
  Add history section to natd(8)
  Fix back sentence raised by igor.
  
  PR:   212544
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/natd/natd.8

Modified: head/sbin/natd/natd.8
==
--- head/sbin/natd/natd.8   Wed Oct  5 20:38:49 2016(r306734)
+++ head/sbin/natd/natd.8   Wed Oct  5 20:42:35 2016(r306735)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.Dd June 23, 2008
+.Dd October 5, 2016
 .Dt NATD 8
 .Os
 .Sh NAME
@@ -426,7 +426,7 @@ Options can be divided to several sectio
 Each section applies to own
 .Nm
 instance.
-This ability allows to configure one
+This ability allows the configuration of one
 .Nm
 process for several NAT instances.
 The first instance that always exists is a "default" instance.
@@ -808,6 +808,11 @@ are forwarded to the appropriate router 
 .Xr init 8 ,
 .Xr ipfw 8 ,
 .Xr ppp 8
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Fx 3.0 .
 .Sh AUTHORS
 This program is the result of the efforts of many people at different
 times:
___
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: r306734 - head/sbin/fsck_ffs

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:38:49 2016
New Revision: 306734
URL: https://svnweb.freebsd.org/changeset/base/306734

Log:
  Add history section to fsck_ffs(8)
  Move sentence to a new line as advised by igor.
  
  PR:   212474
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/fsck_ffs/fsck_ffs.8

Modified: head/sbin/fsck_ffs/fsck_ffs.8
==
--- head/sbin/fsck_ffs/fsck_ffs.8   Wed Oct  5 20:31:44 2016
(r306733)
+++ head/sbin/fsck_ffs/fsck_ffs.8   Wed Oct  5 20:38:49 2016
(r306734)
@@ -29,7 +29,7 @@
 .\"@(#)fsck.8  8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd July 30, 2013
+.Dd October 5, 2016
 .Dt FSCK_FFS 8
 .Os
 .Sh NAME
@@ -268,9 +268,9 @@ do not open the file system for writing.
 Preen file systems (see above).
 .It Fl R
 Instruct fsck_ffs to restart itself if it encounters certain errors that
-warrant another run.  It will limit itself to a maximum of 10 restarts
-in a given run in order to avoid an endless loop with extremely corrupted
-filesystems.
+warrant another run.
+It will limit itself to a maximum of 10 restarts in a given run in order
+to avoid an endless loop with extremely corrupted filesystems.
 .It Fl r
 Free up excess unused inodes.
 Decreasing the number of preallocated inodes reduces the
@@ -393,3 +393,14 @@ are fully enumerated and explained in Ap
 .Xr fsdb 8 ,
 .Xr newfs 8 ,
 .Xr reboot 8
+.Sh HISTORY
+A
+.Nm fsck
+utility appeared in
+.Bx 4.0 .
+It became
+.Nm
+in
+.Fx 5.0
+with the introduction of the filesystem independent wrapper as
+.Nm fsck .
___
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: r306733 - head/sbin/fsck

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:31:44 2016
New Revision: 306733
URL: https://svnweb.freebsd.org/changeset/base/306733

Log:
  Add history section to fsck(8)
  
  PR:   212472
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/fsck/fsck.8

Modified: head/sbin/fsck/fsck.8
==
--- head/sbin/fsck/fsck.8   Wed Oct  5 20:28:04 2016(r306732)
+++ head/sbin/fsck/fsck.8   Wed Oct  5 20:31:44 2016(r306733)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 23, 2014
+.Dd October 5, 2016
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -229,3 +229,15 @@ file system table
 .Xr fsck_ffs 8 ,
 .Xr fsck_msdosfs 8 ,
 .Xr mount 8
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.Bx 4.0 .
+It was reimplemented as a filesystem independent wrapper in
+.Nx 1.3
+and first appeared in
+.Fx 5.0 .
+The original filesystem specific utility became
+.Xr fsck_ffs 8
+at this point.
___
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: r306729 - head/tools/build/options

2016-10-05 Thread Bryan Drewery
On 10/5/16 1:12 PM, Ed Maste wrote:
> Author: emaste
> Date: Wed Oct  5 20:12:00 2016
> New Revision: 306729
> URL: https://svnweb.freebsd.org/changeset/base/306729
> 
> Log:
>   makeman: avoid bogus output with duplicated options
>   
>   On some targets 'make showconfig' currently reports both 'no' and 'yes'
>   for some options. For example:
>   
>   % make TARGET=mips showconfig | grep SSP
>   MK_SSP   = no
>   MK_SSP   = yes
>   

This problem in this case is because kern.opts.mk is returning
MK_SSP=yes due to bsd.opts.mk defaulting SSP to on, and src.opts.mk is
returning MK_SSP=no for TARGET_ARCH=mips.

This will fix it:
https://people.freebsd.org/~bdrewery/patches/bsd.opts.mk.broken-options.patch

I think it would be more proper to move any BROKEN_OPTIONS owned by
bsd.opts.mk to there rather than in src.opts.mk.  Since in this case SSP
is broken on MIPS and yet will continue to be used for out-of-tree
builds even though it is broken...

>   Emit a warning on encountering a duplicated variable, and skip the
>   second entry.
>   
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/tools/build/options/makeman
> 
> Modified: head/tools/build/options/makeman
> ==
> --- head/tools/build/options/makeman  Wed Oct  5 20:08:07 2016
> (r306728)
> +++ head/tools/build/options/makeman  Wed Oct  5 20:12:00 2016
> (r306729)
> @@ -33,12 +33,18 @@ show_options()
>   ALL_TARGETS=$(echo $(${make} targets | tail -n +2))
>   rm -f $t/settings
>   for target in ${ALL_TARGETS} ; do
> + prev_opt=
>   env -i ${make} showconfig \
>   SRC_ENV_CONF=/dev/null SRCCONF=/dev/null \
>   __MAKE_CONF=/dev/null \
>   TARGET_ARCH=${target#*/} TARGET=${target%/*} |
>   while read var _ val ; do
>   opt=${var#MK_}
> + if [ $opt = "$prev_opt" ]; then
> + echo "$target: ignoring duplicate option $opt" 
> >&2
> + continue
> + fi
> + prev_opt=$opt
>   case ${val} in
>   yes)
>   echo ${opt} ${target}
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r306732 - head/sbin/fdisk_pc98

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:28:04 2016
New Revision: 306732
URL: https://svnweb.freebsd.org/changeset/base/306732

Log:
  Document the history of fdisk based on the original post to comp.unix.bsd by 
Julian Elischer [1] and the Mach 2.5 Installation notes [2].
  I was unable to pin point the exact version of Mach the fdisk utility 
appeared as I could not find documentation older than version 2.5 & no source 
code or repo history.
  fdisk utility appears as a separate utility[3] in v2.5. Due to this, I have 
avoided stating the exact version fdisk first appeared in Mach.
  Add authors section.
  
  [1] https://groups.google.com/d/topic/comp.unix.bsd/Hhi45vAHxDg/discussion
  [2] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_install.ps
  [3] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_manpages.ps
  
  PR:   212470
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/fdisk_pc98/fdisk.8

Modified: head/sbin/fdisk_pc98/fdisk.8
==
--- head/sbin/fdisk_pc98/fdisk.8Wed Oct  5 20:21:06 2016
(r306731)
+++ head/sbin/fdisk_pc98/fdisk.8Wed Oct  5 20:28:04 2016
(r306732)
@@ -1,6 +1,6 @@
 .\" $FreeBSD$
 .\"
-.Dd April 30, 2007
+.Dd October 5, 2016
 .Dt FDISK 8
 .Os
 .Sh NAME
@@ -448,6 +448,21 @@ Example: to make slice 1 the active slic
 .Xr bsdlabel 8 ,
 .Xr gpart 8 ,
 .Xr newfs 8
+.Sh HISTORY
+A version of
+.Nm
+first appeared in the Mach Operating System.
+It was subsequently ported to
+.Bx 386 .
+.Sh AUTHORS
+.An -nosplit
+.Nm
+for Mach Operating System was written by
+.An Robert Baron Aq Mt r...@cs.cmu.edu .
+It was ported to
+.Bx 386
+by
+.An Julian Elischer Aq Mt jul...@tfs.com .
 .Sh BUGS
 The default boot code will not necessarily handle all slice types
 correctly, in particular those introduced since
___
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: r306731 - head/sbin/fdisk

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:21:06 2016
New Revision: 306731
URL: https://svnweb.freebsd.org/changeset/base/306731

Log:
  Document the history of fdisk based on the original post to comp.unix.bsd by 
Julian Elischer [1] and the Mach 2.5 Installation notes [2].
  I was unable to pin point the exact version of Mach the fdisk utility 
appeared as I could not find documentation older than version 2.5 & no source 
code or repo history.
  fdisk utility appears as a separate utility[3] in v2.5. Due to this, I have 
avoided stating the exact version fdisk first appeared in Mach.
  Add authors section.
  Make correction pointed by igor
  [1] https://groups.google.com/d/topic/comp.unix.bsd/Hhi45vAHxDg/discussion
  [2] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_install.ps
  [3] ftp://ftp.mcs.vuw.ac.nz/doc/misc/mach-i386-doc/i386_manpages.ps
  PR:   212469
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/fdisk/fdisk.8

Modified: head/sbin/fdisk/fdisk.8
==
--- head/sbin/fdisk/fdisk.8 Wed Oct  5 20:18:17 2016(r306730)
+++ head/sbin/fdisk/fdisk.8 Wed Oct  5 20:21:06 2016(r306731)
@@ -1,6 +1,6 @@
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2013
+.Dd October 5, 2016
 .Dt FDISK 8
 .Os
 .Sh NAME
@@ -177,19 +177,19 @@ An example follows:
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
-   start 495, size 380160 (185 Meg), flag 0
+   start 495, size 380160 (185 Meg), flag 0
beg: cyl 1/ sector 1/ head 0;
end: cyl 768/ sector 33/ head 14
The data for partition 2 is:
sysid 164,(unknown)
-   start 378180, size 2475 (1 Meg), flag 0
+   start 378180, size 2475 (1 Meg), flag 0
beg: cyl 764/ sector 1/ head 0;
end: cyl 768/ sector 33/ head 14
The data for partition 3 is:

The data for partition 4 is:
sysid 99,(ISC UNIX, other System V/386, GNU HURD or Mach)
-   start 380656, size 224234 (109 Meg), flag 80
+   start 380656, size 224234 (109 Meg), flag 80
beg: cyl 769/ sector 2/ head 0;
end: cyl 197/ sector 33/ head 14
 .Ed
@@ -485,6 +485,21 @@ The default boot code.
 .Xr bsdlabel 8 ,
 .Xr gpart 8 ,
 .Xr newfs 8
+.Sh HISTORY
+A version of
+.Nm
+first appeared in the Mach Operating System.
+It was subsequently ported to
+.Bx 386 .
+.Sh AUTHORS
+.An -nosplit
+.Nm
+for Mach Operating System was written by
+.An Robert Baron Aq Mt r...@cs.cmu.edu .
+It was ported to
+.Bx 386
+by
+.An Julian Elischer Aq Mt jul...@tfs.com .
 .Sh BUGS
 The default boot code will not necessarily handle all slice types
 correctly, in particular those introduced since
___
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: r306730 - head/share/man/man5

2016-10-05 Thread Ed Maste
Author: emaste
Date: Wed Oct  5 20:18:17 2016
New Revision: 306730
URL: https://svnweb.freebsd.org/changeset/base/306730

Log:
  Regen src.conf.5 after r306649
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Oct  5 20:12:00 2016
(r306729)
+++ head/share/man/man5/src.conf.5  Wed Oct  5 20:18:17 2016
(r306730)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z 
bdrewery
+.\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z 
emaste
 .\" $FreeBSD$
-.Dd September 21, 2016
+.Dd October 5, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -493,6 +493,15 @@ When set, it also enforces the following
 .\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 
2015-10-27 20:49:56Z emaste
 Set to avoid building or installing standalone debug files for each
 executable binary and shared library.
+.It Va WITHOUT_DIALOG
+.\" from FreeBSD: head/tools/build/options/WITHOUT_DIALOG 306375 2016-09-27 
18:08:38Z emaste
+Set to not build dialog(1), dialog(1,3), and dpv(1,3).
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_BSDINSTALL
+.El
 .It Va WITHOUT_DICT
 .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 
07:50:50Z ru
 Set to not build the Webster dictionary files.
@@ -617,12 +626,6 @@ and related programs.
 .It Va WITH_EISA
 .\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 
16:53:06Z imp
 Set to build EISA kernel modules.
-.It Va WITHOUT_ELFCOPY_AS_OBJCOPY
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY 296193 
2016-02-29 16:39:38Z emaste
-Set to build and install
-.Xr objcopy 1
-from GNU Binutils, instead of the one from ELF Tool Chain.
-This option is provided as a transition aid and will be removed in due time.
 .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 
295491 2016-02-11 00:14:00Z emaste
 Set to not build ELF Tool Chain tools
@@ -1376,6 +1379,9 @@ Set to not build kernel modules that inc
 .It Va WITHOUT_SSP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 
21:33:28Z ru
 Set to not build world with propolice stack smashing protection.
+.Pp
+It is a default setting on
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64 and mips/mipsn32.
 .It Va WITH_STAGING
 .\" from FreeBSD: head/tools/build/options/WITH_STAGING 290816 2015-11-14 
03:24:48Z sjg
 Enable staging of files to a stage tree.
___
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: r306729 - head/tools/build/options

2016-10-05 Thread Ed Maste
Author: emaste
Date: Wed Oct  5 20:12:00 2016
New Revision: 306729
URL: https://svnweb.freebsd.org/changeset/base/306729

Log:
  makeman: avoid bogus output with duplicated options
  
  On some targets 'make showconfig' currently reports both 'no' and 'yes'
  for some options. For example:
  
  % make TARGET=mips showconfig | grep SSP
  MK_SSP   = no
  MK_SSP   = yes
  
  Emit a warning on encountering a duplicated variable, and skip the
  second entry.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/build/options/makeman

Modified: head/tools/build/options/makeman
==
--- head/tools/build/options/makemanWed Oct  5 20:08:07 2016
(r306728)
+++ head/tools/build/options/makemanWed Oct  5 20:12:00 2016
(r306729)
@@ -33,12 +33,18 @@ show_options()
ALL_TARGETS=$(echo $(${make} targets | tail -n +2))
rm -f $t/settings
for target in ${ALL_TARGETS} ; do
+   prev_opt=
env -i ${make} showconfig \
SRC_ENV_CONF=/dev/null SRCCONF=/dev/null \
__MAKE_CONF=/dev/null \
TARGET_ARCH=${target#*/} TARGET=${target%/*} |
while read var _ val ; do
opt=${var#MK_}
+   if [ $opt = "$prev_opt" ]; then
+   echo "$target: ignoring duplicate option $opt" 
>&2
+   continue
+   fi
+   prev_opt=$opt
case ${val} in
yes)
echo ${opt} ${target}
___
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: r306728 - head/sbin/devfs

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:08:07 2016
New Revision: 306728
URL: https://svnweb.freebsd.org/changeset/base/306728

Log:
  Add history section for devfs(8)
  Move sentence to a new line as advised by igor.
  
  PR:   212441
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/devfs/devfs.8

Modified: head/sbin/devfs/devfs.8
==
--- head/sbin/devfs/devfs.8 Wed Oct  5 20:04:36 2016(r306727)
+++ head/sbin/devfs/devfs.8 Wed Oct  5 20:08:07 2016(r306728)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 12, 2013
+.Dd October 5, 2016
 .Dt DEVFS 8
 .Os
 .Sh NAME
@@ -249,7 +249,8 @@ configuration file.
 .It Pa /etc/devfs.rules
 Local
 .Nm
-configuration file.  Rulesets in here override those in
+configuration file.
+Rulesets in here override those in
 .Pa /etc/defaults/devfs.rules
 with the same ruleset number, otherwise the two files are effectively merged.
 .It Pa /etc/devfs.conf
@@ -374,5 +375,10 @@ this feature can be used to copy ruleset
 .Xr chown 8 ,
 .Xr jail 8 ,
 .Xr mknod 8
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Fx 5.0 .
 .Sh AUTHORS
 .An Dima Dorfman
___
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: r306727 - head/sbin/devd

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:04:36 2016
New Revision: 306727
URL: https://svnweb.freebsd.org/changeset/base/306727

Log:
  Add history section for devd(8)
  Move sentence to a new line as advised by igor
  
  PR:   212439
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/devd/devd.8

Modified: head/sbin/devd/devd.8
==
--- head/sbin/devd/devd.8   Wed Oct  5 20:02:34 2016(r306726)
+++ head/sbin/devd/devd.8   Wed Oct  5 20:04:36 2016(r306727)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 14, 2014
+.Dd October 5, 2016
 .Dt DEVD 8
 .Os
 .Sh NAME
@@ -62,7 +62,8 @@ The default connection limit is 10.
 Do not process all pending events before becoming a daemon.
 Instead, call daemon right away.
 .It Fl q
-Quiet mode.  Only log messages at priority LOG_WARNING or above.
+Quiet mode.
+Only log messages at priority LOG_WARNING or above.
 .El
 .Sh IMPLEMENTATION NOTES
 The
@@ -153,5 +154,10 @@ A deprecated socket retained for use wit
 .Sh SEE ALSO
 .Xr devctl 4 ,
 .Xr devd.conf 5
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Fx 5.0 .
 .Sh AUTHORS
 .An M. Warner Losh
___
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: r306726 - head/lib/libcapsicum

2016-10-05 Thread Mariusz Zaborski
Author: oshogbo
Date: Wed Oct  5 20:02:34 2016
New Revision: 306726
URL: https://svnweb.freebsd.org/changeset/base/306726

Log:
  Add man pages for Capsicum helpers.
  
  Reviewed by:  cem
  Differential Revision:https://reviews.freebsd.org/D8154

Added:
  head/lib/libcapsicum/capsicum_helpers.3   (contents, props changed)
Modified:
  head/lib/libcapsicum/Makefile

Modified: head/lib/libcapsicum/Makefile
==
--- head/lib/libcapsicum/Makefile   Wed Oct  5 20:01:09 2016
(r306725)
+++ head/lib/libcapsicum/Makefile   Wed Oct  5 20:02:34 2016
(r306726)
@@ -4,4 +4,14 @@ PACKAGE=lib${LIB}
 
 INCS=  capsicum_helpers.h
 
+MAN+=  capsicum_helpers.3
+
+MLINKS+=capsicum_helpers.3 caph_limit_stream.3
+MLINKS+=capsicum_helpers.3 caph_limit_stdin.3
+MLINKS+=capsicum_helpers.3 caph_limit_stderr.3
+MLINKS+=capsicum_helpers.3 caph_limit_stdout.3
+MLINKS+=capsicum_helpers.3 caph_limit_stdio.3
+MLINKS+=capsicum_helpers.3 caph_cache_tzdata.3
+MLINKS+=capsicum_helpers.3 caph_cache_catpages.3
+
 .include 

Added: head/lib/libcapsicum/capsicum_helpers.3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libcapsicum/capsicum_helpers.3 Wed Oct  5 20:02:34 2016
(r306726)
@@ -0,0 +1,110 @@
+.\" Copyright (c) 2016 Mariusz Zaborski 
+.\" 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 AUTHORS 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 AUTHORS 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 October 5, 2016
+.Dt CAPSICUM_HELPERS 3
+.Os
+.Sh NAME
+.Nm caph_limit_stream ,
+.Nm caph_limit_stdin ,
+.Nm caph_limit_stderr ,
+.Nm caph_limit_stdout ,
+.Nm caph_limit_stdio ,
+.Nm caph_cache_tzdata ,
+.Nm caph_cache_catpages
+.Nd "set of the functions , part of the libcapsicum"
+.Sh LIBRARY
+.Lb libcapsicum
+.Sh SYNOPSIS
+.In capsicum_helpers.h
+.Ft int
+.Fn caph_limit_stream "int fd, int flags"
+.Ft int
+.Fn caph_limit_stdin "void"
+.Ft int
+.Fn caph_limit_stderr "void"
+.Ft int
+.Fn caph_limit_stdout "void"
+.Ft int
+.Fn caph_limit_stdio "void"
+.Ft void
+.Fn caph_cache_tzdata "void"
+.Ft void
+.Fn caph_cache_catpages "void"
+.Sh DESCRIPTION
+The
+.Nm capsicum helpers
+are a set of a inline functions which simplify Capsicumizing programs.
+The goal is to reduce duplicated code patterns.
+The
+.Nm capsicum helpers
+are part of
+.Nm libcapsicum
+but there is no need to link to the library.
+.Pp
+.Fn caph_limit_stream
+restricts capabilities on
+.Fa fd
+to only those needed by POSIX stream objects (that is, FILEs).
+.Pp
+The following flags can be provided:
+.Pp
+.Bl -tag -width "CAPH_IGNORE_EBADF" -compact -offset indent
+.It Dv CAPH_IGNORE_EBADF
+Do not return an error if file descriptor is invalid.
+.It Dv CAPH_READ
+Set CAP_READ on limited descriptor.
+.It Dv CAPH_WRITE
+Set CAP_WRITE on limited descriptor.
+.El
+.Pp
+.Fn caph_limit_stdin ,
+.Fn caph_limit_stderr
+and
+.Fn caph_limit_stdout
+limit standard descriptors using the
+.Nm caph_limit_stream
+function.
+.Pp
+.Fn caph_limit_stdio
+limits stdin, stderr and stdout.
+.Pp
+.Fn caph_cache_tzdata
+precaches all timezone data needed to use
+.Li libc
+local time functions.
+.Pp
+.Fn caph_cache_catpages
+caches Native Language Support (NLS) data.
+NLS data is used for localized error printing by
+.Xr strerror 3
+and
+.Xr err 3 ,
+among others.
+.Ed
+.Sh SEE ALSO
+.Xr cap_enter 2 ,
+.Xr rights 4
___
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: r306725 - head/sbin/clri

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 20:01:09 2016
New Revision: 306725
URL: https://svnweb.freebsd.org/changeset/base/306725

Log:
  Add history section for clri(8)
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/man/man8/clri.8
  
  PR:   212438
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/clri/clri.8

Modified: head/sbin/clri/clri.8
==
--- head/sbin/clri/clri.8   Wed Oct  5 19:56:10 2016(r306724)
+++ head/sbin/clri/clri.8   Wed Oct  5 20:01:09 2016(r306725)
@@ -28,7 +28,7 @@
 .\"@(#)clri.8  8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd April 19, 1994
+.Dd October 5, 2016
 .Dt CLRI 8
 .Os
 .Sh NAME
@@ -70,6 +70,11 @@ will be able to clean up the resulting m
 .Sh SEE ALSO
 .Xr fsck 8 ,
 .Xr fsdb 8
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.At v6 .
 .Sh BUGS
 If the file is open, the work of
 .Nm
___
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: r306724 - head/sbin/bsdlabel

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:56:10 2016
New Revision: 306724
URL: https://svnweb.freebsd.org/changeset/base/306724

Log:
  Add history section for bsdlabel(8)
  
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Tahoe/usr/man/cat8/disklabel.0
  Remove tab after space, highlighted by igor
  
  PR:   212436
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/bsdlabel/bsdlabel.8

Modified: head/sbin/bsdlabel/bsdlabel.8
==
--- head/sbin/bsdlabel/bsdlabel.8   Wed Oct  5 19:49:48 2016
(r306723)
+++ head/sbin/bsdlabel/bsdlabel.8   Wed Oct  5 19:56:10 2016
(r306724)
@@ -31,7 +31,7 @@
 .\"@(#)disklabel.8 8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2013
+.Dd October 5, 2016
 .Dt BSDLABEL 8
 .Os
 .Sh NAME
@@ -466,7 +466,7 @@ which could be used as a source file for
 
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
-  a:   400M   164.2BSD 4096 1638475# (Cyl.0 - 812*)
+  a:   400M   164.2BSD 4096 1638475# (Cyl.0 - 812*)
   b: 1G*  swap
   c:  **unused
   e: 204800*4.2BSD
@@ -500,3 +500,8 @@ are not generally compatible.
 .Xr boot0cfg 8 ,
 .Xr gpart 8 ,
 .Xr newfs 8
+.Sh HISTORY
+The
+.Nm disklabel
+utility appeared in
+.Bx 4.3 Tahoe .
___
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: r306723 - head/sbin/atm/atmconfig

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:49:48 2016
New Revision: 306723
URL: https://svnweb.freebsd.org/changeset/base/306723

Log:
  Add history section for atmconfig(8)
  
  PR:   212415
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/sbin/atm/atmconfig/atmconfig.8

Modified: head/sbin/atm/atmconfig/atmconfig.8
==
--- head/sbin/atm/atmconfig/atmconfig.8 Wed Oct  5 19:47:02 2016
(r306722)
+++ head/sbin/atm/atmconfig/atmconfig.8 Wed Oct  5 19:49:48 2016
(r306723)
@@ -1,7 +1,7 @@
 .\"
 .\" Copyright (c) 2001-2003
 .\"Fraunhofer Institute for Open Communication Systems (FhG Fokus).
-.\"All rights reserved.
+.\"All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 11, 2003
+.Dd October 5, 2016
 .Dt ATMCONFIG 8
 .Os
 .Sh NAME
@@ -314,5 +314,10 @@ List all NATM routes.
 .Sh SEE ALSO
 .Xr natm 4 ,
 .Xr natmip 4
+.Sh HISTORY
+An
+.Nm
+command appeared in
+.Fx 3.0 .
 .Sh AUTHORS
 .An Hartmut Brandt Aq Mt ha...@freebsd.org
___
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: r306722 - head/bin/test

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:47:02 2016
New Revision: 306722
URL: https://svnweb.freebsd.org/changeset/base/306722

Log:
  Add history section for test(1)
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/test.c
  
  PR:   211789
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/test/test.1

Modified: head/bin/test/test.1
==
--- head/bin/test/test.1Wed Oct  5 19:37:46 2016(r306721)
+++ head/bin/test/test.1Wed Oct  5 19:47:02 2016(r306722)
@@ -32,7 +32,7 @@
 .\" @(#)test.1 8.1 (Berkeley) 5/31/93
 .\" $FreeBSD$
 .\"
-.Dd June 1, 2013
+.Dd October 5, 2016
 .Dt TEST 1
 .Os
 .Sh NAME
@@ -376,6 +376,11 @@ The primaries
 and
 .Fl O
 are extensions.
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.At v7 .
 .Sh BUGS
 Both sides are always evaluated in
 .Fl a
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306721 - head/bin/stty

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:37:46 2016
New Revision: 306721
URL: https://svnweb.freebsd.org/changeset/base/306721

Log:
  Add history section for stty(1)
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/stty.1
  
  PR:   211788
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/stty/stty.1

Modified: head/bin/stty/stty.1
==
--- head/bin/stty/stty.1Wed Oct  5 19:31:29 2016(r306720)
+++ head/bin/stty/stty.1Wed Oct  5 19:37:46 2016(r306721)
@@ -32,7 +32,7 @@
 .\" @(#)stty.1 8.4 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd August 23, 2008
+.Dd October 5, 2016
 .Dt STTY 1
 .Os
 .Sh NAME
@@ -601,3 +601,8 @@ and
 .Fl f
 are
 extensions to the standard.
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v2 .
___
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: r306720 - head/bin/pwd

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:31:29 2016
New Revision: 306720
URL: https://svnweb.freebsd.org/changeset/base/306720

Log:
  Add history section of pwd(1)
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s2/pwd.c
  
  PR:   211787
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/pwd/pwd.1

Modified: head/bin/pwd/pwd.1
==
--- head/bin/pwd/pwd.1  Wed Oct  5 19:26:35 2016(r306719)
+++ head/bin/pwd/pwd.1  Wed Oct  5 19:31:29 2016(r306720)
@@ -32,7 +32,7 @@
 .\" @(#)pwd.1  8.2 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2003
+.Dd October 5, 2016
 .Dt PWD 1
 .Os
 .Sh NAME
@@ -85,6 +85,11 @@ The
 .Nm
 utility conforms to
 .St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Nm 
+command appeared in
+.At v5 .
 .Sh BUGS
 In
 .Xr csh 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306719 - head/bin/expr

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:26:35 2016
New Revision: 306719
URL: https://svnweb.freebsd.org/changeset/base/306719

Log:
  Document origins of expr & authors
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/usr/man/man1/expr.1
  
  PR:   173979
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/expr/expr.1

Modified: head/bin/expr/expr.1
==
--- head/bin/expr/expr.1Wed Oct  5 19:16:55 2016(r306718)
+++ head/bin/expr/expr.1Wed Oct  5 19:26:35 2016(r306719)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2012
+.Dd October 5, 2016
 .Dt EXPR 1
 .Os
 .Sh NAME
@@ -309,3 +309,19 @@ these arguments are treated just as thei
 The
 .Fl e
 flag is an extension.
+.Sh HISTORY
+An
+.Nm
+utility first appeared in the Programmer's Workbench (PWB/UNIX).
+A public domain version of
+.Nm
+written by
+.An Pace Willisson Aq Mt p...@blitz.com
+appeared in
+.Bx 386 0.1 .
+.Sh AUTHORS
+Initial implementation by
+.An Pace Willisson Aq Mt p...@blitz.com
+was largely rewritten by
+.An -nosplit
+.An J.T. Conklin Aq Mt j...@freebsd.org .
___
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: r306718 - head/bin/echo

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 19:16:55 2016
New Revision: 306718
URL: https://svnweb.freebsd.org/changeset/base/306718

Log:
  Add history section for echo(1)
  Sourced using the draft copy of the second edition manual
  
http://www.tuhs.org/Archive/PDP-11/Distributions/research/1972_stuff/unix_2nd_edition_manual.pdf
  
  PR:   211785
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/echo/echo.1

Modified: head/bin/echo/echo.1
==
--- head/bin/echo/echo.1Wed Oct  5 19:09:27 2016(r306717)
+++ head/bin/echo/echo.1Wed Oct  5 19:16:55 2016(r306718)
@@ -32,7 +32,7 @@
 .\"@(#)echo.1  8.1 (Berkeley) 7/22/93
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2010
+.Dd October 5, 2016
 .Dt ECHO 1
 .Os
 .Sh NAME
@@ -103,3 +103,8 @@ The
 utility conforms to
 .St -p1003.1-2001
 as amended by Cor.\& 1-2002.
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.At v2 .
___
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: r306717 - head/sys/arm/ti/cpsw

2016-10-05 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Oct  5 19:09:27 2016
New Revision: 306717
URL: https://svnweb.freebsd.org/changeset/base/306717

Log:
  if_cpsw overhaul:
  
  - Fix RX and TX teardown:
. TX teardown would not reclaim the abandoned descriptors;
. Interrupt storms in RX teardown;
. Fixed the acknowledge of the teardown completion interrupt.
  
  - Remove temporary lists for the descriptors;
  
  - Simplified the descriptor handling (less writes and reads from
descriptors where possible);
  
  - Better debug;
  
  - Add support for the RX threshold interrupts:
With interrupt moderation only, an RX overrun is likely to happen.  The
RX threshold is set to trigger a non paced interrupt everytime your RX
free buffers are under the minimum threshold, helping to prevent the rx
overrun.
  
  The NIC now survive when pushed over its limits (where previously it would
  lock up in a few seconds).
  
  uFW (600MHz SoC) can now forward up to 560Mb/s of UDP traffic (netmap
  pkt-gen as source and sink).  TCP forwarding rate is over 350Mb/s.
  
  No difference (other than CPU use) was seen on Beaglebone black (1GHz SoC)
  for his fast ethernet.
  
  Tested on:uFW, BBB
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/cpsw/if_cpswreg.h
  head/sys/arm/ti/cpsw/if_cpswvar.h

Modified: head/sys/arm/ti/cpsw/if_cpsw.c
==
--- head/sys/arm/ti/cpsw/if_cpsw.c  Wed Oct  5 19:01:00 2016
(r306716)
+++ head/sys/arm/ti/cpsw/if_cpsw.c  Wed Oct  5 19:09:27 2016
(r306717)
@@ -336,6 +336,8 @@ cpsw_debugf(const char *fmt, ...)
bus_write_region_4(sc->mem_res, slot->bd_offset, (uint32_t *) val, 4)
 #definecpsw_cpdma_write_bd_next(sc, slot, next_slot)   
\
cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot))
+#definecpsw_cpdma_write_bd_flags(sc, slot, val)
\
+   bus_write_2(sc->mem_res, slot->bd_offset + 14, val)
 #definecpsw_cpdma_read_bd_flags(sc, slot)  
\
bus_read_2(sc->mem_res, slot->bd_offset + 14)
 #definecpsw_write_hdp_slot(sc, queue, slot)
\
@@ -383,7 +385,8 @@ cpsw_dump_slot(struct cpsw_softc *sc, st
int i;
 
cpsw_cpdma_read_bd(sc, slot, );
-   printf("BD Addr: 0x%08x   Next: 0x%08x\n", cpsw_cpdma_bd_paddr(sc, 
slot), bd.next);
+   printf("BD Addr : 0x%08x   Next  : 0x%08x\n",
+   cpsw_cpdma_bd_paddr(sc, slot), bd.next);
printf("  BufPtr: 0x%08x   BufLen: 0x%08x\n", bd.bufptr, bd.buflen);
printf("  BufOff: 0x%08x   PktLen: 0x%08x\n", bd.bufoff, bd.pktlen);
printf("  Flags: ");
@@ -417,7 +420,7 @@ cpsw_dump_queue(struct cpsw_softc *sc, s
int others = 0;
 
STAILQ_FOREACH(slot, q, next) {
-   if (i > 4)
+   if (i > CPSW_TXFRAGS)
++others;
else
cpsw_dump_slot(sc, slot);
@@ -581,16 +584,14 @@ cpsw_init(struct cpsw_softc *sc)
/* Enable statistics for ports 0, 1 and 2 */
cpsw_write_4(sc, CPSW_SS_STAT_PORT_EN, 7);
 
-   /* Experiment:  Turn off flow control */
-   /* This seems to fix the watchdog resets that have plagued
-  earlier versions of this driver; I'm not yet sure if there
-  are negative effects yet. */
+   /* Turn off flow control. */
cpsw_write_4(sc, CPSW_SS_FLOW_CONTROL, 0);
 
/* Make IP hdr aligned with 4 */
cpsw_write_4(sc, CPSW_CPDMA_RX_BUFFER_OFFSET, 2);
 
/* Initialize RX Buffer Descriptors */
+   cpsw_write_4(sc, CPSW_CPDMA_RX_PENDTHRESH(0), 0);
cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), 0);
 
/* Enable TX & RX DMA */
@@ -607,7 +608,8 @@ cpsw_init(struct cpsw_softc *sc)
cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3);
 
/* Enable interrupts for RX and TX on Channel 0 */
-   cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1);
+   cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET,
+   CPSW_CPDMA_RX_INT(0) | CPSW_CPDMA_RX_INT_THRESH(0));
cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_SET, 1);
 
/* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */
@@ -625,6 +627,8 @@ cpsw_init(struct cpsw_softc *sc)
if (slot != NULL)
cpsw_write_hdp_slot(sc, >rx, slot);
cpsw_rx_enqueue(sc);
+   cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len);
+   cpsw_write_4(sc, CPSW_CPDMA_RX_PENDTHRESH(0), CPSW_TXFRAGS);
 
/* Activate network interface. */
sc->rx.running = 1;
@@ -1154,58 +1158,52 @@ cpsw_shutdown(device_t dev)
 }
 
 static void
-cpsw_rx_teardown_locked(struct cpsw_softc *sc)
+cpsw_rx_teardown(struct cpsw_softc *sc)
 {
-   struct ifnet *ifp;
-   struct mbuf *received, *next;
int i = 0;
 
+   

svn commit: r306716 - head/share/man/man9

2016-10-05 Thread Mariusz Zaborski
Author: oshogbo
Date: Wed Oct  5 19:01:00 2016
New Revision: 306716
URL: https://svnweb.freebsd.org/changeset/base/306716

Log:
  Add man page for dnvlist.
  
  Submitted by: Adam Starak 
  Reviewed by:  cem, wblock

Added:
  head/share/man/man9/dnv.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Oct  5 18:38:38 2016
(r306715)
+++ head/share/man/man9/MakefileWed Oct  5 19:01:00 2016
(r306716)
@@ -114,6 +114,7 @@ MAN=accept_filter.9 \
devstat.9 \
devtoname.9 \
disk.9 \
+   dnv.9 \
domain.9 \
drbr.9 \
driver.9 \
@@ -761,6 +762,19 @@ MLINKS+=disk.9 disk_alloc.9 \
disk.9 disk_destroy.9 \
disk.9 disk_gone.9 \
disk.9 disk_resize.9
+MLINKS+=dnv.9 dnvlist.9 \
+   dnv.9 dnvlist_get_binary.9 \
+   dnv.9 dnvlist_get_bool.9 \
+   dnv.9 dnvlist_get_descriptor.9 \
+   dnv.9 dnvlist_get_number.9 \
+   dnv.9 dnvlist_get_nvlist.9 \
+   dnv.9 dnvlist_get_string.9 \
+   dnv.9 dnvlist_take_binary.9 \
+   dnv.9 dnvlist_take_bool.9 \
+   dnv.9 dnvlist_take_descriptor.9 \
+   dnv.9 dnvlist_take_number.9 \
+   dnv.9 dnvlist_take_nvlist.9 \
+   dnv.9 dnvlist_take_string.9
 MLINKS+=domain.9 DOMAIN_SET.9 \
domain.9 domain_add.9 \
domain.9 pfctlinput.9 \

Added: head/share/man/man9/dnv.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/dnv.9   Wed Oct  5 19:01:00 2016(r306716)
@@ -0,0 +1,116 @@
+.\"
+.\" Copyright (c) 2016 Adam Starak 
+.\" 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 July 26, 2016
+.Dt DNV 9
+.Os
+.Sh NAME
+.Nm dnvlist_get,
+.Nm dnvlist_take,
+.Nd "API for getting name/value pairs. Nonexistent pairs do not raise an 
error."
+.Sh LIBRARY
+.Lb libnv
+.Sh SYNOPSIS
+.In sys/dnv.h
+.Ft bool
+.Fn dnvlist_get_bool "const nvlist_t *nvl" "const char *name" "bool defval"
+.Ft uint64_t
+.Fn dnvlist_get_number "const nvlist_t *nvl" "const char *name" "uint64_t 
defval"
+.Ft char *
+.Fn dnvlist_get_string "const nvlist_t *nvl" "const char *name" "const char 
*defval"
+.Ft nvlist_t *
+.Fn dnvlist_get_nvlist "const nvlist_t *nvl" "const char *name" "nvlist_t 
*defval"
+.Ft int
+.Fn dnvlist_get_descriptor "const nvlist_t *nvl" "const char *name" "int 
defval"
+.Ft void *
+.Fn dnvlist_get_binary "const nvlist_t *nvl" "const char *name" "size_t 
*sizep" "void *defval" "size_t defsize"
+.Ft bool
+.Fn dnvlist_take_bool "const nvlist_t *nvl" "const char *name" "bool defval"
+.Ft uint64_t
+.Fn dnvlist_take_number "const nvlist_t *nvl" "const char *name" "uint64_t 
defval"
+.Ft char *
+.Fn dnvlist_take_string "const nvlist_t *nvl" "const char *name" "const char 
*defval"
+.Ft nvlist_t *
+.Fn dnvlist_take_nvlist "const nvlist_t *nvl" "const char *name" "nvlist_t 
*defval"
+.Ft int
+.Fn dnvlist_take_descriptor "const nvlist_t *nvl" "const char *name" "int 
defval"
+.Ft void *
+.Fn dnvlist_take_binary "const nvlist_t *nvl" "const char *name" "size_t 
*sizep" "void *defval" "size_t defsize"
+.Sh DESCRIPTION
+The
+.Nm libnv
+library permits easy management of name/value pairs and can send and receive
+them over sockets.
+For more information, also see
+.Xr nv 9 .
+.Pp
+The
+.Nm dnvlist_get
+family of functions returns the value associated with the specified name.
+If an element of the specified name does not 

svn commit: r306715 - head/bin/dd

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 18:38:38 2016
New Revision: 306715
URL: https://svnweb.freebsd.org/changeset/base/306715

Log:
  Add history section for dd(1)
  First version of UNIX to include dd found using TUHS
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c
  
  PR:   211777
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/dd/dd.1

Modified: head/bin/dd/dd.1
==
--- head/bin/dd/dd.1Wed Oct  5 18:26:39 2016(r306714)
+++ head/bin/dd/dd.1Wed Oct  5 18:38:38 2016(r306715)
@@ -32,7 +32,7 @@
 .\" @(#)dd.1   8.2 (Berkeley) 1/13/94
 .\" $FreeBSD$
 .\"
-.Dd August 25, 2016
+.Dd October 5, 2016
 .Dt DD 1
 .Os
 .Sh NAME
@@ -447,6 +447,11 @@ and
 values are extensions to the
 .Tn POSIX
 standard.
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v5 .
 .Sh BUGS
 Protection mechanisms in the
 .Xr geom 4
___
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: r306714 - head/bin/chio

2016-10-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Wed Oct  5 18:26:39 2016
New Revision: 306714
URL: https://svnweb.freebsd.org/changeset/base/306714

Log:
  Document where chio(1) originated from & which version of FreeBSD first 
included it.
  
  PR:   211776
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8104

Modified:
  head/bin/chio/chio.1

Modified: head/bin/chio/chio.1
==
--- head/bin/chio/chio.1Wed Oct  5 18:03:17 2016(r306713)
+++ head/bin/chio/chio.1Wed Oct  5 18:26:39 2016(r306714)
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 2, 2016
+.Dd October 5, 2016
 .Dt CHIO 1
 .Os
 .Sh NAME
@@ -287,6 +287,14 @@ Configure the changer to use picker 2 (t
 .Sh SEE ALSO
 .Xr mt 1 ,
 .Xr mount 8
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.Nx 1.3 .
+.Nm
+first appeared in
+.Fx 2.2 .
 .Sh AUTHORS
 .An -nosplit
 The
___
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: r306712 - head/sys/vm

2016-10-05 Thread Alan Cox
Author: alc
Date: Wed Oct  5 17:32:06 2016
New Revision: 306712
URL: https://svnweb.freebsd.org/changeset/base/306712

Log:
  Make the page daemon's notion of what kind of pass is being performed
  by vm_pageout_scan() local to vm_pageout_worker().  There is no reason
  to store the pass in the NUMA domain structure.
  
  Reviewed by:  kib
  MFC after:3 weeks

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Oct  5 17:26:32 2016(r306711)
+++ head/sys/vm/vm_page.c   Wed Oct  5 17:32:06 2016(r306712)
@@ -394,7 +394,6 @@ vm_page_domain_init(struct vm_domain *vm
vmd->vmd_free_count = 0;
vmd->vmd_segs = 0;
vmd->vmd_oom = FALSE;
-   vmd->vmd_pass = 0;
for (i = 0; i < PQ_COUNT; i++) {
pq = >vmd_pagequeues[i];
TAILQ_INIT(>pq_pl);
@@ -3928,14 +3927,12 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag
db_printf("pq_free %d pq_cache %d\n",
vm_cnt.v_free_count, vm_cnt.v_cache_count);
for (dom = 0; dom < vm_ndomains; dom++) {
-   db_printf(
-   "dom %d page_cnt %d free %d pq_act %d pq_inact %d pass %d\n",
+   db_printf("dom %d page_cnt %d free %d pq_act %d pq_inact %d\n",
dom,
vm_dom[dom].vmd_page_count,
vm_dom[dom].vmd_free_count,
vm_dom[dom].vmd_pagequeues[PQ_ACTIVE].pq_cnt,
-   vm_dom[dom].vmd_pagequeues[PQ_INACTIVE].pq_cnt,
-   vm_dom[dom].vmd_pass);
+   vm_dom[dom].vmd_pagequeues[PQ_INACTIVE].pq_cnt);
}
 }
 

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Wed Oct  5 17:26:32 2016(r306711)
+++ head/sys/vm/vm_page.h   Wed Oct  5 17:32:06 2016(r306712)
@@ -226,7 +226,6 @@ struct vm_domain {
u_int vmd_free_count;
long vmd_segs;  /* bitmask of the segments */
boolean_t vmd_oom;
-   int vmd_pass;   /* local pagedaemon pass */
int vmd_oom_seq;
int vmd_last_active_scan;
struct vm_page vmd_marker; /* marker for pagedaemon private use */

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cWed Oct  5 17:26:32 2016(r306711)
+++ head/sys/vm/vm_pageout.cWed Oct  5 17:32:06 2016(r306712)
@@ -1509,11 +1509,12 @@ static void
 vm_pageout_worker(void *arg)
 {
struct vm_domain *domain;
-   int domidx;
+   int domidx, pass;
bool target_met;
 
domidx = (uintptr_t)arg;
domain = _dom[domidx];
+   pass = 0;
target_met = true;
 
/*
@@ -1575,9 +1576,9 @@ vm_pageout_worker(void *arg)
 * and try again later.
 */
mtx_unlock(_page_queue_free_mtx);
-   if (domain->vmd_pass > 1)
+   if (pass > 1)
pause("psleep", hz / 2);
-   domain->vmd_pass++;
+   pass++;
} else {
/*
 * Yes.  Sleep until pages need to be reclaimed or
@@ -1587,12 +1588,12 @@ vm_pageout_worker(void *arg)
_page_queue_free_mtx, PDROP | PVM, "psleep",
hz) == 0) {
PCPU_INC(cnt.v_pdwakeups);
-   domain->vmd_pass = 1;
+   pass = 1;
} else
-   domain->vmd_pass = 0;
+   pass = 0;
}
 
-   target_met = vm_pageout_scan(domain, domain->vmd_pass);
+   target_met = vm_pageout_scan(domain, pass);
}
 }
 
___
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: r306710 - head/sys/cam

2016-10-05 Thread Mark Johnston
Author: markj
Date: Wed Oct  5 17:18:24 2016
New Revision: 306710
URL: https://svnweb.freebsd.org/changeset/base/306710

Log:
  CAM ccbq sanity: checks on insert and remove
  
  KASSERT in cam_ccbq_insert_ccb that only XPT_FC_QUEUED ops are queued,
  and XPT_FC_USER_CCB ops are not. Otherwise cam_ccbq_ccb_done may be
  skipped.
  
  Bounds check the index used for camq_remove in order to panic instead
  of scribble on removal of an out-of-bounds index (e.g. consider the
  effect of camq_remove of CAM_UNQUEUED_INDEX).
  
  KASSERT in cam_ccbq_remove_ccb that the ccb removed by index was the
  one sought.
  
  Submitted by: Ryan Libby 
  Reviewed by:  imp, mav
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8151

Modified:
  head/sys/cam/cam_queue.c
  head/sys/cam/cam_queue.h

Modified: head/sys/cam/cam_queue.c
==
--- head/sys/cam/cam_queue.cWed Oct  5 17:04:58 2016(r306709)
+++ head/sys/cam/cam_queue.cWed Oct  5 17:18:24 2016(r306710)
@@ -176,8 +176,11 @@ camq_remove(struct camq *queue, int inde
 {
cam_pinfo *removed_entry;
 
-   if (index == 0 || index > queue->entries)
-   return (NULL);
+   if (index <= 0 || index > queue->entries)
+   panic("%s: Attempt to remove out-of-bounds index %d "
+   "from queue %p of size %d", __func__, index, queue,
+   queue->entries);
+
removed_entry = queue->queue_array[index];
if (queue->entries != index) {
queue->queue_array[index] = queue->queue_array[queue->entries];

Modified: head/sys/cam/cam_queue.h
==
--- head/sys/cam/cam_queue.hWed Oct  5 17:04:58 2016(r306709)
+++ head/sys/cam/cam_queue.hWed Oct  5 17:18:24 2016(r306710)
@@ -197,6 +197,11 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb
struct ccb_hdr *old_ccb;
struct camq *queue = >queue;
 
+   KASSERT((new_ccb->ccb_h.func_code & XPT_FC_QUEUED) != 0 &&
+   (new_ccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0,
+   ("%s: Cannot queue ccb %p func_code %#x", __func__, new_ccb,
+new_ccb->ccb_h.func_code));
+
/*
 * If queue is already full, try to resize.
 * If resize fail, push CCB with lowest priority out to the TAILQ.
@@ -218,6 +223,7 @@ cam_ccbq_remove_ccb(struct cam_ccbq *ccb
 {
struct ccb_hdr *cccb, *bccb;
struct camq *queue = >queue;
+   cam_pinfo *removed_entry __unused;
 
/* If the CCB is on the TAILQ, remove it from there. */
if (ccb->ccb_h.pinfo.index == CAM_EXTRAQ_INDEX) {
@@ -228,7 +234,10 @@ cam_ccbq_remove_ccb(struct cam_ccbq *ccb
return;
}
 
-   camq_remove(queue, ccb->ccb_h.pinfo.index);
+   removed_entry = camq_remove(queue, ccb->ccb_h.pinfo.index);
+   KASSERT(removed_entry == >ccb_h.pinfo,
+   ("%s: Removed wrong entry from queue (%p != %p)", __func__,
+removed_entry, >ccb_h.pinfo));
 
/*
 * If there are some CCBs on TAILQ, find the best one and move it
___
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: r306709 - in head/lib/msun: ld80 src

2016-10-05 Thread Ed Maste
Author: emaste
Date: Wed Oct  5 17:04:58 2016
New Revision: 306709
URL: https://svnweb.freebsd.org/changeset/base/306709

Log:
  libm: remove unused variables
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/msun/ld80/e_lgammal_r.c
  head/lib/msun/src/e_lgammaf_r.c

Modified: head/lib/msun/ld80/e_lgammal_r.c
==
--- head/lib/msun/ld80/e_lgammal_r.cWed Oct  5 17:03:22 2016
(r306708)
+++ head/lib/msun/ld80/e_lgammal_r.cWed Oct  5 17:04:58 2016
(r306709)
@@ -249,7 +249,7 @@ sin_pil(long double x)
 long double
 lgammal_r(long double x, int *signgamp)
 {
-   long double nadj,p,p1,p2,p3,q,r,t,w,y,z;
+   long double nadj,p,p1,p2,q,r,t,w,y,z;
uint64_t lx;
int i;
uint16_t hx,ix;

Modified: head/lib/msun/src/e_lgammaf_r.c
==
--- head/lib/msun/src/e_lgammaf_r.c Wed Oct  5 17:03:22 2016
(r306708)
+++ head/lib/msun/src/e_lgammaf_r.c Wed Oct  5 17:04:58 2016
(r306709)
@@ -122,7 +122,7 @@ sin_pif(float x)
 float
 __ieee754_lgammaf_r(float x, int *signgamp)
 {
-   float nadj,p,p1,p2,p3,q,r,t,w,y,z;
+   float nadj,p,p1,p2,q,r,t,w,y,z;
int32_t hx;
int i,ix;
 
___
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: r306708 - head/lib/libc/stdlib

2016-10-05 Thread Ed Maste
Author: emaste
Date: Wed Oct  5 17:03:22 2016
New Revision: 306708
URL: https://svnweb.freebsd.org/changeset/base/306708

Log:
  abort in srandomdev if kern.arandom sysctl fails
  
  The sysctl cannot fail. If it does fail on some FreeBSD derivative or
  after some future change, just abort() so that the problem will be found
  and fixed.
  
  While abort() is not normally suitable for a library, it makes sense
  here.
  
  This is akin to r306636 for arc4random.
  
  Reviewed by:  ed
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8077

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

Modified: head/lib/libc/stdlib/random.c
==
--- head/lib/libc/stdlib/random.c   Wed Oct  5 16:23:02 2016
(r306707)
+++ head/lib/libc/stdlib/random.c   Wed Oct  5 17:03:22 2016
(r306708)
@@ -270,16 +270,17 @@ void
 srandomdev(void)
 {
int mib[2];
-   size_t len;
+   size_t expected, len;
 
if (rand_type == TYPE_0)
-   len = sizeof(state[0]);
+   expected = len = sizeof(state[0]);
else
-   len = rand_deg * sizeof(state[0]);
+   expected = len = rand_deg * sizeof(state[0]);
 
mib[0] = CTL_KERN;
mib[1] = KERN_ARND;
-   sysctl(mib, 2, state, , NULL, 0);
+   if (sysctl(mib, 2, state, , NULL, 0) == -1 || len != expected)
+   abort();
 
if (rand_type != TYPE_0) {
fptr = [rand_sep];
___
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: r306707 - head/lib/libcasper/libcasper

2016-10-05 Thread Mariusz Zaborski
Author: oshogbo
Date: Wed Oct  5 16:23:02 2016
New Revision: 306707
URL: https://svnweb.freebsd.org/changeset/base/306707

Log:
  Fix naming in Casper man page.

Modified:
  head/lib/libcasper/libcasper/libcasper.3

Modified: head/lib/libcasper/libcasper/libcasper.3
==
--- head/lib/libcasper/libcasper/libcasper.3Wed Oct  5 16:15:26 2016
(r306706)
+++ head/lib/libcasper/libcasper/libcasper.3Wed Oct  5 16:23:02 2016
(r306707)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2016
+.Dd October 5, 2016
 .Dt LIBCASPER 3
 .Os
 .Sh NAME
@@ -75,7 +75,7 @@
 .Fn cap_service_open "const cap_channel_t *chan" "const char *name"
 .Sh DESCRIPTION
 The
-.Nm libcapsicum
+.Nm libcasper
 library allows to manage application capabilities through the casper process.
 .Pp
 The application capability (represented by the
___
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: r306706 - head/sys/vm

2016-10-05 Thread Alan Cox
Author: alc
Date: Wed Oct  5 16:15:26 2016
New Revision: 306706
URL: https://svnweb.freebsd.org/changeset/base/306706

Log:
  Change vm_pageout_scan() to return a value indicating whether the free page
  target was met.
  
  Previously, vm_pageout_worker() itself checked the length of the free page
  queues to determine whether vm_pageout_scan(pass >= 1)'s inactive queue scan
  freed enough pages to meet the free page target.  Specifically,
  vm_pageout_worker() used vm_paging_needed().  The trouble with
  vm_paging_needed() is that it compares the length of the free page queues to
  the wakeup threshold for the page daemon, which is much lower than the free
  page target.  Consequently, vm_pageout_worker() could conclude that the
  inactive queue scan succeeded in meeting its free page target when in fact
  it did not; and rather than immediately triggering an all-out laundering
  pass over the inactive queue, vm_pageout_worker() would go back to sleep
  waiting for the free page count to fall below the page daemon wakeup
  threshold again, at which point it will perform another limited (pass == 1)
  scan over the inactive queue.
  
  Changing vm_pageout_worker() to use vm_page_count_target() instead of
  vm_paging_needed() won't work because any page allocations that happen
  concurrently with the inactive queue scan will result in the free page count
  being below the target at the end of a successful scan.  Instead, having
  vm_pageout_scan() return a value indicating success or failure is the most
  straightforward fix.
  
  Reviewed by:  kib, markj
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8111

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cWed Oct  5 14:00:05 2016(r306705)
+++ head/sys/vm/vm_pageout.cWed Oct  5 16:15:26 2016(r306706)
@@ -121,7 +121,7 @@ static void vm_pageout(void);
 static void vm_pageout_init(void);
 static int vm_pageout_clean(vm_page_t m);
 static int vm_pageout_cluster(vm_page_t m);
-static void vm_pageout_scan(struct vm_domain *vmd, int pass);
+static bool vm_pageout_scan(struct vm_domain *vmd, int pass);
 static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage,
 int starting_page_shortage);
 
@@ -845,17 +845,20 @@ unlock_mp:
  * pass 0 - Update active LRU/deactivate pages
  * pass 1 - Free inactive pages
  * pass 2 - Launder dirty pages
+ *
+ * Returns true if pass was zero or enough pages were freed by the inactive
+ * queue scan to meet the target.
  */
-static void
+static bool
 vm_pageout_scan(struct vm_domain *vmd, int pass)
 {
vm_page_t m, next;
struct vm_pagequeue *pq;
vm_object_t object;
long min_scan;
-   int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan;
-   int page_shortage, scan_tick, scanned, starting_page_shortage;
-   int vnodes_skipped;
+   int act_delta, addl_page_shortage, deficit, error, inactq_shortage;
+   int maxlaunder, maxscan, page_shortage, scan_tick, scanned;
+   int starting_page_shortage, vnodes_skipped;
boolean_t pageout_ok, queue_locked;
 
/*
@@ -886,7 +889,9 @@ vm_pageout_scan(struct vm_domain *vmd, i
addl_page_shortage = 0;
 
/*
-* Calculate the number of pages that we want to free.
+* Calculate the number of pages that we want to free.  This number
+* can be negative if many pages are freed between the wakeup call to
+* the page daemon and this calculation.
 */
if (pass > 0) {
deficit = atomic_readandclear_int(_pageout_deficit);
@@ -956,7 +961,7 @@ vm_pageout_scan(struct vm_domain *vmd, i
 * Held pages are essentially stuck in the
 * queue.  So, they ought to be discounted
 * from the inactive count.  See the
-* calculation of the page_shortage for the
+* calculation of inactq_shortage before the
 * loop over the active queue below.
 */
addl_page_shortage++;
@@ -1164,7 +1169,7 @@ relock_queue:
 * Compute the number of pages we want to try to move from the
 * active queue to the inactive queue.
 */
-   page_shortage = vm_cnt.v_inactive_target - vm_cnt.v_inactive_count +
+   inactq_shortage = vm_cnt.v_inactive_target - vm_cnt.v_inactive_count +
vm_paging_target() + deficit + addl_page_shortage;
 
pq = >vmd_pagequeues[PQ_ACTIVE];
@@ -1182,7 +1187,7 @@ relock_queue:
min_scan /= hz * vm_pageout_update_period;
} else
min_scan = 0;
-   if (min_scan > 0 || (page_shortage > 0 && maxscan > 0))
+   if (min_scan > 0 || 

svn commit: r306705 - head/sys/arm/include

2016-10-05 Thread Andrew Turner
Author: andrew
Date: Wed Oct  5 14:00:05 2016
New Revision: 306705
URL: https://svnweb.freebsd.org/changeset/base/306705

Log:
  We don't use cpu_control on armv6, remove the macro there.

Modified:
  head/sys/arm/include/cpufunc.h

Modified: head/sys/arm/include/cpufunc.h
==
--- head/sys/arm/include/cpufunc.h  Wed Oct  5 12:19:09 2016
(r306704)
+++ head/sys/arm/include/cpufunc.h  Wed Oct  5 14:00:05 2016
(r306705)
@@ -168,10 +168,8 @@ extern u_int cputype;
 
 #if __ARM_ARCH < 6
 #definecpu_cpwait()cpufuncs.cf_cpwait()
-#endif
 
 #define cpu_control(c, e)  cpufuncs.cf_control(c, e)
-#if __ARM_ARCH < 6
 #define cpu_setttb(t)  cpufuncs.cf_setttb(t)
 
 #definecpu_tlb_flushID()   cpufuncs.cf_tlb_flushID()
@@ -190,6 +188,7 @@ extern u_int cputype;
 #definecpu_idcache_wbinv_all() cpufuncs.cf_idcache_wbinv_all()
 #definecpu_idcache_wbinv_range(a, s) 
cpufuncs.cf_idcache_wbinv_range((a), (s))
 #endif
+
 #define cpu_l2cache_wbinv_all()cpufuncs.cf_l2cache_wbinv_all()
 #define cpu_l2cache_wb_range(a, s) cpufuncs.cf_l2cache_wb_range((a), (s))
 #define cpu_l2cache_inv_range(a, s) cpufuncs.cf_l2cache_inv_range((a), (s))
___
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: r306704 - in head/sys/arm: arm include

2016-10-05 Thread Michal Meloun
Author: mmel
Date: Wed Oct  5 12:19:09 2016
New Revision: 306704
URL: https://svnweb.freebsd.org/changeset/base/306704

Log:
  ARM: Remove next bunch of unused cpu_functions from ARMv6.

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/include/cpufunc.h

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Wed Oct  5 12:17:43 2016(r306703)
+++ head/sys/arm/arm/cpufunc.c  Wed Oct  5 12:19:09 2016(r306704)
@@ -242,9 +242,6 @@ struct cpu_functions sheeva_cpufuncs = {
 
 #ifdef CPU_MV_PJ4B
 struct cpu_functions pj4bv7_cpufuncs = {
-   /* MMU functions */
-   .cf_control = cpufunc_control,
-   .cf_setttb = armv7_setttb,
 
/* Cache operations */
.cf_l2cache_wbinv_all = (void *)cpufunc_nullop,
@@ -254,7 +251,6 @@ struct cpu_functions pj4bv7_cpufuncs = {
.cf_l2cache_drain_writebuf = (void *)cpufunc_nullop,
 
/* Other functions */
-   .cf_drain_writebuf = armv7_drain_writebuf,
.cf_sleep = (void *)cpufunc_nullop,
 
/* Soft functions */
@@ -418,9 +414,6 @@ struct cpu_functions fa526_cpufuncs = {
 
 #if defined(CPU_ARM1176)
 struct cpu_functions arm1176_cpufuncs = {
-   /* MMU functions */
-   .cf_control = cpufunc_control,
-   .cf_setttb = arm11x6_setttb,
 
/* Cache operations */
.cf_l2cache_wbinv_all = (void *)cpufunc_nullop,
@@ -430,7 +423,6 @@ struct cpu_functions arm1176_cpufuncs = 
.cf_l2cache_drain_writebuf = (void *)cpufunc_nullop,
 
/* Other functions */
-   .cf_drain_writebuf = arm11_drain_writebuf,
.cf_sleep = arm11x6_sleep, 
 
/* Soft functions */
@@ -440,9 +432,6 @@ struct cpu_functions arm1176_cpufuncs = 
 
 #if defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT)
 struct cpu_functions cortexa_cpufuncs = {
-   /* MMU functions */
-   .cf_control = cpufunc_control,
-   .cf_setttb = armv7_setttb,
 
/* Cache operations */
 
@@ -457,7 +446,6 @@ struct cpu_functions cortexa_cpufuncs = 
.cf_l2cache_drain_writebuf = (void *)cpufunc_nullop,
 
/* Other functions */
-   .cf_drain_writebuf = armv7_drain_writebuf,
.cf_sleep = armv7_cpu_sleep,
 
/* Soft functions */

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Wed Oct  5 12:17:43 2016(r306703)
+++ head/sys/arm/arm/machdep.c  Wed Oct  5 12:19:09 2016(r306704)
@@ -412,7 +412,7 @@ arm_vector_init(vm_offset_t va, int whic
icache_sync(va, (ARM_NVEC * 2) * sizeof(u_int));
 
vector_page = va;
-
+#if __ARM_ARCH < 6
if (va == ARM_VECTORS_HIGH) {
/*
 * Enable high vectors in the system control reg (SCTLR).
@@ -427,6 +427,7 @@ arm_vector_init(vm_offset_t va, int whic
 */
cpu_control(CPU_CONTROL_VECRELOC, CPU_CONTROL_VECRELOC);
}
+#endif
 }
 
 static void

Modified: head/sys/arm/include/cpufunc.h
==
--- head/sys/arm/include/cpufunc.h  Wed Oct  5 12:17:43 2016
(r306703)
+++ head/sys/arm/include/cpufunc.h  Wed Oct  5 12:19:09 2016
(r306704)
@@ -61,14 +61,12 @@ struct cpu_functions {
/* CPU functions */
 #if __ARM_ARCH < 6
void(*cf_cpwait)(void);
-#endif
 
/* MMU functions */
 
u_int   (*cf_control)   (u_int bic, u_int eor);
void(*cf_setttb)(u_int ttb);
 
-#if __ARM_ARCH < 6
/* TLB functions */
 
void(*cf_tlb_flushID)   (void);
@@ -150,7 +148,9 @@ struct cpu_functions {
 
/* Other functions */
 
+#if __ARM_ARCH < 6
void(*cf_drain_writebuf)(void);
+#endif
 
void(*cf_sleep) (int mode);
 
___
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: r306703 - head/sys/conf

2016-10-05 Thread Michal Meloun
Author: mmel
Date: Wed Oct  5 12:17:43 2016
New Revision: 306703
URL: https://svnweb.freebsd.org/changeset/base/306703

Log:
  ARM: Disconnect elf_trampoline.c from ARMv6 build.
  The trampoline code never functioned properly for Cortex CPUs,
  and its functionality is already provided by ubldr.

Modified:
  head/sys/conf/Makefile.arm

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Wed Oct  5 04:40:48 2016(r306702)
+++ head/sys/conf/Makefile.arm  Wed Oct  5 12:17:43 2016(r306703)
@@ -74,7 +74,7 @@ FILES_CPU_FUNC = \
$S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \
$S/$M/$M/cpufunc_asm_armv7.S
 
-.if defined(KERNPHYSADDR)
+.if ${TARGET_ARCH} != "armv6" && defined(KERNPHYSADDR)
 KERNEL_EXTRA=trampoline
 KERNEL_EXTRA_INSTALL=kernel.gz.tramp
 trampoline: ${KERNEL_KO}.tramp
___
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"