From db488f819e5bbac07f20f209392b40dbe3e1b962 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 15:06:43 +1100 Subject: [PATCH 1/2] soc: apple: sep: Run the KUnit suites in CI 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> --- .github/workflows/sep-source.yml | 27 +++++++++++++++++++++++++++ drivers/soc/apple/sep.kunitconfig | 21 +++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 drivers/soc/apple/sep.kunitconfig diff --git a/.github/workflows/sep-source.yml b/.github/workflows/sep-source.yml index e77ffd8ad7340..51ce8828d55ab 100644 --- a/.github/workflows/sep-source.yml +++ b/.github/workflows/sep-source.yml @@ -73,3 +73,30 @@ jobs: grep -qx 'CONFIG_APPLE_SEP_KUNIT_TEST=y' .config make -j2 LLVM=1 ARCH=arm64 modules_prepare make -j2 LLVM=1 ARCH=arm64 drivers/soc/apple/apple-sep.o + + kunit: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Install kernel build and QEMU dependencies + run: | + sudo apt-get update + sudo apt-get install -y clang lld llvm libclang-dev libelf-dev libssl-dev \ + flex bison bc pkg-config make perl qemu-system-arm + rustup component add rust-src + - name: Prepare the layout-corrected bindgen + env: + LIBCLANG_PATH: /usr/lib/llvm-18/lib + run: python3 tools/aurora-bindgen/build.py + # rust-build only compiles the tests; this runs them. + - name: Run the Apple SEP KUnit suites on arm64 QEMU + env: + LIBCLANG_PATH: /usr/lib/llvm-18/lib + run: | + ./tools/testing/kunit/kunit.py run --arch=arm64 \ + --make_options LLVM=1 \ + --kunitconfig=drivers/soc/apple/sep.kunitconfig \ + --jobs="$(nproc)" --timeout=900 'apple_sep*' diff --git a/drivers/soc/apple/sep.kunitconfig b/drivers/soc/apple/sep.kunitconfig new file mode 100644 index 0000000000000..62924e1415efd --- /dev/null +++ b/drivers/soc/apple/sep.kunitconfig @@ -0,0 +1,21 @@ +CONFIG_KUNIT=y +CONFIG_ARCH_APPLE=y +CONFIG_OF=y +CONFIG_RUST=y +CONFIG_ARM64_16K_PAGES=y +CONFIG_IOMMU_SUPPORT=y +CONFIG_DRM=y +CONFIG_DRM_ASAHI=y +CONFIG_APPLE_RTKIT=y +CONFIG_APPLE_MAILBOX=y +CONFIG_PM=y +CONFIG_SPI=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_OF_DYNAMIC=y +CONFIG_OF_OVERLAY=y +CONFIG_HW_RANDOM=y +CONFIG_KEYS=y +CONFIG_TRUSTED_KEYS=y +CONFIG_CRYPTO=y +CONFIG_APPLE_SEP=y +CONFIG_APPLE_SEP_KUNIT_TEST=y From 676144867d74e94625142a81e164f88eea7fe581 Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 15:07:10 +1100 Subject: [PATCH 2/2] soc: apple: sep: Initialise blank host-state store files again 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 c73c18c03037 ("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 1c1088958638 ("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: 1c1088958638 ("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> --- drivers/soc/apple/store.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/soc/apple/store.rs b/drivers/soc/apple/store.rs index d9930332cab99..bff68e070db4b 100644 --- a/drivers/soc/apple/store.rs +++ b/drivers/soc/apple/store.rs @@ -263,9 +263,6 @@ impl Store { pr_info!("created a new host-state store\n"); return Ok(store); } - if size < STORE_SIZE as u64 { - return Err(store.refuse(Damage::Size)); - } let mut sb = KVec::with_capacity(BLOCK_SIZE, GFP_KERNEL)?; sb.resize(BLOCK_SIZE, 0, GFP_KERNEL)?;