qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] a2f997: tests: Add test case for x86 feature


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] a2f997: tests: Add test case for x86 feature parsing compa...
Date: Tue, 18 Oct 2016 03:00:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a2f9976ea83c50b452d46b8b1189242617e4ac73
      
https://github.com/qemu/qemu/commit/a2f9976ea83c50b452d46b8b1189242617e4ac73
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  tests: Add test case for x86 feature parsing compatibility

Add a new test case to ensure the existing behavior of the
feature parsing code will be kept.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: ee465a3ef77c2b2975ffa71c72208c05b3f3970d
      
https://github.com/qemu/qemu/commit/ee465a3ef77c2b2975ffa71c72208c05b3f3970d
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu-qom.h
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: List CPU models using subclass list

Instead of using the builtin_x86_defs array, use the QOM subclass
list to list CPU models on "-cpu ?" and "query-cpu-definitions".

Signed-off-by: Andreas Färber <address@hidden>
[ehabkost: copied code from a patch by Andreas:
 "target-i386: QOM'ify CPU", from March 2012]
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 04d99c3c61f4bdc0450dbeb6512b6dd743baca65
      
https://github.com/qemu/qemu/commit/04d99c3c61f4bdc0450dbeb6512b6dd743baca65
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Disable VME by default with TCG

VME is already disabled automatically when using TCG. So, instead
of pretending it is there when reporting CPU model data on
query-cpu-* QMP commands (making every CPU model to be reported
as not runnable), we can disable it by default on all CPU models
when using TCG.

Do that by adding a tcg_default_props array that will work like
kvm_default_props.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 54b8dc7c19cd781e96f1e9b001ca6001d804eb19
      
https://github.com/qemu/qemu/commit/54b8dc7c19cd781e96f1e9b001ca6001d804eb19
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Register aliases for feature names with underscores

Registering the actual names containing underscores as aliases
will allow management software to be aware that the old
compatibility names are suported, and will make feat2prop() calls
unnecessary when using feature names.

Also, this will help us avoid making the code support underscores
on feature names that never had them in the first place. e.g.
"+tsc_deadline" was never supported and doesn't need to be
translated to "+tsc-deadline".

In other word: this will require less magic translation of
strings, and simple 1:1 match between the config options and
actual QOM properties.

Note that the underscores are still present in the
FeatureWordInfo::feat_names arrays, because
add_flagname_to_bitmaps() needs them to be kept. The next patches
will remove add_flagname_to_bitmaps() and will allow us to
finally remove the aliases from feat_names.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2fae0d96e6834f3bf98065a9cddedad120f9b2b4
      
https://github.com/qemu/qemu/commit/2fae0d96e6834f3bf98065a9cddedad120f9b2b4
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Make plus_features/minus_features QOM-based

Instead of using custom feature name lookup code for
plus_features/minus_features, save the property names used in
"[+-]feature" and use object_property_set_bool() to set them.

We don't need a feat2prop() call because we now have alias
properties for the old names containing underscores.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: fc7dfd205f3287893c436d932a167bffa30579c8
      
https://github.com/qemu/qemu/commit/fc7dfd205f3287893c436d932a167bffa30579c8
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Remove underscores from feat_names arrays

Instead of translating the feature name entries when adding
property names, store the actual property names in the feature
name array.

For reference, here is the full list of functions that use
FeatureWordInfo::feat_names:

* x86_cpu_get_migratable_flags(): not affected, as it just
  check for non-NULL values.
* report_unavailable_features(): informative only. It will
  start printing feature names with hyphens.
* x86_cpu_list(): informative only. It will start printing
  feature names with hyphens
* x86_cpu_register_feature_bit_props(): not affected, as it
  was already calling feat2prop(). Now we can remove the
  feat2prop() calls safely.

So, the only user-visible effect of this patch are the new names
being used in help and error messages for users.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 16d2fcaa509b1ca56eb2fcd8fe877279cf65cccc
      
https://github.com/qemu/qemu/commit/16d2fcaa509b1ca56eb2fcd8fe877279cf65cccc
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Register properties for feature aliases manually

Instead of keeping the aliases inside the feature name arrays and
require parsing the strings, just register alias properties
manually. This simplifies the code for property registration and
lookup.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e3c9022b4e2b6a4deb6518361d2bbf33522b9198
      
https://github.com/qemu/qemu/commit/e3c9022b4e2b6a4deb6518361d2bbf33522b9198
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas

Instead of treating the FP and SSE bits as special cases, add
them to the x86_ext_save_areas array. This will simplify the code
that calculates the supported xsave components and the size of
the xsave area.

Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 9504e7100b74ae688601ec2c990bb80a47f263e3
      
https://github.com/qemu/qemu/commit/9504e7100b74ae688601ec2c990bb80a47f263e3
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M qapi-schema.json

  Log Message:
  -----------
  qmp: Add runnability information to query-cpu-definitions

Add a new optional field to query-cpu-definitions schema:
"unavailable-features". It will contain a list of QOM properties
that prevent the CPU model from running in the current host.

Cc: David Hildenbrand <address@hidden>
Cc: Michael Mueller <address@hidden>
Cc: Christian Borntraeger <address@hidden>
Cc: Cornelia Huck <address@hidden>
Cc: Jiri Denemark <address@hidden>
Cc: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 8ca30e8673aff9bfcf8f969f8db4266b5f62e49c
      
https://github.com/qemu/qemu/commit/8ca30e8673aff9bfcf8f969f8db4266b5f62e49c
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Move warning code outside x86_cpu_filter_features()

x86_cpu_filter_features() will be reused by code that shouldn't
print any warning. Move the warning code to a new
x86_cpu_report_filtered_features() function, and call it from
x86_cpu_realizefn().

Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2f114315dcf239bc513f18ae0b04b5df81cae059
      
https://github.com/qemu/qemu/commit/2f114315dcf239bc513f18ae0b04b5df81cae059
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/intc/apic_common.c
    M include/hw/i386/apic_internal.h
    M target-i386/cpu.c

  Log Message:
  -----------
  apic: add global apic_get_class()

Every configuration has only up to one APIC class and we'll be extending
the class with a function that can be called without an instanced
object, so a direct access to the class is convenient.

This patch will break compilation if some code uses apic_get_class()
with CONFIG_USER_ONLY.

Suggested-by: Eduardo Habkost <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 267ee357153bb61870b60da69ba9f839ddb0e32e
      
https://github.com/qemu/qemu/commit/267ee357153bb61870b60da69ba9f839ddb0e32e
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/i386/kvm/apic.c
    M hw/i386/xen/xen_apic.c
    M hw/intc/apic.c
    M include/hw/i386/apic_internal.h

  Log Message:
  -----------
  apic: add send_msi() to APICCommonClass

The MMIO based interface to APIC doesn't work well with MSIs that have
upper address bits set (remapped x2APIC MSIs).  A specialized interface
is a quick and dirty way to avoid the shortcoming.

Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 329460191d527e0cfa9ddbd14c75994e73de1975
      
https://github.com/qemu/qemu/commit/329460191d527e0cfa9ddbd14c75994e73de1975
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c

  Log Message:
  -----------
  intel_iommu: pass whole remapped addresses to apic

The MMIO interface to APIC only allowed 8 bit addresses, which is not
enough for 32 bit addresses from EIM remapping.
Intel stored upper 24 bits in the high MSI address, so use the same
technique. The technique is also used in KVM MSI interface.
Other APICs are unlikely to handle those upper bits.

Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 6333e93c772f78baf26a5c97c1a67ffa7cd76068
      
https://github.com/qemu/qemu/commit/6333e93c772f78baf26a5c97c1a67ffa7cd76068
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c

  Log Message:
  -----------
  intel_iommu: redo configuraton check in realize

* there no point in configuring the device if realization is going to
  fail, so move the check to the beginning,
* create a separate function for the check,
* use error_setg() instead error_report().

Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e6b6af05607a8bc828c454f6830b5fc68e5a9ac1
      
https://github.com/qemu/qemu/commit/e6b6af05607a8bc828c454f6830b5fc68e5a9ac1
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c
    M include/hw/i386/intel_iommu.h

  Log Message:
  -----------
  intel_iommu: add OnOffAuto intr_eim as "eim" property

The default (auto) emulates the current behavior.
A user can now control EIM like
  -device intel-iommu,intremap=on,eim=off

Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: fb506e701e9bafa3e0685747c1c98962c52d1962
      
https://github.com/qemu/qemu/commit/fb506e701e9bafa3e0685747c1c98962c52d1962
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c
    M include/hw/compat.h
    M include/hw/i386/intel_iommu.h
    M target-i386/kvm-stub.c
    M target-i386/kvm.c
    M target-i386/kvm_i386.h

  Log Message:
  -----------
  intel_iommu: reject broken EIM

Cluster x2APIC cannot work without KVM's x2apic API when the maximal
APIC ID is greater than 8 and only KVM's LAPIC can support x2APIC, so we
forbid other APICs and also the old KVM case with less than 9, to
simplify the code.

There is no point in enabling EIM in forbidden APICs, so we keep it
enabled only for the KVM APIC;  unconditionally, because making the
option depend on KVM version would be a maintanance burden.

Old QEMUs would enable eim whenever intremap was on, which would trick
guests into thinking that they can enable cluster x2APIC even if any
interrupt destination would get clamped to 8 bits.
Depending on your configuration, QEMU could notice that the destination
LAPIC is not present and report it with a very non-obvious:

  KVM: injection failed, MSI lost (Operation not permitted)

Or the guest could say something about unexpected interrupts, because
clamping leads to aliasing so interrupts were being delivered to
incorrect VCPUs.

KVM_X2APIC_API is the feature that allows us to enable EIM for KVM.

QEMU 2.7 allowed EIM whenever interrupt remapping was enabled.  In order
to keep backward compatibility, we again allow guests to misbehave in
non-obvious ways, and make it the default for old machine types.

A user can enable the buggy mode it with "x-buggy-eim=on".

Signed-off-by: Radim Krčmář <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2a138ec3af871cd42a982eb401f16dcb74cba8d3
      
https://github.com/qemu/qemu/commit/2a138ec3af871cd42a982eb401f16dcb74cba8d3
  Author: Radim Krčmář <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386/kvm: cache the return value of kvm_enable_x2apic()

Assume that KVM would have returned the same on subsequent runs.
Abstract the memoizaiton pattern into macros and call it memorize as
adding the r makes it less obscure.

Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e9e60febc497ae9d446caba0bdb2e9597a72e37c
      
https://github.com/qemu/qemu/commit/e9e60febc497ae9d446caba0bdb2e9597a72e37c
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Unset cannot_destroy_with_object_finalize_yet

TYPE_X86_CPU now call cpu_exec_init() on realize, so we don't
need to set cannot_destroy_with_object_finalize_yet anymore.

Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 41f3d4d69a423dadb8431fda65d8d7c68c0de0fc
      
https://github.com/qemu/qemu/commit/41f3d4d69a423dadb8431fda65d8d7c68c0de0fc
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: x86_cpu_load_features() function

When probing for CPU model information, we need to reuse the code
that initializes CPUID fields, but not the remaining side-effects
of x86_cpu_realizefn(). Move that code to a separate function
that can be reused later.

Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: b54c93778b5850aaaea176803fe1e46f9732ee1a
      
https://github.com/qemu/qemu/commit/b54c93778b5850aaaea176803fe1e46f9732ee1a
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Return runnability information on query-cpu-definitions

Fill the "unavailable-features" field on the x86 implementation
of query-cpu-definitions.

Cc: Jiri Denemark <address@hidden>
Cc: address@hidden
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 46c032f3afcc05a0123914609f1003906ba63fda
      
https://github.com/qemu/qemu/commit/46c032f3afcc05a0123914609f1003906ba63fda
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-10-17 (Mon, 17 Oct 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Don't use cpu->migratable when filtering features

When explicitly enabling unmigratable flags using "-cpu host"
(e.g. "-cpu host,+invtsc"), the requested feature won't be
enabled because cpu->migratable is true by default.

This is inconsistent with all other CPU models, which don't have
the "migratable" option, making "+invtsc" work without the need
for extra options.

This happens because x86_cpu_filter_features() uses
cpu->migratable as an argument for
x86_cpu_get_supported_feature_word(). This is not useful
because:
2) on "-cpu host" it only makes QEMU disable features that were
   explicitly enabled in the command-line;
1) on all the other CPU models, cpu->migratable is already false.

The fix is to just use 'false' as an argument to
x86_cpu_get_supported_feature_word() in
x86_cpu_filter_features().

Note that:

* This won't change anything for people using using
  "-cpu host" or "-cpu host,migratable=<on|off>" (with no extra
  features) because the x86_cpu_get_supported_feature_word() call
  on the cpu->host_features check uses cpu->migratable as
  argument.
* This won't change anything for any CPU model except "host"
  because they all have cpu->migratable == false (and only "host"
  has the "migratable" property that allows it to be changed).
* This will only change things for people using "-cpu host,+<feature>",
  where <feature> is a non-migratable feature. The only existing
  named non-migratable feature is "invtsc".

In other words, this change will only affect people using
"-cpu host,+invtsc" (that will now get what they asked for: the
invtsc flag will be enabled). All other use cases are unaffected.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e8ddc2eae5ccc41f0815e5c43e70cb04a7e67e2e
      
https://github.com/qemu/qemu/commit/e8ddc2eae5ccc41f0815e5c43e70cb04a7e67e2e
  Author: Peter Maydell <address@hidden>
  Date:   2016-10-18 (Tue, 18 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c
    M hw/i386/kvm/apic.c
    M hw/i386/xen/xen_apic.c
    M hw/intc/apic.c
    M hw/intc/apic_common.c
    M include/hw/compat.h
    M include/hw/i386/apic_internal.h
    M include/hw/i386/intel_iommu.h
    M qapi-schema.json
    M target-i386/cpu-qom.h
    M target-i386/cpu.c
    M target-i386/kvm-stub.c
    M target-i386/kvm.c
    M target-i386/kvm_i386.h
    M tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into 
staging

x86 queue, 2016-10-17

# gpg: Signature made Mon 17 Oct 2016 18:51:07 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-pull-request: (21 commits)
  target-i386: Don't use cpu->migratable when filtering features
  target-i386: Return runnability information on query-cpu-definitions
  target-i386: x86_cpu_load_features() function
  target-i386: Unset cannot_destroy_with_object_finalize_yet
  target-i386/kvm: cache the return value of kvm_enable_x2apic()
  intel_iommu: reject broken EIM
  intel_iommu: add OnOffAuto intr_eim as "eim" property
  intel_iommu: redo configuraton check in realize
  intel_iommu: pass whole remapped addresses to apic
  apic: add send_msi() to APICCommonClass
  apic: add global apic_get_class()
  target-i386: Move warning code outside x86_cpu_filter_features()
  qmp: Add runnability information to query-cpu-definitions
  target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas
  target-i386: Register properties for feature aliases manually
  target-i386: Remove underscores from feat_names arrays
  target-i386: Make plus_features/minus_features QOM-based
  target-i386: Register aliases for feature names with underscores
  target-i386: Disable VME by default with TCG
  target-i386: List CPU models using subclass list
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2d02ac10b664...e8ddc2eae5cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]