|
@@ -1015,8 +1015,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
|
|
/* llgf %w1,map.max_entries(%b2) */
|
|
/* llgf %w1,map.max_entries(%b2) */
|
|
|
EMIT6_DISP_LH(0xe3000000, 0x0016, REG_W1, REG_0, BPF_REG_2,
|
|
EMIT6_DISP_LH(0xe3000000, 0x0016, REG_W1, REG_0, BPF_REG_2,
|
|
|
offsetof(struct bpf_array, map.max_entries));
|
|
offsetof(struct bpf_array, map.max_entries));
|
|
|
- /* clgrj %b3,%w1,0xa,label0: if %b3 >= %w1 goto out */
|
|
|
|
|
- EMIT6_PCREL_LABEL(0xec000000, 0x0065, BPF_REG_3,
|
|
|
|
|
|
|
+ /* clrj %b3,%w1,0xa,label0: if (u32)%b3 >= (u32)%w1 goto out */
|
|
|
|
|
+ EMIT6_PCREL_LABEL(0xec000000, 0x0077, BPF_REG_3,
|
|
|
REG_W1, 0, 0xa);
|
|
REG_W1, 0, 0xa);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1042,8 +1042,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
|
|
* goto out;
|
|
* goto out;
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- /* sllg %r1,%b3,3: %r1 = index * 8 */
|
|
|
|
|
- EMIT6_DISP_LH(0xeb000000, 0x000d, REG_1, BPF_REG_3, REG_0, 3);
|
|
|
|
|
|
|
+ /* llgfr %r1,%b3: %r1 = (u32) index */
|
|
|
|
|
+ EMIT4(0xb9160000, REG_1, BPF_REG_3);
|
|
|
|
|
+ /* sllg %r1,%r1,3: %r1 *= 8 */
|
|
|
|
|
+ EMIT6_DISP_LH(0xeb000000, 0x000d, REG_1, REG_1, REG_0, 3);
|
|
|
/* lg %r1,prog(%b2,%r1) */
|
|
/* lg %r1,prog(%b2,%r1) */
|
|
|
EMIT6_DISP_LH(0xe3000000, 0x0004, REG_1, BPF_REG_2,
|
|
EMIT6_DISP_LH(0xe3000000, 0x0004, REG_1, BPF_REG_2,
|
|
|
REG_1, offsetof(struct bpf_array, ptrs));
|
|
REG_1, offsetof(struct bpf_array, ptrs));
|