Commit Graph

274805 Commits

Author SHA1 Message Date
Alfredo Dal'Ava Junior
f9ee415674 build target triple variable from sys/conf/newvers.sh
Retrieve FreeBSD revision number directly from sys/conf/newvers.sh
when building the compiler target triple value, avoiding manual
intervention on other files every new release.

Reviewed by:	imp
MFC after:	2 months
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D34429
2022-05-03 08:09:38 -03:00
Andrew Turner
c7904405a8 Remove PAGE_SIZE from libthr
In libthr we use PAGE_SIZE when allocating memory with mmap and to check
various structs will fit into a single page so we can use this allocator
for them.

Ask the kernel for the page size on init for use by the page allcator
and add a new machine dependent macro to hold the smallest page size
the architecture supports to check the structure is small enough.

This allows us to use the same libthr on arm64 with either 4k or 16k
pages.

Reviewed by:	kib, markj, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34984
2022-05-03 11:04:41 +01:00
Andrew Turner
86c500937c Use the existing page size in libthr
Rather than calling getpagesize() twice use the value saved after the
first call to size a mmap allocation.

Reviewed by:	kib, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34983
2022-05-03 11:04:06 +01:00
Rick Macklem
271f6d52a6 nfsd: Fix session slot freeing for NFSv4.1/4.2
Without this patch the NFSv4.1/4.2 server erroneously
always frees session slot zero for callbacks.  This only
affects 4.1/4.2 mounts if the server has delegations
enabled or is a pNFS configuration.  Even for those
cases, the effect is mainly to only use slot 0 for
callbacks, serializing all of them.  There is a slight
chance that callbacks will fail if the client performs
them in a different order than received on the TCP
connection.

If this bug affects your server, you will see console
messages like:
  newnfs_request: Bad session slot

This patch fixes the problem.  Found during a recent
IETF NFSv4 testing event.

PR:	263728
MFC after:	2 weeks
2022-05-02 12:47:43 -07:00
Ed Maste
729ee78911 Remove stray .Pp from WITH_LOADER_EFI_SECUREBOOT description
MFC after:	3 days
Fixes:		13ea0450a9 ("Extend libsecureboot(old libve) to...")
Sponsored by:	The FreeBSD Foundation
2022-05-02 15:43:36 -04:00
Ed Maste
6cd1bc5316 freebsd-update: restart sshd after upgrade
Sometimes the parent-child sshd protocol changes during an upgrade, and
when this happens sshd will not accept new connections until it is
restarted.

PR:		263489
Reviewed by:	kevans, gjb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35109
2022-05-02 14:38:19 -04:00
Ed Maste
b7f53cdcf8 Update UNIFIED_OBJDIR descriptions
src.conf(5) previously stated they would be removed before FreeBSD 12.0,
but that did not happen.  Change it to "a future version of FreeBSD."

Also pick up LOADER_KBOOT change (enabled on x86) in src.conf regen.

Reported by:	jhb
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-05-02 14:02:31 -04:00
Warner Losh
6f78dae849 cam: Remove redunant static __inline forward decls
Sponsored by:		Netflix
2022-05-02 09:30:07 -06:00
Tom Jones
c1c381eb7f diff3: Remove test case that references non existent test files
Sponsored by:	Klara, Inc.
2022-05-02 16:00:44 +01:00
Eugene Grosbein
28903f396a ng_pppoe: introduce new sysctl net.graph.pppoe.lcp_pcp
This fixes incomplete commit 2e547442ab

New sysctl allows to mark transmitted PPPoE LCP Control
ethernet frames with needed 3-bit Priority Code Point (PCP) value.
Confirming driver like if_vlan(4) uses the value to fill
IEEE 802.1p class of service field.

This is similar to Cisco IOS "control-packets vlan cos priority"
command.

It helps to avoid premature disconnection of user sessions
due to control frame drops (LCP Echo etc.)
if network infrastructure has a botteleck at a switch
or the xdsl DSLAM.

See also:
https://sourceforge.net/p/mpd/discussion/44692/thread/c7abe70e3a/

Tested by:      Klaus Fokuhl at SourceForge
MFC after:      2 weeks
2022-05-02 21:57:12 +07:00
Hans Petter Selasky
6244b53e16 ibcore: Allow passing NULL-pointers to ib_umem_release()
FreeBSD commit b633e08c70 removed the
NULL-checks from the mlx4ib-driver.

