forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc/bpf: Reallocate BPF registers to volatile registers when poss…
…ible on PPC64 Implement commit 4027203 ("powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32") for PPC64. When the BPF routine doesn't call any function, the non volatile registers can be reallocated to volatile registers in order to avoid having to save them/restore on the stack. To keep track of which registers can be reallocated to make sure registers are set seen when used. Before this patch, the test torvalds#359 ADD default X is: 0: nop 4: nop 8: std r27,-40(r1) c: std r28,-32(r1) 10: xor r8,r8,r8 14: rotlwi r8,r8,0 18: xor r28,r28,r28 1c: rotlwi r28,r28,0 20: mr r27,r3 24: li r8,66 28: add r8,r8,r28 2c: rotlwi r8,r8,0 30: ld r27,-40(r1) 34: ld r28,-32(r1) 38: mr r3,r8 3c: blr After this patch, the same test has become: 0: nop 4: nop 8: xor r8,r8,r8 c: rotlwi r8,r8,0 10: xor r5,r5,r5 14: rotlwi r5,r5,0 18: mr r4,r3 1c: li r8,66 20: add r8,r8,r5 24: rotlwi r8,r8,0 28: mr r3,r8 2c: blr Signed-off-by: Jordan Niethe <[email protected]>
- Loading branch information
1 parent
283acec
commit 8e40280
Showing
2 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 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