Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-22 Thread Thomas Bogendoerfer
On Wed, Feb 16, 2022 at 02:13:23PM +0100, Arnd Bergmann wrote: > diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h > index db9a8e002b62..d7c89dc3426c 100644 > --- a/arch/mips/include/asm/uaccess.h > +++ b/arch/mips/include/asm/uaccess.h > @@ -19,6 +19,7 @@ > #ifdef CON

Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-22 Thread Thomas Bogendoerfer
On Mon, Feb 21, 2022 at 03:31:23PM +0100, Arnd Bergmann wrote: > I'll update it this way, otherwise I'd need help in form of a patch > that changes the exception handling so __get_user/__put_user > also return -EFAULT for an address error. https://lore.kernel.org/all/20220222155345.138861-1-tsbog.

[RFC PATCH 12/13] ARC: build: inhibit ZOL generation by compiler

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Inhibit ZOL generation by compiler if configuration states the lack of it. This is done before we remove the ZOL regs save/restore in entry code Signed-off-by: Vineet Gupta --- arch/arc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/Makefile b/arch/a

[RFC PATCH 13/13] ARC: pt_regs: handle the case when ZOL is not supported

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta - Entry code (interrupts/exceptions) need not save/restore ZOL regs - Any userspace ZOL references (ptrace, signal frame, process start) reworked such that ZOL regs are Zero-on-read, Ingore-on-write since the ptrace ABI need not change Signed-off-by: Vineet Gupta --- arc

[RFC PATCH 10/13] ARC: checksum: elide ZOL

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Add checksum implementation based on double load/stores if ZOL is not supported. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/checksum.h | 58 ++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/arch/arc/include/asm/checks

[RFC PATCH 11/13] ARC: head: elide ZOL

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Add entry implementation based on double load/stores if ZOL is not supported. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/asm-macro-ll64-emul.h | 3 +++ arch/arc/include/asm/entry.h | 2 ++ arch/arc/kernel/head.S | 8 +++- arch/

[RFC PATCH 09/13] ARC: delay: elide ZOL

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Add __delay implementation based on DBNZ if ZOL is not supported. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/delay.h | 16 1 file changed, 16 insertions(+) diff --git a/arch/arc/include/asm/delay.h b/arch/arc/include/asm/delay.h index 54db798f0aa0

[RFC PATCH 08/13] ARC: string: use generic C code if no ZOL support

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Switch to generic C code when ZOL is not supported. Generic code lacks memzero, so define it. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/string.h | 15 ++- arch/arc/kernel/arcksyms.c| 2 ++ arch/arc/lib/Makefile | 4 3 files changed,

[RFC PATCH 07/13] ARCv2: memset: rewrite using double load/stores

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Signed-off-by: Vineet Gupta --- arch/arc/lib/memset-archs.S | 112 ++-- 1 file changed, 43 insertions(+), 69 deletions(-) diff --git a/arch/arc/lib/memset-archs.S b/arch/arc/lib/memset-archs.S index 330e22f7cf3c..a9a0ccef761d 100644 --- a/arch

[RFC PATCH 04/13] ARC: uaccess: elide ZOL, use double load/stores

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Upcoming ARCv3 lacks ZOL support, so provide alternative uaccess implementations based on 64-bit memory operations. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/asm-macro-ll64-emul.h | 28 arch/arc/include/asm/asm-macro-ll64.h | 20 +++ arch/arc/include/a

[RFC PATCH 06/13] ARCv2: memset: elide unaligned handling if hardware supports

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta The only functional change is eliding the unaligned buffer head handling. Also cleanup macros adding argument default values. Signed-off-by: Vineet Gupta --- arch/arc/lib/memset-archs.S | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-

[RFC PATCH 05/13] ARCv2: memset: don't prefetch for len == 0 which happens a lot

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta This avoids potential "bleeding" when size == 0 as cache line would be dirtied (and possibly fetched from other cores) and due to the same reasons more optimal too. Signed-off-by: Vineet Gupta --- arch/arc/lib/memset-archs.S | 3 ++- 1 file changed, 2 insertions(+), 1 deleti

[RFC PATCH 03/13] ARC: uaccess: drop CC_OPTIMIZE_FOR_SIZE

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Currently ARC uses CC_OPTIMIZE_FOR_PERFORMANCE_O3, which excludes CC_OPTIMIZE_FOR_SIZE. So drop unused define branch. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/uaccess.h | 11 ++- arch/arc/mm/extable.c | 11 --- 2 files changed, 2 insertio

[RFC PATCH 00/13] ARC: handle the lack of ZOL support

2022-02-22 Thread Sergey Matyukevich
From: Sergey Matyukevich Hi Vineet and all, This patch series continues to prepare arch/arc for the upcoming ARCv3 support. ARCv3 does not support zero-overhead-loop (ZOL). So this patch series provides a set of changes that make ZOL support optional. The patch series is based on top of Linux 5

[RFC PATCH 02/13] ARC: Kconfig: introduce option to disable ZOL

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Upcoming ARCv3 lacks ZOL support, so provide alternatives based on DBNZ instruction inrtroduced in ARCv2. Signed-off-by: Vineet Gupta --- arch/arc/Kconfig | 10 arch/arc/Makefile | 1 + arch/arc/include/asm/asm-mac

[RFC PATCH 01/13] ARC: uaccess: elide unaligned handling if hardware supports

2022-02-22 Thread Sergey Matyukevich
From: Vineet Gupta Signed-off-by: Vineet Gupta --- arch/arc/include/asm/uaccess.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h index 783bfdb3bfa3..d78aae76831f 100644 --- a/arch/arc/include/asm/uac

[PATCH 0/2] ARC: atomic: cleanup and optimization fixes

2022-02-22 Thread Sergey Matyukevich
From: Sergey Matyukevich Hi Vineet and all, This patch set provides cleanup for atomic-llsc code and fixes for unwanted compiler optimizations in ARCv2 32bit and 64bit atomics. Regards, Sergey Sergey Matyukevich (2): ARC: atomic: cleanup atomic-llsc definitions ARC: atomic: avoid unwanted

[PATCH 2/2] ARC: atomic: avoid unwanted gcc optimizations in atomic operations

2022-02-22 Thread Sergey Matyukevich
From: Sergey Matyukevich All the llock/scond based atomic operations read and write atomic counter field. However write operation performed by the scond instruction is not properly communicated to the compiler: inline assembly shows atomic argument as an input parameter and its clobber list does

[PATCH 1/2] ARC: atomic: cleanup atomic-llsc definitions

2022-02-22 Thread Sergey Matyukevich
From: Sergey Matyukevich Remove redundant c_op macro argument. Only asm_op is needed to define atomic operations using llock/scond. Signed-off-by: Sergey Matyukevich --- arch/arc/include/asm/atomic-llsc.h | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) d