Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

Hardware Acceleration of Qemu MMU for aarch64 on x86-64 Full System Emulation

https://doi.org/10.15514/ISPRAS-2025-37(6)-35

Abstract

Full system cross-ISA emulation is widely used nowdays, but is known for being slow. Major contribution to the slowdown is made by software MMU doing guest virtual addresses translation. In article we look at optimization which allows to move part of such address translation work to the hardware MMU of the host system. For this goal, extra view to the whole guest virtual address space is added to the address space of the emulator process, using mmap system call. After mapping is done there is opportunity to use fixed offset correction to guest virtual address in the translated binary code in place of dynamic search of needed offset in software TLB. Additional view of guest virtual address space maintained coherent with guest page tables. Such approach allows to use less host instructions per each guest memory instruction, which lead to notable emulation acceleration, considering the large quantity of memory instructions in the guest execution flow. Measurments show speed up as large as 271% for benchmark tests and up to 217% for the real-world program. Ideas are proposed for overcoming some limitations of described approach.

About the Authors

Dmitry Nikolaevich POLETAEV
Ivannikov Institute for System Programming of the Russian Academy of Sciences, Yaroslav-the-Wise Novgorod State University
Russian Federation

Software developer at Ivannikov Institute for System Programming of the Russian Academy of Sciences. Research interests: reverse engineering, binary code analysis, virtual machines.



Pavel Mikhailovich DOVGALYUK
Ivannikov Institute for System Programming of the Russian Academy of Sciences, Yaroslav-the-Wise Novgorod State University
Russian Federation

Cand. Sci. (Tech.), engineer. Research interests: virtual machines introspection and instrumentation, dynamic analysis of code, debuggers, emulators.



Georgiy Nikolaevich TEYS
Ivannikov Institute for System Programming of the Russian Academy of Sciences, Yaroslav-the-Wise Novgorod State University
Russian Federation

QA engineer of the Institute for System Programming of the RAS since 2022. His research interests include processes automation in system programming.



Maksim Alekseevich KOSTIN
Ivannikov Institute for System Programming of the Russian Academy of Sciences, Yaroslav-the-Wise Novgorod State University
Russian Federation

Engineer at Compiler Technology department of ISP RAS. His research interests include emulators, dynamic binary translation, optimizations.



References

1. Chao-Jui Chang, Jan-Jan Wu, Wei-Chung Hsu, Pangfeng Liu, and Pen-Chung Yew. 2014. Efficient memory virtualization for Cross-ISA system mode emulation. In Proceedings of the 10th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments (VEE '14). Association for Computing Machinery, New York, NY, USA, 117–128.

2. “Qemu – a generic and open source machine emulator and virtualizer,” https://www.qemu.org/, accessed: 22.05.2025.

3. Antoine Faravelon. Acceleration of memory accesses in dynamic binary translation. Operating Systems [cs.OS]. Université Grenoble Alpes, 2018. English.

4. Chao-Jui Chang, Jan-Jan Wu, Wei-Chung Hsu, Pangfeng Liu, and Pen-Chung Yew. Efficient memory virtualization for cross-isa system mode emulation. In ACM SIGPLAN Notices, volume 49, pages 117–128. ACM, 2014.

5. Zhe Wang, Jianjun Li, Chenggang Wu, Dongyan Yang, Zhenjiang Wang, WeiChung Hsu, Bin Li, and Yong Guan. Hspt: Practical implementation and efficient management of embedded shadow page tables for cross-isa system virtual machines. In ACM SIGPLAN Notices, volume 50, pages 53–64. ACM, 2015.

6. Tom Spink, Harry Wagstaff, and Björn Franke. Hardware-accelerated crossarchitecture full-system virtualization. ACM Transactions on Architecture and Code Optimization (TACO), 13(4):36, 2016.

7. S. Rodzevich, K. Batuzov, D. Koltunov, A. Cheremnov and I. Shlyapin, "Efficient MMU Emulation in Case of Cross-ISA Dynamic Binary Translation," 2024 Ivannikov Ispras Open Conference (ISPRAS), Moscow, Russian Federation, 2024, pp. 1-6, doi: 10.1109/ISPRAS64596.2024.10899135.

8. “AMD-V Nested Paging White Paper,” https://www.cse.iitd.ac.in/~sbansal/csl862-virt/readings/NPT-WP-1%201-final-TM.pdf, accessed: 22.05.2025.

9. “Raspberry Pi 3 Model B,” https://www.raspberrypi.com/products/raspberry-pi-3-model-b/, accessed: 22.05.2025.

10. “Raspberry Pi OS (Legacy) Lite,” https://downloads.raspberrypi.com/raspios_oldstable_lite_arm64/ images/raspios_oldstable_lite_arm64-2025-05-07/2025-05-06-raspios-bullseye-arm64-lite.img.xz, accessed: 22.05.2025.

11. “Introduction to 5-Level Paging in 3rd Gen Intel Xeon Scalable Processors with Linux,” https://lenovopress.lenovo.com/lp1468-introduction-to-5-level-paging, accessed: 22.05.2025.


Review

For citations:


POLETAEV D.N., DOVGALYUK P.M., TEYS G.N., KOSTIN M.A. Hardware Acceleration of Qemu MMU for aarch64 on x86-64 Full System Emulation. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2025;37(6):45-58. (In Russ.) https://doi.org/10.15514/ISPRAS-2025-37(6)-35



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)