···10071007 # Keeping it a built-in ensures it will be used if possible.
10081008 FB_SIMPLE = yes;
1009100910101010+ # https://docs.kernel.org/arch/arm/mem_alignment.html
10111011+ # tldr:
10121012+ # when buggy userspace code emits illegal misaligned LDM, STM,
10131013+ # LDRD and STRDs, the instructions trap, are caught, and then
10141014+ # are emulated by the kernel.
10151015+ #
10161016+ # This is the default on armv7l, anyway, but it is explicitly
10171017+ # enabled here for the sake of providing context for the
10181018+ # aarch64 compat option which follows.
10191019+ ALIGNMENT_TRAP = mkIf (stdenv.hostPlatform.system == "armv7l-linux") yes;
10201020+10211021+ # https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220701135322.3025321-1-ardb@kernel.org/
10221022+ # tldr:
10231023+ # when encountering alignment faults under aarch64, this option
10241024+ # makes the kernel attempt to handle the fault by doing the
10251025+ # same style of misaligned emulation that is performed under
10261026+ # armv7l (see above option).
10271027+ #
10281028+ # This minimizes the potential for aarch32 userspace to behave
10291029+ # differently when run under aarch64 kernels compared to when
10301030+ # it is run under an aarch32 kernel.
10311031+ COMPAT_ALIGNMENT_FIXUPS = mkIf (stdenv.hostPlatform.system == "aarch64-linux") (whenAtLeast "6.1" yes);
10101032 } // optionalAttrs (versionAtLeast version "5.4" && (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux")) {
10111033 # Required for various hardware features on Chrome OS devices
10121034 CHROME_PLATFORMS = yes;