kpatch: add openEuler 6.6 kernel support#1504
Open
qjl21 wants to merge 2 commits into
Open
Conversation
openEuler 6.6 introduces ftrace-less livepatch via the kernel config CONFIG_LIVEPATCH_WO_FTRACE=y. When this option is enabled, CONFIG_LIVEPATCH_FTRACE is not set and the kernel applies live patches without relying on ftrace trampolines. Two changes are required to handle this configuration: kpatch-build: detect CONFIG_LIVEPATCH_WO_FTRACE=y in the target kernel config and automatically export NO_PROFILING_CALLS=1, which suppresses the ftrace-based profiling instrumentation that is incompatible with ftrace-less livepatch. livepatch-patch-hook.c: introduce the HAVE_WO_FTRACE_ENABLE helper macro when CONFIG_LIVEPATCH_WO_FTRACE is defined, and guard the klp_enable_patch() call with it so the correct activation path is selected at compile time. Signed-off-by: qujingling <18810075699@163.com>
…rnel >= 6.6 CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY was removed in the 6.6 kernel. On openEuler 6.6, the per-task consistency model is no longer a separate Kconfig symbol; the kernel instead uses CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY and CONFIG_LIVEPATCH_WO_FTRACE to describe its livepatch mechanism. The existing check unconditionally fails when building against an openEuler 6.6 kernel because the config option simply does not appear in the .config file, even though the kernel is correctly configured for live patching. Guard the check with a kernel version comparison so that it only fires on kernels older than 6.6, where CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY is still the expected indicator of a supported livepatch configuration. Signed-off-by: qujingling <18810075699@163.com>
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.
Summary
Add compatibility support for openEuler 6.6 kernel, which introduces
CONFIG_LIVEPATCH_WO_FTRACE(livepatch without ftrace) and removes theCONFIG_LIVEPATCH_PER_TASK_CONSISTENCYrequirement.Changes
kpatch-build: skip CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY check on kernel >= 6.6
The
CONFIG_LIVEPATCH_PER_TASK_CONSISTENCYcheck was previously requiredfor all openEuler kernels. On openEuler 6.6+, this config option no longer
exists, so the check is now skipped for kernels >= 6.6.0 to avoid a false
build failure.
kpatch: add support for CONFIG_LIVEPATCH_WO_FTRACE on openEuler 6.6
openEuler 6.6 introduces
CONFIG_LIVEPATCH_WO_FTRACE, a livepatchmechanism that does not rely on ftrace. When this option is enabled:
HAVE_WO_FTRACE_ENABLEis defined in the patch hook, andklp_enable_patch()is conditionally compiled for this path.NO_PROFILING_CALLS=1is exported during build to suppress ftrace-basedprofiling instrumentation, which is incompatible with the wo-ftrace path.