qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/5] X86CPU "feature-words" & "filtered-features" properties (v2)
@ 2013-04-04 18:11 Eduardo Habkost
  2013-04-04 18:11 ` [Qemu-devel] [RFC 1/5] target-i386: Add ECX information to FeatureWordInfo Eduardo Habkost
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Eduardo Habkost @ 2013-04-04 18:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: libvir-list, Igor Mammedov, Jiri Denemark, Andreas Färber

Changes v2:
 * Added "filtered-features" properties
 * Removed the non-qapi version and kept only the qapi version of the code
 * Moved the new types to qapi-schema.json instead of creating
   cpu-qapi-schema.json
 * Rebased on top of "feature words array" series

Git tree:
 https://github.com/ehabkost/qemu-hacks/tree/work/cpu-raw-feature-props-v2
 git://github.com/ehabkost/qemu-hacks.git work/cpu-raw-feature-props-v2

Description:

As the work to get X86CPU subclasses static properties defined is taking very
long to get reviewed and we risk not getting it finished in 1.5, I am sending
an alternative mechanism to allow libvirt to probe for CPU model information.

It's interesting to note that this alternative solution is actually _easier_ to
use for libvirt, because libvirt logic is already based on CPUID bit values, not
"feature names", so it should be very easy to convert the current libvirt code
that (incorrectly) query the host CPU directly for available features to instead
start QEMU with "-cpu host" and use the "feature-words" array information to
find out which CPU features are supported by the host.

The "feature-words" property will have two main use cases:
 * Checking host capabilities, by checking the features of the "host"
   CPU model;
 * Checking which features are enabled on each CPU model.

The "filtered-features" property will have two main use cases:
 * Allowing libvirt to emulate the "check" & "enforce" flags while collecting
   more detailted data about the missing features;
 * Allowing libvirt to probe for CPU model information even if host features
   are missing (it can simply combine the "feature-words" and
   "filtered-features" values to get the full CPU model definition)

Example output:

  $ ./QMP/qmp --path=/tmp/m qom-get --path=/machine/unattached/device[1] --property=feature-words
  item[0].cpuid-register: EDX
  item[0].cpuid-input-eax: 1
  item[0].features: 126614521
  item[1].cpuid-register: ECX
  item[1].cpuid-input-eax: 1
  item[1].features: 2155880449
  item[2].cpuid-register: EBX
  item[2].cpuid-input-eax: 7
  item[2].features: 0
  item[2].cpuid-input-ecx: 0
  item[3].cpuid-register: EDX
  item[3].cpuid-input-eax: 2147483649
  item[3].features: 563346425
  item[4].cpuid-register: ECX
  item[4].cpuid-input-eax: 2147483649
  item[4].features: 101
  item[5].cpuid-register: EDX
  item[5].cpuid-input-eax: 3221225473
  item[5].features: 0
  item[6].cpuid-register: EAX
  item[6].cpuid-input-eax: 1073741825
  item[6].features: 0
  item[7].cpuid-register: EDX
  item[7].cpuid-input-eax: 2147483658
  item[7].features: 0


Eduardo Habkost (5):
  target-i386: Add ECX information to FeatureWordInfo
  target-i386: Add "feature-words" property
  target-i386: Use FeatureWord loop on filter_features_for_kvm()
  target-i386: Introduce X86CPU.filtered_features field
  target-i386: Add "filtered-features" property to X86CPU

 .gitignore            |   2 +
 Makefile.objs         |   7 +++-
 qapi-schema.json      |  32 +++++++++++++++
 target-i386/cpu-qom.h |   3 ++
 target-i386/cpu.c     | 110 +++++++++++++++++++++++++++++++++++---------------
 5 files changed, 121 insertions(+), 33 deletions(-)

-- 
1.8.1.4

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

end of thread, other threads:[~2013-04-04 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 18:11 [Qemu-devel] [RFC 0/5] X86CPU "feature-words" & "filtered-features" properties (v2) Eduardo Habkost
2013-04-04 18:11 ` [Qemu-devel] [RFC 1/5] target-i386: Add ECX information to FeatureWordInfo Eduardo Habkost
2013-04-04 18:11 ` [Qemu-devel] [RFC 2/5] target-i386: Add "feature-words" property Eduardo Habkost
2013-04-04 18:11 ` [Qemu-devel] [RFC 3/5] target-i386: Use FeatureWord loop on filter_features_for_kvm() Eduardo Habkost
2013-04-04 18:11 ` [Qemu-devel] [RFC 4/5] target-i386: Introduce X86CPU.filtered_features field Eduardo Habkost
2013-04-04 18:11 ` [Qemu-devel] [RFC 5/5] target-i386: Add "filtered-features" property to X86CPU Eduardo Habkost

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