1. 15 1月, 2013 7 次提交
    • E
      target-i386: check/enforce: Check all feature words · 07ca5945
      Eduardo Habkost 提交于
      This adds the following feature words to the list of flags to be checked
      by kvm_check_features_against_host():
      
       - cpuid_7_0_ebx_features
       - ext4_features
       - kvm_features
       - svm_features
      
      This will ensure the "enforce" flag works as it should: it won't allow
      QEMU to be started unless every flag that was requested by the user or
      defined in the CPU model is supported by the host.
      
      This patch may cause existing configurations where "enforce" wasn't
      preventing QEMU from being started to abort QEMU. But that's exactly the
      point of this patch: if a flag was not supported by the host and QEMU
      wasn't aborting, it was a bug in the "enforce" code.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      07ca5945
    • E
      target-i386/cpu.c: Add feature name array for ext4_features · 89e49c8b
      Eduardo Habkost 提交于
      Feature names were taken from the X86_FEATURE_* constants in the Linux
      kernel code.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      89e49c8b
    • E
      target-i386: kvm_check_features_against_host(): Use feature_word_info · bffd67b0
      Eduardo Habkost 提交于
      Instead of carrying the CPUID leaf/register and feature name array on
      the model_features_t struct, move that information into
      feature_word_info so it can be reused by other functions.
      
      The goal is to eventually kill model_features_t entirely, but to do that
      we have to either convert x86_def_t.features to an array or use
      offsetof() inside FeatureWordInfo (to replace the pointers inside
      model_features_t). So by now just move most of the model_features_t
      fields to FeatureWordInfo except for the two pointers to local
      arguments.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      bffd67b0
    • E
      target-i386/cpu: Introduce FeatureWord typedefs · 5ef57876
      Eduardo Habkost 提交于
      This introduces a FeatureWord enum, FeatureWordInfo struct (with
      generation information about a feature word), and a FeatureWordArray
      typedef, and changes add_flagname_to_bitmaps() code and
      cpu_x86_parse_featurestr() to use the new typedefs instead of separate
      variables for each feature word.
      
      This will help us keep the code at kvm_check_features_against_host(),
      cpu_x86_parse_featurestr() and add_flagname_to_bitmaps() sane while
      adding new feature name arrays.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      5ef57876
    • E
      target-i386: Disable kvm_mmu by default · 6a4784ce
      Eduardo Habkost 提交于
      KVM_CAP_PV_MMU capability reporting was removed from the kernel since
      v2.6.33 (see commit a68a6a7282373), and was completely removed from the
      kernel since v3.3 (see commit fb92045843). It doesn't make sense to keep
      it enabled by default, as it would cause unnecessary hassle when using
      the "enforce" flag.
      
      This disables kvm_mmu on all machine-types. With this fix, the possible
      scenarios when migrating from QEMU <= 1.3 to QEMU 1.4 are:
      
      ------------+----------+----------------------------------------------------
       src kernel | dst kern.| Result
      ------------+----------+----------------------------------------------------
       >= 2.6.33  | any      | kvm_mmu was already disabled and will stay disabled
       <= 2.6.32  | >= 3.3   | correct live migration is impossible
       <= 2.6.32  | <= 3.2   | kvm_mmu will be disabled on next guest reboot *
      ------------+----------+----------------------------------------------------
      
       * If they are running kernel <= 2.6.32 and want kvm_mmu to be kept
         enabled on guest reboot, they can explicitly add +kvm_mmu to the QEMU
         command-line. Using 2.6.33 and higher, it is not possible to enable
         kvm_mmu explicitly anymore.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      6a4784ce
    • A
      cpu: Move cpu_index field to CPUState · 55e5c285
      Andreas Färber 提交于
      Note that target-alpha accesses this field from TCG, now using a
      negative offset. Therefore the field is placed last in CPUState.
      
      Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.
      
      Move common parts of mips cpu_state_reset() to mips_cpu_reset().
      
      Acked-by: Richard Henderson <rth@twiddle.net> (for alpha)
      [AF: Rebased onto ppc CPU subclasses and openpic changes]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      55e5c285
    • A
      cpu: Move nr_{cores,threads} fields to CPUState · ce3960eb
      Andreas Färber 提交于
      To facilitate the field movements, pass MIPSCPU to malta_mips_config();
      avoid that for mips_cpu_map_tc() since callers only access MIPS Thread
      Contexts, inside TCG helpers.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      ce3960eb
  2. 09 1月, 2013 10 次提交
  3. 23 12月, 2012 1 次提交
    • E
      target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel · 57f26ae7
      Eduardo Habkost 提交于
      This fixes a subtle bug. A bug that probably won't cause trouble for any
      existing OS, but a bug anyway:
      
      Intel SDM Volume 2, CPUID Instruction states:
      
      > Two types of information are returned: basic and extended function
      > information. If a value entered for CPUID.EAX is higher than the maximum
      > input value for basic or extended function for that processor then the
      > data for the highest basic information leaf is returned. For example,
      > using the Intel Core i7 processor, the following is true:
      >
      >   CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *)
      >   CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *)
      >   CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *)
      >   CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 0BH. *)
      >   CPUID.EAX = 80000008H (* Returns linear/physical address size data. *)
      >   CPUID.EAX = 8000000AH (* INVALID: Returns same information as CPUID.EAX = 0BH. *)
      
      AMD's CPUID Specification, on the other hand, is less specific:
      
      > The CPUID instruction supports two sets or ranges of functions,
      > standard and extended.
      >
      > • The smallest function number of the standard function range is
      >   Fn0000_0000. The largest function num- ber of the standard function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn0000_0000_EAX.
      >
      > • The smallest function number of the extended function range is
      >   Fn8000_0000. The largest function num- ber of the extended function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn8000_0000_EAX.
      >
      > Functions that are neither standard nor extended are undefined and
      > should not be relied upon.
      
      QEMU's behavior matched Intel's specification before, but this was
      changed by commit b3baa152. This patch
      restores the behavior documented by Intel when cpuid_xlevel2 is 0.
      
      The existing behavior when cpuid_xlevel2 is set (falling back to
      level=cpuid_xlevel) is being kept, as I couldn't find any public
      documentation on the CPUID 0xC0000000 function range on Centaur CPUs.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      57f26ae7
  4. 19 12月, 2012 5 次提交
  5. 08 12月, 2012 1 次提交
  6. 06 12月, 2012 3 次提交
  7. 27 11月, 2012 2 次提交
  8. 26 11月, 2012 1 次提交
  9. 15 11月, 2012 3 次提交
  10. 03 11月, 2012 1 次提交
  11. 31 10月, 2012 6 次提交