summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm/uaccess.h
Commit message (Collapse)AuthorAgeFilesLines
* microblaze: mm: Fix lowmem max memory size limitsMichal Simek2012-03-231-1/+1
| | | | | | | | | | Use CONFIG_LOWMEM_SIZE if system has larger ram size. For system with larger ram size, enable HIGMEM support. Also setup limitation for memblock and use memblock allocation in lowmem region. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix access_ok macroMichal Simek2011-10-141-1/+1
| | | | | | | | | | | | | | | | There is the problem with bit OR (|) because for some combination is addr | size | addr+size equal to seq. For standard kernel setting (kernel starts at 0xC0000000) is seq for user space 0xBFFFFFFF and everything below this limit is fine. But even address 0xBFFFFFFF is fine because it is below kernel space. Signed-off-by: Andrew Fedonczuk <andrew.fedonczuk@ericsson.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix /dev/zero corruption from __clear_user()Steven J. Magnani2011-03-091-4/+4
| | | | | | | | | | | | | | | | A userland read of more than PAGE_SIZE bytes from /dev/zero results in (a) not all of the bytes returned being zero, and (b) memory corruption due to zeroing of bytes beyond the user buffer. This is caused by improper constraints on the assembly __clear_user function. The constrints don't indicate to the compiler that the pointer argument is modified. Since the function is inline, this results in double-incrementing of the pointer when __clear_user() is invoked through a multi-page read() of /dev/zero. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Acked-by: Michal Simek <monstr@monstr.eu> CC: stable@kernel.org
* 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>
* microblaze: fix get_user/put_user side-effectsSteven J. Magnani2010-05-131-18/+69
| | | | | | | | | | | | | | | The Microblaze implementations of get_user() and (MMU) put_user() evaluate the address argument more than once. This causes unexpected side-effects for invocations that include increment operators, i.e. get_user(foo, bar++). This patch also removes the distinction between MMU and noMMU put_user(). Without the patch: $ echo 1234567890 > /proc/sys/kernel/core_pattern $ cat /proc/sys/kernel/core_pattern 12345 Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
* microblaze: uaccess: Sync strlen, strnlen, copy_to/from_userMichal Simek2010-04-011-56/+32
| | | | | | Last sync. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: Unify __copy_tofrom_userMichal Simek2010-04-011-38/+21
| | | | | | Move to generic location. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: Move functions to generic locationMichal Simek2010-04-011-151/+61
| | | | | | noMMU and MMU use them. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: Fix put_user for noMMUMichal Simek2010-04-011-22/+56
| | | | | | | | Here is small regression on dhrystone tests and I think that on all benchmarking tests. It is due to better checking mechanism in put_user macro Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: Fix get_user macro for noMMUMichal Simek2010-04-011-23/+66
| | | | | | Use unified version. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: fix clear_user for noMMU kernelMichal Simek2010-04-011-45/+36
| | | | | | | Previous patches fixed only MMU version and this is the first patch for noMMU kernel Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: Fix strncpy_from_user functionMichal Simek2010-04-011-3/+11
| | | | | | Generic implementation for noMMU and MMU version Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: fix copy_from_user macroMichal Simek2010-04-011-9/+14
| | | | | | copy_from_user macro also use copy_tofrom_user function Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: copy_to_user unificationMichal Simek2010-04-011-9/+16
| | | | | | | noMMU and MMU kernel will use copy copy_tofrom_user asm implementation. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: sync put/get/clear_user macrosMichal Simek2010-04-011-37/+69
| | | | | | Add macro description and resort. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: fix put_user and get_user macrosMichal Simek2010-04-011-51/+49
| | | | | | Use FIXUP macros and resort them. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: fix __get_user_asm macroMichal Simek2010-04-011-16/+17
| | | | | | It is used __FIXUP_SECTION and __EX_TABLE_SECTION macros. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: uaccess: fix clean user macroMichal Simek2010-04-011-34/+55
| | | | | | | | This is the first patch which does uaccess unification. I choosed to do several patches to be able to use bisect in future if any fault happens. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: move noMMU __range_ok function to uaccess.hMichal Simek2010-04-011-1/+6
| | | | | | | The same noMMU and MMU functions should be placed in one file. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Move exception_table_entry upwardMichal Simek2010-04-011-16/+15
| | | | | | Just sort to be able remove whole block. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Remove segment.hMichal Simek2010-04-011-1/+29
| | | | | | | I would like to use asm-generic uaccess.h where are segment macros defined. This is just first step. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Simple __copy_tofrom_user for noMMUJohn Williams2009-12-141-6/+6
| | | | | | | | This is first patch which clear part of uaccess.h. uaccess.h will be clear later. Signed-off-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix put_user macro for 64bits argumentsMichal Simek2009-07-271-1/+1
| | | | | | | | | | | | | For 64bits arguments gcc caused that put_user macro works with wrong value because of optimalization. Adding volatile caused that gcc not optimized it. It is possible to use (as Blackfin do) two put_user macros with 32bits arguments but there is one more instruction which is due to duplication zero return value which is called put_user_asm macro. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze_mmu_v2: uaccess MMU updateMichal Simek2009-05-261-52/+246
| | | | Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: remove bad_user_access_lengthArnd Bergmann2009-05-211-4/+3
| | | | | | | | This function was actually causing harm, by hiding errors about invalid sized get_user/put_user accesses. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze_v8: uaccess filesMichal Simek2009-03-271-0/+134
Reviewed-by: Ingo Molnar <mingo@elte.hu> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: John Linn <john.linn@xilinx.com> Acked-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
OpenPOWER on IntegriCloud