Repository navigation
accel/ane: send both custom BARs of a scratch-backed H16 program - #1061
Merged
Merged
Conversation
A scratch-backed H16 program uses the 0x8c0 descriptor form. Besides the prefetch relocation tuple that the linear 0x8a0 form also has, it carries a second tuple for the intermediate-spill stream in the kind-3 payload at +0x890. ane_h16_custom_bars() returned no record for that form, so an EXECUTE of such a program carried no custom BAR at all. The first request of a program takes the queued EXELOOP path, which sets up a fresh BAR context; later requests go direct and reuse it. Without the BAR records, the direct second request of a scratch-backed program reads through an unrelocated selector: on a T6041 (M4 Pro) the engine raised DART read faults at 0x21_xxxx_xxxx and the firmware quarantined the program. Decode both tuples and send two records, both on BAR 4 with the program's DSID. Their bit ranges overlap but they use different mcache value types, so the request validator now treats two records as conflicting only when they also share the value type. Drop the info message on the first request of each program. Each load already logs, and the line added nothing. Tested on a T6041 (J616s) on a 7.3 kernel with this change: a two-task scratch-backed program with one DRAM spill and a two-task L2-resident program both run bit-exact on two executions each, the second one on the direct path, with no DART faults. A MobileNet v2 program ran 16/16 correct in five runs with p50 latency at parity with the unpatched driver, the suspend/resume gate passed, and there were no new SELinux denials. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A scratch-backed H16 program (the 0x8c0 descriptor form, used when the compiler spills L2 intermediates to DRAM) declares two custom-BAR relocation tuples: the prefetch tuple that the linear 0x8a0 form also has, and an intermediate-spill tuple in the kind-3 payload.
ane_h16_custom_bars()returned no record for this form, so its EXECUTEs carried no custom BAR.The first request of a program is queued through EXELOOP, which sets up a fresh BAR context; later requests go direct and reuse it. Without the records, the direct second request of a scratch-backed program reads through an unrelocated selector. On the J616s (T6041, M4 Pro) that showed up as DART read faults at
0x21_xxxx_xxxxfollowed by a firmware program quarantine.This change:
One commit, 3 files under
drivers/accel/ane/, +73/-17. KUnit cases cover both decoded records and the two-record EXECUTE tail on the queued and direct paths.Hardware evidence (J616s, T6041, kernel 7.3.0-aurora-fleet17 with these modules, one-shot boots)
-p3messages, 33 kernel log lines per 5 runs against 30 unpatched, SELinux enforcing with 0 AVCs.The full 28-task MobileNet L2-spill program is still wrong with this change. The sentinels above show the BAR setup is now right, so that remaining fault is in the compiler's program and is tracked there, not in this driver.
Checks
checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.ane-h16-programcases pass.drivers/accel/anecompiles with 0 warnings.🤖 Generated with Claude Code