Cc: David S. Miller <da...@davemloft.net>
Signed-off-by: Jiong Wang <jiong.w...@netronome.com>
---
 arch/sparc/net/bpf_jit_comp_64.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c
index 65428e7..e58f84e 100644
--- a/arch/sparc/net/bpf_jit_comp_64.c
+++ b/arch/sparc/net/bpf_jit_comp_64.c
@@ -1144,7 +1144,8 @@ static int build_insn(const struct bpf_insn *insn, struct 
jit_ctx *ctx)
                break;
 
        do_alu32_trunc:
-               if (BPF_CLASS(code) == BPF_ALU)
+               if (BPF_CLASS(code) == BPF_ALU &&
+                   ctx->prog->aux->no_verifier_zext)
                        emit_alu_K(SRL, dst, 0, ctx);
                break;
 
@@ -1432,6 +1433,11 @@ static void jit_fill_hole(void *area, unsigned int size)
                *ptr++ = 0x91d02005; /* ta 5 */
 }
 
+bool bpf_jit_hardware_zext(void)
+{
+       return false;
+}
+
 struct sparc64_jit_data {
        struct bpf_binary_header *header;
        u8 *image;
-- 
2.7.4

Reply via email to