Commit Graph

251850 Commits

Author SHA1 Message Date
Andrew Turner
31e34625ca Handle Raspberry Pi 4 xhci firmware loading.
The newer hardware revisions of the Raspberry Pi 4 removed the ability of
the VIA VL805 xhci controller to load its own firmware. Instead the
firmware must be installed at the appropriate time by the VideoCore
coprocessor.

Submitted by:	Robert Crowston <crowston_protonmail.com>
Differential Revision:	https://reviews.freebsd.org/D25261
2020-08-03 10:19:50 +00:00
Jason A. Harmening
4fdb1b227c vt(4): CONS_HISTORY/CONS_CLRHIST should operate on issuing terminal
Currently the CONS_HISTORY and CONS_CLRHIST ioctls modify the state of the
active terminal instead of the terminal against which the ioctl was issued.
Because of the way vidcontrol(1) works, these are the same in most cases.
But a poorly-timed window switch can make them differ. This is reproducible
by issuing e.g. 'vidcontrol -s 2 && vidcontrol -C' to switch from vty 1 to
vty 2; teken will reset the cursor position on vty 1 but vt(4) will clear
the history buffer of vty 2, producing an interesting state of affairs.

Differential Revision:	https://reviews.freebsd.org/D25564
2020-08-02 20:18:37 +00:00
Mateusz Guzik
9fce5c4b3c Bump __FreeBSD_version after vnode layout changes 2020-08-02 20:03:23 +00:00
Mateusz Guzik
7ad2f1105e vfs: store precomputed namecache hash in the vnode
This significantly speeds up path lookup, Cascade Lake doing access(2) on ufs
on /usr/obj/usr/src/amd64.amd64/sys/GENERIC/vnode_if.c, ops/s:
before: 2535298
after: 2797621

Over +10%.

The reversed order of computation here does not seem to matter for hash
distribution.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D25921
2020-08-02 20:02:06 +00:00
Mateusz Guzik
b145e38934 vfs: shorten v_iflag and v_vflag
While here renumber VI_* flags to remove the gaps.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D25921
2020-08-02 20:00:43 +00:00
Mateusz Guzik
838984de32 vfs: move namecache initialisation into cache_vnode_init 2020-08-02 19:42:06 +00:00
Mateusz Piotrowski
c7b00f0071 core(5) appeared in Version 1 AT&T UNIX
Based on the scans of manual pages available at
https://www.bell-labs.com/usr/dmr/www/man51.pdf,
which are a part of the following collection:
https://www.bell-labs.com/usr/dmr/www/1stEdman.html.

Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D25849
2020-08-02 16:59:14 +00:00
Mateusz Piotrowski
ea27bce336 Document automatic handling of font height for BDF files
PR:		248395
Submitted by:	Dmitry Wagin <dmitry.wagin@ya.ru>
Reviewed by:	bcr, emaste, tsoome
Differential Revision:	https://reviews.freebsd.org/D25907
2020-08-02 16:41:36 +00:00
Conrad Meyer
9da903e5d3 Unlocked getblk: Fix new false-positive assertion
A free buf's lock may be held (temporarily) due to unlocked lookup, so
buf_alloc() must acquire it without LK_NOWAIT.  The unlocked getblk path
should unlock it promptly once it realizes the identity does not match
the buffer it was searching for.

Reported by:	gallatin
Reviewed by:	kib
Tested by:	pho
X-MFC-With:	r363482
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D25914
2020-08-02 16:34:27 +00:00
Mateusz Guzik
936c24faba cred: add more asserts for td_realucred == td_ucred 2020-08-01 16:02:32 +00:00
Marcin Wojtas
acdc915461 Fix TX csum handling in if_mvneta
The mvneta device requires MVNETA_TX_CMD_L4_CHECKSUM_NONE bit to be set in the tx descriptor is checksum not required. However, mvneta_tx_set_csumflag() is not setting this flag currently, causing the hardware to randomly corrupt IP header during transmission.

This affects injected IPv4 packets that skips kernel IP stack processing (e.g. DHCP), as well as all IPv6 packets, since the driver currently does not offload csum for IPv6.

