sw64: bpf: fix ebpf jit compiler
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5PNGJ -------------------------------- This patch makes following changes to ebpf jit compiler: * implement proper XADD instructions * implement 32-bit ARSH instructions * implement DIV and MOD instructions using helper functions * reorganize header file to make it easier to read * optimize load immediate helper functions * make sure ILLEGAL_INSN will throw instruction fault * make sure fields in jited instrctions won't overflow * restore GP register when exit * make sure 32-bit alu functions are unsigned * make sure 32-bit results are zero extended to 64 bits * make sure function addr are stored in $27 so callee can calculate GP correctly * track free temporary registers to make sure we won't accidentally clobber useful data * fix register mapping * fix host to be algorithm * fix offset calculation of branch instructions * fix tail call Result of "test_bpf.ko": 378 PASSED, 0 FAILED, [366/366 JIT'ed] Signed-off-by: NMao Minkai <maominkai@wxiat.com> Signed-off-by: NGu Zitao <guzitao@wxiat.com>
Showing
想要评论请 注册 或 登录