Skip to content

kpatch: add openEuler 6.6 kernel support#1504

Open
qjl21 wants to merge 2 commits into
dynup:masterfrom
qjl21:github
Open

kpatch: add openEuler 6.6 kernel support#1504
qjl21 wants to merge 2 commits into
dynup:masterfrom
qjl21:github

Conversation

@qjl21
Copy link
Copy Markdown

@qjl21 qjl21 commented May 16, 2026

Summary

Add compatibility support for openEuler 6.6 kernel, which introduces
CONFIG_LIVEPATCH_WO_FTRACE (livepatch without ftrace) and removes the
CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY requirement.

Changes

kpatch-build: skip CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY check on kernel >= 6.6

The CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY check was previously required
for 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 livepatch
mechanism that does not rely on ftrace. When this option is enabled:

  • HAVE_WO_FTRACE_ENABLE is defined in the patch hook, and
    klp_enable_patch() is conditionally compiled for this path.
  • NO_PROFILING_CALLS=1 is exported during build to suppress ftrace-based
    profiling instrumentation, which is incompatible with the wo-ftrace path.

qjling added 2 commits May 16, 2026 18:24
  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>
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.

2 participants