ebpf-verifier
ebpf-verifier copied to clipboard
Add other atomic instructions
- Add the rest of the atomic instructions defined in https://www.ietf.org/archive/id/draft-ietf-bpf-isa-00.html#name-atomic-operations
- Add various test cases in atomic.yaml
- Replace uses of
(INST_MEM << 5)
etc. with the more readable and less bug-proneINST_MODE_MEM
. - Make the atomic operation conformance tests (all of which do operations on stack memory not shared memory) pass
- The CMPXCHG instruction is still not as precise as it could be. Improving its precision is left for future work (filed issue #566 to track this issue where a number of conformance tests give TOP or a RANGE instead of the exact value)
Fixes #483
coverage: 90.322% (-0.02%) from 90.344% when pulling e96578fe6c0fd15f812f00478bcc1c0feb2532ae on dthaler:atomics into fe59c86c51091f5449409c2326eae7d257d36277 on vbpf:main.
I'm probably missing something, but aren't the instructions atomic because they change memory regions that are already volatile?
I'm probably missing something, but aren't the instructions atomic because they change memory regions that are already volatile?
Apparently atomic operations can also work on stack memory. Not that you need atomic operations for them, but if you do them they shouldn't fail verification per se (and don't on Linux).
Looks good in general. See my question about the choice of fields though.
I think I've now made changes according to all your comments. Please re-review. Thanks!