Commit graph

1140 commits

Author SHA1 Message Date
Stephane Lee
eb61b739ae Increase the log size for larger bpf programs
Test: Build passes, bpf program loads without an out of space error
Bug: 203462310
Change-Id: I5f67021a530223467662f341cdfffc4816781078
2021-10-22 19:07:05 -07:00
Treehugger Robot
bf05d42ef4 Merge "bpfloader: add schedact support" 2021-10-14 02:06:12 +00:00
Patrick Rohr
b28bf2aa53 bpfloader: add schedact support
This also bumps the bpfloader version to 0.3 to signify support
for loading schedact (ie. tc scheduler action) programs.

Test: load netd.o
Change-Id: Ic3fdc80d3f6ea2b42a4f1d6829b1ff12dd4d52c0
2021-10-13 19:28:53 +00:00
Pirama Arumuga Nainar
ee9072f58e Cleanup unused dependency to libprocessgroup am: e8d6df1231
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1815076

Change-Id: I2250ddd495b6dc05b5161e0739f6f3fefc69f63d
2021-08-31 20:59:11 +00:00
Pirama Arumuga Nainar
e8d6df1231 Cleanup unused dependency to libprocessgroup
Bug: http://b/197965342

Dependence on libprocessgroup was removed in aosp/947297

Test: presubmit
Change-Id: I802efee3500e25006b55e0f35cb8650fd1aa2033
2021-08-31 19:59:20 +00:00
Dmitri Plotnikov
e93ed7e867 Add support for testing of eBPF programs am: bb05a5c138 am: f0e77da7be
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1507724

Change-Id: Ib6e1c04a3ff1b9dd5d4cdc5b6877ce99399481fa
2021-07-16 03:00:15 +00:00
Dmitri Plotnikov
f0e77da7be Add support for testing of eBPF programs am: bb05a5c138
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1507724

Change-Id: I1d386f72940ce6e271970bc3d2e862a98bac0556
2021-07-16 02:41:52 +00:00
Dmitri Plotnikov
bb05a5c138 Add support for testing of eBPF programs
Bug: 171262763
Test: this is just a header file
Change-Id: Id25846f91d2da698717a9cc0d8d9091022dd7233
2021-07-15 17:06:15 -07:00
Maciej Żenczykowski
475ac08ee8 [automerger skipped] expose readSectionUint() for testing am: c1f8ca3060 -s ours
am skip reason: Merged-In I772c918d162440de6cc492b2faeafe03340fca11 with SHA-1 7ed94efeda is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15212804

Change-Id: I6812cfa7767b4954ba5e7b35ddd87caf1fe3de72
2021-07-06 12:37:25 +00:00
Maciej Żenczykowski
fbe33e1b4c [automerger skipped] bpf - struct bpf_map_def - add min/max kernel version. am: 2a51516a63 -s ours
am skip reason: Merged-In I085cc723ff1c19d8acc8972a391f894e16dd1875 with SHA-1 36c53ba91e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15212803

Change-Id: I2f61b1be0d81117e7facde4a7b9ca50f161b9e66
2021-07-06 12:37:24 +00:00
Maciej Żenczykowski
c1f8ca3060 expose readSectionUint() for testing
Bug: 190519702
Test: atest bpf_module_test, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756850
Merged-In: I772c918d162440de6cc492b2faeafe03340fca11
Change-Id: I772c918d162440de6cc492b2faeafe03340fca11
2021-07-06 10:50:12 +00:00
Maciej Żenczykowski
2a51516a63 bpf - struct bpf_map_def - add min/max kernel version.
This is also bpfloader v0.2.
Some newer map types (for example DEVMAP) are unusable
on older kernel versions.

Bug: 190519702
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756575
Merged-In: I085cc723ff1c19d8acc8972a391f894e16dd1875
Change-Id: I085cc723ff1c19d8acc8972a391f894e16dd1875
2021-07-06 10:49:52 +00:00
Maciej Żenczykowski
f71ce9b4c9 expose readSectionUint() for testing am: 7ed94efeda am: 0f24b26b6c
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756850

Change-Id: Ibd6d7fb84b583ef5a9a15e7ccc28ae79173f3f76
2021-07-06 10:37:12 +00:00
Maciej Żenczykowski
6f2b6ca0ca bpf - struct bpf_map_def - add min/max kernel version. am: 36c53ba91e am: f1421cd47f
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756575

Change-Id: I75a99d681d7e82cb46f4350e29bf4ce1992636d1
2021-07-06 10:37:11 +00:00
Maciej Żenczykowski
0f24b26b6c expose readSectionUint() for testing am: 7ed94efeda
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756850

Change-Id: Iea2971e09d3c7f1a7ac2d3344bd3d6b5df3e110f
2021-07-06 10:25:07 +00:00
Maciej Żenczykowski
f1421cd47f bpf - struct bpf_map_def - add min/max kernel version. am: 36c53ba91e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756575

Change-Id: I2848c223ff92111e7012da0e82ea2325401971f6
2021-07-06 10:25:06 +00:00
Maciej Żenczykowski
7ed94efeda expose readSectionUint() for testing
Bug: 190519702
Test: atest bpf_module_test, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I772c918d162440de6cc492b2faeafe03340fca11
2021-07-06 01:55:33 -07:00
Maciej Żenczykowski
6582d798e1 [automerger skipped] bpf - add a bunch of static asserts on size/alignment of struct field types am: 0c713b1b19 -s ours
am skip reason: Merged-In Ibe74a6f97bdbba490a7848060d07dc3efcee0e68 with SHA-1 df91d2b5b2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15212614

Change-Id: I8e47d2a92fe4514da48e907edeb8f40025315879
2021-07-06 08:46:12 +00:00
Maciej Żenczykowski
0c713b1b19 bpf - add a bunch of static asserts on size/alignment of struct field types
It really turns out that till now we've just been lucky to not have
ever used a 64-bit type.

See also discussion on:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560
(and other places on the internet)

Bug: 190519702
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756574
Merged-In: Ibe74a6f97bdbba490a7848060d07dc3efcee0e68
Change-Id: Ibe74a6f97bdbba490a7848060d07dc3efcee0e68
2021-07-06 07:26:19 +00:00
Maciej Żenczykowski
14b5d3be44 bpf - add a bunch of static asserts on size/alignment of struct field types am: df91d2b5b2 am: ae7da3d3ac
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756574

Change-Id: If27205fa6964bb86379b761a44e682451f6af511
2021-07-06 05:33:51 +00:00
Maciej Żenczykowski
ae7da3d3ac bpf - add a bunch of static asserts on size/alignment of struct field types am: df91d2b5b2
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1756574

Change-Id: Ic6ee9bda73f56337f6b0ff322f9871d1c531f21d
2021-07-06 05:24:00 +00:00
Maciej Żenczykowski
36c53ba91e bpf - struct bpf_map_def - add min/max kernel version.
This is also bpfloader v0.2.
Some newer map types (for example DEVMAP) are unusable
on older kernel versions.

Bug: 190519702
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I085cc723ff1c19d8acc8972a391f894e16dd1875
2021-07-05 18:02:16 -07:00
Maciej Żenczykowski
df91d2b5b2 bpf - add a bunch of static asserts on size/alignment of struct field types
It really turns out that till now we've just been lucky to not have
ever used a 64-bit type.

See also discussion on:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560
(and other places on the internet)

Bug: 190519702
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibe74a6f97bdbba490a7848060d07dc3efcee0e68
2021-07-05 16:56:22 -07:00
Maciej Żenczykowski
eb6a440260 [automerger skipped] bpf - move to v0.1 .o struct formatting am: e8edd956ba -s ours
am skip reason: Merged-In I157458a4f798e455fb563fad569e20bfde5248fd with SHA-1 0bf9219e07 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15197128

Change-Id: Iaafa9c8eb3bd0386b01f797916f99e397ae0521b
2021-07-05 00:26:32 +00:00
Maciej Żenczykowski
e8edd956ba bpf - move to v0.1 .o struct formatting
We cannot submit this as long as we want current mainline releases
bpf .o objects to be loaded by images with bpfloader v0.0.

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1754795
Merged-In: I157458a4f798e455fb563fad569e20bfde5248fd
Change-Id: I157458a4f798e455fb563fad569e20bfde5248fd
2021-07-03 07:42:30 +00:00
Maciej Żenczykowski
14a8c7bb02 bpf - move to v0.1 .o struct formatting am: 0bf9219e07 am: 4db99f648e
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754795

