Support __kconfig macro for LINUX_KERNEL_VERSION#951
Merged
ti-mo merged 4 commits intocilium:masterfrom Mar 3, 2023
Merged
Conversation
ti-mo
reviewed
Mar 1, 2023
53d1826 to
06ff2c7
Compare
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
fixupDatasecLayout steps through Datasec.Vars to calculate the proper offsets based on the Vars' sizes and populates Datasec.Size when done. alignof() now returns an error if the size of the type it wants to calculate is not a power of two. Signed-off-by: Timo Beckers <timo@isovalent.com>
Simplify elfCode methods by moving maps from being an argument to being a struct member. Avoids a BTF lookup in a subsequent commit. Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com> Co-authored-by: Timo Beckers <timo@isovalent.com>
This commit is a first step towards __kconfig support. When a .kconfig Datasec is detected, a .kconfig map is created and emitted into the CollectionSpec. Instructions referring to __kconfig variables will be rewritten to refer to the .kconfig map during ELF load. Its contents will only be initialized when loading the spec into the kernel. All variables specified in the .kconfig Datasec are resolved based on their names, and the results are written to .kconfig's Contents. For the moment, it only enables using LINUX_KERNEL_VERSION. Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com> Co-authored-by: Timo Beckers <timo@isovalent.com>
Contributor
Author
|
Amazing! Thank you for the merge 🎉 🎉 🎉 🔥 🔥 🔥 😄 😄 😄! |
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.
Hi.
This supersedes #869.
This PR is a first step toward
__kconfigsupport which is discussed in #698.When a
.kconfigdata section is detected, a.kconfigmap is created, its content will be initialized depending on theCONFIG_*values.During relocation, variable inside the
.kconfigdata section will have their offset changed to reflect their value inside the.kconfigmap.For the moment, it only enables using
LINUX_KERNEL_VERSION. The.kconfigmap will be updated to contain the result ofinternal.KernelVersion().If you see any way to improve this PR, feel free to share.
Best regards and thank you in advance.