-
Notifications
You must be signed in to change notification settings - Fork 334
Add support for Arm64 including all changes in PR #1302 (@swine, @surajjs95, @t-msn, and others) #1439
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
Merged
Merged
Add support for Arm64 including all changes in PR #1302 (@swine, @surajjs95, @t-msn, and others) #1439
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6bea1dd
kpatch-build: update version to 0.9.10
puranjaymohan 2ed84b1
kpatch-build: Add sym->has_func_profiling support for aarch64
062fd46
create-diff-object: Check __patchable_function_entries section for aa…
swine c1034f5
kpatch-build: Enable ARM64 support
72f6a88
create-diff-object: Include .rodata.str section in output object
8f29263
create-diff-object: Fix mapping symbol handling on aarch64
t-msn 01db546
kpatch-syscall.h: add aarch64 helper
swine 6f0ecd5
create-diff-object: Add support for arm64 DYNAMIC_FTRACE_WITH_CALL_OPS
dylanbhatch 197c679
create-diff-object: skip sframe sections for now
puranjaymohan 95d93a3
create-diff-object: don't mangle .rela.__patchable_function_entries
puranjaymohan f15eedf
test/unit/objs: Update reference for arm64 objs
puranjaymohan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we believe the
ishould be either 0 or 2, would it be better if we can report an error here when theiis some other value?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the function_padding_size is decideced by the nop padding at the start of the function.
The number of nop adding to the function head is decided by the N of building option
-fpatchable-function-entry.Or maybe this function padding size can be calculated by this building option of the target kernel
build Makefile? And we can support more specific situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the arm64 kernel build, there could be:
There could also be a
BTIinstruction at the entry of the function before the two nops, if they exist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puranjaymohan : From my understanding, I think @wardenjohn is right about the
-fpatchable-function-entryargument... but I don't think it's trivial to figure out what that build-time option actually was. (Sure, kpatch-build could reverse engineer from the kernel config, but it may become out of date.) So for the time being, I think the dynamic padding check is easier to implement. (Incidentally, we may need this dynamic padding for ppc64le as there are kernel config options that change the number of nops from 1, 2, etc.)Anyway, a trivial nitpick here:
*insn == 0xd503201fis not endian safe. See other examples in this file that check the bytes individually.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay,
I will fix it in the next push.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puranjaymohan , a reminder for the pending changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZzzMao I have already pushed the fix.
Now the code looks like: