nfp: bpf: zero extend 4 byte context loads
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 28 Sep 2016 22:47:37 +0000 (23:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Sep 2016 06:10:15 +0000 (02:10 -0400)
Set upper 32 bits of destination register to zeros after
load from the context structure.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_bpf_jit.c

index 3de819acd68c0b7afae479f86deb550554e613e7..f8df5300f49c1182e271d444c3b42714f30951e6 100644 (file)
@@ -1134,6 +1134,8 @@ static int mem_ldx4(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
        else
                return -ENOTSUPP;
 
+       wrp_immed(nfp_prog, reg_both(meta->insn.dst_reg * 2 + 1), 0);
+
        return 0;
 }