RE: [PATCH v6 2/5] tracing: Add __print_dynamic_array() helper

2024-10-16 Thread Zhuo, Qiuxu
> From: Avadhut Naik > [...] > diff --git a/include/trace/stages/stage3_trace_output.h > b/include/trace/stages/stage3_trace_output.h > index c1fb1355d309..8e3215093e1f 100644 > --- a/include/trace/stages/stage3_trace_output.h > +++ b/include/trace/stages/stage3_trace_output.h > @@ -119,6 +119,14

[PATCH v2] verification/dot2: Improve dot parser robustness

2024-10-16 Thread Gabriele Monaco
This patch makes the dot parser used by dot2c and dot2k slightly more robust, namely: * allows parsing files with the gv extension (GraphViz) * correctly parses edges with any indentation * used to work only with a single character (e.g. '\t') Additionally it fixes a couple of warnings reported

RE: [PATCH v6 1/5] x86/mce: Add wrapper for struct mce to export vendor specific info

2024-10-16 Thread Zhuo, Qiuxu
> From: Avadhut Naik > [...] > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > [...] > @@ -1506,13 +1528,14 @@ noinstr void do_machine_check(struct pt_regs > *regs) > > this_cpu_inc(mce_exception_count); > > - mce_gather_info(&m, regs); > - m.tsc = rdt

Re: [PATCH v3 tip/perf/core 2/4] mm: switch to 64-bit mm_lock_seq/vm_lock_seq on 64-bit architectures

2024-10-16 Thread Suren Baghdasaryan
On Sun, Oct 13, 2024 at 12:56 AM Shakeel Butt wrote: > > On Thu, Oct 10, 2024 at 01:56:42PM GMT, Andrii Nakryiko wrote: > > To increase mm->mm_lock_seq robustness, switch it from int to long, so > > that it's a 64-bit counter on 64-bit systems and we can stop worrying > > about it wrapping around

Re: [PATCH v5 7/8] execmem: add support for cache of large ROX pages

2024-10-16 Thread Luis Chamberlain
On Wed, Oct 16, 2024 at 01:40:55PM +0300, Mike Rapoport wrote: > On Tue, Oct 15, 2024 at 01:11:54PM -0700, Luis Chamberlain wrote: > > On Tue, Oct 15, 2024 at 08:54:29AM +0300, Mike Rapoport wrote: > > > On Mon, Oct 14, 2024 at 09:09:49PM -0700, Luis Chamberlain wrote: > > > > Mike, please run this

Re: [PATCH v17 01/16] function_graph: Pass ftrace_regs to entryfunc

2024-10-16 Thread Google
On Wed, 16 Oct 2024 09:53:25 -0400 Steven Rostedt wrote: > On Wed, 16 Oct 2024 09:57:55 +0900 > "Masami Hiramatsu (Google)" wrote: > > > From: Masami Hiramatsu (Google) > > > > Pass ftrace_regs to the fgraph_ops::entryfunc(). If ftrace_regs is not > > available, it passes a NULL instead. User

Re: [PATCH v6 6/8] x86/module: prepare module loading for ROX allocations of text

