stat: Nits in stat tests
* Use ourselves as test file instead of /COPYRIGHT, which may or may not
be present in the test environment.
* atf-check understands \n in strings, use it.
* Some file systems don't like creating small holes, so create large ones
instead. This means we need two variables: ps (page size) is the
minimum size of a data region and the alignment for a hole, while hs
(hole size) is the minimum size of the holes we create. This makes no
difference on FreeBSD but makes it easier to port the test to other
platforms.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D56304
libgcc_s: export __extendhftf2
We've compiled it since the LLVM 13 import in 2021, but for some reason
never exported it. A user of CheriBSD recently caused Morello LLVM to
emit a reference to it so finish the job and export it.
Reviewed by: dim, emaste
Fixes: 6e75b2fbf9a0 ("Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a")
MFC after: 1 week
Sponsored by: DARPA, AFRL
See also: https://github.com/CTSRD-CHERI/cheribsd/issues/2614
Differential Revision: https://reviews.freebsd.org/D56310
compat/linprocfs: Fix auxv sbuf leak
linprocfs_doauxv() allocates an automatic sbuf before validating
whether the requested read can be satisfied.
When the computed auxv read length exceeds IOSIZE_MAX, or when the
buffer length is too big, the function returns early without
releasing the sbuf.
Route these early exits through a shared cleanup path so the sbuf is
always deleted after sbuf_new_auto() succeeds.
Signed-off-by: Shunchao Hu <ankohuu at gmail.com>
Reviewed by: des, spmzt, zlei, aokblast
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/2118
lib/msun: centralize addition of the arch-specific symbol map files
This also adds the aarch64 symbols, exporting them.
Reported and tested by: fluffy
Reviewed by: emaste
Fixes: 3a01e1e1a50cb9a9594aac2148dc920a6b295428
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56283
arm64: Add arm64 SVE tests
Add the tests/sys/arch directory for architecture-specific tests and
use it to add arm64 SVE tests. These test the kernel is managing the
SVE state in a way we expect.
These tests require SVE hardware support to run so will skip when they
can't detect it.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43311
vm_fault: Reset m_needs_zeroing properly
- When allocating a page, we should only consider the PG_ZERO flag when
handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
Previously, vm_fault_busy_sleep() would fail to reset it.
PR: 294039
Reviewed by: kib
Tested by: Peter Much <pmc at citylink.dinoex.sub.org>
MFC after: 3 days
Fixes: cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision: https://reviews.freebsd.org/D56234
imgact_elf: Unconditionally initialize a variable in a note handler
In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter. But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.
PR: 292811
MFC after: 1 week
ip6_mroute: VNETify counters
Commit a223d6c489c7 made most of the ip6_mroute state per-VNET, but
failed to do this for a couple of counter structures. Make them
per-VNET too.
Reported by: zlei
Reviewed by: pouria, zlei
Fixes: a223d6c489c7 ("ip6_mroute: Start putting global variables into a structure")
Differential Revision: https://reviews.freebsd.org/D56253
arm64: Have a common call to userret
Rather than each exception calling userret use a common copy. As
syscallret already calls userret we need to skip it in that case.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55250
(cherry picked from commit 14e97448fcebbe4b038eaf5628933abe5f9e690d)
arm64: Optimise the repeated TLBI workaround
It has been reported that the overhead of repeating all TLBI
instructions is too large [1]. The Software Developer Errata Notices
(SDEN) for the relevant Arm CPUs have been updated so a single
"tlbi vale1is, xzr" followed by "dsb ish" is sufficient to work around
the issues.
Replace the places we repeat TLBI instructions with the new sequence.
[1] https://lore.kernel.org/linux-arm-kernel/20260218164348.2022831-1-mark.rutland@arm.com/
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55646
(cherry picked from commit 80b4129bef8b908eb19fe47853cb6e45e4513d76)
arm64/vmm: Support PMU v3p9
The only new register is read-only. As the kernel just passes the
registers to the guest directly no further change should be needed.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51764
(cherry picked from commit d1650d226205cdf07fb19e0c9b10b47b941e8747)
arm64: Treat the PMUVer field of ID_AA64DFR0 as unsigned
The PMUVer field of ID_AA64DFR0 contains an unsigned version of the
Performance Monitors Extension, but it is currently treated as signed.
Change it to unsigned.
Reviewed by: andrew
Sponsored by: Arm Ltd
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2062
(cherry picked from commit e40e5458616d13b44cd407aa1afff620f8ff8766)
vtgpu: Support virtio gpu on Parallels Desktop
The Parallels Desktop Virtio GPU implementation doesn't handle
enqueuing the VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING request and
memory list together.
Work around this by splitting them before sending them to be enqueued.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55147
(cherry picked from commit 1ea0721e1a566fdb552b0a919c22667844a894d9)
nvmecontrol: Remove an incorrect use of PAGE_SIZE
The mdts value is in terms of the nvme page size, not the host page
size. On many architectures these are both 4k, however on arm64 it is
possible to build a system with the host page size of 16k.
Use NVME_MPS_SHIFT to get the correct nvme page shift.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55334
(cherry picked from commit bfb7c81f93b534f8c10928d80ea56c8177a6f39f)
arm64: Add MOPS implementation of pagezero()
Reimplement pagezero() as ifunc. As pagezero() is only used in pmap.c,
move ifunc to that file.
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54946
(cherry picked from commit 7d7295df9b13b98ac395b206667e7586c602862b)
arm64: Add MOPS implementations of memset(), memcpy() and memmove()
Enable the use of MOPS implementations of memset, memcpy and memmove within
the kernel. Fix pre-ifunc resolution uses of these functions.
Reported by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55051
(cherry picked from commit 2ccbf06c0285ca1c06681e7212da8e7d1e87fe19)
arm64: Panic if the ID register isn't known
This will allow for callers to be simplified & not need to check the
return status.
Keep the return type for now so this can be MFCd without breaking the
KBI.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55104
(cherry picked from commit 3b0b6aa2cd05b516ecf4b72f9a3c2aadddf3c94e)
libc/tests/string: add a more comprehensive unit test for strrchr()
The unit tests are patterned after those for memrchr().
This catches the issue found in 293915.
PR: 293915
Reviewed by: strajabot
Reported by: safonov.paul at gmail.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56037
lualoader: allow the local module to filter out the BE list
This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:
-- file: /boot/lua/local.lua
local core = require("core")
local function be_hide(be)
if core.isSingleUserBoot() then
-- All BEs are accepted for single-user
return true
end
local name = be:match("/([^/]+)$")
if not name then
-- Accept malformed BEs, for whatever reason
return true
[15 lines not shown]
stat: Nits in readlink tests
* The f_flag test may fail if a component of the full path to the
temporary directory is a symbolic link.
* The n_flag test had an empty head; give it a description.
* Use consistent quoting.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D56293
hwpstate_amd: Expose nodes as much as possible in legacy pstate
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55606