]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMerge ^/head r323559 through r325504.
hselasky [Tue, 7 Nov 2017 08:39:14 +0000 (08:39 +0000)]
Merge ^/head r323559 through r325504.

6 years agoRedo r325502
ngie [Tue, 7 Nov 2017 06:26:48 +0000 (06:26 +0000)]
Redo r325502

:U:Mfoo expands to :Mfoo, apparently. Explicit check for CPUTYPE being
defined, and test for it's value not containing *soft* before calling CRTARCH
armhf.

Tested, somewhat. Unfortunately recent changes appear to have affected
cross-builds where it no longer works, per my tests after universe12a being
upgraded from 07/2017 to 11/2017 sources (DESTDIR isn't being used in WORLDTMP;
MK_SYSTEM_COMPILER might be causing issues right now).

MFC after: 1 week
MFC with: r325502
Reported by: imp

6 years agoHandle arm/armv[67] hosted/targeted builds gracefully
ngie [Tue, 7 Nov 2017 05:02:36 +0000 (05:02 +0000)]
Handle arm/armv[67] hosted/targeted builds gracefully

CPUTYPE (apparently) isn't defined in non-cross-builds, which caused
arm/armv[67] hosted/targeted builds to fail when evaluating CPUTYPE.

Add the :U modifier to CPUTYPE so it evaluates to "". This allows armv[67] to
get past the conditional successfully.

MFC after: 1 week
Reported by: bob prohaska <fbsd@www.zefox.net>

6 years agoRemove unnecessary src.opts.mk .include
ngie [Tue, 7 Nov 2017 04:56:53 +0000 (04:56 +0000)]
Remove unnecessary src.opts.mk .include

MK_<FOO> isn't used in lib/libcompiler_rt/Makefile at all. Remove it to reduce
namespace pollution.

MFC after: 1 week

6 years agoUse bsd.compiler.mk instead of src.opts.mk
ngie [Tue, 7 Nov 2017 04:55:23 +0000 (04:55 +0000)]
Use bsd.compiler.mk instead of src.opts.mk

- MK_PROFILE is controlled in bsd.opts.mk, which is pulled in via bsd.own.mk,
  which is pulled in via bsd.init.mk . All upstream Makefiles which build off
  of this one use bsd.init.mk.
- COMPILER_{TYPE,VERSION} is set via bsd.compiler.mk .

This reduces the namespace pollution/complexity somewhat.

MFC after: 1 week

6 years agoFix NOINET/NOINET6 build during compilation of iflib.
sbruno [Mon, 6 Nov 2017 19:54:25 +0000 (19:54 +0000)]
Fix NOINET/NOINET6 build during compilation of iflib.

Reported by: kib

6 years agoReapply r295227: Stop hiding link install commands.
bdrewery [Mon, 6 Nov 2017 19:33:50 +0000 (19:33 +0000)]
Reapply r295227: Stop hiding link install commands.

This was lost in the release-pkg merge in r298107.

Sponsored by: Dell EMC Isilon

6 years agoFix ixgbe(4) support for ifconfig's vlanhwtag flag. Disabling this flag
sbruno [Mon, 6 Nov 2017 18:08:59 +0000 (18:08 +0000)]
Fix ixgbe(4) support for ifconfig's vlanhwtag flag.  Disabling this flag
will now prevent the driver from stripping vlan tags from packets.

PR: 219390
Submitted by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reported by: Charles Goncalves <halfling@halfling.com.br>
Obtained from: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D12795

6 years agoSpecify WITH_UNIFIED_OBJDIR in chroot_arm_build_release() to
gjb [Mon, 6 Nov 2017 17:59:04 +0000 (17:59 +0000)]
Specify WITH_UNIFIED_OBJDIR in chroot_arm_build_release() to
ensure the output image is created in the correct .OBJDIR.

Sponsored by: The FreeBSD Foundation

6 years agobnxt: Add support for new phy_types and speeds - Part #2
shurd [Mon, 6 Nov 2017 16:41:29 +0000 (16:41 +0000)]
bnxt: Add support for new phy_types and speeds - Part #2

Use our ifm_list of supported media types rather than nested switch
statements to find the current media type.  Find a supported type that
matches the current speed.

Remove all workarounds while updating ifmr->ifm_active.

For BNXT_IFMEDIA_ADD, added Three more speeds IFM_10G_T, IFM_2500_T & IFM_2500_KX.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12896

6 years agoOnly chain non-LRO mbufs when LRO is not possible
shurd [Mon, 6 Nov 2017 16:23:21 +0000 (16:23 +0000)]
Only chain non-LRO mbufs when LRO is not possible

Preserve packet order between tcp_lro_rx() and if_input() to avoid
creating extra corner cases. If no packets can be LROed, combine them
into one chain for submission via if_input(). If any packet can
potentially be LROed however, retain old behaviour and call if_input()
for each packet.

This should keep the 12% improvement for small packet forwarding intact,
but mostly avoids impacting the LRO case.

Reviewed by: cem, sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12876

6 years agoAdd an UPDATING entry for the posix_fallocate/ZFS change, r325320
avg [Mon, 6 Nov 2017 15:29:33 +0000 (15:29 +0000)]
Add an UPDATING entry for the posix_fallocate/ZFS change, r325320

6 years agoCentralize all 32-bit builds on 64-bit platform stuff.
imp [Mon, 6 Nov 2017 15:22:24 +0000 (15:22 +0000)]
Centralize all 32-bit builds on 64-bit platform stuff.

Move the addition of the -m32 and other flags to defs.mk. Remove
redunant copies of -m32 that come from multiple locations.

Sponsored by: Netflix

6 years agoPrefer bsd.init.mk to src.opts.mk
imp [Mon, 6 Nov 2017 15:22:17 +0000 (15:22 +0000)]
Prefer bsd.init.mk to src.opts.mk

Final sweep to prefer bsd.init.mk to src.opts.mk everywhere as a
design pattern.  The rule is that all Makefiles in this subtree should
start with .include <bsd.init.mk> so that we properly include
../Makefile.inc and defs.mk before anything else.

Sponsored by: Netflix

6 years agoMACHINE can never be powerpc64, so cleanup code that thinks it can.
imp [Mon, 6 Nov 2017 15:22:11 +0000 (15:22 +0000)]
MACHINE can never be powerpc64, so cleanup code that thinks it can.

Sponsored by: Netflix

6 years agoMove machine and other link creation to defs.mk
imp [Mon, 6 Nov 2017 15:22:04 +0000 (15:22 +0000)]
Move machine and other link creation to defs.mk

Steal the code from kmod.mk and use it to automatically create
links. Modify it a little for the needs of the loader (no need to
guess the OBJS dependency, and we have 32-on-64 cases to contend
with). Remove 15 redundant implementations (which were mostly
different, but kinda the same).

A future commit should factor out this code and that of kmod.mk so we
have only one copy of it in the tree.

Sposnored by: Netflix

6 years agoPrefer bsd.init.mk to other constructs.
imp [Mon, 6 Nov 2017 15:21:56 +0000 (15:21 +0000)]
Prefer bsd.init.mk to other constructs.

Sponsored by: Netflix

6 years agoUse DO32 for all the places that we need to flag we're building a 32
imp [Mon, 6 Nov 2017 15:21:51 +0000 (15:21 +0000)]
Use DO32 for all the places that we need to flag we're building a 32
bit version of a library. Use a generic name since this may be usefule
elsewhere.

Sponsored by: Netflix

6 years agoDefine LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64.
imp [Mon, 6 Nov 2017 15:21:45 +0000 (15:21 +0000)]
Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64.

Sponsored by: Netflix

6 years agoPowerpc is a 32-bit boot loader.
imp [Mon, 6 Nov 2017 15:21:39 +0000 (15:21 +0000)]
Powerpc is a 32-bit boot loader.

Stop building libsa32 on powerpc. Build everything on powerpc64
-m32. Transition to using LIBSA from LIBSA32. This elimiantes the
useless build of libsa on powerpc64 (nothing used to use it) and
should be a more direct way of saying this.

Sponsored by: Netflix

6 years agorwlock: fix up compilation without KDTRACE_HOOKS after r324787
mjg [Mon, 6 Nov 2017 05:14:05 +0000 (05:14 +0000)]
rwlock: fix up compilation without KDTRACE_HOOKS after r324787

6 years agoSet the PRD extension list base address in little endian
jhibbits [Mon, 6 Nov 2017 05:09:18 +0000 (05:09 +0000)]
Set the PRD extension list base address in little endian

All data accesses with the SATA controller are little endian.  This was
missed when writing the extension code.

6 years agonamecache: bump numcache after dropping all locks
mjg [Sun, 5 Nov 2017 22:29:45 +0000 (22:29 +0000)]
namecache: bump numcache after dropping all locks

This makes no difference correctness-wise, but shortens total hold time.

6 years agoRework r325076: Just use the pre-existing OBJDIR.
bdrewery [Sun, 5 Nov 2017 22:29:34 +0000 (22:29 +0000)]
Rework r325076: Just use the pre-existing OBJDIR.

Like was done in usr.sbin/mergemaster in r249906, we can just use
the already-built OBJDIR for install(1).

Sponsored by: Dell EMC Isilon

6 years agonamecache: wlock buckets in cache_lookup_nomakeentry
mjg [Sun, 5 Nov 2017 22:28:39 +0000 (22:28 +0000)]
namecache: wlock buckets in cache_lookup_nomakeentry

Since the case of an empty chain was already covered, it si very likely
that the existing entry is matching. Skipping readlocking saves on lock
upgrade.

6 years agoFix an off-by-one error missed in the initial commit of this driver
jhibbits [Sun, 5 Nov 2017 22:09:59 +0000 (22:09 +0000)]
Fix an off-by-one error missed in the initial commit of this driver

When the segment count is > 16 it spills into an 'indirect descriptor list',
which immediately follows the main table, but the indirect list is entry 15, so
needs to be skipped for the general list.

6 years agoRemove badsect(8).
kib [Sun, 5 Nov 2017 22:00:54 +0000 (22:00 +0000)]
Remove badsect(8).

Failure modes of the modern (that is, produced in the last 25 years)
hard drives and SSDs made the utility outdated.  Since the kernel
interface to support it was removed in r324853, cut the userspace
remnants as well.

Discussed with: bde (who does not like the removal)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agonamecache: skip locking in cache_lookup_nomakeentry if there is no entry
mjg [Sun, 5 Nov 2017 21:59:39 +0000 (21:59 +0000)]
namecache: skip locking in cache_lookup_nomakeentry if there is no entry

6 years agoFix cosmetic nit when printing out "override $mode" and "$owner/$group ..."
ngie [Sun, 5 Nov 2017 21:43:26 +0000 (21:43 +0000)]
Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..."

The wrong index was being checked for == ' ' in the resulting stringified
mode from strmode(3) -- it should have been the 11th value, not the 10th.

MFC after: 3 days
PR: 76711
Submitted by: Vasil Dimov <vd@datamax.bg>

6 years agoChoose a simpler, more philosophically correct version for CRTARCH with armv[67]
ngie [Sun, 5 Nov 2017 20:38:40 +0000 (20:38 +0000)]
Choose a simpler, more philosophically correct version for CRTARCH with armv[67]

This is a rework of r325443.

PR: 222925
Tested with: make buildenv with appropriate TARGET/TARGET_ARCH pairs

6 years agoZero the structure instead of the pointer to it.
kib [Sun, 5 Nov 2017 20:03:57 +0000 (20:03 +0000)]
Zero the structure instead of the pointer to it.

Reported by: Don Morris <Don.Morris@dell.com>
MFC after: 4 days

6 years agoRevert r325443
ngie [Sun, 5 Nov 2017 20:01:00 +0000 (20:01 +0000)]
Revert r325443

Despite the fact that it's a working solution, it doesn't follow the design
philosophy of only doing TARGET_* in Makefile.inc1 and special locations in
the source tree.

PR: 222925
Requested by: imp

6 years agoANSIfy sys/kern/md4c.c
emaste [Sun, 5 Nov 2017 19:49:44 +0000 (19:49 +0000)]
ANSIfy sys/kern/md4c.c

PR: 223453
Submitted by: ota@j.email.ne.jp
MFC After: 2 weeks

6 years agoFix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants
ngie [Sun, 5 Nov 2017 19:38:51 +0000 (19:38 +0000)]
Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants

- Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH

  When cross-compiling, the wrong architecture was being embedded in the
  libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not
  MACHINE_ARCH (host).

  If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH.

- Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67]

  TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which
  affects the clang lookup path per `getArchNameForCompilerRTLib(..)` in
  contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and
  Linux's assumed naming convention for hard-float arm architectures.

  CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the
  TARGET*-relevant values when building the `libraries` target, so test
  those variables instead.

- Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. This
  impacts only arm/armv6 and arm/armv7.

PR: 222925

6 years agoSupport compiling lib/libclang_rt/profile a bit more with recent versions of gcc
ngie [Sun, 5 Nov 2017 19:25:06 +0000 (19:25 +0000)]
Support compiling lib/libclang_rt/profile a bit more with recent versions of gcc

Several of the flags were being treated as CFLAGS, when they were actually
technically CXXFLAGS. Move them there.

Only apply -fno-sanitize=safe-stack with clang.

PR:             223179

6 years agoExtend the synopsis section of md(4) to look more like other manpages
bcr [Sun, 5 Nov 2017 18:45:43 +0000 (18:45 +0000)]
Extend the synopsis section of md(4) to look more like other manpages
of this kind.  Describe how to compile the driver into the kernel
and how to load it as a module.
This is useful for people using the MINIMAL kernel configuration file.

PR: 218610
Submitted by: Harald Schmalzbauer (bugzilla.freebsd@omnilan.de)
Reviewed by: noone (1 month inactivity)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12271

6 years agoThe last example used LOG_INFO, but the message itself said error.
bcr [Sun, 5 Nov 2017 18:24:31 +0000 (18:24 +0000)]
The last example used LOG_INFO, but the message itself said error.
Change to LOG_ERR to be less confusing.

PR: 216756
Submitted by: Thomas Cort (linuxgeek@gmail.com)
Reviewed by: noone (after 2 months)
Differential Revision: https://reviews.freebsd.org/D11824

6 years agoRemove support for ARMv6/v7 platform from elf_trampoline.
mmel [Sun, 5 Nov 2017 17:14:44 +0000 (17:14 +0000)]
Remove support for ARMv6/v7 platform from elf_trampoline.

