]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFor now, undo the WARNS=3 setting for the clang and llvm tools. More
Dimitry Andric [Fri, 2 Sep 2016 19:26:39 +0000 (19:26 +0000)]
For now, undo the WARNS=3 setting for the clang and llvm tools.  More
work needs to be done first to get everything compiling without warnings.

8 years agoUpdate clang to the final 3.9.0 release. There were no more code changes
Dimitry Andric [Fri, 2 Sep 2016 19:20:27 +0000 (19:20 +0000)]
Update clang to the final 3.9.0 release. There were no more code changes
since the last release candidate.

8 years agoVendor import of clang 3.9.0 release r280324:
Dimitry Andric [Fri, 2 Sep 2016 19:05:13 +0000 (19:05 +0000)]
Vendor import of clang 3.9.0 release r280324:
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_390/final@280324

8 years agoDIRDEPS_BUILD: Don't conditionally include src.opts.mk.
Bryan Drewery [Thu, 1 Sep 2016 22:58:53 +0000 (22:58 +0000)]
DIRDEPS_BUILD: Don't conditionally include src.opts.mk.

This was preventing having MK_LLD a value set in 'make bootstrap-tools' since
MK_LLDB was forced to no in that context.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Connect lld.
Bryan Drewery [Thu, 1 Sep 2016 21:03:27 +0000 (21:03 +0000)]
DIRDEPS_BUILD: Connect lld.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse a proper comment.
Bryan Drewery [Thu, 1 Sep 2016 21:02:02 +0000 (21:02 +0000)]
Use a proper comment.

Submitted by: emaste

8 years agoDIRDEPS_BUILD: Connect the new clang build.
Bryan Drewery [Thu, 1 Sep 2016 20:38:59 +0000 (20:38 +0000)]
DIRDEPS_BUILD: Connect the new clang build.

Sponsored by: EMC / Isilon Storage Division

8 years agoBuild lld by default on amd64 and arm64
Ed Maste [Thu, 1 Sep 2016 20:36:10 +0000 (20:36 +0000)]
Build lld by default on amd64 and arm64

8 years agoDIRDEPS_BUILD: Clang libraries now have nested directories/objects in OBJDIR.
Bryan Drewery [Thu, 1 Sep 2016 20:23:49 +0000 (20:23 +0000)]
DIRDEPS_BUILD: Clang libraries now have nested directories/objects in OBJDIR.

These nested directories are not build targets.  They just map back to
lib/clang/lib{clang,llvm,llvmminimal,lldb}.  Avoid adding these nested
directories into Makefile.depend.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Use libllvmminimal for tblgen for the host build.
Bryan Drewery [Thu, 1 Sep 2016 18:35:37 +0000 (18:35 +0000)]
DIRDEPS_BUILD: Use libllvmminimal for tblgen for the host build.

The host tools are only ever built for the same reason as TOOLS_PREFIX, for running
during the build.

Sponsored by: EMC / Isilon Storage Division

8 years agoMerge ^/head r305087 through r305219.
Dimitry Andric [Thu, 1 Sep 2016 18:16:45 +0000 (18:16 +0000)]
Merge ^/head r305087 through r305219.

8 years agoIf error happens, don't overwrite original errno comes from __mbrtowc()
Andrey A. Chernov [Thu, 1 Sep 2016 18:12:53 +0000 (18:12 +0000)]
If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

MFC after:      3 days

8 years agoPull in r277331 from upstream llvm trunk (by Diana Picus):
Dimitry Andric [Thu, 1 Sep 2016 18:11:44 +0000 (18:11 +0000)]
Pull in r277331 from upstream llvm trunk (by Diana Picus):

  [AArch64] Return the correct size for TLSDESC_CALLSEQ

  The branch relaxation pass is computing the wrong offsets because it assumes
  TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction
  sequence taking up 16 bytes. This can become a problem in huge files with lots
  of TLS accesses, as it may slowly move branch targets out of the range computed
  by the branch relaxation pass.

  Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234

  Differential Revision: https://reviews.llvm.org/D22870

This fixes "error in backend: fixup value out of range" when compiling
the misc/talkfilters port for AArch64.

Reported by: sbruno
PR: 201762
MFC after: 3 days

8 years agoFAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.
Bryan Drewery [Thu, 1 Sep 2016 17:36:52 +0000 (17:36 +0000)]
FAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.

- For FAST_DEPEND, properly apply the -M flags when compiling by
  enduring that the condition also has the s,/,_,g filter applied to it
  first.
- For FAST_DEPEND, properly read from the filtered filename.
- For META_MODE, it needs to read from a full-pathed and s,/,_,g replaced
  filename based on bmake's meta_name() function which names the .meta
  file for SRCS with '/' in them.

This support has not been extended to the kernel build yet but may be in the
future.

MFC after: 2 weeks
Reported by: dim
Sponsored by: EMC / Isilon Storage Division

