Michel Lind de7e84
From 943edf5bc8079fee8806af6a902852dc22b5db3c Mon Sep 17 00:00:00 2001
Michel Lind de7e84
From: Joe Lawrence <joe.lawrence@redhat.com>
Michel Lind de7e84
Date: Thu, 10 Oct 2024 17:09:46 -0400
Michel Lind de7e84
Subject: [PATCH 103/118] aarch64: kpatch-build aarch64 implementation
Michel Lind de7e84
Michel Lind de7e84
TODO
Michel Lind de7e84
Michel Lind de7e84
Signed-off-by: Suraj Jitindar Singh <surajjs@amazon.com>
Michel Lind de7e84
Signed-off-by: Pete Swain <swine@google.com>
Michel Lind de7e84
Signed-off-by: Mihails Strasuns <mstrasun@amazon.com>
Michel Lind de7e84
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Michel Lind de7e84
---
Michel Lind de7e84
 kpatch-build/Makefile     | 2 +-
Michel Lind de7e84
 kpatch-build/kpatch-build | 3 +++
Michel Lind de7e84
 kpatch-build/kpatch-cc    | 1 +
Michel Lind de7e84
 3 files changed, 5 insertions(+), 1 deletion(-)
Michel Lind de7e84
Michel Lind de7e84
diff --git a/kpatch-build/Makefile b/kpatch-build/Makefile
Michel Lind de7e84
index 4e964b7..1969fff 100644
Michel Lind de7e84
--- a/kpatch-build/Makefile
Michel Lind de7e84
+++ b/kpatch-build/Makefile
Michel Lind de7e84
@@ -21,7 +21,7 @@ PLUGIN_CFLAGS := $(filter-out -std=gnu11 -Wconversion, $(CFLAGS))
Michel Lind de7e84
 PLUGIN_CFLAGS += -shared -I$(GCC_PLUGINS_DIR)/include \
Michel Lind de7e84
 		   -Igcc-plugins -fPIC -fno-rtti -O2 -Wall
Michel Lind de7e84
 endif
Michel Lind de7e84
-ifeq ($(filter $(ARCH),s390x x86_64 ppc64le),)
Michel Lind de7e84
+ifeq ($(filter $(ARCH),aarch64 s390x x86_64 ppc64le),)
Michel Lind de7e84
 $(error Unsupported architecture ${ARCH}, check https://github.com/dynup/kpatch/#supported-architectures)
Michel Lind de7e84
 endif
Michel Lind de7e84
 
Michel Lind de7e84
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
Michel Lind de7e84
index bc112fc..643d85c 100755
Michel Lind de7e84
--- a/kpatch-build/kpatch-build
Michel Lind de7e84
+++ b/kpatch-build/kpatch-build
Michel Lind de7e84
@@ -382,6 +382,9 @@ find_special_section_data() {
Michel Lind de7e84
 
Michel Lind de7e84
 	# Arch-specific features
Michel Lind de7e84
 	case "$ARCH" in
Michel Lind de7e84
+		"aarch64")
Michel Lind de7e84
+			check[a]=true					# alt_instr
Michel Lind de7e84
+			;;
Michel Lind de7e84
 		"x86_64")
Michel Lind de7e84
 			check[a]=true					# alt_instr
Michel Lind de7e84
 			kernel_version_gte 5.10.0 && check[s]=true	# static_call_site
Michel Lind de7e84
diff --git a/kpatch-build/kpatch-cc b/kpatch-build/kpatch-cc
Michel Lind de7e84
index 17aae25..5456179 100755
Michel Lind de7e84
--- a/kpatch-build/kpatch-cc
Michel Lind de7e84
+++ b/kpatch-build/kpatch-cc
Michel Lind de7e84
@@ -31,6 +31,7 @@ if [[ "$TOOLCHAINCMD" =~ ^(.*-)?gcc$ || "$TOOLCHAINCMD" =~ ^(.*-)?clang$ ]] ; th
Michel Lind de7e84
 				vmlinux.o|\
Michel Lind de7e84
 				.tmp_kallsyms1.o|\
Michel Lind de7e84
 				.tmp_kallsyms2.o|\
Michel Lind de7e84
+				arch/arm64/kernel/vdso*/*|\
Michel Lind de7e84
 				arch/x86/boot/*|\
Michel Lind de7e84
 				arch/x86/entry/vdso/*|\
Michel Lind de7e84
 				arch/x86/purgatory/*|\
Michel Lind de7e84
-- 
Michel Lind de7e84
2.48.1
Michel Lind de7e84