2020-05-11 14:59:12 +08:00
|
|
|
From 1281e03a115ee04e8ddea9f88d0e4e16b2e5ce57 Mon Sep 17 00:00:00 2001
|
2019-12-30 15:59:18 +08:00
|
|
|
From: Zhipeng Xie <xiezhipeng1@huawei.com>
|
|
|
|
|
Date: Thu, 20 Dec 2018 04:55:38 +0000
|
2020-05-11 14:59:12 +08:00
|
|
|
Subject: [PATCH 01/21] support compile kpatch on aarch64
|
2019-12-30 15:59:18 +08:00
|
|
|
|
|
|
|
|
delete __x86_64__ to support compile kpatch on aarch64.
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
|
|
|
|
|
---
|
2020-05-11 14:59:12 +08:00
|
|
|
kpatch-build/Makefile | 4 ++++
|
2020-02-27 17:15:29 -05:00
|
|
|
kpatch-build/create-diff-object.c | 14 +-------------
|
2020-05-11 14:59:12 +08:00
|
|
|
2 files changed, 5 insertions(+), 13 deletions(-)
|
2019-12-30 15:59:18 +08:00
|
|
|
|
|
|
|
|
diff --git a/kpatch-build/Makefile b/kpatch-build/Makefile
|
2020-05-11 14:59:12 +08:00
|
|
|
index 7505e07..8efae94 100644
|
2019-12-30 15:59:18 +08:00
|
|
|
--- a/kpatch-build/Makefile
|
|
|
|
|
+++ b/kpatch-build/Makefile
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -14,6 +14,10 @@ ifeq ($(ARCH),x86_64)
|
2019-12-30 15:59:18 +08:00
|
|
|
SOURCES += insn/insn.c insn/inat.c
|
|
|
|
|
INSN = insn/insn.o insn/inat.o
|
2020-05-11 14:59:12 +08:00
|
|
|
insn/%.o: CFLAGS := $(filter-out -Wconversion, $(CFLAGS))
|
2019-12-30 15:59:18 +08:00
|
|
|
+else ifeq ($(ARCH),aarch64)
|
|
|
|
|
+SOURCES += insn/insn.c insn/inat.c
|
|
|
|
|
+INSN = insn/insn.o insn/inat.o
|
2020-05-11 14:59:12 +08:00
|
|
|
+insn/%.o: CFLAGS := $(filter-out -Wconversion, $(CFLAGS))
|
2019-12-30 15:59:18 +08:00
|
|
|
else ifeq ($(ARCH),ppc64le)
|
|
|
|
|
SOURCES += gcc-plugins/ppc64le-plugin.c
|
|
|
|
|
PLUGIN = gcc-plugins/ppc64le-plugin.so
|
|
|
|
|
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
|
2020-05-11 14:59:12 +08:00
|
|
|
index aedd07d..2707cdb 100644
|
2019-12-30 15:59:18 +08:00
|
|
|
--- a/kpatch-build/create-diff-object.c
|
|
|
|
|
+++ b/kpatch-build/create-diff-object.c
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -475,7 +475,6 @@ out:
|
2019-12-30 15:59:18 +08:00
|
|
|
log_debug("section %s has changed\n", sec->name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#ifdef __x86_64__
|
|
|
|
|
/*
|
|
|
|
|
* Determine if a section has changed only due to a WARN* or might_sleep
|
|
|
|
|
* macro call's embedding of the line number into an instruction operand.
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -586,7 +585,7 @@ static int kpatch_line_macro_change_only(struct section *sec)
|
2019-12-30 15:59:18 +08:00
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
-#elif __powerpc64__
|
|
|
|
|
+#if __powerpc64__
|
|
|
|
|
#define PPC_INSTR_LEN 4
|
|
|
|
|
#define PPC_RA_OFFSET 16
|
|
|
|
|
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -652,11 +651,6 @@ static int kpatch_line_macro_change_only(struct section *sec)
|
2019-12-30 15:59:18 +08:00
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
-#else
|
|
|
|
|
-static int kpatch_line_macro_change_only(struct section *sec)
|
|
|
|
|
-{
|
|
|
|
|
- return 0;
|
|
|
|
|
-}
|
|
|
|
|
#endif
|
2020-02-27 17:15:29 -05:00
|
|
|
|
|
|
|
|
static void kpatch_compare_sections(struct list_head *seclist)
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1215,7 +1209,6 @@ static void kpatch_compare_correlated_elements(struct kpatch_elf *kelf)
|
2019-12-30 15:59:18 +08:00
|
|
|
kpatch_compare_symbols(&kelf->symbols);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#ifdef __x86_64__
|
2020-02-27 17:15:29 -05:00
|
|
|
static void rela_insn(const struct section *sec, const struct rela *rela,
|
|
|
|
|
struct insn *insn)
|
2019-12-30 15:59:18 +08:00
|
|
|
{
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1239,7 +1232,6 @@ static void rela_insn(const struct section *sec, const struct rela *rela,
|
2019-12-30 15:59:18 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
-#endif
|
|
|
|
|
|
2020-02-27 17:15:29 -05:00
|
|
|
static bool is_callback_section(struct section *sec) {
|
|
|
|
|
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1785,7 +1777,6 @@ static int jump_table_group_size(struct kpatch_elf *kelf, int offset)
|
2019-12-30 15:59:18 +08:00
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#ifdef __x86_64__
|
|
|
|
|
static int parainstructions_group_size(struct kpatch_elf *kelf, int offset)
|
|
|
|
|
{
|
|
|
|
|
static int size = 0;
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1820,7 +1811,6 @@ static int smp_locks_group_size(struct kpatch_elf *kelf, int offset)
|
2019-12-30 15:59:18 +08:00
|
|
|
{
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
-#endif
|
|
|
|
|
#ifdef __powerpc64__
|
|
|
|
|
static int fixup_entry_group_size(struct kpatch_elf *kelf, int offset)
|
|
|
|
|
{
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1915,7 +1905,6 @@ static struct special_section special_sections[] = {
|
2020-02-27 17:15:29 -05:00
|
|
|
.name = "__jump_table",
|
|
|
|
|
.group_size = jump_table_group_size,
|
2019-12-30 15:59:18 +08:00
|
|
|
},
|
|
|
|
|
-#ifdef __x86_64__
|
|
|
|
|
{
|
|
|
|
|
.name = ".smp_locks",
|
|
|
|
|
.group_size = smp_locks_group_size,
|
2020-05-11 14:59:12 +08:00
|
|
|
@@ -1928,7 +1917,6 @@ static struct special_section special_sections[] = {
|
2019-12-30 15:59:18 +08:00
|
|
|
.name = ".altinstructions",
|
|
|
|
|
.group_size = altinstructions_group_size,
|
|
|
|
|
},
|
|
|
|
|
-#endif
|
|
|
|
|
#ifdef __powerpc64__
|
|
|
|
|
{
|
|
|
|
|
.name = "__ftr_fixup",
|
|
|
|
|
--
|
2020-02-27 17:15:29 -05:00
|
|
|
2.18.1
|