Skip to content

Commit bef8968

Browse files
Russell Kingborkmann
Russell King
authored andcommitted
ARM: net: bpf: always use odd/even register pair
Always use an odd/even register pair for our 64-bit registers, so that we're able to use the double-word load/store instructions in the future. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent b504522 commit bef8968

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

arch/arm/net/bpf_jit_32.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,27 @@
4747
* The callee saved registers depends on whether frame pointers are enabled.
4848
* With frame pointers (to be compliant with the ABI):
4949
*
50-
* high
51-
* original ARM_SP => +------------------+ \
52-
* | pc | |
53-
* current ARM_FP => +------------------+ } callee saved registers
54-
* |r4-r8,r10,fp,ip,lr| |
55-
* +------------------+ /
56-
* low
50+
* high
51+
* original ARM_SP => +--------------+ \
52+
* | pc | |
53+
* current ARM_FP => +--------------+ } callee saved registers
54+
* |r4-r9,fp,ip,lr| |
55+
* +--------------+ /
56+
* low
5757
*
5858
* Without frame pointers:
5959
*
60-
* high
61-
* original ARM_SP => +------------------+
62-
* | r4-r8,r10,fp,lr | callee saved registers
63-
* current ARM_FP => +------------------+
64-
* low
60+
* high
61+
* original ARM_SP => +--------------+
62+
* | r4-r9,fp,lr | callee saved registers
63+
* current ARM_FP => +--------------+
64+
* low
6565
*
6666
* When popping registers off the stack at the end of a BPF function, we
6767
* reference them via the current ARM_FP register.
6868
*/
6969
#define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \
70-
1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R10 | \
70+
1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \
7171
1 << ARM_FP)
7272
#define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR)
7373
#define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC)
@@ -157,7 +157,7 @@ static const s8 bpf2a32[][2] = {
157157
* for constant blindings and others.
158158
*/
159159
[TMP_REG_1] = {ARM_R7, ARM_R6},
160-
[TMP_REG_2] = {ARM_R10, ARM_R8},
160+
[TMP_REG_2] = {ARM_R9, ARM_R8},
161161
/* Tail call count. Stored on stack scratch space. */
162162
[TCALL_CNT] = {STACK_OFFSET(BPF_TC_HI), STACK_OFFSET(BPF_TC_LO)},
163163
/* temporary register for blinding constants.

0 commit comments

Comments
 (0)