All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: libvir-list@redhat.com, qemu-devel@nongnu.org,
	Avi Kivity <avi@redhat.com>, Jiri Denemark <jdenemar@redhat.com>,
	"arch@ovirt.org" <arch@ovirt.org>
Subject: Re: [Qemu-devel] [libvirt] Modern CPU models cannot be used with libvirt
Date: Sun, 11 Mar 2012 18:16:25 +0200	[thread overview]
Message-ID: <20120311161625.GN17882@redhat.com> (raw)
In-Reply-To: <4F5CC5BB.3070000@codemonkey.ws>

On Sun, Mar 11, 2012 at 10:33:15AM -0500, Anthony Liguori wrote:
> On 03/11/2012 09:56 AM, Gleb Natapov wrote:
> >On Sun, Mar 11, 2012 at 09:12:58AM -0500, Anthony Liguori wrote:
> >>-cpu best wouldn't solve this.  You need a read/write configuration
> >>file where QEMU probes the available CPU and records it to be used
> >>for the lifetime of the VM.
> >That what I thought too, but this shouldn't be the case (Avi's idea).
> >We need two things: 1) CPU model config should be per machine type.
> >2) QEMU should refuse to start if it cannot create cpu exactly as
> >specified by model config.
> 
> This would either mean:
> 
> A. pc-1.1 uses -cpu best with a fixed mask for 1.1
> 
> B. pc-1.1 hardcodes Westmere or some other family
> 
This would mean neither A nor B. May be it wasn't clear but I didn't talk
about -cpu best above. I am talking about any CPU model with fixed meaning
(not host or best which are host cpu dependant). Lets take Nehalem for
example (just to move from Westmere :)). Currently it has level=2. Eduardo
wants to fix it to be 11, but old guests, installed with -cpu Nehalem,
should see the same CPU exactly. How do you do it? Have different
Nehalem definition for pc-1.0 (which level=2) and pc-1.1 (with level=11).
Lets get back to Westmere. It actually has level=11, but that's only
expose another problem. Kernel 3.3 and qemu-1.1 combo will support
architectural PMU which is exposed in cpuid leaf 10. We do not want
guests installed with -cpu Westmere and qemu-1.0 to see architectural
PMU after upgrade. How do you do it? Have different Westmere definitions
for pc-1.0 (does not report PMU) and pc-1.1 (reports PMU). What happens
if you'll try to run qemu-1.1 -cpu Westmere on Kernel < 3.3 (without
PMU support)? Qemu will fail to start.


> (A) would imply a different CPU if you moved the machine from one
> system to another.  I would think this would be very problematic
> from a user's perspective.
> 
> (B) would imply that we had to choose the least common denominator
> which is essentially what we do today with qemu64.  If you want to
> just switch qemu64 to Conroe, I don't think that's a huge difference
> from what we have today.
> 
> >>It's a discussion about how we handle this up and down the stack.
> >>
> >>The question is who should define and manage CPU compatibility.
> >>Right now QEMU does to a certain degree, libvirt discards this and
> >>does it's own thing, and VDSM/ovirt-engine assume that we're
> >>providing something and has built a UI around it.
> >If we want QEMU to be usable without management layer then QEMU should
> >provide stable CPU models. Stable in a sense that qemu, kernel or CPU
> >upgrade does not change what guest sees.
> 
> We do this today by exposing -cpu qemu64 by default.  If all you're
> advocating is doing -cpu Conroe by default, that's fine.
I am not advocating that. I am saying we should be able to amend qemu64
definition without breaking older guests that use it.

> 
> But I fail to see where this fits into the larger discussion here.
> The problem to solve is: I want to use the largest possible subset
> of CPU features available uniformly throughout my datacenter.
> 
> QEMU and libvirt have single node views so they cannot solve this
> problem on their own.  Whether that subset is a generic
> Westmere-like processor that never existed IRL or a specific
> Westmere processor seems like a decision that should be made by the
> datacenter level manager with the node level view.
> 
> If I have a homogeneous environments of Xeon 7540, I would probably
> like to see a Xeon 7540 in my guest.  Doesn't it make sense to
> enable the management tool to make this decision?
> 
Of course neither QEMU nor libvirt can't made a cluster wide decision.
If QEMU provides sane CPU model definitions (usable even with -nodefconfig)
it would be always possible to find the model that fits best. If the
oldest CPU in data center is Nehalem then probably -cpu Nehalem will do.
But our CPU model definitions have a lot of shortcomings and we were
talking with Edurado how to fix them when he brought this thread back to
life, so may be I stirred the discussion a little bit in the wrong
direction, but I do think those things are connected. If QEMU CPU model
definitions are not stable across upgrades how can we say to management
that it is safe to use them? Instead they insist in reimplementing the
same logic in mngmt layer and do it badly (because the lack of info).

