Commit Graph

257207 Commits

Author SHA1 Message Date
Alan Somers
f05b724ecb Modernize geom_stats_snapshot_get
* A logically useless memset() is used to fault in some memory pages.
  Change it to explicit_bzero so the compiler won't eliminate it.

* Eliminate the second memset.  It made sense in the days of the Big
  Kernel Lock, but not in the days of fine-grained SMP and especially
  not in the days of VDSO.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	phk
Differential Revision:	https://reviews.freebsd.org/D29047
2021-03-04 07:45:48 -07:00
Glen Barber
63749bfe96 release: sprinkle UNAME_r hacks following c883b6fd8c
Pass UNAME_r override to make(1) for ports builds when building
ports for another branch.

MFC after:	3 days
MFC with:	0be274d373, 80ab50e1de, c883b6fd8c
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-03-04 09:25:18 -05:00
Fernando Apesteguía
fc1e79740e compress(1): warn about link handling
compress(1) handles links badly and does not provide link-handling options.
Document this behavior.

PR:     84271
Submitted by: garys@opusnet.com
Approved by: gbe@ (mentor)
Differential Revision:	https://reviews.freebsd.org/D28552
2021-03-04 14:52:12 +01:00
Glen Barber
fa04db4762 release: fix VMSIZE following 1ca8842f3a
truncate(1) is not case-sensitive with regard to setting the size
of a file.  makefs(8), however, does not honor upper-case values.
Update release-specific files and the release(7) manual page to
reflect this.

MFC with:	1ca8842f3a
Submitted by:	ehem_freebsd_m5p.com (original)
Differential Review:	https://reviews.freebsd.org/D28979
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-03-04 08:43:02 -05:00
Stefan Eßer
a0d921bae9 Remove obsolete bc library and dc test files
The new bc implementation has the library embedded into the binary
and tests in tests/usr.bin/bc instead of tests/ustr.bin/dc.

MFC after:	3 days
2021-03-04 14:24:51 +01:00
Fernando Apesteguía
3457dbd52b mq_open(2): Fix xref to mq_unlink(2)
mq_unlink(2) was added in acab1d58be

PR: 215611
Reported by: rwatson@FreeBSD.org
Approved by: gbe@ (mentor)
Differential Revision:	https://reviews.freebsd.org/D28913
2021-03-04 13:32:42 +01:00
Chris Rees
5ac70383c8 elftoolchain: stop leaving tempfiles on error
Temporary files were not cleaned up, resulting in $TMPDIR or even
the current directory becoming littered with ecp.* files.

This happened with error and even sometimes on success!

Approved by:		dim
MFC after:		4 weeks
Accepted upstream:	https://sourceforge.net/p/elftoolchain/code/3918/
Differential Revision:	https://reviews.freebsd.org/D28651
2021-03-04 12:24:07 +00:00
Oleksandr Tymoshenko
37cd6c20db cron: consume blanks in system crontabs before options
On system crontabs, multiple blanks are not being consumed after reading the
username. This change adds blank consumption before parsing any -[qn] options.
Without this change, an entry like:

  * * * * * username  -n true  # Two spaces between username and option.

will fail, as the shell will try to execute (' -n true'), while an entry like:

  * * * * * username -n true   # One space between username and option.

works as expected (executes 'true').

For user crontabs, this is not an issue as the preceding (day of week
or @shortcut) processing consumes any leading whitespace.

PR:		253699
Submitted by:	Eric A. Borisch <eborisch@gmail.com>
MFC after:	1 week
2021-03-03 23:23:31 -08:00
Jung-uk Kim
483c6da3a2 libkvm: Refine the previous commit (645eaa2cca)
Resort free()'ing memory in kvm_close() to make it easier to MFC.

MFC after:	3 days
2021-03-03 18:50:45 -05:00
Ed Maste
0dcde5cc12 growfs: allow operation on RW-mounted filesystems
growfs supports growing mounted filesystems (writes are temporarily
suspended while the grow happens).  Drop the check for fs_clean == 0
to restore this case.  Leave fs_flags check for FS_UNCLEAN or
FS_NEEDSFSCK which represent the state of the filesystem when it was
mounted, and fsck should be run first if they are set.

