Skip to content

ipc4: helper: reject cross-core modules early when unsupported - #11375

Open
ujfalusi wants to merge 1 commit into
thesofproject:mainfrom
ujfalusi:peter/pr/ll-no-crosscore-fix
Open

ujfalusi wants to merge 1 commit into
thesofproject:mainfrom
ujfalusi:peter/pr/ll-no-crosscore-fix

Conversation

@ujfalusi

Copy link
Copy Markdown
Contributor

With CONFIG_SOF_USERSPACE_LL the IPC4 module commands run in a user thread which cannot issue IDC messages. CONFIG_CROSS_CORE_STREAM is therefore disabled in that configuration, but a module created on a different core than its pipeline (e.g. the compress decoder pinned to core 1) was still accepted, and the first cross-core operation then panicked the DSP from user space instead of failing:

  • ipc4_comp_connect() called comp_get_attribute() on the remote sink before checking cross_core_bind, hitting the privileged IDC path (rzalloc/idc_send_msg) -> privileged instruction exception.
  • the host's error unwind deleted the pipeline, and ipc_pipeline_module_free() used ipc_comp_free_remote() for the remote module -> load error on the kernel-only IDC data.

Reject such a module already at MOD_INIT_INSTANCE when user-space LL is enabled and cross-core streams are disabled, and move the cross-core check in ipc4_comp_connect() before any remote access so the bind fails with IPC4_INVALID_REQUEST instead of crashing.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 13:38
With CONFIG_SOF_USERSPACE_LL the IPC4 module commands run in a user
thread which cannot issue IDC messages. CONFIG_CROSS_CORE_STREAM is
therefore disabled in that configuration, but a module created on a
different core than its pipeline (e.g. the compress decoder pinned to
core 1) was still accepted, and the first cross-core operation then
panicked the DSP from user space instead of failing:

 - ipc4_comp_connect() called comp_get_attribute() on the remote sink
   before checking cross_core_bind, hitting the privileged IDC path
   (rzalloc/idc_send_msg) -> privileged instruction exception.
 - the host's error unwind deleted the pipeline, and
   ipc_pipeline_module_free() used ipc_comp_free_remote() for the
   remote module -> load error on the kernel-only IDC data.

Reject such a module already at MOD_INIT_INSTANCE when user-space LL
is enabled and cross-core streams are disabled, and move the
cross-core check in ipc4_comp_connect() before any remote access so
the bind fails with IPC4_INVALID_REQUEST instead of crashing.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

With CONFIG_SOF_USERSPACE_LL, the userspace constructor bypasses pipeline/core validation, allowing a cross-core module that exposes the privileged ipc_comp_free_remote() path during pipeline deletion.

1 open issue
What changed in this PR

This PR aims to prevent IPC4 cross-core module operations from crashing the DSP when user-space LL execution cannot issue privileged inter-core messages.

Changes:

  • Adds a module/pipeline core check in comp_new_ipc4() for user-space LL configurations without cross-core stream support.
  • Moves unsupported cross-core bind rejection ahead of remote attribute access, returning IPC4_INVALID_REQUEST.
File Description
src/​ipc/​ipc4/​helper.c Adds constructor validation and rejects unsupported cross-core binds earlier.

Review effort: Balanced

Comment thread src/ipc/ipc4/helper.c
Comment on lines +193 to +194
if (IS_ENABLED(CONFIG_SOF_USERSPACE_LL) && !IS_ENABLED(CONFIG_CROSS_CORE_STREAM) &&
ppl->core != ipc_config.core) {

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ujfalusi , looks good. Please fix the copilot finding on unreachable code.

@intel-sofci

Copy link
Copy Markdown

PR 11375: test results

Run date: 2026-10-29 16:40 UTC

Tested commit: 5286bc7f2d25aca35d0f773d2cc7adf213f15730

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants