Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64: don't pull uaccess.h into *.S

Split asm-only parts of arm64 uaccess.h into a new header and use that
from *.S.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro b4b8664d 7ce7d89f

+72 -71
+65
arch/arm64/include/asm/asm-uaccess.h
··· 1 + #ifndef __ASM_ASM_UACCESS_H 2 + #define __ASM_ASM_UACCESS_H 3 + 4 + #include <asm/alternative.h> 5 + #include <asm/kernel-pgtable.h> 6 + #include <asm/sysreg.h> 7 + #include <asm/assembler.h> 8 + 9 + /* 10 + * User access enabling/disabling macros. 11 + */ 12 + #ifdef CONFIG_ARM64_SW_TTBR0_PAN 13 + .macro __uaccess_ttbr0_disable, tmp1 14 + mrs \tmp1, ttbr1_el1 // swapper_pg_dir 15 + add \tmp1, \tmp1, #SWAPPER_DIR_SIZE // reserved_ttbr0 at the end of swapper_pg_dir 16 + msr ttbr0_el1, \tmp1 // set reserved TTBR0_EL1 17 + isb 18 + .endm 19 + 20 + .macro __uaccess_ttbr0_enable, tmp1 21 + get_thread_info \tmp1 22 + ldr \tmp1, [\tmp1, #TSK_TI_TTBR0] // load saved TTBR0_EL1 23 + msr ttbr0_el1, \tmp1 // set the non-PAN TTBR0_EL1 24 + isb 25 + .endm 26 + 27 + .macro uaccess_ttbr0_disable, tmp1 28 + alternative_if_not ARM64_HAS_PAN 29 + __uaccess_ttbr0_disable \tmp1 30 + alternative_else_nop_endif 31 + .endm 32 + 33 + .macro uaccess_ttbr0_enable, tmp1, tmp2 34 + alternative_if_not ARM64_HAS_PAN 35 + save_and_disable_irq \tmp2 // avoid preemption 36 + __uaccess_ttbr0_enable \tmp1 37 + restore_irq \tmp2 38 + alternative_else_nop_endif 39 + .endm 40 + #else 41 + .macro uaccess_ttbr0_disable, tmp1 42 + .endm 43 + 44 + .macro uaccess_ttbr0_enable, tmp1, tmp2 45 + .endm 46 + #endif 47 + 48 + /* 49 + * These macros are no-ops when UAO is present. 50 + */ 51 + .macro uaccess_disable_not_uao, tmp1 52 + uaccess_ttbr0_disable \tmp1 53 + alternative_if ARM64_ALT_PAN_NOT_UAO 54 + SET_PSTATE_PAN(1) 55 + alternative_else_nop_endif 56 + .endm 57 + 58 + .macro uaccess_enable_not_uao, tmp1, tmp2 59 + uaccess_ttbr0_enable \tmp1, \tmp2 60 + alternative_if ARM64_ALT_PAN_NOT_UAO 61 + SET_PSTATE_PAN(0) 62 + alternative_else_nop_endif 63 + .endm 64 + 65 + #endif
-64
arch/arm64/include/asm/uaccess.h
··· 22 22 #include <asm/kernel-pgtable.h> 23 23 #include <asm/sysreg.h> 24 24 25 - #ifndef __ASSEMBLY__ 26 - 27 25 /* 28 26 * User space memory access functions 29 27 */ ··· 421 423 422 424 extern __must_check long strlen_user(const char __user *str); 423 425 extern __must_check long strnlen_user(const char __user *str, long n); 424 - 425 - #else /* __ASSEMBLY__ */ 426 - 427 - #include <asm/assembler.h> 428 - 429 - /* 430 - * User access enabling/disabling macros. 431 - */ 432 - #ifdef CONFIG_ARM64_SW_TTBR0_PAN 433 - .macro __uaccess_ttbr0_disable, tmp1 434 - mrs \tmp1, ttbr1_el1 // swapper_pg_dir 435 - add \tmp1, \tmp1, #SWAPPER_DIR_SIZE // reserved_ttbr0 at the end of swapper_pg_dir 436 - msr ttbr0_el1, \tmp1 // set reserved TTBR0_EL1 437 - isb 438 - .endm 439 - 440 - .macro __uaccess_ttbr0_enable, tmp1 441 - get_thread_info \tmp1 442 - ldr \tmp1, [\tmp1, #TSK_TI_TTBR0] // load saved TTBR0_EL1 443 - msr ttbr0_el1, \tmp1 // set the non-PAN TTBR0_EL1 444 - isb 445 - .endm 446 - 447 - .macro uaccess_ttbr0_disable, tmp1 448 - alternative_if_not ARM64_HAS_PAN 449 - __uaccess_ttbr0_disable \tmp1 450 - alternative_else_nop_endif 451 - .endm 452 - 453 - .macro uaccess_ttbr0_enable, tmp1, tmp2 454 - alternative_if_not ARM64_HAS_PAN 455 - save_and_disable_irq \tmp2 // avoid preemption 456 - __uaccess_ttbr0_enable \tmp1 457 - restore_irq \tmp2 458 - alternative_else_nop_endif 459 - .endm 460 - #else 461 - .macro uaccess_ttbr0_disable, tmp1 462 - .endm 463 - 464 - .macro uaccess_ttbr0_enable, tmp1, tmp2 465 - .endm 466 - #endif 467 - 468 - /* 469 - * These macros are no-ops when UAO is present. 470 - */ 471 - .macro uaccess_disable_not_uao, tmp1 472 - uaccess_ttbr0_disable \tmp1 473 - alternative_if ARM64_ALT_PAN_NOT_UAO 474 - SET_PSTATE_PAN(1) 475 - alternative_else_nop_endif 476 - .endm 477 - 478 - .macro uaccess_enable_not_uao, tmp1, tmp2 479 - uaccess_ttbr0_enable \tmp1, \tmp2 480 - alternative_if ARM64_ALT_PAN_NOT_UAO 481 - SET_PSTATE_PAN(0) 482 - alternative_else_nop_endif 483 - .endm 484 - 485 - #endif /* __ASSEMBLY__ */ 486 426 487 427 #endif /* __ASM_UACCESS_H */
+1 -1
arch/arm64/kernel/entry.S
··· 31 31 #include <asm/memory.h> 32 32 #include <asm/ptrace.h> 33 33 #include <asm/thread_info.h> 34 - #include <linux/uaccess.h> 34 + #include <asm/asm-uaccess.h> 35 35 #include <asm/unistd.h> 36 36 37 37 /*
+1 -1
arch/arm64/lib/clear_user.S
··· 17 17 */ 18 18 #include <linux/linkage.h> 19 19 20 - #include <linux/uaccess.h> 20 + #include <asm/asm-uaccess.h> 21 21 22 22 .text 23 23
+1 -1
arch/arm64/lib/copy_from_user.S
··· 17 17 #include <linux/linkage.h> 18 18 19 19 #include <asm/cache.h> 20 - #include <linux/uaccess.h> 20 + #include <asm/asm-uaccess.h> 21 21 22 22 /* 23 23 * Copy from user space to a kernel buffer (alignment handled by the hardware)
+1 -1
arch/arm64/lib/copy_in_user.S
··· 19 19 #include <linux/linkage.h> 20 20 21 21 #include <asm/cache.h> 22 - #include <linux/uaccess.h> 22 + #include <asm/asm-uaccess.h> 23 23 24 24 /* 25 25 * Copy from user space to user space (alignment handled by the hardware)
+1 -1
arch/arm64/lib/copy_to_user.S
··· 17 17 #include <linux/linkage.h> 18 18 19 19 #include <asm/cache.h> 20 - #include <linux/uaccess.h> 20 + #include <asm/asm-uaccess.h> 21 21 22 22 /* 23 23 * Copy to user space from a kernel buffer (alignment handled by the hardware)
+1 -1
arch/arm64/mm/cache.S
··· 23 23 #include <asm/assembler.h> 24 24 #include <asm/cpufeature.h> 25 25 #include <asm/alternative.h> 26 - #include <linux/uaccess.h> 26 + #include <asm/asm-uaccess.h> 27 27 28 28 /* 29 29 * flush_icache_range(start,end)
+1 -1
arch/arm64/xen/hypercall.S
··· 49 49 50 50 #include <linux/linkage.h> 51 51 #include <asm/assembler.h> 52 - #include <linux/uaccess.h> 52 + #include <asm/asm-uaccess.h> 53 53 #include <xen/interface/xen.h> 54 54 55 55