The Dwarves Beneath the Kernel: Forging BTF for eBPF

This blog post is the third installment in our eBPF blog post series, following our posts about eBPF selftests and eBPF trampolines.

In the previous blog post, we discussed how eBPF trampolines are dynamically generated to allow hooking tracing programs to functions’ entry and/or exit. Each trampoline is tailored specifically for the target function on which we want to hook programs: it is then able to read the function context (e.g. function arguments and return value) and to pass those to the hooked programs. However there is one detail that we did not address: how does the trampoline generator know exactly about the function layout ? To be able to generate trampolines that can read and store the function arguments, the trampoline generator needs many details about each argument: the location (a register ? If so, which one ? Or maybe it is on the stack ? And if so, at which offset ?) and its size. Parsing the function machine code is not enough to learn about those, and even if it was, compiler optimizations would obfuscate this kind of info even more. What if besides the actual executable code, the kernel image could be bearing some data about its internal functions ? In this post, we will dive into the DWARF debug information format, and the BPF Type Format (BTF) derived from it to support such a purpose.

Continue reading “The Dwarves Beneath the Kernel: Forging BTF for eBPF”

Linux 6.17 released, Bootlin contributions inside

Penguin coding, AI generatedLinux 6.17 was released a bit over a week ago, and as usual LWN.net gave the best summary of the new features and important changes in this release: part 1, part 2.

As usual, Bootlin contributed to this kernel, with a total of 98 patches authored by Bootlin engineers, but also another 94 patches that were reviewed/merged by Bootlin engineers, mostly by Alexandre Belloni (RTC and I3C maintainer, reviewed/merged 58 patches), Miquèl Raynal (MTD co-maintainer, reviewed/merged 20 patches) and Grégory Clement (Marvell EBU platform maintainer, reviewed/merged 8 patches).

Continue reading “Linux 6.17 released, Bootlin contributions inside”

Congatec Board Controller support into the upstream Linux Kernel

Introduction

Congatec’s x86 System-on-Modules (SoM) include a Board Controller component connected to the processor via an eSPI bus, and providing various features such as I²C buses, GPIOs, a watchdog timer, and various sensors for monitoring voltage, fan speed, and more.

Conga-SA7 datasheet extract

For their x86 System-on-Modules (SoMs), Congatec provides a Yocto meta-layer: meta-congatec-x86. This meta-layer includes, among other components, a driver, a library, and tools for interfacing with the Board Controller.

The primary issue with the provided driver is its deviation from standard Linux APIs. It exposes a custom character device and relies on custom ioctl() for communication with userspace. This non-standard approach leads to compatibility and portability challenges. For example, an application using the standard Linux GPIO API would need to be adapted to access the GPIOs from Congatec’s Board Controller. Similarly, software designed specifically for the Board Controller’s GPIOs would require changes to work with GPIOs on other platforms.

Additionally, because the driver is out-of-tree, it raises concerns about long-term support and maintainability. Questions naturally arise—will the driver be regularly updated to remain compatible with future Linux kernel versions, given the instability of internal APIs? Will bugs and security vulnerabilities be addressed in a timely manner?

One of our customers, planning to use the Conga-SA7 board in a commercial product, recognized these challenges early on. As a result, they asked us to integrate support for the Congatec Board Controller directly into the mainline Linux kernel. Upstreaming the driver into the kernel would eliminate these issues by ensuring better portability, long-term maintenance, and community support.

Continue reading “Congatec Board Controller support into the upstream Linux Kernel”

Bouncing on trampolines to run eBPF programs

This blog post is the second installment in our eBPF blog post series, following our blog post about eBPF selftests.

As eBPF is more and more used in the industry, eBPF kernel developers give considerable attention to eBPF performance: some standard use cases like system monitoring involve hundreds of eBPF programs attached to events triggered at high frequencies. It is then paramount to keep eBPF programs execution overhead as low as possible. This blog post aims to shed some light on an internal eBPF mechanism perfectly showcasing those efforts: the eBPF trampoline.

Continue reading “Bouncing on trampolines to run eBPF programs”

Linux 6.16 released, Bootlin contributions

Penguin coding, AI generatedLinux 6.16 was released last Sunday, and as usual LWN provides the best coverage of what’s new: part 1 and part 2, as well as the KernelNewbies.org page for this release.

This time around, the engineers at Bootlin contributed 89 patches to the 6.16 release, but also as maintainers, they reviewed/merged 117 patches from other contributors!

Continue reading “Linux 6.16 released, Bootlin contributions”

Linux 6.15 released, Bootlin contributions inside

Penguin coding, AI generatedLinux 6.15 has been released last Sunday, and we as usual encourage our readers to look at the LWN summaries of the merge window (part 1, part 2) for a good summary. CNX-Software also has a summary more oriented towards hardware support for ARM and RISC-V platforms.

On our side, we have been quite active in this release cycle, with no less than 145 commits from Bootlin engineers merged. Also, our engineers who maintain various subsystems in the Linux kernel reviewed and merged a total of 104 patches from other contributors.

Continue reading “Linux 6.15 released, Bootlin contributions inside”

Announcing our new Embedded Linux Networking training course

Bootlin Embedded Linux networking trainingWe are proud to announce the launch of a brand new addition to our lineup of training courses: Embedded Linux Networking!

This training course is designed to provide embedded Linux engineers with a deep and practical understanding of networking concepts and their implementation in both the Linux kernel and user-space — with a strong focus on real-world embedded applications.
Continue reading “Announcing our new Embedded Linux Networking training course”

Demystifying the Kernel Boot Sequence: From ‘Starting Kernel…’ to Userspace”

Board booting

As kernel developers, we often find ourselves writing device drivers—pieces of code that are typically registered using module_init() in the Linux kernel. But have you ever paused to wonder: just how late in the boot process does this happen? What exactly takes place between the moment we see the famous "Starting kernel..." message and the point where drivers are finally registered and devices probed?

If you’re curious about the intricate steps that occur before the system even reaches a working init process, you’re in the right place. Join us as we explore the fascinating journey of the Linux kernel boot sequence—step by step.

Throughout this article, you’ll find clickable links to our Elixir source code browser. We encourage you to dive in and follow along!

Continue reading “Demystifying the Kernel Boot Sequence: From ‘Starting Kernel…’ to Userspace””

Back from Netdev 0x19

Netdev 0x19Around mid-March, Bootlin engineers Köry Maincent and Romain Gantois had the chance to attend edition 0x19 of the Netdev conference, where developers from the Linux kernel networking community assemble for four days of technical presentations and discussions.

They were generally very much impressed by the quality and detail of the talks given during this conference, and they have selected two of the talks that they found the most interesting, which they summarized below. We expect the slides and videos to be published at some point in the future, but they don’t seem to be available at the moment.

Continue reading “Back from Netdev 0x19”

Linux 6.14 released, Bootlin contributions inside

Penguin coding, AI generatedLinux 6.14 was released last week, and as usual, we recommend checking out the LWN articles covering the 6.14 merge window (part 1, part 2) to get a good sense of the main new features and updates in this release.

Bootlin engineers have once again been busy contributing to this kernel release, with 125 commits authored by Bootlin engineers, and 60 patches reviewed and merged by Bootlin engineers who are maintainers of specific parts of the Linux kernel.

Continue reading “Linux 6.14 released, Bootlin contributions inside”