Kernel config (CONFIG_IKCONFIG) resolution for KPMs#275
Open
MhmRdd wants to merge 2 commits into
Open
Conversation
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.
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.
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.
No description provided.