1. 16 3月, 2016 2 次提交
  2. 09 2月, 2016 2 次提交
    • E
      qom: Swap 'name' next to visitor in ObjectPropertyAccessor · d7bce999
      Eric Blake 提交于
      Similar to the previous patch, it's nice to have all functions
      in the tree that involve a visitor and a name for conversion to
      or from QAPI to consistently stick the 'name' parameter next
      to the Visitor parameter.
      
      Done by manually changing include/qom/object.h and qom/object.c,
      then running this Coccinelle script and touching up the fallout
      (Coccinelle insisted on adding some trailing whitespace).
      
          @ rule1 @
          identifier fn;
          typedef Object, Visitor, Error;
          identifier obj, v, opaque, name, errp;
          @@
           void fn
          - (Object *obj, Visitor *v, void *opaque, const char *name,
          + (Object *obj, Visitor *v, const char *name, void *opaque,
             Error **errp) { ... }
      
          @@
          identifier rule1.fn;
          expression obj, v, opaque, name, errp;
          @@
           fn(obj, v,
          -   opaque, name,
          +   name, opaque,
              errp)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d7bce999
    • E
      qapi: Swap visit_* arguments for consistent 'name' placement · 51e72bc1
      Eric Blake 提交于
      JSON uses "name":value, but many of our visitor interfaces were
      called with visit_type_FOO(v, &value, name, errp).  This can be
      a bit confusing to have to mentally swap the parameter order to
      match JSON order.  It's particularly bad for visit_start_struct(),
      where the 'name' parameter is smack in the middle of the
      otherwise-related group of 'obj, kind, size' parameters! It's
      time to do a global swap of the parameter ordering, so that the
      'name' parameter is always immediately after the Visitor argument.
      
      Additional reason in favor of the swap: the existing include/qjson.h
      prefers listing 'name' first in json_prop_*(), and I have plans to
      unify that file with the qapi visitors; listing 'name' first in
      qapi will minimize churn to the (admittedly few) qjson.h clients.
      
      Later patches will then fix docs, object.h, visitor-impl.h, and
      those clients to match.
      
      Done by first patching scripts/qapi*.py by hand to make generated
      files do what I want, then by running the following Coccinelle
      script to affect the rest of the code base:
       $ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
      I then had to apply some touchups (Coccinelle insisted on TAB
      indentation in visitor.h, and botched the signature of
      visit_type_enum() by rewriting 'const char *const strings[]' to
      the syntactically invalid 'const char*const[] strings').  The
      movement of parameters is sufficient to provoke compiler errors
      if any callers were missed.
      
          // Part 1: Swap declaration order
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_start_struct
          -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type bool, TV, T1;
          identifier ARG1;
          @@
           bool visit_optional
          -(TV v, T1 ARG1, const char *name)
          +(TV v, const char *name, T1 ARG1)
           { ... }
      
          @@
          type TV, TErr, TObj, T1;
          identifier OBJ, ARG1;
          @@
           void visit_get_next_type
          -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_type_enum
          -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj;
          identifier OBJ;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
           void VISIT_TYPE
          -(TV v, TObj OBJ, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, TErr errp)
           { ... }
      
          // Part 2: swap caller order
          @@
          expression V, NAME, OBJ, ARG1, ARG2, ERR;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
          (
          -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
          +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -visit_optional(V, ARG1, NAME)
          +visit_optional(V, NAME, ARG1)
          |
          -visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
          +visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
          |
          -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
          +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -VISIT_TYPE(V, OBJ, NAME, ERR)
          +VISIT_TYPE(V, NAME, OBJ, ERR)
          )
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      51e72bc1
  3. 30 1月, 2016 7 次提交
  4. 29 1月, 2016 1 次提交
    • P
      ppc: Clean up includes · 0d75590d
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-6-git-send-email-peter.maydell@linaro.org
      0d75590d
  5. 27 1月, 2016 1 次提交
  6. 15 1月, 2016 1 次提交
  7. 06 11月, 2015 1 次提交
  8. 23 10月, 2015 2 次提交
  9. 11 9月, 2015 1 次提交
  10. 09 7月, 2015 3 次提交
  11. 09 3月, 2015 1 次提交
    • C
      PPC: Introduce the Virtual Time Base (VTB) SPR register · 3ba55e39
      Cyril Bur 提交于
      This patch adds basic support for the VTB.
      
      PowerISA:
      The Virtual Time Base (VTB) is a 64-bit incrementing counter.
      Virtual Time Base increments at the same rate as the Time Base until its value
      becomes 0xFFFF_FFFF_FFFF_FFFF (2 64 - 1); at the next increment its value
      becomes 0x0000_0000_0000_0000. There is no interrupt or other indication when
      this occurs.
      
      The operation of the Virtual Time Base has the following additional
      properties.
      1. Loading a GPR from the Virtual Time Base has no effect on the accuracy of
      the Virtual Time Base.
      2. Copying the contents of a GPR to the Virtual Time Base replaces the
      contents of the Virtual Time Base with the contents of the GPR.
      Signed-off-by: NCyril Bur <cyril.bur@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3ba55e39
  12. 07 1月, 2015 1 次提交
  13. 03 1月, 2015 1 次提交
  14. 23 12月, 2014 1 次提交
  15. 20 11月, 2014 1 次提交
  16. 05 11月, 2014 6 次提交
  17. 15 10月, 2014 2 次提交
  18. 26 9月, 2014 2 次提交
  19. 15 7月, 2014 1 次提交
    • A
      target-ppc: Fix number of threads per core limit · 063cac53
      Alexey Kardashevskiy 提交于
      The number of threads per core is different for POWER6/7/8 CPUs.
      Guest systems do not expect to see more threads per core than
      a specific CPU supports so we need to limit this number.
      This limit is implemented by ppc_get_compat_smt_threads().
      
      However it has a problem as it checks for PCR (Processor Compatibility
      Register) mask, 2.05 means 2 threads per core, 2.06 - 4 threads.
      For POWER8 one would expect PCR_COMPAT_2_07 bit set and
      ppc_get_compat_smt_threads() checking for it to return 8 threads
      per core. But the latest PowerISA spec now is 2.07 and there is
      no 2.07 compatibility mode defined, QEMU does not define it either
      (will be in PowerISA 2.08).
      
      Instead of relying on a PCR mask, this uses kvmppc_smt_threads()
      which returns the maximum supported threads number for KVM or
      1 for TCG.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      063cac53
  20. 08 7月, 2014 3 次提交
    • A
      target-ppc: Remove POWER7+ and POWER8E families · b60c6007
      Alexey Kardashevskiy 提交于
      POWER8E is architecturally equal to POWER8 and POWER7+ is equal to
      POWER7. Also no user space tool makes any difference for CPU node name
      in the device tree (such as PowerPC,POWER7@0 vs. PowerPC,POWER7+@0).
      So there is no point in emulating POWER7+ and POWER8E apart from POWER7
      and POWER8. Also, the previos patch implemented multiple PVR mask support
      per CPU class so POWER7 class now covers both POWER7 and POWER7+ CPUs,
      same is valid for POWER8/8E.
      
      This removes POWER7+ and POWER8E classes. This replaces references
      to POWER7P/POWER8E families with POWER7/POWER8 families.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b60c6007
    • A
      target-ppc: Add pvr_match() callback · 03ae4133
      Alexey Kardashevskiy 提交于
      So far it was enough to have a base PVR value and mask per CPU
      family such as POWER7 or POWER8. However there CPUs which are
      completely architecturally compatible but have different PVRs such
      as POWER7/POWER7+ and POWER8/POWER8E. For these CPUs, top 16 bits
      are CPU family and low 16 bits are the version. The families have
      PVR base values different enough so defining a mask which
      would cover both (or potentially more) CPUs within the family is
      not possible.
      
      This adds a pvr_match() callback to PowerPCCPUClass. The default
      handler simply compares PVR defined in the class.
      
      This implements ppc_pvr_match_power7/ppc_pvr_match_power8 callbacks
      for POWER7/8 families. These check for POWER7/POWER7+ and POWER8/POWER8E.
      
      This changes ppc_cpu_compare_class_pvr_mask() not to check masks but
      use the pvr_match() callback.
      
      Since all server CPUs use the same mask, this defines one mask
      value - CPU_POWERPC_POWER_SERVER_MASK - which is used everywhere now.
      This removes other mask definitions.
      
      This removes pvr_mask from PowerPCCPUClass as it is not used anymore.
      This removes pvr initialization for POWER7/8 families as it is not used
      to find the class, the pvr_match() callback is used instead.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      03ae4133
    • R
      target-ppc: Change default cpu for ppc64le-linux-user · a74029f6
      Richard Henderson 提交于
      The default, 970fx, doesn't support MSR_LE.  So even though we set LE in
      ppc_cpu_reset, it gets cleared again in hreg_store_msr.  Error out if a
      user-selected cpu model doesn't support LE.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      [agraf: switch to POWER7 as default for BE and LE]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a74029f6