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

Why I can’t increase the transmit power of my Wifi interface?

1  Asked on November 19, 2021 by christopher-shaju


compare available list with chosen ids in shell script

2  Asked on November 19, 2021 by user3696623


How do I gunzip to a particular directory?

2  Asked on November 19, 2021


How to blacklist built-in Kernel module 8250_pci

1  Asked on November 19, 2021 by mark2012


Input Output errors on disk drives

1  Asked on November 19, 2021 by yuanl


Linux X86_64 physical memory layout

1  Asked on November 19, 2021 by franc-m


feh keys configuration not working

1  Asked on November 19, 2021 by ma08


slow Matlab on Ubuntu LTS and ZERO Swap

2  Asked on November 18, 2021 by waleed-shawki


Save all the terminal output to a file

3  Asked on November 18, 2021 by user78927


CentOS: Wireless adapter not found

0  Asked on November 17, 2021 by mohit-singh


cmd nested in backticks processed from sudo?

1  Asked on November 17, 2021 by alecxs


Ask a Question

Get help from others!

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