Blob Blame History Raw
From c147ddf8a343c1de68ac306deb7ddc942d0f50bb Mon Sep 17 00:00:00 2001
From: Song Liu <song@kernel.org>
Date: Thu, 30 May 2024 11:48:03 -0700
Subject: [PATCH 111/112] kpatch-build: Ignore missing PARA_STRUCT_SIZE for
 6.8.0+ kernels

struct paravirt_patch_site was removed in 6.8.0+ kernels. We should not
fail kpatch-build for missing PARA_STRUCT_SIZE.

Signed-off-by: Song Liu <song@kernel.org>
---
 kpatch-build/kpatch-build | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index 3af1918..29624da 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -236,6 +236,11 @@ support_klp_replace()
 	fi
 }
 
+check_paravirt_patch_site()
+{
+    ! kernel_version_gte 6.8.0
+}
+
 find_dirs() {
 	if [[ -e "$SCRIPTDIR/create-diff-object" ]]; then
 		# git repo
@@ -426,7 +431,9 @@ find_special_section_data() {
 	[[ ${check[i]} && -z "$PRINTK_INDEX_STRUCT_SIZE" ]] && die "can't find special struct pi_entry size"
 	[[ ${check[j]} && -z "$JUMP_STRUCT_SIZE" ]] && die "can't find special struct jump_entry size"
 	[[ ${check[o]} && -z "$ORC_STRUCT_SIZE" ]] && die "can't find special struct orc_entry size"
-	[[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size"
+	if check_paravirt_patch_site; then
+		[[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size"
+	fi
 	[[ ${check[s]} && -z "$STATIC_CALL_STRUCT_SIZE" ]] && die "can't find special struct static_call_site size"
 
 	save_env
-- 
2.45.1