Linux kernel patches

  • ANDROID: sched: Gate sched_stat tracepoint exports on CONFIG_SCHEDSTATS: One of those instances where a tangential change in the Android trees broke our continuous integration. Our CI tests some 32-bit ARM configurations because certain Android OEMs care about them but these configs are not tested by the actual Android team, meaning we find breakage that they do not.

  • [PATCH net-next] net: ks8851: Make ks8851_read_selftest() return void: clang implemented GCC’s -Wunused-but-set-variable and this instance was found by Intel’s kernel test robot. Rather simple fix but it is important to fix warnings as they crop up so that the build stays as clean as possible so that the real issues are easily visible.

  • [PATCH net-next] net: ethernet: rmnet: Restructure if checks to avoid uninitialized warning: Uninitialized variable warnings are always worrisome because using an uninitialized variable results in undefined behavior and could be a security problem if the attacker were able to control or read the contents. In this particular instance, it was just that clang could not understand that the variable was always initialized because of how the code was structure so I rearranged it to make it cleaner to both humans and the compiler.

  • [PATCH] btrfs: Remove total_data_size variable in btrfs_batch_insert_items(): btrfs turns on some extra warnings for their code, known in the kernel as W=1 because of the variable that is passed to make. This cleans up one of those instances, which will be visible in a normal build.

  • [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session(): Unlike the uninitialized warning above, this one is legitimate and it shows up in a debug print so it is important to get a proper value.

  • [PATCH] scsi: elx: efct: Eliminate unnecessary boolean check in efct_hw_command_cancel(): A fairly uninteresting warning from clang but it can be a bug occasionally so it is important to clean them up.

  • [PATCH] scripts/ Raise minimum clang version to 13.0.0 for s390: The s390 folks had their compiler team implement support for even/odd register pair in LLVM, which means that older versions of LLVM are broken in non-obvious ways, so we codify this requirement before the build can even start. This is unfortunate because LLVM 13.0.0 is still in development at this point but using the tip of tree versions of LLVM is not all that scary because of LLVM’s aggressive “revert to green” policy, meaning the tree is intended to be “release worthy” at any point.

  • [PATCH] scsi: lpfc: Reduce scope of uuid in lpfc_queuecommand(): A small build error that I noticed in a few of the configurations that I test. Unfortunately, this was not accepted because it was fixed by just declaring the variable outside of the CONFIG_SCSI_LPFC_DEBUG_FS at the top of the function.

  • [PATCH net-next] net/mlx5: Use cpumask_available() in mlx5_eq_create_generic(): Yet another instance of -Wpointer-bool-conversion, which happens in certain configurations. This was solved through a helper function in the early days of ClangBuiltLinux so we use that again here.

  • [PATCH] KVM: PPC: Book3S HV: Workaround high stack usage with clang: This warning has been around since the beginning of the year or so, which was starting to become annoying for a few parties, including the kernel test robot. This is now fixed in LLVM 13.0.0 but this workaround still buys us a decent amount of stack space so it is probably worth keeping around for a while.

  • [PATCH] mailbox: imx: Avoid using val uninitialized in imx_mu_isr(): Switch statements with default cases that do not do anything sort of defeats the purpose of the default case in my opinion, as clang points out here, so we avoid the warning and make it obvious to the developer that this switch statement will need to be updated.

  • [PATCH 1/2] ACPI: bgrt: Fix CFI violation: My girlfriend had a laptop lying around that she was not using anymore so I threw an SSD in it and installed Linux on it for testing. Virtualized testing is nice because it scales really well but it is no replacement for running on real hardware to test various device specific drivers. In this case, I found an issue in an ACPI table driver with Control Flow Integrity, which was rather easy to fix, and now allows the computer to boot with CFI enabled in enforcing mode.

  • [PATCH 4.4 to 4.19] Makefile: Move -Wno-unused-but-set-variable out of GCC only block: A stable specific backport of an upstream patch that I sent so that there are not new warnings for downstream users such as Android, which is where I discovered this.

  • ANDROID: Add CONFIG_LLD_VERSION and UPSTREAM: x86, lto: Pass -stack-alignment only on LLD < 13.0.0: An Android specific backport so that our continuous integration would stay building with tip of tree LLVM. The Android LLVM team picks a particular revision of LLVM then stays on that for a few months, just cherry-picking reverts and features as needed so they will not run into this for a bit but it is better to get ahead of the curve. After all, that is the entire point of this project :)

  • [PATCH] ALSA: usb-audio: scarlett2: Fix for loop increment in scarlett2_usb_get_config: This bug was rather fun for me as I learned a bit about C that I did not know. Casting an increment does not do anything because a cast is an rvalue and the increment operator only works on lvalues. I did not do very well in my “Principles of Programming Languages” class before switching degrees but I do remember that distinction. This patch went through quite a few revisions but it did get picked up eventually.

  • [PATCH net-next] net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe(): More and more uninitialized warnings :( unfortunately, GCC does not warn about uninitialized variables in the kernel after commit 78a5255ffb6a (“Stop the ad-hoc games with -Wno-maybe-initialized”) because GCC does its variable initiailization analysis after inlining, which can be somewhat confusing at different optimization levels. clang’s analysis happens much easier, which makes it a little dumber at times, but it also makes it a little more reliable when it comes to stack variables with if and switch statements in my experience.

LLVM patches

Patch review and input

For the next sections, I link directly to my response when possible but there are times where the link is to the main post and my response can be seen inline.

Issue triage and reporting

Tooling improvements

Special thanks to: