Implement a simple heuristic to skip pointless promotion attempts by
pmap_enter_quick_locked() and moea64_enter(). Specifically, when
vm_fault() calls pmap_enter_quick() to map neighboring pages at the end
of a copy-on-write fault, there is no point in attempting promotion in
pmap_enter_quick_locked() and moea64_enter(). Promotion will fail
because the base pages have differing protection.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45431
MFC after: 1 week
This function follows both m_nextpkt and m_next linkage freeing all mbufs.
Note that existing m_freem() follows only m_next.
Reviewed by: khng
Differential Revision: https://reviews.freebsd.org/D45477
The manual page is correct though.
No functional change.
Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 3 days
Event: Kitchener-Waterloo Hackathon 202406
Sponsored by: The FreeBSD Foundation
Do some light cleanup to make the output format more consistent for
readability.
Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D45442
In three instances where fls(x)-1 is used, the compiler does not know
that x is nonzero and so adds needless zero checks. Using ilog(x)
instead saves, in each instance, about 4 instructions, including a
conditional, and 16 or so bytes, on an amd64 build.
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D45330
In three instances where fls(x)-1 is used, the compiler does not know
that x is nonzero and so adds needless zero checks. Using ilog(x)
instead saves, in each instance, about 4 instructions, including a
conditional, and 16 or so bytes, on an amd64 build.
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D45330
The kernel source contains several definitions of an ilog2 function;
some are slower than necessary, and one of them is incorrect.
Elimininate them all and define an ilog2 macro in libkern to replace
them, in a way that is fast, correct for all argument types, and, in a
GENERIC kernel, includes a check for an invalid zero parameter.
Folks at Microsoft have verified that having a correct ilog2
definition for their MANA driver doesn't break it.
Reviewed by: alc, markj, mhorne (older version), jhibbits (older version)
Differential Revision: https://reviews.freebsd.org/D45170
Differential Revision: https://reviews.freebsd.org/D45235
Almost all code related to the saf1761 driver was removed in commit
44796b7e82, except for two small bits related to saf1761otg support.
This patch completes the removal.
PR: 279302
Signed-off-by: Joshua Kinard <freebsd@kumba.dev>
Reviewed by: mhorne
MFC after: 3 days
Fixes: 44796b7e82 ("mips: remove saf1761")
The kernel hasn't built with anything less than c99 for a long
time. Retire support in the build for it. In addition, retire the
translation of c99 to -std=iso9899:1999, since all latter day C
compilers that we support have had this for maybe 15 years or so (gcc
since 4.5, clang since the earliest version) and it simplifies the code.
Reviewed-by: imp, emaste
Differential-Revision: https://reviews.freebsd.org/D44145
It's probably a copy-paste leftover from the other functions which
return a boolean value and generates annoying "CLOCK_SETTIME error 1"
from subr_rtc.c on Traverse Ten64 in verbose mode.
No functional changes intended.
MFC after: 3 days
Unfortunately this results in make universe's environment, i.e.
corresponding to the host, being used for every one of its sub-makes, so
they're in the wrong place and trample over each other.
This reverts commit 2b7c1402f9.
This case gets hit in make universe on Linux, since we will first run
make test-system-compiler to determine whether to use the system or
universe toolchain, during which time CC is the host's, GCC, and XCC
isn't set, so defaults to the same.
Fixes: 4c0dfd5959 ("arm: fail early on gcc builds")
This used to be name = mktemp followed by fd = open downstream,
replacing upstream's crude PID-based sprintf, but in 1.4.7 this was
changed upstream to this buggy code, which we then picked up in the
1.5.0 import. Presumably nobody's actually used ee's ispell function
in the past 15 years; that or it's just ended up using junk file names
as temporary files if name's happened to be a valid address to something
that can be interpreted as a string.
Reported by: Dapeng Gao <dapeng.gao@cl.cam.ac.uk>
Fixes: 96b676e999 ("Update ee(1) in the base system to version 1.5.0.")
MFC after: 1 week
DELAY takes microseconds not milliseconds, so 100 was too low. Moreover,
when enabling hw.pci.clear_pcib, PCI emeration would still stop at one
of the first bridges, but by asserting PERST for the rest of the reset
sequence that appears to be reliably addressed.
Fixes: 896e217a0e ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver")
New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but now rc.subr(8) does not call it
if a service is not enabled.
Fix devd startup script to use it instead of start_precmd.
PR: 279198
MFC after: 2 weeks
Reported by: Dmitry S. Lukhtionov
Tested by: Dmitry S. Lukhtionov
This non-standard type is unused in the base system (__ct_rune_t or
__rune_t are used instead) and ports. It has been around as long as our
current source repo, but we have avoided using it. In sys/_types.h
where the __*rune_t typedefs are defined, the following appears in a
comment:
NOTE: rune_t is not covered by ANSI nor other standards, and should
not be instantiated outside of lib/libc/locale. Use wchar_t.
The definition of this unused type meant we gratutiously differed from
standards compliant stddef.h/stdlib.h.
PR: 279357 (exp-run by antoine)
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D45426
A set of convenience macros to initialize struct iovec's and increment
the base and length together.
IOVEC_INIT - sets iov_base and iov_len
IOVEC_INIT_CSTR - takes a string and sets iov_len to strlen + 1
IOVEC_INIT_OBJ - takes an object and sets iov_len to sizeof obj
IOVEC_ADVANCE - increments iov_base and decrements iov_len
On CheriBSD these present the opportunity to insert more precise bounds
on some objects and hide differences in casts in hybrid kernels (where
some, but not all pointers are capabilities and require annotation).
Here in FreeBSD the resulting code is tidier, particularly in the
IOVEC_ADVANCE case where the need to cast iov_base to (char *) is
avoided.
Reviewed by: kib
Feedback from: des, jrtc27
MFC after: 1 week
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D45422
This breaks the weekly snapshot builds. We'll try again once Warner has
some time to debug the qemu-user-static-devel port.
This reverts commit a04ecddfc7.
Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD devices
and issues with very large cluster sizes (see PR 277414).
The -A option used to align the start of the root directory to a
multiple of the cluster size, which happens to align the start of the
data area with a buffer page boundary in case of large clusters and
the default number of directory entries (512 entries requiring 16 KB
for FAT12 or FAT16, FAT32 puts the root directory into the data area).
This commit aligns the start of the data area with the page size, if
neither -A nor -r is used. It changes -A to align the start of the
data area (end of the root directory) to a multiple of the cluster
size, since this is the alignment that prevents write multiplication
due to clusters crossing erase block boundaries of a SSD device.
The -r option is unchanged and will prevent any automatic alignment
from occuring.
Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436
It's never had any effect. The kernel ignores it. Remove it from the
documentation. But continue to parse it on the command line, for
backwards-compatibility.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1271