Skip to content

accel/ane: add shared H16/H17 firmware transport - #706

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
ane/fw-transport
Nov 1, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
ane/fw-transport

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

H16 and H17 need the same validated firmware channel transport before their boot and execution backends can submit commands. Add device-independent helpers for channel-table validation, host ring arming, pool-backed IO and DATA_CHAIN publication, exact reply checking, owned IO_T2H report consumption, bounded SHAREDMALLOC allocations and match-data IRQ pending/acknowledge access.

The helpers use caller-supplied memory, DMA barrier, MMIO, allocation and monotonic clock accessors. Absolute deadlines survive provider servicing. Firmware errors retain transactions and mappings, and FREE/control forms remain logged refusals while their reply format is unspecified. Probe and ownership handling do not change.

Add 27 synthetic KUnit transport cases covering malformed and overlapping tables, write/barrier ordering, ring wrap, every reply predicate, stale report UUIDs, allocation ceilings and bad allocator results, IRQ masks and deadline expiry during allocation service. Command storage uses a bounded monotonic pool arena and is not recycled before reset.

A native compatibility harness passes all 27 new transport cases and all 10 existing protocol cases under ASAN/UBSAN. Full Linux KUnit on x86_64 and arm64 with KASAN/UBSAN, plus arm64 LLVM W=1 compilation of drivers/accel/ane, remain pending build capacity. Native runs are supplementary and do not establish kernel validation. Both new C files pass strict checkpatch with zero errors, warnings or checks. The complete diff passes strict checkpatch with the generic new-file MAINTAINERS advisory excluded; the directory is already covered by MAINTAINERS.

No hardware testing or inference claim is made. Keep this PR draft until the build results and backend integration have been reviewed.

Validate the dynamic channel table before arming host rings, publish pool-backed commands, check replies and consume owned reports. Provide bounded SHAREDMALLOC allocations and match-data IRQ helpers with absolute command deadlines and retained failure state.

Exercise malformed descriptors, ring ordering, reply corruption, report ownership, allocation ceilings and deadline expiry using synthetic KUnit accessors. Keep probe and hardware ownership unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Record the wrapped replacement description for commit 0a3bdfc.
Keep the published history intact.

Validate the dynamic channel table before arming host rings, publish
pool-backed commands, check replies and consume owned reports. Provide
bounded SHAREDMALLOC allocations and match-data IRQ helpers with absolute
command deadlines and retained failure state.

Exercise malformed descriptors, ring ordering, reply corruption, report
ownership, allocation ceilings and deadline expiry using synthetic KUnit
accessors. Keep probe and hardware ownership 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

All 27 new transport cases are included in the 49 cases per architecture. The source tree at 8f9cd9c is identical to 0a3bdfc. The new empty fixup commit records a wrapped replacement description; the published commit history was preserved.

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/706/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
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  SYSHDR  arch/arm64/include/generated/uapi/asm/unistd_64.h
  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]
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  SYSTBL  arch/arm64/include/generated/asm/syscall_table_32.h
  SYSTBL  arch/arm64/include/generated/asm/syscall_table_64.h
  SYSHDR  arch/arm64/include/generated/asm/unistd_32.h
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  SYSHDR  arch/arm64/include/generated/asm/unistd_compat_32.h
  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_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_fw_transport_test.o
  AR      drivers/accel/ane/built-in.a
make[1]: Leaving directory '$WORK/out/706/driver'

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