]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge ^/head r309106 through r309117.
dim [Thu, 24 Nov 2016 21:14:22 +0000 (21:14 +0000)]
Merge ^/head r309106 through r309117.

7 years agoIn preparation for merging back to head, bump __FreeBSD_version,
dim [Thu, 24 Nov 2016 21:12:43 +0000 (21:12 +0000)]
In preparation for merging back to head, bump __FreeBSD_version,
FREEBSD_CC_VERSION and set date in ObsoleteFiles.inc.

7 years agoMerge ^/head r308870 through r309105.
dim [Thu, 24 Nov 2016 14:39:04 +0000 (14:39 +0000)]
Merge ^/head r308870 through r309105.

7 years agoSync the rtwn(4) entry with the manpage.
brueffer [Thu, 24 Nov 2016 10:35:49 +0000 (10:35 +0000)]
Sync the rtwn(4) entry with the manpage.

7 years agoMFV r308990: 7181 race between zfs_mount and zfs_ioc_rollback
avg [Thu, 24 Nov 2016 10:34:42 +0000 (10:34 +0000)]
MFV r308990: 7181 race between zfs_mount and zfs_ioc_rollback

illumos/illumos-gate@90f2c094b3822f4825f21cef2c2faf7d03b55139
https://github.com/illumos/illumos-gate/commit/90f2c094b3822f4825f21cef2c2faf7d03b55139

https://www.illumos.org/issues/7181
  zfsvfs_setup() is called in both zfs_mount and zfs_resume_fs paths.
  dmu_objset_set_user(zfsvfs->z_os, zfsvfs) is called early in zfsvfs_setup()
  before the setup is actually completed,
  thus an under-constructed zfsvfs becomes visible.
  Additionally, there is nothing to serialize the two call paths. As a result two
  threads can step on each other's toes.
  assertion failed: zilog->zl_clean_taskq == NULL, file:
  ../../common/fs/zfs/zil.c, line: 1772

  > $c
  vpanic()
  0xfffffffffbdf6928()
  zil_open+0x45(ffffff1bbc5dd000fffffffff7993880)
  zfsvfs_setup+0x84(ffffffb378d77000, 0)
  zfs_resume_fs+0x132(ffffffb378d77000ffffffb37ddcf000)
  zfs_ioc_rollback+0x96(ffffffb37ddcf000ffffff01dcdc4cd0ffffff01aa091000)
  zfsdev_ioctl+0x215(10a00000000, 5a19, 80465f8, 100003, ffffff01ab318368,
  ffffff0004b59e58)
  cdev_ioctl+0x39(10a00000000, 5a19, 80465f8, 100003, ffffff01ab318368,
  ffffff0004b59e58)
  spec_ioctl+0x60(ffffff0197737700, 5a19, 80465f8, 100003,
  ffffff01ab318368ffffff0004b59e58)
  fop_ioctl+0x55(ffffff0197737700, 5a19, 80465f8, 100003,
  ffffff01ab318368ffffff0004b59e58)
  ioctl+0x9b(7, 5a19, 80465f8)
  sys_syscall32+0x1f7()

  > ffffff1bbc5dd000::print objset_t os_zil
  os_zil = 0xffffff1c053cf7c0
  > 0xffffff1c053cf7c0::print zilog_t zl_clean_taskq

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>

MFC after: 2 weeks

7 years agoMFV r308988: 7199, 7200 dsl_dataset_rollback_sync may try to free
avg [Thu, 24 Nov 2016 10:29:21 +0000 (10:29 +0000)]
MFV r308988: 7199, 7200 dsl_dataset_rollback_sync may try to free
already free blocks

7199 dsl_dataset_rollback_sync may try to free already free blocks
7200 no blocks must be born in a txg after a snaphot is created

illumos/illumos-gate@bfaed0b91e57062c38bc16b4f89db3c8f0052a9b
https://github.com/illumos/illumos-gate/commit/bfaed0b91e57062c38bc16b4f89db3c8f0052a9b

https://www.illumos.org/issues/7199
  dsl_dataset_rollback_sync may try to free already freed blocks when it calls
  dsl_destroy_head_sync_impl to destroy a temporary clone.
  That happens if a snapshot to which we are rolling back and from which the
  clone is created has some ZIL records.

https://www.illumos.org/issues/7200
  No new blocks must be born in a dataset in the same TXG after a snapshot of the
  dataset is taken.
  Those blocks would have the same blk_birth as the dataset's ds_prev_snap_txg
  and as such they would be presumed to belong o the snapshot while in fact they
  do not.
  All the datasets must be clean before sync tasks are run, so the described
  scenario may happen only if one of the sync tasks dirties the dataset and
  another sync task takes its snapshot.
  Then, there will be another sync pass because of the dirty data and the new
  blocks will be born in the same TXG when the data is written out.
  It seems that almost all of the existing sync tasks modify only MOS and do not
  dirty any objsets.
  The only exception that I've been able to identify so far is the rollback which
  can modify an objset when it zeroes out the objset's ZIL.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>

MFC after: 3 weeks

7 years agoMFV r308987: 7180 potential race between zfs_suspend_fs+zfs_resume_fs
avg [Thu, 24 Nov 2016 10:21:22 +0000 (10:21 +0000)]
MFV r308987: 7180 potential race between zfs_suspend_fs+zfs_resume_fs
and zfs_ioc_rename

illumos/illumos-gate@690041b9caf801816f2d0bac90bc7cecefb73523
https://github.com/illumos/illumos-gate/commit/690041b9caf801816f2d0bac90bc7cecefb73523

