]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRemove fortune quotes attributed to or providing admiration of Adolf Hitler
feld [Mon, 13 Nov 2017 21:55:34 +0000 (21:55 +0000)]
Remove fortune quotes attributed to or providing admiration of Adolf Hitler

MFC after: 1 week

6 years agoDon't add /boot/dt*s* but /boot/dt*b*. Stupid think-o. /boot/dtb was
imp [Mon, 13 Nov 2017 21:25:57 +0000 (21:25 +0000)]
Don't add /boot/dt*s* but /boot/dt*b*. Stupid think-o. /boot/dtb was
what was tested...

6 years agoAdd /boot/dts to the list of default modules. The minimal arm and mips
imp [Mon, 13 Nov 2017 21:23:26 +0000 (21:23 +0000)]
Add /boot/dts to the list of default modules. The minimal arm and mips
loader.conf for uboot have this in the list, but the default one
didn't. Since there's no harm and it's a failsafe, add it to the list.

Sponsored by: Netflix

6 years agoMove loop to clear TDB_SUSPEND into PT_DETACH case.
jhb [Mon, 13 Nov 2017 21:22:33 +0000 (21:22 +0000)]
Move loop to clear TDB_SUSPEND into PT_DETACH case.

The PT_DETACH case above the sendsig: label already looped over all
threads clearing flags in td_dbgflags.  Reuse this loop to clear
TDB_SUSPEND and move the logic out of the sendsig: block.

6 years agoPull the PT_ATTACH case out of the 'sendsig:' block.
jhb [Mon, 13 Nov 2017 21:09:08 +0000 (21:09 +0000)]
Pull the PT_ATTACH case out of the 'sendsig:' block.

Most of the conditionals in the 'sendsig:' block are now only different
for PT_ATTACH vs other continue requests.  Pull the PT_ATTACH-specific
logic up into the PT_ATTACH case and simplify the 'sendsig:' block.  This
also permits moving the unlock of proctree_lock above the sendsig: label
since PT_KILL doesn't hold the lock and and the other cases all fall
through to the label.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D13073

6 years agoRework r325568 so all 'make LINT' targets work.
bdrewery [Mon, 13 Nov 2017 20:49:08 +0000 (20:49 +0000)]
Rework r325568 so all 'make LINT' targets work.

Reported by: ngie
Sponsored by: Dell EMC Isilon

6 years agoAdd loader.conf to the list of files that are MD.
imp [Mon, 13 Nov 2017 20:39:43 +0000 (20:39 +0000)]
Add loader.conf to the list of files that are MD.

loader.conf is also different between machines. On arm it's a minimal
one that's not quite compatible with the default one. On arm it's
minimal for speed, which is good, but there's also extra things in it
relative to the default on which break loading FDT which is bad. This
doesn't address that issue, but instead ensures the minimal one for
arm is used.

A similar issue for mips exists, but since we can have a beri variant
of /boot/loader and a uboot variant, I'm leaving that mess alone for
the moment.

Sponsored by: Netflix

6 years agoOnly build the libmagic build-tools if MK_FILE != no
arichardson [Mon, 13 Nov 2017 20:07:08 +0000 (20:07 +0000)]
Only build the libmagic build-tools if MK_FILE != no

Before this patch libmagic was always built in the build-tools phase
even if -DWITHOUT_FILE was specified.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12925

6 years agoOnly clear a pending thread event if one is pending.
jhb [Mon, 13 Nov 2017 19:58:58 +0000 (19:58 +0000)]
Only clear a pending thread event if one is pending.

This fixes a panic when attaching to an already-stopped process after
r325028.  While here, clean up a few other things in the control flow
of the 'sendsig' section:
- Only check for P_STOPPED_TRACE rather than either of P_STOPPED_SIG
  or P_STOPPED_TRACE for most ptrace requests.  The signal handling
  code in kern_sig.c never sets just P_STOPPED_SIG for a traced
  process, so if P_STOPPED_SIG is stopped, P_STOPPED_TRACE should be
  set anyway.  Remove a related debug printf.  Assuming P_STOPPED_TRACE
  permits simplifications in the 'sendsig:' block.
- Move the block to clear the pending thread state up into a new
  block conditional on P_STOPPED_TRACE and handle delivering pending
  signals to the reporting thread and clearing the reporting thread's
  state in this block.
- Consolidate case to send a signal to the process in a single case
  for PT_ATTACH.  The only case that could have been in the else before
  was a PT_ATTACH where P_STOPPED_SIG was not set, so both instances
  of kern_psignal() collapse down to just PT_ATTACH.

Reported by: pho, mmel
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D12837

6 years agoRemove -fuse-ld= when creating _LDFLAGS from LDFLAGS
arichardson [Mon, 13 Nov 2017 19:44:33 +0000 (19:44 +0000)]
Remove -fuse-ld= when creating _LDFLAGS from LDFLAGS

The -fuse-ld flag is only meant to be passed to the compiler driver so
direct linker invocations should not include it.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12910

6 years agoUpdate the GUMSTIX image build to use arm/arm TARGET/TARGET_ARCH.
gjb [Mon, 13 Nov 2017 19:31:51 +0000 (19:31 +0000)]
Update the GUMSTIX image build to use arm/arm TARGET/TARGET_ARCH.
Update the TARGET/TARGET_ARCH matching in release/release.sh and
release/Makefile.mirrors for simplification.

Discussed with: mmel
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoarm: rpi2: Fix cpufreq(4)
manu [Mon, 13 Nov 2017 18:53:41 +0000 (18:53 +0000)]
arm: rpi2: Fix cpufreq(4)

Since r324184 the root node compatible for rpi2 is "brcm,bcm2836", add
it to the compatible list of bcm2835_cpufreq.

Tested On: RPI2 v1.1 RPI2 v1.2

Reported by: many on freebsd-arm@

6 years agoProperly handle the case where the linux_cdev_handle_insert() function
hselasky [Mon, 13 Nov 2017 18:16:26 +0000 (18:16 +0000)]
Properly handle the case where the linux_cdev_handle_insert() function
in the LinuxKPI returns NULL. This happens when the VM area's private
data handle already exists and could cause a so-called NULL pointer
dereferencing issue prior to this fix.

Found by: greg@unrelenting.technology
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix formatting of _umtx_op(2)
vangyzen [Mon, 13 Nov 2017 17:46:38 +0000 (17:46 +0000)]
Fix formatting of _umtx_op(2)

Do not use macros in the -width of a .Bl, since mandoc does not support them.

Fix issues reported by igor and mandoc -Tlint.

Use a .Bl for list of clock IDs instead of a comma list.

MFC after: 3 days
Sponsored by: Dell EMC

6 years agoAdd notes about overlapping copies.
imp [Mon, 13 Nov 2017 17:04:44 +0000 (17:04 +0000)]
Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Sponsored by: Netflix

6 years agoAdd __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>
vangyzen [Mon, 13 Nov 2017 16:53:36 +0000 (16:53 +0000)]
Add __BEGIN_DECLS and __END_DECLS to <sys/umtx.h>

This allows C++ programs to call _umtx_op().

MFC after: 3 days
Sponsored by: Dell EMC

6 years agoDo not leak PMC_PO_OWNS_LOGFILE on error.
kib [Mon, 13 Nov 2017 10:45:31 +0000 (10:45 +0000)]
Do not leak PMC_PO_OWNS_LOGFILE on error.

Note that PMCLOG_RESERVE_WITH_ERROR() macro contains goto error;
statement and executed after the flag is set.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoStyle bug.
kib [Mon, 13 Nov 2017 10:43:31 +0000 (10:43 +0000)]
Style bug.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoBe more careful when doing calculation with request from userland.
delphij [Mon, 13 Nov 2017 07:47:43 +0000 (07:47 +0000)]
Be more careful when doing calculation with request from userland.

MFC after: 2 weeks

6 years agoDocument MACHINE, MACHINE_ARCH, CPUTYPE, TARGET and TARGET_ARCH
imp [Mon, 13 Nov 2017 00:32:44 +0000 (00:32 +0000)]
Document MACHINE, MACHINE_ARCH, CPUTYPE, TARGET and TARGET_ARCH
historical use and general philosphy.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12981

6 years agoUse proper include file. While <boot/userboot/userboot.h> works, it
imp [Mon, 13 Nov 2017 00:30:38 +0000 (00:30 +0000)]
Use proper include file. While <boot/userboot/userboot.h> works, it
only works because we have -Isys on the command line. We also have
-Isys/boot/userboot on the command line, so bring it in directly with
<userboot.h>. No functional change, but it removes one hard to see
dependency on the boot loader's location in sys/boot.

Sponsored by: Netflix

6 years agoAdd Intel Processor Trace (PT) MSRs.
br [Sun, 12 Nov 2017 23:13:04 +0000 (23:13 +0000)]
Add Intel Processor Trace (PT) MSRs.

Sponsored by: DARPA, AFRL

