]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
Dimitry Andric [Sun, 25 Feb 2018 13:20:32 +0000 (13:20 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 (branches/release_60 r325932).  This corresponds to 6.0.0 rc3.

MFC after: 3 months
X-MFC-With: r327952
PR: 224669

6 years agopf: Cope with overly large net.pf.states_hashsize
Kristof Provost [Sun, 25 Feb 2018 08:56:44 +0000 (08:56 +0000)]
pf: Cope with overly large net.pf.states_hashsize

If the user configures a states_hashsize or source_nodes_hashsize value we may
not have enough memory to allocate this. This used to lock up pf, because these
allocations used M_WAITOK.

Cope with this by attempting the allocation with M_NOWAIT and falling back to
the default sizes (with M_WAITOK) if these fail.

PR: 209475
Submitted by: Fehmi Noyan Isi <fnoyanisi AT yahoo.com>
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D14367

6 years agolualoader: Explain deviation from naming guidelines
Kyle Evans [Sun, 25 Feb 2018 05:14:06 +0000 (05:14 +0000)]
lualoader: Explain deviation from naming guidelines

cli_execute is likely the only exception that we should make, due to it
being a global. We don't really need other globals, so this won't really end
up an epidemic.

6 years agolualoader: Pull autoboot handling out into menu.run()
Kyle Evans [Sun, 25 Feb 2018 05:00:54 +0000 (05:00 +0000)]
lualoader: Pull autoboot handling out into menu.run()

There's no reason for autoboot handling to be mixed in with menu processing.
It is a distinct process that should only be done once when entering the
menu system.

menu.process has been modified to take an initial keypress to process and to
only draw the screen initially if it's been invalidated. The keypress is
kind of a kludge, although it could be argued to be a potentially useful
kludge if there are other processes that may need to feed a keypress into
the menu system.

6 years agolualoader: Pull menu redrawing specifics out of menu.process
Kyle Evans [Sun, 25 Feb 2018 04:44:45 +0000 (04:44 +0000)]
lualoader: Pull menu redrawing specifics out of menu.process

In general, every menu redraw is going to require a screen clear and cursor
reset. Each redraw also has the potential to invalidate the alias table, so
we move the alias table being used out into a module variable. This allows
third party consumers to also inspect or update the alias table if they need
to.

While here, stop searching the alias table once we've found a match.

6 years agolualoader: Clean up menu handling a little bit
Kyle Evans [Sun, 25 Feb 2018 04:11:08 +0000 (04:11 +0000)]
lualoader: Clean up menu handling a little bit

This is driven by an urge to separate out the bits that really only need to
happen when the menu system starts up. Key points:

- menu.process now does the bulk of menu handling. It retains autoboot
  handling for dubious reasons, and it no longer accepts a 'nil' menu to
  process as 'the default'. Its return value is insignificant.
- The MENU_SUBMENU handler now returns nothing. If menu.process has exited,
  then we continue processing menu items on the parent menu as expected.
- menu.run is now the entry point of the menu system. It checks whether the
  menu should be skipped, processes the default menu, then returns.

6 years agolualoader: menu: Terminate final values in tables with a comma
Kyle Evans [Sun, 25 Feb 2018 03:33:25 +0000 (03:33 +0000)]
lualoader: menu: Terminate final values in tables with a comma

6 years agolualoader: Don't explicitly index tables without reason
Kyle Evans [Sun, 25 Feb 2018 03:30:24 +0000 (03:30 +0000)]
lualoader: Don't explicitly index tables without reason

These indices were assigned the same values as they would've been implicitly
assigned anyways.

While here, throw terminating commas after the last value of tables.

6 years agoFix issues with sparse cpu allocation. Consistently use mp_maxid + 1.
Jeff Roberson [Sun, 25 Feb 2018 00:35:21 +0000 (00:35 +0000)]
Fix issues with sparse cpu allocation.  Consistently use mp_maxid + 1.

Reported by: pho
Reviewed by: markj
Sponsored by: Netflix, Dell/EMC Isilon

6 years agoAvoid dereferencing random memory when kickstarting DMA.
Nathan Whitehorn [Sat, 24 Feb 2018 22:34:56 +0000 (22:34 +0000)]
Avoid dereferencing random memory when kickstarting DMA.

MFC after: 1 week

6 years agoVendor import of lldb release_60 branch r325932:
Dimitry Andric [Sat, 24 Feb 2018 21:28:02 +0000 (21:28 +0000)]
Vendor import of lldb release_60 branch r325932:
https://llvm.org/svn/llvm-project/lldb/branches/release_60@325932

6 years agoVendor import of lld release_60 branch r325932:
Dimitry Andric [Sat, 24 Feb 2018 21:27:54 +0000 (21:27 +0000)]
Vendor import of lld release_60 branch r325932:
https://llvm.org/svn/llvm-project/lld/branches/release_60@325932

6 years agoVendor import of clang release_60 branch r325932:
Dimitry Andric [Sat, 24 Feb 2018 21:27:39 +0000 (21:27 +0000)]
Vendor import of clang release_60 branch r325932:
https://llvm.org/svn/llvm-project/cfe/branches/release_60@325932

6 years agoVendor import of llvm release_60 branch r325932:
Dimitry Andric [Sat, 24 Feb 2018 21:27:30 +0000 (21:27 +0000)]
Vendor import of llvm release_60 branch r325932:
https://llvm.org/svn/llvm-project/llvm/branches/release_60@325932

6 years agoroute(8): make it possible to manually delete pinned route
Eugene Grosbein [Sat, 24 Feb 2018 21:25:56 +0000 (21:25 +0000)]
route(8): make it possible to manually delete pinned route

Reported by: Andreas Longwitz <longwitz@incore.de>
Approved by: avg (mentor)
MFC after: 1 week

6 years agoRestore the pre-r329882 inactive page shortage computation.
Mark Johnston [Sat, 24 Feb 2018 20:47:22 +0000 (20:47 +0000)]
Restore the pre-r329882 inactive page shortage computation.

With r329882, in the absence of a free page shortage we would only take
len(PQ_INACTIVE)+len(PQ_LAUNDRY) into account when deciding whether to
aggressively scan PQ_ACTIVE. Previously we would also include the
number of free pages in this computation, ensuring that we wouldn't scan
PQ_ACTIVE with plenty of free memory available. The change in behaviour
was most noticeable immediately after booting, when PQ_INACTIVE and
PQ_LAUNDRY are nearly empty.

Reviewed by: jeff

6 years agolualoader: Remove inaccurate part of comment
Kyle Evans [Sat, 24 Feb 2018 20:24:57 +0000 (20:24 +0000)]
lualoader: Remove inaccurate part of comment

6 years agolualoader: Clean up naming conventions a little bit
Kyle Evans [Sat, 24 Feb 2018 20:21:21 +0000 (20:21 +0000)]
lualoader: Clean up naming conventions a little bit

We mostly use camel case for function names, but some local functions got
mixed in using internal underscores. Doubles down on camel case.

6 years agoAdd SPDX tags for chvgpio driver sources
Oleksandr Tymoshenko [Sat, 24 Feb 2018 20:19:31 +0000 (20:19 +0000)]
Add SPDX tags for chvgpio driver sources

Also move $FreeBSD$ keyword in header to BSD license

MFC after: 2 weeks

6 years agolualoader: throw out nextboot's usage of standard config processing
Kyle Evans [Sat, 24 Feb 2018 20:07:39 +0000 (20:07 +0000)]
lualoader: throw out nextboot's usage of standard config processing

It should use the common parser, but it should not be processed like a
standard file. Rewite check_nextboot to read the file in, check whether it
should continue, then parse as needed.

This allows us to throw the recently introduced check_and_halt callback
swiftly out the window.

6 years agolualoader: Strip config.parse of its I/O privileges
Kyle Evans [Sat, 24 Feb 2018 20:00:31 +0000 (20:00 +0000)]
lualoader: Strip config.parse of its I/O privileges

config.parse is now purely a parser, rather than a whole proccessor. The
standard process for loading a config file has been split out into
config.processFile.

This clears the way for having nextboot read its own config file and decide
there whether it should parse the rest of the file.

6 years agolualoader: Split config file I/O out into a separate function
Kyle Evans [Sat, 24 Feb 2018 19:51:18 +0000 (19:51 +0000)]
lualoader: Split config file I/O out into a separate function

This is step 1 towards revoking config.parse of it I/O privileges. Ideally,
all reading would be done before config.parse and config.parse would just
take text and parse it rather than being charged with the entire process.

6 years agolibc: Remove unused definition
Conrad Meyer [Sat, 24 Feb 2018 19:40:23 +0000 (19:40 +0000)]
libc: Remove unused definition

RANDOMDEV isn't used after r306636.  Remove the unneeded definition.

No functional change.

Sponsored by: Dell EMC Isilon

6 years agoUnbreak 64-bit Book-E builds post r329712
Justin Hibbits [Sat, 24 Feb 2018 18:12:38 +0000 (18:12 +0000)]
Unbreak 64-bit Book-E builds post r329712

can_wakeup is defined only in AIM's locore64.S, so conditionalize use of it
on AIM in addition to powerpc64.

6 years agoMake MPC85XXSPE kernel conf ident match the file name
Justin Hibbits [Sat, 24 Feb 2018 17:54:12 +0000 (17:54 +0000)]
Make MPC85XXSPE kernel conf ident match the file name

6 years agoChange ident for QORIQ64 kernel conf
Justin Hibbits [Sat, 24 Feb 2018 17:53:22 +0000 (17:53 +0000)]
Change ident for QORIQ64 kernel conf

Make it match the conf file name.

6 years agoUnbreak the build after r329891
Justin Hibbits [Sat, 24 Feb 2018 17:29:29 +0000 (17:29 +0000)]
Unbreak the build after r329891

I was apparently a little too excited with deleting code, and apparently
didn't do a final test build before commit.  Restore cpu_idle_wakeup().

6 years agoUpdates and enhancements to io.d to aid DTrace scripting
Devin Teske [Sat, 24 Feb 2018 17:13:15 +0000 (17:13 +0000)]
Updates and enhancements to io.d to aid DTrace scripting

+ Add dev_type do devinfo_t
+ Add b_cmd to bufinfo_t
+ Add constants for BIO_* and DEVSTAT_TYPE_*
+ Add inline for converting BIO_* int to string
+ Add inline for converting DEVSTAT_TYPE_* int to string
+ Add mask for dev_type & DEVSTAT_TYPE_MASK to string
+ Add mask for dev_type & DEVSTAT_TYPE_IF_MASK to string

Reviewed by: markj
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D14396

6 years agoFix reference to nvlist in man pages.
Mariusz Zaborski [Sat, 24 Feb 2018 16:31:26 +0000 (16:31 +0000)]
Fix reference to nvlist in man pages.

Reviewed by: @bcr @brueffer
Pointed out by: @brueffer
Differential Revision: https://reviews.freebsd.org/D14410

6 years agoAdd a functional detach() routine, to make things kldunload-friendly.
Ian Lepore [Sat, 24 Feb 2018 16:28:45 +0000 (16:28 +0000)]
Add a functional detach() routine, to make things kldunload-friendly.

6 years agoImplement CTASSERT using _Static_assert
Alan Somers [Sat, 24 Feb 2018 16:01:21 +0000 (16:01 +0000)]
Implement CTASSERT using _Static_assert

Prevents warnings about "unused typedef" with GCC-6

Reported by: GCC-6
MFC after: 18 days
X-MFC-With: 329722

6 years agotests: require ksh93 in the Kyuafiles for all atf-ksh93 test programs
Alan Somers [Sat, 24 Feb 2018 15:13:20 +0000 (15:13 +0000)]
tests: require ksh93 in the Kyuafiles for all atf-ksh93 test programs

6 years agoUse NULL as a mtx type instead of "", as it otherwise confuses WITNESS.
Olivier Houchard [Sat, 24 Feb 2018 14:34:23 +0000 (14:34 +0000)]
Use NULL as a mtx type instead of "", as it otherwise confuses WITNESS.

6 years agoCorrectly set the 16kB page size field in the ITS BASER register. Some
Andrew Turner [Sat, 24 Feb 2018 10:33:31 +0000 (10:33 +0000)]
Correctly set the 16kB page size field in the ITS BASER register. Some
new arm64 hardware, e.g. ThunderX2, seems to use this page size so was
failing to attach as the register value read back was incorrect.

While here fix the spelling on shareability.

Sponsored by: DARPA, AFRL

6 years agoHide all vm/vm_pageout.h content under #ifdef _KERNEL.
Konstantin Belousov [Sat, 24 Feb 2018 10:26:26 +0000 (10:26 +0000)]
Hide all vm/vm_pageout.h content under #ifdef _KERNEL.

There are no parts useful for usermode applications in
vm/vm_pageout.h.  Even for the specific applications like fstat and
lsof.

In my opinion, this protection is redundant and instead userspace
should not include the header at all.  Since there are apparently
broken third party codebases, give them a bit of slack by providing
transitional period.

Reported by: julian
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix race when detach is called right after attach in if_axge, that the
Hans Petter Selasky [Sat, 24 Feb 2018 08:44:51 +0000 (08:44 +0000)]
Fix race when detach is called right after attach in if_axge, that the
network device pointer might be NULL. Wait for any pending tasks to
complete before calling axge_stop().

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agolualoader: Explain nextboot stuff a little bit more
Kyle Evans [Sat, 24 Feb 2018 04:02:06 +0000 (04:02 +0000)]
lualoader: Explain nextboot stuff a little bit more

6 years agolualoader: Remove unused variable; we now use the effective line number
Kyle Evans [Sat, 24 Feb 2018 03:48:52 +0000 (03:48 +0000)]
lualoader: Remove unused variable; we now use the effective line number

6 years agolualoader: Add comment on trailing space, don't operate on nil
Kyle Evans [Sat, 24 Feb 2018 03:47:04 +0000 (03:47 +0000)]
lualoader: Add comment on trailing space, don't operate on nil

Functionally, the latter error wouldn't necessarily hurt anything. io.write
will just error out as it's not passed a valid file handle. Still, we can do
better than that.

6 years agolualoader: Correct test and name
Kyle Evans [Sat, 24 Feb 2018 03:43:10 +0000 (03:43 +0000)]
lualoader: Correct test and name

The functionality was correct, but our style guidelines tend to request that
we shy away from using boolean operations in place of explicit comparisons
to nil.

6 years agolualoader: Plug file handle not properly closed
Kyle Evans [Sat, 24 Feb 2018 03:38:51 +0000 (03:38 +0000)]
lualoader: Plug file handle not properly closed

6 years agolualoader: Add nextboot support
Kyle Evans [Sat, 24 Feb 2018 03:35:35 +0000 (03:35 +0000)]
lualoader: Add nextboot support

config.parse now takes an extra callback that is invoked on the full text of
the config file. This callback dictates where we should actually try to
parse this file or not.

For nextboot, we use this to halt parsing if we see 'nextboot_enable="NO"'.
If we don't, parse it and write 'nextboot_enable="NO" ' to it. The same
caveat as with forth still applies- writing is only supported by UFS.

6 years agoRelax the location restraints when validating one of the
Kirk McKusick [Sat, 24 Feb 2018 03:33:46 +0000 (03:33 +0000)]
Relax the location restraints when validating one of the
backup superblocks.

6 years agoliblua: Implement write support
Kyle Evans [Sat, 24 Feb 2018 02:57:24 +0000 (02:57 +0000)]
liblua: Implement write support

Write support (even if it only works on UFS) will be needed for nextboot
functionality.

Reviewed by: cem, imp
Differential Revision: https://reviews.freebsd.org/D14478

6 years agolibsa: Change write(2)-alike prototype to match definition
Conrad Meyer [Sat, 24 Feb 2018 01:58:53 +0000 (01:58 +0000)]
libsa: Change write(2)-alike prototype to match definition

Broken in r329879.

Apparently old GCC detects this, but modern GCC didn't.  Mea culpa.

Reported by: np
Sponsored by: Dell EMC Isilon

6 years agoRemove platform_cpu_idle() and platform_cpu_idle_wakeup() interfaces
Justin Hibbits [Sat, 24 Feb 2018 01:46:56 +0000 (01:46 +0000)]
Remove platform_cpu_idle() and platform_cpu_idle_wakeup() interfaces

These interfaces were put in place to let QorIQ SoCs dictate CPU idling
semantics, in order to support capabilities such as NAP mode and deep sleep.
However, this never stabilized, and the idling support reverted back to
CPU-level rather than SoC level.  Move this code back to cpu.c instead.  If
at a later date the lower power modes do come to fruition, it should be done
by overriding the cpu_idle_hook instead of this platform hook.

6 years agoFix installation with read-only OBJDIR.
Bryan Drewery [Sat, 24 Feb 2018 01:33:17 +0000 (01:33 +0000)]
Fix installation with read-only OBJDIR.

Reported by: npn
Sponsored by: Dell EMC

6 years agoPartially revert r197863 to reduce diff against i386.
Jung-uk Kim [Sat, 24 Feb 2018 01:24:57 +0000 (01:24 +0000)]
Partially revert r197863 to reduce diff against i386.

When I wrote the patch, I wanted to remove SYSINIT() usage from amd64 code.
There is no reason to keep the divergence any more because iwasaki merged
most amd64 suspend/resume code to i386 with r235622.  Note this also fixed
an enge case reported by royger. [1]

Suggested by: jhb
Reviewed by: royger
Tested by: royger [1]
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14400 [1]

6 years agokern/sys_generic.c: style(9) return(foo) -> return (foo)
Conrad Meyer [Sat, 24 Feb 2018 01:15:33 +0000 (01:15 +0000)]
kern/sys_generic.c: style(9) return(foo) -> return (foo)

No functional change.

Sponsored by: Dell EMC Isilon

6 years agoCorrect some comments after r328954.
Mark Johnston [Fri, 23 Feb 2018 23:27:53 +0000 (23:27 +0000)]
Correct some comments after r328954.

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

6 years agoRemove a bogus assertion from vm_page_launder().
Mark Johnston [Fri, 23 Feb 2018 23:25:22 +0000 (23:25 +0000)]
Remove a bogus assertion from vm_page_launder().

After r328977, a wired page m may have m->queue != PQ_NONE.

Reviewed by: kib
X-MFC with: r328977
Differential Revision: https://reviews.freebsd.org/D14485

6 years agoAdd a generic Proportional Integral Derivative (PID) controller algorithm and
Jeff Roberson [Fri, 23 Feb 2018 22:51:51 +0000 (22:51 +0000)]
Add a generic Proportional Integral Derivative (PID) controller algorithm and
use it to regulate page daemon output.

This provides much smoother and more responsive page daemon output, anticipating
demand and avoiding pageout stalls by increasing the number of pages to match
the workload.  This is a reimplementation of work done by myself and mlaier at
Isilon.

Reviewed by: bsdimp
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14402

6 years agoInclude error number in the "fsync: giving up on dirty" message
Kirk McKusick [Fri, 23 Feb 2018 21:57:10 +0000 (21:57 +0000)]
Include error number in the "fsync: giving up on dirty" message
(in case it ever starts happening again in spite of 328444).

Submitted by: Andreas Longwitz <longwitz at incore.de>

6 years agolibsa: Const-ify buffer argument of write(2) analog
Conrad Meyer [Fri, 23 Feb 2018 20:18:09 +0000 (20:18 +0000)]
libsa: Const-ify buffer argument of write(2) analog

Reported by: kevans
Reviewed by: delphij, eadler, imp, kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14482

6 years agoRemove unused error return from API that cannot fail
Conrad Meyer [Fri, 23 Feb 2018 20:15:19 +0000 (20:15 +0000)]
Remove unused error return from API that cannot fail

No implementation of fpu_kern_enter() can fail, and it was causing needless
error checking boilerplate and confusion. Change the return code to void to
match reality.

(This trivial change took nine days to land because of the commit hook on
sys/dev/random.  Please consider removing the hook or otherwise lowering the
bar -- secteam never seems to have free time to review patches.)

Reported by: Lachlan McIlroy <Lachlan.McIlroy AT isilon.com>
Reviewed by: delphij
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14380

6 years agoCorrect typo in ATA_WRITE_UNCORRECTABLE_PSEUDO
Ed Maste [Fri, 23 Feb 2018 20:01:42 +0000 (20:01 +0000)]
Correct typo in ATA_WRITE_UNCORRECTABLE_PSEUDO

Also correct a typo in the comment for these values, noted by jimharris.

Reviewed by: jimharris
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3715

6 years agoUse linux types for linux-specific syscalls
Ed Maste [Fri, 23 Feb 2018 19:09:27 +0000 (19:09 +0000)]
Use linux types for linux-specific syscalls

Sponsored by: Turing Robotic Industries Inc.
Differential Revision: https://reviews.freebsd.org/D14065

6 years agoRestore UP build.
Konstantin Belousov [Fri, 23 Feb 2018 18:26:31 +0000 (18:26 +0000)]
Restore UP build.

Reviewed by: truckman
Sponsored by: The FreeBSD Foundation

6 years agoAdd tests for lagg(4) and other cloned network interfaces
Alan Somers [Fri, 23 Feb 2018 18:18:42 +0000 (18:18 +0000)]
Add tests for lagg(4) and other cloned network interfaces

Unfortunately, most of the tests are disabled because they fairly frequently
trigger panics.

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoCorrect pseudo misspelling in sys/ comments
Ed Maste [Fri, 23 Feb 2018 18:15:50 +0000 (18:15 +0000)]
Correct pseudo misspelling in sys/ comments

contrib code and #define in intel_ata.h unchanged.

6 years agoDelete copypasta
Alan Somers [Fri, 23 Feb 2018 17:20:53 +0000 (17:20 +0000)]
Delete copypasta

Reported by: rpokala
MFC after: 20 days
X-MFC-With: 329845
Sponsored by: Spectra Logic Corp

6 years agoAdd the ZFS test suite
Alan Somers [Fri, 23 Feb 2018 16:31:00 +0000 (16:31 +0000)]
Add the ZFS test suite

It was originally written by Sun as part of the STF (Solaris test framework).
They open sourced it in OpenSolaris, then HighCloud partially ported it to
FreeBSD, and Spectra Logic finished the port.  We also added many testcases,
fixed many broken ones, and converted them all to the ATF framework.  We've had
help along the way from avg, araujo, smh, and brd.

By default most of the tests are disabled.  Set the disks Kyua variable to
enable them.

Submitted by: asomers, will, justing, ken, brd, avg, araujo, smh
Sponsored by: Spectra Logic Corp, HighCloud

6 years agoUse bool instead of int for predicate functions relating to work
Warner Losh [Fri, 23 Feb 2018 16:06:54 +0000 (16:06 +0000)]
Use bool instead of int for predicate functions relating to work
available.

6 years agoDo not return out of bound pointers from intr_lookup_source().
Konstantin Belousov [Fri, 23 Feb 2018 11:20:59 +0000 (11:20 +0000)]
Do not return out of bound pointers from intr_lookup_source().

This hardens the code against driver and upper level bugs causing
invalid indexes used, e.g. on msi release.

Reported by: gallatin
Reviewed by: gallatin, hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14470

6 years agopowerpc64: add NVMe to GENERIC64
Wojciech Macek [Fri, 23 Feb 2018 07:43:52 +0000 (07:43 +0000)]
powerpc64: add NVMe to GENERIC64

NVMe support is ready and should be compiled-in
to the ppc64 kernel.

Submitted by:          Wojciech Macek <wma@semihalf.org>
Obtained from:         Semihalf
Sponsored by:          IBM, QCM Technologies

6 years agolualoader: Track effective line number, use it for drawing
Kyle Evans [Fri, 23 Feb 2018 04:12:19 +0000 (04:12 +0000)]
lualoader: Track effective line number, use it for drawing

Takes into account hidden entries, so that we don't draw blank lines in
place of a hidden item.

6 years agoFloaty McFloatface is funnier...
Warner Losh [Fri, 23 Feb 2018 04:06:15 +0000 (04:06 +0000)]
Floaty McFloatface is funnier...

Submitted by: emaste@

6 years agoDo not include float interfaces when using libsa.
Warner Losh [Fri, 23 Feb 2018 04:04:25 +0000 (04:04 +0000)]
Do not include float interfaces when using libsa.

We don't support float in the boot loaders, so don't include
interfaces for float or double in systems headers. In addition, take
the unusual step of spiking double and float to prevent any more
accidental seepage.

6 years agoWhen the LUA_FLOAT_TYPE != LUA_FLOAT_INT64, we can't reference float
Warner Losh [Fri, 23 Feb 2018 04:04:18 +0000 (04:04 +0000)]
When the LUA_FLOAT_TYPE != LUA_FLOAT_INT64, we can't reference float
or double so ifdef that code out when the numbers aren't float at all.

There's still references in the lmathlib.c, but we don't compile that
for the loader yet.

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

6 years agoCentralize lua defines
Warner Losh [Fri, 23 Feb 2018 04:04:03 +0000 (04:04 +0000)]
Centralize lua defines

We need to ensure that we defined Numbers as int64_t everywhere we
build for lua. Previously, we were compiling part of the code with
Numbers as int64_t and part as double. Move lua number definition to a
more-central location

6 years agolualoader: Use "local function x()" instead of "local x = function()"
Kyle Evans [Fri, 23 Feb 2018 04:03:07 +0000 (04:03 +0000)]
lualoader: Use "local function x()" instead of "local x = function()"

The latter is good, but the former is more elegant and clear about what 'x'
is. Adopt it, preferably only using the latter kind of notation where needed
as values for tables.

6 years ago1. Added support to offline a port if is error recovery on successful.
David C Somayajulu [Fri, 23 Feb 2018 03:36:24 +0000 (03:36 +0000)]
1. Added support to offline a port if is error recovery on successful.
2. Sysctls to enable/disable driver_state_dump and error_recovery.
3. Sysctl to control the delay between hw/fw reinitialization and
   restarting the fastpath.
4. Stop periodic stats retrieval if interface has IFF_DRV_RUNNING flag off.
5. Print contents of PEG_HALT_STATUS1 and PEG_HALT_STATUS2 on heartbeat
   failure.
6. Speed up slowpath shutdown during error recovery.
7. link_state update using atomic_store.
8. Added timestamp information on driver state and minidump captures.
9. Added support for Slowpath event logging
10.Added additional failure injection types to simulate failures.

6 years agolualoader: shallowCopyTable => deepCopyTable
Kyle Evans [Fri, 23 Feb 2018 03:18:24 +0000 (03:18 +0000)]
lualoader: shallowCopyTable => deepCopyTable

I called it a shallow copy, but it wasn't really a shallow copy at all.

6 years agolibifconfig: multiple feature additions
Alan Somers [Fri, 23 Feb 2018 03:11:43 +0000 (03:11 +0000)]
libifconfig: multiple feature additions

Added the ability to:

* Create virtual interfaces
* Create vlan interfaces
* Get interface fib
* Get interface groups
* Get interface status
* Get nd6 info
* Get media status
* Get additional ifaddr info in a convenient struct
* Get vhids
* Get carp info
* Get lagg and laggport status
* Iterate over all interfaces and ifaddrs

And add more examples, too.

Note that this is a backwards-incompatible change. But that's ok, because it's
a private library.

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

6 years agoAdd copyright notice to core.lua
Kyle Evans [Fri, 23 Feb 2018 02:53:50 +0000 (02:53 +0000)]
Add copyright notice to core.lua

I've also made some not-insignificant changes/additions to this file, to
include the added constants, ACPI changes, boot environment listing, and
some utility functions.

6 years agoAdd SPDX tags to lua files
Kyle Evans [Fri, 23 Feb 2018 02:51:35 +0000 (02:51 +0000)]
Add SPDX tags to lua files

6 years agolualoader: Drop unused return values; we'll only use the first
Kyle Evans [Fri, 23 Feb 2018 02:47:51 +0000 (02:47 +0000)]
lualoader: Drop unused return values; we'll only use the first

6 years ago__printf_render_int(): small type change to match use.
Pedro F. Giffuni [Fri, 23 Feb 2018 01:11:57 +0000 (01:11 +0000)]
__printf_render_int(): small type change to match use.

Variable l is consistently used as an int rather than a char.
Sort names while here.

Obtained from: Apple's Libc-1244.30.3
MFC after: 5 days

6 years agogetpeereid(3): Fix behavior on failure to match documentation.
Pedro F. Giffuni [Fri, 23 Feb 2018 00:28:00 +0000 (00:28 +0000)]
getpeereid(3): Fix behavior on failure to match documentation.

According to the getpeereid(3) documentation, on failure the value -1 is
returned and the global variable errno is set to indicate the error. We
were returning the error instead.

Obtained from: Apple's Libc-1244.30.3
MFC after: 5 days

6 years agoFix numerous Coverity issues in mptutil
Alan Somers [Fri, 23 Feb 2018 00:17:50 +0000 (00:17 +0000)]
Fix numerous Coverity issues in mptutil

Most are memory or file descriptor leaks. Three were unannotated
fallthroughs in a switch/case statement. One was an integer overflow before
widen.

Reported by: Coverity
CID: 1007463 1007462 1007461 1007460 1007459 1007458 1007457
CID: 1006855 1006854 1006853 1006852 1006851 1006850 1006849
CID: 1006848 1006845 1006844 1006843 1006842 1006841 1006840
CID: 1006839 1006838 1006837 1006836 1006835 1006834 1006833
CID: 1006832 1006831 1006831 1006830 1006829 1008334 1008170
CID: 1008169 1008168
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11013

6 years agoDecrease latency by not wrapping the idle loop's potentially lengthy
Don Lewis [Fri, 23 Feb 2018 00:12:51 +0000 (00:12 +0000)]
Decrease latency by not wrapping the idle loop's potentially lengthy
search for a thread to steal inside a critical section.  Since this
allows the search to be preempted, restart the search if preemption
happens since the search results found earlier may no longer be
valid.

Decrease the latency of starting a thread that may be assigned to
this CPU during the search by polling for incoming threads during
the search and switching to that thread instead of continuing the
search.

Test for stale search results and restart the search before going
through the expense of calling tdq_lock_pair().  Retry some tests
after grabbing the locks since things may have changed while waiting
to get both locks.

Eliminate special case handling for stealing from an SMT peer that
uses 1 as the steal threshold.  This can only succeed if a thread
has been assigned but our SMT peer has not yet started executing
it.  This is quite rare and when it happens the other SMT thread
is generally waiting for the same tdq lock that we hold.  Basically
both SMT threads are racing to grab the same spin lock.

Add the kern.sched.always_steal knob from a ULE patch by jeff@.

Incorporate another idea from Jeff's ULE patch.  If the sched_switch()
detects that the CPU is about to go idle, try to steal a thread
before switching to the idle thread.  Since the search for a thread
to steal has to be done inside a critical section in this context,
limit the impact on latency by adding the knob kern.sched.trysteal_limit
to limit the topological distance of the search and don't restart
the search if we detect stale results.  If this search can't find
an stealable thread, the idle loop can do a more complete search.
Also poll for threads being assigned to this CPU during the search
and switch to them instead of continuing the search.  This change
is responsibile for the majority of the improvement in parallel
buildworld times.

In sched_balance_group() change the minimum threshold from stealing
a thread from 1 to 2.  Poaching a newly assigned thread from a CPU
that is waking up hasn't yet switched to that thread from idle is
likely very rare and is likely to have the same lock race as is
seen when stealing threads in the idle loop.  Also use tdq_notify()
to kick the destintation CPU instead of always sending an IPI.
Update a stale comment, the number of transferable threads is not
calculated.

Reviewed by: kib (earlier version)
Comments by: avg, jeff, mav
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12130

6 years agojedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs
Ravi Pokala [Thu, 22 Feb 2018 23:18:46 +0000 (23:18 +0000)]
jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs

A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset
information (Part Number, Serial Number) encoded in the "Serial Presence
Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and
reports the memory capacity of the DIMM, in megabytes. If the DIMM includes
a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported.

Reviewed by: cem
MFC after: 1 week
Relnotes: yes
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D14392
Discussed with: avg, cem
Tested by: avg, cem (previous version, no semantic changes)

6 years agoAdd a missing line continuation.
Ian Lepore [Thu, 22 Feb 2018 22:25:26 +0000 (22:25 +0000)]
Add a missing line continuation.

How many commits does it take to get a simple module makefile working?
Apparently at least three.

Pointy hat to:  ian

6 years agoFix up sysctl vfs.buffercache broken in r329612
Mateusz Guzik [Thu, 22 Feb 2018 20:39:25 +0000 (20:39 +0000)]
Fix up sysctl vfs.buffercache broken in r329612

Sample problem:
top: sysctl(vfs.bufspace...) expected 8, got 4

Reported by: O. Hartmann <ohartmann walstatt.org>

6 years agolualoader: Attend to some 80-col issues, pointed out by luacheck
Kyle Evans [Thu, 22 Feb 2018 20:10:23 +0000 (20:10 +0000)]
lualoader: Attend to some 80-col issues, pointed out by luacheck

Graphics have a tendency to cause 80-col issues, so make an exception to our
standard indentation guidelines for these graphics. This does not hamper
readability too badly.

Two 40-column strings of spaces is trivially replaced with
string.rep(" ", 80)

6 years ago[chvgpio] add GPIO driver for Intel Z8xxx SoC family
Oleksandr Tymoshenko [Thu, 22 Feb 2018 19:12:32 +0000 (19:12 +0000)]
[chvgpio] add GPIO driver for Intel Z8xxx SoC family

Add chvgpio(4) driver for Intel Z8xxx SoC family. This product
was formerly known as Cherry Trail but Linux and OpenBSD drivers
refer to it as Cherry View. This driver is derived from OpenBSD
one so the name is kept for alignment with another BSD system.

Submitted by: Tom Jones <tj@enoti.me>
Reviewed by: gonzo, wblock(man page)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13086

6 years agoFix userboot w/ ZFS after r329725
Kyle Evans [Thu, 22 Feb 2018 18:49:53 +0000 (18:49 +0000)]
Fix userboot w/ ZFS after r329725

r329725 cleaned up ZFS commands duplicated in multiple places, but userboot
was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to
boot (as seen in PR 226118) in bhyve, with the following message:

/boot/userboot.so: Undefined symbol "ldi_get_size"

PR: 226118
Glanced at by: imp

6 years agonvmecontrol: fix build on amd64/clang
Alan Somers [Thu, 22 Feb 2018 17:47:16 +0000 (17:47 +0000)]
nvmecontrol: fix build on amd64/clang

Broken by: 329824
Sponsored by: Spectra Logic Corp

6 years agosched_ule: update a comment to reflect reality
Eric van Gyzen [Thu, 22 Feb 2018 17:09:26 +0000 (17:09 +0000)]
sched_ule: update a comment to reflect reality

MFC after: 3 days
Sponsored by: Dell EMC

6 years agonvme: Unbreak LE builds after r329824
Kyle Evans [Thu, 22 Feb 2018 16:16:49 +0000 (16:16 +0000)]
nvme: Unbreak LE builds after r329824

The parameter 'p' is unused if _BYTE_ORDER == _LITTLE_ENDIAN. Add in a
(void)p to fix the build.

6 years agolua-lint: Add note about luacheck in ports, silence warning
Kyle Evans [Thu, 22 Feb 2018 15:29:57 +0000 (15:29 +0000)]
lua-lint: Add note about luacheck in ports, silence warning

luacheck was added in ports r462609.

Silence warning about cli_execute -- it's non-standard, but for our setup it
will be a standard global.

6 years agoReturn correct error code to user-space when a system call receives a
Hans Petter Selasky [Thu, 22 Feb 2018 15:29:19 +0000 (15:29 +0000)]
Return correct error code to user-space when a system call receives a
signal in the LinuxKPI.

The read(), write() and mmap() system calls can return either EINTR or
ERESTART upon receiving a signal. Add code to figure out the correct
return value by temporarily storing the return code from the relevant
FreeBSD kernel APIs in the Linux task structure.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoNVMe: Add big-endian support
Wojciech Macek [Thu, 22 Feb 2018 13:32:31 +0000 (13:32 +0000)]
NVMe: Add big-endian support

Remove bitfields from defined structures as they are not portable.
Instead use shift and mask macros in the driver and nvmecontrol application.

NVMe is now working on powerpc64 host.

Submitted by:          Michal Stanek <mst@semihalf.com>
Obtained from:         Semihalf
Reviewed by:           imp, wma
Sponsored by:          IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D13916

6 years agoanother rework of getzfsvfs / getzfsvfs_impl code
Andriy Gapon [Thu, 22 Feb 2018 13:06:27 +0000 (13:06 +0000)]
another rework of getzfsvfs / getzfsvfs_impl code

This change is designed to account for yet another difference between
illumos and FreeBSD VFS.  In FreeBSD a filesystem driver is supposed to
clean up mnt_data in its VFS_UNMOUNT method because it's the last call
into the driver before a struct mount object is destroyed.  The VFS
drains all references to the object before destroying it, but for the
driver it's already as good as gone.
In contrast, illumos VFS provides another method, VFS_FREEVFS, that is
called when all references are drained.  So, the driver can keep its
data after VFS_UNMOUNT and clean it up in VFS_FREEVFS after all
references are gone. This is what ZFS does on illumos.
So there a reference to a filesystem is sufficient to guarantee that the
ZFS specific data, aka zfsvfs_t, stays around (even if the filesystem
gets unmounted).  In FreeBSD we need to vfs_busy the filesystem to get
the same guarantee.  vfs_ref guarantees only that the struct mount is
kept.

The following rules should be observed in getzfsvfs / getzfsvfs_impl on
FreeBSD:
- if we need access to zfsvfs_t then we must use vfs_busy
- if only we need to access struct mount (aka vfs_t), then vfs_ref is
  enough
- when illumos code actually needs only the vfs_t, they still can pass
  the zfsvfs_t and get the vfs_t from it;  that can work in FreeBSD if
  the filesystem is busied, but when it's just referenced then we have
  to pass the vfs_t explicitly
- we cannot call vfs_busy while holding a dataset because that creates a
  LOR with dp_config_rwlock

As a result:
- getzfsvfs_impl now only references the filesystem, same as in illumos,
  but unlike illumos it has to return the vfs_t
- the consumers are updated to account for the change
- getzfsvfs busies the filesystem (and drops the reference from
  getzfsvfs_impl)

Also, zfs_unmount_snap() now gets a busied a filesystem, references it
and then unbusies it essentially reverting actions done in getzfsvfs.
This is needed because the code may perform some checks that require the
zfsvfs_t.  So, those are done before the unbusying.

MFC after: 2 weeks

6 years agoAdd bsdlabel and fdisk to powerpc64
Wojciech Macek [Thu, 22 Feb 2018 12:31:28 +0000 (12:31 +0000)]
Add bsdlabel and fdisk to powerpc64

Submitted by:          Wojciech Macek <wma@semihalf.org>
Obtained from:         Semihalf
Sponsored by:          IBM, QCM Technologies

6 years agoRevert r329814 as well. It should have been in r329819.
Warner Losh [Thu, 22 Feb 2018 11:51:50 +0000 (11:51 +0000)]
Revert r329814 as well. It should have been in r329819.

6 years agofollowup to r329556, completely remove the covered vnode assert
Andriy Gapon [Thu, 22 Feb 2018 11:41:00 +0000 (11:41 +0000)]
followup to r329556, completely remove the covered vnode assert

vrele() acquires the vnode lock only if the hold count drops to zero.
In other scenarios it needs only the interlock.  So,
zfsctl_snapdir_lookup() can race with vfs_mount_destroy() -> vrele()
such that the lookup adds a new reference and then vrele() drops the
mountpoint's reference and only then we check the reference count.
It would be just one in this case.

In fact, the assert should have been removed in r323483 when the code
learned how to deal with the uncovered vnode.

PR: 225795
MFC after: 4 days
X-MFC with: r329556

6 years agoBackout r329818, r329816 and r329815.
Warner Losh [Thu, 22 Feb 2018 11:18:33 +0000 (11:18 +0000)]
Backout r329818, r329816 and r329815.

These aren't the commits I thought I was testing prior to
commit. Revert until I can sort out what happened and fix it.

6 years agoFix typo in last commit after last rebase before commit...
Warner Losh [Thu, 22 Feb 2018 10:55:23 +0000 (10:55 +0000)]
Fix typo in last commit after last rebase before commit...

6 years agoThe firewall_type is ignored if not set in rc.conf or rc.conf.local,
Marcelo Araujo [Thu, 22 Feb 2018 08:25:39 +0000 (08:25 +0000)]
The firewall_type is ignored if not set in rc.conf or rc.conf.local,
after r190575 there is an option to call rc.firewall with the firewall_type
passed in as an argument.

Submitted by: David P. Discher <dpd@dpdtech.com>
MFC after: 3 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D14286