8 years agoOpenBSD 6.0 added.
Maxim Konovalov [Thu, 1 Sep 2016 17:05:54 +0000 (17:05 +0000)]
OpenBSD 6.0 added.

8 years agoAs an optimization to the machine-independent layer, change the machine-
Alan Cox [Thu, 1 Sep 2016 15:57:44 +0000 (15:57 +0000)]
As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.

Reviewed by: kib, markj
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7722

8 years ago- Invert calloc(3) argument order.
Marcelo Araujo [Thu, 1 Sep 2016 15:23:33 +0000 (15:23 +0000)]
- Invert calloc(3) argument order.

MFC after: 4 weeks

8 years agoMFV r302662: 6447 handful of nvpair cleanups
Alexander Motin [Thu, 1 Sep 2016 15:17:39 +0000 (15:17 +0000)]
MFV r302662: 6447 handful of nvpair cleanups

illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773
https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc
e948773

https://www.illumos.org/issues/6447
  I got a patch from someone who uses nvpair code outside of illumos. It fixes a
  couple of gcc warnings/bugs for him.
     1. silence uninitialized use warnings
     2. add parentheses around assignment used as truth value
     3. fix printf format specifier (ll is for integers only)
     4. strstr, strspn, strcspn, and strcmp are declared in string.h, not
        strings.h.
     5. avoid scanning integer into boolean variable

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Steve Dougherty <sdougherty@barracuda.com>

8 years agoMFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg()
Alexander Motin [Thu, 1 Sep 2016 15:10:40 +0000 (15:10 +0000)]
MFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg()

illumos/illumos-gate@10e67aa0db0823d5464aafdd681f3c966155c68e
https://github.com/illumos/illumos-gate/commit/10e67aa0db0823d5464aafdd681f3c966
155c68e

https://www.illumos.org/issues/7082
  upstream
  DLPX-40542 bptree_iterate() passes wrong args to zfs_dbgmsg()

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r302660: 6314 buffer overflow in dsl_dataset_name
Alexander Motin [Thu, 1 Sep 2016 15:08:27 +0000 (15:08 +0000)]
MFV r302660: 6314 buffer overflow in dsl_dataset_name

illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660
https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6
92b6660

https://www.illumos.org/issues/6314
  Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but
  dsl_dataset_name copies the datasets' name PLUS the snapshot name to it,
  resulting in a max of 2 * ZFS_MAXNAMELEN + '@'.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoo Separate rtc and timecmp registers: they are different across
Ruslan Bukin [Thu, 1 Sep 2016 14:58:11 +0000 (14:58 +0000)]
o Separate rtc and timecmp registers: they are different across
  RISC-V cpu implementations.
o Update RocketChip device tree source (DTS).

We now support latest verison of RocketChip synthesized on
Xilinx FPGA (Zedboard).

RocketChip is an implementation of RISC-V processor written on
Chisel hardware construction language.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoMFV r302659: 6931 lib/libzfs: cleanup gcc warnings
Alexander Motin [Thu, 1 Sep 2016 14:57:06 +0000 (14:57 +0000)]
MFV r302659: 6931 lib/libzfs: cleanup gcc warnings

illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be
https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be

https://www.illumos.org/issues/6931
  need cleanup:
  CERRWARN += -_gcc=-Wno-switch
  CERRWARN += -_gcc=-Wno-parentheses
  CERRWARN += -_gcc=-Wno-unused-function

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Igor Kozhukhov <ikozhukhov@gmail.com>

8 years agoMFV r302658: 6872 zfs libraries should not allow uninitialized variables
Alexander Motin [Thu, 1 Sep 2016 14:53:56 +0000 (14:53 +0000)]
MFV r302658: 6872 zfs libraries should not allow uninitialized variables

illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e
https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41
2ac1f5e

https://www.illumos.org/issues/6872
  We compile the zfs libraries with -Wno-uninitialized. We should remove
  this. Change makefiles, fix new warnings, fix pbchk errors.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

8 years agoMFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"
Alexander Motin [Thu, 1 Sep 2016 14:52:05 +0000 (14:52 +0000)]
MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"

illumos/illumos-gate@8808ac5dae118369991f158b6ab736cb2691ecde
https://github.com/illumos/illumos-gate/commit/8808ac5dae118369991f158b6ab736cb2
691ecde

https://www.illumos.org/issues/4521
  zfstest is trying to execute evil "zfs unmount -a", which fails (fortunately,
  as it would otherwise leave me with my ~ missing):
  03:44:11.86 cannot unmount '/export/home/yuri': Device busy cannot unmount '/
  export/home': Device busy
  03:44:11.86 ERROR: /usr/sbin/zfs unmount -a exited 1
  This affects, at least, zfs_mount_009_neg and zfs_mount_all_001_pos, both
  failing on that step. The pool containing the /export/home hierarchy is
  included in KEEP variable, but it doesn't seem to affect anything here.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

