public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wentao Guan" <guanwentao@uniontech.com>
To: stable <stable@vger.kernel.org>
Cc: gregkh <gregkh@linuxfoundation.org>,
	chenhuacai <chenhuacai@kernel.org>,
	loongarch <loongarch@lists.linux.dev>
Subject: [PATCH 6.6] Revert "LoongArch: BPF: Sign extend kfunc call arguments"
Date: Wed, 14 Jan 2026 14:13:25 +0800	[thread overview]
Message-ID: <tencent_09063379481F265B19AC7AC7@qq.com> (raw)

It cause loongarch build failed. it need merge more depends,
such as "LoongArch: Add more instruction opcodes and emit_* helpers"
This reverts commit fd43edf357a3a1f5ed1c4bf450b60001c9091c39.

config: https://gist.github.com/opsiff/b6c9c32ade5f6d4abb5454a476f4c4e1
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
---
 arch/loongarch/net/bpf_jit.c | 16 ----------------
 arch/loongarch/net/bpf_jit.h | 26 --------------------------
 2 files changed, 42 deletions(-)

diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c
index 54661cffd654f..c6400d7b95ee8 100644
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -834,22 +834,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 		if (ret < 0)
 			return ret;
 
-		if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
-			const struct btf_func_model *m;
-			int i;
-
-			m = bpf_jit_find_kfunc_model(ctx->prog, insn);
-			if (!m)
-				return -EINVAL;
-
-			for (i = 0; i < m->nr_args; i++) {
-				u8 reg = regmap[BPF_REG_1 + i];
-				bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG;
-
-				emit_abi_ext(ctx, reg, m->arg_size[i], sign);
-			}
-		}
-
 		move_addr(ctx, t1, func_addr);
 		emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
 
diff --git a/arch/loongarch/net/bpf_jit.h b/arch/loongarch/net/bpf_jit.h
index 9352ea5545308..f9c569f539491 100644
--- a/arch/loongarch/net/bpf_jit.h
+++ b/arch/loongarch/net/bpf_jit.h
@@ -87,32 +87,6 @@ static inline void emit_sext_32(struct jit_ctx *ctx, enum loongarch_gpr reg, boo
 	emit_insn(ctx, addiw, reg, reg, 0);
 }
 
-/* Emit proper extension according to ABI requirements.
- * Note that it requires a value of size `size` already resides in register `reg`.
- */
-static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign)
-{
-	/* ABI requires unsigned char/short to be zero-extended */
-	if (!sign && (size == 1 || size == 2))
-		return;
-
-	switch (size) {
-	case 1:
-		emit_insn(ctx, extwb, reg, reg);
-		break;
-	case 2:
-		emit_insn(ctx, extwh, reg, reg);
-		break;
-	case 4:
-		emit_insn(ctx, addiw, reg, reg, 0);
-		break;
-	case 8:
-		break;
-	default:
-		pr_warn("bpf_jit: invalid size %d for extension\n", size);
-	}
-}
-
 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr)
 {
 	u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;

             reply	other threads:[~2026-01-14  6:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  6:13 Wentao Guan [this message]
2026-01-14  6:24 ` [PATCH 6.6] Revert "LoongArch: BPF: Sign extend kfunc call arguments" Wentao Guan
2026-01-15 11:38   ` Greg KH
2026-01-30 10:04 ` [PATCH 6.6] ALSA: usb-audio: Fix missing unlock at error path of maxpacksize check Wentao Guan
2026-02-03 14:48   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_09063379481F265B19AC7AC7@qq.com \
    --to=guanwentao@uniontech.com \
    --cc=chenhuacai@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=loongarch@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox