User mode qemu and KVM

Unix & Linux Asked by Mauricio Galindo on January 3, 2022

When running user mode qemu for target x86 on a target x86 (or just target arch = host arch), will qemu use KVM, transfer control to the directly to the CPU or will it be interpreting the instructions.

One Answer

A few circumstantial evidences that user mode does not use KVM:

  • the userland executable qemu-x86_64 --help does not show a --kvm option, as is present for the full system executable qemu-system-x86_64 --help

  • we can see both input instructions and the binary translated instructions with:

    qemu-x86_64 -d in_asm,out_asm hello.out

    A commented example: How does native android code written for ARM run on x86

Now, for the more interesting question, could it in theory work?

I'm not sure, but on the gem5 simulator, which also has an analogous user mode (called syscall emulation), there was at least some serious investigation of this possibility by AMD, and they concluded it would be possible:

Something was actually merged in 2014: adbaa4dfde96d5aaf84adf0ae4989ef880aad726 "kvm, x86: Adding support for SE mode execution". But when I tried on 3ca404da175a66e0b958165ad75eb5f54cb5e772 it failed with KeyError: 'OsKernel', gotta investigate/ask further.

Answered by Ciro Santilli 新疆再教育营六四事件法轮功郝海东 on January 3, 2022

Add your own answers!

Related Questions

How to expand “word” in bash? Not talking about file wildcards

2  Asked on October 31, 2021 by luis-santos


Parse a string using keywords

7  Asked on October 31, 2021 by beaker


Why does the command a-=2 fail?

4  Asked on October 31, 2021 by tmpbin


Shell dropping every other character of input

3  Asked on October 31, 2021 by michael-davis


Out of memory, but swap available

1  Asked on October 31, 2021


How can I display list of files in a directory?

4  Asked on October 31, 2021 by brocharvey


Booting from ISO suddenly stopped working

0  Asked on October 31, 2021 by ajgringo619


Does Pulseaudio leak memory?

2  Asked on October 31, 2021


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP