4.9 kernels must support eBPF (as of Android S)
so there is no longer a need to look at any properties
or api levels.
Test: builds, atest, TreeHugger
Bug: 167500195
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia5479db807f5444e48251dff45fd42fff610d5ca
diff --git a/bpfloader/bpfloader.rc b/bpfloader/bpfloader.rc
index fec7530..9a9482c 100644
--- a/bpfloader/bpfloader.rc
+++ b/bpfloader/bpfloader.rc
@@ -7,9 +7,6 @@
# - /sys/fs/bpf is already mounted,
# - apex (incl. rollback) is initialized (so that in the future we can load bpf
# programs shipped as part of apex mainline modules)
-# - system properties have been set, this is because isBpfSupported() calls
-# getUncachedBpfSupportLevel() which depends on
-# ro.kernel.ebpf.supported, ro.product.first_api_level & ro.build.version.sdk
# - logd is ready for us to log stuff
#
# At the same time we want to be as early as possible to reduce races and thus
diff --git a/libbpf_android/BpfUtils.cpp b/libbpf_android/BpfUtils.cpp
index 3b6c764..f640cde 100644
--- a/libbpf_android/BpfUtils.cpp
+++ b/libbpf_android/BpfUtils.cpp
@@ -34,7 +34,6 @@
#include <sstream>
#include <string>
-#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <log/log.h>
#include <processgroup/processgroup.h>
@@ -137,22 +136,8 @@
if (kver >= KVER(4, 19, 0)) return BpfLevel::EXTENDED_4_19;
if (kver >= KVER(4, 14, 0)) return BpfLevel::EXTENDED_4_14;
- // Override for devices launched with O but now on a 4.9-P+ kernel.
- bool ebpf_supported = base::GetBoolProperty("ro.kernel.ebpf.supported", false);
- if (ebpf_supported) return BpfLevel::BASIC_4_9;
-
- uint64_t api_level = base::GetUintProperty<uint64_t>("ro.product.first_api_level", 0);
- if (api_level == 0) {
- ALOGE("Cannot determine initial API level of the device");
- api_level = base::GetUintProperty<uint64_t>("ro.build.version.sdk", 0);
- }
-
- // Check if the device is shipped originally with android P.
- if (api_level < MINIMUM_API_REQUIRED) return BpfLevel::NONE;
-
- if (kver >= KVER(4, 9, 0)) return BpfLevel::BASIC_4_9;
-
- return BpfLevel::NONE;
+ // Basic BPF support is required on all devices.
+ return BpfLevel::BASIC_4_9;
}
BpfLevel getBpfSupportLevel() {