https://www.illumos.org/issues/7180
  If a filesystem is not unmounted while the rename is being performed, then, for
  example, a concurrect zfs rollback may call zfs_suspend_fs followed by
  zfs_resume_fs on the same filesystem.
  The latter takes the filesystem's name as an argument. If the filesystem name
  changes as a result of the rename, then dmu_objset_hold(osname, zfsvfs, &os)
  call in zfs_resume_fs would fail resulting in a kernel panic.
  So far I have been able to reproduce this problem on FreeBSD where zfs rename
  has -u option that skips the unmounting before doing the renaming.
  But I think that in theory the same problem can occur on illumos as well,
  because the unmounting is done in userland before invoking the rename ioctl and
  there could be a race with, e.g., zfs mount.
  panic: solaris assert: dmu_objset_hold(osname, zfsvfs, &zfsvfs->z_os) == 0 (0x2
  == 0x0), file: /usr/devel/svn/head/sys/cddl/contrib/opensolaris/uts/common/fs/
  zfs/zfs_vfsops.c, line: 2210
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004df30710
  vpanic() at vpanic+0x182/frame 0xfffffe004df30790
  panic() at panic+0x43/frame 0xfffffe004df307f0
  assfail3() at assfail3+0x2c/frame 0xfffffe004df30810
  zfs_resume_fs() at zfs_resume_fs+0xb9/frame 0xfffffe004df30860
  zfs_ioc_rollback() at zfs_ioc_rollback+0x61/frame 0xfffffe004df308a0
  zfsdev_ioctl() at zfsdev_ioctl+0x65c/frame 0xfffffe004df30940
  devfs_ioctl_f() at devfs_ioctl_f+0x156/frame 0xfffffe004df309a0
  kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe004df30a00
  sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe004df30ae0
  amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe004df30bf0
  Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe004df30bf0

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

MFC after: 2 weeks

7 years agoMFV r308989: 6428 set canmount=off on unmounted filesystem tries to
avg [Thu, 24 Nov 2016 10:11:09 +0000 (10:11 +0000)]
MFV r308989: 6428 set canmount=off on unmounted filesystem tries to
unmount children

This is a cosmetic and bookkeeping change as the actual change is
already in FreeBSD.
See r297521, r304520, r308985.

7 years agoFix path for per-user nsmb.conf file
martymac [Thu, 24 Nov 2016 10:04:20 +0000 (10:04 +0000)]
Fix path for per-user nsmb.conf file

~/nsmb.conf, as erroneously introduced by r214387, is never used. Fix the man
page to specify that ~/.nsmbrc is used instead.

PR: 210652
Submitted by: ganael.laplanche@corp.ovh.com
Approved by: gjb (doceng@)

7 years agofirewire: initialize tag label to -1 in fw_xfer_alloc()
avg [Thu, 24 Nov 2016 09:47:56 +0000 (09:47 +0000)]
firewire: initialize tag label to -1 in fw_xfer_alloc()

Zero can be confused for a potentially valid value.
For example, if I load and unload sbp driver I get a lot of messages
like the following:

fw_tl_free: the xfer is not in the queue (tlabel=0, flag=0x0)
send: dst=0x00 tl=0x00 rt=0 tcode=0x0 pri=0x0 src=0x000
recv: dst=0x01 tl=0x21 rt=1 tcode=0x1 pri=0x0 src=0xffc0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe04464407e0
fw_tl_free() at fw_tl_free+0x18d/frame 0xfffffe0446440820
fw_xfer_unload() at fw_xfer_unload+0xca/frame 0xfffffe0446440840
fw_xferlist_remove() at fw_xferlist_remove+0x2f/frame 0xfffffe0446440870
sbp_detach() at sbp_detach+0x1e0/frame 0xfffffe04464408e0
device_detach() at device_detach+0x80/frame 0xfffffe0446440900
devclass_driver_deleted() at devclass_driver_deleted+0x6a/frame 0xfffffe0446440940
devclass_delete_driver() at devclass_delete_driver+0x7d/frame 0xfffffe0446440980
driver_module_handler() at driver_module_handler+0xff/frame 0xfffffe04464409d0
module_unload() at module_unload+0x32/frame 0xfffffe04464409f0
linker_file_unload() at linker_file_unload+0x24b/frame 0xfffffe0446440a40
kern_kldunload() at kern_kldunload+0xbc/frame 0xfffffe0446440a70
amd64_syscall() at amd64_syscall+0x314/frame 0xfffffe0446440bf0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0446440bf0

MFC after: 2 weeks

7 years agofwohci: report whether PhysicalUpperBound register is implemented
avg [Thu, 24 Nov 2016 09:43:42 +0000 (09:43 +0000)]
fwohci: report whether PhysicalUpperBound register is implemented

Please see section 5.15 of 1394 OHCI Specification.
If the register is not implemented, then the physical response unit is
limited to the first 4GB of the physical memory.
In that case the non-cooperative debugging over firewire (using /dev/fwmem)
can not be expected to work if a target has more RAM than that.
The method is described in gdb.4 and the Developer's Handbook.

It seems that most of the consumer hardware does not implement
PhysicalUpperBound register.

MFC after: 1 week

7 years agofurther fix zfs_lock() diagnostics
avg [Thu, 24 Nov 2016 09:00:51 +0000 (09:00 +0000)]
further fix zfs_lock() diagnostics

It was very wrong to look at the vnode and znode internals without
having locked the vnode first.

Reported by: pho
Tested by: pho
MFC after: 1 week
X-MFC with: r308887

7 years agohyperv/hn: Fix primary channel revocation
sephe [Thu, 24 Nov 2016 07:35:16 +0000 (07:35 +0000)]
hyperv/hn: Fix primary channel revocation

Since hypervisor will not drain the TX bufring, once the channels are
revoked:
- Setup vmbus orphan handler properly.
- Make sure that suspension will not wait the TX bufring draining
  forever.
- GC the pending TX descs on detach path, before freeing the busdma
  stuffs.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8559

7 years agoEnable the SPI1 and SPI2 node for Olimex A20 SOM EVB.
manu [Thu, 24 Nov 2016 06:43:11 +0000 (06:43 +0000)]
Enable the SPI1 and SPI2 node for Olimex A20 SOM EVB.
This was missed in r309079.

7 years agohyperv/vmbus: Fix the multi-channel revoking on vmbus side.
sephe [Thu, 24 Nov 2016 06:01:29 +0000 (06:01 +0000)]
hyperv/vmbus: Fix the multi-channel revoking on vmbus side.

- Reference count the sub-channel when channel offer message is
  processed, so that immediate rescind message on the same channel
  will not race sub-channel open on driver side.
- Drop the above reference when sub-channel is closed, this closely
  mimics the hypervisor's reaction when primary channel is closed
  on the VM side.  No drivers use sub-channel after primary channel
  is closed.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8546

7 years agoshare/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386
dexuan [Thu, 24 Nov 2016 05:52:28 +0000 (05:52 +0000)]
share/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386

We shouldn't install them on the architectures not supported by Hyper-V.

And, hv_ata_pci_disengage.4.gz should be removed from all architectures:
1) It should have only applied to Hyper-V;
2) For Hyper-V platforms (amd64 and i386), the related driver was removed by
r306426 | sephe | 2016-09-29 09:41:52 +0800 (Thu, 29 Sep 2016),
because now we have a better mechanism to disble the ata driver for hard
disks when the VM runs on Hyper-V.

Reviewed by: sephe, andrew, jhb
Approved by: sephe (mentor)
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8572

7 years agohyperv/vmbus: Fix the primary channel revoking on vmbus side.
sephe [Thu, 24 Nov 2016 05:18:45 +0000 (05:18 +0000)]
hyperv/vmbus: Fix the primary channel revoking on vmbus side.

Drivers can now use vmbus_chan_{is_revoked,set_orphan,unset_orphan}() and
vmbus_xact_ctx_orphan() to fix their attach/detach DEVMETHODs for revoked
primary channels.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8545

7 years agohyperv/vmbus: Implement orphan support for transaction API
sephe [Thu, 24 Nov 2016 04:58:13 +0000 (04:58 +0000)]
hyperv/vmbus: Implement orphan support for transaction API

It will be used to fix the primary channel revocation support.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8525

7 years agoEnable the SCL and SDA i2c line for DDC.
manu [Thu, 24 Nov 2016 01:24:26 +0000 (01:24 +0000)]
Enable the SCL and SDA i2c line for DDC.
This is an undocumented register that we need to set if we do not want to
rely on u-boot or other bootloader.

7 years agoAdd new device IDs
shurd [Thu, 24 Nov 2016 00:49:00 +0000 (00:49 +0000)]
Add new device IDs

Add device IDs for new hardware, sort the device IDs, add comment
regarding fragice NPAR/VF detection.

Approved by: davidch
MFC after: 6 days
Sponsored by: Broadcom Limited

7 years ago[rpi3] Move SOC_BRCM_BCM2837 from UP config to SMP one
gonzo [Thu, 24 Nov 2016 00:45:52 +0000 (00:45 +0000)]
[rpi3] Move SOC_BRCM_BCM2837 from UP config to SMP one

Now that BCM283x source are buildable with SMP option it cam be moved to
GENERIC SMP config. SMP itself does not work on RPi3 yet due to lack of
PSCI monitor which is work in progress at the moment

7 years ago[rpi3] Fix SMP build for FreeBSD/arm64
gonzo [Thu, 24 Nov 2016 00:39:17 +0000 (00:39 +0000)]
[rpi3] Fix SMP build for FreeBSD/arm64

7 years agoFix version string
shurd [Thu, 24 Nov 2016 00:15:32 +0000 (00:15 +0000)]
Fix version string

This is no longer on github, but in FreeBSD base.

Approved by: davidch
MFC after: 6 days
Sponsored by: Broadcom Limited

7 years agortwn.4: fix hostapd(8) man page section.
avos [Wed, 23 Nov 2016 22:57:47 +0000 (22:57 +0000)]
rtwn.4: fix hostapd(8) man page section.

7 years agoAdd tunable to disable destructive dtrace
gnn [Wed, 23 Nov 2016 22:50:20 +0000 (22:50 +0000)]
Add tunable to disable destructive dtrace

Submitted by: Joerg Pernfuss <code.jpe@gmail.com>
Reviewed by: rstone, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8624

7 years agoFix _mips_rtld_bind() to handle ELF filters.
jhb [Wed, 23 Nov 2016 20:21:53 +0000 (20:21 +0000)]
Fix _mips_rtld_bind() to handle ELF filters.

MIPS does not use the common _rtld_bind() to handle runtime binding.
Instead, it uses a private _mips_rtld_bind().  Update _mips_rtld_bind()
to include the changes made to _rtld_bind() in r216695 and r218476 to
support upgrading the read-locked rtld_bind_lock to a write lock when
an object with a filter is encountered.

While here, add a 'where' variable to track the location of the fixup
in the GOT to make the code flow more closely match _rtld_bind().

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D8625

7 years agocache: ensure that the number of bucket locks does not exceed hash size
mjg [Wed, 23 Nov 2016 19:50:12 +0000 (19:50 +0000)]
cache: ensure that the number of bucket locks does not exceed hash size

The size can be changed by side effect of modifying kern.maxvnodes.

Since numbucketlocks was not modified, setting a sufficiently low value
would give more locks than actual buckets, which would then lead to
corruption.

Force the number of buckets to be not smaller.

Note this should not matter for real world cases.

Reported and tested by: pho

7 years agoFix various mdoc issues reported by mandoc -Tlint.
brueffer [Wed, 23 Nov 2016 19:19:11 +0000 (19:19 +0000)]
Fix various mdoc issues reported by mandoc -Tlint.

7 years agoFix various mdoc issues reported by mandoc -Tlint.
brueffer [Wed, 23 Nov 2016 18:45:15 +0000 (18:45 +0000)]
Fix various mdoc issues reported by mandoc -Tlint.

7 years agoEnable UEXT related nodes for Olimex A20 SOM
manu [Wed, 23 Nov 2016 18:31:34 +0000 (18:31 +0000)]
Enable UEXT related nodes for Olimex A20 SOM

UEXT are Universal EXTension connector from Olimex. They embed i2c, spi
and uart pins along power in one connector and are found on most,
if not all, Olimex boards.
The Olimex A20 SOM EVB have two UEXT connector so enable the nodes found on
those two connectors.

Patch has been applied upstream, in the meantime add the nodes to our custom
DTS.

7 years agoTest that the emac device is enabled in probe function
manu [Wed, 23 Nov 2016 18:07:44 +0000 (18:07 +0000)]
Test that the emac device is enabled in probe function

MFC after: 3 days

7 years agoRelease laundered vnode pages to the head of the inactive queue.
markj [Wed, 23 Nov 2016 17:53:07 +0000 (17:53 +0000)]
Release laundered vnode pages to the head of the inactive queue.

The swap pager enqueues laundered pages near the head of the inactive queue
to avoid another trip through LRU before reclamation. This change adds
support for this behaviour to the vnode pager and makes use of it in UFS and
ext2fs. Some ioflag handling is consolidated into a common subroutine so
that this support can be easily extended to other filesystems which make use
of the buffer cache. No changes are needed for ZFS since its putpages
routine always undirties the pages before returning, and the laundry
thread requeues the pages appropriately in this case.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D8589

7 years agoFix comment typo.
brueffer [Wed, 23 Nov 2016 16:54:27 +0000 (16:54 +0000)]
Fix comment typo.

PR: 208484
Submitted by: madpilot
MFC after: 1 week

7 years ago- Add myself (misha) as a ports committer
misha [Wed, 23 Nov 2016 14:15:51 +0000 (14:15 +0000)]
- Add myself (misha) as a ports committer
- Update mentor/mentee relationships

Approved by: jpaetzel (mentor)

7 years agoSplit MALTA board config to big and little endian versions.
br [Wed, 23 Nov 2016 11:56:22 +0000 (11:56 +0000)]
Split MALTA board config to big and little endian versions.

This fixes compilation after r308807 ("Pass MACHINE_ARCH on
command line for MIPS kernels.")

Sponsored by: DARPA, AFRL

7 years agoIncrease pcpu size to 512 so it become both denominator
br [Wed, 23 Nov 2016 11:30:40 +0000 (11:30 +0000)]
Increase pcpu size to 512 so it become both denominator
of PAGE_SIZE and aligned to CACHE_LINE_SIZE.

This fixes CTASSERT.

Sponsored by: DARPA, AFRL

7 years agoRemove debugging code.
des [Wed, 23 Nov 2016 10:52:19 +0000 (10:52 +0000)]
Remove debugging code.

7 years agoMark cpu_find_cpu0_fdt as FDT only. It's only called when this is set, and
andrew [Wed, 23 Nov 2016 09:38:10 +0000 (09:38 +0000)]
Mark cpu_find_cpu0_fdt as FDT only. It's only called when this is set, and
the kernel is using FDT.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoRemove the unneeded ofw_cpu_reg function signature, it's not used in this
andrew [Wed, 23 Nov 2016 09:33:47 +0000 (09:33 +0000)]
Remove the unneeded ofw_cpu_reg function signature, it's not used in this
file.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agohyperv/vmbus: Merge free/active locks.
sephe [Wed, 23 Nov 2016 08:30:02 +0000 (08:30 +0000)]
hyperv/vmbus: Merge free/active locks.

These functions are only used by management stuffs, so there are
no needs to introduce extra complexity.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8524

7 years agoThis little BSD licensed library has been kicking around for years.
julian [Wed, 23 Nov 2016 07:57:52 +0000 (07:57 +0000)]
This little BSD licensed library has been kicking around for years.
It allows one to trivially convert an absolute path to a relative path
and the reverse. The test programs themselves are very useful in scripts
but the real use comes shortly with the -r and -a arguments to ln.
These are sometimes known as the --relative and --absolute flags and
can force a symlink to be relative when you only have an absolue path.
Another place these are sometimes used is to add -a and -r args to 'realpath'.
Incredibly useful in Makefiles.

I was going to just add the files in with 'ln' but a library makes more sense.
The test programs may come out in their own right some day for scripting.

released under a BSD 2-clause:
 * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved.
 * Copyright (c) 1999 Tama Communications Corporation. All rights reserved.

The test directry does not conform to any framework.
Not connected to build.
doc people may want to play with the manual pages.

Obtained from:  https://www.tamacom.com/pathconvert.html  Shigio Yamaguchi.
MFC after: 1 month
Relnotes:       yes
Sponsored by:   Panzura, Tama Communications Corporation

7 years agohyperv/vmbus: Set a mark on the revoked channel.
sephe [Wed, 23 Nov 2016 05:03:44 +0000 (05:03 +0000)]
hyperv/vmbus: Set a mark on the revoked channel.

This will be used to fix device detach DEVMETHOD for revoked primary
channel.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8522

7 years agoDo not attempt to disable/release clock if it had not been enabled.
manu [Wed, 23 Nov 2016 01:44:28 +0000 (01:44 +0000)]
Do not attempt to disable/release clock if it had not been enabled.
While here fix a style(9) issue.

MFC after: 1 week

7 years agoAdd missing break to switch statement
shurd [Wed, 23 Nov 2016 00:26:31 +0000 (00:26 +0000)]
Add missing break to switch statement

Minimal impact, would allow selection of LR media when KR is connected.

Reported by: Coverity
Approved by: davidch
MFC after: 7 days
Sponsored by: Broadcom Limited

7 years agoAllocate a struct ifreq rather than using a (wrong) computed size for
brooks [Tue, 22 Nov 2016 22:45:15 +0000 (22:45 +0000)]
Allocate a struct ifreq rather than using a (wrong) computed size for
the BIOCSETIF ioctl.

The kernel always copies an entire struct ifreq and IPv4 addresses will
always fit in an ifreq.

On systems with pointers larger than 64-bits, the computed size will be
less than the size of struct ifreq, potentially resulting in the kernel
attempting to copyin memory from outside the allocation.

Reviewed by: jhb
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8445

7 years agoopen(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW.
jilles [Tue, 22 Nov 2016 22:30:55 +0000 (22:30 +0000)]
open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW.

We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.

PR: 214633
Reviewed by: kib, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8586

7 years agoPass the correct size argument to ioctl(DIOCGSECTORSIZE)
phk [Tue, 22 Nov 2016 22:10:58 +0000 (22:10 +0000)]
Pass the correct size argument to ioctl(DIOCGSECTORSIZE)

7 years agoAdd the missing DEVMETHOD_ENDs to the arm64 nexus ACPI and FDT drivers.
andrew [Tue, 22 Nov 2016 19:31:32 +0000 (19:31 +0000)]
Add the missing DEVMETHOD_ENDs to the arm64 nexus ACPI and FDT drivers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoAdd myself (dab) as a src committer and vangyzen as my mentor.
dab [Tue, 22 Nov 2016 18:32:20 +0000 (18:32 +0000)]
Add myself (dab) as a src committer and vangyzen as my mentor.

Approved by: vangyzen (mentor)

7 years agoRevert r306186 ("Adjust the sopt_val pointer on bigendian systems").
br [Tue, 22 Nov 2016 18:31:43 +0000 (18:31 +0000)]
Revert r306186 ("Adjust the sopt_val pointer on bigendian systems").

This logic doesn't work with bigger sopt_valsize (e.g. when ipfw
passing 2048 bytes rule).

Reported by: adrian
Sponsored by: DARPA, AFRL

7 years agoRemove PG_CACHED-related fields from struct vmmeter, because they are no
alc [Tue, 22 Nov 2016 18:13:46 +0000 (18:13 +0000)]
Remove PG_CACHED-related fields from struct vmmeter, because they are no
longer used.  More precisely, they are always zero because the code that
decremented and incremented them no longer exists.

Bump __FreeBSD_version to mark this change.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8583

7 years agoOnly build acpi_timer.c on x86, it fails on arm64 as it attempts to access
andrew [Tue, 22 Nov 2016 18:13:04 +0000 (18:13 +0000)]
Only build acpi_timer.c on x86, it fails on arm64 as it attempts to access
an invalid address. It is also unneeded on arm64 as we use the ARM Generic
Timer driver.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years ago[net80211] high oops on the high seas, or "god damnit compilers, it's 2016 and you...
adrian [Tue, 22 Nov 2016 17:36:16 +0000 (17:36 +0000)]
[net80211] high oops on the high seas, or "god damnit compilers, it's 2016 and you're supposed to save me from this."

TODO:

* drink real coffee before committing in the morning, or there's a high
  risk of more obviously self-evident commits being turned into attempts
  at humour.

Reported by: cem, Coverity CID 1366219

7 years agoremove unnecessary vm includes from setproctitle
emaste [Tue, 22 Nov 2016 16:00:18 +0000 (16:00 +0000)]
remove unnecessary vm includes from setproctitle

vm headers were needed only for the PS_STRINGS fallback, which was
removed in r297888.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoRefactor fetch_connect() and fetch_bind() to improve readability and avoid
des [Tue, 22 Nov 2016 13:30:07 +0000 (13:30 +0000)]
Refactor fetch_connect() and fetch_bind() to improve readability and avoid
repeating the same DNS lookups.

MFC after: 3 weeks

7 years agoOn error, bread(9) zeroes buffer pointer, do not dereference it.
kib [Tue, 22 Nov 2016 13:24:57 +0000 (13:24 +0000)]
On error, bread(9) zeroes buffer pointer, do not dereference it.
See r294954 for the bread(9) change and r297401 for similar cd9660 fix.

Reported and tested by: Joshua Kinard <kumba@gentoo.org>
PR: 214705
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agorevert r304520, set canmount=on is not supposed to mount the filesystem
avg [Tue, 22 Nov 2016 11:44:30 +0000 (11:44 +0000)]
revert r304520, set canmount=on is not supposed to mount the filesystem

Not sure where I got the idea that it should.

See https://github.com/openzfs/openzfs/pull/218

Reported by: mahrens
Pointyhat to: avg
MFC after: 5 days

7 years agoUse buffer pager for NFS.
kib [Tue, 22 Nov 2016 10:58:24 +0000 (10:58 +0000)]
Use buffer pager for NFS.

The pager, due to its construction, implements clustering for the
page-ins.  In particular, buildworld load demonstrates reduction of
the READ RPCs from 39k down to 24k.  No change in real or CPU time was
observed.

Discussed with, and measured by: bde
No objections from: rmacklem
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMinor cleanup, remove unneeded XXX comments and unused re-define.
kib [Tue, 22 Nov 2016 10:24:59 +0000 (10:24 +0000)]
Minor cleanup, remove unneeded XXX comments and unused re-define.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRestore vnode pager statistic for buffer pagers.
kib [Tue, 22 Nov 2016 10:06:39 +0000 (10:06 +0000)]
Restore vnode pager statistic for buffer pagers.

Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8585

7 years agoSplit out the FDT parts of the pmu driver to make way for adding ACPI
andrew [Tue, 22 Nov 2016 09:39:31 +0000 (09:39 +0000)]
Split out the FDT parts of the pmu driver to make way for adding ACPI
support.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoReplay r304721 in contrib/ so the change won't get lost across import.
delphij [Tue, 22 Nov 2016 08:30:32 +0000 (08:30 +0000)]
Replay r304721 in contrib/ so the change won't get lost across import.

7 years agoMFV r308954:
delphij [Tue, 22 Nov 2016 08:27:49 +0000 (08:27 +0000)]
MFV r308954:

ntp 4.2.8p9.

Approved by: so

7 years ago[net80211] Only send out a probe request if we see an unknown IBSS node that matches...
adrian [Tue, 22 Nov 2016 06:53:52 +0000 (06:53 +0000)]
[net80211] Only send out a probe request if we see an unknown IBSS node that matches our SSID.

7 years agoVendor import of ntp-4.2.8p9.
delphij [Tue, 22 Nov 2016 06:28:26 +0000 (06:28 +0000)]
Vendor import of ntp-4.2.8p9.

7 years agoMerge ACPICA 20161117.
jkim [Tue, 22 Nov 2016 05:54:37 +0000 (05:54 +0000)]
Merge ACPICA 20161117.

7 years ago[net80211] store references to VHT and related IEs.
adrian [Tue, 22 Nov 2016 02:51:06 +0000 (02:51 +0000)]
[net80211] store references to VHT and related IEs.

This just stores pointers to the IE; it doesn't yet parse anything.

Note: it blows out the size of ieee80211_node, so this will require
ye olde kernel/modules recompile.

7 years ago[ath] obey the peer A-MPDU density and max-size.
adrian [Tue, 22 Nov 2016 02:42:00 +0000 (02:42 +0000)]
[ath] obey the peer A-MPDU density and max-size.

* Obey the peer A-MPDU density if it's larger than the currently configured
  one.

* Pay attention to the peer A-MPDU max-size and don't assume we can transmit
  a full A-MPDU (64k!) if the peer announces smaller values.

Relnotes: ath(4): Fix A-MPDU transmit; obey A-MPDU density and max size.

7 years ago[net80211] Remove extra \n.
adrian [Tue, 22 Nov 2016 02:02:13 +0000 (02:02 +0000)]
[net80211] Remove extra \n.

7 years ago[net80211] flesh out more IBSS 11n support
adrian [Tue, 22 Nov 2016 01:22:54 +0000 (01:22 +0000)]
[net80211] flesh out more IBSS 11n support

* Pepper comments around which describe what state(s) we're in when faking
  up 11n nodes.
* By default don't fake it up as 11n until we properly negotiate the 11n
  capabilities using probe request/response frames.
* Send a probe request with our HT information, as the 802.11-2012 spec
  suggests.
* Reassociate with the driver if we've been promoted.

This is done because although learning a peer via beacons can learn 11n
state, learning peers via hearing probe frames and broadcast frames
does not.  Thus, sometimes you end up with an 11n peer in the peer
table and sometimes you don't.

Note that the probe request/response exchange may not actually succeed.
Ideally we'd put the peer into some blocking state until we've exchanged
probe request/reponse to learn capabilities, or we timeout and just
stay non-11n.

This is more an experiment to get 11n IBSS nodes actually discovering
each other and be able to transmit.  There are other issues that creep
up which I'll attempt to address in future commits.

Tested:

* AR9380 NICs in 11n mode.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8365

7 years agoInitialize 'ticks' earlier in boot after 'hz' is set.
jhb [Tue, 22 Nov 2016 01:02:59 +0000 (01:02 +0000)]
Initialize 'ticks' earlier in boot after 'hz' is set.

This avoids the time-warp after kthreads have started running and the
required fixup to td_slptick and td_blktick in the EARLY_AP_STARTUP
case.  Now, 'ticks' is initialized before any kthreads are created or
any context switches are performed.

Tested by: gavin
MFC after: 2 weeks
Sponsored by: Netflix

7 years agoAudit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM,
rwatson [Tue, 22 Nov 2016 00:41:24 +0000 (00:41 +0000)]
Audit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM,
always audit the file-descriptor number and vnode information for all
fnctl(2) commands, not just locking-related ones.  This was likely an
oversight in the original adaptation of this code from XNU.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoSet the 'vital' flag on the runtime and jail packages.
gjb [Mon, 21 Nov 2016 23:29:28 +0000 (23:29 +0000)]
Set the 'vital' flag on the runtime and jail packages.

The default pkg(8) from pkg.freebsd.org requires libjail.so,
so mark the jail package as vital along with the runtime
package to avoid errors when libjail.so is removed.  This is
a no-op for systems with WITHOUT_JAIL in src.conf(5) and pkg(8)
built from the Ports Collection.

In order to make this work without marking packages such as
the jail-lib32, for example, the jail.ucl file needed to be
split out into separate files similarly to the runtime-*.ucl
files.

Glanced at by: brd
MFC after: 5 days
Sponsored by: The FreeBSD Foundation

7 years agor308942 broke kernel build.
hiren [Mon, 21 Nov 2016 21:07:43 +0000 (21:07 +0000)]
r308942 broke kernel build.
Add acpi_if.h to module makefile to fix it.

Submitted by: peter

7 years agoFor RTT calculations mid-session, we explicitly ignore ACKs with tsecr of 0 as
hiren [Mon, 21 Nov 2016 20:53:11 +0000 (20:53 +0000)]
For RTT calculations mid-session, we explicitly ignore ACKs with tsecr of 0 as
many borken middle-boxes tend to do that. But during 3whs, in syncache_expand(),
we don't do that which causes us to send a RST to such a client. Relax this
constraint by only using tsecr to compare against timestamp that we sent when it
is not 0. As a result, we'd now accept the final ACK of 3whs with tsecr of 0.

Reviewed by:     jtl, gnn
Sponsored by:     Limelight Networks
Differential Revision: https://reviews.freebsd.org/D8552

7 years ago[bytgpio] Add module for bytgpio(4)
gonzo [Mon, 21 Nov 2016 19:47:37 +0000 (19:47 +0000)]
[bytgpio] Add module for bytgpio(4)

MFC after: 3 days

7 years ago[bytgpio] Add bytgpio(4) man page with general description of the driver
gonzo [Mon, 21 Nov 2016 19:46:10 +0000 (19:46 +0000)]
[bytgpio] Add bytgpio(4) man page with general description of the driver

MFC after: 3 days

7 years ago[bytgpio] prepare bytgpio(4) for modularization
gonzo [Mon, 21 Nov 2016 19:43:01 +0000 (19:43 +0000)]
[bytgpio] prepare bytgpio(4) for modularization

- Add detach method
- module should depend on gpiobus, not gpio

7 years agoInclude the missing accommon.h from the ACPI uart code.
andrew [Mon, 21 Nov 2016 19:38:57 +0000 (19:38 +0000)]
Include the missing accommon.h from the ACPI uart code.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoAdd support to find the arm64 serial using the ACPI tables. This uses the
andrew [Mon, 21 Nov 2016 19:26:58 +0000 (19:26 +0000)]
Add support to find the arm64 serial using the ACPI tables. This uses the
Serial Port Console Redirection Table to find the device to use.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years ago[etherswitch] add ukswitch hint that is phy offset at mdio register
mizhka [Mon, 21 Nov 2016 19:26:22 +0000 (19:26 +0000)]
[etherswitch] add ukswitch hint that is phy offset at mdio register

This patch allows to specify PHY register offset for ukswitch. For instance,
switch MAICREL KS8995XA connected via MDIO to SoC, but PHY register starts
at 1. So hint for this case is: hint.ukswitch.0.phyoffset=1

No change/effect if hint is not set.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8584

7 years agoMark virtio_mmio as FDT only, it lacks an ACPI attachment.
andrew [Mon, 21 Nov 2016 19:14:46 +0000 (19:14 +0000)]
Mark virtio_mmio as FDT only, it lacks an ACPI attachment.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMark uart_dev_snps.c as FDT only, it doesn't have and ACPI bindings.
andrew [Mon, 21 Nov 2016 19:13:33 +0000 (19:13 +0000)]
Mark uart_dev_snps.c as FDT only, it doesn't have and ACPI bindings.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMark extres as FDT only. Much of this assumes FDT and fails to build
andrew [Mon, 21 Nov 2016 19:03:51 +0000 (19:03 +0000)]
Mark extres as FDT only. Much of this assumes FDT and fails to build
without it.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMark the Allwinner drivers as FDT only. These are mobile and embedded parts
andrew [Mon, 21 Nov 2016 18:50:45 +0000 (18:50 +0000)]
Mark the Allwinner drivers as FDT only. These are mobile and embedded parts
so are unlikely to use ACPI.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoTo allow for an ACPI attachment to the generic PCIe driver split off the
andrew [Mon, 21 Nov 2016 18:24:05 +0000 (18:24 +0000)]
To allow for an ACPI attachment to the generic PCIe driver split off the
FDT attachment to a new file. A separate ACPI attachment will then be added
to allow arm64 servers with ACPI to use it over FDT.

This should also help with merging this with the ofwpci driver, with
further work needed to remove restrictions this driver places on resource
allocation.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7319

7 years agoAdd PDMA controller registers.
br [Mon, 21 Nov 2016 15:42:54 +0000 (15:42 +0000)]
Add PDMA controller registers.

Obtained from: X1000 IoT Application Processor Programming Manual
Sponsored by: DARPA, AFRL

7 years agoMove FDT option to the main SoC file and mark boards config
br [Mon, 21 Nov 2016 15:35:56 +0000 (15:35 +0000)]
Move FDT option to the main SoC file and mark boards config
as NO_UNIVERSE.

Pointed out by: andrew
Sponsored by: DARPA, AFRL

7 years agoAdd Intel Atom Cherryview SOC HSUART support
sbruno [Mon, 21 Nov 2016 14:43:31 +0000 (14:43 +0000)]
Add Intel Atom Cherryview SOC HSUART support

PR: 207910
Submitted by: johannes@brilliantservice.co.jp
MFC after: 1 week

7 years agoAdjust r308689 to make rtld compilable with either in-tree or
kib [Mon, 21 Nov 2016 14:13:57 +0000 (14:13 +0000)]
Adjust r308689 to make rtld compilable with either in-tree or
(hopefully) stock gcc 4.2.1 on i386 and other arches.

In particular:
- Do not use %ebx in the asm constraints on i386, since rtld is
  compiled with -fPIC and gcc cannot handle GOT-base register reload
  (clang and newer gcc can).
- Avoid direct use of [static N] construct in the function
  declaration/definion.  In-tree gcc was patched to support this, but
  stock 4.2.1 cannot handle the feature.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDisable superpages reservations as we don't have implemented them yet.
br [Mon, 21 Nov 2016 12:00:31 +0000 (12:00 +0000)]
Disable superpages reservations as we don't have implemented them yet.

Requested by: Alan Cox <alc@rice.edu>
Sponsored by: DARPA, AFRL

7 years agoAdd an arm64 specific uart cpu driver. As arm64 may use ACPI to find the
andrew [Mon, 21 Nov 2016 11:27:14 +0000 (11:27 +0000)]
Add an arm64 specific uart cpu driver. As arm64 may use ACPI to find the
uart we need to handle both it and FDT, and as such we need to have an
architecture specific driver.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7796

7 years agoAdd accelerated AES with using the ARMv8 crypto instructions. This is based
andrew [Mon, 21 Nov 2016 11:18:00 +0000 (11:18 +0000)]
Add accelerated AES with using the ARMv8 crypto instructions. This is based
on the AES-NI code, and modified as needed for use on ARMv8. When loaded
the driver will check the appropriate field in the id_aa64isar0_el1
register to see if AES is supported, and if so the probe function will
signal the driver should attach.

With this I have seen up to 2000Mb/s from the cryptotest test with a single
thread on a ThunderX Pass 2.0.

Reviewed by: imp
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8297

7 years agoUpdate struct r12a_rom.
kevlo [Mon, 21 Nov 2016 09:23:42 +0000 (09:23 +0000)]
Update struct r12a_rom.

Reviewed by: avos

7 years agohyperv/hn: Don't abuse hn_{tx,rx}_ring_inuse.
sephe [Mon, 21 Nov 2016 05:54:31 +0000 (05:54 +0000)]
hyperv/hn: Don't abuse hn_{tx,rx}_ring_inuse.

Just in case, the # of TX/RX rings is changed upon synthetic parts
re-attach.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8520

7 years agohyperv/hn: Allow enabling IPv6 TX checksum offloading and IPv6 TSO.
sephe [Mon, 21 Nov 2016 05:41:08 +0000 (05:41 +0000)]
hyperv/hn: Allow enabling IPv6 TX checksum offloading and IPv6 TSO.

They are still disabled by default.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8490

7 years agohyperv/hn: Fix WITNESS warnings
sephe [Mon, 21 Nov 2016 05:21:15 +0000 (05:21 +0000)]
hyperv/hn: Fix WITNESS warnings

And re-enable SIOCADDMULTI/SIOCDELMULTI, after WITNESS warning is fixed.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8489

7 years agohyperv/vmbus: Support transction result busy-wait.
sephe [Mon, 21 Nov 2016 05:09:43 +0000 (05:09 +0000)]
hyperv/vmbus: Support transction result busy-wait.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8488

7 years agohyperv/hn: Implement RNDIS multi-packet message support.
sephe [Mon, 21 Nov 2016 05:00:51 +0000 (05:00 +0000)]
hyperv/hn: Implement RNDIS multi-packet message support.

Currently, it is only applied to packet sent through chimney sending
buffers.  Not enabled by default yet.

This one gives 20%~30% performance boost for non-TSO usage in both
bit/packet rate tests and nginx performance test.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8560

7 years agoFix error reporting from wcstof()
vangyzen [Sun, 20 Nov 2016 20:13:22 +0000 (20:13 +0000)]
Fix error reporting from wcstof()

When wcstof() skipped initial space and then parsing failed, it set
endptr to the first non-space character.  Fix it to correctly report
failure by setting endptr to the beginning of the input string.
The fix is from theraven@, who fixed this bug in wcstod() and
wcstold() in r227753.

While I'm here:

Move assignments out of declarations in wcstod() and wcstold().
This is against my personal preference, but it is our agreed style(9).

Set endptr correctly on malloc() failure in all three functions.

Remove an incorrect comment:  This is pointer arithmetic,
so the code was not actually making that assumption.

wcstold() advanced the wcp pointer beyond leading whitespace
and then reset it back to the beginning of the string.
Do not reset it.  This seems to have no functional effect,
since strtold_l() also skips leading whitespace.  I'm making
the change to keep this function consistent with wcstof() and
wcstod(), and because the C11 spec prescribes the use of iswspace()
to skip leading space.

Reported by: libc++ unit test for std::stof(std::wstring)
MFC after: 8 days
Sponsored by: Dell EMC