Commit graph

217914 commits

Author SHA1 Message Date
David Bright 4fb8e361ec Add myself (dab) as a src committer and vangyzen as my mentor.
Approved by:	vangyzen (mentor)
2016-11-22 18:32:20 +00:00
Ruslan Bukin dd7d4f199e 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
2016-11-22 18:31:43 +00:00
Alan Cox bba39b9ae3 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
2016-11-22 18:13:46 +00:00
Andrew Turner f63f5057e9 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
2016-11-22 18:13:04 +00:00
Adrian Chadd 5899368a8a [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
2016-11-22 17:36:16 +00:00
Ed Maste 134ede2dd2 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
2016-11-22 16:00:18 +00:00
Dag-Erling Smørgrav 792ef1ae7b Refactor fetch_connect() and fetch_bind() to improve readability and avoid
repeating the same DNS lookups.

MFC after:	3 weeks
2016-11-22 13:30:07 +00:00
Konstantin Belousov 1fa81dab7d 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
2016-11-22 13:24:57 +00:00
Andriy Gapon aee4554721 7181 race between zfs_mount and zfs_ioc_rollback
illumos/illumos-gate@90f2c094b3
90f2c094b3

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(ffffff1bbc5dd000, fffffffff7993880)
  zfsvfs_setup+0x84(ffffffb378d77000, 0)
  zfs_resume_fs+0x132(ffffffb378d77000, ffffffb37ddcf000)
  zfs_ioc_rollback+0x96(ffffffb37ddcf000, ffffff01dcdc4cd0, ffffff01aa091000)
  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,
  ffffff01ab318368, ffffff0004b59e58)
  fop_ioctl+0x55(ffffff0197737700, 5a19, 80465f8, 100003,
  ffffff01ab318368, ffffff0004b59e58)
  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>
2016-11-22 11:51:55 +00:00
Andriy Gapon 5041986419 6428 set canmount=off on unmounted filesystem tries to unmount children
illumos/illumos-gate@c079fa4d20
c079fa4d20

https://www.illumos.org/issues/6428
  Scenario:
  $ zfs create rpool/p
  $ zfs set canmount=noauto rpool/p
  $ zfs umount rpool/p
  $ zfs create rpool/p/c
  $ zfs get -r mounted,canmount rpool/p
  NAME             PROPERTY  VALUE     SOURCE
  rpool/p    mounted   no        -
  rpool/p    canmount  noauto    local
  rpool/p/c  mounted   yes       -
  rpool/p/c  canmount  on        default
  In another shell ensure that rpool/p/c is in use, for example:
  $ cd /rpool/p/c
  Then:
  $ zfs set canmount=off rpool/p
  cannot unmount '/rpool/p/c': Device busy
  But there is no reason to try to unmount rpool/p/c in this scenario.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>
2016-11-22 11:50:52 +00:00
Andriy Gapon 7f74889d89 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@bfaed0b91e
bfaed0b91e

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>
2016-11-22 11:49:55 +00:00
Andriy Gapon d414bfe23b 7180 potential race between zfs_suspend_fs+zfs_resume_fs and zfs_ioc_rename
illumos/illumos-gate@690041b9ca
690041b9ca

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>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>
2016-11-22 11:47:27 +00:00
Andriy Gapon 94ce2dcaab 6412 zfs receive: -u can be ignored sometimes
illumos/illumos-gate@9185393f29
9185393f29

https://www.illumos.org/issues/6412
  It seems that zfs receive -F -u would mount a received filesystem after
  receiving a full stream if a destination filesystem already existed (and, thus,
  got destroyed and re-created) and was mounted.
  How to reproduce:
  $ zfs create rpool/sandbox
  $ zfs create rpool/sandbox/from
  $ zfs create rpool/sandbox/to
  $ zfs snap rpool/sandbox/from@snap
  $ zfs send rpool/sandbox/from@snap | zfs recv -v -F -u rpool/sandbox/to
  receiving full stream of rpool/sandbox/from@snap into rpool/sandbox/to@snap
  received 41.7KB stream in 1 seconds (41.7KB/sec)
  $ zfs get mounted rpool/sandbox/to
  NAME                  PROPERTY  VALUE    SOURCE
  rpool/tmp/sandbox/to  mounted   yes      -
  This behavior can be problematic if the mountpoint property changes either
  because it had a non-inherited value or the stream contains properties because
  it has been generated with either -R or -p.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>