6 years agoCleanup the handling of control chunks. While there fix some minor
tuexen [Sun, 12 Nov 2017 21:43:33 +0000 (21:43 +0000)]
Cleanup the handling of control chunks. While there fix some minor
bug related to clearing the assoc retransmit counter and the dup TSN
handling of NR-SACK chunks.

MFC after: 3 days

6 years agoboot1: also check for NULL device
emaste [Sun, 12 Nov 2017 17:15:54 +0000 (17:15 +0000)]
boot1: also check for NULL device

r325681 fixed a NULL pointer dereference on RPi3 caused by a lack of
functionality in uboot's EFI implementation.  That rev checked the boot1
load path for NULL but not the load device.  In practice if the former
works the latter will as well, but improve correctness by checking each
separately.

Submitted by: Keith White <kwhite@eecs.uottawa.ca>
Reported by: jhb
MFC after: 5 days
MFC with: r325681
Sponsored by: The FreeBSD Foundation

6 years agoMake sure the proper loader.rc gets installed.
imp [Sun, 12 Nov 2017 17:10:57 +0000 (17:10 +0000)]
Make sure the proper loader.rc gets installed.

There were two things wrong. First, the wrong path was listed in .PATH
statement. Second, BOOTSRC wasn't yet defined for the .PATH, so it
didn't properly add it. Third, even if these were right, . was in the
path before, so it wouldn't have worked. Replace this with a simple
loop so the proper loader.rc gets selected.

Noticed by: dhw@ (menus stopped working on boot)
Sponsored by: Netflix

6 years agoStop installing eqnchar which has been removed
bapt [Sun, 12 Nov 2017 09:42:42 +0000 (09:42 +0000)]
Stop installing eqnchar which has been removed

Pointyhat to: bapt

6 years agodhclient(8) should not close stdio using daemon(3) function.
oshogbo [Sun, 12 Nov 2017 08:54:23 +0000 (08:54 +0000)]
dhclient(8) should not close stdio using daemon(3) function.

dhclient(8) is chrooted so opening /dev/null always will fail.
In capability world this is also annoying because we getting error that
open(2) is not permitted in Capsicum. dhclient(8) is closing stdio by
precaching fd to /dev/null before chroot.
This is done few lines below daemon(3) function so let's not try to do that
in daemon(3) function.

Reviewed by: cem@
Differential Revision: https://reviews.freebsd.org/D12826

6 years agoUse syslog service in dhclient(8).
oshogbo [Sun, 12 Nov 2017 08:42:43 +0000 (08:42 +0000)]
Use syslog service in dhclient(8).

dhclient(8) is failing during boot to connect to the syslog service, because
syslog daemon is started after dhclient(8). This can be reproduced by stooping
syslog daemon and ktrace the dhclient or use kern.trap_enotcap sysctl and boot
the machine. Using the Casper syslog service fix the problem.

Reviewed by: bapt@
Differential Revision: https://reviews.freebsd.org/D12825

6 years agoIntroduce syslog service for Casper.
oshogbo [Sun, 12 Nov 2017 08:34:25 +0000 (08:34 +0000)]
Introduce syslog service for Casper.

syslog in libc secretly reconnects to the daemon.
Another issue is that we don't have any information from openlog(3) if we
succeeded to open log or not so we don't know if we are ready
to enter cabability mode.
Because all of that we decided we need a syslog service for Caspser.

Reviewed by: bapt@
Differential Revision: https://reviews.freebsd.org/D12824

6 years agoRemove the special character definitions files for eqn(1)
bapt [Sun, 12 Nov 2017 08:31:17 +0000 (08:31 +0000)]
Remove the special character definitions files for eqn(1)

This files hasn't been used since groff(1) was introduced in base 23 years ago.

6 years agoUpdate to 2017.10.21
bapt [Sun, 12 Nov 2017 08:00:57 +0000 (08:00 +0000)]
Update to 2017.10.21

MFC after: 3 days

6 years agoWe return a pointer when we are using cap_init() or cap_service_open()
oshogbo [Sun, 12 Nov 2017 07:18:10 +0000 (07:18 +0000)]
We return a pointer when we are using cap_init() or cap_service_open()
function, so check if cap_chanel_t is NULL is not enough.
Casper with a normal libc will still fail in capability mote so let's not
enter capability mode without casper support when we need to resolve DNS.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D12823

6 years agolibkvm: fix lib32 build.
will [Sun, 12 Nov 2017 03:28:47 +0000 (03:28 +0000)]
libkvm: fix lib32 build.

