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 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)?;