tpm: Harvest entropy from TPM 1.2 devices
The TPM 2.0 driver periodically contributes TPM-generated random bytes
to the kernel entropy pool, but the TPM 1.2 driver does not.
Issue TPM_GetRandom every ten seconds and submit successful responses
as RANDOM_PURE_TPM. Keep each exchange under the TPM transaction lock.
Defer harvesting while the character device is open or a command is
pending so the task cannot consume a user response. Drain the task for
suspend and detach, rearming it after resume or a failed suspend.
Document the expanded scope of RANDOM_ENABLE_TPM and update the kernel
configuration comments that described it as TPM 2.0-only.
Validated on a STMicroelectronics TPM 1.2 TIS device. DTrace observed
periodic entropy submissions; a raw GetRandom response remained intact
while the device was held open across a harvest interval; and module
unload/reload deregistered and restored the entropy source cleanly.
[4 lines not shown]
[MLIR][Python] Fix stale multithreaded_tests.py (#237018)
`multithreaded_tests.py` only runs on free-threaded CPython, so it
rotted unnoticed. On 3.14t it failed every test and then aborted. This
PR:
- Drops calls to live-operation APIs removed in #155114.
- Compares live contexts against a pre-test baseline instead of 0,
because `ir/array_attributes.py` keeps a Context alive.
- Restores the builtin `RankedTensorType` caster after binding
`TestIntegerRankedTensorType`, which hijacked it and caused the abort.
The abort itself is fixed in #237010.
- Only collects test functions defined in each module, so imported
helpers aren't run as tests.
- Skips `testMatchInterfaceEnumReplaceAttributeBuilder`, which replaces
a global attribute builder used by `testMatchInterfaceEnum`.
- Without TSAN, skips the xfail list and tests using the `np_to_memref`
helpers. They hit a ctypes race (python/cpython#127945)
nondeterministically. Under TSAN they still xfail as before.
Assisted by: Claude
graphics/blender4: Update to 4.5.14
Bugfix releases of the 4.5 LTS series. They fix crashes in the Video
Sequencer and in Armature Edit mode and the Extensions tab not loading
because of an SSL problem.
Changelog: https://www.blender.org/download/lts/4-5/
PR: 298728
Sponsored by: Netzkommune GmbH
(cherry picked from commit 76eb4a792b709d94cf39c9fb033d877cd154b21d)
graphics/blender4: Unbreak with non-3.11 Python and FFmpeg 9
Blender's CMake defaults to Python 3.11 and fails when that exact
version is missing. Pass the version of the default Python instead,
look up the NumPy 2 headers under numpy/_core/include and backport
FFmpeg 9 support for audaspace from upstream (e3c92c22817d).
PR: 299533
Approved by: Shane <FreeBSD at ShaneWare.Biz> (maintainer)
Sponsored by: Netzkommune GmbH
(cherry picked from commit 0146d7f56262e9f8c7483230b79bee6a3fa9a466)
graphics/blender: Update to 5.2.2
Blender 5.2 is the new LTS release, supported until July 2028. It adds
experimental Geometry Nodes based cloth and hair dynamics and a texture
cache in Cycles that lowers memory use on scenes with many image
textures. Since 5.1 Blender no longer loads the Python user site
directory by default.
Blender 5.2 requires Python 3.13. Until that is the default version,
build it with DEFAULT_VERSIONS+=python=3.13.
Changelog: https://developer.blender.org/docs/release_notes/5.2/
PR: 294160
Sponsored by: Netzkommune GmbH
graphics/blender4: Unbreak with non-3.11 Python and FFmpeg 9
Blender's CMake defaults to Python 3.11 and fails when that exact
version is missing. Pass the version of the default Python instead,
look up the NumPy 2 headers under numpy/_core/include and backport
FFmpeg 9 support for audaspace from upstream (e3c92c22817d).
PR: 299533
Approved by: Shane <FreeBSD at ShaneWare.Biz> (maintainer)
Sponsored by: Netzkommune GmbH
graphics/blender4: Update to 4.5.14
Bugfix releases of the 4.5 LTS series. They fix crashes in the Video
Sequencer and in Armature Edit mode and the Extensions tab not loading
because of an SSL problem.
Changelog: https://www.blender.org/download/lts/4-5/
PR: 298728
Sponsored by: Netzkommune GmbH
tpm: crb: Improve ACPI control and buffer addresses
The TPM2 ControlAddress identifies the control area, not necessarily a
PTP locality block. Hyper-V exposes a start-method-7 control area at the
beginning of its ACPI memory resource, with command and response buffers
in separate reserved memory pages. Assuming control registers are at
resource + 0x40 instead writes CANCEL as LOC_CTRL and fails attach.
Map the control area using ControlAddress and map buffers using their
reported physical addresses. Reuse the resource mapping for contained
ranges and track ownership of independent mappings for cleanup. Request
locality only when the resource contains the preceding 64-byte PTP header.
Keep the existing Pluton notification callbacks and locality behavior for
that layout. Control, locality, and buffer accesses use their respective
mappings directly, without the tpm_bus accessor class.
Bound transfers by the mapped buffer sizes and TPM_BUFSIZE. Clamp an
overstated buffer that starts within the ACPI resource to its remaining
extent, while requiring room for a complete response header. Keep strict
[20 lines not shown]
tpm: Tie exclusive-open cleanup to the file lifetime
Use a cdevpriv destructor to abort an unfinished TPM 1.2 transaction and
release exclusive-open ownership. Register it before setting TPM_OPEN so
a failed registration leaves the device available. The last reference to
the successful open triggers cleanup, including after dup() or fork().
Suggested by: kevans
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59812
tpm: Validate firmware interrupt routes and fall back cleanly
A host IRQ resource is not necessarily an LPC SIRQ selector. Let the
frontend configure the route: ACPI uses the allocated _CRS interrupt and
_SRS when present, preserving the firmware selector, while ISA supplies a
separate, range-checked SIRQ. Match trigger and polarity to the host route
and TPM capabilities, including opaque INTRNG resource mappings.
Pass the firmware descriptor unchanged to _SRS; apply the x86 ISA polarity
override only when computing the TPM mode. ISA chips without rising-edge
support now poll instead of substituting a level mode for the host route.
For both FIFO drivers, require a complete GetRandom transport response and
a fresh DATA_AVAIL interrupt before selecting interrupt waits. Perform
the test with polling before publishing the device, and repeat it after
resume. During cold boot, defer the test and publication to an interrupt
configuration hook so the IRQ grace wait can sleep and the handler can run.
Drain the hook before teardown; failed deferred initialization remains
unpublished and can be detached safely. Missing or failed routes release
the handler and IRQ resource;
[33 lines not shown]
tpm: Validate TIS 1.2 IRQs and quiesce delivery before teardown
The TIS 1.2 driver uses the IRQ resource value directly as the four-bit
LPC SIRQ selector in TPM_INT_VECTOR, without validating it before
narrowing. Add the missing range check on the full resource value and use
polling for routes outside 1 through 15. This restriction reflects the
driver's current routing support: parent interrupt numbers need not equal
LPC SIRQ channels.
Attach also installs a handler when the chip's quirks select polling.
Release the IRQ resource when initialization selects polling. Retain an
interrupt cookie only after successful setup and require it for interrupt
waits.
Share verified interrupt masking across initialization, resume, and
detach. Quiesce after draining cdev methods and before removing a handler,
including polling devices whose failed resume left firmware delivery on.
Preserve an owned locality until the existing abort path discards any
pending response. Report quiesce failures while completing detach cleanup.
[17 lines not shown]
[flang] Enable test for all other targets (NFC) (#237224)
x86-registered-target disables the test if the compiler built with
LLVM_TARGETS_TO_BUILD=all or
LLVM_TARGETS_TO_BUILD=...X86..... This patch is to only disable for x86
related targets and enable for all other targets.
[CIR] Make fenv lowering follow the attribute's defaults
An absent fenv parameter now takes its value in the default FP
environment (tonearest, masked, non-strict), so the empty attribute is the
unconstrained default. The lowering reads the parameters through the
OrDefault helpers, as speculation does, and checks strict_except before the
exception mode: strict exceptions keep the FP status exact even when masked.
Clang codegen output and its lowering are unchanged.
Assisted-by: Claude Code (Opus 5.5).
jailmeta: reject empty keys in metadata lookups
Reject empty keys in metadata lookups with EINVAL to prevent an infinite
loop while holding allprison_lock and pr_mtx. Add tests for empty-key
reads and writes with empty and populated meta/env buffers, trailing
newlines, and empty final values.
Reviewed by: igoro, jamie
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D61025
[mlir][ODS] Give AttrDefs an identity constBuilderCall
An attribute defined with AttrDef is its own constant value, so set its
constBuilderCall to "$0" when its returnType is the attribute class. This
lets an AttrDef be used directly in DefaultValuedAttr without a per-def
override, and drops the one LLVM_DIGlobalVariableExpressionAttr had. Defs
with a different returnType keep it unset.
Assisted-by: Claude Code (Opus 5.5).