mlx5en: fix RX HW timestamp overflow with 1GHz clock
mlx5e_mbuf_tstmp() splits the HW clock delta into seconds and a
sub-second remainder before scaling it by the calibration interval.
With a 1GHz core clock and the default 30 seconds recalibration
interval, both the remainder multiplied by the interval in ns and the
carry over multiplied by cclk exceed 2^64. RX timestamps end up off by
up to two seconds, which shows up as clock drift in NTP using HW RX
timestamps.
Take the whole calibration intervals out of the HW clock delta first,
so that the rest of the computation does not depend on how far the
timestamp is from the calibration point, e.g. after the system was
suspended. Then split the rest at 2^20 clocks, about 1ms at 1GHz,
instead of at seconds, using shifts and masks. The split no longer
depends on the clock frequency, so priv->cclk is removed.
Reviewed by: kib, gallatin
Sponsored by: Nvidia networking
[2 lines not shown]
imgact_elf: accept PT_INTERP segments up to 4096 bytes
The Yocto/Poky relocatable SDK NUL-pads the interpreter path in
PT_INTERP out to 4096 bytes (within Linux's POSIX PATH_MAX) so that
'relocate_sdk.py' can rewrite the path in place. The kernel rejected
any PT_INTERP with p_filesz > BSD's MAXPATHLEN (1024) with
"Invalid PT_INTERP" and ENOEXEC, so none of the SDK's binaries could
be run under the Linuxulator.
- The PT_INTERP segment may now be up to 'PT_INTERP_SEG_MAXSZ'
bytes, which may be greater than 'MAXPATHLEN'.
- The interpreter path within the segment must still be shorter
than 'MAXPATHLEN' -- when violated results in 'ENAMETOOLONG'
when the interpreter is looked up.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D62075
(cherry picked from commit 7ee8d41ebb2ffb13e50ea59fd5bc43155123f323)
linuxulator/powerpc: report the CPU family in AT_PLATFORM
Linux passes the CPU family here, e.g. power9. glibc uses it for
__builtin_cpu_is().
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62279
linuxulator/powerpc: implement the FUTEX_WAKE_OP helpers
These were stubs returning ENOTSUP. Qt uses FUTEX_WAKE_OP, so Qt programs
hung as soon as they started a thread.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62278
linuxulator/powerpc: fix terminal ioctls
linux_ioctl() only looks at the low 16 bits of the command, so the PowerPC
handler was never called and isatty() failed. Return ENOIOCTL for commands
we don't know, so that other handlers get a chance.
struct termios has c_cc before c_line and carries the speeds on PowerPC,
and CSIZE is encoded like on BSD. Fix the codes for 57600 and 115200 baud
while here.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62277
Add USB quirk for WCH-Link adapter
WCH-Link is a debug adapter from QinHeng Electronics that features a
(proprietary) debug bridge for their RISC-V MCUs, as well as a serial
gateway, implemented as a CDC device. The CDC's call management
descriptor declares the data interface to be 1, but it is actually
interface 2. UQ_IGNORE_CDC_CM has already been implemented before to
handle this kind of firmware bug, so just add this quirk for WCH-Link.
Reported by: Holm Tiffe
(cherry picked from commit 1660d69068a0650fcda2ce7497dfa20e33f0b58d)
linuxulator/powerpc: use the PowerPC socket option numbers
Six socket options are numbered differently on PowerPC. linux_socket.h
already has an #ifndef for that, but nothing defined them.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62276
linuxulator/powerpc: enable socketcall
PowerPC had no separate socket syscalls before Linux 4.3, so binaries
built for older kernels use socketcall() for everything.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62275
linuxulator/powerpc: implement send, recv and ipc
glibc uses send(), recv() and the ipc() multiplexer on PowerPC. Without
them DNS lookups and SysV shared memory don't work.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62274
acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers
<dev/acpica/acpivar.h> uses types from
<contrib/dev/acpica/include/acpi.h>, so have it include it directly.
This allows removing that include, and in passing some superfluous
includes from sys/contrib/dev/acpica/include, from all source files
including <dev/acpica/acpivar.h>.
Reviewed by: imp, jaeyoon
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62103
linuxulator/powerpc: move syscalls out of the 32-bit only slots
On powerpc64 select() is syscall 142, getrlimit() is 190 and umount2() is
52. We had them at 82, 76 and 22, which are 32-bit only. Linux programs
couldn't unmount anything.
mmap2 is 32-bit only as well. Use linux_mmap2() for mmap like amd64 and
arm64 do and remove our copy of it.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62273
rtld: preserve the FP and vector registers in __tls_get_addr() on powerpc64
LLVM assumes that __tls_get_addr() clobbers only r0, r4-r12, LR, CTR,
CR0, CR1 and CR5-CR7 (the GETtlsADDR pseudo in PPCInstr64Bit.td), as
glibc's implementation guarantees, and keeps live values in the other
registers across the call. Our slow path, which runs on the first
access to the TLS block of a dlopen()ed object, copies the TLS
initialization image with the generic memcpy() and memset(), which
clang vectorizes: for a 130-byte block they clobber vs0, vs1, v0, v2,
v3 and v5 on powerpc64le and v2, v4 and v5 in a POWER9 powerpc64 build.
Qt's QBindingStorage constructor zeroes vs0, calls __tls_get_addr() and
then stores vs0 into the object, so the first QObject created by a
process that dlopen()ed libQt6Core gets 0xffffffff in its binding
storage pointer and crashes on destruction; this is why devel/pyside6
cannot generate QtGui.pyi on powerpc64le.
Keep the fast path as it is and run the slow path through a trampoline
that saves and restores the volatile floating-point and vector
[13 lines not shown]
misc/opencode: update to 2.4.4
- Update to 2.4.4 and bundled OpenTUI 0.9.12.
- Rebase the FreeBSD watcher patch onto the reworked native layer in 2.4.4
(Layer.effect + FiberSet); the FreeBSD snapshot/poll behaviour is
unchanged.
- The opencode-pty daemon (0.6.0, protocol 9), fff 0.10.5 and Ghostty v1.4.0
pins are unchanged, and the remaining patches apply unchanged.
*/*: Bump PORTREVISION for known Qt private API abusers
Qt 6.12.1 edition.
These ports are known to directly use or link to a library that uses the
Qt private API and must be rebuilt with every Qt update.
Qt *public* API/ABI compatability is excellent, so most consumers don't
need to necessarily be rebuilt between patch or even minor releases, but
use of the private API breaks this compatibility between even patch
releases and its use is highly discouraged.
This list [1] is based on histortical data. We don't have time to
revisit every port on the list with each Qt update, so if your port has
dropped Qt private headers and was bumped in error, please remove it
yourself if you have write access to the Wiki or alert someone on kde@.
[1] https://wiki.freebsd.org/KDE/Qt
x11-toolkits/pythonqt: Mark BROKEN
Does not build with Qt 6.12, but upstream PR
https://github.com/MeVisLab/pythonqt/pull/376
might fix it.
I'll do a followup on it, but this is a leaf
library and was getting in the way of the Qt
update.