public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Marc Joliet <marcec@gmx.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Recommendation for CPU type in QEMU?
Date: Sat, 3 Aug 2013 16:55:48 +0200	[thread overview]
Message-ID: <20130803165548.5ef5759a@marcec> (raw)
In-Reply-To: <51F8FF11.1010401@fastmail.co.uk>

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

Am Wed, 31 Jul 2013 13:12:01 +0100
schrieb Kerin Millar <kerframil@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?

-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-08-03 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 10:11 [gentoo-user] Recommendation for CPU type in QEMU? Walter Dnes
2013-07-31 10:45 ` Kerin Millar
2013-08-01  1:02   ` Walter Dnes
2013-08-01  6:41     ` Michael Hampicke
2013-08-01 21:38       ` Walter Dnes
2013-08-01 22:14         ` Kerin Millar
2013-07-31 11:31 ` Marc Joliet
2013-07-31 12:12   ` Kerin Millar
2013-08-03 14:55     ` Marc Joliet [this message]
2013-08-06 13:14       ` Kerin Millar
2013-08-06 15:59         ` Marc Joliet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130803165548.5ef5759a@marcec \
    --to=marcec@gmx.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox