Re: [PATCH bpf-next 1/2] bpf: fix a verifier failure with xor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yonghong Song <yhs@xxxxxx> writes:

> On 9/1/20 1:07 PM, Andrii Nakryiko wrote:
>> On Mon, Aug 24, 2020 at 11:47 PM Yonghong Song <yhs@xxxxxx> wrote:
>>>
>>> bpf selftest test_progs/test_sk_assign failed with llvm 11 and llvm 12.
>>> Compared to llvm 10, llvm 11 and 12 generates xor instruction which
>> 
>> Does this mean that some perfectly working BPF programs will now fail
>> to verify on older kernels, if compiled with llvm 11 or llvm 12? If
>
> Right.
>
>> yes, is there something that one can do to prevent Clang from using
>> xor in such situations?
>
> The xor is generated by the combination of llvm simplifyCFG and 
> instrCombine phase.
>
> The following is a hack to prevent compiler from generating xor's.

Wait, so this means that we can no longer tell people to just use the
newest LLVM version - now we have to keep track of a minimum *and*
maximum LLVM version for each kernel version?

Could we maybe try to not *keep* making it harder for people to use BPF? :/

As for the patch, sure, make the verifier smarter, but I also feel like
LLVM should be fixed to not suddenly emit such xor instructions...

-Toke




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux