Commit Graph

268969 Commits

Author SHA1 Message Date
Elyes HAOUAS
da3278ded3 ntp.conf.5: Fix typos
"certian" --> "certain"
"compatability" --> "compatibility"
"noticable" --> "noticeable"
"limite" --> "limit"
"acutal" --> "actual"
"ba" --> "be"

MFC after:	1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/550
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-06 10:16:04 -04:00
Konstantin Belousov
9b86d3e5de When queuing ignored signal, only abort target thread' sleep if it is inside sigwait()
Reported and tested by:	trasz
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32252
2021-10-06 17:05:22 +03:00
Konstantin Belousov
f17eb93d55 When sending ignored signal, arrange for zero return code from sleep
Otherwise consumers get unexpected EINTR errors without seeing
a properly discarded signal.

Reported and tested by:	trasz
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32252
2021-10-06 17:05:22 +03:00
Konstantin Belousov
b599982b65 Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT
The flag should be accessible from non-current threads.

Reviewed by:	markj
Tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32252
2021-10-06 17:05:22 +03:00
Kyle Evans
7f4bb50176 login: use sizeof(audit_cond) consistently, NFC
The other three instances were already converted to use audit_cond, this
one was just changed from sizeof(long) -> sizeof(int).
2021-10-05 23:25:29 -05:00
Konstantin Belousov
8d3cd7767a Fix mistakes in link(2) and shm_open(2)
PR:	258957
Submitted by:	sigsys@gmail.com
MFC after:	1 week
2021-10-06 06:38:26 +03:00
Konstantin Belousov
ce21d4bff1 amd64 efirt: do not flush cache for runtime pages
We actually do not know is it safe or not to flush cache for random
BAR/register page existing in the system.  It is well-known that for
instance LAPICs cannot tolerate cache flush.  As report indicates,
there are more such devices.

This issue typically affects AMD machines which do not report self-snoop,
causing real CLFLUSH invocation on the mapped pages.  Intels do self-snoop,
so this change should be nop for them, and unsafe devices, if any, are
already ignored.

Reported and tested by:	manu
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32318
2021-10-06 05:53:20 +03:00
Konstantin Belousov
33c17670af amd64: add pmap_page_set_memattr_noflush()
Similar to pmap_page_set_memattr() by setting MD page cache attribute
to the argument.  Unlike pmap_page_set_memattr(), does not flush cache
for the direct mapping of the page.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32318
2021-10-06 05:53:12 +03:00
Konstantin Belousov
f8d3368b43 apic: initialize lapic_paddr statically
The default value for LAPIC registers page physical address
is usually right. Having this value available early makes
pmap_force_invalidate_cache_range(), used on non-self-snoop machines,
avoid flushing LAPIC range for early calls.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32318
2021-10-06 05:52:56 +03:00
Elyes HAOUAS
7102ec5226 unifdef.1: Fix typo on "input"
Pull request: https://github.com/freebsd/freebsd-src/pull/549
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-05 20:27:16 -04:00
John Baldwin
680d70b59e sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP.
MFC after:	3 days
Sponsored by:	DARPA
2021-10-05 14:55:18 -07:00
Tom Hukins
70ffa69e1b Remove obsolete amd(8) rc.conf configuration
The script that used these was removed in 13f7dbe822 along with amd
itself.

Fixes:		13f7dbe822 ("retire amd(8)")
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/548
2021-10-05 17:16:58 -04:00
Alexander Motin
730ea72c70 cam(4): Limit search for disks in SES enclosure by single bus
At least for SAS that we only support now disks are typically
connected to the same bus as the enclosure.  Limiting the search
scope makes it much faster on systems with multiple buses and
thousands of disks.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D32305
2021-10-05 15:01:16 -04:00
Alexander Motin
8f9be1eed1 cam(4): Improve XPT_DEV_MATCH
Remove *_MATCH_NONE enums, making no sense and so never used.  Make
*_MATCH_ANY enums 0 (no any match flags set), previously used by
*_MATCH_NONE.  Bump CAM_VERSION to 0x1a reflecting those changes and
add compat shims.

When traversing through buses and devices do not descend if we can
already see that requested pattern does not match the bus or device.
It allows to save significant amount of time on system with thousands
of disks when doing limited searches.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D32304
2021-10-05 14:54:03 -04:00
Alexander Motin
7835b2cb4a sbuf(9): Microoptimize sbuf_put_byte()
This function is actively used by sbuf_vprintf(), so this simple
inlining in half reduces time of kern.geom.confxml generation.

