[NFC][msan] Deduplicate stack-based VarArg helpers (#243183)
As for now, the VarArgHelper classes for the i368, PowerPC64 and generic
implementation use the same va_args handling model relying on the
arguments being place in stack memory in their natural order.
This patch introduces VarArgStackModelHelperBase class used to
deduplicate the va_list shadow handling in the described case.
Follow-up to the discussion in #211339
[test][CodeGen] Precommit MachineOutliner test for nomerge instructions (#245434)
Precommit a reduced -enable-machine-outliner test showing current
MachineOutliner behavior on trap blocks ending in a nomerge
@llvm.ubsantrap call.
Assisted-by: Gemini
StripDeadPrototypes: Preserve function analyses
Only unused declarations are deleted, which does not affect the
analyses of any remaining function. Also report a change when only
global variable declarations are deleted. This doesn't do much since
it's not in the default pass pipeline but I want to cover all the
passes.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
NAS-145417 / 27.1.0 / Add conftest.py for tests/vm (by bmeagherix) (#20301)
tests/vm had no conftest, so nothing prepared the server before the
tests ran: SSH password login was never enabled and the default pool was
never created.
Use the same session setup as tests/cloud.
Original PR: https://github.com/truenas/middleware/pull/20300
Co-authored-by: Brian Meagher <brian.meagher at truenas.com>
[VPlan] Get IV from condition load GEP for EE with stores. (#245797)
handleUncountableExitsWithSideEffects assumed the first header phi is a
VPWidenInductionRecipe, asserting if a reduction phi comes before the
IV. Use the index of the condition load's GEP instead.
[NFC][Clang][CodeGen] Factor out EmitCFICheckFailStaticArgs (#245505)
Deduplicate construction of {CheckKind, SourceLocation, TypeDescriptor}
static argument arrays across CFI vtable, indirect-call, and
member-pointer
checks into CodeGenFunction::EmitCFICheckFailStaticArgs.
Assisted-by: Gemini
[NFC][Clang][CodeGen] Factor out EmitCheckStaticData (#245504)
Deduplicate construction of private unnamed_addr UBSan static descriptor
globals across EmitCheck and EmitCfiSlowPathCheck into
CodeGenFunction::EmitCheckStaticData.
Assisted-by: Gemini
[KnownFPClass] Add `KnownFPClass::sinpi/cospi` (#242696)
Add KnownFPClass::sinpi and KnownFPClass::cospi, and use them in
ValueTracking when extracting results from llvm.sincospi. Infer that
non-subnormal inputs produce non-subnormal sine results and that cosine
results are never subnormal, except for PPCDoubleDouble types.
Fixes #225014
evdev: Map the HP mic mute and programmable keys on HP only
AT scan codes 0xE0 0x01 and 0x68 are vendor keys: systemd's hwdb gives
them other meanings on Dell, Alienware, Lenovo, Samsung and others,
some of which send no release code. The shared AT table made Insert
toggle mic mute on an IdeaPad 5 and left KEY_PROG1 held after the Dell
G-Mode key.
Map them only where SMBIOS names an HP business laptop, as hwdb does:
0xE0 0x01 to KEY_MICMUTE on ZBook, EliteBook, ProBook, Elite Dragonfly
and EliteBoard, 0x68 to KEY_PROG1 on the Elite Dragonfly G2 and the
ZBook Ultra G1a.
Reported by: llm-postcr
Reviewed by: imp, wulf
Approved by: wulf
Fixes: d34baf1b5ca0 ("evdev: Map the HP mic mute and programmable keys")
MFC after: 1 week
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/130
[Sparc][MC] Use CoerceFromRegClass instead of validateTargetOperandClass (#245073)
Use CoerceFromRegClass for IntPair, DFPRegs, QFPRegs (via an
unallocatable CanonicalFPRegs class), and CoprocPair. This allows us to
remove SparcAsmParser::validateTargetOperandClass completely.
The main change needed here is that O6_O7 and I6_I7 now use primary
AsmNames "sp"/"fp" (matching O6/I6) so that the tablegen coercion works.
The functional diff is that ldd/std with %o6/%i6 prints %sp/%fp, but
that matching all other SPARC instructions. To avoid any difference,
"%o6"/"%i6" are parsed explicitly in matchRegisterName instead of
relying on accidental IntPair matching + canonicalization.
Assisted-by: AI tooling
[AVR][MC] Avoid mutating operands in validateTargetOperandClass (#245076)
Avoid mutating AVROperand inside validateTargetOperandClass (which can
result in subtle matching bugs, and will no longer be possible once we
make the argument const). This moves the bare register number to reg
conversion to a custom render method.
AVROperand now keeps a pointer to MCRegisterInfo since toDREG needs it
for getMatchingSuperReg. Also bail out early when Expected is not a
register class: the previous mutating code caused extra immediate
operands in 0..15 to be misdiagnosed as invalid registers on avrtiny.
Assisted-by: AI tooling
Annotation2Metadata: Preserve function analyses (#245788)
Only !annotation metadata is added, which does not affect any function
analyses (and probably would never?)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Add conftest.py for tests/vm
tests/vm had no conftest, so nothing prepared the server before the
tests ran: SSH password login was never enabled and the default
pool was never created.
Use the same session setup as tests/cloud.
(cherry picked from commit badc8468c174184d7bb8bc9f3fe16cae0a180d8c)
NAS-145417 / 28.0.0-BETA.1 / Add conftest.py for tests/vm (#20300)
tests/vm had no conftest, so nothing prepared the server before the
tests ran: SSH password login was never enabled and the default pool was
never created.
Use the same session setup as tests/cloud.
[APFloat] Canonicalize PPC double-double infinity in scalbn (#242965)
## Summary
Fix `scalbn` producing non-canonical infinities for PPC double-double
(`ppc_fp128`) values.
Previously, `DoubleAPFloat::scalbn` scaled the high and low components
independently. When the high component overflowed to infinity while the
low component remained finite, the result retained a nonzero low
component.
For example:
```text
scalbn((2^1000, -2^10), 100)
```
Previously produced:
[17 lines not shown]
[ValueTracking] Add intrinsics to canIgnoreSignBitOfNaN (#242719)
Adds additional floating point intrinsics to `canIgnoreSignBitOfNaN`.
AI Disclosure:
I used Claude Opus 5.5 to help write the tests.
NAS-145364 / 28.0.0-BETA.1 / middleware: strengthen path handling (#20280)
Paths that an unprivileged user may control are opened with safe_open,
safe_open_raw and safe_makedirs from truenas_os_pyutils, which refuse a
symlink anywhere in the path, and a FIFO, socket or device node before
opening it.
- rsync: create and chown ~/.ssh/known_hosts through symlink-refusing
fds; cap the known_hosts read at 4 MiB
- ssh-keyscan: pass "--" before the host
- user: read authorized_keys with safe_open, capped at 1 MiB; unlink it
through a symlink-free .ssh fd
- filesystem.mkdir: chmod, rmdir and listxattr through fds; compare .ssh
by component
- NFS: refuse export paths that exportfs would rewrite
- nvmet: a FILE namespace must be a symlink-free regular file in a data
pool
- SMB: path_suffix and dataset_naming_schema must stay beneath the share
- filesystem.set_zfs_attributes: callers without FULL_ADMIN are limited
[29 lines not shown]
sysutils/samdruckerclientshell: Update to 0.3.2
The client is one script again. samdrucker.repo-to-json.stdin, which
converted the pkg repos output to JSON, has been folded into
samdrucker.sh, which now runs that Lua itself with flua -e. The helper
is no longer installed.
What the client sends, and how it reports a failed check-in, are
unchanged. It still needs /usr/libexec/flua from the base system (the
FreeBSD-flua package on pkgbase hosts).
0.3.1 was tagged upstream before these changes were committed, so it
was the same code as 0.3.0.
Release notes:
https://github.com/dlangille/SamDrucker/releases/tag/0.3.2
www/samdruckerweb: Update to 0.3.2
On a package page, the Versions table now says what each link lists.
The host count beside a version links to the hosts on exactly that
version (new ?version= filter, kept by the downloads), and the
older-than link shows how many hosts it will list, for example
"73 hosts older than 0.3.0_1", or "none" on the oldest version.
Before, the link beside the oldest version read "hosts older than this"
and listed no hosts, which looked like a bug.
0.3.1 was tagged upstream before this change was committed, so it was
the same code as 0.3.0. No database changes.
Release notes:
https://github.com/dlangille/SamDrucker/releases/tag/0.3.2
Add conftest.py for tests/vm
tests/vm had no conftest, so nothing prepared the server before the
tests ran: SSH password login was never enabled and the default
pool was never created.
Use the same session setup as tests/cloud.
Include STLExtras.h for the range helpers
foldInlineAsmMemOperands uses is_contained, min_element, drop_begin,
and enumerate from STLExtras.h, which the file got only through other
headers.
Assisted-by: Claude Opus 5.5