Commit Graph

253093 Commits

Author SHA1 Message Date
Alan Somers
5e20b96c65 nsswitch.conf.5: style fixes
Fix some whitespace, and remove the .Tn macro

Reported by:	mandoc, igor
Reviewed by:	bcr (manpages)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26345
2020-09-07 13:44:54 +00:00
Alexander V. Chernikov
05aca418f4 Consistently use the same gateway when adding/deleting interface routes.
Use the same link-level gateway when adding or deleting interface routes.
This helps nexthop checking in the upcoming multipath changes.

Differential Revision:	https://reviews.freebsd.org/D26317
2020-09-07 10:13:54 +00:00
Li-Wen Hsu
eddaeb2095 Slightly improve usb(4)
- Mention USB 3.0
- Update links
- Fix `mandoc -T lint` warnings

Reviewed by:	bcr, hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26349
2020-09-07 07:44:14 +00:00
Andriy Gapon
1668d773a4 musb/allwinner: add support for configuring phy as well as device mode
At least on Orange Pi PC Plus even the host mode does not work without
enabling the phy and setting it to the host mode.

The driver will now parse dr_mode property and will try to configure
itself and the phy accordingly.
OTG mode is not supported yet, so it is treated as the device / peripheral
mode.

The phy is enabled -- powered on -- only for the host mode.

The device mode requires support from a phy driver, e.g., aw_usbphy on
Allwinner platform.
aw_usbphy does not support the device mode, so it cannnot work yet.

MFC after:	6 weeks
2020-09-07 06:53:29 +00:00
Andriy Gapon
f206695209 musb/allwinner: add H3 support
MFC after:	6 weeks
2020-09-07 06:49:07 +00:00
Andriy Gapon
d7abf6e73c musb/allwinner: apply register filter in awusbdrd_bs_r_2() as well
Otherwise, I get this panic:
panic: awusbdrd_reg: Invalid register 0x342

It looks that musb code both writes and reads at least MUSB2_REG_TXDBDIS.

MFC after:	5 weeks
X-MFC after:	r365399
2020-09-07 06:48:08 +00:00
Andriy Gapon
029e367dd1 fixup r365398: add a missed file with all the new Allwinner musb_otg code
Obtained from:	andrew
MFC after:	5 weeks
X-MFC with:	r365398
2020-09-07 06:44:24 +00:00
Andriy Gapon
d9a65ba85b Allwinner USB DRD support (musb_otg)
Allwinner USB DRD is based on the Mentor USB OTG controller, with a
different register layout and a few missing registers.

The code is by Andrew Turner (andrew).

Reviewed by:	hselasky, manu
Obtained from:	andrew
MFC after:	5 weeks
Differential Revision: https://reviews.freebsd.org/D5881
2020-09-07 06:39:00 +00:00
Andriy Gapon
6305020526 twsi: some variants clear interrupt flag by writing 0, others by writing 1
Make that distinction more explicit and regular in the code.
The difference in behavior is documented in the respective datasheets.

Previously, the code handled the distinction by writing the control
register multiple times where at least one write was zero and another
was one.

This can be considered a follow-up to r363021.

Reviewed by:	manu
MFC after:	4 weeks
Differential Revision: https://reviews.freebsd.org/D26308
2020-09-07 06:32:03 +00:00
Andriy Gapon
e21a4ccfd1 twsi: use tsleep instead of pause for better responsiveness
wakeup() does not have any effect on pause(), so if a transfer was
not finished by the time of the first check, then the thread
would sleep full 30 ms.

To do: protect the transfer and interrupt code with the mutex,
switch from tsleep from msleep

Reviewed by:	manu
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D26309
2020-09-07 06:29:41 +00:00
Andriy Gapon
c3a7328be8 aw_clk_nm: fix incorrect use of abs()
abs() takes a (signed) int as input.
Instead, it was used with unsigned 64-bit integers.

So, add and use a new helper function to calculate a difference between
two uint64_t-s.

Reviewed by:	manu
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D26307
2020-09-07 06:27:18 +00:00
Alan Somers
04bd07fd15 nsswitch.conf(5): recommend placing cache after files
When cache precedes files, and nscd is configured to allow negative caching,
commands like "pw groupadd" can fail. The sequence of events looks like:

1. A command like pkg(8) looks up the group, and finds it absent.
2. pkg invokes pw(8) to add the group
3. pkg queries the group, but nscd says it doesn't exist, since it has a
   negative cache entry for that group.

See also: https://lists.freebsd.org/pipermail/freebsd-current/2012-January/031595.html

Reviewed by:	bcr (manpages)
MFC after:	1 week
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D26184
2020-09-06 20:32:13 +00:00
Alan Somers
dbc973ca7a padlock(4): fix instapanics with geli authentication
cryptodev_process implementations are supposed to return 0

PR:		247986
Submitted by:	jhb
MFC after:	1 week
2020-09-06 19:25:31 +00:00
Mariusz Zaborski
35f8045f55 Remove duplicated line.
Reported by:	lwhsu
2020-09-06 15:44:09 +00:00
Mariusz Zaborski
cc432e237c traceroute6: capsicumize it
Submitted by:	Shubh Gupta <shubh@freebsd.org>
Sponsored by: Google (GSOC 2020)
Differential Revision:	https://reviews.freebsd.org/D25604
2020-09-06 14:04:02 +00:00
Dimitry Andric
86b019c29a Follow-up r365371 by removing sentences which indicate the state of the
MK_MALLOC_PRODUCTION option on -CURRENT.

Also, for the sake of backwards compatibility, support the old way of
enabling 'production malloc', e.g. by adding a define in make.conf(5).

MFC after:	1 week
X-MFC-With:	r365371
2020-09-06 09:08:06 +00:00
Dimitry Andric
7d4374f65f Turn MALLOC_PRODUCTION into a regular src.conf(5) option
For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
been used to turn off potentially expensive debug checks and statistics
gathering in the implementation of malloc(3).

It seems more consistent to turn this into a regular src.conf(5) option,
e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
be toggled similar to any other source build option, and turned on or
off by default for e.g. stable branches.

Reviewed by:	imp, #manpages
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D26337
2020-09-05 23:30:17 +00:00
Konstantin Belousov
12cb97fb37 Undo 'fix off by one' part of r365360.
Noted by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
2020-09-05 22:48:27 +00:00
Konstantin Belousov
500433057e rtld: do not refuse to relocate objects without dynamic symtabs.
Such objects can still have valid relocations not requiring symbolic
references.

PR:	249121
Reported by:	wsh@riski.sh
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-09-05 22:44:38 +00:00
Konstantin Belousov
2b49b95cfa rtld: do not process absent dynamic.
If object has no dynamic phdr, do not try to dereference NULL.  This
means that we cannot process any relocation, and that there cannot be
symbols defined, but it is up to static linker to produce meaningful
objects.

PR:	249121
Reported by:	wsh@riski.sh
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-09-05 22:41:31 +00:00
Mateusz Guzik
ea0a0939ef sx: fix up manpage after r363113
No date change as there is no new information.

Submitted by:	sigsys@gmail.com
Differential Revision: https://reviews.freebsd.org/D26341
2020-09-05 20:22:02 +00:00
Simon J. Gerraty
2c3632d14f Update to bmake-20200902
Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.

Other significant changes:

o new read-only variable .SHELL which provides the path of the shell
  used to run scripts (as defined by  the .SHELL target).

o variable parsing detects more errors.

o new debug option -dl: LINT mode, does the equivalent of := for all
  variable assignments so that file and line number are reported for
  variable parse errors.
2020-09-05 19:29:42 +00:00
Ed Maste
08d0b468f1 ci-qemu-test.sh: use pkgbase
Reviewed by:	bcran (earlier), manu (earlier), imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24276
2020-09-05 19:03:34 +00:00
Ed Maste
4fa9815a3d rtsock.c: remove extraneous space
Submitted by:	Neel Chauhan <neel AT neelc DOT org>
Differential Revision:	https://reviews.freebsd.org/D26249
2020-09-05 16:13:36 +00:00
Simon J. Gerraty
6bbc783f48 Import bmake-20200902
Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.

