Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-18 Thread Eugenio Perez Martin
On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea wrote: > > On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > > On Mon, Dec 18, 2023 at 11:52 AM Dragos Tatulea wrote: > > > > > > On Mon, 2023-12-18 at 11:16 +0100, Eugenio Perez Martin wrote: > > > > On Sat, Dec 16, 2023 at 12:03 PM

[PATCH] virtio_pmem: support feature SHMEM_REGION

2023-12-18 Thread Changyuan Lyu
As per virtio spec 1.2 section 5.19.5.2, if the feature VIRTIO_PMEM_F_SHMEM_REGION has been negotiated, the driver MUST query shared memory ID 0 for the physical address ranges. Signed-off-by: Changyuan Lyu --- drivers/nvdimm/virtio_pmem.c | 29 +

Re: [PATCH V3] remoteproc: qcom: q6v5: Get crash reason from specific SMEM partition

2023-12-18 Thread Vignesh Viswanathan
On 12/18/2023 9:26 PM, Mukesh Ojha wrote: > > > On 12/18/2023 11:40 AM, Vignesh Viswanathan wrote: >> q6v5 fatal and watchdog IRQ handlers always retrieves the crash reason >> information from SMEM global partition (QCOM_SMEM_HOST_ANY). >> >> For some targets like IPQ9574 and IPQ5332, crash

[PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" To synchronize the timestamps with the ring buffer reservation, there are two timestamps that are saved in the buffer meta data. 1. before_stamp 2. write_stamp When the two are equal, the write_stamp is considered valid, as in, it may be used to calculate the

[PATCH] ring-buffer: Check if absolute timestamp goes backwards

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The check_buffer() which checks the timestamps of the ring buffer sub-buffer page, when enabled, only checks if the adding of deltas of the events from the last absolute timestamp or the timestamp of the sub-buffer page adds up to the current event. What it does

Re: [PATCH v6 0/3] Add UFS host controller and Phy nodes for sc7280

2023-12-18 Thread Martin K. Petersen
On Tue, 05 Dec 2023 15:38:53 +0100, Luca Weiss wrote: > This patch adds UFS host controller and Phy nodes for Qualcomm sc7280 > SoC and enable it on some sc7280-based boards. > > Pick up the patchset from Nitin since the last revision (v4) has been > sent end of September and is blocking

Re: [PATCH v2] ring-buffer: Add interrupt information to dump of data sub-buffer

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 17:01:06 -0500 Steven Rostedt wrote: > @@ -3347,7 +3418,8 @@ static void check_buffer(struct ring_buffer_per_cpu > *cpu_buffer, > } > } > if ((full && ts > info->ts) || > - (!full && ts + info->delta != info->ts)) { > + (!full && ts

Re: [PATCH 1/2] ring-buffer: Replace rb_time_cmpxchg() with rb_time_cmp_and_update()

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 13:42:40 -0500 Steven Rostedt wrote: > > > > > > > static bool rb_time_cmp_and_update(rb_time_t *t, u64 expect, u64 set) > > > > { > > > > - return rb_time_cmpxchg(t, expect, set); > > > > +#ifdef RB_TIME_32 > > > > + return expect == READ_ONCE(t->time);

[PATCH v2] ring-buffer: Add interrupt information to dump of data sub-buffer

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When the ring buffer timestamp verifier triggers, it dumps the content of the sub-buffer. But currently it only dumps the timestamps and the offset of the data as well as the deltas. It would be even more informative if the event data also showed the interrupt

[PATCH] ring-buffer: Add interrupt information to dump of data sub-buffer

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When the ring buffer timestamp verifier triggers, it dumps the content of the sub-buffer. But currently it only dumps the timestamps and the offset of the data as well as the deltas. It would be even more informative if the event data also showed the interrupt

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-18 Thread Haitao Huang
On Sun, 17 Dec 2023 19:44:56 -0600, Huang, Kai wrote: > > The point is, with or w/o this patch, you can only reclaim 16 EPC pages > in one > function call (as you have said you are going to remove > SGX_NR_TO_SCAN_MAX, > which is a cipher to both of us). The only difference I can see is,

[RFD] kprobe: Use cases on further optimizations

2023-12-18 Thread Jinghao Jia
Hi, We are looking into a way of implementing a fast-kprobe that allows users to instrument an instruction in function bodies without a trap even when that address cannot be jump optimized with existing techniques. We were initially interested in these optimizations for our KCFI project [1], but

Re: [PATCH net-next v2 3/3] net: add netmem_t to skb_frag_t

2023-12-18 Thread Mina Almasry
On Mon, Dec 18, 2023 at 4:39 AM Yunsheng Lin wrote: > > On 2023/12/17 16:09, Mina Almasry wrote: > > Use netmem_t instead of page directly in skb_frag_t. Currently netmem_t > > is always a struct page underneath, but the abstraction allows efforts > > to add support for skb frags not backed by

[PATCH v2 0/2] tracing: Replace final 64-bit cmpxchg with compare and update if available

2023-12-18 Thread Steven Rostedt
With the introduction of a389d86f7fd09 ("ring-buffer: Have nested events still record running time stamp"), the timestamps required needing 64-bit cmpxchg. As some architectures do no even have a 64-bit cmpxchg, the code for 32-bit architectures used 3 32-bit words that represented the 64-bit

[PATCH v2 1/2] ring-buffer: Replace rb_time_cmpxchg() with rb_time_cmp_and_update()

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There's only one place that performs a 64-bit cmpxchg for the timestamp processing. The cmpxchg is only to set the write_stamp equal to the before_stamp, and if it doesn't get set, then the next event will simply be forced to add an absolute timestamp. Given that

[PATCH v2 2/2] ring-buffer: Remove 32bit timestamp logic

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Each event has a 27 bit timestamp delta that is used to hold the delta from the last event. If the time between events is greater than 2^27, then a timestamp is added that holds a 59 bit absolute timestamp. Until a389d86f7fd09 ("ring-buffer: Have nested events

Re: [PATCH 1/2] ring-buffer: Replace rb_time_cmpxchg() with rb_time_cmp_and_update()

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 10:15:31 -0500 Steven Rostedt wrote: > Basically I broke it into: > > 1. Remove workaround exposure from the main logic. (this patch) > 2. Remove the workaround. (next patch). > > > > > Isn't this part actual change? > > This part is abstracted out from the main logic.

Re: [PATCH] rpmsg: virtio: free driver_override when rpmsg_remove()

2023-12-18 Thread Mathieu Poirier
On Fri, Dec 15, 2023 at 10:00:49AM +0800, Xiaolei Wang wrote: > free driver_override when rpmsg_remove(), otherwise > the following memory leak will occur: > > unreferenced object 0xd55d7080 (size 128): > comm "kworker/u8:2", pid 56, jiffies 4294893188 (age 214.272s) > hex dump (first

Re: [PATCH v5 4/4] vduse: Add LSM hook to check Virtio device type

2023-12-18 Thread Stephen Smalley
On Mon, Dec 18, 2023 at 12:21 PM Stephen Smalley wrote: > > On Tue, Dec 12, 2023 at 8:17 AM Maxime Coquelin > wrote: > > > > This patch introduces a LSM hook for devices creation, > > destruction (ioctl()) and opening (open()) operations, > > checking the application is allowed to perform these

Re: [PATCH v2] virtio_balloon: stay awake while adjusting balloon

2023-12-18 Thread David Hildenbrand
On 18.12.23 16:18, David Stevens wrote: From: David Stevens A virtio_balloon's parent device may be configured so that a configuration change interrupt is a wakeup event. Extend the processing of such a wakeup event until the balloon finishes inflating or deflating by calling

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-18 Thread Mikko Ylinen
On Mon, Dec 18, 2023 at 01:44:56AM +, Huang, Kai wrote: > > Let's focus on enabling functionality first. When you have some real > performance issue that is related to this, we can come back then. > > Btw, I think you need to step back even further. IIUC the whole multiple LRU > thing

Re: [PATCH v5 4/4] vduse: Add LSM hook to check Virtio device type

2023-12-18 Thread Stephen Smalley
On Tue, Dec 12, 2023 at 8:17 AM Maxime Coquelin wrote: > > This patch introduces a LSM hook for devices creation, > destruction (ioctl()) and opening (open()) operations, > checking the application is allowed to perform these > operations for the Virtio device type. Can you explain why the

Re: [PATCH v7 0/2] ring-buffer: Rename sub-buffer into buffer page

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 11:28:17 -0500 Steven Rostedt wrote: > > Remove all references to sub-buffer and replace them with either bpage > > or ring_buffer_page. The user interface should not be changed. But what I would like to have changed (and this will come after all other changes are

Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2023-12-18 Thread Willem de Bruijn
Steffen Trumtrar wrote: > This series tries to pick up the work on the virtio-net timestamping > feature from Willem de Bruijn. > > Original series > Message-Id: 20210208185558.995292-1-willemdebruijn.ker...@gmail.com > Subject: [PATCH RFC v2 0/4] virtio-net: add tx-hash, rx-tstamp, >

Re: [PATCH v7 0/2] ring-buffer: Rename sub-buffer into buffer page

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 15:46:18 + Vincent Donnefort wrote: > Previously was introduced the ability to change the ring-buffer page > size. It also introduced the concept of sub-buffer that is, a contiguous > virtual memory space which can now be bigger than the system page size > (4K on most

Re: [PATCH V3] remoteproc: qcom: q6v5: Get crash reason from specific SMEM partition

2023-12-18 Thread Mukesh Ojha
On 12/18/2023 11:40 AM, Vignesh Viswanathan wrote: q6v5 fatal and watchdog IRQ handlers always retrieves the crash reason information from SMEM global partition (QCOM_SMEM_HOST_ANY). For some targets like IPQ9574 and IPQ5332, crash reason information is present in target specific partition

[PATCH v7 0/2] ring-buffer: Rename sub-buffer into buffer page

2023-12-18 Thread Vincent Donnefort
Previously was introduced the ability to change the ring-buffer page size. It also introduced the concept of sub-buffer that is, a contiguous virtual memory space which can now be bigger than the system page size (4K on most systems). But behind the scene this is really just a page with an order >

[PATCH v3] tracing: Add filter-direct option

2023-12-18 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Normally, when the filter is enabled, a temporary buffer is created to copy the event data into it to perform the filtering logic. If the filter passes and the event should be recorded, then the event is copied from the temporary buffer into the ring buffer. If

Re: [PATCH] virtio_balloon: stay awake while adjusting balloon

2023-12-18 Thread David Stevens
On Mon, Dec 18, 2023 at 10:18 AM David Hildenbrand wrote: > > On 18.12.23 16:16, David Stevens wrote: > > On Mon, Dec 18, 2023 at 6:37 AM David Hildenbrand wrote: > >> > >> On 14.12.23 05:13, David Stevens wrote: > >>> On Wed, Dec 13, 2023 at 5:44 PM David Hildenbrand > >>> wrote: > >

[PATCH v2] virtio_balloon: stay awake while adjusting balloon

2023-12-18 Thread David Stevens
From: David Stevens A virtio_balloon's parent device may be configured so that a configuration change interrupt is a wakeup event. Extend the processing of such a wakeup event until the balloon finishes inflating or deflating by calling pm_stay_awake/pm_relax in the virtio_balloon driver. Note

Re: [RFC PATCH 3/5] dt-bindings: input: add entry for 88pm88x-onkey

2023-12-18 Thread Rob Herring
On Sun, Dec 17, 2023 at 02:17:01PM +0100, Karel Balej wrote: > From: Karel Balej > > Marvell 88PM88X PMICs provide onkey functionality. Document it. > > Signed-off-by: Karel Balej > --- > .../bindings/input/marvell,88pm88x-onkey.yaml | 30 +++ >

Re: [PATCH] virtio_balloon: stay awake while adjusting balloon

2023-12-18 Thread David Hildenbrand
On 18.12.23 16:16, David Stevens wrote: On Mon, Dec 18, 2023 at 6:37 AM David Hildenbrand wrote: On 14.12.23 05:13, David Stevens wrote: On Wed, Dec 13, 2023 at 5:44 PM David Hildenbrand wrote: On 11.12.23 12:43, David Stevens wrote: From: David Stevens Hi David, Add a wakeup event

Re: [RFC PATCH 1/5] dt-bindings: mfd: add entry for the Marvell 88PM88X PMICs

2023-12-18 Thread Rob Herring
On Sun, Dec 17, 2023 at 02:16:59PM +0100, Karel Balej wrote: > From: Karel Balej > > Marvell 88PM880 and 88PM886 are two similar PMICs with mostly matching > register mapping and subdevices such as onkey, regulators or battery and > charger. Both seem to come in two revisions which seem to be

Re: [PATCH] virtio_balloon: stay awake while adjusting balloon

2023-12-18 Thread David Stevens
On Mon, Dec 18, 2023 at 6:37 AM David Hildenbrand wrote: > > On 14.12.23 05:13, David Stevens wrote: > > On Wed, Dec 13, 2023 at 5:44 PM David Hildenbrand wrote: > >> > >> On 11.12.23 12:43, David Stevens wrote: > >>> From: David Stevens > >>> > >> > >> Hi David, > >> > >>> Add a wakeup event

[PATCH v7 2/2] tracing: Allow user-space mapping of the ring-buffer

2023-12-18 Thread Vincent Donnefort
Currently, user-space extracts data from the ring-buffer via splice, which is handy for storage or network sharing. However, due to splice limitations, it is imposible to do real-time analysis without a copy. A solution for that problem is to let the user-space map the ring-buffer directly. The

[PATCH v7 1/2] ring-buffer: Introducing ring-buffer mapping functions

2023-12-18 Thread Vincent Donnefort
In preparation for allowing the user-space to map a ring-buffer, add a set of mapping functions: ring_buffer_{map,unmap}() ring_buffer_map_fault() And controls on the ring-buffer: ring_buffer_map_get_reader() /* swap reader and head */ Mapping the ring-buffer also involves: A unique

[PATCH v7 0/2] Introducing trace buffer mapping by user-space

2023-12-18 Thread Vincent Donnefort
The tracing ring-buffers can be stored on disk or sent to network without any copy via splice. However the later doesn't allow real time processing of the traces. A solution is to give userspace direct access to the ring-buffer pages via a mapping. An application can now become a consumer of the

Re: [PATCH 1/2] ring-buffer: Replace rb_time_cmpxchg() with rb_time_cmp_and_update()

2023-12-18 Thread Steven Rostedt
On Mon, 18 Dec 2023 23:24:55 +0900 Masami Hiramatsu (Google) wrote: > On Fri, 15 Dec 2023 11:55:13 -0500 > Steven Rostedt wrote: > > > From: "Steven Rostedt (Google)" > > > > There's only one place that performs a 64-bit cmpxchg for the timestamp > > processing. The cmpxchg is only to set

Re: [PATCH 1/2] ring-buffer: Replace rb_time_cmpxchg() with rb_time_cmp_and_update()

2023-12-18 Thread Google
On Fri, 15 Dec 2023 11:55:13 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > There's only one place that performs a 64-bit cmpxchg for the timestamp > processing. The cmpxchg is only to set the write_stamp equal to the > before_stamp, and if it doesn't get set, then the next

Re: [PATCH v6 2/2] kbuild: rpm-pkg: Fix build with non-default MODLIB

2023-12-18 Thread Masahiro Yamada
On Tue, Dec 12, 2023 at 10:12 PM Michal Suchánek wrote: > > On Mon, Dec 11, 2023 at 01:33:23PM +0900, Masahiro Yamada wrote: > > On Mon, Dec 11, 2023 at 6:09 AM Michal Suchánek wrote: > > > > > > On Mon, Dec 11, 2023 at 03:44:35AM +0900, Masahiro Yamada wrote: > > > > On Thu, Dec 7, 2023 at 4:48 

Re: [PATCH v6 1/2] depmod: Handle installing modules under a different directory

2023-12-18 Thread Masahiro Yamada
On Tue, Dec 12, 2023 at 10:03 PM Michal Suchánek wrote: > > On Mon, Dec 11, 2023 at 01:29:15PM +0900, Masahiro Yamada wrote: > > On Mon, Dec 11, 2023 at 6:07 AM Michal Suchánek wrote: > > > > > > Hello! > > > > > > On Mon, Dec 11, 2023 at 03:43:44AM +0900, Masahiro Yamada wrote: > > > > On Thu,

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-18 Thread Dragos Tatulea
On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > On Mon, Dec 18, 2023 at 11:52 AM Dragos Tatulea wrote: > > > > On Mon, 2023-12-18 at 11:16 +0100, Eugenio Perez Martin wrote: > > > On Sat, Dec 16, 2023 at 12:03 PM Dragos Tatulea > > > wrote: > > > > > > > > On Fri, 2023-12-15

Re: [PATCH v2] MAINTAINERS: Remove Ohad Ben-Cohen from hwspinlock subsystem

2023-12-18 Thread Ohad Ben Cohen
On Mon, Dec 18, 2023 at 3:29 PM Bagas Sanjaya wrote: > Commit 62c46d55688894 ("MAINTAINERS: Removing Ohad from remoteproc/rpmsg > maintenance") removes his MAINTAINERS entry in regards to remoteproc > subsystem due to his inactivity (the last commit with his Signed-off-by > is 99c429cb4e628e

[PATCH v2] MAINTAINERS: Remove Ohad Ben-Cohen from hwspinlock subsystem

2023-12-18 Thread Bagas Sanjaya
Commit 62c46d55688894 ("MAINTAINERS: Removing Ohad from remoteproc/rpmsg maintenance") removes his MAINTAINERS entry in regards to remoteproc subsystem due to his inactivity (the last commit with his Signed-off-by is 99c429cb4e628e ("remoteproc/wkup_m3: Use MODULE_DEVICE_TABLE to export alias")

[PATCH v5 34/34] Documentation: probes: Update fprobe on function-graph tracer

2023-12-18 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. ---

[PATCH v5 33/34] selftests/ftrace: Add a test case for repeating register/unregister fprobe

2023-12-18 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 v5 32/34] selftests: ftrace: Remove obsolate maxactive syntax check

2023-12-18 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

[PATCH v5 31/34] bpf: Enable kprobe_multi feature if CONFIG_FPROBE is enabled

2023-12-18 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).

[PATCH v5 30/34] tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS

2023-12-18 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_PT_REGS_COMPAT_FTRACE_REGS, fprobe events will not be able to be used from

[PATCH v5 29/34] tracing/fprobe: Remove nr_maxactive from fprobe

2023-12-18 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 | 44

[PATCH v5 28/34] fprobe: Rewrite fprobe on function-graph tracer

2023-12-18 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

[PATCH v5 27/34] tracing: Add ftrace_fill_perf_regs() for perf event

2023-12-18 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

[PATCH v5 26/34] tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs. If the architecture defines its own ftrace_regs, this copies partial registers to pt_regs and returns it. If not, ftrace_regs is the same as pt_regs and ftrace_partial_regs() will return

[PATCH v5 25/34] fprobe: Use ftrace_regs in fprobe exit handler

2023-12-18 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_PT_REGS_TO_FTRACE_REGS_CAST which means the ftrace_regs's memory layout is equal to the pt_regs so that those are able to cast. Fprobe introduces a new

[PATCH v5 24/34] fprobe: Use ftrace_regs in fprobe entry handler

2023-12-18 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 from previous series:

[PATCH v5 23/34] arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Enable CONFIG_HAVE_FUNCTION_GRAPH_FREGS on arm64. Note that this depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS which is enabled if the compiler supports "-fpatchable-function-entry=2". If not, it continue to use ftrace_ret_regs. Signed-off-by: Masami Hiramatsu

[PATCH v5 22/34] tracing: Rename ftrace_regs_return_value to ftrace_regs_get_return_value

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Rename ftrace_regs_return_value to ftrace_regs_get_return_value as same as other ftrace_regs_get/set_* APIs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Newly added. --- arch/loongarch/include/asm/ftrace.h |2 +-

[PATCH v5 21/34] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs on the stack in ftrace_graph return trampoline so that the callbacks can access registers via ftrace_regs APIs. Note that this only recovers 'rax' and 'rdx' registers because other registers are

[PATCH v5 20/34] function_graph: Add a new exit handler with parent_ip and ftrace_regs

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a new return handler to fgraph_ops as 'retregfunc' which takes parent_ip and ftrace_regs instead of ftrace_graph_ret. This handler is available only if the arch support CONFIG_HAVE_FUNCTION_GRAPH_FREGS. Note that the 'retfunc' and 'reregfunc' are mutual

[PATCH v5 19/34] function_graph: Add a new entry handler with parent_ip and ftrace_regs

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a new entry handler to fgraph_ops as 'entryregfunc' which takes parent_ip and ftrace_regs. Note that the 'entryfunc' and 'entryregfunc' are mutual exclusive. You can set only one of them. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: -

[PATCH v5 18/34] function_graph: Add selftest for passing local variables

2023-12-18 Thread Masami Hiramatsu (Google)
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. Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Add reserved size test. -

[PATCH v5 17/34] function_graph: Implement fgraph_reserve_data() and fgraph_retrieve_data()

2023-12-18 Thread Masami Hiramatsu (Google)
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 task's

[PATCH v5 16/34] function_graph: Move graph notrace bit to shadow stack global var

2023-12-18 Thread Masami Hiramatsu (Google)
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. Signed-off-by: Steven Rostedt

[PATCH v5 15/34] function_graph: Move graph depth stored data to shadow stack global var

2023-12-18 Thread Masami Hiramatsu (Google)
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. Signed-off-by: Steven Rostedt (VMware)

[PATCH v5 14/34] function_graph: Move set_graph_function tests to shadow stack global var

2023-12-18 Thread Masami Hiramatsu (Google)
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. Signed-off-by: Steven Rostedt (VMware)

[PATCH v5 13/34] function_graph: Add "task variables" per task for fgraph_ops

2023-12-18 Thread Masami Hiramatsu (Google)
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 per

[PATCH v5 12/34] function_graph: Use a simple LRU for fgraph_array index number

2023-12-18 Thread Masami Hiramatsu (Google)
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 newer

[PATCH v5 11/34] function_graph: Have the instances use their own ftrace_ops for filtering

2023-12-18 Thread Masami Hiramatsu (Google)
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. This also change how the function_graph handles multiple instances on the

[PATCH v5 10/34] ftrace: Allow ftrace startup flags exist without dynamic ftrace

2023-12-18 Thread Masami Hiramatsu (Google)
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 v5 09/34] ftrace: Allow function_graph tracer to be enabled in instances

2023-12-18 Thread Masami Hiramatsu (Google)
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 v5 08/34] ftrace/function_graph: Pass fgraph_ops to function graph callbacks

2023-12-18 Thread Masami Hiramatsu (Google)
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 registered

[PATCH v5 07/34] function_graph: Remove logic around ftrace_graph_entry and return

2023-12-18 Thread Masami Hiramatsu (Google)
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 the

[PATCH v5 06/34] function_graph: Allow multiple users to attach to function graph

2023-12-18 Thread Masami Hiramatsu (Google)
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 of

[PATCH v5 05/34] function_graph: Add an array structure that will allow multiple callbacks

2023-12-18 Thread Masami Hiramatsu (Google)
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 the

[PATCH v5 04/34] fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by long

2023-12-18 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Instead of using "ALIGN()", use BUILD_BUG_ON() as the structures should always be divisible by sizeof(long). Link: http://lkml.kernel.org/r/2019052444.gi2...@hirez.programming.kicks-ass.net Suggested-by: Peter Zijlstra Signed-off-by: Steven Rostedt (VMware)

[PATCH v5 03/34] function_graph: Convert ret_stack to a series of longs

2023-12-18 Thread Masami Hiramatsu (Google)
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 v5 02/34] x86: tracing: Add ftrace_regs definition in the header

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_regs definition for x86_64 in the ftrace header to clarify what register will be accessible from ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Add rip to be saved. Changes in v2: - Newly added. ---

[PATCH v5 01/34] tracing: Add a comment about ftrace_regs definition

2023-12-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) To clarify what will be expected on ftrace_regs, add a comment to the architecture independent definition of the ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Add instruction pointer Changes in v2: - newly added. ---

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

2023-12-18 Thread Masami Hiramatsu (Google)
Hi, Here is the 5th version of the series to re-implement the fprobe on function-graph tracer. The previous version is; https://lore.kernel.org/all/170203105427.579004.8033550792660734570.stgit@devnote2/ This version fixes a bug of simple LRU [12/34] which caused some bug reports and add a

[PATCH AUTOSEL 4.14 6/6] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 4.14 5/6] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 4.14 4/6] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 4.19 6/6] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 4.19 5/6] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 4.19 4/6] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 5.4 7/7] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 5.4 6/7] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 5.4 5/7] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 5.10 8/8] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 5.10 7/8] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 5.10 6/8] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 5.15 13/13] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 5.15 12/13] tracing: Fix uaf issue when open the hist or hist_debug file

2023-12-18 Thread Sasha Levin
From: Zheng Yejian [ Upstream commit 1cc111b9cddc71ce161cd388f11f0e9048edffdb ] KASAN report following issue. The root cause is when opening 'hist' file of an instance and accessing 'trace_event_file' in hist_show(), but 'trace_event_file' has been freed due to the instance being removed.

[PATCH AUTOSEL 5.15 09/13] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 5.15 08/13] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 6.1 15/15] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

[PATCH AUTOSEL 6.1 14/15] tracing: Fix uaf issue when open the hist or hist_debug file

2023-12-18 Thread Sasha Levin
From: Zheng Yejian [ Upstream commit 1cc111b9cddc71ce161cd388f11f0e9048edffdb ] KASAN report following issue. The root cause is when opening 'hist' file of an instance and accessing 'trace_event_file' in hist_show(), but 'trace_event_file' has been freed due to the instance being removed.

[PATCH AUTOSEL 6.1 11/15] tracing: Add size check when printing trace_marker output

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 ] If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte.

[PATCH AUTOSEL 6.1 10/15] tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 ] If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # #

[PATCH AUTOSEL 6.6 18/18] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-18 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit 712292308af2265cd9b126aedfa987f10f452a33 ] As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link:

  1   2   >