Change-Id: I071dcd5144aaddea34fba9918fe3f324f382a1a8
2021-07-03 06:57:11 +00:00
Maciej Żenczykowski
4db99f648e bpf - move to v0.1 .o struct formatting am: 0bf9219e07
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754795

Change-Id: I243b847f9f90f0209fd4893dc6b5d73b11579b77
2021-07-03 06:44:35 +00:00
Maciej Żenczykowski
951f4077ec [automerger skipped] bpfloader - minor fixups asked for by reviewer am: d521e47d30 -s ours
am skip reason: Merged-In I4f5181f371d31dcf52768217ffd2b1b5b772103d with SHA-1 a21256dcf1 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15177779

Change-Id: If64f78c738dd32c406dadc71ab7691e11d832515
2021-07-02 19:28:43 +00:00
Maciej Żenczykowski
582627de6d [automerger skipped] bpf loader improvements for better long term compatibility with mainline am: 355b8df7f5 -s ours
am skip reason: Merged-In I36fa5b917540be7ea3ecfddc5fe7834e9eb18d88 with SHA-1 9217eee3df is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/15187416

Change-Id: I92bc2429597cdaa8d1c88867ec7c564240df3958
2021-07-02 19:28:42 +00:00
Maciej Żenczykowski
d521e47d30 bpfloader - minor fixups asked for by reviewer
As requested by Bernie on previous commit.

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1754722
Merged-In: I4f5181f371d31dcf52768217ffd2b1b5b772103d
Change-Id: I4f5181f371d31dcf52768217ffd2b1b5b772103d
2021-07-02 11:38:17 +00:00
Maciej Żenczykowski
355b8df7f5 bpf loader improvements for better long term compatibility with mainline
This is bpfLoader v0.1, previously we had no version number,
the version immediately preceding this commit we'll call v0.0.

Versions older than that are either pre-S and don't matter, since
loading mainline eBpf code was only added in S, or are from early
during the S development cycle (ie. pre-March 5th 2021 or earlier)
and simply no longer supported (no need to maintain compatibility).

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1754794
Merged-In: I36fa5b917540be7ea3ecfddc5fe7834e9eb18d88
Change-Id: I36fa5b917540be7ea3ecfddc5fe7834e9eb18d88
2021-07-02 11:36:21 +00:00
Maciej Żenczykowski
32cb91f40a bpfloader - minor fixups asked for by reviewer am: a21256dcf1 am: 6e11c1c304
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754722

Change-Id: I2a94dfc87121516531dcfaf5ad40d50231bafaf7
2021-07-02 10:02:14 +00:00
Maciej Żenczykowski
6e11c1c304 bpfloader - minor fixups asked for by reviewer am: a21256dcf1
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754722

Change-Id: I5c64e62cea1d38274c5f2ca9cafe1dffbf712011
2021-07-02 09:48:24 +00:00
Maciej Żenczykowski
0bf9219e07 bpf - move to v0.1 .o struct formatting
We cannot submit this as long as we want current mainline releases
bpf .o objects to be loaded by images with bpfloader v0.0.

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I157458a4f798e455fb563fad569e20bfde5248fd
2021-07-02 01:17:13 -07:00
Maciej Żenczykowski
a21256dcf1 bpfloader - minor fixups asked for by reviewer
As requested by Bernie on previous commit.

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4f5181f371d31dcf52768217ffd2b1b5b772103d
2021-07-02 01:17:13 -07:00
Maciej Żenczykowski
d31ce0059a bpf loader improvements for better long term compatibility with mainline am: 9217eee3df am: 489a4279d5
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754794

Change-Id: I3cb82c85353ab7adbadec4e95497bf5506aa7e36
2021-07-02 08:01:05 +00:00
Maciej Żenczykowski
489a4279d5 bpf loader improvements for better long term compatibility with mainline am: 9217eee3df
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754794

Change-Id: I8e928d4771f51fb01bdb06f59d093517fbff888a
2021-07-02 07:47:53 +00:00
Maciej Żenczykowski
9217eee3df bpf loader improvements for better long term compatibility with mainline
This is bpfLoader v0.1, previously we had no version number,
the version immediately preceding this commit we'll call v0.0.

