KVM Forum 2024

TCG Plugin in Practice: A Case of Microarchitecture Research
09-22, 09:45–10:15 (Europe/Rome), Hall A+B

While KVM and other virtualization tools dominate the scene, QEMU's TCG emulation deserves a second look. Sure, it excels at cross-development and retro gaming, but what if it could do more? This talk explores using TCG not just to mimic processors, but to create a new one.
Designing a processor microarchitecture involves a selection of various options. Implementing them all in silicon takes forever. A common methodology for microarchitecture design exploration is to use simulators. Simulators focus on replicating execution timing, eliminating details for faster implementation. However, they lack a mechanism to perform operations and make decisions about branches and memory access. Interpreters, a typical solution, are slow, unreliable, and feature-poor.
Here's where TCG shines. Compared to interpreters, TCG boasts impressive speed, supports multiple architectures, allows debugging with GDB, and handles both system and user space emulation. To showcase its potential, we describe a practical case of employing TCG for RISC-V emulation and integrating it with a simulator through a custom TCG plugin. In the process, we contributed to the upstream development of a new feature of the TCG plugin infrastructure to read registers, crucial for our use case. Finally, we discuss possibilities to extend QEMU to empower future microarchitecture research further.

See also:

Akihiko Odaki, a Ph.D. candidate at the University of Tokyo, is passionate about designing faster processors. His research focuses on processor microarchitecture, specifically using QEMU to analyze RISC-V programs and optimize processor designs for their execution speed.

He is also a software engineer at Daynix Computing, Ltd., and his contribution to the development of the TCG plugin’s register reading feature was supported by the company. His primary focus at the company is QEMU's networking subsystem. Notably, he is the maintainer of igb, a critical component that emulates an Intel network interface card with advanced virtualization capabilities. Akihiko's interests extend beyond networking and include macOS support, Asahi Linux (a port of Linux for Apple Silicon) support, and para-virtualized graphics.

This speaker also appears in: