Re: [vgupta-arc:for-next 3/4] arch/arc/kernel/disasm.c:494:23: error: 'struct pt_regs' has no member named 'gp'; did you mean 'fp'?

2022-04-26 Thread Sergey Matyukevich
Hello Vineet, > tree: https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git > for-next > head: e88856183749fd59759cd4c617f9ecec8280d8fa > commit: b08a66fb680018b621fd8be641c537c625132ab3 [3/4] ARC: disasm: handle > ARCv2 case in kprobe get/set functions > config: arc-randconfig-r0

[PATCH/next] ARC: disasm: fix gp name for arc700

2022-04-26 Thread Sergey Matyukevich
Fixes: b08a66fb680018b6 ("ARC: disasm: handle ARCv2 case in kprobe get/set functions"). Signed-off-by: Sergey Matyukevich Reported-by: kernel test robot --- arch/arc/kernel/disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/kernel/disasm.c b/arch/

[PATCH v2 1/4] ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature

2022-04-14 Thread Sergey Matyukevich
From: Sergey Matyukevich Enable HAVE_REGS_AND_STACK_ACCESS_API feature for ARC architecture, including ARCcompact and ARCv2 flavors. Add supporting functions and defines. Signed-off-by: Sergey Matyukevich --- arch/arc/Kconfig | 1 + arch/arc/include/asm/ptrace.h | 27

[PATCH v2 2/4] ARC: entry: fix syscall_trace_exit argument

2022-04-14 Thread Sergey Matyukevich
From: Sergey Matyukevich Function syscall_trace_exit expects pointer to pt_regs. However r0 is also used to keep syscall return value. Restore pointer to pt_regs before calling syscall_trace_exit. Signed-off-by: Sergey Matyukevich --- arch/arc/kernel/entry.S | 1 + 1 file changed, 1 insertion

[PATCH v2 0/4] ARC: add missing bits for better BPF support

2022-04-14 Thread Sergey Matyukevich
. Regards, Sergey v1 -> v2: - drop path with uapi for BPF_PROG_TYPE_PERF_EVENT program type: send it via bpf mailing list - add patch with ARCv2 changes for kprobe disasm Sergey Matyukevich (4): ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature ARC: entry: fix syscall_trace_exit argum

[PATCH v2 3/4] ARC: implement syscall tracepoints

2022-04-14 Thread Sergey Matyukevich
From: Sergey Matyukevich Implement all the bits required to support HAVE_SYSCALL_TRACEPOINTS according to Documentation/trace/ftrace-design.rst. Signed-off-by: Sergey Matyukevich --- arch/arc/Kconfig | 1 + arch/arc/include/asm/syscall.h | 2 ++ arch/arc/include/asm

[PATCH v2 4/4] ARC: disasm: handle ARCv2 case in kprobe get/set functions

2022-04-14 Thread Sergey Matyukevich
From: Sergey Matyukevich Current implementation of get_reg/set_reg implies ARCompact layout of pt_regs structure. Meanwhile pt_regs structure differs between ARCompact and ARCv2. Update those functions to handle ARCv2. Signed-off-by: Sergey Matyukevich --- arch/arc/kernel/disasm.c | 64

[PATCH 1/4] ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type

2022-04-08 Thread Sergey Matyukevich
From: Sergey Matyukevich Define appropriate uapi for the BPF_PROG_TYPE_PERF_EVENT program type by exporting the user_regs_struct structure instead of the pt_regs structure that is in-kernel only. Signed-off-by: Sergey Matyukevich --- arch/arc/include/asm/perf_event.h | 4 arch

[PATCH 4/4] ARC: implement syscall tracepoints

2022-04-08 Thread Sergey Matyukevich
From: Sergey Matyukevich Implement all the bits required to support HAVE_SYSCALL_TRACEPOINTS according to Documentation/trace/ftrace-design.rst. Signed-off-by: Sergey Matyukevich --- arch/arc/Kconfig | 1 + arch/arc/include/asm/syscall.h | 2 ++ arch/arc/include/asm

[PATCH 2/4] ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature

2022-04-08 Thread Sergey Matyukevich
From: Sergey Matyukevich Enable HAVE_REGS_AND_STACK_ACCESS_API feature for ARC architecture, including ARCcompact and ARCv2 flavors. Add supporting functions and defines. Signed-off-by: Sergey Matyukevich --- arch/arc/Kconfig | 1 + arch/arc/include/asm/ptrace.h | 27

[PATCH 0/4] ARC: add missing bits for better BPF support

2022-04-08 Thread Sergey Matyukevich
Hi Vineet and all, This patch set implements the following two features for ARC: - HAVE_REGS_AND_STACK_ACCESS_API - HAVE_SYSCALL_TRACEPOINTS Adding these features enables more BPF programs for ARC kernels, including KPROBE, TRACEPOINT, PERF_EVENT program types. Regards, Sergey Sergey

[PATCH 3/4] ARC: entry: fix syscall_trace_exit argument

2022-04-08 Thread Sergey Matyukevich
From: Sergey Matyukevich Function syscall_trace_exit expects pointer to pt_regs. However r0 is also used to keep syscall return value. Restore pointer to pt_regs before calling syscall_trace_exit. Signed-off-by: Sergey Matyukevich --- arch/arc/kernel/entry.S | 1 + 1 file changed, 1 insertion

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

2022-03-23 Thread Sergey Matyukevich
Hi Vineet, > Thx for doing this. I think the series mixes a few things not related to ZOL > removal - the changelog for removal of -Os specific code seems incorrect > etc. > Let me repost with slight more cleanups. Let me know if you don't have capacity to work on v2 at the moment. In this case

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

2022-03-03 Thread Sergey Matyukevich
Hi Vineet, > Thx for doing this. I think the series mixes a few things not related to ZOL > removal - the changelog for removal of -Os specific code seems incorrect > etc. > Let me repost with slight more cleanups. Great. I will help with testing of the updated version. Regards, Sergey

[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

[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

Re: [PATCH v2 18/18] uaccess: drop maining CONFIG_SET_FS users

2022-02-18 Thread Sergey Matyukevich
CONFIG_SET_FS gone, so drop all remaining references to > set_fs()/get_fs(), mm_segment_t and uaccess_kernel(). > > Signed-off-by: Arnd Bergmann Tested-by: Sergey Matyukevich # for arc changes Regards, Sergey ___ linux-snps-arc mailing lis

Re: [RFC PATCH 0/3] arc: remove CONFIG_SET_FS

2022-02-15 Thread Sergey Matyukevich
Hi Vineet, > > Hi all, > > > > This patch series removes SET_FS support for arc. > > > > Sergey Matyukevich (3): > >arc: use BUILD_BUG for invalid sizes in get_user/put_user > >arc: provide __{get,put}_kernel_nofault > >

[RFC PATCH 0/3] arc: remove CONFIG_SET_FS

2022-02-01 Thread Sergey Matyukevich
Hi all, This patch series removes SET_FS support for arc. Sergey Matyukevich (3): arc: use BUILD_BUG for invalid sizes in get_user/put_user arc: provide __{get,put}_kernel_nofault arc: remove set_fs() arch/arc/Kconfig | 1 - arch/arc/include/asm/segment.h | 20

[RFC PATCH 1/3] arc: use BUILD_BUG for invalid sizes in get_user/put_user

2022-02-01 Thread Sergey Matyukevich
From: Sergey Matyukevich Use BUILD_BUG for compile-time check of invalid sizes passed to get_user/put_user functions. Signed-off-by: Sergey Matyukevich --- arch/arc/include/asm/uaccess.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include

[RFC PATCH 2/3] arc: provide __{get,put}_kernel_nofault

2022-02-01 Thread Sergey Matyukevich
From: Sergey Matyukevich Implement the non-faulting kernel access helpers directly instead of using uaccess routines under set_fs(KERNEL_DS). Signed-off-by: Sergey Matyukevich --- arch/arc/include/asm/uaccess.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch

[RFC PATCH 3/3] arc: remove set_fs()

2022-02-01 Thread Sergey Matyukevich
From: Sergey Matyukevich Kernel __{get,put}_kernel_nofault operations are implemented for ARC. There are no other remaining arch/arc specific callers of set_fs(). So just remove it and all the supporting code. Signed-off-by: Sergey Matyukevich --- arch/arc/Kconfig | 1