8 years agoMFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist
Alexander Motin [Thu, 1 Sep 2016 14:47:43 +0000 (14:47 +0000)]
MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist

illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168
https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812
f7e5168

https://www.illumos.org/issues/6873
  lzc_destroy_snaps() returns an nvlist in errlist.
  zfs_destroy_snaps_nvl() should nvlist_free() it before returning.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Chris Williamson <chris.williamson@delphix.com>

8 years agoMFV r302654:
Alexander Motin [Thu, 1 Sep 2016 14:46:33 +0000 (14:46 +0000)]
MFV r302654:
6879 incorrect endianness swap for drr_spill.drr_length in libzfs_sendrecv.c

illumos/illumos-gate@20fea7a47472aceb64d3ed48cc2a3ea268bc4795
https://github.com/illumos/illumos-gate/commit/20fea7a47472aceb64d3ed48cc2a3ea26
8bc4795

https://www.illumos.org/issues/6879
  In libzfs_sendrecv, there's a typo:
  case DRR_SPILL:
              if (byteswap) {
                  drr->drr_u.drr_write.drr_length =
                      BSWAP_64(drr->drr_u.drr_spill.drr_length);
              }
  Instead of drr_write.drr_length, we should be assigning the result of the
  byteswap to drr_spill.drr_length.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

8 years agoMFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot
Alexander Motin [Thu, 1 Sep 2016 14:45:11 +0000 (14:45 +0000)]
MFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot

illumos/illumos-gate@4a20c933b148de8a1c1d3538391c64284e636653
https://github.com/illumos/illumos-gate/commit/4a20c933b148de8a1c1d3538391c64284
e636653

https://www.illumos.org/issues/6111
  If you create a zfs child folder, zfs send returns an error when a recursive
  incremental send is done between two snapshots made prior to the folder
  creation.
  The problem can be reproduced with the following steps.
  root@zfs:/# zfs create pool/test
  root@zfs:/# zfs snapshot pool/test@snap1
  root@zfs:/# zfs snapshot pool/test@snap2
  root@zfs:/# zfs create pool/test/child
  root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null
  WARNING: could not send pool/test/child@snap2: does not exist
  WARNING: could not send pool/test/child@snap2: does not exist
  root@zfs:/# echo $?
  1
  root@zfs:/# zfs snapshot -r pool/test@snap3
  root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null
  root@zfs:/# echo $?
  0
  root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null
  root@zfs:/# echo $?
  0
  Since pool/test/child was created after snap2, zfs send should not expect snap2
  to be in pool/test/child when doing a recursive send. It should examine the
  compare the creation time of the snapshot and each child folder to decide if
  the folder will be sent. The next incremental send between snap2 and snap3
  would properly create the child folder and snap3 which first appears in the
  child folder.
  The problem is identical if '-i' is used instead of '-I'.

Reviewed by: Alex Aizman alex.aizman@nexenta.com
Reviewed by: Alek Pinchuk alek.pinchuk@nexenta.com
Reviewed by: Roman Strashkin roman.strashkin@nexenta.com
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Alex Deiter <alex.deiter@nexenta.com>

8 years agoMFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space
Alexander Motin [Thu, 1 Sep 2016 14:38:25 +0000 (14:38 +0000)]
MFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space

illumos/illumos-gate@0c779ad424a92a84d1e07d47cab7f8009189202b
https://github.com/illumos/illumos-gate/commit/0c779ad424a92a84d1e07d47cab7f8009
189202b

https://www.illumos.org/issues/7054
  upstream:
  ee0003de7d3e598499be7ac3fe6b61efcc47cb7f
  DLPX-40399 dmu_tx_hold_t should use refcount_t to track space

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years agoMFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set
Alexander Motin [Thu, 1 Sep 2016 14:24:54 +0000 (14:24 +0000)]
MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set

Note that the bulk of the upstream change is not applicable to FreeBSD
and the affected files are not even in the vendor area.

illumos/illumos-gate@45b1747515a17db45e8971501ee84a26bdff37b2
https://github.com/illumos/illumos-gate/commit/45b1747515a17db45e8971501ee84a26bdff37b2