6 years agoamd64: stop nesting preemption counter in spinlock_enter
mjg [Sun, 12 Nov 2017 03:13:01 +0000 (03:13 +0000)]
amd64: stop nesting preemption counter in spinlock_enter

Discussed with: jhb

6 years agoUse passed thread pointer instead of curthread in sys_sched_yield
mjg [Sun, 12 Nov 2017 02:34:33 +0000 (02:34 +0000)]
Use passed thread pointer instead of curthread in sys_sched_yield

No functional changes.

6 years agolibkvm: fix build failures
will [Sun, 12 Nov 2017 01:36:48 +0000 (01:36 +0000)]
libkvm: fix build failures

6 years agolibkvm: fix 'index' shadowing.
will [Sun, 12 Nov 2017 00:00:38 +0000 (00:00 +0000)]
libkvm: fix 'index' shadowing.

6 years agolibkvm: add kvm_walk_pages API.
will [Sat, 11 Nov 2017 23:30:58 +0000 (23:30 +0000)]
libkvm: add kvm_walk_pages API.

This API allows callers to enumerate all known pages, including any
direct map & kernel map virtual addresses, physical addresses, size,
offset into the core, & protection configured.

For architectures that support direct map addresses, also generate pages
for any direct map only addresses that are not associated with kernel
map addresses.

Fix page size portability issue left behind from previous kvm page table
lookup interface.

Reviewed by: jhb
Sponsored by: Backtrace I/O
Differential Revision: https://reviews.freebsd.org/D12279

6 years agobhyve: avoid applying capsicum capabilities to file that was not opened
robak [Sat, 11 Nov 2017 22:50:14 +0000 (22:50 +0000)]
bhyve: avoid applying capsicum capabilities to file that was not opened

When using -l option targeting file that can't be opened (ie. nmdm module
is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum
capabilities to a file that was not opened.

Enclose that code in an if statement and only run it on correctly opened
descriptor also providing meaningful message in case of an error.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: grehan, emaste
Sponsoied by: Mysterious Code Ltd.
Differential Revision: D12985

6 years agoAvoid locking and refing in sysctl_kern_proc_args if possible.
mjg [Sat, 11 Nov 2017 22:39:33 +0000 (22:39 +0000)]
Avoid locking and refing in sysctl_kern_proc_args if possible.

Turns out the sysctl is called a lot e.g. by pkg-static.

6 years agosysctl: try to avoid malloc in name2oid
mjg [Sat, 11 Nov 2017 21:50:36 +0000 (21:50 +0000)]
sysctl: try to avoid malloc in name2oid

name2oid is called all the time and passed names are almost always very short
(< 16 characters).

6 years agoImplement missing KDGETMODE IOCTL in VT.
hselasky [Sat, 11 Nov 2017 20:12:48 +0000 (20:12 +0000)]
Implement missing KDGETMODE IOCTL in VT.

Obtained from: Johannes Lundberg <yohanesu75@gmail.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agofind(1): Don't treat statfs() error as fatal in f_fstype, which can happen
delphij [Sat, 11 Nov 2017 19:18:47 +0000 (19:18 +0000)]
find(1): Don't treat statfs() error as fatal in f_fstype, which can happen
when a directory is removed in the middle of find.

Instead of a full err(), allow find to continue, plus print a warning with
exitstatus set when appropriate.

Reported by: 100.chksetuid via gordon
Reviewed by: jilles
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D13024

6 years agoUse pfind_any in linux_rt_sigqueueinfo and kern_sigqueue
mjg [Sat, 11 Nov 2017 18:10:09 +0000 (18:10 +0000)]
Use pfind_any in linux_rt_sigqueueinfo and kern_sigqueue

6 years agoAdd pfind_any
mjg [Sat, 11 Nov 2017 18:04:39 +0000 (18:04 +0000)]
Add pfind_any

It looks for both regular and zombie processes. This avoids allproc relocking
previously seen with pfind -> zpfind calls.

6 years agoAvoid allproc lock in pfind if curproc->pid == pid
mjg [Sat, 11 Nov 2017 18:03:26 +0000 (18:03 +0000)]
Avoid allproc lock in pfind if curproc->pid == pid

6 years agoRemove useless proc lookup from sysctl_out_proc
mjg [Sat, 11 Nov 2017 18:02:23 +0000 (18:02 +0000)]
Remove useless proc lookup from sysctl_out_proc

6 years agoFix typo in filename.
imp [Sat, 11 Nov 2017 16:09:20 +0000 (16:09 +0000)]
Fix typo in filename.

Noticed by: Shawn Webb

