[GlobalISel] Preserve cache hint metadata through IRTranslator (#224522)
Preserve cache hint metadata when lowering from IR to gMIR. Supports
loads/stores atomic loads/stores, atomicrmw, cmpxchg, memcpy, memmov,
and memset and target memory intrinsics.
Skip autotrim on vdevs without TRIM support (#20022)
With autotrim enabled, metaslab_sync_done() collected all frees into
ms_trim, and vdev_autotrim_thread() periodically disabled and enabled
every metaslab, swapping and walking those trees, even when none of
the vdev's leaves supported TRIM.
Signed-off-by: Alexander Motin <alexander.motin at truenas.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
sysrc: Add "unchanged" messages
When a value would not change, emit a message indicating such. This
aligns with sysconf which does the same thing.
While here, add missing loop hygiene; unset loop variables after loop
to avoid potential later misuse.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61742
sysrc: Support special characters in file names
Previously, passing -f "abc'123" (for example) would break sysrc.
Support special characters such as single-quote, double-quote,
dollar sign, backtick, asterisk, and more.
It was previously impossible to handle file names with glob
characters. If you absolutely need to use a glob to expand a list
of potential files for `-f' you can still do it in two ways:
sysrc -f "$( echo glob )" ...
RC_CONFS=$( echo glob ) sysrc ...
While here, clean up trailing whitespace on 3 lines.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61740
sysrc: Accept values that contain a newline
awk -v rejects a newline in the value, and the old writer treated that
failure as an empty edit. The temporary file then held only the new
assignment, so the rest of the configuration was lost.
Pass the value in the environment and replace the last assignment by
joining that line through end of file. A quoted newline stays with the
value, and the text after it stays after the closer. If awk exits
above 1, leave the file alone. sh -n still refuses a value that would
break the quotes.
PR: 283729
MFC after: 2 weeks
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61743
sysrc: Send -c output to stderr instead of stdout
This aligns with sysconf's `-c' while also adding a default output of
`value differs' (suppressed with `-q').
While here, replace f_err with warn() where appropriate.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61741
sysrc: Change -l/-L to list files one per-line
This makes -l and -L consistent with sysconf target -l/-L such that:
sysconf rc -l # or -L (in turn calls sysrc -l or -L)
sysconf lo -l # or -L (lo valid short-hand for loader)
similarly produce one file per-line. This is instead of the former
behavior where sysrc -l/-L (and thus sysconf rc -l/-L) produced one
long line with each path separated my a single space.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61739
sysrc: Fix -e output
The sysrc(8) man-page states that `-e' is used to "print query results
as sh(1) compatible syntax".
Flags such as `-v' when combined with `-e' could make the output
incompatible with sh(1).
This is a breaking change that should not be MFC'd because it both
alters certain output formats and also fixes a bug that others may
have relied upon. When changing value of an existing variable, the
`-e' output would produce syntax that would revert the change:
$name="$before" # -> $after
This change improves the output of `-e' to:
_$name="$before" $name="$after"
[29 lines not shown]
sysrc: Add more sanity checks
Potentially a breaking change for some folks. MFC discouraged.
This aligns sysrc with the same sanity checks performed by sysconf.
It reduces the chance of POLA violations when people use `sysconf rc'
(where sysrc is hooked into sysconf as the rc target provider).
However, some shell scripts calling out to sysrc may have relied on
some of the leniency that is now cause for exit. For example, using
`-x' with assignments (such as `sysrc -x foo=bar' which now generates
the error `-x does not take a value' -- the same error produced when
you try `sysconf loader -x foo=bar').
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D61735
[SampleProfile] Match stale profiles inside eliminated inline frames
An inline frame can survive after its standalone Function is deleted.
Recovering its root profile is not enough when probe locations inside that
frame have changed: the existing matcher visits surviving functions and
otherwise represents inlined code through the outermost call site.
Collect frame-relative anchors during the existing instruction scan and
match eliminated functions with the existing stale-profile matching algorithm.
Prefer a surviving definition when one exists, require an available mismatched
probe descriptor for probe-based matching, and resolve known MD5 callee names
before the matching loop.
Share selective inline-root retrieval with the matcher, including cases where
caller locations disagree or the outer function has no root profile. Permit
annotation of a known checksum mismatch only when a location map is available;
retain the definition and call-count checks for sample reuse.
This is the stale-location extension split from the basic profile-recovery
[5 lines not shown]
[SampleProfile] Split stale inline-frame matching into a follow-up
Keep the basic inline-profile recovery in #245375 and move the stale-location
extension into a separate stacked change. Preserve selective root discovery,
nested-profile preference, missing-outer-frame handling, and the definition,
call-count, zero-head, and available-checksum checks.
Restore the existing stale-profile matcher, remove matching-only retrieval
policy and location-map accessors, and reject known checksum mismatches in
root fallback. Move the synthetic moved-probe tests with the extension while
retaining the basic recovery and negative checksum tests.
This commit is directly on top of 76cd07eceb984b3c248387a1c8f6ee0e891e7343,
so the published recovery commit does not need to be rewritten. The stacked
follow-up restores the original combined source tree exactly.
Assisted-by: OpenAI
gve: Propagate m_pullup() mbuf changes in gve_prep_tso()
gve_prep_tso() uses m_pullup() via PULLUP_HDR() to make protocol headers
contiguous in the first mbuf, but both gve_prep_tso() and
gve_tx_fill_ctx_descs() take struct mbuf * by value:
- When m_pullup() allocates a new head mbuf (freeing the old head), the
new chain is leaked and callers continue reading, copying, and later
freeing the freed mbuf pointer.
- When m_pullup() fails, it frees the chain and returns NULL, leaving
callers with a dangling non-NULL pointer that gve_xmit_br() frees a
second time on EINVAL.
- In DQO-RDA mode, gve_xmit_dqo() calls gve_map_mbuf_dqo() before
gve_prep_tso(), leaving the DMA map pointing at pre-pullup buffers
without the updated th->th_sum.
Additionally, gve_prep_tso() pulls up sizeof(struct tcphdr *) (8 bytes)
instead of sizeof(*th) (20 bytes), and gve_xmit_br() falls through to
BPF_MTAP(ifp, NULL) and a doorbell write when a transmit helper frees
[25 lines not shown]
[CIR] Support ConstantExpr GLValues and subexpression fallback in ScalarExprEmitter (#242234)
### Description
This patch adds support for `ConstantExpr` GLValues and subexpression
fallback in `ScalarExprEmitter::VisitConstantExpr`, establishing parity
with classic Clang CodeGen
(`clang/lib/CodeGen/CGExprScalar.cpp:516-530`).
In ClangIR, evaluating a `ConstantExpr` GLValue in an RValue scalar
context (such as returning or loading a scalar from a `consteval`
function returning a reference: `int test_load() { return get_ref(val);
}`) previously caused `errorNYI: ScalarExprEmitter: constant expr GL
Value`, while a null result from `tryEmitConstantExpr` failed with
`errorNYI: ScalarExprEmitter: constant expr` rather than delegating to
the subexpression.
This change:
1. Creates the pointee LValue via `makeNaturalAlignPointeeAddrLValue`
[12 lines not shown]
[TBAA] Preserve tags when an access ends within a field (#243670)
Allow `AAMDNodes::adjustForAccess `to derive a `!tbaa` tag when the
requested access ends inside a `!tbaa.struct field`. The correct check
for `adjustForAccess` is that if all struct fields in [0, accessSize)
carry the same scalar access tag, then you can derive that scalar access
tag for the whole sub-access. This doesn't change if the access ends
inside a field.
In the added test, an 8-byte `memcpy` copies a `long`. SROA splits this
into two 4-byte loads. The first 4-byte load previously did not receive
the `long` tag because it ended half-way through the `long`. The second
4-byte load did receive the `long` tag because the load is at a 4-byte
offset, so the `!tbaa.struct` metadata is first shifted 4 bytes so that
it looks like `!0 = !{i64 0, i64 4, !1}` and then the 4-byte access does
not end inside a field.
build: let RECIPE pull configurations from git #529
Revisiting previous it looks like we can just pull a configuration
from git. Make this true for ports.conf and plugins.conf and
unify some of the necessary code.
All we need for this is TOOLSTAG, which already works for 26.7.10
because there is a tag for it.
make.conf is a bit harder, but definitely not impossible.
[SPIRV] Lower llvm.sincospi to OpenCL.std sinpi and cospi (#231761)
llvm.sincospi failed instruction selection for SPIR-V. It now lowers to
OpenCL.std sinpi and cospi, emitting only the results that are used and
typing them from the argument; shaders and types OpenCL.std does not
define for these instructions get a diagnostic.
Split out of #218641.
This PR was generated using AI
---------
Co-authored-by: Marcos Maronas <mmaronas at amd.com>
libvmmapi/amd64: Add support for CPUID ioctls to libvmmapi
libvmmapi needs wrapper functions for the new vmm/amd64 CPUID ioctls.
Reviewed by: corvink, markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51554