Skip to content

feat(mte,dmabuf,android): ARM64 MTE safety, CONTPTE DMA-BUF heap, opt-in governors & Prefab AAR - #60

Merged
saariuslystoned merged 3 commits into
mainfrom
feat/qpr2-mte-contpte-prefab-aar
Dec 3, 2026
Merged

saariuslystoned merged 3 commits into
mainfrom
feat/qpr2-mte-contpte-prefab-aar

Conversation

@saariuslystoned

Copy link
Copy Markdown
Contributor

Summary

  • fs_mte (include/freesched/fs_mte.h, src/fs_mte.c, single_include/fs_mte.h):
    • Read-only ARMv8.5-A / ARMv9 MTE runtime detection via PR_GET_TAGGED_ADDR_CTRL (56) and getauxval(AT_HWCAP2).
    • Pure bit-arithmetic tag-clean pointer helpers (fs_mte_untag_ptr, fs_mte_ptr_tag, fs_mte_ptr_tbi_byte, fs_mte_is_granule_aligned, fs_mte_granule_align_up, fs_mte_ptr_equal_untagged, fs_mte_hash_ptr_untagged) with zero PR_SET_TAGGED_ADDR_CTRL mutation (FS_MTE_OPT_IN_UNSAFE_THREAD_DISABLE defaults to 0).
    • Updated src/fs_backend_openbuenos.cpp immutable weight lookup/unregistration (fs_ob_ensure_immutable_locked, fs_ob_unreg_immutable_locked) to compare fs_mte_untag_ptr() while preserving original tagged pointers for CPU access.
  • fs_dmabuf_contpte (include/freesched/fs_dmabuf.h, src/fs_dmabuf_contpte.cpp, single_include/fs_contpte_heap.h):
    • Added cleanly alongside existing src/fs_dmabuf.cpp.
    • Runtime /dev/dma_heap/system + SELinux (EACCES / ENOENT / ioctl / mmap) probe (fs_dmabuf_probe_contpte), default-ON system-uncached rejection (FS_DMABUF_ERR_UNCACHED_BLOCKED), 64 KiB (CONTPTE) / 2 MiB alignment helpers, reusable pre-pinned bump arena, and silent host fallback (fs_dmabuf_contpte_alloc_or_fallback).
  • fs_governor (include/freesched/fs_governor.h, src/fs_governor.cpp):
    • Strictly gated behind BOTH compile-time -DFS_GOV_EXPERIMENTAL=1 AND runtime cfg.experimental_opt_in = true (ADPF thermal curve + 83.33 ms coalescing, 1 Hz ARR idle scheduler hints, LMKD <= 7.5 GiB pinned admission + O_DIRECT guard, and SVE2-PMULL / NEON-AES-CTR cluster dispatcher).
  • Tooling, Packaging & CI:
    • Added tools/fs_probe.cpp JSON diagnostics, tests/test_freesched_patch.cpp, tests/test_stb_headers.c, android-aar/ (io.github.freesilicon:freesched-android Prefab AAR Gradle/CMake packaging), cmake/freeschedConfig.cmake.in, SUPPORTED.md, .github/ISSUE_TEMPLATE/bug_report.yml, and .github/workflows/{release-prefab-aar.yml,stale-probe-check.yml,public-roads-firewall.yml}.
    • Updated Makefile, CMakeLists.txt, android/src/main/cpp/CMakeLists.txt, README.md, and .github/workflows/ci.yml additively.

Verification

  • make clean && make verify && make sanitize && make clean: PASSED (strict C11/C++17 header syntax checks, all existing tests, test_freesched_patch with FS_GOV_EXPERIMENTAL=OFF and ON, test_stb_headers C11/C++17, fs_probe, twin-test, clean-room-audit.sh, and ASan+UBSan).
  • cmake + ctest (FS_GOV_EXPERIMENTAL=OFF, 45/45 passed) + FS_GOV_EXPERIMENTAL=ON + -DFREESCHED_BUILD_TESTS=OFF -DFREESCHED_BUILD_TOOLS=OFF + cmake --install: PASSED.
  • ./scripts/clean-room-audit.sh across 233 files and ./scripts/audit-no-async-ring.sh: PASSED (0 errors).

@saariuslystoned
saariuslystoned merged commit d152312 into main Dec 3, 2026
7 checks passed
@saariuslystoned
saariuslystoned deleted the feat/qpr2-mte-contpte-prefab-aar branch December 3, 2026 18:05
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.

1 participant