Versions older than that are either pre-S and don't matter, since
loading mainline eBpf code was only added in S, or are from early
during the S development cycle (ie. pre-March 5th 2021 or earlier)
and simply no longer supported (no need to maintain compatibility).

Bug: 190519702
Test: atest, TreeHugger - existing bpf programs load
  examination of bpfloader logs
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I36fa5b917540be7ea3ecfddc5fe7834e9eb18d88
2021-07-02 03:36:49 +00:00
Evgenii Stepanov
e1f4e39c5b [automerger skipped] Enable Async MTE in bpfloader. am: a88de013d7 -s ours
am skip reason: Merged-In I6340055fea1f97fcc781b418e2465a7961ecedf4 with SHA-1 d27ae792e1 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bpf/+/14793615

Change-Id: I199b637d62b1a187a5562b08c978bc99e844bca9
2021-06-02 19:35:22 +00:00
Evgenii Stepanov
a88de013d7 Enable Async MTE in bpfloader.
This change enables Async mode ARM MTE in the bpfloader process on compatible
hardware and has no effect otherwise.

Bug: 181603044
Test: atest under system/bpf
Change-Id: I6340055fea1f97fcc781b418e2465a7961ecedf4
Merged-In: I6340055fea1f97fcc781b418e2465a7961ecedf4
(cherry picked from commit d27ae792e1)
2021-06-01 23:20:16 +00:00
Evgenii Stepanov
f32f4a046c Enable Async MTE in bpfloader. am: d27ae792e1 am: 80f73b878b
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1715722

Change-Id: Id71886bc5c3998ac7d59ccf92769d3a807425433
2021-05-25 08:40:43 +00:00
Evgenii Stepanov
80f73b878b Enable Async MTE in bpfloader. am: d27ae792e1
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1715722

Change-Id: I5696b0aeff980fd873785c48c53df18fef7d3641
2021-05-25 08:16:38 +00:00
Evgenii Stepanov
d27ae792e1 Enable Async MTE in bpfloader.
This change enables Async mode ARM MTE in the bpfloader process on compatible
hardware and has no effect otherwise.

Bug: 181603044
Test: atest under system/bpf
Change-Id: I6340055fea1f97fcc781b418e2465a7961ecedf4
2021-05-24 15:35:31 -07:00
Maciej Żenczykowski
1ebce20b0f BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro am: 67fa2073ff am: 625c2c6bc6 am: c5468f82d4
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1631935

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0e6a740dcb11c9c8ea73ba9aa8646e473a5a3242
2021-03-12 10:43:35 +00:00
Maciej Żenczykowski
c5468f82d4 BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro am: 67fa2073ff am: 625c2c6bc6
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1631935

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8d84f5368f2f9fa78b136d67dc92587cf05e3b81
2021-03-12 10:00:47 +00:00
Maciej Żenczykowski
625c2c6bc6 BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro am: 67fa2073ff
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1631935

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4319f83b426be2800ee92f3fb900ad98ec597ed9
2021-03-12 09:20:54 +00:00
Maciej Żenczykowski
67fa2073ff BpfUtils.h - add back SKIP_IF_BPF_NOT_SUPPORTED macro
Needs to be used by dns mainline module tests on R devices (Pixel 2).

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2974a5368f4a9d744e30be9148aefac117d09acb
2021-03-11 19:52:30 -08:00
Maciej Żenczykowski
ade234047b bpfloader: auto-demote DEVMAP/DEVMAP_HASH map types on too old kernels am: cb358de067 am: 76f565a3f1 am: 3aa8ecefd5
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1619223

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7dc2b7da56ee348f87cded9c1fb858a240e3776b
2021-03-05 07:27:32 +00:00
Maciej Żenczykowski
3aa8ecefd5 bpfloader: auto-demote DEVMAP/DEVMAP_HASH map types on too old kernels am: cb358de067 am: 76f565a3f1
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1619223

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5423fe59d3c9a360e9687a2c6c8619c6741800db
2021-03-05 07:02:21 +00:00
Maciej Żenczykowski
76f565a3f1 bpfloader: auto-demote DEVMAP/DEVMAP_HASH map types on too old kernels am: cb358de067
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1619223

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I30a799d8beb4784baa0820d3fbad16d9b7e88464
2021-03-05 06:22:15 +00:00