1. 02 3月, 2011 13 次提交
  2. 25 2月, 2011 1 次提交
  3. 24 2月, 2011 4 次提交
  4. 21 1月, 2011 3 次提交
  5. 18 12月, 2010 2 次提交
    • C
      arch/tile: handle rt_sigreturn() more cleanly · 81711cee
      Chris Metcalf 提交于
      The current tile rt_sigreturn() syscall pattern uses the common idiom
      of loading up pt_regs with all the saved registers from the time of
      the signal, then anticipating the fact that we will clobber the ABI
      "return value" register (r0) as we return from the syscall by setting
      the rt_sigreturn return value to whatever random value was in the pt_regs
      for r0.
      
      However, this breaks in our 64-bit kernel when running "compat" tasks,
      since we always sign-extend the "return value" register to properly
      handle returned pointers that are in the upper 2GB of the 32-bit compat
      address space.  Doing this to the sigreturn path then causes occasional
      random corruption of the 64-bit r0 register.
      
      Instead, we stop doing the crazy "load the return-value register"
      hack in sigreturn.  We already have some sigreturn-specific assembly
      code that we use to pass the pt_regs pointer to C code.  We extend that
      code to also set the link register to point to a spot a few instructions
      after the usual syscall return address so we don't clobber the saved r0.
      Now it no longer matters what the rt_sigreturn syscall returns, and the
      pt_regs structure can be cleanly and completely reloaded.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      81711cee
    • C
      arch/tile: handle CLONE_SETTLS in copy_thread(), not user space · bc4cf2bb
      Chris Metcalf 提交于
      Previously we were just setting up the "tp" register in the
      new task as started by clone() in libc.  However, this is not
      quite right, since in principle a signal might be delivered to
      the new task before it had its TLS set up.  (Of course, this race
      window still exists for resetting the libc getpid() cached value
      in the new task, in principle.  But in any case, we are now doing
      this exactly the way all other architectures do it.)
      
      This change is important for 2.6.37 since the tile glibc we will
      be submitting upstream will not set TLS in user space any more,
      so it will only work on a kernel that has this fix.  It should
      also be taken for 2.6.36.x in the stable tree if possible.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: stable <stable@kernel.org>
      bc4cf2bb
  6. 25 11月, 2010 4 次提交
    • C
      arch/tile: fix memchr() not to dereference memory for zero length · 3edabee2
      Chris Metcalf 提交于
      This change fixes a bug that memchr() will read the first word
      of the source even if the length is zero.  Ironically, the code
      was originally written with a test to avoid exactly this problem,
      but to make the code conform to Linux coding standards with all
      declarations preceding all statements, the first load from memory
      was moved up above that test as the initial value for a variable.
      
      The change just moves all the variable declarations to the top
      of the file, with no initializers, so that the test can also be
      at the top of the file.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      3edabee2
    • C
      arch/tile: make glibc's sysconf(_SC_NPROCESSORS_CONF) work correctly · 4d658d13
      Chris Metcalf 提交于
      glibc assumes that it can count /sys/devices/system/cpu/cpu* to get
      the number of configured cpus.  For this to be valid on tile, we need
      to generate a "cpu" entry for all cpus, including the ones that are
      not currently allocated for Linux's use.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      4d658d13
    • C
      pci root complex: support for tile architecture · f02cbbe6
      Chris Metcalf 提交于
      This change enables PCI root complex support for TILEPro.  Unlike
      TILE-Gx, TILEPro has no support for memory-mapped I/O, so the PCI
      support consists of hypervisor upcalls for PIO, DMA, etc.  However,
      the performance is fine for the devices we have tested with so far
      (1Gb Ethernet, SATA, etc.).
      
      The <asm/io.h> header was tweaked to be a little bit more aggressive
      about disabling attempts to map/unmap IO port space.  The hacky
      <asm/pci-bridge.h> header was rolled into the <asm/pci.h> header
      and the result was simplified.  Both of the latter two headers were
      preliminary versions not meant for release before now - oh well.
      
      There is one quirk for our TILEmpower platform, which accidentally
      negotiates up to 5GT and needs to be kicked down to 2.5GT.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      f02cbbe6
    • C
      drivers/net/tile/: on-chip network drivers for the tile architecture · e5a06939
      Chris Metcalf 提交于
      This change adds the first network driver for the tile architecture,
      supporting the on-chip XGBE and GBE shims.
      
      The infrastructure is present for the TILE-Gx networking drivers (another
      three source files in the new directory) but for now the the actual
      tilegx sources are waiting on releasing hardware to initial customers.
      
      Note that arch/tile/include/hv/* are "upstream" headers from the
      Tilera hypervisor and will probably benefit less from LKML review.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      e5a06939
  7. 18 11月, 2010 1 次提交
  8. 15 11月, 2010 1 次提交
    • C
      arch/tile: fix rwlock so would-be write lockers don't block new readers · 24f3f6b5
      Chris Metcalf 提交于
      This avoids a deadlock in the IGMP code where one core gets a read
      lock, another core starts trying to get a write lock (thus blocking
      new readers), and then the first core tries to recursively re-acquire
      the read lock.
      
      We still try to preserve some degree of balance by giving priority
      to additional write lockers that come along while the lock is held
      for write, so they can all complete quickly and return the lock to
      the readers.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      24f3f6b5
  9. 02 11月, 2010 7 次提交
    • C
      arch/tile: mark "hardwall" device as non-seekable · d02db4f8
      Chris Metcalf 提交于
      Arnd's recent patch series tagged this device with noop_llseek,
      conservatively.  In fact, it should be no_llseek, which we arrange
      for by opening the device with nonseekable_open().
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      d02db4f8
    • C
      asm-generic/stat.h: support 64-bit file time_t for stat() · 2c7387ef
      Chris Metcalf 提交于
      The existing asm-generic/stat.h specifies st_mtime, etc., as a 32-value,
      and works well for 32-bit architectures (currently microblaze, score,
      and 32-bit tile).  However, for 64-bit architectures it isn't sufficient
      to return 32 bits of time_t; this isn't good insurance against the 2037
      rollover.  (It also makes glibc support less convenient, since we can't
      use glibc's handy STAT_IS_KERNEL_STAT mode.)
      
      This change extends the two "timespec" fields for each of the three atime,
      mtime, and ctime fields from "int" to "long".  As a result, on 32-bit
      platforms nothing changes, and 64-bit platforms will now work as expected.
      
      The only wrinkle is 32-bit userspace under 64-bit kernels taking advantage
      of COMPAT mode.  For these, we leave the "struct stat64" definitions with
      the "int" versions of the time_t and nsec fields, so that architectures
      can implement compat_sys_stat64() and friends with sys_stat64(), etc.,
      and get the expected 32-bit structure layout.  This requires a
      field-by-field copy in the kernel, implemented by the code guarded
      under __ARCH_WANT_STAT64.
      
      This does mean that the shape of the "struct stat" and "struct stat64"
      structures is different on a 64-bit kernel, but only one of the two
      structures should ever be used by any given process: "struct stat"
      is meant for 64-bit userspace only, and "struct stat64" for 32-bit
      userspace only.  (On a 32-bit kernel the two structures continue to have
      the same shape, since "long" is 32 bits.)
      
      The alternative is keeping the two structures the same shape on 64-bit
      kernels, which means a 64-bit time_t in "struct stat64" for 32-bit
      processes.  This is a little unnatural since 32-bit userspace can't
      do anything with 64 bits of time_t information, since time_t is just
      "long", not "int64_t"; and in any case 32-bit userspace might expect
      to be running under a 32-bit kernel, which can't provide the high 32
      bits anyway.  In the case of a 32-bit kernel we'd then be extending the
      kernel's 32-bit time_t to 64 bits, then truncating it back to 32 bits
      again in userspace, for no particular reason.  And, as mentioned above,
      if we have 64-bit time_t for 32-bit processes we can't easily use glibc's
      STAT_IS_KERNEL_STAT, since glibc's stat structure requires an embedded
      "struct timespec", which is a pair of "long" (32-bit) values in a 32-bit
      userspace.  "Inventive" solutions are possible, but are pretty hacky.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      2c7387ef
    • C
      arch/tile: don't allow user code to set the PL via ptrace or signal return · 1deb9c5d
      Chris Metcalf 提交于
      The kernel was allowing any component of the pt_regs to be updated either
      by signal handlers writing to the stack, or by processes writing via
      PTRACE_POKEUSR or PTRACE_SETREGS, which meant they could set their PL
      up from 0 to 1 and get access to kernel code and data (or, in practice,
      cause a kernel panic).  We now always reset the ex1 field, allowing the
      user to set their ICS bit only.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      1deb9c5d
    • C
      arch/tile: correct double syscall restart for nested signals · 34a89d26
      Chris Metcalf 提交于
      This change is modelled on similar fixes for other architectures.
      The pt_regs "faultnum" member is set to the trap (fault) number that
      caused us to enter the kernel, and is INT_SWINT_1 for the syscall software
      interrupt.  We already supported a pseudo value, INT_SWINT_1_SIGRETURN,
      that we used for the rt_sigreturn syscall; it avoided the case where
      one signal was handled, then we "tail-called" to another handler.
      
      This change avoids the similar case where we start to call one handler,
      then are preempted into another handler when we start trying to run
      the first handler.  We clear ->faultnum after calling handle_signal(),
      and to be paranoid also in the case where there was no signal to deliver.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      34a89d26
    • C
      arch/tile: avoid __must_check warning on one strict_strtol check · d59e609d
      Chris Metcalf 提交于
      For the "initfree" boot argument it's not that big a deal, but
      to avoid warnings in the code, we check for a valid value before
      allowing the specified argument to override the kernel default.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      d59e609d
    • C
      arch/tile: bomb raw_local_irq_ to arch_local_irq_ · 5d966115
      Chris Metcalf 提交于
      This completes the tile migration to the new naming scheme for
      the architecture-specific irq management code.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      5d966115
    • C
      arch/tile: complete migration to new kmap_atomic scheme · 38a6f426
      Chris Metcalf 提交于
      This change makes KM_TYPE_NR independent of the actual deprecated
      list of km_type values, which are no longer used in tile code anywhere.
      For now we leave it set to 8, allowing that many nested mappings,
      and thus reserving 32MB of address space.
      
      A few remaining places using KM_* values were cleaned up as well.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      38a6f426
  10. 29 10月, 2010 1 次提交
  11. 28 10月, 2010 3 次提交