]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agovfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels
mjg [Fri, 17 Jun 2016 19:41:30 +0000 (19:41 +0000)]
vfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels

This removes calls to empty functions like vop_lock_{pre/post} from
common vfs routines.

Approved by: re (gjb)

8 years agomkimg: bump version to 20151211 after r292082
emaste [Fri, 17 Jun 2016 18:49:42 +0000 (18:49 +0000)]
mkimg: bump version to 20151211 after r292082

mkimg has had a number of functional additions after the last time the
version was incremented. Do so now, to r292082's commit date, so that
users can determine what is supported.

Reviewed by: marcel
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6882

8 years agopf: Filter on and set vlan PCP values
kp [Fri, 17 Jun 2016 18:21:55 +0000 (18:21 +0000)]
pf: Filter on and set vlan PCP values

Adopt the OpenBSD syntax for setting and filtering on VLAN PCP values. This
introduces two new keywords: 'set prio' to set the PCP value, and 'prio' to
filter on it.

Reviewed by:    allanjude, araujo
Approved by: re (gjb)
Obtained from:  OpenBSD (mostly)
Differential Revision:  https://reviews.freebsd.org/D6786

8 years agoUse vnlru_free(9) to implement dnlc_reduce_cache().
kib [Fri, 17 Jun 2016 17:34:28 +0000 (17:34 +0000)]
Use vnlru_free(9) to implement dnlc_reduce_cache().

This apparently puts ARC back under the limits after the vnode pressure
rework in r291244, in particular due to the kmem exhaustion.

Based on patch by: mckusick
Reviewed by: avg, mckusick
Tested by: allanjude, madpilot
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

8 years agoAdd VFS interface to flush specified amount of free vnodes belonging
kib [Fri, 17 Jun 2016 17:33:25 +0000 (17:33 +0000)]
Add VFS interface to flush specified amount of free vnodes belonging
to mount points with the given filesystem type, specified by mount
vfs_ops pointer.

Based on patch by: mckusick
Reviewed by: avg, mckusick
Tested by: allanjude, madpilot
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

8 years agoPrint a message when disks are found but no logical partition are
manu [Fri, 17 Jun 2016 17:09:22 +0000 (17:09 +0000)]
Print a message when disks are found but no logical partition are
reported by EFI implementation. This address comment on r301714.

Approved by: re (gjb), andrew (mentor)
Differential Revision: https://reviews.freebsd.org/D6787

8 years ago[ath] don't debug RX EDMA descriptors that are not yet complete.
adrian [Fri, 17 Jun 2016 17:01:32 +0000 (17:01 +0000)]
[ath] don't debug RX EDMA descriptors that are not yet complete.

Approved by: re@ (gjb)

8 years agoAdd clang-format under WITH_CLANG_EXTRAS.
bdrewery [Fri, 17 Jun 2016 16:46:58 +0000 (16:46 +0000)]
Add clang-format under WITH_CLANG_EXTRAS.

Reviewed by: dim
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6856

8 years agoImport ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564
bdrewery [Fri, 17 Jun 2016 16:44:31 +0000 (16:44 +0000)]
Import ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564

Discussed with: dim
Approved by: re (gjb)

8 years agoNote ipfilter support in blacklist-helper script in relnotes
lidl [Fri, 17 Jun 2016 16:34:25 +0000 (16:34 +0000)]
Note ipfilter support in blacklist-helper script in relnotes

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

8 years agoUpdate 11.0 to -ALPHA4 in preparation of a new set of snapshot
gjb [Fri, 17 Jun 2016 00:00:45 +0000 (00:00 +0000)]
Update 11.0 to -ALPHA4 in preparation of a new set of snapshot
builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoar: enable reproducible output by default when invoked as 'ar -s'
emaste [Thu, 16 Jun 2016 21:22:26 +0000 (21:22 +0000)]
ar: enable reproducible output by default when invoked as 'ar -s'

ar output is already deterministic by default for ar -q and ar -r, and
when invoked as ranlib. Make ar -s equivalent to ranlib and enable
deterministic output by default in that case too.

PR: 210330
Reviewed by: bdrewery
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6871

8 years agoAdd bsdconfig `wifi' (aka `wireless' or `wlan') module
dteske [Thu, 16 Jun 2016 21:14:25 +0000 (21:14 +0000)]
Add bsdconfig `wifi' (aka `wireless' or `wlan') module

Approved by: re (gjb)
MFC after: 8 weeks
Relnotes: yes

8 years agosiba(4): Adopt bcma-compatible mapping of bhnd(4) port/region identifiers.
landonf [Thu, 16 Jun 2016 20:04:33 +0000 (20:04 +0000)]
siba(4): Adopt bcma-compatible mapping of bhnd(4) port/region identifiers.

Maps Sonics/OCP per-core address spaces to bcma(4)-compatible port/region
identifiers.

This permits the use of common address map identifiers in bhnd device
drivers, independent of the underlying interconnect type.

Approved by: re (gjb), adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D6850

8 years agobhnd(4): Fix resource allocation issues exposed by chipc PMU support.
landonf [Thu, 16 Jun 2016 19:57:24 +0000 (19:57 +0000)]
bhnd(4): Fix resource allocation issues exposed by chipc PMU support.

- Delete all chipc children on attachment failure.
- Added missing bhnd_nexus bhnd_bus_deactivate_resource implementation.
- Drop a CHIPC_UNLOCK() accidentally left behind after lifting
  synchronization into the chipc region refcounting API.
- Fix re-allocation of chipc resources. Previously, the resource ID was
  reset to -1 on release, preventing later re-allocation.

Approved by: re (gjb), adrian (mentor)
Differential Revision:  https://reviews.freebsd.org/D6849

8 years ago[iwm] free RX ring / NVM memory after they're used.
adrian [Thu, 16 Jun 2016 17:59:15 +0000 (17:59 +0000)]
[iwm] free RX ring / NVM memory after they're used.

* Free RX ring during detach
* Free NVM memory after parsing

Tested:

* 7260, STA mode

Submitted by: Imre Vadasz <imre@vdsz.com>
Approved by: re (gjb)
Obtained from: dragonflybsd
Differential Revision: https://reviews.freebsd.org/D6817

8 years agoAdd missing return statement.
hselasky [Thu, 16 Jun 2016 16:26:16 +0000 (16:26 +0000)]
Add missing return statement.

Approved by: re (gjb)
MFC after: 1 week

8 years agoAdd multiple missing descriptor parsing functions to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 16:17:29 +0000 (16:17 +0000)]
Add multiple missing descriptor parsing functions to the LibUSB v1.0 API.

Approved by: re (kib)
Requested by: swills
MFC after: 1 week

8 years agoFix usr.sbin/rpcbind ATF tests on 32-bit platforms
asomers [Thu, 16 Jun 2016 15:25:37 +0000 (15:25 +0000)]
Fix usr.sbin/rpcbind ATF tests on 32-bit platforms

usr.sbin/rpcbind/tests/addrmerge_test.c
Fix some sizeof calculations that work only by luck on 64-bit
platforms.

PR: 210314
Reviewed by: ngie
Approved by: re (kib)
Reported by: Mark Millard
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6855

8 years agoAdd support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 14:26:04 +0000 (14:26 +0000)]
Add support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

8 years agoReimplement r301944 using the correct install(1) invocation, which again
gjb [Thu, 16 Jun 2016 13:34:20 +0000 (13:34 +0000)]
Reimplement r301944 using the correct install(1) invocation, which again
fixes packaging tzdata/zoneinfo.

Thank you to hrs for the pointer on what I did incorrectly.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

8 years agoAdd support for libusb_get_port_number() to the LibUSB v1.0 API.
hselasky [Thu, 16 Jun 2016 12:14:19 +0000 (12:14 +0000)]
Add support for libusb_get_port_number() to the LibUSB v1.0 API.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

8 years agoReturn usual error indicator to shell.
kib [Thu, 16 Jun 2016 12:08:25 +0000 (12:08 +0000)]
Return usual error indicator to shell.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

8 years agoAlways allow loading of cpuctl(4). When a CPU feature is not
kib [Thu, 16 Jun 2016 12:07:40 +0000 (12:07 +0000)]
Always allow loading of cpuctl(4).  When a CPU feature is not
supported, e.g. CPUID or MSR, return ENODEV from the ioctl which needs
that feature.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

8 years agoUpdate comments for the MD functions managing contexts for new
kib [Thu, 16 Jun 2016 12:05:44 +0000 (12:05 +0000)]
Update comments for the MD functions managing contexts for new
threads, to make it less confusing and using modern kernel terms.

Rename the functions to reflect current use of the functions, instead
of the historic KSE conventions:
  cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads)
  cpu_set_upcall -> cpu_copy_thread (for forks)
  cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation)

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
Differential revision: https://reviews.freebsd.org/D6731

8 years agoRemove XXX comments from kern_thread.c. In one case, there is no
kib [Thu, 16 Jun 2016 12:01:11 +0000 (12:01 +0000)]
Remove XXX comments from kern_thread.c.  In one case, there is no
reason for it in modern times.  In the other case, expand the comment
stating instead of doubting.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
X-Differential revision: https://reviews.freebsd.org/D6731

8 years agoRemove code duplication.
kib [Thu, 16 Jun 2016 11:58:46 +0000 (11:58 +0000)]
Remove code duplication.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
X-Differential revision: https://reviews.freebsd.org/D6731

8 years agoRevert r301944, which apparently broke zoneinfo install during
gjb [Thu, 16 Jun 2016 11:55:24 +0000 (11:55 +0000)]
Revert r301944, which apparently broke zoneinfo install during
installworld (although I am not sure why).  I'll revisit this
change after I further understand the cause of the breakage.

Thanks to our secret canary (dhw) for the report.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

8 years agoDefine LIBUSB_API_VERSION.
hselasky [Thu, 16 Jun 2016 11:51:20 +0000 (11:51 +0000)]
Define LIBUSB_API_VERSION.

Approved by: re (kostikbel)
Requested by: swills
MFC after: 1 week

8 years agoImplement libusb_get_version() and update libusb manual page.
hselasky [Thu, 16 Jun 2016 07:48:21 +0000 (07:48 +0000)]
Implement libusb_get_version() and update libusb manual page.

Approved by: re (glebius)
Requested by: swills
MFC after: 1 week

8 years agofix a zfs boot regression introduced in r300117 by accident
avg [Thu, 16 Jun 2016 07:45:57 +0000 (07:45 +0000)]
fix a zfs boot regression introduced in r300117 by accident

There is no reason to return non-zero value from zfs_probe_partition()
as that causes following partitions to not be probed for ZFS vdevs.
A particular scenario that I encountered is a GPT partitioned disk
where several partitions have freebsd-zfs type.  A partition with a lower
index is used as a cache (l2arc) vdev and in that case case zfs_probe()
returned a non-zero status.  That status was returned to ptable_iterate()
and caused it to abort the iteration.  Because of that the subsequent
partitions were not probed and a root pool was not discovered resulting
in a boot failure.

While there fix the style for nearby return statements.

Approved by: re (kib)

8 years ago Bump /tmp from 30m to 50m for ARM release images.
manu [Thu, 16 Jun 2016 03:02:27 +0000 (03:02 +0000)]
 Bump /tmp from 30m to 50m for ARM release images.
 30m isn't enough for pkg anymore to extract packagesite.txz.
 40m is fine for now but let's take a safer way as we don't know when pkg will need more.

Reported by: many
Approved by: re (gjb), andrew (mentor)

8 years agoFix zoneinfo file packaging.
gjb [Thu, 16 Jun 2016 03:00:10 +0000 (03:00 +0000)]
Fix zoneinfo file packaging.

This change fixes 468 of 488 zoneinfo file packaging issues,
the rest still to be investigated.

Approved by: re (blanket, pkgbase)
Sponsored by: The FreeBSD Foundation

8 years agoMark targets with _SUBDIR as .PHONY.
bdrewery [Wed, 15 Jun 2016 23:58:09 +0000 (23:58 +0000)]
Mark targets with _SUBDIR as .PHONY.

This is mostly fixing META_MODE with realinstall wanting a .meta
file when it does not need one.  These targets really should
always run though since they have _SUBDIR on them.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Whitelist 'make kernel' and 'make world'.
bdrewery [Wed, 15 Jun 2016 23:58:06 +0000 (23:58 +0000)]
WITH_META_MODE: Whitelist 'make kernel' and 'make world'.

installkernel is technically META_MODE safe but doesn't need an explicit
approval to use it since it's all disabled via .PHONY.

world uses 'make -B installworld' which already will disable META_MODE
via the -B (.MAKE.MODE=compat) usage.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix native powerpc64 build of lib32 with in-tree GCC.
bdrewery [Wed, 15 Jun 2016 23:58:03 +0000 (23:58 +0000)]
Fix native powerpc64 build of lib32 with in-tree GCC.

- This was broken by r300350 and r300885.
- Add some comments around the external GCC logic since it is spread out
  and in need of some cleanup.
- The problem was that X_COMPILER_TYPE is always defined from CC->XCC's
  default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then
  X_COMPILER_TYPE was getting GCC and triggering the external logic in
  Makefile.libcompat.  It was intended to always provide -isystem with
  GCC since --sysroot is used into the lib32 sysroot which won't modify
  the header path without the -isystem.  The use of the libc++/std=c++11
  override was only intended to be used for external compilers though
  (more accurately GCC 4.8+ but that's a separate assumption to
  cleanup).  Apply the same logic from Makefile.inc1 to Makefile.libcompat
  to only add the libc++ override when needed for external compilers.

Pointyhat to: bdrewery
Tested with: native ppc64 (swills), universe, ppc64 xtoolchain,
amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2)
Reported by: andreast, swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

8 years agotinderbox/universe: Only show arm64 warning if it was in the TARGETS list.
bdrewery [Wed, 15 Jun 2016 23:58:00 +0000 (23:58 +0000)]
tinderbox/universe: Only show arm64 warning if it was in the TARGETS list.

This was a flaw in my change in r287903 but also in the original change
in r282156 since it used empty(${TARGETS}) rather than empty(TARGETS).

Reported by: lidl
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Keep .MAKE.MODE/META_MODE clean
bdrewery [Wed, 15 Jun 2016 23:57:57 +0000 (23:57 +0000)]
WITH_META_MODE: Keep .MAKE.MODE/META_MODE clean

Due to META_MODE being passed into the environment it tends
to keep growing with the defaults.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Don't expect a .meta file for side-effect generated files.
bdrewery [Wed, 15 Jun 2016 23:57:53 +0000 (23:57 +0000)]
WITH_META_MODE: Don't expect a .meta file for side-effect generated files.

This is the same as r301285.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Do include headers for specific guessed dependencies
bdrewery [Wed, 15 Jun 2016 23:57:50 +0000 (23:57 +0000)]
WITH_META_MODE: Do include headers for specific guessed dependencies

This is a follow-up to r300343.

This is important for the OBJS_DEPEND_GUESS usage in
gnu/usr.bin/cc/cc_tools.

See comments for more details.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoConvert to new FAST_DEPEND syntax for guessed dependencies.
bdrewery [Wed, 15 Jun 2016 23:57:46 +0000 (23:57 +0000)]
Convert to new FAST_DEPEND syntax for guessed dependencies.

This OBJS_DEPEND_GUESS is needed since each target gets its
own .depend.target.o file but also because it is spelled
.meta.target.o with WITH_META_MODE.  The OBJS_DEPEND_GUESS
will apply the dependency if the required file is missing.

Also remove redundant .c files while here to avoid prolems with
targets using .ALLSRC and getting multiple source files.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't truncate OBJS_DEPEND_GUESS.target from Makefile
bdrewery [Wed, 15 Jun 2016 23:57:32 +0000 (23:57 +0000)]
Don't truncate OBJS_DEPEND_GUESS.target from Makefile

This is important to allow a Makefile to override OBJS_DEPEND_GUESS for
handling in META_MODE when its depend files are missing.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoUse sbused() instead of sbspace() to avoid signed issues.
jhb [Wed, 15 Jun 2016 21:08:51 +0000 (21:08 +0000)]
Use sbused() instead of sbspace() to avoid signed issues.

Inserting a full mbuf with an external cluster into the socket buffer
resulted in sbspace() returning -MLEN.  However, since sb_hiwat is
unsigned, the -MLEN value was converted to unsigned in comparisons.  As a
result, the socket buffer was never autosized.  Note that sb_lowat is signed
to permit direct comparisons with sbspace(), but sb_hiwat is unsigned.
Follow suit with what tcp_output() does and compare the value of sbused()
with sb_hiwat instead.

Approved by: re (gjb)
Sponsored by: Chelsio Communications

8 years agoAdd a tool to decode ioctl commands.
jhb [Wed, 15 Jun 2016 21:01:53 +0000 (21:01 +0000)]
Add a tool to decode ioctl commands.

One or more ioctl command values can be passed as arguments on the command
line.  For each value, the command is broken down into it's components
(direction, group, number, and length).  In addition, if a command has a
known name it is output via sysdecode_ioctlname().

Reviewed by: kib, emaste, avg
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6851

8 years agoMove backend-specific fields of kaiocb into a union.
jhb [Wed, 15 Jun 2016 20:56:45 +0000 (20:56 +0000)]
Move backend-specific fields of kaiocb into a union.

This reduces the size of kaiocb slightly. I've also added some generic
fields that other backends can use in place of the BIO-specific fields.

Change the socket and Chelsio DDP backends to use 'backend3' instead of
abusing _aiocb_private.status directly. This confines the use of
_aiocb_private to the AIO internals in vfs_aio.c.

Reviewed by: kib (earlier version)
Approved by: re (gjb)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D6547

8 years agoDo not assume that we own the use reference on the covered vnode until
kib [Wed, 15 Jun 2016 15:56:03 +0000 (15:56 +0000)]
Do not assume that we own the use reference on the covered vnode until
we set MNTK_UNMOUNT flag on the mp.  Otherwise parallel unmount which
wins race with us could dereference the covered vnode, and we are
left with the locked freed memory.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

8 years agoAnother follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
kib [Wed, 15 Jun 2016 15:55:14 +0000 (15:55 +0000)]
Another follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
in devfs_reclaim().

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

8 years agosdt: annotate the probe test as likely to fail
mjg [Wed, 15 Jun 2016 08:34:36 +0000 (08:34 +0000)]
sdt: annotate the probe test as likely to fail

This saves a jump in plenty of cases.

Approved by: re (kib)
MFC after: 1 week

8 years agometa_oodate: set needOODATE if oodate due to missing .meta file.
sjg [Tue, 14 Jun 2016 23:52:32 +0000 (23:52 +0000)]
meta_oodate: set needOODATE if oodate due to missing .meta file.

Reviewed by: bdrewery
Approved by: re

8 years agocxgbe/t4_tom: Fix inverted assertion in r300895. It is RDMA
np [Tue, 14 Jun 2016 21:09:00 +0000 (21:09 +0000)]
cxgbe/t4_tom:  Fix inverted assertion in r300895.  It is RDMA
connections and not others that are allowed to fail the receive window
check.

Approved by: re (gjb@)

8 years agoiw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
np [Tue, 14 Jun 2016 21:02:36 +0000 (21:02 +0000)]
iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
Release the hold on ep->com immediately after sending the RST.  This
fixes a bug that sometimes leaves userspace iWARP tools hung when the
user presses ^C.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Approved by: re (gjb@)
Sponsored by: Chelsio Communications

8 years agoFix bug in iwcm that caused a panic in iw_cm_wq when krping is run
np [Tue, 14 Jun 2016 20:58:05 +0000 (20:58 +0000)]
Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run
repeatedly in a tight loop.

Approved by: re (gjb@)
Obtained from: hselasky@ (part of larger changes in D5791)

8 years agoRenegerate for WITH_META_MODE updates.
bdrewery [Tue, 14 Jun 2016 18:41:18 +0000 (18:41 +0000)]
Renegerate for WITH_META_MODE updates.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix makeman showing dependency of DIRDEPS_BUILD->META_MODE.
bdrewery [Tue, 14 Jun 2016 18:37:33 +0000 (18:37 +0000)]
Fix makeman showing dependency of DIRDEPS_BUILD->META_MODE.

This broke in r301887 with the meta mode whitelist.  'make showconfig'
still needs WITH_META_MODE support.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix build from stable/10 with fmake.
bdrewery [Tue, 14 Jun 2016 17:23:22 +0000 (17:23 +0000)]
Fix build from stable/10 with fmake.

This was broken in r301888.

fmake does not look in share/mk by default and thus does not yet
have MK_META_MODE set with default.

Pointyhat to: bdrewery
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoBump __FreeBSD_version for r301602.
bdrewery [Tue, 14 Jun 2016 17:15:36 +0000 (17:15 +0000)]
Bump __FreeBSD_version for r301602.

Reported by: ngie, Ben Lavery
PR: 210229
Approved by: re (gjb)

8 years agoDIRDEPS_BUILD: Update dependencies
bdrewery [Tue, 14 Jun 2016 16:55:05 +0000 (16:55 +0000)]
DIRDEPS_BUILD: Update dependencies

Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

8 years agoMove the arm call to intr_pic_init_secondary earlier in the secondary CPU
andrew [Tue, 14 Jun 2016 16:41:39 +0000 (16:41 +0000)]
Move the arm call to intr_pic_init_secondary earlier in the secondary CPU
initialisation. This ensures it will complete before signalling to the boot
CPU it has booted. This fixes a race with the GIC where the arm_gic_map may
not be populated before it is used to bind interrupts leading to some
interrupts becoming bound to no CPUs.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

8 years agoWITH_META_MODE: Enable printing of some of make's environment on error.
bdrewery [Tue, 14 Jun 2016 16:20:25 +0000 (16:20 +0000)]
WITH_META_MODE: Enable printing of some of make's environment on error.

This will print a set of variables from make on error using
MAKE_PRINT_VAR_ON_ERROR.  It is already enabled for the DIRDEPS_BUILD.
It may make sense to enable this in the non-meta mode as well once
people are more used to its more verbose error output.

This makes it much simpler to see which .meta file is used when a
command files so that it may be inspected for the build command.

Suggested by: sjg
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Lessen the filemon(4) requirement scope.
bdrewery [Tue, 14 Jun 2016 16:20:19 +0000 (16:20 +0000)]
WITH_META_MODE: Lessen the filemon(4) requirement scope.

- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
  This is intended only to show when building directly in a subdirectory
  without filemon loaded.
- Move the error into Makefile and only apply it when building
  from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful.  It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Whitelist targets that are meta-mode-safe.
bdrewery [Tue, 14 Jun 2016 16:20:14 +0000 (16:20 +0000)]
WITH_META_MODE: Whitelist targets that are meta-mode-safe.

META_TGT_WHITELIST is added to define which build targets are safe for
meta mode.  See comments for more details.

This fixes 'make delete-old-libs' to properly show the interactive
prompt.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Set MK_META_MODE=no with -B.
bdrewery [Tue, 14 Jun 2016 16:20:11 +0000 (16:20 +0000)]
WITH_META_MODE: Set MK_META_MODE=no with -B.

Using -B already sets .MAKE.MODE=compat but it was leaving
MK_META_MODE set which could still cause other MK_META_MODE==yes
checks to trigger.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd more missing .PHONY
bdrewery [Tue, 14 Jun 2016 16:20:08 +0000 (16:20 +0000)]
Add more missing .PHONY

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Fix rebuilding maketab outside of build-tools.
bdrewery [Tue, 14 Jun 2016 16:20:05 +0000 (16:20 +0000)]
WITH_META_MODE: Fix rebuilding maketab outside of build-tools.

The bsd.dep.mk yacc targets rely on only the .c file getting a .meta
file.  However the previous code here relying on only the .h file meant
that it would be generated with a .meta file.  r301285 made it so that
the .h file is never expected to get a .meta file.  To keep this
restriction in place add in an extra dependency on the .c file so that
it is generated at this time.  It's a hack but the best for the patterns
we have at the moment for handling build-tools and side-effect-generated
files.

Reported by: Mark Millard
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoDefine targets in same order as .ORDER
bdrewery [Tue, 14 Jun 2016 16:19:59 +0000 (16:19 +0000)]
Define targets in same order as .ORDER

This is a NOP but is done for style and to reduce confusion.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Fix rescue rebuilding build-tools.
bdrewery [Tue, 14 Jun 2016 16:19:54 +0000 (16:19 +0000)]
WITH_META_MODE: Fix rescue rebuilding build-tools.

This is the same issue as r297997.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE: Fix bin/csh rebuilding tc.const.h
bdrewery [Tue, 14 Jun 2016 16:19:49 +0000 (16:19 +0000)]
WITH_META_MODE: Fix bin/csh rebuilding tc.const.h

This is the same issue as r297997, but was missed in it.

The WARNS value changes between 'build-tools' (MK_WARNS=no) and
'everything' resulting in a rebuild of this file.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

8 years agoWITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.
bdrewery [Tue, 14 Jun 2016 16:19:44 +0000 (16:19 +0000)]
WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.

A simplified example of the library targets with WITH_DEBUG_FILES is:

  libgeom.so.5: libgeom.so.5.full
     cp libgeom.so.5.full libgeom.so.5

  libgeom.so.5.full:
     ln -s libgeom.so.5 libgeom.so
     cc -o libgeom.so.5.full *.o