This fixes the following NULL-pointer panic when unloading mlx4ib:
ib_umem_release()
mlx4_ib_destroy_qp()
ib_destroy_qp_user()
ipoib_transport_dev_cleanup()
ipoib_dev_cleanup()
ipoib_remove_one()
ib_unregister_client()
ipoib_cleanup_module()
linker_file_sysuninit()
linker_file_unload()
kern_kldunload()
amd64_syscall()

Linux commit:
836a0fbb3e76f704ad65ddfb57f00725245e509b

MFC after:	1 week
Submitted by:	dandan@lysator.liu.se
Sponsored by:	Lysator ACS
Sponsored by:	NVIDIA Networking
2022-05-02 13:11:06 +02:00
Warner Losh
1599fc904d iosched: Move bio_next() inside of the CAM_IOSCHED_DYNAMIC ifdef
bio_next() is only used by the dynamic scheduler, so move it under that
ifdef.

Sponsored by:		Netflix
2022-05-01 16:54:15 -06:00
Rick Macklem
47d75c29f5 nfsd: Add a sanity check to SecinfoNoname for file type
Robert Morris reported that, for the case of SecinfoNoname
with the Parent option, providing a non-directory could
cause a crash.

This patch adds a sanity check for v_type == VDIR for
this case, to avoid the crash.

Reported by:	rtm@lcs.mit.edu
PR:	260300
MFC after:	2 weeks
2022-05-01 13:41:31 -07:00
Warner Losh
d095d6a34c cam_xpt: Prefer bool to int where it's a boolean
In the places where we set an integer to 0 or 1 and then use it like a
boolean, replace int with bool and 0/1 with false/true. Left alone
places where this is a function argument or return value. No functional
changes intended.

Sponsored by:		Netflix
2022-05-01 12:09:42 -06:00
Warner Losh
d592c0db8b cam: add hw.cam.iosched.read_bias
Allow a global setting for the read_bias for the dynamic io
scheduler. This allows global policy to be set, in addition to the
existing per-drive policy. kern.cam.iosched.read_bias is a new tunable.

Sponsored by:		Netflix
Reviewed by:		chs
Differential Revision:	https://reviews.freebsd.org/D34365
2022-05-01 11:27:34 -06:00
Warner Losh
b65803ba57 cam iosched: default to no read bias in dynamic ioscheduling
When we're doing dynamic I/O scheduling, don't default to a read bias of
100. Default it to 0 so turning on dynamic scheduling only does
scheduling tweaks that are requested. The other limiters are off by
default, and need no further adjustment.

Sponsored by:		Netflix
2022-05-01 11:27:34 -06:00
Warner Losh
cc1572ddeb cam iosched: Remove write bias when read bias = 0
Change the meaning of read bias == 0 in the dynamic I/O scheduler. Prior
to this change, a read bias of 0 would mean prefer writes.  Now, when
read bias is 0, we queue all requests to the same queue removing the
bias. When it's non-zero, we still separate the queues we use so we can
bias reads vs writes for workloads that are read centric. These changes
restore the typical bias you get from disksort or ordered insertion at
the end of the list.

Sponsored by:		Netflix
2022-05-01 11:27:34 -06:00
Warner Losh
7df08a14e3 stand: Initial kboot support on amd64
Get amd64 compiling. However, the current kboot supports an old way of
enumerating memory and the new way needs to be incorporated as well. The
powerpc folks could use either, it seems and newer powerpc platforms
need some changes for kboot to work anyway.

This commit includes the linker script, trampoline code to start the new
kernel, Linux system calls and the necessary configuration glue needed
to build the binaries.

This includes a quick hack to get multiboot support, but we need to
really share these defines. The multiiboot2.h is the minimum needed to
build. We have multiboot information in three places now, so a
refactoring is in order.

This should be considered, at best, preliminary and experimental for
anybody wishing to try it out.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D35100
2022-05-01 11:13:39 -06:00
Warner Losh
6c8ab086fe ada: Retry commands with retries left on CAM_SEL_TIMEOUT
The AHCI and ATA SIMs will return CAM_SEL_TIMEOUT when an underlying
device has stopped responding. This is usually seen after a timeouted
out command and can be a transient event. Rather than fail the
peripheral immediately after seeing this, queue a retry. For transient
events, this allows drives to continue to provide data, though with some
added latency, just like we do when we have some other kind of retriable
error. If the error isn't transient (the drive is truly gone), then
we'll discover that eventually and fail the transaction and invalidate
the drive like we do today.

This helps us avoid a panic at the end of camperiphfree when
CAM_PERIPH_NEW_DEV_FOUND is set. However, the deferred callback should
be queued to xpt_async_td instead of being made inline there. This issue
will be solved in a different patch that does that. PR 263703.

This also helps us avoid another bug where we can drop all references to
the device (causing us to go through camperiphfree and destroy the path)
while we have an I/O pending in the ata_da state machine (usually in
state ADA_STATE_RAHEAD with ATA_SETFEATURES ATA_SF_ENAB_RCACHE
command). It's not clear why the reference that we take out to do the
reprobe isn't effective at blocking this. By retrying this condition,
though we avoid this bug (at least more often, I don't have a good
reproduction test case, I just see this panic a few times a month at
work on systems that have transient disk errors on ahci connected SATA
SSDs). PR 263704. It's too soon to know how much this helps us avoid
this bug.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D34977
2022-05-01 11:08:56 -06:00
Eugene Grosbein
2e547442ab ng_pppoe: introduce new sysctl net.graph.pppoe.lcp_pcp
New sysctl allows to mark transmitted PPPoE LCP Control
ethernet frames with needed 3-bit Priority Code Point (PCP) value.
Confirming driver like if_vlan(4) uses the value to fill
IEEE 802.1p class of service field.

This is similar to Cisco IOS "control-packets vlan cos priority"
command.

It helps to avoid premature disconnection of user sessions
due to control frame drops (LCP Echo etc.)
if network infrastructure has a botteleck at a switch
or the xdsl DSLAM.

See also:
https://sourceforge.net/p/mpd/discussion/44692/thread/c7abe70e3a/

Tested by:	Klaus Fokuhl at SourceForge
MFC after:	2 weeks
2022-05-01 23:34:08 +07:00
Xin LI
f44280bf5f libz: update the upgrade instructions to reflect reality 2022-04-30 16:57:54 -07:00
Rick Macklem
5218d82c81 nfscl: Add support for a NFSv4 AppendWrite RPC
For IO_APPEND VOP_WRITE()s, the code first does a
Getattr RPC to acquire the file's size, before it
can do the Write RPC.

Although NFS does not have an append write operation,
an NFSv4 compound can use a Verify operation to check
that the client's notion of the file's size is
correct, followed by the Write operation.

This patch modifies the NFSv4 client to use an Appendwrite
RPC, which does a Verify to check the file's size before
doing the Write.  This avoids the need for a Getattr RPC
to preceed this RPC and reduces the RPC count by half for
IO_APPEND writes, so long as the client knows the file's
size.

The nfsd structure was moved from the stack to be malloc()'d,
since the kernel stack limit was being exceeded.

While here, fix the types of a few variables, although
there should not be any semantics change caused by these
type changes.
2022-04-30 13:49:23 -07:00
Ed Maste
13cf431304 src.conf.5: regen after f768ecf247 2022-04-30 15:42:49 -04:00
Ed Maste
60b08330a5 Correct markup in WITH_/WITHOUT_UNIFIED_OBJDIR descriptions
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-04-30 15:40:49 -04:00
Ed Maste
f768ecf247 Update WITH_PROFILE description as it is yet removed
GCC still wants to link against (for example) libc_p.a when -pg is in
use, and it's unclear when and how this will be addressed.  Change the
WITH_PROFILE option description to claim that it may be removed from an
unspecified future version of FreeBSD, rather than FreeBSD 14.

Reported by:	Steve Kargl
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-30 15:35:01 -04:00
Warner Losh
70b5c4ff48 stand: Install libsa.3
Turns out there is a libsa.3. It's a bit out of date, but we reference
it in a number of places so we should install it. We need to do the DO32
dance because this Makefile is included twice and we don't want it
installing twice.

Sponsored by:		Netflix
2022-04-30 12:52:19 -06:00
Enji Cooper
f9f42a709b sbin/devfs: Correct usage
The -s applies to rule keyword only and it follows the rule keyword.

