OSDN Git Service

riscv, bpf: Fix missing exception handling and redundant zext for LDX_B/H/W
authorPu Lehui <pulehui@huawei.com>
Thu, 24 Aug 2023 09:49:55 +0000 (09:49 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 24 Aug 2023 16:13:08 +0000 (09:13 -0700)
commit469fb2c3c1bbaa092f541e3a8d3b3554042aa6a5
treed5eb570a44e9525e6ca5706b927d3fcc145a1505
parent1b580c9bb63414903cfb414571e92e4fd36d6969
riscv, bpf: Fix missing exception handling and redundant zext for LDX_B/H/W

For LDX_B/H/W, when zext has been inserted by verifier, it'll return 1,
and no exception handling will continue. Also, when the offset is 12-bit
value, the redundant zext inserted by the verifier is not removed. Fix
both scenarios by moving down the removal of redundant zext.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Link: https://lore.kernel.org/r/20230824095001.3408573-2-pulehui@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/riscv/net/bpf_jit_comp64.c