1
linux/arch/arm/lib
Catalin Marinas 247055aa21 ARM: 6384/1: Remove the domain switching on ARMv6k/v7 CPUs
This patch removes the domain switching functionality via the set_fs and
__switch_to functions on cores that have a TLS register.

Currently, the ioremap and vmalloc areas share the same level 1 page
tables and therefore have the same domain (DOMAIN_KERNEL). When the
kernel domain is modified from Client to Manager (via the __set_fs or in
the __switch_to function), the XN (eXecute Never) bit is overridden and
newer CPUs can speculatively prefetch the ioremap'ed memory.

Linux performs the kernel domain switching to allow user-specific
functions (copy_to/from_user, get/put_user etc.) to access kernel
memory. In order for these functions to work with the kernel domain set
to Client, the patch modifies the LDRT/STRT and related instructions to
the LDR/STR ones.

The user pages access rights are also modified for kernel read-only
access rather than read/write so that the copy-on-write mechanism still
works. CPU_USE_DOMAINS gets disabled only if the hardware has a TLS register
(CPU_32v6K is defined) since writing the TLS value to the high vectors page
isn't possible.

The user addresses passed to the kernel are checked by the access_ok()
function so that they do not point to the kernel space.

Tested-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-04 15:44:31 +00:00
..
ashldi3.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
ashrdi3.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
backtrace.S ARM: fix build error in arch/arm/kernel/process.c 2010-04-21 08:45:21 +01:00
bitops.h Complete irq tracing support for ARM 2009-08-13 20:34:37 +02:00
changebit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
clear_user.S ARM: 6110/1: Fix Thumb-2 kernel builds when UACCESS_WITH_MEMCPY is enabled 2010-05-08 10:45:26 +01:00
clearbit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
copy_from_user.S ARM: fix build error in arch/arm/kernel/process.c 2010-04-21 08:45:21 +01:00
copy_page.S ARM: 5701/1: ARM: copy_page.S: take into account the size of the cache line 2009-09-15 22:07:02 +01:00
copy_template.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
copy_to_user.S ARM: 6110/1: Fix Thumb-2 kernel builds when UACCESS_WITH_MEMCPY is enabled 2010-05-08 10:45:26 +01:00
csumipv6.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
csumpartial.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
csumpartialcopy.S [ARM] 5231/1: Do not save the frame pointer in the csum_partial_copy_* functions 2008-09-01 12:06:35 +01:00
csumpartialcopygeneric.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
csumpartialcopyuser.S ARM: Fix csum_partial_copy_from_user() 2010-07-26 12:18:16 +01:00
delay.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
div64.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
ecard.S [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
findbit.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
floppydma.S
getuser.S ARM: 6384/1: Remove the domain switching on ARMv6k/v7 CPUs 2010-11-04 15:44:31 +00:00
io-acorn.S
io-readsb.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
io-readsl.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
io-readsw-armv3.S [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
io-readsw-armv4.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
io-shark.c
io-writesb.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
io-writesl.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
io-writesw-armv3.S [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
io-writesw-armv4.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
lib1funcs.S Nicolas Pitre has a new email address 2009-09-15 09:37:12 -07:00
lshrdi3.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
Makefile ARM: Remove support for LinkUp Systems L7200 SDP. 2010-06-24 15:41:31 +01:00
memchr.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
memcpy.S Thumb-2: Implement the unified arch/arm/lib functions 2009-07-24 12:32:57 +01:00
memmove.S ARM: 6006/1: ARM: Use the correct NOP size in memmove for Thumb-2 kernel builds 2010-03-29 17:33:33 +01:00
memset.S [ARM] remove memzero() 2008-11-27 12:37:59 +00:00
memzero.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
muldi3.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
putuser.S ARM: 6384/1: Remove the domain switching on ARMv6k/v7 CPUs 2010-11-04 15:44:31 +00:00
setbit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
sha1.S Nicolas Pitre has a new email address 2009-09-15 09:37:12 -07:00
strchr.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
strncpy_from_user.S ARM: fix build error in arch/arm/kernel/process.c 2010-04-21 08:45:21 +01:00
strnlen_user.S ARM: fix build error in arch/arm/kernel/process.c 2010-04-21 08:45:21 +01:00
strrchr.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
testchangebit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
testclearbit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
testsetbit.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
uaccess_with_memcpy.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
uaccess.S ARM: 6384/1: Remove the domain switching on ARMv6k/v7 CPUs 2010-11-04 15:44:31 +00:00
ucmpdi2.S [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00