[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 6 Jun 2014 08:36:31 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Alexei Starovoitov' <ast@...mgrid.com>,
"David S. Miller" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net] net: filter: fix typo in sparc BPF JIT
From: Alexei Starovoitov
> fix typo in sparc codegen for SKF_AD_IFINDEX and SKF_AD_HATYPE
> classic BPF extensions
...
> --- a/arch/sparc/net/bpf_jit_comp.c
> +++ b/arch/sparc/net/bpf_jit_comp.c
> @@ -83,9 +83,9 @@ static void bpf_flush_icache(void *start_, void *end_)
> #define BNE (F2(0, 2) | CONDNE)
>
> #ifdef CONFIG_SPARC64
> -#define BNE_PTR (F2(0, 1) | CONDNE | (2 << 20))
> +#define BE_PTR (F2(0, 1) | CONDE | (2 << 20))
> #else
> -#define BNE_PTR BNE
> +#define BE_PTR BNE
> #endif
That doesn't look right.
AFAICT you've had to invert the branch in the code (below) so need
the alternate define - I presume this is the only place they are used.
But the second is only partially inverted.
I presume you only tested sparc64?
David
> #define SETHI(K, REG) \
> @@ -600,7 +600,7 @@ void bpf_jit_compile(struct sk_filter *fp)
> case BPF_S_ANC_IFINDEX:
> emit_skb_loadptr(dev, r_A);
> emit_cmpi(r_A, 0);
> - emit_branch(BNE_PTR, cleanup_addr + 4);
> + emit_branch(BE_PTR, cleanup_addr + 4);
> emit_nop();
> emit_load32(r_A, struct net_device, ifindex, r_A);
> break;
> @@ -613,7 +613,7 @@ void bpf_jit_compile(struct sk_filter *fp)
> case BPF_S_ANC_HATYPE:
> emit_skb_loadptr(dev, r_A);
> emit_cmpi(r_A, 0);
> - emit_branch(BNE_PTR, cleanup_addr + 4);
> + emit_branch(BE_PTR, cleanup_addr + 4);
> emit_nop();
> emit_load16(r_A, struct net_device, type, r_A);
> break;
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists