[PATCH 18/20] ftrace: Add multiple fgraph storage selftest

2024-05-24 Thread Steven Rostedt
From: "Masami Hiramatsu (Google)" Add a selftest for multiple function graph tracer with storage on a same function. In this case, the shadow stack entry will be shared among those fgraph with different data storage. So this will ensure the fgraph will not mixed those storage data. Link:

[PATCH 20/20] function_graph: Use bitmask to loop on fgraph entry

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Instead of looping through all the elements of fgraph_array[] to see if there's an gops attached to one and then calling its gops->func(). Create a fgraph_array_bitmask that sets bits when an index in the array is reserved (via the simple lru algorithm). Then only

[PATCH 19/20] function_graph: Use for_each_set_bit() in __ftrace_return_to_handler()

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Instead of iterating through the entire fgraph_array[] and seeing if one of the bitmap bits are set to know to call the array's retfunc() function, use for_each_set_bit() on the bitmap itself. This will only iterate for the number of set bits. Signed-off-by:

[PATCH 17/20] function_graph: Add selftest for passing local variables

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add boot up selftest that passes variables from a function entry to a function exit, and make sure that they do get passed around. Co-developed with Masami Hiramatsu: Link:

[PATCH 16/20] function_graph: Implement fgraph_reserve_data() and fgraph_retrieve_data()

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Added functions that can be called by a fgraph_ops entryfunc and retfunc to store state between the entry of the function being traced to the exit of the same function. The fgraph_ops entryfunc() may call fgraph_reserve_data() to store up to 32 words onto the

[PATCH 15/20] function_graph: Move graph notrace bit to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the function graph no-trace was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link:

[PATCH 14/20] function_graph: Move graph depth stored data to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the function graph depth was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link:

[PATCH 13/20] function_graph: Move set_graph_function tests to shadow stack global var

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The use of the task->trace_recursion for the logic used for the set_graph_funnction was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Link:

[PATCH 12/20] function_graph: Add "task variables" per task for fgraph_ops

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add a "task variables" array on the tasks shadow ret_stack that is the size of longs for each possible registered fgraph_ops. That's a total of 16, taking up 8 * 16 = 128 bytes (out of a page size 4k). This will allow for fgraph_ops to do specific features on a

[PATCH 10/20] function_graph: Have the instances use their own ftrace_ops for filtering

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Allow for instances to have their own ftrace_ops part of the fgraph_ops that makes the funtion_graph tracer filter on the set_ftrace_filter file of the instance and not the top instance. Note that this also requires to update ftrace_graph_func() to call new

[PATCH 11/20] function_graph: Use a simple LRU for fgraph_array index number

2024-05-24 Thread Steven Rostedt
From: "Masami Hiramatsu (Google)" Since the fgraph_array index is used for the bitmap on the shadow stack, it may leave some entries after a function_graph instance is removed. Thus if another instance reuses the fgraph_array index soon after releasing it, the fgraph may confuse to call the

[PATCH 09/20] ftrace: Allow ftrace startup flags to exist without dynamic ftrace

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Some of the flags for ftrace_startup() may be exposed even when CONFIG_DYNAMIC_FTRACE is not configured in. This is fine as the difference between dynamic ftrace and static ftrace is done within the internals of ftrace itself. No need to have use cases fail to

[PATCH 08/20] ftrace: Allow function_graph tracer to be enabled in instances

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Now that function graph tracing can handle more than one user, allow it to be enabled in the ftrace instances. Note, the filtering of the functions is still joined by the top level set_ftrace_filter and friends, as well as the graph and nograph files.

[PATCH 07/20] ftrace/function_graph: Pass fgraph_ops to function graph callbacks

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Pass the fgraph_ops structure to the function graph callbacks. This will allow callbacks to add a descriptor to a fgraph_ops private field that wil be added in the future and use it for the callbacks. This will be useful when more than one callback can be

[PATCH 05/20] function_graph: Handle tail calls for stack unwinding

2024-05-24 Thread Steven Rostedt
From: "Masami Hiramatsu (Google)" For the tail-call, there would be 2 or more ftrace_ret_stacks on the ret_stack, which records "return_to_handler" as the return address except for the last one. But on the real stack, there should be 1 entry because tail-call reuses the return address on the

[PATCH 06/20] function_graph: Remove logic around ftrace_graph_entry and return

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The function pointers ftrace_graph_entry and ftrace_graph_return are no longer called via the function_graph tracer. Instead, an array structure is now used that will allow for multiple users of the function_graph infrastructure. The variables are still used by

[PATCH 04/20] function_graph: Allow multiple users to attach to function graph

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Allow for multiple users to attach to function graph tracer at the same time. Only 16 simultaneous users can attach to the tracer. This is because there's an array that stores the pointers to the attached fgraph_ops. When a function being traced is entered, each

[PATCH 03/20] function_graph: Add an array structure that will allow multiple callbacks

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Add an array structure that will eventually allow the function graph tracer to have up to 16 simultaneous callbacks attached. It's an array of 16 fgraph_ops pointers, that is assigned when one is registered. On entry of a function the entry of the first item in

[PATCH 01/20] function_graph: Convert ret_stack to a series of longs

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" In order to make it possible to have multiple callbacks registered with the function_graph tracer, the retstack needs to be converted from an array of ftrace_ret_stack structures to an array of longs. This will allow to store the list of callbacks on the stack for

[PATCH 02/20] fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by long

2024-05-24 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" Instead of using "ALIGN()", use BUILD_BUG_ON() as the structures should always be divisible by sizeof(long). Co-developed with Masami Hiramatsu: Link: https://lore.kernel.org/linux-trace-kernel/171509093949.162236.14518699447151894536.stgit@devnote2 Link:

[PATCH 00/20] function_graph: Allow multiple users for function graph tracing

2024-05-24 Thread Steven Rostedt
[ Resend for some of you as I missed a comma in the Cc and quilt died sending this out. ] This is a continuation of the function graph multi user code. I wrote a proof of concept back in 2019 of this code[1] and Masami started cleaning it up. I started from Masami's work v10 that can be found

[no subject]

2024-05-24 Thread Steven Rostedt

[no subject]

2024-05-24 Thread Steven Rostedt

Re: [PATCH v10 07/36] function_graph: Allow multiple users to attach to function graph

