[PATCH v6 5/5] EDAC/mce_amd: Add support for FRU Text in MCA

2024-10-15 Thread Avadhut Naik
From: Yazen Ghannam A new "FRU Text in MCA" feature is defined where the Field Replaceable Unit (FRU) Text for a device is represented by a string in the new MCA_SYND1 and MCA_SYND2 registers. This feature is supported per MCA bank, and it is advertised by the McaFruTextInMca bit (MCA_CONFIG[9]).

Re: [PATCHv6 perf/core 01/16] uprobe: Add data pointer to consumer handlers

2024-10-15 Thread Jiri Olsa
On Wed, Oct 16, 2024 at 07:24:26AM +0900, Masami Hiramatsu wrote: > On Thu, 10 Oct 2024 22:09:42 +0200 > Jiri Olsa wrote: > > > Adding data pointer to both entry and exit consumer handlers and all > > its users. The functionality itself is coming in following change. > > > > Looks good to me. >

[PATCH v6 4/5] x86/mce/apei: Handle variable register array size

2024-10-15 Thread Avadhut Naik
From: Yazen Ghannam ACPI Boot Error Record Table (BERT) is being used by the kernel to report errors that occurred in a previous boot. On some modern AMD systems, these very errors within the BERT are reported through the x86 Common Platform Error Record (CPER) format which consists of one or mor

[PATCH v6 3/5] x86/mce, EDAC/mce_amd: Add support for new MCA_SYND{1,2} registers

2024-10-15 Thread Avadhut Naik
Starting with Zen4, AMD's Scalable MCA systems incorporate two new registers: MCA_SYND1 and MCA_SYND2. These registers will include supplemental error information in addition to the existing MCA_SYND register. The data within these registers is considered valid if MCA_STATUS[SyndV] is set. Usersp

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

2024-10-15 Thread Avadhut Naik
From: Steven Rostedt When printing a dynamic array in a trace event, the method is rather ugly. It has the format of: __print_array(__get_dynamic_array(array), __get_dynmaic_array_len(array) / el_size, el_size) Since dynamic arrays are known to the tracing infrastructure, create a

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

2024-10-15 Thread Avadhut Naik
Currently, exporting new additional machine check error information involves adding new fields for the same at the end of the struct mce. This additional information can then be consumed through mcelog or tracepoint. However, as new MSRs are being added (and will be added in the future) by CPU ven

[PATCH v6 0/5] MCE wrapper and support for new SMCA syndrome MSRs

2024-10-15 Thread Avadhut Naik
This patchset adds a new wrapper for struct mce to prevent its bloating and export vendor specific error information. Additionally, support is also introduced for two new "syndrome" MSRs used in newer AMD Scalable MCA (SMCA) systems. Also, a new "FRU Text in MCA" feature that uses these new "syndro

[PATCH v17 16/16] bpf: Add get_entry_ip() for arm64

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add get_entry_ip() implementation for arm64. This is based on the information in ftrace_call_adjust() on arm64. Basically function entry address = ftrace call entry_ip - 4, but when there is a BTI at the first instruction, we need one more instruction back (entry_i

[PATCH v17 15/16] Documentation: probes: Update fprobe on function-graph tracer

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Update fprobe documentation for the new fprobe on function-graph tracer. This includes some bahvior changes and pt_regs to ftrace_regs interface change. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update @fregs parameter explanation. --- Doc

[PATCH v17 14/16] selftests/ftrace: Add a test case for repeating register/unregister fprobe

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) This test case repeats define and undefine the fprobe dynamic event to ensure that the fprobe does not cause any issue with such operations. Signed-off-by: Masami Hiramatsu (Google) --- .../test.d/dynevent/add_remove_fprobe_repeat.tc| 19 ++

