Re: [PATCH v4 1/4] x86/ibt: factor out cfi and fineibt offset

2025-03-05 Thread Alexei Starovoitov
On Wed, Mar 5, 2025 at 6:59 PM Menglong Dong wrote: > > I'm not sure if it works. However, indirect call is also used > in function graph, so we still have better performance. Isn't it? > > Let me have a look at the code of the function graph first :/ Menglong, Function graph infra isn't going t

Re: [PATCH v4 1/4] x86/ibt: factor out cfi and fineibt offset

2025-03-05 Thread Menglong Dong
On Wed, Mar 5, 2025 at 11:02 PM Steven Rostedt wrote: > > On Wed, 5 Mar 2025 09:19:09 +0800 > Menglong Dong wrote: > > > Ok, let me explain it from the beginning. (My English is not good, > > but I'll try to describe it as clear as possible :/) > > I always appreciate those who struggle with Engl

Re: [PATCH -next v1 0/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread David Hildenbrand
On 05.03.25 20:58, Andrii Nakryiko wrote: On Wed, Mar 5, 2025 at 11:47 AM David Hildenbrand wrote: On 05.03.25 20:43, Andrii Nakryiko wrote: On Wed, Mar 5, 2025 at 7:22 AM Oleg Nesterov wrote: On 03/04, David Hildenbrand wrote: Currently, uprobe_write_opcode() implements COW-breaking man

Re: [PATCH -next v1 0/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread Andrii Nakryiko
On Wed, Mar 5, 2025 at 11:47 AM David Hildenbrand wrote: > > On 05.03.25 20:43, Andrii Nakryiko wrote: > > On Wed, Mar 5, 2025 at 7:22 AM Oleg Nesterov wrote: > >> > >> On 03/04, David Hildenbrand wrote: > >>> > >>> Currently, uprobe_write_opcode() implements COW-breaking manually, which > >>> i

Re: [PATCH -next v1 0/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread David Hildenbrand
On 05.03.25 20:43, Andrii Nakryiko wrote: On Wed, Mar 5, 2025 at 7:22 AM Oleg Nesterov wrote: On 03/04, David Hildenbrand wrote: Currently, uprobe_write_opcode() implements COW-breaking manually, which is really far from ideal. To say at least ;) David, thanks for doing this. I'll try to

Re: [PATCH -next v1 0/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread Andrii Nakryiko
On Wed, Mar 5, 2025 at 7:22 AM Oleg Nesterov wrote: > > On 03/04, David Hildenbrand wrote: > > > > Currently, uprobe_write_opcode() implements COW-breaking manually, which is > > really far from ideal. > > To say at least ;) > > David, thanks for doing this. I'll try to read 3/3 tomorrow, but I do

Re: [PATCH -next v1 3/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread David Hildenbrand
On 05.03.25 20:30, Matthew Wilcox wrote: On Tue, Mar 04, 2025 at 04:48:46PM +0100, David Hildenbrand wrote: +static bool orig_page_is_identical(struct vm_area_struct *vma, + unsigned long vaddr, struct page *page, bool *pmd_mappable) +{ + const pgoff_t index = vaddr_to_offset

[PATCH] kbuild: exclude .rodata.(cst|str)* when building ranges

2025-03-05 Thread Kris Van Hees
The .rodata.(cst|str)* sections are often resized during the final linking and since these sections do not cover actual symbols there is no need to include them in the modules.builtin.ranges data. When these sections were included in processing and resizing occurred, modules were reported with ran

Re: [PATCH -next v1 3/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread Matthew Wilcox
On Tue, Mar 04, 2025 at 04:48:46PM +0100, David Hildenbrand wrote: > +static bool orig_page_is_identical(struct vm_area_struct *vma, > + unsigned long vaddr, struct page *page, bool *pmd_mappable) > +{ > + const pgoff_t index = vaddr_to_offset(vma, vaddr) >> PAGE_SHIFT; > + stru

[PATCH v5 3/9] rv: Add sco and tss per-cpu monitors

2025-03-05 Thread Gabriele Monaco
Add 2 per-cpu monitors as part of the sched model: * sco: scheduling context operations Monitor to ensure sched_set_state happens only in thread context * tss: task switch while scheduling Monitor to ensure sched_switch happens only in scheduling context To: Ingo Molnar To: Peter Zijlstr

[PATCH v4 4/8] tracing: Have persistent trace instances save KASLR offset

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt There's no reason to save the KASLR offset for the ring buffer itself. That is used by the tracer. Now that the tracer has a way to save data in the persistent memory of the ring buffer, have the tracing infrastructure take care of the saving of the KASLR offset. Reviewed-by

[PATCH v4 7/8] tracing: Show module names and addresses of last boot

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt Add the last boot module's names and addresses to the last_boot_info file. This only shows the module information from a previous boot. If the buffer is started and is recording the current boot, this file still will only show "current". ~# cat instances/boot_mapped/last_b

[PATCH v4 0/8] ring-buffer/tracing: Save module information in persistent memory

2025-03-05 Thread Steven Rostedt
This updates the persistent instance to record what modules were loaded and what addresses they were loaded at. First the KASLR offset is recorded in the persistent ring buffer instead of a text address. This can be used to calculated the address offset. Next the persistent memory is divided up

[PATCH v4 2/8] ring-buffer: Add buffer meta data for persistent ring buffer

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt Instead of just having a meta data at the first page of each sub buffer that has duplicate data, add a new meta page to the entire block of memory that holds the duplicate data and remove it from the sub buffer meta data. This will open up the extra memory in this first page

[PATCH v4 5/8] module: Add module_for_each_mod() function

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt The tracing system needs a way to save all the currently loaded modules and their addresses into persistent memory so that it can evaluate the addresses on a reboot from a crash. When the persistent memory trace starts, it will load the module addresses and names into the per

[PATCH v4 8/8] tracing: Update modules to persistent instances when loaded

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt When a module is loaded and a persistent buffer is actively tracing, add it to the list of modules in the persistent memory. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c| 27 + kernel/trace/trace.h| 2 ++ kernel/t

[PATCH v4 3/8] ring-buffer: Add ring_buffer_meta_scratch()

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt Now that there's one meta data at the start of the persistent memory used by the ring buffer, allow the caller to request some memory right after that data that it can use as its own persistent memory. Also fix some white space issues with ring_buffer_alloc(). Reviewed-by:

[PATCH v4 1/8] ring-buffer: Use kaslr address instead of text delta

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt Instead of saving off the text and data pointers and using them to compare with the current boot's text and data pointers, just save off the KASLR offset. Then that can be used to figure out how to read the previous boots buffer. The last_boot_info will now show this offset,

[PATCH v4 6/8] tracing: Have persistent trace instances save module addresses

2025-03-05 Thread Steven Rostedt
From: Steven Rostedt For trace instances that are mapped to persistent memory, have them use the scratch area to save the currently loaded modules. This will allow where the modules have been loaded on the next boot so that their addresses can be deciphered by using where they were loaded previou

[PATCH v5 8/9] Documentation/rv: Add docs for the sched monitors

2025-03-05 Thread Gabriele Monaco
Add man page and kernel documentation for the sched monitors, as sched is a container of other monitors, document all in the same page. sched is the first nested monitor, also explain what is a nested monitor and how enabling containers or children monitors work. To: Ingo Molnar To: Peter Zijlstr

Re: [PATCH -next v1 0/3] kernel/events/uprobes: uprobe_write_opcode() rewrite

2025-03-05 Thread Oleg Nesterov
On 03/04, David Hildenbrand wrote: > > Currently, uprobe_write_opcode() implements COW-breaking manually, which is > really far from ideal. To say at least ;) David, thanks for doing this. I'll try to read 3/3 tomorrow, but I don't think I can really help. Let me repeat, this code was written man

Re: [PATCH resend ] tracepoint: Print the function symbol when tracepoint_debug is set

2025-03-05 Thread Steven Rostedt
On Wed, 5 Mar 2025 08:53:43 -0500 Mathieu Desnoyers wrote: > On 2025-03-04 20:55, Huang Shijie wrote: > > When tracepoint_debug is set, we may get the output in kernel log: > > [ 380.013843] Probe 0 : f0d68cda > > > > It is not readable, so change to print the function symbol. > >

Re: [PATCH v3 5/8] module: Add module_for_each_mod() function

2025-03-05 Thread Steven Rostedt
On Wed, 5 Mar 2025 09:47:49 +0100 Petr Pavlu wrote: > On 3/4/25 15:57, Steven Rostedt wrote: > > > > Luis, > > > > Can I get an Acked-by from you? > > > > This follows the changes you have in linux-next. > > Hi Steven, > > I'm not Luis, but we started rotating the modules maintenance every

Re: [PATCH v4 1/4] x86/ibt: factor out cfi and fineibt offset

2025-03-05 Thread Steven Rostedt
On Wed, 5 Mar 2025 09:19:09 +0800 Menglong Dong wrote: > Ok, let me explain it from the beginning. (My English is not good, > but I'll try to describe it as clear as possible :/) I always appreciate those who struggle with English having these conversations. Thank you for that, as I know I am ho

Re: [PATCH 2/2] pid: Optional first-fit pid allocation

2025-03-05 Thread Michal Koutný
Hi. On Fri, Feb 21, 2025 at 04:18:54PM -0800, Andrew Morton wrote: > This seems thin. Is there more we can tell our users? What are the > visible effects of this? What are the benefits? Why would they want > to turn it on? Thanks for review and comments (also Alexander). > I mean, there ar

Re: [PATCH 2/2] pid: Optional first-fit pid allocation

2025-03-05 Thread Michal Koutný
On Sat, Feb 22, 2025 at 09:02:08AM +, David Laight wrote: > It also seems a good way of being able to predict the next pid and > doing all the 'nasty' things that allows because there is no guard > time on pid reuse. The motivations was not to make guessing next pid more difficult, I'll upda

[PATCH v5 7/9] verification/dot2k: Add support for nested monitors

2025-03-05 Thread Gabriele Monaco
RV now supports nested monitors, this functionality requires a container monitor, which has virtually no functionality besides holding other monitors, and nested monitors, that have a container as parent. Add the -p flag to pass a parent to a monitor, this sets it up while registering the monitor

[PATCH v5 5/9] rv: Add scpd, snep and sncid per-cpu monitors

2025-03-05 Thread Gabriele Monaco
Add 3 per-cpu monitors as part of the sched model: * scpd: schedule called with preemption disabled Monitor to ensure schedule is called with preemption disabled * snep: schedule does not enable preempt Monitor to ensure schedule does not enable preempt * sncid: schedule not called with in

[PATCH v5 2/9] rv: Add option for nested monitors and include sched

2025-03-05 Thread Gabriele Monaco
Monitors describing complex systems, such as the scheduler, can easily grow to the point where they are just hard to understand because of the many possible state transitions. Often it is possible to break such descriptions into smaller monitors, sharing some or all events. Enabling those smaller m

[PATCH v5 0/9] rv: Add scheduler specification monitors

2025-03-05 Thread Gabriele Monaco
This patchset starts including adapted scheduler specifications from Daniel's task model [1]. As the model is fairly complicated, it is split in several generators and specifications. The tool used to create the model can output a unified model, but that would be hardly readable (9k states). RV al

[PATCH v5 1/9] sched: Add sched tracepoints for RV task model

2025-03-05 Thread Gabriele Monaco
Add the following tracepoints: * sched_entry(bool preempt, ip) Called while entering __schedule * sched_exit(bool is_switch, ip) Called while exiting __schedule * sched_set_state(task, curr_state, state) Called when a task changes its state (to and from running) These tracepoints are u

[PATCH v5 9/9] tools/rv: Allow rv list to filter for container

2025-03-05 Thread Gabriele Monaco
Add possibility to supply the container name to rv list: # rv list sched mon1 mon2 mon3 This lists only monitors in sched, without indentation. Supplying -h, any option (string starting with -) or more than 1 argument will still print the usage. Passing a non-existent container prints not

[PATCH v5 6/9] tools/rv: Add support for nested monitors

2025-03-05 Thread Gabriele Monaco
RV now supports nested monitors, this functionality requires a container monitor, which has virtually no functionality besides holding other monitors, and nested monitors, that have a container as parent. Nested monitors' sysfs folders are physically nested in the container's folder, and they are

[PATCH v5 4/9] rv: Add snroc per-task monitor

2025-03-05 Thread Gabriele Monaco
Add a per-task monitor as part of the sched model: * snroc: set non runnable on its own context Monitor to ensure set_state happens only in the respective task's context To: Ingo Molnar To: Peter Zijlstra Cc: Juri Lelli Cc: John Kacur Cc: Clark Williams Signed-off-by: Gabriele Monaco --

Re: [PATCH resend ] tracepoint: Print the function symbol when tracepoint_debug is set

2025-03-05 Thread Mathieu Desnoyers
On 2025-03-04 20:55, Huang Shijie wrote: When tracepoint_debug is set, we may get the output in kernel log: [ 380.013843] Probe 0 : f0d68cda It is not readable, so change to print the function symbol. After this patch, the output may becomes: [ 54.930567] Probe 0 : perf_tr

Re: [PATCH RFC v2 02/29] x86: Create CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION

2025-03-05 Thread Brendan Jackman
On Sat, Mar 01, 2025 at 09:23:51AM +0200, Mike Rapoport wrote: > Hi Brendan, > > On Fri, Jan 10, 2025 at 06:40:28PM +, Brendan Jackman wrote: > > Currently a nop config. Keeping as a separate commit for easy review of > > the boring bits. Later commits will use and enable this new config. > > >

Re: [PATCH v4 02/11] rv: Add license identifiers to monitor files

2025-03-05 Thread Gabriele Monaco
On Tue, 2025-03-04 at 12:18 -0500, Steven Rostedt wrote: > On Tue, 18 Feb 2025 13:31:07 +0100 > Gabriele Monaco wrote: > > > Some monitor files like the main header and the Kconfig are missing > > the > > license identifier. > > > > Add it to those and make sure the automatic generation script >

Re: [RFC v2 7/9] khugepaged: add mTHP support

2025-03-05 Thread Dev Jain
On 04/03/25 12:43 am, Nico Pache wrote: On Wed, Feb 19, 2025 at 9:52 AM Ryan Roberts wrote: On 11/02/2025 00:30, Nico Pache wrote: Introduce the ability for khugepaged to collapse to different mTHP sizes. While scanning a PMD range for potential collapse candidates, keep track of pages in

Re: [RFC v2 7/9] khugepaged: add mTHP support

2025-03-05 Thread Dev Jain
On 19/02/25 10:22 pm, Ryan Roberts wrote: On 11/02/2025 00:30, Nico Pache wrote: Introduce the ability for khugepaged to collapse to different mTHP sizes. While scanning a PMD range for potential collapse candidates, keep track of pages in MIN_MTHP_ORDER chunks via a bitmap. Each bit represen

Re: [PATCH v4 1/4] x86/ibt: factor out cfi and fineibt offset

2025-03-05 Thread Menglong Dong
On Wed, Mar 5, 2025 at 4:30 PM H. Peter Anvin wrote: > > On March 4, 2025 5:19:09 PM PST, Menglong Dong > wrote: > >On Tue, Mar 4, 2025 at 10:53 PM H. Peter Anvin wrote: > >> > >> On March 4, 2025 1:42:20 AM PST, Peter Zijlstra > >> wrote: > >> >On Tue, Mar 04, 2025 at 03:47:45PM +0800, Mengl

Re: [PATCH v3 5/8] module: Add module_for_each_mod() function

2025-03-05 Thread Petr Pavlu
On 3/4/25 15:57, Steven Rostedt wrote: > > Luis, > > Can I get an Acked-by from you? > > This follows the changes you have in linux-next. Hi Steven, I'm not Luis, but we started rotating the modules maintenance every six months and I'm currently looking after the modules tree. I see Luis seeme

Re: [PATCH v4 1/4] x86/ibt: factor out cfi and fineibt offset

2025-03-05 Thread H. Peter Anvin
On March 4, 2025 5:19:09 PM PST, Menglong Dong wrote: >On Tue, Mar 4, 2025 at 10:53 PM H. Peter Anvin wrote: >> >> On March 4, 2025 1:42:20 AM PST, Peter Zijlstra wrote: >> >On Tue, Mar 04, 2025 at 03:47:45PM +0800, Menglong Dong wrote: >> >> We don't have to select FUNCTION_ALIGNMENT_32B, so th