Re: svn commit: r294773 - in head/etc: . defaults periodic/daily rc.d

2016-05-31 Thread Cy Schubert
In message <0100015509c22d19-fb9e2052-3ab3-4f80-b697-273cebbedcb5-00@ema
il.
amazonses.com>, Colin Percival writes:
> On 01/25/16 23:06, Cy Schubert wrote:
> > Author: cy
> > Date: Tue Jan 26 07:06:44 2016
> > New Revision: 294773
> > URL: https://svnweb.freebsd.org/changeset/base/294773
> > 
> > Log:
> >   Add support for automatic leap-second file updates.
> >   [...]
> > Added: head/etc/periodic/daily/480.leapfile-ntpd
> > ===
> ===
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/etc/periodic/daily/480.leapfile-ntpd   Tue Jan 26 07:06:44 201
> 6 (r294773)
> > [...]
> > +   case "$daily_ntpd_avoid_congestion" in
> > +   [Yy][Ee][Ss])
> > +   # Avoid dogpiling
> > +   (sleep $(jot -r 1 0 86400); service ntpd fetch) &
> > +   ;;
> > +   *)
> > +   service ntpd fetch
> > +   ;;
> 
> Can we change this to 'service ntpd onefetch'?  If someone turns on this
> periodic script, I think it's safe to assume that they want it to run,
> even if they don't have ntpd running.  (In my case, I have some systems
> where `ntpd -q` runs from cron but I don't want to leave the daemon running
> continuously.)

Sounds good. Committed. Thanks for the suggestion.


-- 
Cheers,
Cy Schubert  or 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


svn commit: r301102 - head/etc/periodic/daily

2016-05-31 Thread Cy Schubert
Author: cy
Date: Wed Jun  1 04:37:43 2016
New Revision: 301102
URL: https://svnweb.freebsd.org/changeset/base/301102

Log:
  Don't rely on $ntpd_enable to periodically fetch the latest
  leapfile.
  
  Suggested by: cperciva
  MFC after:1 week

Modified:
  head/etc/periodic/daily/480.leapfile-ntpd

Modified: head/etc/periodic/daily/480.leapfile-ntpd
==
--- head/etc/periodic/daily/480.leapfile-ntpd   Wed Jun  1 04:18:55 2016
(r301101)
+++ head/etc/periodic/daily/480.leapfile-ntpd   Wed Jun  1 04:37:43 2016
(r301102)
@@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in
case "$daily_ntpd_avoid_congestion" in
[Yy][Ee][Ss])
# Avoid dogpiling
-   (sleep $(jot -r 1 0 86400); service ntpd fetch) &
+   (sleep $(jot -r 1 0 86400); service ntpd onefetch) &
;;
*)
-   service ntpd fetch
+   service ntpd onefetch
;;
esac
;;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301101 - head/release/tools

2016-05-31 Thread Glen Barber
Author: gjb
Date: Wed Jun  1 04:18:55 2016
New Revision: 301101
URL: https://svnweb.freebsd.org/changeset/base/301101

Log:
  Turn off nfsv4acls for arm/armv6 builds, which has an impact
  on performance, especially with SD cards on certain SoCs.
  
  Requested by: trasz
  Discussed with:   ian, kientzle
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Wed Jun  1 04:07:33 2016(r301100)
+++ head/release/tools/arm.subr Wed Jun  1 04:18:55 2016(r301101)
@@ -72,7 +72,6 @@ arm_create_disk() {
chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2
chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a
-   chroot ${CHROOTDIR} tunefs -N enable /dev/${mddev}s2a
 
return 0
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301100 - in stable/10/sys: kern sys ufs/ufs

2016-05-31 Thread Konstantin Belousov
Author: kib
Date: Wed Jun  1 04:07:33 2016
New Revision: 301100
URL: https://svnweb.freebsd.org/changeset/base/301100

Log:
  MFC r300142:
  Ensure that ftruncate(2) is performed synchronously when file is
  opened in O_SYNC mode, at least for UFS.

Modified:
  stable/10/sys/kern/vfs_vnops.c
  stable/10/sys/sys/vnode.h
  stable/10/sys/ufs/ufs/ufs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_vnops.c
==
--- stable/10/sys/kern/vfs_vnops.c  Wed Jun  1 04:03:55 2016
(r301099)
+++ stable/10/sys/kern/vfs_vnops.c  Wed Jun  1 04:07:33 2016
(r301100)
@@ -1372,6 +1372,8 @@ vn_truncate(struct file *fp, off_t lengt
if (error == 0) {
VATTR_NULL();
vattr.va_size = length;
+   if ((fp->f_flag & O_FSYNC) != 0)
+   vattr.va_vaflags |= VA_SYNC;
error = VOP_SETATTR(vp, , fp->f_cred);
}
 out:

Modified: stable/10/sys/sys/vnode.h
==
--- stable/10/sys/sys/vnode.h   Wed Jun  1 04:03:55 2016(r301099)
+++ stable/10/sys/sys/vnode.h   Wed Jun  1 04:07:33 2016(r301100)
@@ -286,6 +286,7 @@ struct vattr {
  */
 #defineVA_UTIMES_NULL  0x01/* utimes argument was NULL */
 #defineVA_EXCLUSIVE0x02/* exclusive create request */
+#defineVA_SYNC 0x04/* O_SYNC truncation */
 
 /*
  * Flags for ioflag. (high 16 bits used to ask for read-ahead and

Modified: stable/10/sys/ufs/ufs/ufs_vnops.c
==
--- stable/10/sys/ufs/ufs/ufs_vnops.c   Wed Jun  1 04:03:55 2016
(r301099)
+++ stable/10/sys/ufs/ufs/ufs_vnops.c   Wed Jun  1 04:07:33 2016
(r301100)
@@ -626,7 +626,8 @@ ufs_setattr(ap)
 */
return (0);
}
-   if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL,
+   if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL |
+   ((vap->va_vaflags & VA_SYNC) != 0 ? IO_SYNC : 0),
cred)) != 0)
return (error);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301099 - stable/10/sys/vm

2016-05-31 Thread Konstantin Belousov
Author: kib
Date: Wed Jun  1 04:03:55 2016
New Revision: 301099
URL: https://svnweb.freebsd.org/changeset/base/301099

Log:
  MFC r300622:
  In vm_page_cache(), only drop the vnode after radix insert failure
  for empty page cache when the object type is OBJT_VNODE.

Modified:
  stable/10/sys/vm/vm_page.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_page.c
==
--- stable/10/sys/vm/vm_page.c  Wed Jun  1 04:01:48 2016(r301098)
+++ stable/10/sys/vm/vm_page.c  Wed Jun  1 04:03:55 2016(r301099)
@@ -2582,7 +2582,8 @@ vm_page_cache(vm_page_t m)
cache_was_empty = vm_radix_is_empty(>cache);
if (vm_radix_insert(>cache, m)) {
mtx_unlock(_page_queue_free_mtx);
-   if (object->resident_page_count == 0)
+   if (object->type == OBJT_VNODE &&
+   object->resident_page_count == 0)
vdrop(object->handle);
m->object = NULL;
vm_page_free(m);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301098 - stable/10/sys/vm

2016-05-31 Thread Konstantin Belousov
Author: kib
Date: Wed Jun  1 04:01:48 2016
New Revision: 301098
URL: https://svnweb.freebsd.org/changeset/base/301098

Log:
  MFC r300596:
  In vm_page_alloc_contig(), on vm_page_insert() failure, mark each
  freed page as VPO_UNMANAGED.  Otherwise vm_pge_free_toq() insists on
  owning the page lock.

Modified:
  stable/10/sys/vm/vm_page.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_page.c
==
--- stable/10/sys/vm/vm_page.c  Wed Jun  1 03:49:22 2016(r301097)
+++ stable/10/sys/vm/vm_page.c  Wed Jun  1 04:01:48 2016(r301098)
@@ -1838,8 +1838,10 @@ retry:
m < _ret[npages]; m++) {
if ((req & VM_ALLOC_WIRED) != 0)
m->wire_count = 0;
-   if (m >= m_tmp)
+   if (m >= m_tmp) {
m->object = NULL;
+   m->oflags |= VPO_UNMANAGED;
+   }
vm_page_free(m);
}
return (NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301097 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:49:22 2016
New Revision: 301097
URL: https://svnweb.freebsd.org/changeset/base/301097

Log:
  [ath_hal] implement shared PA handling checks, based on ath9k.
  
  These are apparently conditional on there being a shared PA/LNA, which
  at least on AR9462/QCA9535 devices I have isn't a thing.
  
  I'm .. not yet sure which devices it /is/ a thing, so I'll come back
  to that.
  
  Tested:
  
  * QCA9565 STA + bluetooth
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cWed Jun  1 
03:36:31 2016(r301096)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cWed Jun  1 
03:49:22 2016(r301097)
@@ -472,9 +472,11 @@ void ar9300_mci_mute_bt(struct ath_hal *
  * 1. reset not after resuming from full sleep
  * 2. before reset MCI RX, to quiet BT and avoid MCI RX misalignment
  */
-HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n");
-ar9300_mci_send_lna_take(ah, AH_TRUE);
-OS_DELAY(5);
+if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) {
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n");
+ar9300_mci_send_lna_take(ah, AH_TRUE);
+OS_DELAY(5);
+}
 HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send sys sleeping\n");
 ar9300_mci_send_sys_sleeping(ah, AH_TRUE);
 }
@@ -498,7 +500,7 @@ static void ar9300_mci_observation_set_u
 HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called; config=0x%08x\n",
 __func__, ah->ah_config.ath_hal_mci_config);
 
-if (ah->ah_config.ath_hal_mci_config & 
+if (ah->ah_config.ath_hal_mci_config &
 ATH_MCI_CONFIG_MCI_OBS_MCI)
 {
 HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_MCI\n", __func__);
@@ -846,7 +848,9 @@ static void ar9300_mci_prep_interface(st
 AR_MCI_INTERRUPT_RX_MSG_CONT_RST);
 OS_REG_WRITE(ah, AR_MCI_INTERRUPT_RAW, AR_MCI_INTERRUPT_BT_PRI);
 
-if (AR_SREV_JUPITER_10(ah) || ahp->ah_mci_coex_is_2g) {
+if (AR_SREV_JUPITER_10(ah) ||
+   (ahp->ah_mci_coex_is_2g &&
+MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) {
 /* Send LNA_TRANS */
 HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) %s: Send LNA_TRANS to 
BT\n", 
 __func__);
@@ -856,8 +860,8 @@ static void ar9300_mci_prep_interface(st
 }
 
 if (AR_SREV_JUPITER_10(ah) ||
-(ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update))
-{
+(ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update &&
+MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) {
 if (ar9300_mci_wait_for_interrupt(ah, AR_MCI_INTERRUPT_RX_MSG_RAW, 
 AR_MCI_INTERRUPT_RX_MSG_LNA_INFO, mci_timeout)) {
 HALDEBUG(ah, HAL_DEBUG_BT_COEX, 
@@ -1153,7 +1157,11 @@ void ar9300_mci_reset(struct ath_hal *ah
 OS_REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE,
  (SM(0xe801, AR_MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR) |
   SM(0x, AR_MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM)));
-OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) {
+OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+} else {
+OS_REG_SET_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+}
 
 if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 ar9300_mci_observation_set_up(ah);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Allan Jude
On 2016-05-31 14:44, Allan Jude wrote:
> On 2016-05-31 14:36, Nikolai Lifanov wrote:
>> On 05/31/2016 03:28, Jan Beich wrote:
>>> Allan Jude  writes:
>>>
 Author: allanjude
 Date: Tue May 31 04:12:14 2016
 New Revision: 301010
 URL: https://svnweb.freebsd.org/changeset/base/301010

 Log:
   Connect the SHA-512t256 and Skein hashing algorithms to ZFS

   Support for the new hashing algorithms in ZFS was introduced in
 r289422
   However it was disconnected because FreeBSD lacked implementations of
   SHA-512 (truncated to 256 bits), and Skein.

   These implementations were introduced in r300921 and r300966
 respectively

   This commit connects them to ZFS and enabled these new checksum
 algorithms

   This new algorithms are not supported by the boot blocks, so do
 not use them
   on your root dataset if you boot from ZFS.
>>>
>>> Can you document the feature and booting caveat in zpool-features(7)
>>> manpage?
>>> And Illumos seems to limit booting support to pools vs. datasets.
>>>
>>
>> +1. Also, zfs(8) needs to be updated.
>>
>>>   Booting off of pools using skein is NOT supported -- any attempt to
>>>   enable skein on a root pool will fail with an error.
>>>
>>> https://illumos.org/man/5/zpool-features
>>>
>>
>>
> 
> Yeah, i thought these were included in the original MFV, I'll add them
> 

r301096 updates zpool-features(7) and zfs(8)

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


svn commit: r301096 - in head/cddl/contrib/opensolaris/cmd: zfs zpool

2016-05-31 Thread Allan Jude
Author: allanjude
Date: Wed Jun  1 03:36:31 2016
New Revision: 301096
URL: https://svnweb.freebsd.org/changeset/base/301096

Log:
  Update zfs(8) and zpool-features(7) man pages with new hashing algorithms
  
  Sponsored by: ScaleEngine Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Jun  1 03:27:33 2016
(r301095)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Jun  1 03:36:31 2016
(r301096)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 24, 2015
+.Dd May 31, 2016
 .Dt ZFS 8
 .Os
 .Sh NAME
@@ -940,7 +940,7 @@ command or unmounted by the
 command.
 .Pp
 This property is not inherited.
-.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity
+.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | 
noparity | sha512 | skein
 Controls the checksum used to verify data integrity. The default value is
 .Cm on ,
 which automatically selects an appropriate algorithm (currently,
@@ -957,6 +957,16 @@ not be used by any other dataset.
 Disabling checksums is
 .Em NOT
 a recommended practice.
+The
+.Sy sha512 ,
+and
+.Sy skein
+checksum algorithms require enabling the appropriate features on the pool.
+Please see
+.Xr zpool-features 7
+for more information on these algorithms.
+.Pp
+Changing this property affects only newly-written data.
 .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle 
| Cm lz4
 Controls the compression algorithm used for this dataset.
 Setting compression to
@@ -1036,7 +1046,7 @@ Changing this property only affects newl
 property at file system creation time by using the
 .Fl o Cm copies= Ns Ar N
 option.
-.It Sy dedup Ns = Ns Cm on | off | verify | sha256 Ns Op Cm ,verify
+.It Sy dedup Ns = Ns Cm on | off | verify | sha256 Ns Oo Cm ,verify Oc | Sy 
sha512 Ns Oo Cm ,verify Oc | Sy skein Ns Oo Cm ,verify Oc
 Configures deduplication for a dataset. The default value is
 .Cm off .
 The default deduplication checksum is

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jun  1 
03:27:33 2016(r301095)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jun  1 
03:36:31 2016(r301096)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 10, 2014
+.Dd May 31, 2016
 .Dt ZPOOL-FEATURES 7
 .Os
 .Sh NAME
@@ -454,6 +454,97 @@ Please note that booting from datasets t
 supported by the
 .Fx
 boot loader.
+.It Sy sha512
+.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:sha512"
+.It GUID Ta org.illumos:sha512
+.It READ\-ONLY COMPATIBLE Ta no
+.It DEPENDENCIES Ta none
+.El
+.Pp
+The
+.Sy sha512
+feature enables the use of the SHA-512/256 truncated hash algorithm
+.Pq FIPS 180-4
+for checksum and dedup.
+The native 64-bit arithmetic of SHA-512 provides an approximate 50%
+performance boost over SHA-256 on 64-bit hardware and is thus a good
+minimum-change replacement candidate for systems where hash performance is
+important, but these systems cannot for whatever reason utilize the faster
+.Sy skein
+algorithms.
+.Pp
+When the
+.Sy sha512
+feature is set to
+.Sy enabled ,
+the administrator can turn on the
+.Sysha512
+checksum on any dataset using the
+.Dl # zfs set checksum=sha512 Ar dataset
+command.
+This feature becomes
+.Sy active
+once a
+.Sy checksum
+property has been set to
+.Sy sha512 ,
+and will return to being
+.Sy enabled
+once all filesystems that have ever had their checksum set to
+.Sy sha512
+are destroyed.
+.Pp
+Booting off of a pools utilizing SHA-512/256 is
+.Em NOT
+yet supported.
+.It Sy skein
+.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:skein"
+.It GUID Ta org.illumos:skein
+.It READ\-ONLY COMPATIBLE Ta no
+.It DEPENDENCIES Ta none
+.El
+.Pp
+The
+.Sy skein
+feature enables the use of the Skein hash algorithm for checksum and dedup.
+Skein is a high-performance secure hash algorithm that was a finalist in the
+NIST SHA-3 competition.
+It provides a very high security margin and high performance on 64-bit hardware
+.Pq 80% faster than SHA-256 .
+This implementation also utilizes the new salted checksumming functionality in
+ZFS, which means that the checksum is pre-seeded with a secret 256-bit random
+key
+.Pq stored on the pool
+before being fed the data block to be checksummed.
+Thus the produced checksums are unique to a given pool, preventing hash
+collision attacks on systems with dedup.
+.Pp
+When the
+.Sy skein
+feature is set to
+.Sy enabled ,
+the administrator can turn on the
+.Sy skein
+checksum on any dataset using the
+.Dl # zfs set checksum=skein Ar dataset
+command.
+This feature becomes
+.Sy active
+once a
+.Sy checksum

svn commit: r301095 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:27:33 2016
New Revision: 301095
URL: https://svnweb.freebsd.org/changeset/base/301095

Log:
  [ath_hal] add MCI bits from ath9k for QCA9565
  
  * Add extra debugging - the weights debugging is really useful to ensure
things are programmed into the wlan coexistence table.  The weights are
what traffic priority each of the various modes get (tx, tx-high-priority,
rx-beacon, etc) if they're all zero, things work very poorly.
  
  * Add in coex init routines from ath9k for AR9462 and QCA9565 1ANT and 2ANT.
This control things like beacon stomping, ACK handling, antennas, PA/LNA
shared, etc.
  
  * Some ancillary bits.
  
  TODO:
  
  * There's some conditional stuff around MCI_ANT_ARCH_PA_LNA_SHARED() in ath9k
which doesn't always enable force-on LNA.  That'll have to be examined
and merged in as appropriate.
  
  Obtained from:linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cWed Jun  1 
03:24:53 2016(r301094)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cWed Jun  1 
03:27:33 2016(r301095)
@@ -73,6 +73,10 @@ void ar9300_mci_osla_setup(struct ath_ha
 if (!(ah->ah_config.ath_hal_mci_config &
 ATH_MCI_CONFIG_DISABLE_AGGR_THRESH))
 {
+
+if (AR_SREV_APHRODITE(ah))
+OS_REG_RMW_FIELD(ah, AR_MCI_MISC, AR_MCI_MISC_HW_FIX_EN, 1);
+
 thresh = MS(ah->ah_config.ath_hal_mci_config,
 ATH_MCI_CONFIG_AGGR_THRESH);
 OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL,
@@ -147,11 +151,11 @@ static int32_t ar9300_mci_wait_for_inter
 }
 
 if (time_out <= 0) {
-HALDEBUG(ah, HAL_DEBUG_BT_COEX, 
+HALDEBUG(ah, HAL_DEBUG_BT_COEX,
 "(MCI) %s: Wait for Reg0x%08x = 0x%08x timeout.\n",
 __func__, address, bit_position);
 HALDEBUG(ah, HAL_DEBUG_BT_COEX,
-"(MCI) INT_RAW = 0x%08x, RX_MSG_RAW = 0x%08x",
+"(MCI) INT_RAW = 0x%08x, RX_MSG_RAW = 0x%08x\n",
 OS_REG_READ(ah, AR_MCI_INTERRUPT_RAW),
 OS_REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW));
 time_out = 0;
@@ -450,6 +454,9 @@ void ar9300_mci_2g5g_switch(struct ath_h
 
 void ar9300_mci_mute_bt(struct ath_hal *ah)
 {
+
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__);
+
 /* disable all MCI messages */ 
 OS_REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0x);
 OS_REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0x);
@@ -488,10 +495,13 @@ static void ar9300_mci_observation_set_u
 OS_REG_WRITE(ah, AR_PHY_TEST, 0x0008); // a360
 OS_REG_WRITE(ah, AR_PHY_TEST_CTL_STATUS, 0xe000); // a364
 */
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called; config=0x%08x\n",
+__func__, ah->ah_config.ath_hal_mci_config);
 
 if (ah->ah_config.ath_hal_mci_config & 
 ATH_MCI_CONFIG_MCI_OBS_MCI)
 {
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_MCI\n", __func__);
 ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_MCI_WLAN_DATA);
 ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_MCI_WLAN_CLK);
 ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_MCI_BT_DATA);
@@ -500,6 +510,7 @@ static void ar9300_mci_observation_set_u
 else if (ah->ah_config.ath_hal_mci_config & 
 ATH_MCI_CONFIG_MCI_OBS_TXRX)
 {
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_TXRX\n", __func__);
 ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_WL_IN_TX);
 ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_WL_IN_RX);
 ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_TX);
@@ -509,6 +520,7 @@ static void ar9300_mci_observation_set_u
 else if (ah->ah_config.ath_hal_mci_config & 
 ATH_MCI_CONFIG_MCI_OBS_BT)
 {
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_BT\n", __func__);
 ar9300_gpio_cfg_output(ah, 3, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_TX);
 ar9300_gpio_cfg_output(ah, 2, HAL_GPIO_OUTPUT_MUX_AS_BT_IN_RX);
 ar9300_gpio_cfg_output(ah, 1, HAL_GPIO_OUTPUT_MUX_AS_MCI_BT_DATA);
@@ -913,6 +925,68 @@ void ar9300_mci_enable_interrupt(struct 
 AR_MCI_INTERRUPT_RX_MSG_DEFAULT);
 }
 
+static void ar9300_mci_set_btcoex_ctrl_9565_1ANT(struct ath_hal *ah)
+{
+uint32_t regval;
+
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called\n", __func__);
+regval = SM(1, AR_BTCOEX_CTRL_JUPITER_MODE) |
+  SM(1, AR_BTCOEX_CTRL_WBTIMER_EN) |
+  SM(1, AR_BTCOEX_CTRL_PA_SHARED) |
+  SM(1, AR_BTCOEX_CTRL_LNA_SHARED) |
+  SM(1, AR_BTCOEX_CTRL_NUM_ANTENNAS) |
+  SM(1, AR_BTCOEX_CTRL_RX_CHAIN_MASK) |
+  SM(0, AR_BTCOEX_CTRL_1_CHAIN_ACK) |
+  SM(0, AR_BTCOEX_CTRL_1_CHAIN_BCN) |
+  SM(0, 

svn commit: r301094 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:24:53 2016
New Revision: 301094
URL: https://svnweb.freebsd.org/changeset/base/301094

Log:
  [ath_hal] add support for QCA9565 for configuring the bluetooth antenna LNA 
diversity.
  
  Notably, this also sets AR_BTCOEX_WL_LNADIV to FORCE_ON, so LNA diversity
  is always enabled and under control of the wifi chip.
  
  Tested:
  
  * QCA9565, STA + bluetooth mode
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Wed Jun  1 
03:21:23 2016(r301093)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Wed Jun  1 
03:24:53 2016(r301094)
@@ -5340,6 +5340,9 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM
 
 ar9300_set_smart_antenna(ah, ahp->ah_smartantenna_enable);
 
+if (AR_SREV_APHRODITE(ah) && ahp->ah_lna_div_use_bt_ant_enable)
+OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON);
+
 if (ahp->ah_skip_rx_iq_cal && !is_scan) {
 /* restore RX Cal result if existing */
 ar9300_rx_iq_cal_restore(ah);
@@ -6385,6 +6388,9 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(s
 struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
 HAL_CAPABILITIES *pcap = >ah_caps;
 
+HALDEBUG(ah, HAL_DEBUG_RESET | HAL_DEBUG_BT_COEX,
+  "%s: called; enable=%d\n", __func__, enable);
+
 if (AR_SREV_POSEIDON(ah)) {
 // Make sure this scheme is only used for WB225(Astra)
 ahp->ah_lna_div_use_bt_ant_enable = enable;
@@ -6454,10 +6460,35 @@ ar9300_ant_ctrl_set_lna_div_use_bt_ant(s
 }
 
 return AH_TRUE;
-} else {
+} else if (AR_SREV_APHRODITE(ah)) {
+ahp->ah_lna_div_use_bt_ant_enable = enable;
+if (enable) {
+OS_REG_SET_BIT(ah, AR_PHY_MC_GAIN_CTRL, ANT_DIV_ENABLE);
+OS_REG_SET_BIT(ah, AR_PHY_MC_GAIN_CTRL, (1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT));
+OS_REG_SET_BIT(ah, AR_PHY_CCK_DETECT, 
AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV);
+OS_REG_SET_BIT(ah, AR_PHY_RESTART, 
RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK);
+OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, 
AR_BTCOEX_WL_LNADIV_FORCE_ON);
+} else {
+OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL, ANT_DIV_ENABLE);
+OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL, (1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT));
+OS_REG_CLR_BIT(ah, AR_PHY_CCK_DETECT, 
AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV);
+OS_REG_CLR_BIT(ah, AR_PHY_RESTART, 
RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK);
+OS_REG_CLR_BIT(ah, AR_BTCOEX_WL_LNADIV, 
AR_BTCOEX_WL_LNADIV_FORCE_ON);
+
+regval = OS_REG_READ(ah, AR_PHY_MC_GAIN_CTRL);
+regval &= (~(MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_LNACONF__MASK |
+ MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_LNACONF__MASK |
+ MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_GAINTB__MASK |
+ MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_GAINTB__MASK));
+regval |= (HAL_ANT_DIV_COMB_LNA1 <<
+   MULTICHAIN_GAIN_CTRL__ANT_DIV_MAIN_LNACONF__SHIFT);
+regval |= (HAL_ANT_DIV_COMB_LNA2 <<
+   MULTICHAIN_GAIN_CTRL__ANT_DIV_ALT_LNACONF__SHIFT);
+ 
+OS_REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval);
+}
 return AH_TRUE;
 }
-
-/* XXX TODO: Add AR9565 support? */
+return AH_TRUE;
 }
 #endif /* ATH_ANT_DIV_COMB */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301092 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:20:55 2016
New Revision: 301092
URL: https://svnweb.freebsd.org/changeset/base/301092

Log:
  [ath_hal] add QCA9565 bluteooth antenna control.
  
  This configures the LNA antenna diversity control, which should be on
  if wlan owns the LNA for bluetooth coexistence.  Otherwise, make sure
  it's off.
  
  I think this is eventually intended to allow 1-antenna bluetooth +
  wifi setups for QCA9565, but I'm not sure where that's actually configured
  in ath9k.
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Wed Jun  1 
03:17:36 2016(r301091)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Wed Jun  1 
03:20:55 2016(r301092)
@@ -1643,6 +1643,10 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at
 u_int32_t xlan_gpio_cfg;
 u_int8_t  i;
 
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: use_bt_ant_enable=%d\n",
+  __func__, ahp->ah_lna_div_use_bt_ant_enable);
+
+/* XXX TODO: only if rx_gain_idx == 0 */
 if (AR_SREV_POSEIDON(ah)) {
 xlan_gpio_cfg = ah->ah_config.ath_hal_ext_lna_ctl_gpio;
 if (xlan_gpio_cfg) {
@@ -1733,7 +1737,7 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at
 AR_PHY_SWITCH_CHAIN_2, AR_SWITCH_TABLE_ALL, value);
 }
 }
-if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah)) {
+if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) {
 value = ar9300_eeprom_get(ahp, EEP_ANTDIV_control);
 /* main_lnaconf, alt_lnaconf, main_tb, alt_tb */
 regval = OS_REG_READ(ah, AR_PHY_MC_GAIN_CTRL);
@@ -1747,6 +1751,29 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at
 if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == 
TRUE) ) {
 regval |= ANT_DIV_ENABLE;
 }
+if (AR_SREV_APHRODITE(ah)) {
+if (ahp->ah_lna_div_use_bt_ant_enable) {
+regval |= (1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT);
+
+OS_REG_SET_BIT(ah, AR_PHY_RESTART,
+RESTART__ENABLE_ANT_FAST_DIV_M2FLAG__MASK);
+
+/* Force WLAN LNA diversity ON */
+OS_REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV,
+AR_BTCOEX_WL_LNADIV_FORCE_ON);
+} else {
+regval &= ~(1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_DIV_LNADIV__SHIFT);
+regval &= ~(1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT);
+
+OS_REG_CLR_BIT(ah, AR_PHY_MC_GAIN_CTRL,
+(1 << 
MULTICHAIN_GAIN_CTRL__ENABLE_ANT_SW_RX_PROT__SHIFT));
+
+/* Force WLAN LNA diversity OFF */
+OS_REG_CLR_BIT(ah, AR_BTCOEX_WL_LNADIV,
+AR_BTCOEX_WL_LNADIV_FORCE_ON);
+}
+}
+
 #endif  /* ATH_ANT_DIV_COMB */
 OS_REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval);
 
@@ -1756,7 +1783,8 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct at
 regval |= ((value >> 7) & 0x1) << 
   BBB_SIG_DETECT__ENABLE_ANT_FAST_DIV__SHIFT;
 #if ATH_ANT_DIV_COMB
-if ( AR_SREV_POSEIDON(ah) && (ahp->ah_lna_div_use_bt_ant_enable == 
TRUE) ) {
+if ((AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah))
+  && (ahp->ah_lna_div_use_bt_ant_enable == TRUE) ) {
 regval |= FAST_DIV_ENABLE;
 }
 #endif  /* ATH_ANT_DIV_COMB */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301093 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:21:23 2016
New Revision: 301093
URL: https://svnweb.freebsd.org/changeset/base/301093

Log:
  [ath_hal] Allow the BT antenna diversity option to be enabled for QCA9565.
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c   Wed Jun  1 
03:20:55 2016(r301092)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c   Wed Jun  1 
03:21:23 2016(r301093)
@@ -2457,11 +2457,13 @@ static void
 ar9300_bt_coex_antenna_diversity(struct ath_hal *ah, u_int32_t value)
 {
 struct ath_hal_9300 *ahp = AH9300(ah);
-#if ATH_ANT_DIV_COMB
+#if ATH_ANT_DIV_COMB
 //struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
 const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan;
 #endif
 
+HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called, value=%d\n", __func__, value);
+
 if (ahp->ah_bt_coex_flag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW)
 {
 if (ahp->ah_diversity_control == HAL_ANT_VARIABLE)
@@ -2494,7 +2496,7 @@ ar9300_bt_coex_set_parameter(struct ath_
 break;
 
 case HAL_BT_COEX_ANTENNA_DIVERSITY:
-if (AR_SREV_POSEIDON(ah)) {
+if (AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) {
 ahp->ah_bt_coex_flag |= HAL_BT_COEX_FLAG_ANT_DIV_ALLOW;
 if (value) {
 ahp->ah_bt_coex_flag |= HAL_BT_COEX_FLAG_ANT_DIV_ENABLE;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301091 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 03:17:36 2016
New Revision: 301091
URL: https://svnweb.freebsd.org/changeset/base/301091

Log:
  [ath_hal] add extra debugging for MCI interrupts.

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Wed Jun  1 
02:30:06 2016(r301090)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Wed Jun  1 
03:17:36 2016(r301091)
@@ -389,6 +389,8 @@ ar9300_get_pending_interrupts(
 if (int_rx_msg & AR_MCI_INTERRUPT_RX_MSG_CONT_INFO) {
 ahp->ah_mci_cont_status = 
 OS_REG_READ(ah, AR_MCI_CONT_STATUS);
+HALDEBUG(ah, HAL_DEBUG_BT_COEX,
+"(MCI) cont_status=0x%08x\n", ahp->ah_mci_cont_status);
 }
 OS_REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_RAW, 
 int_rx_msg);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-05-31 Thread Mark Johnston
Author: markj
Date: Wed Jun  1 02:30:06 2016
New Revision: 301090
URL: https://svnweb.freebsd.org/changeset/base/301090

Log:
  mkimg: Indicate that input file pages are unlikely to be reused.
  
  mkimg(1) uses a swap file to back input file chunks. When the output file
  is being written out, blocks of the swap file are mapped and their contents
  copied. This causes the backing VM pages to enter the active queue, and when
  the output file is large relative to system memory (as is generally the
  case), can result in a shortfall of inactive memory. This causes the
  pagedaemon to aggressively scan the active queue and swap out process
  memory in an attempt to meet the shortfall. Because mkimg's input files
  are typically the intermediate result of some build process, there's no
  need to push them all through the active queue. Use madvise(2) to indicate
  that the backing pages may be reclaimed in preference to active pages. In
  the case of the swap file, these pages will be freed as soon as mkimg
  exits anyway.
  
  When using mkimg on a desktop-class system with large amounts of dirty
  process memory, this change substantially improves mkimg runtime and
  reduces swap usage.
  
  Reviewed by:  marcel
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D6654

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

Modified: head/usr.bin/mkimg/image.c
==
--- head/usr.bin/mkimg/image.c  Wed Jun  1 01:43:46 2016(r301089)
+++ head/usr.bin/mkimg/image.c  Wed Jun  1 02:30:06 2016(r301090)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -315,6 +316,8 @@ image_file_unmap(void *buffer, size_t sz
 
unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
sz = (sz + unit - 1) & ~(unit - 1);
+   if (madvise(buffer, sz, MADV_DONTNEED) != 0)
+   warn("madvise");
munmap(buffer, sz);
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r294773 - in head/etc: . defaults periodic/daily rc.d

2016-05-31 Thread Colin Percival
On 01/25/16 23:06, Cy Schubert wrote:
> Author: cy
> Date: Tue Jan 26 07:06:44 2016
> New Revision: 294773
> URL: https://svnweb.freebsd.org/changeset/base/294773
> 
> Log:
>   Add support for automatic leap-second file updates.
>   [...]
> Added: head/etc/periodic/daily/480.leapfile-ntpd
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Jan 26 07:06:44 2016
> (r294773)
> [...]
> + case "$daily_ntpd_avoid_congestion" in
> + [Yy][Ee][Ss])
> + # Avoid dogpiling
> + (sleep $(jot -r 1 0 86400); service ntpd fetch) &
> + ;;
> + *)
> + service ntpd fetch
> + ;;

Can we change this to 'service ntpd onefetch'?  If someone turns on this
periodic script, I think it's safe to assume that they want it to run,
even if they don't have ntpd running.  (In my case, I have some systems
where `ntpd -q` runs from cron but I don't want to leave the daemon running
continuously.)

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301089 - head/sys/dev/ath/ath_hal

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Wed Jun  1 01:43:46 2016
New Revision: 301089
URL: https://svnweb.freebsd.org/changeset/base/301089

Log:
  [ath_hal] add extra MCI definitions used by the later chips 
(QCA9565/Aphrodite).
  
  Obtained from:Linux ath9k

Modified:
  head/sys/dev/ath/ath_hal/ah_btcoex.h

Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h
==
--- head/sys/dev/ath/ath_hal/ah_btcoex.hTue May 31 23:40:21 2016
(r301088)
+++ head/sys/dev/ath/ath_hal/ah_btcoex.hWed Jun  1 01:43:46 2016
(r301089)
@@ -488,6 +488,17 @@ typedef enum mci_state_type {
 #define ATH_MCI_CONFIG_CLK_DIV  0x3000
 #define ATH_MCI_CONFIG_CLK_DIV_S12
 #define ATH_MCI_CONFIG_DISABLE_TUNING   0x4000
+#define ATH_MCI_CONFIG_DISABLE_AIC  0x8000
+#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN 0x007f
+#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN_S   16
+#define ATH_MCI_CONFIG_NO_QUIET_ACK 0x0080
+#define ATH_MCI_CONFIG_NO_QUIET_ACK_S   23
+#define ATH_MCI_CONFIG_ANT_ARCH 0x0700
+#define ATH_MCI_CONFIG_ANT_ARCH_S   24
+#define ATH_MCI_CONFIG_FORCE_QUIET_ACK  0x0800
+#define ATH_MCI_CONFIG_FORCE_QUIET_ACK_S27
+#define ATH_MCI_CONFIG_FORCE_2CHAIN_ACK 0x1000
+#define ATH_MCI_CONFIG_MCI_STAT_DBG 0x2000
 #define ATH_MCI_CONFIG_MCI_WEIGHT_DBG   0x4000
 #define ATH_MCI_CONFIG_DISABLE_MCI  0x8000
 
@@ -496,6 +507,16 @@ typedef enum mci_state_type {
   ATH_MCI_CONFIG_MCI_OBS_BT )
 #define ATH_MCI_CONFIG_MCI_OBS_GPIO 0x002F
 
+#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_NON_SHARED 0x00
+#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED 0x01
+#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED 0x02
+#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED 0x03
+#define ATH_MCI_ANT_ARCH_3_ANT   0x04
+
+#defineMCI_ANT_ARCH_PA_LNA_SHARED(c)   \
+   ((MS(c, ATH_MCI_CONFIG_ANT_ARCH) == 
ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED) || \
+   (MS(c, ATH_MCI_CONFIG_ANT_ARCH) == 
ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED))
+
 #define ATH_MCI_CONCUR_TX_SHARED_CHN0x01
 #define ATH_MCI_CONCUR_TX_UNSHARED_CHN  0x02
 #define ATH_MCI_CONCUR_TX_DEBUG 0x03
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301023 - head/sys/boot/geli

2016-05-31 Thread Allan Jude
On 2016-05-31 02:31, Xin Li wrote:
> 
> 
> On 5/30/16 23:24, Garrett Cooper wrote:
>> Author: ngie
>> Date: Tue May 31 06:24:09 2016
>> New Revision: 301023
>> URL: https://svnweb.freebsd.org/changeset/base/301023
>>
>> Log:
>>   Add missing libc includes to fix -Wimplicit-function-declaration warnings
>>   
>>   MFC after: 2 weeks
>>   Reported by: clang
>>   Sponsored by: EMC / Isilon Storage Division
>>
>> Modified:
>>   head/sys/boot/geli/geliboot_crypto.c
>>
>> Modified: head/sys/boot/geli/geliboot_crypto.c
>> ==
>> --- head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:00:18 2016
>> (r301022)
>> +++ head/sys/boot/geli/geliboot_crypto.c Tue May 31 06:24:09 2016
>> (r301023)
>> @@ -27,6 +27,10 @@
>>   * $FreeBSD$
>>   */
>>  
>> +#include 
>> +#include 
>> +#include 
>> +
>>  #include "geliboot.h"
> 
> This is wrong, you shouldn't use standard C library in freestanding
> environment.
> 
> It seems that libstand.h is explicitly excluded, why? (in geliboot.h,
> allanjude cc'ed):
> 
> %%%
> /* AES-XTS implementation */
> #define _STAND
> #define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */
> #include 
> 
> %%%
> 
> Cheers,
> 

The boot loader uses sys/common/util.h to avoid needing all of libstand
in size sensitive files like boot2 (7kb) and zfsboot (64kb).
If you then pull in stand.h or string.h, you get conflicting definitions
of the functions like printf and bcmp. The manual defines for STAND_H,
_STRING_H_, _STDIO_H_, etc, are there to block those files being
included by existing library we use, like opencrypto and geli.

Since these are included before geliboot.h, and only compiled into the
libgeliboot.a archive, it would seem to work, although it is probably
confusing to anyone trying to read the code.

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


svn commit: r301088 - head/sys/conf

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 23:40:21 2016
New Revision: 301088
URL: https://svnweb.freebsd.org/changeset/base/301088

Log:
  WITH_META_MDE: Fix machine/include and x86/include issues.
  
  - Fixes 'ln: File exists' errors.
  - Fixes creating include directories in the source directory as well.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue May 31 23:26:45 2016(r301087)
+++ head/sys/conf/kern.post.mk  Tue May 31 23:40:21 2016(r301088)
@@ -285,7 +285,7 @@ ${_ILINKS}:
path=${S}/${.TARGET}/include ;; \
esac ; \
${ECHO} ${.TARGET} "->" $$path ; \
-   ln -s $$path ${.TARGET}
+   ln -fhs $$path ${.TARGET}
 
 # .depend needs include links so we remove them only together.
 kernel-cleandepend: .PHONY

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue May 31 23:26:45 2016(r301087)
+++ head/sys/conf/kmod.mk   Tue May 31 23:40:21 2016(r301088)
@@ -287,7 +287,7 @@ ${_ILINKS}:
esac ; \
path=`(cd $$path && /bin/pwd)` ; \
${ECHO} ${.TARGET:T} "->" $$path ; \
-   ln -sf $$path ${.TARGET:T}
+   ln -fhs $$path ${.TARGET:T}
 
 CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301087 - in head: cddl/usr.sbin/zfsd lib/libdevdctl

2016-05-31 Thread Alan Somers
Author: asomers
Date: Tue May 31 23:26:45 2016
New Revision: 301087
URL: https://svnweb.freebsd.org/changeset/base/301087

Log:
  Coverity fixes for r300906
  
  lib/libdevdctl/consumer.cc
In Consumer::DisconnectFromDevd, don't close the socket if it's
already closed.
  
  cddl/usr.sbin/zfsd/case_file.cc
  lib/libdevdctl/consumer.h
Delete dead code leftover from before devd(8) gained SOCK_SEQPACKET
support
  
  Reported by:  Coverity
  CID:  1356155, 1356169
  Sponsored by: Spectra Logic Corp

Modified:
  head/cddl/usr.sbin/zfsd/case_file.cc
  head/lib/libdevdctl/consumer.cc
  head/lib/libdevdctl/consumer.h

Modified: head/cddl/usr.sbin/zfsd/case_file.cc
==
--- head/cddl/usr.sbin/zfsd/case_file.ccTue May 31 23:14:15 2016
(r301086)
+++ head/cddl/usr.sbin/zfsd/case_file.ccTue May 31 23:26:45 2016
(r301087)
@@ -83,7 +83,6 @@ using std::setfill;
 using std::setw;
 
 using DevdCtl::Event;
-using DevdCtl::EventBuffer;
 using DevdCtl::EventFactory;
 using DevdCtl::EventList;
 using DevdCtl::Guid;

Modified: head/lib/libdevdctl/consumer.cc
==
--- head/lib/libdevdctl/consumer.cc Tue May 31 23:14:15 2016
(r301086)
+++ head/lib/libdevdctl/consumer.cc Tue May 31 23:26:45 2016
(r301087)
@@ -129,10 +129,10 @@ Consumer::ConnectToDevd()
 void
 Consumer::DisconnectFromDevd()
 {
-   if (m_devdSockFD != -1)
+   if (m_devdSockFD != -1) {
syslog(LOG_INFO, "Disconnecting from devd.");
-
-   close(m_devdSockFD);
+   close(m_devdSockFD);
+   }
m_devdSockFD = -1;
 }
 

Modified: head/lib/libdevdctl/consumer.h
==
--- head/lib/libdevdctl/consumer.h  Tue May 31 23:14:15 2016
(r301086)
+++ head/lib/libdevdctl/consumer.h  Tue May 31 23:26:45 2016
(r301087)
@@ -44,8 +44,6 @@ namespace DevdCtl
 
 /*=== Forward Declarations 
===*/
 class Event;
-class EventBuffer;
-class FDReader;
 
 /* Class Declarations 
*/
 /*- DevdCtl::Consumer 
*/
@@ -139,16 +137,6 @@ protected:
 */
intm_devdSockFD;
 
-   /**
-* Reader tied to the devd socket.
-*/
-   FDReader  *m_reader;
-
-   /**
-* Default EventBuffer connected to m_reader.
-*/
-   EventBuffer   *m_eventBuffer;
-
EventFactory   m_eventFactory;
 
/** Queued events for replay. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301086 - head/sys/conf

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 23:14:15 2016
New Revision: 301086
URL: https://svnweb.freebsd.org/changeset/base/301086

Log:
  Define SYSDIR earlier since the defined(FIRMWS) block depends on it.
  
  It uses it in a dependency, which won't work if it is not yet defined.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue May 31 23:12:43 2016(r301085)
+++ head/sys/conf/kmod.mk   Tue May 31 23:14:15 2016(r301086)
@@ -76,6 +76,16 @@ OBJCOPY?=objcopy
 .include 
 .include "config.mk"
 
+# Search for kernel source tree in standard places.
+.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
+.if !defined(SYSDIR) && exists(${_dir}/kern/)
+SYSDIR=${_dir:tA}
+.endif
+.endfor
+.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
+.error "can't find kernel source tree"
+.endif
+
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m
 
 # amd64 and mips use direct linking for kmod, all others use shared binaries
@@ -266,16 +276,6 @@ ${OBJS}: ${_link}
 .endif
 .endfor
 
-# Search for kernel source tree in standard places.
-.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
-.if !defined(SYSDIR) && exists(${_dir}/kern/)
-SYSDIR=${_dir:tA}
-.endif
-.endfor
-.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
-.error "can't find kernel source tree"
-.endif
-
 .NOPATH: ${_ILINKS}
 
 ${_ILINKS}:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301085 - head/sys/conf

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 23:12:43 2016
New Revision: 301085
URL: https://svnweb.freebsd.org/changeset/base/301085

Log:
  Add missed updates for r301079 and r301084.

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkTue May 31 23:08:43 2016(r301084)
+++ head/sys/conf/dtb.mkTue May 31 23:12:43 2016(r301085)
@@ -34,7 +34,7 @@
 # Search for kernel source tree in standard places.
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/)
-SYSDIR=${_dir}
+SYSDIR=${_dir:tA}
 .endif
 .endfor
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
@@ -51,7 +51,7 @@ all: ${DTB}
 
 .if defined(DTS)
 .for _dts in ${DTS}
-${_dts:R:S/$/.dtb/}:   ${_dts}
+${_dts:R:S/$/.dtb/}:   ${_dts} ${OP_META}
@echo Generating ${.TARGET} from ${_dts}
@${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR}
 CLEANFILES+=${_dts:R:S/$/.dtb/}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301084 - in head: share/mk sys/conf

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 23:08:43 2016
New Revision: 301084
URL: https://svnweb.freebsd.org/changeset/base/301084

Log:
  WITH_META_MODE: Resolve SYSDIR to avoid changed build commands.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.kmod.mk
==
--- head/share/mk/bsd.kmod.mk   Tue May 31 22:37:11 2016(r301083)
+++ head/share/mk/bsd.kmod.mk   Tue May 31 23:08:43 2016(r301084)
@@ -4,7 +4,7 @@
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
 ${.CURDIR}/../../../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
-SYSDIR=${_dir}
+SYSDIR=${_dir:tA}
 .endif
 .endfor
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue May 31 22:37:11 2016(r301083)
+++ head/sys/conf/kern.post.mk  Tue May 31 23:08:43 2016(r301084)
@@ -12,7 +12,7 @@
 .if defined(DESTDIR)
 MKMODULESENV+= DESTDIR="${DESTDIR}"
 .endif
-SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
+SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA}
 MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
 .if defined(CONF_CFLAGS)

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue May 31 22:37:11 2016(r301083)
+++ head/sys/conf/kmod.mk   Tue May 31 23:08:43 2016(r301084)
@@ -269,7 +269,7 @@ ${OBJS}: ${_link}
 # Search for kernel source tree in standard places.
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/)
-SYSDIR=${_dir}
+SYSDIR=${_dir:tA}
 .endif
 .endfor
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301083 - head/share/mk

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 22:37:11 2016
New Revision: 301083
URL: https://svnweb.freebsd.org/changeset/base/301083

Log:
  WITH_META_MODE: Require filemon(4) be loaded.
  
  Since META_MODE is being sold and used as a working incremental build, it 
won't
  make much sense if filemon data is excluded.  There is no way to recover
  from that in a subsequent build.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/sys.mk

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkTue May 31 21:58:09 2016(r301082)
+++ head/share/mk/sys.mkTue May 31 22:37:11 2016(r301083)
@@ -52,6 +52,9 @@ META_MODE+=   meta verbose
 META_MODE+=silent=yes
 .endif
 .if !exists(/dev/filemon)
+.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON)
+.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded.
+.endif
 META_MODE+= nofilemon
 .endif
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301079 - in head: share/mk sys/conf

2016-05-31 Thread Bryan Drewery
Author: bdrewery
Date: Tue May 31 21:22:19 2016
New Revision: 301079
URL: https://svnweb.freebsd.org/changeset/base/301079

Log:
  WITH_META_MODE: Mitigate switching from without to with META_MODE.
  
  Adding .META to targets-to-build will ensure that they will rebuild if there
  is no .meta file.
  
  Adding it to all SUFFIXES and objects ensures that at least objects will
  rebuild if there is no .meta file.
  
  This will be reverted if bmake's behavior changes to rebuild on missing .meta
  files.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.dep.mk
  head/share/mk/bsd.info.mk
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.man.mk
  head/share/mk/bsd.nls.mk
  head/share/mk/bsd.prog.mk
  head/share/mk/sys.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkTue May 31 21:21:32 2016(r301078)
+++ head/share/mk/bsd.dep.mkTue May 31 21:22:19 2016(r301079)
@@ -92,7 +92,7 @@ OBJS_DEPEND_GUESS.${_S:R}.o=  ${_S}
 # Lexical analyzers
 .for _LSRC in ${SRCS:M*.l:N*/*}
 .for _LC in ${_LSRC:R}.c
-${_LC}: ${_LSRC}
+${_LC}: ${_LSRC} ${OP_META}
${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC}
 OBJS_DEPEND_GUESS.${_LC:R}.o=  ${_LC}
 SRCS:= ${SRCS:S/${_LSRC}/${_LC}/}
@@ -107,6 +107,7 @@ SRCS:=  ${SRCS:S/${_YSRC}/${_YC}/}
 CLEANFILES+= ${_YC}
 .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h)
 .ORDER: ${_YC} y.tab.h
+${_YC}:${OP_META}
 ${_YC} y.tab.h: ${_YSRC}
${YACC} ${YFLAGS} ${.ALLSRC}
cp y.tab.c ${_YC}
@@ -114,13 +115,14 @@ CLEANFILES+= y.tab.c y.tab.h
 .elif !empty(YFLAGS:M-d)
 .for _YH in ${_YC:R}.h
 .ORDER: ${_YC} ${_YH}
+${_YC}:${OP_META}
 ${_YC} ${_YH}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
 SRCS+= ${_YH}
 CLEANFILES+= ${_YH}
 .endfor
 .else
-${_YC}: ${_YSRC}
+${_YC}: ${_YSRC} ${OP_META}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
 .endif
 OBJS_DEPEND_GUESS.${_YC:R}.o=  ${_YC}
@@ -134,20 +136,20 @@ CFLAGS+=  -I${.OBJDIR}
 .for _DSRC in ${SRCS:M*.d:N*/*}
 .for _D in ${_DSRC:R}
 SRCS+= ${_D}.h
-${_D}.h: ${_DSRC}
+${_D}.h: ${_DSRC} ${OP_META}
${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
 SRCS:= ${SRCS:S/^${_DSRC}$//}
 OBJS+= ${_D}.o
 CLEANFILES+= ${_D}.h ${_D}.o
-${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
+${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${OP_META}
@rm -f ${.TARGET}
${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
 .if defined(LIB)
 CLEANFILES+= ${_D}.So ${_D}.po
-${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
+${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${OP_META}
@rm -f ${.TARGET}
${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
-${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
+${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${OP_META}
@rm -f ${.TARGET}
${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
 .endif
@@ -243,7 +245,7 @@ DPSRCS+= ${SRCS}
 # A .depend file will only be generated if there are commands in
 # beforedepend/_EXTRADEPEND/afterdepend.  The target is kept
 # to allow 'make depend' to generate files.
-${DEPENDFILE}: ${DPSRCS}
+${DEPENDFILE}: ${DPSRCS} ${OP_META}
 .if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
rm -f ${DEPENDFILE}
 .endif

Modified: head/share/mk/bsd.info.mk
==
--- head/share/mk/bsd.info.mk   Tue May 31 21:21:32 2016(r301078)
+++ head/share/mk/bsd.info.mk   Tue May 31 21:22:19 2016(r301079)
@@ -86,18 +86,18 @@ DVIPS2ASCII?=   dvips2ascii
 
 .SUFFIXES: ${ICOMPRESS_EXT} .info .texi .texinfo .dvi .ps .latin1 .html
 
-.texi.info .texinfo.info:
+.texi.info .texinfo.info: ${OP_META}
${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} -I ${SRCDIR} ${.IMPSRC} \
-o ${.TARGET}
 
-.texi.dvi .texinfo.dvi:
+.texi.dvi .texinfo.dvi: ${OP_META}
TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
${TEX} ${.IMPSRC} > ${.IMPSRC:T:R}-la.texi
TEXINPUTS=${.CURDIR}:${SRCDIR}:$$TEXINPUTS \
${TEX} ${.IMPSRC:T:R}-la.texi  ${.TARGET}.new
mv -f ${.TARGET}.new ${.TARGET}
 
-.dvi.ps:
+.dvi.ps: ${OP_META}
${DVIPS} -o ${.TARGET} ${.IMPSRC}
 
-.info.html:
+.info.html: ${OP_META}
${INFO2HTML} ${.IMPSRC}
${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET}
 
@@ -133,7 +133,7 @@ all: ${IFILES}
 .endif
 
 .for x in ${IFILENS}
-${x:S/$/${ICOMPRESS_EXT}/}:${x}
+${x:S/$/${ICOMPRESS_EXT}/}:${x} ${OP_META}
${ICOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
 .endfor
 
@@ -158,7 +158,7 @@ ${x:S/$/-install/}:
 
 .if defined(SRCS)
 CLEANFILES+=   ${INFO}.texi
-${INFO}.texi: ${SRCS}
+${INFO}.texi: ${SRCS} ${OP_META}
cat ${.ALLSRC} > ${.TARGET}
 .endif
 

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

svn commit: r301068 - head/etc/rc.d

2016-05-31 Thread Eric van Gyzen
Author: vangyzen
Date: Tue May 31 18:40:47 2016
New Revision: 301068
URL: https://svnweb.freebsd.org/changeset/base/301068

Log:
  Fix indentation in dhclient rc.d script

Modified:
  head/etc/rc.d/dhclient

Modified: head/etc/rc.d/dhclient
==
--- head/etc/rc.d/dhclient  Tue May 31 18:34:39 2016(r301067)
+++ head/etc/rc.d/dhclient  Tue May 31 18:40:47 2016(r301068)
@@ -30,7 +30,7 @@ dhclient_pre_check()
else
debug "$msg"
fi
-   exit 1
+   exit 1
fi
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301082 - head/sys/arm/allwinner

2016-05-31 Thread Jared McNeill
Author: jmcneill
Date: Tue May 31 21:58:09 2016
New Revision: 301082
URL: https://svnweb.freebsd.org/changeset/base/301082

Log:
  Fix a crash while iterating compat strings when no match is found.
  
  Spotted by:   ian

Modified:
  head/sys/arm/allwinner/aw_ccu.c

Modified: head/sys/arm/allwinner/aw_ccu.c
==
--- head/sys/arm/allwinner/aw_ccu.c Tue May 31 21:34:02 2016
(r301081)
+++ head/sys/arm/allwinner/aw_ccu.c Tue May 31 21:58:09 2016
(r301082)
@@ -192,7 +192,7 @@ aw_ccu_search_compatible(void) 
phandle_t root;
 
root = OF_finddevice("/");
-   for (compat = compat_data; compat_data->ocd_str != NULL; compat++)
+   for (compat = compat_data; compat->ocd_str != NULL; compat++)
if (fdt_is_compatible(root, compat->ocd_str))
break;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301071 - head/sys/sys

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 19:05:41 2016
New Revision: 301071
URL: https://svnweb.freebsd.org/changeset/base/301071

Log:
  Improve POSIX conformance of .
  
  - This header file has always depended on pthread_t, pthread_attr_t,
struct timespec, size_t and uid_t. Only as of POSIX 2008, these
dependencies have been states explicitly. They should now be defined.
  
  - In our implementation, struct sigevent::sigev_notify_attributes has
type "void *" instead of "pthread_attr_t *". My guess is that this was
done to prevent pulling in the pthread types, but this can easily be
avoided by using the underlying structure types.

Modified:
  head/sys/sys/signal.h

Modified: head/sys/sys/signal.h
==
--- head/sys/sys/signal.h   Tue May 31 18:45:52 2016(r301070)
+++ head/sys/sys/signal.h   Tue May 31 19:05:41 2016(r301071)
@@ -45,6 +45,23 @@
 #include/* __MINSIGSTKSZ */
 #include /* sig_atomic_t; trap codes; sigcontext */
 
+#if __POSIX_VISIBLE >= 200809
+
+#include 
+#include 
+
+#ifndef _SIZE_T_DECLARED
+typedef__size_tsize_t;
+#define_SIZE_T_DECLARED
+#endif
+
+#ifndef _UID_T_DECLARED
+typedef__uid_t uid_t;
+#define_UID_T_DECLARED
+#endif
+
+#endif /* __POSIX_VISIBLE >= 200809 */
+
 /*
  * System defined signals.
  */
@@ -160,6 +177,9 @@ union sigval {
 #endif
 
 #if __POSIX_VISIBLE >= 199309
+
+struct pthread_attr;
+
 struct sigevent {
int sigev_notify;   /* Notification type */
int sigev_signo;/* Signal number */
@@ -168,7 +188,7 @@ struct sigevent {
__lwpid_t   _threadid;
struct {
void (*_function)(union sigval);
-   void *_attribute; /* pthread_attr_t * */
+   struct pthread_attr **_attribute;
} _sigev_thread;
unsigned short _kevent_flags;
long __spare__[8];
@@ -190,6 +210,7 @@ struct sigevent {
 #defineSIGEV_KEVENT3   /* Generate a kevent. */
 #defineSIGEV_THREAD_ID 4   /* Send signal to a kernel 
thread. */
 #endif
+
 #endif /* __POSIX_VISIBLE >= 199309 */
 
 #if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301060 - head/sys/arm/arm

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 17:49:47 2016
New Revision: 301060
URL: https://svnweb.freebsd.org/changeset/base/301060

Log:
  Bin interrupts to the correct CPU when we boot on a non-zero CPU.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/arm/gic.c

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Tue May 31 17:30:08 2016(r301059)
+++ head/sys/arm/arm/gic.c  Tue May 31 17:49:47 2016(r301060)
@@ -968,7 +968,7 @@ gic_bind(struct arm_gic_softc *sc, u_int
 
for (mask = 0, cpu = 0; cpu < end; cpu++)
if (CPU_ISSET(cpu, cpus))
-   mask |= 1 << cpu;
+   mask |= 1 << arm_gic_map[cpu];
 
gic_d_write_1(sc, GICD_ITARGETSR(0) + irq, mask);
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301061 - head/sys/dev/sfxge/common

2016-05-31 Thread Andrew Rybchenko
Author: arybchik
Date: Tue May 31 18:04:16 2016
New Revision: 301061
URL: https://svnweb.freebsd.org/changeset/base/301061

Log:
  sfxge(4): regenerate MCDI headers from firmwaresrc .yml
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week

Modified:
  head/sys/dev/sfxge/common/efx_regs_mcdi.h

Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h
==
--- head/sys/dev/sfxge/common/efx_regs_mcdi.h   Tue May 31 17:49:47 2016
(r301060)
+++ head/sys/dev/sfxge/common/efx_regs_mcdi.h   Tue May 31 18:04:16 2016
(r301061)
@@ -5115,16 +5115,20 @@
 #defineMC_CMD_POLL_BIST_MEM_BUS_MC 0x0
 /* enum: CSR IREG bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_CSR 0x1
-/* enum: RX DPCPU bus. */
+/* enum: RX0 DPCPU bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2
 /* enum: TX0 DPCPU bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3
 /* enum: TX1 DPCPU bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4
-/* enum: RX DICPU bus. */
+/* enum: RX0 DICPU bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5
 /* enum: TX DICPU bus. */
 #defineMC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6
+/* enum: RX1 DPCPU bus. */
+#defineMC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX1 0x7
+/* enum: RX1 DICPU bus. */
+#defineMC_CMD_POLL_BIST_MEM_BUS_DICPU_RX1 0x8
 /* Pattern written to RAM / register */
 #defineMC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16
 /* Actual value read from RAM / register */
@@ -6094,6 +6098,8 @@
 #defineMC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1
 #defineMC_CMD_NVRAM_INFO_OUT_TLV_LBN 1
 #defineMC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1
+#defineMC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6
+#defineMC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1
 #defineMC_CMD_NVRAM_INFO_OUT_A_B_LBN 7
 #defineMC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1
 #defineMC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
@@ -6887,6 +6893,8 @@
  * the command will fail with MC_CMD_ERR_FILTERS_PRESENT.
  */
 #defineMC_CMD_WORKAROUND_BUG26807 0x6
+/* enum: Bug 61265 work around (broken EVQ TMR writes). */
+#defineMC_CMD_WORKAROUND_BUG61265 0x7
 /* 0 = disable the workaround indicated by TYPE; any non-zero value = enable
  * the workaround
  */
@@ -7865,8 +7873,10 @@
 #defineNVRAM_PARTITION_TYPE_SPARE_1  0x1100
 /* enum: Spare partition 2 */
 #defineNVRAM_PARTITION_TYPE_SPARE_2  0x1200
-/* enum: Spare partition 3 */
-#defineNVRAM_PARTITION_TYPE_SPARE_3  0x1300
+/* enum: Manufacturing partition. Used during manufacture to pass information
+ * between XJTAG and Manftest.
+ */
+#defineNVRAM_PARTITION_TYPE_MANUFACTURING0x1300
 /* enum: Spare partition 4 */
 #defineNVRAM_PARTITION_TYPE_SPARE_4  0x1400
 /* enum: Spare partition 5 */
@@ -7901,6 +7911,8 @@
 #defineLICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40
 /* enum: Network Access Control */
 #defineLICENSED_APP_ID_NETWORK_ACCESS_CONTROL  0x80
+/* enum: TCP Direct */
+#defineLICENSED_APP_ID_TCP_DIRECT  0x100
 #defineLICENSED_APP_ID_ID_LBN 0
 #defineLICENSED_APP_ID_ID_WIDTH 32
 
@@ -7957,6 +7969,12 @@
 #defineLICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1
 #defineLICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7
 #defineLICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1
+#defineLICENSED_V3_APPS_TCP_DIRECT_LBN 8
+#defineLICENSED_V3_APPS_TCP_DIRECT_WIDTH 1
+#defineLICENSED_V3_APPS_LOW_LATENCY_LBN 9
+#defineLICENSED_V3_APPS_LOW_LATENCY_WIDTH 1
+#defineLICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10
+#defineLICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1
 #defineLICENSED_V3_APPS_MASK_LBN 0
 #defineLICENSED_V3_APPS_MASK_WIDTH 64
 
@@ -7985,6 +8003,8 @@
 #defineLICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1
 #defineLICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8
 #defineLICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1
+#defineLICENSED_V3_FEATURES_EVENT_CUT_THROUGH_LBN 9
+#defineLICENSED_V3_FEATURES_EVENT_CUT_THROUGH_WIDTH 1
 #defineLICENSED_V3_FEATURES_MASK_LBN 0
 #defineLICENSED_V3_FEATURES_MASK_WIDTH 64
 
@@ -8142,6 +8162,109 @@
 /* Only valid if INTRFLAG was true */
 #defineMC_CMD_INIT_EVQ_OUT_IRQ_OFST 0
 
+/* MC_CMD_INIT_EVQ_V2_IN msgrequest */
+#defineMC_CMD_INIT_EVQ_V2_IN_LENMIN 44
+#defineMC_CMD_INIT_EVQ_V2_IN_LENMAX 548
+#defineMC_CMD_INIT_EVQ_V2_IN_LEN(num) (36+8*(num))
+/* Size, in entries */
+#defineMC_CMD_INIT_EVQ_V2_IN_SIZE_OFST 0
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
+#defineMC_CMD_INIT_EVQ_V2_IN_INSTANCE_OFST 4
+/* The initial timer value. The load value is ignored if the timer mode is DIS.
+ */
+#defineMC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_OFST 8

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

2016-05-31 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue May 31 18:15:18 2016
New Revision: 301063
URL: https://svnweb.freebsd.org/changeset/base/301063

Log:
  Document r300906, ZFS fault management daemon
  
  Approved by:  re (gjb, implicit, relnotes)

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

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue May 31 
18:05:17 2016(r301062)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue May 31 
18:15:18 2016(r301063)
@@ -1554,6 +1554,11 @@
code has been updated to take ashift into
account when gathering buffers to be written to the
l2arc device.
+
+  The zfsd daemon has been added,
+   which manages hotspares and replements in drive slots that publish
+   physical paths.
 
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301072 - head/sys/arm64/arm64

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 19:17:32 2016
New Revision: 301072
URL: https://svnweb.freebsd.org/changeset/base/301072

Log:
  dpcpu_init should have also passed in the calculated cpuid, not the
  devicetree ID.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Tue May 31 19:05:41 2016
(r301071)
+++ head/sys/arm64/arm64/mp_machdep.c   Tue May 31 19:17:32 2016
(r301072)
@@ -522,7 +522,7 @@ cpu_init_fdt(u_int id, phandle_t node, u
 
dpcpu[cpuid - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
M_WAITOK | M_ZERO);
-   dpcpu_init(dpcpu[cpuid - 1], id);
+   dpcpu_init(dpcpu[cpuid - 1], cpuid);
 
target_cpu = reg[0];
if (addr_size == 2) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Chris Torek
>That was what I was complaining about.  div.c is for C90 (misspelled
>"ANSI").

It wasn't misspelled when I wrote it.  :-)  The 1989 ANSI C
standard was formally ratified in Dec 1989, and the draft was
pretty firm by the time I wrote the code (which I am sure was also
1989, despite the 1990 copyright; we added or updated all the
copyrights at the last minute, for net-2).  ISO's quick adoption,
and hence the name C90, post-date all of that.

>... div.c hasn't caught up with C99.  C99 broke this by changing
>the rules for integer division to disallow correct rounding for and
>require consistently incorrect rounding.

Specifically, C99 requires truncation towards zero, so that
(-1)/2 = 0 (not -1) and 1/(-2) = 0 (not -1).  You (and I) might
prefer (-1)/2 = -1, but most CPU "integer divide" ops provide
the other result (so that "x >> 1" and "x / 2" are different
when x is negative: "x >> 1" sign extends so that (-1)>>1 == -1).

C90 (and C99) both require div() and ldiv() to behave like most
CPUs, this this truncation-towards-zero behavior, which makes
the two functions kind of pointless in C99.

>Correct rounding for a
>positive divisor is towards minus infinity so that the remainder is
>not negative.  This is modulo arithmetic and has good algebraic
>properties.  C99 requires rounding minus infinity, at least for positive
>divisors, under the extension "reliable integer division".

Did you state this backwards?  For integer divison I see:

When integers are divided, the result of the / operator is the
algebraic quotient with any fractional part discarded.[105] If
the quotient a/b is representable, the expression (a/b)*b + a%b
shall equal a; otherwise, the behavior of both a/b and a%b is
undefined.

which (as footnote 105 notes) is "truncation towards zero", so that
(-1)/2 is 0 and not -1.

>In C90,
>the rounding is implementation-defined, so it may be correct, but it
>is "unreliable" since it can be anything.
>
>In C90, div() is specified as giving "reliable" division, and that is
>what the fixups implement.  This now wastes time to change nothing.

Right -- as long as the compiler must meet C99 rules, div.c
can just use the / and % operators.

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


svn commit: r301081 - head/sys/sys

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 21:34:02 2016
New Revision: 301081
URL: https://svnweb.freebsd.org/changeset/base/301081

Log:
  Make RLIM_INFINITY usable without including .
  
  By using __uint64_t instead of uint64_t, this constant can also be used
  if  is included on its own.

Modified:
  head/sys/sys/resource.h

Modified: head/sys/sys/resource.h
==
--- head/sys/sys/resource.h Tue May 31 21:23:57 2016(r301080)
+++ head/sys/sys/resource.h Tue May 31 21:34:02 2016(r301081)
@@ -108,7 +108,7 @@ struct __wrusage {
 
 #defineRLIM_NLIMITS15  /* number of resource limits */
 
-#defineRLIM_INFINITY   ((rlim_t)(((uint64_t)1 << 63) - 1))
+#defineRLIM_INFINITY   ((rlim_t)(((__uint64_t)1 << 63) - 1))
 /* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301080 - head/cddl/usr.sbin/zfsd

2016-05-31 Thread Pedro F. Giffuni
Author: pfg
Date: Tue May 31 21:23:57 2016
New Revision: 301080
URL: https://svnweb.freebsd.org/changeset/base/301080

Log:
  zfsd: Remove a redundant semicolon,

Modified:
  head/cddl/usr.sbin/zfsd/vdev_iterator.cc

Modified: head/cddl/usr.sbin/zfsd/vdev_iterator.cc
==
--- head/cddl/usr.sbin/zfsd/vdev_iterator.ccTue May 31 21:22:19 2016
(r301079)
+++ head/cddl/usr.sbin/zfsd/vdev_iterator.ccTue May 31 21:23:57 2016
(r301080)
@@ -118,7 +118,7 @@ VdevIterator::Next()
 */
m_vdevQueue.insert(m_vdevQueue.begin(), vdevChildren,
   vdevChildren + numChildren);
-   };
+   }
 
return (vdevConfig);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301077 - head/share/man/man3

2016-05-31 Thread Jilles Tjoelker
Author: jilles
Date: Tue May 31 21:16:34 2016
New Revision: 301077
URL: https://svnweb.freebsd.org/changeset/base/301077

Log:
  Remove mentions that PTHREAD_PROCESS_SHARED is not supported from man pages.
  
  Also add support for process-shared synchronization objects to the HISTORY
  sections where they already exist.

Modified:
  head/share/man/man3/pthread_barrierattr.3
  head/share/man/man3/pthread_condattr.3
  head/share/man/man3/pthread_rwlock_init.3
  head/share/man/man3/pthread_rwlockattr_setpshared.3
  head/share/man/man3/pthread_spin_init.3

Modified: head/share/man/man3/pthread_barrierattr.3
==
--- head/share/man/man3/pthread_barrierattr.3   Tue May 31 21:09:42 2016
(r301076)
+++ head/share/man/man3/pthread_barrierattr.3   Tue May 31 21:16:34 2016
(r301077)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 19, 2004
+.Dd May 31, 2016
 .Dt PTHREAD_BARRIERATTR 3
 .Os
 .Sh NAME
@@ -131,16 +131,5 @@ and in
 .Lb libthr
 in
 .Fx 5.3 .
-.Sh BUGS
-The implementation of
-barriers
-does not fully conform to
-.St -p1003.2
-because the process-shared attribute is ignored in
-.Lb libthr ;
-if any value other than
-.Dv PTHREAD_PROCESS_PRIVATE
-is specified in a call to
-.Fn pthread_barrierattr_setpshared ,
-it will return
-.Er EINVAL .
+Support for process-shared barriers appeared in
+.Fx 11.0 .

Modified: head/share/man/man3/pthread_condattr.3
==
--- head/share/man/man3/pthread_condattr.3  Tue May 31 21:09:42 2016
(r301076)
+++ head/share/man/man3/pthread_condattr.3  Tue May 31 21:16:34 2016
(r301077)
@@ -26,7 +26,7 @@
 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd May 9, 2010
+.Dd May 31, 2016
 .Dt PTHREAD_CONDATTR 3
 .Os
 .Sh NAME
@@ -160,15 +160,3 @@ and
 .Fn pthread_condattr_destroy
 functions conform to
 .St -p1003.1-96
-.Sh BUGS
-The implementation of
-condition variables
-does not fully conform to
-.St -p1003.2
-because the process-shared attribute is ignored;
-if any value other than
-.Dv PTHREAD_PROCESS_PRIVATE
-is specified in a call to
-.Fn pthread_condattr_setpshared ,
-it will return
-.Er EINVAL .

Modified: head/share/man/man3/pthread_rwlock_init.3
==
--- head/share/man/man3/pthread_rwlock_init.3   Tue May 31 21:09:42 2016
(r301076)
+++ head/share/man/man3/pthread_rwlock_init.3   Tue May 31 21:16:34 2016
(r301077)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 1998
+.Dd May 31, 2016
 .Dt PTHREAD_RWLOCK_INIT 3
 .Os
 .Sh NAME
@@ -98,5 +98,3 @@ The
 .Fn pthread_rwlock_init
 function first appeared in
 .Fx 3.0 .
-.Sh BUGS
-The PTHREAD_PROCESS_SHARED attribute is not supported.

Modified: head/share/man/man3/pthread_rwlockattr_setpshared.3
==
--- head/share/man/man3/pthread_rwlockattr_setpshared.3 Tue May 31 21:09:42 
2016(r301076)
+++ head/share/man/man3/pthread_rwlockattr_setpshared.3 Tue May 31 21:16:34 
2016(r301077)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 1998
+.Dd May 31, 2016
 .Dt PTHREAD_RWLOCKATTR_SETPSHARED 3
 .Os
 .Sh NAME
@@ -88,7 +88,5 @@ The
 .Fn pthread_rwlockattr_setpshared
 function first appeared in
 .Fx 3.0 .
-.Sh BUGS
-The
-.Dv PTHREAD_PROCESS_SHARED
-attribute is not supported.
+Support for process-shared read/write locks appeared in
+.Fx 11.0 .

Modified: head/share/man/man3/pthread_spin_init.3
==
--- head/share/man/man3/pthread_spin_init.3 Tue May 31 21:09:42 2016
(r301076)
+++ head/share/man/man3/pthread_spin_init.3 Tue May 31 21:16:34 2016
(r301077)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2004
+.Dd May 31, 2016
 .Dt PTHREAD_SPIN_INIT 3
 .Os
 .Sh NAME
@@ -121,16 +121,5 @@ and in
 .Lb libthr
 in
 .Fx 5.3 .
-.Sh BUGS
-The implementation of
-.Fn pthread_spin_init
-does not fully conform to
-.St -p1003.2
-because the
-.Fa pshared
-argument is ignored in
-.Lb libthr ;
-if any value other than
-.Dv PTHREAD_PROCESS_PRIVATE
-is specified, it returns
-.Er EINVAL .
+Support for process-shared spinlocks appeared in
+.Fx 11.0 .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301073 - head/sys/conf

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 19:19:21 2016
New Revision: 301073
URL: https://svnweb.freebsd.org/changeset/base/301073

Log:
  Attach the generic USB OHCI driver to the arm64 build.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/files.arm64

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Tue May 31 19:17:32 2016(r301072)
+++ head/sys/conf/files.arm64   Tue May 31 19:19:21 2016(r301073)
@@ -74,6 +74,8 @@ dev/psci/psci_arm64.S optionalpsci
 dev/uart/uart_cpu_fdt.coptionaluart fdt
 dev/uart/uart_dev_pl011.c  optionaluart pl011
 dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220
+dev/usb/controller/generic_ohci.c optional ohci fdt
+dev/usb/controller/generic_usb_if.m optional   ohci fdt
 dev/vnic/mrml_bridge.c optionalvnic fdt
 dev/vnic/nic_main.coptionalvnic pci
 dev/vnic/nicvf_main.c  optionalvnic pci pci_iov
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301070 - head/sys/arm64/arm64

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 18:45:52 2016
New Revision: 301070
URL: https://svnweb.freebsd.org/changeset/base/301070

Log:
  Allow the kernel to boot on a CPU where the devicetree has numbered it with
  a non-zero ID. To do this we increment the cpuid of any CPUs with a smaller
  devicetree ID by one to stop them conflicting with the boot CPU.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/mp_machdep.c

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Tue May 31 18:44:33 2016
(r301069)
+++ head/sys/arm64/arm64/mp_machdep.c   Tue May 31 18:45:52 2016
(r301070)
@@ -119,6 +119,13 @@ static uint32_t cpu_reg[MAXCPU][2];
 #endif
 static device_t cpu_list[MAXCPU];
 
+/*
+ * Not all systems boot from the first CPU in the device tree. To work around
+ * this we need to find which CPU we have booted from so when we later
+ * enable the secondary CPUs we skip this one.
+ */
+static int cpu0 = -1;
+
 void mpentry(unsigned long cpuid);
 void init_secondary(uint64_t);
 
@@ -486,6 +493,7 @@ cpu_init_fdt(u_int id, phandle_t node, u
uint64_t target_cpu;
struct pcpu *pcpup;
vm_paddr_t pa;
+   u_int cpuid;
int err;
 
/* Check we are able to start this cpu */
@@ -502,16 +510,19 @@ cpu_init_fdt(u_int id, phandle_t node, u
 #endif
 
/* We are already running on cpu 0 */
-   if (id == 0)
+   if (id == cpu0)
return (1);
 
+   cpuid = id;
+   if (cpuid < cpu0)
+   cpuid++;
 
-   pcpup = &__pcpu[id];
-   pcpu_init(pcpup, id, sizeof(struct pcpu));
+   pcpup = &__pcpu[cpuid];
+   pcpu_init(pcpup, cpuid, sizeof(struct pcpu));
 
-   dpcpu[id - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
+   dpcpu[cpuid - 1] = (void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
M_WAITOK | M_ZERO);
-   dpcpu_init(dpcpu[id - 1], id);
+   dpcpu_init(dpcpu[cpuid - 1], id);
 
target_cpu = reg[0];
if (addr_size == 2) {
@@ -519,21 +530,23 @@ cpu_init_fdt(u_int id, phandle_t node, u
target_cpu |= reg[1];
}
 
-   printf("Starting CPU %u (%lx)\n", id, target_cpu);
+   printf("Starting CPU %u (%lx)\n", cpuid, target_cpu);
pa = pmap_extract(kernel_pmap, (vm_offset_t)mpentry);
 
-   err = psci_cpu_on(target_cpu, pa, id);
+   err = psci_cpu_on(target_cpu, pa, cpuid);
if (err != PSCI_RETVAL_SUCCESS) {
/* Panic here if INVARIANTS are enabled */
-   KASSERT(0, ("Failed to start CPU %u (%lx)\n", id, target_cpu));
+   KASSERT(0, ("Failed to start CPU %u (%lx)\n", id,
+   target_cpu));
 
pcpu_destroy(pcpup);
-   kmem_free(kernel_arena, (vm_offset_t)dpcpu[id - 1], DPCPU_SIZE);
-   dpcpu[id - 1] = NULL;
+   kmem_free(kernel_arena, (vm_offset_t)dpcpu[cpuid - 1],
+   DPCPU_SIZE);
+   dpcpu[cpuid - 1] = NULL;
/* Notify the user that the CPU failed to start */
printf("Failed to start CPU %u (%lx)\n", id, target_cpu);
} else
-   CPU_SET(id, _cpus);
+   CPU_SET(cpuid, _cpus);
 
return (1);
 }
@@ -551,6 +564,7 @@ cpu_mp_start(void)
switch(cpu_enum_method) {
 #ifdef FDT
case CPUS_FDT:
+   KASSERT(cpu0 >= 0, ("Current CPU was not found"));
ofw_cpu_early_foreach(cpu_init_fdt, true);
break;
 #endif
@@ -565,13 +579,34 @@ cpu_mp_announce(void)
 {
 }
 
+static boolean_t
+cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
+{
+   uint64_t mpidr_fdt, mpidr_reg;
+
+   if (cpu0 < 0) {
+   mpidr_fdt = reg[0];
+   if (addr_size == 2) {
+   mpidr_fdt <<= 32;
+   mpidr_fdt |= reg[1];
+   }
+
+   mpidr_reg = READ_SPECIALREG(mpidr_el1);
+
+   if ((mpidr_reg & 0xff00fful) == mpidr_fdt)
+   cpu0 = id;
+   }
+
+   return (TRUE);
+}
+
 void
 cpu_mp_setmaxid(void)
 {
 #ifdef FDT
int cores;
 
-   cores = ofw_cpu_early_foreach(NULL, false);
+   cores = ofw_cpu_early_foreach(cpu_find_cpu0_fdt, false);
if (cores > 0) {
cores = MIN(cores, MAXCPU);
if (bootverbose)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301066 - in head: include lib/libc/db/hash lib/libc/db/man

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 18:32:57 2016
New Revision: 301066
URL: https://svnweb.freebsd.org/changeset/base/301066

Log:
  Fix prototype of dbm_open().
  
  The last argument of dbm_open() should be a mode_t according to POSIX;
  not an int.
  
  Reviewed by:  pfg, kib
  Differential Revision:https://reviews.freebsd.org/D6650

Modified:
  head/include/ndbm.h
  head/lib/libc/db/hash/ndbm.c
  head/lib/libc/db/man/dbm.3

Modified: head/include/ndbm.h
==
--- head/include/ndbm.h Tue May 31 18:31:17 2016(r301065)
+++ head/include/ndbm.h Tue May 31 18:32:57 2016(r301066)
@@ -70,7 +70,7 @@ datum  dbm_firstkey(DBM *);
 longdbm_forder(DBM *, datum);
 #endif
 datum   dbm_nextkey(DBM *);
-DBM*dbm_open(const char *, int, int);
+DBM*dbm_open(const char *, int, mode_t);
 int dbm_store(DBM *, datum, datum, int);
 #if __BSD_VISIBLE
 int dbm_dirfno(DBM *);

Modified: head/lib/libc/db/hash/ndbm.c
==
--- head/lib/libc/db/hash/ndbm.cTue May 31 18:31:17 2016
(r301065)
+++ head/lib/libc/db/hash/ndbm.cTue May 31 18:32:57 2016
(r301066)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
  *  NULL on failure
  */
 extern DBM *
-dbm_open(const char *file, int flags, int mode)
+dbm_open(const char *file, int flags, mode_t mode)
 {
HASHINFO info;
char path[MAXPATHLEN];

Modified: head/lib/libc/db/man/dbm.3
==
--- head/lib/libc/db/man/dbm.3  Tue May 31 18:31:17 2016(r301065)
+++ head/lib/libc/db/man/dbm.3  Tue May 31 18:32:57 2016(r301066)
@@ -34,7 +34,7 @@
 .In fcntl.h
 .In ndbm.h
 .Ft DBM *
-.Fn dbm_open "const char *base" "int flags" "int mode"
+.Fn dbm_open "const char *base" "int flags" "mode_t mode"
 .Ft void
 .Fn dbm_close "DBM *db"
 .Ft int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301075 - head/sys/dev/sfxge

2016-05-31 Thread Andrew Rybchenko
Author: arybchik
Date: Tue May 31 20:54:42 2016
New Revision: 301075
URL: https://svnweb.freebsd.org/changeset/base/301075

Log:
  sfxge(4): avoid code duplication in SW events definition
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D6662

Modified:
  head/sys/dev/sfxge/sfxge.h
  head/sys/dev/sfxge/sfxge_ev.c
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge.h
==
--- head/sys/dev/sfxge/sfxge.h  Tue May 31 19:24:32 2016(r301074)
+++ head/sys/dev/sfxge/sfxge.h  Tue May 31 20:54:42 2016(r301075)
@@ -120,18 +120,15 @@
 #defineSFXGE_MAGIC_DMAQ_LABEL_MASK \
((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
 
-#defineSFXGE_MAGIC_RX_QFLUSH_DONE \
-   (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_RX_QFLUSH_FAILED \
-   (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_RX_QREFILL \
-   (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_TX_QFLUSH_DONE \
-   (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+enum sfxge_sw_ev {
+   SFXGE_SW_EV_RX_QFLUSH_DONE = 1,
+   SFXGE_SW_EV_RX_QFLUSH_FAILED,
+   SFXGE_SW_EV_RX_QREFILL,
+   SFXGE_SW_EV_TX_QFLUSH_DONE,
+};
 
+#defineSFXGE_SW_EV_MAGIC(_sw_ev) \
+   (SFXGE_MAGIC_RESERVED | ((_sw_ev) << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
 
 enum sfxge_evq_state {
SFXGE_EVQ_UNINITIALIZED = 0,

Modified: head/sys/dev/sfxge/sfxge_ev.c
==
--- head/sys/dev/sfxge/sfxge_ev.c   Tue May 31 19:24:32 2016
(r301074)
+++ head/sys/dev/sfxge/sfxge_ev.c   Tue May 31 20:54:42 2016
(r301075)
@@ -230,7 +230,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3
label = 0;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level"));
-   magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label;
+   magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE) | label;
 
KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
("evq not started"));
@@ -264,7 +264,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin
label = 0;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label"));
-   magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label;
+   magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED) | label;
 
KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
("evq not started"));
@@ -355,7 +355,7 @@ sfxge_ev_txq_flush_done(void *arg, uint3
label = txq->type;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label"));
-   magic = SFXGE_MAGIC_TX_QFLUSH_DONE | label;
+   magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE) | label;
 
KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
("evq not started"));
@@ -380,19 +380,19 @@ sfxge_ev_software(void *arg, uint16_t ma
magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK;
 
switch (magic) {
-   case SFXGE_MAGIC_RX_QFLUSH_DONE:
+   case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_DONE):
sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label));
break;
 
-   case SFXGE_MAGIC_RX_QFLUSH_FAILED:
+   case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QFLUSH_FAILED):
sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label));
break;
 
-   case SFXGE_MAGIC_RX_QREFILL:
+   case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL):
sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label));
break;
 
-   case SFXGE_MAGIC_TX_QFLUSH_DONE: {
+   case SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_TX_QFLUSH_DONE): {
struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label);
 
KASSERT(txq != NULL, ("txq == NULL"));

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Tue May 31 19:24:32 2016
(r301074)
+++ head/sys/dev/sfxge/sfxge_rx.c   Tue May 31 20:54:42 2016
(r301075)
@@ -185,7 +185,7 @@ sfxge_rx_post_refill(void *arg)
label = 0;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level"));
-   magic = SFXGE_MAGIC_RX_QREFILL | label;
+   magic = SFXGE_SW_EV_MAGIC(SFXGE_SW_EV_RX_QREFILL) | label;
 
/* This is guaranteed due to the start/stop order of rx and ev */
KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
___
svn-src-all@freebsd.org mailing 

svn commit: r301074 - head/sys/sys

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 19:24:32 2016
New Revision: 301074
URL: https://svnweb.freebsd.org/changeset/base/301074

Log:
  Add missing dependency on .
  
  The SHMLBA definition provided by this header file is defined as
  PAGE_SIZE. PAGE_SIZE is only available when  is
  included.

Modified:
  head/sys/sys/shm.h

Modified: head/sys/sys/shm.h
==
--- head/sys/sys/shm.h  Tue May 31 19:19:21 2016(r301073)
+++ head/sys/sys/shm.h  Tue May 31 19:24:32 2016(r301074)
@@ -43,6 +43,8 @@
 #include 
 #include 
 
+#include 
+
 #define SHM_RDONLY  01  /* Attach read-only (else read-write) */
 #define SHM_RND 02  /* Round attach address to SHMLBA */
 #define SHMLBA  PAGE_SIZE /* Segment low boundary address multiple */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301059 - head/sbin/ifconfig

2016-05-31 Thread John Baldwin
On Tuesday, May 31, 2016 05:30:08 PM Allan Jude wrote:
> Author: allanjude
> Date: Tue May 31 17:30:08 2016
> New Revision: 301059
> URL: https://svnweb.freebsd.org/changeset/base/301059
> 
> Log:
>   ifconfig(8) now supports some output formatting options
>   
>   specified by the -f flag or IFCONFIG_FORMAT environment variable, the user
>   can request that inet4 subnet masks be printed in CIDR or dotted-quad
>   notation, in addition to the traditional hex output.
>   inet6 prefixes can be printed in CIDR as well.
>   
>   For more documentation see the ifconfig(8) man page.

... and there was much rejoicing!

Are you brave enough to set a default IFCONFIG_FORMAT in the root shell
startup files?

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


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

2016-05-31 Thread Andrey A. Chernov
Author: ache
Date: Tue May 31 18:44:33 2016
New Revision: 301069
URL: https://svnweb.freebsd.org/changeset/base/301069

Log:
  For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point to
  the character after the one this conversion stopped at.
  
  PR: 209907
  Submitted by: Roel Standaert  (partially)
  MFC after:  3 days

Modified:
  head/lib/libc/locale/ascii.c
  head/lib/libc/locale/none.c

Modified: head/lib/libc/locale/ascii.c
==
--- head/lib/libc/locale/ascii.cTue May 31 18:40:47 2016
(r301068)
+++ head/lib/libc/locale/ascii.cTue May 31 18:44:33 2016
(r301069)
@@ -143,6 +143,7 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d
nchr = 0;
while (len-- > 0 && nms-- > 0) {
if (*s & 0x80) {
+   *src = s;
errno = EILSEQ;
return ((size_t)-1);
}
@@ -177,6 +178,7 @@ _ascii_wcsnrtombs(char * __restrict dst,
nchr = 0;
while (len-- > 0 && nwc-- > 0) {
if (*s < 0 || *s > 127) {
+   *src = s;
errno = EILSEQ;
return ((size_t)-1);
}

Modified: head/lib/libc/locale/none.c
==
--- head/lib/libc/locale/none.c Tue May 31 18:40:47 2016(r301068)
+++ head/lib/libc/locale/none.c Tue May 31 18:44:33 2016(r301069)
@@ -174,6 +174,7 @@ _none_wcsnrtombs(char * __restrict dst, 
nchr = 0;
while (len-- > 0 && nwc-- > 0) {
if (*s < 0 || *s > UCHAR_MAX) {
+   *src = s;
errno = EILSEQ;
return ((size_t)-1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Nikolai Lifanov
On 05/31/2016 03:28, Jan Beich wrote:
> Allan Jude  writes:
> 
>> Author: allanjude
>> Date: Tue May 31 04:12:14 2016
>> New Revision: 301010
>> URL: https://svnweb.freebsd.org/changeset/base/301010
>>
>> Log:
>>   Connect the SHA-512t256 and Skein hashing algorithms to ZFS
>>   
>>   Support for the new hashing algorithms in ZFS was introduced in r289422
>>   However it was disconnected because FreeBSD lacked implementations of
>>   SHA-512 (truncated to 256 bits), and Skein.
>>   
>>   These implementations were introduced in r300921 and r300966 respectively
>>   
>>   This commit connects them to ZFS and enabled these new checksum algorithms
>>   
>>   This new algorithms are not supported by the boot blocks, so do not use 
>> them
>>   on your root dataset if you boot from ZFS.
> 
> Can you document the feature and booting caveat in zpool-features(7) manpage?
> And Illumos seems to limit booting support to pools vs. datasets.
> 

+1. Also, zfs(8) needs to be updated.

>   Booting off of pools using skein is NOT supported -- any attempt to
>   enable skein on a root pool will fail with an error.
> 
> https://illumos.org/man/5/zpool-features
> 

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


svn commit: r301065 - head/sys/dev/sfxge

2016-05-31 Thread Andrew Rybchenko
Author: arybchik
Date: Tue May 31 18:31:17 2016
New Revision: 301065
URL: https://svnweb.freebsd.org/changeset/base/301065

Log:
  sfxge(4): zero should be used as RxQ label in SW event
  
  The buggy code was using the rxq index but should use the evq label
  associated with the rxq. It was missed in r298735.
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D6661

Modified:
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Tue May 31 18:30:33 2016
(r301064)
+++ head/sys/dev/sfxge/sfxge_rx.c   Tue May 31 18:31:17 2016
(r301065)
@@ -175,13 +175,17 @@ sfxge_rx_post_refill(void *arg)
struct sfxge_softc *sc;
unsigned int index;
struct sfxge_evq *evq;
+   unsigned int label;
uint16_t magic;
 
sc = rxq->sc;
index = rxq->index;
evq = sc->evq[index];
 
-   magic = SFXGE_MAGIC_RX_QREFILL | index;
+   label = 0;
+   KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
+   ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level"));
+   magic = SFXGE_MAGIC_RX_QREFILL | label;
 
/* This is guaranteed due to the start/stop order of rx and ev */
KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301076 - head/share/man/man3

2016-05-31 Thread Jilles Tjoelker
Author: jilles
Date: Tue May 31 21:09:42 2016
New Revision: 301076
URL: https://svnweb.freebsd.org/changeset/base/301076

Log:
  Fix typo ESRC -> ESRCH in pthread man pages.

Modified:
  head/share/man/man3/pthread_attr_get_np.3
  head/share/man/man3/pthread_resume_np.3
  head/share/man/man3/pthread_suspend_np.3

Modified: head/share/man/man3/pthread_attr_get_np.3
==
--- head/share/man/man3/pthread_attr_get_np.3   Tue May 31 20:54:42 2016
(r301075)
+++ head/share/man/man3/pthread_attr_get_np.3   Tue May 31 21:09:42 2016
(r301076)
@@ -93,7 +93,7 @@ function will fail if:
 .Bl -tag -width Er
 .It Bq Er EINVAL
 Invalid value for one of given parameters.
-.It Bq Er ESRC
+.It Bq Er ESRCH
 No thread could be found corresponding to that specified by the given
 thread ID.
 .El

Modified: head/share/man/man3/pthread_resume_np.3
==
--- head/share/man/man3/pthread_resume_np.3 Tue May 31 20:54:42 2016
(r301075)
+++ head/share/man/man3/pthread_resume_np.3 Tue May 31 21:09:42 2016
(r301076)
@@ -57,7 +57,7 @@ function will fail if:
 The value specified by the
 .Fa tid
 argument is invalid.
-.It Bq Er ESRC
+.It Bq Er ESRCH
 No thread could be found corresponding to the thread ID specified by the
 .Fa tid
 argument.

Modified: head/share/man/man3/pthread_suspend_np.3
==
--- head/share/man/man3/pthread_suspend_np.3Tue May 31 20:54:42 2016
(r301075)
+++ head/share/man/man3/pthread_suspend_np.3Tue May 31 21:09:42 2016
(r301076)
@@ -63,7 +63,7 @@ An attempt was made to suspend the curre
 The value specified by the
 .Fa tid
 argument is invalid.
-.It Bq Er ESRC
+.It Bq Er ESRCH
 No thread could be found corresponding to the thread ID specified by the
 .Fa tid
 argument.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Allan Jude

On 2016-05-31 14:36, Nikolai Lifanov wrote:

On 05/31/2016 03:28, Jan Beich wrote:

Allan Jude  writes:


Author: allanjude
Date: Tue May 31 04:12:14 2016
New Revision: 301010
URL: https://svnweb.freebsd.org/changeset/base/301010

Log:
  Connect the SHA-512t256 and Skein hashing algorithms to ZFS

  Support for the new hashing algorithms in ZFS was introduced in r289422
  However it was disconnected because FreeBSD lacked implementations of
  SHA-512 (truncated to 256 bits), and Skein.

  These implementations were introduced in r300921 and r300966 respectively

  This commit connects them to ZFS and enabled these new checksum algorithms

  This new algorithms are not supported by the boot blocks, so do not use them
  on your root dataset if you boot from ZFS.


Can you document the feature and booting caveat in zpool-features(7) manpage?
And Illumos seems to limit booting support to pools vs. datasets.



+1. Also, zfs(8) needs to be updated.


  Booting off of pools using skein is NOT supported -- any attempt to
  enable skein on a root pool will fail with an error.

https://illumos.org/man/5/zpool-features






Yeah, i thought these were included in the original MFV, I'll add them

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


svn commit: r301078 - stable/10

2016-05-31 Thread Nick Hibma
Author: n_hibma
Date: Tue May 31 21:21:32 2016
New Revision: 301078
URL: https://svnweb.freebsd.org/changeset/base/301078

Log:
  Fixup botched merge in rev. r300488.
  
  This commit only updates mergeinfo, not sys/net/if.c.

Modified:
Directory Properties:
  stable/10/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301062 - head/sys/arm/arm

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 18:05:17 2016
New Revision: 301062
URL: https://svnweb.freebsd.org/changeset/base/301062

Log:
  arm_gic_map is a mask not the CPUs ID, there is no need to shift it.
  
  Pointy-hat to:andrew
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/arm/gic.c

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Tue May 31 18:04:16 2016(r301061)
+++ head/sys/arm/arm/gic.c  Tue May 31 18:05:17 2016(r301062)
@@ -968,7 +968,7 @@ gic_bind(struct arm_gic_softc *sc, u_int
 
for (mask = 0, cpu = 0; cpu < end; cpu++)
if (CPU_ISSET(cpu, cpus))
-   mask |= 1 << arm_gic_map[cpu];
+   mask |= arm_gic_map[cpu];
 
gic_d_write_1(sc, GICD_ITARGETSR(0) + irq, mask);
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-05-31 Thread Steven Kreuzer
Author: skreuzer (doc,ports committer)
Date: Tue May 31 18:30:33 2016
New Revision: 301064
URL: https://svnweb.freebsd.org/changeset/base/301064

Log:
  Document r300240, net.inet.tcp.ecn.enable now is a three way setting
  
  Approved by:  re (gjb, implicit, relnotes)

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

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue May 31 
18:15:18 2016(r301063)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue May 31 
18:30:33 2016(r301064)
@@ -1734,6 +1734,43 @@
   The
network stack has been updated to fix handling of
IPv6 On-Link redirects.
+
+   The net.inet.tcp.ecn.enable sysctl mib has been
+   changed from a binary off/on control to a three way setting.
+
+  
+   
+ 
+ 
+ 
+   
+ Value
+ Description
+   
+ 
+
+ 
+   
+ 0
+ Totally disable ECN.
+   
+
+   
+ 1
+ Enable ECN if incoming connections request it. Outgoing
+ connections will request ECN.
+   
+
+   
+ 2
+ Enable ECN if incoming connections request it. Outgoing
+ conections will not request ECN.
+   
+
+ 
+   
+  
+
 
   
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301070 - head/sys/arm64/arm64

2016-05-31 Thread John Baldwin
On Tuesday, May 31, 2016 06:45:52 PM Andrew Turner wrote:
> Author: andrew
> Date: Tue May 31 18:45:52 2016
> New Revision: 301070
> URL: https://svnweb.freebsd.org/changeset/base/301070
> 
> Log:
>   Allow the kernel to boot on a CPU where the devicetree has numbered it with
>   a non-zero ID. To do this we increment the cpuid of any CPUs with a smaller
>   devicetree ID by one to stop them conflicting with the boot CPU.
>   
>   Obtained from:  ABT Systems Ltd
>   Sponsored by:   The FreeBSD Foundation

It's a bit more friendly if you can have FreeBSD CPU IDs still represent the
topology of the system if possible.  On x86 we don't always boot from CPU 0
either (in fact, it's an election system so that the APIC ID of the BSP can
vary from boot to boot).  What we do however, is add CPUs from the same
core, then package first after the BSP and then add remaining CPUs as we
normally would.  For x86, the first thread in a package is always chosen as
the BSP, so this is implemented by starting at the APIC ID of the BSP and
assigning CPU IDs to increasing APIC IDs and eventually wrapping back around
to APIC ID 0 to add CPUs from "earlier" packages if we did not boot from
package 0.  However, this means that if you have a system with dual quad-core
CPUs, CPUs 0-3 are always one package and 4-7 are always the other, regardless
of which package is used for booting.  Initially the x86 code did not do that
but just skipped over the BSP when adding APs (so something similar I think to
what you've done here), but that meant that when the second package won the
boot-time election, CPUs 0,5-7 were on one package and 1-4 were on another
package.

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


svn commit: r301067 - head/sys/dev/sfxge

2016-05-31 Thread Andrew Rybchenko
Author: arybchik
Date: Tue May 31 18:34:39 2016
New Revision: 301067
URL: https://svnweb.freebsd.org/changeset/base/301067

Log:
  sfxge(4): move definition of the SW events to sfxge.h
  
  Tx flush done event is defined and Rx-specific header is not a good
  place for it.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge.h
  head/sys/dev/sfxge/sfxge_rx.h

Modified: head/sys/dev/sfxge/sfxge.h
==
--- head/sys/dev/sfxge/sfxge.h  Tue May 31 18:32:57 2016(r301066)
+++ head/sys/dev/sfxge/sfxge.h  Tue May 31 18:34:39 2016(r301067)
@@ -113,6 +113,26 @@
 
 #defineSFXGE_ETHERTYPE_LOOPBACK0x9000  /* Xerox loopback */
 
+
+#defineSFXGE_MAGIC_RESERVED0x8000
+
+#defineSFXGE_MAGIC_DMAQ_LABEL_WIDTH6
+#defineSFXGE_MAGIC_DMAQ_LABEL_MASK \
+   ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
+
+#defineSFXGE_MAGIC_RX_QFLUSH_DONE \
+   (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+
+#defineSFXGE_MAGIC_RX_QFLUSH_FAILED \
+   (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+
+#defineSFXGE_MAGIC_RX_QREFILL \
+   (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+
+#defineSFXGE_MAGIC_TX_QFLUSH_DONE \
+   (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
+
+
 enum sfxge_evq_state {
SFXGE_EVQ_UNINITIALIZED = 0,
SFXGE_EVQ_INITIALIZED,

Modified: head/sys/dev/sfxge/sfxge_rx.h
==
--- head/sys/dev/sfxge/sfxge_rx.h   Tue May 31 18:32:57 2016
(r301066)
+++ head/sys/dev/sfxge/sfxge_rx.h   Tue May 31 18:34:39 2016
(r301067)
@@ -43,24 +43,6 @@
 #defineSFXGE_LRO   1
 #endif
 
-#defineSFXGE_MAGIC_RESERVED0x8000
-
-#defineSFXGE_MAGIC_DMAQ_LABEL_WIDTH6
-#defineSFXGE_MAGIC_DMAQ_LABEL_MASK \
-   ((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
-
-#defineSFXGE_MAGIC_RX_QFLUSH_DONE \
-   (SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_RX_QFLUSH_FAILED \
-   (SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_RX_QREFILL \
-   (SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
-#defineSFXGE_MAGIC_TX_QFLUSH_DONE \
-   (SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-
 #defineSFXGE_RX_SCALE_MAX  EFX_MAXRSS
 
 struct sfxge_rx_sw_desc {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301059 - head/sbin/ifconfig

2016-05-31 Thread Allan Jude
Author: allanjude
Date: Tue May 31 17:30:08 2016
New Revision: 301059
URL: https://svnweb.freebsd.org/changeset/base/301059

Log:
  ifconfig(8) now supports some output formatting options
  
  specified by the -f flag or IFCONFIG_FORMAT environment variable, the user
  can request that inet4 subnet masks be printed in CIDR or dotted-quad
  notation, in addition to the traditional hex output.
  inet6 prefixes can be printed in CIDR as well.
  
  For more documentation see the ifconfig(8) man page.
  
  PR:   169072
  Requested by: seanc, marcel, brd, many others
  Reviewed by:  gnn, jhb (earlier version)
  Relnotes: yes
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D2856

Modified:
  head/sbin/ifconfig/af_inet.c
  head/sbin/ifconfig/af_inet6.c
  head/sbin/ifconfig/af_link.c
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cTue May 31 17:23:27 2016
(r301058)
+++ head/sbin/ifconfig/af_inet.cTue May 31 17:30:08 2016
(r301059)
@@ -54,11 +54,14 @@ static const char rcsid[] =
 
 static struct in_aliasreq in_addreq;
 static struct ifreq in_ridreq;
+static char addr_buf[MAXHOSTNAMELEN *2 + 1];   /*for getnameinfo()*/
+extern char *f_inet, *f_addr;
 
 static void
 in_status(int s __unused, const struct ifaddrs *ifa)
 {
struct sockaddr_in *sin, null_sin;
+   int error, n_flags;

memset(_sin, 0, sizeof(null_sin));
 
@@ -66,19 +69,47 @@ in_status(int s __unused, const struct i
if (sin == NULL)
return;
 
-   printf("\tinet %s ", inet_ntoa(sin->sin_addr));
+   if (f_addr != NULL && strcmp(f_addr, "fqdn") == 0)
+   n_flags = 0;
+   else if (f_addr != NULL && strcmp(f_addr, "host") == 0)
+   n_flags = NI_NOFQDN;
+   else
+   n_flags = NI_NUMERICHOST;
+
+   error = getnameinfo((struct sockaddr *)sin, sin->sin_len, addr_buf,
+   sizeof(addr_buf), NULL, 0, n_flags);
+
+   if (error)
+   inet_ntop(AF_INET, >sin_addr, addr_buf, sizeof(addr_buf));
+   
+   printf("\tinet %s", addr_buf);
 
if (ifa->ifa_flags & IFF_POINTOPOINT) {
sin = (struct sockaddr_in *)ifa->ifa_dstaddr;
if (sin == NULL)
sin = _sin;
-   printf("--> %s ", inet_ntoa(sin->sin_addr));
+   printf(" --> %s ", inet_ntoa(sin->sin_addr));
}
 
sin = (struct sockaddr_in *)ifa->ifa_netmask;
if (sin == NULL)
sin = _sin;
-   printf("netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr));
+   if (f_inet != NULL && strcmp(f_inet, "cidr") == 0) {
+   int cidr = 32;
+   unsigned long smask;
+
+   smask = ntohl(sin->sin_addr.s_addr);
+   while ((smask & 1) == 0) {
+   smask = smask >> 1;
+   cidr--;
+   if (cidr == 0)
+   break;
+   }
+   printf("/%d ", cidr);
+   } else if (f_inet != NULL && strcmp(f_inet, "dotted") == 0)
+   printf(" netmask %s ", inet_ntoa(sin->sin_addr));
+   else
+   printf(" netmask 0x%lx ", (unsigned 
long)ntohl(sin->sin_addr.s_addr));
 
if (ifa->ifa_flags & IFF_BROADCAST) {
sin = (struct sockaddr_in *)ifa->ifa_broadaddr;

Modified: head/sbin/ifconfig/af_inet6.c
==
--- head/sbin/ifconfig/af_inet6.c   Tue May 31 17:23:27 2016
(r301058)
+++ head/sbin/ifconfig/af_inet6.c   Tue May 31 17:30:08 2016
(r301059)
@@ -65,6 +65,7 @@ staticint ip6lifetime;
 static int prefix(void *, int);
 static char *sec2str(time_t);
 static int explicit_prefix = 0;
+extern char *f_inet6, *f_addr, *f_scope;
 
 extern void setnd6flags(const char *, int, int, const struct afswtch *);
 extern void setnd6defif(const char *, int, int, const struct afswtch *);
@@ -172,9 +173,10 @@ in6_status(int s __unused, const struct 
struct in6_ifreq ifr6;
int s6;
u_int32_t flags6;
+   const u_int16_t *a;
struct in6_addrlifetime lifetime;
struct timespec now;
-   int error;
+   int error, n_flags, i;
 
clock_gettime(CLOCK_MONOTONIC_FAST, );
 
@@ -206,12 +208,30 @@ in6_status(int s __unused, const struct 
lifetime = ifr6.ifr_ifru.ifru_lifetime;
close(s6);
 
-   error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, addr_buf,
-   sizeof(addr_buf), NULL, 0, NI_NUMERICHOST);
-   if (error != 0)
-   inet_ntop(AF_INET6, >sin6_addr, addr_buf,
- sizeof(addr_buf));
-   printf("\tinet6 %s ", 

svn commit: r301058 - head/share/misc

2016-05-31 Thread Remko Lodder
Author: remko
Date: Tue May 31 17:23:27 2016
New Revision: 301058
URL: https://svnweb.freebsd.org/changeset/base/301058

Log:
  Update the Security Team member list with the actual
  members.
  
  Discussed with:   glebius

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==
--- head/share/misc/organization.dotTue May 31 17:15:57 2016
(r301057)
+++ head/share/misc/organization.dotTue May 31 17:23:27 2016
(r301058)
@@ -33,7 +33,7 @@ portscommitters [label="Ports Committers
 portmgr [label="Port Management Team\nport...@freebsd.org\nantoine, bapt, 
bdrewery,\nerwin, mat, swills,\nmiwi"]
 portmgrsecretary [label="Port Management Team 
Secretary\nportmgr-secret...@freebsd.org\nrene"]
 re [label="Primary Release Engineering Team\n...@freebsd.org\nkib, blackend, 
jpaetzel, hrs, kensmith"]
-secteam [label="Security Team\nsect...@freebsd.org\nsimon, qingli, 
delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"]
+secteam [label="Security Team\nsect...@freebsd.org\ndelphij,\ndes, gavin, 
gjb,\nglebius, remko"]
 portssecteam [label="Ports Security Team\nports-sect...@freebsd.org\ndelphij, 
eadler, feld, jgh, junovitch, miwi, rea, sbz, simon, swills, zi"]
 secteamsecretary [label="Security Team 
Secretary\nsecteam-secret...@freebsd.org\nremko"]
 securityofficer [label="Security Officer 
Team\nsecurity-offi...@freebsd.org\ncperciva, simon, nectar"]
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301057 - stable/10/sys/nfs

2016-05-31 Thread Ian Lepore
Author: ian
Date: Tue May 31 17:15:57 2016
New Revision: 301057
URL: https://svnweb.freebsd.org/changeset/base/301057

Log:
  MFC r297323,r297324, r297325, r297326:
  
Set only one default route for nfsroot mount, the one associated with the
interface that will be used to mount the rootfs (and never a self-ip proxy
arp route).  Made up of the following related changes...
  
Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
server (and not when it came from a fallback method such as the ROOTDEVNAME
option).  This makes the code in bootpc_init() choose the first interface
that provided a rootpath name.  Previously it was choosing the first
interface that got an IP address, which could be on a different and
potentially unreachable subnet than the server providing the rootfs.
  
If the rootpath name actually does come from a fallback source, then the
code continues to use the first interface in the list that got configured.
Note that this wasn't directly reported in the PR cited below, but was
discovered while working on that PR.
  
Switch bootpc_adjust_interface() from returning int to void.  Its one caller
doesn't check for errors, and all the errors that can happen result in it
calling panic anyway, except for one that's really more of a warning (and
is going to disappear on an upcoming commit anyway).
  
Stop setting the default route to the IP of the interface itself when the
bootp/dhcp server doesn't provide a router option.  Doing so prevents
setting defaultrouter= in rc.conf (it fails because there's already
a bogus default route installed by bootpc_init).
  
When an admin wants to use this style of proxy arp on an interface, the
proper mechanism is to set the "use-lease-addr-for-default-route" flag
in the dhcp server config.  That causes the lease address to be delivered
in the routers option, and the normal handling of the routers option will
then install the self-ip as the default route.
  
Do not try to install a default route for each interface found, because
only the first one will actually work and all the others just result in
errors (which would get printed but otherwise ignored).
  
Instead, wait until we make a choice of which interface will be used to
mount the rootfs, and install the default route associated with it (if any).
After doing the md_mount() call to obtain the needed info, remove the
default route again, and transcribe the route info into the nfs_diskless
structure.  If the system eventually chooses to mount the nfs rootfs, the
default route will be installed again when the nfs_diskless code
re-initializes the interface.
  
  PR:   187094

Modified:
  stable/10/sys/nfs/bootp_subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/nfs/bootp_subr.c
==
--- stable/10/sys/nfs/bootp_subr.c  Tue May 31 17:01:54 2016
(r301056)
+++ stable/10/sys/nfs/bootp_subr.c  Tue May 31 17:15:57 2016
(r301057)
@@ -272,7 +272,7 @@ static int  bootpc_call(struct bootpc_glo
 static voidbootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
struct thread *td);
 
-static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
+static voidbootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx, struct thread *td);
 
 static voidbootpc_decode_reply(struct nfsv3_diskless *nd,
@@ -1007,30 +1007,26 @@ bootpc_shutdown_interface(struct bootpc_
panic("%s: SIOCDIFADDR, error=%d", __func__, error);
 }
 
-static int
+static void
 bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
 struct bootpc_globalcontext *gctx, struct thread *td)
 {
int error;
-   struct sockaddr_in defdst;
-   struct sockaddr_in defmask;
struct sockaddr_in *sin;
struct ifreq *ifr;
struct in_aliasreq *ifra;
struct sockaddr_in *myaddr;
struct sockaddr_in *netmask;
-   struct sockaddr_in *gw;
 
ifr = >ireq;
ifra = >iareq;
myaddr = >myaddr;
netmask = >netmask;
-   gw = >gw;
 
if (bootpc_ifctx_isresolved(ifctx) == 0) {
/* Shutdown interfaces where BOOTP failed */
bootpc_shutdown_interface(ifctx, td);
-   return (0);
+   return;
}
 
printf("Adjusted interface %s", ifctx->ireq.ifr_name);
@@ -1065,24 +1061,48 @@ bootpc_adjust_interface(struct bootpc_if
error = ifioctl(bootp_so, SIOCAIFADDR, (caddr_t)ifra, td);
if (error != 0)
panic("%s: SIOCAIFADDR, error=%d", __func__, error);
+}
+
+static void
+bootpc_add_default_route(struct bootpc_ifcontext *ifctx)
+{
+   int error;
+   struct sockaddr_in defdst;
+   struct 

svn commit: r301051 - in releng/10.2: . sys/compat/linux sys/conf sys/kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:55:45 2016
New Revision: 301051
URL: https://svnweb.freebsd.org/changeset/base/301051

Log:
  Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
  Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
  
  Security: SA-16:20
  Security: SA-16:21
  Approved by:  so

Modified:
  releng/10.2/UPDATING
  releng/10.2/sys/compat/linux/linux_ioctl.c
  releng/10.2/sys/compat/linux/linux_misc.c
  releng/10.2/sys/conf/newvers.sh
  releng/10.2/sys/kern/vfs_syscalls.c

Modified: releng/10.2/UPDATING
==
--- releng/10.2/UPDATINGTue May 31 16:55:41 2016(r301050)
+++ releng/10.2/UPDATINGTue May 31 16:55:45 2016(r301051)
@@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160531   p18 FreeBSD-SA-16:20.linux
+   FreeBSD-SA-16:21.43bsd
+   FreeBSD-SA-16:22.libarchive
+
+   Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
+   Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
+   Fix directory traversal in cpio(1). [SA-16:22]
+
 20160517   p17 FreeBSD-SA-16:18.atkbd
FreeBSD-SA-16:19.sendmsg
 

Modified: releng/10.2/sys/compat/linux/linux_ioctl.c
==
--- releng/10.2/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:41 2016
(r301050)
+++ releng/10.2/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:45 2016
(r301051)
@@ -919,6 +919,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: releng/10.2/sys/compat/linux/linux_misc.c
==
--- releng/10.2/sys/compat/linux/linux_misc.c   Tue May 31 16:55:41 2016
(r301050)
+++ releng/10.2/sys/compat/linux/linux_misc.c   Tue May 31 16:55:45 2016
(r301051)
@@ -138,6 +138,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: releng/10.2/sys/conf/newvers.sh
==
--- releng/10.2/sys/conf/newvers.sh Tue May 31 16:55:41 2016
(r301050)
+++ releng/10.2/sys/conf/newvers.sh Tue May 31 16:55:45 2016
(r301051)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.2"
-BRANCH="RELEASE-p17"
+BRANCH="RELEASE-p18"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.2/sys/kern/vfs_syscalls.c
==
--- releng/10.2/sys/kern/vfs_syscalls.c Tue May 31 16:55:41 2016
(r301050)
+++ releng/10.2/sys/kern/vfs_syscalls.c Tue May 31 16:55:45 2016
(r301051)
@@ -2195,6 +2195,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301056 - in stable/10: lib/libstand sys/boot/common sys/boot/i386/libi386 sys/boot/libstand32 sys/boot/userboot/libstand sys/nfs

2016-05-31 Thread Ian Lepore
Author: ian
Date: Tue May 31 17:01:54 2016
New Revision: 301056
URL: https://svnweb.freebsd.org/changeset/base/301056

Log:
  MFC r297147, r297148, r297149, r297150, r297151:
  
Make both the loader and kernel use the interface-mtu option if the
dhcp server provides it.  Made up of these (semi-)related changes...
  
[kernel...] If the dhcp server provides an interface-mtu option, parse
the value and set that mtu on the interface.
  
[libstand...]
  
Garbage collect the bswap routines from libstand, use sys/endian.h.
  
If the dhcp server delivers an interface-mtu option, parse it and store
the value in a new global intf_mtu for use by the application.
  
[loader...]
  
If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.
  
  PR:   187094

Deleted:
  stable/10/lib/libstand/bswap.c
Modified:
  stable/10/lib/libstand/Makefile
  stable/10/lib/libstand/bootp.c
  stable/10/lib/libstand/bootp.h
  stable/10/lib/libstand/globals.c
  stable/10/lib/libstand/net.h
  stable/10/lib/libstand/stand.h
  stable/10/sys/boot/common/dev_net.c
  stable/10/sys/boot/i386/libi386/pxe.c
  stable/10/sys/boot/libstand32/Makefile
  stable/10/sys/boot/userboot/libstand/Makefile
  stable/10/sys/nfs/bootp_subr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libstand/Makefile
==
--- stable/10/lib/libstand/Makefile Tue May 31 16:58:00 2016
(r301055)
+++ stable/10/lib/libstand/Makefile Tue May 31 17:01:54 2016
(r301056)
@@ -43,7 +43,7 @@ CFLAGS+=  -G0 -fno-pic -mno-abicalls
 .endif
 
 # standalone components and stuff we have modified locally
-SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c 
gets.c \
+SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c 
random.c \
sbrk.c twiddle.c zalloc.c zalloc_malloc.c
 

Modified: stable/10/lib/libstand/bootp.c
==
--- stable/10/lib/libstand/bootp.c  Tue May 31 16:58:00 2016
(r301055)
+++ stable/10/lib/libstand/bootp.c  Tue May 31 17:01:54 2016
(r301056)
@@ -39,6 +39,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
@@ -393,6 +394,13 @@ vend_rfc1048(cp, len)
val = (const char *)cp;
strlcpy(hostname, val, sizeof(hostname));
}
+   if (tag == TAG_INTF_MTU) {
+   if ((val = getenv("dhcp.interface-mtu")) != NULL) {
+   intf_mtu = (u_int)strtoul(val, NULL, 0);
+   } else {
+   intf_mtu = be16dec(cp);
+   }
+   }
 #ifdef SUPPORT_DHCP
if (tag == TAG_DHCP_MSGTYPE) {
if(*cp != expected_dhcpmsgtype)

Modified: stable/10/lib/libstand/bootp.h
==
--- stable/10/lib/libstand/bootp.h  Tue May 31 16:58:00 2016
(r301055)
+++ stable/10/lib/libstand/bootp.h  Tue May 31 17:01:54 2016
(r301056)
@@ -91,6 +91,7 @@ struct bootp {
 #define TAG_DOMAINNAME ((unsigned char)  15)
 #define TAG_SWAPSERVER ((unsigned char)  16)
 #define TAG_ROOTPATH   ((unsigned char)  17)
+#define TAG_INTF_MTU   ((unsigned char)  26)
 
 #ifdef SUPPORT_DHCP
 #define TAG_REQ_ADDR   ((unsigned char)  50)

Modified: stable/10/lib/libstand/globals.c
==
--- stable/10/lib/libstand/globals.cTue May 31 16:58:00 2016
(r301055)
+++ stable/10/lib/libstand/globals.cTue May 31 17:01:54 2016
(r301056)
@@ -32,5 +32,6 @@ structin_addr rootip; /* root ip addr
 struct in_addr swapip; /* swap ip address */
 struct in_addr gateip; /* swap ip address */
 n_long netmask = 0xff00;   /* subnet or net mask */
+u_int  intf_mtu;   /* interface mtu from bootp/dhcp */
 interrno;  /* our old friend */
 

Modified: stable/10/lib/libstand/net.h
==
--- stable/10/lib/libstand/net.hTue May 31 16:58:00 2016
(r301055)
+++ stable/10/lib/libstand/net.hTue May 31 17:01:54 2016
(r301056)
@@ -83,6 +83,7 @@ externstruct in_addr swapip;
 extern struct in_addr gateip;
 extern struct in_addr nameip;
 extern n_long netmask;
+extern u_int intf_mtu;
 
 extern int debug; 

svn commit: r301055 - in stable/9/sys: compat/linux kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:58:00 2016
New Revision: 301055
URL: https://svnweb.freebsd.org/changeset/base/301055

Log:
  Merge r301053:
  
Fix kernel stack disclosures in the Linux and 4.3BSD compat layers.
  
  Security: SA-16:20
  Security: SA-16:21

Modified:
  stable/9/sys/compat/linux/linux_ioctl.c
  stable/9/sys/compat/linux/linux_misc.c
  stable/9/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/compat/linux/linux_ioctl.c
==
--- stable/9/sys/compat/linux/linux_ioctl.c Tue May 31 16:57:42 2016
(r301054)
+++ stable/9/sys/compat/linux/linux_ioctl.c Tue May 31 16:58:00 2016
(r301055)
@@ -911,6 +911,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: stable/9/sys/compat/linux/linux_misc.c
==
--- stable/9/sys/compat/linux/linux_misc.c  Tue May 31 16:57:42 2016
(r301054)
+++ stable/9/sys/compat/linux/linux_misc.c  Tue May 31 16:58:00 2016
(r301055)
@@ -138,6 +138,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: stable/9/sys/kern/vfs_syscalls.c
==
--- stable/9/sys/kern/vfs_syscalls.cTue May 31 16:57:42 2016
(r301054)
+++ stable/9/sys/kern/vfs_syscalls.cTue May 31 16:58:00 2016
(r301055)
@@ -2326,6 +2326,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301054 - in stable/10/sys: compat/linux kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:57:42 2016
New Revision: 301054
URL: https://svnweb.freebsd.org/changeset/base/301054

Log:
  Merge r301053:
  
Fix kernel stack disclosures in the Linux and 4.3BSD compat layers.
  
  Security: SA-16:20
  Security: SA-16:21

Modified:
  stable/10/sys/compat/linux/linux_ioctl.c
  stable/10/sys/compat/linux/linux_misc.c
  stable/10/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_ioctl.c
==
--- stable/10/sys/compat/linux/linux_ioctl.cTue May 31 16:56:30 2016
(r301053)
+++ stable/10/sys/compat/linux/linux_ioctl.cTue May 31 16:57:42 2016
(r301054)
@@ -915,6 +915,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: stable/10/sys/compat/linux/linux_misc.c
==
--- stable/10/sys/compat/linux/linux_misc.c Tue May 31 16:56:30 2016
(r301053)
+++ stable/10/sys/compat/linux/linux_misc.c Tue May 31 16:57:42 2016
(r301054)
@@ -150,6 +150,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: stable/10/sys/kern/vfs_syscalls.c
==
--- stable/10/sys/kern/vfs_syscalls.c   Tue May 31 16:56:30 2016
(r301053)
+++ stable/10/sys/kern/vfs_syscalls.c   Tue May 31 16:57:42 2016
(r301054)
@@ -2197,6 +2197,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301053 - in head/sys: compat/linux kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:56:30 2016
New Revision: 301053
URL: https://svnweb.freebsd.org/changeset/base/301053

Log:
  Fix kernel stack disclosures in the Linux and 4.3BSD compat layers.
  
  Submitted by: CTurt
  Security: SA-16:20
  Security: SA-16:21

Modified:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_misc.c
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Tue May 31 16:55:50 2016
(r301052)
+++ head/sys/compat/linux/linux_ioctl.c Tue May 31 16:56:30 2016
(r301053)
@@ -916,6 +916,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Tue May 31 16:55:50 2016
(r301052)
+++ head/sys/compat/linux/linux_misc.c  Tue May 31 16:56:30 2016
(r301053)
@@ -149,6 +149,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue May 31 16:55:50 2016
(r301052)
+++ head/sys/kern/vfs_syscalls.cTue May 31 16:56:30 2016
(r301053)
@@ -2068,6 +2068,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301050 - in releng/10.1: . sys/compat/linux sys/conf sys/kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:55:41 2016
New Revision: 301050
URL: https://svnweb.freebsd.org/changeset/base/301050

Log:
  Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
  Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
  
  Security: SA-16:20
  Security: SA-16:21
  Approved by:  so

Modified:
  releng/10.1/UPDATING
  releng/10.1/sys/compat/linux/linux_ioctl.c
  releng/10.1/sys/compat/linux/linux_misc.c
  releng/10.1/sys/conf/newvers.sh
  releng/10.1/sys/kern/vfs_syscalls.c

Modified: releng/10.1/UPDATING
==
--- releng/10.1/UPDATINGTue May 31 16:55:37 2016(r301049)
+++ releng/10.1/UPDATINGTue May 31 16:55:41 2016(r301050)
@@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160531   p35 FreeBSD-SA-16:20.linux
+   FreeBSD-SA-16:21.43bsd
+   FreeBSD-SA-16:22.libarchive
+
+   Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
+   Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
+   Fix directory traversal in cpio(1). [SA-16:22]
+
 20160517   p34 FreeBSD-SA-16:18.atkbd
FreeBSD-SA-16:19.sendmsg
 

Modified: releng/10.1/sys/compat/linux/linux_ioctl.c
==
--- releng/10.1/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:37 2016
(r301049)
+++ releng/10.1/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:41 2016
(r301050)
@@ -919,6 +919,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: releng/10.1/sys/compat/linux/linux_misc.c
==
--- releng/10.1/sys/compat/linux/linux_misc.c   Tue May 31 16:55:37 2016
(r301049)
+++ releng/10.1/sys/compat/linux/linux_misc.c   Tue May 31 16:55:41 2016
(r301050)
@@ -138,6 +138,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: releng/10.1/sys/conf/newvers.sh
==
--- releng/10.1/sys/conf/newvers.sh Tue May 31 16:55:37 2016
(r301049)
+++ releng/10.1/sys/conf/newvers.sh Tue May 31 16:55:41 2016
(r301050)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.1"
-BRANCH="RELEASE-p34"
+BRANCH="RELEASE-p35"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.1/sys/kern/vfs_syscalls.c
==
--- releng/10.1/sys/kern/vfs_syscalls.c Tue May 31 16:55:37 2016
(r301049)
+++ releng/10.1/sys/kern/vfs_syscalls.c Tue May 31 16:55:41 2016
(r301050)
@@ -2181,6 +2181,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301052 - in releng/10.3: . sys/compat/linux sys/conf sys/kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:55:50 2016
New Revision: 301052
URL: https://svnweb.freebsd.org/changeset/base/301052

Log:
  Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
  Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
  
  Security: SA-16:20
  Security: SA-16:21
  Approved by:  so

Modified:
  releng/10.3/UPDATING
  releng/10.3/sys/compat/linux/linux_ioctl.c
  releng/10.3/sys/compat/linux/linux_misc.c
  releng/10.3/sys/conf/newvers.sh
  releng/10.3/sys/kern/vfs_syscalls.c

Modified: releng/10.3/UPDATING
==
--- releng/10.3/UPDATINGTue May 31 16:55:45 2016(r301051)
+++ releng/10.3/UPDATINGTue May 31 16:55:50 2016(r301052)
@@ -16,6 +16,15 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20160531   p4  FreeBSD-SA-16:20.linux
+   FreeBSD-SA-16:21.43bsd
+   FreeBSD-SA-16:22.libarchive
+
+   Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
+   Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
+   Fix directory traversal in cpio(1). [SA-16:22]
+
+
 20160517   p3  FreeBSD-SA-16:18.atkbd
FreeBSD-SA-16:19.sendmsg
 

Modified: releng/10.3/sys/compat/linux/linux_ioctl.c
==
--- releng/10.3/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:45 2016
(r301051)
+++ releng/10.3/sys/compat/linux/linux_ioctl.c  Tue May 31 16:55:50 2016
(r301052)
@@ -915,6 +915,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: releng/10.3/sys/compat/linux/linux_misc.c
==
--- releng/10.3/sys/compat/linux/linux_misc.c   Tue May 31 16:55:45 2016
(r301051)
+++ releng/10.3/sys/compat/linux/linux_misc.c   Tue May 31 16:55:50 2016
(r301052)
@@ -150,6 +150,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: releng/10.3/sys/conf/newvers.sh
==
--- releng/10.3/sys/conf/newvers.sh Tue May 31 16:55:45 2016
(r301051)
+++ releng/10.3/sys/conf/newvers.sh Tue May 31 16:55:50 2016
(r301052)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="10.3"
-BRANCH="RELEASE-p3"
+BRANCH="RELEASE-p4"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/10.3/sys/kern/vfs_syscalls.c
==
--- releng/10.3/sys/kern/vfs_syscalls.c Tue May 31 16:55:45 2016
(r301051)
+++ releng/10.3/sys/kern/vfs_syscalls.c Tue May 31 16:55:50 2016
(r301052)
@@ -2197,6 +2197,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301049 - in releng/9.3: . sys/compat/linux sys/conf sys/kern

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:55:37 2016
New Revision: 301049
URL: https://svnweb.freebsd.org/changeset/base/301049

Log:
  Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
  Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
  
  Security: SA-16:20
  Security: SA-16:21
  Approved by:  so

Modified:
  releng/9.3/UPDATING
  releng/9.3/sys/compat/linux/linux_ioctl.c
  releng/9.3/sys/compat/linux/linux_misc.c
  releng/9.3/sys/conf/newvers.sh
  releng/9.3/sys/kern/vfs_syscalls.c

Modified: releng/9.3/UPDATING
==
--- releng/9.3/UPDATING Tue May 31 16:35:03 2016(r301048)
+++ releng/9.3/UPDATING Tue May 31 16:55:37 2016(r301049)
@@ -11,6 +11,16 @@ handbook:
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20160531   p43 FreeBSD-SA-16:20.linux
+   FreeBSD-SA-16:21.43bsd
+   FreeBSD-SA-16:22.libarchive
+   FreeBSD-SA-16:23.libarchive
+
+   Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
+   Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
+   Fix directory traversal in cpio(1). [SA-16:22]
+   Fix buffer overflow in libarchive(3). [SA-16:23]
+
 20160517   p42 FreeBSD-SA-16:18.atkbd
 
Fix buffer overflow in keyboard driver. [SA-16:18]

Modified: releng/9.3/sys/compat/linux/linux_ioctl.c
==
--- releng/9.3/sys/compat/linux/linux_ioctl.c   Tue May 31 16:35:03 2016
(r301048)
+++ releng/9.3/sys/compat/linux/linux_ioctl.c   Tue May 31 16:55:37 2016
(r301049)
@@ -911,6 +911,8 @@ linux_ioctl_termio(struct thread *td, st
 
case LINUX_TIOCGSERIAL: {
struct linux_serial_struct lss;
+
+   bzero(, sizeof(lss));
lss.type = LINUX_PORT_16550A;
lss.flags = 0;
lss.close_delay = 0;

Modified: releng/9.3/sys/compat/linux/linux_misc.c
==
--- releng/9.3/sys/compat/linux/linux_misc.cTue May 31 16:35:03 2016
(r301048)
+++ releng/9.3/sys/compat/linux/linux_misc.cTue May 31 16:55:37 2016
(r301049)
@@ -138,6 +138,7 @@ linux_sysinfo(struct thread *td, struct 
int i, j;
struct timespec ts;
 
+   bzero(, sizeof(sysinfo));
getnanouptime();
if (ts.tv_nsec != 0)
ts.tv_sec++;

Modified: releng/9.3/sys/conf/newvers.sh
==
--- releng/9.3/sys/conf/newvers.sh  Tue May 31 16:35:03 2016
(r301048)
+++ releng/9.3/sys/conf/newvers.sh  Tue May 31 16:55:37 2016
(r301049)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.3"
-BRANCH="RELEASE-p42"
+BRANCH="RELEASE-p43"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/9.3/sys/kern/vfs_syscalls.c
==
--- releng/9.3/sys/kern/vfs_syscalls.c  Tue May 31 16:35:03 2016
(r301048)
+++ releng/9.3/sys/kern/vfs_syscalls.c  Tue May 31 16:55:37 2016
(r301049)
@@ -2326,6 +2326,7 @@ cvtstat(st, ost)
struct ostat *ost;
 {
 
+   bzero(ost, sizeof(*ost));
ost->st_dev = st->st_dev;
ost->st_ino = st->st_ino;
ost->st_mode = st->st_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301048 - in releng/10.3/contrib/libarchive: cpio libarchive libarchive/test

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:35:03 2016
New Revision: 301048
URL: https://svnweb.freebsd.org/changeset/base/301048

Log:
  Merge r300361 by mm@:
  
Backport security fix for absolute path traversal
vulnerability in bsdcpio.
  
  Security: CVE-2015-2304
  Security: SA-16:22
  Approved by:  so

Modified:
  releng/10.3/contrib/libarchive/cpio/bsdcpio.1
  releng/10.3/contrib/libarchive/cpio/cpio.c
  releng/10.3/contrib/libarchive/libarchive/archive.h
  releng/10.3/contrib/libarchive/libarchive/archive_write_disk.3
  releng/10.3/contrib/libarchive/libarchive/archive_write_disk_posix.c
  releng/10.3/contrib/libarchive/libarchive/test/test_write_disk_secure.c
Directory Properties:
  releng/10.3/   (props changed)

Modified: releng/10.3/contrib/libarchive/cpio/bsdcpio.1
==
--- releng/10.3/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:33:56 
2016(r301047)
+++ releng/10.3/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:35:03 
2016(r301048)
@@ -156,7 +156,8 @@ See above for description.
 .It Fl Fl insecure
 (i and p mode only)
 Disable security checks during extraction or copying.
-This allows extraction via symbolic links and path names containing
+This allows extraction via symbolic links, absolute paths,
+and path names containing
 .Sq ..
 in the name.
 .It Fl J , Fl Fl xz

Modified: releng/10.3/contrib/libarchive/cpio/cpio.c
==
--- releng/10.3/contrib/libarchive/cpio/cpio.c  Tue May 31 16:33:56 2016
(r301047)
+++ releng/10.3/contrib/libarchive/cpio/cpio.c  Tue May 31 16:35:03 2016
(r301048)
@@ -179,6 +179,7 @@ main(int argc, char *argv[])
cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
@@ -264,6 +265,7 @@ main(int argc, char *argv[])
case OPTION_INSECURE:
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case 'L': /* GNU cpio */
cpio->option_follow_links = 1;
@@ -300,6 +302,7 @@ main(int argc, char *argv[])
"Cannot use both -p and -%c", cpio->mode);
cpio->mode = opt;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case OPTION_PRESERVE_OWNER:
cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;

Modified: releng/10.3/contrib/libarchive/libarchive/archive.h
==
--- releng/10.3/contrib/libarchive/libarchive/archive.h Tue May 31 16:33:56 
2016(r301047)
+++ releng/10.3/contrib/libarchive/libarchive/archive.h Tue May 31 16:35:03 
2016(r301048)
@@ -562,6 +562,8 @@ __LA_DECL int archive_read_set_options(s
 /* Default: Do not use HFS+ compression if it was not compressed. */
 /* This has no effect except on Mac OS v10.6 or later. */
 #defineARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED  (0x8000)
+/* Default: Do not reject entries with absolute paths */
+#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x1)
 
 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
 int flags);

Modified: releng/10.3/contrib/libarchive/libarchive/archive_write_disk.3
==
--- releng/10.3/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:33:56 2016(r301047)
+++ releng/10.3/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:35:03 2016(r301048)
@@ -177,6 +177,9 @@ The default is to not refuse such paths.
 Note that paths ending in
 .Pa ..
 always cause an error, regardless of this flag.
+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
 .It Cm ARCHIVE_EXTRACT_SPARSE
 Scan data for blocks of NUL bytes and try to recreate them with holes.
 This results in sparse files, independent of whether the archive format

Modified: releng/10.3/contrib/libarchive/libarchive/archive_write_disk_posix.c
==
--- 

svn commit: r301047 - in releng/10.2/contrib/libarchive: cpio libarchive libarchive/test

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:33:56 2016
New Revision: 301047
URL: https://svnweb.freebsd.org/changeset/base/301047

Log:
  Merge r300361 by mm@:
  
Backport security fix for absolute path traversal
vulnerability in bsdcpio.
  
  Security: CVE-2015-2304
  Security: SA-16:22
  Approved by:  so

Modified:
  releng/10.2/contrib/libarchive/cpio/bsdcpio.1
  releng/10.2/contrib/libarchive/cpio/cpio.c
  releng/10.2/contrib/libarchive/libarchive/archive.h
  releng/10.2/contrib/libarchive/libarchive/archive_write_disk.3
  releng/10.2/contrib/libarchive/libarchive/archive_write_disk_posix.c
  releng/10.2/contrib/libarchive/libarchive/test/test_write_disk_secure.c
Directory Properties:
  releng/10.2/   (props changed)

Modified: releng/10.2/contrib/libarchive/cpio/bsdcpio.1
==
--- releng/10.2/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:32:42 
2016(r301046)
+++ releng/10.2/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:33:56 
2016(r301047)
@@ -156,7 +156,8 @@ See above for description.
 .It Fl Fl insecure
 (i and p mode only)
 Disable security checks during extraction or copying.
-This allows extraction via symbolic links and path names containing
+This allows extraction via symbolic links, absolute paths,
+and path names containing
 .Sq ..
 in the name.
 .It Fl J , Fl Fl xz

Modified: releng/10.2/contrib/libarchive/cpio/cpio.c
==
--- releng/10.2/contrib/libarchive/cpio/cpio.c  Tue May 31 16:32:42 2016
(r301046)
+++ releng/10.2/contrib/libarchive/cpio/cpio.c  Tue May 31 16:33:56 2016
(r301047)
@@ -179,6 +179,7 @@ main(int argc, char *argv[])
cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
@@ -264,6 +265,7 @@ main(int argc, char *argv[])
case OPTION_INSECURE:
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case 'L': /* GNU cpio */
cpio->option_follow_links = 1;
@@ -300,6 +302,7 @@ main(int argc, char *argv[])
"Cannot use both -p and -%c", cpio->mode);
cpio->mode = opt;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case OPTION_PRESERVE_OWNER:
cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;

Modified: releng/10.2/contrib/libarchive/libarchive/archive.h
==
--- releng/10.2/contrib/libarchive/libarchive/archive.h Tue May 31 16:32:42 
2016(r301046)
+++ releng/10.2/contrib/libarchive/libarchive/archive.h Tue May 31 16:33:56 
2016(r301047)
@@ -562,6 +562,8 @@ __LA_DECL int archive_read_set_options(s
 /* Default: Do not use HFS+ compression if it was not compressed. */
 /* This has no effect except on Mac OS v10.6 or later. */
 #defineARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED  (0x8000)
+/* Default: Do not reject entries with absolute paths */
+#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x1)
 
 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
 int flags);

Modified: releng/10.2/contrib/libarchive/libarchive/archive_write_disk.3
==
--- releng/10.2/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:32:42 2016(r301046)
+++ releng/10.2/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:33:56 2016(r301047)
@@ -177,6 +177,9 @@ The default is to not refuse such paths.
 Note that paths ending in
 .Pa ..
 always cause an error, regardless of this flag.
+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
 .It Cm ARCHIVE_EXTRACT_SPARSE
 Scan data for blocks of NUL bytes and try to recreate them with holes.
 This results in sparse files, independent of whether the archive format

Modified: releng/10.2/contrib/libarchive/libarchive/archive_write_disk_posix.c
==
--- 

svn commit: r301046 - in releng/10.1/contrib/libarchive: cpio libarchive libarchive/test

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:32:42 2016
New Revision: 301046
URL: https://svnweb.freebsd.org/changeset/base/301046

Log:
  Merge r300361 by mm@:
  
Backport security fix for absolute path traversal
vulnerability in bsdcpio.
  
  Security: CVE-2015-2304
  Security: SA-16:22
  Approved by:  so

Modified:
  releng/10.1/contrib/libarchive/cpio/bsdcpio.1
  releng/10.1/contrib/libarchive/cpio/cpio.c
  releng/10.1/contrib/libarchive/libarchive/archive.h
  releng/10.1/contrib/libarchive/libarchive/archive_write_disk.3
  releng/10.1/contrib/libarchive/libarchive/archive_write_disk_posix.c
  releng/10.1/contrib/libarchive/libarchive/test/test_write_disk_secure.c
Directory Properties:
  releng/10.1/   (props changed)

Modified: releng/10.1/contrib/libarchive/cpio/bsdcpio.1
==
--- releng/10.1/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:28:56 
2016(r301045)
+++ releng/10.1/contrib/libarchive/cpio/bsdcpio.1   Tue May 31 16:32:42 
2016(r301046)
@@ -156,7 +156,8 @@ See above for description.
 .It Fl Fl insecure
 (i and p mode only)
 Disable security checks during extraction or copying.
-This allows extraction via symbolic links and path names containing
+This allows extraction via symbolic links, absolute paths,
+and path names containing
 .Sq ..
 in the name.
 .It Fl J , Fl Fl xz

Modified: releng/10.1/contrib/libarchive/cpio/cpio.c
==
--- releng/10.1/contrib/libarchive/cpio/cpio.c  Tue May 31 16:28:56 2016
(r301045)
+++ releng/10.1/contrib/libarchive/cpio/cpio.c  Tue May 31 16:32:42 2016
(r301046)
@@ -179,6 +179,7 @@ main(int argc, char *argv[])
cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
@@ -264,6 +265,7 @@ main(int argc, char *argv[])
case OPTION_INSECURE:
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case 'L': /* GNU cpio */
cpio->option_follow_links = 1;
@@ -300,6 +302,7 @@ main(int argc, char *argv[])
"Cannot use both -p and -%c", cpio->mode);
cpio->mode = opt;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case OPTION_PRESERVE_OWNER:
cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;

Modified: releng/10.1/contrib/libarchive/libarchive/archive.h
==
--- releng/10.1/contrib/libarchive/libarchive/archive.h Tue May 31 16:28:56 
2016(r301045)
+++ releng/10.1/contrib/libarchive/libarchive/archive.h Tue May 31 16:32:42 
2016(r301046)
@@ -562,6 +562,8 @@ __LA_DECL int archive_read_set_options(s
 /* Default: Do not use HFS+ compression if it was not compressed. */
 /* This has no effect except on Mac OS v10.6 or later. */
 #defineARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED  (0x8000)
+/* Default: Do not reject entries with absolute paths */
+#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x1)
 
 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
 int flags);

Modified: releng/10.1/contrib/libarchive/libarchive/archive_write_disk.3
==
--- releng/10.1/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:28:56 2016(r301045)
+++ releng/10.1/contrib/libarchive/libarchive/archive_write_disk.3  Tue May 
31 16:32:42 2016(r301046)
@@ -177,6 +177,9 @@ The default is to not refuse such paths.
 Note that paths ending in
 .Pa ..
 always cause an error, regardless of this flag.
+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
 .It Cm ARCHIVE_EXTRACT_SPARSE
 Scan data for blocks of NUL bytes and try to recreate them with holes.
 This results in sparse files, independent of whether the archive format

Modified: releng/10.1/contrib/libarchive/libarchive/archive_write_disk_posix.c
==
--- 

svn commit: r301045 - head/sys/arm64/arm64

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 16:28:56 2016
New Revision: 301045
URL: https://svnweb.freebsd.org/changeset/base/301045

Log:
  Enable setting BF_COHERENT on DMA tags. This allows the kernel to start
  using the cache handling functions.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/busdma_bounce.c

Modified: head/sys/arm64/arm64/busdma_bounce.c
==
--- head/sys/arm64/arm64/busdma_bounce.cTue May 31 16:23:56 2016
(r301044)
+++ head/sys/arm64/arm64/busdma_bounce.cTue May 31 16:28:56 2016
(r301045)
@@ -184,10 +184,8 @@ bounce_bus_dma_tag_create(bus_dma_tag_t 
newtag->map_count = 0;
newtag->segments = NULL;
 
-#ifdef notyet
if ((flags & BUS_DMA_COHERENT) != 0)
newtag->bounce_flags |= BF_COHERENT;
-#endif
 
if (parent != NULL) {
if ((newtag->common.filter != NULL ||
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301044 - in releng/9.3/contrib/libarchive: cpio libarchive libarchive/test

2016-05-31 Thread Gleb Smirnoff
Author: glebius
Date: Tue May 31 16:23:56 2016
New Revision: 301044
URL: https://svnweb.freebsd.org/changeset/base/301044

Log:
  Merge r300363 by mm@:
  
Backport security fix for absolute path traversal vulnerability in bsdcpio.
  
  Security:   CVE-2015-2304
  Security:   SA-16:22
  Approved by:  so

Modified:
  releng/9.3/contrib/libarchive/cpio/bsdcpio.1
  releng/9.3/contrib/libarchive/cpio/cpio.c
  releng/9.3/contrib/libarchive/libarchive/archive.h
  releng/9.3/contrib/libarchive/libarchive/archive_write.c
  releng/9.3/contrib/libarchive/libarchive/archive_write_disk.3
  releng/9.3/contrib/libarchive/libarchive/test/test_write_disk_secure.c
Directory Properties:
  releng/9.3/   (props changed)

Modified: releng/9.3/contrib/libarchive/cpio/bsdcpio.1
==
--- releng/9.3/contrib/libarchive/cpio/bsdcpio.1Tue May 31 16:08:06 
2016(r301043)
+++ releng/9.3/contrib/libarchive/cpio/bsdcpio.1Tue May 31 16:23:56 
2016(r301044)
@@ -159,7 +159,8 @@ See above for description.
 .It Fl -insecure
 (i and p mode only)
 Disable security checks during extraction or copying.
-This allows extraction via symbolic links and path names containing
+This allows extraction via symbolic links, absolute paths,
+and path names containing
 .Sq ..
 in the name.
 .It Fl J

Modified: releng/9.3/contrib/libarchive/cpio/cpio.c
==
--- releng/9.3/contrib/libarchive/cpio/cpio.c   Tue May 31 16:08:06 2016
(r301043)
+++ releng/9.3/contrib/libarchive/cpio/cpio.c   Tue May 31 16:23:56 2016
(r301044)
@@ -162,6 +162,7 @@ main(int argc, char *argv[])
cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
@@ -231,6 +232,7 @@ main(int argc, char *argv[])
case OPTION_INSECURE:
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case 'L': /* GNU cpio */
cpio->option_follow_links = 1;
@@ -265,6 +267,7 @@ main(int argc, char *argv[])
"Cannot use both -p and -%c", cpio->mode);
cpio->mode = opt;
cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+   cpio->extract_flags &= 
~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
break;
case OPTION_PRESERVE_OWNER:
cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;

Modified: releng/9.3/contrib/libarchive/libarchive/archive.h
==
--- releng/9.3/contrib/libarchive/libarchive/archive.h  Tue May 31 16:08:06 
2016(r301043)
+++ releng/9.3/contrib/libarchive/libarchive/archive.h  Tue May 31 16:23:56 
2016(r301044)
@@ -477,6 +477,8 @@ __LA_DECL int   archive_read_set_options(
 #defineARCHIVE_EXTRACT_NO_OVERWRITE_NEWER  (0x0800)
 /* Detect blocks of 0 and write holes instead. */
 #defineARCHIVE_EXTRACT_SPARSE  (0x1000)
+/* Default: Do not reject entries with absolute paths */
+#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x1)
 
 __LA_DECL int   archive_read_extract(struct archive *, struct archive_entry *,
 int flags);

Modified: releng/9.3/contrib/libarchive/libarchive/archive_write.c
==
--- releng/9.3/contrib/libarchive/libarchive/archive_write.cTue May 31 
16:08:06 2016(r301043)
+++ releng/9.3/contrib/libarchive/libarchive/archive_write.cTue May 31 
16:23:56 2016(r301044)
@@ -459,8 +459,12 @@ static ssize_t
 _archive_write_data(struct archive *_a, const void *buff, size_t s)
 {
struct archive_write *a = (struct archive_write *)_a;
+   const size_t max_write = INT_MAX;
__archive_check_magic(>archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_data");
+   /* In particular, this catches attempts to pass negative values. */
+   if (s > max_write)
+   s = max_write;
archive_clear_error(>archive);
return ((a->format_write_data)(a, buff, s));
 }

Modified: releng/9.3/contrib/libarchive/libarchive/archive_write_disk.3

svn commit: r301043 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Tue May 31 16:08:06 2016
New Revision: 301043
URL: https://svnweb.freebsd.org/changeset/base/301043

Log:
  [ath_hal] rename the MCI state info routine.
  
  It's not /really/ "get state".

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
  head/sys/dev/ath/ath_hal/ah.h

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cTue May 31 
16:07:15 2016(r301042)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cTue May 31 
16:08:06 2016(r301043)
@@ -303,6 +303,15 @@ ar9300_attach_freebsd_ops(struct ath_hal
 
/* MCI bluetooth functions */
if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) {
+   /*
+* Note: these are done in attach too for now, because
+* at this point we haven't yet setup the mac/bb revision
+* values, so this code is effectively NULL.
+* However, I'm leaving this here so people digging
+* into the code (a) see the MCI bits here, and (b)
+* are now told they should look elsewhere for
+* these methods.
+*/
ah->ah_btCoexSetWeights = ar9300_mci_bt_coex_set_weights;
ah->ah_btCoexDisable = ar9300_mci_bt_coex_disable;
ah->ah_btCoexEnable = ar9300_mci_bt_coex_enable;
@@ -310,7 +319,7 @@ ar9300_attach_freebsd_ops(struct ath_hal
ah->ah_btMciSetup   = ar9300_mci_setup;
ah->ah_btMciSendMessage = ar9300_mci_send_message;
ah->ah_btMciGetInterrupt= ar9300_mci_get_interrupt;
-   ah->ah_btMciGetState= ar9300_mci_state;
+   ah->ah_btMciState   = ar9300_mci_state;
ah->ah_btMciDetach  = ar9300_mci_detach;
 
/* LNA diversity functions */

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Tue May 31 16:07:15 2016
(r301042)
+++ head/sys/dev/ath/ath_hal/ah.h   Tue May 31 16:08:06 2016
(r301043)
@@ -1513,7 +1513,7 @@ struct ath_hal {
HAL_BOOL, HAL_BOOL);
uint32_t__ahdecl(*ah_btMciGetInterrupt)(struct ath_hal *,
uint32_t *, uint32_t *);
-   uint32_t__ahdecl(*ah_btMciGetState)(struct ath_hal *,
+   uint32_t__ahdecl(*ah_btMciState)(struct ath_hal *,
uint32_t, uint32_t *);
void__ahdecl(*ah_btMciDetach)(struct ath_hal *);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301042 - head/sys/dev/ath/ath_hal/ar5416

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Tue May 31 16:07:15 2016
New Revision: 301042
URL: https://svnweb.freebsd.org/changeset/base/301042

Log:
  [ath_hal] add support for setting the azimuth timestamp in the outgoing TX 
payload.
  
  FYI: This is an unsupported/deprecated feature of the 11n hardware.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c   Tue May 31 16:05:54 
2016(r301041)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c   Tue May 31 16:07:15 
2016(r301042)
@@ -352,6 +352,7 @@ ar5416SetupTxDesc(struct ath_hal *ah, st
 
/*
 * XXX For now, just assume that this isn't a HT40 frame.
+* It'll get over-ridden by the multi-rate TX power setup.
 */
if (AH5212(ah)->ah_tpcEnabled) {
txPower = ar5416GetTxRatePower(ah, txRate0,
@@ -368,6 +369,7 @@ ar5416SetupTxDesc(struct ath_hal *ah, st
 ;
ads->ds_ctl1 = (type << AR_FrameType_S)
 | (flags & HAL_TXDESC_NOACK ? AR_NoAck : 0)
+| (flags & HAL_TXDESC_HWTS ? AR_InsertTS : 0)
  ;
ads->ds_ctl2 = SM(txTries0, AR_XmitDataTries0)
 | (flags & HAL_TXDESC_DURENA ? AR_DurUpdateEn : 0)
@@ -450,6 +452,10 @@ ar5416SetupXTxDesc(struct ath_hal *ah, s
return AH_TRUE;
 }
 
+/*
+ * XXX TODO: Figure out if AR_InsertTS is required on all sub-frames
+ * of a TX descriptor.
+ */
 HAL_BOOL
 ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds,
HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList, u_int descId,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301041 - head/sys/dev/ath/ath_hal

2016-05-31 Thread Adrian Chadd
Author: adrian
Date: Tue May 31 16:05:54 2016
New Revision: 301041
URL: https://svnweb.freebsd.org/changeset/base/301041

Log:
  [ath_hal] reserve a HAL_TXDESC_ bit for azimuth TX timestamp requests.

Modified:
  head/sys/dev/ath/ath_hal/ah_desc.h

Modified: head/sys/dev/ath/ath_hal/ah_desc.h
==
--- head/sys/dev/ath/ath_hal/ah_desc.h  Tue May 31 15:27:33 2016
(r301040)
+++ head/sys/dev/ath/ath_hal/ah_desc.h  Tue May 31 16:05:54 2016
(r301041)
@@ -280,7 +280,8 @@ struct ath_desc_status {
 #defineHAL_TXDESC_EXT_AND_CTL  0x0100  /* send on ext + ctl channels 
(11n) */
 #defineHAL_TXDESC_VMF  0x0200  /* virtual more frag */
 #defineHAL_TXDESC_LOWRXCHAIN   0x0400  /* switch to low RX chain */
-#defineHAL_TXDESC_LDPC 0x1000
+#defineHAL_TXDESC_LDPC 0x1000  /* Set LDPC TX for all rates */
+#defineHAL_TXDESC_HWTS 0x2000  /* Request Azimuth Timestamp in 
TX payload */
 
 /* flags passed to rx descriptor setup methods */
 #defineHAL_RXDESC_INTREQ   0x0020  /* enable per-descriptor 
interrupt */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Matthew Ahrens
On Tue, May 31, 2016 at 7:44 AM, Allan Jude  wrote:

> On 2016-05-31 07:41, Ivan Klymenko wrote:
> > On Tue, 31 May 2016 04:12:14 + (UTC)
> > Allan Jude  wrote:
> >
> >> Author: allanjude
> >> Date: Tue May 31 04:12:14 2016
> >> New Revision: 301010
> >> URL: https://svnweb.freebsd.org/changeset/base/301010
> >>
> >> Log:
> >>   Connect the SHA-512t256 and Skein hashing algorithms to ZFS
> >>
> >>   Support for the new hashing algorithms in ZFS was introduced in
> >> r289422 However it was disconnected because FreeBSD lacked
> >> implementations of SHA-512 (truncated to 256 bits), and Skein.
> >>
> >>   These implementations were introduced in r300921 and r300966
> >> respectively
> >>   This commit connects them to ZFS and enabled these new checksum
> >> algorithms
> >>   This new algorithms are not supported by the boot blocks, so do not
> >> use them on your root dataset if you boot from ZFS.
> >>
> >
> > Hello.
> >
> > Tell me please, who is now the fastest of these algorithms?
> >
> > What remains of the available algorithms checksum algorithm by default?
> >
> > Thanks.
> >
>
> None of the old checksums were removed
> This means the available checksums are (from fastest to slowest):
>
> off (bad idea)
> fletcher2 (not recommended, weak)
> fletcher4 (default)
> edon-r (not implemented, possibly insecure)
>

To be clear, all of the above are (possibly) insecure.  Edon-R and
fletcher4 are not used for dedup, so they doesn't need to be secure.
Edon-R can be used for nop-write, which also doesn't need to be secure, it
just needs to prevent accidental hash collisions (intentional ones are
fine, because they only mess up the block being written, and if you can
write then by definition you can arbitrarily modify the block being
written).

That said, even intentional collisions with Edon-R would be nontrivial,
because of the secret salt.  This is documented in the zpool-features
manpage:

   edonr

   GUID   org.illumos:edonr
   READ-ONLY COMPATIBLE   no
   DEPENDENCIES   none

   This feature enables the use of the Edon-R hash algorithm for
   checksum, including for nopwrite (if compression is also enabled,
   an overwrite of a block whose checksum matches the data being
   written will be ignored).  In an abundance of caution, Edon-R can
   not be used with dedup (without verification).

   Edon-R is a very high-performance hash algorithm that was part of
   the NIST SHA-3 competition. It provides extremely high hash
   performance (over 350% faster than SHA-256), but was not selected
   because of its unsuitability as a general purpose secure hash
   algorithm.  This implementation utilizes the new salted
   checksumming functionality in ZFS, which means that the checksum
is
   pre-seeded with a secret 256-bit random key (stored on the pool)
   before being fed the data block to be checksummed. Thus the
   produced checksums are unique to a given pool, blocking hash
   collision attacks on systems with dedup.

--matt


> skein
> sha512
> sha256
>
> --
> Allan Jude
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301040 - head/sys/kern

2016-05-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 31 15:27:33 2016
New Revision: 301040
URL: https://svnweb.freebsd.org/changeset/base/301040

Log:
  Cosmetics - add missing space after ellipses in shutdown messages.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_shutdown.c
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Tue May 31 15:05:50 2016
(r301039)
+++ head/sys/kern/kern_shutdown.c   Tue May 31 15:27:33 2016
(r301040)
@@ -804,7 +804,7 @@ kproc_shutdown(void *arg, int howto)
return;
 
p = (struct proc *)arg;
-   printf("Waiting (max %d seconds) for system process `%s' to stop...",
+   printf("Waiting (max %d seconds) for system process `%s' to stop... ",
kproc_shutdown_wait, p->p_comm);
error = kproc_suspend(p, kproc_shutdown_wait * hz);
 
@@ -824,7 +824,7 @@ kthread_shutdown(void *arg, int howto)
return;
 
td = (struct thread *)arg;
-   printf("Waiting (max %d seconds) for system thread `%s' to stop...",
+   printf("Waiting (max %d seconds) for system thread `%s' to stop... ",
kproc_shutdown_wait, td->td_name);
error = kthread_suspend(td, kproc_shutdown_wait * hz);
 

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cTue May 31 15:05:50 2016(r301039)
+++ head/sys/kern/vfs_subr.cTue May 31 15:27:33 2016(r301040)
@@ -2103,7 +2103,7 @@ sched_sync(void)
if (syncer_state != SYNCER_RUNNING &&
starttime != time_uptime) {
if (first_printf) {
-   printf("\nSyncing disks, vnodes remaining...");
+   printf("\nSyncing disks, vnodes remaining... ");
first_printf = 0;
}
printf("%d ", net_worklist_len);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301037 - head/sys/x86/include

2016-05-31 Thread Bruce Evans

On Tue, 31 May 2016, Ed Schouten wrote:


Log:
 Implement _ALIGN() using internal integer types.

 The existing version depends on register_t and uintptr_t, which are only
 available when including headers such as . As this macro is
 used by , for example, it should be written in such a way
 that it doesn't depend on those types.


It was originally carefully written to not have this dependency.  This was
broken by merging the amd64 and i386 versions.


Modified: head/sys/x86/include/_align.h
==
--- head/sys/x86/include/_align.h   Tue May 31 12:39:54 2016
(r301036)
+++ head/sys/x86/include/_align.h   Tue May 31 13:31:19 2016
(r301037)
@@ -46,7 +46,7 @@
 * for all data types (int, long, ...).   The result is unsigned int
 * and must be cast to any desired pointer type.
 */


The comment is still broken.  It still hard-codes the i386 type, so is
wrong for amd64.

The orginaly i386 version spelled "unsigned" verbosely as "unsigned int"
in the comment but not in the code.  The code now uses __uintptr_t.  My
version uses the following old fixes:

X diff -u2 param.h~ param.h
X --- param.h~  Thu Apr  8 23:21:42 2004
X +++ param.h   Thu Apr  8 23:21:43 2004
X @@ -40,20 +40,12 @@
X  /*
X   * Round p (pointer or byte index) up to a correctly-aligned value
X - * for all data types (int, long, ...).   The result is unsigned int
X - * and must be cast to any desired pointer type.
X + * for all data types (int, long, ...).   The result is compatible with
X + * uintptr_t and must be cast to any desired pointer type.
X   */
X -#ifndef _ALIGNBYTES
X  #define _ALIGNBYTES  (sizeof(int) - 1)
X -#endif
X -#ifndef _ALIGN
X  #define _ALIGN(p)(((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
X -#endif
X ...

The fixes here are:
- don't say what the type is.  Only say that it is compatible with something
- say it is compatible with uintptr_t and don't just echo the implementation's
  use of unsigned.  -current already uses __uintptr_t in the code.
- the verbose spelling goes away as a side effect
- remove ifdefs.  Redefinition with the same value is harmless, and the ifdefs
  just break detection of incorrect redefinitions.

The original amd64 version was more broken here.  It used u_long throughout
that looks better, but is broken since u_long is in the application
namespace.

The comment is also broken on arm64.  Plain arm was changed recently.  It
now has slightly better but unnecessarily different wording in the comment.

mips uses u_long consistently, but that is probably a type mismatch with
size_t.

powerpc has the same 2 bugs as x86 had before this fix.

riscv only has the wrong comment like arm64 (if it is 64 bits)

sparc64 only has the wrong comment.


-#define_ALIGNBYTES (sizeof(register_t) - 1)
-#define_ALIGN(p)   (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+#define_ALIGNBYTES (sizeof(__register_t) - 1)
+#define_ALIGN(p)   (((__uintptr_t)(p) + _ALIGNBYTES) & 
~_ALIGNBYTES)

#endif /* !_X86_INCLUDE__ALIGN_H_ */


The existence of this file is another bug.  The original version was
carefully written to live in , although that requires
complications to avoid namespace pollution in .

Now with the merged amd64 and i386, it takes 2 extra include files instead
of only 1 extra just to define 2 macros.  First there is 
which just points here; then there is .  Misimplementations
like that are one reason for bloated build times (bloat for kernels with
no modules since FreeBSD-4 is approximately 3 times in kernel size, 6
times in .depend/number of #include's, and more than 6 for build times.
Over nfs mounted without -cto, build times are almost proportional to the
number of #include statements unless you have a fast network and break
+cto using large -j.

 is too large and complicated to merge, so with the
alignment macros back in it, they have to be duplicated.  This is a
feature.  They can use unsigned [long], so you can see what the types
are without decoding 10 layers of nested includes and ifdefs.

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


svn commit: r301039 - head/sys/dev/sound/usb

2016-05-31 Thread Hans Petter Selasky
Author: hselasky
Date: Tue May 31 15:05:50 2016
New Revision: 301039
URL: https://svnweb.freebsd.org/changeset/base/301039

Log:
  Add support for simplex USB MIDI devices, which only provide BULK or
  INTERRUPT endpoints for moving data in one direction, like the KeyRig
  49 from M-Audio.
  
  Requested by: Ivan Klymenko 
  MFC after:1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Tue May 31 13:32:33 2016
(r301038)
+++ head/sys/dev/sound/usb/uaudio.c Tue May 31 15:05:50 2016
(r301039)
@@ -657,6 +657,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
+   .flags = {.no_pipe_ok = 1},
.callback = _bulk_write_callback,
},
 
@@ -665,7 +666,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4,   /* bytes */
-   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
+   .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
.callback = _bulk_read_callback,
},
 };
@@ -5754,7 +5755,16 @@ umidi_start_write(struct usb_fifo *fifo)
 {
struct umidi_chan *chan = usb_fifo_softc(fifo);
 
-   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) {
+   uint8_t buf[1];
+   int actlen;
+   do {
+   /* dump data */
+   usb_fifo_get_data_linear(fifo, buf, 1, , 0);
+   } while (actlen > 0);
+   } else {
+   usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+   }
 }
 
 static void
@@ -5872,6 +5882,11 @@ umidi_probe(device_t dev)
DPRINTF("error=%s\n", usbd_errstr(error));
goto detach;
}
+   if (chan->xfer[UMIDI_TX_TRANSFER] == NULL &&
+   chan->xfer[UMIDI_RX_TRANSFER] == NULL) {
+   DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n");
+   goto detach;
+   }
 
/*
 * Some USB MIDI device makers couldn't resist using
@@ -5885,7 +5900,8 @@ umidi_probe(device_t dev)
 * and 64-byte maximum packet sizes for full-speed bulk
 * endpoints and 512 bytes for high-speed bulk endpoints."
 */
-   if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
+   if (chan->xfer[UMIDI_TX_TRANSFER] != NULL &&
+   usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
chan->single_command = 1;
 
if (chan->single_command != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Allan Jude
On 2016-05-31 07:41, Ivan Klymenko wrote:
> On Tue, 31 May 2016 04:12:14 + (UTC)
> Allan Jude  wrote:
> 
>> Author: allanjude
>> Date: Tue May 31 04:12:14 2016
>> New Revision: 301010
>> URL: https://svnweb.freebsd.org/changeset/base/301010
>>
>> Log:
>>   Connect the SHA-512t256 and Skein hashing algorithms to ZFS
>>   
>>   Support for the new hashing algorithms in ZFS was introduced in
>> r289422 However it was disconnected because FreeBSD lacked
>> implementations of SHA-512 (truncated to 256 bits), and Skein.
>>   
>>   These implementations were introduced in r300921 and r300966
>> respectively 
>>   This commit connects them to ZFS and enabled these new checksum
>> algorithms 
>>   This new algorithms are not supported by the boot blocks, so do not
>> use them on your root dataset if you boot from ZFS.
>>   
> 
> Hello.
> 
> Tell me please, who is now the fastest of these algorithms?
> 
> What remains of the available algorithms checksum algorithm by default?
> 
> Thanks.
> 

None of the old checksums were removed
This means the available checksums are (from fastest to slowest):

off (bad idea)
fletcher2 (not recommended, weak)
fletcher4 (default)
edon-r (not implemented, possibly insecure)
skein
sha512
sha256

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


Re: svn commit: r300999 - in head: include lib/libc/db/man

2016-05-31 Thread Ed Schouten
2016-05-30 19:55 GMT+02:00 Pedro Giffuni :
> IMHO, just before a new release is the perfect time to break the ABI, and
> POSIX
> is a good reason to do it.

I thought about it a bit more and switching this over to size_t will
only cause breakage on 64-bit big endian platforms. On 32-bit systems
this would have no effect. On 64-bit little endian systems, we'd still
load the bottom four bytes, which is all right. We could use symbol
versioning to deal with this, but I don't think it's worth the effort.

I've sent out a code review to both of you: https://reviews.freebsd.org/D6660

If anyone wants to share their thoughts on the proposed change, feel
free to leave a comment. I'll hold off for a couple of days before
submitting.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Andrey Chernov
On 31.05.2016 17:17, Bruce Evans wrote:
> Our rand should use just 1, and it is dangerous to change RAND_MAX again,
> but can we even change the sequences?  Something might depend on
> reproducing the old sequences.

This question already arises many times. The sequence must be
reproducible during program runtime only, it is impossible to change
implementation at all otherwise. If someone needs something always
reproducible it needs to implement their own PRNG.

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


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Bruce Evans

On Tue, 31 May 2016, Andrey Chernov wrote:


On 31.05.2016 12:58, Bruce Evans wrote:

On Tue, 31 May 2016, Andrey Chernov wrote:

...

You can download SPRNG library implementing all of them here:
http://www.sprng.org/RNG/
For me it is overcomplicated.


The general case is certainly too complicated.  It would let the user
specify all the parameters for the LCG and generate optimal code for
the choice on the fly.  Maybe also change the parameters with the seed.
But even most implementors don't know how to choose the parameters.
That's just for the not so good LCG family of RNGs.


All mentioned PRNGs with exact parameters (info.h) can be found in the
subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks
complicated and use GMP Bignum library for calculations.


Our rand should use just 1, and it is dangerous to change RAND_MAX again,
but can we even change the sequences?  Something might depend on 
reproducing the old sequences.



For fixups, see full
explanation in the comment of stdlib/div.c


That was what I was complaining about.  div.c is for C90 (misspelled
"ANSI").  div.c hasn't caught up with C99.  C99 broke this by changing
...

In C90, div() is specified as giving "reliable" division, and that is
what the fixups implement.  This now wastes time to change nothing.
If the hardware does correct rounding, then the compiler already
had to do the fixup and id should have produced good MD code for this.
The C code then adds not so good MI code.


It seems POSIX says nothing about any fixup and negative results:
"These functions shall compute the quotient and remainder of the
division of the numerator numer by the denominator denom. If the
division is inexact, the resulting quotient is the long integer (for the
ldiv( ) function) or long long integer (for the lldiv( ) function) of
lesser magnitude that is the nearest to the algebraic quotient. If the
result cannot be represented, the behavior is undefined; otherwise, quot
* denom+rem shall equal numer."


This uses the same not so good wording as C90.  "algebraic" means
"in the field of ordinary rational numbers", not in a general algebraic
object.  Then we use the ordering property of the rationals, so we're
closer to analysis than algebra.

POSIX doesn't define the division operator, and the difference is only
there, except for bugs in the wording.  In C90, the rounding can go
either way so the fixup is needed, but in C99 and C11 the division
operator is intended to be specified to do the same rounding as div()
used to be specified to do, but with the unimproved wording "the result
[of division] is the algebraic quotient with any fractional part
discarded".  C99 and C11 remove the special wording for div().  This
removes all ordering requirements from the standard (1 was moved to
a footnote), so C has "unreliable" division again, depending on the
unspecified choice of sign for the fractional part.


Does it mean that this fixup should be removed?


Just ifdef it for < C99.  This corresponds to removing the special wording
in >= C99.

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


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Jan Beich
Allan Jude  writes:

> Author: allanjude
> Date: Tue May 31 04:12:14 2016
> New Revision: 301010
> URL: https://svnweb.freebsd.org/changeset/base/301010
>
> Log:
>   Connect the SHA-512t256 and Skein hashing algorithms to ZFS
>   
>   Support for the new hashing algorithms in ZFS was introduced in r289422
>   However it was disconnected because FreeBSD lacked implementations of
>   SHA-512 (truncated to 256 bits), and Skein.
>   
>   These implementations were introduced in r300921 and r300966 respectively
>   
>   This commit connects them to ZFS and enabled these new checksum algorithms
>   
>   This new algorithms are not supported by the boot blocks, so do not use them
>   on your root dataset if you boot from ZFS.

Can you document the feature and booting caveat in zpool-features(7) manpage?
And Illumos seems to limit booting support to pools vs. datasets.

  Booting off of pools using skein is NOT supported -- any attempt to
  enable skein on a root pool will fail with an error.

https://illumos.org/man/5/zpool-features


signature.asc
Description: PGP signature


svn commit: r301038 - head/sys/sys

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 13:32:33 2016
New Revision: 301038
URL: https://svnweb.freebsd.org/changeset/base/301038

Log:
  Make CMSG_*() work without having NULL available.
  
  The  is not supposed to declare NULL, according to POSIX.
  Our implementation complies with that, meaning that we need to make sure
  that CMSG_*() doesn't use it.

Modified:
  head/sys/sys/socket.h

Modified: head/sys/sys/socket.h
==
--- head/sys/sys/socket.h   Tue May 31 13:31:19 2016(r301037)
+++ head/sys/sys/socket.h   Tue May 31 13:32:33 2016(r301038)
@@ -500,7 +500,7 @@ struct sockcred {
 
 /* given pointer to struct cmsghdr, return pointer to next cmsghdr */
 #defineCMSG_NXTHDR(mhdr, cmsg) \
-   ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \
+   ((char *)(cmsg) == (char *)0 ? CMSG_FIRSTHDR(mhdr) : \
((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \
  _ALIGN(sizeof(struct cmsghdr)) > \
(char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
@@ -515,7 +515,7 @@ struct sockcred {
 #defineCMSG_FIRSTHDR(mhdr) \
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
 (struct cmsghdr *)(mhdr)->msg_control : \
-(struct cmsghdr *)NULL)
+(struct cmsghdr *)0)
 
 #if __BSD_VISIBLE
 /* RFC 2292 additions */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301037 - head/sys/x86/include

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 13:31:19 2016
New Revision: 301037
URL: https://svnweb.freebsd.org/changeset/base/301037

Log:
  Implement _ALIGN() using internal integer types.
  
  The existing version depends on register_t and uintptr_t, which are only
  available when including headers such as . As this macro is
  used by , for example, it should be written in such a way
  that it doesn't depend on those types.

Modified:
  head/sys/x86/include/_align.h

Modified: head/sys/x86/include/_align.h
==
--- head/sys/x86/include/_align.h   Tue May 31 12:39:54 2016
(r301036)
+++ head/sys/x86/include/_align.h   Tue May 31 13:31:19 2016
(r301037)
@@ -46,7 +46,7 @@
  * for all data types (int, long, ...).   The result is unsigned int
  * and must be cast to any desired pointer type.
  */
-#define_ALIGNBYTES (sizeof(register_t) - 1)
-#define_ALIGN(p)   (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+#define_ALIGNBYTES (sizeof(__register_t) - 1)
+#define_ALIGN(p)   (((__uintptr_t)(p) + _ALIGNBYTES) & 
~_ALIGNBYTES)
 
 #endif /* !_X86_INCLUDE__ALIGN_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Andrey Chernov
This implementation of shifts 32-bit and 64-bit PRNGs looks more
reliable than Mersenne primes and don't use Bignums:
http://wwwmaths.anu.edu.au/~brent/ftp/random/xorgens305.tar.gz
PDF article inside.

On 31.05.2016 14:30, Andrey Chernov wrote:
> On 31.05.2016 12:58, Bruce Evans wrote:
>> On Tue, 31 May 2016, Andrey Chernov wrote:
>>
>>> On 31.05.2016 9:48, Bruce Evans wrote:
> Perhaps you can find some ideas, answers and PRNG comparison in the
> original paper:
> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf

 The ones with Mersenne primes and tweaked Mersenne primes in the
 reference
 (lanl?) given by pfg@ seem OK.
>>>
>>> It should be again correctly implemented to not overflow 64bit (as any
>>> other 64bit generator too).
>>>
>>> Moreover, it have visible patterns in the low order bits. This one from
>>> the same site is better
>>> http://nuclear.llnl.gov/CNP/rng/rngman/node7.html
>>> but still have some pattern too and 61-bit. Next one does not suffer
>>> from the pattern at all
>>> http://nuclear.llnl.gov/CNP/rng/rngman/node8.html
>>> but is 2^64-2^10+1.
>>
>> That's the tweaked Mersenne prime one.
>>
>> Surely there is a pattern in the bits for all of these, and the better
>> ones just hide the pattern better from normal uses and tests?
> 
> Excepting bad first one from pfg@
> http://nuclear.llnl.gov/CNP/rng/rngman/node4.html
> as I understand, they not hide (i.e. drop) the pattern but mix it with
> other part in calculations, it cause whole range reduced.
> 
>>> You can download SPRNG library implementing all of them here:
>>> http://www.sprng.org/RNG/
>>> For me it is overcomplicated.
>>
>> The general case is certainly too complicated.  It would let the user
>> specify all the parameters for the LCG and generate optimal code for
>> the choice on the fly.  Maybe also change the parameters with the seed.
>> But even most implementors don't know how to choose the parameters.
>> That's just for the not so good LCG family of RNGs.
> 
> All mentioned PRNGs with exact parameters (info.h) can be found in the
> subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks
> complicated and use GMP Bignum library for calculations.

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


svn commit: r301036 - svnadmin/conf

2016-05-31 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue May 31 12:39:54 2016
New Revision: 301036
URL: https://svnweb.freebsd.org/changeset/base/301036

Log:
  Release Mariusz Zaborski (oshogbo) from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301035 - head/include

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 12:29:21 2016
New Revision: 301035
URL: https://svnweb.freebsd.org/changeset/base/301035

Log:
  Make strfmon_l() work without requiring the use of .
  
  The strfmon_l() function provided by  is also part
  of POSIX 2008's , so it should be exposed by default.
  
  Change the check used in  to be similar to the one that's
  part of , where we both test for __POSIX_VISIBLE and
  _XLOCALE_H_.

Modified:
  head/include/monetary.h

Modified: head/include/monetary.h
==
--- head/include/monetary.h Tue May 31 11:32:09 2016(r301034)
+++ head/include/monetary.h Tue May 31 12:29:21 2016(r301035)
@@ -43,7 +43,7 @@ typedef   __ssize_t   ssize_t;
 #endif
 
 __BEGIN_DECLS
-#ifdef _XLOCALE_H_
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
 #include 
 #endif
 ssize_tstrfmon(char * __restrict, size_t, const char * __restrict, 
...);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301010 - in head/sys: cddl/contrib/opensolaris/common/zfs cddl/contrib/opensolaris/uts/common cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2016-05-31 Thread Ivan Klymenko
On Tue, 31 May 2016 04:12:14 + (UTC)
Allan Jude  wrote:

> Author: allanjude
> Date: Tue May 31 04:12:14 2016
> New Revision: 301010
> URL: https://svnweb.freebsd.org/changeset/base/301010
> 
> Log:
>   Connect the SHA-512t256 and Skein hashing algorithms to ZFS
>   
>   Support for the new hashing algorithms in ZFS was introduced in
> r289422 However it was disconnected because FreeBSD lacked
> implementations of SHA-512 (truncated to 256 bits), and Skein.
>   
>   These implementations were introduced in r300921 and r300966
> respectively 
>   This commit connects them to ZFS and enabled these new checksum
> algorithms 
>   This new algorithms are not supported by the boot blocks, so do not
> use them on your root dataset if you boot from ZFS.
>   

Hello.

Tell me please, who is now the fastest of these algorithms?

What remains of the available algorithms checksum algorithm by default?

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


svn commit: r301033 - in head: sys/dev/iscsi usr.bin/iscsictl

2016-05-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 31 11:32:07 2016
New Revision: 301033
URL: https://svnweb.freebsd.org/changeset/base/301033

Log:
  Add "iscsictl -e".  Among other things, it makes it possible to perform
  discovery without attaching to the targets ("iscsictl -Ad ... -e off"),
  and then attach to selected ones ("iscsictl -Mi ... -e on").
  
  PR:   204129
  MFC after:1 month
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6633

Modified:
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi_ioctl.h
  head/usr.bin/iscsictl/iscsi.conf.5
  head/usr.bin/iscsictl/iscsictl.8
  head/usr.bin/iscsictl/iscsictl.c
  head/usr.bin/iscsictl/iscsictl.h
  head/usr.bin/iscsictl/parse.y
  head/usr.bin/iscsictl/token.l

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Tue May 31 09:24:16 2016(r301032)
+++ head/sys/dev/iscsi/iscsi.c  Tue May 31 11:32:07 2016(r301033)
@@ -406,6 +406,11 @@ iscsi_maintenance_thread_reconnect(struc
KASSERT(STAILQ_EMPTY(>is_postponed),
("destroying session with postponed PDUs"));
 
+   if (is->is_conf.isc_enable == 0 && is->is_conf.isc_discovery == 0) {
+   ISCSI_SESSION_UNLOCK(is);
+   return;
+   }
+
/*
 * Request immediate reconnection from iscsid(8).
 */
@@ -549,6 +554,9 @@ iscsi_callout(void *context)
 
callout_schedule(>is_callout, 1 * hz);
 
+   if (is->is_conf.isc_enable == 0)
+   goto out;
+
is->is_timeout++;
 
if (is->is_waiting_for_iscsid) {
@@ -1311,6 +1319,11 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof
for (;;) {
TAILQ_FOREACH(is, >sc_sessions, is_next) {
ISCSI_SESSION_LOCK(is);
+   if (is->is_conf.isc_enable == 0 &&
+   is->is_conf.isc_discovery == 0) {
+   ISCSI_SESSION_UNLOCK(is);
+   continue;
+   }
if (is->is_waiting_for_iscsid)
break;
ISCSI_SESSION_UNLOCK(is);
@@ -1826,17 +1839,22 @@ iscsi_ioctl_session_add(struct iscsi_sof
callout_reset(>is_callout, 1 * hz, iscsi_callout, is);
TAILQ_INSERT_TAIL(>sc_sessions, is, is_next);
 
+   ISCSI_SESSION_LOCK(is);
/*
-* Trigger immediate reconnection.
+* Don't notify iscsid(8) if the session is disabled and it's not
+* a discovery session,
 */
-   ISCSI_SESSION_LOCK(is);
+   if (is->is_conf.isc_enable == 0 && is->is_conf.isc_discovery == 0) {
+   ISCSI_SESSION_UNLOCK(is);
+   sx_xunlock(>sc_lock);
+   return (0);
+   }
+
is->is_waiting_for_iscsid = true;
strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason));
ISCSI_SESSION_UNLOCK(is);
cv_signal(>sc_cv);
-
sx_xunlock(>sc_lock);
-
return (0);
 }
 

Modified: head/sys/dev/iscsi/iscsi_ioctl.h
==
--- head/sys/dev/iscsi/iscsi_ioctl.hTue May 31 09:24:16 2016
(r301032)
+++ head/sys/dev/iscsi/iscsi_ioctl.hTue May 31 11:32:07 2016
(r301033)
@@ -67,7 +67,8 @@ struct iscsi_session_conf {
int isc_data_digest;
int isc_iser;
charisc_offload[ISCSI_OFFLOAD_LEN];
-   int isc_spare[2];
+   int isc_enable;
+   int isc_spare[1];
 };
 
 /*

Modified: head/usr.bin/iscsictl/iscsi.conf.5
==
--- head/usr.bin/iscsictl/iscsi.conf.5  Tue May 31 09:24:16 2016
(r301032)
+++ head/usr.bin/iscsictl/iscsi.conf.5  Tue May 31 11:32:07 2016
(r301033)
@@ -125,6 +125,14 @@ must be defined.
 Discovery sessions result in the initiator connecting to all the targets
 returned by SendTargets iSCSI discovery with the defined
 .Sy TargetAddress .
+.It Cm Enable
+Enable or disable the session.
+State can be either
+.Qq Ar On ,
+or
+.Qq Ar Off .
+Default is
+.Qq Ar On .
 .It Cm Offload
 Name of selected iSCSI hardware offload driver.
 Default is

Modified: head/usr.bin/iscsictl/iscsictl.8
==
--- head/usr.bin/iscsictl/iscsictl.8Tue May 31 09:24:16 2016
(r301032)
+++ head/usr.bin/iscsictl/iscsictl.8Tue May 31 11:32:07 2016
(r301033)
@@ -40,11 +40,13 @@
 .Op Fl u Ar user Fl s Ar secret
 .Op Fl w Ar timeout
 .Op Fl r
+.Op Fl e Cm on | off
 .Nm
 .Fl A
 .Fl d Ar discovery-host
 .Op Fl u Ar user Fl s Ar secret
 .Op Fl r
+.Op Fl e Cm on | off
 .Nm
 .Fl A
 .Fl a Op Fl c Ar path
@@ -58,6 +60,7 @@
 .Op Fl t Ar target
 .Op Fl u Ar user
 

svn commit: r301034 - head/sys/cddl/dev/dtrace/aarch64

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 11:32:09 2016
New Revision: 301034
URL: https://svnweb.freebsd.org/changeset/base/301034

Log:
  Set oldfp so the check for fp == oldfp works as expected.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c

Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c
==
--- head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c   Tue May 31 11:32:07 
2016(r301033)
+++ head/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c   Tue May 31 11:32:09 
2016(r301034)
@@ -119,7 +119,7 @@ dtrace_getustack_common(uint64_t *pcstac
volatile uint16_t *flags =
(volatile uint16_t *)_core[curcpu].cpuc_dtrace_flags;
int ret = 0;
-   uintptr_t oldfp;
+   uintptr_t oldfp = fp;
 
ASSERT(pcstack == NULL || pcstack_limit > 0);
 
@@ -168,6 +168,8 @@ dtrace_getustack_common(uint64_t *pcstac
*flags &= ~CPU_DTRACE_FAULT;
break;
}
+
+   oldfp = fp;
}
 
return (ret);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Andrey Chernov
On 31.05.2016 12:58, Bruce Evans wrote:
> On Tue, 31 May 2016, Andrey Chernov wrote:
> 
>> On 31.05.2016 9:48, Bruce Evans wrote:
 Perhaps you can find some ideas, answers and PRNG comparison in the
 original paper:
 http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf
>>>
>>> The ones with Mersenne primes and tweaked Mersenne primes in the
>>> reference
>>> (lanl?) given by pfg@ seem OK.
>>
>> It should be again correctly implemented to not overflow 64bit (as any
>> other 64bit generator too).
>>
>> Moreover, it have visible patterns in the low order bits. This one from
>> the same site is better
>> http://nuclear.llnl.gov/CNP/rng/rngman/node7.html
>> but still have some pattern too and 61-bit. Next one does not suffer
>> from the pattern at all
>> http://nuclear.llnl.gov/CNP/rng/rngman/node8.html
>> but is 2^64-2^10+1.
> 
> That's the tweaked Mersenne prime one.
> 
> Surely there is a pattern in the bits for all of these, and the better
> ones just hide the pattern better from normal uses and tests?

Excepting bad first one from pfg@
http://nuclear.llnl.gov/CNP/rng/rngman/node4.html
as I understand, they not hide (i.e. drop) the pattern but mix it with
other part in calculations, it cause whole range reduced.

>> You can download SPRNG library implementing all of them here:
>> http://www.sprng.org/RNG/
>> For me it is overcomplicated.
> 
> The general case is certainly too complicated.  It would let the user
> specify all the parameters for the LCG and generate optimal code for
> the choice on the fly.  Maybe also change the parameters with the seed.
> But even most implementors don't know how to choose the parameters.
> That's just for the not so good LCG family of RNGs.

All mentioned PRNGs with exact parameters (info.h) can be found in the
subdirs under SRC, f.e. lcg64 or pmlcfg. They are still looks
complicated and use GMP Bignum library for calculations.

>> For fixups, see full
>> explanation in the comment of stdlib/div.c
> 
> That was what I was complaining about.  div.c is for C90 (misspelled
> "ANSI").  div.c hasn't caught up with C99.  C99 broke this by changing
> the rules for integer division to disallow correct rounding for and
> require consistently incorrect rounding.  Correct rounding for a
> positive divisor is towards minus infinity so that the remainder is
> not negative.  This is modulo arithmetic and has good algebraic
> properties.  C99 requires rounding minus infinity, at least for positive
> divisors, under the extension "reliable integer division".  In C90,
> the rounding is implementation- defined, so it may be correct, but it
> is "unreliable" since it can be anything.
> 
> In C90, div() is specified as giving "reliable" division, and that is
> what the fixups implement.  This now wastes time to change nothing.
> If the hardware does correct rounding, then the compiler already
> had to do the fixup and id should have produced good MD code for this.
> The C code then adds not so good MI code.

It seems POSIX says nothing about any fixup and negative results:
"These functions shall compute the quotient and remainder of the
division of the numerator numer by the denominator denom. If the
division is inexact, the resulting quotient is the long integer (for the
ldiv( ) function) or long long integer (for the lldiv( ) function) of
lesser magnitude that is the nearest to the algebraic quotient. If the
result cannot be represented, the behavior is undefined; otherwise, quot
* denom+rem shall equal numer."
Does it mean that this fixup should be removed?

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


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Bruce Evans

On Tue, 31 May 2016, Andrey Chernov wrote:


On 31.05.2016 9:48, Bruce Evans wrote:

Perhaps you can find some ideas, answers and PRNG comparison in the
original paper:
http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf


The ones with Mersenne primes and tweaked Mersenne primes in the reference
(lanl?) given by pfg@ seem OK.


It should be again correctly implemented to not overflow 64bit (as any
other 64bit generator too).

Moreover, it have visible patterns in the low order bits. This one from
the same site is better
http://nuclear.llnl.gov/CNP/rng/rngman/node7.html
but still have some pattern too and 61-bit. Next one does not suffer
from the pattern at all
http://nuclear.llnl.gov/CNP/rng/rngman/node8.html
but is 2^64-2^10+1.


That's the tweaked Mersenne prime one.

Surely there is a pattern in the bits for all of these, and the better
ones just hide the pattern better from normal uses and tests?

Isn't it well known that the lower bits have more patterns so shouldn't
be used?  This depends on whether the implementation exposes all its
bits.  Since the rand() specification and FreeBSD man pages don't say
anything about this, it is a bug in the implementation to expose all
its bits.  The implementation is handicapped by using only 32 bits
internally but wanting RAND_MAX to be almost 32 bits.


You can download SPRNG library implementing all of them here:
http://www.sprng.org/RNG/
For me it is overcomplicated.


The general case is certainly too complicated.  It would let the user
specify all the parameters for the LCG and generate optimal code for
the choice on the fly.  Maybe also change the parameters with the seed.
But even most implementors don't know how to choose the parameters.
That's just for the not so good LCG family of RNGs.


clang -O uses single "idivl" calculating both quotient and reminder for
current code, but for ldiv(3) case call/storage/additional calcs
overhead will be added. ldiv(3) does not reduce anything, see
stdlib/ldiv.c


The extern functions give lots of overhead.  Sometimes they get replaced
automatically by builtins, so it is unclear when the extern functions are
actually used.  ldiv.c compiles to idivl for the division part but has
lots of extras for the fixups.  The fixups do nothing except waste time
on most hardware/cstd combinations.  IIRC, C99 requires direct division
to have the same poor rounding rules as idiv(), so idiv() is not really
needed in C99 and the fixups in it are negatively needed.  The builtins
know what is needed so they don't do the fixups in the usual case that
the hardware follows the poor rounding rules.


We don't have ldiv() builtin in any cae.


Apparently integer division is too fundamental to be a builtin.
strings -a `which clang` | grep builtin.*div on amd64 gives 47 builtins
for division, but none seem to be for integer division.  gcc-3.3 has
just 4, all for SSE FP division.


For fixups, see full
explanation in the comment of stdlib/div.c


That was what I was complaining about.  div.c is for C90 (misspelled
"ANSI").  div.c hasn't caught up with C99.  C99 broke this by changing
the rules for integer division to disallow correct rounding for and
require consistently incorrect rounding.  Correct rounding for a
positive divisor is towards minus infinity so that the remainder is
not negative.  This is modulo arithmetic and has good algebraic
properties.  C99 requires rounding minus infinity, at least for positive
divisors, under the extension "reliable integer division".  In C90,
the rounding is implementation- defined, so it may be correct, but it
is "unreliable" since it can be anything.

In C90, div() is specified as giving "reliable" division, and that is
what the fixups implement.  This now wastes time to change nothing.
If the hardware does correct rounding, then the compiler already
had to do the fixup and id should have produced good MD code for this.
The C code then adds not so good MI code.

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


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

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 09:24:16 2016
New Revision: 301032
URL: https://svnweb.freebsd.org/changeset/base/301032

Log:
  Move a device_printf under bootverbose where it should have been.
  
  Reported by:  bz
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/pci/pci_host_generic.c
==
--- head/sys/dev/pci/pci_host_generic.c Tue May 31 09:15:21 2016
(r301031)
+++ head/sys/dev/pci/pci_host_generic.c Tue May 31 09:24:16 2016
(r301032)
@@ -185,7 +185,7 @@ pci_host_generic_attach(device_t dev)
if (sc->coherent == 0) {
sc->coherent = OF_hasprop(node, "dma-coherent");
}
-   //if (bootverbose)
+   if (bootverbose)
device_printf(dev, "Bus is%s cache-coherent\n",
sc->coherent ? "" : " not");
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301031 - in head/sys: arm64/cavium dev/pci

2016-05-31 Thread Andrew Turner
Author: andrew
Date: Tue May 31 09:15:21 2016
New Revision: 301031
URL: https://svnweb.freebsd.org/changeset/base/301031

Log:
  Mark the ThunderX and generic PCI drivers as cache-coherent when we know
  this to be the case. This will mean we don't try and handle the cache in
  bus_dmamap_sync when it is not needed.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6605

Modified:
  head/sys/arm64/cavium/thunder_pcie_fdt.c
  head/sys/arm64/cavium/thunder_pcie_pem.c
  head/sys/arm64/cavium/thunder_pcie_pem.h
  head/sys/dev/pci/pci_host_generic.c
  head/sys/dev/pci/pci_host_generic.h

Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c
==
--- head/sys/arm64/cavium/thunder_pcie_fdt.cTue May 31 08:38:24 2016
(r301030)
+++ head/sys/arm64/cavium/thunder_pcie_fdt.cTue May 31 09:15:21 2016
(r301031)
@@ -119,6 +119,7 @@ thunder_pcie_fdt_attach(device_t dev)
 
sc = device_get_softc(dev);
thunder_pcie_identify_ecam(dev, >ecam);
+   sc->coherent = 1;
 
return (pci_host_generic_attach(dev));
 }

Modified: head/sys/arm64/cavium/thunder_pcie_pem.c
==
--- head/sys/arm64/cavium/thunder_pcie_pem.cTue May 31 08:38:24 2016
(r301030)
+++ head/sys/arm64/cavium/thunder_pcie_pem.cTue May 31 09:15:21 2016
(r301031)
@@ -137,6 +137,7 @@ static int thunder_pem_get_id(device_t, 
 static int thunder_pem_attach(device_t);
 static int thunder_pem_deactivate_resource(device_t, device_t, int, int,
 struct resource *);
+static bus_dma_tag_t thunder_pem_get_dma_tag(device_t, device_t);
 static int thunder_pem_detach(device_t);
 static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int);
 static int thunder_pem_link_init(struct thunder_pem_softc *);
@@ -176,6 +177,8 @@ static device_method_t thunder_pem_metho
DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
 
+   DEVMETHOD(bus_get_dma_tag,  thunder_pem_get_dma_tag),
+
/* pcib interface */
DEVMETHOD(pcib_maxslots,thunder_pem_maxslots),
DEVMETHOD(pcib_read_config, thunder_pem_read_config),
@@ -331,6 +334,15 @@ thunder_pem_adjust_resource(device_t dev
return (rman_adjust_resource(res, start, end));
 }
 
+static bus_dma_tag_t
+thunder_pem_get_dma_tag(device_t dev, device_t child)
+{
+   struct thunder_pem_softc *sc;
+
+   sc = device_get_softc(dev);
+   return (sc->dmat);
+}
+
 static int
 thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount,
 int *irqs)
@@ -766,6 +778,21 @@ thunder_pem_attach(device_t dev)
sc->reg_bst = rman_get_bustag(sc->reg);
sc->reg_bsh = rman_get_bushandle(sc->reg);
 
+   /* Create the parent DMA tag to pass down the coherent flag */
+   error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
+   1, 0,   /* alignment, bounds */
+   BUS_SPACE_MAXADDR,  /* lowaddr */
+   BUS_SPACE_MAXADDR,  /* highaddr */
+   NULL, NULL, /* filter, filterarg */
+   BUS_SPACE_MAXSIZE,  /* maxsize */
+   BUS_SPACE_UNRESTRICTED, /* nsegments */
+   BUS_SPACE_MAXSIZE,  /* maxsegsize */
+   BUS_DMA_COHERENT,   /* flags */
+   NULL, NULL, /* lockfunc, lockarg */
+   >dmat);
+   if (error != 0)
+   return (error);
+
/* Map SLI, do it only once */
if (!sli0_s2m_regx_base) {
bus_space_map(sc->reg_bst, SLIX_S2M_REGX_ACC,

Modified: head/sys/arm64/cavium/thunder_pcie_pem.h
==
--- head/sys/arm64/cavium/thunder_pcie_pem.hTue May 31 08:38:24 2016
(r301030)
+++ head/sys/arm64/cavium/thunder_pcie_pem.hTue May 31 09:15:21 2016
(r301031)
@@ -39,6 +39,7 @@ struct thunder_pem_softc {
struct resource *reg;
bus_space_tag_t reg_bst;
bus_space_handle_t  reg_bsh;
+   bus_dma_tag_t   dmat;
struct pcie_range   ranges[MAX_RANGES_TUPLES];
struct rman mem_rman;
struct rman io_rman;

Modified: head/sys/dev/pci/pci_host_generic.c
==
--- head/sys/dev/pci/pci_host_generic.c Tue May 31 08:38:24 2016
(r301030)
+++ head/sys/dev/pci/pci_host_generic.c Tue May 31 09:15:21 2016
(r301031)
@@ -181,6 +181,29 @@ pci_host_generic_attach(device_t dev)
if (generic_pcie_ofw_bus_attach(dev) != 0)
return (ENXIO);
 
+   node 

Re: svn commit: r301024 - head/sbin/swapon

2016-05-31 Thread Chris Torek
> This change makes the code use the POSIX basename() function. It has the
> advantage that (if implemented correctly), it also imposes no restrict
> on the pathname length.

I'm not sure what the parenthetic remark "if implemented correctly"
means, but libc basename() has this in it:

char *
basename(const char *path)
{
static char *bname = NULL;

if (bname == NULL) {
bname = (char *)malloc(MAXPATHLEN);
if (bname == NULL)
return (NULL);
}
return (basename_r(path, bname));
}

which means that it is not only not thread-safe, it also
imposes restrictions on pathname length.

I recently wrote a pair of can-be-thread-safe yet can-be-
unlimited-path-length yet can-be-backwards-compatible basename
and dirname functions (I tested to see if they produced the same
errno's and oddball outputs like for dirname("///")).  I'll toss
them in here in case anyone has some enthusiasm for fixing the
mess.  Of course they are equally non-standard, unless we can
convince a future POSIX committee or something.

(I also wrote some halfway useable reentrant getpw* and getgr*
functions but they need more thought and do not play well with
nsswitch so I am not including them here.  NB: rfuncs.h just
contains declarations for these reentrant r_* functions.)

Chris

---

/*
 * Copyright 2016 Chris Torek 
 * All rights reserved
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted providing 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 ``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 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.
 *
 */

#include 
#include 
#include 
#include 

#include "rfuncs.h"

/*
 * This is essentially a clone of the BSD basename_r function,
 * which is like POSIX basename() but puts the result in a user
 * supplied buffer.
 *
 * In BSD basename_r, the buffer must be least MAXPATHLEN bytes
 * long.  In our case we take the size of the buffer as an argument.
 *
 * Note that it's impossible in general to do this without
 * a temporary buffer since basename("foo/bar") is "bar",
 * but basename("foo/bar/") is still "bar" -- no trailing
 * slash is allowed.
 *
 * The return value is your supplied buffer , or NULL if
 * the length of the basename of the supplied  equals or
 * exceeds your indicated .
 *
 * As a special but useful case, if you supply NULL for the 
 * argument, we allocate the buffer dynamically to match the
 * basename, i.e., the result is basically strdup()ed for you.
 * In this case  is ignored (recommended: pass 0 here).
 */
char *
r_basename(const char *path, char *buf, size_t bufsize)
{
const char *endp, *comp;
size_t len;

/*
 * NULL or empty path means ".".  This is perhaps overly
 * forgiving but matches libc basename_r(), and avoids
 * breaking the code below.
 */
if (path == NULL || *path == '\0') {
comp = ".";
len = 1;
} else {
/*
 * Back up over any trailing slashes.  If we reach
 * the top of the path and it's still a trailing
 * slash, it's also a leading slash and the entire
 * path is just "/" (or "//", or "///", etc).
 */
endp = path + strlen(path) - 1;
while (*endp == '/' && endp > path)
endp--;
/* Invariant: *endp != '/' || endp == path */
if (*endp == '/') {
/* then endp==path and hence entire path is "/" */
comp = "/";
len = 1;
} else {
/*
 * We handled empty strings earlier, and
 * we just proved *endp != '/'.  

svn commit: r301030 - head/sys/x86/include

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 08:38:24 2016
New Revision: 301030
URL: https://svnweb.freebsd.org/changeset/base/301030

Log:
  Add missing dependency on .
  
  In r227474, this header file was changed to define SIG_ATOMIC_{MIN,MAX}
  in terms of LONG_{MIN,MAX}. Unlike all of the definitions in this header
  file, LONG_{MIN,MAX} is provided by . Remove the dependency on
   by using __LONG_{MIN,MAX} instead and including
  .
  
  This change is needed to make SIG_ATOMIC_{MIN,MAX} work without
  including any other header files.

Modified:
  head/sys/x86/include/_stdint.h

Modified: head/sys/x86/include/_stdint.h
==
--- head/sys/x86/include/_stdint.h  Tue May 31 08:36:39 2016
(r301029)
+++ head/sys/x86/include/_stdint.h  Tue May 31 08:38:24 2016
(r301030)
@@ -40,6 +40,8 @@
 #ifndef _MACHINE__STDINT_H_
 #define_MACHINE__STDINT_H_
 
+#include 
+
 #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
 
 #defineINT8_C(c)   (c)
@@ -167,8 +169,8 @@
 #definePTRDIFF_MAX INT64_MAX
 
 /* Limits of sig_atomic_t. */
-#defineSIG_ATOMIC_MIN  LONG_MIN
-#defineSIG_ATOMIC_MAX  LONG_MAX
+#defineSIG_ATOMIC_MIN  __LONG_MIN
+#defineSIG_ATOMIC_MAX  __LONG_MAX
 
 /* Limit of size_t. */
 #defineSIZE_MAXUINT64_MAX
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301029 - head/sys/x86/include

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 08:36:39 2016
New Revision: 301029
URL: https://svnweb.freebsd.org/changeset/base/301029

Log:
  Add missing dependency on .
  
  This header uses __INT_MIN and __INT_MAX, which is provided by
  . This is needed to make 's WCHAR_MIN and
  WCHAR_MAX work without including other headers as well.

Modified:
  head/sys/x86/include/_types.h

Modified: head/sys/x86/include/_types.h
==
--- head/sys/x86/include/_types.h   Tue May 31 08:31:34 2016
(r301028)
+++ head/sys/x86/include/_types.h   Tue May 31 08:36:39 2016
(r301029)
@@ -43,6 +43,8 @@
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
+#include 
+
 #define __NO_STRICT_ALIGNMENT
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301028 - head/etc/rc.d

2016-05-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 31 08:31:34 2016
New Revision: 301028
URL: https://svnweb.freebsd.org/changeset/base/301028

Log:
  Cosmetics: add missing space after the ':' in etc/rc.d/random.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/etc/rc.d/random

Modified: head/etc/rc.d/random
==
--- head/etc/rc.d/randomTue May 31 08:27:39 2016(r301027)
+++ head/etc/rc.d/randomTue May 31 08:31:34 2016(r301028)
@@ -44,12 +44,12 @@ random_start()
 {
 
if [ ${harvest_mask} -gt 0 ]; then
-   echo -n 'Setting up harvesting:'
+   echo -n 'Setting up harvesting: '
${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null
${SYSCTL_N} kern.random.harvest.mask_symbolic
fi
 
-   echo -n 'Feeding entropy:'
+   echo -n 'Feeding entropy: '
 
if [ ! -w /dev/random ] ; then
warn "/dev/random is not writeable"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301027 - head/lib/libfetch

2016-05-31 Thread Dag-Erling Smørgrav
Author: des
Date: Tue May 31 08:27:39 2016
New Revision: 301027
URL: https://svnweb.freebsd.org/changeset/base/301027

Log:
  r169386 (PR 112515) was incomplete: it treated 307 as an error except
  in verbose mode, and did not handle 308 at all.
  
  r241840 (PR 172451) added support for 308, but with the same bug.
  
  Correctly handle both by recognizing them as redirects in all places
  where we check the HTTP result code.
  
  PR:   112515 173451 209546
  Submitted by: novel@
  MFC after:1 week

Modified:
  head/lib/libfetch/http.c

Modified: head/lib/libfetch/http.c
==
--- head/lib/libfetch/http.cTue May 31 08:07:40 2016(r301026)
+++ head/lib/libfetch/http.cTue May 31 08:27:39 2016(r301027)
@@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|| (xyz) == HTTP_MOVED_TEMP \
|| (xyz) == HTTP_TEMP_REDIRECT \
+   || (xyz) == HTTP_PERM_REDIRECT \
|| (xyz) == HTTP_USE_PROXY \
|| (xyz) == HTTP_SEE_OTHER)
 
@@ -1767,6 +1768,8 @@ http_request_body(struct url *URL, const
break;
case HTTP_MOVED_PERM:
case HTTP_MOVED_TEMP:
+   case HTTP_TEMP_REDIRECT:
+   case HTTP_PERM_REDIRECT:
case HTTP_SEE_OTHER:
case HTTP_USE_PROXY:
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301026 - head/sys/sys

2016-05-31 Thread Ed Schouten
Author: ed
Date: Tue May 31 08:07:40 2016
New Revision: 301026
URL: https://svnweb.freebsd.org/changeset/base/301026

Log:
  Let  define struct timespec.
  
  POSIX 2004 doesn't require that this header defines struct timespec, but
  does allow it. For FreeBSD, we would at least need a forward declaration
  for sched_rr_get_interval().
  
  POSIX 2008 is a bit more demanding, as it now requires that it is
  declared. Remove the old forward declaration and include the _timespec.h
  header. This should conform to both POSIX 2004 and 2008 now.

Modified:
  head/sys/sys/sched.h

Modified: head/sys/sys/sched.h
==
--- head/sys/sys/sched.hTue May 31 07:49:59 2016(r301025)
+++ head/sys/sys/sched.hTue May 31 08:07:40 2016(r301026)
@@ -222,6 +222,7 @@ struct sched_param {
  */
 #ifndef _KERNEL
 #include 
+#include 
 #include 
 
 #ifndef _PID_T_DECLARED
@@ -229,8 +230,6 @@ typedef __pid_t pid_t;
 #define _PID_T_DECLARED
 #endif
 
-struct timespec;
-
 __BEGIN_DECLS
 int sched_get_priority_max(int);
 int sched_get_priority_min(int);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300956 - head/lib/libc/stdlib

2016-05-31 Thread Andrey Chernov
On 31.05.2016 9:48, Bruce Evans wrote:
>> Perhaps you can find some ideas, answers and PRNG comparison in the
>> original paper:
>> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf
> 
> The ones with Mersenne primes and tweaked Mersenne primes in the reference
> (lanl?) given by pfg@ seem OK.

It should be again correctly implemented to not overflow 64bit (as any
other 64bit generator too).

Moreover, it have visible patterns in the low order bits. This one from
the same site is better
http://nuclear.llnl.gov/CNP/rng/rngman/node7.html
but still have some pattern too and 61-bit. Next one does not suffer
from the pattern at all
http://nuclear.llnl.gov/CNP/rng/rngman/node8.html
but is 2^64-2^10+1.

You can download SPRNG library implementing all of them here:
http://www.sprng.org/RNG/
For me it is overcomplicated.

>> clang -O uses single "idivl" calculating both quotient and reminder for
>> current code, but for ldiv(3) case call/storage/additional calcs
>> overhead will be added. ldiv(3) does not reduce anything, see
>> stdlib/ldiv.c
> 
> The extern functions give lots of overhead.  Sometimes they get replaced
> automatically by builtins, so it is unclear when the extern functions are
> actually used.  ldiv.c compiles to idivl for the division part but has
> lots of extras for the fixups.  The fixups do nothing except waste time
> on most hardware/cstd combinations.  IIRC, C99 requires direct division
> to have the same poor rounding rules as idiv(), so idiv() is not really
> needed in C99 and the fixups in it are negatively needed.  The builtins
> know what is needed so they don't do the fixups in the usual case that
> the hardware follows the poor rounding rules.

We don't have ldiv() builtin in any cae. For fixups, see full
explanation in the comment of stdlib/div.c

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


svn commit: r301025 - head/usr.bin/iscsictl

2016-05-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 31 07:49:59 2016
New Revision: 301025
URL: https://svnweb.freebsd.org/changeset/base/301025

Log:
  Make iscsictl(8) error messages more consistent.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.bin/iscsictl/iscsictl.c
==
--- head/usr.bin/iscsictl/iscsictl.cTue May 31 06:45:19 2016
(r301024)
+++ head/usr.bin/iscsictl/iscsictl.cTue May 31 07:49:59 2016
(r301025)
@@ -837,10 +837,6 @@ main(int argc, char **argv)
if (session_id == -1)
xo_errx(1, "-M requires -i");
 
-   if (discovery_host != NULL)
-   xo_errx(1, "-M and -d are mutually exclusive");
-   if (aflag != 0)
-   xo_errx(1, "-M and -a are mutually exclusive");
if (nickname != NULL) {
if (portal != NULL)
xo_errx(1, "-n and -p and mutually exclusive");
@@ -852,6 +848,10 @@ main(int argc, char **argv)
xo_errx(1, "-n and -s and mutually exclusive");
}
 
+   if (aflag != 0)
+   xo_errx(1, "-a cannot be used with -M");
+   if (discovery_host != NULL)
+   xo_errx(1, "-d cannot be used with -M");
if (rflag != 0)
xo_errx(1, "-r cannot be used with -M");
if (vflag != 0)
@@ -860,13 +860,6 @@ main(int argc, char **argv)
xo_errx(1, "-w cannot be used with -M");
 
} else if (Rflag != 0) {
-   if (user != NULL)
-   xo_errx(1, "-R and -u are mutually exclusive");
-   if (secret != NULL)
-   xo_errx(1, "-R and -s are mutually exclusive");
-   if (discovery_host != NULL)
-   xo_errx(1, "-R and -d are mutually exclusive");
-
if (aflag != 0) {
if (portal != NULL)
xo_errx(1, "-a and -p and mutually exclusive");
@@ -883,10 +876,16 @@ main(int argc, char **argv)
xo_errx(1, "must specify either -a, -n, -t, or -p");
}
 
+   if (discovery_host != NULL)
+   xo_errx(1, "-d cannot be used with -R");
if (session_id != -1)
xo_errx(1, "-i cannot be used with -R");
if (rflag != 0)
xo_errx(1, "-r cannot be used with -R");
+   if (user != NULL)
+   xo_errx(1, "-u cannot be used with -R");
+   if (secret != NULL)
+   xo_errx(1, "-s cannot be used with -R");
if (vflag != 0)
xo_errx(1, "-v cannot be used with -R");
if (timeout != -1)
@@ -895,23 +894,22 @@ main(int argc, char **argv)
} else {
assert(Lflag != 0);
 
+   if (discovery_host != NULL)
+   xo_errx(1, "-d cannot be used with -L");
+   if (session_id != -1)
+   xo_errx(1, "-i cannot be used with -L");
+   if (nickname != NULL)
+   xo_errx(1, "-n cannot be used with -L");
if (portal != NULL)
-   xo_errx(1, "-L and -p and mutually exclusive");
+   xo_errx(1, "-p cannot be used with -L");
+   if (rflag != 0)
+   xo_errx(1, "-r cannot be used with -L");
if (target != NULL)
-   xo_errx(1, "-L and -t and mutually exclusive");
+   xo_errx(1, "-t cannot be used with -L");
if (user != NULL)
-   xo_errx(1, "-L and -u and mutually exclusive");
+   xo_errx(1, "-u cannot be used with -L");
if (secret != NULL)
-   xo_errx(1, "-L and -s and mutually exclusive");
-   if (nickname != NULL)
-   xo_errx(1, "-L and -n and mutually exclusive");
-   if (discovery_host != NULL)
-   xo_errx(1, "-L and -d and mutually exclusive");
-   if (rflag != 0)
-   xo_errx(1, "-L and -r and mutually exclusive");
-
-   if (session_id != -1)
-   xo_errx(1, "-i cannot be used with -L");
+   xo_errx(1, "-s cannot be used with -L");
}
 
iscsi_fd = open(ISCSI_PATH, O_RDWR);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   >