git-arc: Add a diff subcommand
Show the differences between local commits and their associated
Phabricator reviews, i.e., what "git arc update" would upload. For
each commit, the review's current raw diff is applied to the commit's
parent in a temporary index and the resulting tree is compared against
the commit itself. An empty diff means the commit and the review are
in sync.
This makes it easy to check whether local amendments have diverged
from the posted review before updating it, or to confirm that a
review is current before landing.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D58789
unix: only treat an empty sun_path as a peer descriptor for connectat(2)connect(2) passes AT_FDCWD to unp_connectat(), so the empty-path
descriptor branch added in 6563dcb6b1f5 turned any sockaddr whose
sun_path begins with a NUL byte into getsock(AT_FDCWD), failing with
EBADF where the pathname lookup historically failed with ENOENT.
Linux abstract namespace names are exactly that: the linuxulator
passes them through with the leading NUL intact, and libxcb tries the
abstract socket first, falling back to the pathname socket only on
ENOENT or ECONNREFUSED. The EBADF made every Linux X11 client fail
at startup with "Missing X server or $DISPLAY".
Restrict the descriptor interpretation to fd != AT_FDCWD, matching
the contract stated in 6563dcb6b1f5's commit message ("Accept an
empty sun_path when fd is not AT_FDCWD"): connect(2) again reaches
the pathname lookup and fails with ENOENT as it always did.
Add a regression test: a NUL-leading, nonzero-length sun_path through
[7 lines not shown]
libcxgb4: Use t4fw_interface.h from the cxgbe driver sources
In Linux these are maintained in separate places so a separate copy is
needed, but in FreeBSD take advantage of the shared tree to avoid
having a duplicate copy that can be stale.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D58575
rtld: Remove a stale #ifdef PIC
rtld has always been built PIC since commit
7ca8e6a67068e8357e251bd3ea86253c8a751d59. The stale #ifdef might
confuse a reader by thinking rtld can be built as non-PIC.
Reviewed by: kib
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D58623
libc: Implement qualifier-preserving standard library functions
Several standard library functions are specified to return an unqualified
pointer while accepting a pointer to a potentially const-qualified object.
N3020 addresses this behaviour, discarding qualifiers due to incompatible
pointer types, by introducing qualifier-preserving macros for the affected
set of standard library functions.
Add `__qualsel()` helper to `<sys/cdefs.h>`, implemented using the generic
selection, and define qualifier-preserving macros for that set of functions
in `<string.h>`, `<wchar.h>`, and `<stdlib.h>`.
Macros are gated on `_STDC_VERSION__ >= 202311L && !__cplusplus`, therefore
there is no behavioural change for earlier C modes or C++ translation units.
The kernel is likewise unaffected, as it does not include userland headers.
As function-like macros, they are transparent except at a call site where
the address-of operator is applied, the macro is suppressed via `#undef`,
or the identifier appears in parenthesised form; all of which cause the
[6 lines not shown]
pfsync test: reduce the number of states to bulk-sync
We created so many states that our bulk-sync occasionally caused epair
to drop packets, which in turn caused the test to fail. That's not what
we're testing here, make it more robust by creating fewer states.
PR: 297307
Sponsored by: Rubicon Communications, LLC ("Netgate")
release/riscv: tweak GENERICSD partition placement
Increase EFI partition size to begin rootfs at 64mb. I believe this was
my original intention. I have a microSD card with 8mb block size which
emits an advisory in verbose dmesg about the misaligned partition.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
libusb: Mark defualt smybol tag as latest stable version
As we might change the libusb ABI in 16, we should mark thje first
version as FBSD_1.8 instead of 1.9. Since versioning patch has not
landed for a long time, it makes sense to change it directly.
Discussed with: kib
Fixes: 527a82474cb3 ("libusb: versioning symbols")
Sponsored by: The FreeBSD Foundation
bnxt: Add led(4) identification support
Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported. Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.
This follows the DPDK and Linux bnxt HWRM identification paths.
Reviewed against: DPDK, Linux
Reviewed by: Sumit Saxena <sumit.saxena at broadcom.com>
MFC after: 2 weeks
Sponsored by: BBOX.io
linuxkpi: stop inlining accesses to curthread->td_lkpi_task
This should provide much higher resistence against struct thread layout
changes for out-of-tree modules depending on linuxkpi.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58733
tty: do not recurse on ttydev_close()
When the terminal cdev is closed due to revoke, ttydev_close() destroys
t_inpoll and t_outpoll selinfos. Since corresponding knotes reference
files pointing to the same tty cdev, it fdrop()s them. But then the
VOP_CLOSE() call would recurse into the ttydev_close() for the same tty.
More, because the devfs vnode is already doomed, each close call gets
the FREVOKE flag set.
As result, the kernel is recursing as deep into the ttydev_close() as
there are opened files referencing the same tty, which have the knotes
installed. Basically, the recursion level is controlled by userspace.
Prevent it by marking the tty that is handled by ttydev_close(), with
the TF_INDEVCLOSE flag. Do nothing in ttydev_close() when the flag is
already set, avoiding recursion.
Fixes: acd5638e268a ("tty: delete knotes when TTY is revoked")
Reviewed by: markj
[3 lines not shown]
unix: Fix mchain handling in uipc_sosend_stream_or_seqpacket()
Empty mchains cannot be copied with simple assignment.
I think this bug is mostly harmless: if mcnext is empty, then it won't
be accessed again before it is reinitialized in the next loop iteration.
So the bug only trips an assertion in INVARIANTS kernels and won't be
visible otherwise.
Add a regression test which triggers this corner case.
Reported by: Jan Bramkamp
Fixes: d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket")
Reviewed by: glebius
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58791
rc_subr_test: ignore stderr in no_cycles test
nuageinit_user_data_script references 'firstboot_freebsd_update'
and 'firstboot_pkg_upgrade', which are from Ports. In a default
base system test without sysutils/firstboot-freebsd-update and
sysutils/firstboot-pkg-upgrade, rcorder will warn on "unknown
provisions" to stderr, but is otherwise harmless.
Reviewed by: arrowd
Fixes: 16e47f317c4ce2be5fed530bf8a9af9f9bf55364
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
build: Use -f when copying sources
If one of the source files we copy is non-writeable, cp will create a
non-writeable copy. If the original is later modified, cp will fail to
overwrite the copy since it is not writeable. Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro
Add BOOL_MAX and BITINT_MAXWIDTH macros for C23 compliance, and
define the __STDC_VERSION_LIMITS_H__ feature test macro now that
the header fully conforms to C23.
Reviewed by: fuz
Approved by: fuz (mentor)
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
thunderbolt: Explicitly read NHI ISR0 register to clear it
This fixes and issue where Pink Sardine controllers were not receiving
interrupts for more than the first command sent on the ring.
Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52862
dpaa2: Apply if_flags and MAC filters in dpaa2_ni_init()
make sure interface flags and filters are reprogrammed during init().
The config isn't pushed into the hardware when the interface is down but
the flags are still being set, so we need to do the initial programming
ourselves. This fixes bridge and multicast behavior.
PR: 292006
Reported by: jhibbits
Approved by: adrian
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D58330
(cherry picked from commit dc12e3e0e72a73f1ad1a14d8d0fa4e2147151720)
Signed-off-by: Nick Price <nprice at FreeBSD.org>