[RISCV] Andes: model fast unaligned accesses for the 45-series (#221166)
The 45-series cores support unaligned scalar accesses. Add
FeatureUnalignedScalarMem to each 45-series processor (andes-n45,
andes-nx45, andes-a45, andes-ax45 and andes-ax45mpv), so that it is
selected by -mcpu rather than -mtune. Other processors declare it this
way too. The feature is somewhat architectural: -mtune is only supposed
to affect performance, but reaching it through tune features lets -mtune
introduce unaligned accesses that crash on a CPU which does not support
them.
Cover this in memcpy.ll using -mcpu=andes-a45/-mcpu=andes-ax45. The new
RUN lines pass -mtune=rocket so that the 45-series scheduling model does
not reorder the output, letting them reuse the existing check lines.
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
iavf: Probe the Hyper-V VF device ID
The shared code already recognizes IAVF_DEV_ID_VF_HV and handles it
through the regular iavf register and virtchnl paths, but the PCI probe
table omits it. Add the missing entry so the driver attaches.
PR: 239849
MFC after: 1 week
[SLP][modularisation][NFC] Move getNumberOfParts, isAllowedNonPowerOf2VF (#220827)
Move the following BoUpSLP-independent type/width helpers out of
SLPVectorizer.cpp into SLPVectorizer/SLPTypeUtils.{h,cpp}:
getNumberOfParts
isAllowedNonPowerOf2VF
Both read a file-local cl::opt (SLPReVec and VectorizeNonPowerOf2
respectively). The options stay static in SLPVectorizer.cpp; the moved
helpers take their values as explicit bool parameters. Behavior is
unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
apple_bce: require usb(4) for vhci functionality
The vhci portion of the driver relies on usb(4) for both constants and
functionality. Add an explicit dependency on usb(4) in `files.amd64` so
it builds properly 100% of the time in a static kernel config.
Reviewed by: seuros
Differential Revision: https://reviews.freebsd.org/D59469
Write a legacy license record on unlicensed iX appliances
This commit adds changes to write a minimal legacy license record during upgrade on iX appliance hardware that carries no license at all, so those systems resolve entitlements as licensed hardware and future features have somewhere to be gated. Which features the record actually carries is deliberately minimal for now and a separate decision.
The record is stamped with a marker in customer_key so legacy normalization can tell it apart from a license an issuer signed, and it carries an empty HA serial so the parsed type stays ENTERPRISE_SINGLE and failover.licensed remains false.
Record what the hardware entitlement script did on upgrade
This commit adds changes to leave a record under /data of every outcome from truenas-hw-license.py, since the installer discards the script's output and a failure to write the entitlement record was previously invisible. Middleware relays it into middlewared.log on first boot and then deletes it, and only says anything when the record carries an error.
Every outcome is recorded rather than just the failures because a chassis reading as unknown is indistinguishable in the script from dmidecode having failed, so which outcomes deserve attention is better decided in middleware.
Both writes now go through atomic_write instead of a hand-rolled open with fchmod and fchown, matching truenas-nvdimm.py which already uses it from the same chroot. That also closes a window where a failed write left behind a permanent zero-byte /data/license that no later upgrade would have retried.
Distinguish system-generated license records from issued ones
This commit adds changes to record where a license record came from, since we now write one ourselves during upgrade on unlicensed appliance hardware and several consumers were treating it as though iX had issued it.
Entitlement resolution deliberately ignores the origin - a system-generated record is meant to resolve exactly as an issued one does. This only changes alerting, the unlicensed to licensed transition hook, and what we report outward to TrueNAS Connect and support.
cat: add -A, -E and -T flags
Support cat -A, -E and -T, which are commonly used by Linux shell
scripts. -E prints a "$" at the end of each line, -T renders tabs
as ^I, and -A is equivalent to -vET.
MFC After: 1 week
Discussed with: jrtc27
Reviewed by: jrtc27, ziaee
Differential Revision: https://reviews.freebsd.org/D59250
(cherry picked from commit d2cfdf4c12a76db3612c83575403150811f5aa9a)
nuageinit: root should be allowed to log in when disable_root is false
PermitRootLogin is "no" by default and that stopped root from logging in
even though disable_root was set to false during initialization.
Reviewed by: bapt
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D59101
(cherry picked from commit a209aac86882d3062318dea4971b2f728463c7e2)
nuageinit: fix ssh_pwauth string handling
Treat "no"/"unchanged" correctly instead of any non-nil value as yes.
(cherry picked from commit 8d4d5f2e8e56e7b24b50706acbdc0c8c750c6fed)
nuageinit: support allow_public_ssh_keys
Skip importing datasource public keys when set to false.
(cherry picked from commit 8f378c83c6b8b052433834ca0b53677459dc0e85)
grep(1): optimize -w/--word-regexp word boundary check
The -w option checks word boundaries before and after each potential
match by decoding the adjacent character. This was done via the
heavyweight sscanf(3) with "%lc", which goes through the full scanf
parser and locale-aware mbrtowc(3) machinery even for simple ASCII.
Replace with a three-tier fast path:
1. ASCII bytes (< 0x80): simple isalnum(3) / '_' comparison
2. UTF-8 continuation bytes (0x80-0xBF): interior bytes of a multi-byte
character are always word characters -> no further decoding needed
3. Multi-byte start bytes (>= 0xC0): decode with mbrtowc(3) directly
instead of sscanf(3)/%lc, avoiding scanf parser overhead
Benchmark with ministat(1) (10 runs each):
Worst-case ASCII (100k lines of 100 'a' chars, -w 'a'):
Difference at 95.0% confidence: -15.3% +/- 3.1%
[16 lines not shown]
grep: periodic timer-based fflush instead of unconditional per-line flush
Replace the unconditional fflush(stdout) in grep_printline and
procmatches with a periodic timer that flushes at most once every
100ms. This preserves interactive responsiveness (grep | tee,
grep | tail -f) while avoiding 1M+ write(2) syscalls when
processing large inputs.
The flush interval is tracked via clock_gettime(CLOCK_MONOTONIC)
and a static timespec. --line-buffered continues to flush
immediately via setlinebuf(3), as before.
Benchmark on 1M lines (37MB output to file):
unconditional fflush: 1.90s (sys 1.22s)
periodic 100ms timer: 0.49s (sys 0.007s)
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D57528
(cherry picked from commit ffe47c424e0a45f5d8d20a5944477821bd946eef)
[InterleavedLoadCombine] Index candidates to avoid quadratic matching (#213053)
Matching scanned every candidate against every other candidate, which
got very slow on functions with many interleaved loads. Index by address
offset and look up neighbors instead.
llc's Compile-time drops from 212s to ~2s on a Grace machine for the
test case in the issue.
[ Compile-time remains flat
](https://llvm-compile-time-tracker.com/?config=Overview&stat=instructions%3Au&remote=madhur13490)
Fixes #162299.
Assisted by Cursor.
[libc++] Implement LWG4072: std::optional comparisons: constrain harder (#209968)
Resolves #118345.
Previously, the heterogeneous comparison operators (`==`, `!=`, `<`,
`<=`, `>`, `>=`) for arguments `T` and `U` don't check that `T` or `U`
are not a `std::optional` themselves. This allowed the operators to
cause ambiguous overload resolution instead of falling back to
`optional`'s own operators, which possibly caused hard error when there
should not be a matched overload.
This patch implements the resolution by adding
`!__is_std_optional_v<_Up>` (and the `_Tp` equivalent for the reversed)
to the constraints in all twelve involved operators.
As required by the LLVM Project's AI use policy:
- The fix and test processes were revised and verified with AI
assistance.
contrib/lutok: remove autotools generated files
These files provide no value in the FreeBSD tree proper and change
frequently, depending on what machine I generate the release tarball on
(and what versions of autotools are on the host). Nuke the autogenerated
files to avoid bloating commit history/the tree.
MFC after: 3 days
Requested by: Benjamin Jacobs <freebsd at dev.thsi.be>
Revert "contrib/lutok: remove autotools and doxygen generated files"
I messed up the commit title. Redo it with a correct summary.
This reverts commit 3dbe1800848ca71f5cc083f1d5c5b4759b601fae.
contrib/lutok: remove autotools and doxygen generated files
These files provide no value in the FreeBSD tree proper and change
frequently, depending on what machine I generate the release tarball on
(and what versions of autotools are on the host). Nuke the autogenerated
files to avoid bloating commit history/the tree.
MFC after: 3 days
Requested by: Benjamin Jacobs <freebsd at dev.thsi.be>
Revert "[ELF] Omit zero-range FDEs from .eh_frame_hdr" (#221624)
Reverts llvm/llvm-project#220492
This causes the RISC-V buildbots to fail in the exception handling
tests, see https://lab.llvm.org/buildbot/#/builders/210/builds/12623 for
the gauntlet build logs
Apologies this revert is coming in so late, there is a proposed fix at
https://github.com/llvm/llvm-project/pull/221342 but it looks like it
might require additional rounds of review so reverting to get the
buildbots back to green for now
cc @MaskRay @Prabhuk
Distinguish system-generated license records from issued ones
This commit adds changes to record where a license record came from, since we now write one ourselves during upgrade on unlicensed appliance hardware and several consumers were treating it as though iX had issued it.
Entitlement resolution deliberately ignores the origin - a system-generated record is meant to resolve exactly as an issued one does. This only changes alerting, the unlicensed to licensed transition hook, and what we report outward to TrueNAS Connect and support.
Write a legacy license record on unlicensed iX appliances
This commit adds changes to write a minimal legacy license record during upgrade on iX appliance hardware that carries no license at all, so those systems resolve entitlements as licensed hardware and future features have somewhere to be gated. Which features the record actually carries is deliberately minimal for now and a separate decision.
The record is stamped with a marker in customer_key so legacy normalization can tell it apart from a license an issuer signed, and it carries an empty HA serial so the parsed type stays ENTERPRISE_SINGLE and failover.licensed remains false.
Distinguish system-generated license records from issued ones
This commit adds changes to record where a license record came from, since we now write one ourselves during upgrade on unlicensed appliance hardware and several consumers were treating it as though iX had issued it.
Entitlement resolution deliberately ignores the origin - a system-generated record is meant to resolve exactly as an issued one does. This only changes alerting, the unlicensed to licensed transition hook, and what we report outward to TrueNAS Connect and support.
Write a legacy license record on unlicensed iX appliances
This commit adds changes to write a minimal legacy license record during upgrade on iX appliance hardware that carries no license at all, so those systems resolve entitlements as licensed hardware and future features have somewhere to be gated. Which features the record actually carries is deliberately minimal for now and a separate decision.
The record is stamped with a marker in customer_key so legacy normalization can tell it apart from a license an issuer signed, and it carries an empty HA serial so the parsed type stays ENTERPRISE_SINGLE and failover.licensed remains false.