Eduard Zingerman <eddyz87@xxxxxxxxx> writes: > I think it would be good to have some tests checking that nospec > instructions are inserted in expected locations. > Could you please take look at use of __xlated tag in e.g. > tools/testing/selftests/bpf/progs/verifier_sdiv.c ? That looks very promising, I will look into it for v2. Thanks for the pointer. I guess it might be worth it to add __xlated to at least on test per nospec-related code path. If there are other rewrites at play that will make it harder to adapt the tests when the other rewrite is ever changed, but it might also help in catching interactions between the other rewrites and the nospec. Also, thanks for the review of patches 2 and 3.