Re: [PATCH 1/6] tty: n_gsm: Add support for serdev drivers

2024-12-19 Thread Ivaylo Dimitrov
On 19.12.24 г. 9:53 ч., Jiri Slaby wrote: On 19. 12. 24, 8:45, Ivaylo Dimitrov wrote: Hi, ... On 29.11.20 г. 22:51 ч., Pavel Machek wrote: It looks like you may also have a problem with tty hangups, which serdev does not support currently. There are multiple paths in n_gsm which can tri

[PATCH for-next 2/2] selftests/Makefile: add INSTALL_DEP_TARGETS to run_tests

2024-12-19 Thread Li Zhijian
Similar to the installation process, run_tests out-of-tree requires copying TEST_FILES and TEST_INCLUDES to the OUTPUT directory. The `net/lib` directory is a special case because it is a dependency for `net`. Therefore, it should be processed before `net`. This patch fixes the following error:

[PATCH for-next 0/2] selftests: Fix run_tests and install for net TARGET

2024-12-19 Thread Li Zhijian
This patch set intends to fix the errors in install and run_tests when 'O=' is specified. such as `make O=/path/to/build TARGETS=net kselftest-install` Li Zhijian (2): selftests/Makefile: Create BUILD_TARGET directory for INSTALL_DEP_TARGETS selftests/Makefile: add INSTALL_DEP_TARGETS to

[PATCH for-next 1/2] selftests/Makefile: Create BUILD_TARGET directory for INSTALL_DEP_TARGETS

2024-12-19 Thread Li Zhijian
Similar to 'all' which will create BUILD_TARGET for TARGETS, we should create BUILD_TARGET directory for INSTALL_DEP_TARGETS before generate the binaries. This helps to fix the following error for net target during kselftest-install: $ make O=$build/ kselftest-install TARGETS=net V=1 ... /usr/bin/

[PATCH v7 15/16] samples: rust: add Rust platform sample driver

2024-12-19 Thread Danilo Krummrich
Add a sample Rust platform driver illustrating the usage of the platform bus abstractions. This driver probes through either a match of device / driver name or a match within the OF ID table. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS

[PATCH v7 14/16] rust: platform: add basic platform device / driver abstractions

2024-12-19 Thread Danilo Krummrich
Implement the basic platform bus abstractions required to write a basic platform driver. This includes the following data structures: The `platform::Driver` trait represents the interface to the driver and provides `platform::Driver::probe` for the driver to implement. The `platform::Device` abst

[PATCH v7 16/16] MAINTAINERS: add Danilo to DRIVER CORE

2024-12-19 Thread Danilo Krummrich
Let's keep an eye on the Rust abstractions; add myself as reviewer to DRIVER CORE. Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ed4b293b1baa..15c8df5b3590 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7021,6

[PATCH v7 02/16] rust: implement generic driver registration

2024-12-19 Thread Danilo Krummrich
Implement the generic `Registration` type and the `RegistrationOps` trait. The `Registration` structure is the common type that represents a driver registration and is typically bound to the lifetime of a module. However, it doesn't implement actual calls to the kernel's driver core to register dr

[PATCH v7 01/16] rust: module: add trait `ModuleMetadata`

2024-12-19 Thread Danilo Krummrich
In order to access static metadata of a Rust kernel module, add the `ModuleMetadata` trait. In particular, this trait provides the name of a Rust kernel module as specified by the `module!` macro. Signed-off-by: Danilo Krummrich --- rust/kernel/lib.rs| 6 ++ rust/macros/module.rs | 4 ++

[PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2024-12-19 Thread Danilo Krummrich
I/O memory is typically either mapped through direct calls to ioremap() or subsystem / bus specific ones such as pci_iomap(). Even though subsystem / bus specific functions to map I/O memory are based on ioremap() / iounmap() it is not desirable to re-implement them in Rust. Instead, implement a

[PATCH v7 08/16] rust: add devres abstraction

2024-12-19 Thread Danilo Krummrich
Add a Rust abstraction for the kernel's devres (device resource management) implementation. The Devres type acts as a container to manage the lifetime and accessibility of device bound resources. Therefore it registers a devres callback and revokes access to the resource on invocation. Users of t

[PATCH v7 10/16] rust: pci: implement I/O mappable `pci::Bar`

2024-12-19 Thread Danilo Krummrich
Implement `pci::Bar`, `pci::Device::iomap_region` and `pci::Device::iomap_region_sized` to allow for I/O mappings of PCI BARs. To ensure that a `pci::Bar`, and hence the I/O memory mapping, can't out-live the PCI device, the `pci::Bar` type is always embedded into a `Devres` container, such that t

[PATCH v7 11/16] samples: rust: add Rust PCI sample driver

2024-12-19 Thread Danilo Krummrich
This commit adds a sample Rust PCI driver for QEMU's "pci-testdev" device. To enable this device QEMU has to be called with `-device pci-testdev`. The same driver shows how to use the PCI device / driver abstractions, as well as how to request and map PCI BARs, including a short sequence of MMIO o

[PATCH v7 00/16] Device / Driver PCI / Platform Rust abstractions

2024-12-19 Thread Danilo Krummrich
This patch series implements the necessary Rust abstractions to implement device drivers in Rust. This includes some basic generalizations for driver registration, handling of ID tables, MMIO operations and device resource handling. Those generalizations are used to implement device driver suppor

[PATCH v7 04/16] rust: add rcu abstraction

2024-12-19 Thread Danilo Krummrich
From: Wedson Almeida Filho Add a simple abstraction to guard critical code sections with an rcu read lock. Reviewed-by: Boqun Feng Signed-off-by: Wedson Almeida Filho Co-developed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich --- MAINTAINERS | 1 + rust/helpers/helpers.c

[PATCH v7 06/16] rust: add `Revocable` type

2024-12-19 Thread Danilo Krummrich
From: Wedson Almeida Filho Revocable allows access to objects to be safely revoked at run time. This is useful, for example, for resources allocated during device probe; when the device is removed, the driver should stop accessing the device resources even if another state is kept in memory due

[PATCH v7 05/16] rust: types: add `Opaque::pin_init`

2024-12-19 Thread Danilo Krummrich
Analogous to `Opaque::new` add `Opaque::pin_init`, which instead of a value `T` takes a `PinInit` and returns a `PinInit>`. Reviewed-by: Alice Ryhl Suggested-by: Alice Ryhl Signed-off-by: Danilo Krummrich --- rust/kernel/types.rs | 11 +++ 1 file changed, 11 insertions(+) diff --git a

[PATCH v7 13/16] rust: driver: implement `Adapter`

2024-12-19 Thread Danilo Krummrich
In order to not duplicate code in bus specific implementations (e.g. platform), implement a generic `driver::Adapter` to represent the connection of matched drivers and devices. Bus specific `Adapter` implementations can simply implement this trait to inherit generic functionality, such as matchin

[PATCH v7 09/16] rust: pci: add basic PCI device / driver abstractions

2024-12-19 Thread Danilo Krummrich
Implement the basic PCI abstractions required to write a basic PCI driver. This includes the following data structures: The `pci::Driver` trait represents the interface to the driver and provides `pci::Driver::probe` for the driver to implement. The `pci::Device` abstraction represents a `struct

[PATCH v7 03/16] rust: implement `IdArray`, `IdTable` and `RawDeviceId`

2024-12-19 Thread Danilo Krummrich
Most subsystems use some kind of ID to match devices and drivers. Hence, we have to provide Rust drivers an abstraction to register an ID table for the driver to match. Generally, those IDs are subsystem specific and hence need to be implemented by the corresponding subsystem. However, the `IdArra

[PATCH v7 12/16] rust: of: add `of::DeviceId` abstraction

2024-12-19 Thread Danilo Krummrich
`of::DeviceId` is an abstraction around `struct of_device_id`. This is used by subsequent patches, in particular the platform bus abstractions, to create OF device ID tables. Reviewed-by: Rob Herring (Arm) Signed-off-by: Danilo Krummrich --- MAINTAINERS| 1 + rust/kernel/lib.rs | 1 +

Re: [PATCH net-next v16 06/26] kref/refcount: implement kref_put_sock()

2024-12-19 Thread Will Deacon
On Thu, Dec 19, 2024 at 02:42:00AM +0100, Antonio Quartulli wrote: > Similarly so kref_put_lock(), decrease the refcount > and call bh_lock_sock(sk) if it reached 0. > > This kref_put variant comes handy when in need of > atomically cleanup any socket context along with > setting the refcount to 0

[PATCH v4] vdpa: solidrun: Replace deprecated PCI functions

2024-12-19 Thread Philipp Stanner
From: Philipp Stanner The PCI functions pcim_iomap_regions() pcim_iounmap_regions() pcim_iomap_table() have been deprecated by the PCI subsystem. Replace these functions with their successors pcim_iomap_region() and pcim_iounmap_region(). Signed-off-by: Philipp Stanner

Re: [PATCH v4] vdpa: solidrun: Replace deprecated PCI functions

2024-12-19 Thread Stefano Garzarella
On Thu, Dec 19, 2024 at 10:44:29AM +0100, Philipp Stanner wrote: From: Philipp Stanner The PCI functions pcim_iomap_regions() pcim_iounmap_regions() pcim_iomap_table() have been deprecated by the PCI subsystem. Replace these functions with their successors pcim_iomap_

[PATCH v2 0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc driver

2024-12-19 Thread Beleswar Padhi
This series uses various devm_ helpers to simplify device removal path in ti_k3_r5_remoteproc driver. This is the first series in the TI K3 Remoteproc refactoring as long planned since [0]. Testing Done: 1. Tested boot of R5F remoteprocs in MCU and MAIN voltage domain in both IPC-Only mode and Ker

[PATCH v2 3/5] remoteproc: k3-r5: Use devm_ioremap_wc() helper

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed ioremap helper function. This helps prevent mistakes like unmapping out of order in cleanup functions and forgetting to unmap on all error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 4/5] from v1 to [PATCH v2 3/5] in v2. [Andrew] 2.

[PATCH v2 1/5] remoteproc: k3-r5: Add devm action to release reserved memory

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to release reserved memory. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. None to this patch Link to v1: https://lore.kernel.org/all

[PATCH v2 2/5] remoteproc: k3-r5: Use devm_kcalloc() helper

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to free memory. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. None to this patch Link to v1: https://lore.kernel.org/all/2024120430.22

[PATCH v2 4/5] remoteproc: k3-r5: Use devm_rproc_add() helper

2024-12-19 Thread Beleswar Padhi
Use device lifecycle managed devm_rproc_add() helper function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on all error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 5/5] from v1 to [PATCH v2 4/5] in v2. [Andr

[PATCH v2 5/5] remoteproc: k3-r5: Add devm action to release tsp

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to release tsp ti_sci_proc handle. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 3/5] from v1 to [PATCH v2 5/5] in v

