AMDGPU: Use ArgRange for builtin constant argument range checks
Replace the manual Sema range checks of constant builtin arguments
with the new ArgRange annotation on the builtin definitions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
loader.efi: Measure boot policy and loaded contents with a TPM
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2
firmware, to extend the loader PCRs and record EV_IPL events in the
firmware event log.
Extend PCR 8 with the final kernel environment and the type, name, and
arguments of each loaded boot input. Prefix both record types with
versioned, NUL-terminated domain strings. These make the records
self-identifying and define an explicit measured policy encoding. Store
the complete measured pre-images in the event data so attestation and
diagnostic tools can audit the values without an out of band copy.
Extend PCR 9 with the initialized contents of kernels, modules, and raw
boot inputs, but record only descriptive labels rather than copying file
contents into the event log.
The Lua module table has no defined traversal order. Retain content
ranges as loader-private metadata, then sort the final file list before
[27 lines not shown]
clang/AMDGPU: Check constant argument ranges of builtins (#241584)
These builtins take a constant argument that the IR verifier range
checks on the corresponding intrinsic. Sema didn't enforce this, so
you could write code that failed the IR verifier. Use the new Range
annotation on the builtins to fix this.
This only covers builtins that previously had no range validation at
all. Builtins already checked by the manual switch in SemaAMDGPU will
be converted separately.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[docs] Add premerge check requirements to CI best practices
Premerge checks catch problems on common platforms before they land, but
there has been no written standard for what a check must provide to be
enabled and stay enabled. Add a "Premerge Check Requirements" section to
the CI best practices document so operators and the community share one
actionable reference.
The section sets targets for speed (over 90% of runs under one hour, all
runs under two hours) and reliability (false positive rate under 1%) in a
table, and lists configurability requirements: a declarative, community
editable environment definition, public infrastructure definitions in an
LLVM-owned repository, and timely review of changes to them.
The targets are aspirational. If they cannot be met consistently, the LLVM
infrastructure area team may decide to disable CI resources that are not
creating value for the community.
LLM-aided
[clang][Lex] Point header guard warnings at the macro name in #if (#242216)
For header guards written as `#if !defined(MACRO)`, the warning for a
mismatched guard points at `if` instead of the macro name.
Before:
```text
<source>:1:2: warning: 'HEADER_H' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]
1 | #if !defined(HEADER_H)
| ^~
<source>:2:9: note: 'HAEDER_H' is defined here; did you mean 'HEADER_H'?
2 | #define HAEDER_H
| ^~~~~~~~
| HEADER_H
1 warning generated.
```
After:
```text
[11 lines not shown]
tests: Improve vn_io_fault1 test
* Declare that the test needs 4 GB of memory so it can be automatically
skipped on systems with low memory.
* Switch back to mmap() as in my initial prototype. Using malloc() is
simpler, but on systems with malloc debugging enabled, malloc() will
prefault the entire buffer, resulting in a false positive. Using
mmap() also guarantees that the buffer is page-aligned, which renders
the test determinstic: we now only need to prefault exactly 2 GB, and
the difference between ret and len will be exactly the amount that we
prefaulted.
* To prefault the buffer, instead of a simple loop that writes zeroes
to it, which a compiler might recognize as dead stores and eliminate,
read the first INT_MAX bytes from the file into it.
PR: 298159
Fixes: ba02bbbe86ae ("tests: Add test for vn_io_fault1 bug")
[2 lines not shown]
[CGUpdater] `removeFunction` should not deleteBody() (#241015)
PR #94815 has CGSCC erase dead functions at the end of a CG walk, in a
batch, keeping them as defs with an unreachable body until then.
However, `CallGraphUpdater::removeFunction` (called by the Attributor)
was still calling `deleteBody`. This fixes that.
powerpc64: don't reserve the red zone on the alternate signal stack
A 64-bit signal frame is 1552 bytes; rounded up and with the 512 byte
red zone added it needs 2096 bytes, more than MINSIGSTKSZ (2048), so a
handler on a minimum size alternate stack had its frame start 48 bytes
below the stack. The red zone only exists below the interrupted code's
stack pointer, so skip it only when the frame goes on that stack.
A handler on a MINSIGSTKSZ alternate stack overwrote the 48 bytes below
it; the frame stays within the stack now.
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61519
[HLSL] Change HLSL default language version to 2021 from 202x (#242503)
Change HLSL default language version from 202x to 2021. Update tests
which broke. Don't emit the "use 202x" warning for language versions
2021 anymore.
zpool-offline.8: fix missing punctuation
Sponsored-by: ConnectWise
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alan Somers <asomers at gmail.com>
Closes #19878
[scudo] Add DoubleFreeFromSecondary death test (#242398)
Complement DoubleFreeFromPrimary with a death test verifying that
double-freeing a cached secondary allocation fails with "invalid chunk
state" (or faults under MTE, which marks cached secondary entries
MAP_NOACCESS). Guard the test on configurations with an active secondary
cache, since uncached blocks are unmapped on the first deallocate() and
fault when loading the chunk header instead.
Also remove an unused condition_variable.h include.
Used Gemini to review my change.
CI: fetch source matching the FreeBSD image kernel
FreeBSD snapshot images can outlive their src.txz archive. If it is
missing, fetch the running image's kernel revision from the official
FreeBSD source mirror. Require an empty destination before extracting
the fallback archive.
Assisted-by: OpenAI Codex
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: ooonea <ooonea at gmail.com>
Closes #19876
G/C the curpcb global on m68k. It's redundant (the current PCB can always
be accessed via the current LWP) and its presence means wasted work in
cpu_switchto().
For cases where asm code does need to get to to it, add a GET_CURPCB()
macro that places curlwp's PCB pointer into the specified register.
[bazel] Add subpackages for libc/hdr/... (#242520)
This PR creates subpackages for `libc/hdr/...` as part of
https://github.com/llvm/llvm-project/issues/238076.
The refactor was entirely generated by a one-off tool
[jtstogel/bazel-move-targets](https://github.com/jtstogel/bazel-move-targets)@1e51f7f
(LLM-written), since AFAICT there's no good standard tooling for this
kind of thing.
Generated by:
```
function new-pkg() {
pkg=$1
shift
bazel-move-targets move \
--workspace_root=utils/bazel/llvm-project-overlay \
--src_package=libc \
[9 lines not shown]
textproc/py-rst2ansi: unbreak py-b2 after py-docutils 0.22.4
The contributed patch includes the change I proposed and also fixes
a Python 3.14 issue.
The patch backports two fixes from upstream master:
- 81758ed drops the unused docutils.utils.error_reporting imports
(upstream issue #16), the same fix as attachment 274652
- 3728e16 passes an 8-byte struct winsize to the TIOCGWINSZ
ioctl in rst2ansi/get_terminal_size.py; Python 3.14 rejects
the old 4-byte
buffer with SystemError (upstream issue #18)
Also update pkg-descr and switch to pep517.
PR: 298414
Approved by: PopularMoment at protonmail.com (maintainer)
Obtained from: Patrick Crandol
textproc/py-rst2ansi: unbreak py-b2 after py-docutils 0.22.4
The contributed patch includes the change I proposed and also fixes
a Python 3.14 issue.
The patch backports two fixes from upstream master:
- 81758ed drops the unused docutils.utils.error_reporting imports
(upstream issue #16), the same fix as attachment 274652
- 3728e16 passes an 8-byte struct winsize to the TIOCGWINSZ
ioctl in rst2ansi/get_terminal_size.py; Python 3.14 rejects
the old 4-byte
buffer with SystemError (upstream issue #18)
Also update pkg-descr and switch to pep517.
PR: 298414
Approved by: PopularMoment at protonmail.com (maintainer)
Obtained from: Patrick Crandol
clang/AMDGPU: Check constant argument ranges of builtins
These builtins take a constant argument that the IR verifier range
checks on the corresponding intrinsic. Sema didn't enforce this, so
you could write code that failed the IR verifier. Use the new Range
annotation on the builtins to fix this.
This only covers builtins that previously had no range validation at
all. Builtins already checked by the manual switch in SemaAMDGPU will
be converted separately.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>