]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

6 years agocrypto(9) is called from ipsec in CRYPTO_F_CBIFSYNC mode. This is working
fabient [Fri, 3 Nov 2017 10:27:22 +0000 (10:27 +0000)]
crypto(9) is called from ipsec in CRYPTO_F_CBIFSYNC mode. This is working
fine when a lot of different flows to be ciphered/deciphered are involved.

However, when a software crypto driver is used, there are
situations where we could benefit from making crypto(9) multi threaded:
- a single flow is to be ciphered: only one thread is used to cipher it,
- a single ESP flow is to be deciphered: only one thread is used to
decipher it.

The idea here is to call crypto(9) using a new mode (CRYPTO_F_ASYNC) to
dispatch the crypto jobs on multiple threads, if the underlying crypto
driver is working in synchronous mode.

Another flag is added (CRYPTO_F_ASYNC_KEEPORDER) to make crypto(9)
dispatch the crypto jobs in the order they are received (an additional
queue/thread is used), so that the packets are reinjected in the network
using the same order they were posted.

A new sysctl net.inet.ipsec.async_crypto can be used to activate
this new behavior (disabled by default).

Submitted by: Emeric Poupon <emeric.poupon@stormshield.eu>
Reviewed by: ae, jmg, jhb
Differential Revision:    https://reviews.freebsd.org/D10680
Sponsored by: Stormshield

6 years agochase removal of csup in r267863 from 2014..
eadler [Fri, 3 Nov 2017 07:30:54 +0000 (07:30 +0000)]
chase removal of csup in r267863 from 2014..

6 years agoFix integer type and format in debug print
jhibbits [Fri, 3 Nov 2017 03:13:15 +0000 (03:13 +0000)]
Fix integer type and format in debug print

gcc complains "cast to pointer from integer of different size".  phandle_t is
*always* a uint32_t, so treat it as such, not as a pointer.  Fixes 64-bit build.

6 years agoAUTO_OBJ: If the wanted .OBJDIR was not used then disable the feature.
bdrewery [Fri, 3 Nov 2017 01:09:35 +0000 (01:09 +0000)]
AUTO_OBJ: If the wanted .OBJDIR was not used then disable the feature.

This is to prevent downstream checks from assuming they can trust .OBJDIR when
MK_AUTO_OBJ is yes, such as the bsd.obj.mk checks.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon

6 years agoFollow-up r325329: Store all WORLDTMP objects back in the same directory.
bdrewery [Fri, 3 Nov 2017 00:29:42 +0000 (00:29 +0000)]
Follow-up r325329: Store all WORLDTMP objects back in the same directory.

This still keeps the reduced MAKEOBJDIRPREFIX (SRCTOP) redundancy
removed in the OBJDIR, but now keeps all early phase objects
in the same directory rather than split per phase.

The problem of splitting per phase is that later phases want to link in
libraries from earlier phases and base their location on ${OBJTOP}.

Pointyhat to: bdrewery
Reported by: mjoras, Mark Millard
Sponsored by: Dell EMC Isilon

6 years agopmcstat(8): unbreak build with LDFLAGS+=-Wl,--as-needed
avos [Fri, 3 Nov 2017 00:12:32 +0000 (00:12 +0000)]
pmcstat(8): unbreak build with LDFLAGS+=-Wl,--as-needed

libpmcstat.a requires libelf.so; reorder them accordingly.

6 years agoAUTO_OBJ is unsafe at the moment as it is for some reason removing /etc with _cleanobj.
bdrewery [Thu, 2 Nov 2017 23:00:04 +0000 (23:00 +0000)]
AUTO_OBJ is unsafe at the moment as it is for some reason removing /etc with _cleanobj.

6 years agoSomething is very wrong
bdrewery [Thu, 2 Nov 2017 22:23:00 +0000 (22:23 +0000)]
Something is very wrong

6 years agoFollow-up r325342: Always ensure WORLDTMP exists.
bdrewery [Thu, 2 Nov 2017 21:58:18 +0000 (21:58 +0000)]
Follow-up r325342: Always ensure WORLDTMP exists.

Reported by: Herbert J. Skuhra
Sponsored by: Dell EMC Isilon

6 years agoDIRDEPS_BUILD: Cleanup leftover WORLDTMP files.
bdrewery [Thu, 2 Nov 2017 20:45:04 +0000 (20:45 +0000)]
DIRDEPS_BUILD: Cleanup leftover WORLDTMP files.

This will force any existing objects to rebuild if their .meta
files reference files from WORLDTMP.  This is a problem after
the UNIFIED_OBJDIR effort caused buildworld and DIRDEPS_BUILD
to share an OBJDIR.  Without cleaning these files the
Makefile.depend files end up with odd tmp/legacy/... entries
since some bootstrap-tools linger from there and otherwise
don't rebuild.  Removing the files causes anything having
used WORLDTMP to rebuild.

Sponsored by: Dell EMC Isilon

6 years agoUpdate to bmake-20171028
sjg [Thu, 2 Nov 2017 20:08:00 +0000 (20:08 +0000)]
Update to bmake-20171028

