Repository navigation
proxy: kboot: hand a live post-M4 ANS session to Linux as boot= does - #403
DjDeveloperr wants to merge 3 commits into
Conversation
How this interacts with #410#410 as it stands today: no conflict. #410 changes how The receivers differ. Ryan's failure (aura#406) is a receiving aura stage faulting in Evidence (J773g, T8132, 27.2): this keep is in images built from 1a08e86 + ecbe6ba. On the proxy kboot path, the chainloaded image starts ANS from off, then hands it to Linux live.
The coming rework of #410. If it drops T8132 out of
Assisted-by: LLM (Claude:Opus 5.5) |
|
#410 is merged now, and on main
After the rebase, the row to run is a proxy kboot on the J773g. It should show Assisted-by: LLM (Claude:Opus 5.5) |
|
Blockers: 2. Building on the comment above. Its three points still stand at d496c7e: the predicate is a no-op on T8132 now that main's
The hardware evidence is from ecbe6ba on a pre-#305/#410 base; this head has not been booted, and after #410 it would not even select the live branch on the J773g. HW row: J773g (T8132, 27.2 firmware), rebased head, proxy kboot via linux.py, default command line: Assisted-by: LLM (Claude:Opus 5.5) |
d496c7e to
63c1d74
Compare
|
Rebased cleanly onto
Local checks: Assisted-by: LLM (Gemini:4 Neon) |
|
Re-checked at 63c1d74 (the real commit under the trailing github-actions "gfya" commit).
Still missing (nothing has been booted at this head yet):
Assisted-by: LLM (Claude:Opus 5.5) |
When a proxy kboot (P_KBOOT_PREPARE_DT, then P_KBOOT_BOOT) runs on a post-M4 ANS controller that Linux adopts live (NVME_T8132 with non-secure registers), kboot_prepare_dt() builds the tree before the next-stage nvme_shutdown(). Because nvme_keep_running_for_linux was never set on the proxy path, nvme_sart_entries() described ANS as powered off and nvme_shutdown() powered T8132 ANS off on main (post-#410), breaking Linux's NVMe adoption. Make a proxy kboot use the same Linux-handoff condition that nvme_shutdown() already acts on for payload.c's boot= (nvme_initialized && nvme_type == NVME_T8132 && !nvme_secure_regs), without introducing a chip list. Bound nvme_keep_running_for_linux to a single handoff by clearing it once the Linux branch in nvme_shutdown() runs and on failed P_KBOOT_PREPARE_DT / P_KBOOT_BOOT, P_VECTOR (chainload), P_NVME_INIT, and P_NVME_SHUTDOWN. Add host unit test coverage in tests/python/test_nvme_adoption.py for both the prepare_dt -> Linux-handoff -> cleared path and the aborted prepare_dt -> stage-to-stage power-off path. Signed-off-by: Diljit Singh <hey@djdev.me>
6d21ac7 to
e234040
Compare
|
@RyanTheTide Dropped the trailing Remaining: J773g proxy kboot ( Assisted-by: LLM (Gemini:4 Neon) |
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: REQUEST CHANGES at e234040a
Blockers:
- Branch is
CONFLICTINGwithmain. Rebase/merge currentmainso the PR isMERGEABLEand full CI executes cleanly. - Missing exact-head proxy kboot hardware verification. Post a live proxy kboot (
P_KBOOT_PREPARE_DT->P_KBOOT_BOOT) hardware row on a post-M4 Mac confirming live ANS handoff to Linux at the rebased head.
Checked:
- Metadata and diff summary (
+63/-2, 4 files),CONFLICTINGagainstmain.
Evidence
e234040aconflicts with currentmainand still lacks live proxy kboot hardware verification.
Dismissed under the 12-01 merge bar: this review's blockers were not shown failures (CI/rows/rebase/design or re-run asks). Follow-ups, not blocking: Only metadata checked; follow-ups: rebase, post-M4 proxy kboot ANS handoff row
Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Forward-merged main dfe97a4 as 069e349. The two proxy conflicts keep the raw-vector display refusal and the failed-kboot error reply alongside the ANS flag cleanup. The boot-refusal fixture now checks that cleanup runs on refusal. Ran the NVMe adoption, poisoned I/O, kboot DT and display-refusal pytest files together (63 passed). J773g still needs a live proxy prepare → Linux boot proving ANS adoption, plus the prepare → chainload control. |
RyanTheTide
left a comment
There was a problem hiding this comment.
A retry can boot a prepared tree that says ANS stays live after the proxy has cleared the live handoff request. After successful PREPARE_DT, let the first BOOT return S_ERROR because a secondary callback is still pending. That branch leaves dt_ready set, but the proxy clears the NVMe flag. Once the callback completes, a second BOOT without PREPARE_DT accepts the old tree and normal shutdown can power ANS off. I reproduced the accepted stale-tree retry with the exact prepared-DT host fixture and a controllable pending-callback stub. Clearing the handoff request needs to invalidate the associated prepared tree, or the retry must retain the handoff state it describes.
A proxy P_KBOOT_PREPARE_DT on a live post-M4 ANS session builds a tree that says ANS stays running, and asks nvme_shutdown() to leave it so. A refused P_KBOOT_BOOT (a secondary callback is still pending, say) drops that request but left the prepared tree bootable: a second P_KBOOT_BOOT without a new preparation was accepted, nvme_shutdown() powered ANS off, and Linux got a tree that says it is running, without the SART entries to start it. P_NVME_INIT and P_NVME_SHUTDOWN between the preparation and the boot did the same. Record with the tree that it relies on the handoff, and refuse it in kboot_boot() once the request is gone, as for a display handoff that changed: the host prepares the tree again. A tree that does not rely on it can still be retried, and boot= is unchanged. The host test runs the proxy's own request handlers: prepare, refused boot, retry, and prepare followed by a chainload as the control. Reported-by: Ryan Murray <ryan@aurorasilicon.org> Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Fixed the retry Ryan found. New head: What happened: Fix (10 lines in Tests: the new host test runs the proxy's own Not yet: nothing has been booted at this head. The proxy prepare and Linux boot, and the prepare and chainload control, are still needed on hardware. The pending-callback retry itself is host-tested only. |
What: A proxy kboot (
linux.py:P_KBOOT_PREPARE_DT, thenP_KBOOT_BOOT) on a live post-M4 ANS session now hands that session to Linux, asboot=already does. Without it the tree says ANS is off andnvme_shutdown()powers it off, and Linux loses its root. A tree that relies on the live handoff can no longer be booted after the handoff was dropped (found by Ryan).Tested: Host only at 2e811c7: 65 pytest cases pass with gcc and with clang, Stage 1 and ESP Stage 2 build. Nothing has been booted at this head. The first version of this change (ecbe6ba, before #410) booted on J773g with macOS 27.2 firmware:
nvme-appleadopted the live session and mounted the NVMe root.Risk: two-way door · proxy kboot only, on Macs with a T8132-type ANS and non-secure registers (M4, M4 Pro/Max, M5 and Neo).
boot=, M1 to M3 and T8152 are unchanged.Not yet: a proxy prepare and Linux boot that adopts ANS, and the prepare, then chainload control, on an M4 mini; the same boot on a Neo, including stock handback. The refused-boot retry is covered by the host test only.
Details
nvme_keep_for_kboot()uses the conditionnvme_shutdown()acts on forboot=(nvme_initialized && nvme_type == NVME_T8132 && !nvme_secure_regs), not a chip list.nvme_shutdown()ran, on a failedP_KBOOT_PREPARE_DTorP_KBOOT_BOOT, and onP_VECTOR,P_NVME_INITandP_NVME_SHUTDOWN.kboot_prepare_dt()records whether the tree relies on the live handoff.kboot_boot()refuses such a tree once the request is gone (kboot: ANS handoff changed; prepare the device tree again), before it touches hardware, as it already does for a display handoff that changed. A tree that does not rely on it can still be retried.Evidence
At 2e811c7 (base dfe97a4),
CC=gccandCC=clang:test_nvme_adoption.py test_nvme_poisoned_io.py test_kboot_prepared_dt.py test_t8140_display_refusal_contract.py: 65 passed each.test_smp_handoff_gate.py test_m4_ans_fdt.py test_ctxr_exec_window.py test_t6040_hibernate_layout.py test_usb_dma_reserve.py: 18 passed each.src/kboot.cfrom 069e349, the newtest_live_ans_tree_is_not_booted_without_its_handofffails: the secondP_KBOOT_BOOTis accepted. The chainload control passes with and without the fix.clang-format --dry-run --Werror src/kboot.c src/nvme.c src/nvme.h src/proxy.c: clean.make USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 BUILTIN_LOGO=aurora: 95616 B headroom; withESP_STAGE2=1: 78728 B.