Commit graph

138915 commits

Author SHA1 Message Date
Konstantin Belousov
c1df4eef12 msdosfs: clusterfree() is used only in error handling cases
(cherry picked from commit 65990b68a2)
2022-01-14 20:11:02 +02:00
Konstantin Belousov
95a83a5fff msdosfs: do no allow lookup to return vdp except for dot lookups
(cherry picked from commit aec97963cd)
2022-01-14 20:11:02 +02:00
Konstantin Belousov
1bcbcd68f5 msdosfs: handle a case when non-dot lookup returned dvp
(cherry picked from commit 1319c433f4)
2022-01-14 20:11:02 +02:00
Konstantin Belousov
472f576064 msdosfs: take inusemap inconsistency as an error, not invariants violation
(cherry picked from commit 2c9a1c22c3)
2022-01-14 20:11:01 +02:00
Konstantin Belousov
bbab525fc1 msdosfs: handle inconsistently hashed denodes
(cherry picked from commit 595ed4d767)
2022-01-14 20:11:01 +02:00
Konstantin Belousov
e1ac02ff7a geom label msdosfs: sanity check BPB before using it for io request
(cherry picked from commit 9f4073d446)
2022-01-14 20:11:01 +02:00
Stefan Eßer
54e1dc50ec sys/kern/sched_4bsd.c: fix typo introduced in previous commit
(cherry picked from commit ec3af9d0ca)
2022-01-14 18:17:31 +02:00
Stefan Eßer
a94baf23cf Restore variable aliasing in the context of cpu set operations
(cherry picked from commit a19bd8e30e)
2022-01-14 18:17:31 +02:00
Stefan Eßer
2cb81011e7 sys/cpuset.h: fix macro definition
(cherry picked from commit 5650d340ad)
2022-01-14 18:17:30 +02:00
Stefan Eßer
cb10f20a72 sys/cpuset.h: add 3 more macros provided by GLIBC
(cherry picked from commit cb65d4432a)
2022-01-14 18:17:30 +02:00
Stefan Eßer
eddcbd3b5b sys/sys/cpuset.h: Fix typo in source file
(cherry picked from commit b78860f96c)
2022-01-14 18:17:30 +02:00
Stefan Eßer
dc4114875e Make CPU_SET macros compliant with other implementations
(cherry picked from commit e2650af157)
2022-01-14 18:17:30 +02:00
Stefan Eßer
fddbba918d sys/_bitset.h: Fix fall-out from commit 5e04571cf3
(cherry picked from commit 49c2c62889)
2022-01-14 18:17:30 +02:00
Stefan Eßer
ca0d97022a sys/_bitset.h: Fix fall-out from commit 5e04571cf3
(cherry picked from commit 22c4ab6cb0)
2022-01-14 18:17:30 +02:00
Stefan Eßer
379bfb2aa9 sys/bitset.h: reduce visibility of BIT_* macros
(cherry picked from commit 5e04571cf3)
2022-01-14 18:17:30 +02:00
Konstantin Belousov
6e676b5550 Regen 2022-01-14 18:17:30 +02:00
Konstantin Belousov
6685c78631 sched.h: add CPU_EQUAL() for better compatibility with Linux
(cherry picked from commit 43e6f07b06)
2022-01-14 18:17:29 +02:00
Konstantin Belousov
a48d9f1900 Add sched_getcpu()
(cherry picked from commit 77b2c2f814)
2022-01-14 18:17:29 +02:00
Greg V
ae4067ce94 efifb,vbefb: implement vd_fini
This removes the pmap entry when switching away to e.g. drm fb.

Differential Revision:	https://reviews.freebsd.org/D29020
MFC After:	1 month

(cherry picked from commit 8ebda6e44b)
2022-01-14 16:55:23 +01:00
Mark Johnston
1562fe492a exec: Simplify sv_copyout_strings implementations a bit
Simplify control flow around handling of the execpath length and signal
trampoline.  Cache the sysentvec pointer in a local variable.

No functional change intended.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f04a096049)
2022-01-14 08:50:06 -05:00
Ian Lepore
1a86aab86a Add ETHER_ALIGN support to ng_device(4).
This adds a new ng_device command, NGM_DEVICE_ETHERALIGN, which has no
associated args.  After the command arrives, the device begins adjusting all
packets sent out its hook to have ETHER_ALIGN bytes of padding at the
beginning of the packet.  The ETHER_ALIGN padding is added only when
running on an architecture that requires strict alignment of IP headers
(based on the __NO_STRICT_ALIGNMENT macro, which is only #define'd on
x86 as of this writing).

This also adds ascii <-> binary command translation to ng_device, both for
the existing NGM_DEVICE_GET_DEVNAME and the new ETHERALIGN command.

This also gives a name to every ng_device node when it is constructed, using
the cdev device name (ngd0, ngd1, etc).  This makes it easier to address
command msgs to the device using ngctl(8).

Reviewed by:	donner, ray, adrian
Differential Revision:	https://reviews.freebsd.org/D32905
MFC after:   1 week

(cherry picked from commit 44aae623ab)
2022-01-14 14:28:43 +01:00
Gleb Smirnoff
1e2a0cef6b tcptw: count how many times a tcptw was actually useful
This will allow a sysadmin to lower net.inet.tcp.msl and
see how long tcptw are actually useful.

(cherry picked from commit 71d2d5adfe)
2022-01-13 13:19:40 -08:00
Alexander Motin
3c6b6246f2 CTL: Allow I/Os up to 8MB, depending on maxphys value.
For years CTL block backend limited I/O size to 1MB, splitting larger
requests into sequentially processed chunks.  It is sufficient for
most of use cases, since typical initiators rarely use bigger I/Os.

One of known exceptions is VMWare VAAI offload, by default sending up
to 8 4MB EXTENDED COPY requests same time.  CTL internally converted
those into 32 1MB READ/WRITE requests, that could overwhelm the block
backend, having finite number of processing threads and making more
important interactive I/Os to wait in its queue.  Previously it was
partially covered by CTL core serializing sequential reads to help
ZFS speculative prefetcher, but that serialization was significantly
relaxed after recent ZFS improvements.

With the new settings block backend receives 8 4MB requests, that
should be easier for both CTL itself and the underlying storage.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.

(cherry picked from commit b06771aa66)
2022-01-12 23:51:01 -05:00
Colin Percival
972796d007 vfs_mountroot: Check for root dev before waiting
If GEOM is idle but the root device is not yet present when we enter
vfs_mountroot_wait_if_necessary, we call vfs_mountroot_wait to wait
for root holds (e.g. CAM or USB initialization).  Upon returning from
vfs_mountroot_wait, we wait 100 ms at a time until the root device
shows up.

Since the root device most likely appeared during vfs_mountroot_wait
-- waiting for subsystems which may be responsible for the root
device is the whole purpose of that function -- it makes sense to
check if the device is now present rather than printing a warning
and pausing for 100 ms before checking.

Reviewed by:	trasz
Fixes: a3ba3d09c2 Make root mount wait mechanism smarter
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D33593

(cherry picked from commit 33812d60b9)
2022-01-12 11:29:51 -08:00
Colin Percival
72f61780a4 vfs_mountroot: Wait for GEOM idle post root holds
In the case of a root hold related to the initialization of a disk
device, a flurry of GEOM tasting is likely to take place as soon as
the device is initialized and the root hold is released.  If we
don't wait for GEOM idle it's easy for vfs_mountroot to "win" the
race and proceed before the root filesystem GEOM is ready.

Reviewed by:	imp
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D33592

(cherry picked from commit 19a172158c)
2022-01-12 11:29:48 -08:00
Colin Percival
d4724934f2 vfs_mountroot: Skip 'Root mount waiting' < 1 s
While the message is technically correct, it's not particularly
helpful in the case where we're only waiting a few ms; this case
occurs frequently on EC2 arm64 instances with CAM initialization
racing to release its root hold before vfs_mountroot reaches this
point.  Only print the message if we end up waiting for more than
one second.

Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D33591

(cherry picked from commit e6db5eb9ec)
2022-01-12 11:29:37 -08:00
Mark Johnston
4905ce27b8 mvneta: Unconditionally print an error message if mii_attach() fails
The error message is useful for diagnosing mvneta_attach() failures.

(cherry picked from commit ed166a0173)
2022-01-11 09:28:33 -05:00
Alexander Motin
472f92731f GEOM: Minor polishing in geom_event.
- Remove timeouts from msleep()'s.  Those should always be woken up.
 - Move wakeup() under the lock to not call on possibly freed pointer.
 - Remove some dead code.

MFC after:	2 weeks

(cherry picked from commit f4bf48c25c)
2022-01-10 21:45:30 -05:00
Cy Schubert
71dc210252 ipfilter: Add SDT probe frb_natv6in
Like IPv4 NAT frb_natv4in, add a corresponding IPv6 NAT SDT probe called
frb_natv6in.

(cherry picked from commit 6b54d2f4c5)
2022-01-10 07:08:29 -08:00
Cy Schubert
2c8fbe4c51 ipfilter: Unconditionally expose SDT probe frb_natv4in
SDT probe frb_natv4in is only available when an error is encountered.
Make it also available when no error is encountered, i.e. NATed and
not translated.

(cherry picked from commit b6f072f767)
2022-01-10 07:08:29 -08:00
Leandro Lupori
c930d356a3 powerpc64: fix the calculation of Maxmem
The calculation of Maxmem was skipping the last phys_avail segment,
because of a wrong stop condition.

This was detected when using QEMU/PowerNV with Radix MMU and low
memory (2G). In this case opal_pci would allocate a DMA window that
was too small to cover all physical memory, resulting in reading all
zeroes from disk when using memory that was not inside the allocated
window.

Reviewed by:		jhibbits
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33449

