]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg()
mav [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>

7 years agoMFV r302660: 6314 buffer overflow in dsl_dataset_name
mav [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>

7 years agoo Separate rtc and timecmp registers: they are different across
br [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

7 years agoMFV r302659: 6931 lib/libzfs: cleanup gcc warnings
mav [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>

7 years agoMFV r302658: 6872 zfs libraries should not allow uninitialized variables
mav [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>

7 years agoMFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"
mav [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>

7 years agoMFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist
mav [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>

7 years agoMFV r302654:
mav [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>

7 years agoMFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot
mav [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>

7 years agoMFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space
mav [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>

7 years agoMFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set
mav [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>

7 years agoMFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device
mav [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>

7 years agoMFV r302646:
mav [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>

7 years ago[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro
mizhka [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

7 years agoMFV r302643:
mav [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.

7 years agoMFV r302642:
mav [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>

7 years agoMFV r302642:
mav [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>

7 years agoFix arm64 superpages bugs in pmap_enter:
andrew [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

7 years agonet/rndis: Define types for RNDIS pktinfo rm_type field.
sephe [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

7 years agohyperv/hn: Fix VLAN tag construction.
sephe [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

7 years agobd_int13probe() should check extended info if sector info is bad
tsoome [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

7 years agonet/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
sephe [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

7 years agohyperv/hn: Stringent per-packet-info verification.
sephe [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

7 years agonet/rndis: Define per-packet-info for RNDIS packet message
sephe [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

7 years agohyperv/hn: Remove unused function
sephe [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

7 years agonet/rndis: Add comment for rndis_set_parameter
sephe [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

7 years agoallow kern.proc.nfds sysctl in capability mode
emaste [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

7 years agoDon't bake all of CC/CPP/CXX into CFLAGS
ngie [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

7 years ago_taskqueue_start_threads() now fails if it doesn't actually start any threads.
pkelsey [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

7 years agoFix linker warnings (errors on gcc) that resulted from r304510.
erj [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@

7 years agocxgbe/t4_tom: Two new routines to allocate and write page pods for a
np [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.

7 years agocxgbe/t4_tom: Add general purpose routines to deal with page pod regions
np [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

7 years agoRename unp_dispose_so() to unp_dispose().
markj [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.

7 years agoSet UEFI boot loader PE/COFF timestamps to known value for reproducible builds
emaste [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

7 years agousers: don't build when we don't have a C++ toolchain
emaste [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

7 years agoreadelf: silence GCC 4.2.1 uninitialized variable warning
emaste [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

7 years agodirectory(3): Deprecate readdir_r(). Clarify dirent buffers.
jilles [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

7 years agoAll the TI platforms are FDT based and it is not necessary to enumerate
loos [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

7 years agoDIRDEPS_BUILD: Add some missing dirctories to the build.
bdrewery [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

7 years agoAdd a 'make print-dir' that simply traverses all directories and prints them.
bdrewery [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

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

Sponsored by: EMC / Isilon Storage Division

7 years agoDIRDEPS_BUILD: Avoid cyclic dependency with libc++.
bdrewery [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

7 years ago'addrlen' does not matter when we need to find the first non-zero bit in
ache [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

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

Sponsored by: The FreeBSD Foundation

7 years agoFix the build.
loos [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...

7 years agoAllow getdtablesize in capability mode
emaste [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

7 years agodf(1): Allow duplicate -l flags gracefully
cem [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

7 years agoEliminate unnecessary loop in _cap_check()
allanjude [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

7 years agoAdd Allwinner A64 (sun50i) and Pine64 dts files.
jmcneill [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

7 years agoApply the same qsort() usage fix as in r304911 getaddrinfo.c
ache [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

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

Noticed by: dteske@

7 years agoUpdate to ELF Tool Chain r3490
emaste [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

7 years agoMake swapoff reliable.
kib [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

7 years agoAlso handle instruction traps. We might hit these when the page we are
andrew [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

7 years agoImport ELF Tool Chain snapshot at revision 3490
emaste [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/

7 years agoNetboot: allow both tftpfs and nfs in both pxeboot and loader.efi
bapt [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

7 years agofd: effectively revert r305091
mjg [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

7 years agoFix kernel panic when inheriting properties without default.
mav [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

7 years agoRemove redundant sanity checks from ipsec[46]_common_input_cb().
ae [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.

7 years agoAdd some locking to sc_cngetc().
bde [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.

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

Reviewed by: manu

7 years agoAfter r305113, try to properly replace the magic numbers with
bz [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).

7 years agorecvtftp() is broken for large files, report file size
tsoome [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

7 years agoAdd a driver for the AM335x bandgap sensor, an on-die temperature sensor
loos [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)

7 years agoAllow the use of control module extensions to cope with specific platform
loos [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)

7 years agoReplace more magic numbers with the proper register names.
loos [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)

7 years agoReplace a magic number with the proper register name.
loos [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)

7 years agohyperv/timesync: Rework time adjustment policy
sephe [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

7 years agohyperv/hn: Consolidate NVS transaction execution.
sephe [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

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

7 years agoRefix operation on sparse CPU mappings as in r302372, temporarily broken
nwhitehorn [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

7 years agoCreate a hook 'post-initialize' for people that want to define
imp [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

7 years agoUpdate VCHIQ driver to upstream version 4eda74f2
gonzo [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>

7 years agoRevert 305098
bapt [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

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

7 years agoNuke obio_bs_tag, it was used before it was initialized, and
cognet [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.

7 years agoSome old arm ports don't load the kernel at the beginning of the memory,
cognet [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.

7 years agoAUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
bdrewery [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

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

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

7 years agoMFV r302423:
pfg [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)

7 years agofd: simplify fd testing in fget_locked by casting to u_int
mjg [Tue, 30 Aug 2016 21:48:10 +0000 (21:48 +0000)]
fd: simplify fd testing in fget_locked by casting to u_int

7 years agogetvfsbyname(3): Remove [EFAULT] error.
jilles [Tue, 30 Aug 2016 21:43:57 +0000 (21:43 +0000)]
getvfsbyname(3): Remove [EFAULT] error.

Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.

MFC after: 1 week

7 years agoFix warnings in telnet about invalid constant conversions, e.g.:
dim [Tue, 30 Aug 2016 20:27:22 +0000 (20:27 +0000)]
Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
                *lsrp++ = IPOPT_SSRR;
                        ~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
                                ^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
                *lsrp++ = IPOPT_LSRR;
                        ~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
                                ^~~

Use unsigned char buffers instead.

MFC after: 1 week

7 years agoFix warnings in tnftp about invalid constant conversions, e.g.:
dim [Tue, 30 Aug 2016 20:24:50 +0000 (20:24 +0000)]
Fix warnings in tnftp about invalid constant conversions, e.g.:

contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int'
to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
        buf[0] = IAC;
               ~ ^~~
/usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC'
#define IAC     255             /* interpret as command: */
                ^~~
contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int'
to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion]
        buf[1] = IP;
               ~ ^~
/usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP'
#define IP      244             /* interrupt process--permanently */
                ^~~

Use an unsigned char buffer instead.

MFC after: 1 week

7 years agoFix Capsicum syscalls test suite.
oshogbo [Tue, 30 Aug 2016 19:58:41 +0000 (19:58 +0000)]
Fix Capsicum syscalls test suite.

7 years agolibcpp: Complete the __COUNTER__ support with upstream implementation.
pfg [Tue, 30 Aug 2016 19:39:33 +0000 (19:39 +0000)]
libcpp: Complete the __COUNTER__ support with upstream implementation.

We brought an original __COUNTER__ implementation in r228474, however, it
was missing documentation and it had a different behaviour for precompiled
headers with respect to the upstream version. Since the upstream version
is under the same license as GCC4.2, bring the missing pieces to reduce
differences against upstream.

Optained from: GCC pre-4.3 (rev. 125041 ; GPLv2)

7 years agoReduce duplicated logic for !SMP
bdrewery [Tue, 30 Aug 2016 19:26:07 +0000 (19:26 +0000)]
Reduce duplicated logic for !SMP

Sponsored by: EMC / Isilon Storage Division

7 years agoiscsi_initiator: make logout_req::reason unsigned char
emaste [Tue, 30 Aug 2016 19:20:26 +0000 (19:20 +0000)]
iscsi_initiator: make logout_req::reason unsigned char

Previously this reported an error from Clang 3.9.0: implict conversion
from 'int' to 'char' changes value from 128 to -128.

Discussed with: dim, trasz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7699

7 years agoSquelch clang 3.9.0 warnings about BASE (which is 32768) being converted
dim [Tue, 30 Aug 2016 19:02:15 +0000 (19:02 +0000)]
Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC after: 1 week

7 years agoThe code only converts from bpbHugeSectors to bpbSectors if the sum of
imp [Tue, 30 Aug 2016 18:01:26 +0000 (18:01 +0000)]
The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors and
2048 hidden (sum > MAXU16). The hidden sectors count is the number of
sectors before the FAT16 Boot Record so it shouldn't affect the sector
count. Attached patch (huge_sec_conversion.patch) to only check for
bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.

Submitted by: Guy Yur
PR: 183234

7 years agoRemove CHS alignment. It's not needed and causes problems for the BBB
imp [Tue, 30 Aug 2016 18:01:19 +0000 (18:01 +0000)]
Remove CHS alignment. It's not needed and causes problems for the BBB
boot partition. NetBSD removed it in 1.10 in their repo some time ago.

Submitted by: Guy Yur
PR: 183234

7 years agoBecause we need to use a break-before-make sequence when promoting pages
andrew [Tue, 30 Aug 2016 16:45:15 +0000 (16:45 +0000)]
Because we need to use a break-before-make sequence when promoting pages
there is a short period where functions that walk the kernel page table
without locking them may see an invalid entry. One solution would be to add
locking to these functions, however some may be called from locations where
we are unable to sleep.

Until a better solution can be found stop promoting pages in the kernel
pmap so these functions work as expected.

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

7 years agoUpdate cryptotest for modern algorithms
gnn [Tue, 30 Aug 2016 14:28:35 +0000 (14:28 +0000)]
Update cryptotest for modern algorithms

Reviewed by: cem
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7598

7 years agoAdd refactored blacklist support to sshd
lidl [Tue, 30 Aug 2016 14:09:24 +0000 (14:09 +0000)]
Add refactored blacklist support to sshd

Change the calls to of blacklist_init() and blacklist_notify to be
macros defined in the blacklist_client.h file.  This avoids
the need for #ifdef USE_BLACKLIST / #endif except in the
blacklist.c file.

Remove redundent initialization attempts from within
blacklist_notify - everything always goes through
blacklistd_init().

Added UseBlacklist option to sshd, which defaults to off.
To enable the functionality, use '-o UseBlacklist=yes' on
the command line, or uncomment in the sshd_config file.

Reviewed by: des
Approved by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7051

7 years agoInvert calloc(3) argument order.
araujo [Tue, 30 Aug 2016 12:40:12 +0000 (12:40 +0000)]
Invert calloc(3) argument order.

Reviewed by: grehan, mav
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7613

7 years agoFix keyboard polling "on/off" to support recursion. vt depends on
bde [Tue, 30 Aug 2016 12:36:14 +0000 (12:36 +0000)]
Fix keyboard polling "on/off" to support recursion.  vt depends on
this, and sc will soon depend on it again.

The on/off request is passed without modification to lower layers,
so the bug was smaller in this layer than in in lower layers (the
sequence on;on;off left polling off when it should be on, but the
sequence on;on;off;on;off...  doesn't allow the interrupt handler
to eat the input after an "off" that should't turn off polled mode,
provided lower layers don't have the bug, since this layer is virtual.

The bug was small in lower layers too.  Normally everything is Giant
locked for keyboards, and this locks out the interrupt handler in
on;on;off;on;off... sequences.  However, PR 211884 says that fixing
this bug in ukbd in r303765 apparently causes the eating-by-interrupt
behaviour that the fix is to prevent.

Discussed with: emax

7 years agoStart adding locking to sc_cngetc().
bde [Tue, 30 Aug 2016 10:57:19 +0000 (10:57 +0000)]
Start adding locking to sc_cngetc().

Restore an splx() lost in r228644.  We aren't nearly ready to remove
spl's.  They give hints about missing locking.  This lost one was
misplaced.  Dropping it early for convenience gave race windows for
accesses to the fkey buffer.  Giant locking accidentally fixed this
for non-console cases.

Put the spl's around the whole function.  Since there are many returns
that would need splx() just before them for a direct fix, split the
function into a wrapper that does the spl's and a "locked" function
that does the work.

Return earlier when no keyboard is attached to match the ordering in a
planned version.  This breaks the dubious feature of returning keys
from the fkey buffer after the keyboard has gone away.  Losing the keys
wouldn't matter, but we keep them too long now.

7 years agoAdd support for Allwinner A64 watchdog timer.
jmcneill [Tue, 30 Aug 2016 10:21:32 +0000 (10:21 +0000)]
Add support for Allwinner A64 watchdog timer.

7 years agoUpdate a comment to reflect r305051.
kevlo [Tue, 30 Aug 2016 08:34:49 +0000 (08:34 +0000)]
Update a comment to reflect r305051.