Thread Safety Analysis: Fix implicit member access in attributes (#194457)
SExprBuilder previously translated DeclRefExprs referring to FieldDecls
as plain global references (til::LiteralPtr), ignoring the base object.
This caused false positives when members were accessed implicitly (such
as in C, or parameter attributes in C++) because the context of the
parent object was lost.
Fix this by using translateCXXThisExpr() to evaluate SelfArg into a base
expression when translating a DeclRefExpr to a FieldDecl. This makes the
analysis behave correctly for implicit member accesses in attributes.
Assisted-by: Gemini 3 (for debugging and review)
[AArch64][llvm] Add missing form for `LD64B`/`ST64B` instructions
`LD64B` and `ST64B` should be defined as follows[1]:
```
LD64B <Xt>, [<Xn|SP> {,#0}]
```
but they're missing the form that allows a zero immediate offset,
for example:
```
ld64b x2, [x13, #0]
st64b x16, [x13, #0]
```
Add support for zero immediate offsets for these instructions.
[1] https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/LD64B--Single-copy-Atomic-64-byte-Load-
etcupdate: fix arguments order of diff command
Due to misplacement of the second -L argument of diff command, it is
treated by getopt_long as an error.
Also add -l option for a diff command that alters the way it shows
differences. Instead of printing full diff, it reports changed file
the same way as added/removed files are reported.
Reviewed by: imp
Obtained from: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D56708
(cherry picked from commit 6d65c91b9a4743bbffc3508bf754e68b65bbd494)
[libc++][NFC] Remove unused #define (#195831)
We've removed the use of
`_LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE` a while ago, but
didn't remove the `#define` for it.
etcupdate: fix arguments order of diff command
Due to misplacement of the second -L argument of diff command, it is
treated by getopt_long as an error.
Also add -l option for a diff command that alters the way it shows
differences. Instead of printing full diff, it reports changed file
the same way as added/removed files are reported.
Reviewed by: imp
Obtained from: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D56708
(cherry picked from commit 6d65c91b9a4743bbffc3508bf754e68b65bbd494)
bufspace_wait(): only try to help bufdaemon if there is a chance to help
Only call buf_flush() if there are some dirty buffers belonging to the
vnode we are allocating the buffer for. Otherwise the bd dirty queue
scan cannot find anything and it makes no sense to spend CPU doing it.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
[MLIR][SPIRV] Spell strict assembly properties directly
SPIR-V strict property assembly currently uses prop-dict for FunctionCall and
GraphConstant. Both operations have small inherent attributes that can be
covered directly by the declarative assembly format.
Spell FunctionCall arg/result attributes and GraphConstant IDs in the format,
and update tests to use the direct syntax instead of a property dictionary.
Assisted-by: Codex
[libc] Add generic cpp::byteswap to CPP/bit.h (#196274)
Added a constexpr byteswap template using recursive half-swap
decomposition. Accepts all integral types, matching C++23 std::byteswap
semantics. Signed types delegate to the unsigned path via static_cast,
which the compiler elides entirely.
A single recursive template handles all sizes from 8 to 128 bits with no
per-width specialisations or builtin fallbacks needed. Produces optimal
bswap/rolw instructions on Clang at -O2. A static_assert rejects types
larger than 128 bits.
Refactored endian_internal.h to call cpp::byteswap directly, replacing
the explicit template specialisations and builtin dispatch.
Assisted-by: Automated tooling, human reviewed.
devel/llvm-{cheri,morello}: Remove obsolete patch
Both llvm-cheri and llvm-morello have been upgraded to LLVM 17 so we
don't need LLVM 15 patches.
Sponsored by: DARPA, AFRL
Improve path_calc_hash()
Includes other attributes into the hash calculation and also adjust
the the span of hashed elements of struct rde_aspath to exclude
aspa_generation. On top of this reshuffle the siphash calls to
work on 64bit values first and only then other sizes.
OK tb@
linuxkpi: Implement `module_*()` APIs as static functions
This fixes an "unused variable" warning when building DRM drivers.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780
(cherry picked from commit 658bb99db9c7872f92ccb86ed2674c72636436d2)
NAS-140922 / 27.0.0-BETA.1 / improve VMFlags (#18909)
`vm.flags` previously fork+exec'd `lscpu` and regex-parsed its output to
detect the CPU vendor. Replace that with a single read of
`/proc/cpuinfo`
via the existing `cpu_info()` helper, which already opens the file for
`cpu_model`.
Changes:
- `middlewared.utils.cpu.CpuInfo` gains `vendor_id: str | None` and
`cpu_flags: tuple[str, ...]`. Both are populated in the same
`/proc/cpuinfo` pass that already read `model name`.
- `vm_flags()` now reads from `cpu_info()` instead of `lscpu`. With no
subprocess to await, the function is synchronous.
- `amd_rvi` was previously set to `True` on every AMD CPU regardless of
capability. It now correctly reflects the `npt` feature flag.
- `vm.supports_virtualization` and `crud.py`'s validator call
`kvm_supported()` directly instead of going through a one-line wrapper.
[2 lines not shown]
[MLIR][NVVM] Spell strict assembly properties directly
NVVM strict property assembly currently uses prop-dict for many ops. Some of those formats already bind every inherent field, and a few small groups can spell their inherent attributes more naturally in the assembly syntax.
Spell the transcendental ftz flag, redux abs/nan flags, cluster aligned flag, and the small fence attributes directly. Drop prop-dict from formats whose inherent fields are now fully covered by the declarative format.
Assisted-by: Codex
[BOLT][AArch64] Update error messages for X86-specific passes (#196200)
Update error messages with "is specific to X86" wording on passes that
are functionally X86. Update unsupported-passes.test to match the new
wording.