Skip to content

Kernel config (CONFIG_IKCONFIG) resolution for KPMs#275

Open
MhmRdd wants to merge 2 commits into
bmax121:mainfrom
MhmRdd:feat/kpm-kconfig-resolution
Open

Kernel config (CONFIG_IKCONFIG) resolution for KPMs#275
MhmRdd wants to merge 2 commits into
bmax121:mainfrom
MhmRdd:feat/kpm-kconfig-resolution

Conversation

@MhmRdd

@MhmRdd MhmRdd commented Jun 8, 2026

Copy link
Copy Markdown

No description provided.

Add kernel-config resolution for KPMs. The engine exports one primitive,
kpm_kconfig_get(key), returning an option's value (string options unquoted) or
NULL when the option is unset, absent, or the kernel was built without
CONFIG_IKCONFIG. Typed accessors (kpm_kconfig_bool/tristate/int/hex and the
KPM_KCONFIG_* macros) are KPM-side inline wrappers, so the engine ABI stays a
single symbol. Works for both embedded and runtime-loaded KPMs.

- kptools: locate the gzipped ikconfig blob (find_ikconfig) and pass its
  kimg-relative offset/size through the preset (reserved bytes, no ABI break)
  and setup1.S into the runtime engine.
- engine: vendored puff.c (zlib License) plus a small freestanding arm64
  setjmp/longjmp shim decompress the blob on demand.
- values are memoized in a process-wide, negative-cached table; the config is
  immutable so entries never expire and the blob is decompressed at most once
  per distinct key, shared across all modules.
- add kpms/demo-kconfig example, build it in CI, and credit puff in README.
@MhmRdd MhmRdd changed the title feat(kpm): resolve kernel config (CONFIG_IKCONFIG) values for KPMs Kernel config (CONFIG_IKCONFIG) resolution for KPMs Jun 8, 2026
Keep the decompressed .config resident only while a module load phase is open,
refcounted by kpm_kconfig_load_begin/end around each module init and the
embedded-event batch. A burst of distinct-key lookups across one module, or a
whole embedded batch loaded together, then shares a single decompression with
no steady-state residency. The per-key value cache stays permanent, so repeated
and post-init lookups never re-decompress.
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.

1 participant