An important aspect of long-term viability for an open-source project is to ensure that all code modifications and components are open-source. But while it is a basic requirement, it is also highly desirable that all modifications made to projects that we depend on are proposed back to the original project and merged. This is also referred to as “upstreaming”. As part of ACRN, a Linux kernel driver is being developed to allow for the ACRN Device Model to communicate with the hypervisor, and it has been an objective and a priority for the project to upstream this to the Linux kernel since the start of the project.
ACRN is a Type-1 hypervisor that runs on bare-metal hardware. It also comes with a privileged Virtual Machine (VM) called the Service VM, something that is akin to Xen’s Dom0. The Service VM provides additional functionalities such as User VM lifecycle management and device sharing capabilities between those. These are implemented as a user-space component called the ACRN Device Model (acrn-dm). The communication between the ACRN Device Model and the hypervisor is achieved through a Linux kernel driver called the Hypervisor Service Module (HSM). All three components—hypervisor, Linux kernel driver, and user-space components—are needed for a fully functional system.
Linux Kernel in a User VM
Upstreaming Linux kernel drivers and patches is an effort that takes some time and a number of exchanges and conversations with the Linux kernel maintainers. The very first ACRN HSM Linux kernel patchset was merged in May 2019. These patches, which were needed to run the Linux kernel in an ACRN User VM, were accepted into the mainline kernel tree. Read more about this patchset in this archive of the commit.
Linux Kernel in the Service VM
Since then, the ACRN team has been hard at work to get another big chunk of functionality merged into the Linux kernel mainline: the code needed to run the Linux kernel in the ACRN Service VM. These efforts recently paid off and the HSM changes were accepted into the 5.12 kernel tree. Read more about this patchset in this archive of the commit.
This is a very important milestone as it saves the ACRN developers the effort of maintaining their own fork of the Linux kernel and continuously forward-porting their changes as newer kernel versions get released.
So what’s next now? As development continues, similar efforts will take place to upstream new features and debug capabilities to keep the upstream ACRN driver up to date and on-par with all the latest features.
Upstreaming the ACRN HSM driver to the Linux kernel has been a long, ongoing effort. Today marks a significant milestone as the most important part of this driver, which is needed to run Linux in the Service VM, has been merged in the 5.12 mainline kernel, paving the way for easier system integration with Linux-based systems.