Repository navigation
third_party: carry the #812 imported-dma-buf pair (compile-proven, owner-gated, NOT installed) - #1134
Conversation
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY (two nits, neither blocking)
Verified at 79519af4, by building it rather than reading the claim.
The series applies, 7/7, in numeric order, on a fresh clone of the pin (amd/xdna-driver @ 526c6081974e, nothing local applied):
for p in 000[1-7]-*.patch; git apply --check && git apply -> 7 applied, 0 rejected
git status --short -> 11 modified files under drivers/accel/amdxdna, no conflicts
The new fingerprint row reproduces exactly. Built the documented way against this box's headers, 4 jobs under thermal-run:
make -C drivers/accel/amdxdna modules ARCH=x86_64 KERNEL_VER=7.4.0-rc1-1bit \
MODULE_VER_STR='2.21.0_20261104,526c6081974ea4f0f7dd22329186c5d6adb8fad5' -j4
rc=0 0 occurrences of "warning:" or "error:" in the build log
modinfo -F srcversion drivers/accel/amdxdna/amdxdna.ko -> 336751493A77C50DE0B50F7
The cmp claim holds independently of the fingerprint: cmp over every drivers/accel/amdxdna/*.c and *.h against the two trees this lane's verification left on the box gives 0 differing files against ~/wt/xdna-series-verify/i812verify and ~/wt/xdna-series-verify/i812b.
The deletion is complete, and -Werror is why it had to be: grep -rn amdxdna_mark_mapp_invalid drivers/ -> 0 hits, and drivers/accel/amdxdna/Kbuild:19 is ccflags-y += -g -Werror, so the warning-free build above is the proof that no caller survives.
"carried, NOT installed" is the true state of this box: /sys/module/amdxdna/srcversion and modinfo -F srcversion /lib/modules/7.4.0-rc1-1bit/updates/amdxdna.ko both read 349FDC99CADC56900E0249A — the kernel lane's 0011v2 build, on disk since 07:19 and loaded — which is a different fingerprint from this pair's, so the running module does not contain it.
And nothing can pick it up by accident, which is the risk the new section exists to guard. Nothing in the tree applies third_party/patches/amdxdna/*.patch by glob (only docs/npu.md, app/npu_device_lock.h and the README reference the directory at all), os/mini/mkimage.sh:270 takes AMDXDNA_KO explicitly, and os/v3/puppy/g3-probe.sh:173 asserts the srcversion it expects. An image carries a built .ko, not a patch, and the probe fails a module it did not build.
Mechanism, read rather than assumed. The -EFAULT is reachable exactly as the message says: amdxdna_client_populate_ranges() walks client->bo_invalid_list, amdxdna_populate_range() returns -EFAULT when mmget_not_zero() or hmm_range_fault() fails over the exporter's vma (amdxdna_gem.c:1658-1698), and aie2_ctx.c:1191 calls the drain before every submit, client-wide — which is why one imported BO poisons every later job including a new context's admission. Imported BOs get their sgt from dma_buf_map_attachment at import time (:1110-1137), not from this list, so nothing that was load-bearing is removed. 0006's hunk sits inside the is_import_bo(abo) branch right after dma_buf_mmap(); 0007 keeps mmu_interval_set_seq() and the MMU_NOTIFY_UNMAP unregister, so it is not an early return.
Two nits:
- The
## Buildingrecipe can no longer produce the fingerprint row this PR adds. Itsgit applylist is still0001 0002 0004 0005 0003, so a reader who follows the copy-paste path builds the shipping stack, not0001..0007; the new row's composition exists only in the table. Two more lines there, with# owner-gated, not installedbeside them, closes it. - Both patch headers carry a placeholder time:
Date: Thu, 5 Nov 2026 13:2x:00 -0400and13:2x:30.git applydoes not care, but 0003/0004/0005 carry real times and this directory's purpose is that the header is the provenance record.
Not verified by me, and correctly not claimed: the runtime behaviour. The pair has never been loaded and /lib/modules is untouched, so the load and the CTS proof stay the owner's, per #812.
CI at this head: build success, CodeQL + 5 Analyze success, hw_gate skipped, pr_agent queued (not red). MERGEABLE, BEHIND.
…ner-gated, NOT installed) durability hole this directory was created to close - the same one that shipped a panicking driver once. They also no longer applied: 0001 rewrote the mmap/invalidate region they touch, so the pair had to be re-expressed on top of the series rather than copied. 0006 don't invalidate an imported dma-buf BO at mmap time 0007 and don't re-invalidate one from the mmu notifier What they fix: an imported BO was put on client->bo_invalid_list, whose only drain path is hmm_range_fault() over a vma the exporter owns, so the client's *next* submit returned -EFAULT for every job - including a fresh context's admission (measured 2026-11-02: import + map succeed, then kernel_queue_create() fails 0x30000000E and the process stays poisoned). Status is deliberately not "carried fix": loading these is the owner's call, and the runtime proof is the owner's run, so the README rows say "carried, NOT installed, owner-gated" and a new section states that no image may pick them up before that word exists. Unlike the TDR series, this pair has never been loaded anywhere. Verified: the exported patches apply in order on top of 0001..0005 in a clean pin worktree, the resulting sources are byte-identical (cmp) to the tree the number below came from, and that tree builds to srcversion 336751493A77C50DE0B50F7 (rc 0, no warnings), now in the fingerprint table.
… the placeholder dates Review of #1134 found two nits, both in the copy-paste path rather than in the patch content: * "## Building" listed only `0001 0002 0004 0005 0003`, so the fingerprint row this PR adds (`... + 0006 + 0007` -> `336751493A77C50DE0B50F7`) could not be reproduced from the recipe. It now has its own block, explicitly the compile proof and not an install path. * both new patch headers carried a placeholder time (`13:2x:00`, `13:2x:30`). Meta only: the hunks are untouched, so the build is unchanged. Verified rather than assumed - the result of applying all seven patches in order to a clean `526c608` checkout is `cmp`-identical to `~/wt/xdna-series-verify/i812{verify,b}` over all 79 files of `drivers/accel/amdxdna`, i.e. the sources that built to `336751493A77C50DE0B50F7` (rc 0, no warnings). `copyright.py --check` clean.
79519af to
75d615b
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
Re-verdicted at 75d615b0 (rebased onto main a56f0e9, so it is mergeable again after going CONFLICTING with #1127). Both nits are closed and, more usefully, closed without touching the thing that was proven:
- The placeholders are real times now:
git show 75d615b -- third_party/patches/amdxdna/*.patchis exactly two lines,Date: … 13:2x:00->13:23:33and13:2x:30->13:23:34. Nothing else in either patch moved. - The
## Buildingblock now covers the pair:third_party/patches/amdxdna/README.md:77-83is a "To reproduce the carried fingerprint row (…+0006+0007->336751493A77C50DE0B50F7)" recipe that runsgit applyon0004,0005,0006,0007in order, labelled as the compile proof and not an install path.
I re-ran the recipe rather than reading it: on a clean copy of 526c6081, git apply --check + git apply for 0001..0007 in filename order gives 0001-0003 already-applied (that baseline is those three) and 0004, 0005, 0006, 0007 apply clean, in order. Then cmp of every .c/.h under drivers/accel/amdxdna against ~/wt/xdna-series-verify/i812verify - the tree I built at 79519af4 that produced srcversion 336751493A77C50DE0B50F7, rc 0, no warnings - is identical for all of them (diff --brief shows only build outputs: .o, .cmd, Module.symvers, config_kernel.h). So the fingerprint row in the README is reproducible from the copy-paste path and my earlier build result stands unchanged; the Date: header is not a build input.
Still carried, NOT installed, owner-gated, as it was: nothing in this PR writes to /lib/modules, modprobes, or touches a module parameter.
PR Reviewer Guide 🔍(Review updated until commit 3002217)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit 3002217 |
Patches only — no code in the engine tree, nothing installed anywhere.
Why: #812's two commits (
~/wt/xdna812/src,ab885d8f+412fdbc4, 2026-11-02) existed only in a scratch tree. That isthe durability hole this directory was created to close, and the same one that once shipped a panicking driver. They also no
longer applied —
0001rewrote the mmap/invalidate region they touch — so the pair is re-expressed on top of the seriesrather than copied:
don't invalidate an imported dma-buf BO at mmap timeclient->bo_invalid_list; its only drain path ishmm_range_fault()over a vma the exporter owns, so the client's next submit returned-EFAULTfor every job, including a fresh context's admission. Imported BOs are left alone;amdxdna_mark_mapp_invalid()loses its last caller and goes with it (the driver builds-Werror)don't re-invalidate imported dma-buf BOs from the mmu notifieramdxdna_hmm_invalidate(), so any real invalidation of the range re-poisoned the client. Skips the marking for imported BOs and keeps the sequence update +MMU_NOTIFY_UNMAPcleanup, which is why it is not simply an early returnStatus is deliberately not "carried fix". Loading these is the owner's call (#812), and the runtime proof is the owner's
run; unlike the TDR series this pair has never been loaded (
/lib/modulesuntouched, nomodprobe, no parameterchanged). The README rows say so, and a new short section states that no image may pick them up before that word exists.
Verified, by building it: the exported patches apply in order on top of
0001..0005in a clean pin worktree, theresulting sources are
cmp-identical to the tree the fingerprint came from, and that tree builds tosrcversion 336751493A77C50DE0B50F7(rc 0, no warnings) — now a row in the README's fingerprint table. The failure thepatch fixes is measured in
FACTS-libamdf.md§9 (0x30000000E= EFAULT fromkernel_queue_create()), so this PR carries thefix, not the claim.
Refs #812.