BpfRingbuf: Add support for 32 bit kernels
This change adds support for 32 bit kernels by capping mProducerPos to 4 bytes. mConsumerPos (which is written to by userspace) continues to use 8 bytes. (This can be done because an entire page is allocated for mConsumerPos to control access permissions). In a 32 bit kernel, that means that the top order bits are just ignored. In addition, comparisons in userspace only use the bottom 4 bytes to be bitness agnostic. Test: atest BpfRingbufTest Change-Id: I7fe6d9000a151512785f1aa2a53fa97d31967d19
This commit is contained in:
@@ -50,10 +50,6 @@ class BpfRingbufTest : public ::testing::Test {
|
||||
GTEST_SKIP() << "BPF ring buffers not supported below 5.8";
|
||||
}
|
||||
|
||||
if (!isKernel64Bit()) {
|
||||
GTEST_SKIP() << "BPF ring buffers not supported on 32 bit kernel";
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
mProgram.reset(retrieveProgram(mProgPath.c_str()));
|
||||
EXPECT_EQ(errno, 0);
|
||||
|
||||
Reference in New Issue
Block a user