Re: [PATCH] livepatch: introduce 'stack_order' sysfs interface to klp_patch

2024-09-28 Thread zhang warden
Hi, Miroslav! > > Perhaps something like > > " > Add "stack_order" sysfs attribute which holds the order in which a live > patch module was loaded into the system. A user can then determine an > active live patched version of a function. > > cat /sys/kernel/livepatch/livepatch_1/stack_order ->

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Alan Huang
2024年9月29日 07:55,Boqun Feng wrote: > > > > On Sun, Sep 29, 2024, at 6:26 AM, Alan Huang wrote: >> 2024年9月28日 23:55,Mathieu Desnoyers wrote: >>> >>> On 2024-09-28 17:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: > On 2024-09-28 16:49, Alan St

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Boqun Feng
On Sun, Sep 29, 2024, at 6:26 AM, Alan Huang wrote: > 2024年9月28日 23:55,Mathieu Desnoyers wrote: >> >> On 2024-09-28 17:49, Alan Stern wrote: >>> On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: On 2024-09-28 16:49, Alan Stern wrote: > On Sat, Sep 28, 2024 at 09:51:27

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Gary Guo
Cc: Nikita Popov Cc: l...@lists.linux.dev On Sat, 28 Sep 2024 09:51:27 -0400 Mathieu Desnoyers wrote: > Compiler CSE and SSA GVN optimizations can cause the address dependency > of addresses returned by rcu_dereference to be lost when comparing those > pointers with either constants or previous

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-28 Thread Alan Huang
2024年9月29日 06:10,Alan Huang wrote: > > 2024年9月28日 06:18,Jonas Oberhauser wrote: >> >> >> >> Am 9/27/2024 um 10:10 PM schrieb Mathieu Desnoyers: >>> On 2024-09-27 21:23, Jonas Oberhauser wrote: >>> [...] That idea seems to be confirmed by this (atrocious, not to be copied!) example:

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Alan Huang
2024年9月28日 23:55,Mathieu Desnoyers wrote: > > On 2024-09-28 17:49, Alan Stern wrote: >> On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: >>> On 2024-09-28 16:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: > equality, which does

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-28 Thread Alan Huang
2024年9月28日 06:18,Jonas Oberhauser wrote: > > > > Am 9/27/2024 um 10:10 PM schrieb Mathieu Desnoyers: >> On 2024-09-27 21:23, Jonas Oberhauser wrote: >> [...] >>> That idea seems to be confirmed by this (atrocious, not to be copied!) >>> example: >>> >>> int fct_escape_address_of_b(void) >>> {

Re: [PATCH v2 1/2] exec: add a flag for "reasonable" execveat() comm

2024-09-28 Thread Kees Cook
On Fri, Sep 27, 2024 at 10:45:58AM -0500, Eric W. Biederman wrote: > Tycho Andersen writes: > > > From: Tycho Andersen > > > > Zbigniew mentioned at Linux Plumber's that systemd is interested in > > switching to execveat() for service execution, but can't, because the > > contents of /proc/pid/c

Re: [PATCH v3 00/20] Implement DWARF modversions

2024-09-28 Thread Neal Gompa
On Mon, Sep 23, 2024 at 2:19 PM Sami Tolvanen wrote: > > Hi, > > Here's v3 of the DWARF modversions series [1][2]. The main > motivation remains modversions support for Rust, which is important > for distributions like Android that are eager to ship Rust kernel > modules. Per Luis' request [3], v2

Re: [PATCH v5 00/16] Extended MODVERSIONS Support

2024-09-28 Thread Neal Gompa
On Wed, Sep 25, 2024 at 7:39 PM Matthew Maurer wrote: > > This patch series is intended for use alongside the Implement > MODVERSIONS for RUST [1] series as a replacement for the symbol name > hashing approach used there to enable RUST and MODVERSIONS at the same > time. > > Elsewhere, we've seen

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-28 Thread Guenter Roeck
On 9/28/24 12:27, Shuah Khan wrote: On 9/28/24 11:54, Shuah Khan wrote: On 9/28/24 11:31, Guenter Roeck wrote: On 9/27/24 17:08, Guenter Roeck wrote: On 9/27/24 13:45, Shuah Khan wrote: On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Alan Stern
On Sat, Sep 28, 2024 at 11:55:22AM -0400, Mathieu Desnoyers wrote: > On 2024-09-28 17:49, Alan Stern wrote: > > On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: > > > On 2024-09-28 16:49, Alan Stern wrote: > > > > On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote:

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-28 Thread Shuah Khan
On 9/28/24 11:54, Shuah Khan wrote: On 9/28/24 11:31, Guenter Roeck wrote: On 9/27/24 17:08, Guenter Roeck wrote: On 9/27/24 13:45, Shuah Khan wrote: On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: On Thu,

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-28 Thread Shuah Khan
On 9/28/24 11:31, Guenter Roeck wrote: On 9/27/24 17:08, Guenter Roeck wrote: On 9/27/24 13:45, Shuah Khan wrote: On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: On Thu, Sep 26, 2024 at 09:14:11PM -0700, Gu

[GIT PULL] Kselftest fixes update for Linux 6.12-rc1

2024-09-28 Thread Shuah Khan
Hi Linus, Please pull this fixes update for Linux 6.12-rc1. This kselftest fixes update for Linux 6.12-rc1 consists of an urgent fix to vDSO as automated testing is failing due to this bug. diff is attached. thanks, -- Shuah The

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-28 Thread Guenter Roeck
On 9/27/24 17:08, Guenter Roeck wrote: On 9/27/24 13:45, Shuah Khan wrote: On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: On Thu, Sep 26, 2024 at 09:14:11PM -0700, Guenter Roeck wrote: Hi Stephen, On Thu,

Re: [GIT PULL] Modules changes for v6.12-rc1

2024-09-28 Thread pr-tracker-bot
The pull request you sent on Fri, 27 Sep 2024 14:29:00 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/ > tags/modules-6.12-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/6f81a446f86106c68630032e114024ec7a557077 Thank you! -- Deet-doot-d

[PATCH v2] kselftest: devices: Add test to detect missing devices

2024-09-28 Thread Nícolas F . R . A . Prado
Introduce a new test to identify regressions causing devices to go missing on the system. For each bus and class on the system the test checks the number of devices present against a reference file, which needs to have been generated by the program at a previous point on a known-good kernel, and i

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 17:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: On 2024-09-28 16:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: equality, which does not preserve address dependencies and allows the following mi

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Alan Stern
On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote: > On 2024-09-28 16:49, Alan Stern wrote: > > On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: > > > equality, which does not preserve address dependencies and allows the > > > following misordering speculations: >

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 16:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: Compiler CSE and SSA GVN optimizations can cause the address dependency of addresses returned by rcu_dereference to be lost when comparing those pointers with either constants or previously

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 16:49, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: [...] +/* + * Compare two addresses while preserving the address dependencies for + * later use of the address. It should be used when comparing an address + * returned by rcu_dereference()

Re: [PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 16:58, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:28AM -0400, Mathieu Desnoyers wrote: [...] -- Be very careful about comparing pointers obtained from - rcu_dereference() against non-NULL values. As Linus Torvalds - explained, if the two pointers are equal,

Re: [PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Alan Stern
On Sat, Sep 28, 2024 at 09:51:28AM -0400, Mathieu Desnoyers wrote: > Refer to ptr_eq() in the rcu_dereference() documentation. > > ptr_eq() is a mechanism that preserves address dependencies when > comparing pointers, and should be favored when comparing a pointer > obtained from rcu_dereference()

Re: [PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Alan Stern
On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote: > Compiler CSE and SSA GVN optimizations can cause the address dependency > of addresses returned by rcu_dereference to be lost when comparing those > pointers with either constants or previously loaded pointers. > > Introduce ptr_

[syzbot] [net?] [virt?] BUG: unable to handle kernel paging request in clear_page_erms (6)

2024-09-28 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:abf2050f51fd Merge tag 'media/v6.12-1' of git://git.kernel.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=15a0310798 kernel config: https://syzkaller.appspot.com/x/.config?x=2a8c36c5e2b56016 das

[PATCH 1/2] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Mathieu Desnoyers
Compiler CSE and SSA GVN optimizations can cause the address dependency of addresses returned by rcu_dereference to be lost when comparing those pointers with either constants or previously loaded pointers. Introduce ptr_eq() to compare two addresses while preserving the address dependencies for l

[PATCH 0/2] Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Mathieu Desnoyers
Introduce ptr_eq() to compare two addresses while preserving the address dependencies for later use of the address. It should be used when comparing an address returned by rcu_dereference(). Thanks, Mathieu Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" Cc: Will D

[PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Mathieu Desnoyers
Refer to ptr_eq() in the rcu_dereference() documentation. ptr_eq() is a mechanism that preserves address dependencies when comparing pointers, and should be favored when comparing a pointer obtained from rcu_dereference() against another pointer. Signed-off-by: Mathieu Desnoyers Cc: Greg Kroah-H

Re: [RFC PATCH 1/1] hpref: Hazard Pointers with Reference Counter

2024-09-28 Thread Jonas Oberhauser
Thanks for your response, Am 9/28/2024 um 1:33 PM schrieb Mathieu Desnoyers: This is a userspace prototype. This will behave similarly to a userspace spinlock in that case, which is not great in terms of CPU usage, but should eventually unblock the waiter, unless it has a RT priority that reall

Re: [RFC PATCH 1/1] hpref: Hazard Pointers with Reference Counter

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 13:22, Jonas Oberhauser wrote: Two more questions below: Am 9/21/2024 um 6:42 PM schrieb Mathieu Desnoyers: +#define NR_PERCPU_SLOTS_BITS    3 Have you measured any advantage of this multi-slot version vs a version with just one normal slot and one emergency slot? No, I have

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Paul E. McKenney
On Fri, Sep 27, 2024 at 07:05:53PM -0400, Mathieu Desnoyers wrote: > On 2024-09-27 22:33, Mathieu Desnoyers wrote: > [...] > > > --- > > include/linux/compiler.h | 62 > > 1 file changed, 62 insertions(+) > > > > I'm wondering if this really belongs in

Re: [RFC PATCH 1/1] hpref: Hazard Pointers with Reference Counter

2024-09-28 Thread Jonas Oberhauser
Two more questions below: Am 9/21/2024 um 6:42 PM schrieb Mathieu Desnoyers: +#define NR_PERCPU_SLOTS_BITS 3 Have you measured any advantage of this multi-slot version vs a version with just one normal slot and one emergency slot? With just one normal slot, the normal slot version would alw

Re: [PATCH bpf-next 2/2] selftests: bpf: Add missing per-arch include path

2024-09-28 Thread Björn Töpel
On Fri, 27 Sept 2024 at 22:52, Andrii Nakryiko wrote: > > On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel wrote: > > > > From: Björn Töpel > > > > The prog_tests programs do not include the per-arch tools include > > path, e.g. tools/arch/riscv/include. Some architectures depend those > > files to b

Re: [PATCH bpf-next 1/2] libbpf: Add missing per-arch include path

2024-09-28 Thread Björn Töpel
Andrii, On Fri, 27 Sept 2024 at 22:51, Andrii Nakryiko wrote: > > On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel wrote: > > > > From: Björn Töpel > > > > libbpf does not include the per-arch tools include path, e.g. > > tools/arch/riscv/include. Some architectures depend those files to > > build p