On 03/08/2013 15:55, Marc Joliet wrote:
Am Wed, 31 Jul 2013 13:12:01 +0100
schrieb Kerin Millar <kerfra...@fastmail.co.uk>:

On 31/07/2013 12:31, Marc Joliet wrote:

[snip]


There's also "-cpu host", which simply passes your CPU through to the guest.
That's what I use for my 32 bit WinXP VM. You can use it if you don't mind not
being able to migrate your guest, but it sounds to me like you're doing this on
a desktop machine, so I suspect guest migration doesn't matter to you.


I thought the same until very recently but it's not the case. The -cpu
host feature exposes all feature bits supported by qemu. Those may
include features that aren't supported in hardware by the host CPU, in
which case qemu has to resort to (slow) emulation if they are used.

--Kerin

Just a follow up: the most authoritative answer I could find is this:

   http://thread.gmane.org/gmane.comp.emulators.kvm.devel/84227/focus=90541

Furthermore, the Linux KVM tuning page also defines "-cpu host" as I understand
it:

   http://www.linux-kvm.org/page/Tuning_KVM

 From the above I conclude that "-cpu host" should *not* activate CPU features
that the host CPU does not support.

Otherwise I could only find out the following:

- the Gentoo and Arch wikis both recommend "-cpu host" in conjunction with KVM
   (see, e.g., http://wiki.gentoo.org/wiki/QEMU/Options)
- in contrast, http://wiki.qemu.org/Features/CPUModels#-cpu_host_vs_-cpu_best
   seems to match your statement
- some guy on serverfault.com says this
   
(http://serverfault.com/questions/404195/kvm-which-cpu-features-make-vms-run-better):

   "Qemu doesn't work in the same way many other hypervisors do. For starters, 
it
   can provide full emulation. That means you can run x86 code on an ARM
   processor, for example. When in KVM mode, as you're using it, it doesn't
   actually do that... the processor is exposed no matter what, but what is
   reported to the OS will be changed by the -cpu flag."

   If that's correct, "-cpu host" might mean different things when in KVM
   mode vs. when not. However I'm not going to blindly trust that statement.

How/where did you find out that "-cpu host" also exposes non-host CPU features?


I checked the code and you're right. I had obtained the information from the qemu wiki but can now only assume that the content was discussing the feature before its implementation became concrete. Lesson to self: don't believe everything one reads in wikis (even official ones).

--Kerin

Reply via email to