2016-11-22 11:46:22 +00:00
Andriy Gapon 9170c18bb9 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
2016-11-22 11:44:30 +00:00
Konstantin Belousov 753a007f0d 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
2016-11-22 10:58:24 +00:00
Konstantin Belousov fc2c3afee0 Minor cleanup, remove unneeded XXX comments and unused re-define.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-11-22 10:24:59 +00:00
Konstantin Belousov eb962424ba 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
2016-11-22 10:06:39 +00:00
Andrew Turner f1568d1e03 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
2016-11-22 09:39:31 +00:00
Xin LI 8624bb0572 Replay r304721 in contrib/ so the change won't get lost across import. 2016-11-22 08:30:32 +00:00
Xin LI f391d6bc1d MFV r308954:
ntp 4.2.8p9.

Approved by:	so
2016-11-22 08:27:49 +00:00
Adrian Chadd e65d4e8abc [net80211] Only send out a probe request if we see an unknown IBSS node that matches our SSID. 2016-11-22 06:53:52 +00:00
Xin LI 01b922f62c Vendor import of ntp-4.2.8p9. 2016-11-22 06:28:26 +00:00
Jung-uk Kim 1cc50d6b6a Merge ACPICA 20161117. 2016-11-22 05:54:37 +00:00
Adrian Chadd 74a54be9a4 [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.
2016-11-22 02:51:06 +00:00
Adrian Chadd c969f82d85 [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.
2016-11-22 02:42:00 +00:00
Adrian Chadd 3d12d1f14f [net80211] Remove extra \n. 2016-11-22 02:02:13 +00:00
Adrian Chadd 869897d2e5 [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
2016-11-22 01:22:54 +00:00
John Baldwin 5d8cce1764 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
2016-11-22 01:02:59 +00:00
Robert Watson 1279fdafce 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
2016-11-22 00:41:24 +00:00
Glen Barber 9fc3c7f733 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
2016-11-21 23:29:28 +00:00
Hiren Panchasara 005cecb30a r308942 broke kernel build.
Add acpi_if.h to module makefile to fix it.

Submitted by:	peter
2016-11-21 21:07:43 +00:00
Hiren Panchasara 2806b2933b 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
2016-11-21 20:53:11 +00:00
Oleksandr Tymoshenko 5370c80e0e [bytgpio] Add module for bytgpio(4)
MFC after:	3 days
2016-11-21 19:47:37 +00:00
Oleksandr Tymoshenko 119bea9ff5 [bytgpio] Add bytgpio(4) man page with general description of the driver
MFC after:	3 days
2016-11-21 19:46:10 +00:00
Oleksandr Tymoshenko fd98051117 [bytgpio] prepare bytgpio(4) for modularization
- Add detach method
- module should depend on gpiobus, not gpio
2016-11-21 19:43:01 +00:00
Andrew Turner ef022bb1de Include the missing accommon.h from the ACPI uart code.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-11-21 19:38:57 +00:00
Andrew Turner eba1a249df 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
2016-11-21 19:26:58 +00:00
Michael Zhilin b15317c431 [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
2016-11-21 19:26:22 +00:00
Andrew Turner e45c936f46 Mark virtio_mmio as FDT only, it lacks an ACPI attachment.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-11-21 19:14:46 +00:00
Andrew Turner da8695d408 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
2016-11-21 19:13:33 +00:00
Andrew Turner 824f05d68f 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
2016-11-21 19:03:51 +00:00
Andrew Turner 32e7ac1e5e 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
2016-11-21 18:50:45 +00:00
Andrew Turner f94f8e62ab 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
2016-11-21 18:24:05 +00:00
Ruslan Bukin fbe94797ea Add PDMA controller registers.
Obtained from:	X1000 IoT Application Processor Programming Manual
Sponsored by:	DARPA, AFRL
2016-11-21 15:42:54 +00:00
Ruslan Bukin 38079cf572 Move FDT option to the main SoC file and mark boards config
as NO_UNIVERSE.

Pointed out by:	andrew
Sponsored by:	DARPA, AFRL
2016-11-21 15:35:56 +00:00
Sean Bruno cb3c7e7f93 Add Intel Atom Cherryview SOC HSUART support
PR:	207910
Submitted by:	johannes@brilliantservice.co.jp
MFC after:	1 week
2016-11-21 14:43:31 +00:00
Konstantin Belousov d27078f990 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
2016-11-21 14:13:57 +00:00
Ruslan Bukin 250b1bf3c5 Disable superpages reservations as we don't have implemented them yet.
Requested by:	Alan Cox <alc@rice.edu>
Sponsored by:	DARPA, AFRL
2016-11-21 12:00:31 +00:00
Andrew Turner 0812ab3141 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
2016-11-21 11:27:14 +00:00
Andrew Turner d6699d292b 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
2016-11-21 11:18:00 +00:00