The fix is to remove all the early return paths from mvneta_tx_set_csumflag() which do not set the MVNETA_TX_CMD_L4_CHECKSUM_NONE flag.

PR: 248306
Submitted by: Mike Cui <cuicui@gmail.com>
Reported by: Mike Cui <cuicui@gmail.com>
2020-08-01 09:40:19 +00:00
Michal Meloun
208fb7e5cf Add missing dependency for cpsw module.
Reported by:	mjg
MFC with:	r363700
2020-08-01 09:06:16 +00:00
Mateusz Guzik
d53c862742 Bump __FreeBSD_version after making rights mandatory for NDINIT_ALL 2020-08-01 06:37:26 +00:00
Mateusz Guzik
8a7ec17095 cache: reshuffle struct cache_fpl and nameidata_saved
Shaves 16 bytes.
2020-08-01 06:35:18 +00:00
Mateusz Guzik
5a3944334c cache: mark climb_mount as __noinline 2020-08-01 06:34:18 +00:00
Mateusz Guzik
85cf316172 vfs: inline NDINIT_ALL
The routine takes more than 6 arguments, which on amd64 means some of
them have to be passed through the stack.
2020-08-01 06:33:38 +00:00
Mateusz Guzik
14576629bb vfs: convert ni_rigthsneeded to a pointer
Shaves 8 bytes of struct nameidata on 64-bit platforms.
2020-08-01 06:33:11 +00:00
Mateusz Guzik
21c162605b vfs: make rights mandatory for NDINIT_ALL 2020-08-01 06:32:25 +00:00
Mateusz Guzik
fe4f491461 capsicum: move global caps to caprights.h
.. for easier inclusion
2020-08-01 06:31:58 +00:00
Gregory Neil Shapiro
c5112a4e2d Mirror recommendation from Handbook to avoid linking conflicts when
pulling in SASL libraries.

PR:		247959
Reported by:	Scott Allendorf
MFC after:	3 days
2020-08-01 04:57:30 +00:00
Rick Macklem
cb889ce631 Add optional support for ext_pgs mbufs to the NFS server's read, readlink
and getxattr operations.

This patch optionally enables generation of read, readlink and getxattr replies
in ext_pgs mbufs.  Since neither of ND_EXTPG or ND_TLS are currently ever set,
there is no change in semantics at this time.
It also corrects the message in a couple of panic()s that should never occur.

This is another in the series of commits that add support to the NFS client
and server for building RPC messages in ext_pgs mbufs with anonymous pages.
This is useful so that the entire mbuf list does not need to be
copied before calling sosend() when NFS over TLS is enabled.

Use of ext_pgs mbufs will not be enabled until the kernel RPC is updated
to handle TLS.
2020-07-31 23:35:49 +00:00
Ruslan Bukin
0eed04c802 Add iommu_domain_map_ops virtual table with map/unmap methods
so x86 can support Intel DMAR and AMD IOMMU simultaneously.

Reviewed by:	kib
Sponsored by:	DARPA/AFRL
Differential Revision:	https://reviews.freebsd.org/D25894
2020-07-31 23:02:17 +00:00
Stephen J. Kiernan
fafe230db0 Fix compilation error for install.c in loader
Fix typo in interp_include() invocation (missing 'p')
Remove setting tftpip, as servip is used by the tftp code in libsa. There
is no separate tftpip global variable any more.

Obtained from:	Juniper Networks, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25897
2020-07-31 16:08:25 +00:00
Mateusz Piotrowski
0b87619ffe Point to rc(8) for more details about the autoboot variable
Reviewed by:	bcr, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25904
2020-07-31 14:13:26 +00:00
Mark Johnston
370b7cc904 ng_iface(4): Remove unsupported protocols.
Update the ng_iface documentation and hooks to reflect the fact that the
node currently only supports IPv4 and v6 packets.