--
			Gleb.

  reply	other threads:[~2012-03-11 16:16 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 14:54 [Qemu-devel] Modern CPU models cannot be used with libvirt Jiri Denemark
2011-12-15 14:58 ` Anthony Liguori
2011-12-15 15:30   ` Jiri Denemark
2011-12-18 10:07     ` Dor Laor
2011-12-15 15:42 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2011-12-18  9:58   ` Gleb Natapov
2012-03-09 20:56     ` Eduardo Habkost
2012-03-09 21:04       ` Daniel P. Berrange
2012-03-09 21:15         ` Anthony Liguori
2012-03-10  4:37           ` Eduardo Habkost
2012-03-11 11:45           ` Gleb Natapov
2012-03-10 12:42         ` Daniel P. Berrange
2012-03-10 15:58           ` Eduardo Habkost
2012-03-10 18:24             ` Anthony Liguori
2012-03-10 18:37               ` Andreas Färber
2012-03-10 22:39               ` Doug Goldstein
2012-03-11  0:55               ` Andrew Cathrow
2012-03-11 13:27               ` Gleb Natapov
2012-03-11 14:12                 ` Anthony Liguori
2012-03-11 14:56                   ` Gleb Natapov
2012-03-11 15:33                     ` Anthony Liguori
2012-03-11 16:16                       ` Gleb Natapov [this message]
2012-03-12 14:48                         ` Anthony Liguori
2012-03-12 15:16                           ` Eduardo Habkost
2012-03-12 15:49                         ` Andreas Färber
2012-03-12 16:50                           ` Eduardo Habkost
2012-03-12 17:41                             ` Andreas Färber
2012-03-12 17:47                               ` Peter Maydell
2012-03-12 17:53                                 ` Andreas Färber
2012-03-12 17:55                                   ` Gleb Natapov
2012-03-12 17:59                                   ` Alexander Graf
2012-03-12 17:52                               ` Gleb Natapov
2012-03-12 18:30                               ` Eduardo Habkost
2012-03-12 18:42                                 ` Anthony Liguori
2012-03-12 18:53                       ` Itamar Heim
2012-03-12 19:01                         ` Anthony Liguori
2012-03-12 19:12                           ` Itamar Heim
2012-03-12 19:50                             ` Anthony Liguori
2012-03-12 20:00                               ` Itamar Heim
2012-03-12 20:19                               ` Ayal Baron
2012-03-13  8:32                                 ` Itamar Heim
2012-03-14  0:11                                   ` Ayal Baron
2012-03-12 12:52                   ` Eduardo Habkost
2012-03-12 13:04                     ` Daniel P. Berrange
2012-03-12 13:15                       ` Gleb Natapov
2012-03-12 13:32                         ` Eduardo Habkost
2012-03-12 13:34                           ` Gleb Natapov
2012-03-12 13:50                         ` Daniel P. Berrange
2012-03-12 13:53                           ` Gleb Natapov
2012-03-12 13:55                             ` Daniel P. Berrange
2012-03-12 14:01                               ` Gleb Natapov
2012-03-25 13:21                   ` Avi Kivity
2012-03-25 13:26                     ` Anthony Liguori
2012-03-25 16:06                       ` Avi Kivity
2012-03-11 12:41             ` Gleb Natapov
2012-03-11 14:16               ` Anthony Liguori
2012-03-11 15:12                 ` Gleb Natapov
2012-03-11 15:41                   ` Anthony Liguori
2012-03-11 16:27                     ` Gleb Natapov
2012-03-12 13:08                     ` Eduardo Habkost
2012-03-13 14:53                       ` Eduardo Habkost
2012-03-22  9:32                         ` Gleb Natapov
2012-03-22 13:31                           ` Eduardo Habkost
2012-03-22 14:30                             ` Gleb Natapov
2012-03-22 15:50                               ` Eduardo Habkost
2012-03-25 10:19                                 ` Gleb Natapov
2012-03-25 13:09                                   ` Anthony Liguori
2012-03-25 14:46                                     ` Gleb Natapov
2012-03-25 15:06                                       ` Anthony Liguori
2012-03-25 16:34                                         ` Gleb Natapov
2012-03-26 16:00                                   ` Eduardo Habkost
2012-03-22 16:37                           ` Anthony Liguori
2012-03-22 17:14                             ` Eduardo Habkost
2012-03-22 20:01                               ` Anthony Liguori
2012-03-25  9:49                                 ` Gleb Natapov
2012-03-25 12:55                                   ` Anthony Liguori
2012-03-25 13:08                                     ` Avi Kivity
2012-03-25 13:12                                       ` Anthony Liguori
2012-03-25 13:14                                         ` Avi Kivity
2012-03-25 13:22                                           ` Anthony Liguori
2012-03-25 13:34                                             ` Avi Kivity
2012-03-25 14:36                                               ` Anthony Liguori
2012-03-25 14:46                                                 ` Avi Kivity
2012-03-25 14:59                                                   ` Anthony Liguori
2012-03-25 15:16                                                     ` Avi Kivity
2012-03-25 15:26                                                       ` Anthony Liguori
2012-03-25 15:40                                                         ` Avi Kivity
2012-03-25 18:11                                                           ` Anthony Liguori
2012-03-26  9:08                                                             ` Avi Kivity
2012-03-26  9:53                                                               ` Gleb Natapov
2012-03-26 19:03                                                               ` Anthony Liguori
2012-03-28  9:55                                                                 ` Avi Kivity
2012-03-26 16:34                                                             ` Eduardo Habkost
2012-03-26 11:24                                                         ` Jiri Denemark
2012-03-26 11:59                                                           ` Avi Kivity
2012-03-26 12:03                                                             ` Gleb Natapov
2012-03-26 16:14                                                               ` Eduardo Habkost
2012-03-26 19:04                                                                 ` Anthony Liguori
2012-03-25 14:58                                           ` Gleb Natapov
2012-03-25 15:07                                             ` Anthony Liguori
2012-03-25 15:18                                               ` Avi Kivity
2012-03-25 15:30                                                 ` Anthony Liguori
2012-03-25 15:45                                                   ` Avi Kivity
2012-03-25 18:01                                                     ` Anthony Liguori
2012-03-25 18:09                                                       ` Avi Kivity
2012-03-26 19:00                                                         ` Anthony Liguori
2012-03-28  9:59                                                           ` Avi Kivity
2012-03-20 18:59       ` Eduardo Habkost

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=20120311161625.GN17882@redhat.com \
    --to=gleb@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=arch@ovirt.org \
    --cc=avi@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.