Re: [PATCH] selftest: hid: add the missing tests directory

2024-10-08 Thread luyun
在 2024/10/9 03:33, Shuah Khan 写道: On 10/8/24 03:31, Yun Lu wrote: Commit 160c826b4dd0 ("selftest: hid: add missing run-hid-tools-tests.sh") has added the run-hid-tools-tests.sh script for it to be installed, but I forgot to add the tests directory together. In fact, the run-hid-tools-tests.s

[RESEND] [PATCH v6 2/2] selftests: Add a test mangling with uc_sigmask

2024-10-08 Thread Dev Jain
The test is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask of blocked signals. If you run a fresh minimalistic program doing this, this field is empty, even if you block s

[RESEND] [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-10-08 Thread Dev Jain
Rename sigaltstack to generic signal directory, to allow adding more signal tests in the future. Signed-off-by: Dev Jain Reviewed-by: Mark Brown Acked-by: Shuah Khan --- tools/testing/selftests/Makefile| 2 +- tools/testing/selftests/{sigaltstack => signal}/.git

[RESEND] [PATCH v6 0/2] Add test to distinguish between thread's signal mask and ucontext_t

2024-10-08 Thread Dev Jain
This patch series is motivated by the following observation: Raise a signal, jump to signal handler. The ucontext_t structure dumped by kernel to userspace has a uc_sigmask field having the mask of blocked signals. If you run a fresh minimalistic program doing this, this field is empty, even if yo

Re: [PATCH net-next v20 01/14] mm: page_frag: add a test module for page_frag

2024-10-08 Thread Yunsheng Lin
On 2024/10/9 3:56, Shuah Khan wrote: > On 10/8/24 05:20, Yunsheng Lin wrote: >> The testing is done by ensuring that the fragment allocated >> from a frag_frag_cache instance is pushed into a ptr_ring >> instance in a kthread binded to a specified cpu, and a kthread >> binded to a specified cpu wil

Re: [RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap

2024-10-08 Thread Manwaring, Derek
On 2024-10-08 at 19:56+ Sean Christopherson wrote: > Another (slightly crazy) approach would be use protection keys to provide the > security properties that you want, while giving KVM (and userspace) a > quick-and-easy > override to access guest memory. > >  1. mmap() guest_memfd into userpac

Re: [PATCH 3/3] rcu: Report callbacks enqueued on offline CPU blind spot

2024-10-08 Thread Neeraj Upadhyay
On 10/2/2024 8:30 PM, Frederic Weisbecker wrote: > Le Wed, Oct 02, 2024 at 04:57:38PM +0200, Frederic Weisbecker a écrit : >> Callbacks enqueued after rcutree_report_cpu_dead() fall into RCU barrier >> blind spot. Report any potential misuse. >> >> Reported-by: Paul E. McKenney >> Signed-off-by

Re: [PATCH 3/3] rcu: Report callbacks enqueued on offline CPU blind spot

2024-10-08 Thread Paul E. McKenney
On Wed, Oct 02, 2024 at 05:00:03PM +0200, Frederic Weisbecker wrote: > Le Wed, Oct 02, 2024 at 04:57:38PM +0200, Frederic Weisbecker a écrit : > > Callbacks enqueued after rcutree_report_cpu_dead() fall into RCU barrier > > blind spot. Report any potential misuse. > > > > Reported-by: Paul E. McKe

[PATCH 1/1] selftests/rseq: Fix mm_cid test failure

2024-10-08 Thread Mathieu Desnoyers
Adapt the rseq.c/rseq.h code to follow GNU C library changes introduced by: glibc commit 2e456ccf0c34 ("Linux: Make __rseq_size useful for feature detection (bug 31965)") Without this fix, rseq selftests for mm_cid fail: ./run_param_test.sh Default parameters Running test spinlock Running compa

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

2024-10-08 Thread Guenter Roeck
On 10/8/24 16:12, Stephen Boyd wrote: Quoting Guenter Roeck (2024-10-03 21:52:09) On 10/3/24 17:42, Stephen Boyd wrote: Can you please describe how you run the kunit test? And provide the qemu command you run to boot arm64 with acpi? Example command line: qemu-system-aarch64 -M virt -m 512

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

2024-10-08 Thread Stephen Boyd
Quoting Guenter Roeck (2024-10-03 21:52:09) > On 10/3/24 17:42, Stephen Boyd wrote: > > > > Can you please describe how you run the kunit test? And provide the qemu > > command you run to boot arm64 with acpi? > > > > Example command line: > > qemu-system-aarch64 -M virt -m 512 \ > -kerne

[PATCH] selftests: drivers: net: fix name not defined

2024-10-08 Thread Alessandro Zanni
This fix solves this error, when calling kselftest with targets "drivers/net": File "tools/testing/selftests/net/lib/py/nsim.py", line 64, in __init__ if e.errno == errno.ENOSPC: NameError: name 'errno' is not defined The module errno makes available standard error system symbols. Signed-off-b

Re: [PATCH v2] selftests: vDSO: Explicitly include sched.h

2024-10-08 Thread Shuah Khan
On 10/7/24 20:33, Yu Liao wrote: The previous commit introduced the use of CLONE_NEWTIME without including which contains its definition. Add an explicit include of to ensure that CLONE_NEWTIME is correctly defined before it is used. Fixes: 2aec90036dcd ("selftests: vDSO: ensure vgetrandom wo

Re: [PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-08 Thread David Vernet
On Tue, Oct 08, 2024 at 05:35:18PM +0200, Björn Töpel wrote: > From: Björn Töpel > > The sched_ext selftests is missing proper cross-compilation support, a > proper target entry, and out-of-tree build support. > > When building the kselftest suite, e.g.: > > make ARCH=riscv CROSS_COMPILE=risc

Re: [PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-08 Thread Shuah Khan
On 10/8/24 09:35, Björn Töpel wrote: From: Björn Töpel The sched_ext selftests is missing proper cross-compilation support, a proper target entry, and out-of-tree build support. When building the kselftest suite, e.g.: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ TARGETS=sched_

Re: [RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap

2024-10-08 Thread Sean Christopherson
On Tue, Oct 08, 2024, Ackerley Tng wrote: > Patrick Roy writes: > > For the "non-CoCo with direct map entries removed" VMs that we at AWS > > are going for, we'd like a VM type with host-controlled in-place > > conversions which doesn't zero on transitions, Hmm, your use case shouldn't need conve

Re: [PATCH net-next v20 01/14] mm: page_frag: add a test module for page_frag

2024-10-08 Thread Shuah Khan
On 10/8/24 05:20, Yunsheng Lin wrote: The testing is done by ensuring that the fragment allocated from a frag_frag_cache instance is pushed into a ptr_ring instance in a kthread binded to a specified cpu, and a kthread binded to a specified cpu will pop the fragment from the ptr_ring and free the

Re: [RFC PATCH v3 4/4] sched+mm: Use hazard pointers to track lazy active mm existence

2024-10-08 Thread Joel Fernandes
On Tue, Oct 8, 2024 at 9:52 AM Mathieu Desnoyers wrote: > > Replace lazy active mm existence tracking with hazard pointers. This > removes the following implementations and their associated config > options: > > - MMU_LAZY_TLB_REFCOUNT > - MMU_LAZY_TLB_SHOOTDOWN > - This removes the call_rcu delay

Re: [PATCH] selftest: hid: add the missing tests directory

2024-10-08 Thread Shuah Khan
On 10/8/24 03:31, Yun Lu wrote: Commit 160c826b4dd0 ("selftest: hid: add missing run-hid-tools-tests.sh") has added the run-hid-tools-tests.sh script for it to be installed, but I forgot to add the tests directory together. In fact, the run-hid-tools-tests.sh script uses the scripts in the tests

Re: [RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap

2024-10-08 Thread Sean Christopherson
On Thu, Oct 03, 2024, Ackerley Tng wrote: > Ackerley Tng writes: > > > Elliot Berman writes: > >> From x86 CoCo perspective, I think it also makes sense to not zero > >> the folio when changing faultiblity from private to shared: > >> - If guest is sharing some data with host, you've wiped the

[PATCH v4 19/19] Documentation/kbuild: Add DWARF module versioning

2024-10-08 Thread Sami Tolvanen
Add documentation for gendwarfksyms changes, and the kABI stability features that can be useful for distributions even though they're not used in mainline kernels. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- Documentation/kbuild/gendwarfksyms.rst | 274 + Docum

[PATCH v4 18/19] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-10-08 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- kernel/module/Kconfig | 25 - scripts/Makefile | 2 +- scripts/Makefile.build | 39 +++

[PATCH v4 17/19] export: Add __gendwarfksyms_ptr_ references to exported symbols

2024-10-08 Thread Sami Tolvanen
With gendwarfksyms, we need each TU where the EXPORT_SYMBOL() macro is used to also contain DWARF type information for the symbols it exports. However, as a TU can also export external symbols and compilers may choose not to emit debugging information for symbols not defined in the current TU, the

[PATCH v4 16/19] gendwarfksyms: Add support for symbol type pointers

2024-10-08 Thread Sami Tolvanen
The compiler may choose not to emit type information in DWARF for external symbols. Clang, for example, does this for symbols not defined in the current TU. To provide a way to work around this issue, add support for __gendwarfksyms_ptr_ pointers that force the compiler to emit the necessary type

[PATCH v4 15/19] gendwarfksyms: Add support for reserved and ignored fields

2024-10-08 Thread Sami Tolvanen
Distributions that want to maintain a stable kABI need the ability to make ABI compatible changes to kernel data structures without affecting symbol versions, either because of LTS updates or backports. With genksyms, developers would typically hide these changes from version calculation with #ifn

[PATCH v4 14/19] gendwarfksyms: Add support for kABI rules

2024-10-08 Thread Sami Tolvanen
Distributions that want to maintain a stable kABI need the ability to make ABI compatible changes to kernel without affecting symbol versions, either because of LTS updates or backports. With genksyms, developers would typically hide these changes from version calculation with #ifndef __GENKSYMS__

[PATCH v4 13/19] gendwarfksyms: Add symbol versioning

2024-10-08 Thread Sami Tolvanen
Calculate symbol versions from the fully expanded type strings in type_map, and output the versions in a genksyms-compatible format. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/dwarf.c | 25 +- scripts/gendwarfksyms/gendwarfksyms.c | 11 ++- scripts

[PATCH v4 12/19] gendwarfksyms: Add symtypes output

2024-10-08 Thread Sami Tolvanen
Add support for producing genksyms-style symtypes files. Process die_map to find the longest expansions for each type, and use symtypes references in type definitions. The basic file format is similar to genksyms, with two notable exceptions: 1. Type names with spaces (common with Rust) in refer

[PATCH v4 11/19] gendwarfksyms: Add die_map debugging

2024-10-08 Thread Sami Tolvanen
Debugging the DWARF processing can be somewhat challenging, so add more detailed debugging output for die_map operations. Add the --dump-die-map flag, which adds color coded tags to the output for die_map changes. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/dwarf

[PATCH v4 10/19] gendwarfksyms: Limit structure expansion

2024-10-08 Thread Sami Tolvanen
Expand each structure type only once per exported symbol. This is necessary to support self-referential structures, which would otherwise result in infinite recursion, but is still sufficient for catching ABI changes. For pointers, limit structure expansion after the first pointer in the symbol ty

[PATCH v4 09/19] gendwarfksyms: Expand structure types

2024-10-08 Thread Sami Tolvanen
Recursively expand DWARF structure types, i.e. structs, unions, and enums. Also include relevant DWARF attributes in type strings to encode structure layout, for example. Example output with --dump-dies: subprogram ( formal_parameter structure_type &str { member pointer_type {

[PATCH v4 08/19] gendwarfksyms: Expand array_type

2024-10-08 Thread Sami Tolvanen
Add support for expanding DW_TAG_array_type, and the subrange type indicating array size. Example source code: const char *s[34]; Output with --dump-dies: variable array_type[34] { pointer_type { const_type { base_type char byte_size(1) encoding(6) } } byte_size(

[PATCH v4 07/19] gendwarfksyms: Expand subroutine_type

2024-10-08 Thread Sami Tolvanen
Add support for expanding DW_TAG_subroutine_type and the parameters in DW_TAG_formal_parameter. Use this to also expand subprograms. Example output with --dump-dies: subprogram ( formal_parameter pointer_type { const_type { base_type char byte_size(1) encoding(6) } }

[PATCH v4 06/19] gendwarfksyms: Expand type modifiers and typedefs

2024-10-08 Thread Sami Tolvanen
Add support for expanding DWARF type modifiers, such as pointers, const values etc., and typedefs. These types all have DW_AT_type attribute pointing to the underlying type, and thus produce similar output. Also add linebreaks and indentation to debugging output to make it more readable. Signed-o

[PATCH v4 05/19] gendwarfksyms: Add a cache for processed DIEs

2024-10-08 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c |

[PATCH v4 04/19] gendwarfksyms: Expand base_type

2024-10-08 Thread Sami Tolvanen
Start making gendwarfksyms more useful by adding support for expanding DW_TAG_base_type types and basic DWARF attributes. Example: $ echo loops_per_jiffy | \ scripts/gendwarfksyms/gendwarfksyms \ --debug --dump-dies vmlinux.o ... gendwarfksyms: process_symbol: loops_per_jiffy

[PATCH v4 03/19] gendwarfksyms: Add address matching

2024-10-08 Thread Sami Tolvanen
The compiler may choose not to emit type information in DWARF for all aliases, but it's possible for each alias to be exported separately. To ensure we find type information for the aliases as well, read {section, address} tuples from the symbol table and match symbols also by address. Signed-off-

[PATCH v4 02/19] tools: Add gendwarfksyms

2024-10-08 Thread Sami Tolvanen
Add a basic DWARF parser, which uses libdw to traverse the debugging information in an object file and looks for functions and variables. In follow-up patches, this will be expanded to produce symbol versions for CONFIG_MODVERSIONS from DWARF. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Re

[PATCH v4 01/19] scripts: move genksyms crc32 implementation to a common include

2024-10-08 Thread Sami Tolvanen
To avoid duplication between host programs, move the crc32 code to a shared header file. Suggested-by: Petr Pavlu Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/genksyms/genksyms.c | 77 +- scripts/include/crc32.h | 93

[PATCH v4 00/19] Implement DWARF modversions

2024-10-08 Thread Sami Tolvanen
Hi, Here's v4 of the DWARF modversions series. The main motivation is modversions support for Rust, which is important for distributions like Android that are about to ship Rust kernel modules. Per Luis' request [1], v2 dropped the Rust specific bits from the series and instead added the feature a

Re: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware

2024-10-08 Thread kernel test robot
: 9852d85ec9d492ebef56dc5f229416c925758edc patch link: https://lore.kernel.org/r/20241007131620.2090104-8-arnaud.pouliquen%40foss.st.com patch subject: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware config: arm-randconfig-r054-20241008 (https://download.01.org/0day-ci/archive

Re: [RFC PATCH 30/39] KVM: guest_memfd: Handle folio preparation for guest_memfd mmap

2024-10-08 Thread Ackerley Tng
Patrick Roy writes: > Hi Ackerley, > > On Thu, 2024-10-03 at 22:32 +0100, Ackerley Tng wrote: >> Elliot Berman writes: >> >>> On Tue, Sep 10, 2024 at 11:44:01PM +, Ackerley Tng wrote: Since guest_memfd now supports mmap(), folios have to be prepared before they are faulted into use

Re: [PATCH bpf] selftests/bpf: add missing header include for htons

2024-10-08 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (net) by Martin KaFai Lau : On Tue, 08 Oct 2024 16:50:57 +0200 you wrote: > Including the network_helpers.h header in tests can lead to the following > build error: > > ./network_helpers.h: In function ‘csum_tcpudp_magic’: > ./network_helpers.h:1

Re: [PATCH v1 04/10] iommufd/viommu: Allow drivers to control vdev_id lifecycle

2024-10-08 Thread Nicolin Chen
Sorry for the late reply. Just sat down and started to look at this series. On Thu, Sep 05, 2024 at 03:01:19PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 10:02:06AM -0700, Nicolin Chen wrote: > > The iommufd core provides a lookup helper for an IOMMU driver to find a > > device pointe

Re: [PATCH] selftests: make kselftest-clean remove libynl outputs

2024-10-08 Thread Mina Almasry
On Sat, Oct 5, 2024 at 2:56 PM Greg Thelen wrote: > > Starting with 6.12 commit 85585b4bc8d8 ("selftests: add ncdevmem, netcat > for devmem TCP") kselftest-all creates additional outputs that > kselftest-clean does not cleanup: > $ make defconfig > $ make kselftest-all > $ make kselftest-cle

Re: [PATCH V5 1/1] livepatch: Add stack_order sysfs attribute

2024-10-08 Thread Josh Poimboeuf
On Tue, Oct 08, 2024 at 09:48:56AM +0800, Wardenjohn wrote: > 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

Re: [PATCH] selftests: make kselftest-clean remove libynl outputs

2024-10-08 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Sat, 5 Oct 2024 14:56:00 -0700 you wrote: > Starting with 6.12 commit 85585b4bc8d8 ("selftests: add ncdevmem, netcat > for devmem TCP") kselftest-all creates additional outputs that > kselftest-clean does not cleanup:

Re: [RFC PATCH v3 3/4] hazptr: Implement Hazard Pointers

2024-10-08 Thread Mathieu Desnoyers
On 2024-10-08 15:50, Mathieu Desnoyers wrote: [...] +/* Retire the protected hazard pointer from @slot. */ +static inline +void hazptr_retire(struct hazptr_slot *slot, void *addr) +{ + WARN_ON_ONCE(slot->addr != addr); + smp_store_release(&slot->addr, NULL); +} Actually, comparing

[PATCH bpf v7 2/2] selftests/bpf: fix perf_event link info name_len assertion

2024-10-08 Thread Tyrone Wu
Fix `name_len` field assertions in `bpf_link_info.perf_event` for kprobe/uprobe/tracepoint to validate correct name size instead of 0. Fixes: 23cf7aa539dc ("selftests/bpf: Add selftest for fill_link_info") Signed-off-by: Tyrone Wu Acked-by: Jiri Olsa Acked-by: Yafang Shao --- V6 -> V7: no chang

[PATCH bpf v7 1/2] bpf: fix unpopulated name_len field in perf_event link info

2024-10-08 Thread Tyrone Wu
Previously when retrieving `bpf_link_info.perf_event` for kprobe/uprobe/tracepoint, the `name_len` field was not populated by the kernel, leaving it to reflect the value initially set by the user. This behavior was inconsistent with how other input/output string buffer fields function (e.g. `raw_tr

[PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-08 Thread Björn Töpel
From: Björn Töpel The sched_ext selftests is missing proper cross-compilation support, a proper target entry, and out-of-tree build support. When building the kselftest suite, e.g.: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ TARGETS=sched_ext SKIP_TARGETS="" O=/output/foo \ -

Re: [PATCH net v2 0/3] selftests: net: add missing gitignore and EXTRA_CLEAN entries.

2024-10-08 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Jakub Kicinski : On Sat, 05 Oct 2024 07:29:39 +0200 you wrote: > This series is a cherry-pick on top of v6.12-rc1 from the one I sent > for selftests with other patches that were not net-related: > > https://lore.kernel.org/all/20240925-

Re: 6.12-rc1: Lockdep regression bissected (virtio-net/console/scheduler)

2024-10-08 Thread John Ogness
On 2024-10-04, Petr Mladek wrote: > On Fri 2024-10-04 02:08:52, Breno Leitao wrote: >> = >> WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected >> 6.12.0-rc1-kbuilder-virtme-00033-gd4ac164bde7a #50 Not tainted >> -

[PATCH] Fix typo in vringh_test.c

2024-10-08 Thread Shivam Chaudhary
Corrected minor typo in tools/virtio/vringh_test.c: - Fixed "retreives" to "retrieves" Signed-off-by: Shivam Chaudhary --- tools/virtio/vringh_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index 43d3a6aa1dcf..b9

[PATCH bpf] selftests/bpf: add missing header include for htons

2024-10-08 Thread eBPF Foundation
+#include #include #include #include --- base-commit: 67a7c7b656cfc10a7280f71641fb9e88726e8a5d change-id: 20241008-network_helpers_fix-bbb7d1589930 Best regards, -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-08 Thread Willem de Bruijn
Gur Stavi wrote: > PACKET socket can retain its fanout membership through link down and up > and leave a fanout while closed regardless of link state. > However, socket was forbidden from joining a fanout while it was not > RUNNING. > > This patch allows PACKET socket to join fanout while not RUNN

Re: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware

2024-10-08 Thread Mathieu Poirier
link: > https://lore.kernel.org/r/20241007131620.2090104-8-arnaud.pouliquen%40foss.st.com > patch subject: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA > to load the firmware > config: alpha-kismet-CONFIG_REMOTEPROC_TEE-CONFIG_STM32_RPROC-0-0 > (https://download.01.org/0day-ci

Re: [PATCH] mailbox, remoteproc: k3-m4+: fix compile testing

2024-10-08 Thread Mathieu Poirier
On Mon, Oct 07, 2024 at 01:23:57PM +, Arnd Bergmann wrote: > From: Arnd Bergmann > > The k3-m4 remoteproc driver was merged with incorrect dependencies. > Despite multiple people trying to fix this, the version 6.12-rc2 > remains broken and causes a build failure with CONFIG_TI_SCI_PROTOCOL=m

[RFC PATCH v3 3/4] hazptr: Implement Hazard Pointers

2024-10-08 Thread Mathieu Desnoyers
This API provides existence guarantees of objects through Hazard Pointers (hazptr). This minimalist implementation is specific to use with preemption disabled, but can be extended further as needed. Each hazptr domain defines a fixed number of hazard pointer slots (nr_cpus) across the entire syste

[RFC PATCH v3 4/4] sched+mm: Use hazard pointers to track lazy active mm existence

2024-10-08 Thread Mathieu Desnoyers
Replace lazy active mm existence tracking with hazard pointers. This removes the following implementations and their associated config options: - MMU_LAZY_TLB_REFCOUNT - MMU_LAZY_TLB_SHOOTDOWN - This removes the call_rcu delayed mm drop for RT. It leverages the fact that each CPU only ever have a

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

2024-10-08 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

[RFC PATCH v3 0/4] sched+mm: Track lazy active mm existence with hazard pointers

2024-10-08 Thread Mathieu Desnoyers
[ I'm posting a v3 taking care of feedback from Peter Zijlstra and Paul E. McKenney in case it can be useful to try hazard pointers with other use-cases, or for further benchmarking of active mm tracking impact. ] Hazard pointers appear to be a good fit for replacing refcount based lazy acti

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

2024-10-08 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 Acked-by: Alan S

[PATCH] vdpa: solidrun: Fix UB bug with devres

2024-10-08 Thread Philipp Stanner
In psnet_open_pf_bar() and snet_open_vf_bar() a string later passed to pcim_iomap_regions() is placed on the stack. Neither pcim_iomap_regions() nor the functions it calls copy that string. Should the string later ever be used, this, consequently, causes undefined behavior since the stack frame wi

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

2024-10-08 Thread Miklos Szeredi
On Sat, 31 Aug 2024 at 11:38, 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: [PATCH net-next v8 03/24] ovpn: add basic netlink support

2024-10-08 Thread Antonio Quartulli
On 08/10/2024 14:52, Jiri Pirko wrote: Tue, Oct 08, 2024 at 11:16:01AM CEST, anto...@openvpn.net wrote: On 08/10/2024 10:58, Jiri Pirko wrote: Tue, Oct 08, 2024 at 10:01:40AM CEST, anto...@openvpn.net wrote: Hi, On 07/10/24 17:32, Jiri Pirko wrote: Wed, Oct 02, 2024 at 11:02:17AM CEST, anto.

Re: [PATCH net-next v8 03/24] ovpn: add basic netlink support

2024-10-08 Thread Jiri Pirko
Tue, Oct 08, 2024 at 11:16:01AM CEST, anto...@openvpn.net wrote: >On 08/10/2024 10:58, Jiri Pirko wrote: >> Tue, Oct 08, 2024 at 10:01:40AM CEST, anto...@openvpn.net wrote: >> > Hi, >> > >> > On 07/10/24 17:32, Jiri Pirko wrote: >> > > Wed, Oct 02, 2024 at 11:02:17AM CEST, anto...@openvpn.net wrot

Re: [PATCH 11/20] sched: Handle CPU isolation on last resort fallback rq selection

2024-10-08 Thread Frederic Weisbecker
Le Tue, Oct 08, 2024 at 11:54:35AM +0100, Will Deacon a écrit : > On Fri, Sep 27, 2024 at 12:48:59AM +0200, Frederic Weisbecker wrote: > > When a kthread or any other task has an affinity mask that is fully > > offline or unallowed, the scheduler reaffines the task to all possible > > CPUs as a las

Re: [PATCH 1/1] s390/virtio_ccw: fix dma_parm pointer not set up

2024-10-08 Thread Heiko Carstens
On Mon, Oct 07, 2024 at 10:10:30PM +0200, Halil Pasic wrote: > At least since commit 334304ac2bac ("dma-mapping: don't return errors > from dma_set_max_seg_size") setting up device.dma_parms is basically > mandated by the DMA API. As of now Channel (CCW) I/O in general does not > utilize the DMA AP

[PATCH net-next v20 11/14] mm: page_frag: add testing for the newly added prepare API

2024-10-08 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 66 +-- tools/testing/selftests/mm/run_vmt

[PATCH net-next v20 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-08 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h

[PATCH net-next v20 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-10-08 Thread Yunsheng Lin
Inspired by [1], move the page fragment allocator from page_alloc into its own c file and header file, as we are about to make more change for it to replace another page_frag implementation in sock.c As this patchset is going to replace 'struct page_frag' with 'struct page_frag_cache' in sched.h,

[PATCH net-next v20 01/14] mm: page_frag: add a test module for page_frag

2024-10-08 Thread Yunsheng Lin
The testing is done by ensuring that the fragment allocated from a frag_frag_cache instance is pushed into a ptr_ring instance in a kthread binded to a specified cpu, and a kthread binded to a specified cpu will pop the fragment from the ptr_ring and free the fragment. CC: Alexander Duyck Signed-

Re: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware

2024-10-08 Thread kernel test robot
://download.01.org/0day-ci/archive/20241008/202410081902.twqcmwjk-...@intel.com/config) reproduce: (https://download.01.org/0day-ci/archive/20241008/202410081902.twqcmwjk-...@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit

Re: [PATCH 1/1] s390/virtio_ccw: fix dma_parm pointer not set up

2024-10-08 Thread Halil Pasic
On Tue, 08 Oct 2024 10:47:48 +0200 "Marc Hartmayer" wrote: > > Closes: https://bugzilla.linux.ibm.com/show_bug.cgi?id=209131 > > I guess, this line can be removed as it’s internal only. checkpatch.pl complains about the Reported-by if I do. It does not complain about Closes: N/A but if I re

Re: [PATCH 11/20] sched: Handle CPU isolation on last resort fallback rq selection

2024-10-08 Thread Will Deacon
On Fri, Sep 27, 2024 at 12:48:59AM +0200, Frederic Weisbecker wrote: > When a kthread or any other task has an affinity mask that is fully > offline or unallowed, the scheduler reaffines the task to all possible > CPUs as a last resort. > > This default decision doesn't mix up very well with nohz_

[PATCH net-next v02 2/2] selftests: net/psock_fanout: socket joins fanout when link is down

2024-10-08 Thread Gur Stavi
Modify test_control_group to have toggle parameter. When toggle is non-zero, loopback device will be set down for the initialization of fd[1] which is still expected to successfully join the fanout. Signed-off-by: Gur Stavi --- tools/testing/selftests/net/psock_fanout.c | 42

[PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-08 Thread Gur Stavi
PACKET socket can retain its fanout membership through link down and up and leave a fanout while closed regardless of link state. However, socket was forbidden from joining a fanout while it was not RUNNING. This patch allows PACKET socket to join fanout while not RUNNING. Signed-off-by: Gur Stav

[PATCH net-next v02 0/2] net: af_packet: allow joining a fanout when link is down

2024-10-08 Thread Gur Stavi
PACKET socket can retain its fanout membership through link down and up and leave a fanout while closed regardless of link state. However, socket was forbidden from joining a fanout while it was not RUNNING. This patch allows PACKET socket to join a fanout while not RUNNING. Selftest psock_fanout

Re: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware

2024-10-08 Thread kernel test robot
: 9852d85ec9d492ebef56dc5f229416c925758edc patch link: https://lore.kernel.org/r/20241007131620.2090104-8-arnaud.pouliquen%40foss.st.com patch subject: [PATCH v10 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware config: parisc-randconfig-001-20241008 (https://download.01.org/0day-ci

[PATCH V2 1/4] riscv: Remove unused GENERATING_ASM_OFFSETS

2024-10-08 Thread Chunyan Zhang
The macro is not used in the current version of kernel, it looks like can be removed to avoid a build warning: ../arch/riscv/kernel/asm-offsets.c: At top level: ../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros] 7 | #define GENERATING_A

[PATCH V2 2/4] riscv: Remove duplicated GET_RM

2024-10-08 Thread Chunyan Zhang
The macro GET_RM defined twice in this file, one can be removed. Reviewed-by: Alexandre Ghiti Signed-off-by: Chunyan Zhang --- V1: https://lore.kernel.org/lkml/20240909095557.446745-1-zhangchun...@iscas.ac.cn/T/ --- arch/riscv/kernel/traps_misaligned.c | 2 -- 1 file changed, 2 deletions(-) d

[PATCH V2 0/4] A few fixes for RISC-V

2024-10-08 Thread Chunyan Zhang
These patches are all simple fixes with no strong dependency though, I hope that making them a patchset will be more convenient for merge. The patchset are based on v6.12-rc2. Chunyan Zhang (4): riscv: Remove unused GENERATING_ASM_OFFSETS riscv: Remove duplicated GET_RM selftest/mm: Fix typ

[PATCH V2 3/4] selftest/mm: Fix typo in virtual_address_range

2024-10-08 Thread Chunyan Zhang
The function name should be *hint* address, so correct it. Reviewed-by: Charlie Jenkins Signed-off-by: Chunyan Zhang --- V1: https://lore.kernel.org/linux-mm/ZuOuedBpS7i3T%2Fo0@ghost/T/ --- tools/testing/selftests/mm/virtual_address_range.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH V2 4/4] selftests/mm: skip virtual_address_range tests on riscv

2024-10-08 Thread Chunyan Zhang
RISC-V doesn't currently have the behavior of restricting the virtual address space which virtual_address_range tests check, this will cause the tests fail. So lets disable the whole test suite for riscv64 for now, not build it and run_vmtests.sh will skip it if it is not present. Reviewed-by: Cha

[PATCH] selftest: hid: add the missing tests directory

2024-10-08 Thread Yun Lu
Commit 160c826b4dd0 ("selftest: hid: add missing run-hid-tools-tests.sh") has added the run-hid-tools-tests.sh script for it to be installed, but I forgot to add the tests directory together. In fact, the run-hid-tools-tests.sh script uses the scripts in the tests directory to run tests. The tests

Re: [PATCH net-next v8 03/24] ovpn: add basic netlink support

2024-10-08 Thread Antonio Quartulli
On 08/10/2024 10:58, Jiri Pirko wrote: Tue, Oct 08, 2024 at 10:01:40AM CEST, anto...@openvpn.net wrote: Hi, On 07/10/24 17:32, Jiri Pirko wrote: Wed, Oct 02, 2024 at 11:02:17AM CEST, anto...@openvpn.net wrote: [...] +operations: + list: +- + name: dev-new + attribute-set: ov

Re: [PATCH net-next v8 03/24] ovpn: add basic netlink support

2024-10-08 Thread Jiri Pirko
Tue, Oct 08, 2024 at 10:01:40AM CEST, anto...@openvpn.net wrote: >Hi, > >On 07/10/24 17:32, Jiri Pirko wrote: >> Wed, Oct 02, 2024 at 11:02:17AM CEST, anto...@openvpn.net wrote: >> >> [...] >> >> >> > +operations: >> > + list: >> > +- >> > + name: dev-new >> > + attribute-set: ovp

Re: [PATCH 1/1] s390/virtio_ccw: fix dma_parm pointer not set up

2024-10-08 Thread Marc Hartmayer
On Mon, Oct 07, 2024 at 10:10 PM +0200, Halil Pasic wrote: > At least since commit 334304ac2bac ("dma-mapping: don't return errors > from dma_set_max_seg_size") setting up device.dma_parms is basically > mandated by the DMA API. As of now Channel (CCW) I/O in general does not > utilize the DMA API

[PATCH] selftests: net: rds: fix module not found

2024-10-08 Thread Alessandro Zanni
This fix solves this error, when calling kselftest with targets "net/rds": selftests: net/rds: test.py Traceback (most recent call last): File "tools/testing/selftests/net/rds/./test.py", line 17, in from lib.py import ip ModuleNotFoundError: No module named 'lib' Signed-off-by: Alessandro

Re: [PATCH v2 6/8] net: ieee802154: do not leave a dangling sk pointer in ieee802154_create()

2024-10-08 Thread Miquel Raynal
Hi Ignat, ig...@cloudflare.com wrote on Mon, 7 Oct 2024 22:35:00 +0100: > sock_init_data() attaches the allocated sk object to the provided sock > object. If ieee802154_create() fails later, the allocated sk object is > freed, but the dangling pointer remains in the provided sock object, which >

Re: [PATCH net-next v8 03/24] ovpn: add basic netlink support

2024-10-08 Thread Antonio Quartulli
Hi, On 07/10/24 17:32, Jiri Pirko wrote: Wed, Oct 02, 2024 at 11:02:17AM CEST, anto...@openvpn.net wrote: [...] +operations: + list: +- + name: dev-new + attribute-set: ovpn + flags: [ admin-perm ] + doc: Create a new interface of type ovpn + do: +reques

[PATCH 1/1] selftests: livepatch: add test cases of stack_order sysfs interface

2024-10-08 Thread Wardenjohn
Add selftest test cases to sysfs attribute 'stack_order'. Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 71 +++ .../selftests/livepatch/test_modules/Makefile | 5 +- .../test_klp_livepatch_noreplace.c| 53 ++ .../test_klp_l

[PATCH 0/1] selftests: livepatch: add test cases of stack_order sysfs

2024-10-08 Thread Wardenjohn
This patch add self test cases to 'stack_order' sysfs interface. Reuse test module of 'test_klp_livepatch'. However, some module in test_module have '.replace' enable. So, I set the replace value of the stack_order test module to false. Regards. Wardenjohn.

Re: [PATCH net-next v8 01/24] netlink: add NLA_POLICY_MAX_LEN macro

2024-10-08 Thread Antonio Quartulli
On 07/10/24 17:53, Jakub Kicinski wrote: On Mon, 7 Oct 2024 12:04:22 +0200 Antonio Quartulli wrote: Or we could check if len(self.checks) <= 1 early and throw our hands up if there is more, for now? We already perform the same check in the 'else' branch below. It'd be about moving it at the be

Re: [PATCH 1/1] s390/virtio_ccw: fix dma_parm pointer not set up

2024-10-08 Thread Cornelia Huck
On Mon, Oct 07 2024, Halil Pasic wrote: > At least since commit 334304ac2bac ("dma-mapping: don't return errors > from dma_set_max_seg_size") setting up device.dma_parms is basically > mandated by the DMA API. As of now Channel (CCW) I/O in general does not > utilize the DMA API, except for virti

[RESEND PATCH v4] list: test: Check the size of every lists for list_cut_position*()

2024-10-08 Thread I Hsin Cheng
Check the total number of elements in both resultant lists are correct within list_cut_position*(). Previously, only the first list's size was checked. so additional elements in the second list would not have been caught. Signed-off-by: I Hsin Cheng --- change in v4: Amend the description

Re: [RESEND PATCH v4] list: test: Check the size of every lists for list_cut_position*()

2024-10-08 Thread Kuan-Wei Chiu
Hi I Hsin, On Tue, Oct 08, 2024 at 02:51:23PM +0800, I Hsin Cheng wrote: > Check the total number of elements in both resultant lists are correct > within list_cut_position*(). Previously, only the first list's size was > checked. wo additional elements in the second list would not have been > cau

Re: [PATCH v2 5/8] net: af_can: do not leave a dangling sk pointer in can_create()

2024-10-08 Thread Ignat Korchagin
On Tue, Oct 8, 2024 at 3:38 AM Vincent MAILHOL wrote: > > Hi Ignat, > > Thanks for the patch. > > On Tue. 8 Oct. 2024 at 06:37, Ignat Korchagin wrote: > > On error can_create() frees the allocated sk object, but sock_init_data() > > has already attached it to the provided sock object. This will l

[RESEND PATCH v4] list: test: Check the size of every lists for list_cut_position*()

2024-10-08 Thread I Hsin Cheng
Check the total number of elements in both resultant lists are correct within list_cut_position*(). Previously, only the first list's size was checked. wo additional elements in the second list would not have been caught. Signed-off-by: I Hsin Cheng --- change in v4: Amend the description

  1   2   >