Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Recommendation for CPU type in QEMU?
Date: Sat, 03 Aug 2013 14:55:55
Message-Id: 20130803165548.5ef5759a@marcec
In Reply to: Re: [gentoo-user] Recommendation for CPU type in QEMU? by Kerin Millar
1 Am Wed, 31 Jul 2013 13:12:01 +0100
2 schrieb Kerin Millar <kerframil@×××××××××××.uk>:
3
4 > On 31/07/2013 12:31, Marc Joliet wrote:
5 >
6 > [snip]
7 >
8 > >
9 > > There's also "-cpu host", which simply passes your CPU through to the guest.
10 > > That's what I use for my 32 bit WinXP VM. You can use it if you don't mind not
11 > > being able to migrate your guest, but it sounds to me like you're doing this on
12 > > a desktop machine, so I suspect guest migration doesn't matter to you.
13 > >
14 >
15 > I thought the same until very recently but it's not the case. The -cpu
16 > host feature exposes all feature bits supported by qemu. Those may
17 > include features that aren't supported in hardware by the host CPU, in
18 > which case qemu has to resort to (slow) emulation if they are used.
19 >
20 > --Kerin
21
22 Just a follow up: the most authoritative answer I could find is this:
23
24 http://thread.gmane.org/gmane.comp.emulators.kvm.devel/84227/focus=90541
25
26 Furthermore, the Linux KVM tuning page also defines "-cpu host" as I understand
27 it:
28
29 http://www.linux-kvm.org/page/Tuning_KVM
30
31 From the above I conclude that "-cpu host" should *not* activate CPU features
32 that the host CPU does not support.
33
34 Otherwise I could only find out the following:
35
36 - the Gentoo and Arch wikis both recommend "-cpu host" in conjunction with KVM
37 (see, e.g., http://wiki.gentoo.org/wiki/QEMU/Options)
38 - in contrast, http://wiki.qemu.org/Features/CPUModels#-cpu_host_vs_-cpu_best
39 seems to match your statement
40 - some guy on serverfault.com says this
41 (http://serverfault.com/questions/404195/kvm-which-cpu-features-make-vms-run-better):
42
43 "Qemu doesn't work in the same way many other hypervisors do. For starters, it
44 can provide full emulation. That means you can run x86 code on an ARM
45 processor, for example. When in KVM mode, as you're using it, it doesn't
46 actually do that... the processor is exposed no matter what, but what is
47 reported to the OS will be changed by the -cpu flag."
48
49 If that's correct, "-cpu host" might mean different things when in KVM
50 mode vs. when not. However I'm not going to blindly trust that statement.
51
52 How/where did you find out that "-cpu host" also exposes non-host CPU features?
53
54 --
55 Marc Joliet
56 --
57 "People who think they know everything really annoy those of us who know we
58 don't" - Bjarne Stroustrup

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Recommendation for CPU type in QEMU? Kerin Millar <kerframil@×××××××××××.uk>