Repository navigation
iommu/apple-dart: warn once per stream when a retire invalidate fails - #272
Conversation
When the TLB invalidate that retiring a locked root needs fails, the DART remembers the error per stream (locked_retire_err), and apple_dart_domain_free() keeps the page tables of every domain on that stream until reboot. Nothing said so until a domain was freed, and then only as a ratelimited "retaining page tables" error per free. Log a warning the first time a stream records such an error, naming the stream and the error and saying its page tables are kept. The error is never cleared, so this fires at most once per stream. The host fixture counts the warning in the timeout cases, and a new retire-repeat-timeout case checks that a second failed retire on the same stream keeps the first error and does not warn again. Signed-off-by: DjDeveloperr <[email protected]> (cherry picked from commit edfd516)
chriskearney
left a comment
There was a problem hiding this comment.
Source approval for 80ccff5. All three changed files and relevant retirement/error callers were reviewed. The patch applies to integration/aurora 1046424 with all three results equal to the head files; its #235 prerequisite is already merged.
This adds a first-error warning after the existing sticky per-stream error assignment. First selection remains under the existing irq-save lock; printing happens after unlock. The scope is once per SID per live DART instance. It does not change invalidation/MMIO, return values, retries, ordering or page-table retention. Existing low-level timeout and domain-free retention diagnostics remain intact; repeat suppression applies only to the new warning.
Independent focused host validation passed the authored 74 cases. The new repeated-timeout case compiles and fails at the expected assertion before the patch. An exact-region gate control exercised all 256 SID indices, device-instance isolation and 24 competing threads, and caught four semantic mutants. These controls do not simulate full concurrent hardware retirement. I verified the retained report/checksums and read all three diffs.
A physical boot is not needed solely for this diagnostic delta: ordinary successful operation is unchanged and would not exercise the added failure warning. Real TLB fault injection would add unnecessary risk. Existing full CI 40806530886 is green, including QEMU, and normal current-tree merge-queue CI remains required; no physical-device qualification is claimed.
Follow-up to #235, from maralcbr's non-blocking note there.
When the TLB invalidate that retiring a locked root needs fails, the DART remembers the error per stream (
locked_retire_err).apple_dart_domain_free()then keeps the page tables of every domain on that stream until reboot. Until now nothing said so before a domain was freed, and then only as a ratelimited "retaining page tables" error per free.The first time a stream records such an error, this logs:
The error is never cleared, so the warning fires at most once per stream. The ordinary unmap path, which still drops invalidate errors, predates #235 and isn't changed here.
The commit is a clean cherry-pick (
-x) of aurora-silicon/linux edfd5166 (aurora-silicon/linux#559, merged there).Testing (host only):
tools/asahi/apple-dart-fw-tests.py: 74/74. The timeout cases now also check for exactly one warning, and the newretire-repeat-timeoutcase checks that a second failed retire on the same stream keeps the first error and doesn't warn again.apple-dart.obuilds clean with W=1.