Before, or without, WITH_DEBUG_FILES it is:

  libgeom.so.5:
     ln -s libgeom.so.5 libgeom.so
     cc -o libgeom.so.5 *.o

The problem is that bmake considers the link source for the libgeom.so
link in the libgeom.so.5.full target as being a dependency for
libgeom.so.5.full.  That resolves to libgeom.so.5.  Thus a cyclic
dependency is created.  The result of this is that if libgeom.so.5 is
created with a newer timestamp than libgeom.so.5.full, then
libgeom.so.5.full will be rebuilt on the next build.  This causes a
chain reaction of everything in the build relinking, or hitting the
problem itself.

Moving the link creation to the target that actually creates
libgeom.so.5 fixes the problem.  The simplest fix here is to just
duplicate the logic.

Submitted by: sjg
Approved by: re (implicit)

8 years agomakefs: Provide a -T option to set timestamps to a consistent value
emaste [Tue, 14 Jun 2016 14:03:28 +0000 (14:03 +0000)]
makefs: Provide a -T option to set timestamps to a consistent value

This is taken from the NetBSD versions listed below and adapted to the
makefs version in FreeBSD, along with a bug fix from cem@ that will be
sent to NetBSD.

Reviewed by: pfg
Approved by: re (gjb)
Obtained from: NetBSD
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D6835

8 years ago[mips] Tidy up setting/clearing the hardfloat flag.
adrian [Tue, 14 Jun 2016 06:21:51 +0000 (06:21 +0000)]
[mips] Tidy up setting/clearing the hardfloat flag.

Submitted by: kan
Approved by: re (delphij)

8 years agoAdd a missing error check for a malloc() call in idr_get().
markj [Tue, 14 Jun 2016 03:57:00 +0000 (03:57 +0000)]
Add a missing error check for a malloc() call in idr_get().

Submitted by: Matt Joras <mjoras@isilon.com>
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd myself (mahrens) to calendar.freebsd
mahrens [Mon, 13 Jun 2016 23:36:15 +0000 (23:36 +0000)]
Add myself (mahrens) to calendar.freebsd

Approved by: mckusick
Approved by: re (gjb)

8 years agoRemove the SIOCSIFALIFETIME_IN6 ioctl.
pfg [Mon, 13 Jun 2016 22:31:16 +0000 (22:31 +0000)]
Remove the SIOCSIFALIFETIME_IN6 ioctl.

The SIOCSIFALIFETIME_IN6 provided by the kame project is unused,
it can't really be used safely and has been completely removed from
NetBSD and OpenBSD.

Obtained from: NetBSD (kern/35897)
PR: 210148 (exp-run)
Reviewed by: ae, hrs
Relnotes: yes
Approved by: re (glebius)
Differential Revision: https://reviews.freebsd.org/D5491

8 years agoFix usr.sbin/extattr testcases on tmpfs
asomers [Mon, 13 Jun 2016 22:00:44 +0000 (22:00 +0000)]
Fix usr.sbin/extattr testcases on tmpfs

Skip the usr.sbin/extattr testscases if $TMPDIR is tmpfs, which doesn't
support extended attributes

PR: 210184
Reported by: ngie
Reviewed by: ngie
Approved by: re (glebius)
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D6802
Sponsored by: Spectra Logic Corp

8 years agol2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr
avg [Mon, 13 Jun 2016 18:39:13 +0000 (18:39 +0000)]
l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr

The change is in arc_buf_l2_cdata_free().
Without this we can trip the assertion in arc_hdr_realloc()
if INVARIANTS option is enabled.

Approved by: re (kib)
MFC after: 1 week

8 years agoDo not define __NO_STRICT_ALIGNMENT for armv6. While the requirements
ian [Mon, 13 Jun 2016 16:48:27 +0000 (16:48 +0000)]
Do not define __NO_STRICT_ALIGNMENT for armv6.  While the requirements
are no longer natural-alignment strict, there are still some restrictions.

FreeBSD network code assumes data is naturally-aligned or is running
on a platform with no restrictions; pointers are not annotated to
indicate the data pointed to may be packed or unaligned.  The clang
optimizer can sometimes combine the load or store of a pair of adjacent
32-bit values into a single doubleword load/store, and that operation
requires at least 4-byte alignment.  __NO_STRICT_ALIGNMENT can lead
to tcp headers being only 2-byte aligned.

Note that alignment faults remain disabled on armv6, this change reverts
only the defining of the symbol which leads to some overly-agressive code
shortcuts when building common/shared drivers and network code for arm.

Approved by: re(kib)

8 years agoAdd missing break in lock_partialfilelock(..) with NFS_RESERR
ngie [Mon, 13 Jun 2016 11:19:06 +0000 (11:19 +0000)]
Add missing break in lock_partialfilelock(..) with NFS_RESERR

This will help ensure that the right error is trickled up when the
function is called if the lock status is NFS_RESERR

Differential Revision: https://reviews.freebsd.org/D6622
Reviewed by: rmacklem
Approved by: re (gjb)
Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php
MFC after: 2 weeks
Reported by: Coverity
CID: 10081611304956
Sponsored by: EMC / Isilon Storage Division

8 years agozfs_vptocnp: check for an invalid znode
avg [Mon, 13 Jun 2016 10:53:34 +0000 (10:53 +0000)]
zfs_vptocnp: check for an invalid znode

... which can arise after the receive or rollback
and failed zfs_rezget().

Approved by: re (kib)
MFC after: 1 week

8 years agoChange my given name from "Garrett" to "Ngie"
ngie [Mon, 13 Jun 2016 10:35:11 +0000 (10:35 +0000)]
Change my given name from "Garrett" to "Ngie"

A legal name change from "Garrett" to "Ngie", as well as a FreeBSD
account name change, is pending.

Approved by: re (hrs)

8 years agoImplement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating
rwatson [Mon, 13 Jun 2016 09:22:20 +0000 (09:22 +0000)]
Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating
console warnings when pread(2) and pwrite(2) are used with full
system-call auditing enabled.  We audit the same file-descriptor data
for these calls as we do read(2) and write(2).

Approved by: re (kib)
MFC after: 3 days
Sponsored by: DARPA, AFRL

8 years agoDo not access pv_table array for fictitious pages, since the array
kib [Mon, 13 Jun 2016 03:45:08 +0000 (03:45 +0000)]
Do not access pv_table array for fictitious pages, since the array
does not cover the dynamically registered ficititious ranges, and
fictitious pages mappings are not promoted.  Offer a dummy struct
md_page to fetch constant superpage pv list generation to satisfy
logic.  Also, by initializing the pv_dummy pv_list to empty, we can
remove several explicit PG_FICTITIOUS tests.