MFC after:	2 weeks
Sponsored by:	iXsystem, Inc.
2021-10-05 14:47:38 -04:00
Warner Losh
b3b15d9256 cam: Add doxygen for cam_sim_free
Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D32303
2021-10-05 07:07:47 -06:00
Mateusz Guzik
cee9a741b2 cesa: remove unused CESA_SESSIONS macro
Unused since 1b0909d51a ("OpenCrypto: Convert sessions to opaque handles
instead of integers")

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-10-05 12:17:10 +00:00
Konstantin Belousov
0eb2dcd32e mlx5_en: fix use of CALLOUT_DIRECT
Reported by:	markj
Reviewed by:	hselasky
Sponsored by:	NVIDIA Networking
MFC after:	1 week
2021-10-05 13:07:36 +03:00
Mateusz Guzik
ae4fb190fd netstat: split ipsec and ipsec6 statistics in libxo
In particular fixes --libxo json

PR:		254673
Reported by:	j.vandeville@gmail.com
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2021-10-05 09:42:58 +00:00
Hans Petter Selasky
5a7de2b42c mlx4en(4): Fix wrong mbuf cluster size in mlx4_en_debugnet_init()
This fixes an "invalid cluster size" panic when debugnet is activated.

panic()
m_getzone()
debugnet_mbuf_reinit()
debugnet_any_ifnet_update()
ifhwioctl()
ifioctl()

Submitted by:	ae@
PR:		258923
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-10-05 10:48:30 +02:00
Stefan Eßer
f902ca97bd Revert erroneous commit ded0d3d486
These files came from a prior commit to contrib/bc and seem to have
been placed in the top of the source tree by a failed git rebase.

Reported by:	markj
2021-10-05 09:41:46 +02:00
Bartlomiej Grzesik
3ac5012e52 sdhci: Fix crash caused by M_WAITOK in sdhci dumps
In some contexts it is illegal to wait for memory allocation, causing
kernel panic. By default sbuf_new passes M_WAITOK to malloc,
which caused crashes when sdhci_dumpcaps or sdhci_dumpregs was callend in
non sutiable context.

Add SBUF_NOWAIT flag to sbuf_new to fix this.

Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32075
2021-10-05 06:22:32 +02:00
Konstantin Belousov
be6116fdfc pthread_mutexattr(3): document each pthread_mutexattr_set/get* function
The descriptions may be more elaborated of course, but this is a good
step at starting providing any useful information in our man page, at all.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:53 +03:00
Konstantin Belousov
f5b9747075 libthr(3): explain some internals of the locks implementation
Describe internal allocations, mention problems with the use of global
malloc(3) and the reasons for internal allocator existence.

Document shared objects implementation and describe shortcomings of the
chosen approach, as well as the rationale why it was done that way.

Reviewed by:	markj
Discussed with:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:53 +03:00
Konstantin Belousov
6bda192013 pthread_mutexattr(3): install pthread_mutexattr_get/setpshared links
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Konstantin Belousov
0a6e5fc29b pthread_mutexattr(3): document pthread_mutexattr_set/getpshared
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Konstantin Belousov
9f3b6cdbe8 pthread_mutexattr(3): use .Fo/.Fc to avoid too long lines
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Mark Johnston
f0a08fa9f5 geom_label: Add more validation for NTFS volume tasting
- Ensure that the computed MFT record size isn't negative or larger than
  maxphys before trying to read $Volume.
- Guard against truncated records in volume metadata.
- Ensure that the record length is large enough to contain the volume
  name.
- Verify that the (UTF-16-encoded) volume name's length is a multiple of
  two.

PR:		258833, 258914
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2021-10-04 18:15:06 -04:00
Stefan Eßer
d43fa8ef53 contrib/bc: merge version 5.1.0 from vendor branch
This version adds options and functions that allow to print numbers
in the open interval (-1 .. 1) with or without a leading 0 digit.

Additionally, an option has been added to prevent line wrap and
allows to print arbitrarily long results on a single line.

Merge commit '5d58a51571721190681c50d4bd3a1f45e6282d72'
2021-10-04 22:25:24 +02:00
Stefan Eßer
b8d895faf4 contrib/bc: re-enable tests after the import of version 5.1.0
The tests have been fixed to not write any data outside of the
temporary work directory provided by the test framework.

MFC after:	3 days
2021-10-04 22:14:27 +02:00
Stefan Eßer
ded0d3d486 Add back Windows only VCXProj files 2021-10-04 22:10:52 +02:00
Stefan Eßer
d6c323eda2 Remove files that were checked in with wrong .gitattributes
These files will be added back in updated form, but are only relevant
for the Windows platform, anyway.
2021-10-04 22:10:32 +02:00
Stefan Eßer
5d58a51571 vendor/bc: update to version 5.1.0
This version adds options and functions that allow to print numbers
in the open interval (-1 .. 1) with or without a leading 0 digit.

Additionally, an option has been added to prevent line wrap and
allows to print arbitrarily long results on a single line.
2021-10-04 21:22:35 +02:00
David Bright
d18c9a9197 RPCBIND: skip ipv6 link local when request is not from link local address
RPCINFO on macOS behaves different compared to other linux clients and
doesn't provide request address in rpcb structure of the
RPCBPROC_GETADDRLIST call which doesn't seem to be forbidden.

In this case RPCBIND uses RPC call's source address and picks a
closest corresponding local address. If there are no addresses in the
same subnet as the source address, return of RPCBIND may vary
depending on the order of addresses returned in getifaddrs. If a link
local precedes global address it may be returned even if the request
comes from neither a link local nor from link local in a different
scope, which will prevent services like nfs from working in tpc6
scenario on macOS clients. Issue can be seen only on FreeBSD rpcbind
port due to changes in workflow of addrmerge call.

Submitted by:	Dmitry Ovsyannikov (Dmitry.Ovsyannikov@dell.com)
Reviewers:	dab
Differential Revision:	https://reviews.freebsd.org/D31491
Sponsored by:	Dell EMC
MFC to:	stable/12, stable/13
MFC after:	1 week
2021-10-04 10:45:26 -07:00
Warner Losh
d6dffbae96 lastcomm/sa: Remove sparc64 tests, they aren't needed.
These tests will run only on a sparc64 system, and so never run anymore.

Sponsored by:		Netflix
2021-10-04 10:51:15 -06:00
Mark Johnston
69f7649b71 gmultipath tests: Re-enable the failloop test in CI
PR:		258763
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2021-10-04 12:28:27 -04:00
Mark Johnston
105fd928b0 libctf: Improve check for duplicate SOU definitions in ctf_add_type()
When copying a struct or union from one CTF container to another,
ctf_add_type() checks whether it matches an existing type in the
destination container.  It does so by looking for a type with the same
name and kind as the new type, and if one exists, it iterates over all
members of the source type and checks whether a member with matching
name and offset exists in the matched destination type.  This can
produce false positives, for example because member types are not
compared, but this is not expected to arise in practice.  If the match
fails, ctf_add_type() returns an error.

The procedure used for member comparison breaks down in the face of
anonymous struct and union members.  ctf_member_iter() visits each
member in the source definition and looks up the corresponding member in
the desination definition by name using ctf_member_info(), but this
function will descend into anonymous members and thus fail to match.
Fix the problem by introducing a custom comparison routine which does
not assume member names are unique.  This should also be faster for
types with many members; in the previous scheme, membcmp() would perform
a linear scan of the desination type's members to perform a lookup by
name.  The new routine steps through the members of both types in a
single loop.

PR:		258763
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2021-10-04 12:28:22 -04:00
Andrew Turner
507a22be38 Add the missing license to gic_if.m
Sponsored by:	The FreeBSD Foundation
2021-10-04 13:21:21 +01:00
Baptiste Daroussin
cc46927f8a ncurses: fix libcompat (lib32 for example) building 2021-10-04 14:16:32 +02:00
Baptiste Daroussin
27803b54db ncurses: fix path where to find curses.h at bootstrap
after the split, curses.h is now generated by tinfo Makefile, but
still used for a file generated in ncurses lib. Adjust the path to
make sure curses.h is always found
2021-10-04 12:31:23 +02:00
Baptiste Daroussin
16f1ee11e6 ncurses: document in UPDATING and bump _FreeBSD_version 2021-10-04 11:38:29 +02:00
Baptiste Daroussin
19deec3b30 bsdinstall: reduce overlinking
both distextract and distfetch does not directly use ncurses,
or figpart, drop their direct link to those libs
2021-10-04 11:38:27 +02:00
Baptiste Daroussin
cbc83e378a ncurses: chase dependency changes in the source tree
Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:24 +02:00
Baptiste Daroussin
396851c20a ncurses: split libtinfo from libncurses
many external program expects libncurses to not be provided as a single
library. Instead of fixing all ports, distribute ncurses the way
upstream distributes it

Turn libncursesw.so into a ldscript which will link automatically as
needed to libtinfow so so this change is seamless at compile time.

Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:21 +02:00
Hans Petter Selasky
8bc5971be1 UPDATING: Update notes about new mixer(8) utility.
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking
2021-10-04 11:01:47 +02:00
Stefan Eßer
f774652b0e contrib/bc: temporarily disconnect the tests for 5.0.2
The tests that come with version 5.0.2 have been extended to cover the
line editing functions. It has been found that these tests generate
false negative results in FreeBSD, most likely due to an issue in the
pexpect functionality used.

These history tests are skipped on systems that do not have python and
py-pexpect installed (and thus are unlikely to cause CI test failures),
but in order to not cause irritating failures on systems were these
packages are in fact installed, I temporarily disconnect them.

I had planned to skip this version due to the issue with the history
tests, but some committer has asked me to go ahead since the currently
used version 5.0.0 contains a macro name that collides with a project
he is working on.

No MFC of this version is planned. A version 5.0.3 is expected to be
released soon, and that version will allow to reconnect the tests and
will be MFCed.
2021-10-04 09:50:44 +02:00
Stefan Eßer
ea31d1a5c4 contrib/bc: remove files ommitted from the release
A number of files have been removed from the release distribution of
this bc implementation. They were mostly relevant for pre release
testing and benchmarking to identify regressions. The Markdown
sources of the man pages are only relevant for combinations of build
options not used in FreeBSD and need non-default conversion tools
(available as ports in FreeBSD).

All the omitted files can be found in the upstream git repository,
and they are fetched when building this software as a port. But they
have never been used in the FreeBSD base system.
2021-10-04 09:41:06 +02:00
Stefan Eßer
662087dfd0 vendor/bc: update to upstream version 5.0.2
(cherry picked from commit a60ef1802a)
2021-10-04 09:37:19 +02:00
Colin Percival
248682a589 loader bcache: Allow readahead up to 256 kB I/Os
Prior to this commit, the loader would perform readaheads of up to
128 kB; when booting on a UFS filesystem this resulted in a series
of 160 kB reads (32 kB request + 128 kB readahead).

This commit allows readaheads to be longer, subject to a total I/O
size limit of 256 kB; i.e. 32 kB read requests will have added
readaheads of up to 224 kB.

In my testing on an EC2 c5.xlarge instance, this change reduces the
boot time by roughly 80 ms.

Reviewed by:	tsoome
MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32251
2021-10-03 14:55:10 -07:00
Colin Percival
04b9b7c507 loader bcache: Track unconsumed readahead
The loader bcache attempts to determine whether readahead is useful,
increasing or decreasing its readahead length based on whether a
read could be serviced out of the cache.  This resulted in two
unfortunate behaviours:

1. A series of consecutive 32 kB reads are requested and bcache
performs 16 kB readaheads.  For each read, bcache determines that,
since only the first 16 kB is already in the cache, the readahead
was not useful, and keeps the readahead at the minimum (16 kB) level.

2. A series of consecutive 32 kB reads are requested and bcache
starts with a 32 kB readahead resulting in a 64 kB being read on
the first request.  The second 32 kB request can be serviced out of
the cache, and bcache responds by doubling its readahead length to
64 kB.  The third 32 kB request cannot be serviced out of the cache,
and bcache reduces its readahead length back down to 32 kB.

The first syndrome converts a series of 32 kB reads into a series of
(misaligned) 32 kB reads, while the second syndrome converts a series
of 32 kB reads into a series of 64 kB reads; in both cases we do not
increase the readahead length to its limit (currently 128 kB) no
matter how many consecutive read requests are made.

This change avoids this problem by tracking the "unconsumed
readahead" length; readahead is deemed to be useful (and the
read-ahead length is potentially increased) not only if a request was
completely serviced out of the cache, but also if *any* of the request
was serviced out of the cache and that length matches the amount of
unconsumed readahead.  Conversely, we now only reduce the readahead
length in cases where there was unconsumed readahead data.

In my testing on an EC2 c5.xlarge instance, this change reduces the
boot time by roughly 120 ms.

Reviewed by:	imp, tsoome
MFC after:	1 week
Sponsored by:	https://patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32250
2021-10-03 14:54:09 -07:00