Repository navigation
kernel/user partition, Phase 4 part 1: enforce the include checker, fix a telemetry include regression - #11464
Merged
Conversation
Commit 20206e3 ("telemetry: headers: add extended TEL2 and PMW2 window definitions") added rtos/timer.h to telemetry.h. telemetry.h is included by component.h, and rtos/timer.h includes sof/platform.h, so every component source got the platform headers back: on PTL the user-space sources that include kernel-only headers went from 28 to 140, undoing most of the header untangling of thesofproject#11306 Phase 1. Nothing in telemetry.h needs the include. It only names sof_cycle_get_64() in the telemetry_timestamp macro, and the two sources that expand that macro, component.c and zephyr_ll.c, already get rtos/timer.h, as they did before that commit. 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 manifest's user-space source list was written before the kernel code moved to src/kernel. Now that it has, every source in src/ outside of src/kernel is user-space code: that also covers the user halves of the Phase 3 splits in src/ipc, src/schedule, src/lib and src/debug, which were not checked. The legacy host and DAI drivers stay excluded until they are deleted. The checked builds now report 11 more user-space sources that include kernel-only headers: the user halves of the IPC, scheduler, DMA and DAI splits, the notifier and a tester module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a [leak-baseline] section to the partition manifest, listing the 41 user-space sources that still include kernel-only headers in the CI configurations and with the user-space overlays. With --strict, the checker now only fails when a user-space source outside of the baseline includes a kernel-only header, so it can be enforced before the remaining leaks are removed, and new leaks are caught when they are added. Baseline sources that were built without leaks are reported, so that they can be dropped from the list once they are clean in every configuration. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the kernel/user-space include checker with --strict, so that the Linux build jobs fail when a user-space source that is not in the checker's leak baseline includes a kernel-only header. Such a regression went unnoticed with the report alone: one header change brought the platform headers back into every component source. 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 identified for the kernel/user-space include-checking changes.
No open issues 🎉
What changed in this PR
This PR advances SOF’s kernel/user-space partitioning by enforcing include checks in Linux CI and removing a telemetry include that reintroduced kernel-only headers into component sources.
Changes:
- Removes the unnecessary
rtos/timer.hinclude fromtelemetry.h. - Expands checking to all
src/sources except kernel code and legacy host/DAI drivers, with a 41-source baseline for existing leaks. - Enables strict CI checks for leaks outside the baseline and reports baseline sources built without leaks.
| File | Description |
|---|---|
src/kernel/README.md |
Documents CI enforcement and the shrinking leak baseline. |
src/include/sof/debug/telemetry/telemetry.h |
Removes the timer include responsible for transitive platform-header exposure. |
scripts/kernel_user_partition.txt |
Broadens source coverage and records existing leak exceptions. |
scripts/check_kernel_includes.py |
Adds baseline-aware strict checks and clean-source reporting. |
.github/workflows/zephyr.yml |
Enables strict checks and propagates failures across platform builds. |
Review effort: Balanced
lgirdwood
marked this pull request as ready for review
November 15, 2026 17:05
lgirdwood
requested review from
dbaluta,
kv2019i,
lbetlej,
mmaka1 and
plbossart
as code owners
November 15, 2026 17:05
PR 11464: test resultsRun date: 2026-11-16 10:29 UTC Tested commit: 2d08b0d481027a03a0b897d665e6620e08e780d5 |
Member
Author
|
unrelated CI error |
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 4 of #11306 (kernel / user-space partition), first part: turn on enforcement of the include checker, so that new kernel-only includes from user-space code fail CI. It also fixes a regression that this would have caught.
The regression
Commit 20206e3 ("telemetry: headers: add extended TEL2 and PMW2 window definitions") added
rtos/timer.htotelemetry.h.component.hincludestelemetry.h, andrtos/timer.hincludessof/platform.h. So every component source got the platform headers back:That undid most of the Phase 1 header untangling (#11330, #11345, #11364, #11386). Nobody noticed, because the CI step only reports.
Patches
rtos/timer.hfromtelemetry.h: nothing in the header needs it. It only namessof_cycle_get_64()in thetelemetry_timestampmacro. The two sources that expand that macro,component.candzephyr_ll.c, already getrtos/timer.h, as they did before that commit.src/kernel. Now every source insrc/outsidesrc/kernelis user-space code. This adds the user halves of the Phase 3 splits insrc/ipc,src/schedule,src/libandsrc/debug, which were not checked. The legacy host and DAI drivers stay excluded until they are deleted.[leak-baseline]section inscripts/kernel_user_partition.txtlists the 41 user-space sources that still include kernel-only headers in the CI configurations and with the user-space overlays.--strict, the checker fails only when a source outside the baseline includes a kernel-only header.--strict.src/kerneldescribes the baseline.Next parts of Phase 4
sof/platform.h, the platform memory map andrtos/clk.h/rtos/timer.h, in the DMA, DAI, pipeline and copier code;zephyr/drivers/dma.handrtos/idc.h;src/kernel/include/sof/kernel/.Functional change
None. The telemetry patch changes no object in any configuration below, and no image symbol, section or
SYS_INIT()entry. The other patches only touch the checker, its manifest, CI and docs.Testing
repro-build.conf,-Werror):--strictpasses;--strictalso passes. Across all of them, exactly the 41 baseline sources leak;--strictfails;--strictfails and names the source and its kernel-only headers;CONFIG_SOF_USERSPACE_PROXY=n;os_linux_overlay.conf;llext_relocatable.conf;app/debug_stream_overlay.conf, with and without user-space LL. TGL with that overlay fails on main; Phase 3 (part 4): move the kernel-only debug stream code to src/kernel/debug #11461 fixes it.SYS_INIT()order), and the per-function disassembly. Only the imx93sof_init()differs, because it embeds the git hash.All of the above was run on e9b5dd8 (current main).
🤖 Generated with Claude Code