-
Notifications
You must be signed in to change notification settings - Fork 5
libbpf: move arena variables out of the zero page #6384
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
libbpf: move arena variables out of the zero page #6384
Conversation
|
Upstream branch: 4722981 |
86f62c3 to
c8a7e22
Compare
|
Upstream branch: 7dc211c |
17515ef to
a50fe8f
Compare
c8a7e22 to
c919396
Compare
|
Upstream branch: ec12ab2 |
a50fe8f to
cb78d78
Compare
c919396 to
73c6b0b
Compare
|
Upstream branch: d6ec090 |
cb78d78 to
d491045
Compare
73c6b0b to
0bdd2b9
Compare
|
Upstream branch: d6ec090 |
d491045 to
a95281c
Compare
0bdd2b9 to
729c7ba
Compare
|
Upstream branch: d088da9 |
a95281c to
68abc3d
Compare
729c7ba to
623bab9
Compare
|
Upstream branch: e0940c6 |
68abc3d to
aafd02c
Compare
623bab9 to
fe03c14
Compare
|
Upstream branch: 792f258 |
aafd02c to
393902b
Compare
fe03c14 to
65bfb85
Compare
|
Upstream branch: 878ee3c |
393902b to
5d03558
Compare
65bfb85 to
b1f8b58
Compare
|
Upstream branch: 4dd3a48 |
00119f9 to
7f72b1b
Compare
|
Upstream branch: 4dd3a48 |
7f72b1b to
c02e8d9
Compare
c347688 to
fb42a92
Compare
|
Upstream branch: 8f7cf30 |
c02e8d9 to
61a52ab
Compare
fb42a92 to
3282beb
Compare
|
Upstream branch: c427320 |
61a52ab to
f025c7f
Compare
3282beb to
067f842
Compare
|
Upstream branch: fad8040 |
f025c7f to
3b0fed5
Compare
067f842 to
3bd2c43
Compare
|
Upstream branch: acf8726 |
3b0fed5 to
a455c96
Compare
3bd2c43 to
71c4be1
Compare
|
Upstream branch: 4617b30 |
a455c96 to
fb8e2a8
Compare
71c4be1 to
9b3817c
Compare
|
Upstream branch: 590699d |
The big_alloc1 test in verifier_arena_large assumes that the arena base and the first page allocated by bpf_arena_alloc_pages are identical. This is not the case, because the first page in the arena is populated by global arena data. The test still passes because the code makes the tacit assumption that the first page is on offset PAGE_SIZE instead of 0. Make this distinction explicit in the code, and adjust the page offsets requested during the test to count from the beginning of the arena instead of using the address of the first allocated page. Signed-off-by: Emil Tsalapatis <[email protected]> Reviewed-by: Eduard Zingerman <[email protected]>
Add a stub function for reporting in which offset within a mapping libbpf places the map's data. This will be used in a subsequent patch to support offsetting arena variables within the mapped region. Adjust skeleton generation to account for the new arena memory layout by adding padding corresponding to the offset into the arena map. Add a libbbpf API function to get the data offset within the map's mapping during skeleton generation. Signed-off-by: Emil Tsalapatis <[email protected]>
Currently, libbpf places global arena data at the very beginning of the arena mapping. Stray NULL dereferences into the arena then find valid data and lead to silent corruption instead of causing an arena page fault. The data is placed in the mapping at load time, preventing us from reserving the region using bpf_arena_reserve_pages(). Adjust the arena logic to attempt placing the data from an offset within the arena (currently 16 pages in) instead of the very beginning. If placing the data at an offset would lead to an allocation failure due to global data being as large as the entire arena, progressively reduce the offset down to 0 until placement succeeds. Adjust existing arena tests in the same commit to account for the new global data offset. New tests that explicitly consider the new feature are introduced in the next patch. Signed-off-by: Emil Tsalapatis <[email protected]>
Add tests for the new libbpf globals arena offset logic. The tests cover all three cases: The globals being small enough to be placed at the maximum possible offset, being as large as the arena itself and being placed at the very beginning, and requiring an intermediate offset into the arena. Signed-off-by: Emil Tsalapatis <[email protected]>
fb8e2a8 to
434ab9a
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1024622 expired. Closing PR. |
Pull request for series with
subject: libbpf: move arena variables out of the zero page
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1024622