6 years agoRemove __unused attributed on arguments that are actually used
bapt [Sat, 11 Nov 2017 15:18:25 +0000 (15:18 +0000)]
Remove __unused attributed on arguments that are actually used

MFC after: 3 days

6 years agoFix some nroff style issue
bapt [Sat, 11 Nov 2017 14:39:13 +0000 (14:39 +0000)]
Fix some nroff style issue

MFC after: 3 days

6 years agovmstat: fix duplicate key in libxo output
allanjude [Sat, 11 Nov 2017 14:02:21 +0000 (14:02 +0000)]
vmstat: fix duplicate key in libxo output

In the libxo output from vmstat, the number of pages that have been
paged out uses the same key name as the number of times pages have been
paged. Appears to have been a typo or copy-pasto.

PR: 222198
Submitted by: Yavuz Tanriverdi <stemix@gmail.com>
Reviewed by: phil, garga
Differential Revision: https://reviews.freebsd.org/D12395

6 years agoFollow up on zstd update
bapt [Sat, 11 Nov 2017 13:57:30 +0000 (13:57 +0000)]
Follow up on zstd update

6 years agoUpdate to zstd 1.3.2
bapt [Sat, 11 Nov 2017 13:54:37 +0000 (13:54 +0000)]
Update to zstd 1.3.2

6 years agoRemove release and acquire semantics when accessing the "state" field of the
hselasky [Sat, 11 Nov 2017 11:01:50 +0000 (11:01 +0000)]
Remove release and acquire semantics when accessing the "state" field of the
LinuxKPI task struct. Change type of "state" variable from "int" to
"atomic_t" to simplify code and avoid unneccessary casting.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMask away return codes from del_timer() and del_timer_sync() because
hselasky [Sat, 11 Nov 2017 10:46:12 +0000 (10:46 +0000)]
Mask away return codes from del_timer() and del_timer_sync() because
they are not the same like in Linux.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agorwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER
mjg [Sat, 11 Nov 2017 09:34:11 +0000 (09:34 +0000)]
rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER

6 years agosecure: chase removal of pkg_install
eadler [Sat, 11 Nov 2017 07:21:49 +0000 (07:21 +0000)]
secure: chase removal of pkg_install

6 years agoChase removal of pkg_* commands
eadler [Sat, 11 Nov 2017 07:20:14 +0000 (07:20 +0000)]
Chase removal of pkg_* commands

6 years agobadsect(8): case remaining element
eadler [Sat, 11 Nov 2017 07:14:19 +0000 (07:14 +0000)]
badsect(8): case remaining element

r325452 removed badsect(8) - remove pseudo-target for it

6 years agomailaddr(7): wave goodbye
eadler [Sat, 11 Nov 2017 07:00:40 +0000 (07:00 +0000)]
mailaddr(7): wave goodbye

The information here is somewhere between ancient to obsolete.
It refers to a time in the internet's history when manual routing
was still useful, talks about UUCP as if its modern, and refers
to documents which I had trouble tracking down.

It seems unlikely that a manual page in this form would be useful, so
just remove it.

Reviewed By: imp, tsoome, bdrewery(?)
Differential Revision: https://reviews.freebsd.org/D12924

6 years agoDIRDEPS_BUILD: Fix after r325417.
bdrewery [Sat, 11 Nov 2017 01:11:00 +0000 (01:11 +0000)]
DIRDEPS_BUILD: Fix after r325417.

DIRDEPS_BUILD works just fine without defining __objdir or dealing with any of
this logic.  It handles its own TARGET_SPEC in local.meta.sys.mk as well.  Just
let it do its own thing.

Sponsored by: Dell EMC Isilon

6 years agoDon't work out of a TARGET. directory if TARGET_ARCH is not defined.
bdrewery [Sat, 11 Nov 2017 01:10:55 +0000 (01:10 +0000)]
Don't work out of a TARGET. directory if TARGET_ARCH is not defined.

This fixes 'TARGET=<target> make universe_kernels' creating an empty TARGET.
directory and showing it in SIGINFO.

Sponsored by: Dell EMC Isilon

6 years agoMETA_MODE: Avoid some logic if disabled and allow enabling with make argument.
bdrewery [Sat, 11 Nov 2017 01:10:50 +0000 (01:10 +0000)]
META_MODE: Avoid some logic if disabled and allow enabling with make argument.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: Disable in non-build targets.
bdrewery [Sat, 11 Nov 2017 01:10:46 +0000 (01:10 +0000)]
AUTO_OBJ: Disable in non-build targets.

There's no reason to create object directories for targets like 'installworld'
or 'distributeworld', and the others in this list.  Specifying MK_AUTO_OBJ as a
make argument allows circumventing this if needed for some reason.

This fixes mergemaster creating a full object tree due to doing a 'make
installconfig' tree walk.

Reported by: Mark Millard
Sponsored by: Dell EMC Isilon

6 years agoHandle MAKEOBJDIRPREFIX when already inside of .OBJDIR.
bdrewery [Sat, 11 Nov 2017 01:10:41 +0000 (01:10 +0000)]
Handle MAKEOBJDIRPREFIX when already inside of .OBJDIR.

This can happen in obscure cases with things like the kernel build.

Sponsored by: Dell EMC Isilon

6 years agocleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.
bdrewery [Sat, 11 Nov 2017 01:10:08 +0000 (01:10 +0000)]
cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR.

Sponsored by: Dell EMC Isilon

6 years agoInstall the 4th files in sys/boot/forth instead of each loader
imp [Fri, 10 Nov 2017 23:54:58 +0000 (23:54 +0000)]
Install the 4th files in sys/boot/forth instead of each loader

Also, move generation of loader.help into loader.mk. Set HELP_FILES=
to disable this (so we only install one help file, for now). At the
same time remove some duplicate -I lines. Fix several FILES= and
CLEANFILES= into the += form since we're touching both of those in the
.mk files. Make sure we only build one loader.help file per platform
in a unified way (we were building many on some, with the last to
install winning, though often they were the same text).