Re: [PATCH v2 0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc driver

2024-12-19 Thread Beleswar Prasad Padhi
On 12/19/2024 8:22 PM, Andrew Davis wrote: On 12/19/24 5:05 AM, Beleswar Padhi wrote: This series uses various devm_ helpers to simplify device removal path in ti_k3_r5_remoteproc driver. This is the first series in the TI K3 Remoteproc refactoring as long planned since [0]. Testing Done: 1.

Re: [PATCH v6 13/16] rust: driver: implement `Adapter`

2024-12-19 Thread Andreas Hindborg
Hi Danilo, Danilo Krummrich writes: > In order to not duplicate code in bus specific implementations (e.g. > platform), implement a generic `driver::Adapter` to represent the > connection of matched drivers and devices. > > Bus specific `Adapter` implementations can simply implement this trait

[PATCH v2] selftests: arm coresight: sysfsmode testing

2024-12-19 Thread Linu Cherian
Add sysfs mode selftest for ARM Coresight hardware tracer. The test will run below sequence for all possible sinks for every trace source available on the system. 1. Enable source and sink device to start tracing in sysfs mode 3. Run a standard dd command to be traced 4. Stop tracing 5. Readback t

Re: [PATCH v3 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest

2024-12-19 Thread Niklas Cassel
On Thu, Dec 19, 2024 at 09:01:12AM +0900, Krzysztof Wilczyński wrote: > Hello, > > > This series carries forward the effort to add Kselftest for PCI Endpoint > > Subsystem started by Aman Gupta [1] a while ago. I reworked the initial > > version > > based on another patch that fixes the return va

[PATCH] sev-snp: parse MP tables for VMware hypervisor

2024-12-19 Thread Ajay Kaher
For VMware hypervisor, SEV-SNP enabled VM's could boot without UEFI. In this case, mpparse_find_mptable() has to be called to parse MP tables which contains boot information. Fixes: 0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests") Signed-off-by: Ajay Kaher Signed-

Re: [PATCH v2 0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc driver

2024-12-19 Thread Andrew Davis
On 12/19/24 5:05 AM, Beleswar Padhi wrote: This series uses various devm_ helpers to simplify device removal path in ti_k3_r5_remoteproc driver. This is the first series in the TI K3 Remoteproc refactoring as long planned since [0]. Testing Done: 1. Tested boot of R5F remoteprocs in MCU and MAIN

Re: [PATCH v6 13/16] rust: driver: implement `Adapter`

2024-12-19 Thread Danilo Krummrich
On Thu, Dec 19, 2024 at 11:53:06AM +0100, Andreas Hindborg wrote: > > Hi Danilo, > > Danilo Krummrich writes: > > > In order to not duplicate code in bus specific implementations (e.g. > > platform), implement a generic `driver::Adapter` to represent the > > connection of matched drivers and de

[PATCH bpf-next/net v2 0/7] bpf: Add mptcp_subflow bpf_iter support

2024-12-19 Thread Matthieu Baerts (NGI0)
Here is a series from Geliang, adding mptcp_subflow bpf_iter support. We are working on extending MPTCP with BPF, e.g. to control the path manager -- in charge of the creation, deletion, and announcements of subflows (paths) -- and the packet scheduler -- in charge of selecting which available pat

[PATCH bpf-next/net v2 3/7] bpf: Register mptcp common kfunc set

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang MPTCP helper mptcp_sk() is used to convert struct sock to mptcp_sock. Helpers mptcp_subflow_ctx() and mptcp_subflow_tcp_sock() are used to convert between struct mptcp_subflow_context and sock. They all will be used in MPTCP BPF programs too. This patch defines corresponding w

[PATCH bpf-next/net v2 6/7] selftests/bpf: More endpoints for endpoint_init

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch changes ADDR_2 from "10.0.1.2" to "10.0.2.1", and adds two more IPv4 test addresses ADDR_3 - ADDR_4, four IPv6 addresses ADDR6_1 - ADDR6_4. Add a new helper address_init() to initialize all these addresses. Add a new parameter "endpoints" for endpoint_init() to cont

[PATCH bpf-next/net v2 7/7] selftests/bpf: Add mptcp_subflow bpf_iter subtest

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a "cgroup/getsockopt" program "iters_subflow" to test the newly added mptcp_subflow bpf_iter. Export mptcp_subflow helpers bpf_iter_mptcp_subflow_new/_next/_destroy, bpf_mptcp_sock_acquire/_release and other helpers into bpf_experimental.h. Use bpf_mptcp_sock_

[PATCH bpf-next/net v2 2/7] bpf: Allow use of skc_to_mptcp_sock in cg_sockopt

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Currently, bpf_skc_to_mptcp_sock() helper is not allowed to be used in cg_sockopt. This patch adds this permission. Thanks to the previous patch allowing skc_to_mptcp_sock() to be used with MPTCP sockets, this permission allows this helper to be use it in CGroup BPF hooks, e.g

[PATCH bpf-next/net v2 1/7] bpf: Extend bpf_skc_to_mptcp_sock to MPTCP sock

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Currently, bpf_skc_to_mptcp_sock() can only be used with sockets that are MPTCP subflows: TCP sockets with tp->is_mptcp, created by the kernel from an MPTCP socket (IPPROTO_MPTCP). Typically used with BPF sock_ops operators. Here, this helper is extended to support MPTCP socke

[PATCH bpf-next/net v2 4/7] bpf: Add mptcp_subflow bpf_iter

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang It's necessary to traverse all subflows on the conn_list of an MPTCP socket and then call kfunc to modify the fields of each subflow. In kernel space, mptcp_for_each_subflow() helper is used for this: mptcp_for_each_subflow(msk, subflow) kfunc(subflow);

[PATCH bpf-next/net v2 5/7] bpf: Acquire and release mptcp socket

2024-12-19 Thread Matthieu Baerts (NGI0)
From: Geliang Tang The KF_TRUSTED_ARGS flag is used for bpf_iter_mptcp_subflow_new, it indicates that the all pointer arguments are valid. It's necessary to add a KF_ACQUIRE helper to get valid "msk". This patch adds bpf_mptcp_sock_acquire() and bpf_mptcp_sock_release() helpers for this. Increas

Re: [PATCH v3 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest

2024-12-19 Thread Krzysztof Wilczyński
Hello, [...] > > Applied to selftests, thank you! > > > > [01/04] PCI: qcom-ep: Mark BAR0/BAR2 as 64bit BARs and BAR1/BAR3 as RESERVED > > https://git.kernel.org/pci/pci/c/71ae1c3a342c > > > > [02/04] misc: pci_endpoint_test: Fix the return value of IOCTL > > https://git.kernel.o

Re: [PATCH 0/3] hrtimer: Fix timers queued locally from offline CPUs

2024-12-19 Thread Paul E. McKenney
On Wed, Dec 18, 2024 at 05:50:05PM +0100, Frederic Weisbecker wrote: > 5c0930ccaad5 ("hrtimers: Push pending hrtimers away from outgoing CPU > earlier") > was introduced to fix stalls with scheduler bandwidth timers getting > migrated while some kthreads handling CPU hotplug rely on bandwidth. >

[PATCH] selftests/mm: Added new test cases to the migration test

2024-12-19 Thread Donet Tom
Added three new test cases to the migration tests: 1. Shared anon THP migration test This test will mmap shared anon memory, madvise it to MADV_HUGEPAGE, then do migration entry testing. One thread will move pages back and forth between nodes whilst other threads try and access them. 2. Private a

Re: [PATCH v5 12/13] media: i2c: imx214: Fix clock handling on probe error or remove

2024-12-19 Thread Ricardo Ribalda Delgado
On Tue, Dec 17, 2024 at 10:40 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > The driver should disable or unprepare the clock on probe error and on > removing the module. > > Remove regulator_bulk_disable(), because it is called by > imx214_power_off(). > > Signed-off-by: Andr

Re: [PATCH] selftests/bpf: Fix compilation error in get_uprobe_offset()

2024-12-19 Thread Daniel Borkmann
On 12/19/24 2:28 AM, Yonghong Song wrote: On 12/18/24 9:57 AM, Jerome Marchand wrote: In get_uprobe_offset(), the call to procmap_query() use the constant PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined. Define PROCMAP_QUERY_VMA_EXECUTABLE when PROCMAP_QUERY isn't. Fixes: 4e

Re: [PATCH] selftests/bpf: Fix compilation error in get_uprobe_offset()

2024-12-19 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf.git (master) by Daniel Borkmann : On Wed, 18 Dec 2024 18:57:24 +0100 you wrote: > In get_uprobe_offset(), the call to procmap_query() use the constant > PROCMAP_QUERY_VMA_EXECUTABLE, even if PROCMAP_QUERY is not defined. > > Define PROCMAP_QUERY_VMA_EXECU

[PATCH v7 00/18] Implement DWARF modversions

2024-12-19 Thread Sami Tolvanen
Hi, Here's v7 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

[PATCH v7 01/18] tools: Add gendwarfksyms

2024-12-19 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 Reviewed-by: Petr Pavlu

[PATCH v7 02/18] gendwarfksyms: Add address matching

2024-12-19 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 v7 03/18] gendwarfksyms: Expand base_type

2024-12-19 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 v7 04/18] gendwarfksyms: Add a cache for processed DIEs

2024-12-19 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 Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c

[PATCH v7 06/18] gendwarfksyms: Expand subroutine_type

2024-12-19 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 v7 05/18] gendwarfksyms: Expand type modifiers and typedefs

2024-12-19 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 v7 07/18] gendwarfksyms: Expand array_type

