svn commit: r275727 - head/sys/kern

2014-12-12 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 12 09:37:18 2014
New Revision: 275727
URL: https://svnweb.freebsd.org/changeset/base/275727

Log:
  For architectures where time_t is wide enough, in particular, 64bit
  platforms, avoid overflow after year 2038 in clock_ct_to_ts().
  
  PR:   195868
  Reviewed by:  bde
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/subr_clock.c

Modified: head/sys/kern/subr_clock.c
==
--- head/sys/kern/subr_clock.c  Fri Dec 12 09:22:52 2014(r275726)
+++ head/sys/kern/subr_clock.c  Fri Dec 12 09:37:18 2014(r275727)
@@ -133,7 +133,6 @@ print_ct(struct clocktime *ct)
 int
 clock_ct_to_ts(struct clocktime *ct, struct timespec *ts)
 {
-   time_t secs;
int i, year, days;
 
year = ct->year;
@@ -167,11 +166,10 @@ clock_ct_to_ts(struct clocktime *ct, str
days += days_in_month(year, i);
days += (ct->day - 1);
 
-   /* Add hours, minutes, seconds. */
-   secs = ((days * 24 + ct->hour) * 60 + ct->min) * 60 + ct->sec;
-
-   ts->tv_sec = secs;
+   ts->tv_sec = (((time_t)days * 24 + ct->hour) * 60 + ct->min) * 60 +
+   ct->sec;
ts->tv_nsec = ct->nsec;
+
if (ct_debug)
printf(" = %ld.%09ld\n", (long)ts->tv_sec, (long)ts->tv_nsec);
return (0);
___
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: r275728 - in head/sys/dev: beri/virtio virtio virtio/mmio

2014-12-12 Thread Ruslan Bukin
Author: br
Date: Fri Dec 12 11:19:10 2014
New Revision: 275728
URL: https://svnweb.freebsd.org/changeset/base/275728

Log:
  Add virtio bus 'poll' method allowing us to inform backend we are
  going to poll virtqueue.
  
  Use on BERI soft-core to invalidate cpu caches.
  
  Reviewed by:  bryanv
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/beri/virtio/virtio_mmio_platform.c
  head/sys/dev/virtio/mmio/virtio_mmio.c
  head/sys/dev/virtio/mmio/virtio_mmio_if.m
  head/sys/dev/virtio/virtio_bus_if.m
  head/sys/dev/virtio/virtqueue.c

Modified: head/sys/dev/beri/virtio/virtio_mmio_platform.c
==
--- head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Dec 12 09:37:18 
2014(r275727)
+++ head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Dec 12 11:19:10 
2014(r275728)
@@ -234,12 +234,22 @@ platform_setup_intr(device_t dev, device
return (0);
 }
 
+static int
+platform_poll(device_t dev)
+{
+
+   mips_dcache_wbinv_all();
+
+   return (0);
+}
+
 static device_method_t virtio_mmio_platform_methods[] = {
DEVMETHOD(device_probe, virtio_mmio_platform_probe),
DEVMETHOD(device_attach,virtio_mmio_platform_attach),
 
/* virtio_mmio_if.h */
DEVMETHOD(virtio_mmio_note, platform_note),
+   DEVMETHOD(virtio_mmio_poll, platform_poll),
DEVMETHOD(virtio_mmio_setup_intr,   platform_setup_intr),
DEVMETHOD_END
 };

Modified: head/sys/dev/virtio/mmio/virtio_mmio.c
==
--- head/sys/dev/virtio/mmio/virtio_mmio.c  Fri Dec 12 09:37:18 2014
(r275727)
+++ head/sys/dev/virtio/mmio/virtio_mmio.c  Fri Dec 12 11:19:10 2014
(r275728)
@@ -114,6 +114,7 @@ static int  vtmmio_alloc_virtqueues(devic
struct vq_alloc_info *);
 static int vtmmio_setup_intr(device_t, enum intr_type);
 static voidvtmmio_stop(device_t);
+static voidvtmmio_poll(device_t);
 static int vtmmio_reinit(device_t, uint64_t);
 static voidvtmmio_reinit_complete(device_t);
 static voidvtmmio_notify_virtqueue(device_t, uint16_t);
@@ -182,6 +183,7 @@ static device_method_t vtmmio_methods[] 
DEVMETHOD(virtio_bus_alloc_virtqueues,vtmmio_alloc_virtqueues),
DEVMETHOD(virtio_bus_setup_intr,  vtmmio_setup_intr),
DEVMETHOD(virtio_bus_stop,vtmmio_stop),
+   DEVMETHOD(virtio_bus_poll,vtmmio_poll),
DEVMETHOD(virtio_bus_reinit,  vtmmio_reinit),
DEVMETHOD(virtio_bus_reinit_complete, vtmmio_reinit_complete),
DEVMETHOD(virtio_bus_notify_vq,   vtmmio_notify_virtqueue),
@@ -550,6 +552,17 @@ vtmmio_stop(device_t dev)
vtmmio_reset(device_get_softc(dev));
 }
 
+static void
+vtmmio_poll(device_t dev)
+{
+   struct vtmmio_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   if (sc->platform != NULL)
+   VIRTIO_MMIO_POLL(sc->platform);
+}
+
 static int
 vtmmio_reinit(device_t dev, uint64_t features)
 {

Modified: head/sys/dev/virtio/mmio/virtio_mmio_if.m
==
--- head/sys/dev/virtio/mmio/virtio_mmio_if.m   Fri Dec 12 09:37:18 2014
(r275727)
+++ head/sys/dev/virtio/mmio/virtio_mmio_if.m   Fri Dec 12 11:19:10 2014
(r275728)
@@ -67,6 +67,13 @@ METHOD int note {
 } DEFAULT virtio_mmio_note;
 
 #
+# Inform backend we are going to poll virtqueue.
+#
+METHOD int poll {
+   device_tdev;
+};
+
+#
 # Setup backend-specific interrupts.
 #
 METHOD int setup_intr {

Modified: head/sys/dev/virtio/virtio_bus_if.m
==
--- head/sys/dev/virtio/virtio_bus_if.m Fri Dec 12 09:37:18 2014
(r275727)
+++ head/sys/dev/virtio/virtio_bus_if.m Fri Dec 12 11:19:10 2014
(r275728)
@@ -87,3 +87,8 @@ METHOD void write_device_config {
void*src;
int len;
 };
+
+METHOD void poll {
+   device_tdev;
+};
+

Modified: head/sys/dev/virtio/virtqueue.c
==
--- head/sys/dev/virtio/virtqueue.c Fri Dec 12 09:37:18 2014
(r275727)
+++ head/sys/dev/virtio/virtqueue.c Fri Dec 12 11:19:10 2014
(r275728)
@@ -567,8 +567,11 @@ virtqueue_poll(struct virtqueue *vq, uin
 {
void *cookie;
 
-   while ((cookie = virtqueue_dequeue(vq, len)) == NULL)
+   VIRTIO_BUS_POLL(vq->vq_dev);
+   while ((cookie = virtqueue_dequeue(vq, len)) == NULL) {
cpu_spinwait();
+   VIRTIO_BUS_POLL(vq->vq_dev);
+   }
 
return (cookie);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe

svn commit: r275729 - head/usr.sbin/syslogd

2014-12-12 Thread Andrey V. Elsukov
Author: ae
Date: Fri Dec 12 11:29:54 2014
New Revision: 275729
URL: https://svnweb.freebsd.org/changeset/base/275729

Log:
  Increase the buffer size to keep the list of programm names when
  parsing programm specification. It is safe to not check out of bounds
  access, because !isprint(p[i]) check will stop reading, when '\0'
  character will be read from the input string.
  
  Obtained from:Yandex LLC
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Fri Dec 12 11:19:10 2014
(r275728)
+++ head/usr.sbin/syslogd/syslogd.c Fri Dec 12 11:29:54 2014
(r275729)
@@ -1542,7 +1542,7 @@ init(int signo)
struct filed *f, *next, **nextp;
char *p;
char cline[LINE_MAX];
-   char prog[NAME_MAX+1];
+   char prog[LINE_MAX];
char host[MAXHOSTNAMELEN];
char oldLocalHostName[MAXHOSTNAMELEN];
char hostMsg[2*MAXHOSTNAMELEN+40];
@@ -1664,7 +1664,7 @@ init(int signo)
(void)strlcpy(prog, "*", sizeof(prog));
continue;
}
-   for (i = 0; i < NAME_MAX; i++) {
+   for (i = 0; i < LINE_MAX - 1; i++) {
if (!isprint(p[i]) || isspace(p[i]))
break;
prog[i] = p[i];
___
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: r275730 - head/sys/net

2014-12-12 Thread John Baldwin
Author: jhb
Date: Fri Dec 12 16:10:42 2014
New Revision: 275730
URL: https://svnweb.freebsd.org/changeset/base/275730

Log:
  Provide a dead version of if_get_counter.
  
  Submitted by: glebius
  Reported by:  np

Modified:
  head/sys/net/if_dead.c

Modified: head/sys/net/if_dead.c
==
--- head/sys/net/if_dead.c  Fri Dec 12 11:29:54 2014(r275729)
+++ head/sys/net/if_dead.c  Fri Dec 12 16:10:42 2014(r275730)
@@ -93,6 +93,13 @@ ifdead_transmit(struct ifnet *ifp, struc
return (ENXIO);
 }
 
+static uint64_t
+ifdead_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+
+   return (0);
+}
+
 void
 if_dead(struct ifnet *ifp)
 {
@@ -104,4 +111,5 @@ if_dead(struct ifnet *ifp)
ifp->if_resolvemulti = ifdead_resolvemulti;
ifp->if_qflush = ifdead_qflush;
ifp->if_transmit = ifdead_transmit;
+   ifp->if_get_counter = ifdead_get_counter;
 }
___
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: r275730 - head/sys/net

2014-12-12 Thread John Baldwin
On Friday, December 12, 2014 04:10:43 PM John Baldwin wrote:
> Author: jhb
> Date: Fri Dec 12 16:10:42 2014
> New Revision: 275730
> URL: https://svnweb.freebsd.org/changeset/base/275730
> 
> Log:
>   Provide a dead version of if_get_counter.
> 
>   Submitted by:   glebius
>   Reported by:np

Should be "Reviewed by" and I forgot to include the review URL:

https://reviews.freebsd.org/D1282

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


Re: svn commit: r275659 - head/bin/freebsd-version

2014-12-12 Thread Dmitry Marakasov
* Dag-Erling Smørgrav (d...@freebsd.org) wrote:

> Log:
>   Fix dependency on newvers.sh
>   
>   Noticed by: marck
>   MFC after:  1 week

This is wrong. Target uses ${.ALLSRC} to which you've appended ${NEWVERS},
and now the target appends newvers.sh contents to freebsd-version script.

> Modified:
>   head/bin/freebsd-version/Makefile
> 
> Modified: head/bin/freebsd-version/Makefile
> ==
> --- head/bin/freebsd-version/Makefile Tue Dec  9 23:26:47 2014
> (r275658)
> +++ head/bin/freebsd-version/Makefile Wed Dec 10 03:12:22 2014
> (r275659)
> @@ -5,8 +5,7 @@ MAN = freebsd-version.1
>  CLEANFILES = freebsd-version.sh
>  NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh
>  
> -freebsd-version.sh.in: ${NEWVERS}
> -freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in
> +freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS}
>   eval $$(egrep '^(TYPE|REVISION|BRANCH)=' ${NEWVERS}) ; \
>   if ! sed -e "\
>   s/@@TYPE@@/$${TYPE}/g; \

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ruhttp://www.amdmi3.ru
___
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: r275731 - head/share/mk

2014-12-12 Thread Warner Losh
Author: imp
Date: Fri Dec 12 18:54:31 2014
New Revision: 275731
URL: https://svnweb.freebsd.org/changeset/base/275731

Log:
  Fix typo in comments.
  
  Noticed by: brooks@

Modified:
  head/share/mk/bsd.opts.mk
  head/share/mk/src.opts.mk

Modified: head/share/mk/bsd.opts.mk
==
--- head/share/mk/bsd.opts.mk   Fri Dec 12 16:10:42 2014(r275730)
+++ head/share/mk/bsd.opts.mk   Fri Dec 12 18:54:31 2014(r275731)
@@ -11,7 +11,7 @@
 # are exceptions). Recursive makes usually add MK_FOO=no for options that they 
wish
 # to omit from that make.
 #
-# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO
+# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
 # variable.
 #
 # Makefiles may also assume that this file is included by bsd.own.mk should it

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Fri Dec 12 16:10:42 2014(r275730)
+++ head/share/mk/src.opts.mk   Fri Dec 12 18:54:31 2014(r275731)
@@ -11,7 +11,7 @@
 # are exceptions). Recursive makes usually add MK_FOO=no for options that they 
wish
 # to omit from that make.
 #
-# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO
+# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
 # variable.
 #
 # Makefiles may also assume that this file is included by src.opts.mk should it
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275732 - in head: etc/mtree share/man/man4 share/man/man7 share/man/man9 sys/conf sys/crypto/aesni sys/crypto/via sys/geom/eli sys/libkern sys/mips/rmi/dev/sec sys/modules/aesni sys/mo...

2014-12-12 Thread John-Mark Gurney
Author: jmg
Date: Fri Dec 12 19:56:36 2014
New Revision: 275732
URL: https://svnweb.freebsd.org/changeset/base/275732

Log:
  Add some new modes to OpenCrypto.  These modes are AES-ICM (can be used
  for counter mode), and AES-GCM.  Both of these modes have been added to
  the aesni module.
  
  Included is a set of tests to validate that the software and aesni
  module calculate the correct values.  These use the NIST KAT test
  vectors.  To run the test, you will need to install a soon to be
  committed port, nist-kat that will install the vectors.  Using a port
  is necessary as the test vectors are around 25MB.
  
  All the man pages were updated.  I have added a new man page, crypto.7,
  which includes a description of how to use each mode.  All the new modes
  and some other AES modes are present.  It would be good for someone
  else to go through and document the other modes.
  
  A new ioctl was added to support AEAD modes which AES-GCM is one of them.
  Without this ioctl, it is not possible to test AEAD modes from userland.
  
  Add a timing safe bcmp for use to compare MACs.  Previously we were using
  bcmp which could leak timing info and result in the ability to forge
  messages.
  
  Add a minor optimization to the aesni module so that single segment
  mbufs don't get copied and instead are updated in place.  The aesni
  module needs to be updated to support blocked IO so segmented mbufs
  don't have to be copied.
  
  We require that the IV be specified for all calls for both GCM and ICM.
  This is to ensure proper use of these functions.
  
  Obtained from:p4: //depot/projects/opencrypto
  Relnotes: yes
  Sponsored by: FreeBSD Foundation
  Sponsored by: NetGate

Added:
  head/share/man/man7/crypto.7   (contents, props changed)
  head/sys/crypto/aesni/aesni_ghash.c   (contents, props changed)
  head/sys/libkern/timingsafe_bcmp.c   (contents, props changed)
  head/sys/opencrypto/gfmult.c   (contents, props changed)
  head/sys/opencrypto/gfmult.h   (contents, props changed)
  head/sys/opencrypto/gmac.c   (contents, props changed)
  head/sys/opencrypto/gmac.h   (contents, props changed)
  head/tests/sys/opencrypto/
  head/tests/sys/opencrypto/Makefile   (contents, props changed)
  head/tests/sys/opencrypto/cryptodev.py   (contents, props changed)
  head/tests/sys/opencrypto/cryptodevh.py   (contents, props changed)
  head/tests/sys/opencrypto/cryptotest.py   (contents, props changed)
  head/tests/sys/opencrypto/dpkt.py   (contents, props changed)
  head/tests/sys/opencrypto/runtests.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/share/man/man4/crypto.4
  head/share/man/man7/Makefile
  head/share/man/man9/crypto.9
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/crypto/aesni/aesni.c
  head/sys/crypto/aesni/aesni.h
  head/sys/crypto/aesni/aesni_wrap.c
  head/sys/crypto/via/padlock_hash.c
  head/sys/geom/eli/g_eli_crypto.c
  head/sys/geom/eli/g_eli_integrity.c
  head/sys/geom/eli/g_eli_privacy.c
  head/sys/mips/rmi/dev/sec/rmisec.c
  head/sys/modules/aesni/Makefile
  head/sys/modules/crypto/Makefile
  head/sys/opencrypto/criov.c
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptodev.c
  head/sys/opencrypto/cryptodev.h
  head/sys/opencrypto/cryptosoft.c
  head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform.h
  head/sys/sys/libkern.h
  head/sys/sys/param.h
  head/tests/sys/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Fri Dec 12 18:54:31 2014
(r275731)
+++ head/etc/mtree/BSD.tests.dist   Fri Dec 12 19:56:36 2014
(r275732)
@@ -205,6 +205,8 @@
 ..
 netinet
 ..
+opencrypto
+..
 pjdfstest
 chflags
 ..

Modified: head/share/man/man4/crypto.4
==
--- head/share/man/man4/crypto.4Fri Dec 12 18:54:31 2014
(r275731)
+++ head/share/man/man4/crypto.4Fri Dec 12 19:56:36 2014
(r275732)
@@ -1,8 +1,16 @@
-.\"$OpenBSD: crypto.4,v 1.4 2002/09/12 07:15:03 deraadt Exp $
+.\"$NetBSD: crypto.4,v 1.24 2014/01/27 21:23:59 pgoyette Exp $
 .\"
-.\" Copyright (c) 2001 Theo de Raadt
+.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2014 The FreeBSD Foundation
 .\" All rights reserved.
 .\"
+.\" Portions of this documentation were written by John-Mark Gurney
+.\" under sponsorship of the FreeBSD Foundation and
+.\" Rubicon Communications, LLC (Netgate).
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Coyote Point Systems, Inc.
+.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -11,99 +19,378 @@
 .\" 2. R

Re: svn commit: r275732 - in head: etc/mtree share/man/man4 share/man/man7 share/man/man9 sys/conf sys/crypto/aesni sys/crypto/via sys/geom/eli sys/libkern sys/mips/rmi/dev/sec sys/modules/aesni sys/m

2014-12-12 Thread John Baldwin
On Friday, December 12, 2014 07:56:38 PM John-Mark Gurney wrote:
> Author: jmg
> Date: Fri Dec 12 19:56:36 2014
> New Revision: 275732
> URL: https://svnweb.freebsd.org/changeset/base/275732
> 
> Log:
>   Add some new modes to OpenCrypto.  These modes are AES-ICM (can be used
>   for counter mode), and AES-GCM.  Both of these modes have been added to
>   the aesni module.
> 
>   Obtained from:  p4: //depot/projects/opencrypto
>   Relnotes:   yes
>   Sponsored by:   FreeBSD Foundation
>   Sponsored by:   NetGate

No reviewers?  (I thought FF projects required a reviewer?)  Were you not able 
to get other folks to review this when you asked?

With crypto involved, it would seem like a good idea to have run this by 
secteam if you hadn't.  (If you did, something like 'Silence from:  secteam' 
in the commit log would have let us know you tried and didn't get any 
feedback). 

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


Re: svn commit: r275732 - in head: etc/mtree share/man/man4 share/man/man7 share/man/man9 sys/conf sys/crypto/aesni sys/crypto/via sys/geom/eli sys/libkern sys/mips/rmi/dev/sec sys/modules/aesni sys/m

2014-12-12 Thread John-Mark Gurney
John Baldwin wrote this message on Fri, Dec 12, 2014 at 15:23 -0500:
> On Friday, December 12, 2014 07:56:38 PM John-Mark Gurney wrote:
> > Author: jmg
> > Date: Fri Dec 12 19:56:36 2014
> > New Revision: 275732
> > URL: https://svnweb.freebsd.org/changeset/base/275732
> > 
> > Log:
> >   Add some new modes to OpenCrypto.  These modes are AES-ICM (can be used
> >   for counter mode), and AES-GCM.  Both of these modes have been added to
> >   the aesni module.
> > 
> >   Obtained from:p4: //depot/projects/opencrypto
> >   Relnotes: yes
> >   Sponsored by: FreeBSD Foundation
> >   Sponsored by: NetGate
> 
> No reviewers?  (I thought FF projects required a reviewer?)  Were you not 
> able 
> to get other folks to review this when you asked?
> 
> With crypto involved, it would seem like a good idea to have run this by 
> secteam if you hadn't.  (If you did, something like 'Silence from:  secteam' 
> in the commit log would have let us know you tried and didn't get any 
> feedback). 

Sorry, I did get reviewers for specific parts of the project...  But
they were third party reviewers...

Watson Ladd did the software AES review, and Mike Hamburg did the
AES-NI review.

Also, I posted an earlier version of this patch to -security and
-current over a month ago, and didn't get any significant responses...

Sorry for not including that in the commit.  Want me to do a null
commit to record it? or?

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
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: r275732 - in head: etc/mtree share/man/man4 share/man/man7 share/man/man9 sys/conf sys/crypto/aesni sys/crypto/via sys/geom/eli sys/libkern sys/mips/rmi/dev/sec sys/modules/aesni sys/m

2014-12-12 Thread John Baldwin
On Friday, December 12, 2014 12:35:17 PM John-Mark Gurney wrote:
> John Baldwin wrote this message on Fri, Dec 12, 2014 at 15:23 -0500:
> > On Friday, December 12, 2014 07:56:38 PM John-Mark Gurney wrote:
> > > Author: jmg
> > > Date: Fri Dec 12 19:56:36 2014
> > > New Revision: 275732
> > > URL: https://svnweb.freebsd.org/changeset/base/275732
> > > 
> > > Log:
> > >   Add some new modes to OpenCrypto.  These modes are AES-ICM (can be
> > >   used
> > >   for counter mode), and AES-GCM.  Both of these modes have been added
> > >   to
> > >   the aesni module.
> > >   
> > >   Obtained from:  p4: //depot/projects/opencrypto
> > >   Relnotes:   yes
> > >   Sponsored by:   FreeBSD Foundation
> > >   Sponsored by:   NetGate
> > 
> > No reviewers?  (I thought FF projects required a reviewer?)  Were you not
> > able to get other folks to review this when you asked?
> > 
> > With crypto involved, it would seem like a good idea to have run this by
> > secteam if you hadn't.  (If you did, something like 'Silence from: 
> > secteam' in the commit log would have let us know you tried and didn't
> > get any feedback).
> 
> Sorry, I did get reviewers for specific parts of the project...  But
> they were third party reviewers...
> 
> Watson Ladd did the software AES review, and Mike Hamburg did the
> AES-NI review.
> 
> Also, I posted an earlier version of this patch to -security and
> -current over a month ago, and didn't get any significant responses...
> 
> Sorry for not including that in the commit.  Want me to do a null
> commit to record it? or?

No, I don't think it's worth a null commit over.  I think noting even external 
reviewers is probably a good idea for future reference though.  Thanks!

-- 
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: r275733 - in head/sys/dev/cxgbe: . tom

2014-12-12 Thread Navdeep Parhar
Author: np
Date: Fri Dec 12 21:54:59 2014
New Revision: 275733
URL: https://svnweb.freebsd.org/changeset/base/275733

Log:
  Move KTR_CXGBE from t4_tom.h to adapter.h so that the base if_cxgbe
  code can use it too.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hFri Dec 12 19:56:36 2014
(r275732)
+++ head/sys/dev/cxgbe/adapter.hFri Dec 12 21:54:59 2014
(r275733)
@@ -57,6 +57,7 @@
 #include "common/t4_msg.h"
 #include "firmware/t4fw_interface.h"
 
+#define KTR_CXGBE  KTR_SPARE3
 MALLOC_DECLARE(M_CXGBE);
 #define CXGBE_UNIMPLEMENTED(s) \
 panic("%s (%s, line %d) not implemented yet.", s, __FILE__, __LINE__)

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==
--- head/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 12 19:56:36 2014
(r275732)
+++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 12 21:54:59 2014
(r275733)
@@ -31,7 +31,6 @@
 #ifndef __T4_TOM_H__
 #define __T4_TOM_H__
 
-#define KTR_CXGBE  KTR_SPARE3
 #define LISTEN_HASH_SIZE 32
 
 /*
___
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: r275734 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:10:17 2014
New Revision: 275734
URL: https://svnweb.freebsd.org/changeset/base/275734

Log:
  MFV r275542:
  
  If a dnode has a spill block and there is an error while accessing
  a data block then traverse_dnode() loses information about that error
  and returns a status of visiting the spill block.
  
  This issue is discovered by Spectra Logic.
  
  Illumos issue:
  5311 traverse_dnode may report success when it should not
  
  Original author:  gibbs
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c  Fri Dec 
12 21:54:59 2014(r275733)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c  Sat Dec 
13 01:10:17 2014(r275734)
@@ -429,7 +429,7 @@ traverse_dnode(traverse_data_t *td, cons
break;
}
 
-   if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
+   if (err == 0 && dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb);
}
___
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: r275735 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:14:59 2014
New Revision: 275735
URL: https://svnweb.freebsd.org/changeset/base/275735

Log:
  MFV r275543:
  
  Remove always true tests for ds->ds_phys' presence.
  
  Clean up assertions in dsl_dataset_disown.
  
  Remove unreachable code in dsl_dataset_disown().
  
  Illumos issue:
  5310 Remove always true tests for non-NULL ds->ds_phys
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   Sat Dec 
13 01:10:17 2014(r275734)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   Sat Dec 
13 01:14:59 2014(r275735)
@@ -644,16 +644,14 @@ dsl_dataset_rele(dsl_dataset_t *ds, void
 void
 dsl_dataset_disown(dsl_dataset_t *ds, void *tag)
 {
-   ASSERT(ds->ds_owner == tag && ds->ds_dbuf != NULL);
+   ASSERT3P(ds->ds_owner, ==, tag);
+   ASSERT(ds->ds_dbuf != NULL);
 
mutex_enter(&ds->ds_lock);
ds->ds_owner = NULL;
mutex_exit(&ds->ds_lock);
dsl_dataset_long_rele(ds, tag);
-   if (ds->ds_dbuf != NULL)
-   dsl_dataset_rele(ds, tag);
-   else
-   dsl_dataset_evict(NULL, ds);
+   dsl_dataset_rele(ds, tag);
 }
 
 boolean_t

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c  Sat Dec 
13 01:10:17 2014(r275734)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c  Sat Dec 
13 01:14:59 2014(r275735)
@@ -167,8 +167,8 @@ dsl_prop_get_ds(dsl_dataset_t *ds, const
 
ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
-   snapshot = (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds));
-   zapobj = (ds->ds_phys == NULL ? 0 : ds->ds_phys->ds_props_obj);
+   snapshot = dsl_dataset_is_snapshot(ds);
+   zapobj = ds->ds_phys->ds_props_obj;
 
if (zapobj != 0) {
objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
@@ -543,7 +543,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds
 
isint = (dodefault(propname, 8, 1, &intval) == 0);
 
-   if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
+   if (dsl_dataset_is_snapshot(ds)) {
ASSERT(version >= SPA_VERSION_SNAP_PROPS);
if (ds->ds_phys->ds_props_obj == 0) {
dmu_buf_will_dirty(ds->ds_dbuf, tx);
@@ -640,7 +640,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds
if (isint) {
VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval));
 
-   if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) {
+   if (dsl_dataset_is_snapshot(ds)) {
dsl_prop_cb_record_t *cbr;
/*
 * It's a snapshot; nothing can inherit this
___
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: r275736 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:18:23 2014
New Revision: 275736
URL: https://svnweb.freebsd.org/changeset/base/275736

Log:
  MFV r275544:
  
  Clean up some duplicated code in dnode_sync() around freeing spill blocks.
  
  Illumos issue:
  5350 clean up code in dnode_sync()
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.cSat Dec 
13 01:14:59 2014(r275735)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.cSat Dec 
13 01:18:23 2014(r275736)
@@ -633,12 +633,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
dn->dn_free_txg <= tx->tx_txg;
 
/*
-* We will either remove a spill block when a file is being removed
-* or we have been asked to remove it.
+* Remove the spill block if we have been explicitly asked to
+* remove it, or if the object is being removed.
 */
-   if (dn->dn_rm_spillblk[txgoff] ||
-   ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) && freeing_dnode)) {
-   if ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR))
+   if (dn->dn_rm_spillblk[txgoff] || freeing_dnode) {
+   if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR)
kill_spill = B_TRUE;
dn->dn_rm_spillblk[txgoff] = 0;
}
___
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: r275737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:26:06 2014
New Revision: 275737
URL: https://svnweb.freebsd.org/changeset/base/275737

Log:
  MFV r275545:
  
  If zio_checksum_error() returns other than ECKSUM (e.g. EINVAL), it does not
  fill in the "zio_bad_cksum_t *info" parameter. Caller should not attempt to
  use it in this case.
  
  Illumos issue:
  5348 zio_checksum_error() only fills in info if ECKSUM
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Sat Dec 13 
01:18:23 2014(r275736)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Sat Dec 13 
01:26:06 2014(r275737)
@@ -2958,7 +2958,8 @@ zio_checksum_verify(zio_t *zio)
 
if ((error = zio_checksum_error(zio, &info)) != 0) {
zio->io_error = error;
-   if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
+   if (error == ECKSUM &&
+   !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
zfs_ereport_start_checksum(zio->io_spa,
zio->io_vd, zio, zio->io_offset,
zio->io_size, NULL, &info);
___
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: r275738 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:39:24 2014
New Revision: 275738
URL: https://svnweb.freebsd.org/changeset/base/275738

Log:
  MFV r275546:
  
  Reduce scrub activities when system there is enough dirty data, namely when
  dirty data is more than zfs_vdev_async_write_active_min_dirty_percent (once
  we start to increase the number of concurrent async writes).
  
  While there also correct rounding error which would make scrub end up
  pausing for (zfs_txg_timeout + 1) seconds instead of the desired
  zfs_txg_timeout seconds.
  
  Illumos issue:
  5351 scrub goes for an extra second each txg
  5352 scrub should pause when there is some dirty data
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Sat Dec 
13 01:26:06 2014(r275737)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Sat Dec 
13 01:39:24 2014(r275738)
@@ -414,12 +414,11 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu
&scn->scn_phys, tx));
 }
 
