]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMake sure the proper loader.rc gets installed.
Warner Losh [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
Baptiste Daroussin [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.
Mariusz Zaborski [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).
Mariusz Zaborski [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.
Mariusz Zaborski [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)
Baptiste Daroussin [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
Baptiste Daroussin [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()
Mariusz Zaborski [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 Andrews [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
Mateusz Guzik [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
Mateusz Guzik [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 Andrews [Sun, 12 Nov 2017 01:36:48 +0000 (01:36 +0000)]
libkvm: fix build failures

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

6 years agolibkvm: add kvm_walk_pages API.
Will Andrews [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
Bartek Rutkowski [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.
Mateusz Guzik [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
Mateusz Guzik [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.
Hans Petter Selasky [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
Xin LI [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
Mateusz Guzik [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
Mateusz Guzik [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
Mateusz Guzik [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
Mateusz Guzik [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.
Warner Losh [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Allan Jude [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
Baptiste Daroussin [Sat, 11 Nov 2017 13:57:30 +0000 (13:57 +0000)]
Follow up on zstd update

6 years agoUpdate to zstd 1.3.2
Baptiste Daroussin [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
Hans Petter Selasky [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
Hans Petter Selasky [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
Mateusz Guzik [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
Eitan Adler [Sat, 11 Nov 2017 07:21:49 +0000 (07:21 +0000)]
secure: chase removal of pkg_install

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

6 years agobadsect(8): case remaining element
Eitan Adler [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
Eitan Adler [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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
Warner Losh [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
Warner Losh [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
Warner Losh [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.
Warner Losh [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
Warner Losh [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.
Warner Losh [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
Warner Losh [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.
Warner Losh [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.
Warner Losh [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
Warner Losh [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.
Warner Losh [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
Ed Maste [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.
Bryan Drewery [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
Ed Maste [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.
Navdeep Parhar [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'.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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.
Bryan Drewery [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,
Konstantin Belousov [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
Jung-uk Kim [Fri, 10 Nov 2017 18:46:34 +0000 (18:46 +0000)]
MFV: r325668

Merge ACPICA 20171110.

6 years agoImport ACPICA 20171110.
Jung-uk Kim [Fri, 10 Nov 2017 17:54:38 +0000 (17:54 +0000)]
Import ACPICA 20171110.

6 years agoRefactoring the interrupt setup code introduced a bug where the drivers
Scott Long [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}
Ed Maste [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.
Hans Petter Selasky [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
Hans Petter Selasky [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
Hans Petter Selasky [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).
Hans Petter Selasky [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.
Hans Petter Selasky [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
Hans Petter Selasky [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
Hans Petter Selasky [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

6 years agoAdd API function to query virtual port counters in mlx5 core.
Hans Petter Selasky [Fri, 10 Nov 2017 13:53:53 +0000 (13:53 +0000)]
Add API function to query virtual port counters in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to modify the transport interface send object, TIS,
Hans Petter Selasky [Fri, 10 Nov 2017 13:50:08 +0000 (13:50 +0000)]
Add API functions to modify the transport interface send object, TIS,
in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd API functions to set and query dropless port mode in mlx5 core.
Hans Petter Selasky [Fri, 10 Nov 2017 13:44:12 +0000 (13:44 +0000)]
Add API functions to set and query dropless port mode in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoPrevent mlx5 core from accessing host memory after shutdown by disabling
Hans Petter Selasky [Fri, 10 Nov 2017 13:40:27 +0000 (13:40 +0000)]
Prevent mlx5 core from accessing host memory after shutdown by disabling
PCI busmaster.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoSet ATOMIC endian mode in mlx5 core.
Hans Petter Selasky [Fri, 10 Nov 2017 13:38:43 +0000 (13:38 +0000)]
Set ATOMIC endian mode in mlx5 core.

The hardware is capable of 2 requestor endianness modes for standard 8
byte atomics: BE (0x0) and host endianness (0x1). Read the supported
modes from hca atomic capabilities and configure HW to host endianness
mode if supported.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd const keyword to input-only argument in mlx5 core.
Hans Petter Selasky [Fri, 10 Nov 2017 13:30:14 +0000 (13:30 +0000)]
Add const keyword to input-only argument in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake local variable 64-bits to avoid masking away bits in mlx5 core.
Hans Petter Selasky [Fri, 10 Nov 2017 13:28:23 +0000 (13:28 +0000)]
Make local variable 64-bits to avoid masking away bits in mlx5 core.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoImplement support for decoding general port notification event in
Hans Petter Selasky [Fri, 10 Nov 2017 13:25:29 +0000 (13:25 +0000)]
Implement support for decoding general port notification event in
the mlx5 core module.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoloader.efi: efi_devpath_is_prefix should return bool
Toomas Soome [Fri, 10 Nov 2017 12:07:56 +0000 (12:07 +0000)]
loader.efi: efi_devpath_is_prefix should return bool

efi_devpath_is_prefix() is currently returning values 0 or 1, which means
it really should return bool.

Additionally, use unsigned len, because we only get unsigned values from
DevicePathNodeLength().

6 years agoRemove deprecated OVERRIDE_LINUX_BASE_PORT. It can be set via
Tijl Coosemans [Fri, 10 Nov 2017 11:19:47 +0000 (11:19 +0000)]
Remove deprecated OVERRIDE_LINUX_BASE_PORT.  It can be set via
DEFAULT_VERSIONS now (e.g. DEFAULT_VERSIONS+=linux=c7).

Noticed by: xmj
MFC after: 2 weeks

6 years agoRefactor the flowsteering APIs used by mlx5en(4). This change is needed by
Hans Petter Selasky [Fri, 10 Nov 2017 09:49:08 +0000 (09:49 +0000)]
Refactor the flowsteering APIs used by mlx5en(4). This change is needed by
the coming ibcore and mlx5ib updates in order to support traffic redirection
to so-called raw ethernet QPs.

Remove unused E-switch related routines and files while at it.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMark ipoib device as initialized on device open.
Hans Petter Selasky [Fri, 10 Nov 2017 08:58:42 +0000 (08:58 +0000)]
Mark ipoib device as initialized on device open.

Set the IPOIB_FLAG_INITIALIZED on dev_open and clear it on dev_stop to
avoid a race between ipoib load and the underlying device driver.

The device module must dispatch the IB_EVENT_PORT_ACTIVE event before ipoib
module is loaded. Otherwise, the flush will fail since no one set the
IPOIB_FLAG_INITIALIZED.

Submitted by: Slava Shwartsman <slavash@mellanox.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoRemove some not needed comments in the LinuxKPI. Use the Linux source tree
Hans Petter Selasky [Fri, 10 Nov 2017 08:31:40 +0000 (08:31 +0000)]
Remove some not needed comments in the LinuxKPI. Use the Linux source tree
to lookup documentation for the functions implemented in the LinuxKPI
instead.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd some missed OBJS_SRCS_FILTER from r323637.
Bryan Drewery [Fri, 10 Nov 2017 08:00:09 +0000 (08:00 +0000)]
Add some missed OBJS_SRCS_FILTER from r323637.

Sponsored by: Dell EMC Isilon

6 years agoAvoid referencing private lib names directly.
Bryan Drewery [Fri, 10 Nov 2017 07:53:02 +0000 (07:53 +0000)]
Avoid referencing private lib names directly.

Sponsored by: Dell EMC Isilon

6 years agorescue ipf: Remove hacks and link in libipf directly.
Bryan Drewery [Fri, 10 Nov 2017 07:52:58 +0000 (07:52 +0000)]
rescue ipf: Remove hacks and link in libipf directly.

Sponsored by: Dell EMC Isilon

6 years agoAdd support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.
Bryan Drewery [Fri, 10 Nov 2017 07:52:46 +0000 (07:52 +0000)]
Add support for CRUNCH_LIBS_ for specifying a lib only for 1 prog.

Sponsored by: Dell EMC Isilon

6 years agoAdd new USB quirk.
Hans Petter Selasky [Fri, 10 Nov 2017 07:44:57 +0000 (07:44 +0000)]
Add new USB quirk.

Submitted by: Kris G <netsick@gmail.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoProperly initialize the full md_page structure
Justin Hibbits [Fri, 10 Nov 2017 04:23:58 +0000 (04:23 +0000)]
Properly initialize the full md_page structure

6 years agoBook-E pmap_mapdev_attr() improvements
Justin Hibbits [Fri, 10 Nov 2017 04:14:48 +0000 (04:14 +0000)]
Book-E pmap_mapdev_attr() improvements

* Check TLB1 in all mapdev cases, in case the memattr matches an existing
  mapping (doesn't need to be MAP_DEFAULT).
* Fix mapping where the starting address is not a multiple of the widest size
  base.  For instance, it will now properly map 0xffffef000, size 0x11000 using
  2 TLB entries, basing it at 0x****f000, instead of 0x***00000.

MFC after: 2 weeks

6 years agoDeal with src.conf for top-level MAKEOBJDIRPREFIX guard.
Bryan Drewery [Fri, 10 Nov 2017 02:09:37 +0000 (02:09 +0000)]
Deal with src.conf for top-level MAKEOBJDIRPREFIX guard.

- Don't discard SRCCONF value since it may incorrectly have MAKEOBJDIRPREFIX
  in it.
- Add note about src.conf not being a suitable place for MAKEOBJDIRPREFIX.

Sponsored by: Dell EMC Isilon

6 years agoHandle some .OBJDIR == .CURDIR cases.
Bryan Drewery [Fri, 10 Nov 2017 02:09:33 +0000 (02:09 +0000)]
Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH.  This
  only happens at the top-level, and for sub-directories when the
  user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
  determines which .OBJDIR the user gets;  If they cannot write to an
  existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
  libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon

6 years agosystm.h: Include cdefs.h first
Conrad Meyer [Fri, 10 Nov 2017 02:00:40 +0000 (02:00 +0000)]
systm.h: Include cdefs.h first

Ever since r143063, machine/atomic.h requires cdefs.h.  So, include it
first.  Weak support: style(9) tells us to include cdefs.h first.

Argument against: since code that includes systm.h still compiles,
compilation units that include systm.h must already include cdefs.h.  So, an
argument could be made that the cdefs.h include could just be removed
entirely.  That is maybe a bigger change and not one I am interested in
bikeshedding.

Universe compiles.

Sponsored by: Dell EMC Isilon