On 02/13/2023 11:01 AM, Tiezhu Yang wrote:
Hi Hengqi,
On 02/12/2023 11:52 AM, Hengqi Chen wrote:
Let's always use 4 instructions for function address in JIT.
So that the instruction sequences don't change between the first
pass and the extra pass for function calls.
Fixes: 5dc615520c4d ("LoongArch: Add BPF JIT support")
Signed-off-by: Hengqi Chen <hengqi.chen@xxxxxxxxx>
---
arch/loongarch/net/bpf_jit.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c
index c4b1947ebf76..2d952110be72 100644
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -446,6 +446,27 @@ static int add_exception_handler(const struct
bpf_insn *insn,
return 0;
}
+static inline void emit_addr_move(struct jit_ctx *ctx, enum
loongarch_gpr rd, u64 addr)
Small nit:
Maybe use move_addr() ( like move_imm() ) is better than
emit_addr_move()?
Thanks,
Tiezhu