Repository navigation
Conversation
kv2019i
requested review from
LaurentiuM1234,
bardliao,
dbaluta,
lbetlej,
lgirdwood,
marcinszkudlinski,
mmaka1,
pblaszko,
plbossart,
ranj063,
singalsu and
tmleman
as code owners
September 29, 2026 12:45
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several central architecture claims, file classifications, and syscall signatures do not match the current source and configuration.
Review effort: Balanced
Findings: 9
Open (9)
Default PTL configuration does not enable the LL userspace pipeline · New Execution model omits shared-state and synchronization IPC crossings · New Taxonomy rollout is incomplete across source directories · New DMA table omits inline implementations in the authoritative header · New send_resource_notif signature omits required payload arguments · New DMA implementation map omits inline header implementations · New Secondary user IPC initialization can occur after user threads start · New Privileged lock paths are incorrectly classified as context-agnostic · New Kernel file classification omits user-capable scheduling paths · New
What changed in this PR
Documents SOF’s Zephyr user/kernel boundary and adds contributor guidance for preserving it.
Changes:
- Defines execution tiers, userspace configuration, memory partitions, and placement rules.
- Adds a centralized syscall-boundary index.
- Adds “Runs in” banners and agent guardrails across subsystems.
| File | Description |
|---|---|
AGENTS.md |
Adds user/kernel contribution rules. |
src/arch/README.md |
Classifies architecture support. |
src/audio/README.md |
Describes application-tier audio code. |
src/audio/module_adapter/README.md |
Classifies the module adapter boundary. |
src/drivers/README.md |
Documents driver privilege requirements. |
src/idc/README.md |
Classifies inter-core communication. |
src/include/sof/userspace/README.md |
Defines the overall userspace architecture. |
src/include/sof/userspace/syscalls.h |
Indexes SOF syscalls. |
src/init/README.md |
Classifies initialization code. |
src/ipc/README.md |
Documents IPC boundary behavior. |
src/ipc/ipc4/README.md |
Documents the IPC4 split. |
src/lib/README.md |
Classifies common-library code. |
src/math/README.md |
Documents user-safe math routines. |
src/module/README.md |
Classifies the module API. |
src/platform/README.md |
Classifies platform integration. |
src/schedule/README.md |
Documents scheduler execution contexts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * | ||
| * ## DMA | ||
| * Declared: sof/lib/sof_dma.h | ||
| * Kernel side: zephyr/syscall/sof_dma.c (z_vrfy_) / src/lib/dma.c (z_impl_) |
Comment on lines
+3
to
+4
| > **Runs in:** Kernel-only — boot and early bring-up run in supervisor context before any user | ||
| > thread exists; this code never executes in a user thread. See |
Comment on lines
+3
to
+5
| > **Runs in:** Shared library — **with a boundary exception.** Most of this directory | ||
| > (`lib.c`, `notifier.c`, `objpool.c`, `clk.c`, `agent.c`, `ams.c`, `cpu-clk-manager.c`) is | ||
| > context-agnostic helper code linked into whichever thread calls it and must stay user-safe. |
Comment on lines
+4
to
+6
| > memory-domain setup. It is split internally between kernel-side files (`zephyr_ll.c`, | ||
| > `zephyr_domain.c`, `zephyr_dp_schedule_thread.c`) and user-side files (`zephyr_ll_user.c`, | ||
| > `zephyr_ll_app.c`, `zephyr_dp_schedule_application.c`), and it hosts the |
lyakh
reviewed
Sep 30, 2026
SOF audio application logic now runs in Zephyr user-space on userspace configurations (e.g. Intel PTL with CONFIG_SOF_USERSPACE_LL), but the source layout gives no indication of which code runs in kernel vs user context or where the privilege boundary is crossed. Add a canonical reference under src/include/sof/userspace/ with README.md documenting the execution model, split between kernel and users and rules for placing new code. No functional change; documentation only. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Make the user/kernel split evident at the point of use: each top-level src/ directory README now opens with a "Runs in:" banner declaring its tier (kernel-only / boundary / application / shared-library) and linking to the canonical reference in src/include/sof/userspace/README.md. Add banners to existing READMEs (schedule, ipc, ipc4, module_adapter, init, module) and add short new READMEs for directories that lacked one. lib/ is flagged as shared-library with a boundary exception, since dma.c and dai.c host syscall implementations. No functional change; documentation only. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add a "User/kernel boundary" subsection under Development Standards that points contributors to src/include/sof/userspace/README.md and states the requirements for new code: place it in the correct directory tier, cross the boundary only via a validated syscall, and mark any globals shared with user threads with a partition marker. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i
force-pushed
the
202609-userll-doc-update
branch
from
October 7, 2026 06:12
f6f9047 to
961b211
Compare
Collaborator
Author
|
V2 pushed:
|
PR 11247: test resultsRun date: 2026-10-07 06:43 UTC Tested commit: 961b21164118005d9a2f7b0683ec387e974d3fad |
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.

Series of documentation patches to document the overall approach to user-space usage in SOF. This covers the main build options, adds a new central syscalls.h header for documentation and updates agent guardrails for new code.
Moving source files around was considered, but this is not yet done in this PR. As SOF supports multiple approaches: all-kernel (no MMU/MPU), mixed (single audio modules isolated) and app-code-all-in-user, for most source code files, the user/kernel split is not always the same. Starting with a documentation framework seems like the best approach to get started.