nfp: bpf: allow stack accesses via modified stack registers
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 23 Oct 2017 18:58:11 +0000 (11:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 08:38:37 +0000 (17:38 +0900)
commitd3488480635f453410fd27cea3fc370cedc7e28a
tree0cff71e73b2b9affc46425378aa80a88c21b0a3a
parent9a90c83c09874a2fd03905ef0f73512c9de18799
nfp: bpf: allow stack accesses via modified stack registers

As long as the verifier tells us the stack offset exactly we
can render the LMEM reads quite easily.  Simply make sure that
the offset is constant for a given instruction and add it to
the instruction's offset.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/verifier.c