qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [uq/master PATCH 0/7] x86 CPU subclasses, take 7
@ 2014-01-30 19:48 Eduardo Habkost
  2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 1/7] target-i386: Eliminate CONFIG_KVM #ifdefs Eduardo Habkost
                   ` (8 more replies)
  0 siblings, 9 replies; 45+ messages in thread
From: Eduardo Habkost @ 2014-01-30 19:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, libvir-list, Igor Mammedov, Paolo Bonzini, Jiri Denemark,
	Andreas Färber

Is there any hope to get this into QEMU 2.0, or it is now too late? I got
almost no feedback on take 6 (submitted November 27).

This is the main blocker to allow libvirt finally implement an equivalent to the
"enforce" flag, finally making the CPU configuration safe and sane (today
libvirt simply ignores GET_SUPPORTED_CPUID information, and features are
silently disabled because "enforce" is not used).

This blocks libvirt because the current available interfaces requires re-running
QEMU for each CPU model to be probed. Having the x86 CPU subclasses allow
libvirt to simply create and destroy CPU objects from each available CPU class,
and query for the results using QMP.

Demonstration of how this can be used, below:

Running QEMU as:
$ qemu-system-x86_64 -enable-kvm -machine none -monitor stdio -qmp unix:/tmp/qmp,server,nowait -nographic

Then running qmp-shell as:
$ ./scripts/qmp/qmp-shell /tmp/qmp
[...]
(QEMU) object-add qom-type=host-x86_64-cpu id=probing-host-cpu-type
{u'return': {}}
(QEMU) object-add qom-type=Nehalem-x86_64-cpu id=probing-cpu-type-Nehalem
{u'return': {}}
(QEMU) object-add qom-type=Westmere-x86_64-cpu id=probing-cpu-type-Westmere
{u'return': {}}
(QEMU) object-add qom-type=Haswell-x86_64-cpu id=probing-cpu-type-Haswell
(QEMU) qom-list path=/objects/
{u'return': [{u'type': u'child<Haswell-x86_64-cpu>', u'name': u'probing-cpu-type-Haswell'}, {u'type': u'child<Westmere-x86_64-cpu>', u'name': u'probing-cpu-type-Westmere'}, {u'type': u'child<Nehalem-x86_64-cpu>', u'name': u'probing-cpu-type-Nehalem'}, {u'type': u'child<host-x86_64-cpu>', u'name': u'probing-host-cpu-type'}, {u'type': u'string', u'name': u'type'}]}
(QEMU) qom-list path=/objects/probing-cpu-type-Haswell/
{u'return': [{u'type': u'X86CPUFeatureWordInfo', u'name': u'filtered-features'}, {u'type': u'X86CPUFeatureWordInfo', u'name': u'feature-words'}, {u'type': u'int', u'name': u'apic-id'}, {u'type': u'int', u'name': u'tsc-frequency'}, {u'type': u'string', u'name': u'model-id'}, {u'type': u'string', u'name': u'vendor'}, {u'type': u'int', u'name': u'xlevel'}, {u'type': u'int', u'name': u'level'}, {u'type': u'int', u'name': u'stepping'}, {u'type': u'int', u'name': u'model'}, {u'type': u'int', u'name': u'family'}, {u'type': u'link<bus>', u'name': u'parent_bus'}, {u'type': u'boolean', u'name': u'enforce'}, {u'type': u'boolean', u'name': u'check'}, {u'type': u'boolean', u'name': u'hv-time'}, {u'type': u'boolean', u'name': u'hv-vapic'}, {u'type': u'boolean', u'name': u'hv-relaxed'}, {u'type': u'int', u'name': u'hv-spinlocks'}, {u'type': u'boolean', u'name': u'pmu'}, {u'type': u'bool', u'name': u'realized'}, {u'type': u'string', u'name': u'type'}]}
(QEMU) qom-get path=/objects/probing-cpu-type-Haswell property=feature-words
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 16777339}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 1}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 672139264}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 4025, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 2549756419}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 126614525}]}
(QEMU) qom-get path=/objects/probing-cpu-type-Haswell property=filtered-features
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 0, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 0}]}
(QEMU) qom-get path=/objects/probing-host-cpu-type property=feature-words
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 16777467}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 1}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 697564159}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 2, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 2193236483}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 260832255}]}
(QEMU) qom-get path=/objects/probing-host-cpu-type property=filtered-features
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 0, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 0}]}

Changes from take 6:

 * Rebase against uq/master
 * Patch 1/7:
   * Check for __i386__ on host_cpuid() so the code compiles properly
     on non-x86 hosts.
     Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
   * Don't add assert(kvm_enabled()) line, which is not necessary to help
     the compiler (and wouldn't help it if using -DNDEBUG, anyway).
     Reported-by: Richard Henderson <rth@twiddle.net>
   * Commit message update


Eduardo Habkost (7):
  target-i386: Eliminate CONFIG_KVM #ifdefs
  target-i386: Don't change x86_def_t struct on cpu_x86_register()
  target-i386: Move KVM default-vendor hack to instance_init
  target-i386: Rename cpu_x86_register() to x86_cpu_load_def()
  target-i386: Call x86_cpu_load_def() earlier
  target-i386: Rename x86_def_t to X86CPUDefinition
  target-i386: CPU model subclasses

 target-i386/cpu-qom.h |  13 ++
 target-i386/cpu.c     | 402 ++++++++++++++++++++++++++++++--------------------
 target-i386/cpu.h     |   2 -
 3 files changed, 256 insertions(+), 161 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2014-02-11  8:08 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 19:48 [Qemu-devel] [uq/master PATCH 0/7] x86 CPU subclasses, take 7 Eduardo Habkost
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 1/7] target-i386: Eliminate CONFIG_KVM #ifdefs Eduardo Habkost
2014-01-31 11:42   ` Paolo Bonzini
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 2/7] target-i386: Don't change x86_def_t struct on cpu_x86_register() Eduardo Habkost
2014-01-31 11:42   ` Paolo Bonzini
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 3/7] target-i386: Move KVM default-vendor hack to instance_init Eduardo Habkost
2014-01-31 11:42   ` Paolo Bonzini
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 4/7] target-i386: Rename cpu_x86_register() to x86_cpu_load_def() Eduardo Habkost
2014-01-31 11:42   ` Paolo Bonzini
2014-02-10  0:03     ` Andreas Färber
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 5/7] target-i386: Call x86_cpu_load_def() earlier Eduardo Habkost
2014-02-10  0:13   ` Andreas Färber
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 6/7] target-i386: Rename x86_def_t to X86CPUDefinition Eduardo Habkost
2014-01-31 11:42   ` Paolo Bonzini
2014-02-10  0:14     ` Andreas Färber
2014-01-30 19:48 ` [Qemu-devel] [uq/master PATCH 7/7] target-i386: CPU model subclasses Eduardo Habkost
2014-01-31 17:20   ` Eduardo Habkost
2014-01-31 18:13   ` [Qemu-devel] [uq/master PATCH 7/7 v8] " Eduardo Habkost
2014-02-10  0:23     ` Andreas Färber
2014-02-10  8:19       ` Eduardo Habkost
2014-02-10  8:26         ` Eduardo Habkost
2014-02-10 10:21           ` [Qemu-devel] [qom-cpu PATCH 7/7 v9] " Eduardo Habkost
2014-02-10 22:39             ` Andreas Färber
2014-02-11  8:05               ` Eduardo Habkost
2014-02-11  8:07               ` Paolo Bonzini
2014-02-10  9:48       ` [Qemu-devel] [uq/master PATCH 7/7 v8] " Igor Mammedov
2014-01-30 21:47 ` [Qemu-devel] [uq/master PATCH 0/7] x86 CPU subclasses, take 7 Paolo Bonzini
2014-01-31 11:30   ` Andreas Färber
2014-01-31 11:42     ` Paolo Bonzini
2014-01-31 12:17       ` Eduardo Habkost
2014-01-31 12:14     ` Eduardo Habkost
2014-01-31 14:36     ` Igor Mammedov
2014-01-31 14:48 ` Igor Mammedov
2014-01-31 14:50   ` Paolo Bonzini
2014-01-31 15:17     ` Eduardo Habkost
2014-01-31 16:06       ` Igor Mammedov
2014-01-31 16:42         ` Eduardo Habkost
2014-01-31 16:52           ` Paolo Bonzini
2014-01-31 18:51             ` Eduardo Habkost
2014-01-31 18:56               ` [Qemu-devel] [libvirt] " Eric Blake
2014-01-31 19:08                 ` Eduardo Habkost
2014-01-31 19:18                 ` Igor Mammedov
2014-01-31 19:25                   ` Eduardo Habkost
2014-01-31 15:10   ` [Qemu-devel] " Eduardo Habkost
2014-01-31 15:11     ` Paolo Bonzini

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).