summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel
AgeCommit message (Collapse)Author
2010-08-18Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
* 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6: spi.h: missing kernel-doc notation, please fix of: fix missing headers for of_address_to_resource() in MTD and SysACE drivers of: Fix missing includes ata: update for of_device to platform_device replacement microblaze: Fix of: eliminate of_device->node and dev_archdata->{of,prom}_node microblaze: Fix of/address: Merge all of the bus translation code booting-without-of: Remove nonexistent chapters from TOC, fix numbering
2010-08-17Make do_execve() take a const filename pointerDavid Howells
Make do_execve() take a const filename pointer so that kernel_execve() compiles correctly on ARM: arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type This also requires the argv and envp arguments to be consted twice, once for the pointer array and once for the strings the array points to. This is because do_execve() passes a pointer to the filename (now const) to copy_strings_kernel(). A simpler alternative would be to cast the filename pointer in do_execve() when it's passed to copy_strings_kernel(). do_execve() may not change any of the strings it is passed as part of the argv or envp lists as they are some of them in .rodata, so marking these strings as const should be fine. Further kernel_execve() and sys_execve() need to be changed to match. This has been test built on x86_64, frv, arm and mips. Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-16microblaze: Fix of/address: Merge all of the bus translation codeMichal Simek
Commit dbbdee94734bf6f1db7af42008a53655e77cab8f removed of_irq_pci_swizzle but didn't use pci_swizzle_interrupt_pin instead. Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-13Mark arguments to certain syscalls as being constDavid Howells
Mark arguments to certain system calls as being const where they should be but aren't. The list includes: (*) The filename arguments of various stat syscalls, execve(), various utimes syscalls and some mount syscalls. (*) The filename arguments of some syscall helpers relating to the above. (*) The buffer argument of various write syscalls. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-05Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits) of/platform: Register of_platform_drivers with an "of:" prefix of/address: Clean up function declarations of/spi: call of_register_spi_devices() from spi core code of: Provide default of_node_to_nid() implementation. of/device: Make of_device_make_bus_id() usable by other code. of/irq: Fix endian issues in parsing interrupt specifiers of: Fix phandle endian issues of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string of: remove of_default_bus_ids of: make of_find_device_by_node generic microblaze: remove references to of_device and to_of_device sparc: remove references to of_device and to_of_device powerpc: remove references to of_device and to_of_device of/device: Replace of_device with platform_device in includes and core code of/device: Protect against binding of_platform_drivers to non-OF devices of: remove asm/of_device.h of: remove asm/of_platform.h of/platform: remove all of_bus_type and of_platform_bus_type references of: Merge of_platform_bus_type with platform_bus_type drivercore/of: Add OF style matching to platform bus ... Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just some obj-y removals by the devicetree branch, while the microblaze updates added a new file.
2010-08-04microblaze: Add KGDB supportMichal Simek
Kgdb uses brki r16, 0x18 instruction to call low level _debug_exception function which save current state to pt_regs and call microblaze_kgdb_break function. _debug_exception should be called only from the kernel space. User space calling is not supported because user application debugging uses different handling. pt_regs_to_gdb_regs loads additional special registers which can't be changed * Enable KGDB in Kconfig * Remove ancient not-tested KGDB support * Remove ancient _debug_exception code from entry.S Only MMU KGDB support is supported. Signed-off-by: Michal Simek <monstr@monstr.eu> CC: Jason Wessel <jason.wessel@windriver.com> CC: John Williams <john.williams@petalogix.com> CC: Edgar E. Iglesias <edgar.iglesias@petalogix.com> CC: linux-kernel@vger.kernel.org Acked-by: Jason Wessel <jason.wessel@windriver.com>
2010-08-04microblaze: Support brki rX, 0x18 for user application debuggingMichal Simek
This is the first patch which add support for user application debugging through brki rX, 0x18 vector. This patch has side effect which also remove security issue to use brki rX, 0x18 to freeze kernel. Support for old gdb support via priviledged exception (brk r0, r0) is still there. It will be remove in future. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Remove nop after MSRCLR/SET, MTS, MFS instructionsMichal Simek
We need to save instruction and the latest Microblaze shouldn't have any problem with it. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Simplify syscall rutineMichal Simek
Syscall can be called only from userspace that's why we don't need to check which space kernel come from. Kernel syscall calling is not check and shouldn't come throught this part of code. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Move PT_MODE saving to delay slotMichal Simek
We can save one more instruction if PT_MODE is saved in delay slot Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Fix _interrupt functionMichal Simek
Save instructions by using delay slot and clear UMS only if kernel comes from user space. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Fix _user_exception functionMichal Simek
Saving some instructions. Clear VMS bit if kernel comes from kernel space. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Put together addik instructionsMichal Simek
Saving instructions by adding 2/3 addik instructions to one. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Use delay slot in syscall macrosMichal Simek
Saving instruction with delay slot usage. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Save kernel mode in delay slotMichal Simek
This change save one instruction if kernel comes from kernel space. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Do not mix register saving and mode settingMichal Simek
Separate reg saving and mode setting. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Move SAVE_STATE upwardMichal Simek
SAVE_STATE macro could be used by other rutines too. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: entry.S: Macro optimizationMichal Simek
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>
2010-08-04microblaze: Optimize hw exception rutineMichal Simek
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>
2010-08-04microblaze: Implement clear_ums macro and fix SAVE_STATE macroMichal Simek
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>
2010-08-04microblaze: Remove additional setup for kernel_modeMichal Simek
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>
2010-08-04microblaze: Optimize SAVE_STATE macroMichal Simek
SAVE_STATE macro could be used for user_exception or interrupt functions. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Remove additional loadingMichal Simek
We don't need to save r0 to PT_R0. It could be additional operation. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Completely remove working with R11 registerMichal Simek
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>
2010-08-04microblaze: Do not setup BIP in _debug_exceptionMichal Simek
BIP is already setup. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Simplify _debug_exception functionMichal Simek
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>
2010-08-04microblaze: Optimize SAVE_STATE macroMichal Simek
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>
2010-08-04microblaze: trivial: Use la insted of addikMichal Simek
la is translated to addik by toolchain. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: remove enable_irq from SAVE_STATE macroMichal Simek
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>
2010-08-04microblaze: Move stack backup to SAVE_STATE macroMichal Simek
Remove code duplicity and move it to SAVE_STATE macro. There is no impact on performance. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Move BIP setup to the end of ret_from_trap/ret_from_excMichal Simek
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>
2010-08-04microblaze: Remove PER_CPU(KM) variableMichal Simek
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>
2010-08-04microblaze: Optimize clear_vms_ums macroMichal Simek
We can save two instruction when MSR_VMS and MSR_UMS are setup in one instruction. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Save and restore r3/r4 in SAVE/RESTORE_REGS macrosMichal Simek
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>
2010-08-04microblaze: Fix VM_ON and VM_OFF macrosMichal Simek
Jump behind macro. We don't want to execute nop instruction again. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Do not use _start in vmlinuxMichal Simek
_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>
2010-08-04microblaze: Decrease time shifting valuesMichal Simek
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>
2010-08-04microblaze: Do not trace cpu_relax functionMichal Simek
IRQsoff tracer requires to protect cpu_idle function to get correct timing report. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Improve ftrace time measuringMichal Simek
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>
2010-08-04microblaze: Add stack unwinderSteven J. Magnani
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>
2010-08-04microblaze: Allow PAGE_SIZE configurationSteven J. Magnani
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>
2010-08-04microblaze: Trace hardirqsMichal Simek
Add trace_hardirqs_off and trace_hardirqs_on to do_IRQ function. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04microblaze: Fix sys_clone syscallMichal Simek
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>
2010-08-04microblaze: Fix copy_to_user_page macroMichal Simek
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>
2010-08-02microblaze: Fix comment for TLBMichal Simek
There is wrong comment for TLB. Early printk uartlite console uses TLB 63. Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-07-24of: remove of_default_bus_idsJonas Bonn
This list used was by only two platforms with all other platforms defining an own list of valid bus id's to pass to of_platform_bus_probe. This patch: i) copies the default list to the two platforms that depended on it (powerpc) ii) remove the usage of of_default_bus_ids in of_platform_bus_probe iii) removes the definition of the list from all architectures that defined it Passing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the function returns no error in that case as the NULL value is equivalent to an empty list. Signed-off-by: Jonas Bonn <jonas@southpole.se> [grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-07-24of: make of_find_device_by_node genericJonas Bonn
There's no need for this function to be architecture specific and all four architectures defining it had the same definition. The function has been moved to drivers/of/platform.c. Signed-off-by: Jonas Bonn <jonas@southpole.se> [grant.likely@secretlab.ca: moved to drivers/of/platform.c, simplified code, and added kerneldoc comment] Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net>
2010-07-24microblaze: remove references to of_device and to_of_deviceGrant Likely
of_device is just a #define alias to platform_device. This patch replaces all references to it with platform_device. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-07-24of/platform: remove all of_bus_type and of_platform_bus_type referencesGrant Likely
Both of_bus_type and of_platform_bus_type are just #define aliases for the platform bus. This patch removes all references to them and switches to the of_register_platform_driver()/of_unregister_platform_driver() API for registering. Subsequent patches will convert each user of of_register_platform_driver() into plain platform_drivers without the of_platform_driver shim. At which point the of_register_platform_driver()/of_unregister_platform_driver() functions can be removed. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net>
2010-07-24of: Merge of_platform_bus_type with platform_bus_typeGrant Likely
of_platform_bus was being used in the same manner as the platform_bus. The only difference being that of_platform_bus devices are generated from data in the device tree, and platform_bus devices are usually statically allocated in platform code. Having them separate causes the problem of device drivers having to be registered twice if it was possible for the same device to appear on either bus. This patch removes of_platform_bus_type and registers all of_platform bus devices and drivers on the platform bus instead. A previous patch made the of_device structure an alias for the platform_device structure, and a shim is used to adapt of_platform_drivers to the platform bus. After all of of_platform_bus drivers are converted to be normal platform drivers, the shim code can be removed. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net>