Skip to content

iommu/apple-dart: warn once per stream when a retire invalidate fails - #272

Merged
chriskearney merged 1 commit into
integration/aurorafrom
neo/dart-retire-warn-once-20261029
Oct 30, 2026
Merged

chriskearney merged 1 commit into
integration/aurorafrom
neo/dart-retire-warn-once-20261029

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Collaborator

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:

apple-dart <dev>: stream <n>: TLB invalidate failed retiring its root (<err>); keeping the page tables of its domains until reboot

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 new retire-repeat-timeout case checks that a second failed retire on the same stream keeps the first error and doesn't warn again.
  • omacom KUnit: 1702 tests, 1699 pass, 3 skip (apple-dart suites included).
  • apple-dart.o builds clean with W=1.

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 chriskearney left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chriskearney
chriskearney added this pull request to the merge queue Oct 30, 2026
Merged via the queue into integration/aurora with commit 9f31002 Oct 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants