[PATCH RFC 0/3] Revert "virtio_net: rx enable premapped mode by default"

2024-08-13 Thread Michael S. Tsirkin
Note: Xuan Zhuo, if you have a better idea, pls post an alternative patch. Note2: untested, posting for Darren to help with testing. Turns out unconditionally enabling premapped virtio-net leads to a regression on VM with no ACCESS_PLATFORM, and with sysctl net.core.high_order_alloc_disable=1 w

Re: [PATCH v3 0/2] virtiofs: fix the warning for kernel direct IO

2024-08-13 Thread Jingbo Xu
Hi, Tao, On 4/26/24 10:39 PM, Hou Tao wrote: > From: Hou Tao > > Hi, > > The patch set aims to fix the warning related to an abnormal size > parameter of kmalloc() in virtiofs. Patch #1 fixes it by introducing > use_pages_for_kvec_io option in fuse_conn and enabling it in virtiofs. > Beside the

Re: [RFC PATCH] vhost_vdpa: assign irq bypass producer token correctly

2024-08-13 Thread Jason Wang
On Tue, Aug 13, 2024 at 8:53 PM Dragos Tatulea wrote: > > > > On 13.08.24 08:26, Jason Wang wrote: > > On Mon, Aug 12, 2024 at 7:22 PM Dragos Tatulea wrote: > >> > >> > >> > >> On 12.08.24 08:49, Jason Wang wrote: > >>> On Mon, Aug 12, 2024 at 1:47 PM Jason Wang wrote: > > On Fri, Aug

[PATCH net-next v7 4/4] virtio-net: synchronize probe with ndo_set_features

2024-08-13 Thread Jason Wang
We calculate guest offloads during probe without the protection of rtnl_lock. This lead to race between probe and ndo_set_features. Fix this by moving the calculation under the rtnl_lock. Fixes: 3f93522ffab2 ("virtio-net: switch off offloads on demand if possible on XDP set") Acked-by: Michael S.

[PATCH net-next v7 3/4] virtio-net: synchronize operstate with admin state on up/down

2024-08-13 Thread Jason Wang
This patch synchronizes operstate with admin state per RFC2863. This is done by trying to toggle the carrier upon open/close and synchronize with the config change work. This allows to propagate status correctly to stacked devices like: ip link add link enp0s3 macvlan0 type macvlan ip link set li

[PATCH net-next v7 2/4] virtio: allow driver to disable the configure change notification

2024-08-13 Thread Jason Wang
Sometime, it would be useful to disable the configure change notification from the driver. So this patch allows this by introducing a variable config_change_driver_disabled and only allow the configure change notification callback to be triggered when it is allowed by both the virtio core and the d

[PATCH net-next v7 1/4] virtio: rename virtio_config_enabled to virtio_config_core_enabled

2024-08-13 Thread Jason Wang
Following patch will allow the config interrupt to be disabled by a specific driver via another boolean. So this patch renames virtio_config_enabled and relevant helpers to virtio_config_core_enabled. Cc: Venkat Venkatsubra Cc: Gia-Khanh Nguyen Acked-by: Michael S. Tsirkin Signed-off-by: Jason

[PATCH net-next v7 0/4] virtio-net: synchronize op/admin state

2024-08-13 Thread Jason Wang
Hi All: This series tries to synchronize the operstate with the admin state which allows the lower virtio-net to propagate the link status to the upper devices like macvlan. This is done by toggling carrier during ndo_open/stop while doing other necessary serialization about the carrier settings

Re: [PATCH] uprobes: Optimize the allocation of insn_slot for performance

2024-08-13 Thread Liao, Chang
在 2024/8/13 1:57, Andrii Nakryiko 写道: > On Mon, Aug 12, 2024 at 5:05 AM Liao, Chang wrote: >> >> >> >> 在 2024/8/10 2:40, Andrii Nakryiko 写道: >>> On Fri, Aug 9, 2024 at 11:34 AM Andrii Nakryiko >>> wrote: On Fri, Aug 9, 2024 at 12:16 AM Liao, Chang wrote: > > > > 在 20

Re: [PATCH] uprobes: Optimize the allocation of insn_slot for performance

2024-08-13 Thread Liao, Chang
在 2024/8/13 1:49, Andrii Nakryiko 写道: > On Mon, Aug 12, 2024 at 4:11 AM Liao, Chang wrote: >> >> >> >> 在 2024/8/9 2:26, Andrii Nakryiko 写道: >>> On Thu, Aug 8, 2024 at 1:45 AM Liao, Chang wrote: Hi Andrii and Oleg. This patch sent by me two weeks ago also aim to optimize the

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-13 Thread zhang warden
> The search would need more code. But it would be simple and > straightforward. We do this many times all over the code. > > IMHO, it would actually remove some complexity and be a win-win solution. > > Best Regards, > Petr Hi Petr! Thank you for taking the time to review my patch. I will u

[PATCH AUTOSEL 6.10 09/13] virtio-net: check feature before configuring the vq coalescing command

2024-08-13 Thread Sasha Levin
From: Heng Qi [ Upstream commit b50f2af9fbc5c00103ca8b72752b15310bd77762 ] Virtio spec says: The driver MUST have negotiated the VIRTIO_NET_F_VQ_NOTF_COAL feature when issuing commands VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET and VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET. So we add the

Re: [PATCH v2 2/3] tracing/fprobe: Support raw tracepoint events on modules

2024-08-13 Thread Google
Hi, Sorry I missed this thread. Thanks for your comments. On Tue, 4 Jun 2024 14:03:05 -0400 Mathieu Desnoyers wrote: > On 2024-06-04 12:34, Steven Rostedt wrote: > > On Tue, 4 Jun 2024 11:02:16 -0400 > > Mathieu Desnoyers wrote: > > > >> I see. > >> > >> It looks like there are a few things w

Re: [PATCH v3 0/2] Fix kallsyms with CONFIG_LTO_CLANG

2024-08-13 Thread Sami Tolvanen
Hi, On Tue, Aug 13, 2024 at 2:20 PM Song Liu wrote: > > Hi Masami, > > Thanks for your review and test! > > @Sami, could you please also review the set? As the kernel no longer uses the Clang feature combination that was the primary motivation for adding these kallsyms changes in the first place

Re: [PATCH v3 0/2] Fix kallsyms with CONFIG_LTO_CLANG

2024-08-13 Thread Song Liu
Hi Masami, Thanks for your review and test! @Sami, could you please also review the set? @Luis, I replied to 1/2 and 2/2 with Fixes tags that I think make most sense. Please let me know if we need changes to the set or more reviews and tests. Thanks, Song > On Aug 12, 2024, at 9:29 PM, Masa

Re: [PATCH v3 2/2] kallsyms: Match symbols exactly with CONFIG_LTO_CLANG

2024-08-13 Thread Song Liu
> On Aug 7, 2024, at 3:05 PM, Song Liu wrote: > > With CONFIG_LTO_CLANG=y, the compiler may add .llvm. suffix to > function names to avoid duplication. APIs like kallsyms_lookup_name() > and kallsyms_on_each_match_symbol() tries to match these symbol names > without the .llvm. suffix, e.g., mat

Re: [PATCH v3 1/2] kallsyms: Do not cleanup .llvm. suffix before sorting symbols

2024-08-13 Thread Song Liu
> On Aug 7, 2024, at 3:05 PM, Song Liu wrote: > > Cleaning up the symbols causes various issues afterwards. Let's sort > the list based on original name. > > Signed-off-by: Song Liu Fixes: 8cc32a9bbf29 ("kallsyms: strip LTO-only suffixes from promoted global functions")

[PATCH v3] uprobes: turn trace_uprobe's nhit counter to be per-CPU one

2024-08-13 Thread Andrii Nakryiko
trace_uprobe->nhit counter is not incremented atomically, so its value is questionable in when uprobe is hit on multiple CPUs simultaneously. Also, doing this shared counter increment across many CPUs causes heavy cache line bouncing, limiting uprobe/uretprobe performance scaling with number of CP

Re: [PATCH RFC v3 12/13] mm: add SLAB_TYPESAFE_BY_RCU to files_cache

2024-08-13 Thread Andrii Nakryiko
On Tue, Aug 13, 2024 at 7:49 AM Suren Baghdasaryan wrote: > > On Mon, Aug 12, 2024 at 11:07 PM Mateusz Guzik wrote: > > > > On Mon, Aug 12, 2024 at 09:29:16PM -0700, Andrii Nakryiko wrote: > > > Add RCU protection for file struct's backing memory by adding > > > SLAB_TYPESAFE_BY_RCU flag to files

[PATCH 2/2] tracing/fgraph: Have fgraph handle previous boot function addresses

2024-08-13 Thread Steven Rostedt
From: Steven Rostedt Update the function graph code to modify the function addresses for a previous boot buffer so that it matches the current kallsyms (note this does not handle module addresses, yet). After a reboot, instead of seeing: # trace-cmd show -B boot_mapped | tail -n30 swapp

[PATCH 1/2] tracing: Allow boot instances to use reserve_mem boot memory

2024-08-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Allow boot instances to use memory reserved by the reserve_mem boot option. reserve_mem=12M:4096:trace trace_instance=boot_mapped@trace The above will allocate 12 megs with 4096 alignment and label it "trace". The second parameter will create a "boot_mapped" i

[PATCH 0/2] tracing: Have boot instance use reserve_mem option and use fgraph tracer

2024-08-13 Thread Steven Rostedt
Now that "reserve_mem" kernel command line option is upstream, add a patch to use it with the ring buffer boot up mappings. That is: reserve_mem=12M:4096:trace trace_instance=boot_mapped@trace Will allocate 12 megabytes at boot up that is aligned by 4096 bytes and label it with "trace". A tra

Re: [PATCH v2] uprobes: make trace_uprobe->nhit counter a per-CPU one

