aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-26MIPS: kernel: {ftrace,kgdb}: Set correct address limit for cache flushesLeonid Yegoshin2-1/+21
When flushing the icache, make sure the address limit is correct so the appropriate 'cache' instruction will be used. This has no impact on cores operating in non-eva mode. However, when EVA is enabled, we ensure that 'cache' will be used instead of 'cachee'. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: r4kcache: Add EVA cache flushing functionsLeonid Yegoshin1-1/+151
Add EVA cache flushing functions similar to non-EVA configurations. Because the cache may or may not contain user virtual addresses, we need to use the 'cache' or 'cachee' instruction based on whether we flush the cache on behalf of kernel or user respectively. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: r4kcache: Add protected cache operation for EVALeonid Yegoshin1-0/+18
Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: r4kcache: Build flushing code for instruction cacheLeonid Yegoshin1-0/+1
Build code to invalidate an address range in the instruction cache using the Hit Invalidate cache operation. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: kernel: signal: Prevent save/restore FPU context in user memoryLeonid Yegoshin1-0/+32
EVA does not have FPU specific instructions for reading or writing FPU registers from userspace memory. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: checksum: Add MIPS specific csum_and_copy_from_user functionLeonid Yegoshin1-0/+14
A MIPS specific csum_and_copy_from_user function is necessary because the generic one from include/net/checksum.h will not work for EVA. This is because the generic one will link to symbols from lib/checksum.c which are not EVA aware. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: checksum: Split kernel and user copy operationsLeonid Yegoshin1-6/+16
In EVA mode, different instructions need to be used to read/write from kernel and userland. In non-EVA mode, there is no functional difference. The current address limit is checked to decide the type of operation that will be performed. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: csum_partial: Add EVA supportMarkos Chandras1-0/+25
Use EVA specific functions to read and write data to user address space. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: csum_partial: Add macro to build csum_partial symbolsMarkos Chandras1-92/+108
In preparation for EVA support, we use a macro to build the __csum_partial_copy_user main code so it can be shared across multiple implementations. EVA uses the same code but it replaces the load/store/prefetch instructions with the EVA specific ones therefore using a macro avoids unnecessary code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: csum_partial: Merge EXC and load/store macrosMarkos Chandras1-69/+91
Each load/store macro always adds an entry to the __ex_table using the EXC macro. There are cases where a load instruction may never fail such as when we are sure the load happens in the kernel address space. Therefore, we merge these the EXC and LOADX/STOREX macros into a single one. We also expand the argument list in the EXC macro to make the macro more flexible. The extra 'type' argument is not used by this commit, but it will be used when EVA support is added to memcpy. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: checksum: Split the 'copy_user' symbolMarkos Chandras3-10/+21
The 'copy_user' symbol can be used to copy from or to userland so we will use two different symbols for these operations. This makes no difference in the existing code, but when the core is operating in EVA mode, different instructions need to be used to read and write to userland address space. The old function has also been renamed to 'copy_kernel' to denote that it is suitable for copy data to and from kernel space. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: kernel: unaligned: Handle unaligned accesses for EVALeonid Yegoshin1-1/+85
Handle unaligned accesses when we access userspace memory EVA mode. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: kernel: unaligned: Add EVA instruction wrappersMarkos Chandras1-24/+25
Use the load/store instruction wrappers from asm/asm.h to perform such operations when operating in EVA mode. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Add EVA support for str*_user operationsMarkos Chandras1-53/+119
The str*_user functions are used to securely access NULL terminated strings from userland. Therefore, it's necessary to use the appropriate EVA function. However, if the string is in kernel space, then the normal instructions are being used to access it. The __str*_kernel_asm and __str*_user_asm symbols are the same for non-EVA mode so there is no functional change for the non-EVA kernels. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Add EVA support to copy_{in, to,from}_userMarkos Chandras1-20/+171
Use the EVA specific functions from memcpy.S to perform userspace operations. When get_fs() == get_ds() the usual load/store instructions are used because the destination address is located in the kernel address space region. Otherwise, the EVA specifc load/store instructions are used which will go through th TLB to perform the virtual to physical translation for the userspace address. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Rename {get,put}_user_asm macrosMarkos Chandras1-30/+30
The {get,put}_user_asm functions can be used to load data from kernel or the user address space so rename them to avoid confusion. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Use EVA instructions wrappersMarkos Chandras1-24/+109
Use the EVA instruction wrappers from asm.h to perform read/write operations from userland. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Disable unaligned access macros for EVALeonid Yegoshin1-0/+6
ulb, ulh, ulw are macros which emulate unaligned access for MIPS. However, no such macros exist for EVA mode, so the only way to do EVA unaligned accesses is in the ADE exception handler. As a result of which, disable these macros for EVA. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Move duplicated code to common functionMarkos Chandras1-32/+29
Similar to __get_user_* functions, move common code to __put_user_*_common so it can be shared among similar users. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: uaccess: Add instruction argument to __{put,get}_user_asmMarkos Chandras1-13/+13
In preparation for EVA support, an instruction argument is needed for the __get_user_asm{,_ll32} functions to allow instruction overrides in EVA mode. Even though EVA only works for MIPS 32-bit, both codepaths are changed (32-bit and 64-bit) for consistency reasons. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memset: Add EVA support for the __bzero function.Markos Chandras1-4/+23
Build the __bzero function using the EVA load/store instructions when operating in the EVA mode. This function is only used when accessing user code so there is no need to build two distinct symbols for user and kernel operations respectively. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memset: Use macro to build the __bzero symbolMarkos Chandras1-35/+60
Build the __bzero symbol using a macor. In EVA mode we will need to use similar code to do the userspace load operations so it is better if we use a macro to avoid code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memset: Whitespace fixesMarkos Chandras1-15/+15
Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memcpy: Add EVA supportMarkos Chandras2-0/+83
Add copy_{to,from,in}_user when the CPU operates in EVA mode. This is necessary so the EVA specific instructions can be used to perform the virtual to physical translation for user space addresses. We will use the non-EVA functions to read from kernel if needed. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memcpy: Use macro to build the copy_user codeMarkos Chandras1-110/+143
The code can be shared between EVA and non-EVA configurations, therefore use a macro to build it to avoid code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memcpy: Split source and destination prefetch macrosMarkos Chandras1-14/+22
In preparation for EVA support, the PREF macro is split into two separate macros, PREFS and PREFD, for source and destination data prefetching respectively. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: memcpy: Merge EXC and load/store macrosMarkos Chandras1-69/+89
Each load/store macro always adds an entry to the __ex_table using the EXC macro. Therefore, these load/store macros are now merged with the EXC one. The argument list is also expanded in order to make the macro more flexible. The extra 'type' argument is not used by this commit, but it will be used when the EVA support is added to the memcpy. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strncpy_user: Add EVA supportMarkos Chandras2-0/+25
In non-EVA mode, strncpy_from_user* aliases are used for the strncpy_from_kernel* symbols since the code is identical. In EVA mode, new strcpy_from_user* symbols are used which use the EVA specific instructions to load values from userspace. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strncpy_user: Use macro to build the strncpy_from_user symbolMarkos Chandras1-8/+13
Build the __strncpy_from_user symbol using a macro. In EVA mode we will need to use similar code to do the userspace load operations so it is better if we use a macro to avoid code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strlen_user: Add EVA supportMarkos Chandras2-0/+24
In non-EVA mode, strlen_user* aliases are used for the strlen_kernel* symbols since the code is identical. In EVA mode, new strlen_user* symbols are used which use the EVA specific instructions to load values from userspace. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strlen_user: Use macro to build the strlen_user symbolMarkos Chandras1-6/+10
Build the __strlen_user symbol using a macro. In EVA mode we will need to use similar code to do the userspace load operations so it is better if we use a macro to avoid code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strnlen_user: Add EVA supportMarkos Chandras2-0/+24
In non-EVA mode, a strlen_user* alias is used for the strlen_kernel* symbols since the code is identical. In EVA mode, a new strlen_user* symbol is used which uses the EVA specific instructions to load values from userspace. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: lib: strnlen_user: Use macro to build the strnlen_user symbolMarkos Chandras1-6/+10
Build the __strnlen_user symbol using a macro. In EVA mode we will need to use similar code to do the userspace load operations so it is better if we use a macro to avoid code duplications. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: traps: Set correct address limit for breakpoints and trapsLeonid Yegoshin1-0/+12
When a breakpoint or trap happens when operating in kernel mode but on users behalf (eg syscall) it is necessary to change the address limit to KERNEL_DS so any address checking can be bypassed and print the correct stack trace. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: kernel: traps: Whitespace clean upMarkos Chandras1-7/+10
Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: kernel: scall32-o32: Use EVA wrappers to fetch syscall argumentsMarkos Chandras1-4/+5
Arguments 4-8 are stored on user's stack, so use the EVA instructions to fetch them if EVA is enabled. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: uapi: inst: Add instruction format for SPECIAL3 instructionsLeonid Yegoshin1-0/+11
Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: uapi: inst: Add new EVA opcodesLeonid Yegoshin1-4/+10
Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: futex: Add EVA support for futex operationsMarkos Chandras1-4/+5
Use LLE/SCE instructions for performing an address translation for userspace when EVA is enabled. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: Add wrappers for EVA/non-EVA instructionsMarkos Chandras2-0/+136
EVA uses specific instructions for accessing user memory. Instead of polluting the kernel with numerous #ifdef CONFIG_EVA we add wrappers for all the instructions that need special handling when EVA is enabled. Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: asm: Add prefetch instruction for EVALeonid Yegoshin1-0/+8
EVA can use the PREFE instruction to perform the virtual address translation using the user mapping of the address rather than the kernel mapping. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: Kconfig: Add Kconfig symbols for EVA supportLeonid Yegoshin1-1/+27
Add basic Kconfig support for EVA. Not selectable by any platform at this point. Signed-off-by: Leonid Yegoshin <[email protected]> Signed-off-by: Markos Chandras <[email protected]>
2014-03-26MIPS: OProfile: Add CPU_P5600 casesJames Hogan2-0/+5
Add a CPU_P5600 cpu type case in oprofile_arch_init() to use the MIPS model, and in mipsxx_init() to set the cpu_type string to "mips/P5600". Signed-off-by: James Hogan <[email protected]> Reviewed-by: Markos Chandras <[email protected]> Cc: [email protected] Cc: Robert Richter <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6410/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Allow FTLB to be turned on for CPU_P5600James Hogan1-5/+7
Allow FTLB to be turned on or off for CPU_P5600 as well as CPU_PROAPTIV. The existing if statement is converted into a switch to allow for future expansion. Signed-off-by: James Hogan <[email protected]> Reviewed-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6411/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Add MIPS P5600 probe supportJames Hogan1-0/+4
Add a case in cpu_probe_mips for the MIPS P5600 processor ID, which sets the CPU type to the new CPU_P5600. Signed-off-by: James Hogan <[email protected]> Reviewed-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6409/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Add cases for CPU_P5600James Hogan7-0/+7
Add a CPU_P5600 case to various switch statements, doing the same thing as for CPU_PROAPTIV. Signed-off-by: James Hogan <[email protected]> Reviewed-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6408/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Add MIPS P5600 PRid and cputype identifiersJames Hogan1-1/+2
Add a Processor ID and CPU type for the MIPS P5600 core. Signed-off-by: James Hogan <[email protected]> Reviewed-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6407/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Save/restore MSA context around signalsPaul Burton6-16/+357
This patch extends sigcontext in order to hold the most significant 64 bits of each vector register in addition to the MSA control & status register. The least significant 64 bits are already saved as the scalar FP context. This makes things a little awkward since the least & most significant 64 bits of each vector register are not contiguous in memory. Thus the copy_u & insert instructions are used to transfer the values of the most significant 64 bits via GP registers. Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6533/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Warn if vector register partitioning is implementedPaul Burton1-1/+4
No current systems implementing MSA include support for vector register partitioning which makes it somewhat difficult to implement support for it in the kernel. Thus for the moment the kernel includes no such support. However if the kernel were to be run on a system which implemented register partitioning then it would not function correctly, mishandling MSA disabled exceptions. Print a warning if run on a system with vector register partitioning implemented to indicate this problem should it occur. Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6494/ Signed-off-by: Ralf Baechle <[email protected]>
2014-03-26MIPS: Dumb MSA FP exception handlerPaul Burton2-0/+13
This patch adds a simple handler for MSA FP exceptions which delivers a SIGFPE to the running task. In the future it should probably be extended to re-execute the instruction with the MSACSR.NX bit set in order to generate results for any elements which did not cause an exception before delivering the SIGFPE signal. Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/6432/ Signed-off-by: Ralf Baechle <[email protected]>