The elf_trampoline.c is not connected to build for ARMv6/v7 for long time and
it uses outdated low level cpu functions.
This blocks forthcoming cleanup of ARM code.

MFC after: 3 weeks

6 years agoAll CP15 registers are bit fields or counters, don't use signed type
mmel [Sun, 5 Nov 2017 16:52:54 +0000 (16:52 +0000)]
All CP15 registers are bit fields or counters, don't use signed type
when accessing them.

MFC after: 3 weeks

6 years agoFollow-up r325405: Fix assertion still for kernel module builds.
bdrewery [Sun, 5 Nov 2017 16:28:05 +0000 (16:28 +0000)]
Follow-up r325405: Fix assertion still for kernel module builds.

Apparently they have SRCTOP set, but won't have RELDIR set since they are
not in-tree.

Pointyhat to: bdrewery
Reported by: O. Hartmann <ohartmann@walstatt.org>, dhw
Tested by: dhw
Sponsored by: Dell EMC Isilon

6 years agoAllow a process to assign an IP address to local ppp interface
eugen [Sun, 5 Nov 2017 14:41:48 +0000 (14:41 +0000)]
Allow a process to assign an IP address to local ppp interface
even if kernel routing table already has a route to the address in question
installed by some routing daemon (PR 223129).

Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

PR: 222647, 223129
Reviewed by: gnn
Approved by: avg (mentor), mav (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12747

6 years agoImprove the message printed when the cylinder group checksum is wrong.
kib [Sun, 5 Nov 2017 13:28:48 +0000 (13:28 +0000)]
Improve the message printed when the cylinder group checksum is wrong.

Mention the device path and mount point path, handle snapshots.

Tested by: imp
Sponsored by: The FreeBSD Foundation

6 years agoFix an accounting bug where data was counted twice if on the read
tuexen [Sun, 5 Nov 2017 11:59:33 +0000 (11:59 +0000)]
Fix an accounting bug where data was counted twice if on the read
queue and on the ordered or unordered queue.
While there, improve the checking in INVARIANTs when computing the
a_rwnd.

MFC after: 3 days

6 years agonamecache: skip locking in cache_purge_negative if there are no entries
mjg [Sun, 5 Nov 2017 08:31:25 +0000 (08:31 +0000)]
namecache: skip locking in cache_purge_negative if there are no entries

6 years agoAs a follow-on to r325378, make the shutdown timer default to 0 as well.
peter [Sun, 5 Nov 2017 05:05:18 +0000 (05:05 +0000)]
As a follow-on to r325378, make the shutdown timer default to 0 as well.

Otherwise an orderly shutdown will initiate a watchdog that will cause
a 7 minute delayed reboot *by default*,  In the freebsd.org cluster's case
this often worked out be a surprise reboot a minute or two after the
machine came back up.

6 years agoposix_fallocate.2: add an EINVAL errno case
emaste [Sun, 5 Nov 2017 03:02:19 +0000 (03:02 +0000)]
posix_fallocate.2: add an EINVAL errno case

As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that
the underlying filesystem does not support this operation, per
POSIX.1-2008. Document this case in the man page.

MFC after: 20 days
MFC with: r325320
Sponsored by: The FreeBSD Foundation

6 years agoAdd Freescale QorIQ SATA controller support.
jhibbits [Sun, 5 Nov 2017 02:47:46 +0000 (02:47 +0000)]
Add Freescale QorIQ SATA controller support.

The Freescale SATA controller has many similarities to AHCI controllers, so
this driver is a heavily modified AHCI driver.  Currently it seems to only
do SATA 1.0 speeds (~100-150MB/s), so there is still room for improvement.

Still to be done:
* Address erratum SATA-A-006187 -- Spread Spectrum Support (intermittent
  non-recoverable transient data integrity error seen when SSC enabled).
* Linux doesn't read the log page as it hangs on the P1022.  See if that's
  applicable to this, and address accordingly.
* Try to determine what's holding back performance, and address it.

MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D6071

6 years agolld: accept EINVAL to indicate posix_fallocate is unsupported
emaste [Sun, 5 Nov 2017 00:51:53 +0000 (00:51 +0000)]
lld: accept EINVAL to indicate posix_fallocate is unsupported

As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to
indicate that the operation is not supported. (I think this is a strange
choice of errno on the part of POSIX.)

PR: 223383, 223440
Reported by: Mark Millard
Tested by: Mark Millard
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoAvoid trying to remove a fullpath directory in CLEANDIRS.
bdrewery [Sun, 5 Nov 2017 00:26:28 +0000 (00:26 +0000)]
Avoid trying to remove a fullpath directory in CLEANDIRS.

Let CLEANDIRS work relative since make is already in .OBJDIR.

MFC after: 2 weeks
X-MFC-With: r322511
Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: Allow 'make cleandir obj all' combinations.
bdrewery [Sun, 5 Nov 2017 00:12:12 +0000 (00:12 +0000)]
AUTO_OBJ: Allow 'make cleandir obj all' combinations.

The cleanobj target will not really remove the OBJDIR in this case,
it will only remove the OBJDIR if only clean targets are ran.

Sponsored by: Dell EMC Isilon

6 years agoSet the expected __objdir for auto.obj.mk to try.
bdrewery [Sun, 5 Nov 2017 00:12:09 +0000 (00:12 +0000)]
Set the expected __objdir for auto.obj.mk to try.

This avoids some future discrepency that might cause auto.obj.mk to use the
wrong OBJDIR.

Sponsored by: Dell EMC Isilon

6 years agoAlways try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .CURDIR.
bdrewery [Sun, 5 Nov 2017 00:12:05 +0000 (00:12 +0000)]
Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .CURDIR.

When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.mk
check added in r325404.  However, it is possible that new code is added
at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_OBJ.
That could leave make with a bogus and unsafe .OBJDIR in some cases.

Sponsored by: Dell EMC Isilon

6 years agoValidate MAKEOBJDIR after the MAKEOBJDIRPREFIX override.
bdrewery [Sun, 5 Nov 2017 00:12:02 +0000 (00:12 +0000)]
Validate MAKEOBJDIR after the MAKEOBJDIRPREFIX override.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.
bdrewery [Sun, 5 Nov 2017 00:11:58 +0000 (00:11 +0000)]
AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.

auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of
it.  In that case we can't avoid creating the OBJDIR but we do need to avoid
using it.  Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk
files to have a proper .OBJDIR.  It does not fix the Makefile itself but
usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow.

It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk,
but then bsd.obj.mk would need to include bsd.init.mk.  Doing something like
that would require more testing.  It has been proposed that bsd.obj.mk not be
included directly but it has been possible for too long to do so to change it
at this point.

Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not
enabled but the historical behavior has always been that NO_OBJ just avoids
running 'make obj', so .OBJDIR should already be .CURDIR.

Also while NO_OBJ seems like it should be removed at this point, it is not
always possible to fix Makefiles to properly use an .OBJDIR.  The cost of
keeping NO_OBJ support is minimal.

Sponsored by: Dell EMC Isilon

6 years agoSimplify location of bootstrap make.
bdrewery [Sun, 5 Nov 2017 00:11:55 +0000 (00:11 +0000)]
Simplify location of bootstrap make.

Sponsored by: Dell EMC Isilon

6 years agoFix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.
bdrewery [Sun, 5 Nov 2017 00:11:51 +0000 (00:11 +0000)]
Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets.

This problem was caused by r325329 and r325350.

For the release(7) targets, some will run mm-mtree.sh which itself runs make
with a MAKEOBJDIRPREFIX.  The execution of that script leaks OBJROOT,
MAKEOBJDIR, and MAKELEVEL=1 in the environment.  This causes the mm-mtree makes
to not do some basic setup of OBJROOT and only use this special
MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further
nested makes, such as a tree walk.  If that tree walk sets OBJROOT/OBJTOP such
as r325329 is doing, then the wrong OBJDIRs end up being used due to the
unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon

6 years agoSet OBJROOT/OBJTOP as make arguments. Missed in r325329.
bdrewery [Sun, 5 Nov 2017 00:11:47 +0000 (00:11 +0000)]
Set OBJROOT/OBJTOP as make arguments.  Missed in r325329.

Sponsored by: Dell EMC Isilon

6 years agoIncrease TX_MAX_SEGS from 10 to 20 for the if_awg.c driver
gonzo [Sat, 4 Nov 2017 23:28:02 +0000 (23:28 +0000)]
Increase TX_MAX_SEGS from 10 to 20 for the if_awg.c driver

Under certain traffic pattern awg driver does not recover from TX queue
full condition. The actual source of the problem is not identified yet
but jmcneill@ agreed that bumping TX_MAX_SEGS to 20 is OK as a workaround
for the problem (NetBSD has it set to 128).

Also add some diagnostic printfs to prevent silent failure of bus_dma
functions in the future

PR will be kept open until root cause of the issue is identified and fixed

PR: 219927
Submitted by: Tom Vijlbrief <tvijlbrief@gmail.com>
Approved by: jmcneill
MFC after: 2 weeks

6 years agoFollow-up r325405: Only enable assertion for in-tree src builds.
bdrewery [Sat, 4 Nov 2017 21:59:54 +0000 (21:59 +0000)]
Follow-up r325405: Only enable assertion for in-tree src builds.

Pointyhat to: bdrewery
Reported by: O. Hartmann <ohartmann@walstatt.org>
Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: Revert r325351 now that the fix is in auto.obj.mk in r325404.
bdrewery [Sat, 4 Nov 2017 21:06:39 +0000 (21:06 +0000)]
AUTO_OBJ: Revert r325351 now that the fix is in auto.obj.mk in r325404.

Forcing MK_AUTO_OBJ to no is not really needed since bsd.obj.mk is protected
against 'rm -rf ${.CURDIR}' already.  It was also flawed as if MK_AUTO_OBJ=yes
was in the .MAKEOVERRIDES already then it just remained on.

Sponsored by: Dell EMC Isilon

6 years agoAdd an assertion to avoid the 'rm -rf /etc' case from cleanobj fixed in r325404.
bdrewery [Sat, 4 Nov 2017 21:05:03 +0000 (21:05 +0000)]
Add an assertion to avoid the 'rm -rf /etc' case from cleanobj fixed in r325404.

Sponsored by: Dell EMC Isilon

6 years agoEnsure .OBJDIR has known value
sjg [Sat, 4 Nov 2017 21:02:26 +0000 (21:02 +0000)]
Ensure .OBJDIR has known value

If for any reason we cannot set .OBJDIR==_objdir as desired
use .CURDIR so that at least the classic
.if ${.OBJDIR} != ${.CURDIR}
works and dangerous misstakes can be avoided.

Reviewed by: bdrewery

6 years agoAdd missing MLINKS for disk_add_alias(9).
trasz [Sat, 4 Nov 2017 16:23:34 +0000 (16:23 +0000)]
Add missing MLINKS for disk_add_alias(9).

MFC after: 2 weeks

6 years agoMake autofs(5) rc scripts run earlier, matching those for amd(8).
trasz [Sat, 4 Nov 2017 15:52:16 +0000 (15:52 +0000)]
Make autofs(5) rc scripts run earlier, matching those for amd(8).

This helps when you have some daemons that need to access automounted shares.

PR: 221011
MFC after: 2 weeks

6 years agoThe src.opts.mk sets default value for the SHLIBDIR, so our set was not
oshogbo [Sat, 4 Nov 2017 15:50:05 +0000 (15:50 +0000)]
The src.opts.mk sets default value for the SHLIBDIR, so our set was not
respected.

Please notice that libcasper is already in ObsoleteFiles so we don't add it
again.

Reported by: Herbert J. Skuhra <herbert@mailbox.org>
Reviewed by: bdrewery@
Differential Revision: https://reviews.freebsd.org/D12918

6 years agoCasper work's only as shared library - disable building static ones.
oshogbo [Sat, 4 Nov 2017 15:47:18 +0000 (15:47 +0000)]
Casper work's only as shared library - disable building static ones.

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

6 years agoANSI-fy exec_shell_imgact().
pfg [Sat, 4 Nov 2017 15:41:08 +0000 (15:41 +0000)]
ANSI-fy exec_shell_imgact().

Fix a stray space while here.

PR: 223317
MFC after: 3 days

6 years agoAdd NIS automounter map, which supports rewriting of self-hosted locations
trasz [Sat, 4 Nov 2017 14:38:00 +0000 (14:38 +0000)]
Add NIS automounter map, which supports rewriting of self-hosted locations
to make them nullfs.

PR: 221010
Submitted by: G. Paul Ziemba
MFC after: 2 weeks

6 years agoUse proper naming in a debug message.
trasz [Sat, 4 Nov 2017 14:13:58 +0000 (14:13 +0000)]
Use proper naming in a debug message.

MFC after: 2 weeks

6 years agoC++17 requires quick_exit(3) to be async-signal safe.
kib [Sat, 4 Nov 2017 10:52:58 +0000 (10:52 +0000)]
C++17 requires quick_exit(3) to be async-signal safe.

Make it safe, and update man page with the useful information.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agox86: Do not emit unused TD_TID symbols.
kib [Sat, 4 Nov 2017 10:51:52 +0000 (10:51 +0000)]
x86: Do not emit unused TD_TID symbols.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoEliminate unused load.
kib [Sat, 4 Nov 2017 10:50:47 +0000 (10:50 +0000)]
Eliminate unused load.

Based on github pull request: #117
Submitted by: Wuyang-Chung@github
MFC after: 1 week

6 years agoConvert explicit panic() call to assert.
kib [Sat, 4 Nov 2017 10:49:34 +0000 (10:49 +0000)]
Convert explicit panic() call to assert.

Based on github pull request: #113
Submitted by: pmarillo@github
MFC after: 1 week

6 years agoAvoid calling get_controller_count() until attaching, this would avoid
delphij [Sat, 4 Nov 2017 06:19:46 +0000 (06:19 +0000)]
Avoid calling get_controller_count() until attaching, this would avoid
costly PCI config space operations that slows down systems without the
hardware.

Many thanks to HighPoint for continued support of FreeBSD!

Submitted by: Steve Chang
Reported by: cperciva
MFC after: 2 weeks

6 years agoCleanup stray libstand names to be libsa names.
imp [Sat, 4 Nov 2017 06:15:20 +0000 (06:15 +0000)]
Cleanup stray libstand names to be libsa names.

Sponsored by: Netflix

6 years agoRevert "WIP: centralize machine links"
imp [Sat, 4 Nov 2017 03:08:03 +0000 (03:08 +0000)]
Revert "WIP: centralize machine links"

This reverts commit accidentally pushed r325376

6 years agoRevert "mostly libsa"
imp [Sat, 4 Nov 2017 03:07:58 +0000 (03:07 +0000)]
Revert "mostly libsa"

This reverts accidentally pushed r325377.

6 years agoMake the startup timeout 0 seconds by default rathern than 420s. This
imp [Sat, 4 Nov 2017 03:01:58 +0000 (03:01 +0000)]
Make the startup timeout 0 seconds by default rathern than 420s.  This
makes the default fail safe when watchdogd is disabled (which is also
the default).

Sponsored by

6 years agomostly libsa
imp [Sat, 4 Nov 2017 03:01:52 +0000 (03:01 +0000)]
mostly libsa

6 years agoWIP: centralize machine links
imp [Sat, 4 Nov 2017 03:01:11 +0000 (03:01 +0000)]
WIP: centralize machine links

6 years agoStop passing -me500 to the assembler for Book-E kernels
jhibbits [Sat, 4 Nov 2017 00:47:21 +0000 (00:47 +0000)]
Stop passing -me500 to the assembler for Book-E kernels

We already pass -many to the assembler, and -me500 drops 64-bit instruction
handling, for some reason only breaking module building for 64-bit kernels.

Additionally, build with CTF for dtrace.

6 years agoFollow-up r318105: Don't use NO_OBJ at top-level, use NO_OBJWALK.
bdrewery [Fri, 3 Nov 2017 23:22:03 +0000 (23:22 +0000)]
Follow-up r318105: Don't use NO_OBJ at top-level, use NO_OBJWALK.

NO_OBJ has a very specific meaning in sub-directories in that no object
directory will be made.  If a user wanted to skip the 'make obj' phase then
passing -DNO_OBJ would break all sub-directories from building properly.  Using
NO_OBJ internally also causes issue with NO_OBJ handling being added in
share/mk/bsd.init.mk soon.

Sponsored by: Dell EMC Isilon

6 years agorelease/arm: Do not install ubldr
manu [Fri, 3 Nov 2017 23:02:57 +0000 (23:02 +0000)]
release/arm: Do not install ubldr

ubldr is the non-pie version of ubldr.bin, do not install two
copies of the same binary. This will allow us to remove ubldr
in the future.
All the u-boot ports know how to load ubldr.bin

Reviewed by: gjb (earlier version)

6 years agoAdd the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the
ken [Fri, 3 Nov 2017 21:04:22 +0000 (21:04 +0000)]
Add the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the
mt(1) man page.

LTO-8 Type M (also known as M8) is a pristine LTO-7 cartridge
formatted in a LTO-8 drive in a new, higher density format.  It
has a separate density code, and is only readable in an LTO-8
drive.

lib/libmt/mtlib.c:
Add the LTO-8 Type M density code to the density table
in libmt.

usr.bin/mt/mt.1:
Add the LTO-8 Type M density code to the density
table in the mt(1) man page.

MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoAllow the setting of the MTU for future paths using an SCTP socket option.
tuexen [Fri, 3 Nov 2017 20:46:12 +0000 (20:46 +0000)]
Allow the setting of the MTU for future paths using an SCTP socket option.
This functionality was missing.

MFC after: 1 week

6 years agoFix an error in the PINE64.conf, where the ubldr is not needed
gjb [Fri, 3 Nov 2017 19:32:10 +0000 (19:32 +0000)]
Fix an error in the PINE64.conf, where the ubldr is not needed
and the u-boot needs to be written to the partition with dd(1).

Reported by: manu
Sponsored by: The FreeBSD Foundation

6 years agoSpecial-case pget lookups where pid == curproc->pid
mjg [Fri, 3 Nov 2017 19:21:36 +0000 (19:21 +0000)]
Special-case pget lookups where pid == curproc->pid

Saves on allproc_lock acquires during buildworld, poudriere etc.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Sponsored by: Mysterious Code Ltd.
Differential Revision: D12929

6 years agoAdd a configuration file for building pine64 SoC images.
gjb [Fri, 3 Nov 2017 19:08:59 +0000 (19:08 +0000)]
Add a configuration file for building pine64 SoC images.

Parts obtained from: crochet
Sponsored by: The FreeBSD Foundation

6 years agoInclude TARGET and TARGET_ARCH in chroot_arm_build_release()
gjb [Fri, 3 Nov 2017 18:54:25 +0000 (18:54 +0000)]
Include TARGET and TARGET_ARCH in chroot_arm_build_release()
make(1) invocations following the OBJDIR restructuring to
ensure the output arm SoC image is in the correct directory.

Sponsored by: The FreeBSD Foundation

6 years agopatch(1): don't assume a match if we run out of context to check
kevans [Fri, 3 Nov 2017 17:04:30 +0000 (17:04 +0000)]
patch(1): don't assume a match if we run out of context to check

Patches with very little context (-U0 and -U1) could get misapplied if
the file to be patched changes and a hunk is no longer applicable. Matching
with fuzz would be attempted and default to a match when we unexpectedly ran
out of context.

PR: 74127
Reviewed by: emaste, pfg
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12631

6 years agoAdd alignment support to __libc_allocate_tls().
mmel [Fri, 3 Nov 2017 15:57:27 +0000 (15:57 +0000)]
Add alignment support to __libc_allocate_tls().

For statically linked binaries, where all relocation are solved by static
linker, the linker expect that offset to TLS section is aligned. Additionaly,
to maintain absolute alignment, TLS TCB should by also aligned.

Obtained from: CheriBSD (initial version)
MFC after: 1 month
Reviewed by: brooks (previous version), kib
Differential Revision: https://reviews.freebsd.org/D12907

6 years agoFix mpr(4) panics caused by bad drive mapping tables
asomers [Fri, 3 Nov 2017 15:07:36 +0000 (15:07 +0000)]
Fix mpr(4) panics caused by bad drive mapping tables

sys/dev/mpr/mpr_mapping.c
If _mapping_process_dpm_pg0 detects inconsistencies in the drive
mapping table (stored in the HBA's NVRAM), abort reading it and
continue to boot as if the mapping table were blank.  I observed
such inconsistencies in several HBAs after upgrading firmware from
14.0.0.0 to 15.0.0.0.

Reviewed by: slm
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12901

6 years agoAllow CUSE(3) to free all memory mapped memory by using regular SWAP objects
hselasky [Fri, 3 Nov 2017 14:10:57 +0000 (14:10 +0000)]
Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects
instead of malloc(). The SWAP objects are automagically freed when there are no
more consumers. This greatly simplifies the mmap logic inside CUSE(3) in the
kernel. This change fixes an issue where mmapped memory can accumulate and never
get freed, if many different mmap sizes are needed over time. Further this
change fixes memory leaks when the CUSE(3) kernel module is unloaded.

While at it make sure the CUSE_ALLOC_PAGES_MAX limit is treated as an exclusive
limit. CUSE(3) memory maps must be less than CUSE_ALLOC_PAGES_MAX number of pages.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D11392
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoUpdate to CLDR 32 and Unicode 10
bapt [Fri, 3 Nov 2017 13:52:34 +0000 (13:52 +0000)]
Update to CLDR 32 and Unicode 10

MFC after: 2 weeks
Relnotes: yes

6 years agoRemove redundant dev->si_drv1 NULL checks in the LinuxKPI.
hselasky [Fri, 3 Nov 2017 13:43:05 +0000 (13:43 +0000)]
Remove redundant dev->si_drv1 NULL checks in the LinuxKPI.
This pointer is checked during the linux_dev_open() callback and does
not need to be NULL checked again. It should always be set for
character devices belonging to the "linuxcdevsw" and technically
there is no need to NULL check this pointer at all.

Suggested by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUpgrade to Unicode 10.0.0
bapt [Fri, 3 Nov 2017 13:42:04 +0000 (13:42 +0000)]
Upgrade to Unicode 10.0.0

6 years agoIn preparation for update of cldr to version 32 and unicode to version 10
bapt [Fri, 3 Nov 2017 13:38:45 +0000 (13:38 +0000)]
In preparation for update of cldr to version 32 and unicode to version 10
Add a character mapping for a missing character in ISO8859-2

6 years agoWhile discussing the new gets_s.c in D12785, ed@ suggested putting
cy [Fri, 3 Nov 2017 13:08:29 +0000 (13:08 +0000)]
While discussing the new gets_s.c in D12785, ed@ suggested putting
{}'s around the if (c == EOF) block to prevent potential 'trailing else'
issues from being introduced when refactoring. As my gets_s() code
is based on this, it makes sense to fix the same issue here first
here and now, then do an svn copy again to capture this history).

Suggested by: ed@ in D12785

6 years agoExport std::get_new_handler() from libcxxrt.so
arichardson [Fri, 3 Nov 2017 12:52:59 +0000 (12:52 +0000)]
Export std::get_new_handler() from libcxxrt.so

When trying to build world for MIPS64 with clang I was getting
linker errors because of a missing reference to std::get_new_handler().
It turns out std::get_new_handler() was not listed in Version.map so it was
marked as a local symbol in libcxxrt.so.

Reviewed by: theraven, brooks (mentor), emaste
Approved by: trasz
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D11925

6 years agoUse correct pointer in key_updateaddresses() when updating NAT-T config.
ae [Fri, 3 Nov 2017 11:33:13 +0000 (11:33 +0000)]
Use correct pointer in key_updateaddresses() when updating NAT-T config.

key_updateaddresses() is used to update SA addresses and NAT-T
configuration in SADB_UPDATE message. This is done using cloning SA
content from old SA into new one. But addresses and NAT-T configuration
are taking from SADB_UPDATE message. Use newsa pointer to set NAT-T
properties into cloned SA.

PR: 223382
MFC after: 1 week