f6c393
From c147ddf8a343c1de68ac306deb7ddc942d0f50bb Mon Sep 17 00:00:00 2001
f6c393
From: Song Liu <song@kernel.org>
f6c393
Date: Thu, 30 May 2024 11:48:03 -0700
f6c393
Subject: [PATCH 111/112] kpatch-build: Ignore missing PARA_STRUCT_SIZE for
f6c393
 6.8.0+ kernels
f6c393
f6c393
struct paravirt_patch_site was removed in 6.8.0+ kernels. We should not
f6c393
fail kpatch-build for missing PARA_STRUCT_SIZE.
f6c393
f6c393
Signed-off-by: Song Liu <song@kernel.org>
f6c393
---
f6c393
 kpatch-build/kpatch-build | 9 ++++++++-
f6c393
 1 file changed, 8 insertions(+), 1 deletion(-)
f6c393
f6c393
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
f6c393
index 3af1918..29624da 100755
f6c393
--- a/kpatch-build/kpatch-build
f6c393
+++ b/kpatch-build/kpatch-build
f6c393
@@ -236,6 +236,11 @@ support_klp_replace()
f6c393
 	fi
f6c393
 }
f6c393
 
f6c393
+check_paravirt_patch_site()
f6c393
+{
f6c393
+    ! kernel_version_gte 6.8.0
f6c393
+}
f6c393
+
f6c393
 find_dirs() {
f6c393
 	if [[ -e "$SCRIPTDIR/create-diff-object" ]]; then
f6c393
 		# git repo
f6c393
@@ -426,7 +431,9 @@ find_special_section_data() {
f6c393
 	[[ ${check[i]} && -z "$PRINTK_INDEX_STRUCT_SIZE" ]] && die "can't find special struct pi_entry size"
f6c393
 	[[ ${check[j]} && -z "$JUMP_STRUCT_SIZE" ]] && die "can't find special struct jump_entry size"
f6c393
 	[[ ${check[o]} && -z "$ORC_STRUCT_SIZE" ]] && die "can't find special struct orc_entry size"
f6c393
-	[[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size"
f6c393
+	if check_paravirt_patch_site; then
f6c393
+		[[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size"
f6c393
+	fi
f6c393
 	[[ ${check[s]} && -z "$STATIC_CALL_STRUCT_SIZE" ]] && die "can't find special struct static_call_site size"
f6c393
 
f6c393
 	save_env
f6c393
-- 
f6c393
2.45.1
f6c393