Re: [PATCH 3/3] LoongArch: BPF: No support of struct argument in trampoline programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025/8/21 下午5:10, Hengqi Chen wrote:
The current implementation does not support struct argument.

...

Reject it for now.

Fixes: f9b6b41f0cf3 ("LoongArch: BPF: Add basic bpf trampoline support")
Signed-off-by: Hengqi Chen <hengqi.chen@xxxxxxxxx>
---
  arch/loongarch/net/bpf_jit.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c
index 6754e5231ece..a87f51f5b708 100644
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -1516,6 +1516,12 @@ static int __arch_prepare_bpf_trampoline(struct jit_ctx *ctx, struct bpf_tramp_i
  	if (m->nr_args > LOONGARCH_MAX_REG_ARGS)
  		return -ENOTSUPP;
+ /* don't support struct argument */
+	for (i = 0; i < m->nr_args; i++) {
+		if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
+			return -ENOTSUPP;
+	}
+

Acked-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
Tested-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>

By the way, I have 2 patches locally, one patch is to implement this feature, but there exist some other problems now, maybe it is related with the following failed testcase:

  sudo ./test_progs -t module_attach

Anyway, I will send a RFC series later for your review.

Thanks,
Tiezhu





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux