1. 08 4月, 2011 1 次提交
  2. 02 4月, 2011 4 次提交
    • D
      Correct ppc popcntb logic, implement popcntw and popcntd · eaabeef2
      David Gibson 提交于
      qemu already includes support for the popcntb instruction introduced
      in POWER5 (although it doesn't actually allow you to choose POWER5).
      
      However, the logic is slightly incorrect: it will generate results
      truncated to 32-bits when the CPU is in 32-bit mode.  This is not
      normal for powerpc - generally arithmetic instructions on a 64-bit
      powerpc cpu will generate full 64 bit results, it's just that only the
      low 32 bits will be significant for condition codes.
      
      This patch corrects this nit, which actually simplifies the code slightly.
      
      In addition, this patch implements the popcntw and popcntd
      instructions added in POWER7, in preparation for allowing POWER7 as an
      emulated CPU.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      eaabeef2
    • D
      Implement missing parts of the logic for the POWER PURR · 3a7f009a
      David Gibson 提交于
      The PURR (Processor Utilization Resource Register) is a register found
      on recent POWER CPUs.  The guts of implementing it at least enough to
      get by are already present in qemu, however some of the helper
      functions needed to actually wire it up are missing.
      
      This patch adds the necessary glue, so that the PURR can be wired up
      when we implement newer POWER CPU targets which include it.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3a7f009a
    • D
      Implement PowerPC slbmfee and slbmfev instructions · efdef95f
      David Gibson 提交于
      For a 64-bit PowerPC target, qemu correctly implements translation
      through the segment lookaside buffer.  Likewise it supports the
      slbmte instruction which is used to load entries into the SLB.
      
      However, it does not emulate the slbmfee and slbmfev instructions
      which read SLB entries back into registers.  Because these are
      only occasionally used in guests (mostly for debugging) we get
      away with it.
      
      However, given the recent SLB cleanups, it becomes quite easy to
      implement these, and thereby allow, amongst other things, a guest
      Linux to use xmon's command to dump the SLB.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      efdef95f
    • D
      Clean up PowerPC SLB handling code · 81762d6d
      David Gibson 提交于
      Currently the SLB information when emulating a PowerPC 970 is
      storeed in a structure with the unhelpfully named fields 'tmp'
      and 'tmp64'.  While the layout in these fields does match the
      description of the SLB in the architecture document, it is not
      convenient either for looking up the SLB, or for emulating the
      slbmte instruction.
      
      This patch, therefore, reorganizes the SLB entry structure to be
      divided in the the "ESID related" and "VSID related" fields as
      they are divided in instructions accessing the SLB.
      
      In addition to making the code smaller and more readable, this will
      make it easier to implement for the 1TB segments used in more
      recent PowerPC chips.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      81762d6d
  3. 20 1月, 2011 2 次提交
  4. 06 1月, 2011 3 次提交
  5. 02 1月, 2011 1 次提交
  6. 14 10月, 2010 1 次提交
    • B
      ppc: avoid write only variables · 577f25a5
      Blue Swirl 提交于
      Compiling with GCC 4.6.0 20100925 produced warnings:
      /src/qemu/target-ppc/op_helper.c: In function 'helper_icbi':
      /src/qemu/target-ppc/op_helper.c:351:14: error: variable 'tmp' set but not used [-Werror=unused-but-set-variable]
      /src/qemu/target-ppc/op_helper.c: In function 'do_6xx_tlb':
      /src/qemu/target-ppc/op_helper.c:3805:28: error: variable 'EPN' set but not used [-Werror=unused-but-set-variable]
      /src/qemu/target-ppc/op_helper.c: In function 'do_74xx_tlb':
      /src/qemu/target-ppc/op_helper.c:3838:28: error: variable 'EPN' set but not used [-Werror=unused-but-set-variable]
      
      Fix by adding a dummy cast so that the variable is not unused. Delete tmp.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      577f25a5
  7. 06 10月, 2010 1 次提交
  8. 18 9月, 2010 1 次提交
  9. 14 7月, 2010 1 次提交
  10. 01 6月, 2010 1 次提交
    • T
      target-ppc: fix RFI by clearing some bits of MSR · c3d420ea
      Thomas Monjalon 提交于
      Since commit 2ada0ed7, "Return From Interrupt" is broken for PPC processors
      because some interrupt specifics bits of SRR1 are copied to MSR.
      
      SRR1 is a save of MSR during interrupt.
      During RFI, MSR must be restored from SRR1.
      But some bits of SRR1 are interrupt-specific and are not used for MSR saving.
      
      This is the specification (ISA 2.06) at chapter 6.4.3 (Interrupt Processing):
      "2. Bits 33:36 and 42:47 of SRR1 or HSRR1 are loaded with information specific
          to the interrupt type.
       3. Bits 0:32, 37:41, and 48:63 of SRR1 or HSRR1 are loaded with a copy of the
          corresponding bits of the MSR."
      
      Below is a representation of MSR bits which are not saved:
      0:15 16:31 32  33:36    37:41      42:47     48:63
      ——— | ——— | — X X X X — — — — — X X X X X X | ————
      0000 0000 |    7   |   8   |   3   |   F    | 0000
      
      History:
      In the initial Qemu implementation (e1833e1f), the mask 0x783F0000 was used for
      saving MSR in SRR1. But all the bits 32:47 were cleared during RFI restoring.
      This was wrong. The commit 2ada0ed7 explains that this breaks Altivec.
      Indeed, bit 38 (for Altivec support) must be saved and restored.
      The change of 2ada0ed7 was to restore all the bits of SRR1 to MSR.
      But it's also wrong.
      
      Explanation:
      As an example, let's see what's happening after a TLB miss.
      According to the e300 manual (E300CORERM table 5-6), the TLB miss interrupts
      set the bits 44-47 for KEY, I/D, WAY and S/L. These bits are specifics to the
      interrupt and must not be copied into MSR at the end of the interrupt.
      With the current implementation, a TLB miss overwrite bits POW, TGPR and ILE.
      
      Fix:
      It shouldn't be needed to filter-out bits on MSR saving when interrupt occurs.
      Specific bits overwrite MSR ones in SRR1.
      But at the end of interrupt (RFI), specifics bits must be cleared before
      restoring MSR from SRR1. The mask 0x783F0000 apply here.
      
      Discussion:
      The bits of the mask 0x783F0000 are cleared after an interrupt.
      I cannot find a specification which talks about this
      but I assume it is the truth since Linux can run this way.
      Maybe it's not perfect but it's better (works for e300).
      Signed-off-by: NThomas Monjalon <thomas@monjalon.net>
      Acked-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      c3d420ea
  11. 07 2月, 2010 1 次提交
  12. 14 1月, 2010 2 次提交
  13. 21 12月, 2009 3 次提交
  14. 02 10月, 2009 2 次提交
  15. 16 8月, 2009 2 次提交
  16. 04 8月, 2009 1 次提交
  17. 28 7月, 2009 1 次提交
  18. 17 7月, 2009 1 次提交
  19. 13 6月, 2009 1 次提交
  20. 13 5月, 2009 1 次提交
  21. 10 3月, 2009 1 次提交
  22. 08 3月, 2009 2 次提交
  23. 10 2月, 2009 6 次提交