Skip to content

Commit

Permalink
kernel_test: add a VTS test to ensure that the kernel has efficient u…
Browse files Browse the repository at this point in the history
…naligned access.

This is a requirement for some of our bpf code to load correctly.

Discovered by running (a new test of NetBpfLoad I'm developing)
on x86_64 UML (user mode Linux - via the net/test framework).

UML doesn't have this feature, most likely it erroneously
fails to inherit it from the host architecture.

Both aarch64 & x86 support it of course.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <[email protected]>
Change-Id: Id4e27df208f9b6f6089f627baa84642e0da64c05
  • Loading branch information
zenczykowski committed Aug 22, 2024
1 parent 6121465 commit 997e3b3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/kernel_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ TEST(KernelTest, TestBpfJitAlwaysOn) {
ASSERT_TRUE(configVerifier.hasOption("CONFIG_BPF_JIT_ALWAYS_ON"));
}

TEST(KernelTest, TestHaveEfficientUnalignedAccess) {
// Turns out the bpf verifier is stricter if you don't have this option.
// At least *some* of our bpf code fails to verify without it.
KernelConfigVerifier configVerifier;
ASSERT_TRUE(configVerifier.hasOption("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS"));
}

/* Android 14/U should only launch on 64-bit kernels
* T launches on 5.10/5.15
* U launches on 5.15/6.1
Expand Down

0 comments on commit 997e3b3

Please sign in to comment.