Repository navigation
omacom sync: M3 Air GPU lane (GPUVM deferred close fixes; T8122 runtime held) - #772
Closed
RyanTheTide wants to merge 5 commits into
Closed
RyanTheTide wants to merge 5 commits into
RyanTheTide wants to merge 5 commits into
Conversation
Return success when a VM BO has no mappings instead of returning an uninitialized stack value. Deferred-close cleanup can reach this case; a garbage error return marks cleanup failed and blocks the VM. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 2151a34) Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Allow immediate-mode drivers to remove selected mappings of one GEM without allocating an operation list. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit a8f459d) Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A dma-buf reimport can return the same GEM while cleanup for a closed handle is queued. Stamp each binding and remove only mappings covered by the close-time sequence, preserving later maps instead of unmapping them. Keep the indexed BO path when no newer binding exists. A map step that takes its sequence after the close snapshot survives deferred cleanup. [ryan: the VmBoData initialisers follow our SG lease and prepare_sgt_segments() setup; drop_mappings_before() gains the SAFETY comment its exec_lock() call carries elsewhere] Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja> (cherry picked from commit 13c3371) Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
aurora-wip moved after this lane branched (integration/aurora merge and others). Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
aurora-wip now takes GpuVm::exec_lock_vm() for every VA update, and drop_mappings_now() unmaps under the VM reservation alone (f3cc4a6, "drm/asahi: lock only the VM reservation for VA updates"). The deferred close path from omacom 13c3371 was written against the full exec_lock(), which also locks the reservation of every external object, and the merge kept that call. Use exec_lock_vm() there too. The newest-binding check still runs under the lock every bind takes, and the unmap needs nothing more than the VM reservation and each object's gpuva lock, as in drop_mappings_now(). Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Contributor
Author
|
Folded into the single omacom up-port branch omacom-sync/all (head b463cf8), which carries this lane unchanged as a merge. One PR for the whole up-port follows once the combined kernel has passed the hardware regression run. Per-commit verdicts above stay as the record. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
omacom sync, lane m3. This brings the three independent GPUVM and deferred close fixes from the omacom M3 series and records a verdict for all 20 commits in the lane. The T8122 (M3 MacBook Air) GPU runtime itself is held, for the reasons below.
What this brings
drm/gpuvm: initialize BO unmap result.drm_gpuvm_bo_unmap()returned an uninitialisedretwhen a VM BO had no mappings left. Our deferred close path can reach that case, and a garbage error marks the cleanup failed.rust: drm: gpuvm: add filtered object unmap. Addsunmap_object_where(), an allocation-free walk that removes only the mappings of one GEM that a filter selects.drm/asahi: keep new bindings after deferred GEM close. A dma-buf reimport can return the same GEM while the cleanup for a closed handle is still queued. Before, that cleanup removed every mapping of the GEM, including ones bound after the close. Each binding now carries a sequence number, and the deferred cleanup removes only what the close covered. Adapted for our SG lease setup (prepare_sgt_segments()).The deferred close path (
mmu/lifetime.rs) runs on VMs createdwith_status(G17, Neo) orwith_tracked_status(G15, G16 on the J616s). G13/G14 VMs have no lifetime and keepdrop_mappings_now(), which is unchanged. The only new work on M1/M2 is one atomic increment per map step.Per-commit verdicts
e51f1082fa23Generated-by: LLM). Lands only with the parameter layer replaced by identity constants, see belowad52c9b317f6__parammacro, starts only through theasahi.t8122_startexperiment, and on 7.3 conflicts in driver.rs, file.rs, gpu.rs, mmu.rs; after resolving those it still fails to build (16 rustc errors, see Gates)d8ecb2e70637APPLE_T8122_GPU_PMP_LINKis only selected byDRM_ASAHI_M3_T8122, so it is dead code until the runtime lands. Conflicts with our T8132 report branch (trivial)8e864a57c40egpu::Gpu::unknown_page()whose only non-default user is the runtime75c5823f60b3m3_submit.rs)d2666d8ca7a5m3_runtime.rs)e8023bba60e6m3_compute.rs)4888ad0a0fa6d8ecb2e70637; goes in with it9dff537d1732DRM_ASAHI_UAT_ADOPTION; ours gates the same items onany(G15, G16)for the J616s handoff, so every hunk in mmu.rs/pgtable.rs needs rework to keep G16. Needs its build fix follow-up (omacom PR 256) and touches g15/ (g15 lane)2151a3442ee9drm_gpuvm_bo_unmap()returns uninitialisedretfor a VM BO with no mappings; our tree had ita8f459d96480unmap_object_where(), needed by the next commit; existing callers keep their behaviour13c3371ce23dexec_lock_vm()after the aurora-wip merge61eccdbbee80m3_batch_policy.rshas no other caller)6246daaee9d280958cd5a4958a31fe185686DRM_ASAHI_M3_T8122andDRM_ASAHI_G15in asahi.config (DJ's file; G15 is the g15 lane's call) and makes the start a board default through the knob layer (start_for_board) while keepingasahi.t8122_start=0and the state 2 of 5 cap. The intent (start by identity on J613/J615) is what we want, but it has to come from the knob-free rewritefc5391123e5a8a31fe185686's knob semantics18c64047548cm3_client.rsof the runtime uses it; take it with the runtime1032928116c16c66b41af3e7fops.ownerfrom the driver'sOwnerModule(3ef9758, rust/kernel/drm/device.rs:211);drm::Driver::MODULEdoes not exist here, so the commit would not buildWhy the T8122 runtime is held
Our tree dropped the runtime on purpose during the unified 7.2.10 port (2026-10-18). The M3-only split commits (for example 700bfca, 1de2dbd, 997a7db) say the backend is compile-only and that registration and the shared GPUVM and event wiring remain pending. 80797e4 gates the four M3 compatibles to
-ENODEVbefore any resource setup. The port report stopped at the mechanical port boundary and listed four open design points: an event and runtime owner that works across optional render node registration, current GPUVM retained backing, replacement fault and I/O map interfaces, and the shared UAPI. The T8122 register list and InitData provenance hold was cleared later (bc0a841, ed90e7b, 278d0ab, 7231c0b, 6ad3570, 1e8f813). So this was a deferral waiting for a redesign, not an accident of the rebase, and nothing replaced it.omacom ad52c9b317f6is that redesign done on 7.2, and it answers most of the open points (registration throughdrm::Registration, the completion worker owned by the RTKit state, the shared VM job lifetime,Uat::new_adopted). It still cannot come in as it is:m3_param!macro, which writes rawkernel_paramentries into__paramand bypassesmodule!. Four of them are writable at run time. The T8122 start is an "experiment" (t8122_knobs.rs,t8122_start.rs) armed byasahi.t8122_start, withasahi.t8122_*overrides for InitData version, Fender size, clock generator, SGX setup, both unit masks and a performance state cap that defaults to 2 of 5. Aurora selects behaviour from DT, chip and firmware identity and Kconfig, so this layer has to become identity-selected constants first. That rewrite touches most of the roughly 15,000 lines the runtime adds, and we have no M3 to check that a rewritten start still starts.DRM_ASAHI_M3_T8122isdefault nand depends onDRM_ASAHI_G15, which our universal config leaves off. Turning it on means editingasahi.config(DJ's file), whichomacom 8a31fe185686does together with turning G15 on. That is a decision for DJ and Ryan, and the G15 part belongs to the g15 lane.driver.rs,file.rs,gpu.rs,mmu.rs,pmp-report.c,Kconfig,Makefile,asahi_core.rsandpgtable.rs.omacom 9dff537d1732gates the shared UAT adoption on a newDRM_ASAHI_UAT_ADOPTION, while ours gates it onany(G15, G16)for the J616s handoff, so it needs a rework that also covers G16. Its follow-up (omacomPR 256, three morecfgfixes) is not in this lane.9dff537d1732left out,CONFIG_DRM_ASAHI_G15=y CONFIG_DRM_ASAHI_M3_T8122=y), rustc stops at 16 errors in its first pass, so more may follow once these are fixed. Three arem3_params.rsasking for theasahi.t8122_hwdata_418cparser that our 229652c removed on purpose because it was a knob. Four arecrate::THIS_MODULE, which our module layer no longer provides. The rest is API drift:gpu::Gpu::new_queueandmap_timestamp_buffersignatures, a duplicateF32::to_bits,Coherent::dma_handle, and type changes inm3_device.rs,m3_submit.rsandmmu/m3.rs. The pmp-report part builds. The trial ref is kept locally on the buildbox and is not pushed.What has to happen for the runtime to land: rewrite the parameter layer as T8122 identity constants (keep the values of today's defaults), decide the performance state cap, rework the UAT adoption gate to include G16, get a clean
W=1build withDRM_ASAHI_M3_T8122=yandG15=n, agree theasahi.configchange with DJ, and boot it on a J613 or J615. The commits that only make sense with the runtime (the pmp-report T8122 wait, the dummy page hook, the quarantine and start fixes, DJ's client admission size fix) go in with it.Gates
Base for every comparison: aurora-wip e4b030d (the tip this branch merges). Head 2d5d141.
Image modules dtbs)drivers/gpu/drm/drm_gpuvm.oanddrivers/gpu/drm/asahi/(rebuildsrust/kernel)run-host-tests.pyBefore the aurora-wip merge the same three commits on 3f53cb3 also gave 0/0 warnings, identical KUnit (995 run) and identical host tests (148 ok and the same 10 pre-existing avd-av1-tail failures that #754 has since fixed). There is no KUnit suite for
drm_gpuvm.cor the Rust gpuvm binding in this config.Hardware plan (not run here)
Artifacts: buildbox
/srv/aurora/fast/o/omacom-sync-20261101/m3/out-final/(release7.3.0-aurora-omsync-m3: Image, modules tar.zst, dtbs, release.config, SHA256SUMS).The changed code is the shared GPUVM unmap and the deferred close path. It runs on every machine; the deferred close part only on VMs with job lifetime tracking (G17, G15, G16).
dmesg -p3 | wc -l,aurora-diag check --expect. Run the GPU regression gate andgpubench-stress --all --kernel-log(exit and kill with work in flight cover deferred close). Then a dma-buf reimport workload: GNOME session with screenshots and screen recording, Firefox video, close and reopen apps repeatedly; look for GPU faults,MMU: deferred object unmap failed, or VMs left with cleanup failed.with_tracked_status, so deferred close runs here too.drop_mappings_now(). Check dmesg and aurora-diag, and run a short headless GPU job loop (for example the CTS smoke set or vkcube offscreen) to cover thedrm_gpuvm_bo_unmap()change and the new per-map sequence counter.What only omacom hardware can prove
Nothing in this PR runs only on M3 hardware. The deferred close fix was reported by its author against an M3 Pro (G15) with KWin (50/50 GPU regression cases, 10 Settings launches, 10 theme cycles, no faults). That claim is theirs and we did not reproduce it. On our machines the same code runs on the J616s (G16) and the Neo (G17).
🤖 Generated with Claude Code