1. 05 4月, 2016 1 次提交
  2. 24 3月, 2016 6 次提交
  3. 16 3月, 2016 2 次提交
  4. 23 2月, 2016 1 次提交
  5. 01 2月, 2016 1 次提交
    • J
      target-ppc: mcrfs should always update FEX/VX and only clear exception bits · d1277156
      James Clarke 提交于
      Here is the description of the mcrfs instruction from the PowerPC Architecture
      Book, Version 2.02, Book I: PowerPC User Instruction Set Architecture
      (http://www.ibm.com/developerworks/systems/library/es-archguide-v2.html), found
      on page 120:
      
          The contents of FPSCR field BFA are copied to Condition Register field BF.
          All exception bits copied are set to 0 in the FPSCR. If the FX bit is
          copied, it is set to 0 in the FPSCR.
      
          Special Registers Altered:
              CR field BF
              FX OX                        (if BFA=0)
              UX ZX XX VXSNAN              (if BFA=1)
              VXISI VXIDI VXZDZ VXIMZ      (if BFA=2)
              VXVC                         (if BFA=3)
              VXSOFT VXSQRT VXCVI          (if BFA=5)
      
      However, currently every bit in FPSCR field BFA is set to 0, including ones not
      on that list.
      
      This can be seen in the following simple C program:
      
          #include <fenv.h>
          #include <stdio.h>
      
          int main(int argc, char **argv) {
              int ret;
              ret = fegetround();
              printf("Current rounding: %d\n", ret);
              ret = fesetround(FE_UPWARD);
              printf("Setting to FE_UPWARD (%d): %d\n", FE_UPWARD, ret);
              ret = fegetround();
              printf("Current rounding: %d\n", ret);
              ret = fegetround();
              printf("Current rounding: %d\n", ret);
              return 0;
          }
      
      which gave the output (before this commit):
      
          Current rounding: 0
          Setting to FE_UPWARD (2): 0
          Current rounding: 2
          Current rounding: 0
      
      instead of (after this commit):
      
          Current rounding: 0
          Setting to FE_UPWARD (2): 0
          Current rounding: 2
          Current rounding: 2
      
      The relevant disassembly is in fegetround(), which, on my system, is:
      
          __GI___fegetround:
          <+0>:   mcrfs  cr7, cr7
          <+4>:   mfcr   r3
          <+8>:   clrldi r3, r3, 62
          <+12>:  blr
      
      What happens is that, the first time fegetround() is called, FPSCR field 7 is
      retrieved. However, because of the bug in mcrfs, the entirety of field 7 is set
      to 0, which includes the rounding mode.
      
      There are other issues this will fix, such as condition flags not persisting
      when they should if read, and if you were to read a specific field with some
      exception bits set, but no others were set in the entire register, then the
      bits would be cleared correctly, but FEX/VX would not be updated to 0 as they
      should be.
      Signed-off-by: NJames Clarke <jrtc27@jrtc27.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d1277156
  6. 30 1月, 2016 4 次提交
  7. 30 11月, 2015 1 次提交
  8. 11 11月, 2015 1 次提交
  9. 23 10月, 2015 2 次提交
  10. 07 10月, 2015 1 次提交
  11. 25 9月, 2015 1 次提交
  12. 11 9月, 2015 1 次提交
  13. 09 7月, 2015 1 次提交
  14. 28 4月, 2015 1 次提交
    • S
      Convert (ffs(val) - 1) to ctz32(val) · 786a4ea8
      Stefan Hajnoczi 提交于
      This commit was generated mechanically by coccinelle from the following
      semantic patch:
      
      @@
      expression val;
      @@
      - (ffs(val) - 1)
      + ctz32(val)
      
      The call sites have been audited to ensure the ffs(0) - 1 == -1 case
      never occurs (due to input validation, asserts, etc).  Therefore we
      don't need to worry about the fact that ctz32(0) == 32.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1427124571-28598-5-git-send-email-stefanha@redhat.com
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      786a4ea8
  15. 11 3月, 2015 1 次提交
    • 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
  16. 09 3月, 2015 2 次提交
    • 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
    • A
      target-ppc: Use right page size with hash table lookup · ad3e67d0
      Aneesh Kumar K.V 提交于
      We look at two sizes specified in ISA (4K, 64K). If not found matching,
      we consider it 16MB.
      
      Without this patch we would fail to lookup address above 16MB range.
      Below 16MB happened to work before because the kernel have a liner
      mapping and we always looked up hash for 0xc000000000000000. The
      actual real address was computed by using the 16MB offset
      with the real address found with the above hash.
      
      Without Fix:
      (gdb) x/16x 0xc000000001000000
      0xc000000001000000 <list_entries+453208>:       Cannot access memory at address 0xc000000001000000
      (gdb)
      
      With Fix:
      (gdb)  x/16x 0xc000000001000000
      0xc000000001000000 <list_entries+453208>:       0x00000000      0x00000000      0x00000000      0x00000000
      0xc000000001000010 <list_entries+453224>:       0x00000000      0x00000000      0x00000000      0x00000000
      0xc000000001000020 <list_entries+453240>:       0x00000000      0x00000000      0x00000000      0x00000000
      0xc000000001000030 <list_entries+453256>:       0x00000000      0x00000000      0x00000000      0x00000000
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ad3e67d0
  17. 20 1月, 2015 1 次提交
    • P
      exec.c: Drop TARGET_HAS_ICE define and checks · ec53b45b
      Peter Maydell 提交于
      The TARGET_HAS_ICE #define is intended to indicate whether a target-*
      guest CPU implementation supports the breakpoint handling. However,
      all our guest CPUs have that support (the only two which do not
      define TARGET_HAS_ICE are unicore32 and openrisc, and in both those
      cases the bp support is present and the lack of the #define is just
      a bug). So remove the #define entirely: all new guest CPU support
      should include breakpoint handling as part of the basic implementation.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Message-id: 1420484960-32365-1-git-send-email-peter.maydell@linaro.org
      ec53b45b
  18. 07 1月, 2015 3 次提交
  19. 23 12月, 2014 1 次提交
  20. 05 11月, 2014 2 次提交
  21. 26 9月, 2014 1 次提交
  22. 30 6月, 2014 1 次提交
  23. 27 6月, 2014 1 次提交
  24. 16 6月, 2014 3 次提交