1. 21 7月, 2007 3 次提交
  2. 03 7月, 2007 2 次提交
  3. 09 5月, 2007 2 次提交
  4. 24 4月, 2007 1 次提交
    • A
      [POWERPC] spufs: make spu page faults not block scheduling · 57dace23
      Arnd Bergmann 提交于
      Until now, we have always entered the spu page fault handler
      with a mutex for the spu context held. This has multiple
      bad side-effects:
      - it becomes impossible to suspend the context during
        page faults
      - if an spu program attempts to access its own mmio
        areas through DMA, we get an immediate livelock when
        the nopage function tries to acquire the same mutex
      
      This patch makes the page fault logic operate on a
      struct spu_context instead of a struct spu, and moves it
      from spu_base.c to a new file fault.c inside of spufs.
      
      We now also need to copy the dar and dsisr contents
      of the last fault into the saved context to have it
      accessible in case we schedule out the context before
      activating the page fault handler.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      57dace23
  5. 10 3月, 2007 1 次提交
    • B
      [POWERPC] Fix spu SLB invalidations · 94b2a439
      Benjamin Herrenschmidt 提交于
      The SPU code doesn't properly invalidate SPUs SLBs when necessary,
      for example when changing a segment size from the hugetlbfs code. In
      addition, it saves and restores the SLB content on context switches
      which makes it harder to properly handle those invalidations.
      
      This patch removes the saving & restoring for now, something more
      efficient might be found later on. It also adds a spu_flush_all_slbs(mm)
      that can be used by the core mm code to flush the SLBs of all SPEs that
      are running a given mm at the time of the flush.
      
      In order to do that, it adds a spinlock to the list of all SPEs and move
      some bits & pieces from spufs to spu_base.c
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      94b2a439
  6. 25 10月, 2006 3 次提交
  7. 05 10月, 2006 1 次提交
    • H
      [POWERPC] spufs: fix context switch during page fault · 28347bce
      HyeonSeung Jang 提交于
      For better explanation, I break down the page fault handling into steps:
      
      1) There is a page fault caused by DMA operation initiated by SPU and
      DMA is suspended.
      
      2) The interrupt handler 'spu_irq_class_1()/__spu_trap_data_map()' is
      called and it just wakes up the sleeping spe-manager thread.
      
      3) by PPE scheduler, the corresponding bottom half,
      spu_irq_class_1_bottom() is called in process context and DMA is
      restarted.
      
      There can be a quite large time gap between 2) and 3) and I found
      the following problem:
      
      Between 2) and 3) If the context becomes unbound, 3) is not executed
      because when the spe-manager thread is awaken, the context is already
      saved. (This situation can happen, for example, when a high priority spe
      thread newly started in that time gap)
      
      But the actual problem is that the corresponding SPU context does not
      work even if it is bound again to a SPU.
      
      Besides I can see the following warning in mambo simulator when the
      context becomes
      unbound(in save_mfc_cmd()), i.e. when unbind() is called for the
      context after step 2) before 3) :
      
      'WARNING: 61392752237: SPE2: MFC_CMD_QUEUE channel count of 15 is
      inconsistent with number of available DMA queue entries of 16'
      
      After I go through available documents, I found that the problem is
      because the suspended DMA is not restarted when it is bound again.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      28347bce
  8. 01 7月, 2006 1 次提交
  9. 28 6月, 2006 2 次提交
  10. 27 6月, 2006 1 次提交
  11. 21 6月, 2006 6 次提交
  12. 14 4月, 2006 1 次提交
  13. 27 3月, 2006 1 次提交
    • A
      [PATCH] spufs: implement mfc access for PPE-side DMA · a33a7d73
      Arnd Bergmann 提交于
      This patch adds a new file called 'mfc' to each spufs directory.
      The file accepts DMA commands that are a subset of what would
      be legal DMA commands for problem state register access. Upon
      reading the file, a bitmask is returned with the completed
      tag groups set.
      
      The file is meant to be used from an abstraction in libspe
      that is added by a different patch.
      
      From the kernel perspective, this means a process can now
      offload a memory copy from or into an SPE local store
      without having to run code on the SPE itself.
      
      The transfer will only be performed while the SPE is owned
      by one thread that is waiting in the spu_run system call
      and the data will be transferred into that thread's
      address space, independent of which thread started the
      transfer.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a33a7d73
  14. 11 1月, 2006 1 次提交
  15. 09 1月, 2006 6 次提交
    • A
      [PATCH] spufs: abstract priv1 register access. · f0831acc
      Arnd Bergmann 提交于
      In a hypervisor based setup, direct access to the first
      priviledged register space can typically not be allowed
      to the kernel and has to be implemented through hypervisor
      calls.
      
      As suggested by Masato Noguchi, let's abstract the register
      access trough a number of function calls. Since there is
      currently no public specification of actual hypervisor
      calls to implement this, I only provide a place that
      makes it easier to hook into.
      
      Cc: Masato Noguchi <Masato.Noguchi@jp.sony.com>
      Cc: Geoff Levand <geoff.levand@am.sony.com>
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f0831acc
    • A
      [PATCH] spufs: clean up use of bitops · 8837d921
      Arnd Bergmann 提交于
      checking bits manually might not be synchonized with
      the use of set_bit/clear_bit. Make sure we always use
      the correct bitops by removing the unnecessary
      identifiers.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8837d921
    • A
      [PATCH] spufs: fix mailbox polling · 3a843d7c
      Arnd Bergmann 提交于
      Handling mailbox interrupts was broken in multiple respects,
      the combination of which was hiding the bugs most of the time.
      
      - The ibox interrupt mask was open initially even though there
        are no waiters on a newly created SPU.
      
      - Acknowledging the mailbox interrupt did not work because
        it is level triggered and the mailbox data is never retrieved
        from inside the interrupt handler.
      
      - The interrupt handler delivered interrupts with a disabled
        mask if another interrupt is triggered for the same class
        but a different mask.
      
      - The poll function did not enable the interrupt if it had not
        been enabled, so we might run into the poll timeout if none of
        the other bugs saved us and no signal was delivered.
      
      We probably still have a similar problem with blocking
      read/write on mailbox files, but that will result in extra
      wakeup in the worst case, not in incorrect behaviour.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3a843d7c
    • A
      [PATCH] spufs: cooperative scheduler support · 8b3d6663
      Arnd Bergmann 提交于
      This adds a scheduler for SPUs to make it possible to use
      more logical SPUs than physical ones are present in the
      system.
      
      Currently, there is no support for preempting a running
      SPU thread, they have to leave the SPU by either triggering
      an event on the SPU that causes it to return to the
      owning thread or by sending a signal to it.
      
      This patch also adds operations that enable accessing an SPU
      in either runnable or saved state. We use an RW semaphore
      to protect the state of the SPU from changing underneath
      us, while we are holding it readable. In order to change
      the state, it is acquired writeable and a context save
      or restore is executed before downgrading the semaphore
      to read-only.
      
      From: Mark Nutter <mnutter@us.ibm.com>,
            Uli Weigand <Ulrich.Weigand@de.ibm.com>
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8b3d6663
    • M
      [PATCH] kernel-side context switch code for spufs · 7c038749
      Mark Nutter 提交于
      This adds the code needed to perform a context switch from
      spufs, following the recommended 76-step sequence.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      7c038749
    • M
      [PATCH] spufs: switchable spu contexts · 5473af04
      Mark Nutter 提交于
      Add some infrastructure for saving and restoring the context of an
      SPE. This patch creates a new structure that can hold the whole
      state of a physical SPE in memory. It also contains code that
      avoids races during the context switch and the binary code that
      is loaded to the SPU in order to access its registers.
      
      The actual PPE- and SPE-side context switch code are two separate
      patches.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      5473af04