Ignore empty MAKEOBJDIR[PREFIX]

Reported by: bdrewery

6 years agoThis used to have bzip2 support too.
imp [Thu, 2 Nov 2017 19:53:51 +0000 (19:53 +0000)]
This used to have bzip2 support too.

6 years agoloader: fix BOOTSRC -> BOOTOBJ in a library path
avg [Thu, 2 Nov 2017 19:45:51 +0000 (19:45 +0000)]
loader: fix BOOTSRC -> BOOTOBJ in a library path

6 years agoloader: re-enable gzip support for x86
royger [Thu, 2 Nov 2017 18:13:26 +0000 (18:13 +0000)]
loader: re-enable gzip support for x86

r324653 inadvertently disabled default gzip support on x86, re-enable.

Sponsored by: Citrix System R&D
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D12913

6 years agoRegenerate for AUTO_OBJ.
bdrewery [Thu, 2 Nov 2017 18:09:10 +0000 (18:09 +0000)]
Regenerate for AUTO_OBJ.

Sponsored by: Dell EMC Isilon

6 years agoEnable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.
bdrewery [Thu, 2 Nov 2017 18:09:07 +0000 (18:09 +0000)]
Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.

This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes: yes
Reviewed by: sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12841

6 years agoReduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.
bdrewery [Thu, 2 Nov 2017 18:08:36 +0000 (18:08 +0000)]
Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.

Sponsored by: Dell EMC Isilon

6 years agoMerge OpenSSL 1.0.2m.
jkim [Thu, 2 Nov 2017 18:04:29 +0000 (18:04 +0000)]
Merge OpenSSL 1.0.2m.

6 years agoImport OpenSSL 1.0.2m.
jkim [Thu, 2 Nov 2017 17:35:19 +0000 (17:35 +0000)]
Import OpenSSL 1.0.2m.

6 years agoTake into account race conditions in case of accessed or modified bit
skra [Thu, 2 Nov 2017 14:08:38 +0000 (14:08 +0000)]
Take into account race conditions in case of accessed or modified bit
emulation in fast path of data/prefetch abort common routine. Process
these bits only if related page table entries are consistent with
provided abort info. In case of inconsistency, do nothing and let
processor to signal new abort if still needed.

The mapping related to an abort may be a subject of change concurrently.
The situation is more evident on multicore machines. Mapping may be
removed on one core while being used on another one before TLB flush
happened. Memory swapping process may be an example. Or, two or more
aborts may be signaled for the same page on more cores concurrently.
While an abort on one core may cause a promotion of related mapping,
an abort on another core may be inconsistent then as related mapping
was promoted. A question is how much real the issue may be on single
core machine. However, it's better to play safe even for these machines.

This change may solve some "PT2MAP abort" panics reported rarely.
The revision of pmap_fault() was initiated thanks to stack backtrace
provided by Bob Prohaska (fbsd at www.zefox.net).

While here, INVARIANTS block was changed. The previous check had iffy
value as only one entry from many was checked from L2 page table.

Reviewed by: mmel
MFC after: 3 weeks

6 years agoDisable posix_fallocate(2) for ZFS
avg [Thu, 2 Nov 2017 13:49:08 +0000 (13:49 +0000)]
Disable posix_fallocate(2) for ZFS

The generic (naive) implementation of posix_fallocate cannot provide the
standard mandated guarantee that overwrites would never fail due to the lack
of free space.  The fundamental reason is the copy-on-write architecture
of ZFS.  Other features like compression and deduplication can also
increase the size difference between the (pre-)allocated dummy content
and the future content.

So, until ZFS can properly implement the feature it's better to report
that it is unsupported rather than providing an ersatz implementation.
Please note that EINVAL is used to report that the underlying file system
does not support the operation (POSIX.1-2008).

illumos and ZoL seem to do the same.

MFC after: 3 weeks
Sponsored by: Panzura

6 years agoRemove artificial limit for -i.
trasz [Thu, 2 Nov 2017 12:16:50 +0000 (12:16 +0000)]
Remove artificial limit for -i.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd benchmark for access(2).
trasz [Thu, 2 Nov 2017 12:16:11 +0000 (12:16 +0000)]
Add benchmark for access(2).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd bad_open benchmark, which measures failed opens by calling
trasz [Thu, 2 Nov 2017 12:15:39 +0000 (12:15 +0000)]
Add bad_open benchmark, which measures failed opens by calling
open("", O_RDONLY);.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd benchmark for getresuid(2) - three pointers, although only "output" ones,
trasz [Thu, 2 Nov 2017 12:14:42 +0000 (12:14 +0000)]
Add benchmark for getresuid(2) - three pointers, although only "output" ones,
and quite lightwait.

The purpose of this commit, and the previous one, is to be able to measure
overhead of pointer arguments - in case you're running a strange architecture
where pointers and integers are quite different things at the hardware level.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd select(2) benchmark. It takes four pointers; unfortunately it's
trasz [Thu, 2 Nov 2017 12:13:02 +0000 (12:13 +0000)]
Add select(2) benchmark.  It takes four pointers; unfortunately it's
somewhat heavy.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL