arm64: Add exception flag for ksiginfo_t and set in trapsignal
The `ksiginfo_t` flag `KSI_TRAP` is set both for exceptions and when
copying between userspace and the kernel fails. In the latter case, the
exception syndrome register as captured in `struct trapframe` won't be
valid. That means we can't use `KSI_TRAP` to determine whether `tf_esr`
is valid. This motivates the addition of a new flag, here called
`KSI_EXCEPT`, for specifically identifying signals caused by exceptions.
It is added to `ksi_flags` via `trapsignal`.
Signed-off-by: Alex Arslan <ararslan at comcast.net>
Reported by: andrew
Pull Request: https://github.com/freebsd/freebsd-src/pull/2053
arm64: Expose ESR in mcontext
At present, the exception syndrome register (ESR) is not accessible via
the user context on FreeBSD AArch64, which makes it difficult to
determine the cause of an exception. For example, a signal handler might
get a `SIGSEGV` with `SEGV_ACCERR`, but it can't know whether that
occurred due to a bad read or write. The change implemented here
includes ESR in `struct __mcontext`, thereby allowing access via
`ucontext_t` for use by signal handlers, sanitizers, debuggers, etc.
Note that this addition consumes one of the seven spare 64-bit slots in
`struct __mcontext`.
Signed-off-by: Alex Arslan <ararslan at comcast.net>
Reviewed by: andrew
Pull Request: https://github.com/freebsd/freebsd-src/pull/2053
[InstCombine] Use copyMetadata in PointerReplacer::replace (#201827)
PointerReplacer::replace creates a new load that differs from the
original only in its pointer operand; the loaded type is unchanged. It
was using copyMetadataForLoad(), which is meant for the case where the
load's *type* changes. Since the type is the same here, plain
copyMetadata() is correct and preserves all metadata directly.
clang/HIP: Remove __ockl_fdot2 declaration
The builtin headers should not be in the business of exporting
ockl functions, and only declaring the minimum which are actively
used by the builtin headers.
bhyve(8): allow cpu pinning using N-M:X-Y ranges
bhyve's -p allows to pin guest's virtual CPU vcpu to hostcpu, however
this becomes very tedious work when you have to pin more than a single
CPU.
This allows to pass a range to -p, e.g. -p 0-3:4-7 which will pin the
cpus 0:4, 1:5, 2:6, 3:7. The ranges must be equal and the CPU numbers
must be ascending.
Sponsored by: Armenian Bioinformatics Institute
Reviewed by: corvink, markj
Tested by: bnovkov
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D54937
[SPIRV] Extend NSDI debug handling for DebugTypeFunction. (#197003)
Extend NSDI handling for
[DebugTypeFunction](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugTypeFunction).
Changes:
- Collect required types with DebugInfoFinder instead of walking
DbgVariableRecords only. This allows processing types that might not be
available in these records, and avoids code duplication for the
traversals.
- Emit DebugTypeFunction for DISubroutineType when every signature slot
maps to an emitted debug type.
- Reset per-module state in beginModule().
- Replace parallel FileStringRegs/BasicTypeNameRegs with a StringMap
OpString cache, deduplicating identical strings.
- Add LLVM DINode flag lowering for NSDI.
- Cache DebugInfoNone, OpTypeVoid and OpTypeInt32 registers to avoid
duplicate instructions.
[AArch64][GlobalISel] Add patterns for signed scalar extend intrinsics (#201617)
Follow on from https://github.com/llvm/llvm-project/pull/201546
Add patterns for signed versions of scalar extend intrinsics as well.
CodeGen: Fix CGPassBuilderOption::EnableGlobalISelOption for -global-isel=0
SET_OPTION assigned the cl::boolOrDefault into std::optional<bool>;
BOU_FALSE (=2) converts to true, so -global-isel=0 was stored as true
instead of false.
NAS-141266 / 27.0.0-BETA.1 / Restructure alert plugin to the lean typesafe layout (#19071)
## Problem
The alert plugin passed mypy but didn't follow the typesafe convention
the other converted plugins use: the eponymous `alert` service lived in
`alert.py` as an 1100-line `Service` with all logic, models, and helpers
inline, `__init__.py` was empty, and the two sibling services each
combined their service class and service part in one off-convention
file.
## Solution
- Move `AlertService` into a lean `__init__.py` that exposes only the
endpoint stubs; each delegates to plain functions in `lifecycle.py` /
`runtime.py` / `oneshot.py` / `queries.py` that take `(context, state)`.
- Lift all mutable runtime state into a dedicated `AlertState` object
(`state.py`) built once in `__init__`. Concurrency is intentionally
unchanged — it still relies on the asyncio event loop plus the existing
`process_alerts` job lock, with no new lock introduced.
- Pull the standalone pieces into `state.py`, `alert_classes.py`, and
[5 lines not shown]
rc: Bail if /dev/null is not a device
On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.
PR: 295782
MFC after: 1 week
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D57447
etcupdate: Make nobuild the default
The common case for etcupdate is to run it after building and installing
the world, in which case we already have an object directory to draw on.
Add a -b option to turn nobuild off (opposite of -B), and turn nobuild
on by default.
MFC after: 1 week
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D57306
clang: Construct toolchains with normalized triples
Avoid littering calls to normalize around by ensuring toolchains
always use a normalized triple. The test changes are due to
inconsistencies in the behavior of the triple APIs. If the arch name
is empty, normalize leaves it unchanged. If the triple is archname--,
normalize will expand the empty groups to be unknown. setArchName
will introduce the empty groups, which occurs in some of the triple
modifying driver path (mostly the handling of the endianness -m flags).
Driver is still holding onto a raw, unnormalized string triple but
leave that for a later cleanup.
Co-authored-by: Claude Sonnet 4 <noreply at anthropic.com>
[AMDGPU] Allow null operands in VImage tensor instructions (#200911)
NULL is equivalent to passing a block of SGPRs that are set to zero, and
is allowed for 3+ opnds.
[Driver] Don't warn on ObjC constant-literal flags for non-ObjC inputs (#200303)
-fobjc-constant-literals and the per-kind
-f[no-]constant-ns{number,array, dictionary}-literals flags are only
acted on for Objective-C inputs. When a build system passes them
uniformly to every source via a shared response file, they go unclaimed
on assembly and C/C++ inputs and trigger:
error: argument unused during compilation: '-fobjc-constant-literals'
[-Werror,-Wunused-command-line-argument]
Mark the options NoArgumentUnused so the unused argument is ignored
regardless of input type or whether the cc1 or cc1as path runs. The
behavior of the flags is unchanged: only the positive forms are
forwarded to cc1, and only for ObjC inputs.
rdar://175647747
webkit-gtk60: update comments, remove bmalloc patches
Since 2.52.4, the default on NetBSD is to use the system allocator,
so the NetBSD patches for bmalloc are not needed any longer.