MFC after:	1 week
PR: [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id= 263289|263289]]
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
Fixes: c3e412c083 sbin/devfs: clarify usage
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D34934
2022-04-30 11:00:11 -07:00
Alfonso S. Siciliano
1ad9134e11
bsdinstall netconfig_ipv4: Fix resolv.conf rebuild
After an installation restart (for error or choice) dhclient does not
rebuild resolv.conf so `dialog --mixedform' of "Resolver Configuration"
in bsdinstall/scripts/netconfig draws empty forms. It causes a bad UX,
to see PR262262. Fixed resetting the interface before to run dhclient.

PR:			262262
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35094
2022-04-30 17:34:53 +02:00
Warner Losh
11f49259c8 stand: Change libstand.3 to libsa.3
Changes instances of the non-existant libstand.3 to the more correct,
but also non-existant libsa.3.

Sponsored by:		Netflix
2022-04-30 08:07:52 -06:00
Warner Losh
bd001d86d6 stand: s/libstand/libsa/g to catch up with rename
We renamed libstand to libsa years ago with the move from sys/boot to
stand. Catch up in the comments.

Sponsored by:		Netflix
2022-04-30 07:34:19 -06:00
Hans Petter Selasky
6eb6aeef7e uath(4): Fix incorrect byte-swapping and a buffer length check.
PR:			263638
Reported by:		Jeff Gibbons <jgibbons@protogate.com>
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-04-30 11:23:07 +02:00
Bjoern A. Zeeb
00614c9c2d LinuxKPI: 802.11: fill in two more TODOs
Implement ieee80211_is_data_present() and a subset of
ieee80211_is_bufferable_mmpdu() which hopefully is good enough in
the compat code for now.
This is partly in preparation for some TXQ changes coming up soon.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-04-30 08:00:04 +00:00
Bjoern A. Zeeb
3540911bfd LinuxKPI: 802.11: use ieee80211_beacon_miss()
In ieee80211_beacon_loss() call into net80211::ieee80211_beacon_miss()
rather than manually bouncing our state.  That should give us the
ability to send a probereq and see if the AP is till there rather than
right away going to scan.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-04-30 07:57:34 +00:00
Alfonso S. Siciliano
9b4c606b96
bsdinstall/partedit: Fix UFS auto partitioning
Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
The problem is a string comparison failure, it arose during the
dialog(3)/bsddialog(3) form conversion:

 * dialog uses only form.text while bsdialog differentiates between
   form.init and form.value.
 * dialog always allocates memory for form values while bsddialog only
   when a button is pressed.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35033
2022-04-30 01:24:23 +02:00
Alan Somers
2f6362484c fusefs: use the fsname mount option if set
The daemon can specify fsname=XXX in its mount options.  If so, the file
system should report f_mntfromname as XXX during statfs.  This will show
up in the output of commands like mount and df.

Submitted by:	Ali Abdallah <ali.abdallah@suse.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35090
2022-04-29 11:10:03 -06:00
Alan Somers
616eaa66aa fusefs: add a test for the subtype= option
At mount time server can set, for example, "subtype=xfs", so that
mount(8) will later show the mountpoint's file system as "fusefs.xfs".
fusefs has had this feature ever since the original GSoC commit in 2012,
but there's never been a test for it.

MFC after:	2 weeks
2022-04-29 07:59:29 -06:00
Andrew Turner
5b651b501a Map the ACPI tables into the DMAP
When we try to load these tables via acpidump(8) we need them to be in
the DMAP for /dev/mem to access. Add the EFI ACPI reclaim memory type
to the list of memory we map into DMAP but not used by the kernel as
this is the recommended place to put these.

Sponsored by:	The FreeBSD Foundation
2022-04-29 13:11:02 +01:00
Peter Holm
014a2b1a11 stress2: Fixed cleanup path error 2022-04-29 10:55:26 +02:00
Warner Losh
9fb40baf60 cam_periph: Return ENXIO when peripheral is invalidated
When the peripheral is invalidated, no further I/O is possible. Signal
this up the stack with ENXIO now that upper layers of the stack
differentiate sometimes. In order for there to be further I/O, and new
open is required for any block device that a future periph might
instantiate for devices at this location that might return or otherwise
become available. The I/O scheduler flushes its I/O with the ENXIO error
for pending I/O that didn't make it to the device, so this makes the two
paths match.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		chs, mav
Differential Revision:	https://reviews.freebsd.org/D35093
2022-04-28 16:30:00 -06:00
Warner Losh
ca420b4ef2 mpr/mps: when sending reset on removal, include target in message
It's possible for muliple drives to be departing at the same time (if
the common power rail the share goes dark, for example). To understand
what's going on better, include target and handle in the messages
announcing the reset to allow matching with other corresponding events.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D35092
2022-04-28 16:30:00 -06:00
Alan Somers
45825a12f9 fusefs: fix FUSE_CREATE with file handles and fuse protocol < 7.9
Prior to fuse protocol version 7.9, the fuse_entry_out structure had a
smaller size.  But fuse_vnop_create did not take that into account when
working with servers that use older protocols.  The bug does not matter
for servers which don't use file handles or open flags (the only fields
affected).

PR:		263625
Submitted by:	Ali Abdallah <ali.abdallah@suse.com>
MFC after:	2 weeks
2022-04-28 15:13:09 -06:00
Ed Maste
1a50bf77af Add a tool to find MFC candidates
usage: mfc-candidates.sh [-ah] [-f from_branch] [-t to_branch]
    [-u user] [-X exclude_file] [path ...]

This tool compares git commit hashes that are in from_branch and not in
to_branch with hashes listed in "cherry picked from" lines, finding
commits that may be MFC candidates.  By default it searches for commits
by ${USER} but that can be overridden with -u for a specific user or -a
for all.

gonzo@'s MFC tracker is a web application that presents this sort of
information in a more convenient way, and unlike this script it tracks
"MFC After" status and timing.  However, it is sometimes useful to be
able to perform an offline search against a local repo.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34208
2022-04-28 14:02:26 -04:00
Warner Losh
c5041b4ee8 mpr/mps: Add comment explaining state transition
When we can't load a request due to a shortage of chains, we complete
the command's cm. However, to avoid an assert in mp?_complete_command,
we transition its state to INQUEUE. This transition is legitimate
because this is the only error path that terminates a cm before it's
enqueued and the only other alternative would be an additional transient
state that would add complexity w/o adding value. Add a comment
explainging all this because otherwise the transition can look a bit
weird.

Sponsored by:		Netflix
2022-04-28 11:19:39 -06:00
Robert Wing
65c87a6c81 geom_dev: extend kevent support for geom dev
Add support for the following NOTE events:
    NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, NOTE_READ, and NOTE_WRITE.

Differential Revision:	https://reviews.freebsd.org/D34777
2022-04-28 08:40:13 -08:00
Robert Wing
690b7ea081 bhyve/snapshot: ..back to SOCK_STREAM
Now that nvlist_send()/nvlist_recv() are being used, ditch the datagram
socket.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34863
2022-04-28 07:43:01 -08:00
Piotr Kubaj
25768526bb powerpc: enable wlan and ath modules in GENERIC64*
Reviewed by:	jhibbits (src)
Differential Revision: https://reviews.freebsd.org/D35089
2022-04-28 11:42:39 +02:00
Peter Holm
8a5c1f58dd stress2: Added a regression test 2022-04-28 09:41:27 +02:00
Kornel Duleba
0923ff82fb Add USB ID and quirks for Huawei E3372
Set UQ_MSC_NO_INQUIRY and UQ_MSC_NO_GETMAXLUN quirks for mass storage,
which is the initial mode of this dongle.
The modem is shipped with at least two firmware versions: 10.X and 11.X,
without ability to update to the newer one.
The 11.X version works more or less fine, but the 10.X one resets after
receiving either an SCSI INQUIRY, or a get_max_lun command.
Since both of those are used for automatic quirk detection, this leads
to a reset cycle making the device somewhat unusable.

Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: hps, wma
Differential Revision: https://reviews.freebsd.org/D35076
2022-04-28 08:42:30 +02:00
Kornel Duleba
3ee943868c usb: Respect NO_INQUIRY quirk during device enumeration
Both usb_iface_is_cdrom and usb_msc_auto_quirk functions use SCSI INQUIRY
command to probe various properties of usb mass storage devices.
The problem here is that some very broken devices don't like this command.
Check if UQ_MSC_NO_INQUIRY quirk is set and skip cdrom and quirk
autodetection in that case.

Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: hps, wma
Differential Revision: https://reviews.freebsd.org/D35075
2022-04-28 08:42:26 +02:00
Alexander Motin
404f001161 CAM: Keep periph_links when restoring CCB in camperiphdone().
While recovery command executed, some other commands from the periph
may complete, that may affect periph_links of this CCB.  So restoring
original CCB we must keep current periph_links as more up to date.

I've found this triggering assertions with debug kernel and suspect
some memory corruptions otherwise when spun down disk receives two
or sometimes more concurrent requests.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2022-04-27 21:39:50 -04:00