Repository navigation
soc: apple: sep: add HDCP 2.2 transmitter client (ep 0x0e) - #3256
Merged
Merged
Conversation
Declare the in-kernel API through which the display driver drives HDCP 2.2 transmitter authentication on the Apple SEP (endpoint 0x0e). Only clear-text protocol fields (r_tx, cert_rx, r_rx, Ekpub(km)/stored km, H', pairing Ekh(km), r_n, L', Edkey(ks), r_iv, ReceiverID list, V'/V, stream type, M') cross this boundary; km, ks, kd and device keys never leave the enclave. Provide inline -ENODEV/false/no-op stubs when CONFIG_APPLE_SEP_HDCP_INTERFACE is disabled so display driver builds without CONFIG_APPLE_SEP link cleanly. Signed-off-by: Ryan Murray <[email protected]>
Implement the Apple SEP HDCP 2.2 transmitter endpoint (0x0e, 'hdcp') in drivers/soc/apple/hdcp.rs and expose it to the display driver through the built-in C shim (hdcp_shim.c) backing include/linux/apple-sep-hdcp.h. - Validate the endpoint's discovery descriptor and OOL layout config word before use; allocate persistent 16 KiB inbound/outbound OOL buffers and retain registered buffers on remove(). - Enumerate the enclave's HDCP interface channels at runtime with commands 0x27 and 0x28 rather than hard-coding a per-SoC channel count. - Enforce the closed 26-command wire table and per-channel HDCP 2.2 state machine (first-time pairing, stored km, bounded locality-check and repeater stream-manage retries, repeater ReceiverID list and V'/V, finish, encryption on/off, teardown from any open state). - Synchronise outbound OOL reads with repoison/await-written, scrub buffers after each exchange, return -EAGAIN while SEP bring-up or sleep gating is active, and quarantine the endpoint until reset if a command goes unanswered. - Add Rust KUnit suite apple_sep_hdcp (13 cases), C KUnit suite apple_sep_hdcp_shim (6 cases), and host check test_hdcp_client.py wired into sep-source.yml. Signed-off-by: Ryan Murray <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…plies Command 0x28 (GetChannelInfo) is indexed by interface slot 0..count-1 from command 0x27, while info[0] carries the interface's actual HDCP channel ID. On T6040 the 14 interfaces advertise channel IDs 0..5 and 7..14 (skipping channel 6), so requiring info[0] == index rejected enumeration with -EIO on every attempt. Record the enumerated channel IDs in a bitmask so sparse channel sets are validated accurately against hardware-reported IDs, extend KUnit with a sparse-table case, and log unexpected reply words (status/length only, never payload bytes) plus OOL registration failures. Signed-off-by: Ryan Murray <[email protected]>
Contributor
Author
|
Exact-head hardware rows at
|
Contributor
Author
|
Non-author adversarial review at Blockers: none. Checked
Non-blocking follow-ups
|
RyanTheTide
added a commit
that referenced
this pull request
Nov 27, 2026
Resolve the on_discovery() conflict with the HDCP client (#3256): keep the PR's late-discovery refresh of the attach-only endpoints and main's hdcp_discovered() call. Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
added a commit
that referenced
this pull request
Nov 27, 2026
Resolve the remove() conflict with the HDCP client (#3256): wake both the xars and hdcp waiters. The auto-merged parts keep the hdcp and xars OOL buffers and discovery hooks side by side. Signed-off-by: Ryan Murray <[email protected]>
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.
What:
Add the in-kernel Apple SEP HDCP 2.2 transmitter client for SEP endpoint
0x0e(hdcp), exposing a narrow C interface (include/linux/apple-sep-hdcp.h) for the display driver (drm/apple) to run HDCP 2.2 authentication without any key material leaving the enclave.include/linux/apple-sep-hdcp.h: declares the per-channel transmitter API (apple_sep_hdcp_open,ake_cert,ake_h_prime,ake_pairing,lc_init,lc_l_prime,ske,repeater_list,repeater_stream,finish,set_encryption,close,available) carrying only clear-text HDCP 2.2 protocol fields (neverkm,ks,kd, or device keys), plus inline-ENODEV/false/no-op stubs whenCONFIG_APPLE_SEP_HDCP_INTERFACEis disabled.drivers/soc/apple/hdcp.rs: implements endpoint0x0ediscovery (descriptor + OOL layout config check), persistent 16 KiB OOL buffers, runtime sparse-aware interface-channel enumeration (0x27/0x28bitmask from per-interface channel IDs, no hardcoded per-SoC channel table), closed 26-command wire table, per-channel protocol state machine (first pairing, storedkm, bounded locality-check and repeater stream-manage retries, repeaterReceiverIDlist andV'/V, finish, encryption on/off, teardown from any open state), outbound OOL repoison/await-written synchronisation and buffer scrubbing,-EAGAINbeforePHASE_READYor under sleep gating, non-secret reply-word diagnostics on failed commands, and endpoint quarantine on unanswered commands.drivers/soc/apple/hdcp_shim.c&shim.h: built-in C registration shim matching thefv_shim.cpattern, with argument validation,kfree_sensitive/memzero_explicitbuffer hygiene, and output zeroing on error.drivers/soc/apple/sep.rs: wires discovery, dispatch, kernel API registration/unregistration, waitqueue wake, and retaining registeredool_hdcpbuffers onremove().apple_sep_hdcp(13 cases, incl. sparse channel tables), C KUnit suiteapple_sep_hdcp_shim(6 cases), andtools/aurora-sep/tests/test_hdcp_client.pywired into.github/workflows/sep-source.yml.Tested:
c02408deMac mini (J473, T8112,7.3.0-aurora-hdcp9, all 10 PR files byte-identical): PASS — real SEP ep0x0efirst-pairing and 5x stored-kmsessions (Open/Prepare/Start/GetRtx,PutCert,PutRrx,QueryStoredKmNotStored->Stored,GetEkpubKm,PutHContext,PutHPrimeverified,PutPairing,GetRn,LcStart,PutLPrimeverified,GetEks,GetRiv,Close),s2idle1/1, 0 SEP errors, 0 AVCs, 0 failed units, Enforcing; restored to7.3.0-aurora-fleet89.c02408deMacBook Pro 16" (J616s, T6040,7.3.0-aurora-hdcp9, all 10 PR files byte-identical): PASS — sparse channel table (0..5, 7..14, skipping 6) enumerated cleanly, 5 live AKE sessions on channel 7 (GetRtx,PutCert,PutRrx,QueryStoredKm,GetEkpubKm,Close),s2idle1/1, existing SEP endpoints (Touch ID, xART, trusted-keys, hwrng) healthy, 0 SEP errors, 0 failed units, Enforcing; restored to7.3.0-aurora-fleet89.sep.kunitconfig,LLVM=1):apple_sep_hdcp13/13 PASS,apple_sep_hdcp_shim6/6 PASS, fullapple_sep*336/336 PASS (0 warnings in new/changed files).CONFIG_APPLE_SEP=m,CONFIG_APPLE_SEP_KUNIT_TEST=n, fleet89 config,LLVM=1):drivers/soc/apple/apple-sep.oandhdcp_shim.ocompile cleanly.CONFIG_APPLE_SEP_HDCP_INTERFACE=n,clang -target aarch64-linux-gnu -Wall -Werror): PASS.sep-source.ymlPython tests +test_hdcp_client.py(4/4 underpython3andpython3 -O) +test_log_ratelimit.py(5/5) +tools/asahi/run-host-tests.py --only sep(23/23): PASS.scripts/checkpatch.pl --strict: 0 errors, 0 code warnings, 0 checks.Risk:
two-way · all Macs with Apple SEP (
apple-sep,CONFIG_APPLE_SEP_HDCP_INTERFACE). Nothing sends messages on endpoint0x0euntil a display driver consumer opens a session; existing SEP endpoints are untouched.Not yet:
drm/appleDCP relay (tracked by the display HDCP driver PR stacking on this interface).