+extern int zfs_vdev_async_write_active_min_dirty_percent;
+
 static boolean_t
 dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_phys_t *zb)
 {
-   uint64_t elapsed_nanosecs;
-   unsigned int mintime;
-
/* we never skip user/group accounting objects */
if (zb && (int64_t)zb->zb_object < 0)
return (B_FALSE);
@@ -434,12 +433,28 @@ dsl_scan_check_pause(dsl_scan_t *scn, co
if (zb && zb->zb_level != 0)
return (B_FALSE);
 
-   mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ?
+   /*
+* We pause if:
+*  - we have scanned for the maximum time: an entire txg
+*timeout (default 5 sec)
+*  or
+*  - we have scanned for at least the minimum time (default 1 sec
+*for scrub, 3 sec for resilver), and either we have sufficient
+*dirty data that we are starting to write more quickly
+*(default 30%), or someone is explicitly waiting for this txg
+*to complete.
+*  or
+*  - the spa is shutting down because this pool is being exported
+*or the machine is rebooting.
+*/
+   int mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ?
zfs_resilver_min_time_ms : zfs_scan_min_time_ms;
-   elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
-   if (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
+   uint64_t elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
+   int dirty_pct = scn->scn_dp->dp_dirty_total * 100 / zfs_dirty_data_max;
+   if (elapsed_nanosecs / NANOSEC >= zfs_txg_timeout ||
(NSEC2MSEC(elapsed_nanosecs) > mintime &&
-   txg_sync_waiting(scn->scn_dp)) ||
+   (txg_sync_waiting(scn->scn_dp) ||
+   dirty_pct >= zfs_vdev_async_write_active_min_dirty_percent)) ||
spa_shutting_down(scn->scn_dp->dp_spa)) {
if (zb) {
dprintf("pausing at bookmark %llx/%llx/%llx/%llx\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: r275739 - head/cddl/contrib/opensolaris/cmd/zfs

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 01:55:02 2014
New Revision: 275739
URL: https://svnweb.freebsd.org/changeset/base/275739

Log:
  MFV r275547:
  
  Port Illumos 'zfs allow' examples update.  While I'm there also fix
  a typo.
  
  Illumos issue:
  4181 zfs(1m): 'zfs allow' examples in the man page are outdated
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Dec 13 01:39:24 2014
(r275738)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Dec 13 01:55:02 2014
(r275739)
@@ -23,15 +23,15 @@
 .\" Copyright (c) 2012, Glen Barber 
 .\" Copyright (c) 2012, Bryan Drewery 
 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
-.\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
 .\" Copyright (c) 2013, Steven Hartland 
+.\" Copyright (c) 2014 Nexenta Systems, Inc. All Rights Reserved.
 .\" Copyright (c) 2014, Xin LI 
 .\" Copyright (c) 2014, The FreeBSD Foundation, All Rights Reserved.
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2014
+.Dd December 12, 2014
 .Dt ZFS 8
 .Os
 .Sh NAME
@@ -3505,10 +3505,9 @@ are also displayed.
 .Bd -literal -offset 2n
 .Li # Ic zfs allow cindys create,destroy,mount,snapshot tank/cindys
 .Li # Ic zfs allow tank/cindys
--
-Local+Descendent permissions on (tank/cindys)
-  user cindys create,destroy,mount,snapshot
--
+ Permissions on tank/cindys --
+Local+Descendent permissions:
+user cindys create,destroy,mount,snapshot
 .Ed
 .It Sy Example 18 No Delegating Create Time Permissions on a Tn ZFS No Dataset
 .Pp
@@ -3524,12 +3523,11 @@ are also displayed.
 .Li # Ic zfs allow staff create,mount tank/users
 .Li # Ic zfs allow -c destroy tank/users
 .Li # Ic zfs allow tank/users
--
-Create time permissions on (tank/users)
-  create,destroy
-Local+Descendent permissions on (tank/users)
-  group staff create,mount
--
+ Permissions on tank/users ---
+Permission sets:
+destroy
+Local+Descendent permissions:
+group staff create,mount
 .Ed
 .It Xo
 .Sy Example 19
@@ -3547,14 +3545,11 @@ are also displayed.
 .Li # Ic zfs allow -s @pset create,destroy,snapshot,mount tank/users
 .Li # Ic zfs allow staff @pset tank/users
 .Li # Ic zfs allow tank/users
--
-Permission sets on (tank/users)
+ Permissions on tank/users ---
+Permission sets:
 @pset create,destroy,mount,snapshot
-Create time permissions on (tank/users)
-create,destroy
-Local+Descendent permissions on (tank/users)
-group staff @pset,create,mount
--
+Local+Descendent permissions:
+group staff @pset
 .Ed
 .It Sy Example 20 No Delegating Property Permissions on a Tn ZFS No Dataset
 .Pp
@@ -3566,16 +3561,15 @@ file system. The permissions on
 are also displayed.
 .Bd -literal -offset 2n
 .Li # Ic zfs allow cindys quota,reservation users/home
-.Li # Ic zfs allow cindys
--
-Local+Descendent permissions on (users/home)
+.Li # Ic zfs allow users/home
+ Permissions on users/home ---
+Local+Descendent permissions:
 user cindys quota,reservation
--
 .Li # Ic su - cindys
 .Li cindys% Ic zfs set quota=10G users/home/marks
 .Li cindys% Ic zfs get quota users/home/marks
-NAME  PROPERTY  VALUE SOURCE
-users/home/marks  quota 10G   local
+NAME  PROPERTY  VALUE  SOURCE
+users/home/marks  quota 10Glocal
 .Ed
 .It Sy Example 21 No Removing ZFS Delegated Permissions on a Tn ZFS No Dataset
 .Pp
@@ -3589,14 +3583,11 @@ are also displayed.
 .Bd -literal -offset 2n
 .Li # Ic zfs unallow staff snapshot tank/users
 .Li # Ic zfs allow tank/users
--
-Permission sets on (tank/users)
+ Permissions on tank/users ---
+Permission sets:
 @pset create,destroy,mount,snapshot
-Create time permissions on (tank/users)
-create,destroy
-Local+Descendent permissions on (tank/users)
-group staff @pset,create,mount
--
+Local+Descendent permissions

svn commit: r275740 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2014-12-12 Thread Xin LI
Author: delphij
Date: Sat Dec 13 02:08:18 2014
New Revision: 275740
URL: https://svnweb.freebsd.org/changeset/base/275740

Log:
  MFV r275548:
  
  Verify that the block pointer is structurally valid, before attempting to
  read it in.  It can only be invalid in the case of a ZFS bug, but this
  change will help identify such bugs in a more transparent way, by
  panic'ing with a relevant message, rather than indexing off the end of an
  array or something.
  
  Illumos issue:
  5349 verify that block pointer is plausible before reading
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h   Sat Dec 
13 01:55:02 2014(r275739)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h   Sat Dec 
13 02:08:18 2014(r275740)
@@ -811,6 +811,7 @@ extern boolean_t spa_is_root(spa_t *spa)
 extern boolean_t spa_writeable(spa_t *spa);
 extern boolean_t spa_has_pending_synctask(spa_t *spa);
 extern int spa_maxblocksize(spa_t *spa);
+extern void zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp);
 
 extern int spa_mode(spa_t *spa);
 extern uint64_t zfs_strtonum(const char *str, char **nptr);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Sat Dec 13 
01:55:02 2014(r275739)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Sat Dec 13 
02:08:18 2014(r275740)
@@ -265,7 +265,7 @@ zio_buf_alloc(size_t size)
size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
int flags = zio_exclude_metadata ? KM_NODEBUG : 0;
 
-   ASSERT3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+   VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
 
if (zio_use_uma)
return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE));
@@ -284,7 +284,7 @@ zio_data_buf_alloc(size_t size)
 {
size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
 
-   ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+   VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
 
if (zio_use_uma)
return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE));
@@ -297,7 +297,7 @@ zio_buf_free(void *buf, size_t size)
 {
size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
 
-   ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+   VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
 
if (zio_use_uma)
kmem_cache_free(zio_buf_cache[c], buf);
@@ -310,7 +310,7 @@ zio_data_buf_free(void *buf, size_t size
 {
size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
 
-   ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+   VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
 
if (zio_use_uma)
kmem_cache_free(zio_data_buf_cache[c], buf);
@@ -657,6 +657,86 @@ zio_root(spa_t *spa, zio_done_func_t *do
return (zio_null(NULL, spa, NULL, done, private, flags));
 }
 
+void
+zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp)
+{
+   if (!DMU_OT_IS_VALID(BP_GET_TYPE(bp))) {
+   zfs_panic_recover("blkptr at %p has invalid TYPE %llu",
+   bp, (longlong_t)BP_GET_TYPE(bp));
+   }
+   if (BP_GET_CHECKSUM(bp) >= ZIO_CHECKSUM_FUNCTIONS ||
+   BP_GET_CHECKSUM(bp) <= ZIO_CHECKSUM_ON) {
+   zfs_panic_recover("blkptr at %p has invalid CHECKSUM %llu",
+   bp, (longlong_t)BP_GET_CHECKSUM(bp));
+   }
+   if (BP_GET_COMPRESS(bp) >= ZIO_COMPRESS_FUNCTIONS ||
+   BP_GET_COMPRESS(bp) <= ZIO_COMPRESS_ON) {
+   zfs_panic_recover("blkptr at %p has invalid COMPRESS %llu",
+   bp, (longlong_t)BP_GET_COMPRESS(bp));
+   }
+   if (BP_GET_LSIZE(bp) > SPA_MAXBLOCKSIZE) {
+   zfs_panic_recover("blkptr at %p has invalid LSIZE %llu",
+   bp, (longlong_t)BP_GET_LSIZE(bp));
+   }
+   if (BP_GET_PSIZE(bp) > SPA_MAXBLOCKSIZE) {
+   zfs_panic_recover("blkptr at %p has invalid PSIZE %llu",
+   bp, (longlong_t)BP_GET_PSIZE(bp));
+   }
+
+   if (BP_IS_EMBEDDED(bp)) {
+   if (BPE_GET_ETYPE(bp) > NUM_BP_EMBEDDED_TYPES) {
+   zfs_panic_recover("blkptr at %p has invalid ETYPE %llu",
+   bp, (longlong_t)BPE_GET_ETYPE(bp));
+   }
+   }
+
+   /*
+* Pool-specific checks.
+*
+* Note: it would be nice to verify that the blk_birth and
+* BP_PHYSICAL_BIRTH() are not too large.  However, sp

Re: svn commit: r275633 - in head: contrib/llvm/lib/Transforms/Vectorize sys/sys

2014-12-12 Thread Andrey Chernov
On 09.12.2014 10:34, Dimitry Andric wrote:
> PR21302. Vectorize only bottom-tested loops.
...
>   MFC after:  3 days

Hi. More than 3 days already passed, do you plan to MFC it?
I have irrational fear to compile anything under -stable until this
change will be committed)

-- 
http://ache.vniz.net/
___
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"