Revert "linux: implement fchmodat2 syscall"
This got accidentally committed when I was reverting another commit.
This reverts commit c070ec923e2f49b6ecb5a60b584ba8f4376a6e80.
linux: implement fchmodat2 syscall
The fchmodat2 syscall on Linux is effectively the same as the fchmodat
on FreeBSD, whereas fchmodat on Linux is fchmodat on FreeBSD, minus
the `flags` argument.
This change provides the necessary glue in order to call kern_fchmodat
properly via the Linuxulator.
NB: glibc transparently passes through the `flags` argument, so this is
[largely] a no-op for end-users, but it affects those who compiled
binaries specifically using the fchmodat2 syscall.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60394
Revert "linux: implement sched_getattr()"
The changes need to be reviewed further; revert until the issues have
been worked out.
Requested by: markj
This reverts commit bb5f10e51bd53771f1a438f36f554256fcbd7d08.
uiomove_object_page: a failed copy can still dirty the page
For writes, if we fail in the middle of reading from the source, the
destination may have already been dirtied. For example, the source may
cross a page boundary, and the second page is inaccessible.
Conservatively mark the destination as dirty, even on errors.
Reported by: Claude (Opus 5.5)
Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60280
sendfile: Fix build for kernels without INET or INET6
Don't cap the new low watermark to a TCP-specific setting in kernels
without TCP.
Fixes: 6948f4d5e2b2 ("sendfile: keep the lowat hack more conservative")
zstream: Downgrade -Watomic-alignment to a warning
Don't complain about unaligned atomic operations on i386. This
same approach is already used for libspl.
devfs_open: do not access dsw after dev_relthread()
Noted and reviewed by: markj
Fixes: 850d4562928e ("cdevsw: add D_NONPASSABLE flag")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60393
linux: implement sched_getattr()
This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.
This unbreaks using the Linux version of Chromium on FreeBSD.
This change was originally submitted via [freebsd/freebsd-src#2370][github-pr].
MFC after: 2 weeks
PR: 297468
Co-Authored-By: Enji Cooper <ngie at FreeBSD.org>
Signed-off-by: Joao Bonifacio <joaoboni017 at gmail.com>
[github-pr]: https://github.com/freebsd/freebsd-src/pull/2370
Differential Revision: https://reviews.freebsd.org/D60214
ufssuspend(4): mark non-passable
This fixes long-standing issue where ufssuspend file descriptor could
leak over fork or be passed over unix domain socket, and then closing it
in the opener would not unsuspend the file system.
It should not affect the well-behaving growfs(8) utility, but makes the
userspace API safer on principle.
Reviewed by: markj
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60285
cdevsw: add D_NONPASSABLE flag
to make the opened device files non-passable.
Reviewed by: markj
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60285
e1000: Fix the flow control sysctl
dev.em.N.fc and dev.igb.N.fc read and wrote a function-static variable
shared by every em(4) and igb(4) device, so a read returned the last
value written to any of them (3 until the first write), not the state of
the device. The softc value started as 0, which is also the value of
"no flow control", while the hardware was set up for full flow control.
As a result:
- Writing 0 was taken for no change and did nothing, unless another
value had been written to that device before.
- em_reset() took a softc value of 0 for "not set", so a device set to 0
went back to full flow control on the next init.
- On igb(4) with more than one receive queue the driver enabled
per-queue drop (SRRCTL.DROP_EN), which is meant for a MAC that does
not send pause frames, although the MAC was told to send them.
- Values out of range were accepted and ignored.
A write only forced the MAC's flow control bits. The pause bits
[18 lines not shown]
sys.mk: CTFMERGE: don't assume objfiles always have CTF sections
There are many instances, e.g. in the kernel, where
object files don't have CTF sections, but still need
to be merged into one that does have a CTF section.
This fixes cases like the following:
--------------------------------------------------------------
>>> stage 3.1: building everything
--------------------------------------------------------------
linking kernel.full
ctfmerge -t -L VERSION -g -o kernel.full ...
ERROR: ctfmerge: Input file force-dynamic-hack.pico was partially built from C sources, but no CTF data was present
Removing kernel.full
kernel.full ---
[kernel.full] Error code 1
[8 lines not shown]
stand/images: remove translucent pixels around orb
Remove semi-transparent pixels around the orb. These become more
pronounced when the orb is used as the spash screen image.
While here also strip metadata.
MFC after: 3 days
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D60163
(cherry picked from commit f7663278c2ba527dc681b1a806d4cc78ea49452b)
stand/images: remove translucent pixels around orb
Remove semi-transparent pixels around the orb. These become more
pronounced when the orb is used as the spash screen image.
While here also strip metadata.
MFC after: 3 days
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D60163
(cherry picked from commit f7663278c2ba527dc681b1a806d4cc78ea49452b)
iflib: Make the deferral test in iflib_txd_db_check() an early return
Invert the test so the doorbell write is no longer nested inside the
conditional, and wrap its comments to 80 columns. Fix a typo in one of
them.
No functional change intended.
Reviewed by: kbowling
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60371
iflib: Do not ring the transmit doorbell when nothing is pending
For a lightly used ring iflib_txd_db_check() may defer zero descriptors,
so its "pending >= limit" test is true even when nothing has been queued
since the last doorbell. iflib_txq_drain() calls it before, inside and
after its loop, so a sender that drains its own packet wrote the tail
register three times per packet, twice with the value the hardware
already had.
The log of 81be655266fa ("iflib: ensure that tx interrupts enabled and
cleanups") calls skipping the doorbell when db_pending is zero "an
obvious missing optimization"; the comparison against a limit of zero
defeated it. vmx(4) and mgb(4) have dropped such repeated requests in
the driver since 2019. Return early when nothing is pending.
Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60290
arm64: Elide coherent busdma maps
Avoid allocating per-transfer maps for coherent tags that cannot
bounce. Retain maps for cache synchronization, CCA realms, and KMSAN.
These un-used maps carry with them memory and cache miss overheads.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D60098
Sponsored by: Netflix
openssh: Add date bump command to FREEBSD-upgrade instructions
Provide a convenient in-place sed edit command to update the FreeBSD
VersionAddendum dates with today's date.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 0ec81f6a531bf7b3b06e869c99295f3d4ab9ed8e)
(cherry picked from commit 2ba5b9da2be10261c383035bef932cd37d52f903)
openssh: Add reference for another local patch
A bug fix was committed locally and submitted upstream. Document it in
our upgrade instructions, as these sometimes take a long time before
getting merged.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 6531070132b0210aaaeb08c0dc93cb272bed348e)
(cherry picked from commit 14d6926293569048d2d04f6e5a13d80f192ad99e)
secure: Rearrange Makefile SRCS to match upstream Makefile.in
SRCS entries are kept in the same order and with the same line breaks as
upstream, to make comparison easier.
No functional change intended.
Reviewed by: emaste
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D49793
(cherry picked from commit 9440aad19dca73fdd224b128ac2dc2e78191ff15)