Skip to content

Commit 399f157

Browse files
author
Russell King
committed
Merge branch 'devel-stable' into misc
2 parents a09975b + 1a08e3d commit 399f157

51 files changed

Lines changed: 569 additions & 337 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/DocBook/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DOCBOOKS := z8530book.xml \
1212
kernel-api.xml filesystems.xml lsm.xml kgdb.xml \
1313
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
1414
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
15-
80211.xml sh.xml regulator.xml w1.xml \
15+
sh.xml regulator.xml w1.xml \
1616
writing_musb_glue_layer.xml iio.xml
1717

1818
ifeq ($(DOCBOOKS),)

‎Documentation/unaligned-memory-access.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
151151
#else
152152
const u16 *a = (const u16 *)addr1;
153153
const u16 *b = (const u16 *)addr2;
154-
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
154+
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
155155
#endif
156156
}
157157

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION = 4
22
PATCHLEVEL = 10
33
SUBLEVEL = 0
4-
EXTRAVERSION = -rc1
4+
EXTRAVERSION = -rc2
55
NAME = Roaring Lionus
66

77
# *DOCUMENTATION*
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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

‎arch/arm64/include/asm/uaccess.h‎

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include <asm/kernel-pgtable.h>
2323
#include <asm/sysreg.h>
2424

25-
#ifndef __ASSEMBLY__
26-
2725
/*
2826
* User space memory access functions
2927
*/
@@ -424,66 +422,4 @@ extern long strncpy_from_user(char *dest, const char __user *src, long count);
424422
extern __must_check long strlen_user(const char __user *str);
425423
extern __must_check long strnlen_user(const char __user *str, long n);
426424

427-
#else /* __ASSEMBLY__ */
428-
429-
#include <asm/assembler.h>
430-
431-
/*
432-
* User access enabling/disabling macros.
433-
*/
434-
#ifdef CONFIG_ARM64_SW_TTBR0_PAN
435-
.macro __uaccess_ttbr0_disable, tmp1
436-
mrs \tmp1, ttbr1_el1 // swapper_pg_dir
437-
add \tmp1, \tmp1, #SWAPPER_DIR_SIZE // reserved_ttbr0 at the end of swapper_pg_dir
438-
msr ttbr0_el1, \tmp1 // set reserved TTBR0_EL1
439-
isb
440-
.endm
441-
442-
.macro __uaccess_ttbr0_enable, tmp1
443-
get_thread_info \tmp1
444-
ldr \tmp1, [\tmp1, #TSK_TI_TTBR0] // load saved TTBR0_EL1
445-
msr ttbr0_el1, \tmp1 // set the non-PAN TTBR0_EL1
446-
isb
447-
.endm
448-
449-
.macro uaccess_ttbr0_disable, tmp1
450-
alternative_if_not ARM64_HAS_PAN
451-
__uaccess_ttbr0_disable \tmp1
452-
alternative_else_nop_endif
453-
.endm
454-
455-
.macro uaccess_ttbr0_enable, tmp1, tmp2
456-
alternative_if_not ARM64_HAS_PAN
457-
save_and_disable_irq \tmp2 // avoid preemption
458-
__uaccess_ttbr0_enable \tmp1
459-
restore_irq \tmp2
460-
alternative_else_nop_endif
461-
.endm
462-
#else
463-
.macro uaccess_ttbr0_disable, tmp1
464-
.endm
465-
466-
.macro uaccess_ttbr0_enable, tmp1, tmp2
467-
.endm
468-
#endif
469-
470-
/*
471-
* These macros are no-ops when UAO is present.
472-
*/
473-
.macro uaccess_disable_not_uao, tmp1
474-
uaccess_ttbr0_disable \tmp1
475-
alternative_if ARM64_ALT_PAN_NOT_UAO
476-
SET_PSTATE_PAN(1)
477-
alternative_else_nop_endif
478-
.endm
479-
480-
.macro uaccess_enable_not_uao, tmp1, tmp2
481-
uaccess_ttbr0_enable \tmp1, \tmp2
482-
alternative_if ARM64_ALT_PAN_NOT_UAO
483-
SET_PSTATE_PAN(0)
484-
alternative_else_nop_endif
485-
.endm
486-
487-
#endif /* __ASSEMBLY__ */
488-
489425
#endif /* __ASM_UACCESS_H */

‎arch/arm64/kernel/entry.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <asm/memory.h>
3232
#include <asm/ptrace.h>
3333
#include <asm/thread_info.h>
34-
#include <linux/uaccess.h>
34+
#include <asm/asm-uaccess.h>
3535
#include <asm/unistd.h>
3636

3737
/*

‎arch/arm64/lib/clear_user.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
#include <linux/linkage.h>
1919

20-
#include <linux/uaccess.h>
20+
#include <asm/asm-uaccess.h>
2121

2222
.text
2323

‎arch/arm64/lib/copy_from_user.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <linux/linkage.h>
1818

1919
#include <asm/cache.h>
20-
#include <linux/uaccess.h>
20+
#include <asm/asm-uaccess.h>
2121

2222
/*
2323
* Copy from user space to a kernel buffer (alignment handled by the hardware)

‎arch/arm64/lib/copy_in_user.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <linux/linkage.h>
2020

2121
#include <asm/cache.h>
22-
#include <linux/uaccess.h>
22+
#include <asm/asm-uaccess.h>
2323

2424
/*
2525
* Copy from user space to user space (alignment handled by the hardware)

‎arch/arm64/lib/copy_to_user.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <linux/linkage.h>
1818

1919
#include <asm/cache.h>
20-
#include <linux/uaccess.h>
20+
#include <asm/asm-uaccess.h>
2121

2222
/*
2323
* Copy to user space from a kernel buffer (alignment handled by the hardware)

0 commit comments

Comments
 (0)