https://www.illumos.org/issues/7019
  Currently zfsdev_ioctl, when confronted by a request with the FKIOCTL flag set,
  skips all processing of secpolicy functions. This means that ZFS is not doing
  any kind of verification of the credentials or access rights of the caller and
  assuming that (as it is an in-kernel client) all such checks have already been
  done.
  This turns out to be quite a dangerous assumption, especially with respect to
  sdev. In general I don't think it's particularly reasonable to offload this
  enforcement of access rights onto other kernel subsystems when ZFS has some
  particular local semantics in this area (delegated datasets etc) and does not
  provide any kind of API to allow other subsystems to avoid code duplication
  when doing it. ZFS should apply its normal access policy to requests from
  within the kernel, and callers should take care to give it the correct
  credentials and call it from the correct context in order to get the results
  they need.
  You can observe the currently unfortunate consequences of this bug in any non-
  global zone that has access to /dev/zvol or any subset of it via sdev profiles.
  In particular, a zone used to contain a KVM or similar which has a single zvol
  passed through to it using a <device match= block in its zone XML.
  Even though sdev makes something of an attempt to control for whether the
  caller should have access to nodes in /dev/zvol, it doesn't do this correctly,
  or really at all in the lookup call path. So, if we have a zone that's been
  given access to any part of /dev/zvol, it can simply look up the full path to
  any other zvol on the entire system, and the node will appear and be able to be
  used.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alex Wilson <alex.wilson@joyent.com>

8 years agoMFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device
Alexander Motin [Thu, 1 Sep 2016 14:17:30 +0000 (14:17 +0000)]
MFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device

illumos/illumos-gate@63364b0ee2604783e7a55f8425888867768eafa4
https://github.com/illumos/illumos-gate/commit/63364b0ee2604783e7a55f84258888677
68eafa4

https://www.illumos.org/issues/6922
  ZFS does not do a config_sync after removing an aux (spare, log, or cache)
  device. AFAICT this isn't being done because it is slow and was deemed
  unnecessary. However, it should be such a rare operation that speed doesn't
  matter, and not doing it results in two problems:
  1) It is theoretically possible to remove an aux device from one pool and
  attach it to another, then lose power. When power is restored, both pools woul
d
  think that they own the aux device.
  2) Removal of the aux device doesn't send any useful sysevents to userland.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alan Somers <asomers@gmail.com>

8 years agoMFV r302646:
Alexander Motin [Thu, 1 Sep 2016 14:06:30 +0000 (14:06 +0000)]
MFV r302646:
6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch

illumos/illumos-gate@ea4a67f462de0a39a9adea8197bcdef849de5371
https://github.com/illumos/illumos-gate/commit/ea4a67f462de0a39a9adea8197bcdef84
9de5371

https://www.illumos.org/issues/6980
  doing zfs send -i snap1 snap2 >testfile results in
  internal error: Invalid argument
  Abort (core dumped)

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8 years ago[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro
Michael Zhilin [Thu, 1 Sep 2016 13:38:46 +0000 (13:38 +0000)]
[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro

The purpose of BHND_PMU_{GET,SET}_BITS macro is to transform values from/into
register format. SET macro shifts value to left and applies filter mask.
GET macro applies filter mask and then shifts value to right.

Reviewed by:    landonf, adrian (mentor)
Approved by:    adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7721

8 years agoMFV r302643:
Alexander Motin [Thu, 1 Sep 2016 13:29:53 +0000 (13:29 +0000)]
MFV r302643:
6902 speed up listing of snapshots if requesting name only and sorting by name

This was our change from the beginning, so just reduce the upstream diff.

8 years agoMFV r302642:
Alexander Motin [Thu, 1 Sep 2016 13:14:31 +0000 (13:14 +0000)]
MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

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

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

8 years agoMFV r302642:
Alexander Motin [Thu, 1 Sep 2016 13:04:36 +0000 (13:04 +0000)]
MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

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

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

8 years agoFix arm64 superpages bugs in pmap_enter:
Andrew Turner [Thu, 1 Sep 2016 10:26:06 +0000 (10:26 +0000)]
Fix arm64 superpages bugs in pmap_enter:
 * Pass the correct virtual address when demoting a superpage
 * Use the correct l3 table after demoting a superpage
 * Remove an invalid KASSERT hit demoting then promoting a superpage [1]

With this it is believed that  superpages on arm64 is stable.

Reported by: [1] cognet
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agonet/rndis: Define types for RNDIS pktinfo rm_type field.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:17:06 +0000 (07:17 +0000)]
net/rndis: Define types for RNDIS pktinfo rm_type field.

They are defined by NDIS spec, so the NDIS prefix.

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

8 years agohyperv/hn: Fix VLAN tag construction.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:04:47 +0000 (07:04 +0000)]
hyperv/hn: Fix VLAN tag construction.

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

8 years agobd_int13probe() should check extended info if sector info is bad
Toomas Soome [Thu, 1 Sep 2016 06:35:13 +0000 (06:35 +0000)]
bd_int13probe() should check extended info if sector info is bad

In some Dell systems and usb stick combinations, it is found that
int13 AH=08 is reporting back bad sector information, preventing the
boot.

This update is allowing bd_int13probe() to use extended info call to
build disk properties.

It also can happen the total sectors count from extended info may be
wrong, in such case, the CHS data is used to calculate total sectors.

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7718

8 years agonet/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:32:35 +0000 (06:32 +0000)]
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

