Commit Graph

253236 Commits

Author SHA1 Message Date
Kirk McKusick
68d7185b64 The fsdb(8) utility uses the fsck_ffs(8) disk I/O interfaces, so
switch from using libufs's bread() to using fsck_ffs's getdatablk()
when importing tools/diag/prtblnos's prtblknos().

Sponsored by: Netflix
2020-09-19 20:06:12 +00:00
Alan Somers
9ad1d357e0 fix integer underflow in getgrnam_r and getpwnam_r
Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This
triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to
return ERANGE instead of 0.

Fix the user's buffer size check, and add a correct check for a too-small
nscd buffer.

PR:		248932
Event:		September 2020 Bugathon
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D26204
2020-09-19 19:08:27 +00:00
Mark Johnston
c6989859ae Address compiler warnings in C code used by the DTrace test suite.
Reported by:	Jenkins
MFC after:	1 week
2020-09-19 16:15:22 +00:00
Mark Johnston
d26ab2bec0 Fix some nits in 1G page support in the amd64 pmap.
- Move assertions out of the main loop to avoid duplicate conditional
  expressions, and improve assertion messages.
- Fix va_next updates.  In some cases we were not doing the wraparound
  check before continuing the loop.
- Use the right va_next.  In pmap_advise() and pmap_copy() we would step
  through 1G pages 2M at a time.
- Copy 1G mappings in pmap_copy().

Reviewed by:	alc, kib
MFC with:	r365518
Sponsored by:	Juniper Networks, Inc., Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26463
2020-09-19 15:22:04 +00:00
Gordon Bergling
918d5f5908 diskless(8): Correct Sections out of conventional order error
Event:		September 2020 Bugathon
MFC after:	1 week
2020-09-19 15:10:17 +00:00
Gordon Bergling
182ae6ca30 crypto(7): Correct Sections out of conventional order error
Event:		September 2020 Bugathon
MFC after:	1 week
2020-09-19 15:08:57 +00:00
Gordon Bergling
b72ce4bfdf src.conf(5): Fix some mandoc issues in source files
- new sentence, new line
- blank line in fill mode

Event:		September 2020 Bugathon
MFC after:	1 week
2020-09-19 14:49:31 +00:00
Ed Maste
57391dee45 Cirrus-CI: skip svn_head branch
svn_head has the same content as the master or main branch (it's just
the result of a `git svn` conversion instead of svn2git).

Sponsored by:	The FreeBSD Foundation
2020-09-19 13:55:26 +00:00
Alex Richardson
79e02149fc Fix dtrace tools bootstrap on non-FreeBSD after OpenZFS import
This required surprisingly few build system changes and only two changes to the
openZFS compat headers which have been upstreamed as
https://github.com/openzfs/zfs/pull/10863

Reviewed By:	#zfs, freqlabs
Differential Revision: https://reviews.freebsd.org/D26193
2020-09-19 12:08:16 +00:00
Michal Meloun
b8bfffc1b6 Implement workaround for broken access to configuration space.
Due to a HW bug in the RockChip PCIe implementation, attempting to access
a non-existent register in the configuration space will throw an exception.
Use new bus functions bus_peek() and bus_poke() to overcomme this limitation.
2020-09-19 11:27:16 +00:00
Michal Meloun
95a85c125d Add NetBSD compatible bus_space_peek_N() and bus_space_poke_N() functions.
One problem with the bus_space_read_N() and bus_space_write_N() family of
functions is that they provide no protection against exceptions which can
occur when no physical hardware or device responds to the read or write
cycles. In such a situation, the system typically would panic due to a
kernel-mode bus error. The bus_space_peek_N() and bus_space_poke_N() family
of functions provide a mechanism to handle these exceptions gracefully
without the risk of crashing the system.

Typical example is access to PCI(e) configuration space in bus enumeration
function on badly implemented PCI(e) root complexes (RK3399 or Neoverse
N1 N1SDP and/or access to PCI(e) register when device is in deep sleep state.

This commit adds a real implementation for arm64 only. The remaining
architectures have bus_space_peek()/bus_space_poke() emulated by using
bus_space_read()/bus_space_write() (without exception handling).

MFC after:	1 month
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D25371
2020-09-19 11:06:41 +00:00
Colin Percival
9a63bbc93e Move finalize_components_config from get_params to cmd_*.
This allows us to redirect its output in cmd_cron, so that the
"src component not installed, skipped" message will be treated
the same way as other output from freebsd-update cron: Sent
in an email to root (or other address specified) if there are
updates to install, and silenced otherwise.

PR:		202492
MFC After:	1 week
Differential Revision:	https://reviews.freebsd.org/D26432
2020-09-19 02:15:56 +00:00
Kyle Evans
eef96401a9 caroot: update base store
Count:
- Two (2) removed
- Three (3) added

MFC after:	3 days
2020-09-19 01:59:17 +00:00
Rick Macklem
58dd2b52cb Fix a LOR between the NFS server and server side krpc.
Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
used for sessions and the sleep lock used for server side krpc socket
structures in nfsrv_checksequence().  This was fixed by r365789.
A similar bug exists in nfsrv_bindconnsess(), where SVC_RELEASE() is called
while mutexes are held.
This patch applies a fix similar to r365789, moving the SVC_RELEASE() call
down to after the mutexes are released.

This patch fixes the problem by moving the SVC_RELEASE() call in
nfsrv_checksequence() down a few lines to below where the mutex is released.

MFC after:	1 week
2020-09-18 23:52:56 +00:00
Matt Macy
2c48331d28 MFV 2.0-rc2
- Fixes divide by zero for unusual hz
- remove cryptodev dependency
2020-09-18 23:21:24 +00:00
Matt Macy
04bab00822 Update openzfs to 2.0.0-rc2-g4ce06f 2020-09-18 22:55:05 +00:00
Eric van Gyzen
d8d2dda141 amd64 pmap_pkru_same: prev_ppr was always NULL
Fix the logic so it works as it appears.

Reported by:	Coverity
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	D26211 (in progress, so omitting full URL)
2020-09-18 20:53:40 +00:00
Mark Johnston
7afab8a67e Install library symlinks atomically.
As we do for shared library binaries, pass -S to install(1) when
installing symlinks.  Doing so helps avoid transient failures when
libraries are being reinstalled, which seems to be the root cause of
spurious libgcc_s.so link failures during CI builds.

PR:		233769
Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26453
2020-09-18 19:03:34 +00:00
Ed Maste
11224884f2 ys/contrib/dev/ath: remove unintentional double semicolon
Approved by:	adrian
2020-09-18 18:35:18 +00:00
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Eric van Gyzen
f9cc8410e1 vm_ooffset_t is now unsigned
vm_ooffset_t is now unsigned. Remove some tests for negative values,
or make other adjustments accordingly.

Reported by:	Coverity
Reviewed by:	kib markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26214
2020-09-18 16:48:08 +00:00
Mitchell Horne
6dadc5d1cd arm64: generate ISO release images
Some IPMI implementations on arm64 are reportedly unable to load our
memstick installer images, but support the older ISO format. Start
generating these for arm64.

Unlike installer ISOs for other platforms, these images are UEFI-only.

Reviewed by:	emaste
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26452
2020-09-18 14:40:13 +00:00
Kyle Evans
209dcc7cec pkgbase: use consistent annotation for objectk eys
Everywhere else we use objects ("scripts", generally) we do sepcify the
optional colon. Be consistent and do the same for directories.

PR:		249273
Submitted by:	Martin <martin.jakob gmx com>
MFC after:	1 week
2020-09-18 14:29:01 +00:00
Alex Richardson
c5ef56ea61 Remove unnecessary include "../Makefile.inc"
This is already pulled in by bsd.init.mk.

Reported By:	kevans
2020-09-18 14:05:31 +00:00
Mitchell Horne
374ce2488a Initialize some local variables earlier
Move the initialization of these variables to the beginning of their
respective functions.

On our end this creates a small amount of unneeded churn, as these
variables are properly initialized before their first use in all cases.
However, changing this benefits at least one downstream consumer
(NetApp) by allowing local and future modifications to these functions
to be made without worrying about where the initialization occurs.

Reviewed by:	melifaro, rscheff
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26454
2020-09-18 14:01:10 +00:00
Konstantin Belousov
085e04945c Add pargs, penv, pwdx commands and aliases to procstat(1).
Intent is to mimic Solaris commands with the same names.

Submitted by:	Juraj Lutter <juraj@lutter.sk>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26310
2020-09-18 12:59:27 +00:00
Mark Johnston
d99cb9802b Assert we are not traversing through superpages in the arm64 pmap.
Reviewed by:	alc, andrew
MFC after:	1 week
Sponsored by:	Juniper Networks, Inc., Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26465
2020-09-18 12:37:41 +00:00
Mark Johnston
04636a71c6 Ensure that a protection key is selected in pmap_enter_largepage().
Reviewed by:	alc, kib
Reported by:	Coverity
MFC with:	r365518
Differential Revision:	https://reviews.freebsd.org/D26464
2020-09-18 12:30:39 +00:00
Mark Johnston
3d1098617b Fix error checking in shm_create_largepage().
Reviewed by:	alc, kib
Reported by:	Coverity
MFC with:	r365524
Differential Revision:	https://reviews.freebsd.org/D26464
2020-09-18 12:30:15 +00:00
Alex Richardson
72f97a2d09 libarchive: fix mismatch between library and test configuration
I was investigating libarchive test failures on CheriBSD and it turns out
we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows
that libarchive and the tests disagree when it comes to the definition of
archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test
use the libmd type. The latter is not necessarily aligned enough to store
a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing
EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx.

To avoid problems like this in the future, factor out the common compiler
flags into a Makefile.inc and include that from the tests Makefile.

Reviewed By:	lwhsu
Differential Revision: https://reviews.freebsd.org/D26469
2020-09-18 11:22:34 +00:00
Gordon Bergling
16694347a9 crypto_buffer(9): Bring back the reference for bus_dma(9)
The reference was accidentally deleted in r365855.

Reported by:	jhb
Pointy hat to:	gbe
2020-09-18 11:04:16 +00:00
Alexander V. Chernikov
4a8c6300e9 Use atf_fail instead of exit 1 to indicate mpath tests failure. 2020-09-18 07:27:01 +00:00
Peter Grehan
285e35e6f1 Fix byte-reversal of language ID in string descriptor.
The language id of String Descriptors in usb mouse is
0x0904, while the spec require 0x0409 (English - United States)

Submitted by:	Wanpeng Qian
Reviewed by:	grehan
Approved by:	grehan (#bhyve)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26472
2020-09-18 05:54:59 +00:00
Navdeep Parhar
3b8506ae30 cxgbe(4): add the firmware binaries instead of the empty files that were added
in r365861.

Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-18 03:11:47 +00:00
Navdeep Parhar
a4a4ad2dd9 cxgbe(4): add support for stateless offloads for VXLAN traffic.
Hardware assistance includes checksumming (tx and rx), TSO, and RSS on
the inner traffic in a VXLAN tunnel.

Relnotes:	Yes
Sponsored by:	Chelsio Communications
2020-09-18 03:01:47 +00:00
Navdeep Parhar
b092fd6c97 if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS.
This lets a VXLAN pseudo-interface take advantage of hardware checksumming (tx
and rx), TSO, and RSS if the NIC is capable of performing these operations on
inner VXLAN traffic.

A VXLAN interface inherits the capabilities of its vxlandev interface if one is
specified or of the interface that hosts the vxlanlocal address. If other
interfaces will carry traffic for that VXLAN then they must have the same
hardware capabilities.

On transmit, if_vxlan verifies that the outbound interface has the required
capabilities and then translates the CSUM_ flags to their inner equivalents.
This tells the hardware ifnet that it needs to operate on the inner frame and
not the outer VXLAN headers.

An event is generated when a VXLAN ifnet starts. This allows hardware drivers to
configure their devices to expect VXLAN traffic on the specified incoming port.

On receive, the hardware does RSS and checksum verification on the inner frame.
if_vxlan now does a direct netisr dispatch to take full advantage of RSS. It is
not very clear why it didn't do this already.

Future work:
Rx: it should be possible to avoid the first trip up the protocol stack to get
the frame to if_vxlan just so it can decapsulate and requeue for a second trip
up the stack. The hardware NIC driver could directly call an if_vxlan receive
routine for VXLAN traffic instead.

Rx: LRO. depends on what happens with the previous item. There will have to to
be a mechanism to indicate that it's time for if_vxlan to flush its LRO state.

Reviewed by:	kib@
Relnotes:	Yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25873
2020-09-18 02:37:57 +00:00
Navdeep Parhar
72cc43df17 Add a knob to allow zero UDP checksums for UDP/IPv6 traffic on the given UDP port.
This will be used by some upcoming changes to if_vxlan(4).  RFC 7348 (VXLAN)
says that the UDP checksum "SHOULD be transmitted as zero.  When a packet is
received with a UDP checksum of zero, it MUST be accepted for decapsulation."
But the original IPv6 RFCs did not allow zero UDP checksum.  RFC 6935 attempts
to resolve this.

Reviewed by:	kib@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25873
2020-09-18 02:21:15 +00:00
Navdeep Parhar
830edb4561 Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic.
These are similar to the existing VLAN capabilities.

Reviewed by:	kib@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25873
2020-09-18 02:10:28 +00:00
Navdeep Parhar
1f7313861b mbuf checksum flags and fields to support tunneling protocols.
These are being added to support VXLAN but will work for GENEVE as well.
ENCAP_RSVD1 will likely become ENCAP_GENEVE in the future.

The size of struct mbuf does not change and that means this change can be MFC'd.
If size wasn't a constraint a cleaner way may have been to add inner_csum_flags
and inner_csum_data to go with csum_flags and csum_data.

Reviewed by:	kib@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25873
2020-09-18 01:38:47 +00:00
Konstantin Belousov
294c24b194 State kgssapi dependency on xdr.
Submitted by:	Dmitry Afanasiev
PR:	249378
MFC after:	3 days
2020-09-17 22:29:38 +00:00
Navdeep Parhar
88c9c3f4dd cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.
Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-17 22:14:11 +00:00
Gordon Bergling
60365150ae arch(7): Some markup fixes
- no blank before trailing delimiter

MFC after:	3 days
2020-09-17 21:24:11 +00:00
Gordon Bergling
9c946dc379 man(9): Some markup fixes
- whitespace at end of input line
- skipping paragraph macro: Pp after Sh

MFC after:	3 days
2020-09-17 21:08:11 +00:00
Gordon Bergling
8713e3ccba pwmbus(9): some markup fixes
- whitespace at end of input line

MFC after:	3 days
2020-09-17 20:55:42 +00:00
Gordon Bergling
ac81581df3 mbuf(9): Some markup fixes
- whitespace at end of input line
- no blank before trailing delimiter: Dv MJUM16BYTES

MFC after:	3 days
2020-09-17 20:53:24 +00:00
Gordon Bergling
fade09c8ac crypto_buffer(9): Sort the SEE ALSO section
MFC after:	3 days
2020-09-17 20:50:02 +00:00
Gordon Bergling
d2527db87a VOP_INACTIVE(9): Remove trailing whitespace
MFC after:	3 days
2020-09-17 20:42:41 +00:00
Gordon Bergling
6f563a6f49 domainset(9): Some markup fixes
- new sentence, new line
- whitespace at end of input line

MFC after:	3 days
2020-09-17 20:37:54 +00:00
Kyle Evans
9ed054096d Revert r361257: bsdinstall: do a certctl rehash upon installation [...]
As of r365829, any given base distribution set will now include the /etc/ssl
symlinks that this rehash would've otherwise installed. This extra step is
no longer required.

MFC after:	1 week
X-MFC-With:	r365837
2020-09-17 20:35:45 +00:00
Gordon Bergling
27f21fadda rmlock(9): Some markup fixes
- new sentence, new line

MFC after:	3 days
2020-09-17 20:32:10 +00:00