2024-12-19 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 v7 08/18] gendwarfksyms: Expand structure types

2024-12-19 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 v7 11/18] gendwarfksyms: Add symtypes output

2024-12-19 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 v7 09/18] gendwarfksyms: Limit structure expansion

2024-12-19 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, and it's sufficient for catching ABI changes. Types defined in .c files are opaque to external users and thus cannot affect the AB

[PATCH v7 10/18] gendwarfksyms: Add die_map debugging

2024-12-19 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 Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dw

[PATCH v7 12/18] gendwarfksyms: Add symbol versioning

2024-12-19 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 Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 2 +- scripts/gendwarfksyms/dwarf.c | 25 +- scrip

[PATCH v7 13/18] gendwarfksyms: Add support for kABI rules

2024-12-19 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 v7 15/18] gendwarfksyms: Add support for symbol type pointers

2024-12-19 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 v7 14/18] gendwarfksyms: Add support for reserved and ignored fields

2024-12-19 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 v7 16/18] export: Add __gendwarfksyms_ptr_ references to exported symbols

2024-12-19 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 v7 17/18] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-12-19 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen --- kernel/module/Kconfig | 22 ++ scripts/Makefile | 2 +- scripts/Makefile.build | 35 +-- 3 files

[PATCH v7 18/18] Documentation/kbuild: Add DWARF module versioning