PR:		253754
Reviewed by:	mckusick
MFC after:	3 days
Fixes:		6eb925f845 ("Filesystem utilities that modify the...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29021
2021-03-03 18:35:21 -05:00
John Baldwin
78991a93eb ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28757
2021-03-03 15:20:57 -08:00
John Baldwin
92aecd1e6f ossl: Add ChaCha20 cipher support.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28756
2021-03-03 15:20:57 -08:00
John Baldwin
a899ce4ba4 The ChaCha20 counter is little endian, not big endian.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28755
2021-03-03 15:20:57 -08:00
John Baldwin
a079e38b08 ossl: Add Poly1305 digest support.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28754
2021-03-03 15:20:57 -08:00
John Baldwin
442a293611 cryptocheck: Free generated IV after each GMAC test.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28753
2021-03-03 15:20:57 -08:00
John Baldwin
68c0373448 cryptocheck: Add support for the Poly1305 digest.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28758
2021-03-03 15:20:56 -08:00
Jung-uk Kim
645eaa2cca libkvm: Plug couple of memory leaks and check possible calloc(3) failure
First, r204494 introduced dpcpu_off in struct __kvm and it was allocated
from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3).
Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to
use the new function but it did not free the temporary buffer.
Also, check possible calloc(3) failure while I am in the neighborhood.

MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29019
2021-03-03 18:10:00 -05:00
John Baldwin
e6cfd2939a Remove the usr/tests/usr.bin/yacc/yacc directory when removing yacc.
MFC after:	1 week
2021-03-03 14:46:45 -08:00
Vladimir Kondratyev
6241b57131 hid: add opt_hid.h to modules that use HID_DEBUG
Submitted by:	Greg V <greg_AT_unrelenting_DOT_technology>
Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D28995
2021-03-04 01:43:29 +03:00
Mark Johnston
49f6925ca3 ktls: Cache output buffers for software encryption
Maintain a cache of physically contiguous runs of pages for use as
output buffers when software encryption is configured and in-place
encryption is not possible.  This makes allocation and free cheaper
since in the common case we avoid touching the vm_page structures for
the buffer, and fewer calls into UMA are needed.  gallatin@ reports a
~10% absolute decrease in CPU usage with sendfile/KTLS on a Xeon after
this change.

It is possible that we will not be able to allocate these buffers if
physical memory is fragmented.  To avoid frequently calling into the
physical memory allocator in this scenario, rate-limit allocation
attempts after a failure.  In the failure case we fall back to the old
behaviour of allocating a page at a time.

N.B.: this scheme could be simplified, either by simply using malloc()
and looking up the PAs of the pages backing the buffer, or by falling
back to page by page allocation and creating a mapping in the cache
zone.  This requires some way to save a mapping of an M_EXTPG page array
in the mbuf, though.  m_data is not really appropriate.  The second
approach may be possible by saving the mapping in the plinks union of
the first vm_page structure of the array, but this would force a vm_page
access when freeing an mbuf.

Reviewed by:	gallatin, jhb
Tested by:	gallatin
Sponsored by:	Ampere Computing
Submitted by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D28556
2021-03-03 17:34:01 -05:00
Mark Johnston
c113740f26 git-arc.1: Fix synopsis for the "update" verb 2021-03-03 17:01:04 -05:00
Mark Johnston
c49b075305 git-arc: Handle commit ranges in the "update" verb
Reported by:	imp
2021-03-03 17:00:58 -05:00
Alexander Motin
afc3e54eee Move ic_check_send_space clear to the actual check.
It closes tiny race when the flag could be set between being cleared
and the space is checked, that would create us some more work.  The
flag setting is protected by both locks, so we can clear it in either
place, but in between both locks are dropped.

MFC after:	1 week
2021-03-03 15:29:35 -05:00
Kyle Evans
0c1a5eaae8 env: style(9) fix, add a space
Reported by:	pstef
Fixes:	55deb0a5f0 ("service(8): use an environment more [...]")
2021-03-03 14:21:56 -06:00
Andrew Gierth
55deb0a5f0 service(8): use an environment more consistent with init(8)
init(8) sets the "daemon" login class without specifying a pw
entry (so no substitutions are done on the variables). service(8)'s
use of env -L had the effect of specifying root's pw entry, with two
effects: getpwnam and getpwuid are being called, which may not be
entirely safe depending on what nsswitch is up to and what stage of
boot we are at, and substitutions would have been done.

Fix by teaching env(8) to allow -L -/classname to set the class
environment with no pw entry at all specified, and use it in
service(8).

PR:		253959
2021-03-03 12:25:11 -06:00
Alexander Motin
aff9b9ee89 Restore condition removed in df3747c660.
I think it allowed to avoid some TX thread wakeups while the socket
buffer is full.  But add there another options if ic_check_send_space
is set, which means socket just reported that new space appeared, so
it may have sense to pull more data from ic_to_send for better TX
coalescing.

MFC after:	1 week
2021-03-03 12:03:08 -05:00
Ed Maste
f2f24008a2 Cirrus-CI: Add more information to help track down disk full issues
Execute df(1) before and after the build (reporting in MiB for
consistency), and du(1) of /usr/obj.  Also include the uname.
2021-03-03 11:51:08 -05:00
Chris Rees
2935869428 crontab.5: Correct claims on ranges and names
Ranges use the function get_number, which means that ranges of names
are supported and indeed always have been, righ back to the initial
import.

PR:		docs/253969
Reported by:	Ben Bullock <benkasminbullock@gmail.com>
2021-03-03 16:35:45 +00:00
Andreas Bjornestad
25352f9fda Minor grammar nit
PR:		docs/253975
2021-03-03 16:20:29 +00:00
Andrew Turner
773fc43fb0 Revert "Split out the loader efifb setup to a new function"
It was broken by a rebase. Revert until it can be fixed.

This reverts commit c8db60c067.
2021-03-03 16:10:12 +00:00
Zyta Szpak
622d17da46 arm64: mv_ap806_gicp: Fix spi_ranges_cnt
Previously the spi_ranges_cnt stored the table size in bytes
instead of the number of elements. Fix that.

Reviewed by: mmel
Submitted by: Zyta Szpak <zr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Marvell
2021-03-03 17:08:12 +01:00
Andrew Turner
28d945204e Handle functions that use a nop in the arm64 fbt
To trace leaf asm functions we can insert a single nop instruction as
the first instruction in a function and trigger off this.

Reviewed by:	gnn
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28132
2021-03-03 14:18:03 +00:00
Andrew Turner
48ba9b2669 Use L2 blocks when in the identity map
This reduces the memory mapped to be closer to the minimal memory
needed to enable the MMU.

Reviewed by:	mmel
Sponsored by:	Innovate UK
Differential Revision:://reviews.freebsd.org/D27765
2021-03-03 14:18:03 +00:00
Andrew Turner
c8db60c067 Split out the loader efifb setup to a new function
This makes bi_load_efi_data cleaner to add common acpi setup code.

Reviewed by:	imp, tsoome
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28936
2021-03-03 14:18:02 +00:00
Peter Holm
8a272653d9 stress2: Initial import
Discussed with:	 kib
2021-03-03 15:11:40 +01:00
Mark Johnston
3adf72a36b qat.4: Fix some firmware module names
PR:		252984
MFC after:	1 week
2021-03-03 09:07:53 -05:00
Alex Richardson
47ceb65f3c Fix capsicum-test build with GCC
Apparently GCC defines NULL to 0 in C++11 mode (instead of nullptr), so
this causes the following error:
```
In file included from capsicum-test.h:15,
                 from capsicum-test.cc:1:
gtest-1.10.0/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long int; T2 = procstat*]':
capsicum-test.cc:75:3:   required from here
gtest-1.10.0/include/gtest/gtest.h:1621:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 1609 |   if (val1 op val2) {\
      |       ~~~~~~~~~~~~
......
 1621 | GTEST_IMPL_CMP_HELPER_(NE, !=);
gtest-1.10.0/include/gtest/gtest.h:1609:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_'
 1609 |   if (val1 op val2) {\
      |            ^~
```

Fix this by using nullptr directly.

Submitted upstream as https://github.com/google/capsicum-test/pull/56

Reported by:	Jenkins CI
2021-03-03 13:53:45 +00:00
Alex Richardson
1fcbddec14 Fix GCC build of ptrace_test after 96a9e50e63
It seems like GCC's -Wsign-compare is stricter and also warns for
constants. Appease GCC by adding the required casts.

Fixes:		96a9e50e63 ("ptrace_test: Add more debug output on test failures")
Reported by:	Jenkins CI
2021-03-03 11:22:43 +00:00
Emmanuel Vadot
1df30489a8 backlight(8): Add note that with option it print the current brightness.
MFC after:    3 days
PR: 	      253737
2021-03-03 09:00:42 +01:00
David Schlachter
3b005d51bd backlight: Fix incr/decr with percent value of 0
This now does nothing instead of incr/decr by 10%

MFC After:    3 days
PR: 	      253736
2021-03-03 08:57:35 +01:00
Xin LI
5842073a9b arcmsr(4): Fixed no action of hot plugging device on type_F adapter.
Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
MFC after:	3 days
2021-03-02 22:57:20 -08:00
Kyle Evans
852f70b240 init: use explicit_bzero() for clearing passwords
This is a nop in practice, because it cannot be proven that this
particular bzero() is not significant.  Make it explicit anyways, rather
than relying on an implementation detail of how the password is
collected.

Discussed with:	Andrew Gierth <andrew tao146 riddles org uk>
2021-03-02 21:55:41 -06:00
Alan Somers
de415e663c release.7: describe the NOGIT option
It was added in 91ce469984 (svn r365638)

MFC after:	7 days
Sponsored by:	Axcient
Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D29027
2021-03-02 19:39:57 -07:00
Ryan Moeller
80545a16df libifconfig: Fix typo in symbol map
MFC after:	1 week
2021-03-02 21:19:42 -05:00
Ryan Moeller
8b22242550 sbin/ifconfig: Use a global libifconfig handle
This should eventually replace the socket passed to the various
handlers. In the meantime, making it global avoids repeatedly opening
and closing handles.

Reported by:	kp
Reviewed by:	kp (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28990
2021-03-02 21:15:40 -05:00
Krzysztof Galazka
21802a127d ixl(4): Add ability to control link state on ifconfig down
Add sysctl link_active_on_if_down, which allows user to control
if interface is kept in active state when it is brought
down with ifconfig. Set it to enabled by default to preserve
backwards compatibility.

Reviewed by:	erj
Tested by:	gowtham.kumar.ks@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28028
2021-03-02 17:43:38 -08:00
Krzysztof Galazka
9f99061ef9 ixl(4): Report RX errors as sum of all RX error counters
HW keeps track of RX errors using several counters, each for
specific type of errors. Report RX errors to OS as sum
of all those counters: CRC errors, illegal bytes, checksum,
length, undersize, fragment, oversize and jabber errors.

There is no HW counter for frames with invalid L3/L4 checksums
so add a SW one.

Also add a "rx_errors" sysctl with a copy of netstat IERRORS
counter value to make it easier accessible from scripts.

Reviewed By:	erj
Tested By:	gowtham.kumar.ks@intel.com
Sponsored By:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D27639
2021-03-02 17:37:04 -08:00
Warner Losh
b3fce46a3e cam: remove redundant scsi_vpd_block_characteristics definition
There were two definitions for the SCSI VPD Block Device Characteristics (page
0xb1): struct scsi_vpd_block_characteristics and struct
scsi_vpd_block_device_characteristics. The latter is more complete and more
widely used. Convert uses of the former to the latter by tweaking the da driver
and removing sturct scsi_vpd_block_characteristics.
2021-03-02 18:35:09 -07:00
Alan Somers
d977417d74 [skip ci] fix a typo in a comment in mdconfig.c
Sponsored by:	Axcient
Reviewed by:    mav, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D28968
2021-03-02 18:33:45 -07:00
Alan Somers
ab63da3564 Speed up geom_stats_resync in the presence of many devices
The old code had a O(n) loop, where n is the size of /dev/devstat.
Multiply that by another O(n) loop in devstat_mmap for a total of
O(n^2).

This change adds DIOCGMEDIASIZE support to /dev/devstat so userland can
quickly determine the right amount of memory to map, eliminating the
O(n) loop in userland.

This change decreases the time to run "gstat -bI0.001" with 16,384 md
devices from 29.7s to 4.2s.

Also, fix a memory leak first reported as PR 203097.

Sponsored by:	Axcient
Reviewed by:	mav, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28968
2021-03-02 18:33:45 -07:00