1. 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
  2. 01 7月, 2006 1 次提交
  3. 28 6月, 2006 2 次提交
  4. 27 6月, 2006 1 次提交
  5. 21 6月, 2006 6 次提交
  6. 14 4月, 2006 1 次提交
  7. 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
  8. 11 1月, 2006 1 次提交
  9. 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