1. 23 12月, 2011 1 次提交
    • D
      sparc64: Fix MSIQ HV call ordering in pci_sun4v_msiq_build_irq(). · 7cc85833
      David S. Miller 提交于
      This silently was working for many years and stopped working on
      Niagara-T3 machines.
      
      We need to set the MSIQ to VALID before we can set it's state to IDLE.
      
      On Niagara-T3, setting the state to IDLE first was causing HV_EINVAL
      errors.  The hypervisor documentation says, rather ambiguously, that
      the MSIQ must be "initialized" before one can set the state.
      
      I previously understood this to mean merely that a successful setconf()
      operation has been performed on the MSIQ, which we have done at this
      point.  But it seems to also mean that it has been set VALID too.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cc85833
  2. 15 12月, 2011 1 次提交
  3. 05 12月, 2011 1 次提交
  4. 18 11月, 2011 2 次提交
  5. 16 11月, 2011 1 次提交
    • D
      sparc: Stash orig_i0 into %g6 instead of %g2 · e88d2468
      David S. Miller 提交于
      As per the comments added by this commit, %g2 turns out to not be a
      usable place to save away orig_i0 for syscall restart handling.
      
      In fact all of %g2, %g3, %g4, and %g5 are assumed to be saved across
      a system call by various bits of code in glibc.
      
      %g1 can't be used because that holds the syscall number, which would
      need to be saved and restored for syscall restart handling too, and
      that would only compound our problems :-)
      
      This leaves us with %g6 and %g7 which are for "system use".  %g7 is
      used as the "thread register" by glibc, but %g6 is used as a compiler
      and assembler temporary scratch register.  And in no instance is %g6
      used to hold a value across a system call.
      
      Therefore %g6 is safe for storing away orig_i0, at least for now.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e88d2468
  6. 15 11月, 2011 1 次提交
    • D
      sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls. · 1d299bc7
      David S. Miller 提交于
      Although we provide a proper way for a debugger to control whether
      syscall restart occurs, we run into problems because orig_i0 is not
      saved and restored properly.
      
      Luckily we can solve this problem without having to make debuggers
      aware of the issue.  Across system calls, several registers are
      considered volatile and can be safely clobbered.
      
      Therefore we use the pt_regs save area of one of those registers, %g2,
      as a place to save and restore orig_i0.
      
      Debuggers transparently will do the right thing because they save and
      restore this register already.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d299bc7
  7. 14 11月, 2011 1 次提交
  8. 03 11月, 2011 2 次提交
  9. 01 11月, 2011 8 次提交
  10. 31 10月, 2011 1 次提交
  11. 28 10月, 2011 1 次提交
    • E
      compat: sync compat_stats with statfs. · 1448c721
      Eric W. Biederman 提交于
      This was found by inspection while tracking a similar
      bug in compat_statfs64, that has been fixed in mainline
      since decemeber.
      
      - This fixes a bug where not all of the f_spare fields
        were cleared on mips and s390.
      - Add the f_flags field to struct compat_statfs
      - Copy f_flags to userspace in case someone cares.
      - Use __clear_user to copy the f_spare field to userspace
        to ensure that all of the elements of f_spare are cleared.
        On some architectures f_spare is has 5 ints and on some
        architectures f_spare only has 4 ints.  Which makes
        the previous technique of clearing each int individually
        broken.
      
      I don't expect anyone actually uses the old statfs system
      call anymore but if they do let them benefit from having
      the compat and the native version working the same.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      1448c721
  12. 26 10月, 2011 1 次提交
  13. 21 10月, 2011 3 次提交
  14. 20 10月, 2011 1 次提交
  15. 13 10月, 2011 2 次提交
  16. 08 10月, 2011 1 次提交
  17. 30 9月, 2011 1 次提交
    • D
      sparc64: Force the execute bit in OpenFirmware's translation entries. · f4142cba
      David S. Miller 提交于
      In the OF 'translations' property, the template TTEs in the mappings
      never specify the executable bit.  This is the case even though some
      of these mappings are for OF's code segment.
      
      Therefore, we need to force the execute bit on in every mapping.
      
      This problem can only really trigger on Niagara/sun4v machines and the
      history behind this is a little complicated.
      
      Previous to sun4v, the sun4u TTE entries lacked a hardware execute
      permission bit.  So OF didn't have to ever worry about setting
      anything to handle executable pages.  Any valid TTE loaded into the
      I-TLB would be respected by the chip.
      
      But sun4v Niagara chips have a real hardware enforced executable bit
      in their TTEs.  So it has to be set or else the I-TLB throws an
      instruction access exception with type code 6 (protection violation).
      
      We've been extremely fortunate to not get bitten by this in the past.
      
      The best I can tell is that the OF's mappings for it's executable code
      were mapped using permanent locked mappings on sun4v in the past.
      Therefore, the fact that we didn't have the exec bit set in the OF
      translations we would use did not matter in practice.
      
      Thanks to Greg Onufer for helping me track this down.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4142cba
  18. 22 9月, 2011 1 次提交
    • D
      sparc: Make '-p' boot option meaningful again. · 11032c17
      David S. Miller 提交于
      If "-p" is given on the command line, clear the CON_BOOT
      flag for the initial early boot PROM console.
      
      This is necessary to try and see crash messages that occur
      between the registry of the VT console and the probing of
      the first framebuffer or serial console.  During this time
      no console messages are emitted because the VT console
      registry (even if no backend is registered to it) removes
      the early console if CON_BOOT is set.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11032c17
  19. 21 9月, 2011 1 次提交
  20. 17 9月, 2011 1 次提交
  21. 30 8月, 2011 3 次提交
  22. 27 8月, 2011 1 次提交
  23. 21 8月, 2011 1 次提交
    • D
      sparc: Allow handling signals when stack is corrupted. · 5598473a
      David S. Miller 提交于
      If we can't push the pending register windows onto the user's stack,
      we disallow signal delivery even if the signal would be delivered on a
      valid seperate signal stack.
      
      Add a register window save area in the signal frame, and store any
      unsavable windows there.
      
      On sigreturn, if any windows are still queued up in the signal frame,
      try to push them back onto the stack and if that fails we kill the
      process immediately.
      
      This allows the debug/tst-longjmp_chk2 glibc test case to pass.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5598473a
  24. 19 8月, 2011 1 次提交
    • I
      sparc: fix array bounds error setting up PCIC NMI trap · 4a0342ca
      Ian Campbell 提交于
        CC      arch/sparc/kernel/pcic.o
      arch/sparc/kernel/pcic.c: In function 'pcic_probe':
      arch/sparc/kernel/pcic.c:359:33: error: array subscript is above array bounds [-Werror=array-bounds]
      arch/sparc/kernel/pcic.c:359:8: error: array subscript is above array bounds [-Werror=array-bounds]
      arch/sparc/kernel/pcic.c:360:33: error: array subscript is above array bounds [-Werror=array-bounds]
      arch/sparc/kernel/pcic.c:360:8: error: array subscript is above array bounds [-Werror=array-bounds]
      arch/sparc/kernel/pcic.c:361:33: error: array subscript is above array bounds [-Werror=array-bounds]
      arch/sparc/kernel/pcic.c:361:8: error: array subscript is above array bounds [-Werror=array-bounds]
      cc1: all warnings being treated as errors
      
      I'm not particularly familiar with sparc but t_nmi (defined in head_32.S via
      the TRAP_ENTRY macro) and pcic_nmi_trap_patch (defined in entry.S) both appear
      to be 4 instructions long and I presume from the usage that instructions are
      int sized.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: sparclinux@vger.kernel.org
      Reviewed-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a0342ca
  25. 16 8月, 2011 2 次提交
    • D
      sparc64: Set HAVE_C_RECORDMCOUNT · 178a2960
      David S. Miller 提交于
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      178a2960
    • M
      sparc32: unbreak arch_write_unlock() · 3f6aa0b1
      Mikael Pettersson 提交于
      The sparc32 version of arch_write_unlock() is just a plain assignment.
      Unfortunately this allows the compiler to schedule side-effects in a
      protected region to occur after the HW-level unlock, which is broken.
      E.g., the following trivial test case gets miscompiled:
      
      	#include <linux/spinlock.h>
      	rwlock_t lock;
      	int counter;
      	void foo(void) { write_lock(&lock); ++counter; write_unlock(&lock); }
      
      Fixed by adding a compiler memory barrier to arch_write_unlock().  The
      sparc64 version combines the barrier and assignment into a single asm(),
      and implements the operation as a static inline, so that's what I did too.
      
      Compile-tested with sparc32_defconfig + CONFIG_SMP=y.
      Signed-off-by: NMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3f6aa0b1