zstd: disable weak-symbol tracing hooks in the kernel
zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe. That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.
In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime. On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs. On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot. Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.
The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),
[8 lines not shown]
compat/linprocfs: Update /proc/partitions output
Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name. linprocfs still printed obsolete
statistics columns and reported the size in bytes.
Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.
Signed-off-by: Shunchao Hu <ankohuu at gmail.com>
Reviewed by: des
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/2126
Closes: https://github.com/freebsd/freebsd-src/pull/2126
stand: lua: break out a few more dirent types in lfs
These are non-standard and specific to the version used in loader. We
have some desire to recognize symlinks to avoid filtering out kernel
symlinks in the autodetection bits when they would be perfectly fine to
`load`.
This won't be usable right away, so any impending use will need to be
careful to account for nil.
Reported by: leres
(cherry picked from commit bc531a96c9b28b1cabcd5deb0c9f8f6d815cfebc)
flua: lposix: fix WARNS=6 issues
lposix is the last holdout of modules built into flua until we can fix
the module design to have the right parts require()able. Address a
valid bug in lua_read() found at a higher WARNS and drop the override
entirely. Some of the modules could possibly be re-evaluated.
Reported by: des
Reviewed by: des
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
(cherry picked from commit b41b6fdb3a1635de4c2a9280aab12b83e3aeffc5)
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in
and discovering them via linker sets. This is slightly cleaner than
always building them in and baking them into loadedlibs for both
bootstrap and system flua.
Adjust the stand build now that these three libs have their own new
homes. lposix remains builtin because it's structured incorrectly in
our version.
Reviewed by: bapt, emaste, markj
(cherry picked from commit b11a5709ec2b61fefb03bfdd38e2f06d2c1107c1)
(cherry picked from commit 9c7db0931d486ce800aa71d9f41abfad9f7f691f)
(cherry picked from commit d505ef08ffbe3b7383fbc6ed30121de9256ac18e)
flua: support our flua modules in the bootstrap flua
This version builds every module into the flua binary itself, since all
of the bootstrap tools are built -DNO_SHARED. As a result, we also
cannot dlsym(), so we can't really discover the names of our newly
builtin modules. Instead, just build out a linker set with all of our
luaopen_*() functions to register everything up-front.
Building in all of the modules isn't strictly necessary, but it means
that we have an example of how to add a bootstrap module everywhere you
go and one doesn't need to consider whether bootstrap flua can use a
module when writing scripts. On my build machine, the consequence on
our binary size is an increase from around 1.6M -> 1.9M, which isn't
really that bad.
.lua modules can install into their usual path below $WORLDTMP/legacy
and we'll pick them up automagically by way of the ctor that sets up
LUA_PATH early on.
[32 lines not shown]
nuageinit: require lfs where it's needed
nuageinit largely already did this, but one spot was missed -- add the
necessary require() in to get the module loaded.
(cherry picked from commit bb4167463ac44b47ded4e0223a0abd8381ca6cd8)
nfs_nfsdsocket.c: All Copy and Clone across file systems
For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.
As such, this patch allows the Copy/Clone to be attempted
when the file handles are for files on different file systems.
This fixes a problem for exported ZFS file systems when a
copy_files on file_range(2) between file systems in the same
NFSv4 mount is attempted.
PR: 294010
(cherry picked from commit b65e7b4944cc2f594c9d9e6abc9b8618d3d62ff8)
qcom_gcc: migrate the MSM8916 support to qcom_gcc
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
the MSM8916 stub in sys/arm64/qualcomm .
Differential Revision: https://reviews.freebsd.org/D49706
nd6: Remove DRAFT_IETF_6MAN_IPV6ONLY_FLAG and EXPERIMENTAL options
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
procctl.2: Align list indentation
Remove 81 lines of whitespace at default manual rendering width.
MFC after: 3 days
(cherry picked from commit db9bbe131c92f55e6cf03657dc030c9eea93a9fb)
vmgenc.4: Add VM Generation ID Counter manual
Document the vmgenc(4) ACPI driver which detects virtual machine
cloning and snapshot restoration via the VM Generation ID
specification. The driver reseeds the kernel entropy pool when
a generation change is detected.
MFC after: 3 days
Reviewed by: cem (previous), ziaee
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Differential Revision: https://reviews.freebsd.org/D56011
(cherry picked from commit 59cb18f35617d3a53f7d7e142b4f91ad7951f5e0)
freebsd-update: Document -v verbosity flag
PR: 276099
MFC after: 3 days
Reported by: michaelo
Co-authored-by: Alexander Ziaee <ziaee at FreeBSD.org>
(cherry picked from commit 02fd9fa2952705ea0ed142061dd86aad7e01f8db)
style.mdoc: Remove synopsis formatting advice
Remove incorrect advice. The first rule was no spaces padding pipes
when showing alternates. Almost universally we not do this, and third
party manuals do not either. The second was using Cm to mark up symbols.
This advice is in conflict with mdoc(7), and the extended documentation
on mdoc linked below, which is also linked at the bottom of mdoc(7).
Conflicting information in our docs is a natural result of documentation
proliferation. The most important thing we can do to reduce technical
debt in the documentation is reduce the amount of doc overlap. Excessive
technical debt and conflicting rules is a barrier to new contributors.
This type of work requires thorough expertise, is not glamorous at all,
and to add insult to injury, is socially unsafe. To get new contributors
to the docs project, we must deduplicate documentation.
We have the mdoc manual, examples/mdoc, style.mdoc, and the fdp chapter
on manual pages. With this many, they will inevitably come to contain
conflicting information, and people will learn not to read them or work
[7 lines not shown]
style.mdoc: Li macro is undeprecated for some time
Previously, the mdoc linter warned against using Li as it was deprecated
upstream. However, upstream undeprecated it since last year. As usual
when it comes to style, the best thing to do is to follow the existing
style of the page. We have many manuals which prefer double quotes.
MFC after: 3 days
Citation: https://cvsweb.bsd.lv/mandoc/mdoc.7?rev=1.297
Differential Revision: https://reviews.freebsd.org/D55297
(cherry picked from commit fae551b76785d2357b09e2c022a92f410d871b9b)
newgrp.1: Provide examples
"These examples appear to be originally noted thirteen years ago by
Mark Saad, contributed by eadler, put into a patch by Felix Johnson,
and made into mdoc by myself. Finally, put this bug to rest." ~ziaee
PR: 167742
Co-authored-by: eadler, ziaee, Mark Saad
Differential Revision: https://reviews.freebsd.org/D48877
(cherry picked from commit 86dc5dd0b2a861cf9d8cad18fc17c17dbbfc4465)