kpatch-build: handle paravirt absence in Linux v6.8+

Upstream kernel commit f7af6977621a ("x86/paravirt: Remove no longer
needed paravirt patching code") v6.8+ removed the .parainstructions
section and its paravirt_patch_site struct. Therefore this checks the
kernel version and does not export the struct size if the kernel
version is >= v6.8.0, avoiding the code path for it in
create-diff-object.c entirely.

Fixes: https://github.com/dynup/kpatch/issues/1380

Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
This commit is contained in:
Ryan Sullivan 2024-03-29 11:08:31 -04:00
parent ef68b4e416
commit 36ba2b8dfc

View File

@ -358,7 +358,7 @@ find_special_section_data() {
"x86_64")
check[a]=true # alt_instr
kernel_version_gte 5.10.0 && check[s]=true # static_call_site
[[ -n "$CONFIG_PARAVIRT" ]] && check[p]=true # paravirt_patch_site
[[ -n "$CONFIG_PARAVIRT" ]] && ! kernel_version_gte 6.8.0 && check[p]=true # paravirt_patch_site
;;
"ppc64le")
check[f]=true # fixup_entry