(cherry picked from commit a076e2060c)
2022-01-10 11:36:56 -03:00
Mark Johnston
313b1f2d81 Remove an obsolete warning from NOTES
The PREEMPTION option is enabled in all GENERIC kernel configurations.

(cherry picked from commit 5ba4192565)
2022-01-10 09:05:21 -05:00
Andrew Turner
b8c5b751bf Add the missing terminator to the bcm_xhci methods
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6e1be96fd2)
2022-01-10 10:54:20 +00:00
Andrew Turner
dfe221502f Extract the arm64 signal code to a new file
This will be used by the vdso signal trampoline on arm64.

While here fix the license as this part of locore.S to correct the
copyright owner.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8ddb4b9b66)
2022-01-10 10:54:19 +00:00
Olivier Houchard
6d91006cd1 arm64: Fix COMPAT_FREEBSD32.
The ENTRY() macro was modified by commit
28d945204e to add an optional NOP instruction
at the beginning of the function. It is of course an arm64 instruction, so
unsuitable for the 32bits sigcode. So just use EENTRY() instead for
aarch32_sigcode. This should fix receiving signals when running 32bits
binaries on FreeBSD/arm64.

MFC After: 1 week

(cherry picked from commit c328f64d81)
2022-01-10 10:54:19 +00:00
Alexander Motin
4ee9fbcd85 acpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.
MFC after:	2 weeks

(cherry picked from commit 6237a1cc2d)
2022-01-09 19:30:14 -05:00
Alexander Motin
034c2781d5 kern: Remove CTLFLAG_NEEDGIANT from some more sysctls.
MFC after:	2 weeks

(cherry picked from commit c6c52d8e39)
2022-01-09 19:30:09 -05:00
Alexander Motin
c63fc5265b netgraph: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit 2f1a46d12b)
2022-01-09 19:30:03 -05:00
Alexander Motin
1b1f80ae1c sound: Remove CTLFLAG_NEEDGIANT from some sysctls.
While there, remove some dead code.

MFC after:	2 weeks

(cherry picked from commit 3b4c543322)
2022-01-09 19:29:59 -05:00
Alexander Motin
f39bf9a217 acpica: Remove CTLFLAG_NEEDGIANT from most sysctls.
MFC after:	2 weeks

(cherry picked from commit 3e68d2c52b)
2022-01-09 19:29:55 -05:00
Maxim Sobolev
ec746e6195 Fix fragmented UDP packets handling since rev.360967.
Consider IP_MF flag when checking length of the UDP packet to
match the declared value.

Sponsored by:	Sippy Software, Inc.
Differential Revision:	https://reviews.freebsd.org/D32363
MFC after:	2 weeks

(cherry picked from commit 461e6f23db)
2022-01-09 17:04:56 -05:00
Bjoern A. Zeeb
50a078f852 LinuxKPI: 802.11 fix queue wait
We are using a bandaid to wait for queues after station creation
looping and pausing.
The abort condition was looping in the wrong direction so we were
potentially waiting forever if queues never became ready.
From initial user test data we also found that the wait time was
too low in some cases so increase the length.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 500be2e803)
2022-01-09 02:37:01 +00:00
Bjoern A. Zeeb
1158f08bc5 iwlwifi: import correct firmware versions for select Intel iwlwifi/mvm
The firmware files for 3160, 7260, and 7265 imported contain old versions
no longer supported by the driver.
Replace with latest versions from linux-firmware to possibly also
support these chip revisions.

Reported by:	FreeBSD User (freebsd walstatt-de.de) on wireless (2021-12-30)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 58101517cb)
2022-01-09 02:37:01 +00:00
Alexander Motin
6bc8606fca pccbb: Remove Giant mention in comments.
MFC after:	2 weeks

(cherry picked from commit 22405bb2e4)
2022-01-08 20:24:13 -05:00
Alexander Motin
5ec6907c0a kern: Remove CTLFLAG_NEEDGIANT from some sysctls.
MFC after:	2 weeks

(cherry picked from commit fe27f1db5f)
2022-01-08 20:24:10 -05:00
Alexander Motin
2a36679b74 amdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.
It seems to be needed only to serialize very old K8 registers access.
Introduce separate lock for that and remove Giant dependency.

MFC after:	2 weeks

(cherry picked from commit 6c101ed7a3)
2022-01-08 20:24:07 -05:00
Alexander Motin
2123d7a2d6 x86: Remove CTLFLAG_NEEDGIANT from sysctls.
MFC after:	2 weeks

(cherry picked from commit 1d6fb900ed)
2022-01-08 20:24:04 -05:00
Alexander Motin
cd9fe8d81d uart: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit c214c2c004)
2022-01-08 20:24:01 -05:00
Alexander Motin
7518562484 hwpmc: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit 1886cef69b)
2022-01-08 20:23:58 -05:00
Konstantin Belousov
1a35d94bbb mountmsdosfs(): some style
(cherry picked from commit 04fd468da0)
2022-01-09 03:20:22 +02:00