[libc][cmake] Introduce add_type_header for OS/arch-specific types. (#220750)
* Follow the existing model of `add_macro_header` and introduce
`add_type_header` which implicitly adds OS-specific and arch-specific
dependencies for type definitions;
* Since arch-specific definitions may depend on other types (e.g.
`ucontext_t` depends on `sigset_t`),
move arch-specific folder inclusion and types to the bottom of the list;
* Use `add_type_header` for only four types (so far) that require it -
`mcontext_t`, `ucontext_t`,
`loff_t`, and `struct sysinfo`. We can bulk-update everyone else, but
that might be easier to do once
we have CMake formatter in place.
[SimplifyCFG] Handle switch-to-select remapping correctly (#213302)
Simplifed `switch`es whose input a select that maps one value to
another. Handles both equal and non equal forms and also avoids a
pointless case when it would not change anything.
Fixes #202212.
tpm20: Harden the common device lifecycle
Mark the device as dying before teardown and destroy the character
device before freeing its private state or lock. This prevents cdev
methods from entering with a freed internal buffer or a destroyed sx.
Check the teardown state in command paths, honor failures from the cdev
private data interface, and publish teardown before waiting for the
lifecycle lock. Keep that lock across TPM retry delays so commands
cannot interpose and private state remains pinned, but abort before the
next retry once teardown begins.
Block new cdev operations after a successful Shutdown(STATE). Keep the
suspend gate and the TPM command under the same lock so a userspace
command cannot invalidate the saved state before S3 entry. Clear the
gate only after Startup(STATE) succeeds.
Keep entropy harvesting scheduled after a transient command or suspend
failure, but stop it while suspended or once teardown begins. Queue the
[14 lines not shown]
tpm_tis: Restore validated interrupts after resume
TIS interrupt routing and enable registers may lose their state across
S3, while the driver retains its software indication that interrupts
work. A subsequent locality or command wait can then sleep for an
interrupt that cannot arrive.
Remember whether interrupts worked before suspend and restore the
vector, pending status, and enable mask before TPM2_Startup. Put the
transport in polling mode first; the interrupt handler promotes it back
to interrupt waits only after observing an interrupt from the restored
configuration. If register restoration fails, Startup and subsequent
commands continue using polling.
Preserve the initial interrupt-enable mask, including the firmware's
trigger and polarity selection proven by the attach time interrupt test,
and restore that exact mask rather than accepting post-S3 defaults.
Program the same safe baseline for polling devices during attach and
[16 lines not shown]
[MIPS] Fix GP-relative selection after select/add combine (#215414)
## Summary
- Rewrite `$gp + select(...)` before MIPS instruction selection when a
select
arm contains a GP-relative relocation.
- Keep each `MipsISD::GPRel` attached to a selectable add operation.
- Add MIPS32 regression coverage and update the resulting MIPS64 checks.
## Background
The generic DAG combiner can transform:
select C, (add $gp, %gp_rel(A)), (add $gp, %gp_rel(B))
into:
add $gp, (select C, %gp_rel(A), %gp_rel(B))
[31 lines not shown]
tpm20: Initialize common state before testing TIS interrupts
The TIS attach path tested its interrupt by transmitting GetRandom
before tpm20_init() allocated the internal command buffer. A TPM2 FIFO
device with a usable IRQ could therefore dereference a null
internal_priv.
Initialize the common TPM2 state before running the interrupt test.
Make common cleanup safe for partially initialized devices and leave
cleanup to the attachment after tpm20_init() fails, avoiding duplicate
release of the lock, command buffer, and random-source state.
Clear the IRQ resource pointer after releasing it when interrupt handler
setup fails so the later polling-mode detach does not release it twice.
Free the internal command allocation through its object pointer rather
than relying on its embedded buffer being the first structure member.
Reviewed by: kevans
[3 lines not shown]
[SLP] Handle InsertValueInst in getVectorElementSize. (#215473)
When given an `InsertValueInst`, the `getVectorElementSize()` function
was falling back to measuring the bit width of the instruction's result
type (the aggregate type, e.g. { i64, i64 } -> 128 bits) instead of
inspecting the scalar element value being inserted (operand(1) -> 64
bits).
This leads to an overestimated element bit-width, which restricts the
calculated maximum vectorization factor and can prevent valid SLP
vectorization of chains of insertvalue instructions.
---------
Co-authored-by: Aditya-Chaudhary1 <aditya.chaudhary1 at ibm.com>
tpm20: Validate suspend and resume commands
The internal TPM2_Shutdown and TPM2_Startup paths ignored both transport
failures and the TPM response. Suspend could therefore enter S3 without
saved TPM state, while resume could restart entropy harvesting after a
failed state restoration.
Build both commands through one helper, validate their response framing
and TPM return codes, and propagate failures. Retry the standard RETRY
and TESTING responses with bounded exponential backoff. Accept
TPM_RC_INITIALIZE from Startup because firmware may already have started
the TPM during resume.
Do not enter S3 after an unsuccessful state save, and do not restart the
entropy task when TPM state restoration failed. If Shutdown fails after
the entropy task was drained, requeue it before returning so an aborted
suspend does not permanently stop harvesting.
Reviewed by: kevans
[3 lines not shown]
[flang][PPC] Implement ieee_set_status and ieee_get_status for AIX (#215618)
This patch implements the ieee_set_status and ieee_get_status for AIX
PPC. On AIX, the trap-enable bits are needed to have the correct round-trip.
Assisted-by: IBM Bob
dns/wdns: Upgrade to 0.13.0
0.13.0:
* Remove strict aliasing violations.
* Replace Python dependency with shell script.
* Fix various off-by-one errors in bounds checking.
* Various small build and test fixes.
MFH: 2026Q3
Sponsored by: DomainTools LLC
ixl: Route suspend and resume through iflib
Register the iflib device suspend and resume methods. Remove the
direct initialization from the driver resume callback because
iflib_device_resume() performs the datapath restart after the callback
returns.
MFC after: 2 weeks
Sponsored by: BBOX.io
ixv: Wire iflib suspend and resume methods
Register the standard iflib device suspend and resume methods so the
framework reinitializes the VF datapath after a system power
transition.
MFC after: 2 weeks
Sponsored by: BBOX.io
iavf: Wire iflib suspend and resume methods
Register the iflib device suspend and resume methods so the existing
driver callbacks run during system power transitions. This stops
mailbox retry work before suspend and lets iflib reinitialize the
datapath after resume.
MFC after: 2 weeks
Sponsored by: BBOX.io
axgbe: Wire iflib power management methods
Register the standard iflib device methods for shutdown, suspend, and
resume. This gives axgbe the framework managed reinitialization used by
other iflib drivers after a power transition.
MFC after: 2 weeks
Sponsored by: BBOX.io
enic: Route resets through iflib lifecycle
Mark the driver stopped after attach so its first IFDI_STOP() call
does not repeat hardware shutdown.
Defer error interrupt recovery through iflib instead of calling
driver stop and init methods from interrupt context. Let iflib own
the stop and restart around MTU changes as well, avoiding duplicate
lifecycle operations.
MFC after: 2 weeks
Sponsored by: BBOX.io
OS-8766 load_sdc_sysinfo forks cut and sed per line, adding ~850ms to every zone boot
The loop forked a subshell, cut and sed for each line of sysinfo
output, about 71 processes per call. The function runs from the zone
brand statechange hook, so every zone boot paid for it.
Measured on a compute node with an Intel Xeon Gold 6240:
load_sdc_sysinfo 842 ms -> 33 ms
statechange hook 1012 ms -> 161 ms
vmadm start to guest ready 2631 ms -> 1721 ms
Output verified identical under both bash and ksh93: 69 variables,
byte for byte.
load_sdc_bootparams and sdc_bootparams_keys below have the same
pattern and are left alone here; they were not on the path measured.
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_01XsuxyuVvHe6ro76LWLs8GP
[flang][Semantics] Accept multiple initialization of a COMMON block (#218529)
…as a GNU extension
Some compilers accept a named COMMON block variable being redundantly
initialized (via DATA statements or declaration initializers) in more
than one program unit, as a nonstandard extension, so long as every
appearance that initializes the block does so identically: the same
members are initialized to the same values everywhere the block appears.
flang currently rejects this unconditionally as a hard error, whether or
not the appearances agree.
Downgrade this to a portability warning enabled by default (matching the
behavior of the other compilers) when the initializations are
duplicates. A conflicting initialization -- a different value for a
shared member, or a member initialized in one appearance but not another
-- remains a hard error, as it has no defined, portable behavior
(compilers that accept it disagree on which appearance wins). A member
that is only indirectly initialized via an equivalenced object (rather
[24 lines not shown]
[BOLT][RISCV] Handle static IFUNC calls through .iplt (#207733)
Teach BOLT to recognize RISC-V `.iplt` as a PLT-like section and make
the RISC-V `.plt` entry size explicit. Static RISC-V binaries can use
`.iplt` entries together with `R_RISCV_IRELATIVE` relocations for GNU
IFUNC calls, while call sites reference the IFUNC symbol through
`R_RISCV_CALL_PLT`.
Allow default arguments deduction from the return type of the underlying deduction guide.
This change ensures that template parameters that cannot be deduced from constructor arguments receive appropriate default values.
[AMDGPU] Expose LDS block features to TargetParser (#220717)
Add `FeatureHalfAddressablePhysicalLocalMemory` to
`AMDGPUFrontendVisibleFeatures` so TargetParser carries them in its
per-GPU feature bitset.
18295 Add header tests to cover 18293 18294
Reviewed by: Toomas Soome <tsoome at me.com>
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Robert Mustacchi <rm at fingolfin.org>
nfscl: A few more fixes for the NFS over RDMA client glue
A couple of additional fixes for the NFS client side RDMA glue:
- For Readdirplus, the reply needs to be a large chunk, so set
M_PROTO9 instead of M_PROTO8.
- The nfsclrdma.ko module now uses xprt_rdma_unmap_chunk()
instead of xprt_rdma_rekey_chunk().
Hopefully, this is it for the NFS over RDMA client glue changes.
MFC after: 3 months
Fixes: 884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
fsck_msdosfs: add tests for lost cluster chain repair accounting
Add an ATF test suite covering Phase 3 ("Checking for Lost Files")
error accounting. Test images are created using newfs_msdos(8),
and lost cluster chains are injected directly into FAT copies at
offsets derived from the BPB. The LOST.DIR directory required by
reconnect() is constructed similarly: a root directory entry with
ATTR_DIRECTORY set and its first cluster pointing to a zero-filled
cluster containing "." and ".." entries.
The lost_chain_cleared and corrupted_lost_chain_reconnected test
cases provide regression coverage for the preceding commit:
- lost_chain_cleared verifies that clearing a lost chain (the fallback
taken when LOST.DIR is absent) exits with status 0 rather than 8
(unrecovered error).
- corrupted_lost_chain_reconnected verifies that FAT modifications
from a chain truncated by checkchain() prior to reconnection are
written back to disk, requiring "Update FATs? yes" and ensuring a
clean second pass.
[8 lines not shown]
fsck_msdosfs: fix status accounting for lost cluster chains
checklost() scans for lost cluster chains and attempts to
repair each one, first by reconnecting it to LOST.DIR,
and falling back to clearing it if reconnection fails.
However, checklost() incorrectly updates the modification
status flags (mod), which checkfilesys() relies on to
determine whether to write back changes and what exit
status to return.
The current code have three issues:
1. A reconnect() failure immediately sets FSERROR in mod
via "mod |= ret = reconnect(...)". If reconnect() failed
(e.g., because LOST.DIR is missing, or full) but the
fallback clear operation succeeds, clearchain() frees the
chain and sets FSFATMOD. However, the leftover FSERROR
remains in mod: checkfilesys() skips marking the file system
clean and exits with status 8, even though the file system was
[30 lines not shown]
Revert "devel/py-lxml: update to 6.1.3"
Requires at least newer minor version of lang/cython 3.2.9.
Reported by: fallout
This reverts commit 3dba3a5bc9a24ad56d9312a8cb2b64eeab56cb40.
[MLIR][LLVM] Avoid narrowing wide constant shift amounts (#220777)
LLVM::ShlOp::fold() used APInt::getZExtValue() to compare a constant
shift
amount against the operand bit width.
For wide integer constants whose active value exceeds 64 bits, such as
an i128
shift amount of 2^100, getZExtValue() asserts before the fold can
determine
that the shift is out of range.
Compare the APInt directly with the operand bit width using uge()
instead. This
preserves the existing behavior for out-of-range shifts, which are
currently
left unfolded, while avoiding the unsafe narrowing.
Add regression coverage for:
[4 lines not shown]