[CIR][NFC] Refactor calling convention lowering classification (#233639)
This change refactors the CIR calling convention lowering pass to move
classification into a `CIRABIClassifier` class and creates a subclass of
that to perform target-specific handling.
In order to make review easier, I have left as much code as possible in
its previous location. I'll follow up with another PR that moves
definitions into the file where is logically belongs.
Assisted-by: Cursor / claude-opus-5.5
Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux
Pull fsverity updates from Eric Biggers:
"Patches from Andrey Albershteyn to prepare for XFS fsverity support:
- Report verification errors through fserror, instead of only through
an unstructured log message and generic I/O error return
- Move the reporting of STATX_ATTR_VERITY into the VFS, so that each
fsverity-capable filesystem doesn't need to do it. This also fixes
a bug where btrfs didn't return STATX_ATTR_VERITY in
attributes_mask
- Make the VFS prevent enabling DAX on fsverity files, so that it
will be handled in a single place for ext4 and XFS
- Move ext4 and f2fs's code to read verity metadata from the
pagecache into shared code, so that XFS will be able to use it too
[13 lines not shown]
[Clang][counted_by] Don't re-evaluate the base of a counted_by pointer access for -fsanitize=array-bounds (#232228)
When indexing a 'counted_by' pointer field with -fsanitize=array-bounds,
EmitCountedByBoundsChecking was handed an invalid address and re-emitted
the field's l-value to locate the count. That re-evaluated the struct base,
duplicating its side-effects:
struct p { int count; int *buf __counted_by(count); };
struct p *q;
int f(int i) { return q++->buf[i]; } // 'q' incremented twice
int g(int i) { return get()->buf[i]; } // 'get' called twice
i.e. enabling the sanitizer changed the program's behavior.
Emit the subscript base exactly as before, but have ScalarExprEmitter
record the l-value it loads the 'counted_by' field from, and pass that
address to the bounds check. The base is emitted the same way with
and without the sanitizer, so the load keeps its debug location,
ptrauth authentication, 'align_value' assumption, and
[4 lines not shown]
Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux
Pull fscrypt updates from Eric Biggers:
"A few minor cleanups for fs/crypto/"
* tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux:
MAINTAINERS: List the fscrypt branches
fscrypt: Move several items from fscrypt_private.h to .c files
fscrypt: Use aes_ecb_encrypt() for v1 key derivation
[CIR] Fix GCC ambiguity after #232835 (#233734)
After #232835, some GCC versions fail to compile CIR due to an ambiguity
in a call to `mlir::LLVM::InsertValueOp::create`. Fix this ambiguity by
explicitly specifying the last argument.
---------
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
Co-authored-by: Akimasa Watanuki <mencotton0410 at gmail.com>
[mlir][scf] support front peeling for unsigned loop (#233238)
add front peeling support for unsigned loop and add tests.
we branch out if we have a unsigned loop, if constants we check and bail
out if the loop has at most one iteration else we compute the split
bound as `arith.minui(arith.addi(lb, step), ub)`, and they are compared
unsigned.
from #231100
claude helped me with the tests
Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull crypto library updates from Eric Biggers:
- Migrate the x86 and riscv optimized implementations of various AES
modes (ECB, CBC, CBC-CTS, CTR, XCTR, XTS) into lib/crypto/.
This makes the library APIs be properly accelerated on these
architectures, while still accelerating crypto_skcipher as well.
It removes a lot of redundant glue code, since the crypto API
boilerplate no longer needs to be duplicated for these architectures.
It also fixes the longstanding issue where optimizations for these
AES modes were disabled by default on these architectures.
- Optimize AES-XTS on SPARC64 using the SPARC crypto opcodes
- Move the SipHash code into lib/crypto/
[33 lines not shown]
[ProfCheck] Disable zero-weight elision when enabling in pipelines (#233354)
If we do not disable zero branch weight elision when
enable-profcheck-in-pipeline is set, we end up with false positives
where the verifier flags missing weights that have been purposefully
elided.
[BoundsSafety] Address review feedback on late-parsed counted_by types
Fixes for late-parsed counted_by-family type attributes:
- A block-pointer member hands its late attributes to the block-pointer chunk
instead of asserting, so Sema rejects them like a non-pointer type.
- Late-parse type attributes only in member declarators. Function-pointer
parameters, type names in `sizeof`, and other abstract declarators nested in a
member are parsed eagerly. They used to be resolved in struct scope, and a
paren that turned out to be a parameter list asserted.
- An unnamed struct hands its attributes to the enclosing record only when it's
declared directly in a record, not when it's in a statement expression.
- In declaration-specifier position, only type attributes are late-parsed.
Declaration attributes such as guarded_by are parsed eagerly again, so they
apply to every declarator.
- Reject an attribute on a function return type in the late path too.
- Complete a node whose argument fails to parse with a RecoveryExpr and mark the
fields invalid, rather than leave a CountAttributedType without a count.
- Report a rejected declaration-specifier attribute once rather than once per
[7 lines not shown]
[BoundsSafety][test] Add late-parsed counted_by type-attribute coverage
New tests exercising the late-parse fill-in mechanism:
- Sema/attr-counted-by-weird-type-positions{,-late-parsed}.c: counted_by
in assorted type positions, nested pointers, and rejection cases.
- Sema/attr-bounds-safety-function-ptr-param.c: attributes on
function-pointer-typed members.
- Modules/ and PCH/ bounds-safety-attributed-type-late-parsed: the
resolved type round-trips through serialization.
- Sema/attr-counted-by-late-parsed-regressions.c: guards against the
double-free on a nested-record decl-spec attribute and the null-count
escape on a free-function parameter.
[BoundsSafety] Don't orphan a shared counted_by node when one declarator nests it
A late-parsed counted_by-family attribute in declaration-specifier position is
shared by every declarator in the declaration, so they share one incomplete
CountAttributedType. When one declarator nests the node, as `*b` does in
`IP __counted_by(n) a, *b;`, it is rejected and the node is marked rejected.
The completion pass then skipped the node for every declarator, so `a` kept a
CountAttributedType without a count and crashed on use in
FieldDecl::findCountedByField.
Make the rejection apply to the declarator only. The parser checks and clears
the mark after each declarator, and doesn't pair a rejected declarator's field
with the attribute. The completion pass skips an attribute with no fields left,
still without parsing its argument.
Assisted-by: Opus 5.5
[BoundsSafety] Create incomplete counted_by types and wire up the refill
Activate late parsing for the counted_by family (counted_by / sized_by and
their _or_null variants) in type-attribute position, under
-fexperimental-late-parse-attributes, on top of the type-attribute handling,
the validation helper and the refill machinery added in the previous commits.
When such an attribute is seen during type construction and its argument
can't be resolved yet, build the CountAttributedType immediately with
getIncompleteCountAttributedType and record it against the enclosing record;
its count expression is filled in at the closing brace via the refill logic.
Because enclosing types refer to the node by pointer, completing it in place
leaves the type chain untouched.
[BoundsSafety] Reject a second bounds attribute on the same pointer
A pointer with two counted_by-family attributes, as in
`int *__counted_by(n) __sized_by(m) p;`, got one CountAttributedType stacked on
another. Reject the second attribute with
err_counted_by_on_bounds_attributed_type, which names both attributes.
Assisted-by: Opus 5.5
[SandboxVec][LoadStoreVec] Support constant vectors of mixed types (#224890)
`createConstantVector()` previously packed the constant store operands
as-is, which only worked when every store had the same element type.
This patch adds support for mixed type constant vectorization via the
following changes:
- `VecUtils::getCombinedVectorTypeFor()`: Compute the GCD of the
bitwidths of the chain elements. Return the type `<N x iM>` where M is
the GCD. This guarantees that all chain elements will be splittable into
equi-sized slices.
- Introduce `Constant *LoadStoreVec::getEquivalentConstantWithType` to
emit a chain of casts.
- Reinterpret each constant's bits as the combined vector type. Bail out
when a constant cannot be reinterpreted, such as a non-integral pointer
or a relocatable address that needs splitting.
Assisted by Cursor.
Fix smime and cms exit status on option parsing errors
Initialize ret to 1 before parsing options so parsing failures return
an error instead of success.
Reported by jumpifnotzero
Fix https://github.com/libressl/portable/issues/1440
ok tb@
[CIR][NFC] Add missing dependency for CIR dialect (#234042)
https://github.com/llvm/llvm-project/pull/229494 introduced a build
dependency on TargetParser in the MLIRCIR component but didn't add it as
a link component. This causes link failures when building with shared
libraries. This change adds the link component.
Add layout parameter to sharing.s3
Add a new create-time-only field to sharing.s3 `layout` that indicates
whether the specified share is used as a normal truenas S3 bucket,
which implies a certain directory structure `s3data` contains the
live data export and `.truenas_s3` contains a side tree with versions,
in-progress multipart uploads, etc. Or a "whole dataset" bucket.
Whole dataset buckets are readonly and are used for cases where
administrators wish to export existing RW NFS / SMB shares over
S3 in a readonly manner.
The configuration knob used to determine the type of bucket to
be created (and once again, this is create-time only), is the
new `layout` parameter that supports two values:
* BUCKET - a conventional S3 oriented bucket that may optionally
be exported RO via NFS / SMB
[2 lines not shown]
[compiler-rt][Darwin] Disable the armv7* sanitizer slices for watchOS
armv7* are no longer supported for watchOS, stop building them.
Co-Authored-By: Claude
rdar://182837745
[CIR] Make sure we properly set the VFS in ClangIR (#234040)
CIR pre-commit CI started failing due to #233475, which is because
ClangIR failed to set up the virtual file system. There are a handful of
locations that look about right for this, however setting it right here,
immediately after the diagnostic-handler is set, best mirrors what
CodeGenAction.cpp does.
This should unblock CI for ClangIR on the
inline-asm-backend-diagnostic.c test.
[compiler-rt][Darwin] Support building sanitizers for visionOS
COMPILER_RT_ENABLE_XROS previously only enabled builtins. Teach
config-ix.cmake about the xros/xrossim platforms so the
sanitizer runtimes are configured for them as well.
Co-Authored-By: Claude
rdar://190575578
Add the WHOLE_DATASET layout to sharing.s3
Before: sharing.s3.create always created a new dataset. The S3 service
wrote s3data/ and .truenas_s3/ on it. There was no way to serve an
existing dataset over S3. Every share and every writing task on a
bucket's dataset was refused unless it was s3data read-only.
Now:
- SharingS3Entry has `layout`: BUCKET (the default, unchanged) or
WHOLE_DATASET. The field is create-only. The update model excludes
it. The v27_0_0 and v28_0_0 models both carry it, because the
change ships in 27.0 too.
- A new `layout` column stores it. The migration is bbce11d3cbd7
under 27.0, as it ships on 27.0. Master gets a merge migration
(9a4e61c0f2d7) that joins it to the 28.0 chain. Existing rows read
as BUCKET.
- A WHOLE_DATASET create uses the dataset named in `dataset`. Nothing
is created, set or written on that dataset. A failed create does not
[26 lines not shown]
NAS-144375 / 27.0.0 / Always write INFO/version when storing an SMB share ACL (by anodos325) (#19985)
store_share_acl only wrote the INFO/version key into share_info.tdb when
the file did not exist. This fixes a regression introduced when we added
stateful failover for SMB to truenas 26 and adds test coverage.
Original PR: https://github.com/truenas/middleware/pull/19983
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
[BoundsSafety] Handle the counted_by family as a type attribute
counted_by / sized_by (and their _or_null variants) were handled as a
declaration-position attribute through handleCountedByAttrField.
Build the type during type construction instead and properly handle as a
type-position attribute. Building the node in type position also allows
the new way of late-parsing for type attributes: creates a type node
in place and fills it in once late parsing is done, which will be
enabled in the follow-up commits.
Assisted-by: Opus 5.5
initial draft of dbupdate(8) for updating (signed) zoneinfo and cert.pem
from a new cdn.openbsd.org/pub/OpenBSD/dbupdates/ directory. We can't
do this nicely with syspatch(8) because it requires patches in sequence
so a new tool had to be written. It is intentionally kept very simple
so that it can be studied because we intend to run this in root cron,
(the non-simple parts figure out quickly when not to update).
looked at by sthen beck lucas dgl