aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL/ptx-kernels.cl
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-27 14:06:55 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-09-03 04:03:32 +0000
commit74c539fd1cefdbc993411274c613434c3f23b4b1 (patch)
tree6469cfaa78812c5e1e83f9f5def25d8d9ac0902b /test/CodeGenOpenCL/ptx-kernels.cl
parentf613a43c366600e8c388c3200f74c6dd27f8a7a2 (diff)
tpm20: Move user copies outside the lifecycle lockHEADmain
The TPM 2.0 character-device methods held the global device lock while uiomove() accessed user memory. User page faults could therefore delay suspend or detach even though the read response was already buffered. Add a per-open sleepable lock to serialize operations on each response buffer. Stage commands under that lock before acquiring the device lock, and copy them into the response buffer only after the lifecycle checks succeed. This preserves an unread response when suspend or detach rejects a write. Release the device lock before copying buffered responses out. Also advance the response offset by the bytes actually copied when uiomove() returns after a partial transfer. Validated on an Intel TPM 2.0 TIS device. PCR reads and GetRandom passed under 16-process mixed command load. A response was consumed correctly in 5-byte, 7-byte, and remainder reads. Module unload/reload recreated the device and entropy source without lock diagnostics. Source inspection confirmed rejected writes preserve unread responses. Reviewed by: kevans MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59245
Diffstat (limited to 'test/CodeGenOpenCL/ptx-kernels.cl')
0 files changed, 0 insertions, 0 deletions