2024-12-19 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 --- Documentation/kbuild/gendwarfksyms.rst | 308 + Documentation/kbuild/index.

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Eduard Zingerman
On Thu, 2024-12-19 at 14:41 -0700, Daniel Xu wrote: [...] > > > I think that if test operates on a key like: > > > > > > valid key 15 > > > v > > > 000f <-- written to stack as a single u64 value > > > ^^^ > > > stack zero marks > > > > > > and is ex

[RFC PATCH 0/2] ptp: add PTP_SYS_OFFSET_STAT ioctl, support it in virtio_rtc

2024-12-19 Thread Peter Hilber
This RFC patch series proposes a new ioctl PTP_SYS_OFFSET_STAT and adds support for it in the proposed virtio_rtc driver [1]. The new PTP_SYS_OFFSET_STAT ioctl provides a cross-timestamp like PTP_SYS_OFFSET_PRECISE2, plus any the following status information (for now): - for UTC timescale clocks:

[RFC PATCH 1/2] ptp: add PTP_SYS_OFFSET_STAT for xtstamping with status

2024-12-19 Thread Peter Hilber
Ioctl PTP_SYS_OFFSET_PRECISE2 provides cross-timestamping of device time and system time. This can be used for virtualization where (virtualization) host and guest refer to the same clocksource. It may be preferred to indicate UTC time, rather than TAI. It is then useful to indicate when and how th

