+++ /dev/null
-From eea60ff4d4e95ee775c7455b3abaa9c8546c95fc Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 18 Feb 2019 00:56:58 +0100
-Subject: ARM: 8843/1: use unified assembler in headers
-
-From: Stefan Agner <stefan@agner.ch>
-
-[ Upstream commit c001899a5d6c2d7a0f3b75b2307ddef137fb46a6 ]
-
-Use unified assembler syntax (UAL) in headers. Divided syntax is
-considered deprecated. This will also allow to build the kernel
-using LLVM's integrated assembler.
-
-Signed-off-by: Stefan Agner <stefan@agner.ch>
-Acked-by: Nicolas Pitre <nico@linaro.org>
-Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/include/asm/assembler.h | 12 ++++++------
- arch/arm/include/asm/vfpmacros.h | 8 ++++----
- arch/arm/lib/bitops.h | 8 ++++----
- 3 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
-index 7d727506096f..c9ed0b0e0737 100644
---- a/arch/arm/include/asm/assembler.h
-+++ b/arch/arm/include/asm/assembler.h
-@@ -372,9 +372,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
- .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
- 9999:
- .if \inc == 1
-- \instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
-+ \instr\()b\t\cond\().w \reg, [\ptr, #\off]
- .elseif \inc == 4
-- \instr\cond\()\t\().w \reg, [\ptr, #\off]
-+ \instr\t\cond\().w \reg, [\ptr, #\off]
- .else
- .error "Unsupported inc macro argument"
- .endif
-@@ -413,9 +413,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
- .rept \rept
- 9999:
- .if \inc == 1
-- \instr\cond\()b\()\t \reg, [\ptr], #\inc
-+ \instr\()b\t\cond \reg, [\ptr], #\inc
- .elseif \inc == 4
-- \instr\cond\()\t \reg, [\ptr], #\inc
-+ \instr\t\cond \reg, [\ptr], #\inc
- .else
- .error "Unsupported inc macro argument"
- .endif
-@@ -456,7 +456,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
- .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
- #ifndef CONFIG_CPU_USE_DOMAINS
- adds \tmp, \addr, #\size - 1
-- sbcccs \tmp, \tmp, \limit
-+ sbcscc \tmp, \tmp, \limit
- bcs \bad
- #ifdef CONFIG_CPU_SPECTRE
- movcs \addr, #0
-@@ -470,7 +470,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
- sub \tmp, \limit, #1
- subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
- addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
-- subhss \tmp, \tmp, \size @ tmp = limit - (addr + size) }
-+ subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
- movlo \addr, #0 @ if (tmp < 0) addr = NULL
- csdb
- #endif
-diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
-index 301c1db3e99b..66748c04aed2 100644
---- a/arch/arm/include/asm/vfpmacros.h
-+++ b/arch/arm/include/asm/vfpmacros.h
-@@ -28,13 +28,13 @@
- ldr \tmp, =elf_hwcap @ may not have MVFR regs
- ldr \tmp, [\tmp, #0]
- tst \tmp, #HWCAP_VFPD32
-- ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
-+ ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
- addeq \base, \base, #32*4 @ step over unused register space
- #else
- VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
- and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
- cmp \tmp, #2 @ 32 x 64bit registers?
-- ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
-+ ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
- addne \base, \base, #32*4 @ step over unused register space
- #endif
- #endif
-@@ -52,13 +52,13 @@
- ldr \tmp, =elf_hwcap @ may not have MVFR regs
- ldr \tmp, [\tmp, #0]
- tst \tmp, #HWCAP_VFPD32
-- stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
-+ stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
- addeq \base, \base, #32*4 @ step over unused register space
- #else
- VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
- and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
- cmp \tmp, #2 @ 32 x 64bit registers?
-- stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
-+ stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
- addne \base, \base, #32*4 @ step over unused register space
- #endif
- #endif
-diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
-index 7d807cfd8ef5..d9c32b822eda 100644
---- a/arch/arm/lib/bitops.h
-+++ b/arch/arm/lib/bitops.h
-@@ -6,7 +6,7 @@
- ENTRY( \name )
- UNWIND( .fnstart )
- ands ip, r1, #3
-- strneb r1, [ip] @ assert word-aligned
-+ strbne r1, [ip] @ assert word-aligned
- mov r2, #1
- and r3, r0, #31 @ Get bit offset
- mov r0, r0, lsr #5
-@@ -31,7 +31,7 @@ ENDPROC(\name )
- ENTRY( \name )
- UNWIND( .fnstart )
- ands ip, r1, #3
-- strneb r1, [ip] @ assert word-aligned
-+ strbne r1, [ip] @ assert word-aligned
- mov r2, #1
- and r3, r0, #31 @ Get bit offset
- mov r0, r0, lsr #5
-@@ -61,7 +61,7 @@ ENDPROC(\name )
- ENTRY( \name )
- UNWIND( .fnstart )
- ands ip, r1, #3
-- strneb r1, [ip] @ assert word-aligned
-+ strbne r1, [ip] @ assert word-aligned
- and r2, r0, #31
- mov r0, r0, lsr #5
- mov r3, #1
-@@ -88,7 +88,7 @@ ENDPROC(\name )
- ENTRY( \name )
- UNWIND( .fnstart )
- ands ip, r1, #3
-- strneb r1, [ip] @ assert word-aligned
-+ strbne r1, [ip] @ assert word-aligned
- and r3, r0, #31
- mov r0, r0, lsr #5
- save_and_disable_irqs ip
---
-2.25.1
-
+++ /dev/null
-From 5fdd29e7beddf9834319bba2ec9b73c1a0988561 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 3 May 2020 13:03:54 +0100
-Subject: ARM: uaccess: consolidate uaccess asm to asm/uaccess-asm.h
-
-From: Russell King <rmk+kernel@armlinux.org.uk>
-
-[ Upstream commit 747ffc2fcf969eff9309d7f2d1d61cb8b9e1bb40 ]
-
-Consolidate the user access assembly code to asm/uaccess-asm.h. This
-moves the csdb, check_uaccess, uaccess_mask_range_ptr, uaccess_enable,
-uaccess_disable, uaccess_save, uaccess_restore macros, and creates two
-new ones for exception entry and exit - uaccess_entry and uaccess_exit.
-
-This makes the uaccess_save and uaccess_restore macros private to
-asm/uaccess-asm.h.
-
-Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/include/asm/assembler.h | 75 +-------------------
- arch/arm/include/asm/uaccess-asm.h | 106 +++++++++++++++++++++++++++++
- arch/arm/kernel/entry-armv.S | 11 +--
- arch/arm/kernel/entry-header.S | 9 +--
- 4 files changed, 112 insertions(+), 89 deletions(-)
- create mode 100644 arch/arm/include/asm/uaccess-asm.h
-
-diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
-index c9ed0b0e0737..1cd39b1229eb 100644
---- a/arch/arm/include/asm/assembler.h
-+++ b/arch/arm/include/asm/assembler.h
-@@ -21,11 +21,11 @@
- #endif
-
- #include <asm/ptrace.h>
--#include <asm/domain.h>
- #include <asm/opcodes-virt.h>
- #include <asm/asm-offsets.h>
- #include <asm/page.h>
- #include <asm/thread_info.h>
-+#include <asm/uaccess-asm.h>
-
- #define IOMEM(x) (x)
-
-@@ -445,79 +445,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
- .size \name , . - \name
- .endm
-
-- .macro csdb
--#ifdef CONFIG_THUMB2_KERNEL
-- .inst.w 0xf3af8014
--#else
-- .inst 0xe320f014
--#endif
-- .endm
--
-- .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
--#ifndef CONFIG_CPU_USE_DOMAINS
-- adds \tmp, \addr, #\size - 1
-- sbcscc \tmp, \tmp, \limit
-- bcs \bad
--#ifdef CONFIG_CPU_SPECTRE
-- movcs \addr, #0
-- csdb
--#endif
--#endif
-- .endm
--
-- .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
--#ifdef CONFIG_CPU_SPECTRE
-- sub \tmp, \limit, #1
-- subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
-- addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
-- subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
-- movlo \addr, #0 @ if (tmp < 0) addr = NULL
-- csdb
--#endif
-- .endm
--
-- .macro uaccess_disable, tmp, isb=1
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- /*
-- * Whenever we re-enter userspace, the domains should always be
-- * set appropriately.
-- */
-- mov \tmp, #DACR_UACCESS_DISABLE
-- mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
-- .if \isb
-- instr_sync
-- .endif
--#endif
-- .endm
--
-- .macro uaccess_enable, tmp, isb=1
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- /*
-- * Whenever we re-enter userspace, the domains should always be
-- * set appropriately.
-- */
-- mov \tmp, #DACR_UACCESS_ENABLE
-- mcr p15, 0, \tmp, c3, c0, 0
-- .if \isb
-- instr_sync
-- .endif
--#endif
-- .endm
--
-- .macro uaccess_save, tmp
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- mrc p15, 0, \tmp, c3, c0, 0
-- str \tmp, [sp, #SVC_DACR]
--#endif
-- .endm
--
-- .macro uaccess_restore
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- ldr r0, [sp, #SVC_DACR]
-- mcr p15, 0, r0, c3, c0, 0
--#endif
-- .endm
--
- .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
- .macro ret\c, reg
- #if __LINUX_ARM_ARCH__ < 6
-diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h
-new file mode 100644
-index 000000000000..d475e3e8145d
---- /dev/null
-+++ b/arch/arm/include/asm/uaccess-asm.h
-@@ -0,0 +1,106 @@
-+/* SPDX-License-Identifier: GPL-2.0-only */
-+
-+#ifndef __ASM_UACCESS_ASM_H__
-+#define __ASM_UACCESS_ASM_H__
-+
-+#include <asm/asm-offsets.h>
-+#include <asm/domain.h>
-+#include <asm/memory.h>
-+#include <asm/thread_info.h>
-+
-+ .macro csdb
-+#ifdef CONFIG_THUMB2_KERNEL
-+ .inst.w 0xf3af8014
-+#else
-+ .inst 0xe320f014
-+#endif
-+ .endm
-+
-+ .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
-+#ifndef CONFIG_CPU_USE_DOMAINS
-+ adds \tmp, \addr, #\size - 1
-+ sbcscc \tmp, \tmp, \limit
-+ bcs \bad
-+#ifdef CONFIG_CPU_SPECTRE
-+ movcs \addr, #0
-+ csdb
-+#endif
-+#endif
-+ .endm
-+
-+ .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
-+#ifdef CONFIG_CPU_SPECTRE
-+ sub \tmp, \limit, #1
-+ subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
-+ addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
-+ subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
-+ movlo \addr, #0 @ if (tmp < 0) addr = NULL
-+ csdb
-+#endif
-+ .endm
-+
-+ .macro uaccess_disable, tmp, isb=1
-+#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-+ /*
-+ * Whenever we re-enter userspace, the domains should always be
-+ * set appropriately.
-+ */
-+ mov \tmp, #DACR_UACCESS_DISABLE
-+ mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
-+ .if \isb
-+ instr_sync
-+ .endif
-+#endif
-+ .endm
-+
-+ .macro uaccess_enable, tmp, isb=1
-+#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-+ /*
-+ * Whenever we re-enter userspace, the domains should always be
-+ * set appropriately.
-+ */
-+ mov \tmp, #DACR_UACCESS_ENABLE
-+ mcr p15, 0, \tmp, c3, c0, 0
-+ .if \isb
-+ instr_sync
-+ .endif
-+#endif
-+ .endm
-+
-+ .macro uaccess_save, tmp
-+#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-+ mrc p15, 0, \tmp, c3, c0, 0
-+ str \tmp, [sp, #SVC_DACR]
-+#endif
-+ .endm
-+
-+ .macro uaccess_restore
-+#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-+ ldr r0, [sp, #SVC_DACR]
-+ mcr p15, 0, r0, c3, c0, 0
-+#endif
-+ .endm
-+
-+ /*
-+ * Save the address limit on entry to a privileged exception and
-+ * if using PAN, save and disable usermode access.
-+ */
-+ .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
-+ ldr \tmp0, [\tsk, #TI_ADDR_LIMIT]
-+ mov \tmp1, #TASK_SIZE
-+ str \tmp1, [\tsk, #TI_ADDR_LIMIT]
-+ str \tmp0, [sp, #SVC_ADDR_LIMIT]
-+ uaccess_save \tmp0
-+ .if \disable
-+ uaccess_disable \tmp0
-+ .endif
-+ .endm
-+
-+ /* Restore the user access state previously saved by uaccess_entry */
-+ .macro uaccess_exit, tsk, tmp0, tmp1
-+ ldr \tmp1, [sp, #SVC_ADDR_LIMIT]
-+ uaccess_restore
-+ str \tmp1, [\tsk, #TI_ADDR_LIMIT]
-+ .endm
-+
-+#endif /* __ASM_UACCESS_ASM_H__ */
-diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
-index 9f157e7c51e7..efffca3c66e7 100644
---- a/arch/arm/kernel/entry-armv.S
-+++ b/arch/arm/kernel/entry-armv.S
-@@ -30,6 +30,7 @@
- #include <asm/unistd.h>
- #include <asm/tls.h>
- #include <asm/system_info.h>
-+#include <asm/uaccess-asm.h>
-
- #include "entry-header.S"
- #include <asm/entry-macro-multi.S>
-@@ -186,15 +187,7 @@ ENDPROC(__und_invalid)
- stmia r7, {r2 - r6}
-
- get_thread_info tsk
-- ldr r0, [tsk, #TI_ADDR_LIMIT]
-- mov r1, #TASK_SIZE
-- str r1, [tsk, #TI_ADDR_LIMIT]
-- str r0, [sp, #SVC_ADDR_LIMIT]
--
-- uaccess_save r0
-- .if \uaccess
-- uaccess_disable r0
-- .endif
-+ uaccess_entry tsk, r0, r1, r2, \uaccess
-
- .if \trace
- #ifdef CONFIG_TRACE_IRQFLAGS
-diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
-index fa7c6e5c17e7..f9287e65722e 100644
---- a/arch/arm/kernel/entry-header.S
-+++ b/arch/arm/kernel/entry-header.S
-@@ -5,6 +5,7 @@
- #include <asm/asm-offsets.h>
- #include <asm/errno.h>
- #include <asm/thread_info.h>
-+#include <asm/uaccess-asm.h>
- #include <asm/v7m.h>
-
- @ Bad Abort numbers
-@@ -215,9 +216,7 @@
- blne trace_hardirqs_off
- #endif
- .endif
-- ldr r1, [sp, #SVC_ADDR_LIMIT]
-- uaccess_restore
-- str r1, [tsk, #TI_ADDR_LIMIT]
-+ uaccess_exit tsk, r0, r1
-
- #ifndef CONFIG_THUMB2_KERNEL
- @ ARM mode SVC restore
-@@ -261,9 +260,7 @@
- @ on the stack remains correct).
- @
- .macro svc_exit_via_fiq
-- ldr r1, [sp, #SVC_ADDR_LIMIT]
-- uaccess_restore
-- str r1, [tsk, #TI_ADDR_LIMIT]
-+ uaccess_exit tsk, r0, r1
- #ifndef CONFIG_THUMB2_KERNEL
- @ ARM mode restore
- mov r0, sp
---
-2.25.1
-
+++ /dev/null
-From fc0dd68e7e6e390ede71af1dbf81281614f7ace0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 3 May 2020 13:24:07 +0100
-Subject: ARM: uaccess: fix DACR mismatch with nested exceptions
-
-From: Russell King <rmk+kernel@armlinux.org.uk>
-
-[ Upstream commit 71f8af1110101facfad68989ff91f88f8e2c3e22 ]
-
-Tomas Paukrt reports that his SAM9X60 based system (ARM926, ARMv5TJ)
-fails to fix up alignment faults, eventually resulting in a kernel
-oops.
-
-The problem occurs when using CONFIG_CPU_USE_DOMAINS with commit
-e6978e4bf181 ("ARM: save and reset the address limit when entering an
-exception"). This is because the address limit is set back to
-TASK_SIZE on exception entry, and, although it is restored on exception
-exit, the domain register is not.
-
-Hence, this sequence can occur:
-
- interrupt
- pt_regs->addr_limit = addr_limit // USER_DS
- addr_limit = USER_DS
- alignment exception
- __probe_kernel_read()
- old_fs = get_fs() // USER_DS
- set_fs(KERNEL_DS)
- addr_limit = KERNEL_DS
- dacr.kernel = DOMAIN_MANAGER
- interrupt
- pt_regs->addr_limit = addr_limit // KERNEL_DS
- addr_limit = USER_DS
- alignment exception
- __probe_kernel_read()
- old_fs = get_fs() // USER_DS
- set_fs(KERNEL_DS)
- addr_limit = KERNEL_DS
- dacr.kernel = DOMAIN_MANAGER
- ...
- set_fs(old_fs)
- addr_limit = USER_DS
- dacr.kernel = DOMAIN_CLIENT
- ...
- addr_limit = pt_regs->addr_limit // KERNEL_DS
- interrupt returns
-
-At this point, addr_limit is correctly restored to KERNEL_DS for
-__probe_kernel_read() to continue execution, but dacr.kernel is not,
-it has been reset by the set_fs(old_fs) to DOMAIN_CLIENT.
-
-This would not have happened prior to the mentioned commit, because
-addr_limit would remain KERNEL_DS, so get_fs() would have returned
-KERNEL_DS, and so would correctly nest.
-
-This commit fixes the problem by also saving the DACR on exception
-entry if either CONFIG_CPU_SW_DOMAIN_PAN or CONFIG_CPU_USE_DOMAINS are
-enabled, and resetting the DACR appropriately on exception entry to
-match addr_limit and PAN settings.
-
-Fixes: e6978e4bf181 ("ARM: save and reset the address limit when entering an exception")
-Reported-by: Tomas Paukrt <tomas.paukrt@advantech.cz>
-Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/include/asm/uaccess-asm.h | 25 ++++++++++++++++++++-----
- 1 file changed, 20 insertions(+), 5 deletions(-)
-
-diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h
-index e46468b91eaa..907571fd05c6 100644
---- a/arch/arm/include/asm/uaccess-asm.h
-+++ b/arch/arm/include/asm/uaccess-asm.h
-@@ -67,15 +67,21 @@
- #endif
- .endm
-
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-+#if defined(CONFIG_CPU_SW_DOMAIN_PAN) || defined(CONFIG_CPU_USE_DOMAINS)
- #define DACR(x...) x
- #else
- #define DACR(x...)
- #endif
-
- /*
-- * Save the address limit on entry to a privileged exception and
-- * if using PAN, save and disable usermode access.
-+ * Save the address limit on entry to a privileged exception.
-+ *
-+ * If we are using the DACR for kernel access by the user accessors
-+ * (CONFIG_CPU_USE_DOMAINS=y), always reset the DACR kernel domain
-+ * back to client mode, whether or not \disable is set.
-+ *
-+ * If we are using SW PAN, set the DACR user domain to no access
-+ * if \disable is set.
- */
- .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
- ldr \tmp1, [\tsk, #TI_ADDR_LIMIT]
-@@ -84,8 +90,17 @@
- DACR( mrc p15, 0, \tmp0, c3, c0, 0)
- DACR( str \tmp0, [sp, #SVC_DACR])
- str \tmp1, [sp, #SVC_ADDR_LIMIT]
-- .if \disable
-- uaccess_disable \tmp0
-+ .if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN)
-+ /* kernel=client, user=no access */
-+ mov \tmp2, #DACR_UACCESS_DISABLE
-+ mcr p15, 0, \tmp2, c3, c0, 0
-+ instr_sync
-+ .elseif IS_ENABLED(CONFIG_CPU_USE_DOMAINS)
-+ /* kernel=client */
-+ bic \tmp2, \tmp0, #domain_mask(DOMAIN_KERNEL)
-+ orr \tmp2, \tmp2, #domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT)
-+ mcr p15, 0, \tmp2, c3, c0, 0
-+ instr_sync
- .endif
- .endm
-
---
-2.25.1
-
+++ /dev/null
-From 1deb9ca0ee67350299e989a3121e804fb803b2c1 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 3 May 2020 13:14:09 +0100
-Subject: ARM: uaccess: integrate uaccess_save and uaccess_restore
-
-From: Russell King <rmk+kernel@armlinux.org.uk>
-
-[ Upstream commit 8ede890b0bcebe8c760aacfe20e934d98c3dc6aa ]
-
-Integrate uaccess_save / uaccess_restore macros into the new
-uaccess_entry / uaccess_exit macros respectively.
-
-Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/include/asm/uaccess-asm.h | 30 +++++++++++++-----------------
- 1 file changed, 13 insertions(+), 17 deletions(-)
-
-diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h
-index d475e3e8145d..e46468b91eaa 100644
---- a/arch/arm/include/asm/uaccess-asm.h
-+++ b/arch/arm/include/asm/uaccess-asm.h
-@@ -67,30 +67,23 @@
- #endif
- .endm
-
-- .macro uaccess_save, tmp
- #ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- mrc p15, 0, \tmp, c3, c0, 0
-- str \tmp, [sp, #SVC_DACR]
--#endif
-- .endm
--
-- .macro uaccess_restore
--#ifdef CONFIG_CPU_SW_DOMAIN_PAN
-- ldr r0, [sp, #SVC_DACR]
-- mcr p15, 0, r0, c3, c0, 0
-+#define DACR(x...) x
-+#else
-+#define DACR(x...)
- #endif
-- .endm
-
- /*
- * Save the address limit on entry to a privileged exception and
- * if using PAN, save and disable usermode access.
- */
- .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
-- ldr \tmp0, [\tsk, #TI_ADDR_LIMIT]
-- mov \tmp1, #TASK_SIZE
-- str \tmp1, [\tsk, #TI_ADDR_LIMIT]
-- str \tmp0, [sp, #SVC_ADDR_LIMIT]
-- uaccess_save \tmp0
-+ ldr \tmp1, [\tsk, #TI_ADDR_LIMIT]
-+ mov \tmp2, #TASK_SIZE
-+ str \tmp2, [\tsk, #TI_ADDR_LIMIT]
-+ DACR( mrc p15, 0, \tmp0, c3, c0, 0)
-+ DACR( str \tmp0, [sp, #SVC_DACR])
-+ str \tmp1, [sp, #SVC_ADDR_LIMIT]
- .if \disable
- uaccess_disable \tmp0
- .endif
-@@ -99,8 +92,11 @@
- /* Restore the user access state previously saved by uaccess_entry */
- .macro uaccess_exit, tsk, tmp0, tmp1
- ldr \tmp1, [sp, #SVC_ADDR_LIMIT]
-- uaccess_restore
-+ DACR( ldr \tmp0, [sp, #SVC_DACR])
- str \tmp1, [\tsk, #TI_ADDR_LIMIT]
-+ DACR( mcr p15, 0, \tmp0, c3, c0, 0)
- .endm
-
-+#undef DACR
-+
- #endif /* __ASM_UACCESS_ASM_H__ */
---
-2.25.1
-
input-xpad-add-custom-init-packet-for-xbox-one-s-con.patch
input-i8042-add-thinkpad-s230u-to-i8042-reset-list.patch
input-synaptics-rmi4-fix-error-return-code-in-rmi_dr.patch
-arm-8843-1-use-unified-assembler-in-headers.patch
-arm-uaccess-consolidate-uaccess-asm-to-asm-uaccess-a.patch
-arm-uaccess-integrate-uaccess_save-and-uaccess_resto.patch
-arm-uaccess-fix-dacr-mismatch-with-nested-exceptions.patch
ib-qib-call-kobject_put-when-kobject_init_and_add-fa.patch
arm-dts-imx-correct-b850v3-clock-assignment.patch
arm-dts-imx6q-bx50v3-add-internal-switch.patch