Skip to content

lisa._btf: Ensure stable layout for structs from BTF

Douglas Raillard requested to merge douglas-raillard-arm/lisa:_pr0000037 into main

FIX

Kernel options such as CONFIG_RANDSTRUCT_FULL can introduce randomization of struct layouts. Since the LISA module is built out of tree, it cannot share the random seed with the kernel build and any type definition rematerialized from BTF would therefore undergo randomization, breaking the ABI compatibility with the same type in the base kernel image.

In order to avoid that, add the __no_randomize_layout attribute to each struct type we generate from BTF so that the compiler preserves the expected layout.

Merge request reports