[RFC PATCH 2/2] virtio_rtc: Support PTP_SYS_OFFSET_STAT ioctl

2024-12-19 Thread Peter Hilber
Support the new PTP_SYS_OFFSET_STAT ioctl. The virtio-rtc cross-timestamp status information is aligned with the PTP_SYS_OFFSET_STAT output, so the conversion is trivial. Drop the getcrosststamp op implementation, for which the PTP clock core will insert a getstattstamp wrapper. Signed-off-by: Pe

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Daniel Xu
On Mon, Dec 16, 2024 at 03:24:01PM -0800, Andrii Nakryiko wrote: > On Fri, Dec 13, 2024 at 7:13 PM Eduard Zingerman wrote: > > > > On Fri, 2024-12-13 at 19:44 -0700, Daniel Xu wrote: > > > > [...] > > > > > > > + /* First handle precisely tracked STACK_ZERO, up to > > > > > BPF_REG_SIZE */

Re: [PATCH v5 1/2] virt: pvmemcontrol: control guest physical memory properties

2024-12-19 Thread Yuanchu Xie
On Mon, Dec 2, 2024 at 4:24 PM Yuanchu Xie wrote: > > Pvmemcontrol provides a way for the guest to control its physical memory > properties and enables optimizations and security features. For example, > the guest can provide information to the host where parts of a hugepage > may be unbacked, or

Re: [PATCH 1/3] hrtimers: Force migrate away hrtimers queued after CPUHP_AP_HRTIMERS_DYING

2024-12-19 Thread Usama Arif
On 18/12/2024 19:50, Frederic Weisbecker wrote: > hrtimers are migrated away from the dying CPU to any online target at > the CPUHP_AP_HRTIMERS_DYING stage in order not to delay bandwidth timers > handling tasks involved in the CPU hotplug forward progress. > > However wake ups can still be per

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2024-12-19 Thread Reinette Chatre
Hi Shuah, On 12/16/24 7:18 AM, Maciej Wieczor-Retman wrote: > > Sub-Numa Clustering (SNC) allows splitting CPU cores, caches and memory > into multiple NUMA nodes. When enabled, NUMA-aware applications can > achieve better performance on bigger server platforms. > > SNC support was merged into t

[RFC PATCH v4 3/4] virtio_rtc: Add Arm Generic Timer cross-timestamping

2024-12-19 Thread Peter Hilber
Add PTP_SYS_OFFSET_PRECISE2 support on platforms using the Arm Generic Timer. Always report the CP15 virtual counter as the HW counter in use by arm_arch_timer, since the Linux kernel's usage of the Arm Generic Timer should always be compatible with this. Signed-off-by: Peter Hilber --- Notes:

