MigGPT : Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versions
Pucheng Dang, Di Huang, Dong Li, Kang Chen, Yuanbo Wen, Qi Guo, Xing Hu · 2025
Read MigGPT : Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versions by Pucheng Dang, Di Huang, Dong Li, Kang Chen, Yuanbo Wen, Qi Guo, Xing Hu (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-09474.txt.
Introduction
Pucheng Dang and six co-authors build a tool that migrates Linux kernel patches across versions in this 2025 paper. Many hardware drivers live outside the main kernel tree. Each new kernel version forces engineers to rework those patches by hand, a slow expert task. Language models looked promising for automating it. Tests showed they stumble: they miss code context and pick the wrong migration points. The team's system, MigGPT, adds a code fingerprint structure that preserves snippet context, plus three modules aimed at those failure points.
On a benchmark built from real patch projects, MigGPT finished about seventy-four percent of migrations on average. That rate clearly beat using the models raw. The authors frame patch migration as a task where structure beats raw language skill. Kernels are huge and version churn is constant, so even partial automation saves scarce expert hours.
Catalog record
| CREATOR | Pucheng Dang, Di Huang, Dong Li, Kang Chen, Yuanbo Wen, Qi Guo, Xing Hu |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 73 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-09474
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MigGPT : Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versions Pucheng Dang, Di Huang, Dong Li, Kang Chen, Yuanbo Wen, Qi Guo, Xing Hu Abstract Out-of-tree kernel patches are essential for adapting the Linux kernel to new hardware or enabling specific functionalities. Maintaining and updating these patches across different kernel versions demands significant effort from experienced engineers. Large language models (LLMs) have shown remarkable progress across various domains, suggesting their potential for automating out-of-tree kernel patch migration. However, our findings reveal that LLMs, while promising, struggle with incomplete code context understanding and inaccurate migration point identification. In this work, we propose MigGPT , a framework that employs a novel code fingerprint structure to retain code snippet information and incorporates three meticulously designed modules to improve the migration accuracy and efficiency of out-of-tree kernel patches. Furthermore, we establish a robust benchmark using real-world out-of-tree kernel patch projects to evaluate LLM capabilities. Evaluations show that MigGPT significantly outperforms the direct application of vanilla LLMs, achieving an average completion rate of 74.07% ( ↑ 45.92 % \uparrow 45.92\% ) for migration tasks. Our code and data are available at https://github.com/CherryBlueberry/MigGPT . 1 Introduction The Linux kernel, a widely-used open-source operating system, is extensively applied across various domains Tan et al. (2020) ; Lin et al. (2022) ; de Oliveira et al. (2023) ; Yi et al. (2023) . Its adaptability and extensibility enable developers to create out-of-tree kernel patches that enhance performance Kim et al. (2020) ; Adam (2021) or security Xu et al. (2023) ; Zhou et al. (2020) ; Yang et al. (2025) , holding irreplaceable significance in modern engineering practices. Out-of-tree kernel patches, such as RT-PREEMPT, AUFS, HAOC, Raspberry Pi kernel, and Open vSwitch, are modifications to the Linux kernel that are developed and maintained independently of the mainline source tree. Unlike in-tree patches, which are included in official kernel releases, out-of-tree patches address specific use cases or features not yet supported by the mainline kernel. As the Linux kernel evolves, these out-of-tree patches require ongoing maintenance to ensure compatibility with newer Linux kernel versions. As shown in Figure 1 , the maintenance process involves utilizing the old out-of-tree kernel patch and analyzing the differences between the old and new Linux kernel versions to upgrade the patched kernel repository to the new version. This maintenance process is crucial and labor-intensive in engineering applications, which demands specialized experts and takes weeks of intensive effort Zhang et al. (2021) . Figure 1: MigGPT can assist in automating the version migration and maintenance of out-of-tree kernel patches of the Linux kernel. This saves on expert labor costs and reduces the development cycle. Existing code migration technologies Xing and Stroulia (2007) ; Lamothe et al. (2022) ; Fazzini et al. (2019) ; Haryono et al. (2020) ; Thung et al. (2019) ; Ketkar et al. (2019) ; Rolim et al. (2017) ; Dilhara et al. (2023) ; Shi et al. (2022) ; Shariffdeen et al. (2021a) ; Shariffdeen et al. (2021b) ; Yang et al. (2023) utilize static program analysis Landi (1992) to facilitate API cross-version maintenance or the backporting of CVE security patches. However, these methods only address a subset of scenarios in out-of-tree kernel patch migration. 1) They rely on predefined migration rules, which are insufficient for handling comprehensive scenarios involving complex changes such as namespace modifications, invocation conflict resolution, and the integration of control and data flow dependencies. 2) These single-step methods assume known target code locations in updated repositories, limiting their applicability to out-of-tree kernel patch scenarios. With the substantial progress made by Large Language Models (LLMs) in understanding Patel et al. (2023) ; Izadi et al. (2022) ; Kim et al. (2021) and generating code Feng et al. (2020) ; Ahmed and Devanbu (2022) ; Ouyang et al. (2023) ; Yan et al. (2023) ; Yang et al. (2024) , there is a promising opportunity to leverage LLMs for the automated migration and maintenance of out-of-tree kernel patches. However, due to the inherent lack of determinism in LLMs when generating content, several challenges arise when directly employing these models to handle the migration and maintenance of out-of-tree kernel patches. These challenges include 1) structural similarity-induced failure, 2) non-deterministic code snippet boundaries, 3) absence of associated code snippet information, and 4) inaccuracies in locating migration points, which reveal that LLMs struggle with incomplete code context understanding and inaccurate migration point identification. To address the challenges, we propose MigGPT , the first framework designed to assist humans in automating the migration and maintenance of out-of-tree kernel patches. We reframe this migration process as a two-step task: retrieving target code from updated kernels and performing patch migration, which is both more challenging and practical. MigGPT utilizes Code Fingerprint (CFP), a novel data structure to encapsulate the structural and critical information of code snippets throughout the migration process of out-of-tree kernel patches. With the assistance of CFP, MigGPT incorporates three core modules: the Retrieval Augmentation Module (addressing challenges 1 and challenges 3), the Retrieval Alignment Module (addressing challenge 2), and the Migration Enhancement Module (addressing challenge 4). Specifically, the Retrieval Augmentation Module supplies code snippet information via CFPs, mitigates interference from similar structures, and appends additional code snippet information pertinent to migration. The Retrieval Alignment Module achieves alignment of the target code snippet boundaries through the first anchor line and the last anchor line within CFPs. The Migration Enhancement Module facilitates accurate and efficient migration by comparing CFPs to ascertain the number of migration points and their respective locations. To evaluate the efficiency of MigGPT , we construct a robust benchmark that includes three real-world projects from the out-of-tree patch community of the Linux kernel. These projects comprise two different levels of migration examples, encompassing a variety of common migration types. With this benchmark, we evaluated MigGPT across diverse LLMs (GPT-3.5, GPT-4-turbo, OpenAI-o1, DeepSeek-V3, DeepSeek-R1, and Llama-3.1) OpenAI (2023a) ; OpenAI (2023b) ; OpenAI (2024) ; DeepSeek-AI et al. (2024b) ; DeepSeek-AI et al. (2025) ; Dubey et al. (2024) to validate its effectiveness and broad applicability. MigGPT significantly outperforms the direct application of vanilla LLMs, achieving an average completion rate of 74.07% ( \uparrow 45.92\% ) for migration tasks. Additionally, the average number of queries to LLMs is only 2.26( \uparrow 0.26 ), indicating no substantial increase in computational overhead. Meanwhile, MigGPT required only 2.08% of the average time taken by human experts, demonstrating its superior time efficiency. In summary, we make the following contributions: • We have developed a robust migration benchmark, encompassing three real-world projects. To the best of our knowledge, this is the first benchmark for out-of-tree kernel patch migration that can assess performance across diverse migration tools, providing a valuable foundation for future research. • We propose CFP, a carefully designed data structure that encapsulates the structural and critical information of code snippets, providing essential migration context for LLMs. Based on this, we introduce MigGPT , a framework to assist humans in automating out-of-tree kernel patch migration and maintenance. • We conduct comprehensive experiments on both closed-source models ( i.e. GPT-3.5, GPT-4 and OpenAI-o1) and open-source models ( i.e. DeepSeek-V3, Deepseek-R1, and Llama-3.1). The results demonstrate that MigGPT achieved an average migration