svn commit: r307550 - head/usr.bin/mkimg

2016-10-17 Thread Warner Losh
Author: imp
Date: Tue Oct 18 05:43:12 2016
New Revision: 307550
URL: https://svnweb.freebsd.org/changeset/base/307550

Log:
  Add a new flag to mkimg (-a num) to specify the active partition for
  those partitioning schemes that have this concept. Implement it as an
  override for mbr's setting 0x80 in the flags for the first partition
  when we have boot code.
  
  Differential Revision: https://reviews.freebsd.org/D4403

Modified:
  head/usr.bin/mkimg/mbr.c
  head/usr.bin/mkimg/mkimg.1
  head/usr.bin/mkimg/mkimg.c
  head/usr.bin/mkimg/mkimg.h

Modified: head/usr.bin/mkimg/mbr.c
==
--- head/usr.bin/mkimg/mbr.cTue Oct 18 04:02:00 2016(r307549)
+++ head/usr.bin/mkimg/mbr.cTue Oct 18 05:43:12 2016(r307550)
@@ -92,7 +92,12 @@ mbr_write(lba_t imgsz __unused, void *bo
TAILQ_FOREACH(part, , link) {
size = round_track(part->size);
dp = dpbase + part->index;
-   dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0;
+   if (active_partition != 0)
+   dp->dp_flag =
+   (part->index + 1 == active_partition) ? 0x80 : 0;
+   else
+   dp->dp_flag =
+   (part->index == 0 && bootcode != NULL) ? 0x80 : 0;
mbr_chs(>dp_scyl, >dp_shd, >dp_ssect,
part->block);
dp->dp_typ = ALIAS_TYPE2INT(part->type);

Modified: head/usr.bin/mkimg/mkimg.1
==
--- head/usr.bin/mkimg/mkimg.1  Tue Oct 18 04:02:00 2016(r307549)
+++ head/usr.bin/mkimg/mkimg.1  Tue Oct 18 05:43:12 2016(r307550)
@@ -40,6 +40,7 @@
 .Op Fl c Ar capacity
 .Op Fl f Ar format
 .Op Fl o Ar outfile
+.Op Fl a Ar active
 .Op Fl v
 .Op Fl y
 .Op Fl s Ar scheme Op Fl p Ar partition ...
@@ -119,7 +120,7 @@ An empty partition table can be written 
 partitioning scheme with the
 .Fl s
 option, but without specifying any partitions.
-When the size required to for all the partitions is larger than the
+When the size required for all the partitions is larger than the
 given capacity, then the disk image will be larger than the capacity
 given.
 .Pp
@@ -139,6 +140,26 @@ utility will generate predictable values
 .Nm
 utility will create images that are identical.
 .Pp
+The
+.Ar active
+option marks a partition as active, if the partitioning
+scheme supports it.
+Currently, only the
+.Ar mbr
+scheme supports this concept.
+By default,
+.Nm
+will only mark the first partition as active when boot code is
+specified.
+Use the
+.Ar active
+option to override the active partition.
+The number specified corresponds to the number after the 's' in the
+partition's
+.Xr geom 8
+name.
+No partitions are marked active when the value is 0.
+.Pp
 A set of long options exist to query about the
 .Nm
 utility itself.

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Tue Oct 18 04:02:00 2016(r307549)
+++ head/usr.bin/mkimg/mkimg.c  Tue Oct 18 05:43:12 2016(r307550)
@@ -70,6 +70,7 @@ u_int nheads = 1;
 u_int nsecs = 1;
 u_int secsz = 512;
 u_int blksz = 0;
+uint32_t active_partition = 0;
 
 static void
 print_formats(int usage)
@@ -145,6 +146,7 @@ usage(const char *why)
fprintf(stderr, "\t--schemes\t-  list partition schemes\n");
fprintf(stderr, "\t--version\t-  show version information\n");
fputc('\n', stderr);
+   fprintf(stderr, "\t-a \t-  mark num'th partion as active\n");
fprintf(stderr, "\t-b \t-  file containing boot code\n");
fprintf(stderr, "\t-c \t-  capacity (in bytes) of the disk\n");
fprintf(stderr, "\t-f \n");
@@ -468,9 +470,14 @@ main(int argc, char *argv[])
 
bcfd = -1;
outfd = 1;  /* Write to stdout by default */
-   while ((c = getopt_long(argc, argv, "b:c:f:o:p:s:vyH:P:S:T:",
+   while ((c = getopt_long(argc, argv, "a:b:c:f:o:p:s:vyH:P:S:T:",
longopts, NULL)) != -1) {
switch (c) {
+   case 'a':   /* ACTIVE PARTITION, if supported */
+   error = parse_uint32(_partition, 1, 100, optarg);
+   if (error)
+   errc(EX_DATAERR, error, "Partition ordinal");
+   break;
case 'b':   /* BOOT CODE */
if (bcfd != -1)
usage("multiple bootcode given");

Modified: head/usr.bin/mkimg/mkimg.h
==
--- head/usr.bin/mkimg/mkimg.h  Tue Oct 18 04:02:00 2016(r307549)
+++ head/usr.bin/mkimg/mkimg.h  Tue Oct 18 05:43:12 2016(r307550)
@@ -59,6 +59,7 @@ extern u_int nheads;
 extern u_int nsecs;
 extern u_int secsz;

Re: svn commit: r307544 - head/usr.bin/mkimg

2016-10-17 Thread Marcel Moolenaar
On October 17, 2016 at 8:34:11 PM, Ngie Cooper (yaneurab...@gmail.com) wrote:

> On Oct 17, 2016, at 18:55, Marcel Moolenaar  wrote: 
>
*snip*

> +CFLAGS+=-I${SRCTOP}/sys/sys/disk 

Isn't it a better app idea to maintain the disk/ namespace for includes? 
Thanks! 
You mean, add -I${SRCTOP}//sys/sys on the compile line and change the code to 
use #include ?

Unfortunately, that creates conflicts with header files that are included as 
 and match headers we have under sys/sys.




signature.asc
Description: Message signed with OpenPGP using AMPGpg


svn commit: r307549 - in head: sys/modules/dtb/omap4 tools/tools/nanobsd/embedded

2016-10-17 Thread Warner Losh
Author: imp
Date: Tue Oct 18 04:02:00 2016
New Revision: 307549
URL: https://svnweb.freebsd.org/changeset/base/307549

Log:
  Add preliminary support for Raspberry PI3 images to nanobsd.

Added:
  head/sys/modules/dtb/omap4/
  head/sys/modules/dtb/omap4/Makefile   (contents, props changed)
  head/tools/tools/nanobsd/embedded/rpi3.cfg
 - copied, changed from r307548, head/tools/tools/nanobsd/embedded/rpi2.cfg

Added: head/sys/modules/dtb/omap4/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/dtb/omap4/Makefile Tue Oct 18 04:02:00 2016
(r307549)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+# All the dts files for omap4 systems we support.
+DTS=   \
+   omap4-duovero-parlor.dts \
+pandaboard.dts \
+   pandaboard-es.dts
+
+.include 

Copied and modified: head/tools/tools/nanobsd/embedded/rpi3.cfg (from r307548, 
head/tools/tools/nanobsd/embedded/rpi2.cfg)
==
--- head/tools/tools/nanobsd/embedded/rpi2.cfg  Tue Oct 18 04:01:58 2016
(r307548, copy source)
+++ head/tools/tools/nanobsd/embedded/rpi3.cfg  Tue Oct 18 04:02:00 2016
(r307549)
@@ -26,11 +26,10 @@
 # SUCH DAMAGE.
 #
 
-NANO_ARCH=armv6
-NANO_KERNEL=RPI2
+NANO_ARCH=aarch64
+NANO_KERNEL=RPI3
 NANO_DRIVE=mmcsd0
-NANO_NAME=rpi2
-NANO_BOOT_PKG=u-boot-rpi2
-NANO_CPUTYPE=cortex-a7
+NANO_NAME=rpi3
+NANO_BOOT_PKG=u-boot-rpi3
 
 . common   # Pull in common definitions, keep last
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307548 - head/sys/arm/conf

2016-10-17 Thread Warner Losh
Author: imp
Date: Tue Oct 18 04:01:58 2016
New Revision: 307548
URL: https://svnweb.freebsd.org/changeset/base/307548

Log:
  Also include the DTBs in /boot/dtb for omap4 systems.

Modified:
  head/sys/arm/conf/PANDABOARD

Modified: head/sys/arm/conf/PANDABOARD
==
--- head/sys/arm/conf/PANDABOARDTue Oct 18 04:01:56 2016
(r307547)
+++ head/sys/arm/conf/PANDABOARDTue Oct 18 04:01:58 2016
(r307548)
@@ -30,6 +30,8 @@ hints "PANDABOARD.hints"
 include"std.armv6"
 include"../ti/omap4/pandaboard/std.pandaboard"
 
+makeoptionsMODULES_OVERRIDE=dtb/omap4
+
 optionsSCHED_ULE   # ULE scheduler
 optionsPLATFORM
 optionsSMP # Enable multiple cores
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307547 - head/tools/tools/nanobsd/embedded

2016-10-17 Thread Warner Losh
Author: imp
Date: Tue Oct 18 04:01:56 2016
New Revision: 307547
URL: https://svnweb.freebsd.org/changeset/base/307547

Log:
  Add support for building pandaboard images with nanobsd.

Added:
  head/tools/tools/nanobsd/embedded/pandaboard.cfg   (contents, props changed)

Added: head/tools/tools/nanobsd/embedded/pandaboard.cfg
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/nanobsd/embedded/pandaboard.cfgTue Oct 18 04:01:56 
2016(r307547)
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2016 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL iXsystems, Inc. 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.
+#
+
+NANO_ARCH=armv6
+NANO_KERNEL=PANDABOARD
+NANO_DRIVE=mmcsd0
+NANO_NAME=pandaboard
+NANO_BOOT_PKG=u-boot-pandaboard
+NANO_CPUTYPE=cortex-a9
+
+. common   # Pull in common definitions, keep last
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307546 - head/tools/tools/nanobsd/embedded

2016-10-17 Thread Warner Losh
Author: imp
Date: Tue Oct 18 04:01:54 2016
New Revision: 307546
URL: https://svnweb.freebsd.org/changeset/base/307546

Log:
  Skip the checks in mtools. They are false positive for errors.

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonTue Oct 18 02:40:25 2016
(r307545)
+++ head/tools/tools/nanobsd/embedded/commonTue Oct 18 04:01:54 2016
(r307546)
@@ -207,6 +207,8 @@ create_diskimage_mbr ( ) (
(
local extra i sz fmt fmtarg bootmbr bootbsd skiparg
set -o xtrace
+   # Tell mtools not to be too picky
+   export MTOOLS_SKIP_CHECK=1
 
[ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}"
[ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307544 - head/usr.bin/mkimg

2016-10-17 Thread Ngie Cooper

> On Oct 17, 2016, at 18:55, Marcel Moolenaar  wrote:
> 
> Author: marcel
> Date: Tue Oct 18 01:55:07 2016
> New Revision: 307544
> URL: https://svnweb.freebsd.org/changeset/base/307544
> 
> Log:
>   o  Provide a private definition for UUIDs (mkimg_uuid_t) because
>  UUIDs are not portable.
>   o  Move mkimg_uuid() to a new file and merge both gpt_uuid_enc()
>  and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives
>  in the same file.
>   o  Move the OS-specific implementation of generating a UUID to
>  osdep_uuidgen() and provide the implementations for FreeBSD,
>  macOS and Linux.
>   o  Expect the partitioning scheme headers to be found by having
>  a search to the directory in which the headers live. This
>  avoids conflicts on non-FreeBSD machines.
> 
> Added:
>  head/usr.bin/mkimg/uuid.c   (contents, props changed)
> Modified:
>  head/usr.bin/mkimg/Makefile
>  head/usr.bin/mkimg/apm.c
>  head/usr.bin/mkimg/bsd.c
>  head/usr.bin/mkimg/ebr.c
>  head/usr.bin/mkimg/gpt.c
>  head/usr.bin/mkimg/mbr.c
>  head/usr.bin/mkimg/mkimg.c
>  head/usr.bin/mkimg/mkimg.h
>  head/usr.bin/mkimg/pc98.c
>  head/usr.bin/mkimg/vhd.c
>  head/usr.bin/mkimg/vtoc8.c
> 
> Modified: head/usr.bin/mkimg/Makefile
> ==
> --- head/usr.bin/mkimg/MakefileTue Oct 18 01:42:42 2016(r307543)
> +++ head/usr.bin/mkimg/MakefileTue Oct 18 01:55:07 2016(r307544)
> @@ -3,15 +3,15 @@
> .include 
> 
> PROG=mkimg
> -SRCS=format.c image.c mkimg.c scheme.c
> +SRCS=format.c image.c mkimg.c scheme.c uuid.c
> MAN=mkimg.1
> 
> -MKIMG_VERSION=20151211
> +MKIMG_VERSION=20161016
> mkimg.o: Makefile
> 
> CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}
> CFLAGS+=-DSPARSE_WRITE
> -CFLAGS+=-I${.CURDIR:H:H}/sys
> +CFLAGS+=-I${SRCTOP}/sys/sys/disk

Isn't it a better app idea to maintain the disk/ namespace for includes?
Thanks!
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307545 - head/sys/netinet

2016-10-17 Thread Hiren Panchasara
Author: hiren
Date: Tue Oct 18 02:40:25 2016
New Revision: 307545
URL: https://svnweb.freebsd.org/changeset/base/307545

Log:
  Make sure tcp_mss() has the same check as tcp_mss_update() to have t_maxseg 
set
  to at least 64.
  
  This is still just a coverup to avoid kernel panic and not an actual fix.
  
  PR:   213232
  Reviewed by:  glebius
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D8272

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Oct 18 01:55:07 2016
(r307544)
+++ head/sys/netinet/tcp_input.cTue Oct 18 02:40:25 2016
(r307545)
@@ -3758,7 +3758,15 @@ tcp_mss(struct tcpcb *tp, int offer)
(void)sbreserve_locked(>so_snd, bufsize, so, NULL);
}
SOCKBUF_UNLOCK(>so_snd);
-   tp->t_maxseg = mss;
+   /*
+* Sanity check: make sure that maxseg will be large
+* enough to allow some data on segments even if the
+* all the option space is used (40bytes).  Otherwise
+* funny things may happen in tcp_output.
+*
+* XXXGL: shouldn't we reserve space for IP/IPv6 options?
+*/
+   tp->t_maxseg = max(mss, 64);
 
SOCKBUF_LOCK(>so_rcv);
if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307544 - head/usr.bin/mkimg

2016-10-17 Thread Marcel Moolenaar
Author: marcel
Date: Tue Oct 18 01:55:07 2016
New Revision: 307544
URL: https://svnweb.freebsd.org/changeset/base/307544

Log:
   o  Provide a private definition for UUIDs (mkimg_uuid_t) because
  UUIDs are not portable.
   o  Move mkimg_uuid() to a new file and merge both gpt_uuid_enc()
  and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives
  in the same file.
   o  Move the OS-specific implementation of generating a UUID to
  osdep_uuidgen() and provide the implementations for FreeBSD,
  macOS and Linux.
   o  Expect the partitioning scheme headers to be found by having
  a search to the directory in which the headers live. This
  avoids conflicts on non-FreeBSD machines.

Added:
  head/usr.bin/mkimg/uuid.c   (contents, props changed)
Modified:
  head/usr.bin/mkimg/Makefile
  head/usr.bin/mkimg/apm.c
  head/usr.bin/mkimg/bsd.c
  head/usr.bin/mkimg/ebr.c
  head/usr.bin/mkimg/gpt.c
  head/usr.bin/mkimg/mbr.c
  head/usr.bin/mkimg/mkimg.c
  head/usr.bin/mkimg/mkimg.h
  head/usr.bin/mkimg/pc98.c
  head/usr.bin/mkimg/vhd.c
  head/usr.bin/mkimg/vtoc8.c

Modified: head/usr.bin/mkimg/Makefile
==
--- head/usr.bin/mkimg/Makefile Tue Oct 18 01:42:42 2016(r307543)
+++ head/usr.bin/mkimg/Makefile Tue Oct 18 01:55:07 2016(r307544)
@@ -3,15 +3,15 @@
 .include 
 
 PROG=  mkimg
-SRCS=  format.c image.c mkimg.c scheme.c
+SRCS=  format.c image.c mkimg.c scheme.c uuid.c
 MAN=   mkimg.1
 
-MKIMG_VERSION=20151211
+MKIMG_VERSION=20161016
 mkimg.o: Makefile
 
 CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}
 CFLAGS+=-DSPARSE_WRITE
-CFLAGS+=-I${.CURDIR:H:H}/sys
+CFLAGS+=-I${SRCTOP}/sys/sys/disk
 
 # List of formats to support
 SRCS+= \

Modified: head/usr.bin/mkimg/apm.c
==
--- head/usr.bin/mkimg/apm.cTue Oct 18 01:42:42 2016(r307543)
+++ head/usr.bin/mkimg/apm.cTue Oct 18 01:55:07 2016(r307544)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "endian.h"
 #include "image.h"

Modified: head/usr.bin/mkimg/bsd.c
==
--- head/usr.bin/mkimg/bsd.cTue Oct 18 01:42:42 2016(r307543)
+++ head/usr.bin/mkimg/bsd.cTue Oct 18 01:55:07 2016(r307544)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "endian.h"
 #include "image.h"

Modified: head/usr.bin/mkimg/ebr.c
==
--- head/usr.bin/mkimg/ebr.cTue Oct 18 01:42:42 2016(r307543)
+++ head/usr.bin/mkimg/ebr.cTue Oct 18 01:55:07 2016(r307544)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "endian.h"
 #include "image.h"

Modified: head/usr.bin/mkimg/gpt.c
==
--- head/usr.bin/mkimg/gpt.cTue Oct 18 01:42:42 2016(r307543)
+++ head/usr.bin/mkimg/gpt.cTue Oct 18 01:55:07 2016(r307544)
@@ -33,26 +33,25 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
-#include 
-#include 
+#include 
+#include 
 
 #include "endian.h"
 #include "image.h"
 #include "mkimg.h"
 #include "scheme.h"
 
-static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI;
-static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
-static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
-static uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS;
-static uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
-static uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
-static uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
-static uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
-static uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
-static uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
+static mkimg_uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI;
+static mkimg_uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
+static mkimg_uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT;
+static mkimg_uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS;
+static mkimg_uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
+static mkimg_uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
+static mkimg_uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
+static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
+static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
+static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
 
 static struct mkimg_alias gpt_aliases[] = {
 {  ALIAS_EFI, ALIAS_PTR2TYPE(_uuid_efi) },
@@ -126,21 +125,6 @@ crc32(const void *buf, size_t sz)
return (crc ^ ~0U);
 }
 
-static void
-gpt_uuid_enc(void *buf, const uuid_t *uuid)
-{
-   uint8_t *p = buf;
-   

svn commit: r307543 - head/share/mk

2016-10-17 Thread Marcel Moolenaar
Author: marcel
Date: Tue Oct 18 01:42:42 2016
New Revision: 307543
URL: https://svnweb.freebsd.org/changeset/base/307543

Log:
  Add LORDER, TSORT and TSORTFLAGS variables and replace the
  hardcoded utility names and tsort flags.

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/sys.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Oct 18 00:55:15 2016(r307542)
+++ head/share/mk/bsd.lib.mkTue Oct 18 01:42:42 2016(r307543)
@@ -178,7 +178,8 @@ _LIBS=  lib${LIB_PRIVATE}${LIB}.a
 lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
@rm -f ${.TARGET}
-   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder 
${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
+   ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
 .endif
 
@@ -193,7 +194,8 @@ CLEANFILES+=${POBJS}
 lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
@${ECHO} building profiled ${LIB} library
@rm -f ${.TARGET}
-   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder 
${POBJS} | tsort -q` ${ARADD}
+   ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \
+   ${LORDER} ${POBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
 .endif
 
@@ -241,7 +243,8 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
 .endif
${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} \
-   `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${SOBJS} | tsort -q` 
${LDADD}
+   `NM='${NM}' NMFLAGS='${NMFLAGS}' ${LORDER} ${SOBJS} | \
+   ${TSORT} ${TSORTFLAGS}` ${LDADD}
 .if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
 .endif

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkTue Oct 18 00:55:15 2016(r307542)
+++ head/share/mk/sys.mkTue Oct 18 01:42:42 2016(r307543)
@@ -229,6 +229,8 @@ LINTLIBFLAGS?=  -cghapbxu -C ${LIB}
 MAKE   ?=  make
 
 .if !defined(%POSIX)
+LORDER ?=  lorder
+
 NM ?=  nm
 NMFLAGS?=
 
@@ -242,6 +244,9 @@ PFLAGS  ?=
 
 RC ?=  f77
 RFLAGS ?=
+
+TSORT  ?=  tsort
+TSORTFLAGS ?=  -q
 .endif
 
 SHELL  ?=  sh
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306864 - head

2016-10-17 Thread Ngie Cooper
On Sat, Oct 8, 2016 at 11:57 AM, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Sat Oct  8 18:57:11 2016
> New Revision: 306864
> URL: https://svnweb.freebsd.org/changeset/base/306864
>
> Log:
>   groff is not needed in the bootstrap tools if the system is built
>   WITHOUT_SHAREDOCS
>
>   MFC after:2 weeks
>
> Modified:
>   head/Makefile.inc1

   This breaks buildworld when WITHOUT_GROFF is set and
WITHOUT_SHAREDOCS isn't set.
Thanks,
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307542 - in head/sys: contrib/ncsw/Peripherals/BM contrib/ncsw/Peripherals/QM contrib/ncsw/inc contrib/ncsw/inc/Peripherals contrib/ncsw/user/env dev/dpaa

2016-10-17 Thread Justin Hibbits
Author: jhibbits
Date: Tue Oct 18 00:55:15 2016
New Revision: 307542
URL: https://svnweb.freebsd.org/changeset/base/307542

Log:
  Use proper integer-pointer type conversions.
  
  As part of an effort to extend Book-E to the 64-bit world, make the necessary
  changes to the DPAA/dTSEC driver set to be integer-pointer conversion clean.
  This means no more casts to int, and use uintptr_t where needed.
  
  Since the NCSW source is effectively obsolete, direct changes to the source 
tree
  are safe.

Modified:
  head/sys/contrib/ncsw/Peripherals/BM/bman_low.c
  head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c
  head/sys/contrib/ncsw/Peripherals/QM/qman_low.h
  head/sys/contrib/ncsw/inc/Peripherals/bm_ext.h
  head/sys/contrib/ncsw/inc/Peripherals/fm_ext.h
  head/sys/contrib/ncsw/inc/Peripherals/qm_ext.h
  head/sys/contrib/ncsw/inc/error_ext.h
  head/sys/contrib/ncsw/inc/xx_ext.h
  head/sys/contrib/ncsw/user/env/xx.c
  head/sys/dev/dpaa/bman.c
  head/sys/dev/dpaa/bman_portals.c
  head/sys/dev/dpaa/fman.c
  head/sys/dev/dpaa/portals_common.c
  head/sys/dev/dpaa/qman.c
  head/sys/dev/dpaa/qman_portals.c

Modified: head/sys/contrib/ncsw/Peripherals/BM/bman_low.c
==
--- head/sys/contrib/ncsw/Peripherals/BM/bman_low.c Mon Oct 17 23:25:31 
2016(r307541)
+++ head/sys/contrib/ncsw/Peripherals/BM/bman_low.c Tue Oct 18 00:55:15 
2016(r307542)
@@ -51,45 +51,45 @@
 /***/
 
 /* Cache-inhibited register offsets */
-#define REG_RCR_PI_CINH (void *)0x
-#define REG_RCR_CI_CINH (void *)0x0004
-#define REG_RCR_ITR (void *)0x0008
-#define REG_CFG (void *)0x0100
-#define REG_SCN(n)  ((void *)(0x0200 + ((n) << 2)))
-#define REG_ISR (void *)0x0e00
-#define REG_IER (void *)0x0e04
-#define REG_ISDR(void *)0x0e08
-#define REG_IIR (void *)0x0e0c
+#define REG_RCR_PI_CINH 0x
+#define REG_RCR_CI_CINH 0x0004
+#define REG_RCR_ITR 0x0008
+#define REG_CFG 0x0100
+#define REG_SCN(n)  (0x0200 + ((n) << 2))
+#define REG_ISR 0x0e00
+#define REG_IER 0x0e04
+#define REG_ISDR0x0e08
+#define REG_IIR 0x0e0c
 
 /* Cache-enabled register offsets */
-#define CL_CR   (void *)0x
-#define CL_RR0  (void *)0x0100
-#define CL_RR1  (void *)0x0140
-#define CL_RCR  (void *)0x1000
-#define CL_RCR_PI_CENA  (void *)0x3000
-#define CL_RCR_CI_CENA  (void *)0x3100
+#define CL_CR   0x
+#define CL_RR0  0x0100
+#define CL_RR1  0x0140
+#define CL_RCR  0x1000
+#define CL_RCR_PI_CENA  0x3000
+#define CL_RCR_CI_CENA  0x3100
 
 /* The h/w design requires mappings to be size-aligned so that "add"s can be
  * reduced to "or"s. The primitives below do the same for s/w. */
 
-static __inline__ void *ptr_ADD(void *a, void *b)
+static __inline__ void *ptr_ADD(void *a, uintptr_t b)
 {
-return (void *)((uintptr_t)a + (uintptr_t)b);
+return (void *)((uintptr_t)a + b);
 }
 
 /* Bitwise-OR two pointers */
-static __inline__ void *ptr_OR(void *a, void *b)
+static __inline__ void *ptr_OR(void *a, uintptr_t b)
 {
-return (void *)((uintptr_t)a | (uintptr_t)b);
+return (void *)((uintptr_t)a | b);
 }
 
 /* Cache-inhibited register access */
-static __inline__ uint32_t __bm_in(struct bm_addr *bm, void *offset)
+static __inline__ uint32_t __bm_in(struct bm_addr *bm, uintptr_t offset)
 {
 uint32_t*tmp = (uint32_t *)ptr_ADD(bm->addr_ci, offset);
 return GET_UINT32(*tmp);
 }
-static __inline__ void __bm_out(struct bm_addr *bm, void *offset, uint32_t val)
+static __inline__ void __bm_out(struct bm_addr *bm, uintptr_t offset, uint32_t 
val)
 {
 uint32_t*tmp = (uint32_t *)ptr_ADD(bm->addr_ci, offset);
 WRITE_UINT32(*tmp, val);
@@ -101,26 +101,26 @@ static __inline__ void __bm_out(struct b
 #define bm_cl(n)(void *)((n) << 6)
 
 /* Cache-enabled (index) register access */
-static __inline__ void __bm_cl_touch_ro(struct bm_addr *bm, void *offset)
+static __inline__ void __bm_cl_touch_ro(struct bm_addr *bm, uintptr_t offset)
 {
 dcbt_ro(ptr_ADD(bm->addr_ce, offset));
 }
-static __inline__ void __bm_cl_touch_rw(struct bm_addr *bm, void *offset)
+static __inline__ void __bm_cl_touch_rw(struct bm_addr *bm, uintptr_t offset)
 {
 dcbt_rw(ptr_ADD(bm->addr_ce, offset));
 }
-static __inline__ uint32_t __bm_cl_in(struct bm_addr *bm, void *offset)
+static __inline__ uint32_t __bm_cl_in(struct bm_addr *bm, uintptr_t offset)
 {
 uint32_t*tmp = (uint32_t *)ptr_ADD(bm->addr_ce, offset);
 return GET_UINT32(*tmp);
 }
-static __inline__ void __bm_cl_out(struct bm_addr *bm, void *offset, uint32_t 
val)
+static __inline__ void __bm_cl_out(struct bm_addr *bm, uintptr_t offset, 
uint32_t val)
 {
 uint32_t*tmp = (uint32_t 

svn commit: r307541 - head/sys/netinet6

2016-10-17 Thread George V. Neville-Neil
Author: gnn
Date: Mon Oct 17 23:25:31 2016
New Revision: 307541
URL: https://svnweb.freebsd.org/changeset/base/307541

Log:
  Limit the number of mbufs that can be allocated for IPV6_2292PKTOPTIONS
  (and IPV6_PKTOPTIONS).
  
  PR:   100219
  Submitted by: Joseph Kong
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D5157

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Mon Oct 17 22:57:41 2016
(r307540)
+++ head/sys/netinet6/ip6_output.c  Mon Oct 17 23:25:31 2016
(r307541)
@@ -1393,6 +1393,15 @@ ip6_ctloutput(struct socket *so, struct 
int retval;
 #endif
 
+/*
+ * Don't use more than a quarter of mbuf clusters.  N.B.:
+ * nmbclusters is an int, but nmbclusters * MCLBYTES may overflow
+ * on LP64 architectures, so cast to u_long to avoid undefined
+ * behavior.  ILP32 architectures cannot have nmbclusters
+ * large enough to overflow for other reasons.
+ */
+#define IPV6_PKTOPTIONS_MBUF_LIMIT ((u_long)nmbclusters * MCLBYTES / 4)
+
level = sopt->sopt_level;
op = sopt->sopt_dir;
optname = sopt->sopt_name;
@@ -1448,6 +1457,12 @@ ip6_ctloutput(struct socket *so, struct 
{
struct mbuf *m;
 
+   if (optlen > IPV6_PKTOPTIONS_MBUF_LIMIT) {
+   printf("ip6_ctloutput: mbuf limit 
hit\n");
+   error = ENOBUFS;
+   break;
+   }
+
error = soopt_getm(sopt, ); /* XXX */
if (error != 0)
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307540 - head/sys/amd64/amd64

2016-10-17 Thread Stephen J. Kiernan
Author: stevek
Date: Mon Oct 17 22:57:41 2016
New Revision: 307540
URL: https://svnweb.freebsd.org/changeset/base/307540

Log:
  Add sysctl to make amd64 minidump retry count tunable at runtime.
  
  PR:   213462
  Submitted by: RaviPrakash Darbha 
  Reviewed by:  cemi, markj
  Approved by:  sjg (mentor)
  Obtained from:Juniper Networks
  Differential Revision:https://reviews.freebsd.org/D8254

Modified:
  head/sys/amd64/amd64/minidump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Mon Oct 17 22:48:29 2016
(r307539)
+++ head/sys/amd64/amd64/minidump_machdep.c Mon Oct 17 22:57:41 2016
(r307540)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -68,6 +69,9 @@ static void *dump_va;
 static size_t counter, progress, dumpsize;
 
 CTASSERT(sizeof(*vm_page_dump) == 8);
+static int dump_retry_count = 5;
+SYSCTL_INT(_machdep, OID_AUTO, dump_retry_count, CTLFLAG_RWTUN,
+_retry_count, 0, "Number of times dump has to retry before bailing 
out");
 
 static int
 is_dumpable(vm_paddr_t pa)
@@ -447,7 +451,7 @@ minidumpsys(struct dumperinfo *di)
printf("\n");
if (error == ENOSPC) {
printf("Dump map grown while dumping. ");
-   if (retry_count < 5) {
+   if (retry_count < dump_retry_count) {
printf("Retrying...\n");
goto retry;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307539 - head/release/doc/en_US.ISO8859-1/hardware

2016-10-17 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Mon Oct 17 22:48:29 2016
New Revision: 307539
URL: https://svnweb.freebsd.org/changeset/base/307539

Log:
  Fix relnotes build of supported hardware list after r307529
  
  urtwn is merged into rtwn, so there is not a separate hardware list
  to include anymore.

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

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml
==
--- head/release/doc/en_US.ISO8859-1/hardware/article.xml   Mon Oct 17 
22:37:07 2016(r307538)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.xml   Mon Oct 17 
22:48:29 2016(r307539)
@@ -1013,8 +1013,6 @@
 
   
 
-  
-
   [, , ] Lucent
Technologies WaveLAN/IEEE 802.11b wireless network adapters
and workalikes using the Lucent Hermes, Intersil PRISM-II,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307537 - head/lib/libc/sys

2016-10-17 Thread John Baldwin
Author: jhb
Date: Mon Oct 17 22:36:37 2016
New Revision: 307537
URL: https://svnweb.freebsd.org/changeset/base/307537

Log:
  Use 'cmd' rather than 'command' to match the function prototype.

Modified:
  head/lib/libc/sys/kldsym.2

Modified: head/lib/libc/sys/kldsym.2
==
--- head/lib/libc/sys/kldsym.2  Mon Oct 17 22:34:41 2016(r307536)
+++ head/lib/libc/sys/kldsym.2  Mon Oct 17 22:36:37 2016(r307537)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 26, 2001
+.Dd October 17, 2016
 .Dt KLDSYM 2
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .In sys/param.h
 .In sys/linker.h
 .Ft int
-.Fn kldsym "int fileid" "int command" "void *data"
+.Fn kldsym "int fileid" "int cmd" "void *data"
 .Sh DESCRIPTION
 The
 .Fn kldsym
@@ -48,7 +48,7 @@ If
 .Fa fileid
 is 0, all loaded modules are searched.
 Currently, the only
-.Fa command
+.Fa cmd
 implemented is
 .Dv KLDSYM_LOOKUP .
 .Pp
@@ -96,7 +96,7 @@ system call will fail if:
 Invalid value in
 .Fa data->version
 or
-.Fa command .
+.Fa cmd .
 .It Bq Er ENOENT
 The
 .Fa fileid
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307538 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss

2016-10-17 Thread John Baldwin
Author: jhb
Date: Mon Oct 17 22:37:07 2016
New Revision: 307538
URL: https://svnweb.freebsd.org/changeset/base/307538

Log:
  Move mksubr from kdump into libsysdecode.
  
  Restructure this script so that it generates a header of tables instead
  of a source file.  The tables are included in a flags.c source file which
  provides functions to decode various system call arguments.
  
  For functions that decode an enumeration, the function returns a pointer
  to a string for known values and NULL for unknown values.
  
  For functions that do more complex decoding (typically of a bitmask), the
  function accepts a pointer to a FILE object (open_memstream() can be used
  as a string builder) to which decoded values are written.  If the
  function operates on a bitmask, the function returns true if any bits
  were decoded or false if the entire value was valid.  Additionally, the
  third argument accepts a pointer to a value to which any undecoded bits
  are stored.  This pointer can be NULL if the caller doesn't care about
  remaining bits.
  
  Convert kdump over to using decoder functions from libsysdecode instead of
  mksubr.  truss also uses decoders from libsysdecode instead of private
  lookup tables, though lookup tables for objects not decoded by kdump remain
  in truss for now.  Eventually most of these tables should move into
  libsysdecode as the automated table generation approach from mksubr is
  less stale than the static tables in truss.
  
  Some changes have been made to truss and kdump output:
  - The flags passed to open() are now properly decoded in that one of
O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded
mask.
  - Optional arguments to open(), openat(), and fcntl() are only printed
in kdump if they exist (e.g. the mode is only printed for open() if
O_CREAT is set in the flags).
  - Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int.
  - Include all procctl() commands.
  - Correctly decode pipe2() flags in truss by not assuming full
open()-like flags with O_RDONLY, etc.
  - Decode file flags passed to *chflags() as file flags (UF_* and SF_*)
rather than as a file mode.
  - Fix decoding of quotactl() commands by splitting out the two command
components instead of assuming the raw command value matches the
primary command component.
  
  In addition, truss and kdump now build without triggering any warnings.
  All of the sysdecode manpages now include the required headers in the
  synopsis.
  
  Reviewed by:  kib (several older versions), wblock (manpages)
  MFC after:2 months
  Differential Revision:https://reviews.freebsd.org/D7847

Added:
  head/lib/libsysdecode/flags.c
 - copied, changed from r307534, head/usr.bin/kdump/mksubr
  head/lib/libsysdecode/mktables
 - copied, changed from r307534, head/usr.bin/kdump/mksubr
  head/lib/libsysdecode/signal.c   (contents, props changed)
  head/lib/libsysdecode/sysdecode_cap_rights.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_enum.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_fcntl_arg.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_mask.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_quotactl_cmd.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_sigcode.3   (contents, props changed)
  head/lib/libsysdecode/sysdecode_sockopt_name.3   (contents, props changed)
Deleted:
  head/usr.bin/kdump/mksubr
Modified:
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/errno.c
  head/lib/libsysdecode/mkioctls
  head/lib/libsysdecode/syscallnames.c
  head/lib/libsysdecode/sysdecode.3
  head/lib/libsysdecode/sysdecode.h
  head/lib/libsysdecode/sysdecode_abi_to_freebsd_errno.3
  head/lib/libsysdecode/sysdecode_ioctlname.3
  head/lib/libsysdecode/sysdecode_syscallnames.3
  head/lib/libsysdecode/sysdecode_utrace.3
  head/lib/libsysdecode/utrace.c
  head/usr.bin/kdump/Makefile
  head/usr.bin/kdump/kdump.c
  head/usr.bin/truss/Makefile
  head/usr.bin/truss/aarch64-cloudabi64.c
  head/usr.bin/truss/aarch64-freebsd.c
  head/usr.bin/truss/amd64-cloudabi64.c
  head/usr.bin/truss/amd64-freebsd.c
  head/usr.bin/truss/amd64-freebsd32.c
  head/usr.bin/truss/amd64-linux.c
  head/usr.bin/truss/amd64-linux32.c
  head/usr.bin/truss/arm-freebsd.c
  head/usr.bin/truss/extern.h
  head/usr.bin/truss/i386-freebsd.c
  head/usr.bin/truss/i386-linux.c
  head/usr.bin/truss/main.c
  head/usr.bin/truss/mips-freebsd.c
  head/usr.bin/truss/powerpc-freebsd.c
  head/usr.bin/truss/powerpc64-freebsd.c
  head/usr.bin/truss/powerpc64-freebsd32.c
  head/usr.bin/truss/setup.c
  head/usr.bin/truss/sparc64-freebsd.c
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libsysdecode/Makefile
==
--- head/lib/libsysdecode/Makefile  Mon Oct 17 22:36:37 2016
(r307537)
+++ head/lib/libsysdecode/Makefile  

Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap

2016-10-17 Thread Ed Maste
On 16 October 2016 at 10:13, Luigi Rizzo  wrote:
> Author: luigi
> Date: Sun Oct 16 14:13:32 2016
> New Revision: 307394
> URL: https://svnweb.freebsd.org/changeset/base/307394
>
> Log:
>   Import the current version of netmap, aligned with the one on github.

my tinderbox build failed with this, in sparc64 LINT:

In file included from
/scratch/tmp/emaste/freebsd/sys/modules/em/../../dev/e1000/if_lem.c:343:
/scratch/tmp/emaste/freebsd/sys/dev/netmap/if_lem_netmap.h:42:
warning: redundant redeclaration of 'netmap_adaptive_io'
[-Wredundant-decls]
/scratch/tmp/emaste/freebsd/sys/dev/netmap/netmap_kern.h:1529:
warning: previous declaration of 'netmap_adaptive_io' was here
*** [if_lem.o] Error code 1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap

2016-10-17 Thread John Baldwin
On Sunday, October 16, 2016 02:13:32 PM Luigi Rizzo wrote:
> Author: luigi
> Date: Sun Oct 16 14:13:32 2016
> New Revision: 307394
> URL: https://svnweb.freebsd.org/changeset/base/307394
> 
> Log:
>   Import the current version of netmap, aligned with the one on github.
>   
>   This commit, long overdue, contains contributions in the last 2 years
>   from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
>   + fixes on monitor ports
>   + the 'ptnet' virtual device driver, and ptnetmap backend, for
> high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
>   + improved emulated netmap mode
>   + more robust error handling
>   + removal of stale code
>   + various fixes to code and documentation (some mixup between RX and TX
> parameters, and private and public variables)
>   
>   We also include an additional tool, nmreplay, which is functionally
>   equivalent to tcpreplay but operating on netmap ports.

FYI, this broke the build of the following kernel configs from 'make tinderbox':

sparc64 LINT kernel failed, check _.sparc64.LINT for details
i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details
i386 LINT kernel failed, check _.i386.LINT for details
pc98 LINT kernel failed, check _.pc98.LINT for details
i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details
i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details
i386 LINT-VIMAGE kernel failed, check _.i386.LINT-VIMAGE for details
amd64 LINT kernel failed, check _.amd64.LINT for details
amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details
powerpc LINT kernel failed, check _.powerpc.LINT for details
powerpc LINT64 kernel failed, check _.powerpc.LINT64 for details
amd64 LINT-NOINET6 kernel failed, check _.amd64.LINT-NOINET6 for details
amd64 LINT-NOIP kernel failed, check _.amd64.LINT-NOIP for details
amd64 LINT-VIMAGE kernel failed, check _.amd64.LINT-VIMAGE for details
arm LINT kernel failed, check _.arm.LINT for details

Some of the errors:

(1)

In file included from /zoo/jhb/git/freebsd/sys/modules/em/../../dev/e1000/if_lem
.c:343:
/zoo/jhb/git/freebsd/sys/dev/netmap/if_lem_netmap.h:42: warning: redundant redec
laration of 'netmap_adaptive_io' [-Wredundant-decls]
/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:1529: warning: previous declar

(2)

/zoo/jhb/git/freebsd/sys/dev/netmap/if_ptnet.c:347:15: error: shift count >= wid
th of type [-Werror,-Wshift-count-overflow]
(paddr >> 32) & 0x);
   ^  ~~
/zoo/jhb/git/freebsd/sys/sys/bus.h:882:59: note: expanded from macro 
'bus_write_4'
bus_space_write_4((r)->r_bustag, (r)->r_bushandle, (o), (v))
 ^

For this one I think 'paddr' should be 'uint64_t' instead of 'vm_paddr_t'
which should fix the build on 32-bit platforms.

(3)

/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_pt.c:72:9: error: 'DEBUG' macro 
redefined [-Werror,-Wmacro-redefined]
#define DEBUG  /* Enables communication debugging. */
^
./opt_global.h:40:9: note: previous definition is here
#define DEBUG 1
^

(4)

/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_freebsd.c:671:4: error: format specif
ies type 'unsigned long' but the argument has type 'vm_paddr_t' (aka 'unsigned i
nt') [-Werror,-Wformat]
*nm_paddr,
^
/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:249:29: note: expanded from ma
cro 'D'
__LINE__, __FUNCTION__, ##__VA_ARGS__); \
  ^~~
/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_freebsd.c:672:4: error: format specif
ies type 'unsigned long' but the argument has type 'rman_res_t' (aka 'unsigned l
ong long') [-Werror,-Wformat]
rman_get_size(ptn_dev->pci_mem),
^~~
/zoo/jhb/git/freebsd/sys/dev/netmap/netmap_kern.h:249:29: note: expanded from ma
cro 'D'
__LINE__, __FUNCTION__, ##__VA_ARGS__); \
  ^~~

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


svn commit: r307532 - in head: . share/man/man4

2016-10-17 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Oct 17 21:35:13 2016
New Revision: 307532
URL: https://svnweb.freebsd.org/changeset/base/307532

Log:
  Fix dates + add an UPDATING entry.

Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/share/man/man4/rtwn.4
  head/share/man/man4/rtwn_pci.4
  head/share/man/man4/rtwn_usb.4

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Oct 17 20:57:54 2016(r307531)
+++ head/ObsoleteFiles.inc  Mon Oct 17 21:35:13 2016(r307532)
@@ -38,7 +38,7 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20161016: urtwn(4) was merged into rtwn(4)
+# 20161017: urtwn(4) was merged into rtwn(4)
 OLD_FILES+=usr/share/man/man4/urtwn.4.gz
 OLD_FILES+=usr/share/man/man4/urtwnfw.4.gz
 # 20161015: Remove GNU rcs

Modified: head/UPDATING
==
--- head/UPDATING   Mon Oct 17 20:57:54 2016(r307531)
+++ head/UPDATING   Mon Oct 17 21:35:13 2016(r307532)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20161017:
+   The urtwn(4) driver was merged into rtwn(4) and now consists of
+   rtwn(4) main module + rtwn_usb(4) and rtwn_pci(4) bus-specific
+   parts.
+   Also, firmware for RTL8188CE was renamed due to possible name
+   conflict (rtwnrtl8192cU(B) -> rtwnrtl8192cE(B))
+
 20161015:
GNU rcs has been removed from base.  It is available as packages:
- rcs: Latest GPLv3 GNU rcs version.

Modified: head/share/man/man4/rtwn.4
==
--- head/share/man/man4/rtwn.4  Mon Oct 17 20:57:54 2016(r307531)
+++ head/share/man/man4/rtwn.4  Mon Oct 17 21:35:13 2016(r307532)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 19, 2016
+.Dd October 17, 2016
 .Dt RTWN 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/rtwn_pci.4
==
--- head/share/man/man4/rtwn_pci.4  Mon Oct 17 20:57:54 2016
(r307531)
+++ head/share/man/man4/rtwn_pci.4  Mon Oct 17 21:35:13 2016
(r307532)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd September 19, 2016
+.Dd October 17, 2016
 .Dt RTWN_PCI 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/rtwn_usb.4
==
--- head/share/man/man4/rtwn_usb.4  Mon Oct 17 20:57:54 2016
(r307531)
+++ head/share/man/man4/rtwn_usb.4  Mon Oct 17 21:35:13 2016
(r307532)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd September 19, 2016
+.Dd October 17, 2016
 .Dt RTWN_USB 4
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307531 - head/sys/dev/cxgbe

2016-10-17 Thread Navdeep Parhar
Author: np
Date: Mon Oct 17 20:57:54 2016
New Revision: 307531
URL: https://svnweb.freebsd.org/changeset/base/307531

Log:
  cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg
  with the values displayed.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Oct 17 20:41:12 2016
(r307530)
+++ head/sys/dev/cxgbe/t4_main.cMon Oct 17 20:57:54 2016
(r307531)
@@ -6156,7 +6156,8 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS)
if (sb == NULL)
return (ENOMEM);
 
-   sbuf_printf(sb, "Queue  Base  Size Thres RdPtr WrPtr  SOP  EOP Avail");
+   sbuf_printf(sb,
+   "  Queue  Base  Size Thres  RdPtr WrPtr  SOP  EOP Avail");
 
for (i = 0; i < CIM_NUM_IBQ; i++, p += 4)
sbuf_printf(sb, "\n%7s %5x %5u %5u %6x  %4x %4u %4u %5u",
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307326 - head/sys/boot/efi/loader

2016-10-17 Thread Bruce Simpson

On 17/10/16 21:23, Bruce Simpson wrote:

On 17/10/16 18:40, John Baldwin wrote:

I'm a bit hesitant to do all the type parsing in the kernel vs userland.
However, I think having smbios(4) export a /dev/smbios that you can
either
read() or mmap() to access the table would be very convenient and let you
keep the bits to parse the table in userland (and not require root if we
allow read-only access to mortals on /dev/foo).


This is probably a bit left-field, but I'm wondering if both methods
(expose-to-loader-kenv and user-space-accessible devfs node) can be
re-used for things like the Linux-oriented kernel environment page
exported by SYSLINUX/PXELINUX memdisk, which I've used with some success
to boot FreeBSD installers in heterogeneous private cloud/lab setups.


PS Hit send too soon -- the main reason a FreeBSD installer, or image 
wrapper for a FreeBSD installer tool (akin to the Debian style of 
network driven installer), would need access to the memdisk's ACPI-style 
table (containing boot & textual 'environment' page, filled out by the 
TFTP boot server, perhaps by scripted means) is...


...where it can't intuit all system configuration settings by reference 
to its primary MAC address alone, or where it needs network bootstrap 
information to proceed with other provisioning methods (straight to 
Puppet/Ansible, and/or fetching a list of pkgng pkgs to grab from some 
trusted package server).


The code required would just pretty much resemble what you guys are 
doing for EFI right now, but for BIOS-era systems (of which we've got a 
large installed base, and mass provisioning those would be great, for 
the sake of recycling.)

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


Re: svn commit: r307326 - head/sys/boot/efi/loader

2016-10-17 Thread Bruce Simpson

On 17/10/16 18:40, John Baldwin wrote:

I'm a bit hesitant to do all the type parsing in the kernel vs userland.
However, I think having smbios(4) export a /dev/smbios that you can either
read() or mmap() to access the table would be very convenient and let you
keep the bits to parse the table in userland (and not require root if we
allow read-only access to mortals on /dev/foo).


This is probably a bit left-field, but I'm wondering if both methods 
(expose-to-loader-kenv and user-space-accessible devfs node) can be 
re-used for things like the Linux-oriented kernel environment page 
exported by SYSLINUX/PXELINUX memdisk, which I've used with some success 
to boot FreeBSD installers in heterogeneous private cloud/lab setups.


It exports this information using an ACPI-like table in that BIOS HBA 
type area in x86 address space, but the table is not DSDT linked (it's 
not produced by the BIOS).


Having a coherent means of dealing with it would be very useful, as such 
FreeBSD installers (which I've deployed as mfsBSD images) can then 
basically re-use what's been done for EFI variables for those legacy 
systems which don't support/can't use EFI network boot. As yet, I've not 
tried this with 64-bit EFI systems.


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


Re: svn commit: r307518 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/bhnd/cores/usb dev/puc dev/usb dev/usb/controller

2016-10-17 Thread John Baldwin
On Monday, October 17, 2016 10:20:39 AM Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Oct 17 10:20:38 2016
> New Revision: 307518
> URL: https://svnweb.freebsd.org/changeset/base/307518
> 
> Log:
>   Fix device delete child function.
>   
>   When detaching device trees parent devices must be detached prior to
>   detaching its children. This is because parent devices can have
>   pointers to the child devices in their softcs which are not
>   invalidated by device_delete_child(). This can cause use after free
>   issues and panic().
>   
>   Device drivers implementing trees, must ensure its detach function
>   detaches or deletes all its children before returning.
>   
>   While at it remove now redundant device_detach() calls before
>   device_delete_child() and device_delete_children(), mostly in
>   the USB controller drivers.
>   
>   Tested by:  Jan Henrik Sylvester 
>   Reviewed by:jhb
>   Differential Revision:  https://reviews.freebsd.org/D8070
>   MFC after:  2 weeks

Thanks.

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


Re: svn commit: r307326 - head/sys/boot/efi/loader

2016-10-17 Thread John Baldwin
On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote:
> On Oct 14, 2016 11:55 AM, "Doug Ambrisko"  wrote:
> >
> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote:
> > | -Original Message-
> > | > From:  on behalf of Doug Ambrisko <
> ambri...@ambrisko.com>
> > | > Date: 2016-10-14, Friday at 10:27
> > | > To: Warner Losh 
> > | > Cc: Doug Ambrisko , src-committers <
> src-committ...@freebsd.org>, "svn-src-...@freebsd.org" <
> svn-src-...@freebsd.org>, "svn-src-head@freebsd.org" <
> svn-src-head@freebsd.org>
> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader
> > | >
> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote:
> > | > | Love the functionality, but don't like using the 'hint' namespace
> for
> > | > | this. Can we change it now before too many things depend on it? We
> had
> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move
> > | > | this to the 'smbios' space please?
> > | > |
> > | > | The reason is that 'hint' is special and sometimes filtered out, so
> it
> > | > | is a poor choice to export data from the boot loader to the kernel.
> > | >
> > | > The reason I picked hint was it could be put /boot/device.hints
> > | > to make it work as well and that it was a hint.  Other standards in
> the
> > | > future might use other methods.  Looking back over the email I had
> > | > with John he had suggested hint.smbios.0.anchor to make this look
> > | > different.  This code had been hanging around for so long I forgot
> > | > about that and we were using hint.smbios.0.mem in our shipping code
> base.
> > | >
> > | > However, I hope that nothing would use this except for smbios(4) and
> > | > for people to make smbios(4) useful for this info.
> > |
> > | Doug's looking at me when he says that. :-)
> > |
> > | We talked about this last night at BAFUG; right now, even if smbios(4)
> > | is able to find the SMBIOS info -- it currently only looks at the
> > | aforementioned 0xf - 0xf range, so it can't find it on UEFI --
> > | smbios(4) doesn't actually provide any interface for that information.
> > | Doug and I have talked about making smbios(4) useful, by parsing the
> > | data and providing KPIs and APIs, for years now; I think I'll *finally*
> > | have the time and motivation to do so "soon".
> >
> > I've actually talked to a few people.  However, your the first to
> > step up.  This needs to be designed and will take some time and
> > review.  I would hope that except for smbios(4), nothing else would
> > use this kenv but there is nothing to prevent that :-(  I could name
> > it super_secret_dont_use.
> >
> > BTW, to get you started this patch prevents smbios(4) from blowing chunks
> > when it gets a anchor in high memory and works on legacy machines.
> >
> > --- /sys/x86/bios/smbios.c  2013-10-01 14:28:25.0 -0700
> > +++ ./smbios.c  2016-04-11 11:58:03.234969000 -0700
> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
> >  #include 
> >  #include 
> > @@ -59,7 +60,7 @@ struct smbios_softc {
> >  };
> >
> >  #defineRES2EPS(res)((struct smbios_eps
> *)rman_get_virtual(res))
> > -#defineADDR2EPS(addr)  ((struct smbios_eps
> *)BIOS_PADDRTOVADDR(addr))
> > +#defineADDR2EPS(addr)  ((struct smbios_eps *)PHYS_TO_DMAP(addr))
> >
> >  static devclass_t  smbios_devclass;
> >
> > @@ -71,19 +72,26 @@ static int  smbios_modevent (module_t, in
> >
> >  static int smbios_cksum(struct smbios_eps *);
> >
> > +static unsigned long addr;
> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0,
> > +"SMBIOS driver parameters");
> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW,
> > +, 0, "");
> > +
> >  static void
> >  smbios_identify (driver_t *driver, device_t parent)
> >  {
> > device_t child;
> > -   u_int32_t addr;
> > int length;
> > int rid;
> >
> > if (!device_is_alive(parent))
> > return;
> >
> > -   addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN,
> > - SMBIOS_STEP, SMBIOS_OFF);
> > +   if (resource_long_value("smbios", 0, "mem", ) != 0 ||
> > +   addr == 0)
> > +   addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG,
> SMBIOS_LEN,
> > + SMBIOS_STEP, SMBIOS_OFF);
> > if (addr != 0) {
> > rid = 0;
> > length = ADDR2EPS(addr)->length;
> >
> > Note I don't plan to commit this since it doesn't really do much and we
> > need a lot more.
> 
> I was planning on exporting all smbios stuff via sysctl.

I'm a bit hesitant to do all the type parsing in the kernel vs userland.
However, I think having smbios(4) export a /dev/smbios that you can either
read() or mmap() to access the table would be very 

Re: svn commit: r307386 - in head: etc/mtree include sys/sys sys/sys/disk

2016-10-17 Thread John Baldwin
On Sunday, October 16, 2016 02:43:51 AM Marcel Moolenaar wrote:
> Author: marcel
> Date: Sun Oct 16 02:43:51 2016
> New Revision: 307386
> URL: https://svnweb.freebsd.org/changeset/base/307386
> 
> Log:
>   Re-apply change 306811 or alternatively, revert change 307385.

Thanks!

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


svn commit: r307523 - head/sys/cam/scsi

2016-10-17 Thread Alexander Motin
Author: mav
Date: Mon Oct 17 15:02:17 2016
New Revision: 307523
URL: https://svnweb.freebsd.org/changeset/base/307523

Log:
  Make pass driver better support CAM_CDB_POINTER flag.
  
  Previously pass driver just ignored the flag, making random kernel code
  access user-space pointer, sometime causing crashes even for correctly
  written applications if user-level context was switched or swapped out.
  This patch tries to copyin the CDB into kernel space to avoid it.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_pass.c

Modified: head/sys/cam/scsi/scsi_pass.c
==
--- head/sys/cam/scsi/scsi_pass.c   Mon Oct 17 13:52:24 2016
(r307522)
+++ head/sys/cam/scsi/scsi_pass.c   Mon Oct 17 15:02:17 2016
(r307523)
@@ -1876,6 +1876,18 @@ passdoioctl(struct cdev *dev, u_long cmd
break;
}
 
+   if (ccb->ccb_h.flags & CAM_CDB_POINTER) {
+   if (ccb->csio.cdb_len > IOCDBLEN) {
+   error = EINVAL;
+   break;
+   }
+   error = copyin(ccb->csio.cdb_io.cdb_ptr,
+   ccb->csio.cdb_io.cdb_bytes, ccb->csio.cdb_len);
+   if (error)
+   break;
+   ccb->ccb_h.flags &= ~CAM_CDB_POINTER;
+   }
+
/*
 * Some CCB types, like scan bus and scan lun can only go
 * through the transport layer device.
@@ -2143,6 +2155,7 @@ passsendccb(struct cam_periph *periph, u
 {
struct pass_softc *softc;
struct cam_periph_map_info mapinfo;
+   uint8_t *cmd;
xpt_opcode fc;
int error;
 
@@ -2154,6 +2167,14 @@ passsendccb(struct cam_periph *periph, u
 */
xpt_merge_ccb(ccb, inccb);
 
+   if (ccb->ccb_h.flags & CAM_CDB_POINTER) {
+   cmd = __builtin_alloca(ccb->csio.cdb_len);
+   error = copyin(ccb->csio.cdb_io.cdb_ptr, cmd, 
ccb->csio.cdb_len);
+   if (error)
+   return (error);
+   ccb->csio.cdb_io.cdb_ptr = cmd;
+   }
+
/*
 */
ccb->ccb_h.cbfcnp = passdone;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307522 - head/sys/kern

2016-10-17 Thread Ed Maste
Author: emaste
Date: Mon Oct 17 13:52:24 2016
New Revision: 307522
URL: https://svnweb.freebsd.org/changeset/base/307522

Log:
  makesyscalls.sh: remove trailing space on the "created from" line
  
  In r10905 and r10906 makesyscalls was modified to avoid emitting a
  literal $Id$ string in the generated file, with:
  
  gsub("[$]Id: ", "", $0)
  gsub(" [$]", "", $0)
  
  Then r11294 added some functionality and also tried to address the $Id$
  problem in a different way, by removing every $:
  
  sed -e 's/\$//g ...
  
  This rendered the gsub infeffective. The gsub was later updated to
  track the $Id$ -> $FreeBSD$ switch, even though it did not do anything.
  
  Revert the addition of the s/\$//g, and update the gsub to keep the
  resulting format the same.
  
  Discussed with:   bde
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Mon Oct 17 13:47:22 2016
(r307521)
+++ head/sys/kern/makesyscalls.sh   Mon Oct 17 13:52:24 2016
(r307522)
@@ -65,7 +65,6 @@ if [ -n "$2" ]; then
 fi
 
 sed -e '
-s/\$//g
 :join
/\\$/{a\
 
@@ -147,7 +146,7 @@ s/\$//g
printf " * $%s$\n", "FreeBSD" > systrace
}
NR == 1 {
-   gsub("[$]FreeBSD: ", "", $0)
+   gsub("[$]FreeBSD: ", "FreeBSD: ", $0)
gsub(" [$]", "", $0)
 
printf " * created from%s\n */\n\n", $0 > syssw
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307521 - in head: lib/libmd sys/crypto/sha2 sys/crypto/skein sys/sys

2016-10-17 Thread Ed Maste
Author: emaste
Date: Mon Oct 17 13:47:22 2016
New Revision: 307521
URL: https://svnweb.freebsd.org/changeset/base/307521

Log:
  libmd: introduce functions that operate on an fd instead of filename
  
  Reviewed by:  allanjude, cem
  MFC after:2 months
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8264

Modified:
  head/lib/libmd/md4.h
  head/lib/libmd/md5.h
  head/lib/libmd/mdXhl.c
  head/lib/libmd/ripemd.h
  head/lib/libmd/sha.h
  head/sys/crypto/sha2/sha256.h
  head/sys/crypto/sha2/sha384.h
  head/sys/crypto/sha2/sha512.h
  head/sys/crypto/sha2/sha512t.h
  head/sys/crypto/skein/skein_freebsd.h
  head/sys/crypto/skein/skein_port.h
  head/sys/sys/md5.h

Modified: head/lib/libmd/md4.h
==
--- head/lib/libmd/md4.hMon Oct 17 13:36:50 2016(r307520)
+++ head/lib/libmd/md4.hMon Oct 17 13:47:22 2016(r307521)
@@ -53,6 +53,12 @@ __BEGIN_DECLS
 #ifndef MD4End
 #define MD4End _libmd_MD4End
 #endif
+#ifndef MD4Fd
+#define MD4Fd  _libmd_MD4Fd
+#endif
+#ifndef MD4FdChunk
+#define MD4FdChunk _libmd_MD4FdChunk
+#endif
 #ifndef MD4File
 #define MD4File_libmd_MD4File
 #endif
@@ -68,6 +74,8 @@ void   MD4Update(MD4_CTX *, const void *
 void   MD4Pad(MD4_CTX *);
 void   MD4Final(unsigned char [16], MD4_CTX *);
 char * MD4End(MD4_CTX *, char *);
+char * MD4Fd(int, char *);
+char * MD4FdChunk(int, char *, off_t, off_t);
 char * MD4File(const char *, char *);
 char * MD4FileChunk(const char *, char *, off_t, off_t);
 char * MD4Data(const void *, unsigned int, char *);

Modified: head/lib/libmd/md5.h
==
--- head/lib/libmd/md5.hMon Oct 17 13:36:50 2016(r307520)
+++ head/lib/libmd/md5.hMon Oct 17 13:47:22 2016(r307521)
@@ -25,6 +25,12 @@
 #ifndef MD5End
 #define MD5End _libmd_MD5End
 #endif
+#ifndef MD5Fd
+#define MD5Fd  _libmd_MD5Fd
+#endif
+#ifndef MD5FdChunk
+#define MD5FdChunk _libmd_MD5FdChunk
+#endif
 #ifndef MD5File
 #define MD5File_libmd_MD5File
 #endif

Modified: head/lib/libmd/mdXhl.c
==
--- head/lib/libmd/mdXhl.c  Mon Oct 17 13:36:50 2016(r307520)
+++ head/lib/libmd/mdXhl.c  Mon Oct 17 13:47:22 2016(r307521)
@@ -42,18 +42,18 @@ MDXEnd(MDX_CTX *ctx, char *buf)
 }
 
 char *
-MDXFile(const char *filename, char *buf)
+MDXFd(int fd, char *buf)
 {
-   return (MDXFileChunk(filename, buf, 0, 0));
+   return MDXFdChunk(fd, buf, 0, 0);
 }
 
 char *
-MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len)
+MDXFdChunk(int fd, char *buf, off_t ofs, off_t len)
 {
unsigned char buffer[16*1024];
MDX_CTX ctx;
struct stat stbuf;
-   int fd, readrv, e;
+   int readrv, e;
off_t remain;
 
if (len < 0) {
@@ -62,9 +62,6 @@ MDXFileChunk(const char *filename, char 
}
 
MDXInit();
-   fd = open(filename, O_RDONLY);
-   if (fd < 0)
-   return NULL;
if (ofs != 0) {
errno = 0;
if (lseek(fd, ofs, SEEK_SET) != ofs ||
@@ -86,15 +83,34 @@ MDXFileChunk(const char *filename, char 
remain -= readrv;
} 
 error:
-   e = errno;
-   close(fd);
-   errno = e;
if (readrv < 0)
return NULL;
return (MDXEnd(, buf));
 }
 
 char *
+MDXFile(const char *filename, char *buf)
+{
+   return (MDXFileChunk(filename, buf, 0, 0));
+}
+
+char *
+MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len)
+{
+   char *ret;
+   int e, fd;
+
+   fd = open(filename, O_RDONLY);
+   if (fd < 0)
+   return NULL;
+   ret = MDXFdChunk(fd, buf, ofs, len);
+   e = errno;
+   close (fd);
+   errno = e;
+   return ret;
+}
+
+char *
 MDXData (const void *data, unsigned int len, char *buf)
 {
MDX_CTX ctx;

Modified: head/lib/libmd/ripemd.h
==
--- head/lib/libmd/ripemd.h Mon Oct 17 13:36:50 2016(r307520)
+++ head/lib/libmd/ripemd.h Mon Oct 17 13:47:22 2016(r307521)
@@ -96,6 +96,12 @@ __BEGIN_DECLS
 #ifndef RIPEMD160_End
 #define RIPEMD160_End  _libmd_RIPEMD160_End
 #endif
+#ifndef RIPEMD160_Fd
+#define RIPEMD160_Fd   _libmd_RIPEMD160_Fd
+#endif
+#ifndef RIPEMD160_FdChunk
+#define RIPEMD160_FdChunk  _libmd_RIPEMD160_FdChunk
+#endif
 #ifndef RIPEMD160_File
 #define RIPEMD160_File _libmd_RIPEMD160_File
 #endif
@@ -121,6 +127,8 @@ voidRIPEMD160_Update(RIPEMD160_CTX *c, 
 size_t len);
 void   RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
 char   *RIPEMD160_End(RIPEMD160_CTX *, char *);
+char   *RIPEMD160_Fd(int, char *);

svn commit: r307520 - head/usr.bin/elfdump

2016-10-17 Thread Ed Maste
Author: emaste
Date: Mon Oct 17 13:36:50 2016
New Revision: 307520
URL: https://svnweb.freebsd.org/changeset/base/307520

Log:
  elfdump: correct DT_AUXILIARY / DT_USED / DT_FILTER definitions
  
  r109332 introduced these three as DT_SUNW_*. Update to the correct
  names already used elsewhere in FreeBSD and the Sun "Linker and
  Libraries Guide"
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Mon Oct 17 10:21:53 2016
(r307519)
+++ head/usr.bin/elfdump/elfdump.c  Mon Oct 17 13:36:50 2016
(r307520)
@@ -241,9 +241,9 @@ d_tags(u_int64_t tag)
case 0x6ff0:return "DT_GNU_VERSYM";
/* 0x7000 - 0x7fff processor-specific semantics */
case 0x7000:return "DT_IA_64_PLT_RESERVE";
-   case 0x7ffd:return "DT_SUNW_AUXILIARY";
-   case 0x7ffe:return "DT_SUNW_USED";
-   case 0x7fff:return "DT_SUNW_FILTER";
+   case DT_AUXILIARY:  return "DT_AUXILIARY";
+   case DT_USED:   return "DT_USED";
+   case DT_FILTER: return "DT_FILTER";
}
snprintf(unknown_tag, sizeof(unknown_tag),
"ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307519 - head/bin/pkill/tests

2016-10-17 Thread Ruslan Bukin
Author: br
Date: Mon Oct 17 10:21:53 2016
New Revision: 307519
URL: https://svnweb.freebsd.org/changeset/base/307519

Log:
  Increase timeout so low-end platforms have a chance to complete test
  procedures.
  
  This fixes operation in QEMU/MIPS64.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5

Modified:
  head/bin/pkill/tests/pgrep-j_test.sh

Modified: head/bin/pkill/tests/pgrep-j_test.sh
==
--- head/bin/pkill/tests/pgrep-j_test.shMon Oct 17 10:20:38 2016
(r307518)
+++ head/bin/pkill/tests/pgrep-j_test.shMon Oct 17 10:21:53 2016
(r307519)
@@ -20,12 +20,13 @@ sleep=$(pwd)/sleep.txt
 ln -sf /bin/sleep $sleep
 
 name="pgrep -j "
-sleep_amount=5
+sleep_amount=15
 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
 
 jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
+sleep 0.5
 
 for i in `seq 1 10`; do
jid1=$(jail_name_to_jid ${base}_1_1)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307518 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/bhnd/cores/usb dev/puc dev/usb dev/usb/controller ...

2016-10-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 17 10:20:38 2016
New Revision: 307518
URL: https://svnweb.freebsd.org/changeset/base/307518

Log:
  Fix device delete child function.
  
  When detaching device trees parent devices must be detached prior to
  detaching its children. This is because parent devices can have
  pointers to the child devices in their softcs which are not
  invalidated by device_delete_child(). This can cause use after free
  issues and panic().
  
  Device drivers implementing trees, must ensure its detach function
  detaches or deletes all its children before returning.
  
  While at it remove now redundant device_detach() calls before
  device_delete_child() and device_delete_children(), mostly in
  the USB controller drivers.
  
  Tested by:Jan Henrik Sylvester 
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D8070
  MFC after:2 weeks

Modified:
  head/sys/arm/allwinner/a10_ehci.c
  head/sys/arm/at91/at91_ohci.c
  head/sys/arm/at91/at91_ohci_fdt.c
  head/sys/arm/cavium/cns11xx/ehci_ebus.c
  head/sys/arm/cavium/cns11xx/ohci_ec.c
  head/sys/arm/samsung/exynos/exynos5_xhci.c
  head/sys/arm/ti/am335x/am335x_musb.c
  head/sys/arm/ti/usb/omap_ehci.c
  head/sys/arm/xilinx/zy7_ehci.c
  head/sys/boot/kshim/bsd_kernel.c
  head/sys/dev/bhnd/cores/usb/bhnd_ehci.c
  head/sys/dev/bhnd/cores/usb/bhnd_ohci.c
  head/sys/dev/puc/puc.c
  head/sys/dev/usb/controller/at91dci_atmelarm.c
  head/sys/dev/usb/controller/at91dci_fdt.c
  head/sys/dev/usb/controller/atmegadci_atmelarm.c
  head/sys/dev/usb/controller/dwc_otg_fdt.c
  head/sys/dev/usb/controller/ehci_ixp4xx.c
  head/sys/dev/usb/controller/ehci_mv.c
  head/sys/dev/usb/controller/ehci_pci.c
  head/sys/dev/usb/controller/generic_ehci.c
  head/sys/dev/usb/controller/generic_ohci.c
  head/sys/dev/usb/controller/musb_otg_atmelarm.c
  head/sys/dev/usb/controller/ohci_pci.c
  head/sys/dev/usb/controller/ohci_s3c24x0.c
  head/sys/dev/usb/controller/saf1761_otg_boot.c
  head/sys/dev/usb/controller/saf1761_otg_fdt.c
  head/sys/dev/usb/controller/uhci_pci.c
  head/sys/dev/usb/controller/uss820dci_atmelarm.c
  head/sys/dev/usb/controller/xhci_mv.c
  head/sys/dev/usb/controller/xhci_pci.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/video/udl.c
  head/sys/kern/subr_bus.c
  head/sys/mips/atheros/ar71xx_ehci.c
  head/sys/mips/atheros/ar71xx_ohci.c
  head/sys/mips/cavium/usb/octusb_octeon.c
  head/sys/mips/mediatek/mtk_dotg.c
  head/sys/mips/mediatek/mtk_ehci.c
  head/sys/mips/mediatek/mtk_ohci.c
  head/sys/mips/mediatek/mtk_xhci.c
  head/sys/mips/rmi/xls_ehci.c
  head/sys/mips/rt305x/rt305x_dotg.c
  head/sys/mips/rt305x/rt305x_ehci.c
  head/sys/mips/rt305x/rt305x_ohci.c

Modified: head/sys/arm/allwinner/a10_ehci.c
==
--- head/sys/arm/allwinner/a10_ehci.c   Mon Oct 17 09:40:18 2016
(r307517)
+++ head/sys/arm/allwinner/a10_ehci.c   Mon Oct 17 10:20:38 2016
(r307518)
@@ -275,17 +275,11 @@ a10_ehci_detach(device_t self)
struct aw_ehci_softc *aw_sc = device_get_softc(self);
ehci_softc_t *sc = _sc->sc;
const struct aw_ehci_conf *conf;
-   device_t bdev;
int err;
uint32_t reg_value = 0;
 
conf = USB_CONF(self);
 
-   if (sc->sc_bus.bdev) {
-   bdev = sc->sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(self, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(self);
 

Modified: head/sys/arm/at91/at91_ohci.c
==
--- head/sys/arm/at91/at91_ohci.c   Mon Oct 17 09:40:18 2016
(r307517)
+++ head/sys/arm/at91/at91_ohci.c   Mon Oct 17 10:20:38 2016
(r307518)
@@ -165,14 +165,8 @@ static int
 ohci_atmelarm_detach(device_t dev)
 {
struct at91_ohci_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_ohci.sc_bus.bdev) {
-   bdev = sc->sc_ohci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
/* during module unload there are lots of children leftover */
device_delete_children(dev);
 

Modified: head/sys/arm/at91/at91_ohci_fdt.c
==
--- head/sys/arm/at91/at91_ohci_fdt.c   Mon Oct 17 09:40:18 2016
(r307517)
+++ head/sys/arm/at91/at91_ohci_fdt.c   Mon Oct 17 10:20:38 2016
(r307518)
@@ -171,14 +171,8 @@ static int
 ohci_at91_fdt_detach(device_t dev)
 {
struct at91_ohci_softc *sc = device_get_softc(dev);
-   device_t bdev;
int err;
 
-   if (sc->sc_ohci.sc_bus.bdev) {
-   bdev = sc->sc_ohci.sc_bus.bdev;
-   device_detach(bdev);
-   device_delete_child(dev, bdev);
-   }
  

svn commit: r307517 - head/usr.sbin/bhyve

2016-10-17 Thread Maxim Konovalov
Author: maxim
Date: Mon Oct 17 09:40:18 2016
New Revision: 307517
URL: https://svnweb.freebsd.org/changeset/base/307517

Log:
  Typo fixed: arbitraty -> arbitrary.
  
  PR:   213559
  Submitted by: olgeni

Modified:
  head/usr.sbin/bhyve/bhyve.8

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Mon Oct 17 09:31:49 2016(r307516)
+++ head/usr.sbin/bhyve/bhyve.8 Mon Oct 17 09:40:18 2016(r307517)
@@ -172,7 +172,7 @@ Virtio block storage interface.
 .It Li virtio-rnd
 Virtio RNG interface.
 .It Li ahci
-AHCI controller attached to arbitraty devices.
+AHCI controller attached to arbitrary devices.
 .It Li ahci-cd
 AHCI controller attached to an ATAPI CD/DVD.
 .It Li ahci-hd
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307507 - head/sys/cam/scsi

2016-10-17 Thread Alexander Motin
On 17.10.2016 12:32, Steven Hartland wrote:
> On 17/10/2016 09:51, Alexander Motin wrote:
>> On 17.10.2016 11:45, Steven Hartland wrote:
>>> IIRC the timeout for this was intentionally lower than the default,
>>> might be worth just checking.
>> I did traced back the commit history, and it was hardcoded to that value
>> since the beginning 18 years ago.  Theoretically SYNCHRONIZE CACHE may
>> require even more time then WRITE, since nobody knows how big can be
>> write caches and how many writes are sitting there.
> Cool, must be thinking about something else that was added recently
> then, thanks for checking :)

And still it was my mistake.  Reverted.  Sorry.

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


Re: svn commit: r307507 - head/sys/cam/scsi

2016-10-17 Thread Steven Hartland


On 17/10/2016 09:51, Alexander Motin wrote:

On 17.10.2016 11:45, Steven Hartland wrote:

IIRC the timeout for this was intentionally lower than the default,
might be worth just checking.

I did traced back the commit history, and it was hardcoded to that value
since the beginning 18 years ago.  Theoretically SYNCHRONIZE CACHE may
require even more time then WRITE, since nobody knows how big can be
write caches and how many writes are sitting there.
Cool, must be thinking about something else that was added recently 
then, thanks for checking :)

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


svn commit: r307515 - head/sys/cam/scsi

2016-10-17 Thread Alexander Motin
Author: mav
Date: Mon Oct 17 09:16:44 2016
New Revision: 307515
URL: https://svnweb.freebsd.org/changeset/base/307515

Log:
  Revert timeout part of r307507.
  
  I misread 5 minutes as 5 seconds.  Timeout of 5 minutes may have sense.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:53:12 2016(r307514)
+++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 09:16:44 2016(r307515)
@@ -1488,7 +1488,7 @@ daclose(struct disk *dp)
scsi_synchronize_cache(>csio, /*retries*/1,
/*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG,
/*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE,
-   da_default_timeout * 1000);
+   5 * 60 * 1000);
error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
/*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
softc->disk->d_devstat);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r307507 - head/sys/cam/scsi

2016-10-17 Thread Alexander Motin
On 17.10.2016 11:45, Steven Hartland wrote:
> IIRC the timeout for this was intentionally lower than the default,
> might be worth just checking.

I did traced back the commit history, and it was hardcoded to that value
since the beginning 18 years ago.  Theoretically SYNCHRONIZE CACHE may
require even more time then WRITE, since nobody knows how big can be
write caches and how many writes are sitting there.

> On 17/10/2016 09:35, Alexander Motin wrote:
>> Author: mav
>> Date: Mon Oct 17 08:35:56 2016
>> New Revision: 307507
>> URL: https://svnweb.freebsd.org/changeset/base/307507
>>
>> Log:
>>   Consider device as clean even if SYNCHRONIZE CACHE failed.
>>   
>>   If device reservation was preempted by other initiator, our sync request
>>   will always fail.  Without this change CAM tried to sync cache on every
>>   following device close, including numerous GEOM tasting opens/closes,
>>   causing lots of useless noise in logs.
>>   
>>   While there, increase SYNCHRONIZE CACHE timeout to default value.
>>   
>>   MFC after: 2 weeks
>>
>> Modified:
>>   head/sys/cam/scsi/scsi_da.c
>>
>> Modified: head/sys/cam/scsi/scsi_da.c
>> ==
>> --- head/sys/cam/scsi/scsi_da.c  Mon Oct 17 08:29:16 2016
>> (r307506)
>> +++ head/sys/cam/scsi/scsi_da.c  Mon Oct 17 08:35:56 2016
>> (r307507)
>> @@ -1488,12 +1488,11 @@ daclose(struct disk *dp)
>>  scsi_synchronize_cache(>csio, /*retries*/1,
>>  /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG,
>>  /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE,
>> -5 * 60 * 1000);
>> +da_default_timeout * 1000);
>>  error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
>>  /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
>>  softc->disk->d_devstat);
>> -if (error == 0)
>> -softc->flags &= ~DA_FLAG_DIRTY;
>> +softc->flags &= ~DA_FLAG_DIRTY;
>>  xpt_release_ccb(ccb);
>>  }
>>  
>>
> 

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


Re: svn commit: r307507 - head/sys/cam/scsi

2016-10-17 Thread Steven Hartland
IIRC the timeout for this was intentionally lower than the default, 
might be worth just checking.


On 17/10/2016 09:35, Alexander Motin wrote:

Author: mav
Date: Mon Oct 17 08:35:56 2016
New Revision: 307507
URL: https://svnweb.freebsd.org/changeset/base/307507

Log:
   Consider device as clean even if SYNCHRONIZE CACHE failed.
   
   If device reservation was preempted by other initiator, our sync request

   will always fail.  Without this change CAM tried to sync cache on every
   following device close, including numerous GEOM tasting opens/closes,
   causing lots of useless noise in logs.
   
   While there, increase SYNCHRONIZE CACHE timeout to default value.
   
   MFC after:	2 weeks


Modified:
   head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:29:16 2016(r307506)
+++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:35:56 2016(r307507)
@@ -1488,12 +1488,11 @@ daclose(struct disk *dp)
scsi_synchronize_cache(>csio, /*retries*/1,
/*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG,
/*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE,
-   5 * 60 * 1000);
+   da_default_timeout * 1000);
error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
/*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
softc->disk->d_devstat);
-   if (error == 0)
-   softc->flags &= ~DA_FLAG_DIRTY;
+   softc->flags &= ~DA_FLAG_DIRTY;
xpt_release_ccb(ccb);
}
  



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


svn commit: r307509 - head/sys/cam/ata

2016-10-17 Thread Alexander Motin
Author: mav
Date: Mon Oct 17 08:38:24 2016
New Revision: 307509
URL: https://svnweb.freebsd.org/changeset/base/307509

Log:
  Replicate r307507 for ATA disks.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Mon Oct 17 08:37:19 2016(r307508)
+++ head/sys/cam/ata/ata_da.c   Mon Oct 17 08:38:24 2016(r307509)
@@ -926,8 +926,7 @@ adaclose(struct disk *dp)
 
if (error != 0)
xpt_print(periph->path, "Synchronize cache failed\n");
-   else
-   softc->flags &= ~ADA_FLAG_DIRTY;
+   softc->flags &= ~ADA_FLAG_DIRTY;
xpt_release_ccb(ccb);
cam_periph_unhold(periph);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307507 - head/sys/cam/scsi

2016-10-17 Thread Alexander Motin
Author: mav
Date: Mon Oct 17 08:35:56 2016
New Revision: 307507
URL: https://svnweb.freebsd.org/changeset/base/307507

Log:
  Consider device as clean even if SYNCHRONIZE CACHE failed.
  
  If device reservation was preempted by other initiator, our sync request
  will always fail.  Without this change CAM tried to sync cache on every
  following device close, including numerous GEOM tasting opens/closes,
  causing lots of useless noise in logs.
  
  While there, increase SYNCHRONIZE CACHE timeout to default value.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:29:16 2016(r307506)
+++ head/sys/cam/scsi/scsi_da.c Mon Oct 17 08:35:56 2016(r307507)
@@ -1488,12 +1488,11 @@ daclose(struct disk *dp)
scsi_synchronize_cache(>csio, /*retries*/1,
/*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG,
/*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE,
-   5 * 60 * 1000);
+   da_default_timeout * 1000);
error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
/*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
softc->disk->d_devstat);
-   if (error == 0)
-   softc->flags &= ~DA_FLAG_DIRTY;
+   softc->flags &= ~DA_FLAG_DIRTY;
xpt_release_ccb(ccb);
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307501 - head/sys/vm

2016-10-17 Thread Konstantin Belousov
Author: kib
Date: Mon Oct 17 08:17:06 2016
New Revision: 307501
URL: https://svnweb.freebsd.org/changeset/base/307501

Log:
  If vm_fault_hold(9) finds that fs.m is wired, do not free it after a
  pager error, leave the page to the wire owner.  E.g. the page might be
  a part of the invalidated buffer.
  
  Reported and tested by:   pho
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D8197

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Mon Oct 17 08:16:26 2016(r307500)
+++ head/sys/vm/vm_fault.c  Mon Oct 17 08:17:06 2016(r307501)
@@ -722,7 +722,10 @@ vnode_locked:
 */
if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) {
vm_page_lock(fs.m);
-   vm_page_free(fs.m);
+   if (fs.m->wire_count == 0)
+   vm_page_free(fs.m);
+   else
+   vm_page_xunbusy_maybelocked(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
unlock_and_deallocate();
@@ -742,7 +745,10 @@ vnode_locked:
 */
if (fs.object != fs.first_object) {
vm_page_lock(fs.m);
-   vm_page_free(fs.m);
+   if (fs.m->wire_count == 0)
+   vm_page_free(fs.m);
+   else
+   vm_page_xunbusy_maybelocked(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307499 - head/sys/vm

2016-10-17 Thread Konstantin Belousov
Author: kib
Date: Mon Oct 17 08:14:23 2016
New Revision: 307499
URL: https://svnweb.freebsd.org/changeset/base/307499

Log:
  Export vm_page_xunbusy_maybelocked().
  
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  X-Differential revision:  https://reviews.freebsd.org/D8197

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

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Oct 17 08:10:24 2016(r307498)
+++ head/sys/vm/vm_page.c   Mon Oct 17 08:14:23 2016(r307499)
@@ -794,7 +794,7 @@ vm_page_xunbusy_locked(vm_page_t m)
wakeup(m);
 }
 
-static void
+void
 vm_page_xunbusy_maybelocked(vm_page_t m)
 {
bool lockacq;

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Mon Oct 17 08:10:24 2016(r307498)
+++ head/sys/vm/vm_page.h   Mon Oct 17 08:14:23 2016(r307499)
@@ -495,6 +495,7 @@ boolean_t vm_page_unwire(vm_page_t m, ui
 void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr);
 void vm_page_wire (vm_page_t);
 void vm_page_xunbusy_hard(vm_page_t m);
+void vm_page_xunbusy_maybelocked(vm_page_t m);
 void vm_page_set_validclean (vm_page_t, int, int);
 void vm_page_clear_dirty (vm_page_t, int, int);
 void vm_page_set_invalid (vm_page_t, int, int);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"