Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 support, including @surajjs95 & @t-msn changes #1302

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
aa69a14
avoid reloc-type collisions on elf.h constants
swine May 31, 2024
5d62944
test/integration/rhel-8.9: integration testing for rhel-8.9
ryanbsull Dec 4, 2023
439876e
kpatch-build: check if gawk is installed
Dec 6, 2023
6f64414
test/integration/rhel-9.3: integration testing for rhel-9.3
ryanbsull Dec 5, 2023
7e7c969
kpatch-build: simplify distro support
Jan 17, 2024
289045e
kpatch-build: Support distro Anolis OS
Jan 17, 2024
a78bc44
kmod: maintain syscall metadata sections in kpatch syscall macros
joe-lawrence Feb 29, 2024
776056a
kpatch-build: add support for OpenCloudOS
anatasluo Mar 18, 2024
936afb9
test/integration/rhel-8.10: add kernel-4.18.0-552.el8_10 tests
joe-lawrence Jan 22, 2024
e86e0cf
test/integration/rhel-9.4: add kernel-5.14.0-427.13.1.el9_4 tests
joe-lawrence Jan 22, 2024
59a0f24
kpatch-test: add dmesg entry at start of test
joe-lawrence Mar 22, 2024
2060c1f
kpatch-build: handle paravirt absence in Linux v6.8+
ryanbsull Mar 29, 2024
b857c4e
kpatch-build: demote CONFIG_LD_ORPHAN_WARN_LEVEL
joe-lawrence Apr 30, 2024
4003ca5
kpatch-build: cleanup kernel file backup/restore
joe-lawrence Apr 30, 2024
c8e6949
Update spec file
ZzzMao May 10, 2024
fc87070
kpatch-build: Add sym->has_func_profiling support for aarch64
Oct 6, 2021
3521a46
create-diff-object: Split kpatch_create_mcount_sections into alloc an…
swine Jul 28, 2023
22ccb91
create-diff-object: Create __patchable_function_entries section for a…
swine Jan 9, 2023
3650f3a
kpatch-build: Enable ARM64 support
swine May 31, 2024
52842ef
create-diff-object: add aarch64 ASSERT_RTNL macro detection
joe-lawrence Feb 15, 2022
62e3ba3
testing: add aarch unit tests
joe-lawrence Oct 5, 2022
e46ddb3
create-diff-object: Fix mapping symbol handling on aarch64
t-msn Sep 7, 2022
9479442
kpatch-syscall.h: add aarch64 helper
swine Jul 28, 2023
a475523
doc/arm64-upstream-prerequisites.md
swine Oct 11, 2022
17a90ec
arm64: per-func __patchable_function_entries sections
swine Jan 9, 2023
9012da5
arm64 leaf-function fix
swine Jul 12, 2023
9dd4923
kpatch-cc skip arch/arm64/kernel/vdso*/*
swine Oct 17, 2022
2e26ee2
adapt to clang/arm64 naming
swine Jan 9, 2023
5c31d6a
testing: freshen unit tests to address ppc64le fails
swine Jan 31, 2023
141d8a1
create-diff-object: merge aarch64 kpatch_line_macro_change_only()
swine Feb 1, 2023
3005626
create-diff-object: keep ubsan section
swine Jul 28, 2023
41375b5
uninit var in kpatch-elf.c
swine Aug 10, 2023
c48342c
create-diff-object: Remove the multi_pfe flag.
ZzzMao Aug 7, 2023
9b261ab
create-diff-object: add init value for pfe flag
ZzzMao Nov 8, 2023
3fb4582
Merge branch 'master' into arm64
swine Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "test/unit/objs"]
path = test/unit/objs
url = https://github.com/dynup/kpatch-unit-test-objs.git
url = https://github.com/swine/kpatch-unit-test-objs.git
branch = remotes/github-swine/arm64
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Supported Architectures

- [x] x86-64
- [x] ppc64le
- [ ] arm64
- [x] arm64 [upstream prerequisites](doc/arm64-upstream-prerequisites.md)
- [x] s390 [upstream prerequisites](doc/s390-upstream-prerequisites.md)

Installation
Expand Down
11 changes: 11 additions & 0 deletions doc/arm64-upstream-prerequisites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### arm64 backporting

**Prerequisite kernel patches:**
**v5.19:**
- [Madhavan Venkataraman's [RFC PATCH v2 00/20] arm64: livepatch: Use ORC for dynamic frame pointer validation](https://lore.kernel.org/linux-arm-kernel/[email protected]/)
- also tested against madvenka's earlier pre-objtool series up to v15

**v5.15 and v5.10:**
- under development, both known to work with backports of madvenka's v15,
but the objtool-using version above is likely to be the approach that
finally merges into upstream kernel
29 changes: 28 additions & 1 deletion kmod/patch/kpatch-syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,34 @@

# endif /* LINUX_VERSION_CODE */

#endif /* CONFIG_X86_64 */
#elif defined(CONFIG_ARM64)

/* arm64/include/asm/syscall_wrapper.h versions */

#define SC_ARM64_REGS_TO_ARGS(x, ...) \
__MAP(x,__SC_ARGS \
,,regs->regs[0],,regs->regs[1],,regs->regs[2] \
,,regs->regs[3],,regs->regs[4],,regs->regs[5])

#define __KPATCH_SYSCALL_DEFINEx(x, name, ...) \
asmlinkage long __arm64_sys##name(const struct pt_regs *regs); \
ALLOW_ERROR_INJECTION(__arm64_sys##name, ERRNO); \
static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
static inline long __kpatch_do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
asmlinkage long __arm64_sys##name(const struct pt_regs *regs) \
{ \
return __se_sys##name(SC_ARM64_REGS_TO_ARGS(x,__VA_ARGS__)); \
} \
static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
{ \
long ret = __kpatch_do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \
__MAP(x,__SC_TEST,__VA_ARGS__); \
__PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
return ret; \
} \
static inline long __kpatch_do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))

#endif /* which arch */


#ifndef __KPATCH_SYSCALL_DEFINEx
Expand Down
2 changes: 1 addition & 1 deletion kpatch-build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ PLUGIN_CFLAGS := $(filter-out -Wconversion, $(CFLAGS))
PLUGIN_CFLAGS += -shared -I$(GCC_PLUGINS_DIR)/include \
-Igcc-plugins -fPIC -fno-rtti -O2 -Wall
endif
ifeq ($(filter $(ARCH),s390x x86_64 ppc64le),)
ifeq ($(filter $(ARCH),aarch64 s390x x86_64 ppc64le),)
$(error Unsupported architecture ${ARCH}, check https://github.com/dynup/kpatch/#supported-architectures)
endif

Expand Down
Loading
Loading