[PATCH 1/2] selftests: pid_namespace: Include sys/mount.h

2025-04-27 Thread Tiezhu Yang
ong Sun Fixes: 615ab43b838b ("tests/pid_namespace: add pid_max tests") Signed-off-by: Tiezhu Yang --- tools/testing/selftests/pid_namespace/pid_max.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/pid_namespace/pid_max.c b/tools/testing/selftests/pid_names

[PATCH 2/2] selftests: pid_namespace: Skip tests if not root

2025-04-27 Thread Tiezhu Yang
). Fixes: 615ab43b838b ("tests/pid_namespace: add pid_max tests") Signed-off-by: Tiezhu Yang --- tools/testing/selftests/pid_namespace/pid_max.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/pid_namespace/pid_max.c b/tool

[PATCH 0/2] Fix compile-time and run-time issues for pid_namespace

2025-04-27 Thread Tiezhu Yang
Tiezhu Yang (2): selftests: pid_namespace: Include sys/mount.h selftests: pid_namespace: Skip tests if not root tools/testing/selftests/pid_namespace/pid_max.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.42.0

Re: [PATCH] LoongArch: make the users of larch_insn_gen_break() constant

2024-06-30 Thread Tiezhu Yang
kernel/kprobes.c and arch/loongarch/kernel/uprobes.c Tested-by: Tiezhu Yang Thanks, Tiezhu

Re: [PATCH] LoongArch: uprobes: make UPROBE_SWBP_INSN/UPROBE_XOLBP_INSN constant

2024-06-29 Thread Tiezhu Yang
On Thu, 27 Jun 2024 19:38:06 +0200 Oleg Nesterov wrote: ... > > > +arch_initcall(check_emit_break); > > > + > > > > I wouldn't even bother with this, but whatever. > > Agreed, this looks a bit ugly. I did this only because I can not test > this (hopefully trivial) patch and the maintainers didn

[QUESTION] Will the pahole tar source code with corresponding libbpf submodule codes be released as well in the future?

2021-04-14 Thread Tiezhu Yang
(1) tools/bpf/bpftool build failed due to the following reason: Error: failed to load BTF from /boot/vmlinux-5.12.0-rc2: No such file or directory make: *** [Makefile:158: vmlinux.h] Error 2 (2) When set CONFIG_DEBUG_INFO_BTF=y, failed to generate BTF for vmlinux due to pahole is not available

[PATCH bpf-next v2] bpf: Fix some invalid links in bpf_devel_QA.rst

2021-04-14 Thread Tiezhu Yang
g/doc/html/latest/bpf/bpf_devel_QA.html Fixes: 542228384888 ("bpf, doc: convert bpf_devel_QA.rst to use RST formatting") Signed-off-by: Tiezhu Yang --- v2: Add Fixes: tag Documentation/bpf/bpf_devel_QA.rst | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) d

[PATCH bpf-next] bpf: Fix some invalid links in bpf_devel_QA.rst

2021-04-14 Thread Tiezhu Yang
he links of "samples/bpf/" and "selftests" because there are not related documentations. [1] https://www.kernel.org/doc/html/MAINTAINERS [2] https://www.kernel.org/doc/html/samples/bpf/ [3] https://www.kernel.org/doc/html/tools/testing/selftests/bpf/ [4] https://

[PATCH RFC v2] module: Use ARG_MAX as second argument of strndup_user() in load_module()

2021-04-12 Thread Tiezhu Yang
_module() failure disappered and we can login normally through a graphical interface. [1] https://lore.kernel.org/patchwork/patch/1411214/ Signed-off-by: Tiezhu Yang --- v2: Update the commit message to avoid using diff content - patch(1) might not work kernel/module.c | 2 +- 1 file changed, 1 ins

[PATCH RFC] module: Use ARG_MAX as second argument of strndup_user() in load_module()

2021-04-12 Thread Tiezhu Yang
and we can login normally through a graphical interface. [1] https://lore.kernel.org/patchwork/patch/1411214/ Signed-off-by: Tiezhu Yang --- kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/module.c b/kernel/module.c index 3047935..30d320b 100644 --- a/ker

Re: [PATCH] MIPS: Fix strnlen_user access check

2021-04-12 Thread Tiezhu Yang
On 04/12/2021 11:02 AM, Tiezhu Yang wrote: On 04/11/2021 07:04 PM, Jinyang He wrote: Commit 04324f44cb69 ("MIPS: Remove get_fs/set_fs") brought a problem for strnlen_user(). Jump out when checking access_ok() with condition that (s + strlen(s)) < __UA_LIMIT <=

Re: [PATCH] MIPS: Fix strnlen_user access check

2021-04-11 Thread Tiezhu Yang
On 04/11/2021 07:04 PM, Jinyang He wrote: Commit 04324f44cb69 ("MIPS: Remove get_fs/set_fs") brought a problem for strnlen_user(). Jump out when checking access_ok() with condition that (s + strlen(s)) < __UA_LIMIT <= (s + n). The old __strnlen_user_asm() just checked (ua_limit & s) without check

[PATCH RFC] MIPS: Loongson64: Use _CACHE_UNCACHED instead of _CACHE_UNCACHED_ACCELERATED

2021-04-06 Thread Tiezhu Yang
st make it work well, it is not a proper and final solution, I hope someone will have a better solution to fix this issue in the future. [1] https://lore.kernel.org/patchwork/patch/1285542/ Signed-off-by: Tiezhu Yang --- Hi Thomas, If you are OK with this change, could you please apply it to

[PATCH v3] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-04-02 Thread Tiezhu Yang
filename 3792429 0 4221 linux-5.12-rc5/net/ipv4/netfilter/nf_reject_ipv4.o Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/checksum.h | 4 1 file changed, 4 insertions(+) diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 1e6c1

[PATCH v3] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

2021-03-25 Thread Tiezhu Yang
again"). Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") Signed-off-by: Tiezhu Yang --- v3: Select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA on MIPS. v2: update the commit message to fix typos found by Sergei Shtylyov, tha

Re: [PATCH v2] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

2021-03-25 Thread Tiezhu Yang
On 03/25/2021 06:17 PM, Thomas Bogendoerfer wrote: On Mon, Mar 22, 2021 at 03:12:59PM +0800, Tiezhu Yang wrote: On 03/22/2021 12:46 PM, Maciej W. Rozycki wrote: On Thu, 18 Mar 2021, Tiezhu Yang wrote: diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 160b3a8..4b94ec7 100644 --- a/arch

Re: [PATCH v2] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

2021-03-22 Thread Tiezhu Yang
On 03/22/2021 12:46 PM, Maciej W. Rozycki wrote: On Thu, 18 Mar 2021, Tiezhu Yang wrote: diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 160b3a8..4b94ec7 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -6,6 +6,7 @@ config MIPS select ARCH_BINFMT_ELF_STATE if

[PATCH v2] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

2021-03-17 Thread Tiezhu Yang
probe_read() will not be available. This is similar with the commit d195b1d1d119 ("powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again"). Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") Signed-off-by: Tiezhu Yang --- v2: up

[PATCH] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

2021-03-17 Thread Tiezhu Yang
probe_read() will not be available. This is similar with the commit d195b1d1d1196 ("powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again"). Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") Signed-off-by: Tiezhu Yang --- a

Re: [PATCH v2] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-16 Thread Tiezhu Yang
On 03/15/2021 08:42 PM, David Laight wrote: From: Tiezhu Yang Sent: 15 March 2021 12:26 On 03/15/2021 04:49 AM, Maciej W. Rozycki wrote: On Tue, 9 Mar 2021, Tiezhu Yang wrote: diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 1e6c135..80eddd4 100644

Re: [PATCH v2] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-15 Thread Tiezhu Yang
On 03/15/2021 04:49 AM, Maciej W. Rozycki wrote: On Tue, 9 Mar 2021, Tiezhu Yang wrote: diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 1e6c135..80eddd4 100644 --- a/arch/mips/include/asm/checksum.h +++ b/arch/mips/include/asm/checksum.h @@ -128,9 +128,13

