1. 20 3月, 2015 2 次提交
    • E
      target-i386: Haswell-noTSX and Broadwell-noTSX · a356850b
      Eduardo Habkost 提交于
      With the Intel microcode update that removed HLE and RTM, there will be
      different kinds of Haswell and Broadwell CPUs out there: some that still
      have the HLE and RTM features, and some that don't have the HLE and RTM
      features. On both cases people may be willing to use the pc-*-2.3
      machine-types.
      
      So, to cover both cases, introduce Haswell-noTSX and Broadwell-noTSX CPU
      models, for hosts that have Haswell and Broadwell CPUs without TSX support.
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      a356850b
    • E
      Revert "target-i386: Disable HLE and RTM on Haswell & Broadwell" · 1ee91598
      Eduardo Habkost 提交于
      This reverts commit 13704e4c.
      
      With the Intel microcode update that removed HLE and RTM, there will be
      different kinds of Haswell and Broadwell CPUs out there: some that still
      have the HLE and RTM features, and some that don't have the HLE and RTM
      features. On both cases people may be willing to use the pc-*-2.3
      machine-types.
      
      So instead of making the CPU model results confusing by making it depend
      on the machine-type, keep HLE and RTM on the existing Haswell and
      Broadwell CPU models. The plan is to introduce "Haswell-noTSX" and
      "Broadwell-noTSX" CPU models later, for people who have CPUs that don't
      have TSX feature available.
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      1ee91598
  2. 17 3月, 2015 1 次提交
  3. 14 3月, 2015 1 次提交
    • R
      tcg: Change translator-side labels to a pointer · 42a268c2
      Richard Henderson 提交于
      This is improved type checking for the translators -- it's no longer
      possible to accidentally swap arguments to the branch functions.
      
      Note that the code generating backends still manipulate labels as int.
      
      With notable exceptions, the scope of the change is just a few lines
      for each target, so it's not worth building extra machinery to do this
      change in per-target increments.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Anthony Green <green@moxielogic.com>
      Cc: Jia Liu <proljc@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Reviewed-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      42a268c2
  4. 12 3月, 2015 2 次提交
  5. 11 3月, 2015 2 次提交
    • E
      cpu: Make cpu_init() return QOM CPUState object · 2994fd96
      Eduardo Habkost 提交于
      Instead of making cpu_init() return CPUArchState, return CPUState.
      
      Changes were made using the Coccinelle semantic patch below.
      
        @@
        typedef CPUState;
        identifier e;
        expression args;
        type CPUArchState;
        @@
        -   e =
        +   cpu =
                cpu_init(args);
        -   if (!e) {
        +   if (!cpu) {
                ...
            }
        -   cpu = ENV_GET_CPU(env);
        +   e = cpu->env_ptr;
      
        @@
        identifier new_env, new_cpu, env, cpu;
        type CPUArchState;
        expression args;
        @@
        -{
        -   CPUState *cpu = ENV_GET_CPU(env);
        -   CPUArchState *new_env = cpu_init(args);
        -   CPUState *new_cpu = ENV_GET_CPU(new_env);
        +{
        +   CPUState *cpu = ENV_GET_CPU(env);
        +   CPUState *new_cpu = cpu_init(args);
        +   CPUArchState *new_env = new_cpu->env_ptr;
            ...
        }
      
        @@
        identifier c, cpu_init_func, cpu_model;
        type StateType, CPUType;
        @@
        -static inline StateType* cpu_init(const char *cpu_model)
        -{
        -   CPUType *c = cpu_init_func(cpu_model);
        (
        -   if (c == NULL) {
        -       return NULL;
        -   }
        -   return &c->env;
        |
        -   if (c) {
        -       return &c->env;
        -   }
        -   return NULL;
        )
        -}
        +#define cpu_init(cpu_model) CPU(cpu_init_func(cpu_model))
      
        @@
        identifier cpu_init_func;
        identifier model;
        @@
        -#define cpu_init(model) (&cpu_init_func(model)->env)
        +#define cpu_init(model) CPU(cpu_init_func(model))
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Riku Voipio <riku.voipio@iki.fi>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Anthony Green <green@moxielogic.com>
      Cc: Jia Liu <proljc@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      [AF: Fixed up cpu_copy() manually]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      2994fd96
    • M
      target-i386: Clean up misuse of qdev_init() in realize method · 6e8e2651
      Markus Armbruster 提交于
      x86_cpu_apic_realize() calls qdev_init() to realize the APIC.
      qdev_init()'s error handling has unwanted side effects: it unparents
      the device, and it calls qerror_report_err().
      
      qerror_report_err() is always inappropriate in realize methods,
      because it doesn't return the Error object.  It either reports the
      error to stderr or the human monitor, or it stores it in the QMP
      monitor, where it makes the QMP command fail even though the realize
      method succeeded.
      
      Fortunately, qdev_init() can't actually fail here, because realize
      can't fail for any of the three possible APIC device models.
      
      Clean up by cutting out the qdev_init() middle-man: set property
      "realized" directly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      6e8e2651
  6. 10 3月, 2015 8 次提交
  7. 03 3月, 2015 1 次提交
  8. 26 2月, 2015 10 次提交
  9. 18 2月, 2015 1 次提交
  10. 13 2月, 2015 2 次提交
  11. 26 1月, 2015 3 次提交
    • E
      target-i386: Disable HLE and RTM on Haswell & Broadwell · 13704e4c
      Eduardo Habkost 提交于
      All Haswell CPUs and some Broadwell CPUs were updated by Intel to have
      the HLE and RTM features disabled. This will prevent
      "-cpu Haswell,enforce" and "-cpu Broadwell,enforce" from running out of
      the box on those CPUs.
      
      Disable those features by default on Broadwell and Haswell CPU models,
      starting on pc-*-2.3. Users who want to use those features can enable
      them explicitly on the command-line.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      13704e4c
    • P
      target-i386: make xmm_regs 512-bit wide · b7711471
      Paolo Bonzini 提交于
      Right now, the AVX512 registers are split in many different fields:
      xmm_regs for the low 128 bits of the first 16 registers, ymmh_regs
      for the next 128 bits of the same first 16 registers, zmmh_regs
      for the next 256 bits of the same first 16 registers, and finally
      hi16_zmm_regs for the full 512 bits of the second 16 bit registers.
      
      This makes it simple to move data in and out of the xsave region,
      but would be a nightmare for a hypothetical TCG implementation and
      leads to a proliferation of [XYZ]MM_[BWLSQD] macros.  Instead,
      this patch marshals data manually from the xsave region to a single
      32x512-bit array, simplifying the macro jungle and clarifying which
      bits are in which vmstate subsection.
      
      The migration format is unaffected.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b7711471
    • P
      target-i386: use vmstate_offset_sub_array for AVX registers · a03c3e90
      Paolo Bonzini 提交于
      After the next patch, each vmstate field will extract parts of a larger
      (32x512-bit) array, so we cannot check the vmstate field against the
      type of the array.
      
      While changing this, change the macros to accept the index of the first
      element (which will not be 0 for Hi16_ZMM_REGS) instead of the number
      of elements (which is always CPU_NB_REGS).
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a03c3e90
  12. 20 1月, 2015 2 次提交
  13. 14 1月, 2015 2 次提交
  14. 12 1月, 2015 1 次提交
  15. 03 1月, 2015 2 次提交