Re: [PATCH for-next] tracing/kprobes: Add symbol counting check when module loads

2023-10-31 Thread Google
Hi, On Tue, 31 Oct 2023 23:24:43 +0200 Francis Laniel wrote: > > @@ -729,17 +744,55 @@ static int count_mod_symbols(void *data, const char > > *name, unsigned long unused) return 0; > > } > > > > -static unsigned int number_of_same_symbols(char *func_name) > > +static unsigned int

Re: [PATCH] eventfs: Process deletion of dentry more thoroughly

2023-10-31 Thread Al Viro
On Tue, Oct 31, 2023 at 02:47:03PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Looking at how dentry is removed via the tracefs system, I found that > eventfs does not do everything that it did under tracefs. The tracefs > removal of a dentry calls

[PATCH v5 0/7] eventfs: Fixing dynamic creation

2023-10-31 Thread Steven Rostedt
I found an issue with using a union between the rcu list head and the "is_freed" boolean (word). That is, rcu list is a single link list where the last element has a NULL pointer. That means, if the eventfs_inode is the last element (which it likely will be) it will not have its flag set to

[PATCH v5 5/7] eventfs: Hold eventfs_mutex when calling callback functions

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The callback function that is used to create inodes and dentries is not protected by anything and the data that is passed to it could become stale. After eventfs_remove_dir() is called by the tracing system, it is free to remove the events that are associated to

[PATCH v5 4/7] eventfs: Save ownership and mode

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Now that inodes and dentries are created on the fly, they are also reclaimed on memory pressure. Since the ownership and file mode are saved in the inode, if they are freed, any changes to the ownership and mode will be lost. To counter this, if the user changes

[PATCH v5 6/7] eventfs: Delete eventfs_inode when the last dentry is freed

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There exists a race between holding a reference of an eventfs_inode dentry and the freeing of the eventfs_inode. If user space has a dentry held long enough, it may still be able to access the dentry's eventfs_inode after it has been freed. To prevent this, have

[PATCH v5 7/7] eventfs: Remove special processing of dput() of events directory

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The top level events directory is no longer special with regards to how it should be delete. Remove the extra processing for it in eventfs_set_ei_status_free(). Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 19 ++- 1 file

[PATCH v5 3/7] eventfs: Test for ei->is_freed when accessing ei->dentry

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The eventfs_inode (ei) is protected by SRCU, but the ei->dentry is not. It is protected by the eventfs_mutex. Anytime the eventfs_mutex is released, and access to the ei->dentry needs to be done, it should first check if ei->is_freed is set under the

[PATCH v5 1/7] eventfs: Remove "is_freed" union with rcu head

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The eventfs_inode->is_freed was a union with the rcu_head with the assumption that when it was on the srcu list the head would contain a pointer which would make "is_freed" true. But that was a wrong assumption as the rcu head is a single link list where the last

[PATCH v5 2/7] eventfs: Have a free_ei() that just frees the eventfs_inode

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" As the eventfs_inode is freed in two different locations, make a helper function free_ei() to make sure all the allocated fields of the eventfs_inode is freed. This requires renaming the existing free_ei() which is called by the srcu handler to free_rcu_ei() and

[PATCH v4 2/3] eventfs: Test for ei->is_freed when accessing ei->dentry

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The eventfs_inode (ei) is protected by SRCU, but the ei->dentry is not. It is protected by the eventfs_mutex. Anytime the eventfs_mutex is released, and access to the ei->dentry needs to be done, it should first check if ei->is_freed is set under the

[PATCH v4 0/3] eventfs: Fixing dynamic creation

2023-10-31 Thread Steven Rostedt
This is really just putting together two eventfs patches that were stepping on each other in conflicts. I decided to rip out the free_ei() part into its own patch (as that was what was confliciting. This series is just a combination of:

[PATCH v4 3/3] eventfs: Save ownership and mode

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Now that inodes and dentries are created on the fly, they are also reclaimed on memory pressure. Since the ownership and file mode are saved in the inode, if they are freed, any changes to the ownership and mode will be lost. To counter this, if the user changes

[PATCH v4 1/3] eventfs: Have a free_ei() that just frees the eventfs_inode

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" As the eventfs_inode is freed in two different locations, make a helper function free_ei() to make sure all the allocated fields of the eventfs_inode is freed. This requires renaming the existing free_ei() which is called by the srcu handler to free_rcu_ei() and

Re: [PATCH for-next] tracing/kprobes: Add symbol counting check when module loads

2023-10-31 Thread Francis Laniel
Hi! Le dimanche 29 octobre 2023, 05:10:46 EET Masami Hiramatsu (Google) a écrit : > From: Masami Hiramatsu (Google) > > Check the number of probe target symbols in the target module when > the module is loaded. If the probe is not on the unique name symbols > in the module, it will be rejected

Re: [PATCH] eventfs: Process deletion of dentry more thoroughly

2023-10-31 Thread Steven Rostedt
On Wed, 1 Nov 2023 02:25:53 + Al Viro wrote: > On Tue, Oct 31, 2023 at 02:47:03PM -0400, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > > > Looking at how dentry is removed via the tracefs system, I found that > > eventfs does not do everything that it did under tracefs. The

[PATCH] eventfs: Process deletion of dentry more thoroughly

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Looking at how dentry is removed via the tracefs system, I found that eventfs does not do everything that it did under tracefs. The tracefs removal of a dentry calls simple_recursive_removal() that does a lot more than a simple d_invalidate(). Have the same done

[PATCH] tracing: Have the user copy of synthetic event address use correct context

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" A synthetic event is created by the synthetic event interface that can read both user or kernel address memory. In reality, it reads any arbitrary memory location from within the kernel. If the address space is in USER (where

Re: [PATCH v2 2/3] remoteproc: qcom: pas: make region assign more generic

2023-10-31 Thread Neil Armstrong
Hi, On 30/10/2023 14:10, Mukesh Ojha wrote: On 10/30/2023 3:33 PM, Neil Armstrong wrote: The current memory region assign only supports a single memory region. But new platforms introduces more regions to make the memory requirements more flexible for various use cases. Those new platforms

Re: [PATCH] tracing: Have trace_event_file have ref counters

2023-10-31 Thread Beau Belgrave
On Tue, Oct 31, 2023 at 12:24:53PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The following can crash the kernel: > > # cd /sys/kernel/tracing > # echo 'p:sched schedule' > kprobe_events > # exec 5>>events/kprobes/sched/enable > # > kprobe_events > # exec 5>&- > >

Re: [PATCH for-next] tracing/kprobes: Add symbol counting check when module loads

2023-10-31 Thread Andrii Nakryiko
On Sat, Oct 28, 2023 at 8:10 PM Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > Check the number of probe target symbols in the target module when > the module is loaded. If the probe is not on the unique name symbols > in the module, it will be rejected at that point. >

Re: [PATCH] tracing/kprobes: Fix the order of argument descriptions

2023-10-31 Thread Mukesh Ojha
On 10/31/2023 9:43 AM, Yujie Liu wrote: The order of descriptions should be consistent with the argument list of the function, so "kretprobe" should be the second one. int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, const char

Re: [PATCH 7/9] arm64: dts: qcom: sc7280: Add CDSP node

2023-10-31 Thread Mukesh Ojha
On 10/30/2023 8:33 PM, Doug Anderson wrote: Hi, On Mon, Oct 30, 2023 at 7:43 AM Luca Weiss wrote: On Mon Oct 30, 2023 at 3:11 PM CET, Doug Anderson wrote: Hi, On Mon, Oct 30, 2023 at 2:12 AM Luca Weiss wrote: On Mon Oct 30, 2023 at 10:04 AM CET, Mukesh Ojha wrote: On 10/27/2023

Re: [PATCH 7/9] arm64: dts: qcom: sc7280: Add CDSP node

2023-10-31 Thread Luca Weiss
On Tue Oct 31, 2023 at 7:44 AM CET, Mukesh Ojha wrote: > > > On 10/30/2023 8:33 PM, Doug Anderson wrote: > > Hi, > > > > On Mon, Oct 30, 2023 at 7:43 AM Luca Weiss wrote: > >> > >> On Mon Oct 30, 2023 at 3:11 PM CET, Doug Anderson wrote: > >>> Hi, > >>> > >>> On Mon, Oct 30, 2023 at 2:12 AM Luca

Re: [PATCH 9/9] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable WiFi

2023-10-31 Thread Luca Weiss
On Mon Oct 30, 2023 at 8:26 PM CET, Konrad Dybcio wrote: > On 27.10.2023 16:20, Luca Weiss wrote: > > Now that the WPSS remoteproc is enabled, enable wifi so we can use it. > > > > Signed-off-by: Luca Weiss > > --- > > arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 4 > > 1 file

Re: [PATCH 9/9] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable WiFi

2023-10-31 Thread Konrad Dybcio
On 31.10.2023 11:31, Luca Weiss wrote: > On Mon Oct 30, 2023 at 8:26 PM CET, Konrad Dybcio wrote: >> On 27.10.2023 16:20, Luca Weiss wrote: >>> Now that the WPSS remoteproc is enabled, enable wifi so we can use it. >>> >>> Signed-off-by: Luca Weiss >>> --- >>>

Re: [PATCH v7 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks

2023-10-31 Thread David Hildenbrand
On 31.10.23 03:14, Verma, Vishal L wrote: On Mon, 2023-10-30 at 11:20 +0100, David Hildenbrand wrote: On 26.10.23 00:44, Vishal Verma wrote: [..] @@ -2146,11 +2186,69 @@ void try_offline_node(int nid)   }   EXPORT_SYMBOL(try_offline_node); -static int __ref try_remove_memory(u64

Re: [PATCH 8/9] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable various remoteprocs

2023-10-31 Thread Luca Weiss
On Mon Oct 30, 2023 at 8:26 PM CET, Konrad Dybcio wrote: > On 27.10.2023 16:20, Luca Weiss wrote: > > Enable the ADSP, CDSP, MPSS and WPSS that are found on the SoC. > > > > Signed-off-by: Luca Weiss > > --- > > arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 20 > > >

Re: [PATCH v3 3/4] ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 10.1 LTE (SM-T535)

2023-10-31 Thread Konrad Dybcio
On 25.10.2023 10:37, Stefan Hansson wrote: > Add a device tree for the Samsung Galaxy Tab 4 10.1 (SM-T535) LTE tablet > based on the MSM8926 platform. > > Signed-off-by: Stefan Hansson > --- > arch/arm/boot/dts/qcom/Makefile | 1 + > .../qcom/qcom-msm8926-samsung-matisselte.dts

Re: [PATCH v3 4/4] ARM: dts: qcom: samsung-matisse-common: Add UART

2023-10-31 Thread Konrad Dybcio
On 25.10.2023 10:37, Stefan Hansson wrote: > This was not enabled in the matisse-wifi tree. Without this, it is not > possible to use the USB port for serial debugging via a "Carkit debug > cable". > > Signed-off-by: Stefan Hansson > --- Reviewed-by: Konrad Dybcio Konrad

[PATCH v3] eventfs: Save ownership and mode

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Now that inodes and dentries are created on the fly, they are also reclaimed on memory pressure. Since the ownership and file mode are saved in the inode, if they are freed, any changes to the ownership and mode will be lost. To counter this, if the user changes

[PATCH] eventfs: Remove extra dget() in eventfs_create_events_dir()

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The creation of the top events directory does a dget() at the end of the creation in eventfs_create_events_dir() with a comment saying the final dput() will happen when it is removed. The problem is that a dget() is already done on the dentry when it was created

[PATCH] tracing: Have trace_event_file have ref counters

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The following can crash the kernel: # cd /sys/kernel/tracing # echo 'p:sched schedule' > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&- The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe

Re: [PATCH v3 3/4] ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 10.1 LTE (SM-T535)

2023-10-31 Thread Stefan Hansson
On 2023-10-31 12:08, Konrad Dybcio wrote: On 25.10.2023 10:37, Stefan Hansson wrote: Add a device tree for the Samsung Galaxy Tab 4 10.1 (SM-T535) LTE tablet based on the MSM8926 platform. Signed-off-by: Stefan Hansson --- arch/arm/boot/dts/qcom/Makefile | 1 +

[PATCH v5 1/4] ARM: dts: qcom: samsung-matisse-common: Add initial common device tree

2023-10-31 Thread Stefan Hansson
According to the dts from the kernel source code released by Samsung, matissewifi and matisselte only have minor differences in hardware, so use a shared dtsi to reduce duplicated code. Additionally, this should make adding support for matisse3g easier should someone want to do that at a later

[PATCH v5 3/4] ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 10.1 LTE (SM-T535)

2023-10-31 Thread Stefan Hansson
Add a device tree for the Samsung Galaxy Tab 4 10.1 (SM-T535) LTE tablet based on the MSM8926 platform. The common dtsi is also modified to describe the widest constraints, which required modifications to the matisse-wifi dts. Signed-off-by: Stefan Hansson Reviewed-by: Krzysztof Kozlowski ---

[PATCH v5 2/4] dt-bindings: arm: qcom: Add Samsung Galaxy Tab 4 10.1 LTE

2023-10-31 Thread Stefan Hansson
This documents Samsung Galaxy Tab 4 10.1 LTE (samsung,matisselte) which is a tablet by Samsung based on the MSM8926 SoC. Signed-off-by: Stefan Hansson Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v5 4/4] ARM: dts: qcom: samsung-matisse-common: Add UART

2023-10-31 Thread Stefan Hansson
This was not enabled in the matisse-wifi tree. Without this, it is not possible to use the USB port for serial debugging via a "Carkit debug cable". Signed-off-by: Stefan Hansson Reviewed-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio ---

[PATCH v5 0/4] Add samsung-matisselte and common matisse dtsi

2023-10-31 Thread Stefan Hansson
This series adds a common samsung-matisse dtsi and reworks samsung-matisse-wifi to use it, and introduces samsung-matisselte. I choose matisselte over matisse-lte as this is how most other devices (klte, s3ve3g) do it and it is the codename that Samsung gave the device. See individual commits for

[PATCH v3] eventfs: Test for ei->is_freed when accessing ei->dentry

2023-10-31 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The eventfs_inode (ei) is protected by SRCU, but the ei->dentry is not. It is protected by the eventfs_mutex. Anytime the eventfs_mutex is released, and access to the ei->dentry needs to be done, it should first check if ei->is_freed is set under the