2024-08-13 Thread Andrii Nakryiko
On Tue, Aug 13, 2024 at 7:50 AM Oleg Nesterov wrote: > > On 08/09, Andrii Nakryiko wrote: > > > > @@ -815,13 +824,21 @@ static int probes_profile_seq_show(struct seq_file > > *m, void *v) > > { > > struct dyn_event *ev = v; > > struct trace_uprobe *tu; > > + unsigned long nhits;

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-13 Thread Petr Mladek
On Mon 2024-08-05 14:46:56, zhangyongde.zyd wrote: > From: Wardenjohn > > One system may contains more than one livepatch module. We can see > which patch is enabled. If some patches applied to one system > modifing the same function, livepatch will use the function enabled > on top of the functi

Re: [PATCH 3/7] remoteproc: keystone: Use devm action to release reserved memory

2024-08-13 Thread Mathieu Poirier
On Fri, Aug 02, 2024 at 01:22:56PM -0500, Andrew Davis wrote: > This helps prevent mistakes like freeing out of order in cleanup functions > and forgetting to free on error paths. > > Signed-off-by: Andrew Davis > --- > drivers/remoteproc/keystone_remoteproc.c | 17 ++--- > 1 file ch

Re: [PATCH v2] uprobes: make trace_uprobe->nhit counter a per-CPU one

2024-08-13 Thread Oleg Nesterov
On 08/13, Masami Hiramatsu wrote: > > > @@ -62,7 +63,7 @@ struct trace_uprobe { > > struct uprobe *uprobe; > > BTW, what is this change? I couldn't cleanly apply this to the v6.11-rc3. > Which tree would you working on? (I missed something?) tip/perf/core See https://git.ke

Re: [PATCH RFC v3 13/13] uprobes: add speculative lockless VMA to inode resolution

2024-08-13 Thread Suren Baghdasaryan
On Mon, Aug 12, 2024 at 11:18 PM Mateusz Guzik wrote: > > On Mon, Aug 12, 2024 at 09:29:17PM -0700, Andrii Nakryiko wrote: > > Now that files_cachep is SLAB_TYPESAFE_BY_RCU, we can safely access > > vma->vm_file->f_inode lockless only under rcu_read_lock() protection, > > attempting uprobe look up

Re: [PATCH] dt-bindings: remoteproc: xlnx,zynqmp-r5fss: add missing "additionalProperties" on child nodes

2024-08-13 Thread Mathieu Poirier
On Sun, Aug 11, 2024 at 05:34:38PM +0200, Krzysztof Kozlowski wrote: > All nodes need an explicit additionalProperties or unevaluatedProperties > unless a $ref has one that's false. Add missing additionalProperties > to fix dt_binding_check warning: > > xlnx,zynqmp-r5fss.yaml: ^r(.*)@[0-9a-f]+$

[PATCH tip/perf/core] bpf: fix use-after-free in bpf_uprobe_multi_link_attach()

2024-08-13 Thread Oleg Nesterov
If bpf_link_prime() fails, bpf_uprobe_multi_link_attach() goes to the error_free label and frees the array of bpf_uprobe's without calling bpf_uprobe_unregister(). This leaks bpf_uprobe->uprobe and worse, this frees bpf_uprobe->consumer without removing it from the uprobe->consumers list. Cc: sta

Re: [PATCH] remoteproc: Use of_property_present()

2024-08-13 Thread Mathieu Poirier
On Wed, Jul 31, 2024 at 01:12:45PM -0600, Rob Herring (Arm) wrote: > Use of_property_present() to test for property presence rather than > of_(find|get)_property(). This is part of a larger effort to remove > callers of of_find_property() and similar functions. of_find_property() > leaks the DT str

Re: [PATCH v2] uprobes: make trace_uprobe->nhit counter a per-CPU one

2024-08-13 Thread Oleg Nesterov
On 08/09, Andrii Nakryiko wrote: > > @@ -815,13 +824,21 @@ static int probes_profile_seq_show(struct seq_file *m, > void *v) > { > struct dyn_event *ev = v; > struct trace_uprobe *tu; > + unsigned long nhits; > + int cpu; > > if (!is_trace_uprobe(ev)) > ret

Re: [PATCH RFC v3 12/13] mm: add SLAB_TYPESAFE_BY_RCU to files_cache

2024-08-13 Thread Suren Baghdasaryan
On Mon, Aug 12, 2024 at 11:07 PM Mateusz Guzik wrote: > > On Mon, Aug 12, 2024 at 09:29:16PM -0700, Andrii Nakryiko wrote: > > Add RCU protection for file struct's backing memory by adding > > SLAB_TYPESAFE_BY_RCU flag to files_cachep. This will allow to locklessly > > access struct file's fields

[PATCH bpf-next v5 1/2] bpf: enable generic kfuncs for BPF_CGROUP_* programs

2024-08-13 Thread Matteo Croce
From: Matteo Croce These kfuncs are enabled even in BPF_PROG_TYPE_TRACING, so they should be safe also in BPF_CGROUP_* programs. In enum btf_kfunc_hook, rename BTF_KFUNC_HOOK_CGROUP_SKB to a more generic BTF_KFUNC_HOOK_CGROUP, since it's used for all the cgroup related program types. Signed-off

Re: [PATCH v2] uprobes: make trace_uprobe->nhit counter a per-CPU one

2024-08-13 Thread Google
On Fri, 9 Aug 2024 12:23:57 -0700 Andrii Nakryiko wrote: > trace_uprobe->nhit counter is not incremented atomically, so its value > is questionable in when uprobe is hit on multiple CPUs simultaneously. > > Also, doing this shared counter increment across many CPUs causes heavy > cache line bou

[PATCH bpf-next v5 2/2] bpf: allow bpf_current_task_under_cgroup() with BPF_CGROUP_*

2024-08-13 Thread Matteo Croce
From: Matteo Croce The helper bpf_current_task_under_cgroup() currently is only allowed for tracing programs, allow its usage also in the BPF_CGROUP_* program types. Move the code from kernel/trace/bpf_trace.c to kernel/bpf/helpers.c, so it compiles also without CONFIG_BPF_EVENTS. This will be

[PATCH bpf-next v5 0/2] bpf: enable some functions in cgroup programs

2024-08-13 Thread Matteo Croce
From: Matteo Croce Enable some BPF kfuncs and the helper bpf_current_task_under_cgroup() for program types BPF_CGROUP_*. These will be used by systemd-networkd: https://github.com/systemd/systemd/pull/32212 v4->v5: Same code, but v4 had an old cover letter v3->v4: Reset all the acked-by tags be

Re: [PATCH v2 3/6] riscv: ftrace: prepare ftrace for atomic code patching

2024-08-13 Thread Björn Töpel
Andy Chiu writes: > We use an AUIPC+JALR pair to jump into a ftrace trampoline. Since > instruction fetch can break down to 4 byte at a time, it is impossible > to update two instructions without a race. In order to mitigate it, we > initialize the patchable entry to AUIPC + NOP4. Then, the run-t

Re: [RFC PATCH] vhost_vdpa: assign irq bypass producer token correctly

2024-08-13 Thread Dragos Tatulea
On 13.08.24 08:26, Jason Wang wrote: > On Mon, Aug 12, 2024 at 7:22 PM Dragos Tatulea wrote: >> >> >> >> On 12.08.24 08:49, Jason Wang wrote: >>> On Mon, Aug 12, 2024 at 1:47 PM Jason Wang wrote: On Fri, Aug 9, 2024 at 2:04 AM Dragos Tatulea wrote: > > > > On 08.08.2

Re: [PATCH v2 1/2] uprobes: Remove redundant spinlock in uprobe_deny_signal()

2024-08-13 Thread Oleg Nesterov
On 08/13, Liao, Chang wrote: > > > Oleg, your explaination is more accurate. So I will reword the commit log and > quote some of your note like this: Oh, please don't. I just tried to explain the history of this spin_lock(siglock). > Since we already have the lockless user of > clear_thread_f

Re: [PATCH] rtla: Sync the help text between hist tools

2024-08-13 Thread Tomas Glozar
út 13. 8. 2024 v 13:49 odesílatel Eder Zulian napsal: > > In addition, fix a typo in the error message generated when the > specified duration is invalid. > > Signed-off-by: Eder Zulian > --- > tools/tracing/rtla/src/osnoise_hist.c | 4 ++-- > tools/tracing/rtla/src/timerlat_hist.c | 4 ++-- >

Re: [PATCH v2 1/2] uprobes: Remove redundant spinlock in uprobe_deny_signal()

2024-08-13 Thread Liao, Chang
在 2024/8/12 20:07, Oleg Nesterov 写道: > On 08/09, Liao Chang wrote: >> >> Since clearing a bit in thread_info is an atomic operation, the spinlock >> is redundant and can be removed, reducing lock contention is good for >> performance. > > My ack still stays, but let me add some notes... > > si

Re: [PATCH v2 2/2] uprobes: Remove the spinlock within handle_singlestep()

2024-08-13 Thread Liao, Chang
在 2024/8/12 19:29, Oleg Nesterov 写道: > On 08/09, Liao Chang wrote: >> >> --- a/include/linux/uprobes.h >> +++ b/include/linux/uprobes.h >> @@ -75,6 +75,7 @@ struct uprobe_task { >> >> struct uprobe *active_uprobe; >> unsigned long xol_vaddr; >> +

[PATCH bpf-next v4 2/2] bpf: allow bpf_current_task_under_cgroup() with BPF_CGROUP_*

2024-08-13 Thread Matteo Croce
From: Matteo Croce The helper bpf_current_task_under_cgroup() currently is only allowed for tracing programs, allow its usage also in the BPF_CGROUP_* program types. Move the code from kernel/trace/bpf_trace.c to kernel/bpf/helpers.c, so it compiles also without CONFIG_BPF_EVENTS. This will be

[PATCH bpf-next v4 1/2] bpf: enable generic kfuncs for BPF_CGROUP_* programs

2024-08-13 Thread Matteo Croce
From: Matteo Croce These kfuncs are enabled even in BPF_PROG_TYPE_TRACING, so they should be safe also in BPF_CGROUP_* programs. In enum btf_kfunc_hook, rename BTF_KFUNC_HOOK_CGROUP_SKB to a more generic BTF_KFUNC_HOOK_CGROUP, since it's used for all the cgroup related program types. Signed-off

[PATCH bpf-next v4 0/2] bpf: enable generic kfuncs for BPF_CGROUP_* programs

2024-08-13 Thread Matteo Croce
From: Matteo Croce From: Matteo Croce These kfuncs are enabled even in BPF_PROG_TYPE_TRACING, so they should be safe also in BPF_CGROUP_* programs. Reset all the acked-by tags because the code changed a bit. Signed-off-by: Matteo Croce Matteo Croce (2): bpf: enable generic kfuncs for BPF_

[PATCH] rtla: Sync the help text between hist tools

2024-08-13 Thread Eder Zulian
In addition, fix a typo in the error message generated when the specified duration is invalid. Signed-off-by: Eder Zulian --- tools/tracing/rtla/src/osnoise_hist.c | 4 ++-- tools/tracing/rtla/src/timerlat_hist.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/tra

Re: [PATCH v2 2/6] riscv: ftrace: align patchable functions to 4 Byte boundary

2024-08-13 Thread Björn Töpel
Andy Chiu writes: > We are changing ftrace code patching in order to remove dependency from > stop_machine() and enable kernel preemption. This requires us to align > functions entry at a 4-B align address. > > However, -falign-functions on older versions of GCC alone was not strong > enoungh to

Re: [PATCH v2 1/6] riscv: ftrace: support fastcc in Clang for WITH_ARGS

2024-08-13 Thread Björn Töpel
Andy Chiu writes: > Some caller-saved registers which are not defined as function arguments > in the ABI can still be passed as arguments when the kernel is compiled > with Clang. As a result, we must save and restore those registers to > prevent ftrace from clobbering them. > > - [1]: https://re

Re: [PATCH v2 0/6] riscv: ftrace: atmoic patching and preempt improvements

2024-08-13 Thread Björn Töpel
Andy, Way over due; I'm back from my vacation, I've finally started to look at the series. Thanks for working on it. Andy Chiu writes: > This series makes atmoic code patching possible in riscv ftrace. A atomic > direct benefit of this is that we can get rid of stop_machine

[PATCH v3] filemap: add trace events for get_pages, map_pages, and fault

2024-08-13 Thread Takaya Saeki
To allow precise tracking of page caches accessed, add new tracepoints that trigger when a process actually accesses them. The ureadahead program used by ChromeOS traces the disk access of programs as they start up at boot up. It uses mincore(2) or the 'mm_filemap_add_to_page_cache' trace event to

[PATCH] LoongArch: Fix AP booting issue in VM mode

2024-08-13 Thread Bibo Mao
If paravirt IPI is used, native IPI is still necessary for AP booting, which is boot interface between OS and BIOS firmware, and the paravirt ipi is used inside OS. During AP boot stage, AP executes idle instruction and waits for interrupt or SW events, if AP is woke up, it clears IPI interrupt an