Skip to content

Commit

Permalink
README: Add arch porting question
Browse files Browse the repository at this point in the history
Adding a new architecture pops up time to time, since the answer remains
the same each time, provide the common question/answer in the FAQ.

Answered-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Joe Lawrence <[email protected]>
  • Loading branch information
joe-lawrence committed Sep 1, 2022
1 parent b10d0e2 commit feb5e2b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,23 @@ built separately.
`kpatch-build --oot-module-src ~/test/ --target default --oot-module /lib/modules/$(uname -r)/extra/test.ko test.patch`


**Q. What is needed to support a new architecture?**

Porting an architecture can be done in three phases:

1. In the kernel, add `CONFIG_HAVE_LIVEPATCH` support. For some arches
this might be as simple as enabling `CONFIG_DYNAMIC_FTRACE_WITH REGS`.
With this support you can do basic live patches like those in
samples/livepatch. Livepatch functionality is limited and extra care
must be taken to avoid certain pitfalls.
2. Add kpatch-build (create-diff-object) support. This makes it easier
to build patches, and avoids some of the pitfalls. For example,
https://github.com/dynup/kpatch/pull/1203 added s390x support.
3. Add `CONFIG_HAVE_RELIABLE_STACKTRACE` and (if needed) objtool
support in the kernel. This avoids more pitfalls and enables full
livepatch functionality.


Get involved
------------

Expand Down

0 comments on commit feb5e2b

Please sign in to comment.