Open
Conversation
Kernel supports few instruction sets [1], and the default one (which is apparently being used at the moment in falco) is going to be the `generic` or `v1`, which has certain limitations and requires workarounds. It's possible to instruct `llc` to search the latest supported instruction set via `-mcpu` parameter, which generally speaking should result in more compact and potentially more performant generated instructions for the same code. For the support table see great blog post [2] about the topic. The gist for the support is: v2: Linux v4.14 [3], LLVM v6.0 [4] v3: Linux v5.1 [5], LLVM [6] [1]: https://www.kernel.org/doc/html/latest/bpf/bpf_devel_QA.html#q-new-bpf-instruction-for-kernel-and-llvm [2]: https://pchaigno.github.io/bpf/2021/10/20/ebpf-instruction-sets.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=92b31a9af73b3a3fc801899335d6c47966351830 [4]: https://reviews.llvm.org/rL311522 [5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=092ed0968bb648cd18e8a0430cd0a8a71727315c [6]: https://reviews.llvm.org/rL353384
Collaborator
|
This looks really cool. Now that we've got the custom probe, I think these changes should be in https://github.com/stackrox/collector/blob/8ba5dc88a2dd7d948e7308103b336a4369a2de31/kernel-modules/probe/Makefile instead (or we can mirror them here as well) |
Collaborator
Author
Here [1]. I guess it would have to be overridden based on the version we build for though, still need to look at this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kernel supports few instruction sets [1], and the default one (which is
apparently being used at the moment in falco) is going to be the
genericorv1, which has certain limitations and requiresworkarounds. It's possible to instruct
llcto search the latestsupported instruction set via
-mcpuparameter, which generallyspeaking should result in more compact and potentially more performant
generated instructions for the same code. For the support table see
great blog post [2] about the topic. The gist for the support is:
v2: Linux v4.14 [3], LLVM v6.0 [4]
v3: Linux v5.1 [5], LLVM [6]