Reviewed by: araujo, hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7710

8 years agohyperv/hn: Stringent per-packet-info verification.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:05:08 +0000 (06:05 +0000)]
hyperv/hn: Stringent per-packet-info verification.

While I'm here, minor style changes.

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

8 years agonet/rndis: Define per-packet-info for RNDIS packet message
Sepherosa Ziehau [Thu, 1 Sep 2016 05:40:13 +0000 (05:40 +0000)]
net/rndis: Define per-packet-info for RNDIS packet message

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

8 years agohyperv/hn: Remove unused function
Sepherosa Ziehau [Thu, 1 Sep 2016 05:29:58 +0000 (05:29 +0000)]
hyperv/hn: Remove unused function

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

8 years agonet/rndis: Add comment for rndis_set_parameter
Sepherosa Ziehau [Thu, 1 Sep 2016 05:15:04 +0000 (05:15 +0000)]
net/rndis: Add comment for rndis_set_parameter

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

8 years agoallow kern.proc.nfds sysctl in capability mode
Ed Maste [Thu, 1 Sep 2016 02:51:50 +0000 (02:51 +0000)]
allow kern.proc.nfds sysctl in capability mode

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7733

8 years agoDon't bake all of CC/CPP/CXX into CFLAGS
Enji Cooper [Thu, 1 Sep 2016 02:42:11 +0000 (02:42 +0000)]
Don't bake all of CC/CPP/CXX into CFLAGS

Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

Reviewed by: rodrigc (earlier version)
Reported by: Jenkins (FreeBSD_HEAD job from 559+)
MFC after: 12 days
X-MFC with: r304681, r305041
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7732

8 years ago_taskqueue_start_threads() now fails if it doesn't actually start any threads.
Patrick Kelsey [Thu, 1 Sep 2016 02:05:46 +0000 (02:05 +0000)]
_taskqueue_start_threads() now fails if it doesn't actually start any threads.

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7701

8 years agoFix linker warnings (errors on gcc) that resulted from r304510.
Eric Joyner [Thu, 1 Sep 2016 01:08:18 +0000 (01:08 +0000)]
Fix linker warnings (errors on gcc) that resulted from r304510.

The variables that are extern in the netmap header file should be
defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4),
not in the main driver source files.

Reported by: ed@, dim@, ngie@

8 years agocxgbe/t4_tom: Two new routines to allocate and write page pods for a
Navdeep Parhar [Thu, 1 Sep 2016 00:51:59 +0000 (00:51 +0000)]
cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.

8 years agocxgbe/t4_tom: Add general purpose routines to deal with page pod regions
Navdeep Parhar [Wed, 31 Aug 2016 23:23:46 +0000 (23:23 +0000)]
cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
and allocations within them.  Switch to these routines to manage the TOE
DDP region.

Sponsored by: Chelsio Communications

8 years agoRename unp_dispose_so() to unp_dispose().
Mark Johnston [Wed, 31 Aug 2016 21:48:22 +0000 (21:48 +0000)]
Rename unp_dispose_so() to unp_dispose().

It implements the dom_dispose method for local socket domain, so its name
should match the method name.

8 years agoSet UEFI boot loader PE/COFF timestamps to known value for reproducible builds
Ed Maste [Wed, 31 Aug 2016 21:35:38 +0000 (21:35 +0000)]
Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds

Reviewed by: rpokala
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7633

8 years agoAdd WITH_/WITHOUT_LLD knobs to enable the lld linker
Ed Maste [Wed, 31 Aug 2016 21:18:38 +0000 (21:18 +0000)]
Add WITH_/WITHOUT_LLD knobs to enable the lld linker

Use this to control inclusion of the libllvm functionality required
by lld. Enable by default on arm64 and amd64, the two platforms where
lld is most usable for testing.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7713

8 years agousers: don't build when we don't have a C++ toolchain
Ed Maste [Wed, 31 Aug 2016 21:12:50 +0000 (21:12 +0000)]
users: don't build when we don't have a C++ toolchain

(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D7725

8 years agoreadelf: silence GCC 4.2.1 uninitialized variable warning
Ed Maste [Wed, 31 Aug 2016 21:04:58 +0000 (21:04 +0000)]
readelf: silence GCC 4.2.1 uninitialized variable warning

Sponsored by: The FreeBSD Foundation

8 years agodirectory(3): Deprecate readdir_r(). Clarify dirent buffers.
Jilles Tjoelker [Wed, 31 Aug 2016 20:38:40 +0000 (20:38 +0000)]
directory(3): Deprecate readdir_r(). Clarify dirent buffers.

In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, lthough readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

Reviewed by: ed, wblock
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7678

8 years agoAll the TI platforms are FDT based and it is not necessary to enumerate
Luiz Otavio O Souza [Wed, 31 Aug 2016 19:37:10 +0000 (19:37 +0000)]
All the TI platforms are FDT based and it is not necessary to enumerate
the hinted children (there wont be any).

Spotted by: gonzo

8 years agoDIRDEPS_BUILD: Add some missing dirctories to the build.
Bryan Drewery [Wed, 31 Aug 2016 19:30:59 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Add some missing dirctories to the build.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd a 'make print-dir' that simply traverses all directories and prints them.
Bryan Drewery [Wed, 31 Aug 2016 19:30:52 +0000 (19:30 +0000)]
Add a 'make print-dir' that simply traverses all directories and prints them.

This is useful for finding connected directories.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Update dependencies.
Bryan Drewery [Wed, 31 Aug 2016 19:30:46 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Avoid cyclic dependency with libc++.
Bryan Drewery [Wed, 31 Aug 2016 19:30:00 +0000 (19:30 +0000)]
DIRDEPS_BUILD: Avoid cyclic dependency with libc++.

The DIRDEPS_BUILD does not have a 'make includes' phase, so it would
otherwise want libc++ to be fully built/staged before building
libgcc.  Using the header directly works.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years ago'addrlen' does not matter when we need to find the first non-zero bit in
Andrey A. Chernov [Wed, 31 Aug 2016 18:49:50 +0000 (18:49 +0000)]
'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      7 days

8 years agoRegnerate after r305140, getdtablesize in capability mode
Ed Maste [Wed, 31 Aug 2016 18:37:51 +0000 (18:37 +0000)]
Regnerate after r305140, getdtablesize in capability mode

Sponsored by: The FreeBSD Foundation

8 years agoFix the build.
Luiz Otavio O Souza [Wed, 31 Aug 2016 18:35:41 +0000 (18:35 +0000)]
Fix the build.

Works better when the file with the #define is actually included...

8 years agoAllow getdtablesize in capability mode
Ed Maste [Wed, 31 Aug 2016 18:33:15 +0000 (18:33 +0000)]
Allow getdtablesize in capability mode

getdtablesize is "trivial global state" and is similar to
getrlimit(RLIMIT_NOFILE), so should be permitted in capability mode.

Reviewed by: oshogbo
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7719

8 years agodf(1): Allow duplicate -l flags gracefully
Conrad Meyer [Wed, 31 Aug 2016 18:10:41 +0000 (18:10 +0000)]
df(1): Allow duplicate -l flags gracefully

Rather than producing a misleading error message when duplicate -l flags are
provided to df(1), simply ignore extra flags and proceed as if only one was
specified.  This seems most reasonable given the usage for -l:

     -l      Only display information about locally-mounted file systems.

l and t flags still conflict, as before.

PR: 208169
Reported by: by at reorigin.com
Reviewed by: allanjude

8 years agoEliminate unnecessary loop in _cap_check()
Allan Jude [Wed, 31 Aug 2016 17:52:11 +0000 (17:52 +0000)]
Eliminate unnecessary loop in _cap_check()

Calling cap_rights_contains() several times with the same inputs is not
going to produce a different output. The variable being iterated, i, is
never used inside the for loop.

The loop is actually done in cap_rights_contains()

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Reviewed by: oshogbo, ed
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7369

8 years agoAdd Allwinner A64 (sun50i) and Pine64 dts files.
Jared McNeill [Wed, 31 Aug 2016 16:56:54 +0000 (16:56 +0000)]
Add Allwinner A64 (sun50i) and Pine64 dts files.

Reviewed by: andrew, imp, manu, wca
Differential Revision: https://reviews.freebsd.org/D7169

8 years agoApply the same qsort() usage fix as in r304911 getaddrinfo.c
Andrey A. Chernov [Wed, 31 Aug 2016 15:47:58 +0000 (15:47 +0000)]
Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

MFC after:      3 days

8 years agoRemove accidentally committed stray comment.
Warner Losh [Wed, 31 Aug 2016 15:32:52 +0000 (15:32 +0000)]
Remove accidentally committed stray comment.

Noticed by: dteske@

8 years agoUpdate to ELF Tool Chain r3490
Ed Maste [Wed, 31 Aug 2016 15:05:04 +0000 (15:05 +0000)]
Update to ELF Tool Chain r3490

Improvements include:
 * readelf: report all relocation types in rel/rela for MIPS N64
 * readelf: add ELFOSABI_ARM_AEABI
 * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM
 * Add recent RISC-V relocations
 * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH

Sponsored by: The FreeBSD Foundation

8 years agoMake swapoff reliable.
Konstantin Belousov [Wed, 31 Aug 2016 14:49:58 +0000 (14:49 +0000)]
Make swapoff reliable.

The swap_pager_swapoff() function uses trylock for the object lock
before pagein, which means that either i/o to md(4) over swap, or
intensive page faults over swap pager objects might prevent swapoff()
from making any progress. Then the retry < 100 check fails and machine
panics.

If trylock fails, acquire the object lock in the blockable way and
restart the hash bucket walk.  Keep retries logic for now.

Reported and tested by: pho
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7688

8 years agoAlso handle instruction traps. We might hit these when the page we are
Andrew Turner [Wed, 31 Aug 2016 13:58:32 +0000 (13:58 +0000)]
Also handle instruction traps. We might hit these when the page we are
executing is being promoted to a superpage.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoImport ELF Tool Chain snapshot at revision 3490
Ed Maste [Wed, 31 Aug 2016 13:50:23 +0000 (13:50 +0000)]
Import ELF Tool Chain snapshot at revision 3490

From http://svn.code.sf.net/p/elftoolchain/code/

8 years agoNetboot: allow both tftpfs and nfs in both pxeboot and loader.efi
Baptiste Daroussin [Wed, 31 Aug 2016 13:16:40 +0000 (13:16 +0000)]
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi

Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Reviewed by: tsoome
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D7628

8 years agofd: effectively revert r305091
Mateusz Guzik [Wed, 31 Aug 2016 12:29:04 +0000 (12:29 +0000)]
fd: effectively revert r305091

Turns out fd_lastfile can survive being -1 for some processes, giving
incorrect results with the cast.

Noted by: cem

8 years agoFix kernel panic when inheriting properties without default.
Alexander Motin [Wed, 31 Aug 2016 11:55:31 +0000 (11:55 +0000)]
Fix kernel panic when inheriting properties without default.

There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.

MFC after: 2 weeks

8 years agoRemove redundant sanity checks from ipsec[46]_common_input_cb().
Andrey V. Elsukov [Wed, 31 Aug 2016 11:51:52 +0000 (11:51 +0000)]
Remove redundant sanity checks from ipsec[46]_common_input_cb().

This check already has been done in the each protocol callback.

8 years agoAdd some locking to sc_cngetc().
Bruce Evans [Wed, 31 Aug 2016 11:10:39 +0000 (11:10 +0000)]
Add some locking to sc_cngetc().

Keyboard input needs Giant locking, and that is not possible to do
correctly here.  Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant.  Everything here is a hack, but it often
works.  Even if mtx_trylock() succeeds, this might be a LOR.

Keyboard input also needs screen locking, to handle screen updates
and switches.  Add this, using the same simplistic screen locking
as for sc_cnputc().

Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant).  It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.

Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions.  This is correct for the keyboard
parts only.

When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).

The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.

8 years agoAdd support for Allwinner A64 USB PHY.
Jared McNeill [Wed, 31 Aug 2016 10:45:53 +0000 (10:45 +0000)]
Add support for Allwinner A64 USB PHY.

Reviewed by: manu

8 years agoAfter r305113, try to properly replace the magic numbers with
Bjoern A. Zeeb [Wed, 31 Aug 2016 10:45:33 +0000 (10:45 +0000)]
After r305113, try to properly replace the magic numbers with
proper #defines for this driver (not using the wrong header).

8 years agorecvtftp() is broken for large files, report file size
Toomas Soome [Wed, 31 Aug 2016 09:23:09 +0000 (09:23 +0000)]
recvtftp() is broken for large files, report file size

The tftp download for large files will cause internal block id
to wrap to 0 as the data type is unsigned short.

Also provide file size information for stat.

PR: 200500
Reported by: tsoome
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7660

8 years agoAdd a driver for the AM335x bandgap sensor, an on-die temperature sensor
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:42:46 +0000 (07:42 +0000)]
Add a driver for the AM335x bandgap sensor, an on-die temperature sensor
as part of the AM335x control module extension.

TI says that the bandgap sensor is not very accurate on AM335x, but in our
tests it seems to be a good reference for the SoC temperature.

TI details:
http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature

Sponsored by: Rubicon Communications, LLC (Netgate)

8 years agoAllow the use of control module extensions to cope with specific platform
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:22:14 +0000 (07:22 +0000)]
Allow the use of control module extensions to cope with specific platform
features.

Sponsored by: Rubicon Communications, LLC (Netgate)

8 years agoReplace more magic numbers with the proper register names.
Luiz Otavio O Souza [Wed, 31 Aug 2016 07:03:06 +0000 (07:03 +0000)]
Replace more magic numbers with the proper register names.

Sponsored by: Rubicon Communications, LLC (Netgate)

8 years agoReplace a magic number with the proper register name.
Luiz Otavio O Souza [Wed, 31 Aug 2016 06:46:47 +0000 (06:46 +0000)]
Replace a magic number with the proper register name.

Sponsored by: Rubicon Communications, LLC (Netgate)

8 years agohyperv/timesync: Rework time adjustment policy
Sepherosa Ziehau [Wed, 31 Aug 2016 06:00:20 +0000 (06:00 +0000)]
hyperv/timesync: Rework time adjustment policy

- By default, adjust time upon SYNC request.  It can be disabled
  through hw.hvtimesync.ignore_sync_req.  SYNC request will be
  sent by hypervisor the host is resumed, rebooted, etc.
- By default, adjust time upon SAMPLE request, if there is 100ms
  difference between VM time and hypervisor time.  This can be
  disabled through hw.hvtimesync.sample_drift.

And nuke the unnecessary task, since channel callback is running
in a Hyper-V taskqueue nowadays.

Submitted by: YanZhe Chen <t-yachen microsoft com>
Discussed with: Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>, sephe
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7707

8 years agohyperv/hn: Consolidate NVS transaction execution.
Sepherosa Ziehau [Wed, 31 Aug 2016 05:27:30 +0000 (05:27 +0000)]
hyperv/hn: Consolidate NVS transaction execution.

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

8 years agoBack out misfired extra file in r305108.
Nathan Whitehorn [Wed, 31 Aug 2016 04:03:55 +0000 (04:03 +0000)]
Back out misfired extra file in r305108.

8 years agoRefix operation on sparse CPU mappings as in r302372, temporarily broken
Nathan Whitehorn [Wed, 31 Aug 2016 04:02:52 +0000 (04:02 +0000)]
Refix operation on sparse CPU mappings as in r302372, temporarily broken
by r304716.

PR: kern/210106
MFC after: 2 days

8 years agoCreate a hook 'post-initialize' for people that want to define
Warner Losh [Wed, 31 Aug 2016 03:55:50 +0000 (03:55 +0000)]
Create a hook 'post-initialize' for people that want to define
something (perhaps in loader.rc.local) that can read in .conf files
after all the other .conf files have been read and override settings
in them. This is quite handy if the .conf file name is determined
while the loader is running, but might be generically useful for other
things. If this hook exists, call it, otherwise don't do anything.

Doing it in these functions ensures that this file is reliably
read. It also works around a defect in forth where s" isn't allowed
outside a function (well, in a compile context) leading to gross
workarounds if one were to hack loader.rc like:

: maybe-some-func s" some-func" sfind if execute else drop then ;
maybe-some-func

which somehow seems worse. Though I'm sure there's some clever forthy
way of doing that with a macro.

Sponsored by: Netflix, Inc

8 years agoUpdate VCHIQ driver to upstream version 4eda74f2
Oleksandr Tymoshenko [Wed, 31 Aug 2016 01:04:57 +0000 (01:04 +0000)]
Update VCHIQ driver to upstream version 4eda74f2

PR: 211525
Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>

8 years agoRevert 305098
Baptiste Daroussin [Wed, 31 Aug 2016 00:11:35 +0000 (00:11 +0000)]
Revert 305098

Was a wrong assumption from me badly look at the errors cross toolchain was
telling me

8 years agoMake libc++.so ldscript sysroot friendly
Baptiste Daroussin [Wed, 31 Aug 2016 00:04:09 +0000 (00:04 +0000)]
Make libc++.so ldscript sysroot friendly

8 years agoNuke obio_bs_tag, it was used before it was initialized, and
Olivier Houchard [Tue, 30 Aug 2016 23:32:38 +0000 (23:32 +0000)]
Nuke obio_bs_tag, it was used before it was initialized, and
arm_base_bs_tag is the same, anyway.

8 years agoSome old arm ports don't load the kernel at the beginning of the memory,
Olivier Houchard [Tue, 30 Aug 2016 23:30:26 +0000 (23:30 +0000)]
Some old arm ports don't load the kernel at the beginning of the memory,
because the bootloader, ie redboot, won't let them do so, and so used the
memory before the kernel for early memory allocation, such as pagetables,
stacks, etc...
Make a bit of an effort to try to get that memory mapped.

8 years agoAUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
Bryan Drewery [Tue, 30 Aug 2016 22:48:05 +0000 (22:48 +0000)]
AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.

This is to be used by the new clang3.9 build and extends functionality
added to 'make obj' in r279980.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoGarbage collect bits forgotten in r295267.
Olivier Houchard [Tue, 30 Aug 2016 22:32:33 +0000 (22:32 +0000)]
Garbage collect bits forgotten in r295267.

8 years agofd: add fdeget_locked and use in kern_descrip
Mateusz Guzik [Tue, 30 Aug 2016 21:53:22 +0000 (21:53 +0000)]
fd: add fdeget_locked and use in kern_descrip

8 years agoMFV r302423:
Pedro F. Giffuni [Tue, 30 Aug 2016 21:51:53 +0000 (21:51 +0000)]
MFV r302423:
Bring older verbatim version of cpuid.h

This file is used regularly in FreeBSD builds but we usually use the
similar file provided by clang.

By providing the older file introduced in GCC 4.3, we hope to mimic
better what is provided by an external toolchain.

Obtained from: GCC-4_3-branch (SVN rev. 129548, pre GPLv3)