1. 02 4月, 2011 9 次提交
    • D
      Parse SDR1 on mtspr instead of at translate time · bb593904
      David Gibson 提交于
      On ppc machines with hash table MMUs, the special purpose register SDR1
      contains both the base address of the encoded size (hashed) page tables.
      
      At present, we interpret the SDR1 value within the address translation
      path.  But because the encodings of the size for 32-bit and 64-bit are
      different this makes for a confusing branch on the MMU type with a bunch
      of curly shifts and masks in the middle of the translate path.
      
      This patch cleans things up by moving the interpretation on SDR1 into the
      helper function handling the write to the register.  This leaves a simple
      pre-sanitized base address and mask for the hash table in the CPUState
      structure which is easier to work with in the translation path.
      
      This makes the translation path more readable.  It addresses the FIXME
      comment currently in the mtsdr1 helper, by validating the SDR1 value during
      interpretation.  Finally it opens the way for emulating a pSeries-style
      partition where the hash table used for translation is not mapped into
      the guests's RAM.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      bb593904
    • D
      Clean up slb_lookup() function · 8500e3a9
      David Gibson 提交于
      The slb_lookup() function, used in the ppc translation path returns a
      number of slb entry fields in reference parameters.  However, only one
      of the two callers of slb_lookup() actually wants this information.
      
      This patch, therefore, makes slb_lookup() return a simple pointer to the
      located SLB entry (or NULL), and the caller which needs the fields can
      extract them itself.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8500e3a9
    • 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
      Add a hook to allow hypercalls to be emulated on PowerPC · d569956e
      David Gibson 提交于
      PowerPC and POWER chips since the POWER4 and 970 have a special
      hypervisor mode, and a corresponding form of the system call
      instruction which traps to the hypervisor.
      
      qemu currently has stub implementations of hypervisor mode.  That
      is, the outline is there to allow qemu to run a PowerPC hypervisor
      under emulation.  There are a number of details missing so this
      won't actually work at present, but the idea is there.
      
      What there is no provision at all, is for qemu to instead emulate
      the hypervisor itself.  That is to have hypercalls trap into qemu
      and their result be emulated from qemu, rather than running
      hypervisor code within the emulated system.
      
      Hypervisor hardware aware KVM implementations are in the works and
      it would  be useful for debugging and development to also allow
      full emulation of the same para-virtualized guests as such a KVM.
      
      Therefore, this patch adds a hook which will allow a machine to
      set up emulation of hypervisor calls.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d569956e
    • D
      Allow qemu_devtree_setprop() to take arbitrary values · c4897490
      David Gibson 提交于
      Currently qemu_devtree_setprop() expects the new property value to be
      given as a uint32_t *.  While property values consisting of u32s are
      common, in general they can have any bytestring value.
      
      Therefore, this patch alters the function to take a void * instead,
      allowing callers to easily give anything as the property value.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c4897490
    • 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
    • A
      target-ppc: ext32u instead of andi with constant · 17d9b3af
      Aurelien Jarno 提交于
      Cc: Alexander Graf <agraf@suse.de>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      17d9b3af
  2. 31 3月, 2011 2 次提交
  3. 29 3月, 2011 10 次提交
  4. 26 3月, 2011 4 次提交
  5. 25 3月, 2011 2 次提交
  6. 24 3月, 2011 2 次提交
  7. 23 3月, 2011 2 次提交
  8. 22 3月, 2011 9 次提交