Also, we're now installing loader.rc and menu.rc everywhere. arm and
mips uboot installed these as menu.rc.sample, but there's no need
since the loader.rc for those platforms doesn't do menu.rc processing
by default. pcibios.4th is now installed everywhere, but will failsafe
on non x86 platforms (it isn't loaded by default anywhere).

These changes are too intertwined to do separately since aspects of
each are required to have a bug-free commit.

Sponsored by: Netflix

6 years agoMove LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
imp [Fri, 10 Nov 2017 23:54:48 +0000 (23:54 +0000)]
Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI

Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix

6 years agoReplace LOADER_FIREWIRE_SUPPORT variable
imp [Fri, 10 Nov 2017 23:54:41 +0000 (23:54 +0000)]
Replace LOADER_FIREWIRE_SUPPORT variable

Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix

6 years agoRemove useless PNP define here.
imp [Fri, 10 Nov 2017 23:54:36 +0000 (23:54 +0000)]
Remove useless PNP define here.

We never use HAVE_PNP for anything, so don't define it on the command line.

Sponsored by: Netflix

6 years agoRemove LOADER_ZFS_SUPPORT as a Makefile variable
imp [Fri, 10 Nov 2017 23:54:31 +0000 (23:54 +0000)]
Remove LOADER_ZFS_SUPPORT as a Makefile variable

LOADER_ZFS_SUPPORT is entirely used to select whether or not to
support ZFS in the loader. But it's not a user-servicable part (MK_ZFS
is what's used for that) Change it to the more conventional HAVE_ZFS
and move the ZFS support code into loader.mk. In addition, only build
ZFS libraries and boot loaders when ZFS is enabled.

Sponsored by: Netflix

6 years agoRemove LOADER_FDT_SUPPORT as a Makefile variable.
imp [Fri, 10 Nov 2017 23:54:24 +0000 (23:54 +0000)]
Remove LOADER_FDT_SUPPORT as a Makefile variable.

LOADER_FDT_SUPPORT was used inconsistently in the tree. In some
places, it was used to control whether or not the user wanted FDT
included, and in other places it was a command to include
support. Remove it entirely. The former is now enabled -DWITH_FDT,
while the latter is controlled by Makefiles defining HAVE_FDT.

Supported by: Netflix

6 years agoFDT support doesn't make sense for ps3. There's no support in the ps3
imp [Fri, 10 Nov 2017 23:54:18 +0000 (23:54 +0000)]
FDT support doesn't make sense for ps3. There's no support in the ps3
port for FDT, and it's unlikely to grow support for that anytime soon.
When it does, support can be added back easily enough.

Supported by: Netflix

6 years agoRemove all the empty help files from the powerpc build.
imp [Fri, 10 Nov 2017 23:54:13 +0000 (23:54 +0000)]
Remove all the empty help files from the powerpc build.

Sponsored by: Netflix

6 years agoSimplify this if to a direct assignment.
imp [Fri, 10 Nov 2017 23:54:09 +0000 (23:54 +0000)]
Simplify this if to a direct assignment.

Sponsored by: Netflix

6 years agolibsa32 isn't needed for i386. It's already a 32-bit platform and
imp [Fri, 10 Nov 2017 23:54:03 +0000 (23:54 +0000)]
libsa32 isn't needed for i386. It's already a 32-bit platform and
libfoo32 is only needed when compiling 32-bit libraries on native
64-bit architectures, and only when that 64-bit architecture needs
mixed 32-bit and 64-bit binaries.

Sponsored by: Netflix

6 years agoSimplify the efivar interface a little.
imp [Fri, 10 Nov 2017 23:30:23 +0000 (23:30 +0000)]
Simplify the efivar interface a little.

We started out having Linux compatible libefivar interfaces. This was
in anticipation of porting the GPL'd efibootmgr to FreeBSD via a
port. However, since we need that functionality in the base, that port
isn't going to happened. It also appears that efivar is a private
library that's not used much outside a command line util and
efibootmgr. Reduce compatibility with the Linux version a little by
removing the mode parameter to efi_set_variable (which was unused on
FreeBSD, and not set to something useful in the code we'd
written). Also remove some efi error routines that were never
implemented and existed only to placate early GPL efibootmgr porting
experiments.

Suggested by: Matt Williams
Sponsored by: Netflix

6 years agovnic: apply BPF tap before passing packet to hardware
emaste [Fri, 10 Nov 2017 22:17:30 +0000 (22:17 +0000)]
vnic: apply BPF tap before passing packet to hardware

Previously we passed tx packets to hardware via nicvf_tx_mbuf_locked
and then to the BPF tap, with a possibly invalid mbuf which would result
in a panic.

PR: 223600
Discussed with: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation, Packet.net (hardware)

6 years agoRemove rerelease target that was added in r38978.
bdrewery [Fri, 10 Nov 2017 21:52:33 +0000 (21:52 +0000)]
Remove rerelease target that was added in r38978.

I'm not sure what this target is but it doesn't exist now and doesn't seem
to have existed before.

Sponsored by: Dell EMC Isilon

6 years agoboot1: avoid using NULL device path
emaste [Fri, 10 Nov 2017 21:26:44 +0000 (21:26 +0000)]
boot1: avoid using NULL device path

As of r323063 boot1 printed out the path & device from which it was
loaded, but uboot's EFI implementation lacked some support, resulting in
a NULL pointer and a crash.  Check for a NULL pointer and avoid
reporting (and storing in the environment) the device and path in this
case.

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13038

6 years agocxgbe(4): Excluce mdi from the check against port capabilities.
np [Fri, 10 Nov 2017 20:30:10 +0000 (20:30 +0000)]
cxgbe(4): Excluce mdi from the check against port capabilities.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoAUTO_OBJ: Don't create .OBJDIR with 'make -n'.
bdrewery [Fri, 10 Nov 2017 20:10:05 +0000 (20:10 +0000)]
AUTO_OBJ: Don't create .OBJDIR with 'make -n'.

Sponsored by: Dell EMC Isilon

6 years agoTell bsd.dep.mk which depend files to dinclude.
bdrewery [Fri, 10 Nov 2017 20:09:15 +0000 (20:09 +0000)]
Tell bsd.dep.mk which depend files to dinclude.

This allows the _SKIP_DEPEND optimization to work, avoiding reading
the files when not needed.  It also fixes META_MODE incorrectly
reading these files when not needed.

Sponsored by: Dell EMC Isilon

6 years agoAllow consuming Makefiles to add to DEPENDFILES.
bdrewery [Fri, 10 Nov 2017 20:09:11 +0000 (20:09 +0000)]
Allow consuming Makefiles to add to DEPENDFILES.

Sponsored by: Dell EMC Isilon

6 years agoNo need to run 'make depend' with FAST_DEPEND logic in-tree.
bdrewery [Fri, 10 Nov 2017 19:53:17 +0000 (19:53 +0000)]
No need to run 'make depend' with FAST_DEPEND logic in-tree.

Sponsored by: Dell EMC Isilon

6 years agoAUTO_OBJ: No need to tree-walk with 'make obj' here.
bdrewery [Fri, 10 Nov 2017 19:53:14 +0000 (19:53 +0000)]
AUTO_OBJ: No need to tree-walk with 'make obj' here.

Sponsored by: Dell EMC Isilon

6 years agoPass down any PROG-specific buildopts for forwarded targets.
bdrewery [Fri, 10 Nov 2017 19:53:11 +0000 (19:53 +0000)]
Pass down any PROG-specific buildopts for forwarded targets.

This currently has no impact.

Sponsored by: Dell EMC Isilon

6 years agonative-xtools: Fix for GCC archs.
bdrewery [Fri, 10 Nov 2017 19:53:07 +0000 (19:53 +0000)]
native-xtools: Fix for GCC archs.

- This also adds in a _cleanobj step as needed.
- This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in
  Makefile.inc1 as the main build needs to be for MACHINE rather
  than TARGET.

  First build the toolchain and then use that as an external toolchain
  to build the needed directories and NXB_TARGET-toolchain, all as
  MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE.

  The NXBDIRS is evaluated in the 'everything' submake as it needs to be
  based on TARGET's src.opts.mk values, such as MK_GCC=yes when building
  on a MK_CLANG=yes MACHINE.  This can likely be changed to a specific
  _native-xtools-everything target later and the funky late evaluation
  of SUBDIR_OVERRIDE removed.

X-MFC-With: r325001
Pointyhat to: bdrewery
MFC after: 2 months
Sponsored by: Dell EMC Isilon

6 years agoDon't append TARGET.TARGET_ARCH if OBJTOP is already set.
bdrewery [Fri, 10 Nov 2017 19:52:31 +0000 (19:52 +0000)]
Don't append TARGET.TARGET_ARCH if OBJTOP is already set.

This avoids flipping the expected TARGET.TARGET_ARCH suffix / OBJTOP when it is
already set by a parent make which wants to control it more such as in
something like 'make native-xtools'.

Sponsored by: Dell EMC Isilon

6 years agoCheck that the pmc index is less than the number of hardware PMCs,
kib [Fri, 10 Nov 2017 19:10:14 +0000 (19:10 +0000)]
Check that the pmc index is less than the number of hardware PMCs,
instead of asserting the condition.

The row index is directly supplied by userspace, the kernel must
handle invalid values.

Submitted by: pho
MFC after: 3 days

6 years agoMFV: r325668
jkim [Fri, 10 Nov 2017 18:46:34 +0000 (18:46 +0000)]
MFV: r325668

Merge ACPICA 20171110.

6 years agoRefactoring the interrupt setup code introduced a bug where the drivers
scottl [Fri, 10 Nov 2017 17:01:51 +0000 (17:01 +0000)]
Refactoring the interrupt setup code introduced a bug where the drivers
would attempt to re-allocate interrupts during a chip reset without
first de-allocating them.  Doing that right is going to be tricky, so
just band-aid it for now so that a re-init doesn't guarantee a failure
due to resource re-use.

Reported by: gallatin
Sponsored by: Netflix

6 years agoStrip EOL whitespace in usr.sbin/{jail,jexec}
emaste [Fri, 10 Nov 2017 14:53:16 +0000 (14:53 +0000)]
Strip EOL whitespace in usr.sbin/{jail,jexec}

6 years agoAdd more and update existing mlx5 core firmware structure definitions and bits.
hselasky [Fri, 10 Nov 2017 14:39:03 +0000 (14:39 +0000)]
Add more and update existing mlx5 core firmware structure definitions and bits.
This change is part of coming ibcore and mlx5ib updates.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoExpose the current hardware MTU in mlx5en(4) as a separate entry
hselasky [Fri, 10 Nov 2017 14:19:22 +0000 (14:19 +0000)]
Expose the current hardware MTU in mlx5en(4) as a separate entry
in the sysctl tree.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd support for configuring local multicast and unicast data traffic loopback
hselasky [Fri, 10 Nov 2017 14:14:54 +0000 (14:14 +0000)]
Add support for configuring local multicast and unicast data traffic loopback
in mlx5en(4) driver via the sysctl interface.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd support for disabling and enabling RX and TX DMA rings in mlx5en(4).
hselasky [Fri, 10 Nov 2017 14:10:41 +0000 (14:10 +0000)]
Add support for disabling and enabling RX and TX DMA rings in mlx5en(4).
This is useful for supporting setups similar to Netmap.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake physical address of init segment available in the priv of mlx5 core.
hselasky [Fri, 10 Nov 2017 14:02:12 +0000 (14:02 +0000)]
Make physical address of init segment available in the priv of mlx5 core.
This change is needed by mlx5ib(4).

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API function to query port performance counters for infiniband and RoCE
hselasky [Fri, 10 Nov 2017 13:58:49 +0000 (13:58 +0000)]
Add API function to query port performance counters for infiniband and RoCE
traffic in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to query and modify local loopback of multicast and
hselasky [Fri, 10 Nov 2017 13:56:11 +0000 (13:56 +0000)]
Add API functions to query and modify local loopback of multicast and
unicast traffic in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week