Repository navigation
Conversation
The next moves bring kernel code that the host builds (testbench, host library) also compile to src/kernel. Add src/kernel to src/CMakeLists.txt, which only the host builds use; Zephyr adds it from zephyr/CMakeLists.txt. Everything in src/kernel so far is only built for Zephyr, so add those subdirectories only for Zephyr builds. No functional change: the host builds compile the same files as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The IPC3 handler runs in kernel mode. Move it to src/kernel/ipc/ipc3, where Zephyr builds it into the sof_kernel library. The host builds (the IPC3 testbench and host library) now get it from src/kernel/ipc, which is added for them as well. Update the cmocka and ztest unit tests that build ipc3/helper.c, the example patch in fuzz.sh, the comments that name the files and the user-space README. Give src/kernel/ipc the same CODEOWNERS as src/ipc. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
handler-kernel.c is the kernel IPC4 dispatcher and holds the kernel half of the compound-message and reply system calls, notification.c sends notifications to the host and holds the kernel half of send_resource_notif(), and logging.c drives the mtrace log buffer notifications. All three run in kernel mode. Move them to src/kernel/ipc/ipc4, where Zephyr builds them into the sof_kernel library; the host builds get them from src/kernel/ipc as well. The user-side files handler-user.c, notification-user.c, helper.c, dai.c and ams_helpers.c stay in src/ipc/ipc4. Update the IPC READMEs, the user-space README and a comment in the posix IPC fuzzing harness. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The notification message pool is used by the kernel IPC4 notification code and takes a spinlock. Move it to src/kernel/ipc, where Zephyr builds it into the sof_kernel library; the host builds get it from src/kernel/ipc as well. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The system agent checks the timing of the LL scheduler from a timer task and runs in kernel mode. Move it to src/kernel/lib, where Zephyr builds it into the sof_kernel library for CONFIG_HAVE_AGENT. The host library, which always builds it, now gets it from src/kernel/lib, which keeps the early return for CONFIG_LIBRARY so that the host builds compile nothing else from there. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The platform drivers (i.MX, AMD and MediaTek IPC, DMA and DAI drivers, the generic dummy DMA, the legacy interrupt layer and the host library's IPC and timer) access hardware and run in kernel mode. Move them to src/kernel/drivers. The Zephyr build lists the drivers in zephyr/CMakeLists.txt, so point SOF_DRIVERS_PATH there and use it for the entries that spelled the path out. They are still built into modules_sof, like the platform code listed next to them. The host builds now get drivers/host from src/kernel. The drivers Kconfig is sourced from src/kernel/Kconfig instead of src/Kconfig; the option values are unchanged. Update CODEOWNERS, the drivers README, the kernel-only directory lists in the docs and a comment in the IPC3 host page table code. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
zephyr_ll_user.c moved from src/schedule to src/kernel/schedule and lost its code owners. Give src/kernel/schedule the same owners as src/schedule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the kernel-only code relocation into src/kernel.
No open issues 🎉
What changed in this PR
This PR continues the kernel/user-space partition in #11306 by moving kernel-only code used by host builds into src/kernel. It follows #11411 while leaving architecture and platform moves for a later PR, with no intended functional changes.
Changes:
- Relocates IPC3, kernel-side IPC4, notification pooling, the system agent, and drivers.
- Updates host, Zephyr, and unit-test build paths while preserving source selection.
- Updates ownership rules, documentation, and comments to reflect the new layout.
| File | Description |
|---|---|
zephyr/CMakeLists.txt |
Points driver sources to src/kernel/drivers. |
test/ztest/unit/math/fft/CMakeLists.txt |
Updates the IPC3 helper path. |
test/ztest/unit/audio/drc/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/math/fft/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/volume/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/selector/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/pipeline/CMakeLists.txt |
Updates IPC3 helper paths across pipeline tests. |
test/cmocka/src/audio/pcm_converter/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/mux/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/mixer/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/eq_iir/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/eq_fir/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/dcblock/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/component/CMakeLists.txt |
Updates the IPC3 helper path. |
test/cmocka/src/audio/buffer/CMakeLists.txt |
Updates IPC3 helper paths across buffer tests. |
src/platform/posix/ipc.c |
Updates a kernel-handler path in a comment. |
src/lib/dai.c |
Updates IPC3 caller paths in comments. |
src/lib/CMakeLists.txt |
Removes the relocated system agent from this directory’s sources. |
src/kernel/lib/CMakeLists.txt |
Builds the relocated agent, preserving host-library selection. |
src/kernel/lib/agent.c |
Relocates the system agent into the kernel tree. |
src/kernel/Kconfig |
Sources the relocated driver configuration. |
src/kernel/ipc/notification_pool.c |
Relocates the kernel notification pool. |
src/kernel/ipc/ipc4/notification.c |
Relocates kernel-side IPC4 notifications and validation. |
src/kernel/ipc/ipc4/logging.c |
Relocates IPC4 logging control and notifications. |
src/kernel/ipc/ipc4/CMakeLists.txt |
Builds the relocated kernel-side IPC4 sources. |
src/kernel/ipc/ipc3/README.md |
Relocates IPC3 architecture documentation. |
src/kernel/ipc/ipc3/host-page-table.c |
Relocates page-table handling and updates a comment path. |
src/kernel/ipc/ipc3/CMakeLists.txt |
Relocates IPC3 source selection. |
src/kernel/ipc/CMakeLists.txt |
Adds IPC-version subdirectories and notification pooling. |
src/kernel/drivers/README.md |
Updates the driver directory name and documentation link. |
src/kernel/drivers/mediatek/afe/zephyr_mtk_host_dma.c |
Relocates the MediaTek host DMA driver. |
src/kernel/drivers/mediatek/afe/zephyr_mtk_dai.c |
Relocates the MediaTek Zephyr DAI driver. |
src/kernel/drivers/mediatek/afe/zephyr_mtk_afe_memif.c |
Relocates the MediaTek memory-interface DMA driver. |
src/kernel/drivers/mediatek/afe/afe-drv.c |
Relocates MediaTek AFE hardware support. |
src/kernel/drivers/mediatek/afe/afe-dai.c |
Relocates legacy MediaTek AFE DAI support. |
src/kernel/drivers/Kconfig |
Relocates driver configuration definitions. |
src/kernel/drivers/interrupt.c |
Relocates interrupt-controller support. |
src/kernel/drivers/imx/ipc.c |
Relocates the i.MX IPC driver. |
src/kernel/drivers/host/timer.c |
Relocates host timer and timestamp stubs. |
src/kernel/drivers/host/ipc.c |
Relocates host IPC support. |
src/kernel/drivers/host/CMakeLists.txt |
Relocates host-driver source selection. |
src/kernel/drivers/CMakeLists.txt |
Selects host drivers for library builds. |
src/kernel/drivers/amd/rembrandt/ipc.c |
Relocates Rembrandt IPC support. |
src/kernel/drivers/amd/rembrandt/acp_sp_dma.c |
Relocates Rembrandt serial-port DMA support. |
src/kernel/drivers/amd/rembrandt/acp_sp_dai.c |
Relocates Rembrandt serial-port DAI support. |
src/kernel/drivers/amd/rembrandt/acp_hs_dai.c |
Relocates Rembrandt headset DAI support. |
src/kernel/drivers/amd/rembrandt/acp_dmic_dma.c |
Relocates Rembrandt digital-microphone DMA support. |
src/kernel/drivers/amd/rembrandt/acp_dma.c |
Relocates Rembrandt ACP DMA support. |
src/kernel/drivers/amd/Kconfig |
Relocates AMD driver configuration. |
src/kernel/drivers/amd/common/ipc.c |
Relocates shared AMD IPC support. |
src/kernel/drivers/amd/common/acp_sp_dma.c |
Relocates shared AMD serial-port DMA support. |
src/kernel/drivers/amd/common/acp_dmic_dma.c |
Relocates shared AMD digital-microphone DMA support. |
src/kernel/drivers/amd/common/acp_dmic_dai.c |
Relocates shared AMD digital-microphone DAI support. |
src/kernel/drivers/amd/common/acp_dma.c |
Relocates shared AMD ACP DMA support. |
src/kernel/drivers/amd/common/acp_bt_dai.c |
Relocates shared AMD Bluetooth DAI support. |
src/kernel/drivers/amd/acp_7_x/ipc.c |
Relocates ACP 7.x IPC support. |
src/kernel/CMakeLists.txt |
Separates Zephyr-only subdirectories from host-compatible sources. |
src/Kconfig |
Removes the old driver configuration inclusion. |
src/ipc/README.md |
Documents the relocated kernel IPC4 handler. |
src/ipc/ipc4/README.md |
Documents the new kernel-side IPC4 location. |
src/ipc/ipc4/CMakeLists.txt |
Removes relocated kernel-side IPC4 sources. |
src/ipc/CMakeLists.txt |
Removes relocated IPC3 and notification-pool sources. |
src/include/sof/userspace/README.md |
Updates directory tiers and syscall implementation paths. |
src/CMakeLists.txt |
Includes the kernel tree in host builds. |
src/audio/README.md |
Updates the kernel-driver directory reference. |
src/audio/dai-zephyr.c |
Updates IPC3 caller paths in comments. |
scripts/fuzz.sh |
Updates paths in the example test patch. |
CODEOWNERS |
Updates driver ownership and adds kernel IPC/scheduler owners. |
AGENTS.md |
Removes drivers from the list of pending directory moves. |
Review effort: Balanced
lgirdwood
marked this pull request as ready for review
November 7, 2026 14:47
lgirdwood
requested review from
abonislawski,
bardliao,
bhiregoudar,
dbaluta,
iuliana-prodan,
kuanhsuncheng,
kv2019i,
lbetlej,
lyakh,
mmaka1,
pblaszko,
plbossart,
sunilkumardommati,
tmleman and
yaochunhung
as code owners
November 7, 2026 14:47
Member
Author
|
CI showing unrelated topology failure |
PR 11415: test resultsRun date: 2026-11-07 15:29 UTC Tested commit: 986201f0d23fa45074c91ae95ce7591f8ab321d7 |
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.
Phase 2 of #11306 (kernel / user-space partition), fifth part: move the kernel-only code that the host builds (testbench, host library, unit tests) also compile into
src/kernel, one commit per move.archandplatformfollow in a separate PR. As before, moved code keeps its path belowsrc/kernel.Patches
src/CMakeLists.txt, which only the host builds use, now addssrc/kernel. Everything already insrc/kernelis Zephyr-only, so those subdirectories are only added for Zephyr builds. The host builds compile exactly the same files.ipc/ipc3/→kernel/ipc/ipc3/:src/kernel/ipc.ipc3/helper.care updated, along with the example patch inscripts/fuzz.shand the comments that name the files.src/kernel/ipcgets the same CODEOWNERS assrc/ipc.ipc/ipc4/{handler-kernel,logging,notification}.c→kernel/ipc/ipc4/:z_impl_/z_vrfy_) of the compound-message, reply andsend_resource_notif()system calls.src/ipc/ipc4. Its READMEs now say where the kernel half is.ipc/notification_pool.c→kernel/ipc/: only used by the kernel notification code; takes a spinlock.lib/agent.c→kernel/lib/: the system agent.src/kernel/libkeeps theCONFIG_LIBRARYearly return, so the host builds still compile onlyagent.cfrom there.drivers/→kernel/drivers/:SOF_DRIVERS_PATHinzephyr/CMakeLists.txtpoints to the new location and is used for the entries that spelled the path out.src/kernel/Kconfig.modules_sof, becausezephyr/CMakeLists.txtlists them together with the platform code. They move tosof_kerneltogether withplatformin the next PR.src/kernel/schedulegets the scheduler owners.zephyr_ll_user.clost them when Phase 2 (part 4): move the Zephyr-only kernel code to src/kernel #11411 moved it.Functional change
None.
.configand every Intel platform's generated rimage configuration are unchanged.SYS_INIT()order of every image are unchanged. The link-order effects are as in the previous parts: alignment padding in some sections, the kernel object hash table in the PTL userspace builds, andsof_init()changing size with the git hash on Cortex-M7.Testing
CONFIG_SOF_USERSPACE_PROXY=n;os_linux_overlay.conf;llext_relocatable.conf.test-all-defconfigs.sh;sof-hda-generic-cavs25-2ch.tplg, comparing main and this branch. That covers the IPC4 kernel files and the notification pool. Both boot, play 5 s, and play again after runtime suspend, with no DSP errors. No IPC3 hardware was available.All of the above was run on 856cf13 (current main).
🤖 Generated with Claude Code