Reported and tested by: Michael Butler <imb@protected-networks.net>
(previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D6728
Approved by: re (hrs)

8 years agoFix inconsistent locking of the swap pager named objects list.
kib [Mon, 13 Jun 2016 03:42:46 +0000 (03:42 +0000)]
Fix inconsistent locking of the swap pager named objects list.

Right now, all modifications of the list are locked by sw_alloc_mtx.
But initial lookup of the object by the handle in swap_pager_alloc()
is not protected by sw_alloc_mtx, which means that
vm_pager_object_lookup() could follow freed pointer.

Create a new named swap object with the OBJT_SWAP type, instead
of OBJT_DEFAULT.  With this change, swp_pager_meta_build() never need
to upgrade named OBJT_DEFAULT to OBJT_SWAP (in the other place, we do
not forbid for client code to create named OBJT_DEFAULT objects at
all).

That change allows to remove sw_alloc_mtx and make the list locked by
sw_alloc_sx lock.  Update swap_pager_copy() to new locking mode.

Create helper swap_pager_alloc_init() to consolidate named and
anonymous swap objects creation, while a caller ensures that the
neccesary locks are held around the helper.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (hrs)

8 years agoExplicitely initialize sw_alloc_sx. Currently it is not initialized
kib [Mon, 13 Jun 2016 03:39:16 +0000 (03:39 +0000)]
Explicitely initialize sw_alloc_sx.  Currently it is not initialized
but works due to zeroed out bss on startup.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

8 years ago[mips] set hardfloat for fpu instruction generation for gcc/binutils 5.x
adrian [Mon, 13 Jun 2016 03:17:00 +0000 (03:17 +0000)]
[mips] set hardfloat for fpu instruction generation for gcc/binutils 5.x

This allows -HEAD to be compiled again using the gcc-5 mips port compiler.

Reviewed by: imp
Approved by: re@

8 years agoFix compile warning.
hselasky [Mon, 13 Jun 2016 01:33:02 +0000 (01:33 +0000)]
Fix compile warning.

Approved by: re (delphij)
MFC after: 1 week

8 years ago[iwm] Fix up busdma use in the RX path
adrian [Mon, 13 Jun 2016 00:13:20 +0000 (00:13 +0000)]
[iwm] Fix up busdma use in the RX path

When allocating a new mbuf or bus_dmamap_load()-ing it fails,
we can just keep the old mbuf since we are dropping that packet anyway.
Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time,
create an extra bus_dmamap_t which we can use to safely try
bus_dmamap_load()-ing the new mbuf. On success we just swap the spare
bus_dmamap_t with the data->map of that ring entry.

Tested:

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Submitted by: Imre Vadasz <imre@vdsz.com>
Approved by: re@
Obtained from: DragonflyBSD.git cc440b26818b5dfdd9af504d71c1b0e6522b53ef
Differential Revision: https://reviews.freebsd.org/D6742

8 years agoDon't close fd if it's lower then stderr, otherwise we can close
oshogbo [Mon, 13 Jun 2016 00:03:55 +0000 (00:03 +0000)]
Don't close fd if it's lower then stderr, otherwise we can close
one of the descriptor which we just set.

Pointed out by: jilles
Approved by: re (hrs)

8 years agoAdd ipfilter support to blacklistd-helper
lidl [Sun, 12 Jun 2016 23:34:48 +0000 (23:34 +0000)]
Add ipfilter support to blacklistd-helper

In addition to adding initial support for the ipfilter
packet filtering system, wrap a few long lines, perform
whitespace cleanup and sync with upstream changes made
in NetBSD.

Submitted by: cy
Reviewed by: cy
Approved by: re (hrs)
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6823

8 years agoImplement code to stop all USB endpoints before executing a USB device
hselasky [Sun, 12 Jun 2016 23:26:38 +0000 (23:26 +0000)]
Implement code to stop all USB endpoints before executing a USB device
reset command, alternate setting command or set configuration
command. Else LibUSB v1.0 will not re-open the endpoints which the
kernel closes and the USB application might wait infinitely for
transfers to complete.

Approved by: re (hrs)
MFC after: 3 days

8 years agoFix an issue with multicast hash filters on Amlogic and Allwinner boards.
jmcneill [Sun, 12 Jun 2016 22:55:50 +0000 (22:55 +0000)]
Fix an issue with multicast hash filters on Amlogic and Allwinner boards.

For DWC_GMAC_ALT_DESC implementations, the multicast hash table has only
64 entries. Instead of 8 registers starting at 0x500, a pair of registers
at 0x08 and 0x0c are used instead.

Approved by: re (hrs)
Submitted by: Guy Yur <guyyur@gmail.com>

8 years agoswap_dev_info() does not require Giant, so Giant locking around
kib [Sun, 12 Jun 2016 11:13:38 +0000 (11:13 +0000)]
swap_dev_info() does not require Giant, so Giant locking around
the loop in linprocfs_doswaps() is useless.
List of the registered filesystems is protected by vfsconf_sx,
not by the Giant.  Adjust linprocfs_dofilesystems() correspondingly.

Approved by: re (delphij), des (linprocfs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoUpdate 11.0 to ALPHA3 in preparation for new snapshot builds.
gjb [Fri, 10 Jun 2016 19:29:55 +0000 (19:29 +0000)]
Update 11.0 to ALPHA3 in preparation for new snapshot builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoChange the default build behavior so we don't compile extra TCP modules by
jtl [Fri, 10 Jun 2016 19:06:11 +0000 (19:06 +0000)]
Change the default build behavior so we don't compile extra TCP modules by
default. At least initially, the feature to support multiple TCP stacks is
aimed at supporting advanced use cases and TCP development, but it is not
necessarily aimed at a wide audience. Therefore, there is no need to build
and install the extra TCP stacks by default. Instead, the people who are
using or developing this functionality can add the extra option to build/
install the extra TCP stacks.

However, we do want to build the extra TCP stacks as part of test builds
(e.g. LINT or tinderbox) to ensure that developers who are testing their
changes will know that their changes do not break the additional TCP
stack modules.

After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to
make.conf or the kernel config in order to build the extra TCP modules.

Differential Revision: https://reviews.freebsd.org/D6795
Reviewed by: sjg
Approved by: re (kib)

8 years agoDeobfuscate cleanup path in clnt_bck_create(..)
ngie [Fri, 10 Jun 2016 17:53:28 +0000 (17:53 +0000)]
Deobfuscate cleanup path in clnt_bck_create(..)

Similar to r300836, cl and ct will always be non-NULL as they're allocated
using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`.

Deobfuscating the cleanup path fixes a leak where if cl was NULL and
ct was not, ct would not be free'd, and also removes a duplicate test for
cl not being NULL.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6801
MFC after: 1 week
Reported by: Coverity
CID: 1229999
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoRelnotes entries for blacklist project
lidl [Fri, 10 Jun 2016 15:05:35 +0000 (15:05 +0000)]
Relnotes entries for blacklist project

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

8 years agoFix a miss merge in the services_mkdb(8) man page
allanjude [Fri, 10 Jun 2016 14:59:11 +0000 (14:59 +0000)]
Fix a miss merge in the services_mkdb(8) man page

Restore the cross reference to getservent(3) to the correct line

Approved by: re (gjb)
Sponsored by: BSDCan Hacker Lounge

8 years agoFix bsdinstall for root-on-zfs with MBR partitioning
allanjude [Fri, 10 Jun 2016 14:31:59 +0000 (14:31 +0000)]
Fix bsdinstall for root-on-zfs with MBR partitioning

Fix an error where vfs.root.mountfrom was not always set as required
when creating a bootpool. After the recent geliboot changes, it was only
set if the main pool was encrypted.

Also resolve an error where the bootpool was unmounted twice causing
bsdinstall to stop with an error message about the failed command.

Approved by: re (gjb)
Sponsored by: BSDCan Hacker Lounge

8 years ago- Add myself (tz / Torsten Zuehlsdorff) to ports commiters
tz [Fri, 10 Jun 2016 08:33:15 +0000 (08:33 +0000)]
- Add myself (tz / Torsten Zuehlsdorff) to ports commiters
- Add mentors junovitch, pi, swills

Approved by: re (gjb), junovitch (mentor)

8 years agoCommit the bits of nda that were missed. This should fix the build.
imp [Fri, 10 Jun 2016 06:04:53 +0000 (06:04 +0000)]
Commit the bits of nda that were missed. This should fix the build.

Approved by: re@

8 years agoFix regression from r301461.
pfg [Fri, 10 Jun 2016 05:21:52 +0000 (05:21 +0000)]
Fix regression from r301461.

The fix to the __collate_range_cmp() ABI breakage missed some replacements
in libc's vfscanf().  Replace them with __wcollate_range_cmp() which
does what is expected.

This was breaking applications like xterm and pidgin when using wide
characters.

Reported by: Vitalij Satanivskij
Approved by: re