apple_smc: classify DTS vs absolute temperature sensors at attach
Intel DTS (Distance-to-Tj,max) sensors expose negative millidegree offsets
via sp78 keys. On iMac14,1 (Haswell desktop) TC0E, TC0F, TH1F etc. all
read ~-66000 mC at idle while being valid CPU temperatures when decoded as:
actual = Tj,max + dts_offset
Previous code put all sp78 keys in sc_temp_sensors[], exposing raw -66°C
readings as garbage temperature values.
Changes:
- Read Tj,max from MSR_IA32_TEMPERATURE_TARGET (0x1A2) bits[23:16] at
attach; default 100°C for machines without the MSR or pre-Sandy Bridge
- Probe-read each sp78 key at enumeration time and classify:
- <= -120000 mC: disconnected sentinel (0x8000/0x8100 family) — drop
- < -10000 mC: DTS sensor — store in sc_dts_sensors[]
- >= -10000 mC: absolute sensor — store in sc_temp_sensors[]
- Register DTS sensors under dev.apple_smc.0.temp.dts.<key>, decoded to
[8 lines not shown]
Zstd: rework ZSTD_isError symbol renaming
The import of Zstd v1.5.7 in a2ac9cd606ce2428c23cc89cec6f0392424e82c9
added an unconditional renaming of ZSTD_isError to zfs_ZSTD_isError
with an asm directive. Instead, do it with a define that is conditioned
on whether zstd_compat_wrapper.h is actually in use. Also add a define
to that header so that it can be detected. This allows the build to
work without using the compat wrapper.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ryan Libby <rlibby at FreeBSD.org>
Closes #18483
linux: verify stale znodes in legacy fallocate
The mode=0 and FALLOC_FL_KEEP_SIZE preallocation path can reach
zfs_freesp() directly and call zfs_statvfs() before going through the
normal zpl_enter_verify_zp() boundary.
When zfs_rezget() tears down a failed SA reload, a stale inode may
remain alive in the VFS with z_sa_hdl cleared. The unchecked
fallocate path can then reach sa_lookup(zp->z_sa_hdl, ...) through
zfs_statvfs() or zfs_freesp() and crash on a NULL SA handle.
Use zfs_enter_verify_zp() in zfs_statvfs() so stale znodes are
rejected under the teardown lock for both fallocate and statfs.
Also wrap the direct zfs_freesp() call in
zpl_enter_verify_zp()/zfs_exit() so this path follows the same
validation rules as the other Linux ZPL file operations.
Fixes: f734301d2267
("linux: add basic fallocate(mode=0/2) compatibility")
[4 lines not shown]
[modulemap] Fix module build after #189515 (#196106)
Mark newly added `.def` file as textual header to fix module include and
module cycle issue. Also added a missing CMake analysis_gen dependency
that might cause build failure.
[lit] [compiler-rt] Add llvm-lit global command cache to speed up test config (#195888)
Compiler-rt lit test discovery takes quite a while on Darwin (i.e. the
time from when you launch llvm-lit to when the first test runs can be
minutes for check-compiler-rt). This appears to be mostly due to
subprocess calls during test configuration.
This adds a memoized command-runner to llvm-lit, so that lit.cfg.py
scripts can re-use the result of feature-detection commands when running
multiple test suites at once. I've adopted it for several subprocess
calls in compiler-rt.
rdar://175893448
lockf: Avoid spinning when operating on an fd
When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.
Approved by: re (cperciva)
PR: 294832
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56722
(cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
(cherry picked from commit 651b82e64ef4f753d8f4c1793f359de39744526c)
tail(1): Fix -r (reverse) to work on pseudo filesystems
Pseudo filesystems (e.g., procfs) advertise a zero file size.
Fix reverse() to handle such a case similarly as forward() so
that '-r' works on pseudo filesystems.
Approved by: re (cperciva)
Signed-off-by: Aaron LI <aly at aaronly.me>
Reviewed by: pouria, Ricardo Branco <rbranco at suse.de>, des
Fixes: 1fb3caee7 ("tail: Do not trust st_size if it equals zero.")
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2080
(cherry picked from commit 4feeca3193c316c18472cd40f215446fda3bd739)
(cherry picked from commit 771a65210018c68198ea413df10225e87a0ea909)
vt_core: don't draw the splash if a panic occurred
The shutdown splash draws over all the useful info if ddb(4) is
disabled. Don't draw the splash screen if we're rebooting because of a
panic.
Approved by: re (cperciva)
MFC after: 3 days
(cherry picked from commit bc83f414583ccaf337ef3b7c019df7727d6a3aae)
(cherry picked from commit 3aabec5c8c6a74a4e50640b399a825d9f7adca9a)
[IR] Add Instruction::maySynchronize() method (NFC) (#196052)
Extract the logic from FunctionAttrs into a generic API on Instruction,
which will check the nosync flag on calls and ordering for atomic
instructions.
For now, I've retained the previous implementation which considers
monotonic ordering to be synchronizing, which is unnecessarily
conservative and doesn't match LangRef (or the Attributor
implementation).
This is to make it easier to reuse this logic in more places.
[CIR] Implement cleanup for array delete with throwing dtor (#194965)
This implements cleanup handling to perform partial array destruction in
the case where an exception is thrown while we are calling destructors
for an array delete expression. When an exception occurs, we attempt to
continuing destructing the rest of the array. If a second exception is
thrown, we terminate the process, but if only one exception is thrown we
will complete the array element destruction and then call operator
delete. This matches the behavior of classic codegen.
As part of this implementation, I had to move the array delete operator
call to a cleanup handler in order to ensure that it was called both in
the normal case (when no exception is thrown) and in the case where an
exception is thrown but the partial cleanup completes successfully. This
required updating one existing test.
In the case where exception are not enabled, we still call the array
delete operator from a cleanup handler, but the cleanup executes
unconditionally in the non-exception control flow.
Assisted-by: Cursor / claude-opus-4.7-thinking-xhigh
[openmp][flang] To add a cmake option to build OPENMP Fortran modules only without building the libomp lib (#195576)
PR #192687 Introduces a dependency to the Fortran intrinsic module when
building `openmp` Fortran modules, which requires a Flang enabled llvm
build in order to build `openmp` Fortran modules.
This PR is to add a cmake option `LIBOMP_FORTRAN_MODULES_ONLY` to allow
users to build 'openmp` Fortran modules only for Flang without building
the libomp runtime library.
This will allow libomp.a/so build still be independent from the Flang
build as before.
E.g. To build `openmp` Fortran modules only for Flang, one would need to
use the following options.
```
cmake \
...
-DLIBOMP_FORTRAN_MODULES_ONLY=ON \
-DLLVM_ENABLE_PROJECTS="flang" \
-DLLVM_ENABLE_RUNTIMES="openmp" \
...