[PATCH v3] ptp: Add vDSO-style vmclock support

2024-07-29 Thread David Woodhouse
From: David Woodhouse The vmclock "device" provides a shared memory region with precision clock information. By using shared memory, it is safe across Live Migration. Like the KVM PTP clock, this can convert TSC-based cross timestamps into KVM clock values. Unlike the KVM PTP clock, it does so o

[RFC] Printk deadlock in bpf trace called from scheduler context

2024-07-29 Thread Radoslaw Zielonek
I am currently working on a syzbot-reported bug where bpf is called from trace_sched_switch. In this scenario, we are still within the scheduler context, and calling printk can create a deadlock. I am uncertain about the best approach to fix this issue. Should we simply forbid such calls, or perha

Re: [PATCH v2 01/11] arm64: dts: qcom: sm6115-pro1x: Add Hall Switch and Camera Button

2024-07-29 Thread Konrad Dybcio
On 25.07.2024 3:42 AM, Dang Huynh wrote: > The Pro1X has a flip keyboard and a single-state camera button. > > Signed-off-by: Dang Huynh > --- [...] > > &tlmm { > gpio-reserved-ranges = <0 4>, <14 4>; > + > + hall_sensor_n: hall-sensor-n { These must end in -state to pass binding

Re: [RFC] Printk deadlock in bpf trace called from scheduler context

2024-07-29 Thread Peter Zijlstra
On Mon, Jul 29, 2024 at 01:46:09PM +0200, Radoslaw Zielonek wrote: > I am currently working on a syzbot-reported bug where bpf > is called from trace_sched_switch. In this scenario, we are still within > the scheduler context, and calling printk can create a deadlock. > > I am uncertain about the

Re: [PATCH] arm64: dts: exynos: exynos7885-jackpotlte: Correct RAM amount to 4GB

2024-07-29 Thread Krzysztof Kozlowski
On Sat, 13 Jul 2024 19:58:32 +0200, David Virag wrote: > All known jackpotlte variants have 4GB of RAM, let's use it all. > RAM was set to 3GB from a mistake in the vendor provided DTS file. > > Applied, thanks! [1/1] arm64: dts: exynos: exynos7885-jackpotlte: Correct RAM amount to 4GB

Re: [PATCH v4] x86/paravirt: Disable virt spinlock on bare metal

2024-07-29 Thread Thomas Gleixner
On Mon, Jul 29 2024 at 14:52, Chen Yu wrote: > #ifdef CONFIG_PARAVIRT > /* > - * virt_spin_lock_key - enables (by default) the virt_spin_lock() hijack. > + * virt_spin_lock_key - disables (by default) the virt_spin_lock() hijack. > * > * Native (and PV wanting native due to vCPU pinning) shou

Re: [PATCH v1] MAINTAINERS: add me as reviewer of AF_VSOCK and virtio-vsock

2024-07-29 Thread Stefano Garzarella
On Sun, Jul 28, 2024 at 09:33:25PM GMT, Arseniy Krasnov wrote: I'm working on AF_VSOCK and virtio-vsock. Yeah, thanks for the help! Signed-off-by: Arseniy Krasnov --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/MAINTAINERS b/MAINTAIN

Re: [RFC] Printk deadlock in bpf trace called from scheduler context

2024-07-29 Thread Marco Elver
On Mon, 29 Jul 2024 at 14:27, Peter Zijlstra wrote: > > On Mon, Jul 29, 2024 at 01:46:09PM +0200, Radoslaw Zielonek wrote: > > I am currently working on a syzbot-reported bug where bpf > > is called from trace_sched_switch. In this scenario, we are still within > > the scheduler context, and calli

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-29 Thread Ajay Kaher
On Fri, Jul 26, 2024 at 9:33 PM Steven Rostedt wrote: > > On Fri, 26 Jul 2024 18:00:18 +0530 > Ajay Kaher wrote: > > > Some doubt: > > Because of the same race condition, it may happen that kmem_cache_free(file) > > was executed while f_start() is waiting to get event_mutex. Once > > f_start() ac

[PATCH v2 0/5] uprobes: misc cleanups/simplifications

2024-07-29 Thread Oleg Nesterov
Peter, I don't think these changes can really complicate your ongoing work. But again, if you are going to send the next version "soon" I can rebase these cleanups on top of it. Andrii, I dared to preserve your acks, all the changes are simple. Changes since v1: - update the comment in r

[PATCH v2 1/5] uprobes: document the usage of mm->mmap_lock

2024-07-29 Thread Oleg Nesterov
The comment above uprobe_write_opcode() is wrong, unapply_uprobe() calls it under mmap_read_lock() and this is correct. And it is completely unclear why register_for_each_vma() takes mmap_lock for writing, add a comment to explain that mmap_write_lock() is needed to avoid the following race:

[PATCH v2 2/5] uprobes: is_trap_at_addr: don't use get_user_pages_remote()

2024-07-29 Thread Oleg Nesterov
get_user_pages_remote() and the comment above it make no sense. There is no task_struct passed into get_user_pages_remote() anymore, and nowadays mm_account_fault() increments the current->min/maj_flt counters regardless of FAULT_FLAG_REMOTE. Reported-by: Andrii Nakryiko Acked-by: Andrii Nakryik

[PATCH v2 3/5] uprobes: simplify error handling for alloc_uprobe()

2024-07-29 Thread Oleg Nesterov
From: Andrii Nakryiko Return -ENOMEM instead of NULL, which makes caller's error handling just a touch simpler. Signed-off-by: Andrii Nakryiko Signed-off-by: Oleg Nesterov --- kernel/events/uprobes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/events/uprobes.

[PATCH v2 4/5] uprobes: kill uprobe_register_refctr()

2024-07-29 Thread Oleg Nesterov
It doesn't make any sense to have 2 versions of _register(). Note that trace_uprobe_enable(), the only user of uprobe_register(), doesn't need to check tu->ref_ctr_offset to decide which one should be used, it could safely pass ref_ctr_offset == 0 to uprobe_register_refctr(). Add this argument to

[PATCH v2 5/5] uprobes: make uprobe_register() return struct uprobe *

2024-07-29 Thread Oleg Nesterov
This way uprobe_unregister() and uprobe_apply() can use "struct uprobe *" rather than inode + offset. This simplifies the code and allows to avoid the unnecessary find_uprobe() + put_uprobe() in these functions. TODO: uprobe_unregister() still needs get_uprobe/put_uprobe to ensure that this uprobe

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-29 Thread Google
On Thu, 25 Jul 2024 20:15:17 -0400 Steven Rostedt wrote: > From: Steven Rostedt > > When eventfs was introduced, special care had to be done to coordinate the > freeing of the file meta data with the files that are exposed to user > space. The file meta data would have a ref count that is set w

Re: [PATCH] tracing: Use refcount for trace_event_file reference counter

2024-07-29 Thread Google
On Fri, 26 Jul 2024 14:42:08 -0400 Steven Rostedt wrote: > From: Steven Rostedt > > Instead of using an atomic counter for the trace_event_file reference > counter, use the refcount interface. It has various checks to make sure > the reference counting is correct, and will warn if it detects an

Re: [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc

2024-07-29 Thread Mathieu Poirier
On Fri, Jul 19, 2024 at 04:36:10PM +0800, Peng Fan (OSS) wrote: > This patchset is to upstream a few patches that in NXP downstream for > quite sometime. For patches directly cherry-picked from NXP downstream, > I keep the R-b tags. > > Patch 1 is a minor fix to DDR alias. > Patch 2 was sent out b

Re: [PATCH v2 01/11] arm64: dts: qcom: sm6115-pro1x: Add Hall Switch and Camera Button

2024-07-29 Thread Krzysztof Kozlowski
On 25/07/2024 03:42, Dang Huynh wrote: > The Pro1X has a flip keyboard and a single-state camera button. > > Signed-off-by: Dang Huynh > --- > arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts | 34 > +++-- > 1 file changed, 32 insertions(+), 2 deletions(-) > It does not loo

Re: [PATCH v3] ptp: Add vDSO-style vmclock support

2024-07-29 Thread Michael S. Tsirkin
On Mon, Jul 29, 2024 at 11:42:22AM +0100, David Woodhouse wrote: > +struct vmclock_abi { > + /* CONSTANT FIELDS */ > + uint32_t magic; > +#define VMCLOCK_MAGIC0x4b4c4356 /* "VCLK" */ > + uint32_t size; /* Size of region containing this structure */ > + uint16_t vers

Re: [PATCH v2 2/2] remoteproc: imx_rproc: handle system off for i.MX7ULP

2024-07-29 Thread Mathieu Poirier
On Fri, Jul 19, 2024 at 04:49:04PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > The i.MX7ULP Cortex-A7 is under control of Cortex-M4. The i.MX7ULP Linux > poweroff and restart rely on rpmsg driver to send a message to Cortex-M4 > firmware. Then Cortex-A7 could poweroff or restart by Cortex-M

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-29 Thread Steven Rostedt
On Mon, 29 Jul 2024 18:29:49 +0530 Ajay Kaher wrote: > Following is not related to this bug: > event_release callback executed once 'dir' closed (no more ref), any > specific reason to register with 'dir'/'enable' file. If not, could we > register with the 'dir' instead of 'enable'. I tried that

Re: [PATCH v3] ptp: Add vDSO-style vmclock support

2024-07-29 Thread David Woodhouse
On Mon, 2024-07-29 at 11:33 -0400, Michael S. Tsirkin wrote: > you said you will use __le here? I hadn't intended to bother until we add the virtio discovery and negotiation paths; it would basically be cosmetic for now. Although I *will* do so with the QEMU side before posting the latest version

[PATCH] rpmsg: char: Export alias for RPMSG ID rpmsg-raw from table

2024-07-29 Thread Andrew Davis
Module aliases are used by userspace to identify the correct module to load for a detected hardware. The currently supported RPMSG device IDs for this module include "rpmsg-raw", but the module alias is "rpmsg_chrdev". Use the helper macro MODULE_DEVICE_TABLE(rpmsg) to export the correct supported

Re: [PATCH] rust: add `module_params` macro

2024-07-29 Thread Benno Lossin
On 05.07.24 13:15, Andreas Hindborg wrote: > From: Andreas Hindborg > > This patch includes changes required for Rust kernel modules to utilize > module parameters. This code implements read only support for integer > types without `sysfs` support. > > This code is a reduced and updated version

[PATCH RESEND v5] perf,x86: avoid missing caller address in stack traces captured in uprobe

2024-07-29 Thread Andrii Nakryiko
When tracing user functions with uprobe functionality, it's common to install the probe (e.g., a BPF program) at the first instruction of the function. This is often going to be `push %rbp` instruction in function preamble, which means that within that function frame pointer hasn't been established

Re: [PATCH v4] x86/paravirt: Disable virt spinlock on bare metal

2024-07-29 Thread Chen Yu
Hi Thomas, On 2024-07-29 at 14:43:37 +0200, Thomas Gleixner wrote: > On Mon, Jul 29 2024 at 14:52, Chen Yu wrote: > > #ifdef CONFIG_PARAVIRT > > /* > > - * virt_spin_lock_key - enables (by default) the virt_spin_lock() hijack. > > + * virt_spin_lock_key - disables (by default) the virt_spin_lock

Re: [PATCH v7 1/3] vdpa: support set mac address from vdpa tool

2024-07-29 Thread Andrew Lunn
> +static int vdpa_dev_net_device_attr_set(struct vdpa_device *vdev, > + struct genl_info *info) > +{ > + struct vdpa_dev_set_config set_config = {}; > + struct vdpa_mgmt_dev *mdev = vdev->mdev; > + struct nlattr **nl_attrs = info->attrs; > + cons

Re: [PATCH v7 2/3] vdpa_sim_net: Add the support of set mac address

2024-07-29 Thread Andrew Lunn
> +static int vdpasim_net_set_attr(struct vdpa_mgmt_dev *mdev, struct > vdpa_device *dev, > + const struct vdpa_dev_set_config *config) > +{ > + struct vdpasim *vdpasim = container_of(dev, struct vdpasim, vdpa); > + struct virtio_net_config *vio_config = vdpasim

Re: [PATCH v7 3/3] vdpa/mlx5: Add the support of set mac address

2024-07-29 Thread Andrew Lunn
> +static int mlx5_vdpa_set_attr(struct vdpa_mgmt_dev *v_mdev, struct > vdpa_device *dev, > + const struct vdpa_dev_set_config *add_config) > +{ > + struct virtio_net_config *config; > + struct mlx5_core_dev *pfmdev; > + struct mlx5_vdpa_dev *mvdev; > + st

[PATCH v2 0/5] soc: qcom: fix rpm_requests module probing

2024-07-29 Thread Dmitry Baryshkov
tead. Signed-off-by: Dmitry Baryshkov --- Changes in v2: - Separate fix from the improvements (Krzysztof - Split the qcom,glink-smd-rpm compat from the qcom,smd-rpm as they use different channels underneath. - Link to v1: https://lore.kernel.org/r/20240729-fix-smd-rpm-v1-0-99a96133c...@linaro.org

[PATCH v2 1/5] Revert "soc: qcom: smd-rpm: Match rpmsg channel instead of compatible"

2024-07-29 Thread Dmitry Baryshkov
The rpm_requests device nodes have the compatible node. As such the rpmsg core uses OF modalias instead of a native rpmsg modalias. Thus if smd-rpm is built as a module, it doesn't get autoloaded for the device. Revert the commit bcabe1e09135 ("soc: qcom: smd-rpm: Match rpmsg channel instead of co

[PATCH v2 2/5] dt-bindings: soc: qcom: smd-rpm: add generic compatibles

2024-07-29 Thread Dmitry Baryshkov
Add two generic compatibles to all smd-rpm devices, they follow the same RPMSG protocol and are either accessed through the smd-edge or through the glink-edge. Signed-off-by: Dmitry Baryshkov --- .../devicetree/bindings/clock/qcom,rpmcc.yaml | 2 +- .../bindings/remoteproc/qcom,glink-rpm-e

[PATCH v2 3/5] soc: qcom: smd-rpm: add qcom,smd-rpm compatible

2024-07-29 Thread Dmitry Baryshkov
Add the generic qcom,smd-rpm and qcom,glink-smd-rpm compatibles so that there is no need to add further compat strings to the list. Existing strings are intact to keep compatibility with existing DTS. Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/smd-rpm.c | 6 ++ 1 file changed, 6 in

[PATCH v2 4/5] ARM: dts: qcom: add generic compat string to RPM glink channels

2024-07-29 Thread Dmitry Baryshkov
Add the generic qcom,smd-rpm compatible to RPM nodes to follow the schema. Signed-off-by: Dmitry Baryshkov --- arch/arm/boot/dts/qcom/qcom-apq8084.dtsi | 2 +- arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 2 +- arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 de

[PATCH v2 5/5] arm64: dts: qcom: add generic compat string to RPM glink channels

2024-07-29 Thread Dmitry Baryshkov
Add the generic qcom,smd-rpm / qcom,glink-smd-rpm compatible to RPM nodes to follow the schema. Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- arch/arm64/boot/dts/qcom/m

Re: [GIT PULL] virtio: fixes for rc1

2024-07-29 Thread pr-tracker-bot
The pull request you sent on Sun, 28 Jul 2024 19:19:56 -0400: > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/10826505f52357c7c9e12358db97a3acbe82e958 Thank you! -- Deet-doot-dot, I am a b

Re: [PATCH] tracing: Use refcount for trace_event_file reference counter

2024-07-29 Thread Steven Rostedt
On Mon, 29 Jul 2024 23:49:24 +0900 Masami Hiramatsu (Google) wrote: > On Fri, 26 Jul 2024 14:42:08 -0400 > Steven Rostedt wrote: > > > From: Steven Rostedt > > > > Instead of using an atomic counter for the trace_event_file reference > > counter, use the refcount interface. It has various che

Re: [PATCH] tracing: Use refcount for trace_event_file reference counter

2024-07-29 Thread Google
On Mon, 29 Jul 2024 19:02:41 -0400 Steven Rostedt wrote: > On Mon, 29 Jul 2024 23:49:24 +0900 > Masami Hiramatsu (Google) wrote: > > > On Fri, 26 Jul 2024 14:42:08 -0400 > > Steven Rostedt wrote: > > > > > From: Steven Rostedt > > > > > > Instead of using an atomic counter for the trace_eve

[PATCH 0/3] Fix kallsyms with CONFIG_LTO_CLANG

2024-07-29 Thread Song Liu
With CONFIG_LTO_CLANG, the compiler/linker adds .llvm. suffix to local symbols to avoid duplications. Existing scripts/kallsyms sorts symbols without .llvm. suffix. However, this causes quite some issues later on. Some users of kallsyms, such as livepatch, have to match symbols exactly; while other

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

2024-07-29 Thread Song Liu
Cleaning up the symbols causes various issues afterwards. Let's sort the list based on original name and handle suffix later during the symbol lookup. Signed-off-by: Song Liu --- scripts/kallsyms.c | 31 ++- scripts/link-vmlinux.sh | 4 2 files changed, 2 i

[PATCH 2/3] kallsyms: Add APIs to match symbol without .llmv. suffix.

2024-07-29 Thread Song Liu
With CONFIG_LTO_CLANG=y, the compiler may add suffix to function names to avoid duplication. This causes confusion with users of kallsyms. On one hand, users like livepatch are required to match the symbols exactly. On the other hand, users like kprobe would like to match to original function names

[PATCH 3/3] tracing/kprobes: Use APIs that matches symbols with .llvm. suffix

2024-07-29 Thread Song Liu
Use the new kallsyms APIs that matches symbols name with .llvm. suffix. This allows userspace tools to get kprobes on the expected function name, while the actual symbol has a .llvm. suffix. This only effects kernel compared with CONFIG_LTO_CLANG. Signed-off-by: Song Liu --- kernel/trace/trace_

Re: [PATCH] tools/virtio:Fix the wrong format specifier

2024-07-29 Thread Xuan Zhuo
On Wed, 24 Jul 2024 00:41:08 -0700, Zhu Jun wrote: > The unsigned int should use "%u" instead of "%d". > > Signed-off-by: Zhu Jun Reviewed-by: Xuan Zhuo > --- > tools/virtio/ringtest/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/virtio/ringtest/main.c

Re: [PATCH v4] x86/paravirt: Disable virt spinlock on bare metal

2024-07-29 Thread maobibo
Chenyu, Sorry to bother you, I am porting pv spinlock to LoongArch platform, I do not know the history about function virt_spin_lock(). When CONFIG_PARAVIRT_SPINLOCKS is enabled, there is pv_enabled() before virt_spin_lock(), it seems that virt_spin_lock is never called in this condition.

Re: [PATCH v7 1/3] vdpa: support set mac address from vdpa tool

2024-07-29 Thread Cindy Lu
On Tue, 30 Jul 2024 at 03:13, Andrew Lunn wrote: > > > +static int vdpa_dev_net_device_attr_set(struct vdpa_device *vdev, > > + struct genl_info *info) > > +{ > > + struct vdpa_dev_set_config set_config = {}; > > + struct vdpa_mgmt_dev *mdev = vdev->mdev

Re: [PATCH v7 2/3] vdpa_sim_net: Add the support of set mac address

2024-07-29 Thread Cindy Lu
On Tue, 30 Jul 2024 at 03:15, Andrew Lunn wrote: > > > +static int vdpasim_net_set_attr(struct vdpa_mgmt_dev *mdev, struct > > vdpa_device *dev, > > + const struct vdpa_dev_set_config *config) > > +{ > > + struct vdpasim *vdpasim = container_of(dev, struct vdpasim,

Re: [PATCH v7 3/3] vdpa/mlx5: Add the support of set mac address

2024-07-29 Thread Cindy Lu
On Tue, 30 Jul 2024 at 03:16, Andrew Lunn wrote: > > > +static int mlx5_vdpa_set_attr(struct vdpa_mgmt_dev *v_mdev, struct > > vdpa_device *dev, > > + const struct vdpa_dev_set_config *add_config) > > +{ > > + struct virtio_net_config *config; > > + struct mlx5_c

Re: [PATCH 0/3] Fix kallsyms with CONFIG_LTO_CLANG

2024-07-29 Thread Song Liu
On Mon, Jul 29, 2024 at 5:54 PM Song Liu wrote: > > With CONFIG_LTO_CLANG, the compiler/linker adds .llvm. suffix to > local symbols to avoid duplications. Existing scripts/kallsyms sorts > symbols without .llvm. suffix. However, this causes quite some > issues later on. Some users of kallsyms, su

[PATCH bpf-next v2] bpf: kprobe: remove unused declaring of bpf_kprobe_override

2024-07-29 Thread Menglong Dong
After the commit 5ad2f102 ("tracing/kprobe: bpf: Compare instruction pointer with original one"), "bpf_kprobe_override" is not used anywhere anymore, and we can remove it now. Fixes: 5ad2f102 ("tracing/kprobe: bpf: Compare instruction pointer with original one") Signed-off-by: Menglong Do