1. 14 10月, 2010 1 次提交
    • J
      cpu: Fix vendor for recent CPU models · ac7afbeb
      Jiri Denemark 提交于
      Recent CPU models were specified using invalid vendor element
      <vendor>NAME</vendor>, which was silently ignored due to a bug in the
      code which was parsing it.
      ac7afbeb
  2. 13 10月, 2010 1 次提交
    • D
      Enable support for nested SVM · f98a6cd6
      Daniel P. Berrange 提交于
      This enables support for nested SVM using the regular CPU
      model/features block. If the CPU model or features include
      'svm', then the '-enable-nesting' flag will be added to the
      QEMU command line. Latest out of tree patches for nested
      'vmx', no longer require the '-enable-nesting' flag. They
      instead just look at the cpu features. Several of the models
      already include svm support, but QEMU was just masking out
      the svm bit silently. So this will enable SVM on such
      models
      
      * src/qemu/qemu_conf.h: flag for -enable-nesting
      * src/qemu/qemu_conf.c: Use -enable-nesting if VMX or SVM are in
        the CPUID
      * src/cpu/cpu.h, src/cpu/cpu.c: API to check for a named feature
      * src/cpu/cpu_x86.c: x86 impl of feature check
      * src/libvirt_private.syms: Add cpuHasFeature
      * src/qemuhelptest.c: Add nesting flag where required
      f98a6cd6
  3. 13 8月, 2010 1 次提交
  4. 13 7月, 2010 1 次提交
    • J
      cpuCompare: Fix comparison of two host CPUs · ac3daf08
      Jiri Denemark 提交于
      When a CPU to be compared with host CPU describes a host CPU instead of
      a guest CPU, the result is incorrect. This is because instead of
      treating additional features in host CPU description as required, they
      were treated as if they were mentioned with all possible policies at the
      same time.
      ac3daf08
  5. 07 7月, 2010 3 次提交
    • J
      cpu: Add support for CPU vendor · af53714f
      Jiri Denemark 提交于
      By specifying <vendor> element in CPU requirements a guest can be
      restricted to run only on CPUs by a given vendor. Host CPU vendor is
      also specified in capabilities XML.
      
      The vendor is checked when migrating a guest but it's not forced, i.e.,
      guests configured without <vendor> element can be freely migrated.
      af53714f
    • J
      cpuBaseline: Detect empty set of common features · d9332c23
      Jiri Denemark 提交于
      In case the set of CPUs has no features in common, report incompatible
      CPUs instead of returning the simplest CPU model with all features
      disabled.
      d9332c23
    • J
      cpuBaseline: Don't mess with the CPU returned by arch driver · 4e0f648f
      Jiri Denemark 提交于
      All features in the baseline CPU definition were always created with
      policy='require' even though an arch driver returned them with different
      policy settings.
      4e0f648f
  6. 17 5月, 2010 1 次提交
  7. 22 4月, 2010 2 次提交
    • J
      Use configured CPU model if possible · b9a2552d
      Jiri Denemark 提交于
      Adds ability to provide a preferred CPU model for CPUID data decoding.
      Such model would be considered as the best possible model (if it's
      supported by hypervisor) regardless on number of features which have to
      be added or removed for describing required CPU.
      b9a2552d
    • J
      Support removing features when converting data to CPU · 53c4f9fa
      Jiri Denemark 提交于
      So far, when CPUID data were converted into CPU model and features, the
      features can only be added to the model. As a result, when a guest asked
      for something like "qemu64,-svm" it would get a qemu32 plus a bunch of
      additional features instead.
      
      This patch adds support for removing feature from the base model.
      Selection algorithm remains the same: the best CPU model is the model
      which requires lowest number of features to be added/removed from it.
      53c4f9fa
  8. 08 4月, 2010 2 次提交
    • J
      Fix CPU comparison for x86 arch · e26997f6
      Jiri Denemark 提交于
      When comparing a CPU to host CPU, the result would be
      VIR_CPU_COMPARE_SUPERSET (or even VIR_CPU_COMPARE_INCOMPATIBLE if strict
      match was required) even though the two CPUs were identical.
      e26997f6
    • J
      Cleanup x86Compute() · ce4c82f1
      Jiri Denemark 提交于
      No change in semantics.
      ce4c82f1
  9. 27 3月, 2010 1 次提交
    • J
      cpuUpdate() for updating guest CPU according to host CPU · 661ae104
      Jiri Denemark 提交于
      Useful mainly for migration. cpuUpdate changes guest CPU requirements in
      the following way:
      
      - match == "strict" || match == "exact"
          - optional features which are supported by host CPU are changed into
            required features
          - optional features which are not supported by host CPU are disabled
          - all other features remain untouched
      - match == "minimum"
          - match is changed into "exact"
          - optional features and all features not mentioned in guest CPU
            specification which are supported by host CPU become required
            features
          - other optional features are disabled
          - all other features remain untouched
      
      This ensures that no feature will suddenly disappear from the guest
      after migration.
      661ae104
  10. 10 3月, 2010 1 次提交
  11. 02 3月, 2010 1 次提交
  12. 12 2月, 2010 2 次提交
  13. 11 2月, 2010 1 次提交
  14. 10 2月, 2010 1 次提交
    • D
      Remove virConnectPtr from CPU XML APIs · f430ddb6
      Daniel P. Berrange 提交于
      The virConnectPtr is no longer required for error reporting since
      that is recorded in a thread local. Remove use of virConnectPtr
      from all APIs in cpu_conf.{h,c} and update all callers to
      match
      f430ddb6
  15. 09 2月, 2010 2 次提交
  16. 02 2月, 2010 1 次提交
  17. 27 1月, 2010 1 次提交
  18. 19 1月, 2010 2 次提交
  19. 18 1月, 2010 1 次提交
    • J
      Use closest CPU model when decoding from CPUID · 322707ba
      Jiri Denemark 提交于
      Current implementation of x86Decode() used for CPUID -> model+features
      translation does not always select the closest CPU model. When walking
      through all models from cpu_map.xml the function considers a new
      candidate as a better choice than a previously selected candidate only
      if the new one is a superset of the old one. In case the new candidate
      is closer to host CPU but lacks some feature comparing to the old
      candidate, the function does not choose well.
      
      This patch changes the algorithm so that the closest model is always
      selected. That is, the model which requires the lowest number of
      additional features to describe host CPU.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      322707ba
  20. 22 12月, 2009 1 次提交
  21. 18 12月, 2009 1 次提交
    • J
      Adds CPU selection infrastructure · 7286882c
      Jiri Denemark 提交于
      Each driver supporting CPU selection must fill in host CPU capabilities.
      When filling them, drivers for hypervisors running on the same node as
      libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
      such as VMware, need to implement their own way of getting such data.
      Raw data can be decoded into virCPUDefPtr using cpuDecode() function.
      
      When implementing virConnectCompareCPU(), a hypervisor driver can just
      call cpuCompareXML() function with host CPU capabilities.
      
      For each guest for which a driver supports selecting CPU models, it must
      set the appropriate feature in guest's capabilities:
      
          virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)
      
      Actions needed when a domain is being created depend on whether the
      hypervisor understands raw CPU data (currently CPUID for i686, x86_64
      architectures) or symbolic names has to be used.
      
      Typical use by hypervisors which prefer CPUID (such as VMware and Xen):
      
      - convert guest CPU configuration from domain's XML into a set of raw
        data structures each representing one of the feature policies:
      
          cpuEncode(conn, architecture, guest_cpu_config,
                    &forced_data, &required_data, &optional_data,
                    &disabled_data, &forbidden_data)
      
      - create a mask or whatever the hypervisor expects to see and pass it
        to the hypervisor
      
      Typical use by hypervisors with symbolic model names (such as QEMU):
      
      - get raw CPU data for a computed guest CPU:
      
          cpuGuestData(conn, host_cpu, guest_cpu_config, &data)
      
      - decode raw data into virCPUDefPtr with a possible restriction on
        allowed model names:
      
          cpuDecode(conn, guest, data, n_allowed_models, allowed_models)
      
      - pass guest->model and guest->features to the hypervisor
      
      * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
        src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
        src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
      * configure.in: check for CPUID instruction
      * src/Makefile.am: glue the new files in
      * src/libvirt_private.syms: add new private symbols
      * po/POTFILES.in: add new cpu files containing translatable strings
      7286882c