Commit 347b5d2
committed
bpf, arm32: Fix JIT bswap32 code on pre-ARMv6
Current JIT includes fall-back code for byte-swapping on older ARM archs,
but fails tests from module test_bpf:
test_bpf: torvalds#299 ALU_END_FROM_BE 64: 0x0123456789abcdef >> 32 -> 0x01234567 jited:1 ret 4530944 != -271733879 (0x452300 != 0xefcdab89)FAIL (1 times)
test_bpf: torvalds#303 ALU_END_FROM_BE 64: 0xfedcba9876543210 >> 32 -> 0xfedcba98 jited:1 ret 12246016 != 271733878 (0xbadc00 != 0x10325476)FAIL (1 times)
test_bpf: torvalds#315 BSWAP 64: 0x0123456789abcdef >> 32 -> 0xefcdab89 jited:1 ret 4530944 != -271733879 (0x452300 != 0xefcdab89)FAIL (1 times)
test_bpf: torvalds#319 BSWAP 64: 0xfedcba9876543210 >> 32 -> 0x10325476 jited:1 ret 12246016 != 271733878 (0xbadc00 != 0x10325476)FAIL (1 times)
These problems can be traced back to emit_rev32(). Rewrite as simpler code,
going from 10 insns to 4 and dropping use of 2 temp registers, while also
fixing the test failures above.
Signed-off-by: Tony Ambardar <[email protected]>1 parent ac68086 commit 347b5d2
1 file changed
+4
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1754 | 1754 | | |
1755 | 1755 | | |
1756 | 1756 | | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
1768 | | - | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1769 | 1761 | | |
1770 | 1762 | | |
1771 | 1763 | | |
| |||
0 commit comments