Commit Graph

20152 Commits

Author SHA1 Message Date
Warner Losh
5bc9524c7d Add note about universe changes to arch and the need to add
MAKE_OBSOLETE_GCC to get old behavior on universe.
2019-10-09 21:45:40 +00:00
Dimitry Andric
8b3bc70a2b Merge ^/head r352764 through r353315. 2019-10-08 18:17:02 +00:00
Michael Tuexen
746c7ae563 In r343587 a simple port filter as sysctl tunable was added to siftr.
The new sysctl was not added to the siftr.4 man page at the time.
This updates the man page, and removes one left over trailing whitespace.

Submitted by:		Richard Scheffenegger
Reviewed by:		bcr@
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D21619
2019-10-07 20:35:04 +00:00
Edward Tomasz Napierala
1a13f2e6b4 Introduce stats(3), a flexible statistics gathering API.
This provides a framework to define a template describing
a set of "variables of interest" and the intended way for
the framework to maintain them (for example the maximum, sum,
t-digest, or a combination thereof).  Afterwards the user
code feeds in the raw data, and the framework maintains
these variables inside a user-provided, opaque stats blobs.
The framework also provides a way to selectively extract the
stats from the blobs.  The stats(3) framework can be used in
both userspace and the kernel.

See the stats(3) manual page for details.

This will be used by the upcoming TCP statistics gathering code,
https://reviews.freebsd.org/D20655.

The stats(3) framework is disabled by default for now, except
in the NOTES kernel (for QA); it is expected to be enabled
in amd64 GENERIC after a cool down period.

Reviewed by:	sef (earlier version)
Obtained from:	Netflix
Relnotes:	yes
Sponsored by:	Klara Inc, Netflix
Differential Revision:	https://reviews.freebsd.org/D20477
2019-10-07 19:05:05 +00:00
Kyle Evans
036d2e814b Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
Diff partially stolen from CheriBSD; these bits need -Wl,-z,notext in order
to build in an LLVM world. They are needed for all flavors/sizes of MIPS.
This will eventually get fixed in LLVM, but it's unclear when.

Reported by:	arichardson, emaste
Differential Revision:	https://reviews.freebsd.org/D21696
2019-10-06 04:19:49 +00:00
Yuri Pankov
f01edb6f5d Mark "private use area" characters as printable.
At least some of the characters in E000-F8FF range are used by Powerline
fonts, and having no attributes for these ranges in UnicodeData.txt
other than "Other, Private Use" it should be safe to mark all of them as
printable.  Some actually were before r340491, so this fixes the
regression introduced there as well.

PR:		240911
Reviewed by:	bapt
Tested by:	Daniel Ponte <amigan@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D21850
2019-10-05 22:17:54 +00:00
Jens Schweikhardt
6777f10c48 Correct grammos and typos. 2019-10-05 09:59:00 +00:00
Andriy Gapon
5fda0d60c1 add ability to set watchdog timeout for a shutdown
This change allows to specify a watchdog(9) timeout for a system
shutdown.  The timeout is activated when the watchdogd daemon is
stopped.  The idea is to a prevent any indefinite hang during late
stages of the shutdown.  The feature is implemented in rc.d/watchdogd,
it builds upon watchdogd -x option.

Note that the shutdown timeout is not actiavted when the watchdogd
service is individually stopped by an operator.  It is also not
activated for the 'shutdown' to the single-user mode.  In those cases it
is assumed that the operator knows what they are doing and they have
means to recover the system should it hang.

Significant subchanges and implementation details:
- the argument to rc.shutdown, completely unused before, is assigned to
  rc_shutdown variable that can be inspected by rc scripts
- init(8) passes "single" or "reboot" as the argument, this is not
  changed
- the argument is not mandatory and if it is not set then rc_shutdown is
  set to "unspecified"
- however, the default jail management scripts and jail configuration
  examples have been updated to pass "jail" to rc.shutdown, just in case
- the new timeout can be set via watchdogd_shutdown_timeout rc option
- for consistency, the regular timeout can now be set via
  watchdogd_timeout rc option
- watchdogd_shutdown_timeout and watchdogd_timeout override timeout
  specifications in watchdogd_flags
- existing configurations, where the new rc options are not set, should
  keep working as before

I am not particularly wed to any of the implementation specifics.
I am open to changing or removing any of them as long as the provided
functionality is the same (or very close) to the proposed one.
For example, I think it can be implemented without using watchdogd -x,
by means of watchdog(1) alone.  In that case there would be a small
window between stopping watchdogd and running watchdog, but I think that
that is acceptable.

Reviewed by:	bcr (man page changes)
MFC after:	5 weeks
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D21221
2019-10-03 11:23:10 +00:00
Gleb Smirnoff
631cabba47 - Remove the compile time limit for number of links a ng_bridge node
can handle.  Instead using an array on node private data, use per-hook
  private data.
- Use NG_NODE_FOREACH_HOOK() to traverse through hooks instead of array.

PR:		240787
Submitted by:	Lutz Donnerhacke <lutz donnerhacke.de>
Differential Revision:	  https://reviews.freebsd.org/D21803
2019-10-03 02:32:55 +00:00
Kyle Evans
982f1fc2d8 Override the TLS model when building mips64 binaries and static libraries
GCC uses "dynamic" TLS models when -fpic or -fPIC is explicitly
specified on the command line (which is only true for shared libraries).
It uses "static" (or "exec") TLS models otherwise.  In particular, GCC
does _not_ use dynamic TLS models when PIC is implicitly enabled (which
it is on MIPS), only if a PIC flag is explicitly provided.

llvm uses "dynamic" TLS models if PIC is enabled either via a PIC flag
or if it is implicily enabled (as on MIPS64).  This means that llvm on
MIPS64 always uses "dynamic" TLS models.  However, dynamic TLS models
do not work for static binaries and libraries as the __tls_get_addr
function they invoke is only defined in rtld.

Written by:	jhb
Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D21699
2019-10-02 17:18:18 +00:00
Hans Petter Selasky
048ddb58bc Move EEPROM information query from a sysctl in mlx5en(4) to an ioctl
in mlx5core. The EEPROM information is not only a property of the
mlx5en(4) driver.

Submitted by:	slavash@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 10:14:55 +00:00
Kyle Evans
f27f39db77 [1/3] Initial infrastructure for SSL root bundle in base
This setup will add the trusted certificates from the Mozilla NSS bundle
to base.

This commit includes:
- CAROOT option to opt out of installation of certs
- mtree amendments for final destinations
- infrastructure to fetch/update certs, along with instructions

A follow-up commit will add a certctl(8) utility to give the user control
over trust specifics. Another follow-up commit will actually commit the
initial result of updatecerts.

This work was done primarily by allanjude@, with minor contributions by
myself.

No objection from:	secteam
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16856
2019-10-02 01:05:29 +00:00
Simon J. Gerraty
911651d50f Need to use ${${_${group}DIR_${file}}} for STAGE_DIR
STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
${STAGE_OBJTOP}BINDIR rather than
${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR

Reviewed by:	stevek
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21858
2019-10-01 20:32:03 +00:00
Kyle Evans
01a0b1a4c2 Regen src.conf(5) after r352927 (HTTPD option added) 2019-10-01 14:56:31 +00:00
Kyle Evans
2d0a92c9ab Move simple_httpd out of picobsd, add HTTPD option (default OFF)
picobsd/tinyware has had this compact HTTPD server for a long time, and some
people do use it. Move it out into usr.sbin well in advance of any action
being taken on picobsd.

This has been gated behind an HTTPD option defaulted to *off*, primarily for
two reasons:
1.) This code likely needs a good audit, as it's been living off in picobsd
    land for a long time, and
2.) We don't currently ship an httpd and this may not be a welcome surprise.

Reviewed by:	eugen
Differential Revision:	https://reviews.freebsd.org/D21724
2019-10-01 14:55:16 +00:00
Edward Tomasz Napierala
a5adff0eeb Rename ARB_REBALANCE(3) to ARB_REINSERT(3) to match tree(3),
and document it.

MFC after:	2 weeks
Sponsored by:	Klara Inc, Netflix
2019-09-28 09:50:01 +00:00
Edward Tomasz Napierala
160afacf5b Sort MLINKS for arb(3), and actually make them work by fixing a '=' vs '+='
mixup.

MFC after:	2 weeks
Sponsored by:	Klara Inc, Netflix
2019-09-28 09:37:05 +00:00
Edward Tomasz Napierala
2282376483 Add RB_REINSERT(3), a low overhead alternative to removing a node
and reinserting it back with an updated key.

This is one of dependencies for the upcoming stats(3) code.

