aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* microblaze: Use delay slot in syscall macrosMichal Simek2010-08-041-19/+10
| | | | | | Saving instruction with delay slot usage. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Save kernel mode in delay slotMichal Simek2010-08-041-2/+1
| | | | | | | This change save one instruction if kernel comes from kernel space. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Do not mix register saving and mode settingMichal Simek2010-08-041-1/+1
| | | | | | Separate reg saving and mode setting. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Move SAVE_STATE upwardMichal Simek2010-08-041-32/+31
| | | | | | SAVE_STATE macro could be used by other rutines too. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: entry.S: Macro optimizationMichal Simek2010-08-041-12/+12
| | | | | | | | We are not working with values from MSR that's why we can discard it and use r11 for different purpose without saving/restoring. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Optimize hw exception rutineMichal Simek2010-08-041-16/+6
| | | | | | | Remove set_vms because UMS is cleared and VMS is already setup. Optimize function calling which save one additional instruction. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Implement clear_ums macro and fix SAVE_STATE macroMichal Simek2010-08-041-0/+15
| | | | | | | | | VMS is always setup because VM mode was before exception/syscall/interrupt. Kernel continues in kernel mode that's why we have to clear UMS bit if kernel comes from user space. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Remove additional setup for kernel_modeMichal Simek2010-08-041-15/+10
| | | | | | | | | | | PT_MODE stores information if kernel comes from user or kernel space. If come from user space, PT_MODE contains 0. If come from kernel store, PT_MODE contains non zero value. We don't need to save value 1. I am using r1 register which contains non zero value. This change save one additional instruction. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Optimize SAVE_STATE macroMichal Simek2010-08-041-8/+13
| | | | | | | SAVE_STATE macro could be used for user_exception or interrupt functions. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Remove additional loadingMichal Simek2010-08-041-5/+0
| | | | | | | We don't need to save r0 to PT_R0. It could be additional operation. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Completely remove working with R11 registerMichal Simek2010-08-041-41/+21
| | | | | | | We don't need to save R11 register. There is easy way to use only R1 which is saved and restore later. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Do not setup BIP in _debug_exceptionMichal Simek2010-08-041-3/+0
| | | | | | BIP is already setup. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Simplify _debug_exception functionMichal Simek2010-08-041-5/+2
| | | | | | | | | | | | | | | | | | | | Keep together all arguments for send_sig function. Move returning address to delay slot which is executed. Remove additional send_sig loading. I am using IMM part of rtbd instruction with r0. old solution: addik r11, r0, send_sig rtbd r11, 0 nop new solution: rtbd r0, send_sig nop There is one instruction saving. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Optimize SAVE_STATE macroMichal Simek2010-08-041-6/+14
| | | | | | | | | | | | | | | | | | | It is necessary to setup BIP and EE and clear EIP only for unaligned exception handler. The rest of hw exception handlers don't require it. HW exception occured and we are not in virtual mode. That's why we can do operations protected by EIP. Interrupt, next hw exception or syscall can't occur. EIP is cleared by rted. This change speedup page_fault hw exception handler which is critical path. There is also necessary to save R11 content before flag setup for unaligned exception. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: trivial: Use la insted of addikMichal Simek2010-08-041-32/+32
| | | | | | la is translated to addik by toolchain. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: remove enable_irq from SAVE_STATE macroMichal Simek2010-08-041-1/+0
| | | | | | | | SAVE_STATE macro is used in hw exceptions high level handling functions. Hw exception doesn't disable IRQ that's why we don't need to reenable it. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Move stack backup to SAVE_STATE macroMichal Simek2010-08-041-4/+1
| | | | | | | Remove code duplicity and move it to SAVE_STATE macro. There is no impact on performance. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Move BIP setup to the end of ret_from_trap/ret_from_excMichal Simek2010-08-041-6/+6
| | | | | | | | We don't need to protect by BIP whole ret_from_trap/ret_from_exc code. Only restoring from user/hw exception should be covered. If BIP is setup, IRQ can't occur. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Remove PER_CPU(KM) variableMichal Simek2010-08-041-23/+20
| | | | | | | | | There is a way howto remove Kernel Mode variable. It is easier to parse UMS bit in MSR to find out if I come from kernel or user space. Loading MSR content should be in one cycle and loading PER_CPU variable depends on memory state. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Optimize clear_vms_ums macroMichal Simek2010-08-041-3/+1
| | | | | | | We can save two instruction when MSR_VMS and MSR_UMS are setup in one instruction. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Save and restore r3/r4 in SAVE/RESTORE_REGS macrosMichal Simek2010-08-041-40/+8
| | | | | | | | | | | Save and restore R3/R4 registers in macros. This change help to cleanup entry.S. In ret_from_trap function we are saving returning value from syscall to pt_regs on stack that's why we don't need to save and restore these values before kernel functions (schedule, do_signal). Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix VM_ON and VM_OFF macrosMichal Simek2010-08-041-4/+6
| | | | | | Jump behind macro. We don't want to execute nop instruction again. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Do not use _start in vmlinuxMichal Simek2010-08-042-3/+3
| | | | | | | | _start symbol stores physical address where kernel is. Gdb uses this symbol for their purpose that's why we have to rename it. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Cleanup boot/MakefileMichal Simek2010-08-041-5/+6
| | | | | | Remove spaces and use tabs instead. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix number of pvr regsMichal Simek2010-08-041-1/+1
| | | | | | Microblaze has only 11 pvr regs according manual. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Decrease time shifting valuesMichal Simek2010-08-041-4/+5
| | | | | | | Lower shifting values ensure that shifted 32bit counter value doesn't exceed 64bit cycle variable too fast. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Enable early printk only for uartliteMichal Simek2010-08-041-0/+1
| | | | | | | | Microblaze has support for early printk. The second serial driver (uart16550/8250) has no microblaze support for early printk. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: remove unused HAVE_ARCH_PCI_SET_DMA_MASKFUJITA Tomonori2010-08-041-6/+0
| | | | | | | | HAVE_ARCH_PCI_SET_DMA_MASK was removed in 2.6.34 (no architecture has the own implementation of pci_set_dma_mask). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Do not trace cpu_relax functionMichal Simek2010-08-041-2/+5
| | | | | | | IRQsoff tracer requires to protect cpu_idle function to get correct timing report. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Improve ftrace time measuringMichal Simek2010-08-042-2/+17
| | | | | | | I had to comment sched_clock generic function because of broken toolchain. It is fine grain timing. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Add stack unwinderSteven J. Magnani2010-08-0410-95/+454
| | | | | | | | | | | | | | | | | | Implement intelligent backtracing by searching for stack frame creation, and emitting only return addresses. Use print_hex_dump() to display the entire binary kernel stack. Limitation: MMU kernels are not currently able to trace beyond a system trap (interrupt, syscall, etc.). It is the intent of this patch to provide infrastructure that can be extended to add this capability later. Changes from V1: * Removed checks in find_frame_creation() that prevented location of the frame creation instruction in heavily optimized code * Various formatting/commenting/file location tweaks per review comments * Dropped Kconfig option to enable STACKTRACE as something logically separate Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
* microblaze: Allow PAGE_SIZE configurationSteven J. Magnani2010-08-046-11/+50
| | | | | | | | | | Allow developer to configure memory page size at compile time. Larger pages can improve performance on some workloads. Based on PowerPC code. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Trace hardirqsMichal Simek2010-08-041-0/+2
| | | | | | Add trace_hardirqs_off and trace_hardirqs_on to do_IRQ function. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix sys_clone syscallMichal Simek2010-08-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | sys_clone syscall ignored args which this patch mapped to args which are passing from glibc. Here is the origin problem description. "I ran the static libgcc tests (very few of them are there, they are mostly dynamically linked) and some of them fail with an assertion in fork() system call (tid != pid), I looked at the microblaze/entry.S file and it looks suspicious (ignores arguments 3-5)" Arg mapping should be: glibc ARCH_FORK(...) -> do_fork(...) r5 -> r5 (clone_flags) r6 -> r6 (stack_start, use parent->stack if NULL) pt_regs -> r7 (pt_regs) r7 -> r8 (stack_size) r8 -> r9 (parent_tidptr) r9 -> r10 (child_tidptr) Signed-off-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Disable FRAME_POINTER selectionMichal Simek2010-08-041-3/+3
| | | | | | | | Microblaze doesn't support frame pointers. Ftrace code uses CALLER_ADDR1 which is defined in linux/ftrace.h. For Microblaze is 0. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix copy_to_user_page macroMichal Simek2010-08-042-2/+19
| | | | | | | | | | | | | | | | | | | | | | | copy_to_user_page macro is used in mm/memory.c:access_process_vm function. This function is called from ptrace code (POKETEXT, POKEDATA) which write data to memory. Microblaze handle physical address for caches that's why there is virt_to_phys conversion. There is potential one location which can caused the problem on WB system. The important is take a look at write PTRACEs requests (POKE/TEXT, DATA, USR). Note: Majority of Microblaze PTRACE code is moved to generic location in newer kernel version that's why this solution should work on the newest kernel version too. linux/io.h is in cacheflush because of mm/nommu.c Tested on a WB system - hello world debugging. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Sync noMMU and MMU setup_memoryMichal Simek2010-08-041-6/+1
| | | | | | Both versions can use the same node to register NODE_DATA(0) Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Remove unused labelMichal Simek2010-08-041-1/+0
| | | | | | | | | | | The label should be remove by 21e1c93631e027136ea4070e7bca600c4ad4f391 Warning message: arch/microblaze/mm/fault.c: In function 'do_page_fault': arch/microblaze/mm/fault.c:229: warning: label 'survive' defined but not used Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Implement flush_dcache_page macroMichal Simek2010-08-041-4/+10
| | | | | | | flush_dcache_page macro is necessary to implement for JFFS2 rootfs support on WB system. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix comment for TLBMichal Simek2010-08-021-1/+1
| | | | | | | There is wrong comment for TLB. Early printk uartlite console uses TLB 63. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix __copy_to/from_user_inatomic macrosMichal Simek2010-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __copy_to/from_user_inatomic should call __copy_to/from_user because there is not necessary to check access because of kernel function. might_sleep in copy_to/from_user macros is causing problems in debug sessions too (CONFIG_DEBUG_SPINLOCK_SLEEP). BUG: sleeping function called from invalid context at .../arch/microblaze/include/asm/uaccess.h:388 in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper 1 lock held by swapper/1: #0: (&p->cred_guard_mutex){......}, at: [<c00d4b90>] prepare_bprm_creds+0x2c/0x88 Kernel Stack: ... Call Trace: [<c0006bd4>] microblaze_unwind+0x7c/0x94 [<c0006684>] show_stack+0xf4/0x190 [<c0006730>] dump_stack+0x10/0x30 [<c00103a0>] __might_sleep+0x12c/0x160 [<c0090de4>] file_read_actor+0x1d8/0x2a8 [<c0091568>] generic_file_aio_read+0x6b4/0xa64 [<c00cd778>] do_sync_read+0xac/0x110 [<c00ce254>] vfs_read+0xc8/0x160 [<c00d585c>] kernel_read+0x38/0x64 [<c00d5984>] prepare_binprm+0xfc/0x130 [<c00d6430>] do_execve+0x228/0x370 [<c000614c>] microblaze_execve+0x58/0xa4 caused by file_read_actor (mm/filemap.c) which calls __copy_to_user_inatomic. Signed-off-by: Michal Simek <monstr@monstr.eu>
* Linux 2.6.35Linus Torvalds2010-08-011-1/+1
|
* NFS: Fix a typo in include/linux/nfs_fs.hTrond Myklebust2010-08-012-5/+6
| | | | | | | | | | | | nfs_commit_inode() needs to be defined irrespectively of whether or not we are supporting NFSv3 and NFSv4. Allow the compiler to optimise away code in the NFSv2-only case by converting it into an inlined stub function. Reported-and-tested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds2010-07-3011-49/+75
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/home/rmk/linux-2.6-arm: cyber2000fb: fix console in truecolor modes cyber2000fb: fix machine hang on module load SA1111: Eliminate use after free ARM: Fix Versatile/Realview/VExpress MMC card detection sense ARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt ARM: Add barriers to io{read,write}{8,16,32} accessors as well ARM: 6273/1: Add barriers to the I/O accessors if ARM_DMA_MEM_BUFFERABLE ARM: 6272/1: Convert L2x0 to use the IO relaxed operations ARM: 6271/1: Introduce *_relaxed() I/O accessors ARM: 6275/1: ux500: don't use writeb() in uncompress.h ARM: 6270/1: clean files in arch/arm/boot/compressed/ ARM: Fix csum_partial_copy_from_user()
| * cyber2000fb: fix console in truecolor modesOndrej Zary2010-07-301-0/+1
| | | | | | | | | | | | | | | | | | Return value was not set to 0 in setcolreg() with truecolor modes. This causes fb_set_cmap() to abort after first color, resulting in blank palette - and blank console in 24bpp and 32bpp modes. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * cyber2000fb: fix machine hang on module loadOndrej Zary2010-07-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | I was testing two CyberPro 2000 based PCI cards on x86 and the machine always hanged completely when the cyber2000fb module was loaded. It seems that the card hangs when some registers are accessed too quickly after writing RAMDAC control register. With this patch, both card work. Add delay after RAMDAC control register write to prevent hangs on module load. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * SA1111: Eliminate use after freeJulia Lawall2010-07-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __sa1111_remove always frees its argument, so the subsequent reference to sachip->saved_state represents a use after free. __sa1111_remove does not appear to use the saved_state field, so the patch simply frees it first. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E,E2; @@ __sa1111_remove(E) ... ( E = E2 | * E ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * ARM: Fix Versatile/Realview/VExpress MMC card detection senseRussell King2010-07-303-4/+8
| | | | | | | | | | | | | | | | | | The MMC card detection sense has become really confused with negations at various levels, leading to some platforms not detecting inserted cards. Fix this by converting everything to positive logic throughout, thereby getting rid of these negations. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * ARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_viptGary King2010-07-301-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smp_processor_id() must not be called from a preemptible context (this is checked by CONFIG_DEBUG_PREEMPT). kmap_high_l1_vipt() was doing so. This lead to a problem where the wrong per_cpu kmap_high_l1_vipt_depth could be incremented, causing a BUG_ON(*depth <= 0); in kunmap_high_l1_vipt(). The solution is to move the call to smp_processor_id() after the call to preempt_disable(). Originally by: Andrew Howe <ahowe@nvidia.com> Signed-off-by: Gary King <gking@nvidia.com> Acked-by: Nicolas Pitre <nico.as.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * ARM: Add barriers to io{read,write}{8,16,32} accessors as wellRussell King2010-07-291-20/+18
| | | | | | | | | | | | | | | | | | The ioread/iowrite accessors also need barriers as they're used in place of readl/writel et.al. in portable drivers. Create __iormb() and __iowmb() which are conditionally defined to be barriers dependent on ARM_DMA_MEM_BUFFERABLE, and always use these macros in the accessors. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>