Reviewed by:	Lutz Donnerhacke
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25862
2020-07-31 14:08:54 +00:00
Mark Johnston
460a9f9d45 ng_iface(4): Set the current VNET before calling netisr_dispatch().
This is normally handled by a netgraph thread, but netgraph messages may
be dispatched directly to a node, in which case no VNET is set before
ng_iface calls into the network stack.  Netgraph could probably handle
this more generally, but for now just be sure to set the current VNET in
ng_iface.

PR:		242406
Tested by:	Michael Muenz <m.muenz@gmail.com>
Reviewed by:	Lutz Donnerhacke
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25788
2020-07-31 14:08:32 +00:00
Kyle Evans
7c5ec5fe6a <regex.h>: reserve a regcomp field for REG_POSIX
For libc regcomp, this will be a nop. libregex will take this to mean that
it needs to turn off GNU extensions, effectively switching it back to the
POSIX-compliant libc implementation at runtime.
2020-07-31 12:40:31 +00:00
Peter Grehan
f1c3dac414 Replace magic numbers in Identify page register 0 with ATA definitions.
No functional change. Verified with objdump output before/after.

Requested by:	rpokala
Reviewed by:	rpokala
MFC after:	3 weeks
2020-07-31 12:10:28 +00:00
Alex Richardson
74d677ebfd Include virtio support in std.MALTA
The MALTA kernel config is generally used for QEMU and having support
for VirtIO there by default is quite useful.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D25217
2020-07-31 11:28:09 +00:00
Randall Stewart
8315f1ea26 The recent changes to move the ref count increment
back from the end of the function created an issue.
If one of the routines returns NULL during setup
we have inp's with extra references (which is why
the increment was at the end).

Also the stack switch return code was being ignored
and actually has meaning if the stack cannot take over
it should return NULL.

Fix both of these situation by being sure to test the
return code and of course in any case of return NULL (there
are 3) make sure we properly reduce the ref count.

Sponsored by:	Netflix Inc.
Differential Revision:	https://reviews.freebsd.org/D25903
2020-07-31 10:03:32 +00:00
Kyle Evans
d6391a26d6 UPDATING: Add a note about running installworld twice
Some folks seem to be hitting issues with build orchestration; presumably
some of our .WAIT-removal optimizations are going awry, and they're ending
up with applications linked against new libc being installed before the new
libc.

Letting installworld complete the first time should ensure that the new libc
is installed by the end of it, then the second installworld will ensure
consistency as everything should succeed.
2020-07-31 02:21:19 +00:00
Conrad Meyer
d6a75d39e9 getblk: Remove a non-sensical LK_NOWAIT | LK_SLEEPFAIL
No functional change.

LK_SLEEPFAIL implies a behavior that is only possible if the lock operation can
sleep.  LK_NOWAIT prevents the lock operation from sleeping.

Discussed with:	kib
2020-07-31 00:13:40 +00:00
Conrad Meyer
59d13f6154 getblk: Avoid sleeping on wrong buf in lockless path
If the buffer identity changed during lookup, sleeping could introduce a
lock order reversal.  Since we do not know if the identity changed until we
get the lock, we must try-lock (LK_NOWAIT) only.  EINTR and ERESTART error
handling becomes irrelevant, as we no longer sleep.

Reported by:	kib
Reviewed by:	kib
X-MFC-With:	r363482
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D25898
2020-07-31 00:07:01 +00:00
Conrad Meyer
9119bafbaf Import PCG-C into sys/contrib
The intended (future) use is to provide fast pseudo-random numbers in non-
cryptographic applications.
2020-07-30 23:54:25 +00:00
Peter Grehan
872f4e99f4 Definition for the 'removable media flag' from word 0 in the Identify page.
This will be used to remove a magic number in the bhyve AHCI emulation.

