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

6 years agoAdd getpriority(2) benchmark; it's a lightweight syscall which does pretty
trasz [Thu, 2 Nov 2017 12:12:18 +0000 (12:12 +0000)]
Add getpriority(2) benchmark; it's a lightweight syscall which does pretty
much nothing - just like getuid(2) - but takes arguments.

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

6 years agoMake syscall_timing(1) default to a temporary file when run without -p.
trasz [Thu, 2 Nov 2017 12:11:20 +0000 (12:11 +0000)]
Make syscall_timing(1) default to a temporary file when run without -p.

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

6 years agoAdd fetchbench, a trivial HTTP benchmark based on fetch(1).
trasz [Thu, 2 Nov 2017 12:09:18 +0000 (12:09 +0000)]
Add fetchbench, a trivial HTTP benchmark based on fetch(1).

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

6 years agozfs.c:vdev_read() needs to be careful about large sectors
tsoome [Thu, 2 Nov 2017 08:47:03 +0000 (08:47 +0000)]
zfs.c:vdev_read() needs to be careful about large sectors

Using the same implementation as done in efi/boot1. We must handle smaller
than sector size IO etc.

Differential Revision: https://reviews.freebsd.org/D12850

6 years agoActually add the dtsec(4) man page to the build
jhibbits [Thu, 2 Nov 2017 04:17:10 +0000 (04:17 +0000)]
Actually add the dtsec(4) man page to the build

6 years agoFix interrupt handling for dtsec
jhibbits [Thu, 2 Nov 2017 04:07:41 +0000 (04:07 +0000)]
Fix interrupt handling for dtsec

The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit
number, which may not match the cell index.

MFC after: 1 week

6 years agoDon't propagate MAKEOBJDIRPREFIX changes to environment.
bdrewery [Thu, 2 Nov 2017 04:05:03 +0000 (04:05 +0000)]
Don't propagate MAKEOBJDIRPREFIX changes to environment.

A makefile may use this variable later for its own reasons,
don't infect sub-makes with that value.

Sponsored by: Dell EMC Isilon

6 years agorsu(4): trim code for Rx rate calculation.
avos [Thu, 2 Nov 2017 00:17:52 +0000 (00:17 +0000)]
rsu(4): trim code for Rx rate calculation.

Include ridx <-> rate conversion functions from rtwn(4) +
reuse already calculated value for ieee80211_radiotap(9).

Tested with Asus USB-N10, STA mode.

6 years agoWe get VERSION from bmake/VERSION now
sjg [Wed, 1 Nov 2017 23:20:04 +0000 (23:20 +0000)]
We get VERSION from bmake/VERSION now

6 years agotag bmake-20171028
sjg [Wed, 1 Nov 2017 23:17:47 +0000 (23:17 +0000)]
tag bmake-20171028

6 years agoImport bmake-20171028
sjg [Wed, 1 Nov 2017 23:16:32 +0000 (23:16 +0000)]
Import bmake-20171028

From ChangeLog

2017-10-28  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION: 20171028
          Merge with NetBSD make, pick up
          o main.c: ignore empty MAKEOBJDIR

        * Makefile.config.in:
          make @prefix@ @machine*@ and @default_sys_path@ defaults.

2017-10-05  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION: 20171005

        * unit-tests/dotwait.mk: redirect stderr through pipe for more
          consistent result on some platforms.

2017-08-13  Simon J. Gerraty  <sjg@bad.crufty.net>

        * machine.sh: entry for AIX

2017-08-12  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION (_MAKE_VERSION): Move the setting of _MAKE_VERSION
          to a file that can be included by configure as well as make.
          This allows configure to set set _MAKE_VERSION in make-bootstrap.sh

2017-08-10  Simon J. Gerraty  <sjg@bad.crufty.net>

        * Makefile (_MAKE_VERSION): 20170810
          Merge with NetBSD make, pick up
          o meta.c: if target is in subdir we only need subdir name in
            meta_name.

6 years agoevdev: Do not start/stop softrepeat callout if no clients attached
wulf [Wed, 1 Nov 2017 22:37:43 +0000 (22:37 +0000)]
evdev: Do not start/stop softrepeat callout if no clients attached

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Disable value normalization and state filtering for SND events.
wulf [Wed, 1 Nov 2017 22:33:44 +0000 (22:33 +0000)]
evdev: Disable value normalization and state filtering for SND events.

Some events can take sound pitch as a value so can not be represented
as binary on/off events. Tracking for on/off state is left in place
as it is a part of the evdev API.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agosysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol
wulf [Wed, 1 Nov 2017 22:30:36 +0000 (22:30 +0000)]
sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol

- Do not report T-axis wheel events as button presses
- Reverse T-axis to match Linux
- Remove wrong comment. T-axis buttons state should be checked by level not
    by edge to allow continuous wheel tilt reporting

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Take driver's lock in cdev write handler if necessary
wulf [Wed, 1 Nov 2017 22:19:19 +0000 (22:19 +0000)]
evdev: Take driver's lock in cdev write handler if necessary

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Lock Giant around keyboard ioctls
wulf [Wed, 1 Nov 2017 22:15:19 +0000 (22:15 +0000)]
evdev: Lock Giant around keyboard ioctls

This fixes turning ukbd(4) LEDs on/off with evdev interface as well

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
wulf [Wed, 1 Nov 2017 22:09:10 +0000 (22:09 +0000)]
evdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
w/o EVDEV_SUPPORT as it's value has no meaning in this case.

Now presence of this sysctl can be used for discovery if evdev support
for hybrid devices is compiled into kernel or not.
Hide "kern.evdev.sysmouse_t_axis" sysctl for the same reason.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoRegenerate for UNIFIED_OBJDIR.
bdrewery [Wed, 1 Nov 2017 21:22:23 +0000 (21:22 +0000)]
Regenerate for UNIFIED_OBJDIR.

Sponsored by: Dell EMC Isilon

6 years agoMETA_MODE: Respect make -s.
bdrewery [Wed, 1 Nov 2017 21:22:19 +0000 (21:22 +0000)]
META_MODE: Respect make -s.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agomake obj: Skip treewalk if AUTO_OBJ is enabled.
bdrewery [Wed, 1 Nov 2017 21:22:16 +0000 (21:22 +0000)]
make obj: Skip treewalk if AUTO_OBJ is enabled.

Sponsored by: Dell EMC Isilon

6 years agonative-xtools/xdev: Store these in a location including both MACHINE/TARGET.
bdrewery [Wed, 1 Nov 2017 21:22:13 +0000 (21:22 +0000)]
native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
    /usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
    /usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by: Dell EMC Isilon

6 years agoAdd a 'make cleanuniverse'.
bdrewery [Wed, 1 Nov 2017 21:22:10 +0000 (21:22 +0000)]
Add a 'make cleanuniverse'.

This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by: Dell EMC Isilon

6 years agoAdd option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.
bdrewery [Wed, 1 Nov 2017 21:22:05 +0000 (21:22 +0000)]
Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>.  This
new format is used regardless of cross or native build.  It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840

6 years agobluetooth: Default to discoverable off
cem [Wed, 1 Nov 2017 18:58:54 +0000 (18:58 +0000)]
bluetooth: Default to discoverable off

Try to not expose bluetooth devices to external devices unless the user
explicitly configures it, like any other radio/network device.  Bluetooth
has a long history of security problems and it is probably best to keep it
disabled if not needed.

Users who do use the bluetooth device should enable "discoverable" in
bluetooth.device.conf(5) after this change.

Keep in mind that bluetooth addresses can be discovered by passive
monitoring or whole address-space scans[0], so a safety conscious user
should also disable "connectable" in bluetooth.device.conf(5).

[0]: https://www.sans.edu/cyber-research/security-laboratory/article/bluetooth

Reviewed by: emax, hselasky
Security: maybe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12831

6 years agoefipart_strategy is using wrong offset with >512B sectors
tsoome [Wed, 1 Nov 2017 18:49:45 +0000 (18:49 +0000)]
efipart_strategy is using wrong offset with >512B sectors

The strategy() calls are assuming 512B sectors, so we need to adjust the
offset accordingly.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D12849

6 years agoRestore an optimization that was temporary disabled by r324665.
kib [Wed, 1 Nov 2017 18:06:44 +0000 (18:06 +0000)]
Restore an optimization that was temporary disabled by r324665.

In reclaim_pv_chunk(), rotate the pv chunks list so that next
invocations of the reclaim do not scan the same pv chunks that could
not be freed.  Only do the rotation when there is no parallel scan,
tracked by active_reclaims counter.

To rotate, move all chunks that are before current iteration marker,
after another marker that is inserted at the list tail on start of the
reclaim.

Reviewed by: alc
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix the reporting of the MTU for SCTP sockets when using IPv6.
tuexen [Wed, 1 Nov 2017 16:32:11 +0000 (16:32 +0000)]
Fix the reporting of the MTU for SCTP sockets when using IPv6.

MFC after: 1 week

6 years agoepair: Fix panic on unload
kp [Wed, 1 Nov 2017 14:27:26 +0000 (14:27 +0000)]
epair: Fix panic on unload

The VNET_SYSUNINIT() callback is executed after the MOD_UNLOAD. That means
that netisr_unregister() has already been called when
netisr_unregister_vnet() gets calls, leading to an assertion failure.

Restore the expected order of operations by performing everything that
was done in MOD_UNLOAD to a SYSUNINIT() (that will be called after the
VNET_SYSUNINIT()).

Differential Revision: https://reviews.freebsd.org/D12771

6 years agoImplement ioread16be() in the LinuxKPI.
hselasky [Wed, 1 Nov 2017 12:34:18 +0000 (12:34 +0000)]
Implement ioread16be() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies