Repository navigation
soc: apple: sep: Initialise blank host-state store files again, and run the SEP KUnit suites in CI - #1193
Merged
Conversation
The SEP source checks build the driver with APPLE_SEP_KUNIT_TEST but never run the tests, so a failing suite does not show up on a pull request. apple_sep_host_store has been failing on integration/aurora since the 7.3 merge, and every Touch ID series since has reported the same four failures as "pre-existing". Add the kunitconfig the lanes already use for the apple_sep suites and a job that runs them on arm64 QEMU with the layout-corrected bindgen. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
A creation of the host-state store that is interrupted before its superblock is written leaves an empty or all-zero file shorter than the store. Commit c73c18c ("soc: apple: sep: Initialise an empty host-state store file again") made from_file() initialise such a file again, since it holds no state, and refuse only files with other contents. That relies on a short file reaching the Damage::Size path, where describe() tells blank files from damaged ones. The 7.3 merge into aurora-wip brought back the early size guard from the older refuse-everything version, and commit 1c10889 ("merge: adapt the retained store guard and DWC3 fixture to 7.3") kept it. The guard refuses every file shorter than the store before describe() runs, so a blank short file is refused again: Touch ID stays off on every boot until someone deletes /var/lib/aurora-sep-host-state.bin by hand. This is what the four failing apple_sep_host_store tests check. Drop the guard. A short file is still read only through describe(), and one with any non-zero byte is still refused without being written to, as the tests for truncated stores and non-blank short files check. Fixes: 1c10889 ("merge: adapt the retained store guard and DWC3 fixture to 7.3") Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
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.
apple_sep_host_storehas failed 4 of its 19 tests on integration/aurora since the 7.3 merge. Every Touch ID series since then has reported the same 4 failures as pre-existing (#904, #1087, #1134, #1143: "4 = base host_store"). CI never noticed because the SEP checks compile the KUnit tests but never run them.Cause (code, not tests)
Store::from_file()starts with an early check,if size < STORE_SIZE { refuse(Damage::Size) }. 387f76c removed that check. c73c18c ("Initialise an empty host-state store file again") depends on it being gone: a short file has to reach theDamage::Sizepath, wheredescribe()tells a blank file (left by an interrupted creation) from damaged state. The 7.3 aurora-wip merge c20b9d9 brought the check back, and 1c10889 ("Keep the WIP store-size guard") kept it. Now every blank short file is refused beforedescribe()runs. On a real machine that means one interrupted store creation turns Touch ID off on every boot, until someone deletes/var/lib/aurora-sep-host-state.binby hand. The four failing tests assert exactly this behaviour, and c73c18c's commit message explains why it is wanted. The tests are right.Fix
soc: apple: sep: Initialise blank host-state store files again: removes the check. A short file is still read only throughdescribe(). A file with any non-zero byte is still refused and not written to, which the existing tests for truncated stores and non-blank short files cover. No test was changed.soc: apple: sep: Run the KUnit suites in CI: addsdrivers/soc/apple/sep.kunitconfig(the config the lanes already use) and akunitjob insep-source.ymlthat runsapple_sep*on arm64 QEMU with the layout-corrected bindgen. The job takes 6 to 10 minutes.KUnit, arm64 QEMU, from this PR's own CI
Before. CI commit only, on integration 36d9198 (run 42445486052):
After. With the fix (run 42446252716):
checkpatch --strict: 0 errors and 0 warnings on the fix. The CI commit gets the usual MAINTAINERS warning for a new file. No hardware needed. Open PRs #583 and #962 touch other lines of store.rs and still apply.
🤖 Generated with Claude Code