svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Eitan Adler
Author: eadler
Date: Wed Apr 30 06:20:48 2014
New Revision: 265132
URL: http://svnweb.freebsd.org/changeset/base/265132

Log:
  Add a /dev/full device.
  
  /dev/full is similar to /dev/zero except it always returns
  ENOSPC when you attempt to write to it.
  
  Reviewed by:  jhibbits
  Discussed with:   rpaulo

Added:
  head/share/man/man4/full.4   (contents, props changed)
Modified:
  head/share/man/man4/null.4
  head/share/man/man4/zero.4
  head/sys/dev/null/null.c

Added: head/share/man/man4/full.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/full.4  Wed Apr 30 06:20:48 2014(r265132)
@@ -0,0 +1,47 @@
+.\ Copyright (c) 2014
+.\Eitan Adler ead...@freebsd.org.  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 March 29, 2014
+.Dt FULL 4
+.Os
+.Sh NAME
+.Nm full
+.Nd the full device
+.Sh DESCRIPTION
+The
+.Nm
+device supplies an endless stream of zeros when read.
+However, it will always be full when writing to it.
+.Sh FILES
+.Bl -tag -width /dev/full
+.It Pa /dev/full
+.El
+.Sh SEE ALSO
+.Xr null 4
+.Xr zero 4
+.Sh Author
+This device and man page was written by
+.An Eitan Adler Aq ead...@freebsd.org .

Modified: head/share/man/man4/null.4
==
--- head/share/man/man4/null.4  Wed Apr 30 06:03:01 2014(r265131)
+++ head/share/man/man4/null.4  Wed Apr 30 06:20:48 2014(r265132)
@@ -48,6 +48,7 @@ device is always zero.
 .It Pa /dev/null
 .El
 .Sh SEE ALSO
+.Xr full 4
 .Xr zero 4
 .Sh HISTORY
 A

Modified: head/share/man/man4/zero.4
==
--- head/share/man/man4/zero.4  Wed Apr 30 06:03:01 2014(r265131)
+++ head/share/man/man4/zero.4  Wed Apr 30 06:20:48 2014(r265132)
@@ -49,6 +49,7 @@ supply of null bytes when read.
 .It Pa /dev/zero
 .El
 .Sh SEE ALSO
+.Xr full 4
 .Xr null 4
 .Sh HISTORY
 A

Modified: head/sys/dev/null/null.c
==
--- head/sys/dev/null/null.cWed Apr 30 06:03:01 2014(r265131)
+++ head/sys/dev/null/null.cWed Apr 30 06:20:48 2014(r265132)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2000 Mark R. V. Murray  Jeroen C. van Gelderen
  * Copyright (c) 2001-2004 Mark R. V. Murray
+ * Copyright (c) 2014 Eitan Adler
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +48,9 @@ __FBSDID($FreeBSD$);
 /* For use with destroy_dev(9). */
 static struct cdev *null_dev;
 static struct cdev *zero_dev;
+static struct cdev *full_dev;
 
+static d_write_t full_write;
 static d_write_t null_write;
 static d_ioctl_t null_ioctl;
 static d_ioctl_t zero_ioctl;
@@ -70,6 +73,23 @@ static struct cdevsw zero_cdevsw = {
.d_flags =  D_MMAP_ANON,
 };
 
+static struct cdevsw full_cdevsw = {
+   .d_version =D_VERSION,
+   .d_read =   zero_read,
+   .d_write =  full_write,
+   .d_ioctl =  zero_ioctl,
+   .d_name =   full,
+};
+
+
+/* ARGSUSED */
+static int
+full_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
+{
+
+   return (ENOSPC);
+}
+
 /* ARGSUSED */
 static int
 null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
@@ -155,7 +175,9 @@ null_modevent(module_t mod __unused, int
switch(type) {
case MOD_LOAD:
if (bootverbose)
-   printf(null: null device, zero device\n);
+   printf(null: full device, null device, 

svn commit: r265134 - head/sys/dev/null

2014-04-30 Thread Eitan Adler
Author: eadler
Date: Wed Apr 30 06:30:37 2014
New Revision: 265134
URL: http://svnweb.freebsd.org/changeset/base/265134

Log:
  null.c: fix ordering
  
  Use a consistent ordering of full - null - zero (alphabetical) in null.c
  
  Reported by:  mjg

Modified:
  head/sys/dev/null/null.c

Modified: head/sys/dev/null/null.c
==
--- head/sys/dev/null/null.cWed Apr 30 06:27:23 2014(r265133)
+++ head/sys/dev/null/null.cWed Apr 30 06:30:37 2014(r265134)
@@ -46,9 +46,9 @@ __FBSDID($FreeBSD$);
 #include machine/vmparam.h
 
 /* For use with destroy_dev(9). */
+static struct cdev *full_dev;
 static struct cdev *null_dev;
 static struct cdev *zero_dev;
-static struct cdev *full_dev;
 
 static d_write_t full_write;
 static d_write_t null_write;
@@ -56,6 +56,14 @@ static d_ioctl_t null_ioctl;
 static d_ioctl_t zero_ioctl;
 static d_read_t zero_read;
 
+static struct cdevsw full_cdevsw = {
+   .d_version =D_VERSION,
+   .d_read =   zero_read,
+   .d_write =  full_write,
+   .d_ioctl =  zero_ioctl,
+   .d_name =   full,
+};
+
 static struct cdevsw null_cdevsw = {
.d_version =D_VERSION,
.d_read =   (d_read_t *)nullop,
@@ -73,13 +81,6 @@ static struct cdevsw zero_cdevsw = {
.d_flags =  D_MMAP_ANON,
 };
 
-static struct cdevsw full_cdevsw = {
-   .d_version =D_VERSION,
-   .d_read =   zero_read,
-   .d_write =  full_write,
-   .d_ioctl =  zero_ioctl,
-   .d_name =   full,
-};
 
 
 /* ARGSUSED */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265135 - head/share/man/man4

2014-04-30 Thread Eitan Adler
Author: eadler
Date: Wed Apr 30 06:34:53 2014
New Revision: 265135
URL: http://svnweb.freebsd.org/changeset/base/265135

Log:
  man pages: add missing comma
  
  Reported by:  brueffer

Modified:
  head/share/man/man4/null.4
  head/share/man/man4/zero.4

Modified: head/share/man/man4/null.4
==
--- head/share/man/man4/null.4  Wed Apr 30 06:30:37 2014(r265134)
+++ head/share/man/man4/null.4  Wed Apr 30 06:34:53 2014(r265135)
@@ -48,7 +48,7 @@ device is always zero.
 .It Pa /dev/null
 .El
 .Sh SEE ALSO
-.Xr full 4
+.Xr full 4 ,
 .Xr zero 4
 .Sh HISTORY
 A

Modified: head/share/man/man4/zero.4
==
--- head/share/man/man4/zero.4  Wed Apr 30 06:30:37 2014(r265134)
+++ head/share/man/man4/zero.4  Wed Apr 30 06:34:53 2014(r265135)
@@ -49,7 +49,7 @@ supply of null bytes when read.
 .It Pa /dev/zero
 .El
 .Sh SEE ALSO
-.Xr full 4
+.Xr full 4 ,
 .Xr null 4
 .Sh HISTORY
 A
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265136 - head/sys/dev/null

2014-04-30 Thread Eitan Adler
Author: eadler
Date: Wed Apr 30 06:40:30 2014
New Revision: 265136
URL: http://svnweb.freebsd.org/changeset/base/265136

Log:
  null.c: uio is unused
  
  Mark another parameter as unused
  
  Reported by:  rpaulo

Modified:
  head/sys/dev/null/null.c

Modified: head/sys/dev/null/null.c
==
--- head/sys/dev/null/null.cWed Apr 30 06:34:53 2014(r265135)
+++ head/sys/dev/null/null.cWed Apr 30 06:40:30 2014(r265136)
@@ -85,7 +85,7 @@ static struct cdevsw zero_cdevsw = {
 
 /* ARGSUSED */
 static int
-full_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
+full_write(struct cdev *dev __unused, struct uio *uio __unused, int flags 
__unused)
 {
 
return (ENOSPC);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265137 - head/share/man/man4

2014-04-30 Thread Eitan Adler
Author: eadler
Date: Wed Apr 30 06:54:35 2014
New Revision: 265137
URL: http://svnweb.freebsd.org/changeset/base/265137

Log:
  Add missing comma
  
  Relnotes: yes (/dev/full)

Modified:
  head/share/man/man4/full.4

Modified: head/share/man/man4/full.4
==
--- head/share/man/man4/full.4  Wed Apr 30 06:40:30 2014(r265136)
+++ head/share/man/man4/full.4  Wed Apr 30 06:54:35 2014(r265137)
@@ -40,7 +40,7 @@ However, it will always be full when wri
 .It Pa /dev/full
 .El
 .Sh SEE ALSO
-.Xr null 4
+.Xr null 4 ,
 .Xr zero 4
 .Sh Author
 This device and man page was written by
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2014-04-30 Thread Kevin Lo
Author: kevlo
Date: Wed Apr 30 07:17:51 2014
New Revision: 265139
URL: http://svnweb.freebsd.org/changeset/base/265139

Log:
  Change type from int to short to match function prototypes.
  
  Reviewed by:  glebius

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

Modified: head/share/man/man9/mbuf.9
==
--- head/share/man/man9/mbuf.9  Wed Apr 30 07:09:16 2014(r265138)
+++ head/share/man/man9/mbuf.9  Wed Apr 30 07:17:51 2014(r265139)
@@ -64,23 +64,23 @@
 .Fn M_TRAILINGSPACE struct mbuf *mbuf
 .Fn M_MOVE_PKTHDR struct mbuf *to struct mbuf *from
 .Fn M_PREPEND struct mbuf *mbuf int len int how
-.Fn MCHTYPE struct mbuf *mbuf u_int type
+.Fn MCHTYPE struct mbuf *mbuf short type
 .Ft int
 .Fn M_WRITABLE struct mbuf *mbuf
 .\
 .Ss Mbuf allocation functions
 .Ft struct mbuf *
-.Fn m_get int how int type
+.Fn m_get int how short type
 .Ft struct mbuf *
-.Fn m_getm struct mbuf *orig int len int how int type
+.Fn m_getm struct mbuf *orig int len int how short type
 .Ft struct mbuf *
 .Fn m_getjcl int how short type int flags int size
 .Ft struct mbuf *
 .Fn m_getcl int how short type int flags
 .Ft struct mbuf *
-.Fn m_getclr int how int type
+.Fn m_getclr int how short type
 .Ft struct mbuf *
-.Fn m_gethdr int how int type
+.Fn m_gethdr int how short type
 .Ft struct mbuf *
 .Fn m_free struct mbuf *mbuf
 .Ft void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2014-04-30 Thread Kevin Lo
Author: kevlo
Date: Wed Apr 30 08:51:30 2014
New Revision: 265140
URL: http://svnweb.freebsd.org/changeset/base/265140

Log:
  Document m_get2().
  
  Reviewed by:  glebius

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/mbuf.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Apr 30 07:17:51 2014
(r265139)
+++ head/share/man/man9/MakefileWed Apr 30 08:51:30 2014
(r265140)
@@ -902,6 +902,7 @@ MLINKS+=\
mbuf.9 m_freem.9 \
mbuf.9 MGET.9 \
mbuf.9 m_get.9 \
+   mbuf.9 m_get2.9 \
mbuf.9 m_getjcl.9 \
mbuf.9 m_getcl.9 \
mbuf.9 m_getclr.9 \

Modified: head/share/man/man9/mbuf.9
==
--- head/share/man/man9/mbuf.9  Wed Apr 30 07:17:51 2014(r265139)
+++ head/share/man/man9/mbuf.9  Wed Apr 30 08:51:30 2014(r265140)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 16, 2014
+.Dd April 30, 2014
 .Dt MBUF 9
 .Os
 .\
@@ -72,6 +72,8 @@
 .Ft struct mbuf *
 .Fn m_get int how short type
 .Ft struct mbuf *
+.Fn m_get2 int size int how short type int flags
+.Ft struct mbuf *
 .Fn m_getm struct mbuf *orig int len int how short type
 .Ft struct mbuf *
 .Fn m_getjcl int how short type int flags int size
@@ -528,6 +530,10 @@ The functions are:
 A function version of
 .Fn MGET
 for non-critical paths.
+.It Fn m_get2 size how type flags
+Allocate an
+.Vt mbuf
+with enough space to hold specified amount of data.
 .It Fn m_getm orig len how type
 Allocate
 .Fa len
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265145 - head/lib/libcapsicum

2014-04-30 Thread Pawel Jakub Dawidek
Author: pjd
Date: Wed Apr 30 09:58:28 2014
New Revision: 265145
URL: http://svnweb.freebsd.org/changeset/base/265145

Log:
  Don't forget to remember previous element at the end of the loop.
  
  Reported by:  brueffer
  Found with:   Coverity Prevent(tm)
  CID:  1135301

Modified:
  head/lib/libcapsicum/libcapsicum_dns.c

Modified: head/lib/libcapsicum/libcapsicum_dns.c
==
--- head/lib/libcapsicum/libcapsicum_dns.c  Wed Apr 30 09:57:38 2014
(r265144)
+++ head/lib/libcapsicum/libcapsicum_dns.c  Wed Apr 30 09:58:28 2014
(r265145)
@@ -247,6 +247,7 @@ cap_getaddrinfo(cap_channel_t *chan, con
prevai-ai_next = curai;
else if (firstai == NULL)
firstai = curai;
+   prevai = curai;
}
nvlist_destroy(nvl);
if (curai == NULL  nvlai != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r264907 - in head/release: amd64 i386

2014-04-30 Thread Ed Maste
On 30 April 2014 01:41, Nathan Whitehorn nwhiteh...@freebsd.org wrote:

 So, to make universally bootable install media, we have to switch the
 default console driver to newcons. This means we need to finish polishing
 newcons and need to think about what, exactly, the missing pieces are to
 enable it as the default.

There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with
some details, but I believe the main points are:

1. Documentation.  We currently have no vt(4) man page so one needs to
be written, and other pages likely need to be updated.  Other
documentation (like the handbook) need to be investigated.
2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to
be updated.  Alexandr posted a patch for vidcontrol with the subject
RFT vidcontrol for vt(4)
3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts.
4. Address some performance issues, especially on certain non-x86 and
low-end hardware, and in virtual machines.
5. Address boot console priority.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265148 - head/sys/arm/xilinx

2014-04-30 Thread Ian Lepore
Author: ian
Date: Wed Apr 30 14:38:13 2014
New Revision: 265148
URL: http://svnweb.freebsd.org/changeset/base/265148

Log:
  Convert the Zynq SoC support to the new routines for static device mapping.

Modified:
  head/sys/arm/xilinx/zy7_machdep.c
  head/sys/arm/xilinx/zy7_reg.h

Modified: head/sys/arm/xilinx/zy7_machdep.c
==
--- head/sys/arm/xilinx/zy7_machdep.c   Wed Apr 30 14:09:26 2014
(r265147)
+++ head/sys/arm/xilinx/zy7_machdep.c   Wed Apr 30 14:38:13 2014
(r265148)
@@ -60,7 +60,7 @@ vm_offset_t
 initarm_lastaddr(void)
 {
 
-   return (ZYNQ7_PSIO_VBASE);
+   return (arm_devmap_lastaddr());
 }
 
 void
@@ -79,39 +79,18 @@ initarm_late_init(void)
 {
 }
 
-#define FDT_DEVMAP_SIZE 3
-static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_SIZE];
-
 /*
- * Construct pmap_devmap[] with DT-derived config data.
+ * Set up static device mappings.  Not strictly necessary -- simplebus will
+ * dynamically establish mappings as needed -- but doing it this way gets us
+ * nice efficient 1MB section mappings.
  */
 int
 initarm_devmap_init(void)
 {
-   int i = 0;
 
-   fdt_devmap[i].pd_va =   ZYNQ7_PSIO_VBASE;
-   fdt_devmap[i].pd_pa =   ZYNQ7_PSIO_HWBASE;
-   fdt_devmap[i].pd_size = ZYNQ7_PSIO_SIZE;
-   fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
-   fdt_devmap[i].pd_cache = PTE_DEVICE;
-   i++;
-
-   fdt_devmap[i].pd_va =   ZYNQ7_PSCTL_VBASE;
-   fdt_devmap[i].pd_pa =   ZYNQ7_PSCTL_HWBASE;
-   fdt_devmap[i].pd_size = ZYNQ7_PSCTL_SIZE;
-   fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
-   fdt_devmap[i].pd_cache = PTE_DEVICE;
-   i++;
-
-   /* end of table */
-   fdt_devmap[i].pd_va = 0;
-   fdt_devmap[i].pd_pa = 0;
-   fdt_devmap[i].pd_size = 0;
-   fdt_devmap[i].pd_prot = 0;
-   fdt_devmap[i].pd_cache = 0;
+   arm_devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE);
+   arm_devmap_add_entry(ZYNQ7_PSCTL_HWBASE, ZYNQ7_PSCTL_SIZE);
 
-   arm_devmap_register_table(fdt_devmap[0]);
return (0);
 }
 

Modified: head/sys/arm/xilinx/zy7_reg.h
==
--- head/sys/arm/xilinx/zy7_reg.h   Wed Apr 30 14:09:26 2014
(r265147)
+++ head/sys/arm/xilinx/zy7_reg.h   Wed Apr 30 14:38:13 2014
(r265148)
@@ -44,16 +44,13 @@
 #define ZYNQ7_PLGP1_SIZE   0x4000
 
 /* I/O Peripheral registers. */
-#define ZYNQ7_PSIO_VBASE   0xE000
 #define ZYNQ7_PSIO_HWBASE  0xE000
 #define ZYNQ7_PSIO_SIZE0x0030
 
 /* UART0 and UART1 */
-#define ZYNQ7_UART0_VBASE  (ZYNQ7_PSIO_VBASE)
 #define ZYNQ7_UART0_HWBASE (ZYNQ7_PSIO_HWBASE)
 #define ZYNQ7_UART0_SIZE   0x1000
 
-#define ZYNQ7_UART1_VBASE  (ZYNQ7_PSIO_VBASE+0x1000)
 #define ZYNQ7_UART1_HWBASE (ZYNQ7_PSIO_HWBASE+0x1000)
 #define ZYNQ7_UART1_SIZE   0x1000
 
@@ -63,15 +60,12 @@
 #define ZYNQ7_SMC_SIZE 0x0500
 
 /* SLCR, PS system, and CPU private registers combined in this region. */
-#define ZYNQ7_PSCTL_VBASE  0xF800
 #define ZYNQ7_PSCTL_HWBASE 0xF800
 #define ZYNQ7_PSCTL_SIZE   0x0100
 
-#define ZYNQ7_SLCR_VBASE   (ZYNQ7_PSCTL_VBASE)
 #define ZYNQ7_SLCR_HWBASE  (ZYNQ7_PSCTL_HWBASE)
 #define ZYNQ7_SLCR_SIZE0x1000
 
-#define ZYNQ7_DEVCFG_VBASE (ZYNQ7_PSCTL_VBASE+0x7000)
 #define ZYNQ7_DEVCFG_HWBASE(ZYNQ7_PSCTL_HWBASE+0x7000)
 #define ZYNQ7_DEVCFG_SIZE  0x1000
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Ian Lepore
On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:
 Author: eadler
 Date: Wed Apr 30 06:20:48 2014
 New Revision: 265132
 URL: http://svnweb.freebsd.org/changeset/base/265132
 
 Log:
   Add a /dev/full device.
   
   /dev/full is similar to /dev/zero except it always returns
   ENOSPC when you attempt to write to it.
   

For some reason this reminded me of something I've been wanting for a
while but never get around to writing... /dev/ones, it's just
like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
out flash-based media.

-- Ian


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


Re: svn commit: r264907 - in head/release: amd64 i386

2014-04-30 Thread Nathan Whitehorn

On 04/30/14 06:36, Ed Maste wrote:

On 30 April 2014 01:41, Nathan Whitehorn nwhiteh...@freebsd.org wrote:

So, to make universally bootable install media, we have to switch the
default console driver to newcons. This means we need to finish polishing
newcons and need to think about what, exactly, the missing pieces are to
enable it as the default.

There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with
some details, but I believe the main points are:

1. Documentation.  We currently have no vt(4) man page so one needs to
be written, and other pages likely need to be updated.  Other
documentation (like the handbook) need to be investigated.
2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to
be updated.  Alexandr posted a patch for vidcontrol with the subject
RFT vidcontrol for vt(4)
3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts.
4. Address some performance issues, especially on certain non-x86 and
low-end hardware, and in virtual machines.
5. Address boot console priority.



Which of these are blockers before turning it on in GENERIC for wider 
testing? Point #1 is a must, I think. #2 seems potentially destructive: 
do we want to have to make them work with both syscons and vt? #5 we've 
worked around for the time being. #4 would be nice, but maybe wider 
testing helps with it. It's painfully slow on regular x86 hardware as 
well -- my brand-new Lenovo laptop for instance. But I think we could 
switch GENERIC on -CURRENT over only after writing some documentation.

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


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Matthew Fleming
On Wed, Apr 30, 2014 at 7:48 AM, Ian Lepore i...@freebsd.org wrote:
 On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:
 Author: eadler
 Date: Wed Apr 30 06:20:48 2014
 New Revision: 265132
 URL: http://svnweb.freebsd.org/changeset/base/265132

 Log:
   Add a /dev/full device.

   /dev/full is similar to /dev/zero except it always returns
   ENOSPC when you attempt to write to it.


 For some reason this reminded me of something I've been wanting for a
 while but never get around to writing... /dev/ones, it's just
 like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
 out flash-based media.

dd if=/dev/zero | tr \000 \377 | dd of=xxx

But it's not quite the same.

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


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Steven Hartland


- Original Message - 
From: Ian Lepore i...@freebsd.org

To: Eitan Adler ead...@freebsd.org
Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@FreeBSD.org
Sent: Wednesday, April 30, 2014 3:48 PM
Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null



On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:

Author: eadler
Date: Wed Apr 30 06:20:48 2014
New Revision: 265132
URL: http://svnweb.freebsd.org/changeset/base/265132

Log:
  Add a /dev/full device.
  
  /dev/full is similar to /dev/zero except it always returns

  ENOSPC when you attempt to write to it.
  


For some reason this reminded me of something I've been wanting for a
while but never get around to writing... /dev/ones, it's just
like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
out flash-based media.


Surely for that you want camcontrol security ...?

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


Re: svn commit: r264907 - in head/release: amd64 i386

2014-04-30 Thread John Baldwin
On Wednesday, April 30, 2014 10:48:27 am Nathan Whitehorn wrote:
 On 04/30/14 06:36, Ed Maste wrote:
  On 30 April 2014 01:41, Nathan Whitehorn nwhiteh...@freebsd.org wrote:
  So, to make universally bootable install media, we have to switch the
  default console driver to newcons. This means we need to finish polishing
  newcons and need to think about what, exactly, the missing pieces are to
  enable it as the default.
  There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with
  some details, but I believe the main points are:
 
  1. Documentation.  We currently have no vt(4) man page so one needs to
  be written, and other pages likely need to be updated.  Other
  documentation (like the handbook) need to be investigated.
  2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to
  be updated.  Alexandr posted a patch for vidcontrol with the subject
  RFT vidcontrol for vt(4)
  3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts.
  4. Address some performance issues, especially on certain non-x86 and
  low-end hardware, and in virtual machines.
  5. Address boot console priority.
 
 
 Which of these are blockers before turning it on in GENERIC for wider 
 testing? Point #1 is a must, I think. #2 seems potentially destructive: 
 do we want to have to make them work with both syscons and vt? #5 we've 
 worked around for the time being. #4 would be nice, but maybe wider 
 testing helps with it. It's painfully slow on regular x86 hardware as 
 well -- my brand-new Lenovo laptop for instance. But I think we could 
 switch GENERIC on -CURRENT over only after writing some documentation.
 -Nathan

I would prefer having a boot time knob to switch between vt or sc and
being able to include both in the kernel.  The boot time knob could default
to vt when booting from EFI.

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


svn commit: r265149 - head/sys/dev/pci

2014-04-30 Thread Steven Hartland
Author: smh
Date: Wed Apr 30 16:42:12 2014
New Revision: 265149
URL: http://svnweb.freebsd.org/changeset/base/265149

Log:
  Make uninteresting PCI devices with no attached drivers only print out
  on a verbose boot
  
  MFC after:2 weeks

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Apr 30 14:38:13 2014(r265148)
+++ head/sys/dev/pci/pci.c  Wed Apr 30 16:42:12 2014(r265149)
@@ -3968,105 +3968,107 @@ static const struct
 {
int class;
int subclass;
+   int report; /* 0 = bootverbose, 1 = always */
const char  *desc;
 } pci_nomatch_tab[] = {
-   {PCIC_OLD,  -1, old},
-   {PCIC_OLD,  PCIS_OLD_NONVGA,non-VGA display 
device},
-   {PCIC_OLD,  PCIS_OLD_VGA,   VGA-compatible display 
device},
-   {PCIC_STORAGE,  -1, mass storage},
-   {PCIC_STORAGE,  PCIS_STORAGE_SCSI,  SCSI},
-   {PCIC_STORAGE,  PCIS_STORAGE_IDE,   ATA},
-   {PCIC_STORAGE,  PCIS_STORAGE_FLOPPY,floppy disk},
-   {PCIC_STORAGE,  PCIS_STORAGE_IPI,   IPI},
-   {PCIC_STORAGE,  PCIS_STORAGE_RAID,  RAID},
-   {PCIC_STORAGE,  PCIS_STORAGE_ATA_ADMA,  ATA (ADMA)},
-   {PCIC_STORAGE,  PCIS_STORAGE_SATA,  SATA},
-   {PCIC_STORAGE,  PCIS_STORAGE_SAS,   SAS},
-   {PCIC_STORAGE,  PCIS_STORAGE_NVM,   NVM},
-   {PCIC_NETWORK,  -1, network},
-   {PCIC_NETWORK,  PCIS_NETWORK_ETHERNET,  ethernet},
-   {PCIC_NETWORK,  PCIS_NETWORK_TOKENRING, token ring},
-   {PCIC_NETWORK,  PCIS_NETWORK_FDDI,  fddi},
-   {PCIC_NETWORK,  PCIS_NETWORK_ATM,   ATM},
-   {PCIC_NETWORK,  PCIS_NETWORK_ISDN,  ISDN},
-   {PCIC_DISPLAY,  -1, display},
-   {PCIC_DISPLAY,  PCIS_DISPLAY_VGA,   VGA},
-   {PCIC_DISPLAY,  PCIS_DISPLAY_XGA,   XGA},
-   {PCIC_DISPLAY,  PCIS_DISPLAY_3D,3D},
-   {PCIC_MULTIMEDIA,   -1, multimedia},
-   {PCIC_MULTIMEDIA,   PCIS_MULTIMEDIA_VIDEO,  video},
-   {PCIC_MULTIMEDIA,   PCIS_MULTIMEDIA_AUDIO,  audio},
-   {PCIC_MULTIMEDIA,   PCIS_MULTIMEDIA_TELE,   telephony},
-   {PCIC_MULTIMEDIA,   PCIS_MULTIMEDIA_HDA,HDA},
-   {PCIC_MEMORY,   -1, memory},
-   {PCIC_MEMORY,   PCIS_MEMORY_RAM,RAM},
-   {PCIC_MEMORY,   PCIS_MEMORY_FLASH,  flash},
-   {PCIC_BRIDGE,   -1, bridge},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_HOST,   HOST-PCI},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_ISA,PCI-ISA},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_EISA,   PCI-EISA},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_MCA,PCI-MCA},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_PCI,PCI-PCI},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_PCMCIA, PCI-PCMCIA},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_NUBUS,  PCI-NuBus},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_CARDBUS,PCI-CardBus},
-   {PCIC_BRIDGE,   PCIS_BRIDGE_RACEWAY,PCI-RACEway},
-   {PCIC_SIMPLECOMM,   -1, simple comms},
-   {PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_UART,   UART},/* 
could detect 16550 */
-   {PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_PAR,parallel port},
-   {PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_MULSER, multiport serial},
-   {PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_MODEM,  generic modem},
-   {PCIC_BASEPERIPH,   -1, base peripheral},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_PIC,interrupt controller},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_DMA,DMA controller},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_TIMER,  timer},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_RTC,realtime clock},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_PCIHOT, PCI hot-plug 
controller},
-   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_SDHC,   SD host controller},
-   {PCIC_INPUTDEV, -1, input device},
-   {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, keyboard},
-   {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,digitizer},
-   {PCIC_INPUTDEV, PCIS_INPUTDEV_MOUSE,mouse},
-   {PCIC_INPUTDEV, PCIS_INPUTDEV_SCANNER,  scanner},
-   {PCIC_INPUTDEV, PCIS_INPUTDEV_GAMEPORT, gameport},
-   {PCIC_DOCKING,  -1, docking station},
-   {PCIC_PROCESSOR,-1, processor},
-   {PCIC_SERIALBUS,-1, 

Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Ian Lepore
On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote:
 - Original Message - 
 From: Ian Lepore i...@freebsd.org
 To: Eitan Adler ead...@freebsd.org
 Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
 svn-src-head@FreeBSD.org
 Sent: Wednesday, April 30, 2014 3:48 PM
 Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null
 
 
  On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:
  Author: eadler
  Date: Wed Apr 30 06:20:48 2014
  New Revision: 265132
  URL: http://svnweb.freebsd.org/changeset/base/265132
  
  Log:
Add a /dev/full device.

/dev/full is similar to /dev/zero except it always returns
ENOSPC when you attempt to write to it.

  
  For some reason this reminded me of something I've been wanting for a
  while but never get around to writing... /dev/ones, it's just
  like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
  out flash-based media.
 
 Surely for that you want camcontrol security ...?
 
 Regards
 Steve

I have no idea what that is, but given that it has security in the
name, it's almost certainly NOT what I want in any way shape or form.
Shocking as it may be, some people are just not obsessed with security,
for good reason.  It just isn't a consideration in any way in my day to
day activities.  

When I want to make an sdcard, or some portion thereof, look
empty/virgin/new-from-factory for testing on an embedded system, that
has nothing to do with security, and everything to do with just exactly
what I asked for:  something that writes all-ones-bits.

Besides, cam and sdcards don't play in the same sandboxes.

-- Ian


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


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Steven Hartland


- Original Message - 
From: Ian Lepore i...@freebsd.org

To: Steven Hartland kill...@multiplay.co.uk
Cc: Eitan Adler ead...@freebsd.org; src-committ...@freebsd.org; 
svn-src-...@freebsd.org; svn-src-head@FreeBSD.org
Sent: Wednesday, April 30, 2014 6:13 PM
Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null



On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote:
- Original Message - 
From: Ian Lepore i...@freebsd.org

To: Eitan Adler ead...@freebsd.org
Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@FreeBSD.org
Sent: Wednesday, April 30, 2014 3:48 PM
Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null


 On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:
 Author: eadler
 Date: Wed Apr 30 06:20:48 2014
 New Revision: 265132
 URL: http://svnweb.freebsd.org/changeset/base/265132
 
 Log:

   Add a /dev/full device.
   
   /dev/full is similar to /dev/zero except it always returns

   ENOSPC when you attempt to write to it.
   
 
 For some reason this reminded me of something I've been wanting for a

 while but never get around to writing... /dev/ones, it's just
 like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
 out flash-based media.

Surely for that you want camcontrol security ...?

Regards
Steve


I have no idea what that is, but given that it has security in the
name, it's almost certainly NOT what I want in any way shape or form.
Shocking as it may be, some people are just not obsessed with security,
for good reason.  It just isn't a consideration in any way in my day to
day activities.  


Its a standard option which allows you to erase the contents of a device
its named security as thats the class of the ATA commands which provides
this functionality.


When I want to make an sdcard, or some portion thereof, look
empty/virgin/new-from-factory for testing on an embedded system, that
has nothing to do with security, and everything to do with just exactly
what I asked for:  something that writes all-ones-bits.


That does kind of describe the functionality thats provided by camcontrol
security appart from it explicity asks for the cells to be erased, so
results in the device being as close to from factory as possible but,
not set to a specific value. Maybe thats the difference between ATA based
flash media e.g. SSD and sdcard's?

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


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

2014-04-30 Thread Alexander Motin
Author: mav
Date: Wed Apr 30 17:38:26 2014
New Revision: 265150
URL: http://svnweb.freebsd.org/changeset/base/265150

Log:
  Do not reread SCSI disk VPD pages on every device open.
  
  Instead of rereading VPD pages on every device open, do it only on initial
  device probe, and in cases when device reported via UNIT ATTENTIONs that
  something has changed.  Capacity is still rereaded on every open because
  it is more critical for operation and more probable to change in run time.
  
  On my tests with Intel 530 SSDs on mps(4) HBA this change reduces time
  GEOM needs to retaste the device (that includes few open/close cycles)
  from ~150ms to ~30ms.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

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

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Wed Apr 30 16:42:12 2014(r265149)
+++ head/sys/cam/scsi/scsi_da.c Wed Apr 30 17:38:26 2014(r265150)
@@ -90,7 +90,8 @@ typedef enum {
DA_FLAG_SCTX_INIT   = 0x200,
DA_FLAG_CAN_RC16= 0x400,
DA_FLAG_PROBED  = 0x800,
-   DA_FLAG_DIRTY   = 0x1000
+   DA_FLAG_DIRTY   = 0x1000,
+   DA_FLAG_ANNOUNCED   = 0x2000
 } da_flags;
 
 typedef enum {
@@ -1658,10 +1659,18 @@ daasync(void *callback_arg, u_int32_t co
 error_code, sense_key, asc, ascq)) {
if (asc == 0x2A  ascq == 0x09) {
xpt_print(ccb-ccb_h.path,
-   capacity data has changed\n);
+   Capacity data has changed\n);
+   softc-flags = ~DA_FLAG_PROBED;
dareprobe(periph);
-   } else if (asc == 0x28  ascq == 0x00)
+   } else if (asc == 0x28  ascq == 0x00) {
+   softc-flags = ~DA_FLAG_PROBED;
disk_media_changed(softc-disk, M_NOWAIT);
+   } else if (asc == 0x3F  ascq == 0x03) {
+   xpt_print(ccb-ccb_h.path,
+   INQUIRY data has changed\n);
+   softc-flags = ~DA_FLAG_PROBED;
+   dareprobe(periph);
+   }
}
cam_periph_async(periph, code, path, arg);
break;
@@ -1891,7 +1900,7 @@ daprobedone(struct cam_periph *periph, u
 
dadeletemethodchoose(softc, DA_DELETE_NONE);
 
-   if (bootverbose  (softc-flags  DA_FLAG_PROBED) == 0) {
+   if (bootverbose  (softc-flags  DA_FLAG_ANNOUNCED) == 0) {
char buf[80];
int i, sep;
 
@@ -1932,10 +1941,11 @@ daprobedone(struct cam_periph *periph, u
 */
xpt_release_ccb(ccb);
softc-state = DA_STATE_NORMAL;
+   softc-flags |= DA_FLAG_PROBED;
daschedule(periph);
wakeup(softc-disk-d_mediasize);
-   if ((softc-flags  DA_FLAG_PROBED) == 0) {
-   softc-flags |= DA_FLAG_PROBED;
+   if ((softc-flags  DA_FLAG_ANNOUNCED) == 0) {
+   softc-flags |= DA_FLAG_ANNOUNCED;
cam_periph_unhold(periph);
} else
cam_periph_release_locked(periph);
@@ -3190,7 +3200,8 @@ dadone(struct cam_periph *periph, union 
}
}
free(csio-data_ptr, M_SCSIDA);
-   if (announce_buf[0] != '\0'  ((softc-flags  DA_FLAG_PROBED) 
== 0)) {
+   if (announce_buf[0] != '\0' 
+   ((softc-flags  DA_FLAG_ANNOUNCED) == 0)) {
/*
 * Create our sysctl variables, now that we know
 * we have successfully attached.
@@ -3208,6 +3219,12 @@ dadone(struct cam_periph *periph, union 
}
}
 
+   /* We already probed the device. */
+   if (softc-flags  DA_FLAG_PROBED) {
+   daprobedone(periph, done_ccb);
+   return;
+   }
+
/* Ensure re-probe doesn't see old delete. */
softc-delete_available = 0;
if (lbp  (softc-quirks  DA_Q_NO_UNMAP) == 0) {
@@ -3546,13 +3563,21 @@ daerror(union ccb *ccb, u_int32_t cam_fl
 */
else if (sense_key == SSD_KEY_UNIT_ATTENTION 
asc == 0x2A  ascq == 0x09) {
-   xpt_print(periph-path, capacity data has changed\n);
+   xpt_print(periph-path, Capacity data has changed\n);
+   softc-flags = ~DA_FLAG_PROBED;
dareprobe(periph);
sense_flags |= SF_NO_PRINT;
} else if (sense_key == SSD_KEY_UNIT_ATTENTION 
-   asc == 0x28  ascq == 0x00)
+ 

svn commit: r265151 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2014-04-30 Thread Peter Wemm
Author: peter
Date: Wed Apr 30 17:43:49 2014
New Revision: 265151
URL: http://svnweb.freebsd.org/changeset/base/265151

Log:
  Nuke svn:ignore on the conf directory - This makes sense for the compile
  directory, but not so much for here as it's including ignores for things
  like GENERIC etc.
  
  Submitted by: markm

Modified:
Directory Properties:
  head/sys/amd64/conf/   (props changed)
  head/sys/arm/conf/   (props changed)
  head/sys/i386/conf/   (props changed)
  head/sys/ia64/conf/   (props changed)
  head/sys/mips/conf/   (props changed)
  head/sys/pc98/conf/   (props changed)
  head/sys/powerpc/conf/   (props changed)
  head/sys/sparc64/conf/   (props changed)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265152 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2014-04-30 Thread Steven Hartland
Author: smh
Date: Wed Apr 30 17:46:29 2014
New Revision: 265152
URL: http://svnweb.freebsd.org/changeset/base/265152

Log:
  Reintroduce priority for the TRIM ZIOs instead of using the NOW priority
  
  The changes how TRIM requests are generated to use ZIO_TYPE_FREE + a priority
  instead of ZIO_TYPE_IOCTL, until processed by vdev_geom; only then is it
  translated the required geom values. This reduces the amount of changes
  required for FREE requests to be supported by the new IO scheduler. This
  also eliminates the need for a specific DKIOCTRIM.
  
  Also fixed FREE vdev child IO's from running ZIO_STAGE_VDEV_IO_DONE as part
  of their schedule.
  
  As the new IO scheduler can result in a request to execute one type of IO to
  actually run a different type of IO it requires that zio_trim requests are
  processed without holding the trim map lock (tm-tm_lock), as the free request
  execute call may result in write request running hence triggering a
  trim_map_write_start call, which takes the trim map lock and hence would 
result
  in recused on no-recursive sx lock.
  
  This is based off avg's original work, so credit to him.
  
  MFC after:1 month

Modified:
  head/sys/cddl/compat/opensolaris/sys/dkio.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/compat/opensolaris/sys/dkio.h
==
--- head/sys/cddl/compat/opensolaris/sys/dkio.h Wed Apr 30 17:43:49 2014
(r265151)
+++ head/sys/cddl/compat/opensolaris/sys/dkio.h Wed Apr 30 17:46:29 2014
(r265152)
@@ -75,8 +75,6 @@ extern C {
  */
 #defineDKIOCFLUSHWRITECACHE(DKIOC|34)  /* flush cache to phys 
medium */
 
-#defineDKIOCTRIM   (DKIOC|35)  /* TRIM a block */
-
 struct dk_callback {
void (*dkc_callback)(void *dkc_cookie, int error);
void *dkc_cookie;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h   Wed Apr 
30 17:43:49 2014(r265151)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h   Wed Apr 
30 17:46:29 2014(r265152)
@@ -135,9 +135,10 @@ typedef enum zio_priority {
ZIO_PRIORITY_ASYNC_READ,/* prefetch */
ZIO_PRIORITY_ASYNC_WRITE,   /* spa_sync() */
ZIO_PRIORITY_SCRUB, /* asynchronous scrub/resilver reads */
+   ZIO_PRIORITY_TRIM,  /* free requests used for TRIM */
ZIO_PRIORITY_NUM_QUEUEABLE,
 
-   ZIO_PRIORITY_NOW/* non-queued i/os (e.g. free) */
+   ZIO_PRIORITY_NOW/* non-queued I/Os (e.g. ioctl) */
 } zio_priority_t;
 
 #defineZIO_PIPELINE_CONTINUE   0x100
@@ -508,7 +509,7 @@ extern zio_t *zio_claim(zio_t *pio, spa_
 
 extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
 uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv,
-enum zio_flag flags);
+zio_priority_t priority, enum zio_flag flags);
 
 extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
 uint64_t size, void *data, int checksum,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h  Wed Apr 
30 17:43:49 2014(r265151)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h  Wed Apr 
30 17:46:29 2014(r265152)
@@ -215,6 +215,10 @@ enum zio_stage {
ZIO_STAGE_FREE_BP_INIT |\
ZIO_STAGE_DVA_FREE)
 
+#defineZIO_FREE_PHYS_PIPELINE  \
+   (ZIO_INTERLOCK_STAGES | \
+   ZIO_VDEV_IO_STAGES)
+
 #defineZIO_DDT_FREE_PIPELINE   \
(ZIO_INTERLOCK_STAGES | \
ZIO_STAGE_FREE_BP_INIT |\

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c  Wed Apr 
30 17:43:49 2014(r265151)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c  Wed Apr 
30 17:46:29 2014(r265152)
@@ -449,7 +449,7 @@ trim_map_vdev_commit(spa_t *spa, zio_t *
 {
trim_map_t *tm = vd-vdev_trimmap;
trim_seg_t *ts;
-   uint64_t size, txgtarget, txgsafe;
+   uint64_t size, 

svn commit: r265154 - in head: . sys/conf sys/tools/fdt

2014-04-30 Thread Warner Losh
Author: imp
Date: Wed Apr 30 18:02:04 2014
New Revision: 265154
URL: http://svnweb.freebsd.org/changeset/base/265154

Log:
  Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
  kernel config file. If you also want to have a static DTB compiled
  into your kernel, however, it cannot be a list. We have no mechanism
  in the kernel for picking one, so that doesn't make sense and will
  result in a compile-time error.

Modified:
  head/Makefile.inc1
  head/sys/conf/files
  head/sys/tools/fdt/make_dtb.sh   (contents, props changed)

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Apr 30 17:56:05 2014(r265153)
+++ head/Makefile.inc1  Wed Apr 30 18:02:04 2014(r265154)
@@ -1830,24 +1830,12 @@ DTBOUTPUTPATH= ${.CURDIR}
 # Build 'standalone' Device Tree Blob
 #
 builddtb:
-   @if [ ${FDT_DTS_FILE} =  ]; then \
-   echo ERROR: FDT_DTS_FILE must be specified!; \
-   exit 1; \
-   fi; \
-   if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then 
\
-   echo ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
-   exist!; \
-   exit 1; \
-   fi; \
-   if [ ${DTBOUTPUTPATH} = ${.CURDIR} ]; then  \
-   echo WARNING: DTB will be placed in the current working \
-   directory; \
-   fi
-   @PATH=${TMPPATH} \
-   MACHINE=${TARGET} \
+.if !defined(FDT_DTS_FILE)
+.error FDT_DTS_FILE must be specified!
+.endif
+   @PATH=${TMPPATH} MACHINE=${TARGET} \
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
-   ${FDT_DTS_FILE} \
-   ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts`
+   ${FDT_DTS_FILE} ${DTBOUTPUTPATH}
 
 ###
 

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Apr 30 17:56:05 2014(r265153)
+++ head/sys/conf/files Wed Apr 30 18:02:04 2014(r265154)
@@ -14,7 +14,7 @@ acpi_quirks.h optional acpi   
   \
 # from the specified source (DTS) file: platform.dts - platform.dtb
 #
 fdt_dtb_file   optional fdt fdt_dtb_static \
-   compile-with sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} 
${.CURDIR}/${FDT_DTS_FILE:R}.dtb \
+   compile-with sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} 
${.CURDIR} \
no-obj no-implicit-rule before-depend   \
clean   ${FDT_DTS_FILE:R}.dtb
 fdt_static_dtb.h   optional fdt fdt_dtb_static \

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 17:56:05 2014
(r265153)
+++ head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 18:02:04 2014
(r265154)
@@ -4,8 +4,12 @@
 
 # Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
 S=$1
-dts=$2
-dtb=$3
+dts=$2
+dtb_path=$3
 
-cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} 
-I $S/gnu/dts/${MACHINE} -include $dts /dev/null | 
+for d in ${dts}; do
+dtb=${dtb_path}/`basename $d .dts`.dtb
+echo converting $d - $dtb
+cpp -x assembler-with-cpp -I $S/gnu/dts/include -I 
$S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | 
dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i 
$S/gnu/dts/${MACHINE}
+done
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265155 - in head: . sys/arm/conf

2014-04-30 Thread Warner Losh
Author: imp
Date: Wed Apr 30 18:02:10 2014
New Revision: 265155
URL: http://svnweb.freebsd.org/changeset/base/265155

Log:
  Omit from the universe build all config files tagged with
  #NO_UNIVERSE. Many of these config files are important examples, but
  add little to no regresive value to the intended purpose of
  UNIVERSE. We now build over 120 kernels during universe. There's
  really little to no value to this over building say 60 or even 30 of
  them (either is still a way too big number). This is especially true
  for kernels that are nothing more than including a common base and
  adding a static DTB file. Start by pruning 1/3 of the arm kernels that
  add little regresion value.

Added:
  head/sys/arm/conf/VYBRID
 - copied, changed from r265154, head/sys/arm/conf/VYBRID.common
Deleted:
  head/sys/arm/conf/VYBRID.common
Modified:
  head/Makefile
  head/sys/arm/conf/ARNDALE
  head/sys/arm/conf/BWCT
  head/sys/arm/conf/COLIBRI-VF50
  head/sys/arm/conf/COSMIC
  head/sys/arm/conf/EB9200
  head/sys/arm/conf/ETHERNUT5
  head/sys/arm/conf/HL200
  head/sys/arm/conf/HL201
  head/sys/arm/conf/KB920X
  head/sys/arm/conf/NSLU
  head/sys/arm/conf/QILA9G20
  head/sys/arm/conf/QUARTZ
  head/sys/arm/conf/SAM9260EK
  head/sys/arm/conf/SAM9X25EK
  head/sys/arm/conf/SN9G45
  head/sys/arm/conf/WANDBOARD-DUAL
  head/sys/arm/conf/WANDBOARD-QUAD
  head/sys/arm/conf/WANDBOARD-SOLO

Modified: head/Makefile
==
--- head/Makefile   Wed Apr 30 18:02:04 2014(r265154)
+++ head/Makefile   Wed Apr 30 18:02:10 2014(r265155)
@@ -458,9 +458,15 @@ universe_kernels: universe_kernconfs
 .if !defined(TARGET)
 TARGET!=   uname -m
 .endif
+.if defined(MAKE_ALL_KERNELS)
+_THINNER=cat
+.else
+_THINNER=xargs grep -L ^.NO_UNIVERSE
+.endif
 KERNCONFS!=cd ${KERNSRCDIR}/${TARGET}/conf  \
find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
-   ! -name DEFAULTS ! -name NOTES
+   ! -name DEFAULTS ! -name NOTES | \
+   ${_THINNER}
 universe_kernconfs:
 .for kernel in ${KERNCONFS}
 TARGET_ARCH_${kernel}!=cd ${KERNSRCDIR}/${TARGET}/conf  \

Modified: head/sys/arm/conf/ARNDALE
==
--- head/sys/arm/conf/ARNDALE   Wed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/ARNDALE   Wed Apr 30 18:02:10 2014(r265155)
@@ -17,6 +17,8 @@
 #
 # $FreeBSD$
 
+#NO_UNIVERSE
+
 includeEXYNOS5250.common
 ident  ARNDALE
 

Modified: head/sys/arm/conf/BWCT
==
--- head/sys/arm/conf/BWCT  Wed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/BWCT  Wed Apr 30 18:02:10 2014(r265155)
@@ -17,6 +17,8 @@
 #
 # $FreeBSD$
 
+#NO_UNIVERSE
+
 ident  BWCT
 
 optionsVERBOSE_INIT_ARM

Modified: head/sys/arm/conf/COLIBRI-VF50
==
--- head/sys/arm/conf/COLIBRI-VF50  Wed Apr 30 18:02:04 2014
(r265154)
+++ head/sys/arm/conf/COLIBRI-VF50  Wed Apr 30 18:02:10 2014
(r265155)
@@ -17,7 +17,9 @@
 #
 # $FreeBSD$
 
-includeVYBRID.common
+#NO_UNIVERSE
+
+includeVYBRID
 ident  COLIBRI-VF50
 
 #FDT

Modified: head/sys/arm/conf/COSMIC
==
--- head/sys/arm/conf/COSMICWed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/COSMICWed Apr 30 18:02:10 2014(r265155)
@@ -17,7 +17,9 @@
 #
 # $FreeBSD$
 
-includeVYBRID.common
+#NO_UNIVERSE
+
+includeVYBRID
 ident  COSMIC
 
 #FDT

Modified: head/sys/arm/conf/EB9200
==
--- head/sys/arm/conf/EB9200Wed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/EB9200Wed Apr 30 18:02:10 2014(r265155)
@@ -12,6 +12,8 @@
 #
 # $FreeBSD$
 
+#NO_UNIVERSE
+
 ident  EB9200
 
 include../at91/std.eb9200

Modified: head/sys/arm/conf/ETHERNUT5
==
--- head/sys/arm/conf/ETHERNUT5 Wed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/ETHERNUT5 Wed Apr 30 18:02:10 2014(r265155)
@@ -17,6 +17,8 @@
 #
 # $FreeBSD$
 
+#NO_UNIVERSE
+
 ident  ETHERNUT5
 
 include ../at91/std.ethernut5

Modified: head/sys/arm/conf/HL200
==
--- head/sys/arm/conf/HL200 Wed Apr 30 18:02:04 2014(r265154)
+++ head/sys/arm/conf/HL200 Wed Apr 30 18:02:10 2014(r265155)
@@ -17,6 +17,8 @@
 #
 # $FreeBSD$
 
+#NO_UNIVERSE
+
 ident  HL200
 
 include ../at91/std.hl200

Modified: head/sys/arm/conf/HL201

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

2014-04-30 Thread Warner Losh
Author: imp
Date: Wed Apr 30 18:02:19 2014
New Revision: 265156
URL: http://svnweb.freebsd.org/changeset/base/265156

Log:
  This was copied to IMX6, which has since evolved further. Remove this
  as it is no longer needed.

Deleted:
  head/sys/arm/conf/WANDBOARD.common
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265157 - head/usr.sbin/kldxref

2014-04-30 Thread Ed Maste
Author: emaste
Date: Wed Apr 30 18:11:53 2014
New Revision: 265157
URL: http://svnweb.freebsd.org/changeset/base/265157

Log:
  kldxref: Clean up error reporting
  
  Omit too many sections warnings if the ELF file is not dynamically
  linked (and is therefore skipped anyway), and otherwise output it only
  once.  An errant core file would previously cause kldxref to output a
  number of warnings.
  
  Also introduce a MAXSEGS #define and replace literal 2 with it, to make
  comparisons clear.
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/kldxref/ef.c

Modified: head/usr.sbin/kldxref/ef.c
==
--- head/usr.sbin/kldxref/ef.c  Wed Apr 30 18:02:19 2014(r265156)
+++ head/usr.sbin/kldxref/ef.c  Wed Apr 30 18:11:53 2014(r265157)
@@ -47,6 +47,7 @@
 
 #include ef.h
 
+#defineMAXSEGS 2
 struct ef_file {
char*   ef_name;
struct elf_file *ef_efile;
@@ -68,7 +69,7 @@ struct ef_file {
Elf_Off ef_symoff;
Elf_Sym*ef_symtab;
int ef_nsegs;
-   Elf_Phdr *  ef_segs[2];
+   Elf_Phdr *  ef_segs[MAXSEGS];
int ef_verbose;
Elf_Rel *   ef_rel; /* relocation table */
int ef_relsz;   /* number of entries */
@@ -580,12 +581,9 @@ ef_open(const char *filename, struct elf
ef_print_phdr(phdr);
switch (phdr-p_type) {
case PT_LOAD:
-   if (nsegs == 2) {
-   warnx(%s: too many sections,
-   filename);
-   break;
-   }
-   ef-ef_segs[nsegs++] = phdr;
+   if (nsegs  MAXSEGS)
+   ef-ef_segs[nsegs] = phdr;
+   nsegs++;
break;
case PT_PHDR:
break;
@@ -597,12 +595,15 @@ ef_open(const char *filename, struct elf
}
if (verbose  1)
printf(\n);
-   ef-ef_nsegs = nsegs;
if (phdyn == NULL) {
warnx(Skipping %s: not dynamically-linked,
filename);
break;
+   } else if (nsegs  MAXSEGS) {
+   warnx(%s: too many sections, filename);
+   break;
}
+   ef-ef_nsegs = nsegs;
if (ef_read_entry(ef, phdyn-p_offset,
phdyn-p_filesz, (void**)ef-ef_dyn) != 0) {
printf(ef_read_entry failed\n);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265158 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2014-04-30 Thread Peter Wemm
Author: peter
Date: Wed Apr 30 18:25:14 2014
New Revision: 265158
URL: http://svnweb.freebsd.org/changeset/base/265158

Log:
  List LINT* instead of completely removing svn:ignore.

Modified:
Directory Properties:
  head/sys/amd64/conf/   (props changed)
  head/sys/arm/conf/   (props changed)
  head/sys/i386/conf/   (props changed)
  head/sys/ia64/conf/   (props changed)
  head/sys/mips/conf/   (props changed)
  head/sys/pc98/conf/   (props changed)
  head/sys/powerpc/conf/   (props changed)
  head/sys/sparc64/conf/   (props changed)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Jung-uk Kim
On 2014-04-30 02:20:48 -0400, ?? wrote:
 Author: eadler
 Date: Wed Apr 30 06:20:48 2014
 New Revision: 265132
 URL: http://svnweb.freebsd.org/changeset/base/265132
 
 Log:
   Add a /dev/full device.
   
   /dev/full is similar to /dev/zero except it always returns
   ENOSPC when you attempt to write to it.
   
   Reviewed by:jhibbits
   Discussed with: rpaulo
...
Please see lindev(4).

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


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

2014-04-30 Thread Alexander Motin
Author: mav
Date: Wed Apr 30 19:44:31 2014
New Revision: 265159
URL: http://svnweb.freebsd.org/changeset/base/265159

Log:
  Respect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page.
  
  Nobody yet reported disk supporting I/Os less then our MAXPHYS value, but
  since we any way have code to read Block Limits VPD page, that is easy.
  
  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 Wed Apr 30 18:25:14 2014(r265158)
+++ head/sys/cam/scsi/scsi_da.c Wed Apr 30 19:44:31 2014(r265159)
@@ -212,6 +212,7 @@ struct da_softc {
int  trim_max_ranges;
int  delete_running;
int  delete_available;  /* Delete methods possibly available */
+   u_intmaxio;
uint32_tunmap_max_ranges;
uint32_tunmap_max_lba; /* Max LBAs in UNMAP req */
uint64_tws_max_blks;
@@ -2135,11 +2136,12 @@ daregister(struct cam_periph *periph, vo
softc-disk-d_name = da;
softc-disk-d_drv1 = periph;
if (cpi.maxio == 0)
-   softc-disk-d_maxsize = DFLTPHYS;  /* traditional default 
*/
+   softc-maxio = DFLTPHYS;/* traditional default */
else if (cpi.maxio  MAXPHYS)
-   softc-disk-d_maxsize = MAXPHYS;   /* for safety */
+   softc-maxio = MAXPHYS; /* for safety */
else
-   softc-disk-d_maxsize = cpi.maxio;
+   softc-maxio = cpi.maxio;
+   softc-disk-d_maxsize = softc-maxio;
softc-disk-d_unit = periph-unit_number;
softc-disk-d_flags = DISKFLAG_DIRECT_COMPLETION;
if ((softc-quirks  DA_Q_NO_SYNC_CACHE) == 0)
@@ -3276,14 +3278,6 @@ dadone(struct cam_periph *periph, union 
 (lbp-flags  SVPD_LBP_WS10));
dadeleteflag(softc, DA_DELETE_UNMAP,
 (lbp-flags  SVPD_LBP_UNMAP));
-
-   if (lbp-flags  SVPD_LBP_UNMAP) {
-   free(lbp, M_SCSIDA);
-   xpt_release_ccb(done_ccb);
-   softc-state = DA_STATE_PROBE_BLK_LIMITS;
-   xpt_schedule(periph, priority);
-   return;
-   }
} else {
int error;
error = daerror(done_ccb, CAM_RETRY_SELTO,
@@ -3309,7 +3303,7 @@ dadone(struct cam_periph *periph, union 
 
free(lbp, M_SCSIDA);
xpt_release_ccb(done_ccb);
-   softc-state = DA_STATE_PROBE_BDC;
+   softc-state = DA_STATE_PROBE_BLK_LIMITS;
xpt_schedule(periph, priority);
return;
}
@@ -3320,12 +3314,20 @@ dadone(struct cam_periph *periph, union 
block_limits = (struct scsi_vpd_block_limits *)csio-data_ptr;
 
if ((csio-ccb_h.status  CAM_STATUS_MASK) == CAM_REQ_CMP) {
+   uint32_t max_txfer_len = scsi_4btoul(
+   block_limits-max_txfer_len);
uint32_t max_unmap_lba_cnt = scsi_4btoul(
block_limits-max_unmap_lba_cnt);
uint32_t max_unmap_blk_cnt = scsi_4btoul(
block_limits-max_unmap_blk_cnt);
uint64_t ws_max_blks = scsi_8btou64(
block_limits-max_write_same_length);
+
+   if (max_txfer_len != 0) {
+   softc-disk-d_maxsize = MIN(softc-maxio,
+   (off_t)max_txfer_len * 
softc-params.secsize);
+   }
+
/*
 * We should already support UNMAP but we check lba
 * and block count to be sure
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Warner Losh

On Apr 30, 2014, at 11:13 AM, Ian Lepore i...@freebsd.org wrote:

 On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote:
 - Original Message - 
 From: Ian Lepore i...@freebsd.org
 To: Eitan Adler ead...@freebsd.org
 Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
 svn-src-head@FreeBSD.org
 Sent: Wednesday, April 30, 2014 3:48 PM
 Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null
 
 
 On Wed, 2014-04-30 at 06:20 +, Eitan Adler wrote:
 Author: eadler
 Date: Wed Apr 30 06:20:48 2014
 New Revision: 265132
 URL: http://svnweb.freebsd.org/changeset/base/265132
 
 Log:
  Add a /dev/full device.
 
  /dev/full is similar to /dev/zero except it always returns
  ENOSPC when you attempt to write to it.
 
 
 For some reason this reminded me of something I've been wanting for a
 while but never get around to writing... /dev/ones, it's just
 like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
 out flash-based media.
 
 Surely for that you want camcontrol security ...?
 
Regards
Steve
 
 I have no idea what that is, but given that it has security in the
 name, it's almost certainly NOT what I want in any way shape or form.
 Shocking as it may be, some people are just not obsessed with security,
 for good reason.  It just isn't a consideration in any way in my day to
 day activities.  
 
 When I want to make an sdcard, or some portion thereof, look
 empty/virgin/new-from-factory for testing on an embedded system, that
 has nothing to do with security, and everything to do with just exactly
 what I asked for:  something that writes all-ones-bits.
 
 Besides, cam and sdcards don't play in the same sandboxes.

You likely want some variation of the SATA secure erase command, which despite 
having the name ‘secure’ in it really is a ‘erase all contents of this drive 
and reinitialize to factory defaults’.

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


svn commit: r265162 - in head: . sys/tools/fdt

2014-04-30 Thread Warner Losh
Author: imp
Date: Wed Apr 30 20:47:40 2014
New Revision: 265162
URL: http://svnweb.freebsd.org/changeset/base/265162

Log:
  Turns out this .if evaluated not in the context of the makedtb target
  sometimes due to Makefile expansion rules. Make the test for things
  being NULL elsewhere...

Modified:
  head/Makefile.inc1
  head/sys/tools/fdt/make_dtb.sh   (contents, props changed)

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Apr 30 20:46:52 2014(r265161)
+++ head/Makefile.inc1  Wed Apr 30 20:47:40 2014(r265162)
@@ -1830,9 +1830,6 @@ DTBOUTPUTPATH= ${.CURDIR}
 # Build 'standalone' Device Tree Blob
 #
 builddtb:
-.if !defined(FDT_DTS_FILE)
-.error FDT_DTS_FILE must be specified!
-.endif
@PATH=${TMPPATH} MACHINE=${TARGET} \
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
${FDT_DTS_FILE} ${DTBOUTPUTPATH}

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 20:46:52 2014
(r265161)
+++ head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 20:47:40 2014
(r265162)
@@ -7,6 +7,11 @@ S=$1
 dts=$2
 dtb_path=$3
 
+if [ -n $dts ]; then
+echo No DTS specified
+exit 1
+fi
+
 for d in ${dts}; do
 dtb=${dtb_path}/`basename $d .dts`.dtb
 echo converting $d - $dtb
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265163 - head/sys/tools/fdt

2014-04-30 Thread Warner Losh
Author: imp
Date: Wed Apr 30 20:52:38 2014
New Revision: 265163
URL: http://svnweb.freebsd.org/changeset/base/265163

Log:
  Fix logic error. blush
  
  Submitted by: ian@

Modified:
  head/sys/tools/fdt/make_dtb.sh   (contents, props changed)

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 20:47:40 2014
(r265162)
+++ head/sys/tools/fdt/make_dtb.sh  Wed Apr 30 20:52:38 2014
(r265163)
@@ -7,7 +7,7 @@ S=$1
 dts=$2
 dtb_path=$3
 
-if [ -n $dts ]; then
+if [ -z $dts ]; then
 echo No DTS specified
 exit 1
 fi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265095 - head/lib/libc/locale

2014-04-30 Thread Jilles Tjoelker
On Tue, Apr 29, 2014 at 03:25:57PM +, Pedro F. Giffuni wrote:
 Author: pfg
 Date: Tue Apr 29 15:25:57 2014
 New Revision: 265095
 URL: http://svnweb.freebsd.org/changeset/base/265095

 Log:
   citrus: Avoid invalid code points.
   
   From the OpenBSD log:
   The UTF-8 decoder should not accept byte sequences which decode to unicode
   code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+.

   http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
   http://unicode.org/faq/utf_bom.html#utf8-4

   Reported by:Stefan Sperling
   Obtained from:  OpenBSD
   MFC after:  5 days

 Modified:
   head/lib/libc/locale/utf8.c

 Modified: head/lib/libc/locale/utf8.c
 ==
 --- head/lib/libc/locale/utf8.c   Tue Apr 29 15:12:23 2014
 (r265094)
 +++ head/lib/libc/locale/utf8.c   Tue Apr 29 15:25:57 2014
 (r265095)
 @@ -203,6 +203,14 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
   errno = EILSEQ;
   return ((size_t)-1);
   }
 + if ((wch = 0xd800  wch = 0xdfff) ||
 + wch == 0xfffe || wch == 0x) {
 + /*
 +  * Malformed input; invalid code points.
 +  */
 + errno = EILSEQ;
 + return ((size_t)-1);
 + }
   if (pwc != NULL)
   *pwc = wch;
   us-want = 0;

Hmm, I think U+FFFE and U+ should be passed through normally.
According to http://www.unicode.org/faq/private_use.html they are
noncharacters (basically a more private variant of private-use
characters) and must be mapped through UTFs.

The part that rejects U+D800 to U+DFFF is definitely correct, though.
http://unicode.org/faq/utf_bom.html#utf8-4 tells to do only that.

The part about U+FFFE and U+ in
http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 seems out of date.
Note the last modified date of that page: 2009-05-11.

On another note, everything above U+0010 should perhaps be rejected
since those codes, which cannot be encoded in UTF-16, were excluded from
Unicode and ISO 10646.

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


svn commit: r265164 - head/sbin/newfs_msdos

2014-04-30 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 30 21:19:46 2014
New Revision: 265164
URL: http://svnweb.freebsd.org/changeset/base/265164

Log:
  Small cleanup: mostly whitespace vs. tabs.

Modified:
  head/sbin/newfs_msdos/newfs_msdos.c

Modified: head/sbin/newfs_msdos/newfs_msdos.c
==
--- head/sbin/newfs_msdos/newfs_msdos.c Wed Apr 30 20:52:38 2014
(r265163)
+++ head/sbin/newfs_msdos/newfs_msdos.c Wed Apr 30 21:19:46 2014
(r265164)
@@ -51,50 +51,50 @@ static const char rcsid[] =
 #include time.h
 #include unistd.h
 
-#define MAXU16   0x/* maximum unsigned 16-bit quantity */
-#define BPN  4 /* bits per nibble */
-#define NPB  2 /* nibbles per byte */
-
-#define DOSMAGIC  0xaa55   /* DOS magic number */
-#define MINBPS   512   /* minimum bytes per sector */
-#define MAXSPC   128   /* maximum sectors per cluster */
-#define MAXNFT   16/* maximum number of FATs */
-#define DEFBLK   4096  /* default block size */
-#define DEFBLK16  2048 /* default block size FAT16 */
-#define DEFRDE   512   /* default root directory entries */
-#define RESFTE   2 /* reserved FAT entries */
-#define MINCLS12  1U   /* minimum FAT12 clusters */
-#define MINCLS16  0xff5U   /* minimum FAT16 clusters */
-#define MINCLS32  0xfff5U  /* minimum FAT32 clusters */
-#define MAXCLS12  0xff4U   /* maximum FAT12 clusters */
-#define MAXCLS16  0xfff4U  /* maximum FAT16 clusters */
-#define MAXCLS32  0xff4U   /* maximum FAT32 clusters */
+#defineMAXU160x/* maximum unsigned 16-bit quantity */
+#defineBPN   4 /* bits per nibble */
+#defineNPB   2 /* nibbles per byte */
+
+#defineDOSMAGIC  0xaa55/* DOS magic number */
+#defineMINBPS512   /* minimum bytes per sector */
+#defineMAXSPC128   /* maximum sectors per cluster */
+#defineMAXNFT16/* maximum number of FATs */
+#defineDEFBLK4096  /* default block size */
+#defineDEFBLK16  2048  /* default block size FAT16 */
+#defineDEFRDE512   /* default root directory entries */
+#defineRESFTE2 /* reserved FAT entries */
+#defineMINCLS12  1U/* minimum FAT12 clusters */
+#defineMINCLS16  0xff5U/* minimum FAT16 clusters */
+#defineMINCLS32  0xfff5U   /* minimum FAT32 clusters */
+#defineMAXCLS12  0xff4U/* maximum FAT12 clusters */
+#defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
+#defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
-#define mincls(fat)  ((fat) == 12 ? MINCLS12 : \
+#definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
 
-#define maxcls(fat)  ((fat) == 12 ? MAXCLS12 : \
+#definemaxcls(fat)  ((fat) == 12 ? MAXCLS12 :  \
  (fat) == 16 ? MAXCLS16 :  \
MAXCLS32)
 
-#define mk1(p, x)  \
+#definemk1(p, x)   \
 (p) = (u_int8_t)(x)
 
-#define mk2(p, x)  \
+#definemk2(p, x)   \
 (p)[0] = (u_int8_t)(x),\
 (p)[1] = (u_int8_t)((x)  010)
 
-#define mk4(p, x)  \
+#definemk4(p, x)   \
 (p)[0] = (u_int8_t)(x),\
 (p)[1] = (u_int8_t)((x)  010),   \
 (p)[2] = (u_int8_t)((x)  020),   \
 (p)[3] = (u_int8_t)((x)  030)
 
-#define argto1(arg, lo, msg)  argtou(arg, lo, 0xff, msg)
-#define argto2(arg, lo, msg)  argtou(arg, lo, 0x, msg)
-#define argto4(arg, lo, msg)  argtou(arg, lo, 0x, msg)
-#define argtox(arg, lo, msg)  argtou(arg, lo, UINT_MAX, msg)
+#defineargto1(arg, lo, msg)  argtou(arg, lo, 0xff, msg)
+#defineargto2(arg, lo, msg)  argtou(arg, lo, 0x, msg)
+#defineargto4(arg, lo, msg)  argtou(arg, lo, 0x, msg)
+#defineargtox(arg, lo, msg)  argtou(arg, lo, UINT_MAX, msg)
 
 struct bs {
 u_int8_t bsJump[3];/* bootstrap entry point */
@@ -131,7 +131,7 @@ struct bsx {
 u_int8_t exReserved1;  /* reserved */
 u_int8_t exBootSignature;  /* extended boot signature */
 u_int8_t exVolumeID[4];/* volume ID number */
-u_int8_t exVolumeLabel[11];/* volume label */
+u_int8_t exVolumeLabel[11];/* volume label */
 u_int8_t exFileSysType[8]; /* file system type */
 } __packed;
 
@@ -164,7 +164,7 @@ struct bpb {
 u_int bpbBackup;   /* backup boot sector */
 };
 
-#define 

Re: svn commit: r265095 - head/lib/libc/locale

2014-04-30 Thread Pedro Giffuni


On 04/30/14 16:10, Jilles Tjoelker wrote:

On Tue, Apr 29, 2014 at 03:25:57PM +, Pedro F. Giffuni wrote:

Author: pfg
Date: Tue Apr 29 15:25:57 2014
New Revision: 265095
URL: http://svnweb.freebsd.org/changeset/base/265095
Log:
   citrus: Avoid invalid code points.
   
   From the OpenBSD log:

   The UTF-8 decoder should not accept byte sequences which decode to unicode
   code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+.
   http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
   http://unicode.org/faq/utf_bom.html#utf8-4
   Reported by: Stefan Sperling
   Obtained from:   OpenBSD
   MFC after:   5 days
Modified:
   head/lib/libc/locale/utf8.c
Modified: head/lib/libc/locale/utf8.c
==
--- head/lib/libc/locale/utf8.c Tue Apr 29 15:12:23 2014(r265094)
+++ head/lib/libc/locale/utf8.c Tue Apr 29 15:25:57 2014(r265095)
@@ -203,6 +203,14 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc,
errno = EILSEQ;
return ((size_t)-1);
}
+   if ((wch = 0xd800  wch = 0xdfff) ||
+   wch == 0xfffe || wch == 0x) {
+   /*
+* Malformed input; invalid code points.
+*/
+   errno = EILSEQ;
+   return ((size_t)-1);
+   }
if (pwc != NULL)
*pwc = wch;
us-want = 0;

Hmm, I think U+FFFE and U+ should be passed through normally.
According to http://www.unicode.org/faq/private_use.html they are
noncharacters (basically a more private variant of private-use
characters) and must be mapped through UTFs.

The part that rejects U+D800 to U+DFFF is definitely correct, though.
http://unicode.org/faq/utf_bom.html#utf8-4 tells to do only that.

The part about U+FFFE and U+ in
http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 seems out of date.
Note the last modified date of that page: 2009-05-11.

On another note, everything above U+0010 should perhaps be rejected
since those codes, which cannot be encoded in UTF-16, were excluded from
Unicode and ISO 10646.



Thank you! I will fix soon the UTF-8 part.

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


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Daniel O'Connor

On 1 May 2014, at 0:18, Ian Lepore i...@freebsd.org wrote:
  /dev/full is similar to /dev/zero except it always returns
  ENOSPC when you attempt to write to it.
 
 
 For some reason this reminded me of something I've been wanting for a
 while but never get around to writing... /dev/ones, it's just
 like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
 out flash-based media.

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/79421

:)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C








signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r265165 - head/sys/boot/userboot/userboot

2014-04-30 Thread Peter Grehan
Author: grehan
Date: Thu May  1 00:12:24 2014
New Revision: 265165
URL: http://svnweb.freebsd.org/changeset/base/265165

Log:
  Provide an alias for the userboot console and name it 'comconsole'.
  This allows existing loader.conf files that set console=comconsole
  to work without failing. No functional difference otherwise.
  
  Reported by:  Michael Dexter, pfSense install.
  Reviewed by:  neel
  MFC after:3 weeks

Modified:
  head/sys/boot/userboot/userboot/conf.c
  head/sys/boot/userboot/userboot/userboot_cons.c

Modified: head/sys/boot/userboot/userboot/conf.c
==
--- head/sys/boot/userboot/userboot/conf.c  Wed Apr 30 21:19:46 2014
(r265164)
+++ head/sys/boot/userboot/userboot/conf.c  Thu May  1 00:12:24 2014
(r265165)
@@ -97,8 +97,10 @@ struct file_format *file_formats[] = {
  * data structures from bootstrap.h as well.
  */
 extern struct console userboot_console;
+extern struct console userboot_comconsole;
 
 struct console *consoles[] = {
userboot_console,
+   userboot_comconsole,
NULL
 };

Modified: head/sys/boot/userboot/userboot/userboot_cons.c
==
--- head/sys/boot/userboot/userboot/userboot_cons.c Wed Apr 30 21:19:46 
2014(r265164)
+++ head/sys/boot/userboot/userboot/userboot_cons.c Thu May  1 00:12:24 
2014(r265165)
@@ -33,8 +33,12 @@ __FBSDID($FreeBSD$);
 
 int console;
 
+static struct console *userboot_comconsp;
+
 static void userboot_cons_probe(struct console *cp);
 static int userboot_cons_init(int);
+static void userboot_comcons_probe(struct console *cp);
+static int userboot_comcons_init(int);
 static void userboot_cons_putchar(int);
 static int userboot_cons_getchar(void);
 static int userboot_cons_poll(void);
@@ -50,6 +54,21 @@ struct console userboot_console = {
userboot_cons_poll,
 };
 
+/*
+ * Provide a simple alias to allow loader scripts to set the
+ * console to comconsole without resulting in an error
+ */
+struct console userboot_comconsole = {
+   comconsole,
+   comconsole,
+   0,
+   userboot_comcons_probe,
+   userboot_comcons_init,
+   userboot_cons_putchar,
+   userboot_cons_getchar,
+   userboot_cons_poll,
+};
+
 static void
 userboot_cons_probe(struct console *cp)
 {
@@ -65,6 +84,31 @@ userboot_cons_init(int arg)
 }
 
 static void
+userboot_comcons_probe(struct console *cp)
+{
+
+   /*
+* Save the console pointer so the comcons_init routine
+* can set the C_PRESENT* flags. They are not set
+* here to allow the existing userboot console to
+* be elected the default.
+*/
+   userboot_comconsp = cp;
+}
+
+static int
+userboot_comcons_init(int arg)
+{
+
+   /*
+* Set the C_PRESENT* flags to allow the comconsole
+* to be selected as the active console
+*/
+   userboot_comconsp-c_flags |= (C_PRESENTIN | C_PRESENTOUT);
+   return (0);
+}
+
+static void
 userboot_cons_putchar(int c)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r265167 - head/lib/libc/locale

2014-04-30 Thread Pedro F. Giffuni
Author: pfg
Date: Thu May  1 01:42:48 2014
New Revision: 265167
URL: http://svnweb.freebsd.org/changeset/base/265167

Log:
  citrus: Avoid invalid code points.
  
  From the OpenBSD log:
  The UTF-8 decoder should not accept byte sequences which decode to unicode
  code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+.
  
  http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
  http://unicode.org/faq/utf_bom.html#utf8-4
  
  Reported by:  Stefan Sperling
  Obtained from:OpenBSD
  MFC after:5 days

Modified:
  head/lib/libc/locale/utf8.c

Modified: head/lib/libc/locale/utf8.c
==
--- head/lib/libc/locale/utf8.c Thu May  1 00:31:19 2014(r265166)
+++ head/lib/libc/locale/utf8.c Thu May  1 01:42:48 2014(r265167)
@@ -203,8 +203,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
errno = EILSEQ;
return ((size_t)-1);
}
-   if ((wch = 0xd800  wch = 0xdfff) ||
-   wch == 0xfffe || wch == 0x) {
+   if (wch = 0xd800  wch = 0xdfff) {
/*
 * Malformed input; invalid code points.
 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null

2014-04-30 Thread Bruce Evans

On Wed, 30 Apr 2014, Matthew Fleming wrote:


On Wed, Apr 30, 2014 at 7:48 AM, Ian Lepore i...@freebsd.org wrote:



For some reason this reminded me of something I've been wanting for a
while but never get around to writing... /dev/ones, it's just
like /dev/zero except it returns 0xff bytes.  Useful for dd'ing to wipe
out flash-based media.


dd if=/dev/zero | tr \000 \377 | dd of=xxx


Why all these processes and i/o's?

tr /dev/dev/zero \000 \377

The dd's may be needed for controlling the block sizes.


But it's not quite the same.


It is better, since it is not limited to 0xff bytes :-).

Oops, perhaps not.  tr not only uses stdio to pessimize the i/o; it uses
wide characters 1 at a time.  It used to use only characters 1 at a time.

yes(1) is limited to newline bytes, or newlines mixed with strings.  It
also uses stdio to pessimize the i/o, but not wide characters yet.

stdio's pessimizations begin with naively believing that st_blksize gives
a good i/o size.  For most non-regular files, including all (?) devices
and all (?) pipes, st_blksize is PAGE_SIZE.  For disks, this has been
broken signficantly since FreeBSD-4 where it was the disk's si_bsize_best
(usually 64K).  For pipes, this has been broken significantly since
FreeBSD-4 where it was pipe_buffer.size (either PIPE_SIZE = 16K or
BIG_PIPE_SIZE = 64K).

So standard utilities tend to be too slow to use on disks.  You have to
use dd and relatively complicated pipelines to get adequate block sizes.
Sometimes dd or a special utility is needed to get adequate control and
error handling.  I have such a special utility for copying disks
with bad sectors, but prefer to use just cp fpr copying disks.  cp
doesn't use stdio, and doesn't use mmap() above certain small size; it
uses read/write() with a fixed block size of 64K or maybe larger in
-current, so it works OK for copying disks.

The most broken utilities that I use often for disk devices are:

- md5.  This (really libmd/mdXhl.c) has been broken on all devices (really
  on all non-regular files) since ~2001.  It is broken by misusing
  st_size instead of by trusting st_blksize.  st_size is only valid
  for regular files, but is used on other file types to break them.
  For example:

pts/21:bde@freefall:~ md5 /dev/null
MD5 (/dev/null) = d41d8cd98f00b204e9800998ecf8427e
pts/21:bde@freefall:~ md5 /dev/zero
MD5 (/dev/zero) = d41d8cd98f00b204e9800998ecf8427e

  Similarly for disk devices.  All devices are seen as empty by md5.

  The workaround is to use a pipeline, or just stdin.  cat /dev/zero | md5
  and even md5 /dev/zero confuse md5 into using a different input method
  that works.  OTOH, md5 /dev/fd/0 sees an empty device file, and
  cat /dev/zero | md5 /dev/fd/0 fails immediately with a seek error.
  Pipes have st_size == 0 too, so the input method that stats the file
  would see an empty file too, so it must not be reached in the working
  case.  md5 /dev/fd/0 apparently just stats the device file, and this
  appears to be empty.  I'm not sure if it is the tty device file or
  /dev/fd/0 that is seen.  cat /dev/zero | md5 /dev/fd/0 apparently
  reaches the buggy code, but somehow gets further and fails trying to
  seek.

  To get adequate block sizes for disks, use dd in the pipeline that must
  be used for other reasons.

  I only recently noticed that pipes have st_blksize = PAGE_SIZE, so that
  if you pipe to stdio utilities then the i/o will be pessimized and
  reblocking using another dd in a pipeline to get back to an adequate
  size.  PAGE_SIZE is large enough to not be very pessimal for some uses.

- cmp.  cmp uses mmap() excessively for regular files, but for device files
  it uses per-char stdio excessively.

  (
  More on md5.  The i/o routine for the working is are in the application
  (md5/md5.c).  This uses fread() with the bad block size BUFSIZ.  This
  is still 1024.  It is more broken than st_blksize.  However, fread()
  is not per-char, so it is reasonably efficient.  stdio uses st_blksize
  for read() from the file.  When the file is regular, the block size
  is again relatively unimportant provided the file system has a large
  enough block size or does clustering.  For device files, clustering
  might occur at levels below the file system, but usually doesn't for
  disks.  Instead, small i/o's get relatively slower with time except
  on high-end SSDs with high transactions per second, because clustering
  at low levels takes too many transactions.

  The i/o routine for the non0-working case is in the library
  (libmd/mdXhl.c).  It uses read(), but with the silly stdio block
  size of BUFSIZ.  libmd files have several includes of stdio.h, but
  don't seem to use stdio except for bugs like this.  The result is that
  the i/o is especially pessimized for the usual regular file case.
  Buffering in the kernel limits this pessimization.
  )

  The device file case for cmp just uses getc()/putc().  This first
  gets the st_blksize pessimization.  Then it gets 

Re: svn commit: r265167 - head/lib/libc/locale

2014-04-30 Thread Pedro Giffuni

Oops.. wrong log!!

Should've been this:
_

citrus: pass U+FFFE and U+ normally.

r265095, based on an OpenBSD change was rejecting U+FFFE and U+
in accordance with outdated documentation. Both values are valid
non-characters [1] and must be mapped through UTFs.

Reference:
http://www.unicode.org/faq/private_use.html [1]

Reported by:jilles
MFC after:4 days

_


I will fix it for the MFC.

Pedro.

On 04/30/14 20:42, Pedro F. Giffuni wrote:

Author: pfg
Date: Thu May  1 01:42:48 2014
New Revision: 265167
URL: http://svnweb.freebsd.org/changeset/base/265167

Log:
   citrus: Avoid invalid code points.
   
   From the OpenBSD log:

   The UTF-8 decoder should not accept byte sequences which decode to unicode
   code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+.
   
   http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8

   http://unicode.org/faq/utf_bom.html#utf8-4
   
   Reported by:	Stefan Sperling

   Obtained from:   OpenBSD
   MFC after:   5 days

Modified:
   head/lib/libc/locale/utf8.c

Modified: head/lib/libc/locale/utf8.c
==
--- head/lib/libc/locale/utf8.c Thu May  1 00:31:19 2014(r265166)
+++ head/lib/libc/locale/utf8.c Thu May  1 01:42:48 2014(r265167)
@@ -203,8 +203,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc,
errno = EILSEQ;
return ((size_t)-1);
}
-   if ((wch = 0xd800  wch = 0xdfff) ||
-   wch == 0xfffe || wch == 0x) {
+   if (wch = 0xd800  wch = 0xdfff) {
/*
 * Malformed input; invalid code points.
 */



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


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

2014-04-30 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu May  1 03:24:20 2014
New Revision: 265170
URL: http://svnweb.freebsd.org/changeset/base/265170

Log:
  Add freebsd-boot to recognized partition types.

Modified:
  head/usr.bin/mkimg/apm.c

Modified: head/usr.bin/mkimg/apm.c
==
--- head/usr.bin/mkimg/apm.cThu May  1 03:18:11 2014(r265169)
+++ head/usr.bin/mkimg/apm.cThu May  1 03:24:20 2014(r265170)
@@ -44,6 +44,7 @@ __FBSDID($FreeBSD$);
 
 static struct mkimg_alias apm_aliases[] = {
 {  ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) },
+{  ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) },
 {  ALIAS_FREEBSD_NANDFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_NANDFS) },
 {  ALIAS_FREEBSD_SWAP, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_SWAP) },
 {  ALIAS_FREEBSD_UFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_UFS) },
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r265171 - head/release/powerpc

2014-04-30 Thread Justin Hibbits

On Apr 30, 2014, at 8:24 PM, Nathan Whitehorn wrote:


Author: nwhitehorn
Date: Thu May  1 03:24:41 2014
New Revision: 265171
URL: http://svnweb.freebsd.org/changeset/base/265171

Log:
 Use mkimg instead of md(4) and gpart.

Modified:
 head/release/powerpc/make-memstick.sh

Modified: head/release/powerpc/make-memstick.sh


Does this mean we can 'make release' without root now?  Cool!

- Justin

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


Re: svn commit: r265171 - head/release/powerpc

2014-04-30 Thread Nathan Whitehorn

On 04/30/14 20:26, Justin Hibbits wrote:

On Apr 30, 2014, at 8:24 PM, Nathan Whitehorn wrote:


Author: nwhitehorn
Date: Thu May  1 03:24:41 2014
New Revision: 265171
URL: http://svnweb.freebsd.org/changeset/base/265171

Log:
 Use mkimg instead of md(4) and gpart.

Modified:
 head/release/powerpc/make-memstick.sh

Modified: head/release/powerpc/make-memstick.sh


Does this mean we can 'make release' without root now?  Cool!

- Justin



Probably? I haven't actually tried. What it certainly means is that you 
can cross-build all PowerPC install media without kldload'ing geom_part_apm.

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