summaryrefslogtreecommitdiff
path: root/arch/sparc64
AgeCommit message (Collapse)Author
2008-05-12sparc64: Use a TS_RESTORE_SIGMASKDavid S. Miller
This mirrors x86 changeset 5a8da0ea82db6fa9737041381079fd16f25dcce2 ("signals: x86 TS_RESTORE_SIGMASK") on sparc64. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-12sparc: Fix mremap address range validation.David S. Miller
Just like mmap, we need to validate address ranges regardless of MAP_FIXED. sparc{,64}_mmap_check()'s flag argument is unused, remove. Based upon a report and preliminary patch by Jan Lieskovsky <jlieskov@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc64: Work around memory probing bug in openfirmware.David S. Miller
Read all of the OF memory and translation tables, then read the physical available memory list twice. When making these requests, OF can allocate more memory to do it's job, which can remove pages from the available memory list. So fetch in all of the tables at once, and fetch the available list last to make sure we read a stable value. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix debugger syscall restart interactions.David S. Miller
So, forever, we've had this ptrace_signal_deliver implementation which tries to handle all of the nasties that can occur when the debugger looks at a process about to take a signal. It's meant to address all of these issues inside of the kernel so that the debugger need not be mindful of such things. Problem is, this doesn't work. The idea was that we should do the syscall restart business first, so that the debugger captures that state. Otherwise, if the debugger for example saves the child's state, makes the child execute something else, then restores the saved state, we won't handle the syscall restart properly because we lose the "we're in a syscall" state. The code here worked for most cases, but if the debugger actually passes the signal through to the child unaltered, it's possible that we would do a syscall restart when we shouldn't have. In particular this breaks the case of debugging a process under a gdb which is being debugged by yet another gdb. gdb uses sigsuspend to wait for SIGCHLD of the inferior, but if gdb itself is being debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the signal. But ptrace_signal_deliver() assumed the debugger would cancel out the signal and therefore did a syscall restart, because the return error was ERESTARTNOHAND. Fix this by simply making ptrace_signal_deliver() a nop, and providing a way for the debugger to control system call restarting properly: 1) Report a "in syscall" software bit in regs->{tstate,psr}. It is set early on in trap entry to a system call and is fully visible to the debugger via ptrace() and regsets. 2) Test this bit right before doing a syscall restart. We have to do a final recheck right after get_signal_to_deliver() in case the debugger cleared the bit during ptrace_stop(). 3) Clear the bit in trap return so we don't accidently try to set that bit in the real register. As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just like sparc64 has. M68K has this same exact bug, and is now the only other user of the ptrace_signal_deliver hook. It needs to be fixed in the same exact way as sparc. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix ptrace() detach.David S. Miller
Forever we had a PTRACE_SUNOS_DETACH which was unconditionally recognized, regardless of the personality of the process. Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h header file on sparc as PTRACE_DETACH and PT_DETACH. So continue to recognize this old value. Luckily, it doesn't conflict with anything we actually care about. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-07sparc: Fix SA_ONSTACK signal handling.David S. Miller
We need to be more liberal about the alignment of the buffer given to us by sigaltstack(). The user should not need to be mindful of all of the alignment constraints we have for the stack frame. This mirrors how we handle this situation in clone() as well. Also, we align the stack even in non-SA_ONSTACK cases so that signals due to bad stack alignment can be delivered properly. This makes such errors easier to debug and recover from. Finally, add the sanity check x86 has to make sure we won't overflow the signal stack. This fixes glibc testcases nptl/tst-cancel20.c and nptl/tst-cancelx20.c Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-07sparc: Fix fork/clone/vfork system call restart.David S. Miller
We clobber %i1 as well as %i0 for these system calls, because they give two return values. Therefore, on error, we have to restore %i1 properly or else the restart explodes since it uses the wrong arguments. This fixes glibc's nptl/tst-eintr1.c testcase. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-07sparc: Fix mmap VA span checking.David S. Miller
We should not conditionalize VA range checks on MAP_FIXED. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-06sparc64: Fix initrd regression.David S. Miller
We die because we forget to convert initrd_start and initrd_end to virtual addresses. Reported by Mikael Pettersson Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-05sparc64: remove online_page()Adrian Bunk
The identical online_page() implementations from all architectures got moved to mm/memory_hotplug.c - except for the sparc64 one that even was dead code due to MEMORY_HOTPLUG not being available there. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-05sparc64: use compat_sys_utimes instead of home-grown local copy.David S. Miller
Noticed by Christoph Hellwig. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-03Revert "[SPARC64]: Wrap SMP IPIs with irq_enter()/irq_exit()."David S. Miller
This reverts commit 2664ef44cf5053d2b7dff01cecac70bc601a5f68. Ingo moved around where the softlockup dependency sits so this change is no longer necessary. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02sparc64: Fix syscall restart, for real...David S. Miller
The change I put into copy_thread() just papered over the real problem. When we are looking to see if we should do a syscall restart, when deliverying a signal, we should only interpret the syscall return value as an error if the carry condition code(s) are set. Otherwise it's a success return. Also, sigreturn paths should do a pt_regs_clear_trap_type(). It turns out that doing a syscall restart when returning from a fork() does and should happen, from time to time. Even if copy_thread() returns success, copy_process() can still unwind and signal -ERESTARTNOINTR in the parent. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-02sparc64: Stop creating dummy root PCI host controller devices.David S. Miller
It just creates confusion, errors, and bugs. For one thing, this can cause dup sysfs or procfs nodes to get created: [ 1.198015] proc_dir_entry '00.0' already registered [ 1.198036] Call Trace: [ 1.198052] [00000000004f2534] create_proc_entry+0x7c/0x98 [ 1.198092] [00000000005719e4] pci_proc_attach_device+0xa4/0xd4 [ 1.198126] [00000000007d991c] pci_proc_init+0x64/0x88 [ 1.198158] [00000000007c62a4] kernel_init+0x190/0x330 [ 1.198183] [0000000000426cf8] kernel_thread+0x38/0x48 [ 1.198210] [00000000006a0d90] rest_init+0x18/0x5c Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc64: remove duplicated include sparc: Add kgdb support. kgdbts: Sparc needs sstep emulation. sparc32: Kill smp_message_pass() and related code. sparc64: Kill PIL_RESERVED, unused. sparc64: Split entry.S up into seperate files.
2008-04-29sparc64: remove duplicated includeHuang Weiyi
Remove dulicated include file <asm/timer.h> in arch/sparc64/kernel/smp.c. Signed-off-by: Huang Weiyi <hwy@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-29sparc: Add kgdb support.David S. Miller
Current limitations: 1) On SMP single stepping has some fundamental issues, shared with other sw single-step architectures such as mips and arm. 2) On 32-bit sparc we don't support SMP kgdb yet. That requires some reworking of the IPI mechanisms and infrastructure on that platform. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-28sparc64: Split entry.S up into seperate files.David S. Miller
entry.S was a hodge-podge of several totally unrelated sets of assembler routines, ranging from FPU trap handlers to hypervisor call functions. Split it up into topic-sized pieces. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-27sparc64: Fix accidental syscall restart on child return from clone/fork/vfork.David S. Miller
This fixes a regression added by 238468b2ac76020c192a7402c92df5097916bf4a ("[SPARC64]: Use trap type stored in pt_regs to handle syscall restart.") Because we now encode the "returning from syscall" status in the pt_regs area, we have to be mindful to zap it out in the child of a fork. During a parallel kernel build I saw an accidental -EINTR return from vfork() in 'make' because of this bug. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-27sparc64: Clean up handling of pt_regs trap type encoding.David S. Miller
If we use this from more than one place, it's better to have helpers instead of twiddling magic constants all over. Add pt_regs_trap_type(), pt_regs_clear_trap_type(), and pt_regs_is_syscall(). Use them in do_signal(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-27sparc: Remove old style signal frame support.David S. Miller
Back around the same time we were bootstrapping the first 32-bit sparc Linux kernel with a SunOS userland, we made the signal frame match that of SunOS. By the time we even started putting together a native Linux userland for 32-bit Sparc we realized this layout wasn't sufficient for Linux's needs. Therefore we changed the layout, yet kept support for the old style signal frame layout in there. The detection mechanism is that we had sys_sigaction() start passing in a negative signal number to indicate "new style signal frames please". Anyways, no binaries exist in the world that use the old stuff. In fact, I bet Jakub Jelinek and myself are the only two people who ever had such binaries to be honest. So let's get rid of this stuff. I added an assertion using WARN_ON_ONCE() that makes sure 32-bit applications are passing in that negative signal number still. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-27sparc64: Kill bogus RT_ALIGNEDSZ macro from signal.cDavid S. Miller
The structure has to be 8-byte aligned in size, so this macro is just noise. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-26sparc64: Kill unused local ISA bus layer.David S. Miller
No more drivers use this, and therefore it can die. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-26sparc64: Do not ignore 'pmu' device ranges.David S. Miller
I must have disabled this due to other bugs which were fixed over time. And this is needed in order for child devices of "pmu" to get proper resource values. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-26sparc64: Kill CONFIG_SPARC32_COMPATDavid S. Miller
It's completely superfluous, CONFIG_COMPAT is sufficient. What this used to be is an umbrella for enabling code shared by all 32-bit compat binary support types. But with the removal of SunOS and Solaris support, the only one left is Linux 32-bit ELF. Update defconfig. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-26sparc64: Cleanups and corrections for arch/sparc64/KconfigDavid S. Miller
Refer to chip as "SPARC" throughout. Say 32-bit SPARC and 64-bit SPARC rather than mentioning specific chips such like UltraSPARC, as appropriate. Remove non-sense help text referring to things that will never appear on a SPARC system, such as EISA busses etc. Use "help" instead of "--help--" Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-26sparc64: Fix wedged irq regression.David S. Miller
Kernel bugzilla 10273 As reported by Jos van der Ende, ever since commit 5a606b72a4309a656cd1a19ad137dc5557c4b8ea ("[SPARC64]: Do not ACK an INO if it is disabled or inprogress.") sun4u interrupts can get stuck. What this changset did was add the following conditional to the various IRQ chip ->enable() handlers on sparc64: if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) return; which is correct, however it means that special care is needed in the ->enable() method. Specifically we must put the interrupt into IDLE state during an enable, or else it might never be sent out again. Setting the INO interrupt state to IDLE resets the state machine, the interrupt input to the INO is retested by the hardware, and if an interrupt is being signalled by the device, the INO moves back into TRANSMIT state, and an interrupt vector is sent to the cpu. The two sun4v IRQ chip handlers were already doing this properly, only sun4u got it wrong. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-25[SPARC64]: Wrap SMP IPIs with irq_enter()/irq_exit().David S. Miller
Otherwise all sorts of bad things can happen, including spurious softlockup reports. Other platforms have this same bug, in one form or another, just don't see the issue because they don't sleep as long as sparc64 can in NOHZ. Thanks to some brilliant debugging by Peter Zijlstra. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-25[SPARC64]: Fix args to 64-bit sys_semctl() via sys_ipc().David S. Miller
Second and third arguments were swapped for whatever reason. Reported by Tom Callaway. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24[SPARC64]: Detect trap frames in stack backtraces.David S. Miller
Now that we have a magic cookie in the pt_regs, we can properly detect trap frames in stack bactraces. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24[SPARC64]: %l6 trap return handling no longer necessary.David S. Miller
Now that we indicate the "restart system call" in the trap type field of pt_regs->magic, we don't need to set the %l6 boolean in all of the trap return paths. And we therefore don't need to pass it to do_notify_resume(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24[SPARC64]: Use trap type stored in pt_regs to handle syscall restart.David S. Miller
Now that we can check the trap type directly, we don't need the funny restart_syscall indication from the trap return paths. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Store magic cookie and trap type in pt_regs.David S. Miller
This sets us up for several simplifications and facilities: 1) The magic cookie lets us identify trap frames more accurately in stack backtraces. 2) The trap type lets us simplify all of the "are we in a syscall" state management and checks. 3) We can now see if a task off the cpu is sleeping in a system call or not. In fact, we can see what trap it is sleeping in whatever the type. The utrace guys will use this. Based upon some discussions with Roland McGrath. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: PROM debug console can be CON_ANYTIME.David S. Miller
No per-cpu or similar resources need to be setup before we can use this console device. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23sparc64: cleanup after SunOS/Solaris binary emulation removalAdrian Bunk
The following cleanups are now possible: - arch/sparc64/kernel/entry.S:ret_sys_call no longer has to be global - arch/sparc64/kernel/sparc64_ksyms.c: remove no longer used prototypes Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Add NUMA support.David S. Miller
Currently there is only code to parse NUMA attributes on sun4v/niagara systems, but later on we will add such parsing for older systems. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Allocate TSB node-local.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: NUMA device infrastructure.David S. Miller
Record and propagate NUMA information for devices. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Kill pci_iommu_table_init() declaration.David S. Miller
No longer exists. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Once we have the boot cmdline, call parse_early_param()David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Initialize MDESC earlier and use lmb_alloc()David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Use lmb_alloc() for PROM device tree.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Call real_setup_per_cpu_areas() earlier and use lmb_alloc().David S. Miller
We have to do it like this before we can move the PROM and MDESC device tree code over to using lmb_alloc(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Fully use LMB information in bootmem_init().David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Start using LMB information in bootmem_init().David S. Miller
This allows us to kill the incredibly complicated and stupid function trim_pavail(). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Initialize LMB tables.David S. Miller
Call lmb_add() on available regions, and call lmb_reserve() on the main kernel image and the ramdisk (if any). Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-23[SPARC64]: Move ramdisk discovery code out to seperate function.David S. Miller
And add some comments explaining all of the quirks involved in the way the bootloader provides this information. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC]: Remove SunOS and Solaris binary support.
2008-04-21Merge branch 'master' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits) [POWERPC] Fix compile breakage for 64-bit UP configs [POWERPC] Define copy_siginfo_from_user32 [POWERPC] Add compat handler for PTRACE_GETSIGINFO [POWERPC] i2c: Fix build breakage introduced by OF helpers [POWERPC] Optimize fls64() on 64-bit processors [POWERPC] irqtrace support for 64-bit powerpc [POWERPC] Stacktrace support for lockdep [POWERPC] Move stackframe definitions to common header [POWERPC] Fix device-tree locking vs. interrupts [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const [POWERPC] Remove unused __max_memory variable [POWERPC] Simplify xics direct/lpar irq_host setup [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ() [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade() [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c [POWERPC] Use asm-generic/bitops/find.h in bitops.h [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup [POWERPC] 85xx: Fix the size of qe muram for MPC8568E [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier. [POWERPC] 86xx: mark functions static, other minor cleanups ...
2008-04-21[SPARC]: Remove SunOS and Solaris binary support.David S. Miller
As per Documentation/feature-removal-schedule.txt Signed-off-by: David S. Miller <davem@davemloft.net>