1. 21 Dec, 2007 4 commits
    • Jeremy Kerr's avatar
      [POWERPC] spufs: move fault, lscsa_alloc and switch code to spufs module · 7cd58e43
      Jeremy Kerr authored
      Currently, part of the spufs code (switch.o, lscsa_alloc.o and fault.o)
      is compiled directly into the kernel.
      
      This change moves these components of spufs into the kernel.
      
      The lscsa and switch objects are fairly straightforward to move in.
      
      For the fault.o module, we split the fault-handling code into two
      parts: a/p/p/c/spu_fault.c and a/p/p/c/spufs/fault.c. The former is for
      the in-kernel spu_handle_mm_fault function, and we move the rest of the
      fault-handling code into spufs.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      7cd58e43
    • Julio M. Merino Vidal's avatar
      [POWERPC] spufs: fix typos in sched.c comments · 9b1d21f8
      Julio M. Merino Vidal authored
      Fix a few typos in the spufs scheduler comments
      Signed-off-by: default avatarJulio M. Merino Vidal <jmerino@ac.upc.edu>
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      9b1d21f8
    • Masato Noguchi's avatar
      [POWERPC] cell: wrap master run control bit · c25620d7
      Masato Noguchi authored
      Add platform specific SPU run control routines to the spufs.  The current
      spufs implementation uses the SPU master run control bit (MFC_SR1[S]) to
      control SPE execution, but the PS3 hypervisor does not support the use of
      this feature.
      
      This change adds the run control wrapper routies spu_enable_spu() and
      spu_disable_spu().  The bare metal routines use the master run control
      bit, and the PS3 specific routines use the priv2 run control register.
      
      An outstanding enhancement for the PS3 would be to add a guard to check
      for incorrect access to the spu problem state when the spu context is
      disabled.  This check could be implemented with a flag added to the spu
      context that would inhibit mapping problem state pages, and a routine
      to unmap spu problem state pages.  When the spu is enabled with
      ps3_enable_spu() the flag would be set allowing pages to be mapped,
      and when the spu is disabled with ps3_disable_spu() the flag would be
      cleared and mapped problem state pages would be unmapped.
      Signed-off-by: default avatarMasato Noguchi <Masato.Noguchi@jp.sony.com>
      Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      c25620d7
    • Emil Medve's avatar
      [POWERPC] Optimize counting distinct entries in the relocation sections · eda09fbd
      Emil Medve authored
      When a module has relocation sections with tens of thousands of
      entries, counting the distinct/unique entries only (i.e. no
      duplicates) at load time can take tens of seconds and up to minutes.
      The sore point is the count_relocs() function which is called as part
      of the architecture specific module loading processing path:
      
      	-> load_module()			generic
      	   -> module_frob_arch_sections()	arch specific
      	      -> get_plt_size()		32-bit
      	      -> get_stubs_size()	64-bit
      		 -> count_relocs()
      
      Here count_relocs is being called to find out how many distinct
      targets of R_PPC_REL24 relocations there are, since each distinct
      target needs a PLT entry or a stub created for it.
      
      The previous counting algorithm has O(n^2) complexity.  Basically two
      solutions were proposed on the e-mail list: a hash based approach and
      a sort based approach.
      
      The hash based approach is the fastest (O(n)) but the has it needs
      additional memory and for certain corner cases it could take lots of
      memory due to the degeneration of the hash.  One such proposal was
      submitted here:
      
      http://ozlabs.org/pipermail/linuxppc-dev/2007-June/037641.html
      
      The sort based approach is slower (O(n * log n + n)) but if the
      sorting is done "in place" it doesn't need additional memory.
      This has O(n + n * log n) complexity with no additional memory
      requirements.
      
      This commit implements the in-place sort option.
      Signed-off-by: default avatarEmil Medve <Emilian.Medve@Freescale.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      eda09fbd
  2. 20 Dec, 2007 36 commits