From: Denis Kirjanov Date: Mon, 1 Dec 2014 10:12:25 +0000 (+0300) Subject: test: bpf: expand DIV_KX to DIV_MOD_KX X-Git-Tag: MMI-PSA29.97-13-9~11024^2~91 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6867b17b26d80cfd419e491141feb75082915979;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git test: bpf: expand DIV_KX to DIV_MOD_KX Expand DIV_KX to use BPF_MOD operation in the DIV_KX bpf 'classic' test. CC: Alexei Starovoitov Signed-off-by: Denis Kirjanov Signed-off-by: David S. Miller --- diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 3f167d2eeb94..80d78c51f65f 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -124,7 +124,7 @@ static struct bpf_test tests[] = { { { 0, 0xfffffffd } } }, { - "DIV_KX", + "DIV_MOD_KX", .u.insns = { BPF_STMT(BPF_LD | BPF_IMM, 8), BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2), @@ -134,12 +134,18 @@ static struct bpf_test tests[] = { BPF_STMT(BPF_MISC | BPF_TAX, 0), BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff), BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000), + BPF_STMT(BPF_MISC | BPF_TAX, 0), + BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff), + BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0), + BPF_STMT(BPF_MISC | BPF_TAX, 0), + BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff), + BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x70000000), BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0), BPF_STMT(BPF_RET | BPF_A, 0) }, CLASSIC | FLAG_NO_DATA, { }, - { { 0, 0x40000001 } } + { { 0, 0x20000000 } } }, { "AND_OR_LSH_K",