-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: static data: use inline asm to access static data #27589
Merged
Merged
Conversation
This file contains 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
maintainer-s-little-helper
bot
added
the
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
label
Aug 18, 2023
ti-mo
added
the
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
label
Aug 18, 2023
maintainer-s-little-helper
bot
removed
the
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
label
Aug 18, 2023
ti-mo
force-pushed
the
tb/new-static-data
branch
from
August 22, 2023 15:49
65aae79
to
a0b70e5
Compare
ti-mo
changed the title
bpf: static data: use inline asm to emit ldimm64 with direct symbol relocation
bpf: static data: use inline asm to access static data
Aug 22, 2023
/test |
ti-mo
force-pushed
the
tb/new-static-data
branch
from
August 23, 2023 08:03
a0b70e5
to
faeaa67
Compare
/test |
ti-mo
added
sig/loader
Impacts the loading of BPF programs into the kernel.
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
labels
Aug 23, 2023
ti-mo
force-pushed
the
tb/new-static-data
branch
from
August 23, 2023 09:03
faeaa67
to
fd3cea9
Compare
/test |
ti-mo
force-pushed
the
tb/new-static-data
branch
2 times, most recently
from
August 23, 2023 18:47
287b37d
to
1d5d2c1
Compare
/test |
ti-mo
force-pushed
the
tb/new-static-data
branch
from
August 25, 2023 09:17
1d5d2c1
to
32f2ee5
Compare
/test |
ti-mo
force-pushed
the
tb/new-static-data
branch
from
August 25, 2023 10:04
32f2ee5
to
c5b6e60
Compare
/test |
dylandreimerink
approved these changes
Aug 25, 2023
/test |
@yasz24 can you PTAL and see the areas where you can help in follow ups? |
ti-mo
force-pushed
the
tb/new-static-data
branch
from
October 5, 2023 10:14
c5b6e60
to
2c10ad4
Compare
/test |
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Oct 5, 2023
This will conflict with #28417, will wait for that to land first. |
ti-mo
removed
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Oct 5, 2023
ti-mo
force-pushed
the
tb/new-static-data
branch
from
October 6, 2023 09:22
2c10ad4
to
e8a52f8
Compare
/test |
dst_id is often populated by LXC_ID, which is only theoretically a compile-time constant, and generally only when it is compiled using the default ep_config.h or in bpf unit tests. The actual value used for LXC_ID in the bytecode varies per endpoint, so asserting it to be a constant is not very useful. A subsequent commit will make LXC_ID evaluate to an (inlined) function call, so even the theoretical constant-ness assertion no longer holds. Signed-off-by: Timo Beckers <timo@isovalent.com>
The new static data approach is fully documented in the code. Using an inline asm block makes for a more predictable outcome in the bytecode, meaning we can simplify the substitution logic on the Go side and start using runtime-provided constants for user space dead code elimination. Signed-off-by: Timo Beckers <timo@isovalent.com> Co-authored-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
Due to the new implementation of static data substitution in a prior commit, static data symbols now appear with local binding. Rename isGlobalData and only make it tolerate OBJECT-type symbols with local or global visibility. Signed-off-by: Timo Beckers <timo@isovalent.com>
To reduce the amount of potential interference on the resulting bytecode loaded into the kernel, remove .bss inlining from inlineGlobalData. Since a prior commit, all global data is now explicitly placed in .rodata.config, so symbols should never end up in .bss even if they're zero-initialized. Signed-off-by: Timo Beckers <timo@isovalent.com>
ti-mo
force-pushed
the
tb/new-static-data
branch
from
October 19, 2023 10:33
e8a52f8
to
845f8bd
Compare
/test |
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
sig/loader
Impacts the loading of BPF programs into the kernel.
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.
The new static data approach is fully documented in the code. Using a volatile inline asm block makes for a more predictable outcome in the bytecode, meaning we can simplify the substitution logic on the Go side and start using runtime-provided constants for user space dead code elimination.
Part of: #27320