Skip to content

accel/ane: prepare H16 preload identity and bounded load resources - #699

Closed
RyanTheTide wants to merge 5 commits into
aurora-wipfrom
ane/h16-loading-providers
Closed

RyanTheTide wants to merge 5 commits into
aurora-wipfrom
ane/h16-loading-providers

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

H16 lacks the immutable input and mapping geometry needed by a safe loader. This draft adds normalized resident-image identity checking, a single-copy original-HWX import helper, whole-segment load planning and validation of backend mappings and program resource bindings.

The checker authenticates every immutable TEXT/DATA byte and all patchbay framing, normalizing only 20 reviewed value cells and the exact tunables range. Load plans preserve file extents and permissions, combine tasks/constants in one TEXT allocation and cap allocation before DMA. Resource validation retains full-width DVAs and rejects malformed spans, permissions, duplicate indices and overlapping code, scratch, surface and firmware mappings. The backend resolves bindings from the validated program contract; CREATE_PROCESS reply IDs are not resource authority.

H16 inference remains unavailable. No userspace loading ioctl, process installer, live preload acquisition or physical boot backend is supplied. The helpers require backend ownership proof and install no process. Default H16 and H17 refusals remain intact. Follow-on transport, loader and boot work consumes this foundation.

This depends on #681. The accepted dependency is incorporated with its original ancestry. Implementation is 49e4eef, the ancestry-only merge is a371a27 and the final comment/documentation clarification is 4a08e30. The clarification changes no C/header code tokens. There is one shared driver and no new bypass parameter.

Local verification passes strict checkpatch, whitespace, SPDX for five new files, the independent 42-record/20-cell manifest check and the device-free fixture's three buffer hashes and 16,384 fp16 oracle values. All 38 driver/documentation files match the final published commit. No compiler, sanitizer KUnit, arm64 object or reference-hardware pass is claimed. Four controller build attempts were refused before execution by build-host resource guards; final verification inputs and failure results are preserved for retry.

Source rollback is to revert 4a08e30 and 49e4eef, then rebuild a complete matching kernel/module set before installation. No target state changed. Any later candidate boot must retain its recovery fallback, and uncertain firmware ownership must retain mappings without an in-place unload/reset or retry.

RyanTheTide and others added 5 commits October 31, 2026 17:31
Track pending execution UUIDs before channel-7 publication and retire only
matching terminal channel-6 events. Keep one deadline across acknowledgment
and completion, order coherent DMA accesses, and quarantine failed or
uncertain requests without exposing private output mappings.

Validate complete HWX containers, tensor and program descriptors, aperture
records, symbols and payload-only kernel relocations. Match execute buffers
to kernel-owned process resources and revoke per-file authority on close.
Add hardware-free KUnit coverage for validation and pending request paths.

Keep H16 registration and section-only loading refused until preload,
startup, the original-container ABI and process-resource decoding exist.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Track pending execution UUIDs before channel-7 publication and retire only
matching terminal channel-6 events. Keep one deadline across acknowledgment
and completion, order coherent DMA accesses, and quarantine failed or
uncertain requests without exposing private output mappings.

Validate complete HWX containers, tensor and program descriptors, aperture
records, symbols and payload-only kernel relocations. Match execute buffers
to kernel-owned process resources and revoke per-file authority on close.
Add hardware-free KUnit coverage for validation and pending request paths.

Keep H16 registration and section-only loading refused until preload,
startup, the original-container ABI and process-resource decoding exist.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Authenticate stable, owned resident firmware snapshots against the pinned
normalized digest, checking every patchbay tag and width and masking only
the reviewed mutable value cells and exact tunables interval. Keep live
page acquisition behind the boot backend ownership gate.

Import original HWX bytes once before validation and hashing, retain whole
segment geometry, and bound private load plans before DMA allocation.
Validate backend mapping geometry and decoded process bindings without
accepting userspace resource authority or publishing partial results.

Keep H16 registration, section-only loading and process creation refused:
the load/process wire bodies, allocation replies and physical boot backend
still require reviewed providers. Add hardware-free KUnit coverage for the
identity, import, planning and resource paths.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The accepted dependency patch is already applied verbatim as 4700e91,
with SHA-256 89bdf5072e468dd750580348679c0caa552ad26a07911ed218ac809495a1e8fd.
Record the original PR #681 head as an ancestor so merging it upstream
does not create add/add conflicts for the already extended HWX files.
Preserve the current source tree unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Clarify that the backend resolves bindings from validated program metadata.
CREATE_PROCESS reply IDs do not describe a resource map. Keep wire
serialization and process installation separate from geometry validation,
with the existing default refusal unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Verification completed on 2026-10-31.

PR Verified source x86_64 KASAN/UBSAN arm64 KASAN/UBSAN arm64 LLVM W=1
#706 8f9cd9c 49/49 49/49 clean
#699 4a08e30 50/50 50/50 clean
#714 8ebdf63 59/59 59/59 clean

The preserved dependency, change and clarification patches were reconstructed and checked against tree fc3a5133e3b30db3c6e76b94e778b17f7d981c99, matching this PR's 4a08e30 head. All preserved input hashes matched. The build includes the H16 validation objects. No source fix was needed.

All six QEMU runs used LLVM with CONFIG_KASAN=y, CONFIG_KASAN_GENERIC=y, CONFIG_KASAN_INLINE=y, CONFIG_UBSAN=y and CONFIG_UBSAN_BOUNDS=y. Saved final configurations confirm the options were enabled; raw kernel logs contain no KASAN/UBSAN reports or failed tests. Tool versions: Clang 22.1.6, QEMU 11.0.1.

The driver builds enabled ARCH_APPLE, APPLE_MAILBOX, APPLE_RTKIT, APPLE_DART, DRM_ACCEL_ANE and both ANE KUnit options as built-ins. Each log below is from a fresh driver compilation after make clean:

make O="$OUT" ARCH=arm64 LLVM=1 W=1 -j8 drivers/accel/ane/
Complete clean arm64 LLVM W=1 driver build log (exit 0)
make[1]: Entering directory '$WORK/out/699/driver'
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  SYSHDR  arch/arm64/include/generated/uapi/asm/unistd_64.h
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  SYSTBL  arch/arm64/include/generated/asm/syscall_table_32.h
  HOSTCC  scripts/dtc/libfdt/fdt.o
  SYSTBL  arch/arm64/include/generated/asm/syscall_table_64.h
  SYSHDR  arch/arm64/include/generated/asm/unistd_32.h
  SYSHDR  arch/arm64/include/generated/asm/unistd_compat_32.h
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable.o
  HOSTCC  scripts/elf-parse.o
  HOSTCC  scripts/asn1_compiler
  HOSTLD  scripts/sorttable
  GEN     arch/arm64/include/generated/asm/cpucap-defs.h
  GEN     arch/arm64/include/generated/asm/kernel-hwcap.h
  GEN     arch/arm64/include/generated/asm/sysreg-defs.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/mod/symsearch.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CHKSHA1 $WORK/src/include/linux/atomic/atomic-arch-fallback.h
  CHKSHA1 $WORK/src/include/linux/atomic/atomic-instrumented.h
  CHKSHA1 $WORK/src/include/linux/atomic/atomic-long.h
  CC      arch/arm64/kernel/asm-offsets.s
  CC      kernel/sched/rq-offsets.s
  CALL    $WORK/src/scripts/checksyscalls.sh 
  LDS     arch/arm64/kernel/vdso/vdso.lds
  CC      arch/arm64/kernel/vdso/vgettimeofday.o
  AS      arch/arm64/kernel/vdso/note.o
  AS      arch/arm64/kernel/vdso/sigreturn.o
  CC      arch/arm64/kernel/vdso/vgetrandom.o
  AS      arch/arm64/kernel/vdso/vgetrandom-chacha.o
  LD      arch/arm64/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h
  OBJCOPY arch/arm64/kernel/vdso/vdso.so
  LDS     arch/arm64/kernel/vdso32/vdso.lds
  CC32    arch/arm64/kernel/vdso32/note.o
  CC32    arch/arm64/kernel/vdso32/vgettimeofday.o
  HOSTCC  arch/arm64/kernel/vdso32/../../../arm/vdso/vdsomunge
  LD32    arch/arm64/kernel/vdso32/vdso.so.raw
  MUNGE   arch/arm64/kernel/vdso32/vdso32.so.dbg
  OBJCOPY arch/arm64/kernel/vdso32/vdso.so
  CC      drivers/accel/ane/ane_drv.o
  CC      drivers/accel/ane/ane_tm.o
  CC      drivers/accel/ane/ane_dart.o
  CC      drivers/accel/ane/ane_boost.o
  CC      drivers/accel/ane/ane_fw_platform.o
  CC      drivers/accel/ane/ane_t6021_rtclient_main.o
  CC      drivers/accel/ane/ane_t6021_fwload.o
  CC      drivers/accel/ane/ane_t6021_boot.o
  CC      drivers/accel/ane/ane_h16_hwx.o
  CC      drivers/accel/ane/ane_h16_preload.o
  CC      drivers/accel/ane/ane_h16_load.o
  CC      drivers/accel/ane/ane_drv_test.o
  CC      drivers/accel/ane/ane_fw_platform_test.o
  CC      drivers/accel/ane/ane_fw_protocol_test.o
  CC      drivers/accel/ane/ane_h16_tasks_test.o
  CC      drivers/accel/ane/ane_h16_execute_test.o
  CC      drivers/accel/ane/ane_h16_pending_test.o
  CC      drivers/accel/ane/ane_h16_hwx_test.o
  CC      drivers/accel/ane/ane_h16_preload_test.o
  AR      drivers/accel/ane/built-in.a
make[1]: Leaving directory '$WORK/out/699/driver'

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #750 (ANE: H16 cold boot and first inference), which carries every commit of this branch.

@RyanTheTide RyanTheTide closed this Nov 1, 2026
@RyanTheTide
RyanTheTide deleted the ane/h16-loading-providers branch November 7, 2026 12: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