Reported by:	rpokala
Reviewed by:	imp, rpokala
Approved by:	imp, rpokala
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D25893
2020-07-30 23:49:49 +00:00
Conrad Meyer
8ae93acf47 Import PCG-C master, 2019-07-18 (83252d9c23df9c82ecb42210afed61a7b42402d7) 2020-07-30 23:17:30 +00:00
Mateusz Guzik
5b0acaf75f Fix tinderbox build after r363714 2020-07-30 22:56:57 +00:00
Mateusz Guzik
cb90ef2875 cache: drop the useless numchecks counter 2020-07-30 22:52:18 +00:00
Mateusz Guzik
952759111e Further depessimize priv_check_cred_vfs_generation 2020-07-30 22:14:04 +00:00
Mateusz Guzik
551cf5ab71 fd: predict in fdrop 2020-07-30 22:13:15 +00:00
Mark Johnston
19afc65a7e ip6_output(): Check the return value of in6_getlinkifnet().
If the destination address has an embedded scope ID, make sure that it
corresponds to a valid ifnet before proceeding.  Otherwise a sendto()
with a bogus link-local address can trigger a NULL pointer dereference.

Reported by:	syzkaller
Reviewed by:	ae
Fixes:		r358572
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25887
2020-07-30 17:43:23 +00:00
Mateusz Guzik
848f8effdd vfs: inline vops if there are no pre/post associated calls
This removes a level of indirection from frequently used methods, most notably
VOP_LOCK1 and VOP_UNLOCK1.

Tested by:	pho
2020-07-30 15:50:51 +00:00
Mateusz Guzik
2e4f8220e8 vfs: fold poll_no_poll into vop_nopoll
The logic was almost completely present in vop_stdpoll anyway.
2020-07-30 15:48:56 +00:00
Mateusz Guzik
b1f910e02c vfs: short-circuit the common case NDFREE calls
Almost all consumers use the NDF_ONLY_PNBUF macro, making them avoidably branch
a lot in the NDFREE routine. Also note most of them should not need to call
any cleanup anyway as they don't request HASBUF.
2020-07-30 15:47:41 +00:00
Mateusz Guzik
404927357d vfs: add support for WANTPARENT and LOCKPARENT to lockless lookup
This makes the realpath syscall operational with the new lookup. Note that the
walk to obtain the full path name still takes locks.

Tested by:      pho
Differential Revision:	https://reviews.freebsd.org/D23917
2020-07-30 15:45:11 +00:00
Mateusz Guzik
8230d29357 vfs: support negative entry promotion in lockless lookup
Tested by:	pho
2020-07-30 15:44:10 +00:00
Mateusz Guzik
4057e3eaaa vfs: add NOMACCHECK and AUDITVNODE2 to lockless lookup
They are both nops since lookup does not progress with either mac or audit enabled.

Tested by:	pho
2020-07-30 15:43:16 +00:00
Michal Meloun
0050ea2415 Move Ti AM335x to dev/extres/clk framework.
Re-implement clocks for these SoC by using now standard extres/clk framework.
This is necessary for future expansion of these. The new  implementation
is (due to the size of the patch) only the initial (minimum) version.
It will be updated/expanded with a subsequent set of particular patches.

This patch is also not tested on OMAP4 based boards (BeagleBone),
so all possible issues should be (and will be) fixed by ASAP once
identified.

Submited by:		Oskar Holmlund (oskar.holmlund@ohdata.se)
Differential Revision:  https://reviews.freebsd.org/D25118
2020-07-30 14:45:05 +00:00
Kyle Evans
98369a6980 sed: fix hex_subst test after after r363679
r363679 is in-fact the future change referenced by the comment, helpfully
left and forgotten by kevans. Instead of just silently not matching, we
should now be erroring out with vigor.
2020-07-30 13:36:24 +00:00
Kyle Evans
ac05de1788 diff: fix side_by_side after r363679
It's currently unclear to me how this could have worked previously; \n here
is not a literal newline but actual '\' 'n', and was getting passed to the
underlying regex engine as such. regex(3) does not translate this to a
newline, and this became an error because we don't really allow escaping
of arbitrary ordinary characters anymore.

Run the pattern strings through printf to make sure we're dealing with real
newlines before passing them through to atf_check, which ultimately feeds
them directly to regcomp(3).

This fix is different than that will be needed for sed, in that this is the
proper way to inject newlines into search strings as long as regex(3)
won't combine \ + n as folks might expect.

Reported by:	Jenkins via lwhsu
MFC after:	1 week
2020-07-30 13:33:45 +00:00