Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kmod/patch/livepatch-patch-hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
#define KLP_REPLACE_ENABLE true
#endif


#ifdef CONFIG_LIVEPATCH_WO_FTRACE
#define HAVE_WO_FTRACE_ENABLE
#endif

/*
* There are quite a few similar structures at play in this file:
* - livepatch.h structs prefixed with klp_*
Expand Down Expand Up @@ -576,6 +581,7 @@ static int __init patch_init(void)
}
#endif

#if defined(HAVE_WO_FTRACE_ENABLE)
ret = klp_enable_patch(lpatch);
if (ret) {
#ifndef HAVE_SIMPLE_ENABLE
Expand All @@ -584,6 +590,7 @@ static int __init patch_init(void)
patch_free_livepatch(lpatch);
return ret;
}
#endif

return 0;
out:
Expand Down
4 changes: 3 additions & 1 deletion kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ trace_off "reading .config"
source "$CONFIGFILE"
trace_on

[[ "$DISTRO" = openEuler ]] && [[ -z "$CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY" ]] && \
[[ "$DISTRO" = openEuler ]] && ! kernel_version_gte 6.6.0 && [[ -z "$CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY" ]] && \
die "openEuler kernel doesn't have 'CONFIG_LIVEPATCH_PER_TASK_CONSISTENCY' enabled"

[[ -z "$CONFIG_DEBUG_INFO" ]] && die "kernel doesn't have 'CONFIG_DEBUG_INFO' enabled"
Expand Down Expand Up @@ -1232,6 +1232,8 @@ else
KBUILD_EXTRA_SYMBOLS="$SYMVERSFILE"
fi

grep -q "CONFIG_LIVEPATCH_WO_FTRACE=y" "$CONFIGFILE" && export NO_PROFILING_CALLS=1

# unsupported kernel option checking
[[ -n "$CONFIG_DEBUG_INFO_SPLIT" ]] && die "kernel option 'CONFIG_DEBUG_INFO_SPLIT' not supported"
[[ -n "$CONFIG_GCC_PLUGIN_LATENT_ENTROPY" ]] && die "kernel option 'CONFIG_GCC_PLUGIN_LATENT_ENTROPY' not supported"
Expand Down