2024-10-16 Thread Steven Rostedt
On Wed, 16 Oct 2024 15:24:22 +0300 Mike Rapoport wrote: > diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c > index 8da0e66ca22d..b498897b213c 100644 > --- a/arch/x86/kernel/ftrace.c > +++ b/arch/x86/kernel/ftrace.c > @@ -118,10 +118,13 @@ ftrace_modify_code_direct(unsigned long ip

Re: [PATCH RFC] rethook: inline arch_rethook_trampoline_callback() in assembly code

2024-10-16 Thread Andrii Nakryiko
On Tue, Oct 15, 2024 at 5:53 PM Masami Hiramatsu wrote: > > Hi Andrii, > > Sorry I excavated this from patchwork. > > On Mon, 29 Apr 2024 15:38:08 -0700 > Andrii Nakryiko wrote: > > > On Wed, Apr 24, 2024 at 5:02 PM Andrii Nakryiko wrote: > > > > > > At the lowest level, rethook-based kretprobes

The state of uprobes work and logistics

2024-10-16 Thread Andrii Nakryiko
Hello, I wanted to provide a bit of a context about and tie together a few separate work streams (across a few separate kernel trees) all revolving around uprobe improvements, as there are a bunch of them and I'm sure it's hard to keep track of all of them. And hopefully I can also get Peter and A

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-16 Thread Sven Schnelle
Masami Hiramatsu (Google) writes: > On Wed, 16 Oct 2024 14:07:31 +0200 > Sven Schnelle wrote: >> "Masami Hiramatsu (Google)" writes: >> I think that still has the issue that the size is encoded in the >> leftmost fields of the pointer, which doesn't work on all >> architectures. I reported this

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-16 Thread Sven Schnelle
Steven Rostedt writes: > On Wed, 16 Oct 2024 14:07:31 +0200 > Sven Schnelle wrote: > >> > +/* Return reserved data size in words */ >> > +static inline int decode_fprobe_header(unsigned long val, struct fprobe >> > **fp) >> > +{ >> > + unsigned long ptr; >> > + >> > + ptr = (val & FPROBE_HEAD

Re: [PATCH v6 2/8] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-10-16 Thread Uladzislau Rezki
On Wed, Oct 16, 2024 at 03:24:18PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > vmalloc allocations with VM_ALLOW_HUGE_VMAP that do not explicitly > specify node ID will use huge pages only if size_per_node is larger than > a huge page. > Still the actual allocated memory i

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-16 Thread Google
On Wed, 16 Oct 2024 14:07:31 +0200 Sven Schnelle wrote: > "Masami Hiramatsu (Google)" writes: > > > From: Masami Hiramatsu (Google) > > > > Rewrite fprobe implementation on function-graph tracer. > > Major API changes are: > > - 'nr_maxactive' field is deprecated. > > - This depends on CON

Re: [PATCH v6 1/8] mm: vmalloc: group declarations depending on CONFIG_MMU together

2024-10-16 Thread Uladzislau Rezki
On Wed, Oct 16, 2024 at 03:24:17PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > There are a couple of declarations that depend on CONFIG_MMU in > include/linux/vmalloc.h spread all over the file. > > Group them all together to improve code readability. > > No functional c

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-16 Thread Steven Rostedt
On Wed, 16 Oct 2024 14:07:31 +0200 Sven Schnelle wrote: > > +/* Return reserved data size in words */ > > +static inline int decode_fprobe_header(unsigned long val, struct fprobe > > **fp) > > +{ > > + unsigned long ptr; > > + > > + ptr = (val & FPROBE_HEADER_PTR_MASK) | ~FPROBE_HEADER_PTR_M

[PATCH] verification/dot2: Improve dot parser robustness

2024-10-16 Thread Gabriele Monaco
This patch makes the dot parser used by dot2c and dot2k slightly more robust, namely: * allows parsing files with the gv extension (GraphViz) * correctly parses edges with any indentation * used to work only with a single character (e.g. '\t') Additionally it fixes a couple of warnings reported

Re: [PATCH v17 01/16] function_graph: Pass ftrace_regs to entryfunc

2024-10-16 Thread Steven Rostedt
On Wed, 16 Oct 2024 09:57:55 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Pass ftrace_regs to the fgraph_ops::entryfunc(). If ftrace_regs is not > available, it passes a NULL instead. User callback function can access > some registers (including return address)

[PATCH v6 8/8] x86/module: enable ROX caches for module text on 64 bit

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Enable execmem's cache of PMD_SIZE'ed pages mapped as ROX for module text allocations on 64 bit. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/Kconfig | 1 + arch/x86/mm/init.c | 37 - 2 files changed, 37 insertio

[PATCH v6 7/8] execmem: add support for cache of large ROX pages

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Using large pages to map text areas reduces iTLB pressure and improves performance. Extend execmem_alloc() with an ability to use huge pages with ROX permissions as a cache for smaller allocations. To populate the cache, a writable large page is allocated from

[PATCH v6 6/8] x86/module: prepare module loading for ROX allocations of text

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" When module text memory will be allocated with ROX permissions, the memory at the actual address where the module will live will contain invalid instructions and there will be a writable copy that contains the actual module code. Update relocations and alternati

[PATCH v6 5/8] arch: introduce set_direct_map_valid_noflush()

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Add an API that will allow updates of the direct/linear map for a set of physically contiguous pages. It will be used in the following patches. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Christoph Hellwig --- arch/arm64/include/asm/set_memory.h

[PATCH v6 4/8] module: prepare to handle ROX allocations for text

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" In order to support ROX allocations for module text, it is necessary to handle modifications to the code, such as relocations and alternatives patching, without write access to that memory. One option is to use text patching, but this would make module loading e

[PATCH v6 3/8] asm-generic: introduce text-patching.h

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Several architectures support text patching, but they name the header files that declare patching functions differently. Make all such headers consistently named text-patching.h and add an empty header in asm-generic for architectures that do not support text pa

[PATCH v6 2/8] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" vmalloc allocations with VM_ALLOW_HUGE_VMAP that do not explicitly specify node ID will use huge pages only if size_per_node is larger than a huge page. Still the actual allocated memory is not distributed between nodes and there is no advantage in such approach.

[PATCH v6 1/8] mm: vmalloc: group declarations depending on CONFIG_MMU together

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" There are a couple of declarations that depend on CONFIG_MMU in include/linux/vmalloc.h spread all over the file. Group them all together to improve code readability. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Christoph Hellw

[PATCH v6 0/8] x86/module: use large ROX pages for text allocations

2024-10-16 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Hi, This is an updated version of execmem ROX caches. Andrew, Luis, there is a conflict with Suren's "page allocation tag compression" patches: https://lore.kernel.org/all/20241014203646.1952505-1-sur...@google.com Probably taking this via mmotm would be more

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-16 Thread Sven Schnelle
"Masami Hiramatsu (Google)" writes: > From: Masami Hiramatsu (Google) > > Rewrite fprobe implementation on function-graph tracer. > Major API changes are: > - 'nr_maxactive' field is deprecated. > - This depends on CONFIG_DYNAMIC_FTRACE_WITH_ARGS or > !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARG

[PATCH v6 3/3] selftests/tracing: Add hist poll() support test

2024-10-16 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Shuah Khan --- tools/testing/selftests/ftrace/

[PATCH v6 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-10-16 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event return

[PATCH v6 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-10-16 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But th

[PATCH v6 0/3] tracing: Support poll on event hist file

2024-10-16 Thread Masami Hiramatsu (Google)
Hi, Here is the v6 patch to support polling on event 'hist' file. The previous version is here; https://lore.kernel.org/all/172398710447.295714.4489282566285719918.stgit@devnote2 This version is rebased on the ftrace/for-next branch of the linux-trace tree, and use global irq_work and wq instead

Re: [PATCH v5 7/8] execmem: add support for cache of large ROX pages

2024-10-16 Thread Mike Rapoport
On Tue, Oct 15, 2024 at 01:11:54PM -0700, Luis Chamberlain wrote: > On Tue, Oct 15, 2024 at 08:54:29AM +0300, Mike Rapoport wrote: > > On Mon, Oct 14, 2024 at 09:09:49PM -0700, Luis Chamberlain wrote: > > > Mike, please run this with kmemleak enabled and running, and also try to > > > get > > > to

Re: [PATCH 2/3] tracing: Record task flag NEED_RESCHED_LAZY.

2024-10-16 Thread Shrikanth Hegde
On 10/9/24 16:20, Sebastian Andrzej Siewior wrote: The scheduler added NEED_RESCHED_LAZY scheduling. Record this state as part of trace flags and expose it in the need_resched field. Record and expose NEED_RESCHED_LAZY. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/trace_even

Re: [PATCH v16 04/18] function_graph: Replace fgraph_ret_regs with ftrace_regs

2024-10-16 Thread Heiko Carstens
On Wed, Oct 16, 2024 at 08:47:20AM +0900, Masami Hiramatsu wrote: > On Tue, 15 Oct 2024 20:39:06 +0200 > Heiko Carstens wrote: > > > That would make things much simpler... e.g. your new patch is also > > writing r3 to fregs, why? > > BTW, according to the document [1], r3 is for "return value 1