Skip to content

hal2: bound AES loopback while the receiver is stopped - #952

Merged
techomancer merged 1 commit into
techomancer:mainfrom
salvogendut:upstream/hal2-bounded-loopback
Dec 6, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
salvogendut:upstream/hal2-bounded-loopback

Conversation

@salvogendut

Copy link
Copy Markdown
Contributor

HAL2 AES transmit DMA can run while the receiver is stopped. Each transmitted word was appended to the internal loopback queue, so this state could grow host memory indefinitely on Indy and Indigo2.

Cap the queue at 96,000 words and discard the oldest words on overflow. The change includes an overflow/order regression and documents the emulator's buffering limit.

Validation on Linux:

  • The regression fails with the original unbounded enqueue: 96,010 queued words instead of 96,000.
  • cargo +nightly test -p iris --lib dev::hal2::: all 14 tests pass with the fix.

Keep at most 96,000 words and discard the oldest words on overflow so AES TX alone cannot grow host memory indefinitely. Document the buffering limit and cover overflow ordering with a regression test.

Validation: the regression fails with the original unbounded enqueue; all 14 HAL2 tests pass with the fix (cargo +nightly test -p iris --lib dev::hal2::).
@techomancer
techomancer merged commit b3e6cbe into techomancer:main Dec 6, 2026
9 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