2024-05-24 Thread Steven Rostedt
On Tue, 7 May 2024 23:09:22 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -109,6 +244,21 @@ ftrace_push_return_trace(unsigned long ret, unsigned > long func, > if (!current->ret_stack) > return -EBUSY; > > + /* > + * At first, check whether the previous fgraph

Re: [PATCH v10 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-05-24 Thread Steven Rostedt
On Tue, 7 May 2024 23:08:00 +0900 "Masami Hiramatsu (Google)" wrote: > Steven Rostedt (VMware) (15): > function_graph: Convert ret_stack to a series of longs > fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by > long > function_graph: Add an array

Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-24 Thread Luca Weiss
On Donnerstag, 23. Mai 2024 08:19:11 MESZ Krzysztof Kozlowski wrote: > On 23/05/2024 08:16, Luca Weiss wrote: > > On Donnerstag, 23. Mai 2024 08:02:13 MESZ Krzysztof Kozlowski wrote: > >> On 22/05/2024 19:34, Luca Weiss wrote: > >>> On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski

Re: Bug in Kernel 6.8.x, 6.9.x Causing Trace/Panic During Shutdown/Reboot

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 12:50:08 +0200 "Linux regression tracking (Thorsten Leemhuis)" wrote: > > - Affected Versions: Before kernel version 6.8.10, the bug caused a > > quick display of a kernel trace dump before the shutdown/reboot > > completed. Starting from version 6.8.10 and continuing into

Re: Bug in Kernel 6.8.x, 6.9.x Causing Trace/Panic During Shutdown/Reboot

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 12:50:08 +0200 "Linux regression tracking (Thorsten Leemhuis)" wrote: > [CCing a few people] > Thanks for the Cc. > On 24.05.24 12:31, Ilkka Naulapää wrote: > > > > I have encountered a critical bug in the Linux vanilla kernel that > > leads to a kernel panic during the

[PATCH v5 2/2] misc: fastrpc: use coherent pool for untranslated Compute Banks

2024-05-24 Thread Dylan Van Assche
Use fastrpc_remote_heap_alloc to allocate from the FastRPC device instead of the Compute Bank when the session ID is 0. This ensures that the allocation is inside the coherent DMA pool which is already accessible to the DSP. This is necessary to support FastRPC devices which do not have dedicated

[PATCH v5 1/2] misc: fastrpc: support complete DMA pool access to the DSP

2024-05-24 Thread Dylan Van Assche
To support FastRPC Context Banks which aren't mapped via the SMMU, make the whole reserved memory region available to the DSP to allow access to coherent buffers. This is performed by assigning the memory to the DSP via a hypervisor call to set the correct permissions for the Virtual Machines on

[PATCH v5 0/2] misc: fastrpc: FastRPC reserved memory assignment for SDM845 SLPI

2024-05-24 Thread Dylan Van Assche
* About * The Qualcomm SDM845 SoC has a separate SLPI (Sensor Low Power Island) DSP for sensors connected to the SoC which is responsible for exposing sensors to userspace, power saving, and other features. While sensors are connected to GPIOs of the SoC, they cannot be used because the

Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in the header

2024-05-24 Thread Steven Rostedt
On Fri, 24 May 2024 10:37:54 +0900 Masami Hiramatsu (Google) wrote: > > > > > > #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > > > struct ftrace_regs { > > > + /* > > > + * On the x86_64, the ftrace_regs saves; > > > + * rax, rcx, rdx, rdi, rsi, r8, r9, rbp, rip and rsp. > > > + * Also

Re: How to properly fix reading user pointers in bpf in android kernel 4.9?

2024-05-24 Thread Bagas Sanjaya
[also Cc: bpf maintainers and get_maintainer output] On Thu, May 23, 2024 at 07:52:22PM +0300, Marcel wrote: > This seems that it was a long standing problem with the Linux kernel in > general. bpf_probe_read should have worked for both kernel and user pointers > but it fails with access error

Re: Bug in Kernel 6.8.x, 6.9.x Causing Trace/Panic During Shutdown/Reboot

2024-05-24 Thread Linux regression tracking (Thorsten Leemhuis)
[CCing a few people] On 24.05.24 12:31, Ilkka Naulapää wrote: > > I have encountered a critical bug in the Linux vanilla kernel that > leads to a kernel panic during the shutdown or reboot process. The > issue arises after all services, including `journald`, have been > stopped. As a result, the

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-24 Thread zhang warden
> On May 23, 2024, at 22:22, Dan Carpenter wrote: > > Always run your patches through checkpatch. > > So this patch is so that testers can see if a function has been called? > Can you not get the same information from gcov or ftrace? > > There are style issues with the patch, but it's not

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-24 Thread zhang warden
> On May 21, 2024, at 16:04, Petr Mladek wrote: > > Another motivation to use ftrace for testing is that it does not > affect the performance in production. > > We should keep klp_ftrace_handler() as fast as possible so that we > could livepatch also performance sensitive functions. > How

Re: [RFC PATCH 00/20] Introduce the famfs shared-memory file system

2024-05-24 Thread Miklos Szeredi
On Fri, 24 May 2024 at 02:47, John Groves wrote: > Apologies, but I'm short on time at the moment - going into a long holiday > weekend in the US with family plans. I should be focused again by middle of > next week. NP. Obviously I'll need to test it before anything is merged, other than that

[PATCH v4 2/2] LoongArch: Add steal time support in guest side

2024-05-24 Thread Bibo Mao
Percpu struct kvm_steal_time is added here, its size is 64 bytes and also defined as 64 bytes, so that the whole structure is in one physical page. When vcpu is onlined, function pv_enable_steal_time() is called. This function will pass guest physical address of struct kvm_steal_time and tells

[PATCH v4 1/2] LoongArch: KVM: Add steal time support in kvm side

2024-05-24 Thread Bibo Mao
Steal time feature is added here in kvm side, VM can search supported features provided by KVM hypervisor, feature KVM_FEATURE_STEAL_TIME is added here. Like x86, steal time structure is saved in guest memory, one hypercall function KVM_HCALL_FUNC_NOTIFY is added to notify KVM to enable the

[PATCH v4 0/2] LoongArch: Add steal time support

2024-05-24 Thread Bibo Mao
Para-virt feature steal time is added in both kvm and guest kernel side. It is silimar with other architectures, steal time structure comes from guest memory, also pseduo register is used to save/restore base address of steal time structure, so that when vm is migrated, kvm module on target