Reviewed by:	cem
Obtained from:	Netflix
MFC after:	2 weeks
Sponsored by:	Klara Inc, Netflix
Differential Revision:	https://reviews.freebsd.org/D21786
2019-09-28 09:22:52 +00:00
Pawel Biernacki
944e67b9cb Add myself (kaktus) as a src commiter.
Reviewed by:	kib (mentor)
Approved by:	kib (mentor), mjg (mentor)
Differential Revision:	https://reviews.freebsd.org/D21811
2019-09-27 10:19:28 +00:00
Dimitry Andric
668ee10168 Merge ^/head r352587 through r352763. 2019-09-26 18:25:54 +00:00
Dimitry Andric
6b3555c38e Enable OpenMP for powerpc64
Summary: When powerpc64 switches to LLVM, use this patch to enable
OpenMP as well. OpenMP on PPC is only for 64-bits, so don't make a
32-bit libomp. A change to openmp files is necesssary (under review on
https://reviews.llvm.org/D67190), because it determines ELF format
version based on endianness, which is incorrect.

Reviewed by:	alfredo.junior_eldorado.org.br, #manpages
Differential Revision: https://reviews.freebsd.org/D21532
2019-09-26 18:24:04 +00:00
Dimitry Andric
e11365676b In suite.test.mk, test if ${DESTDIR} exists before attempting to run
chflags -R on it, otherwise the command will error out.  (Note that
adding -f to the chflags invocation does not help, unlike with rm.)

MFC after:	3 days
2019-09-25 17:52:59 +00:00
Dimitry Andric
f05b9584fa Merge ^/head r352537 through r352586. 2019-09-21 21:02:57 +00:00
Mateusz Piotrowski
e100548404 ascii(7): Add STANDARDS section and update HISTORY section
PR:		240727
Submitted by:	Gordon Bergling <gbergling@gmail.com>
Approved by:	src (imp)
Event:		EuroBSDcon 2019
2019-09-21 14:16:37 +00:00
Dimitry Andric
0f80acb965 Merge ^/head r352436 through r352536. 2019-09-19 19:26:12 +00:00
Baptiste Daroussin
85686f3425 Add the missing bits for LIBADD to properly function now that
libarchive is linked to libzstd

Pointy hat:	bapt
Reported by:	antoine
2019-09-18 08:02:03 +00:00
Kyle Evans
05e08cbdac src.conf(5): regenerate after r352465, r352466
These changed the defaults for the GOOGLETEST knob and added a description
for WITH_GOOGLETEST.
2019-09-18 02:04:41 +00:00
Kyle Evans
15b53426e8 googletest: default-disable on all of MIPS for now
Parts of the fusefs tests trigger a bug in current versions of llvm: IR
representation of some routine for the MIPS targets is a function with a
large number of arguments. This then leads the compiler on an hour+ long
goose chase, which is OK if you build the current tree but less-so if you're
trying external toolchain or doing a universe build involving mips when it
eventually gets switched over to LLVM.

Better, accurate details can be found in LLVM PR43263.
2019-09-18 01:58:56 +00:00
Dimitry Andric
419f843fff Merge ^/head r352319 through r352435. 2019-09-17 06:08:15 +00:00
Dimitry Andric
2c3f47a727 Another round of attempting to squelch -Wdeprecated-declarations, which
has become very trigger-happy with libc++ 9.0.0.

It does not help that gcc's implementation of this warning is even more
trigger-happy, in the sense that it already warns on the declaration
itself, not when you are using it.  This is very annoying with our use
of -Wsystem-headers.  That should really be disabled for gcc.
2019-09-17 06:07:08 +00:00
Dmitri Goutnik
b077310f30 Amend r352422, add missing 'n'
Reported by:	yuripv
Approved by:	araujo (mentor)
Differential Revision:	https://reviews.freebsd.org/D21679
2019-09-17 00:22:20 +00:00
Dmitri Goutnik
e7e4d3adb7 Add myself (dmgk) as a ports committer
Approved by:	tz (mentor)
Differential Revision:	https://reviews.freebsd.org/D21672
2019-09-16 20:41:37 +00:00
Mark Johnston
38a20ba16f Fix a couple of nits in r352110.
- Remove a dead variable from the amd64 pmap_extract_and_hold().
- Fix grammar in the vm_page_wire man page.

Reported by:	alc
Reviewed by:	alc, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21639
2019-09-16 15:06:19 +00:00
Mark Johnston
e8bcf6966b Revert r352406, which contained changes I didn't intend to commit. 2019-09-16 15:04:45 +00:00
Mark Johnston
41fd4b9422 Fix a couple of nits in r352110.
- Remove a dead variable from the amd64 pmap_extract_and_hold().
- Fix grammar in the vm_page_wire man page.

Reported by:	alc
Reviewed by:	alc, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21639
2019-09-16 15:03:12 +00:00
Yuri Pankov
e3e469850c sbuf(9): fix sbuf_drain_func typedef markup
Reviewed by:	0mp (previous version)
Differential Revision:	https://reviews.freebsd.org/D21569
2019-09-16 13:10:03 +00:00
Simon J. Gerraty
84bfb424e2 Document logic for __DEFAULT_DEPENDENT_OPTIONS
Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D21640
2019-09-16 00:32:23 +00:00
Edward Tomasz Napierala
fad4b12b90 Introduce arb(3), the Array-based Red-Black Tree macros: similar
to the traditional tree(3) RB trees, but using an array (preallocated,
linear chunk of memory) to store the tree.

This avoids allocation overhead, improves memory locality,
and makes it trivially easy to share/transfer/copy the entire tree
without the need for marshalling.  The downside is that the size
is fixed at initialization time; there is no mechanism to resize
it.

This is one of the dependencies for the new stats(3) framework
(https://reviews.freebsd.org/D20477).

Reviewed by:	bcr (man pages), markj
Discussed with:	cem
MFC after:	2 weeks
Sponsored by:	Klara Inc, Netflix
Obtained from:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20324
2019-09-14 19:23:46 +00:00
Dimitry Andric
23e2b4d9b1 Instead of disabling gcc's deprecated declaration warnings about e.g.
std::auto_ptr in a whole bunch of individual Makefiles, make the warning
globally non-fatal instead.  This is similar to what was done to many
more non-fatal warnings from newer gcc versions.
2019-09-14 19:16:28 +00:00
Stephen Gregoratto
f1343abc96 amend r:352320 Fix date for sg@
Approved by:    bcr (mentor)
2019-09-14 14:26:30 +00:00
Stephen Gregoratto
79d0e71c87 Set bcr@ mentor for sg@
Approved by:    bcr (mentor)
2019-09-14 12:40:46 +00:00
Dimitry Andric
61c1328eb0 Merge ^/head r352105 through r352307. 2019-09-13 21:15:01 +00:00
Jason Helfman
9ecaaee305 - fix a minor typo
PR:		240447
Submitted by:	brigadir15@gmail.com
MFC after:	1 week
2019-09-10 22:44:09 +00:00
Baptiste Daroussin
98ac0a3d6a Remove reference to mklocale regarding the nls directory
mklocale never had anything to do with the content of this directory

MFC after:	3 days
2019-09-10 07:40:45 +00:00
Conrad Meyer
8b6acd2b51 ddb(4): Add 'show route <dest>' and 'show routetable [<af>]'
These commands show the route resolved for a specified destination, or
print out the entire routing table for a given address family (or all
families, if none is explicitly provided).

Discussed with:	emaste
Differential Revision:	https://reviews.freebsd.org/D21510
2019-09-09 22:54:27 +00:00
Mark Johnston
fee2a2fa39 Change synchonization rules for vm_page reference counting.
There are several mechanisms by which a vm_page reference is held,
preventing the page from being freed back to the page allocator.  In
particular, holding the page's object lock is sufficient to prevent the
page from being freed; holding the busy lock or a wiring is sufficent as
well.  These references are protected by the page lock, which must
therefore be acquired for many per-page operations.  This results in
false sharing since the page locks are external to the vm_page
structures themselves and each lock protects multiple structures.

Transition to using an atomically updated per-page reference counter.
The object's reference is counted using a flag bit in the counter.  A
second flag bit is used to atomically block new references via
pmap_extract_and_hold() while removing managed mappings of a page.
Thus, the reference count of a page is guaranteed not to increase if the
page is unbusied, unmapped, and the object's write lock is held.  As
a consequence of this, the page lock no longer protects a page's
identity; operations which move pages between objects are now
synchronized solely by the objects' locks.

The vm_page_wire() and vm_page_unwire() KPIs are changed.  The former
requires that either the object lock or the busy lock is held.  The
latter no longer has a return value and may free the page if it releases
the last reference to that page.  vm_page_unwire_noq() behaves the same
as before; the caller is responsible for checking its return value and
freeing or enqueuing the page as appropriate.  vm_page_wire_mapped() is
introduced for use in pmap_extract_and_hold().  It fails if the page is
concurrently being unmapped, typically triggering a fallback to the
fault handler.  vm_page_wire() no longer requires the page lock and
vm_page_unwire() now internally acquires the page lock when releasing
the last wiring of a page (since the page lock still protects a page's
queue state).  In particular, synchronization details are no longer
leaked into the caller.

The change excises the page lock from several frequently executed code
paths.  In particular, vm_object_terminate() no longer bounces between
page locks as it releases an object's pages, and direct I/O and
sendfile(SF_NOCACHE) completions no longer require the page lock.  In
these latter cases we now get linear scalability in the common scenario
where different threads are operating on different files.

__FreeBSD_version is bumped.  The DRM ports have been updated to
accomodate the KPI changes.

Reviewed by:	jeff (earlier version)
Tested by:	gallatin (earlier version), pho
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20486
2019-09-09 21:32:42 +00:00
Chris Rees
58a11be1cf Reverse the referenced tables.
If ipv4_prefer is specified, Section 10.3 is relevant.
If ipv6_prefer is specified, Section  2.1 is relevant.

This change makes the corresponding options/sections 'respective'

PR:		docs/234249
Submitted by:	David Fiander <david@fiander.info>
2019-09-09 20:48:12 +00:00
Dimitry Andric
f993ed2fbd Merge ^/head r351732 through r352104. 2019-09-09 19:58:46 +00:00
Mitchell Horne
e90bb1adec Allow for compiler versions >= 10
Both clang and gcc development branches have reached version 10. Since we
only parse for a single digit in the major version number, this causes
COMPILER_VERSION to be set to its default of 0.0.0, meaning version checks
fail with these newer compilers.

Reviewed by:	emaste
Approved by:	markj (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21413
2019-09-08 19:40:52 +00:00
Simon J. Gerraty
f18ca7f311 Use file destdir for stage_as sets
We cannot use file (without :T) to name targets
but we can use the destination directory (with / replaced by _)
This has the benefit of minimizing the targets created.

Reviewed by:	bdrewery
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org//D21283
2019-09-06 19:05:01 +00:00
Mateusz Piotrowski
bb66a3e948 rc.8: Update documentation regarding old-style rc scripts
The EXAMPLES section does not contain any examples of output formats for
the old-style scripts. Remove the misleading bits stating otherwise.

Reviewed by:	bcr, imp
Approved by:	src (imp)
Differential Revision:	https://reviews.freebsd.org/D21552
2019-09-06 18:51:41 +00:00
Scott Long
e996e2bd6e Add myself as a mentor for Scott Phillip (scottph) 2019-09-06 17:06:48 +00:00
Emmanuel Vadot
725ee594b4 pkgbase: r351861 didn't solve everything, we need to default to the utilities package too 2019-09-06 12:26:45 +00:00
Takanori Watanabe
ca78bcd73b Add embedded Managed Object Format blob access to acpi_wmi(4).
This blob is can be converted to human readable form by bmfdec.
(http://github.com/pali/bmfdec)

Differential Revision:	https://reviews.freebsd.org/D21529
2019-09-06 10:12:05 +00:00
D Scott Phillips
ed4e4cff0e nvdimm(4): Add description of NVDIMM Namespace support
Reviewed by:	kib, bcr
Approved by:	emaste (mentor)
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D21536
2019-09-05 20:51:41 +00:00
Emmanuel Vadot
f6a3b357e9 pkgbase: Add the pkg trusted keys to the FreeBSD-utilities package 2019-09-05 19:17:17 +00:00
Mateusz Piotrowski
d15e810db9 rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd)
A user may set ${name}_env variable in rc.conf(5) in order to set additional
environment variables for a service command.  Unfortunately, at the moment
this variable is only honored when the command is specified via the command
variable. Those additional environment variables coming from ${name}_env
are never set if the service is started via the ${rc_arg}_cmd variable (for
example start_cmd).

PR:		239692
Reviewed by:	bcr, jilles
Approved by:	src (jilles)
Differential Revision:	https://reviews.freebsd.org/D21228
2019-09-05 14:52:22 +00:00
Emmanuel Vadot
5112cfa07b pkgbase: Handle FILES when no FILESGROUP isn't used
bsd.files.mk only add the TAG when groups are used, fix this.

Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D21520
2019-09-05 14:18:13 +00:00
Emmanuel Vadot
ce49128a13 pkgbase: Add tag for LIBSYMLINK case
Otherwised the files aren't packaged.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D21508
2019-09-05 14:17:28 +00:00
Emmanuel Vadot
dba1420463 pkgbase: Add tags for includes in bsd.incs.mk
Otherwise the files aren't packaged.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D21507
2019-09-05 14:16:39 +00:00
Emmanuel Vadot
4c1a82cea5 pkgbase: Create a FreeBSD-utilities package and make it the default one
The default package use to be FreeBSD-runtime but it should only contain
binaries and libs enough to boot to single user and repair the system, it
is also very handy to have a package that can be tranform to a small mfsroot.
So create a new package named FreeBSD-utilities and make it the default one.
Also move a few binaries and lib into this package when it make sense.
Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D21506
2019-09-05 14:15:47 +00:00
Emmanuel Vadot
a7b5a3d486 pkgbase: Put a lot of binaries and lib in FreeBSD-runtime
All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.

Reviewed by:    bapt, gjb
Differential Revision:  https://reviews.freebsd.org/D21503
2019-09-05 14:13:08 +00:00
Bryan Drewery
5d0866bcea PROGS: Build common sources before recursed PROGS_TARGETS as well when building.
MFC after:	2 weeks
Sponsored by:	DellEMC
2019-09-04 18:32:11 +00:00
Jason Helfman
f4d7986ce1 - correct HISTORY section
- while here clarify wording

PR:		240260 (based on)
Submitted by:	gbergling@gmail.com
MFC after:	after 1 week
2019-09-04 17:52:30 +00:00
Kris Moore
59e50df3cd - Retire pc-sysinstall(8)
https://reviews.freebsd.org/D21094

Submitted by: kmoore@FreeBSD.org
Approved by: imp@FreeBSD.org
2019-09-03 19:42:04 +00:00
Mark Johnston
e46cfc2542 Revert a portion of r351628 that I did not mean to commit.
Reported by:	mjg
MFC with:	r351628
2019-09-03 14:39:36 +00:00
Dimitry Andric
c5c3ba6b43 Merge ^/head r351317 through r351731. 2019-09-03 05:58:43 +00:00
Dimitry Andric
b903ca97ef Add workarounds for obsolete std::auto_ptr usage in atf. 2019-09-03 05:55:56 +00:00
Ian Lepore
385a0efed3 Fix the name of the devicetree bindings document file cited in the manpage.
Reported by:	thj@
2019-09-02 18:32:08 +00:00
Mark Johnston
08cfa56ea3 Extend uma_reclaim() to permit different reclamation targets.
The page daemon periodically invokes uma_reclaim() to reclaim cached
items from each zone when the system is under memory pressure.  This
is important since the size of these caches is unbounded by default.
However it also results in bursts of high latency when allocating from
heavily used zones as threads miss in the per-CPU caches and must
access the keg in order to allocate new items.

With r340405 we maintain an estimate of each zone's usage of its
(per-NUMA domain) cache of full buckets.  Start making use of this
estimate to avoid reclaiming the entire cache when under memory
pressure.  In particular, introduce TRIM, DRAIN and DRAIN_CPU
verbs for uma_reclaim() and uma_zone_reclaim().  When trimming, only
items in excess of the estimate are reclaimed.  Draining a zone
reclaims all of the cached full buckets (the previous behaviour of
uma_reclaim()), and may further drain the per-CPU caches in extreme
cases.

Now, when under memory pressure, the page daemon will trim zones
rather than draining them.  As a result, heavily used zones do not incur
bursts of bucket cache misses following reclamation, but large, unused
caches will be reclaimed as before.

Reviewed by:	jeff
Tested by:	pho (an earlier version)
MFC after:	2 months
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D16667
2019-09-01 22:22:43 +00:00
Ed Maste
6c30aa54c3 Remove CLANG_NO_IAS definition
CLANG_NO_IAS is not used anywhere in the tree.

Sponsored by:	The FreeBSD Foundation
2019-09-01 16:47:48 +00:00
Santhosh Raju
47b9005348 Add myself (fox) and update the mentor information.
Approved by:	philip (mentor)
2019-09-01 15:39:28 +00:00
Jung-uk Kim
1c9c1f5903 Add support for TP-Link Archer T2U Nano.
MFC after:	2 weeks
2019-09-01 06:40:58 +00:00
Sevan Janiyan
e12102f114 Earliest reference to /dev/null I can find is in v4 sh(1) and nulldev in
nsys/ken/subr.c
via TUHS archive
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4

MFC after:	5 days
2019-08-30 21:49:00 +00:00
Mark Johnston
d794b3a3c2 Update and clean up the UMA man page.
- Fix warnings from igor and mandoc.
- Provide a brief description of the separation between zones and their
  backend slab allocators.
- Document cache zones and secondary zones.
- Document the kernel config options added in r350659.
- Document the uma_zalloc_pcpu() and uma_zfree_pcpu() wrappers.
- Document uma_zone_reserve(), uma_zone_reserve_kva() and
  uma_zone_prealloc().
- Document uma_zone_alloc() and uma_zone_freef().
- Add some missing MLINKs and Xrefs.

MFC after:	2 weeks
2019-08-30 19:35:44 +00:00
Alexander Motin
f4330e6155 Man page for AMD Non-Transparent Bridge (ntb_hw_amd) driver.
Submitted by:	Rajesh Kumar <rajesh1.kumar@amd.com>
Reviewed by:	bcr
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D21462
2019-08-29 13:46:54 +00:00
Edward Tomasz Napierala
5a38af1fb8 Introduce <sys/qmath.h>, a fixed-point math library from Netflix.
This makes it possible to perform mathematical operations
on
fractional values without using floating point. It operates on Q
numbers, which are integer-sized, opaque structures initialized
to hold a chosen number of integer and fractional
bits.


For a general description of the Q number system, see the "Fixed Point
Representation & Fractional Math" whitepaper[1]; for the actual
API see the qmath(3) man page.

This is one of dependencies for the upcoming stats(3) framework[2]
that will be applied to the TCP stack in a later commit.

1. https://www.superkits.net/whitepapers/Fixed%20Point%20Representation%20&%20Fractional%20Math.pdf
2. https://reviews.freebsd.org/D20477

Reviewed by:	bcr (man pages, earlier version), sef (earlier version)
Discussed with:	cem, dteske, imp, lstewart
Sponsored By:	Klara Inc, Netflix
Obtained from:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20116
2019-08-27 11:46:22 +00:00
John Baldwin
b2e60773c6 Add kernel-side support for in-kernel TLS.
KTLS adds support for in-kernel framing and encryption of Transport
Layer Security (1.0-1.2) data on TCP sockets.  KTLS only supports
offload of TLS for transmitted data.  Key negotation must still be
performed in userland.  Once completed, transmit session keys for a
connection are provided to the kernel via a new TCP_TXTLS_ENABLE
socket option.  All subsequent data transmitted on the socket is
placed into TLS frames and encrypted using the supplied keys.

Any data written to a KTLS-enabled socket via write(2), aio_write(2),
or sendfile(2) is assumed to be application data and is encoded in TLS
frames with an application data type.  Individual records can be sent
with a custom type (e.g. handshake messages) via sendmsg(2) with a new
control message (TLS_SET_RECORD_TYPE) specifying the record type.

At present, rekeying is not supported though the in-kernel framework
should support rekeying.

KTLS makes use of the recently added unmapped mbufs to store TLS
frames in the socket buffer.  Each TLS frame is described by a single
ext_pgs mbuf.  The ext_pgs structure contains the header of the TLS
record (and trailer for encrypted records) as well as references to
the associated TLS session.

KTLS supports two primary methods of encrypting TLS frames: software
TLS and ifnet TLS.

Software TLS marks mbufs holding socket data as not ready via
M_NOTREADY similar to sendfile(2) when TLS framing information is
added to an unmapped mbuf in ktls_frame().  ktls_enqueue() is then
called to schedule TLS frames for encryption.  In the case of
sendfile_iodone() calls ktls_enqueue() instead of pru_ready() leaving
the mbufs marked M_NOTREADY until encryption is completed.  For other
writes (vn_sendfile when pages are available, write(2), etc.), the
PRUS_NOTREADY is set when invoking pru_send() along with invoking
ktls_enqueue().

A pool of worker threads (the "KTLS" kernel process) encrypts TLS
frames queued via ktls_enqueue().  Each TLS frame is temporarily
mapped using the direct map and passed to a software encryption
backend to perform the actual encryption.

(Note: The use of PHYS_TO_DMAP could be replaced with sf_bufs if
someone wished to make this work on architectures without a direct
map.)

KTLS supports pluggable software encryption backends.  Internally,
Netflix uses proprietary pure-software backends.  This commit includes
a simple backend in a new ktls_ocf.ko module that uses the kernel's
OpenCrypto framework to provide AES-GCM encryption of TLS frames.  As
a result, software TLS is now a bit of a misnomer as it can make use
of hardware crypto accelerators.

Once software encryption has finished, the TLS frame mbufs are marked
ready via pru_ready().  At this point, the encrypted data appears as
regular payload to the TCP stack stored in unmapped mbufs.

ifnet TLS permits a NIC to offload the TLS encryption and TCP
segmentation.  In this mode, a new send tag type (IF_SND_TAG_TYPE_TLS)
is allocated on the interface a socket is routed over and associated
with a TLS session.  TLS records for a TLS session using ifnet TLS are
not marked M_NOTREADY but are passed down the stack unencrypted.  The
ip_output_send() and ip6_output_send() helper functions that apply
send tags to outbound IP packets verify that the send tag of the TLS
record matches the outbound interface.  If so, the packet is tagged
with the TLS send tag and sent to the interface.  The NIC device
driver must recognize packets with the TLS send tag and schedule them
for TLS encryption and TCP segmentation.  If the the outbound
interface does not match the interface in the TLS send tag, the packet
is dropped.  In addition, a task is scheduled to refresh the TLS send
tag for the TLS session.  If a new TLS send tag cannot be allocated,
the connection is dropped.  If a new TLS send tag is allocated,
however, subsequent packets will be tagged with the correct TLS send
tag.  (This latter case has been tested by configuring both ports of a
Chelsio T6 in a lagg and failing over from one port to another.  As
the connections migrated to the new port, new TLS send tags were
allocated for the new port and connections resumed without being
dropped.)

ifnet TLS can be enabled and disabled on supported network interfaces
via new '[-]txtls[46]' options to ifconfig(8).  ifnet TLS is supported
across both vlan devices and lagg interfaces using failover, lacp with
flowid enabled, or lacp with flowid enabled.

Applications may request the current KTLS mode of a connection via a
new TCP_TXTLS_MODE socket option.  They can also use this socket
option to toggle between software and ifnet TLS modes.

In addition, a testing tool is available in tools/tools/switch_tls.
This is modeled on tcpdrop and uses similar syntax.  However, instead
of dropping connections, -s is used to force KTLS connections to
switch to software TLS and -i is used to switch to ifnet TLS.

Various sysctls and counters are available under the kern.ipc.tls
sysctl node.  The kern.ipc.tls.enable node must be set to true to
enable KTLS (it is off by default).  The use of unmapped mbufs must
also be enabled via kern.ipc.mb_use_ext_pgs to enable KTLS.

KTLS is enabled via the KERN_TLS kernel option.

This patch is the culmination of years of work by several folks
including Scott Long and Randall Stewart for the original design and
implementation; Drew Gallatin for several optimizations including the
use of ext_pgs mbufs, the M_NOTREADY mechanism for TLS records
awaiting software encryption, and pluggable software crypto backends;
and John Baldwin for modifications to support hardware TLS offload.

Reviewed by:	gallatin, hselasky, rrs
Obtained from:	Netflix
Sponsored by:	Netflix, Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D21277
2019-08-27 00:01:56 +00:00
Edward Tomasz Napierala
375409b48b .Xr ports(7) and development(7).
MFC after:	2 weeks
2019-08-26 10:16:46 +00:00
Hiroki Sato
0e31d5241d Document soft updates journaling and GEOM-based UFS journaling.
Reviewed by:	mckusick
2019-08-25 18:52:10 +00:00
Konstantin Belousov
d2757137b8 Add nvdimm(4) man page.
Reviewed by:	emaste
Discussed with:	scottl, scottph
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D21386
2019-08-24 15:38:07 +00:00
Warner Losh
7574e8572d Turn off -Werror for gcc 4.2.1 for userland
As discussed on arch@, gcc 4.2.1 is on its way out. Turn off Werror on gcc
versions < 5.0 permantly. This will allow older platforms to continue to compile
w/o new errors once we take them out of universe by default. This will also free
developers from chasing down obsolete warnings that produce no beneficial
changes to the source.

Discussed on: arch@
Reviewed by: jhb@, emaste@, pfg@
Differential Revision: https://reviews.freebsd.org/D21378
2019-08-23 16:42:39 +00:00
Mark Johnston
5b699f1614 Add lockmgr(9) probes to the lockstat DTrace provider.
They follow the conventions set by rw and sx lock probes.  There is
an additional lockstat:::lockmgr-disown probe.

Update lockstat(1) to report on contention and hold events for
lockmgr locks.  Document the new probes in dtrace_lockstat.4, and
deduplicate some of the existing probe descriptions.

Reviewed by:	mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21355
2019-08-21 23:43:58 +00:00
Warner Losh
51c5de5f25 Document RST support in nvme(4) and ahci(4). 2019-08-21 22:18:07 +00:00
John Baldwin
93a0379392 Trim a spurious blank line I added in r348969.
I did not bump .Dd since there is no content change.

MFC after:	3 days
2019-08-19 17:28:12 +00:00
Vincenzo Maffione
421c620837 link ptnet(4) man page to the build system
Reported by:	kevans
Reviewed by:	kevans, bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21312
2019-08-19 17:26:04 +00:00
Konstantin Belousov
3a91d1062a i386: Implement atomic_load_64(9) and atomic_store_64(9).
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-08-18 15:58:44 +00:00
Ed Maste
2fe25d1638 arch.7: indicate expectation that arm (i.e., v5) will be removed before 13.0
MFC after:	1 week
2019-08-16 14:06:04 +00:00
Ed Maste
3a26da0b5c Regen src.conf.5 after r351027 (enable BSD_CRTBEGIN on powerpc) 2019-08-16 13:50:44 +00:00
Alexander Motin
105a032977 Limit memory window usage in ntb_transport to 256MB.
This adds safety net for the case of misconfigured NTB with too big
memory window, for which we may be unable to allocate a memory buffer,
which does not make much sense for the network interface.  While there,
fix the code to really work with asymmetric window sizes setup.

This makes driver just print warning message on boot instead of hanging
if too large memory window is configured.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-08-15 22:55:59 +00:00
Alexander Motin
63ac15aba4 Add NTB modules to i386 build.
There is no reason why NTB should not be usable on i386 if memory windows
are small enough.
2019-08-15 16:27:04 +00:00
Ed Maste
e5c6dece98 do not enable userland retpoline if not supported by compiler/linker
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21101
2019-08-15 12:48:17 +00:00
Simon J. Gerraty
5c5316098e Revert prior change till installworld sorted 2019-08-15 06:00:55 +00:00
Doug Moore
504f5e294e swap_pager.c reserves 2 blocks for a bsd label. Change that 2 to the
expression howmany(BBSIZE, PAGE_SIZE), where BBSIZE is the size of the
boot block area.  That can be less than 2 if PAGE_SIZE is big.

swapon(8) has an option to trim (delete) all the blocks of a device at
startup.  However, if the first of those blocks is a bsd label, then
trimming those blocks is destructive.  Change swapon to leave the
first BBSIZE bytes untrimmed.

Update manual pages to reflect changes in how swapon and how it may be
used, espeically in association with savecore.

Reviewed by: alc
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21191
2019-08-15 02:30:44 +00:00
Ed Maste
c06ccdd2ba arch.7: be explicit about the future for unmigrated GCC 4.2.1 archs
Reported by:	imp
MFC after:	1 week
MFC with:	r351036
2019-08-15 02:14:44 +00:00
Simon J. Gerraty
f4ff569996 bsd.files.mk: fix targets to avoid directories
Reintroduce :T when file is used as part of a target name.

Reviewed by:	stevek
2019-08-14 22:33:46 +00:00
Ed Maste
4ef280656c arch.7: clarify that the table shows the default tool chain
Reported by:	jhb
MFC after:	1 week
MFC with:	r351035
Sponsored by:	The FreeBSD Foundation
2019-08-14 17:17:52 +00:00
Ed Maste
ff03c71275 arch.7: add deprecation notice for GCC 4.2.1
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-14 17:13:36 +00:00
Ed Maste
4715c31e3e arch.7: add tool chain table
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-14 17:04:28 +00:00
Andrew Turner
4ee71ec9eb Enable BSD_CRTBEGIN on powerpc
In r342974 jhibbits added support to build crtsavres.o. This was the
blocker for BSD_CRTBEGIN to be enabled there. As such enable this
option again.

Reviewed by:	jhibbits
Sponsored by:	DARPA, AFRL
2019-08-14 14:31:17 +00:00
Conrad Meyer
eefd8f96fb geom_uzip(4), mkuzip(8): Add Zstd image mode
The Zstd format bumps the CLOOP major number to 4 to avoid incompatibility
with older systems.  Support in geom_uzip(4) is conditional on the ZSTDIO
kernel option, which is enabled in amd64 GENERIC, but not all in-tree
configurations.

mkuzip(8) was modified slightly to always initialize the nblocks + 1'th
offset in the CLOOP file format.  Previously, it was only initialized in the
case where the final compressed block happened to be unaligned w.r.t.
DEV_BSIZE.  The "Fake" last+1 block change in r298619 means that the final
compressed block's 'blen' was never correct unless the compressed uzip image
happened to be BSIZE-aligned.  This happened in about 1 out of every 512
cases.  The zlib and lzma decompressors are probably tolerant of extra trash
following the frame they were told to decode, but Zstd complains that the
input size is incorrect.

Correspondingly, geom_uzip(4) was modified slightly to avoid trashing the
nblocks + 1'th offset when it is known to be initialized to a good value.
This corrects the calculated final real cluster compressed length to match
that printed by mkuzip(8).

mkuzip(8) was refactored somewhat to reduce code duplication and increase
ease of adding other compression formats.

  * Input block size validation was pulled out of individual compression
    init routines into main().

  * Init routines now validate a user-provided compression level or select
    an algorithm-specific default, if none was provided.

  * A new interface for calculating the maximal compressed size of an
    incompressible input block was added for each driver.  The generic code
    uses it to validate against MAXPHYS as well as to allocate compression
    result buffers in the generic code.

  * Algorithm selection is now driven by a table lookup, to increase ease of
    adding other formats in the future.

mkuzip(8) gained the ability to explicitly specify a compression level with
'-C'.  The prior defaults -- 9 for zlib and 6 for lzma -- are maintained.
The new zstd default is 9, to match zlib.

Rather than select lzma or zlib with '-L' or its absense, respectively, a
new argument '-A <algorithm>' is provided to select 'zlib', 'lzma', or
'zstd'.  '-L' is considered deprecated, but will probably never be removed.

All of the new features were documented in mkuzip.8; the page was also
cleaned up slightly.

Relnotes:	yes
2019-08-13 23:32:56 +00:00
Conrad Meyer
ac8e5d02cf Remove deprecated GEOM classes
Follow-up on r322318 and r322319 and remove the deprecated modules.

Shift some now-unused kernel files into userspace utilities that incorporate
them.  Remove references to removed GEOM classes in userspace utilities.

Reviewed by:	imp (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21249
2019-08-13 20:06:55 +00:00
Ed Maste
76acea155a Remove some more leftover rlogin man page xrefs
rcmds were removed in r32435 and these three man pages can trivially
drop the references.

There's still a reference in pts.4 because it describes a mode
(TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
that use that mode.  To update later.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-13 15:41:36 +00:00
Ed Maste
85d553093f Regen src.conf.5 after r350980 (remove rsh/rlogin references)
Also pick up changes to LLVM_TARGET_RISCV, NAND, NVME, OPENM

Sponsored by:	The FreeBSD Foundation
2019-08-13 14:57:04 +00:00
Ed Maste
7e527d268e Remove rsh/rlogin references from security man page
More extensive changes to this page are certainly needed, but at least
remove references to binaries that no longer exist.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-13 14:47:24 +00:00
Ian Lepore
649e762762 Fix the driver name in ads111x.4, and hook the manpage up to the build.
The driver was originally written with the name ads1115, but at the last
minute it got renamed to ads111x to reflect its support for many related
chips, but I forgot to update the manpage to match the renaming before
committing it all.
2019-08-13 03:49:53 +00:00
Pedro F. Giffuni
98a43f9e22 Add deprecation notice to snd_maestro(4).
As suggested in:
https://wiki.freebsd.org/WhatsGoing/FreeBSD13

this old driver is buggy and no one is working on it so we should deprecate
it for the next release.

MFC after:	3 days
Diferential Revision:	https://reviews.freebsd.org/D21139
2019-08-13 01:25:07 +00:00
Pedro F. Giffuni
8068df3535 Add deprecation notice to snd_ds1(4).
As suggested in:
https://wiki.freebsd.org/WhatsGoing/FreeBSD13

We will be dropping the snd_ds1 driver. The driver is known to be buggy
and no one has been working on it for years now.
Users of old Yamaha cards may have luck with the OSS drivers instead.

MFC after:	3 days
Diferential Revision:	https://reviews.freebsd.org/D21138
2019-08-13 01:24:43 +00:00
Conrad Meyer
47fec6f3b5 r350739 try #2
For some inexplicable reason, C++ compilers reject the -Wno- flag, and also
(ab)use CWARNFLAGS.

Reported by:	imp
2019-08-08 04:29:46 +00:00
Conrad Meyer
be3ab1876e Disable useless -Wformat-zero-length
It is part of -Wformat, which is enabled by -Wall.  Empty format strings are
well defined and it is perfectly reasonable to expect them in a formatting
interface.
2019-08-08 03:27:46 +00:00
Li-Wen Hsu
26a6feda9c Follow r350693 to add a link for sbuf_nl_terminate(9)
Sponsored by:	The FreeBSD Foundation
2019-08-08 00:51:17 +00:00
Andriy Gapon
09b238e7c9 rc.8: fix a typo in r350701
I wronlgy expected that igor(1) checks spelling of all words.

MFC after:	1 week
2019-08-07 21:20:25 +00:00
Andriy Gapon
ce6c81b9d8 rc.8: add a reference to service(8)
While here:
- use Xr macro for a reference to sysrc(8)
- clarify that rc.shutdown invokes rc.d scripts with "faststop" argument

MFC after:	1 week
2019-08-07 21:07:59 +00:00
Conrad Meyer
ac03832ef3 GEOM: Reduce unnecessary log interleaving with sbufs
Similar to what was done for device_printfs in r347229.

Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an
sbuf; documented in g_bio.9.

Reviewed by:	markj
Discussed with:	rlibby
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21165
2019-08-07 19:28:35 +00:00
Conrad Meyer
76cb1112da sbuf(9): Add sbuf_nl_terminate() API
The API is used to gracefully terminate text line(s) with a single \n.  If
the formatted buffer was empty or already ended in \n, it is unmodified.
Otherwise, a newline character is appended to it.  The API, like other
sbuf-modifying routines, is only valid while the sbuf is not FINISHED.

Reviewed by:	rlibby
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21030
2019-08-07 19:27:14 +00:00
Conrad Meyer
71db411eb6 sbuf(9): Add NOWAIT dynamic buffer extension mode
The goal is to avoid some kinds of low-memory deadlock when formatting
heap-allocated buffers.

Reviewed by:	vangyzen
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21015
2019-08-07 19:23:07 +00:00
Edward Tomasz Napierala
63722e5212 Add cdceem(4) driver, for virtual ethernet devices compliant
with Communication Device Class Ethernet Emulation Model (CDC EEM).
The driver supports both the device, and host side operation; there
is a new USB template (#11) for the former.

This enables communication with virtual USB NIC provided by iLO 5,
as found in new HPE Proliant servers.

Reviewed by:	hselasky
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Hewlett Packard Enterprise
2019-08-07 18:14:45 +00:00
Konstantin Belousov
c5fb9d20cd More places to clarify the robustness guarantees.
Wording submitted by:	Martin Simmons <martin@lispworks.com>
MFC after:	3 days
2019-08-07 17:51:40 +00:00
Konstantin Belousov
be50763fe0 Clarify the robustness guarantees.
Wording submitted by:	Martin Simmons <martin@lispworks.com>
MFC after:	3 days
2019-08-07 17:46:07 +00:00
Warner Losh
ecdc19b50c Enable nvme on aarch64
Don't mark nvme as broken on aarch64. It compiles, at least, and people are
testing it out. This only enables the userland parts of the nvme stack.

Submitted by: greg at unrelenting technologies
Differential Revision: https://reviews.freebsd.org/D21168
2019-08-07 16:19:06 +00:00
Alan Somers
0b4275accb fusefs: merge from projects/fuse2
This commit imports the new fusefs driver. It raises the protocol level
from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and
adds many new features. New features include:

* Optional kernel-side permissions checks (-o default_permissions)
* Implement VOP_MKNOD, VOP_BMAP, and VOP_ADVLOCK
* Allow interrupting FUSE operations
* Support named pipes and unix-domain sockets in fusefs file systems
* Forward UTIME_NOW during utimensat(2) to the daemon
* kqueue support for /dev/fuse
* Allow updating mounts with "mount -u"
* Allow exporting fusefs file systems over NFS
* Server-initiated invalidation of the name cache or data cache
* Respect RLIMIT_FSIZE
* Try to support servers as old as protocol 7.4

Performance enhancements include:

* Implement FUSE's FOPEN_KEEP_CACHE and FUSE_ASYNC_READ flags
* Cache file attributes
* Cache lookup entries, both positive and negative
* Server-selectable cache modes: writethrough, writeback, or uncached
* Write clustering
* Readahead
* Use counter(9) for statistical reporting

PR:		199934 216391 233783 234581 235773 235774 235775
PR:		236226 236231 236236 236291 236329 236381 236405
PR:		236327 236466 236472 236473 236474 236530 236557
PR:		236560 236844 237052 237181 237588 238565
Reviewed by:	bcr (man pages)
Reviewed by:	cem, ngie, rpokala, glebius, kib, bde, emaste (post-commit
		review on project branch)
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://reviews.freebsd.org/D21110
2019-08-07 00:38:26 +00:00
Konstantin Belousov
762caeb475 Provide the list of knobs related to mitigations.
Discussed with:	bjk, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21087
2019-08-06 17:05:58 +00:00
Michael Tuexen
12b678e9f2 Reference the RFC instead of the internet draft.
MFC after:		1 week
Sponsored by:		Netflix, Inc.
2019-08-06 11:26:30 +00:00
Ian Lepore
5177d2941a Add a driver for Texas Instruments ADS101x/ADS111x i2c ADC chips.
Instances of the device can be configured using hints or FDT data.

Interfaces to reconfigure the chip and extract voltage measurements from
it are available via sysctl(8).
2019-08-05 15:56:44 +00:00
Xin LI
3f894e9850 There is no need to explicitly add zlib, we already have it in
sys/conf/files.
2019-08-04 04:51:32 +00:00
Xin LI
1dbf944a91 if_mxge: update zlib version 1.0.4 to 1.2.11.
PR:		229763
Submitted by:	Yoshihiro Ota <ota j email ne jp>
Differential Revision:	https://reviews.freebsd.org/D20272
2019-08-03 03:36:18 +00:00
John Baldwin
a58383d257 Flip REPRODUCIBLE_BUILD back to off by default in head.
Having the full uname output can be useful on head even with
unmodified trees or trees that newvers.sh fails to recognize as
modified.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D20895
2019-08-03 01:06:17 +00:00
Alan Somers
db90284c31 fusefs: proofread man pages
Reported by:	bcr, mandoc, textproc/igor
Sponsored by:	The FreeBSD Foundation
2019-07-31 16:07:16 +00:00
Alan Somers
ad13e15e1d MFHead @350453
Sponsored by:	The FreeBSD Foundation
2019-07-30 19:42:46 +00:00
Alan Somers
6b184f622a Add a CXXWARNFLAGS variable
Some warning flags are valid for C++ but not C. GCC 8 complains if you pass
such flags when building a C file. Using a separate variable for these
flags allows building both C and C++ files in the same directory (such as
the fusefs tests) under GCC.

Reviewed by:	cem, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21116
2019-07-30 19:34:39 +00:00
Alan Somers
58df81b339 MFHead @350426
Sponsored by:	The FreeBSD Foundation
2019-07-30 04:17:36 +00:00
Mariusz Zaborski
7244507616 seqc: add man page
Reviewed by:	markj
Earlier version reviewed by:	emaste, mjg, bcr, 0mp
Differential Revision:	https://reviews.freebsd.org/D16744
2019-07-29 21:53:02 +00:00
Michael Tuexen
333ba164d6 * Improve input validation of sysctl parameters for DCTPC.
* Initialize the alpha parameter to a conservative value (like Linux)
* Improve handling of arithmetic.
* Improve man-page

Obtained from:		Richard Scheffenegger
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D20549
2019-07-29 08:50:35 +00:00
Alan Somers
a63915c2d7 MFHead @r350386
Sponsored by:	The FreeBSD Foundation
2019-07-28 04:02:22 +00:00
Benjamin Kaduk
1f0a85545e Fix grammar nit in copy_file_range docs
Bytes are countable, so we have fewer of them, not less of them.
2019-07-25 15:43:15 +00:00
Rick Macklem
4b5b98d22d Create a man page for VOP_COPY_FILE_RANGE(9).
r350315 created a Linux compatible copy_file_range(2) syscall.
It uses a VOP method called VOP_COPY_FILE_RANGE so that file systems,
such as the NFSv4.2 client can do file system specific copying.
For NFSv4.2, this allows the copying to be done locally on the NFS server,
avoiding transferring the data across the wire twice.

This is a new man page (content changed).

Reviewed by:	kib, asomers
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D20584
2019-07-25 06:20:00 +00:00
Mark Johnston
a76f78dc3f Remove cap_random(3).
Now that we have a way to obtain entropy in capability mode
(getrandom(2)), libcap_random is obsolete.  Remove it.

Bump __FreeBSD_version in case anything happens to use it, though I've
found no consumers.

Reviewed by:	delphij, emaste, oshogbo
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21033
2019-07-24 22:50:43 +00:00
Alan Somers
776e56611b Add c++14 and c++17 to COMPILER_FEATURES
This will be used to gate the fusefs tests. It's a partial merge of r348281
from projects/fuse2.

Reviewed by:	kib, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21044
2019-07-24 15:10:09 +00:00
Kevin Lo
2bb78c1786 Don't use .Xr for things that have no man page. 2019-07-24 07:07:46 +00:00
Alan Somers
147b8ba829 VOP_FSYNC.9: update copyright after r345677
MFC after:	2 weeks
MFC-With:	r345677
Sponsored by:	The FreeBSD Foundation
2019-07-23 23:14:57 +00:00
Michael Tuexen
d21036e033 Add a sysctl variable ts_offset_per_conn to change the computation
of the TCP TS offset from taking the IP addresses and the TCP port
numbers into account to a version just taking only the IP addresses
into account. This works around broken middleboxes or endpoints.
The default is to keep the behaviour, which is also the behaviour
recommended in RFC 7323.

Reported by:		devgs@ukr.net
Reviewed by:		rrs@
MFC after:		2 weeks
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D20980
2019-07-23 21:28:20 +00:00
Konstantin Belousov
43806bc5b2 Update refcount(9).
Describe missed functions.
Give some hint about refcount_release(9) memory ordering guarantees.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21020
2019-07-23 16:11:38 +00:00
Maxim Sobolev
634add3c8d Allow "update" option to be used in the fstab(5). Document possible use case.
Approved by:	mckusick
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18586
2019-07-22 20:04:55 +00:00
Emmanuel Vadot
7d63f8b6df arm: Use -O2 instead of -O as optimization flag
When using Clang -O is equivalent to -O2, change it -O2 to make it
consistent with other platforms.

Reference: https://clang.llvm.org/docs/ClangCommandLineReference.html#optimization-level

Submitted by:	Daniel Engberg (daniel.engberg.lists@pyret.net)
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D21021
2019-07-22 10:17:59 +00:00
Alan Somers
fd6659d50b VOP_PATHCONF.9: correct the type of the retval argument
It was changed from int to register_t in r22521 and from register_t to long
in r328099, but the man page wasn't updated either time.

MFC after:	2 weeks
2019-07-22 04:14:53 +00:00
Konstantin Belousov
13ff4eb1fa Switch the rest of the refcount(9) functions to bool return type.
There are some explicit comparisions of refcount_release(9) result
with 0/1, which are fine.

Reviewed by:	markj, mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21014
2019-07-21 20:16:48 +00:00
Rene Ladan
349c868322 Mark Felder has stepped down from portmgr and ports-secteam 2019-07-21 11:07:39 +00:00
Conrad Meyer
2826da432c motd: Generate from template to /var/run
Update login(1), its manual pages, similar utilities, and motd.5 to refer to
the new location.

Suggested by:	delphij@ (re: r349256)
Reviewed by:	bcr (manpages), delphij
Differential Revision:	https://reviews.freebsd.org/D20721
2019-07-20 20:56:31 +00:00
Brooks Davis
c5d2d5a1ef Make setting mips endian and ABI less verbose.
Allow ABI to be over ridden to allow (with other changes) programs to be
built targeting ABIs other than the default.  This is used in CheriBSD.

Reviewed by:	imp
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D21001
2019-07-19 23:39:21 +00:00
Warner Losh
435e57a1b9 Remove RELEASE_CRUNCH in example
RELEASE_CRUNCH is no longer relevant.
2019-07-19 20:04:26 +00:00
Emmanuel Vadot
1d6d0a43ce pkgbase: move man pages from runtime-manual to runtime
We don't split the other man pages in their own package so do the same for runtime.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20962
2019-07-19 15:12:20 +00:00
Emmanuel Vadot
5c5ed48a03 bsd.confs.mk: Test the correct value for the destination package
Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20961
2019-07-19 15:11:32 +00:00
Bryan Drewery
000a2e7040 Rework some multi-output target dependency handling.
This reworks my last commit in r301285 to more closely match what was in
r241298 (but reverted in r294878).

This is addressing "missing .meta file" rebuilds but also ensuring that
files are always generated when needed in each case.

Note that this is not a complete rework of the problem areas identified
in r301285 as most are "good enough" right now as the new pattern
is too verbose. It's only worth making this current change where headers
may be generated in the INCS list; where missing .meta file rebuilds are
spotted.

--- Technical details follow ---

Several attempts to deal with this problem of multi-output targets, with and
without META MODE, were explained in r241298, r294878, and r301285.

The general problem is with multi-output targets such as:
        foo.c foo.h:
                touch foo.c foo.h
        foo.c foo.h:
                touch foo.c
                touch foo.h
        foo.c foo.h: foo.in
                ./generator ${.ALLSRC}

This pattern is problematic in jobs mode as both files end up being
built concurrently and leads to races. With META MODE it is worse
as both targets end up rebuilding if they lack a .meta file. So the
generator is force built twice even though it is only needed once.
There are also problems in that 'make foo.h' may be ran before 'make foo.c';
The order of make generating the targets is not guaranteed.

An older attempted workaround to this (discussed in r294878) was:
        foo.h: foo.c
        foo.c: foo.in
                ./generator ${.ALLSRC}
This appears fine except that if foo.h is missing and foo.c exists then
foo.h will never be regenerated. This pattern is close to the solution
in this commit though:

        foo.h: foo.c .NOMETA
        .if !exists(foo.h)
        foo.c: .PHONY .META
        .endif
        foo.c: foo.in
                ./generator ${.ALLSRC}

There's 2 differences here:
1. foo.h will never expect to have a .meta file since the foo.c target
   will generate both and own the .meta file.
2. If foo.h does not exist then it needs to force foo.c to be rebuilt
   with .PHONY. That normally disables META MODE though so .META is
   given to tell bmake we do really expect a .meta file.

This pattern cannot work with implicit suffix rules since the .c and .h files
may be generated at different times (buildincludes vs depend/all).

Sponsored by:	Dell EMC
MFC after:	2 weeks
2019-07-19 00:15:25 +00:00
Warner Losh
c75bdc044d Provide new tunable hw.nvme.verbose_cmd_dump
The nvme drive dumps only the most relevant details about a command when it
fails. However, there are times this is not sufficient (such as debugging weird
issues for a new drive with a vendor). Setting hw.nvme.verbose_cmd_dump=1
in loader.conf will enable more complete debugging information about each
command that fails.

Reviewed by: rpokala
Sponsored by: Netflix
Differential Version: https://reviews.freebsd.org/D20988
2019-07-18 21:58:51 +00:00
Thomas Munro
513419f404 tzsetup: upgrade to zone1970.tab
zone.tab is deprecated.  Install zone1970.tab alongside it, and use it
for tzsetup(8).  This is also useful for other applications that need
the modern better maintained file.

Reviewed by: philip
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20646
2019-07-17 06:17:27 +00:00
Sean Bruno
fceeeec75f I add the ability to accept the default pin widget configuration to help
with various laptops using hdaa(4) sound devices.  We don't seem to know
the "correct" configurations for these devices and the defaults are far
superiour, e.g. they work if you don't nuke the default configs.

PR:	200526
Differential Revision:	https://reviews.freebsd.org/D17772
2019-07-17 04:13:46 +00:00
Kevin Lo
ba4ecad9f8 Add an MLINK for igb.
Discussed with:	lwhsu
2019-07-17 02:08:57 +00:00
Kevin Lo
4d302c1a86 Mention iflib(4). 2019-07-17 01:56:40 +00:00
Eric van Gyzen
9d3ecb7e62 Adds signal number format to kern.corefile
Add format capability to core file names to include signal
that generated the core. This can help various validation workflows
where all cores should not be considered equally (SIGQUIT is often
intentional and not an error unlike SIGSEGV or SIGBUS)

Submitted by:	David Leimbach (leimy2k@gmail.com)
Reviewed by:	markj
MFC after:	1 week
Relnotes:	sysctl kern.corefile can now include the signal number
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20970
2019-07-16 15:51:09 +00:00
Konstantin Belousov
30b3018d48 Provide protection against starvation of the ll/sc loops when accessing userpace.
Casueword(9) on ll/sc architectures must be prepared for userspace
constantly modifying the same cache line as containing the CAS word,
and not loop infinitely.  Otherwise, rogue userspace livelocks the
kernel.

To fix the issue, change casueword(9) interface to return new value 1
indicating that either comparision or store failed, instead of relying
on the oldval == *oldvalp comparison.  The primitive no longer retries
the operation if it failed spuriously.  Modify callers of
casueword(9), all in kern_umtx.c, to handle retries, and react to
stops and requests to terminate between retries.

On x86, despite cmpxchg should not return spurious failures, we can
take advantage of the new interface and just return PSL.ZF.

Reviewed by:	andrew (arm64, previous version), markj
Tested by:	pho
Reported by:	https://xenbits.xen.org/xsa/advisory-295.txt
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D20772
2019-07-12 18:43:24 +00:00
Konstantin Belousov
e1be41acf7 Style: avoid long lines by using .Fo instead of .Fn.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-07-12 18:39:41 +00:00
Hiroki Sato
2625e51956 Add support for RTL8156, 2.5GbE USB network controller, to if_cdce(4).
This chip can be found in Planex USB-LAN2500R.
2019-07-10 05:45:50 +00:00
Mark Johnston
eeacb3b02f Merge the vm_page hold and wire mechanisms.
The hold_count and wire_count fields of struct vm_page are separate
reference counters with similar semantics.  The remaining essential
differences are that holds are not counted as a reference with respect
to LRU, and holds have an implicit free-on-last unhold semantic whereas
vm_page_unwire() callers must explicitly determine whether to free the
page once the last reference to the page is released.

This change removes the KPIs which directly manipulate hold_count.
Functions such as vm_fault_quick_hold_pages() now return wired pages
instead.  Since r328977 the overhead of maintaining LRU for wired pages
is lower, and in many cases vm_fault_quick_hold_pages() callers would
swap holds for wirings on the returned pages anyway, so with this change
we remove a number of page lock acquisitions.

No functional change is intended.  __FreeBSD_version is bumped.

Reviewed by:	alc, kib
Discussed with:	jeff
Discussed with:	jhb, np (cxgbe)
Tested by:	pho (previous version)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D19247
2019-07-08 19:46:20 +00:00
Bryan Drewery
3b53f994ea Consider *clean targets as non-build targets as well.
MFC after:	2 weeks
Sponsored by:	DellEMC
2019-07-04 14:51:44 +00:00
Niclas Zeising
f1bb9412c2 pci(4): Use plural configuration registers
Change to use registers instead of register, as it is customary to use
plural when talking about PCI registers.

This was missed in r349150.

MFC after:	3 days
2019-07-02 17:48:27 +00:00
Li-Wen Hsu
9725e74c7b Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK
Submitted by:	Ka Ho Ng <khng300 at gmail.com>
Reviewed by:	mckusick
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20695
2019-06-29 14:55:53 +00:00
John Baldwin
82334850ea Add an external mbuf buffer type that holds multiple unmapped pages.
Unmapped mbufs allow sendfile to carry multiple pages of data in a
single mbuf, without mapping those pages.  It is a requirement for
Netflix's in-kernel TLS, and provides a 5-10% CPU savings on heavy web
serving workloads when used by sendfile, due to effectively
compressing socket buffers by an order of magnitude, and hence
reducing cache misses.

For this new external mbuf buffer type (EXT_PGS), the ext_buf pointer
now points to a struct mbuf_ext_pgs structure instead of a data
buffer.  This structure contains an array of physical addresses (this
reduces cache misses compared to an earlier version that stored an
array of vm_page_t pointers).  It also stores additional fields needed
for in-kernel TLS such as the TLS header and trailer data that are
currently unused.  To more easily detect these mbufs, the M_NOMAP flag
is set in m_flags in addition to M_EXT.

Various functions like m_copydata() have been updated to safely access
packet contents (using uiomove_fromphys()), to make things like BPF
safe.

NIC drivers advertise support for unmapped mbufs on transmit via a new
IFCAP_NOMAP capability.  This capability can be toggled via the new
'nomap' and '-nomap' ifconfig(8) commands.  For NIC drivers that only
transmit packet contents via DMA and use bus_dma, adding the
capability to if_capabilities and if_capenable should be all that is
required.

If a NIC does not support unmapped mbufs, they are converted to a
chain of mapped mbufs (using sf_bufs to provide the mapping) in
ip_output or ip6_output.  If an unmapped mbuf requires software
checksums, it is also converted to a chain of mapped mbufs before
computing the checksum.

Submitted by:	gallatin (earlier version)
Reviewed by:	gallatin, hselasky, rrs
Discussed with:	ae, kp (firewalls)
Relnotes:	yes
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20616
2019-06-29 00:48:33 +00:00
John Baldwin
773123546b Sync mbuf flags, types, and external buffer types with <sys/mbuf.h>.
Sponsored by:	Netflix
2019-06-28 19:49:47 +00:00
John Baldwin
7b29ab7e25 Use a tab after #define for EXT_* constants.
This matches other #define's in this manpage as well as <sys/mbuf.h>.

Sponsored by:	Netflix
2019-06-28 19:37:48 +00:00
Leandro Lupori
0a0163ebde Fix missing powerpc64 in _LLVM_TARGET_FILT
This change was originally in D20378. Making it in a new diff since it's a
bugfix.

Submitted by:	alfredo.junior_eldorado.org.br
Reviewed by:	emaste, luporl
Differential Revision:	https://reviews.freebsd.org/D20756
2019-06-28 15:49:14 +00:00
Hans Petter Selasky
131b2b7658 Implement API for draining EPOCH(9) callbacks.
The epoch_drain_callbacks() function is used to drain all pending
callbacks which have been invoked by prior epoch_call() function calls
on the same epoch. This function is useful when there are shared
memory structure(s) referred to by the epoch callback(s) which are not
refcounted and are rarely freed. The typical place for calling this
function is right before freeing or invalidating the shared
resource(s) used by the epoch callback(s). This function can sleep and
is not optimized for performance.

Differential Revision: https://reviews.freebsd.org/D20109
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2019-06-28 10:38:56 +00:00
Alan Somers
8aafc8c389 [skip ci] update copyright headers in fusefs files
Sponsored by:	The FreeBSD Foundation
2019-06-28 04:18:10 +00:00
Alan Somers
7f49ce7a0b MFHead @349476
Sponsored by:	The FreeBSD Foundation
2019-06-27 23:50:54 +00:00
Alan Somers
b13625b573 [skip ci] VOP_BMAP.9: fix diction in copyright header
MFC after:	2 weeks
MFC-With:	r349230
Sponsored by:	The FreeBSD Foundation
2019-06-27 23:37:09 +00:00
Alan Somers
435ecf40bb fusefs: recycle vnodes after their last unlink
Previously fusefs would never recycle vnodes.  After VOP_INACTIVE, they'd
linger around until unmount or the vnlru reclaimed them.  This commit
essentially actives and inlines the old reclaim_revoked sysctl, and fixes
some issues dealing with the attribute cache and multiply linked files.

Sponsored by:	The FreeBSD Foundation
2019-06-27 20:18:12 +00:00
Alan Somers
560a55d094 fusefs: convert statistical sysctls to use counter(9)
counter(9) is more performant than using atomic instructions to update
sysctls that just report statistics to userland.

Sponsored by:	The FreeBSD Foundation
2019-06-27 16:30:25 +00:00
Andriy Gapon
061b38cdcc gpiobus: provide a new hint, pin_list
"pin_list" allows to specify child pins as a list of pin numbers.
Existing hint "pins" serves the same purpose but with a 32-bit wide bit
mask.  One problem with that is that a controller can have more than 32
pins.  One example is amdgpio.  Also, a list of numbers is a little bit
more human friendly than a matching bit mask.  As a side note, it seems
that in FDT pins are typically specified by their numbers as well.

This commit also adds accessors for instance variables (IVARs) that
define the child pins.  My primary goal is to allow a child to be
configured programmatically rather than via hints (assuming that FDT is
not supported on a platform).  Also, while a child should not care about
specific pin numbers that are allocated to it, it could be interested in
how many were actually assigned to it.

While there, I removed "flags" instance variable.  It was unused.

Reviewed by:	mizhka
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D20459
2019-06-27 15:46:06 +00:00
Alan Somers
dfec6f7391 fusefs.5: remove deleted sysctls from man page
Sponsored by:	The FreeBSD Foundation
2019-06-26 20:07:16 +00:00
Alan Somers
f8ebf1cd7e fusefs: implement protocol 7.23's FUSE_WRITEBACK_CACHE option
As of protocol 7.23, fuse file systems can specify their cache behavior on a
per-mountpoint basis.  If they set FUSE_WRITEBACK_CACHE in
fuse_init_out.flags, then they'll get the writeback cache.  If not, then
they'll get the writethrough cache.  If they set FOPEN_DIRECT_IO in every
FUSE_OPEN response, then they'll get no cache at all.

The old vfs.fusefs.data_cache_mode sysctl is ignored for servers that use
protocol 7.23 or later.  However, it's retained for older servers,
especially for those running in jails that lack access to the new protocol.

This commit also fixes two other minor test bugs:
* WriteCluster:SetUp was using an uninitialized variable.
* Read.direct_io_pread wasn't verifying that the cache was actually
  bypassed.

Sponsored by:	The FreeBSD Foundation
2019-06-26 17:32:31 +00:00
Andriy Gapon
59c94acee9 gpio.4: document device hints common to all devices on gpiobus
"at" keyword is documented in device.hints(5) for all buses, but it does
hurt to add another reference to it.
"pins" keyword is specific to gpiobus.
At least these two hints should be configured for any gpiobus device on
a hints based system.

MFC after:	10 days
2019-06-26 07:38:31 +00:00
Andriy Gapon
50b4788ba1 fix up r349406, add missing .El
MFC after:	1 week
2019-06-26 07:08:51 +00:00
Andriy Gapon
8352171a58 owc.4: document how to set up the 1-wire bus on a device.hints system
MFC after:	1 week
2019-06-26 06:40:30 +00:00
Doug Moore
e70bb5c1a1 Document the KERN_PROTECTION_FAILURE return value from vm_map_protect().
Reviewed by: alc (earlier version)
Approved by: kib, markj (mentors)
Differential Revision: https://reviews.freebsd.org/D20751
2019-06-25 17:27:37 +00:00
Warner Losh
f5a95d9a07 Remove NAND and NANDFS support
NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes:	Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745
2019-06-25 04:50:09 +00:00
Justin Hibbits
e861dab451 powerpc: Transition to Secure-PLT, like most other OSs (Toolchain part)
Summary:
Toolchain follow-up to r349350.  LLVM patches will be submitted upstream for
9.0 as well.

The bsd.cpu.mk change is required because GNU ld assumes BSS-PLT if it
cannot determine for certain that it needs Secure-PLT, and some binaries do
not compile in such a way to make it know to use Secure-PLT.

Reviewed By: nwhitehorn, bdragon, pfg
Differential Revision: https://reviews.freebsd.org/D20598
2019-06-25 02:35:22 +00:00
Sevan Janiyan
31d2b1cf99 Add DragonFly BSD 5.6.1 2019-06-22 22:43:40 +00:00
Sevan Janiyan
07fb2bcc24 Remove question mark from the link between NetBSD & Darwin.
As linked to in bug 26137 as a source
https://web.archive.org/web/20001012121507/http://www.opensource.apple.com/projects/darwin/faq.html
mentions:
"We already synchronize our code periodically with NetBSD for most of our user commands"
2019-06-22 22:34:59 +00:00
Warner Losh
05b626019a Add list of valid CPUTYPE flags for arm/arm64 to make.conf example
Summary:
Adds a list of valid CPUTYPE flags for arm and arm64 architectures
List taken from share/mk/bsd.cpu.mk

Submitted by: Daniel Engberg
Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D20315
2019-06-22 16:54:23 +00:00
Doug Moore
a616b25342 Modify swapon(8) to invoke BIO_DELETE to trim swap devices, either if
'-E' appears on the swapon command line, or if "trimonce" appears as
an fstab option.

Discussed at: BSDCAN
Tested by: markj
Reviewed by: markj
Approved by: markj (mentor)
Differential Revision:https://reviews.freebsd.org/D20599
2019-06-22 03:16:01 +00:00
Ian Lepore
1d90bbbb24 Do some general cleanup and light wordsmithing.
Sort methods alphabetically.  Wrap long lines.  Start sentences on a new
line.  Remove contractions (not because it's a good idea, just to silence
igor).  Add some explanation of the units for the period and duty arguments
and the convention for channel numbers.
2019-06-21 15:12:17 +00:00
Ian Lepore
7202a38099 Catch up with recent changes in pwmbus(9). The pwm(9) and pwmbus(9)
interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX method
was renamed PWMBUS_CHANNEL_COUNT.  The pwmbus_attach_bus() function just
went away completely.  Also, fix a few typos such as s/is/if/.
2019-06-21 14:46:43 +00:00
Kevin Lo
a3cea1de1a Correct function names. 2019-06-21 02:49:36 +00:00
Conrad Meyer
c363b16c63 sys: Remove DEV_RANDOM device option
Remove 'device random' from kernel configurations that reference it (most).
Replace perhaps mistaken 'nodevice random' in two MIPS configs with 'options
RANDOM_LOADABLE' instead.  Document removal in UPDATING; update NOTES and
random.4.

Reviewed by:	delphij, markm (previous version)
Approved by:	secteam(delphij)
Differential Revision:	https://reviews.freebsd.org/D19918
2019-06-21 00:16:30 +00:00
Ed Maste
cb53797473 Clarify vm_map_protect max_protection downgrade
As reported in review D20709 by brooks calling vm_map_protect to set a
new max_protection value downgrades existing mappings if necessary (as
opposed to returning an error).

Reported by:	brooks
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-06-20 18:30:19 +00:00
Ed Maste
0cf197862d Clarify that vm_map_protect cannot upgrade max_protection
It's implied by the man page's RETURN VALUES section, but be explicit in
the description that vm_map_protect can not set new protection bits that
are already in each entry's max_protection.

Reviewed by:	brooks
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20709
2019-06-20 18:19:09 +00:00
Alan Somers
67056e3d08 VOP_REVOKE(9): update locking requirements per r143495
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20524
2019-06-20 16:36:20 +00:00
Alan Somers
e532a99901 MFHead @349234
Sponsored by:	The FreeBSD Foundation
2019-06-20 15:56:08 +00:00
Alan Somers
8bd416a216 VOP_BMAP(9): fix typo in the copyright header
Reported by:	rgrimes
MFC after:	2 weeks
MFC-With:	349230
Sponsored by:	The FreeBSD Foundation
2019-06-20 14:40:36 +00:00
Alan Somers
d01752c703 Add a VOP_BMAP(9) man page
Reviewed by:	mckusick
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20704
2019-06-20 13:59:46 +00:00
Li-Wen Hsu
99b6ccd8c9 Finsh readding Big5 in r317204, which was reverting r315568. This commit
reverts r315569.

Reported by:	Ting-Wei Lan <lantw44 gmail com>
Discussed with:	kevlo
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-06-20 07:17:16 +00:00
Alexander Motin
f91aa773be Add wakeup_any(), cheaper wakeup_one() for taskqueue(9).
wakeup_one() and underlying sleepq_signal() spend additional time trying
to be fair, waking thread with highest priority, sleeping longest time.
But in case of taskqueue there are many absolutely identical threads, and
any fairness between them is quite pointless.  It makes even worse, since
round-robin wakeups not only make previous CPU affinity in scheduler quite
useless, but also hide from user chance to see CPU bottlenecks, when
sequential workload with one request at a time looks evenly distributed
between multiple threads.

This change adds new SLEEPQ_UNFAIR flag to sleepq_signal(), making it wakeup
thread that went to sleep last, but no longer in context switch (to avoid
immediate spinning on the thread lock).  On top of that new wakeup_any()
function is added, equivalent to wakeup_one(), but setting the flag.
On top of that taskqueue(9) is switchied to wakeup_any() to wakeup its
threads.

As result, on 72-core Xeon v4 machine sequential ZFS write to 12 ZVOLs
with 16KB block size spend 34% less time in wakeup_any() and descendants
then it was spending in wakeup_one(), and total write throughput increased
by ~10% with the same as before CPU usage.

Reviewed by:	markj, mmacy
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D20669
2019-06-20 01:15:33 +00:00
Bryan Drewery
8e0c373903 Follow-up r349065: Fix .TARGET flag ambiguity with PROGS which broke MK_TESTS.
X-MFC-With:	r349065
Sponsored by:	DellEMC
2019-06-19 19:19:37 +00:00
Sevan Janiyan
87278c17c9 Whitespace 2019-06-19 11:22:09 +00:00
Bryan Drewery
46dea205c6 Rework r349061: Don't apply guessed dependencies if there is a custom target.
This is still targeting bin/sh cyclic dependency issues.  Only apply
guessed dependencies that are explicitly set for an object (which
gnu/lib/cc/cc_tools needs) and if no custom target exists with its
own dependencies.

This was manifesting as a missing yacc.h in usr.bin/mkesdb_static when
built without -j (or -B). No actual yacc.h dependency ordering was
defined but with -j it got lucky and built fine.

Before r349061 the behavior was different for META_MODE but that logic
difference isn't needed.

X-MFC-With:	r349061
Sponsored by:	DellEMC
2019-06-18 22:00:38 +00:00
Sevan Janiyan
cfdcc8c7fa Mark NetBSD branch points
NetBSD 7.0 was a separate branch, subsequent 8.x releases did not emerge from
this branch.
Clean up minor visual nits, centre OpenBSD listing on the B, DragonFly
listings on the y.
2019-06-18 21:02:40 +00:00
Ian Lepore
a161bab854 Add a pwmc(4) manpage. 2019-06-18 04:32:19 +00:00
Sevan Janiyan
b6bb4d1e19 Add NetBSD 8.1 & DragonFly BSD 5.6 2019-06-17 21:46:13 +00:00
Sevan Janiyan
d5646db99b Fix tab 2019-06-17 21:38:33 +00:00
Niclas Zeising
2d4a74d7a0 pci.4: Use plural configuration registers
It is customary to use plural when talking about PCI configure registers.

Reported by:	scottl
MFC after:	2 weeks
X-MFC-with:	r349133
2019-06-17 17:35:55 +00:00
Mark Johnston
970a1ed345 Add some missing MLINKs for tree(3).
MFC after:	3 days
2019-06-17 16:57:44 +00:00
Niclas Zeising
999546e169 pci.4: wordsmith and add missing words
Add missing words after PCI in the description of the PCIOCWRITE and
PCIOCATTACHED ioctls.
Use singular in PCIOCREAD, we only read one register at the time.

Reviewed by:	bcr, bjk, rgrimes, cem
MFC after:	2 weeks
X-MFC-with:	r349133
Differential Revision:	https://reviews.freebsd.org/D20671
2019-06-17 16:54:51 +00:00
Niclas Zeising
65d328a3eb pci(4): Document PCIOCATTACHED
Document the PCIOCATTACHED ioctl(2) in the pci(4) manual.
PCIOCATTACHED is used to query if a driver has attached to a PCI.

Reviewed by:	bcr, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20652
2019-06-17 05:41:47 +00:00
Ed Maste
c6e475ff5a allow vt(4) fonts to be built from .bdf files
vtfontcvt(8) can convert both .bdf and .hex inputs to binary vt(4) .fnt
files.

Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 12:44:49 +00:00
Bryan Drewery
15a04cec78 symlinkat(2) is not covered. 2019-06-16 05:12:17 +00:00
Bryan Drewery
ee4eeb3213 Allow DEPENDOBJS/DEPENDSRCS to work with only OBJS set and no SRCS.
Default to tracking .depend.* for OBJS rather than SRCS.

This helps cover some special case builds like gnu/lib/csu which
do more of a PROGS-like thing with bsd.prog.mk.

It is possible this causes out-of-tree Makefiles to have problems if they use
this pattern:
	foo.o: foo.c
		${CC} -o ${.TARGET} ${.ALLSRC}
This may cause multiple source files to be compiled due to finding the
'foo.o: foo.c' dependency both in the Makefile at the .depend file. Or
it may try compiling headers. This can be worked around by either of these:
	foo.o: foo.c
		${CC} -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
Or
	foo.o: foo.c
		${CC} -o ${.TARGET} ${.CURDIR}/foo.c
In the latter case the ${.CURDIR} may need to be a different path. The
first case covers automatically using .PATH.

Sponsored by:	DellEMC
2019-06-15 17:08:35 +00:00
Bryan Drewery
9e0a1e78e5 META_MODE: Delete build targets that fail.
If a meta mode change is triggered but then the build fails then the
next build will not retrigger meta mode. This only prevented by
removing the target on rebuild or on the failure to rebuild.

Sponsored by:	DellEMC
2019-06-15 17:08:28 +00:00
Bryan Drewery
48da57b47f Add various CFLAGS/LDADD overrides for the output target file.
Sponsored by:	DellEMC
2019-06-15 17:08:24 +00:00
Bryan Drewery
3d04f5a9c4 Avoid generating DEPENDFILES='.depend.' when there's no DEPENDOBJS.
MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-15 17:08:21 +00:00
Bryan Drewery
05f8fb1fab Similar to r335710 avoid ccache when linking a .cc file directly.
Sponsored by:	DellEMC
2019-06-15 17:08:18 +00:00
Bryan Drewery
c63c5ab001 Fix .depend files to work for build tools.
This is somewhat of a follow-up to r335746.

MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-15 17:08:13 +00:00
Bryan Drewery
f39f6a562e Don't force OBJS_DEPEND_GUESS headers onto all objects.
This is in the case of not having any .depend.foo.o yet.  Don't force add *.h
as a dependency for those. They are built in beforebuild already when in
SRCS/DPSRCS.

This change allows custom rules, like in bin/sh/Makefile for mksyntax, to not
have cyclic dependency problems when connected to the .depend.* handling.

This is purposely not copied to sys/conf/kern.post.mk as it handles
generating headers slightly differently.

MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-15 17:08:02 +00:00
Mateusz Piotrowski
966b76b496 netmap.4: Fix a typo as FreeBSD Linux is not a thing
Approved by:	src (emaste)
Event:		Berlin Devsummit 2019
2019-06-15 12:09:22 +00:00
Stephen Hurd
705aad98c6 Some devices take undesired actions when RTS and DTR are
asserted. Some development boards for example will reset on DTR,
and some radio interfaces will transmit on RTS.

This patch allows "stty -f /dev/ttyu9.init -rtsdtr" to prevent
RTS and DTR from being asserted on open(), allowing these devices
to be used without problems.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D20031
2019-06-12 18:07:04 +00:00
John Baldwin
0f70218343 Make the warning intervals for deprecated crypto algorithms tunable.
New sysctl/tunables can now set the interval (in seconds) between
rate-limited crypto warnings.  The new sysctls are:
- kern.cryptodev_warn_interval for /dev/crypto
- net.inet.ipsec.crypto_warn_interval for IPsec
- kern.kgssapi_warn_interval for KGSSAPI

Reviewed by:	cem
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D20555
2019-06-11 23:00:55 +00:00
John Baldwin
574b98cbd9 Document sysctl nodes that translate their values.
This documents the behavior of sysctl_msec_to_ticks and
SYSCTL_{ADD,}_SBINTIME_[UM]SEC.

Reviewed by:	cem
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D20596
2019-06-11 22:57:25 +00:00
Bryan Drewery
4fc7bd0519 DPSRCS need to be built before recursing.
MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-10 19:38:35 +00:00
Mark Johnston
007d50155f vmrun: Add a missing close-paren to the usage message.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-06-07 17:54:26 +00:00
Ryan Libby
3cf556f05e Allow fail points to have separate declarations, definitions, and evals
Submitted by:	Matthew Bryan <matthew.bryan@isilon.com>
Reviewed by:	cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20546
2019-06-07 04:09:12 +00:00
Alan Somers
0269ae4c19 MFHead @348740
Sponsored by:	The FreeBSD Foundation
2019-06-06 16:20:50 +00:00
D Scott Phillips
3ea05df092 Add myself to committers-src.dot and calendar.freebsd
Approved by:	jhb (mentor)
2019-06-05 04:01:31 +00:00
Vincenzo Maffione
e5f89a8c84 Add myself to committers-src.dot and calendar.freebsd
Reviewed by:	mckusick
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20518
2019-06-04 19:59:43 +00:00
Conrad Meyer
208be1617c style.9: Codify tolerance for eliding blank lines
Consensus seems to be that eliding blank lines for functions with no local
variables is acceptable.  Codify that explicitly in the style document.

Reported by:	jhb
Reviewed by:	delphij, imp, vangyzen (earlier version); rgrimes
With feedback from:	kib
Differential Revision:	https://reviews.freebsd.org/D20448
2019-06-03 23:57:29 +00:00
John Baldwin
37e98e0dda Add 'device cxgbe' explicitly in the synopsis.
ccr depends on symbols exported by the cxgbe driver as well as having
a runtime dependency.  While the runtime depenency was noted in the
manpage already, the compile-time dependency wasn't as clear.

PR:		238265
MFC after:	3 days
Sponsored by:	Chelsio Communications
2019-06-03 15:41:54 +00:00
Edward Tomasz Napierala
1cedef8f7f Make tests(7) point people at the atf(7) man page.
Other frameworks, such as googletest, should be added there as well,
once they become viable.  For now let's keep it simple.

Discussed with: ngie, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20124
2019-06-02 16:33:24 +00:00
Brandon Bergren
03f92fe9e0 Add myself to committers-src.dot and calendar.freebsd
Approved by:	jhibbits (mentor)
2019-06-02 00:08:24 +00:00
Alexander Motin
08b96108ae Document max_chains bump to 16384 at r330049.
MFC after:	1 week
2019-06-01 16:04:20 +00:00
Sergio Carlavilla Delgado
5c59c0d4ef Add Sergio Carlavilla (myself) to the committers doc, Gabor is going to be my mentor Approved by: gabor 2019-05-30 21:39:49 +00:00
Dmitry Chagin
c5afec6e89 Complete LOCAL_PEERCRED support. Cache pid of the remote process in the
struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed.

PR:		215202
Reviewed by:	tijl
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20415
2019-05-30 14:24:26 +00:00
Marcin Wojtas
e44f5c81b8 Fix ENA manual issues
The issues were pointed in community review:
https://reviews.freebsd.org/D10427#inline-67587

Also, fix other issues found by the igor tool.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.
2019-05-30 13:50:45 +00:00
Conrad Meyer
fd55875350 style.9: Correct usage's definition to match its declaration
Suggested by:	emaste
Reviewed by:	delphij, imp, rgrimes, vangyzen (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	(part of D20448)
2019-05-28 20:44:23 +00:00
Alan Somers
2b3899c0ee VOP_ADVLOCK.9: fix description of flags
* F_RDLCK, F_UNLCK, and F_WRLCK aren't flags.  They're stored in the
  fl.l_type field.
* Add F_REMOTE, added in r177633
* Add F_NOINTR, added in r180025

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-05-27 23:25:19 +00:00
Conrad Meyer
b1adb000cd virtio.4: Add missing devices and Xr
This page could probably use further improvement.
2019-05-27 00:51:27 +00:00
Mateusz Piotrowski
7005cea324 ipheth.4: Explain how to manually configure USB tethering on Apple devices
Reviewed by:	danfe, hselasky
Approved by:	src (hselasky)
Differential Revision:	https://reviews.freebsd.org/D20353
2019-05-26 14:15:54 +00:00
Alan Somers
93fecd02a1 fusefs: misc build fixes
* Only build the tests on platforms with C++14 support
* Fix an undefined symbol error on lint builds
* Remove an unused function: fiov_clear

Sponsored by:	The FreeBSD Foundation
2019-05-25 21:40:27 +00:00
Edward Tomasz Napierala
0407410ba0 We don't really need two entries to describe how to deal with
optical drives in devfs.conf(5).

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-05-25 17:37:28 +00:00
Warner Losh
ad018aa4da Add warning that the PNP info has to follow the module declaration.
Due to how the linker.hints file is laid out, we'll associate the pnp
info with the wrong module if the module declaration comes after the
pnp info. Until that limiation is removed, we need to have this
ordering. Ideally, we'd also enforce the ordering somehow, but I've
come up with no way to do that yet...
2019-05-23 15:53:41 +00:00
Andriy Gapon
999d5a34e7 gpioled: fix the manual page update in r348154
MFC after:	2 weeks
2019-05-23 11:35:00 +00:00
Andriy Gapon
694d36403f gpioled: update the manual page after r348153
MFC after:	2 weeks
2019-05-23 11:21:27 +00:00
Alan Somers
6a5074a375 Update VFS_FHTOVP(9) with the flags argument
Revison 222167 added a new argument to VFS_FHTOVP. This revision updates the
man page to match.

Reviewed by:	rmacklem
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20323
2019-05-22 16:24:39 +00:00
Emmanuel Vadot
43fb1e3e4b pkgbase: Really move termcap.small
Messed up with git->svn in r348101
2019-05-22 07:41:20 +00:00