Repository navigation
drm/apple: dcp: take a firmware-placed live OSLog buffer sized in bytes - #3689
Conversation
dcp_rtkit_live_parse() requires a firmware-placed (is_mapped == 1) buffer to be whole 4 KiB pages. That holds for crashlog, syslog and IOReport, which RTKit requests in pages, but OSLog states its size in bytes and only its address in pages, which is how RTKit itself takes an inherited OSLog buffer over (apple_rtkit_inherit_buffers()) and how the binding describes the cell. The T6050 external DCPs' firmware places its own OSLog buffer of 0x5ff8 bytes. A boot stage that hands such a DCP over running describes it as it is, and the adoption failed with a bare "Invalid live RTKit handoff" (-EINVAL), leaving the display processor unbound. Take a firmware-placed OSLog buffer of any size at a 4 KiB-aligned address; the other endpoints and loader-allocated buffers keep their rules. Say which tuple was refused, so the next such failure names it. The buffer must still lie in one of the DCP's no-map carveouts. Signed-off-by: Satya Benson <[email protected]>
|
J775c trial row: kernel linux main + #3686 + #3689 ( HDMI works end to end, and SLC is back. Stage 2 hands over dcpext0 with its live RTKit session ( DRM: One-run rows vs the same machine without the handoff (SLC off) and vs the earlier chain:
One run each; the d4 bandwidth difference from the earlier chain is not yet separated from run-to-run noise. Not yet tested: HDMI audio, a desktop session on this connector, suspend, hotplug, and the dcpext1 Type-C paths. |
|
Merge readiness at
Areas: 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 91ed6a22
Blockers:
- Stacked on unmerged
linux#3686(base=fix/dart-four-level-live-import). Build/KUnit/host-test workflows have not executed on this PR againstmain; wait for#3686to merge and retarget ontomainso full CI passes. - Missing second-generation live-handoff regression row (
Not yet). Alongside the J775c ~30-boot HDMI proof, post a live-handoff regression row on another Mac generation once rebased ontomain.
Checked:
- Full 2-file diff (
drivers/gpu/drm/apple/dcp.c,drivers/gpu/drm/apple/dcp_handoff_test.c,+19/-3),MERGEABLEagainstfix/dart-four-level-live-import. dcp_rtkit_live_buf_valid()permits non-4K-alignedsizestrictly for firmware-placed (is_mapped == 1) OSLog (ep == 8) buffers while still enforcingsize > 0 && size <= SZ_16M, noiova + sizeoverflow, 4 KiBiovaalignment, and full page alignment on allis_mapped == 0and non-OSLog endpoints; KUnit covers all 4 cases.
Evidence
- Code and KUnit cases are clean and verified on J775c (
0x5ff8OSLog buffer); awaiting#3686merge, full CI onmain, and a second-generation regression row.
There was a problem hiding this comment.
Verdict: MERGE at 91ed6a22ef5e
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: - Full 2-file diff (drivers/gpu/drm/apple/dcp.c, drivers/gpu/drm/apple/dcp_handoff_test.c, +19/-3), MERGEABLE against fix/dart-four-level-live-import.
dcp_rtkit_live_buf_valid()permits non-4K-alignedsizestrictly for firmware-placed (is_mapped == 1) OSLog (ep == 8) buffers while still enforcingsize > 0 && size <= SZ_16M, noiova + sizeoverflow, 4 KiBiovaalignment, and full page alignment on allis_mapped == 0and non-OSLog endpoints; KUnit covers all 4 cases.
Follow-ups (not blocking): Merge parent #3686 first; follow-ups: retarget, full CI (2nd-gen row not required)
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at 91ed6a22. Only a firmware-placed OSLog can use a byte-sized buffer. The address alignment, overflow and size checks, and carveout checks still apply. KUnit covers the reported tuple and rejects an unaligned address, another endpoint, and a loader-allocated buffer. The J775c target and J773g regression rows cover the handoff. Apple build and KUnit against main are still pending.
dcp_rtkit_live_parse()requires a firmware-placed (is_mapped == 1) buffer inapple,rtkit-buffersto be whole 4 KiB pages. That holds for crashlog, syslog and IOReport, which RTKit requests in pages, but OSLog states its size in bytes and only its address in pages. That is how RTKit itself takes an inherited OSLog buffer over (apple_rtkit_inherit_buffers()), and the binding describes the cell as a size in bytes.The T6050 external DCPs' firmware places its own OSLog buffer of 0x5ff8 bytes (
rtkit(dcp): pre-allocated oslog buffer (dva 0x100039b4000, ..., size 0x5ff8)in the boot stage's log). On the M5 Max Mac Studio (J775c), with Stage 2 handing dcpext0 (HDMI) over running, the adoption failed with no hint of which tuple was refused:This takes a firmware-placed OSLog buffer of any size at a 4 KiB-aligned address. The other endpoints and loader-allocated buffers keep their rules, and every buffer must still lie in one of the DCP's no-map carveouts. A refused tuple is now named in the log.
The boot-stage side, aurora-silicon/aura#605, gives that OSLog buffer the no-map carveout the binding requires (it had none, which would have failed the next check with -EACCES). Both are needed for the J775c handoff.
Stacked on #3686.
Tested: arm64 build of the J775c trial config at the PR head (no new warnings in drivers/gpu/drm/apple). KUnit
apple-dcp-handoffon arm64 QEMU with 16K pages (CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST): 3/3 pass at the PR head; with onlydcp.creverted to the base,dcp_handoff_live_rtkit_buf_validfails on the J775c OSLog tuple (dcp_rtkit_live_buf_valid(8, 0x100039b4000, 0x5ff8, 1)false), as on the boot above. On hardware: J775c withmain+ #3686 + this head + #3682 and aura#605's Stage 2 has booted about 30 times since Nov 30 on the default command line: noInvalid live RTKit handoff, the dcpext0 DCP binds (bound 2b2e00000.dcp), and HDMI shows the console and the greeter.Regression: J773g (M4) boot of this head: DCP OSLog carve-outs reserved, display connected, 0 failed units (#3686 (comment)).
Not yet: nothing.
Risk: two-way door. Only widens what a firmware-placed OSLog entry of a live DCP handoff may give as its size; other entries, and DCPs without a live handoff, are unchanged.