Repository navigation
kboot: give a firmware-placed live RTKit buffer the carveout the binding needs - #605
Conversation
|
J775c: HDMI works end to end with this stack plus linux#3686/#3689 and the #3682 DT: apple-dcp adopts the live dcpext0 session, HDMI-A-1 connected 2560x1440, boot scanout retired, apple-mcc enables SLC (GPU bandwidth back to 716/863 GB/s at d4/d8). Full row: aurora-silicon/linux#3689 (comment) |
Firmware 27 can advertise both dptx-port endpoints, 0x2a and 0x2c, and
serve the AppleDCPDPTXRemotePort service on either. dcp_dptx_init() took
0x2a whenever it was advertised. On the J775c dcpext0 the RemotePort
service is on 0x2c (dcpdptx-port-epic, units 0 and 1, in macOS's
IORegistry) and 0x2a carries DCPDPService, which announced nothing while
the AP started the ports. RTKit on that DCP has no timeout, so
afk_epic_start_interface() waited on 0x2a without end: the Stage 2
console stopped at the second pair of "AFK: adopted" lines (0x2a's rings)
until the trial watchdog reset the machine.
Where both are advertised, start both and keep the one whose firmware
announces a service the dptx-port ops take; stop the other before the
ports are opened. Where one is advertised, or neither, nothing changes.
Which endpoint is bound still selects the v27 message layout.
AFK:
- afk_epic_select_interface(): of several endpoints started for one
interface, the first whose firmware announces a service it has ops
for. Announcements before the match are dropped and logged; the
matching one stays queued for afk_epic_start_interface(). It waits as
long as afk_epic_start_interface() does.
- The announcement decoding moves out of afk_epic_start_interface()
into afk_epic_decode_announce(), shared by both; what is accepted is
unchanged.
- Candidates start with no notification handler, which would take
their announcements; afk_epic_set_notify() turns it on once the ports
are open.
- The waits that have no bound when RTKit has no timeout now say so
after a second and every five seconds: the first service announcement
("EPIC: still waiting after Ns for a service announcement on endpoint
..."), and a blocking poll with no IOP message ("EPIC: no message from
the IOP for Ns, waiting on endpoint ..."), which covers the START and
SHUTDOWN acknowledgements. The waits themselves are unchanged.
Signed-off-by: Satya Benson <satya@benson.earth>
…ing needs The kernel takes over a DCP handed on running only if every buffer in apple,rtkit-buffers lies in a no-map region the DCP's memory-region names, mapped there through iommu-addresses (the apple,dcp binding). A loader-allocated buffer always gets one. A firmware-placed buffer got none, on the assumption that the DT already describes the firmware's carveout, as it does for the M1 Mac mini (J274) DCP's crashlog in dcp_data. The T6050 external DCPs' firmware places its OSLog buffer itself (0x5ff8 bytes) in memory the DT does not describe, so the kernel refused the whole session and the external display processor stayed unbound. Give a firmware-placed buffer that no such region already holds one of its own: the whole 16K pages it touches, at the IOVA of their start, which the firmware DMAs into and the kernel must never use. A buffer whose pages cannot map that way (its address and IOVA at different offsets in a page) stops the boot like the other descriptions that cannot be made. The buffer itself is still published as the firmware gave it. Signed-off-by: Satya Benson <satya@benson.earth>
a6130e4 to
f8d4f63
Compare
|
J775c (M5 Max Studio) row for the rebased stack at these heads: #589 Stage 2: Linux: |
|
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: HOLD at f8d4f63e
Blockers:
- Stacked on open PR
#591: targets feature branchfix/584-dptx-port-endpoint(which currently has open changes requested onrtkit_access_remote()cache maintenance). Code, tests, hosted CI, and exact-head J775c hardware row for#605itself are clean and ready once#591is resolved and rebased/merged.
Checked:
- Audited
src/kboot.c(dt_live_rtkit_covered(),dt_publish_one_live_rtkit()) andtests/python/test_live_rtkit_description.py(+117/-6). - Verified
dt_live_rtkit_covered()checksmemory-regionphandles for 2-cellu64reg,no-mappresent,reusableabsent, and overflow-free containment (phys >= base && size <= rsize && phys - base <= rsize - size). - Verified
dt_publish_one_live_rtkit()validates every uncovered firmware-placed buffer before mutating the DT (non-zerophys, matchingSZ_16Kpage offset betweenphysandiova,b->iova >= off, overflow guard onphys), aligns the reserved region to full 16 KiB pages (phys -= off,iova -= off,size = ALIGN_UP(b->size + off, SZ_16K)), and keepsapple,rtkit-bufferspublished verbatim with the firmware's byte size. - Verified
test_live_rtkit_description.pycovers existingdcp_datacarveout preservation, T6050 OSLog0x5ff8 -> 0x8000region creation, and fail-hard rejection without partial DT mutation on skewed page offsets. - Hosted CI is green at
f8d4f63e(8/8checks passed:policy,ESP stage 2 vital size,selftest,pr-text,readiness), and exact-head J775c row (#605#issuecomment-7283295510) confirmeddcpext0live RTKit handoff with 3 system buffers,HDMI-A-1 connected 2560x1440, SLC enabled on 32 planes, 0 failed units.
Evidence
- Head SHA:
f8d4f63ece945b0a735a1f9b30454db6fa7779fe(base=fix/584-dptx-port-endpoint,MERGEABLE,8P/0F/0QCI). - Non-blocking nit:
dt_publish_one_live_rtkit()checksb->phys > UINT64_MAX - (b->size + off + SZ_16K)againstu64wraparound, but not the symmetricb->iova > UINT64_MAX - (b->size + off + SZ_16K)(harmless on real DART IOVAs well below 64-bit max).
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at f8d4f63e, after the PRs under it land.
Blockers: none in this PR.
Checked: only firmware-placed buffers that no no-map, non-reusable memory-region of the DCP already holds get a new region. The containment check can't overflow. On the M1 Mac mini, the crashlog sits in dcp_data, so it takes the unchanged path, and your host test covers that shape. The new region is the whole 16K pages at the IOVA of their start. It's refused unless the address and IOVA share their page offset, and every buffer is checked before the tree is touched. The buffer is still published at the firmware's byte size. The J775c row for the rebased stack is at this head with linux#3689. It shows the live RTKit session described and Linux driving HDMI 2560x1440 from dcpext0.
Note (not blocking)
The PR body still says "not yet run on hardware … draft until then" and has no What/Tested/Risk/Not yet sections. The stack row above is that run, so the body can say so.
There was a problem hiding this comment.
Verdict: MERGE at f8d4f63ece94
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited src/kboot.c (dt_live_rtkit_covered(), dt_publish_one_live_rtkit()) and tests/python/test_live_rtkit_description.py (+117/-6).
- Verified
dt_live_rtkit_covered()checksmemory-regionphandles for 2-cellu64reg,no-mappresent,reusableabsent, and overflow-free containment (phys >= base && size <= rsize && phys - base <= rsize - size). - Verified
dt_publish_one_live_rtkit()validates every uncovered firmware-placed buffer before mutating the DT (non-zerophys, matchingSZ_16Kpage offset betweenphysandiova,b->iova >= off, overflow guard onphys), aligns the reserved region to full 16 KiB pages (phys -= off,iova -= off,size = ALIGN_UP(b->size + off, SZ_16K)), and keepsapple,rtkit-bufferspublished verbatim with the firmware's byte size. - Verified
test_live_rtkit_description.pycovers existingdcp_datacarveout preservation, T6050 OSLog0x5ff8 -> 0x8000region creation, and fail-hard rejection without partial DT mutation on skewed page offsets. - Hosted CI is green at
f8d4f63e(8/8checks passed:policy,ESP stage 2 vital size,selftest,pr-text,readiness), and exact-head J775c row (#605#issuecomment-7283295510) confirmeddcpext0live RTKit handoff with 3 system buffers,HDMI-A-1 connected 2560x1440, SLC enabled on 32 planes, 0 failed units.
Follow-ups (not blocking): Merge parent #591 first; follow-ups: symmetric iova overflow check nit
Signed-off-by: Satya Benson <satya@benson.earth>
…-carveout Signed-off-by: Satya Benson <satya@benson.earth>
|
Merged main 2a7854a via the branch below, no conflicts. |
|
Merged #602 ( |
|
J775c (M5 Max) row: a Stage 2 built from aura main |
|
J775c (M5 Max Studio) Stage 2 hardware row at the updated heads: #591
|
|
Merging at |
On the M5 Max Mac Studio (J775c), Stage 2 hands dcpext0 (HDMI) over running and describes its RTKit session, but the kernel refuses it:
The third buffer is the OSLog buffer the T6050 external DCP firmware places itself (
rtkit(dcp): pre-allocated oslog buffer (dva 0x100039b4000, phys 0x10fd71dc000, size 0x5ff8)), in memory the DT does not describe. Theapple,dcpbinding requires everyapple,rtkit-buffersentry to lie in a no-map region the DCP'smemory-regionnames, mapped there throughiommu-addresses;dt_publish_live_rtkit()gave one only to loader-allocated buffers and assumed the DT already describes the firmware's carveout, as it does for the M1 Mac mini (J274) DCP's crashlog indcp_data(the working reference, #564 and aurora-silicon/linux 46d51a741dcf).This gives a firmware-placed buffer that no such region already holds one of its own: the whole 16K pages it touches, at the IOVA of their start. The firmware DMAs into those pages, so they are never the kernel's to use. A buffer whose address and IOVA sit at different offsets in a page cannot be mapped that way and stops the boot, like the other descriptions that cannot be made. The buffer is still published exactly as the firmware gave it (OSLog states its size in bytes).
The kernel side, aurora-silicon/linux#3689 (on #3686), takes a firmware-placed OSLog buffer whose size is not a whole page, as RTKit itself does; both are needed for the J775c handoff.
Stacked on #602.
Tested:
tests/pythonat the PR head on macOS (1501 passed, 60 skipped);test_live_rtkit_description.pycovers a firmware buffer inside a DT carveout (no new region), the J775c OSLog shape outside the DT (a 0x8000 no-map region at the page-aligned IOVA, buffer published as 0x5ff8), and a buffer whose pages cannot map (boot stops, nothing described). clang-format clean. Not yet run on hardware: the J775c row with linux#3689 is next; draft until then.Risk: two-way door. Only adds reserved-memory regions for firmware-placed live RTKit buffers that no existing DCP carveout holds; Macs whose firmware buffers already sit in a DT carveout (M1 Mac mini) get the same tree as before.