[PATCH v17 13/16] selftests: ftrace: Remove obsolate maxactive syntax check

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the fprobe event does not support maxactive anymore, stop testing the maxactive syntax error checking. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc |4 +--- 1 file changed, 1 insertion(+), 3 deletions(

[PATCH v17 12/16] tracing/fprobe: Remove nr_maxactive from fprobe

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Remove depercated fprobe::nr_maxactive. This involves fprobe events to rejects the maxactive number. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Newly added. --- include/linux/fprobe.h |2 -- kernel/trace/trace_fprobe.c | 43 +

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

2024-10-15 Thread Masami Hiramatsu (Google)
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_ARGS, and CONFIG_HAVE_FUNCTION_GRAPH_FREGS. So cur

[PATCH v17 10/16] ftrace: Add CONFIG_HAVE_FTRACE_GRAPH_FUNC

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add CONFIG_HAVE_FTRACE_GRAPH_FUNC kconfig in addition to ftrace_graph_func macro check. This is for the other feature (e.g. FPROBE) which requires to access ftrace_regs from fgraph_ops::entryfunc() can avoid compiling if the fgraph can not pass the valid ftrace_reg

[PATCH v17 09/16] bpf: Enable kprobe_multi feature if CONFIG_FPROBE is enabled

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Enable kprobe_multi feature if CONFIG_FPROBE is enabled. The pt_regs is converted from ftrace_regs by ftrace_partial_regs(), thus some registers may always returns 0. But it should be enough for function entry (access arguments) and exit (access return value). Sig

[PATCH v17 08/16] tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS. With this change, fprobe events mostly use ftrace_regs instead of pt_regs. Note that if the arch doesn't enable HAVE_FTRACE_REGS_HAVING_PT_REGS, fprobe events will not be able to be used from p

[PATCH v17 07/16] tracing: Add ftrace_fill_perf_regs() for perf event

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_fill_perf_regs() which should be compatible with the perf_fetch_caller_regs(). In other words, the pt_regs returned from the ftrace_fill_perf_regs() must satisfy 'user_mode(regs) == false' and can be used for stack tracing. Signed-off-by: Masami Hiramat

[PATCH v17 06/16] tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs. This is for the eBPF which needs this to keep the same pt_regs interface to access registers. Thus when replacing the pt_regs with ftrace_regs in fprobes (which is used by kprobe_multi eBPF event)

[PATCH v17 05/16] fprobe: Use ftrace_regs in fprobe exit handler

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Change the fprobe exit handler to use ftrace_regs structure instead of pt_regs. This also introduce HAVE_FTRACE_REGS_HAVING_PT_REGS which means the ftrace_regs is including the pt_regs so that ftrace_regs can provide pt_regs without memory allocation. Fprobe introd

[PATCH v17 04/16] fprobe: Use ftrace_regs in fprobe entry handler

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe on arm64. Signed-off-by: Masami Hiramatsu (Google) Acked-by: Florent Revest --- Changes in v6: - Keep using SAVE_REG

[PATCH v17 03/16] function_graph: Pass ftrace_regs to retfunc

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Pass ftrace_regs to the fgraph_ops::retfunc(). If ftrace_regs is not available, it passes a NULL instead. User callback function can access some registers (including return address) via this ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v8

[PATCH v17 02/16] function_graph: Replace fgraph_ret_regs with ftrace_regs

2024-10-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Use ftrace_regs instead of fgraph_ret_regs for tracing return value on function_graph tracer because of simplifying the callback interface. The CONFIG_HAVE_FUNCTION_GRAPH_RETVAL is also replaced by CONFIG_HAVE_FUNCTION_GRAPH_FREGS. Signed-off-by: Masami Hiramatsu

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

2024-10-15 Thread Masami Hiramatsu (Google)
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) via this ftrace_regs. Note that the ftrace_regs can be NULL when the arch does N

[PATCH v17 00/16] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-10-15 Thread Masami Hiramatsu (Google)
Hi, Here is the 17th version of the series to re-implement the fprobe on function-graph tracer. The previous version is; https://lore.kernel.org/all/172895571278.107311.14000164546881236558.stgit@devnote2/ This version rebased on ftrace/for-next branch on linux-trace tree and drop first 2 patche

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

2024-10-15 Thread Google
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 on x86-64 architecture go > > through arch_rethoook_trampoline() function,

Re: [PATCHv6 perf/core 02/16] uprobe: Add support for session consumer

2024-10-15 Thread Google
On Thu, 10 Oct 2024 22:09:43 +0200 Jiri Olsa wrote: > This change allows the uprobe consumer to behave as session which > means that 'handler' and 'ret_handler' callbacks are connected in > a way that allows to: > > - control execution of 'ret_handler' from 'handler' callback > - share data

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

2024-10-15 Thread Google
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", isn't it used usually? [1] https://www.kernel.org/doc/Documentation/s390/Deb

Re: [PATCH v16 09/18] tracing: Add ftrace_fill_perf_regs() for perf event

2024-10-15 Thread Google
On Tue, 15 Oct 2024 20:18:02 +0200 Heiko Carstens wrote: > On Tue, Oct 15, 2024 at 10:30:15AM +0900, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Add ftrace_fill_perf_regs() which should be compatible with the > > perf_fetch_caller_regs(). In other words, the pt_

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

2024-10-15 Thread Google
On Tue, 15 Oct 2024 20:39:06 +0200 Heiko Carstens wrote: > On Tue, Oct 15, 2024 at 10:29:17AM +0900, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Use ftrace_regs instead of fgraph_ret_regs for tracing return value > > on function_graph tracer because of simplifyi

Re: [PATCH v16 01/18] tracing: Use arch_ftrace_regs() for ftrace_regs_*() macros

2024-10-15 Thread Steven Rostedt
On Wed, 16 Oct 2024 08:25:41 +0900 Masami Hiramatsu (Google) wrote: > > > > If a change is for function graph infrastructure specifically, you can use > > "fgraph:" instead. > > Just to confirm, is "function_graph:" for function graph tracer itself? If it is for the function graph tracer, I

Re: [PATCH v16 01/18] tracing: Use arch_ftrace_regs() for ftrace_regs_*() macros

2024-10-15 Thread Google
On Tue, 15 Oct 2024 17:27:57 -0400 Steven Rostedt wrote: > > FYI, for anything to do with function hooks (fentry), the subject should be > "ftrace:" not "tracing:". Ah, yes. > > Tracing has to do with the tracing infrastructure, whereas ftrace is the > function hook infrastructure. > > I jus

Re: [PATCHv6 perf/core 01/16] uprobe: Add data pointer to consumer handlers

2024-10-15 Thread Google
On Thu, 10 Oct 2024 22:09:42 +0200 Jiri Olsa wrote: > Adding data pointer to both entry and exit consumer handlers and all > its users. The functionality itself is coming in following change. > Looks good to me. Acked-by: Masami Hiramatsu (Google) Alexei, please merge this series via bpf tre

Re: [PATCH v16 01/18] tracing: Use arch_ftrace_regs() for ftrace_regs_*() macros

2024-10-15 Thread Steven Rostedt
FYI, for anything to do with function hooks (fentry), the subject should be "ftrace:" not "tracing:". Tracing has to do with the tracing infrastructure, whereas ftrace is the function hook infrastructure. I just accepted the first two patches of this series and made the changes to the subjects.

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

2024-10-15 Thread Luis Chamberlain
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 > > tools/testing/selftests/kmod/kmod.sh to pass. > > There was an issue with kmemleak

Re: [PATCH v2] arm64: insn: Simulate nop instruction for better uprobe performance

2024-10-15 Thread Catalin Marinas
On Mon, 09 Sep 2024 07:11:14 +, Liao Chang wrote: > v2->v1: > 1. Remove the simuation of STP and the related bits. > 2. Use arm64_skip_faulting_instruction for single-stepping or FEAT_BTI >scenario. > > As Andrii pointed out, the uprobe/uretprobe selftest bench run into a > counterintuitiv

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

2024-10-15 Thread Heiko Carstens
On Tue, Oct 15, 2024 at 10:29:17AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Use ftrace_regs instead of fgraph_ret_regs for tracing return value > on function_graph tracer because of simplifying the callback interface. > > The CONFIG_HAVE_FUNCTION_GRAPH_RETVAL

Re: [PATCH v16 09/18] tracing: Add ftrace_fill_perf_regs() for perf event

2024-10-15 Thread Heiko Carstens
On Tue, Oct 15, 2024 at 10:30:15AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Add ftrace_fill_perf_regs() which should be compatible with the > perf_fetch_caller_regs(). In other words, the pt_regs returned from the > ftrace_fill_perf_regs() must satisfy 'user_m

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

2024-10-15 Thread Naik, Avadhut
[...] On 10/15/2024 01:53, Zhuo, Qiuxu wrote: >> From: Avadhut Naik >> [...] >> [...] >> static __always_inline int >> -__mc_scan_banks(struct mce *m, struct pt_regs *regs, struct mce *final, >> +__mc_scan_banks(struct mce_hw_err *err, struct pt_regs *regs, struct mce >> *final, > > The 'fina

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Miguel Ojeda
On Tue, Oct 15, 2024 at 4:46 PM Alice Ryhl wrote: > > Too late! But I can do that if I send yet another version. Yeah, I meant after the one you already sent :) Cheers, Miguel

Re: [syzbot] [fs?] [mm?] stack segment fault in folio_wait_writeback

2024-10-15 Thread Mathieu Desnoyers
On 2024-10-14 04:41, Dmitry Vyukov wrote: On Sun, 13 Oct 2024 at 13:01, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:7234e2ea0edd Merge tag 'scsi-fixes' of git://git.kernel.or.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=15

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Alice Ryhl
On Tue, Oct 15, 2024 at 4:44 PM Miguel Ojeda wrote: > > On Tue, Oct 15, 2024 at 3:07 PM Alice Ryhl wrote: > > > > Thank you. I was able to reproduce the error locally. It only happens > > when CONFIG_JUMP_LABEL is disabled. I've verified that this fixes it. > > You're welcome! > > By the way, if

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Miguel Ojeda
On Tue, Oct 15, 2024 at 3:07 PM Alice Ryhl wrote: > > Thank you. I was able to reproduce the error locally. It only happens > when CONFIG_JUMP_LABEL is disabled. I've verified that this fixes it. You're welcome! By the way, if you end up sending a new version, then you could simplify to `ifdef C

Re: [syzbot] Monthly trace report (Oct 2024)

2024-10-15 Thread Steven Rostedt
On Tue, 15 Oct 2024 12:05:29 +0200 Aleksandr Nogikh wrote: > > None of these look like they are tracing infrastructure related. > > Like get_maintainer.pl, syzbot relies on the MAINTAINERS file to > attribute bugs to the individual kernel subsystems. If several ones > are suitable, the bug is

Re: Have compiler remove __fentry locations from overwritten weak functions

2024-10-15 Thread Steven Rostedt
On Tue, 15 Oct 2024 10:01:49 +0200 Peter Zijlstra wrote: > On Mon, Oct 14, 2024 at 09:08:41PM -0400, Steven Rostedt wrote: > > There's a long standing issue with having fentry in weak functions that > > were overwritten. This was first caught when a "notrace" function was > > showing up in the /s

[PATCH v4 6/6] rtla: Documentation: Mention --deepest-idle-state

2024-10-15 Thread tglozar
From: Tomas Glozar Add --deepest-idle-state to manpage and mention libcpupower dependency in README.txt. Signed-off-by: Tomas Glozar --- Documentation/tools/rtla/common_timerlat_options.rst | 8 tools/tracing/rtla/README.txt| 4 2 files changed, 12 inserti

[PATCH v4 5/6] rtla/timerlat: Add --deepest-idle-state for hist

2024-10-15 Thread tglozar
From: Tomas Glozar Support limiting deepest idle state also for timerlat-hist. Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_hist.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/t

[PATCH v4 4/6] rtla/timerlat: Add --deepest-idle-state for top

2024-10-15 Thread tglozar
From: Tomas Glozar Add option to limit deepest idle state on CPUs where timerlat is running for the duration of the workload. Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_top.c | 42 ++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/to

[PATCH v4 3/6] rtla/utils: Add idle state disabling via libcpupower

2024-10-15 Thread tglozar
From: Tomas Glozar Add functions to utils.c to disable idle states through functions of libcpupower. This will serve as the basis for disabling idle states per cpu when running timerlat. Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/utils.c | 150 + too

[PATCH v4 2/6] rtla: Add optional dependency on libcpupower

2024-10-15 Thread tglozar
From: Tomas Glozar If libcpupower is present, set HAVE_LIBCPUPOWER_SUPPORT macro to allow features depending on libcpupower in rtla. Signed-off-by: Tomas Glozar --- tools/tracing/rtla/Makefile| 2 ++ tools/tracing/rtla/Makefile.config | 10 ++ 2 files changed, 12 insertions(+)

[PATCH v4 0/6] rtla: Support idle state disabling via libcpupower in timerlat

2024-10-15 Thread tglozar
From: Tomas Glozar rtla-timerlat allows reducing latency on wake up from idle by setting /dev/cpu_dma_latency during the timerlat measurement. This has an effect on the idle states of all CPUs, including those which are not used by timerlat. Add option --deepest-idle-state that allows limiting t

[PATCH v4 1/6] tools/build: Add libcpupower dependency detection

2024-10-15 Thread tglozar
From: Tomas Glozar Add the ability to detect the presence of libcpupower on a system to the Makefiles in tools/build. Signed-off-by: Tomas Glozar --- tools/build/Makefile.feature | 1 + tools/build/feature/Makefile | 4 2 files changed, 5 insertions(+) diff --git a/tools/build/Makefile.f

[PATCH v11 5/5] rust: add arch_static_branch

2024-10-15 Thread Alice Ryhl
To allow the Rust implementation of static_key_false to use runtime code patching instead of the generic implementation, pull in the relevant inline assembly from the jump_label.h header by running the C preprocessor on a .rs.S file. Build rules are added for .rs.S files. Since the relevant inline

[PATCH v11 4/5] jump_label: adjust inline asm to be consistent

2024-10-15 Thread Alice Ryhl
To avoid duplication of inline asm between C and Rust, we need to import the inline asm from the relevant `jump_label.h` header into Rust. To make that easier, this patch updates the header files to expose the inline asm via a new ARCH_STATIC_BRANCH_ASM macro. The header files are all updated to d

[PATCH v11 3/5] rust: samples: add tracepoint to Rust sample

2024-10-15 Thread Alice Ryhl
This updates the Rust printing sample to invoke a tracepoint. This ensures that we have a user in-tree from the get-go even though the patch is being merged before its real user. Reviewed-by: Boqun Feng Signed-off-by: Alice Ryhl --- MAINTAINERS| 1 + include/trace/event

[PATCH v11 2/5] rust: add tracepoint support

2024-10-15 Thread Alice Ryhl
Make it possible to have Rust code call into tracepoints defined by C code. It is still required that the tracepoint is declared in a C header, and that this header is included in the input to bindgen. Instead of calling __DO_TRACE directly, the exported rust_do_trace_ function calls an inline hel

[PATCH v11 0/5] Tracepoints and static branch in Rust

2024-10-15 Thread Alice Ryhl
An important part of a production ready Linux kernel driver is tracepoints. So to write production ready Linux kernel drivers in Rust, we must be able to call tracepoints from Rust code. This patch series adds support for calling tracepoints declared in C from Rust. This series includes a patch th

[PATCH v11 1/5] rust: add static_branch_unlikely for static_key_false

2024-10-15 Thread Alice Ryhl
Add just enough support for static key so that we can use it from tracepoints. Tracepoints rely on `static_branch_unlikely` with a `struct static_key_false`, so we add the same functionality to Rust. This patch only provides a generic implementation without code patching (matching the one used whe

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Alice Ryhl
On Tue, Oct 15, 2024 at 2:11 PM Miguel Ojeda wrote: > > On Tue, Oct 15, 2024 at 1:06 PM kernel test robot wrote: > > > > >> /bin/sh: 1: cannot create rust/kernel/arch_static_branch_asm.rs: > > >> Directory nonexistent > > This happens because we run `RSCPP` even when it is not a target. We > can

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Alice Ryhl
On Fri, Oct 11, 2024 at 5:24 PM Josh Poimboeuf wrote: > > On Fri, Oct 11, 2024 at 10:13:38AM +, Alice Ryhl wrote: > > +#[cfg(CONFIG_JUMP_LABEL)] > > +#[cfg(not(CONFIG_HAVE_JUMP_LABEL_HACK))] > > +macro_rules! arch_static_branch { > > +($key:path, $keytyp:ty, $field:ident, $branch:expr) =>

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread Miguel Ojeda
On Tue, Oct 15, 2024 at 1:06 PM kernel test robot wrote: > > >> /bin/sh: 1: cannot create rust/kernel/arch_static_branch_asm.rs: Directory > >> nonexistent This happens because we run `RSCPP` even when it is not a target. We can add the dependency conditionally: @@ -423,8 +425,10 @@ $(obj)/uapi

[PATCH v4] ring-buffer: Limit time with disabled interrupts in rb_check_pages()

2024-10-15 Thread Petr Pavlu
The function rb_check_pages() validates the integrity of a specified per-CPU tracing ring buffer. It does so by traversing the underlying linked list and checking its next and prev links. To guarantee that the list isn't modified during the check, a caller typically needs to take cpu_buffer->reade

[PATCH v2] ring-buffer: Fix reader locking when changing the sub buffer order

2024-10-15 Thread Petr Pavlu
The function ring_buffer_subbuf_order_set() updates each ring_buffer_per_cpu and installs new sub buffers that match the requested page order. This operation may be invoked concurrently with readers that rely on some of the modified data, such as the head bit (RB_PAGE_HEAD), or the ring_buffer_per_

Re: [RFC PATCH v1 18/57] trace: Remove PAGE_SIZE compile-time constant assumption

2024-10-15 Thread Ryan Roberts
On 14/10/2024 17:46, Steven Rostedt wrote: > On Mon, 14 Oct 2024 11:58:25 +0100 > Ryan Roberts wrote: > >> To prepare for supporting boot-time page size selection, refactor code >> to remove assumptions about PAGE_SIZE being compile-time constant. Code >> intended to be equivalent when compile-ti

Re: [PATCH v10 5/5] rust: add arch_static_branch

2024-10-15 Thread kernel test robot
: eb887c4567d1b0e7684c026fe7df44afa96589e6 patch link: https://lore.kernel.org/r/20241011-tracepoint-v10-5-7fbde4d6b525%40google.com patch subject: [PATCH v10 5/5] rust: add arch_static_branch config: riscv-randconfig-r062-20241015 (https://download.01.org/0day-ci/archive/20241015/202410151814.wmllakcq

Re: [syzbot] Monthly trace report (Oct 2024)

2024-10-15 Thread Aleksandr Nogikh
Hi Steven, Thanks for the analysis! On Fri, Oct 11, 2024 at 6:00 PM Steven Rostedt wrote: > > On Fri, 11 Oct 2024 08:25:29 -0700 > syzbot wrote: > > > Hello trace maintainers/developers, > > > > This is a 31-day syzbot report for the trace subsystem. > > All related reports/information can be f

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

2024-10-15 Thread Borislav Petkov
On Tue, Oct 15, 2024 at 06:53:41AM +, Zhuo, Qiuxu wrote: > The word 'mce' isn't too long. IMHO using 'mce' instead of 'm' as > a variable name is more meaningful :-). > > struct mce mce; No, this is not better. Because sometimes it is ambiguous whether the struct "mce" is meant or the var

Re: Have compiler remove __fentry locations from overwritten weak functions

2024-10-15 Thread Peter Zijlstra
On Tue, Oct 15, 2024 at 10:01:49AM +0200, Peter Zijlstra wrote: > > Would this be something that the compiler could do? > > Linker, this is link time. The linker would not only have to drop the > (weak) symbol from the symbol table (which is all it really does), but > it would now have to go and

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

2024-10-15 Thread Nathan Chancellor
On Fri, Oct 11, 2024 at 03:58:04PM +0300, Mike Rapoport wrote: > I overlooked how cfi_*_callers routines update addr. > This patch should fix it: Thanks, can confirm. My boot is working again and LKDTM's CFI_FORWARD_PROTO test properly fails. > diff --git a/arch/x86/kernel/alternative.c b/arch/x8

Re: Have compiler remove __fentry locations from overwritten weak functions

2024-10-15 Thread Peter Zijlstra
On Mon, Oct 14, 2024 at 09:08:41PM -0400, Steven Rostedt wrote: > There's a long standing issue with having fentry in weak functions that > were overwritten. This was first caught when a "notrace" function was > showing up in the /sys/kernel/tracing/available_filter_functions list. > > > https