Re: [PATCH v2] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-15 Thread Tiezhu Yang
On 03/15/2021 06:24 PM, Alexander Lobakin wrote: From: Tiezhu Yang Date: Tue, 9 Mar 2021 12:18:13 +0800 The asm code in csum_tcpudp_nofold() is performance-critical, I am sorry for the poorly considered implementation about the performance influence with GCC in the commit 198688edbf77 ("

[PATCH] MAINTAINERS: Add Mailing list and Web-page for PERFORMANCE EVENTS SUBSYSTEM

2021-03-14 Thread Tiezhu Yang
Add entry "L: linux-perf-us...@vger.kernel.org" to archive the related mail on https://lore.kernel.org/linux-perf-users/, add entry "W: https://perf.wiki.kernel.org/"; so that newbies could get some useful materials. Signed-off-by: Tiezhu Yang --- MAINTAINERS | 2 +

[PATCH v2] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-08 Thread Tiezhu Yang
can build successfully by both GCC and Clang, at the same time, we can avoid the potential performance influence with GCC. Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/checksum.h | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/mips/include/asm/checksu

Re: [PATCH] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-08 Thread Tiezhu Yang
On 03/09/2021 12:52 AM, David Laight wrote: From: Tiezhu Yang Sent: 08 March 2021 12:50 The asm code in csum_tcpudp_nofold() is performance-critical, I am sorry for the poorly considered implementation about the performance influence with GCC in the commit 198688edbf77 ("MIPS: Fix inlin

[PATCH] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold()

2021-03-08 Thread Tiezhu Yang
can build successfully by both GCC and Clang, at the same time, we can avoid the potential performance influence with GCC. Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/checksum.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/i

[PATCH] MIPS: Enable some missed configs in loongson3_defconfig to support bpftrace

2021-03-07 Thread Tiezhu Yang
configs in loongson3_defconfig to make sure the above configs are set after make loongson3_defconfig. [1] https://github.com/iovisor/bpftrace/blob/master/INSTALL.md Signed-off-by: Tiezhu Yang --- arch/mips/configs/loongson3_defconfig | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

[PATCH v2] riscv: Return -EFAULT if copy_{to,from}_user() failed in signal.c

2021-03-05 Thread Tiezhu Yang
copy_{to,from}_user() returns the amount left to copy, it should return -EFAULT error code if copy {to,from} user failed, just like the return value is an error code when {put,get}_user() failed, this is to make the return value consistent, no function change. Signed-off-by: Tiezhu Yang

[PATCH v3] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

2021-03-04 Thread Tiezhu Yang
GCC works, as Nathan said, the config should not even be selectable when building with Clang, so just make MIPS32_O32 depends on !CC_IS_CLANG. [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html [2] https://bugs.llvm.org/show_bug.cgi?id=38063 Signed-off-by: Tiezhu Yang Acked-by: Nathan C

Re: [PATCH] MIPS: Fix inline asm input/output type mismatch in checksum.h used with Clang

2021-03-03 Thread Tiezhu Yang
[1] https://lore.kernel.org/linux-mips/CAG_fn=W0JHf8QyUX==+rqmp8poulhrsqca9htffws31ga8k...@mail.gmail.com/ Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/checksum.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) applied to mips-next. This is in a performance-critical path

[PATCH v2] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

2021-03-03 Thread Tiezhu Yang
GCC works well, as Nathan said, the config should not even be selectable when build kernel with Clang, so just make MIPS32_O32 depends on !CC_IS_CLANG. [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html [2] https://bugs.llvm.org/show_bug.cgi?id=38063 Signed-off-by: Tiezhu Yang --- ar

Re: [PATCH] MIPS: Add comment about CONFIG_MIPS32_O32 in loongson3_defconfig when build with Clang

2021-03-03 Thread Tiezhu Yang
On 03/04/2021 10:02 AM, Nathan Chancellor wrote: On Thu, Mar 04, 2021 at 09:15:44AM +0800, Tiezhu Yang wrote: When build kernel with Clang [1]: $ make CC=clang loongson3_defconfig $ make CC=clang [snip] I think this might be a better solution. I know that I personally never read defconfig

[PATCH] MIPS: Add comment about CONFIG_MIPS32_O32 in loongson3_defconfig when build with Clang

2021-03-03 Thread Tiezhu Yang
ment to point out this bug and suggest the users to remove CONFIG_MIPS32_O32=y in defconfig when build kernel with Clang. [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html [2] https://bugs.llvm.org/show_bug.cgi?id=38063 Signed-off-by: Tiezhu Yang --- arch/mips/configs/loongson3_defcon

Re: [PATCH] riscv: Return -EFAULT if copy_to_user() failed in signal.c

2021-03-03 Thread Tiezhu Yang
On 03/02/2021 06:01 PM, Ben Dooks wrote: On 02/03/2021 07:28, Tiezhu Yang wrote: copy_to_user() returns the amount left to copy, it should return -EFAULT if copy to user failed. This looks technically correct, but the caller (only one) will check for non-zero and will covert that to -EFAULT

[PATCH] riscv: Return -EFAULT if copy_to_user() failed in signal.c

2021-03-02 Thread Tiezhu Yang
copy_to_user() returns the amount left to copy, it should return -EFAULT if copy to user failed. Signed-off-by: Tiezhu Yang --- arch/riscv/kernel/signal.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index

Re: [PATCH v2 0/3] Add some perf support for mips

2021-02-25 Thread Tiezhu Yang
, Feb 22, 2021 at 02:43:39PM +0800, Tiezhu Yang escreveu: On 02/04/2021 11:35 AM, Tiezhu Yang wrote: v2: add R26 and R27 to the enum perf_event_mips_regs in patch #1 Tiezhu Yang (3): MIPS: kernel: Support extracting off-line stack traces from user-space with perf perf tools: Support

Re: [PATCH v2 0/3] Add some perf support for mips

2021-02-21 Thread Tiezhu Yang
On 02/04/2021 11:35 AM, Tiezhu Yang wrote: v2: add R26 and R27 to the enum perf_event_mips_regs in patch #1 Tiezhu Yang (3): MIPS: kernel: Support extracting off-line stack traces from user-space with perf perf tools: Support mips unwinding and dwarf-regs perf tools: Generate mips

[PATCH v2 RESEND] MIPS: Add basic support for ptrace single step

2021-02-12 Thread Tiezhu Yang
From: Tiezhu Yang In the current code, arch_has_single_step() is not defined on MIPS, that means MIPS does not support instruction single-step for user mode. Delve is a debugger for the Go programming language, the ptrace syscall PtraceSingleStep() failed [1] on MIPS and then the single step

Re: [PATCH v2] MIPS: Make check condition for SDBBP consistent with EJTAG spec

2021-02-09 Thread Tiezhu Yang
On 02/09/2021 08:11 PM, Thomas Bogendoerfer wrote: On Tue, Feb 09, 2021 at 01:05:25PM +0800, Tiezhu Yang wrote: According to MIPS EJTAG Specification [1], a Debug Breakpoint exception occurs when an SDBBP instruction is executed, the CP0_DEBUG bit DBp indicates that a Debug Breakpoint exception

[PATCH v2] MIPS: Make check condition for SDBBP consistent with EJTAG spec

2021-02-08 Thread Tiezhu Yang
Signed-off-by: Tiezhu Yang --- v2: add MIPS_DEBUG_DBP definition arch/mips/include/asm/mipsregs.h | 4 arch/mips/kernel/genex.S | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index a0e8ae5

Re: [PATCH] MIPS: Make check condition for SDBBP consistent with EJTAG spec

2021-02-08 Thread Tiezhu Yang
On 02/09/2021 10:36 AM, Jiaxun Yang wrote: On Tue, Feb 9, 2021, at 12:32 AM, Jiaxun Yang wrote: On Mon, Feb 8, 2021, at 9:14 PM, Tiezhu Yang wrote: According to MIPS EJTAG Specification [1], a Debug Breakpoint exception occurs when an SDBBP instruction is executed, the CP0_DEBUG bit DBp

[PATCH] MIPS: Make check condition for SDBBP consistent with EJTAG spec

2021-02-08 Thread Tiezhu Yang
Signed-off-by: Tiezhu Yang --- arch/mips/kernel/genex.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index bcce32a..6336826 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -349,8 +349,8 @@ NESTED

[PATCH] MIPS: Add basic support for ptrace single step

2021-02-08 Thread Tiezhu Yang
/master/pkg/proc/native/threads_linux.go#L50 [2] https://github.com/go-delve/delve/blob/master/vendor/golang.org/x/sys/unix/syscall_linux.go#L1573 [3] http://www.t-es-t.hu/download/mips/md00047f.pdf Reported-by: Guoqi Chen Signed-off-by: Xingxing Su Signed-off-by: Tiezhu Yang --- arch/mips/include

[PATCH] selftests: breakpoints: Use correct error messages in breakpoint_test_arm64.c

2021-02-04 Thread Tiezhu Yang
When call ptrace(PTRACE_CONT, ...) failed, use correct error messages. Signed-off-by: Tiezhu Yang --- tools/testing/selftests/breakpoints/breakpoint_test_arm64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c

[PATCH bpf-next] samples/bpf: Add hello world sample for newbies

2021-02-04 Thread Tiezhu Yang
oader completely"), so the old version can not work in the latest mainline kernel. Since it is very simple and useful for newbies, I think it is necessary to be upstreamed. [1] https://github.com/bpftools/linux-observability-with-bpf/tree/master/code/chapter-2/hello_world Signed-off-by: T

[PATCH v2 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf

2021-02-03 Thread Tiezhu Yang
riginal patches into two parts (MIPS kernel and perf tools) to merge easily.] The original patches: https://lore.kernel.org/patchwork/patch/1126521/ https://lore.kernel.org/patchwork/patch/1126520/ Signed-off-by: David Daney Signed-off-by: Ralf Baechle Signed-off-by: Archer Yan Signed-off-by:

[PATCH v2 2/3] perf tools: Support mips unwinding and dwarf-regs

2021-02-03 Thread Tiezhu Yang
Baechle Signed-off-by: Archer Yan Signed-off-by: Tiezhu Yang --- v2: no changes tools/perf/Makefile.config | 6 ++ tools/perf/arch/mips/Makefile | 4 ++ tools/perf/arch/mips/include/dwarf-regs-table.h | 31 + tools/perf/arch/mips/include

[PATCH v2 3/3] perf tools: Generate mips syscalls_n64.c syscall table

2021-02-03 Thread Tiezhu Yang
Grab a copy of arch/mips/kernel/syscalls/syscall_n64.tbl and use it to generate tools/perf/arch/mips/include/generated/asm/syscalls_n64.c file, this is similar with commit 1b700c997500 ("perf tools: Build syscall table .c header from kernel's syscall_64.tbl") Signed-off-by: Tiezh

[PATCH v2 0/3] Add some perf support for mips

2021-02-03 Thread Tiezhu Yang
v2: add R26 and R27 to the enum perf_event_mips_regs in patch #1 Tiezhu Yang (3): MIPS: kernel: Support extracting off-line stack traces from user-space with perf perf tools: Support mips unwinding and dwarf-regs perf tools: Generate mips syscalls_n64.c syscall table arch/mips/Kconfig

Re: [PATCH] selftests: breakpoints: Fix wrong argument of ptrace() when single step

2021-02-03 Thread Tiezhu Yang
On 02/04/2021 02:30 AM, Shuah Khan wrote: On 2/3/21 1:39 AM, Tiezhu Yang wrote: According to the error message, the first argument of ptrace() should be PTRACE_SINGLESTEP instead of PTRACE_CONT when ptrace single step. Fixes: f43365ee17f8 ("selftests: arm64: add test for unaligned/in

Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf

2021-02-03 Thread Tiezhu Yang
On 2/3/21 6:40 PM, Thomas Bogendoerfer wrote: On Mon, Feb 01, 2021 at 08:56:06PM +0800, Tiezhu Yang wrote: On 02/01/2021 06:43 PM, Thomas Bogendoerfer wrote: On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote: +++ b/arch/mips/include/uapi/asm/perf_regs.h @@ -0,0 +1,42 @@ +/* SPDX

[PATCH] selftests: breakpoints: Fix wrong argument of ptrace() when single step

2021-02-03 Thread Tiezhu Yang
According to the error message, the first argument of ptrace() should be PTRACE_SINGLESTEP instead of PTRACE_CONT when ptrace single step. Fixes: f43365ee17f8 ("selftests: arm64: add test for unaligned/inexact watchpoint handling") Signed-off-by: Tiezhu Yang --- tools/testing

[PATCH] sparc: Replace test_ti_thread_flag() with test_tsk_thread_flag()

2021-02-02 Thread Tiezhu Yang
Use test_tsk_thread_flag() directly instead of test_ti_thread_flag() to improve readability when the argument type is struct task_struct, it is similar with commit 5afc78551bf5 ("arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP"). Signed-off-by: Tiezhu Yang --- arch/sp

[PATCH] parisc: Replace test_ti_thread_flag() with test_tsk_thread_flag()

2021-02-02 Thread Tiezhu Yang
Use test_tsk_thread_flag() directly instead of test_ti_thread_flag() to improve readability when the argument type is struct task_struct, it is similar with commit 5afc78551bf5 ("arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP"). Signed-off-by: Tiezhu Yang --- arch/pari

Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf

2021-02-01 Thread Tiezhu Yang
On 02/01/2021 06:43 PM, Thomas Bogendoerfer wrote: On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote: +++ b/arch/mips/include/uapi/asm/perf_regs.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _ASM_MIPS_PERF_REGS_H +#define

Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf

2021-01-28 Thread Tiezhu Yang
On 01/28/2021 05:15 AM, Thomas Bogendoerfer wrote: On Tue, Jan 05, 2021 at 11:18:06AM +0100, Peter Zijlstra wrote: On Tue, Jan 05, 2021 at 11:45:37AM +0800, Jiaxun Yang wrote: 在 2021/1/4 下午6:59, Peter Zijlstra 写道: On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote: +u64 perf_reg_abi

[PATCH bpf-next] MAINTAINERS: BPF: Update web-page bpf.io to ebpf.io to avoid redirects

2021-01-28 Thread Tiezhu Yang
rect}\n' 0.000 So update https://bpf.io/ to https://ebpf.io/ to avoid redirects. Signed-off-by: Tiezhu Yang --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1df56a3..09314ce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -

[PATCH] MIPS: Fix inline asm input/output type mismatch in checksum.h used with Clang

2021-01-26 Thread Tiezhu Yang
ot;0" ((__force unsigned long)daddr), ^~~~ 1 error generated. This is a known issue on MIPS [1], the changed code can be compiled successfully by both GCC and Clang. [1] https://lore.kernel.org/linux-mips/CAG_fn=W0JHf8QyUX==+rqmp8poulhrsqca9htffws31ga8k...@mail.gmail.com

Re: [PATCH bpf-next] samples/bpf: Add include dir for MIPS Loongson64 to fix build errors

2021-01-26 Thread Tiezhu Yang
On 01/27/2021 12:01 AM, Daniel Borkmann wrote: On 1/26/21 3:05 PM, Tiezhu Yang wrote: There exists many build errors when make M=samples/bpf on the Loongson platform, this issue is MIPS related, x86 compiles just fine. Here are some errors: [...] So we can do the similar things in samples

[PATCH bpf-next] samples/bpf: Add include dir for MIPS Loongson64 to fix build errors

2021-01-26 Thread Tiezhu Yang
just add platform specific and generic include dir for MIPS Loongson64 to fix the build errors. Signed-off-by: Tiezhu Yang --- samples/bpf/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 362f314..45ceca4 100644 --- a/samples/

[PATCH bpf-next v2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-24 Thread Tiezhu Yang
With #ifndef __SANE_USERSPACE_TYPES__ in tools/include/linux/types.h, the above error has gone and this ifndef change does not hurt other compilations. Signed-off-by: Tiezhu Yang --- v2: Update the commit message samples/bpf/Makefile| 4 tools/include/linux/types.h | 3 +++ 2 fil

[PATCH] MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MIPS64 manual

2021-01-21 Thread Tiezhu Yang
://www.mips.com/?do-download=the-mips64-instruction-set-v6-06 Reported-by: Ming Wang Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/inst.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h index 22912f7..2f98ced 100644

[PATCH bpf-next v4] samples/bpf: Update build procedure for manually compiling LLVM and Clang

2021-01-21 Thread Tiezhu Yang
html [3] https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages Signed-off-by: Tiezhu Yang Acked-by: Yonghong Song Reviewed-by: Nathan Chancellor --- v2: Update the commit message suggested by Yonghong, thank you very much. v3: Remove the default option BUILD_SHARED_LIBS=O

[PATCH bpf-next v3] samples/bpf: Update build procedure for manually compiling LLVM and Clang

2021-01-20 Thread Tiezhu Yang
[2] https://www.llvm.org/docs/CMake.html Signed-off-by: Tiezhu Yang Acked-by: Yonghong Song --- v2: Update the commit message suggested by Yonghong, thank you very much. v3: Remove the default option BUILD_SHARED_LIBS=OFF and just mkdir llvm-project/llvm/build suggested by Fangrui.

Re: [PATCH bpf-next v2] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-19 Thread Tiezhu Yang
On 01/20/2021 10:43 AM, Nick Desaulniers wrote: On Mon, Jan 18, 2021 at 11:56 PM Tiezhu Yang wrote: The current llvm/clang build procedure in samples/bpf/README.rst is out of date. See below that the links are not accessible any more. $ git clone http://llvm.org/git/llvm.git Cloning into

Re: [PATCH bpf-next v2] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-19 Thread Tiezhu Yang
On 01/20/2021 05:58 AM, Fangrui Song wrote: On 2021-01-19, Tiezhu Yang wrote: The current llvm/clang build procedure in samples/bpf/README.rst is out of date. See below that the links are not accessible any more. $ git clone http://llvm.org/git/llvm.git Cloning into 'llvm'... fatal:

[PATCH bpf-next v2] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-19 Thread Tiezhu Yang
same time, update the related comment in Makefile. [1] https://clang.llvm.org/get_started.html Signed-off-by: Tiezhu Yang Acked-by: Yonghong Song --- v2: Update the commit message suggested by Yonghong, thank you very much. samples/bpf/Makefile | 2 +- samples/bpf/README.rst | 1

[PATCH bpf] samples/bpf: Update README.rst and Makefile for manually compiling LLVM and clang

2021-01-18 Thread Tiezhu Yang
llvm.org/get_started.html Signed-off-by: Tiezhu Yang --- samples/bpf/Makefile | 2 +- samples/bpf/README.rst | 17 ++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 26fc96c..d061446 100644 --- a/samples/bpf/Makef

Re: [PATCH 2/2] compiler.h: Include asm/rwonce.h under ARM64 and ALPHA to fix build errors

2021-01-18 Thread Tiezhu Yang
On 01/14/2021 01:14 AM, Yonghong Song wrote: I do not think this fix is correct. x86 does not define its own rwonce.h and still compiles fine. As noted in the above, we have include/asm-generic/rwonce.h. Once you do a proper build, you will have rwonce.h in arch generated directory like -bash-4

[PATCH bpf] samples/bpf: Update README.rst for manually compiling LLVM and clang

2021-01-18 Thread Tiezhu Yang
o be feasible, so we should update it to reflect the reality. [1] https://clang.llvm.org/get_started.html Signed-off-by: Tiezhu Yang --- samples/bpf/README.rst | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index d

Re: [PATCH bpf 1/2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-17 Thread Tiezhu Yang
On 01/14/2021 01:12 AM, Yonghong Song wrote: On 1/13/21 2:57 AM, Tiezhu Yang wrote: MIPS needs __SANE_USERSPACE_TYPES__ before to select 'int-ll64.h' in arch/mips/include/uapi/asm/types.h and avoid compile warnings when printing __u64 with %llu, %llx or %lld. could you men

[PATCH bpf 1/2] samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings

2021-01-13 Thread Tiezhu Yang
%lu printf("%s/%llx;", sym->name, addr); ~~~^ %lx printf(";%s %lld\n", key->waker, count); ~~~^ ~ %ld Signed-off-by: Tiezhu Yang --- samples/bpf/Makefile|

[PATCH 2/2] compiler.h: Include asm/rwonce.h under ARM64 and ALPHA to fix build errors

2021-01-13 Thread Tiezhu Yang
x/kernel.h:10: ./include/linux/compiler.h:246:10: fatal error: 'asm/rwonce.h' file not found ^~ 1 error generated. $ find . -name rwonce.h ./include/asm-generic/rwonce.h ./arch/arm64/include/asm/rwonce.h ./arch/alpha/include/asm/rwonce.h Signed-off-by: Tiezhu Yang

[PATCH 0/2] Fix build errors and warnings when make M=samples/bpf

2021-01-13 Thread Tiezhu Yang
There exists many build errors and warnings when make M=samples/bpf, this patch series fix some of them, I will submit some other patches related with MIPS later. Tiezhu Yang (2): samples/bpf: Set flag __SANE_USERSPACE_TYPES__ for MIPS to fix build warnings compiler.h: Include asm

Re: [PATCH] MIPS: Loongson64: Give chance to build under !CONFIG_NUMA and !CONFIG_SMP

2020-12-29 Thread Tiezhu Yang
On 12/30/2020 12:39 AM, Thomas Bogendoerfer wrote: On Wed, Dec 16, 2020 at 10:44:23AM +0800, Tiezhu Yang wrote: I have tested the following three configs on the Loongson platform: (1) !NUMA and !SMP, (2) !NUMA and SMP, (3) NUMA and SMP, everything is all right. But there exists the following

[PATCH 3/3] perf tools: Generate mips syscalls_n64.c syscall table

2020-12-29 Thread Tiezhu Yang
Grab a copy of arch/mips/kernel/syscalls/syscall_n64.tbl and use it to generate tools/perf/arch/mips/include/generated/asm/syscalls_n64.c file, this is similar with commit 1b700c997500 ("perf tools: Build syscall table .c header from kernel's syscall_64.tbl") Signed-off-

[PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf

2020-12-29 Thread Tiezhu Yang
riginal patches into two parts (MIPS kernel and perf tools) to merge easily.] The original patches: https://lore.kernel.org/patchwork/patch/1126521/ https://lore.kernel.org/patchwork/patch/1126520/ Signed-off-by: David Daney Signed-off-by: Ralf Baechle Signed-off-by: Archer Yan Signed-off-b

[PATCH 2/3] perf tools: Support mips unwinding and dwarf-regs

2020-12-29 Thread Tiezhu Yang
Baechle Signed-off-by: Archer Yan Signed-off-by: Tiezhu Yang --- tools/perf/Makefile.config | 6 ++ tools/perf/arch/mips/Makefile | 4 ++ tools/perf/arch/mips/include/dwarf-regs-table.h | 31 + tools/perf/arch/mips/include/perf_regs.h| 84

[PATCH 0/3] Add some perf support for mips

2020-12-29 Thread Tiezhu Yang
Tiezhu Yang (3): MIPS: kernel: Support extracting off-line stack traces from user-space with perf perf tools: Support mips unwinding and dwarf-regs perf tools: Generate mips syscalls_n64.c syscall table arch/mips/Kconfig | 2 + arch/mips/include/uapi

[PATCH] Makefile: Remove Module.symvers when make clean

2020-12-21 Thread Tiezhu Yang
Module.symvers still exists when make clean, remove it. Signed-off-by: Tiezhu Yang --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e30cf02..8235bb7 100644 --- a/Makefile +++ b/Makefile @@ -1468,7 +1468,7 @@ endif # CONFIG_MODULES

Re: [QUESTION] support perf record --call-graph dwarf for mips

2020-12-21 Thread Tiezhu Yang
On 12/17/2020 08:48 PM, Tiezhu Yang wrote: On 12/16/2020 11:16 PM, Arnaldo Carvalho de Melo wrote: Em Wed, Dec 16, 2020 at 11:30:47AM -0300, Arnaldo Carvalho de Melo escreveu: Em Wed, Dec 16, 2020 at 07:14:02PM +0800, Jiaxun Yang escreveu: 在 2020/12/16 下午6:05, Tiezhu Yang 写道: Hi, In the

[PATCH 1/4] perf tools: Move syscall.tbl check into check-headers.sh for powerpc

2020-12-18 Thread Tiezhu Yang
It is better to check syscall.tbl for powerpc in check-headers.sh, it is similar with commit c9b51a017065 ("perf tools: Move syscall_64.tbl check into check-headers.sh"). Signed-off-by: Tiezhu Yang --- tools/perf/arch/powerpc/Makefile | 7 --- tools/perf/check-headers.sh | 1

[PATCH 2/4] perf tools: Move syscall.tbl check into check-headers.sh for s390

2020-12-18 Thread Tiezhu Yang
It is better to check syscall.tbl for s390 in check-headers.sh, it is similar with commit c9b51a017065 ("perf tools: Move syscall_64.tbl check into check-headers.sh"). Signed-off-by: Tiezhu Yang --- tools/perf/arch/s390/Makefile | 4 tools/perf/check-headers.sh | 1 + 2 files

[PATCH 4/4] perf tools: Update s390's syscall.tbl

2020-12-18 Thread Tiezhu Yang
perf/arch/s390/entry/syscalls/syscall.tbl Signed-off-by: Tiezhu Yang --- tools/perf/arch/s390/entry/syscalls/syscall.tbl | 395 ++-- 1 file changed, 225 insertions(+), 170 deletions(-) diff --git a/tools/perf/arch/s390/entry/syscalls/syscall.tbl b/tools/perf/arch/s390/entry/

[PATCH 0/4] Move syscall.tbl check and update syscall.tbl for powerpc and s390

2020-12-18 Thread Tiezhu Yang
Tiezhu Yang (4): perf tools: Move syscall.tbl check into check-headers.sh for powerpc perf tools: Move syscall.tbl check into check-headers.sh for s390 perf tools: Update powerpc's syscall.tbl perf tools: Update s390's syscall.tbl tools/perf/arch/powerpc/Makefile

[PATCH 3/4] perf tools: Update powerpc's syscall.tbl

2020-12-18 Thread Tiezhu Yang
tbl tools/perf/arch/powerpc/entry/syscalls/syscall.tbl Signed-off-by: Tiezhu Yang --- tools/perf/arch/powerpc/entry/syscalls/syscall.tbl | 25 -- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl b/tools/per

Re: [QUESTION] support perf record --call-graph dwarf for mips

2020-12-17 Thread Tiezhu Yang
On 12/16/2020 11:16 PM, Arnaldo Carvalho de Melo wrote: Em Wed, Dec 16, 2020 at 11:30:47AM -0300, Arnaldo Carvalho de Melo escreveu: Em Wed, Dec 16, 2020 at 07:14:02PM +0800, Jiaxun Yang escreveu: 在 2020/12/16 下午6:05, Tiezhu Yang 写道: Hi, In the current upstream mainline kernel, perf record

[QUESTION] support perf record --call-graph dwarf for mips

2020-12-16 Thread Tiezhu Yang
Hi, In the current upstream mainline kernel, perf record --call-graph dwarf is not supported for architecture mips64. I find the following related patches about this feature by David Daney and Archer Yan in Sep 2019. [1/2] Support mips unwinding and dwarf-regs https://lore.kernel.org/patchwork

Re: [PATCH] MIPS: Loongson64: Give chance to build under !CONFIG_NUMA and !CONFIG_SMP

2020-12-15 Thread Tiezhu Yang
On 12/15/2020 09:21 PM, Thomas Bogendoerfer wrote: On Thu, Dec 03, 2020 at 08:32:52PM +0800, Tiezhu Yang wrote: In the current code, we can not build under !CONFIG_NUMA and !CONFIG_SMP on the Loongson64 platform, it seems bad for the users who just want to use pure single core (not nosmp) to

[PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable()

2020-12-14 Thread Tiezhu Yang
rectory [root@linux loongson]# echo 0 > /sys/devices/system/cpu/cpu0/online bash: /sys/devices/system/cpu/cpu0/online: Permission denied So no need to check CPU 0 in cps_cpu_disable(), just remove it. Reported-by: liwei (GF) Signed-off-by: Tiezhu Yang --- cps_cpu_disable() is not done in the ear

Re: [PATCH] MIPS: No need to check CPU 0 in {loongson3,bmips,octeon}_cpu_disable()

2020-12-14 Thread Tiezhu Yang
On 12/15/2020 11:26 AM, liwei (GF) wrote: Hi, On 2020/11/25 18:11, Tiezhu Yang wrote: After commit 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable"), Why CPU#0 is not hotpluggable on MIPS? Does that unrealizable? The early discussion is here: https://patchwork.kernel.org/project/

[PATCH v2] perf callchain: Return directly when use '--call-graph dwarf' under !HAVE_DWARF_SUPPORT

2020-12-14 Thread Tiezhu Yang
, max size of stack recording () default: 8192 (bytes) Default: fp Signed-off-by: Tiezhu Yang --- v2: Use HAVE_DWARF_SUPPORT to check tools/perf/util/callchain.c | 11 +++ 1 file changed, 11 insertions(+) dif

Re: [PATCH] perf callchain: Return directly when use '--call-graph dwarf' under !CONFIG_DWARF

2020-12-14 Thread Tiezhu Yang
On 12/14/2020 09:39 PM, Arnaldo Carvalho de Melo wrote: Em Mon, Dec 14, 2020 at 08:56:55PM +0800, Tiezhu Yang escreveu: DWARF register mappings have not been defined for some architectures, at least for mips, so we can print an error message and then return directly when use '--call-graph

[PATCH] perf callchain: Return directly when use '--call-graph dwarf' under !CONFIG_DWARF

2020-12-14 Thread Tiezhu Yang
, max size of stack recording () default: 8192 (bytes) Default: fp Signed-off-by: Tiezhu Yang --- tools/perf/util/callchain.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/perf/util/callchain

[PATCH v2] MIPS: Select ARCH_KEEP_MEMBLOCK if DEBUG_KERNEL to enable sysfs memblock debug

2020-12-07 Thread Tiezhu Yang
with this patch, we can see the following two sysfs interfaces under DEBUG_FS. /sys/kernel/debug/memblock/memory /sys/kernel/debug/memblock/reserved Signed-off-by: Tiezhu Yang --- v2: - select ARCH_KEEP_MEMBLOCK only if DEBUG_KERNEL arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) di

Re: [PATCH 2/2] MIPS: Select ARCH_KEEP_MEMBLOCK to enable sysfs memblock debug

2020-12-04 Thread Tiezhu Yang
On 12/04/2020 08:08 PM, Thomas Bogendoerfer wrote: On Thu, Dec 03, 2020 at 11:58:51AM +0800, Jiaxun Yang wrote: 在 2020/12/3 上午11:19, Tiezhu Yang 写道: In the current code, CONFIG_ARCH_KEEP_MEMBLOCK is not set for MIPS arch, memblock_discard() will discard memory and reserved arrays if they were

[PATCH] MIPS: Loongson64: Give chance to build under !CONFIG_NUMA and !CONFIG_SMP

2020-12-03 Thread Tiezhu Yang
declaration of prom_init_memory() and add the declaration of szmem() in loongson.h to avoid build error. Signed-off-by: Youling Tang Signed-off-by: Jinyang He Signed-off-by: Tiezhu Yang --- arch/mips/Kconfig| 3 +- arch/mips/configs/loongson3_defconfig| 2

[PATCH 0/2] memblock debug

2020-12-02 Thread Tiezhu Yang
Tiezhu Yang (2): MIPS: Move memblock_dump_all() to the end of setup_arch() MIPS: Select ARCH_KEEP_MEMBLOCK to enable sysfs memblock debug arch/mips/Kconfig| 1 + arch/mips/kernel/setup.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.1.0

[PATCH 1/2] MIPS: Move memblock_dump_all() to the end of setup_arch()

2020-12-02 Thread Tiezhu Yang
In order to get more memblock configuration with memblock=debug in the boot cmdline, move memblock_dump_all() to the end of setup_arch(), this can help us to get dmi_setup() and resource_init() memblock info, at least for now. Signed-off-by: Tiezhu Yang --- arch/mips/kernel/setup.c | 4 ++-- 1

[PATCH 2/2] MIPS: Select ARCH_KEEP_MEMBLOCK to enable sysfs memblock debug

2020-12-02 Thread Tiezhu Yang
atch, we can see the following two sysfs interfaces under DEBUG_FS. /sys/kernel/debug/memblock/memory /sys/kernel/debug/memblock/reserved Signed-off-by: Tiezhu Yang --- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 44a47ad..f65da197 10

  1   2   3   4   5   6   >