Other significant changes:

o new read-only variable .SHELL which provides the path of the shell
  used to run scripts (as defined by  the .SHELL target).

o new debug option -dl: LINT mode, does the equivalent of := for all
  variable assignments so that file and line number are reported for
  variable parse errors.
2020-09-05 16:11:04 +00:00
Konstantin Belousov
5d6d106cf6 rtld: Handle ELF dso with program headers outside the first page.
Reported by:	Alex Arslan <alex.arslan@julialang.org>
PR:	229708
Reviewed by:	dim (previous version), emaste
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26323
2020-09-05 10:16:24 +00:00
Warner Losh
84961358b4 Fix typo in comment.
Noticed by: bapt@
2020-09-05 04:20:29 +00:00
Rick Macklem
22f085c43b Fix a potential memory leak in the NFS over TLS handling code.
For the TLS case where there is a "user@domain" name specified in the
X.509 v3 certificate presented by the client in the otherName component
of subjectAltName, a gid list is allocated via mem_alloc().
This needs to be free'd. Otherwise xp_gidp == NULL and free() handles that.
(The size argument to mem_free() is not used by FreeBSD, so it can be 0.)

This leak would not have occurred for any other case than NFS over TLS
with the "user@domain" in the client's certificate.
2020-09-05 00:50:52 +00:00
Xin LI
90802d88a5 Declare dependency relationship once instead of twice for zpool
and zvol.
2020-09-05 00:45:46 +00:00
Chuck Silvers
a0a36d4886 vfs: avoid exposing partially constructed vnodes
If multiple threads race calling vfs_hash_insert() while creating vnodes
with the same identity, all of the vnodes which lose the race must be
destroyed before any other thread can see them. Previously this was
accomplished by the vput() in vfs_hash_insert() resulting in the vnode's
VOP_INACTIVE() method calling vgone() before the vnode lock was unlocked,
but at some point changes to the the vnode refcount/inactive logic have caused
that to no longer work, leading to crashes, so instead vfs_hash_insert()
must call vgone() itself before calling vput() on vnodes which lose the race.

Reviewed by:	mjg, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26291
2020-09-05 00:26:03 +00:00
Bjoern A. Zeeb
67d224ef43 bbr: remove unused static function
bbr_log_type_hrdwtso() is a file local static unused function.
Remove it to avoid warnings on kernel compiles.

Reviewed by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D26331
2020-09-05 00:20:32 +00:00
Bjoern A. Zeeb
d29a3de296 uipc_ktls: remove unused static function
m_segments() was added with r363464 but never used. Remove it to
avoid warnings when compiling kernels.

Reported by:	rmacklem (also says jhb)
Reviewed by:	gallatin, jhb
Differential Revision:	https://reviews.freebsd.org/D26330
2020-09-05 00:19:40 +00:00
Xin LI
0cd669785d Make zpool on GELI work again.
After OpenZFS import, zpool auto import behavior was moved to an
explicit "zpool import -a", and the zpool rc.d script was added
as a prerequisite of zvol.

However, in r299839, zvol was added as a prerequisite of dumpon,
making it to start very early and before all 'disks' providers.
At this time, dumping on a zvol is not supported, so remove this
requirement and make zpool depend on disks to allow zpool on
full disk encryption work.

Reviewed by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D26333
2020-09-04 23:36:43 +00:00
Matt Macy
eac7052fde ZFS: MFV 2.0-rc1-gfd20a8
- fixes jail delegation
- fixes raw kstat unsupported complaints
- exposes dbgmsg, dbuf, and checksum benchmark stats
- restore rename -u support
2020-09-04 22:25:14 +00:00
Matt Macy
b0a96e5e2d make spa_stats.c common 2020-09-04 22:11:58 +00:00
Matt Macy
adfd5c1bd9 Another missed move 2020-09-04 21:55:35 +00:00
Brooks Davis
46b974a9db Round TF_SIZE up to the stack alignment (16-bytes).
The kernel adjusts the stack by TF_SIZE and the RISC-V ABI requires
that it remain 16-byte aligned.

Reported by:	CHERI, jrtc27
Reviewed by:	mhorne
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26328
2020-09-04 21:55:22 +00:00
Matt Macy
69174caaa1 Add missed move 2020-09-04 21:48:36 +00:00
Brooks Davis
29e1fceb73 Maintain a stack alignment of 16-bytes.
This violated the RISC-V 64-bit ABI.  On CheriBSD this manifested as
a trap when attempting to store 16-byte aligned types while zeroing
the stack.

Reported by:	CHERI, jrtc27
Reviewed by:	mhorne, br
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26327
2020-09-04 21:46:10 +00:00
Matt Macy
431004027d Update vendor openzfs to fd20a8 2020-09-04 21:31:58 +00:00
Mateusz Guzik
c86d2ba8a5 tmpfs: drop spurious cache_purge in tmpfs_reclaim
vgone already performs it.
2020-09-04 19:30:15 +00:00
Li-Wen Hsu
8e6b8fc655 Initialize len to avoid ENOMEM from sysctl(3).
PR:		248933
Sponsored by:	The FreeBSD Foundation
2020-09-04 19:24:27 +00:00
Mark Johnston
b6c3b1a92d Stop setting DEBUG_FLAGS in the zfs.ko Makefile.
Rely on system settings to decide whether or not to build with debug
symbols and extract them to a separate file.

Reported and tested by:	rm
2020-09-04 18:55:03 +00:00
Bjoern A. Zeeb
a16e001bd9 umass: enhance debugging
Investigating a hang I found having some more error information
available would be helpful, so be more verbose and also tell cam/xpt
status in case of error/panic.

Reviewed by:	hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26287
2020-09-04 18:29:59 +00:00
Bjoern A. Zeeb
ed75ef34d4 umass: fix a cam_sim leak in error case
While debugging a hang I noticed that in case of error in
umass_cam_attach_sim() we miss a cam_sim_free() call.
Added that to not leak resources.

Reviewed by:	hselasky
MFC after:	3 days
Differential Revision:	D26287
2020-09-04 18:26:35 +00:00
Bjoern A. Zeeb
7a7ca53f69 cam_sim: harmonize code related to acquiring a mtx
cam_sim_free(), cam_sim_release(), and cam_sim_hold() all assign
a mtx variable during declaration and then if NULL or the mtx is
held may re-asign the variable and/or acquire/release a lock.

Harmonize the code, avoiding double assignments and make it look
the same for all three function (with cam_sim_free() not needing
an extra case).

No functional changes intended.

Reviewed by:	imp; no-objections by: mav
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26286
2020-09-04 18:18:05 +00:00
Eric Joyner
1bd641af2b ice_ddp: Update package file to 1.3.16.0
This package is intended to be used with ice(4) version 0.26.16. That
update will happen in a forthcoming commit.

MFC after:	3 days
Sponsored by:	Intel Corporation
2020-09-04 17:37:58 +00:00
Andrew Gallatin
9675d8895a ktls: Check for a NULL send tag in ktls_cleanup()
When using ifnet ktls, and when ktls_reset_send_tag()
fails to allocate a replacement tag, it leaves
the tls session's snd_tag pointer NULL. ktls_cleanup()
tries to release the send tag, and will trip over
this NULL pointer and panic unless NULL is checked for.

Reviewed by:	jhb
Sponsored by:	Netflix
2020-09-04 17:36:15 +00:00
Gordon Bergling
cb55665190 fortune(6): Grammar fix for a hint on searching ports
PR:		249078
Submitted by:	PauAmma <pauamma at gundo dot com>
Reported by:	PauAmma <pauamma at gundo dot com>
MFC after:	3 days
2020-09-04 13:05:00 +00:00
Konstantin Belousov
6eeccaa91b Fix kern_copyin test.
Main part is that kern_copyin on amd64 after LA57 should query the top
of UVA for correct operations. In fact it should started doing that
after the workaround for AMD bug with IRET in the last user page was
fixed by reducing UVA by a page.

Also since we started calculating top of UVA, fix MIPS according to
the comment.

Reported by:	lwhsu
PR:	248933
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26312
2020-09-04 12:52:16 +00:00