Developer ports Rust KVM hypervisor to ARM64, resolves boot errors to run binaries
A developer working on a Rust-based KVM hypervisor documented the process of porting it to ARM64 architecture, encountering an ENOEXEC error when attempting to access CPU registers via KVM_GET_ONE_REG. Tracing the error through Linux kernel source code on Bootlin Elixir revealed that the vCPU must be initialized via KVM_ARM_VCPU_INIT before register access is permitted. To determine the correct initialization parameters, the developer used a GDB script to intercept and decode the ioctl call from a reference implementation, extracting the target value of 5 and zeroed feature flags. After implementing KVM_ARM_VCPU_INIT in Rust with these values, register get and set operations began working correctly. The developer then tackled a further issue where KVM_RUN never returned, experimenting with signal handlers to interrupt execution and retrieve register state synchronously.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in