[CIR] Honor C++17 operator-call argument evaluation order (#232779)
C++17 (P0145) sequences the right operand of an assignment before the
left, even when the assignment resolves to an overloaded operator. CIR
did not apply this to non-member operators.
CIRGenFunction::emitCall now selects the evaluation order by following
faithfully OG.
The OG changes target code sharing, and for OG those should be NFC.
The new test now is mostly a copy off `CodeGenCXX/cxx1z-eval-order.cpp`
to CIR. The MS ABI RUN lines are dropped.
[GlobalISel] Honor the disable-tail-calls attribute for libcalls (#233404)
GlobalISel lowered libcalls as tail calls even when the caller had
`"disable-tail-calls"="true"`.
Check the attribute in isLibCallInTailPosition so such libcalls are not
tail called.
[CIR] Reject language address spaces in DirectToLLVM pointer conversion
Reject unlowered language address spaces in pointer types when bypassing TargetLowering. Guard pointer-producing lowerings, including generated patterns, so failed conversions report legalization failures instead of silently selecting address space zero or constructing invalid LLVM operations.
Assisted-by: Codex / GPT-6
fix: [CIR] Check only the converted pointer's address space
Limit opaque pointer conversion to its own address space and diagnose unsupported pointee types where their layout is required. Emit type-specific errors for failed pointer conversions.
Validate pointee memory conversion before deriving copy sizes, alignments, or pointer-difference strides from CIR layout. Keep deeper pointee types opaque when their layouts are not needed.
Assisted-by: Codex / GPT-6
[CIR] Propagate initializer type adjustment failures
Reject initializers whose active members have no LLVM representation, including when an enclosing union's storage type is convertible. Propagate recursive adjustment failures before querying data layout or constructing LLVM operations.
Assisted-by: Codex / GPT-6
fix: [CIR] Diagnose unsupported type conversions
Emit NYI diagnostics naming the unsupported type and include symbol context when available.
Assisted-by: Codex / GPT-6
[CIR] Propagate type conversion failures in DirectToLLVM
Propagate failed type and constant conversions through DirectToLLVM so unsupported types produce legalization failures instead of invalid LLVM operations or a void function result.
Assisted-by: Codex / GPT-6
Don't hold spa_errlist_lock while resolving errors
spa_get_errlog() held spa_errlist_lock while process_error_list()
walked the in-core error lists. With feature at head_errlog, each entry
is resolved by reading datasets, objsets, dnodes and indirect blocks
(check_filesystem() -> find_birth_txg()). If such a read fails,
zio_done() on the ZIO interrupt thread calls zfs_ereport_post() and
spa_log_error(), which both take spa_errlist_lock. The read never
completes, 'zpool status -v' hangs in zio_wait() and every later
zfs/zpool command for the pool hangs behind it, until a reboot.
Copy the entries of both lists while holding the lock, and resolve
the copies without it, as is already done for the on-disk logs, which
are processed under spa_errlog_lock only. The copy is allocated with
the lock dropped, retrying if the lists grew in the meantime.
This makes zpool_status_errlog_read_error pass.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
[2 lines not shown]
ZTS: zpool status -v with an unreadable error list block
With feature at head_errlog, spa_get_errlog() resolves the birth txg of
each entry of the in-core error lists while it holds
spa_errlist_lock. That needs reads of the damaged object's dnode and
indirect blocks. When one of those reads fails, the ZIO interrupt
thread posts an ereport and logs the error, and both take
spa_errlist_lock, so 'zpool status -v' waits forever for its own read
and every later zfs/zpool command hangs behind it.
Add a test that puts a data block of a file in the in-core error
list, evicts the file's dbufs and makes its L1 block unreadable, then
checks that 'zpool status -v' completes.
Add DBUF_CACHE_MAX_BYTES and DBUF_METADATA_CACHE_MAX_BYTES to
tunables.cfg; the test uses them to evict the dbufs without a txg
sync.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
[2 lines not shown]
networking.7: Scope netif to wlan0
I recently learned that you can restart just wlan0 instead of the entire
netif, which will save you when doing on-device networking like bhyve,
or activting wlan0 when it is booted parked via rc.conf's NOAUTO.
MFC after: 3 days
Reviewed by: bz, bcr
Discussed with: emaste
Differential Revision: https://reviews.freebsd.org/D59586
ossl.4: Canonicalize HARDWARE and add powerpc64
This driver now supports powerpc64, so add that to the list of supported
hardware. Further, rewrite that list into the canonical HARDWARE section
for inclusion in the FreeBSD 16.0 Hardware Release Note.
markj notes that it would be useful to list the CPU features required
for this driver to be usable on these platforms. ngie notes that this
would be good as a table.
Fixes: 5daf8ed625af ("Add GCM support on powerpc64/powerpc64le")
MFC after: the above was scheduled to but has not mfc yet
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D59770
pmc.perf.3: Mark only for amd64 architecture
Manual pages have an optional architecture specifier after the section
number in the document title macro. I highly recommend using it when
expedient, the extra information is available programmatically and it
uses no extra lines in the rendered page.
MFC after: No, pmc.perf.3 is not MFCing
Reviewed by: Anderson Nascimento <anascime at amd.com>
Differential Revision: https://reviews.freebsd.org/D60714
[Clang][counted_by] Don't re-evaluate the base of a counted_by pointer access for -fsanitize=array-bounds
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.
When the subscript base is exactly the field load, emit the field's
l-value once, load the pointer from it (as the default case of
EmitPointerWithAlignment does, through EmitLoadOfLValue so that a
'__ptrauth'-qualified field is still authenticated), and pass the
field's address to the bounds check. When there's an intervening cast (e.g.
[6 lines not shown]
[SystemZ][z/OS] Emit fill in HLASM output (#233056)
HLASM streamer never overrode emitFill and the MCStreamer
default does nothing, so anything that went through emitZeros or a splat
came out as no bytes at all. That meant zero initialised globals and
common symbols had no storage, and struct padding was dropped so an i64
after an i8 ended up at offset 1 instead of 8. The GOFF object path was
already fine, this just makes the HLASM text match it using DC nXL1'hh',
and it errors out past X'7FFFFFFF' since that's the GOFF limit for both
the duplication factor and the location counter. The PPA1 tests change
because the padding after the function name was missing from the HLASM
side too.
[compiler-rt] Remove dlsym interceptor and support `-shared-libsan` for CSan
Summary:
Follow the UBSan offload runtime. Offload now resolves HSA through the
global scope, so the `dlsym` interceptor is no longer needed. The real
HSA entry points are still taken from the loaded HSA library rather than
`RTLD_NEXT`, since every DSO with a static runtime exports the same
wrappers and they would otherwise chain back into each other.
Build `libclang_rt.csan.so` with the offload objects folded in. The
exported HSA wrappers report failure when HSA is absent and warn when HSA
was loaded ahead of the runtime. The preinit hook moves to a separate
`csan_offload-preinit` archive for executables.
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]
[Clang] Support `-shared-libsan` for offload CSan
Summary:
Follow the UBSan handling. The shared runtime embeds the HSA
interceptors, so `csan_offload` is only linked with static runtimes and
executables pull in `csan_offload-preinit` to initialize early.
[Clang] Add support for the `-fsanitize=concurrency` runtime
Summary:
Add the frontend sanitizer kind, function attributes, pass pipeline
integration, predefined macro, driver handling, and documentation for
ConcurrencySanitizer.