Page MenuHomeFreeBSD

tpm: Validate TIS 1.2 IRQs and quiesce delivery before teardown
Needs ReviewPublic

Authored by kbowling on Sun, Sep 13, 7:15 PM.
Tags
None
Referenced Files
F172122100: D59653.id186624.diff
Wed, Sep 16, 7:17 AM
Unknown Object (File)
Mon, Sep 14, 8:46 AM
Unknown Object (File)
Sun, Sep 13, 11:37 PM
Unknown Object (File)
Sun, Sep 13, 11:31 PM
Unknown Object (File)
Sun, Sep 13, 11:14 PM
Subscribers
None

Details

Summary

Apply relevant parts of a22eb754c4bb to tpm1.2

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.
Diagnose a failed initialization-time disable in the attach context, even
when the cleanup retry succeeds. Lifecycle locality acquisition uses the
bounded timeout without PCATCH so signals cannot interrupt masking;
command-path acquisition remains interruptible.

Cancel timed-out or interrupted locality requests, including requests
made by the ISA probe, so a late grant cannot leave locality reserved.

A device whose global enable does not read back cleared now fails attach
instead of publishing a cdev, and fails resume instead of accepting new
commands. Initialization's existing requirement to acquire locality is
unchanged. The separate legacy Atmel transport is unaffected.

MFC after:      2 weeks

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kbowling created this revision.

hm, i wonder if I have any TPM 1.2 devices running -head to test this against. Let me go and check out my laptops again...