Commit Graph

13 Commits

Author SHA1 Message Date
Arnd Bergmann b26b181651 microblaze: use generic strncpy/strnlen from_user
Remove the microblaze implemenation of strncpy/strnlen and instead use
the generic versions.  The microblaze version is fairly slow because it
always does byte accesses even for aligned data, and it lacks a checks
for user_addr_max().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-07-27 23:01:13 +02:00
Bhaskar Chowdhury bbcee72c2f microblaze: Fix a typo
s/storign/storing/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210319045323.21241-1-unixbhaskar@gmail.com
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2021-03-22 09:26:39 +01:00
Michal Simek 1de9e46c21 microblaze: Fix strncpy_from_user macro
Problem happens when len in strncpy_from_user is setup
and passing string has len-1 chars + \0 terminated
character. In this case was returned incorrect length
of the string.
It should always retunrs the length of the string
(not including the trailing NULL).

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-02-12 11:24:44 +01:00
Michal Simek ac64a9caa5 microblaze: Fix stack usage in PAGE_SIZE copy_tofrom_user
If access to user space failed we need to reconstruct
stack pointer and restore all register.

This patch fixed problem introduces by:
"microblaze: Add loop unrolling for PAGE in copy_tofrom_user"
(sha1: ebe211254b)

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-03-30 11:37:13 +02:00
Michal Simek cb5edfe3e5 microblaze: Use delay slot in __strnlen_user, __strncpy_user
Use delay slot to speedup if maxlen is zero.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:34 +02:00
Michal Simek ebe211254b microblaze: Add loop unrolling for PAGE in copy_tofrom_user
Increase performance by loop unrolling.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:26 +02:00
Michal Simek 782d491fc2 microblaze: Simplify logic for unaligned byte copying
Save jump instruction for unaligned byte copying.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:25 +02:00
Michal Simek c83858b3e6 microblaze: Change label names - copy_tofrom_user
Change label name to be prepared for loop unrolling.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:22 +02:00
Michal Simek eedac7914d microblaze: Separate fixup section definition
Move fixups below appropriate code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:22 +02:00
Michal Simek 9b133f8d87 microblaze: Change label name in copy_tofrom_user
Use label 0: for zero length copying and fixups.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:21 +02:00
Michal Simek ca3865bae5 microblaze: Support word copying in copy_tofrom_user
Word copying is used only for aligned addresses.
Here is space for improving to use any better copying technique.
Look at memcpy implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:25 +02:00
Michal Simek 13851966da microblaze: Add .type and .size to ASM functions
Cachegrind analysis need this fix to be able to log asm functions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 0d6de95326 microblaze_mmu_v2: uaccess MMU update
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-05-26 16:45:20 +02:00