[CodeGen] Repair LiveStacks before compaction
Spill slot intervals survive between greedy runs, and their
boundaries can sit on instructions erased in between. Compaction
unlinks those entries, so the boundaries stop following renumbering
and overlapping slots can look disjoint. StackSlotColoring then
merges them, and one spill clobbers the other.
Move such boundaries onto the preceding instruction first.
dns/encrypted-dns-server: Update 0.9.21 => 0.9.22
Changelog:
https://github.com/DNSCrypt/encrypted-dns-server/compare/0.9.21...0.9.22
While here:
- Remove patch that fixes build without METRICS as it upstreamed.
- Set ETCDIR to ${PREFIX}/etc/encrypted-dns so it matches the
chroot() path in the shipped sample configuration.
- Create pkg-message.
PR: 300945
MFH: 2026Q4
lindebugfs: Do not expose a node before its private data is set
pfs_create_file(), pfs_create_dir() and pfs_create_link() link the new node
into its parent and return, and only then do the debugfs_create_*()
functions set pn_data. Between the two, the node can already be found by a
lookup but pn_data is NULL, so a concurrent stat(2) or read(2) calls
debugfs_attr(), debugfs_fill() or debugfs_fill_data() which dereference it:
a driver creating debugfs entries while lindebugfs is mounted can panic
whoever is looking at the tree at that moment. The window is only a few
instructions wide, which made it hard to hit; with a delay added on purpose
it panics at once in debugfs_attr() called from stat(2).
Changing pfs_create_*() to take the data would change the pseudofs API and
ABI. Use the visibility callback instead: pseudofs checks it before
creating a vnode for a node and before getattr, read and write, so a
node whose pn_data is not set yet is reported as not visible and lookups
return ENOENT. The data is published with a release store and read with an
acquire load, so whoever sees the pointer sees the initialized dentry_meta.
debugfs_lookup() now also returns NULL for such a node.
[4 lines not shown]
[IRBuilder] Propagate nuw/nusw flags when canonicalizing GEP (#244592)
InstCombine's GEP index-width canonicalization in
InstCombinerImpl::visitGetElementPtrInst propagates the GEP's no-wrap
flags to the cast that adjusts the index width:
nusw/nuw give trunc nsw/nuw
nusw+nuw gives zext nneg when widening
That was added in commit a71909156e5.
Recently IRBuilder::CreateGEP started to canonicalize GEPs itself.
Support for that was added in commit ede30f6ce0. However, it used
CreateSExtOrTrunc, which drops the flags. When the index type was
already adjusted by IRBuilder, InstCombine never got to apply its
flag-preserving canonicalization, so the flags were lost.
This patch makes sure IRBuilder is using the same logic as InstCombine
when adjusting the index width.
NAS-145315 / 27.1.0 / Remove SMB aapl_extensions, multichannel and streams from the API (by anodos325) (#20269)
The backend logic was removed in NAS-145310, this commit finalizes the
change by removing the API fields as well. Won't be merged until
NAS-145313 (UI change) is merged.
Original PR: https://github.com/truenas/middleware/pull/20256
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
[libc++] Remove redundant `_LIBCPP_HIDE_FROM_ABI` from detail headers j-o (#244539)
This is the third bulk-removal patch of `_LIBCPP_HIDE_FROM_ABI`. While
this is something we could do over time, actively removing the redundant
annotations significantly improves readability, and QoI.
This happens in a few patches to keep the size somewhat manageable.
[CIR] Implement relative-vtable-lookups (#243798)
This patch handles lookups from a relative-vtable. While the rest of the
relative V-table work is quite large, this ends up being pretty easy to
split up. Effectively, we now just make sure we lower to the LLVM
dialect properly for loads of a relative Vtable.
pc64,vkernel64: Prune includes in genassym.cf
In addition, remove the obsolete "opt_nfs.h" header dependency of
genassym.cf in sys/dev/virtual/nvmm/Makefile.
dwc: Limit the DMA of the QoS core to the address width of the hardware
The QoS core is used with the 64 bits descriptor address scheme, TDES1
and the *DLAR_HI registers holding the upper 32 bits. This only works
when the core was synthesized with a wider than 32 bits address bus. The
RK3568 GMAC for example has a 32 bits DMA: DMASBMR.EAME cannot be set and
the *DLAR_HI registers read back as zero. The DMA tags allowed any
address, so on systems with memory above 4GB the descriptor rings and the
mbufs could be allocated there and the core fetched descriptors and data
from the truncated addresses. Nothing could be sent or received.
Read the address width from the ADDR64 field of the MAC hardware feature 1
register, like Linux does, and limit the DMA tags to it. Memory that
cannot be reached is bounced by busdma.
Tested on a Quartz64 Model A with 8GB of RAM and on a NanoPi R5S.
Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D61018
dwc: rockchip: Do not enable the same clock twice
Some Rockchip SoCs reference the same clock from several clock-names
properties. On the RK3568 both mac_clk_tx and clk_mac_speed reference
the same clock: SCLK_GMAC0_RX_TX on GMAC0 and SCLK_GMAC1_RX_TX on
GMAC1. So if_dwc_rk_init_clocks() enables that clock twice through two
different handles.
The clk framework then considers that the clock has more than one
consumer and refuses the rate change done by rk3568_set_speed() with
EBUSY, as the clock is not glitch-free.
Only enable clk_mac_speed if it is not the same clock as mac_clk_tx.
Reviewed by: oh
Differential Revision: https://reviews.freebsd.org/D61016
dwc: Program the DMA burst length of the QoS core
dma4_init() set the 8xPBL mode bit but never wrote the programmable burst
lengths, which stay at the reset value of one beat, so the DMA engines issue
very short bursts. The TX and RX burst lengths are already parsed from the
device tree (snps,pbl, snps,txpbl, snps,rxpbl, default 8) for the older
core, use them here too.
Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D60920
dwc: Do not report a negative number of output errors with the QoS core
The good and the total transmitted packet counters are not read atomically,
so the difference can be negative when a packet completes between the two
reads. It was added to the error counter as a huge unsigned value. Only
add it when the total is larger.
Differential Revision: https://reviews.freebsd.org/D60919
dwc: Configure the AXI request limits and mixed burst of the QoS core
dma4_init() wrote the system bus mode register with only the burst length
and enhanced address bits, which left the maximum number of outstanding AXI
requests at its reset value of one and did not honour mixed burst. The
receive DMA could not keep up and dropped frames in the FIFO while the CPU
was mostly idle.
Parse the snps,axi-config node of the device tree (the maximum number of
outstanding read and write requests) with the other snps properties, and
program the limits, the hardware fields hold the limit minus one. Set the
mixed burst bit when snps,mixed-burst is present, as the eqos driver does.
Differential Revision: https://reviews.freebsd.org/D60918
dwc: rockchip: Add support for the RK3568 GMAC
The RK3568 GMAC is a DesignWare Ethernet QoS core (version 5.x), which dwc
supports since 9006a6ad1b30. Add the SoC specific code:
- Select the GMAC0 or GMAC1 GRF registers from the device address, set the
PHY interface and the RX/TX clock delays.
- Switch the RGMII speed clock according to the media (the device tree only
selects the gigabit one).
- Compute the MDIO clock range from the main clock, the CSR clock of this
core.
- Set DWC_HAS_GMAC5 so that the QoS backend is used.
eqos also matches this device, probe with a higher priority until it is
removed.
Differential Revision: https://reviews.freebsd.org/D60917
dwc: Use the MAC address from the device tree
The bootloader usually sets the Ethernet address of the device in the
device tree (mac-address or local-mac-address), but the driver only used the
address read from the hardware, or a random one if there is none.
Use fdt_ether_get_addr() right before attaching the interface, so the address
from the device tree is preferred and the one from the hardware (or generated)
remains the fallback.
Differential Revision: https://reviews.freebsd.org/D60916
clk: Do not print errors when testing a frequency
clk_set_freq() with CLK_SET_DRYRUN is used to check if a clock can
provide a frequency, for example when a mux looks for a suitable parent.
Several candidates are expected to fail, so only report an error for
real requests, or when bootverbose is set.
Differential Revision: https://reviews.freebsd.org/D61020
rk3568_cru: Allow the GMAC RGMII speed clock to reparent
The RGMII speed mux selects between the 125MHz GMAC clock and fixed
dividers of it that provide the 25MHz (100M) and 2.5MHz (10M) clocks.
Without RK_CLK_MUX_REPARENT the mux does not try its parents and the
rate request is forwarded to clk_gmac0 (and above), where it fails with
EBUSY because that clock is enabled by more than one consumer.
Mark both RGMII speed muxes as reparenting so that the rate is achieved
by selecting the appropriate fixed divider.
Reviewed by: oh
Differential Revision: https://reviews.freebsd.org/D61019
Firewall: Migration Assistant: Fallback generate an UUID when empty, to prevent duplicates if export is imported twice and some entries lack UUID (#11244)
* Firewall: Migration Assistant: Generate an uuid on export, to at least prevent duplicates if users import the same legacy export twice.
* Generate a UUID from the target_rule to make it stable across exports
* For unlikely cases, add the same uuid fallback to the legacy firewall exporter as well
Migrate to the newly imported genassym.sh and generated assym.h
* Remove the old sys/kern/genassym.sh, sys/sys/assym.h and genassym.c
files.
* Migrate the genassym.c code to genassym.cf configs for genassym.sh.
* Update all sources to include the new generated "assym.h" instead of
the old "assym.s".
* Update the kernel makefiles in sys/conf to call genassym.sh to
generate "assym.h".
* Update libc to use genassym.sh to generate "asmcontext.h".
[CIR][AMDGPU] Remove redundant __builtin_amdgcn_lerp case in CIRGen (#243235)
Removes the redundant __builtin_amdgcn_lerp case from `clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp` since EmitBuiltinExpr already lowers them automatically.
Reference PR #222204
nuageinit: Also add -n to pw usermod and pw groupshow
Commit 7e11a18e74ba ("nuageinit: Use -n with pw usershow") fixed a bug
wtih `pw usershow` and numeric user names. Fix the smae issue with
`pw usermod` and `pw groupshow`.
Reported by: llm-postcr
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61761
nuageinit: Add test for user named "0"
Commit 7e11a18e74ba ("nuageinit: Use -n with pw usershow") fixed a bug
with numeric user names. For a user named "0" we would previously look
up and return information for uid 0 (root) instead.
Add a test for this. Confirmed that the new test fails without
7e11a18e74ba.
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61759
[LLVM][Clang] Fill Windows DLL version metadata (#243543)
LLVM and Clang DLLs leave their description and original filename empty
and omit copyright information from their Windows version resources.
Fill these fields, provide descriptions for the LLVM and Clang C
interface libraries, and record each target's actual output filename.
Give each target its own resource and keep the metadata attached to that
target so library creation cannot overwrite another target's metadata.
openssl/4.1: missing endbranch annotations for *_set_{en,de}crypt_keys
Found and tested by bentley, also tested by sthen and landry, thanks!
ok bentley
sys/conf: Share compiler flags and rules between kernel and modules
* Move the common CFLAGS to bsd.kern.mk, and include it earlier in
kern.pre.mk and kmod.sh, so the flags ordering in CFLAGS is mostly
preserved.
* Clear the suffix rules and CFLAGS from <sys.mk> and explicitly define
them in bsd.kern.mk, for use in the kernel and modules building.
pc64: Remove redundant symbol exports in genassym.c
The MSR_GSBASE, MSR_KGSBASE and MSR_FSBASE are constants defined in
<machine/specialreg.h> and can be used in assembly code, so no need to
redefine them.
Caught by the new genassym.sh, whose output has different value format
(e.g., `#define MSR_GSBASE 3221225729`) and thus caused redefinition
error in compilation.
While there, remove a few commented symbols as well.
kernel: Import OpenBSD's genassym.sh tool
The new genassym.sh tool uses special inlined assembly code to create
the "assym.h" (ours named "assym.s") from constant C expressions. It
will replace the current sys/kern/genassym.sh tool, which relies on
the special macros in <sys/assym.h> and a custom CC compilation, and
will help simplify the "assym.s" generation code in kern.post.mk and
kmod.mk.
I compared the genassym.sh tool in both NetBSD and OpenBSD and found
OpenBSD version is better maintained, so I chose their version.
I placed this tool in sys/tools/ directory instead of sys/kern/; I think
the former is a better location as there are already some awk tools, and
this genassym.sh will also be used by libc.