[PATCH bpf-next v2 0/2] bpf, mips: Do some small changes

STALE1771d

Revision v2 of 2 in this series.

5 messages, 3 authors, 2021-10-11 · open the first message on its own page

[PATCH bpf-next v2 0/2] bpf, mips: Do some small changes

From: Tiezhu Yang <yangtiezhu@loongson.cn>
Date: 2021-10-11 01:20:01

This patchset is based on bpf-next tree:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git

v2:
  -- Update patch #2 to only fix the comment,
     suggested by Johan Almbladh, thank you.

Tiezhu Yang (2):
  bpf, mips: Clean up config options about JIT
  bpf, mips: Fix comment on tail call count limiting

 arch/mips/Kconfig              | 9 ---------
 arch/mips/net/Makefile         | 6 +++---
 arch/mips/net/bpf_jit_comp32.c | 2 +-
 3 files changed, 4 insertions(+), 13 deletions(-)

-- 
2.1.0

[PATCH bpf-next v2 1/2] bpf, mips: Clean up config options about JIT

From: Tiezhu Yang <yangtiezhu@loongson.cn>
Date: 2021-10-11 01:19:30

The config options MIPS_CBPF_JIT and MIPS_EBPF_JIT are useless, remove
them in arch/mips/Kconfig, and then modify arch/mips/net/Makefile.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
---
 arch/mips/Kconfig      | 9 ---------
 arch/mips/net/Makefile | 6 +++---
 2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 38468f4..9b03c78 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1214,15 +1214,6 @@ config SYS_SUPPORTS_RELOCATABLE
 	  The platform must provide plat_get_fdt() if it selects CONFIG_USE_OF
 	  to allow access to command line and entropy sources.
 
-config MIPS_CBPF_JIT
-	def_bool y
-	depends on BPF_JIT && HAVE_CBPF_JIT
-
-config MIPS_EBPF_JIT
-	def_bool y
-	depends on BPF_JIT && HAVE_EBPF_JIT
-
-
 #
 # Endianness selection.  Sufficiently obscure so many users don't know what to
 # answer,so we try hard to limit the available choices.  Also the use of a
diff --git a/arch/mips/net/Makefile b/arch/mips/net/Makefile
index 95e8267..e3e6ae6 100644
--- a/arch/mips/net/Makefile
+++ b/arch/mips/net/Makefile
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # MIPS networking code
 
-obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o
+obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o
 
 ifeq ($(CONFIG_32BIT),y)
-        obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp32.o
+        obj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o
 else
-        obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp64.o
+        obj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o
 endif
-- 
2.1.0

[PATCH bpf-next v2 2/2] bpf, mips: Fix comment on tail call count limiting

From: Tiezhu Yang <yangtiezhu@loongson.cn>
Date: 2021-10-11 01:19:31

In emit_tail_call() of bpf_jit_comp32.c, "blez t2" (t2 <= 0) is
not consistent with the comment "t2 < 0", update the comment to
keep consistency.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/mips/net/bpf_jit_comp32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/net/bpf_jit_comp32.c b/arch/mips/net/bpf_jit_comp32.c
index 9d7041a..bd996ed 100644
--- a/arch/mips/net/bpf_jit_comp32.c
+++ b/arch/mips/net/bpf_jit_comp32.c
@@ -1315,7 +1315,7 @@ static int emit_tail_call(struct jit_context *ctx)
 	/* if (TCC-- <= 0) goto out */
 	emit(ctx, lw, t2, ctx->stack_size, MIPS_R_SP);  /* t2 = *(SP + size) */
 	emit_load_delay(ctx);                     /* Load delay slot         */
-	emit(ctx, blez, t2, get_offset(ctx, 1));  /* PC += off(1) if t2 < 0  */
+	emit(ctx, blez, t2, get_offset(ctx, 1));  /* PC += off(1) if t2 <= 0 */
 	emit(ctx, addiu, t2, t2, -1);             /* t2-- (delay slot)       */
 	emit(ctx, sw, t2, ctx->stack_size, MIPS_R_SP);  /* *(SP + size) = t2 */
 
-- 
2.1.0

Re: [PATCH bpf-next v2 2/2] bpf, mips: Fix comment on tail call count limiting

From: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Date: 2021-10-11 08:13:47

On Mon, Oct 11, 2021 at 3:19 AM Tiezhu Yang [off-list ref] wrote:
In emit_tail_call() of bpf_jit_comp32.c, "blez t2" (t2 <= 0) is
not consistent with the comment "t2 < 0", update the comment to
keep consistency.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
quoted hunk
---
 arch/mips/net/bpf_jit_comp32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/net/bpf_jit_comp32.c b/arch/mips/net/bpf_jit_comp32.c
index 9d7041a..bd996ed 100644
--- a/arch/mips/net/bpf_jit_comp32.c
+++ b/arch/mips/net/bpf_jit_comp32.c
@@ -1315,7 +1315,7 @@ static int emit_tail_call(struct jit_context *ctx)
        /* if (TCC-- <= 0) goto out */
        emit(ctx, lw, t2, ctx->stack_size, MIPS_R_SP);  /* t2 = *(SP + size) */
        emit_load_delay(ctx);                     /* Load delay slot         */
-       emit(ctx, blez, t2, get_offset(ctx, 1));  /* PC += off(1) if t2 < 0  */
+       emit(ctx, blez, t2, get_offset(ctx, 1));  /* PC += off(1) if t2 <= 0 */
        emit(ctx, addiu, t2, t2, -1);             /* t2-- (delay slot)       */
        emit(ctx, sw, t2, ctx->stack_size, MIPS_R_SP);  /* *(SP + size) = t2 */

--
2.1.0

Re: [PATCH bpf-next v2 0/2] bpf, mips: Do some small changes

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-11 13:40:51

Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann [off-list ref]:

On Mon, 11 Oct 2021 09:19:08 +0800 you wrote:
This patchset is based on bpf-next tree:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git

v2:
  -- Update patch #2 to only fix the comment,
     suggested by Johan Almbladh, thank you.

[...]
Here is the summary with links:
  - [bpf-next,v2,1/2] bpf, mips: Clean up config options about JIT
    https://git.kernel.org/bpf/bpf-next/c/307d149d9435
  - [bpf-next,v2,2/2] bpf, mips: Fix comment on tail call count limiting
    https://git.kernel.org/bpf/bpf-next/c/431bfb9ee3e2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help