On Thu, Jan 28, 2021 at 09:32:19PM +0300, Elena Afanasova wrote: > This patchset introduces a KVM dispatch mechanism which can be used > for handling MMIO/PIO accesses over file descriptors without returning > from ioctl(KVM_RUN). This allows device emulation to run in another task > separate from the vCPU task. > > This is achieved through KVM vm ioctl for registering MMIO/PIO regions and > a wire protocol that KVM uses to communicate with a task handling an > MMIO/PIO access. > > TODOs: > * Implement KVM_EXIT_IOREGIONFD_FAILURE > * Add non-x86 arch support This is an interesting topic for discussion with the KVM maintainers. The ioctl(KVM_RUN) exit code is arch-specific in the sense that there is no standard approach for PIO/MMIO accesses to return to userspace and resume processing when ioctl(KVM_RUN) is called again. This RFC series is x86-specific, but part of it can be made cross-arch by introducing a core KVM ->complete_user_exit() function pointer that MMIO/PIO and other users (EINTR?) can use to resume processing when ioctl(KVM_RUN) is called again. Maybe the benefit for a generic ->complete_user_exit() function is too small so each arch open codes this behavior?
Attachment:
signature.asc
Description: PGP signature