Re: [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-19 Thread Charlie Jenkins
On Tue, Dec 03, 2024 at 01:55:07PM +0100, Andrew Jones wrote: > On Tue, Dec 03, 2024 at 05:30:05PM +0800, Celeste Liu wrote: > > From: Charlie Jenkins > > > > This test checks that orig_a0 allows a syscall argument to be modified, > > and that changing a0 does not change the syscall argument. > >

[PATCH v2 1/2] KVM: VMX: refactor PML terminology

2024-12-19 Thread Maxim Levitsky
Rename PML_ENTITY_NUM to PML_LOG_NR_ENTRIES Add PML_HEAD_INDEX to specify the first entry that CPU writes. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Maxim Levitsky --- arch/x86/kvm/vmx/main.c | 2 +- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/v

[PATCH v2 0/2] KVM: x86: read the PML log in the same order it was written

2024-12-19 Thread Maxim Levitsky
Reverse the order in which the PML log is read to align more closely to the hardware. It should not affect regular users of the dirty logging but it fixes a unit test specific assumption in the dirty_log_test dirty-ring mode. Best regards, Maxim Levitsky Maxim Levitsky (2): KVM: VMX: ref

[PATCH v2 2/2] KVM: VMX: read the PML log in the same order as it was written

2024-12-19 Thread Maxim Levitsky
Intel's PRM specifies that the CPU writes to the PML log 'backwards' or in other words, it first writes entry 511, then entry 510 and so on. I also confirmed on the bare metal that the CPU indeed writes the entries in this order. KVM on the other hand, reads the entries in the opposite order, fro

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Eduard Zingerman
On Thu, 2024-12-19 at 17:40 -0700, Daniel Xu wrote: [...] > > Ok, thinking a bit more, the best test I can come up with is: > > > > u8 vals[8]; > > vals[0] = 0; > > ... > > vals[6] = 0; > > vals[7] = 0xf; > > p = bpf_map_lookup_elem(... vals ...); > > *p = 42; > > > > For LE vals

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Alexei Starovoitov
On Thu, Dec 19, 2024 at 4:43 PM Eduard Zingerman wrote: > > On Thu, 2024-12-19 at 17:40 -0700, Daniel Xu wrote: > > [...] > > > > Ok, thinking a bit more, the best test I can come up with is: > > > > > > u8 vals[8]; > > > vals[0] = 0; > > > ... > > > vals[6] = 0; > > > vals[7] = 0xf; > >

Re: [PATCH v5 1/2] virt: pvmemcontrol: control guest physical memory properties

2024-12-19 Thread Greg Kroah-Hartman
On Thu, Dec 19, 2024 at 10:58:24AM -0800, Yuanchu Xie wrote: > On Mon, Dec 2, 2024 at 4:24 PM Yuanchu Xie wrote: > > > > Pvmemcontrol provides a way for the guest to control its physical memory > > properties and enables optimizations and security features. For example, > > the guest can provide i

Re: [PATCH v7 00/16] Device / Driver PCI / Platform Rust abstractions

2024-12-19 Thread Dirk Behme
On 19.12.24 18:04, Danilo Krummrich wrote: > This patch series implements the necessary Rust abstractions to implement > device drivers in Rust. > > This includes some basic generalizations for driver registration, handling of > ID > tables, MMIO operations and device resource handling. > > Thos

[RFC PATCH v4 1/4] virtio_rtc: Add module and driver core

2024-12-19 Thread Peter Hilber
Add the virtio_rtc module and driver core. The virtio_rtc module implements a driver compatible with the proposed Virtio RTC device specification. The Virtio RTC (Real Time Clock) device provides information about current time. The device can provide different clocks, e.g. for the UTC or TAI time s

[RFC PATCH v4 0/4] Add virtio_rtc module

2024-12-19 Thread Peter Hilber
This series implements a driver for a virtio-rtc device conforming to spec RFC v6 [1]. It includes a PTP clock driver and an RTC class driver with alarm. RFC v4 updates == Important changes compared to the previous driver series [3] are: - Update to spec RFC v6 [1]. - Distinguish UT

[RFC PATCH v4 2/4] virtio_rtc: Add PTP clocks

2024-12-19 Thread Peter Hilber
Expose the virtio_rtc clocks as PTP clocks to userspace, similar to ptp_kvm. virtio_rtc can expose multiple clocks, e.g. a UTC clock and a monotonic clock. Userspace should distinguish different clocks through the name assigned by the driver. In particular, UTC-like clocks can also be distinguishe

[RFC PATCH v4 4/4] virtio_rtc: Add RTC class driver

2024-12-19 Thread Peter Hilber
Expose the virtio-rtc UTC-like clock as an RTC clock to userspace - if it is present, and if it does not step on leap seconds. The RTC class enables the virtio-rtc device to resume the system from sleep states on RTC alarm. Support RTC alarm if the virtio-rtc alarm feature is present. The virtio-r

Re: [PATCH v5 07/13] media: i2c: imx214: Add vblank and hblank controls

2024-12-19 Thread Ricardo Ribalda Delgado
On Tue, Dec 17, 2024 at 10:39 PM André Apitzsch via B4 Relay wrote: > > From: André Apitzsch > > Add vblank control to allow changing the framerate / > higher exposure values. > > The vblank and hblank controls are needed for libcamera support. > > While at it, fix the minimal exposure time accor

Re: [PATCH v3 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest

2024-12-19 Thread Niklas Cassel
On Fri, Dec 20, 2024 at 12:55:04AM +0900, Krzysztof Wilczyński wrote: [...] > > Mani suggested that my patch (which conflicts with this), > > should be picked up first. > > > > Is there a reason for the sudden chance of plans? > > No, no change to the plan here. > > There were some mixed signa

Re: [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-19 Thread Celeste Liu
On 2024-12-20 02:26, Charlie Jenkins wrote: > On Tue, Dec 03, 2024 at 01:55:07PM +0100, Andrew Jones wrote: >> On Tue, Dec 03, 2024 at 05:30:05PM +0800, Celeste Liu wrote: >>> From: Charlie Jenkins >>> >>> This test checks that orig_a0 allows a syscall argument to be modified, >>> and that chang

Re: [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification

2024-12-19 Thread Charlie Jenkins
On Fri, Dec 20, 2024 at 05:29:45AM +0800, Celeste Liu wrote: > > On 2024-12-20 02:26, Charlie Jenkins wrote: > > On Tue, Dec 03, 2024 at 01:55:07PM +0100, Andrew Jones wrote: > >> On Tue, Dec 03, 2024 at 05:30:05PM +0800, Celeste Liu wrote: > >>> From: Charlie Jenkins > >>> > >>> This test checks

Re: [PATCH v3 0/7] Enhance event delivery error handling

2024-12-19 Thread Ivan Orlov
On Wed, Dec 18, 2024 at 06:40:46PM -0800, Sean Christopherson wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you can confirm the sender and know the > content is safe. > > > > On Tue, 17 Dec 2024 18:14:51 +, Ivan Or

Re: [PATCH] selftests/mm: Added new test cases to the migration test

2024-12-19 Thread Dev Jain
On 19/12/24 3:57 pm, Donet Tom wrote: Added three new test cases to the migration tests: 1. Shared anon THP migration test This test will mmap shared anon memory, madvise it to MADV_HUGEPAGE, then do migration entry testing. One thread will move pages back and forth between nodes whilst other

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Daniel Xu
On Thu, Dec 19, 2024 at 04:04:43PM -0800, Eduard Zingerman wrote: > On Thu, 2024-12-19 at 14:41 -0700, Daniel Xu wrote: > > [...] > > > > > I think that if test operates on a key like: > > > > > > > > valid key 15 > > > > v > > > > 000f <-- written to stack as a si

Re: [PATCH bpf-next v5 4/5] bpf: verifier: Support eliding map lookup nullness

2024-12-19 Thread Daniel Xu
On Thu, Dec 19, 2024 at 04:49:13PM -0800, Alexei Starovoitov wrote: > On Thu, Dec 19, 2024 at 4:43 PM Eduard Zingerman wrote: > > > > On Thu, 2024-12-19 at 17:40 -0700, Daniel Xu wrote: > > > > [...] > > > > > > Ok, thinking a bit more, the best test I can come up with is: > > > > > > > > u8 val

Re: [PATCH net-next v16 26/26] testing/selftests: add test tool and scripts for ovpn module

2024-12-19 Thread Jakub Kicinski
On Thu, 19 Dec 2024 02:42:20 +0100 Antonio Quartulli wrote: > +uint64_t nla_get_uint(struct nlattr *attr) > +{ > + if (nla_len(attr) == sizeof(uint32_t)) > + return nla_get_u32(attr); > + else > + return nla_get_u64(attr); > +} Fedora 41 has: libnl3 3.11.0 which alr

  1   2   >