From: Gleb Natapov <gleb@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>,
libvir-list@redhat.com, qemu-devel@nongnu.org,
Anthony Liguori <anthony@codemonkey.ws>,
Jiri Denemark <jdenemar@redhat.com>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [libvirt] Modern CPU models cannot be used with libvirt
Date: Sun, 11 Mar 2012 14:41:16 +0200 [thread overview]
Message-ID: <20120311124116.GI17882@redhat.com> (raw)
In-Reply-To: <20120310155843.GJ2914@otherpad.lan.raisama.net>
On Sat, Mar 10, 2012 at 12:58:43PM -0300, Eduardo Habkost wrote:
> On Sat, Mar 10, 2012 at 12:42:46PM +0000, Daniel P. Berrange wrote:
> > >
> > > I could have sworn we had this discussion a year ago or so, and had decided
> > > that the default CPU models would be in something like /usr/share/qemu/cpu-x86_64.conf
> > > and loaded regardless of the -nodefconfig setting. /etc/qemu/target-x86_64.conf
> > > would be solely for end user configuration changes, not for QEMU builtin
> > > defaults.
> > >
> > > But looking at the code in QEMU, it doesn't seem we ever implemented this ?
> >
> > Arrrgggh. It seems this was implemented as a patch in RHEL-6 qemu RPMs but,
> > contrary to our normal RHEL development practice, it was not based on
> > a cherry-pick of an upstream patch :-(
> >
> > For sake of reference, I'm attaching the two patches from the RHEL6 source
> > RPM that do what I'm describing
> >
> > NB, I'm not neccessarily advocating these patches for upstream. I still
> > maintain that libvirt should write out a config file containing the
> > exact CPU model description it desires and specify that with -readconfig.
> > The end result would be identical from QEMU's POV and it would avoid
> > playing games with QEMU's config loading code.
>
> I agree that libvirt should just write the config somewhere. The problem
> here is to define: 1) what information should be mandatory on that
> config data; 2) who should be responsible to test and maintain sane
> defaults (and where should they be maintained).
>
> The current cpudef definitions are simply too low-level to require it to
> be written from scratch. Lots of testing have to be done to make sure we
> have working combinations of CPUID bits defined, so they can be used as
> defaults or templates. Not facilitating reuse of those tested
> defauls/templates by libvirt is duplication of efforts.
>
> Really, if we expect libvirt to define all the CPU bits from scratch on
> a config file, we could as well just expect libvirt to open /dev/kvm
> itself and call the all CPUID setup ioctl()s itself. That's how
> low-level some of the cpudef bits are.
>
s/some/all
If libvirt assumes anything about what kvm actually supports it is
working only by sheer luck.
> (Also, there are additional low-level bits that really have to be
> maintained somewhere, just to have sane defaults. Currently many CPUID
> leafs are exposed to the guest without letting the user control them,
> and worse: without keeping stability of guest-visible bits when
> upgrading Qemu or the host kernel. And that's what machine-types are
> for: to have sane defaults to be used as base.)
>
> Let me give you a practical example: I had a bug report about improper
> CPU topology information[1]. After investigating it, I have found out
> that the "level" cpudef field is too low; CPU core topology information
> is provided on CPUID leaf 4, and most of the Intel CPU models on Qemu
> have level=2 today (I don't know why). So, Qemu is responsible for
> exposing CPU topology information set using '-smp' to the guest OS, but
> libvirt would have to be responsible for choosing a proper "level" value
> that makes that information visible to the guest. We can _allow_ libvirt
> to fiddle with these low-level bits, of course, but requiring every
> management layer to build this low-level information from scratch is
> just a recipe to waste developer time.
And QEMU become even less usable from a command line. One more point to
kvm-tool I guess.
>
> (And I really hope that there's no plan to require all those low-level
> bits to appear as-is on the libvirt XML definitions. Because that would
> require users to read the Intel 64 and IA-32 Architectures Software
> Developer's Manual, or the AMD64 Architecture Programmer's Manual and
> BIOS and Kernel Developer's Guides, just to understand why something is
> not working on his Virtual Machine.)
>
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=689665
>
> --
> Eduardo
--
Gleb.
next prev parent reply other threads:[~2012-03-11 12:41 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
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 [this message]
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=20120311124116.GI17882@redhat.com \
--to=gleb@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=berrange@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).