1. 05 10月, 2006 4 次提交
    • A
      [POWERPC] spufs: add infrastructure for finding elf objects · 86767277
      Arnd Bergmann 提交于
      This adds an 'object-id' file that the spe library can
      use to store a pointer to its ELF object. This was
      originally meant for use by oprofile, but is now
      also used by the GNU debugger, if available.
      
      In order for oprofile to find the location in an spu-elf
      binary where an event counter triggered, we need a way
      to identify the binary in the first place.
      
      Unfortunately, that binary itself can be embedded in a
      powerpc ELF binary. Since we can assume it is mapped into
      the effective address space of the running process,
      have that one write the pointer value into a new spufs
      file.
      
      When a context switch occurs, pass the user value to
      the profiler so that can look at the mapped file (with
      some care).
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      86767277
    • A
      [POWERPC] spufs: Add infrastructure needed for gang scheduling · 6263203e
      Arnd Bergmann 提交于
      Add the concept of a gang to spufs as a new type of object.
      So far, this has no impact whatsover on scheduling, but makes
      it possible to add that later.
      
      A new type of object in spufs is now a spu_gang. It is created
      with the spu_create system call with the flags argument set
      to SPU_CREATE_GANG (0x2). Inside of a spu_gang, it
      is then possible to create spu_context objects, which until
      now was only possible at the root of spufs.
      
      There is a new member in struct spu_context pointing to
      the spu_gang it belongs to, if any. The spu_gang maintains
      a list of spu_context structures that are its children.
      This information can then be used in the scheduler in the
      future.
      
      There is still a bug that needs to be resolved in this
      basic infrastructure regarding the order in which objects
      are removed. When the spu_gang file descriptor is closed
      before the spu_context descriptors, we leak the dentry
      and inode for the gang. Any ideas how to cleanly solve
      this are appreciated.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6263203e
    • A
      [POWERPC] spufs: implement error event delivery to user space · 9add11da
      Arnd Bergmann 提交于
      This tries to fix spufs so we have an interface closer to what is
      specified in the man page for events returned in the third argument of
      spu_run.
      
      Fortunately, libspe has never been using the returned contents of that
      register, as they were the same as the return code of spu_run (duh!).
      
      Unlike the specification that we never implemented correctly, we now
      require a SPU_CREATE_EVENTS_ENABLED flag passed to spu_create, in
      order to get the new behavior. When this flag is not passed, spu_run
      will simply ignore the third argument now.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      9add11da
    • M
      [POWERPC] spufs: scheduler support for NUMA. · a68cf983
      Mark Nutter 提交于
      This patch adds NUMA support to the the spufs scheduler.
      
      The new arch/powerpc/platforms/cell/spufs/sched.c is greatly
      simplified, in an attempt to reduce complexity while adding
      support for NUMA scheduler domains.  SPUs are allocated starting
      from the calling thread's node, moving to others as supported by
      current->cpus_allowed.  Preemption is gone as it was buggy, but
      should be re-enabled in another patch when stable.
      
      The new arch/powerpc/platforms/cell/spu_base.c maintains idle
      lists on a per-node basis, and allows caller to specify which
      node(s) an SPU should be allocated from, while passing -1 tells
      spu_alloc() that any node is allowed.
      
      Since the patch removes the currently implemented preemptive
      scheduling, it is technically a regression, but practically
      all users have since migrated to this version, as it is
      part of the IBM SDK and the yellowdog distribution, so there
      is not much point holding it back while the new preemptive
      scheduling patch gets delayed further.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a68cf983
  2. 31 7月, 2006 1 次提交
  3. 03 7月, 2006 1 次提交
    • B
      [POWERPC] Add new interrupt mapping core and change platforms to use it · 0ebfff14
      Benjamin Herrenschmidt 提交于
      This adds the new irq remapper core and removes the old one.  Because
      there are some fundamental conflicts with the old code, like the value
      of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
      etc..., this commit also changes the relevant platform and driver code
      over to use the new remapper (so as not to cause difficulties later
      in bisecting).
      
      This patch removes the old pre-parsing of the open firmware interrupt
      tree along with all the bogus assumptions it made to try to renumber
      interrupts according to the platform. This is all to be handled by the
      new code now.
      
      For the pSeries XICS interrupt controller, a single remapper host is
      created for the whole machine regardless of how many interrupt
      presentation and source controllers are found, and it's set to match
      any device node that isn't a 8259.  That works fine on pSeries and
      avoids having to deal with some of the complexities of split source
      controllers vs. presentation controllers in the pSeries device trees.
      
      The powerpc i8259 PIC driver now always requests the legacy interrupt
      range. It also has the feature of being able to match any device node
      (including NULL) if passed no device node as an input. That will help
      porting over platforms with broken device-trees like Pegasos who don't
      have a proper interrupt tree.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0ebfff14
  4. 21 6月, 2006 3 次提交
  5. 02 5月, 2006 1 次提交
  6. 26 4月, 2006 1 次提交
  7. 27 3月, 2006 3 次提交
    • M
      [PATCH] spufs: enable SPE problem state MMIO access. · 6df10a82
      Mark Nutter 提交于
      This patch is layered on top of CONFIG_SPARSEMEM
      and is patterned after direct mapping of LS.
      
      This patch allows mmap() of the following regions:
      "mfc", which represents the area from [0x3000 - 0x3fff];
      "cntl", which represents the area from [0x4000 - 0x4fff];
      "signal1" which begins at offset 0x14000; "signal2" which
      begins at offset 0x1c000.
      
      The signal1 & signal2 files may be mmap()'d by regular user
      processes.  The cntl and mfc file, on the other hand, may
      only be accessed if the owning process has CAP_SYS_RAWIO,
      because they have the potential to confuse the kernel
      with regard to parallel access to the same files with
      regular file operations: the kernel always holds a spinlock
      when accessing registers in these areas to serialize them,
      which can not be guaranteed with user mmaps,
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6df10a82
    • 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
    • A
      [PATCH] spufs: allow SPU code to do syscalls · 2dd14934
      Arnd Bergmann 提交于
      An SPU does not have a way to implement system calls
      itself, but it can create intercepts to the kernel.
      
      This patch uses the method defined by the JSRE interface
      for C99 host library calls from an SPU to implement
      Linux system calls. It uses the reserved SPU stop code
      0x2104 for this, using the structure layout and syscall
      numbers for ppc64-linux.
      
      I'm still undecided wether it is better to have a list
      of allowed syscalls or a list of forbidden syscalls,
      since we can't allow an SPU to call all syscalls that
      are defined for ppc64-linux.
      
      This patch implements the easier choice of them, with a
      blacklist that only prevents an SPU from calling anything
      that interacts with its own execution, e.g fork, execve,
      clone, vfork, exit, spu_run and spu_create and everything
      that deals with signals.
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2dd14934
  8. 09 1月, 2006 10 次提交
    • A
      [PATCH] spufs: set irq affinity for running threads · 2fb9d206
      Arnd Bergmann 提交于
      For far, all SPU triggered interrupts always end up on
      the first SMT thread, which is a bad solution.
      
      This patch implements setting the affinity to the
      CPU that was running last when entering execution on
      an SPU. This should result in a significant reduction
      in IPI calls and better cache locality for SPE thread
      specific data.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2fb9d206
    • A
      [PATCH] spufs: fix allocation on 64k pages · aeb01377
      Arnd Bergmann 提交于
      The size of the local store is architecture defined
      and independent from the page size, so it should
      not be defined in terms of pages in the first place.
      
      This mistake broke a few places when building for
      64kb pages.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      aeb01377
    • 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] powerpc: sanitize header files for user space includes · 88ced031
      Arnd Bergmann 提交于
      include/asm-ppc/ had #ifdef __KERNEL__ in all header files that
      are not meant for use by user space, include/asm-powerpc does
      not have this yet.
      
      This patch gets us a lot closer there. There are a few cases
      where I was not sure, so I left them out. I have verified
      that no CONFIG_* symbols are used outside of __KERNEL__
      any more and that there are no obvious compile errors when
      including any of the headers in user space libraries.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      88ced031
    • A
      [PATCH] spufs: Improved SPU preemptability [part 2]. · 2a911f0b
      Arnd Bergmann 提交于
      This patch reduces lock complexity of SPU scheduler, particularly
      for involuntary preemptive switches.  As a result the new code
      does a better job of mapping the highest priority tasks to SPUs.
      
      Lock complexity is reduced by using the system default workqueue
      to perform involuntary saves.  In this way we avoid nasty lock
      ordering problems that the previous code had.  A "minimum timeslice"
      for SPU contexts is also introduced.  The intent here is to avoid
      thrashing.
      
      While the new scheduler does a better job at prioritization it
      still does nothing for fairness.
      
      From: Mark Nutter <mnutter@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2a911f0b
    • A
      [PATCH] spufs: Improved SPU preemptability. · 5110459f
      Arnd Bergmann 提交于
      This patch makes it easier to preempt an SPU context by
      having the scheduler hold ctx->state_sema for much shorter
      periods of time.
      
      As part of this restructuring, the control logic for the "run"
      operation is moved from arch/ppc64/kernel/spu_base.c to
      fs/spufs/file.c.  Of course the base retains "bottom half"
      handlers for class{0,1} irqs.  The new run loop will re-acquire
      an SPU if preempted.
      
      From: Mark Nutter <mnutter@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      5110459f
    • 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] 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
    • A
      [PATCH] spufs: The SPU file system, base · 67207b96
      Arnd Bergmann 提交于
      This is the current version of the spu file system, used
      for driving SPEs on the Cell Broadband Engine.
      
      This release is almost identical to the version for the
      2.6.14 kernel posted earlier, which is available as part
      of the Cell BE Linux distribution from
      http://www.bsc.es/projects/deepcomputing/linuxoncell/.
      
      The first patch provides all the interfaces for running
      spu application, but does not have any support for
      debugging SPU tasks or for scheduling. Both these
      functionalities are added in the subsequent patches.
      
      See Documentation/filesystems/spufs.txt on how to use
      spufs.
      Signed-off-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      67207b96