Re: [RFC 00/19] Kernel API Specification Framework

2025-06-30 Thread Sasha Levin
ha Levin wrote: >> > >> > On Wed, Jun 25, 2025 at 10:52:46AM +0200, Dmitry Vyukov wrote: >> > >On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: >> > > >> > >> >6. What's the goal of validation of the input arguments? >> > >>

[PATCH 4/5] kernel/sys.c: Move overflow{uid,gid} sysctl into kernel/sys.c

2025-06-27 Thread Joel Granados
Moved ctl_tables elements for overflowuid and overflowgid into in kernel/sys.c. Create a register function that keeps them under "kernel" and run it after core with postcore_initcall. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-26 Thread Dmitry Vyukov
> On Wed, Jun 25, 2025 at 10:52:46AM +0200, Dmitry Vyukov wrote: > >> > >On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: > >> > > > >> > >> >6. What's the goal of validation of the input arguments? > >> > >> >Kernel code

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-26 Thread Sasha Levin
Levin wrote: > > > >> >6. What's the goal of validation of the input arguments? > >> >Kernel code must do this validation anyway, right. > >> >Any non-trivial validation is hard, e.g. even for open the validation function > >> >for file name wou

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-26 Thread Dmitry Vyukov
; >6. What's the goal of validation of the input arguments? > > >> >Kernel code must do this validation anyway, right. > > >> >Any non-trivial validation is hard, e.g. even for open the validation > > >> >function > > >> >for file name w

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-26 Thread Dmitry Vyukov
On Wed, 25 Jun 2025 at 17:55, Sasha Levin wrote: > > On Wed, Jun 25, 2025 at 10:52:46AM +0200, Dmitry Vyukov wrote: > >On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: > > > >> >6. What's the goal of validation of the input arguments? > >> >Ke

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Sasha Levin
On Wed, Jun 25, 2025 at 10:56:04AM +0200, Dmitry Vyukov wrote: On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: >9. I see that syscalls and ioctls say: >KAPI_CONTEXT(KAPI_CTX_PROCESS | KAPI_CTX_SLEEPABLE) >Can't we make this implicit? Are there any other options? Maybe? I wasn't sure how we'd

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Dmitry Vyukov
On Tue, 24 Jun 2025 at 16:05, Cyril Hrubis wrote: > > Hi! > > 6. What's the goal of validation of the input arguments? > > Kernel code must do this validation anyway, right. > > Any non-trivial validation is hard, e.g. even for open the validation > > funct

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Dmitry Vyukov
On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: > >9. I see that syscalls and ioctls say: > >KAPI_CONTEXT(KAPI_CTX_PROCESS | KAPI_CTX_SLEEPABLE) > >Can't we make this implicit? Are there any other options? > > Maybe? I wasn't sure how we'd describe somthing like getpid() which > isn't supposed to

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Cyril Hrubis
Hi! > > >6. What's the goal of validation of the input arguments? > > >Kernel code must do this validation anyway, right. > > >Any non-trivial validation is hard, e.g. even for open the validation > > >function > > >for file name would ne

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Sasha Levin
On Wed, Jun 25, 2025 at 10:52:46AM +0200, Dmitry Vyukov wrote: On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: >6. What's the goal of validation of the input arguments? >Kernel code must do this validation anyway, right. >Any non-trivial validation is hard, e.g. even for open

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Dmitry Vyukov
On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: > >3. To reduce duplication we could use more type information, e.g. I was > >always > >frustrated that close is just: > > > >SYSCALL_DEFINE1(close, unsigned int, fd) > > > >whereas if we would do: > > > >typedef int fd_t; > >SYSCALL_DEFINE1(close

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-25 Thread Dmitry Vyukov
On Tue, 24 Jun 2025 at 22:04, Sasha Levin wrote: > >6. What's the goal of validation of the input arguments? > >Kernel code must do this validation anyway, right. > >Any non-trivial validation is hard, e.g. even for open the validation > >function > >for fil

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-24 Thread Sasha Levin
atically: https://raw.githubusercontent.com/google/syzkaller/refs/heads/master/sys/linux/auto.txt Though, oviously that won't have user-readable string descriptions, can't be used as a source of truth, and may be challenging to integrate into kernel build process. Though, extracting some o

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-24 Thread Cyril Hrubis
Hi! > 6. What's the goal of validation of the input arguments? > Kernel code must do this validation anyway, right. > Any non-trivial validation is hard, e.g. even for open the validation function > for file name would need to have access to flags and check file precense

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-24 Thread Cyril Hrubis
about parameter > types and their semantic meaning, not the validation part. > The conformance tests should test that actual syscall checking of > arguments, not the validation added by this framework. Exactly. I do not think that it makes sense to encode the argument ranges and functions to

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-23 Thread Dmitry Vyukov
eads/master/sys/linux/auto.txt Though, oviously that won't have user-readable string descriptions, can't be used as a source of truth, and may be challenging to integrate into kernel build process. Though, extracting some of that info automatically may be nice. 2. Does this framework

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-18 Thread Sasha Levin
On Wed, Jun 18, 2025 at 02:29:37PM -0700, Kees Cook wrote: On Sat, Jun 14, 2025 at 09:48:39AM -0400, Sasha Levin wrote: This patch series introduces a framework for formally specifying kernel APIs, addressing the long-standing challenge of maintaining stable interfaces between the kernel and

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-18 Thread Kees Cook
On Sat, Jun 14, 2025 at 09:48:39AM -0400, Sasha Levin wrote: > This patch series introduces a framework for formally specifying kernel > APIs, addressing the long-standing challenge of maintaining stable > interfaces between the kernel and user-space programs. As outlined in > previous

Re: [RFC 00/19] Kernel API Specification Framework

2025-06-17 Thread David Laight
On Sat, 14 Jun 2025 09:48:39 -0400 Sasha Levin wrote: > This patch series introduces a framework for formally specifying kernel > APIs, addressing the long-standing challenge of maintaining stable > interfaces between the kernel and user-space programs. As outlined in > previous

[RFC 19/19] tools/kapi: Add kernel API specification extraction tool

2025-06-14 Thread Sasha Levin
The kapi tool extracts and displays kernel API specifications. Signed-off-by: Sasha Levin --- Documentation/admin-guide/kernel-api-spec.rst | 198 ++- tools/kapi/.gitignore | 4 + tools/kapi/Cargo.toml | 19 + tools/kapi/src/extractor

[RFC 16/19] kernel/api: add IOCTL specification infrastructure

2025-06-14 Thread Sasha Levin
Add IOCTL API specification support to the kernel API specification framework. This enables detailed documentation and runtime validation of IOCTL interfaces. Key features: - IOCTL specification structure with command info and parameter details - Registration/unregistration functions for IOCTL

[RFC 15/19] kernel/api: add debugfs interface for kernel API specifications

2025-06-14 Thread Sasha Levin
Add a debugfs interface to expose kernel API specifications at runtime. This allows tools and users to query the complete API specifications through the debugfs filesystem. The interface provides: - /sys/kernel/debug/kapi/list - lists all available API specifications - /sys/kernel/debug/kapi

[RFC 00/19] Kernel API Specification Framework

2025-06-14 Thread Sasha Levin
This patch series introduces a framework for formally specifying kernel APIs, addressing the long-standing challenge of maintaining stable interfaces between the kernel and user-space programs. As outlined in previous discussions about kernel ABI stability, the lack of machine-readable API

[RFC 01/19] kernel/api: introduce kernel API specification framework

2025-06-14 Thread Sasha Levin
Add a comprehensive framework for formally documenting kernel APIs with inline specifications. This framework provides: - Structured API documentation with parameter specifications, return values, error conditions, and execution context requirements - Runtime validation capabilities for

Re: [PATCH v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-12 Thread David Hildenbrand
On 05.06.25 15:51, Lorenzo Stoakes wrote: The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for

Re: [PATCH v2 2/2] Documentation/kernel-parameters: Update rcu_normal_wake_from_gp doc

2025-06-12 Thread Uladzislau Rezki
On Wed, Jun 11, 2025 at 05:49:14PM -0400, Joel Fernandes wrote: > > > On 6/11/2025 1:56 PM, Uladzislau Rezki (Sony) wrote: > > Update the documentation about rcu_normal_wake_from_gp parameter. > > > > Signed-off-by: Uladzislau Rezki (Sony) > > Reviewed-by: Joel Fernandes > Thanks! -- Uladzi

Re: [PATCH v2 2/2] Documentation/kernel-parameters: Update rcu_normal_wake_from_gp doc

2025-06-11 Thread Joel Fernandes
On 6/11/2025 1:56 PM, Uladzislau Rezki (Sony) wrote: > Update the documentation about rcu_normal_wake_from_gp parameter. > > Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Joel Fernandes Thanks. > --- > Documentation/admin-guide/kernel-parameters.txt | 3 ++- >

[PATCH v2 2/2] Documentation/kernel-parameters: Update rcu_normal_wake_from_gp doc

2025-06-11 Thread Uladzislau Rezki (Sony)
Update the documentation about rcu_normal_wake_from_gp parameter. Signed-off-by: Uladzislau Rezki (Sony) --- Documentation/admin-guide/kernel-parameters.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation

[PATCH 3/3] Documentation/kernel-parameters: Update rcu_normal_wake_from_gp doc

2025-06-10 Thread Uladzislau Rezki (Sony)
Update the documentation about rcu_normal_wake_from_gp parameter. Signed-off-by: Uladzislau Rezki (Sony) --- Documentation/admin-guide/kernel-parameters.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-06 Thread Lorenzo Stoakes
vma() function is rather confusing - it supports > > >> two > > >> modes, one used often, the other used only for debugging. > > >> > > >> The first mode is the common case of traversal of kernel page tables, > > >> which > > >>

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-06 Thread Jann Horn
ed often, the other used only for debugging. > >> > >> The first mode is the common case of traversal of kernel page tables, which > >> is what nearly all callers use this for. > >> > >> Secondly it provides an unusual debugging interface that allows for the &g

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread David Hildenbrand
On 05.06.25 21:19, Jann Horn wrote: On Wed, Jun 4, 2025 at 4:21 PM Lorenzo Stoakes wrote: The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Jann Horn
On Wed, Jun 4, 2025 at 4:21 PM Lorenzo Stoakes wrote: > The walk_page_range_novma() function is rather confusing - it supports two > modes, one used often, the other used only for debugging. > > The first mode is the common case of traversal of kernel page tables, which > is

Re: [PATCH v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Vlastimil Babka
On 6/5/25 15:51, Lorenzo Stoakes wrote: > The walk_page_range_novma() function is rather confusing - it supports two > modes, one used often, the other used only for debugging. > > The first mode is the common case of traversal of kernel page tables, which > is what nearly all c

[PATCH v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Lorenzo Stoakes
The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for. Secondly it provides an unusual debugging

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Muchun Song
200, Vlastimil Babka wrote: >>>> On 6/4/25 16:19, Lorenzo Stoakes wrote: >>>>> The walk_page_range_novma() function is rather confusing - it supports two >>>>> modes, one used often, the other used only for debugging. >>>>> >>>>>

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Lorenzo Stoakes
> The walk_page_range_novma() function is rather confusing - it supports two > >>> modes, one used often, the other used only for debugging. > >>> > >>> The first mode is the common case of traversal of kernel page tables, > >>> which > >>>

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Lorenzo Stoakes
mode is the common case of traversal of kernel page tables, which > > is what nearly all callers use this for. > > > > Secondly it provides an unusual debugging interface that allows for the > > traversal of page tables in a userland range of memory even for that memory >

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Muchun Song
ed often, the other used only for debugging. >>> >>> The first mode is the common case of traversal of kernel page tables, which >>> is what nearly all callers use this for. >>> >>> Secondly it provides an unusual debugging interface that allows fo

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Lorenzo Stoakes
mode is the common case of traversal of kernel page tables, which > > is what nearly all callers use this for. > > > > Secondly it provides an unusual debugging interface that allows for the > > traversal of page tables in a userland range of memory even for that memory > >

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread Vlastimil Babka
On 6/4/25 16:19, Lorenzo Stoakes wrote: > The walk_page_range_novma() function is rather confusing - it supports two > modes, one used often, the other used only for debugging. > > The first mode is the common case of traversal of kernel page tables, which > is what nearly all c

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-05 Thread David Hildenbrand
On 04.06.25 16:19, Lorenzo Stoakes wrote: The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Qi Zheng
On 6/4/25 10:19 PM, Lorenzo Stoakes wrote: The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Oscar Salvador
On Wed, Jun 04, 2025 at 03:19:58PM +0100, Lorenzo Stoakes wrote: > The walk_page_range_novma() function is rather confusing - it supports two > modes, one used often, the other used only for debugging. > > The first mode is the common case of traversal of kernel page tables, whi

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread David Hildenbrand
On 03.06.25 21:22, Lorenzo Stoakes wrote: The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for

Re: [PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Suren Baghdasaryan
On Wed, Jun 4, 2025 at 7:21 AM Lorenzo Stoakes wrote: > > The walk_page_range_novma() function is rather confusing - it supports two > modes, one used often, the other used only for debugging. > > The first mode is the common case of traversal of kernel page tables, which >

[PATCH v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Lorenzo Stoakes
The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for. Secondly it provides an unusual debugging

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Lorenzo Stoakes
On Wed, Jun 04, 2025 at 02:26:57PM +0200, Oscar Salvador wrote: > On Wed, Jun 04, 2025 at 10:09:05AM +0100, Lorenzo Stoakes wrote: > > Nice idea to move to mm/internal.h also :) I like this... > > > > Will fixup on respin > > Dumb question but IIUC, walk_page_range_novma() will only be used by > pt

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Oscar Salvador
On Wed, Jun 04, 2025 at 10:09:05AM +0100, Lorenzo Stoakes wrote: > Nice idea to move to mm/internal.h also :) I like this... > > Will fixup on respin Dumb question but IIUC, walk_page_range_novma() will only be used by ptdump from now on, so why not stick it into mm/ptdump.c, which is where the o

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Lorenzo Stoakes
mode is the common case of traversal of kernel page tables, which > > is what nearly all callers use this for. > > ... and what people should be using it for 🙂 :) Yeah the whole intent of this patch is to detach the 'crazy debug' bit from the 'used by arches all over

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Lorenzo Stoakes
, one used often, the other used only for debugging. > > > > > > The first mode is the common case of traversal of kernel page tables, > > > which > > > is what nearly all callers use this for. > > > > ... and what people should be using it for 🙂 >

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread David Hildenbrand
mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for. ... and what people should be using it for 🙂 Secondly it provides an unusual debugging interface that allows for the traversal of page tables in a userland range of memory even for that

Re: [PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-04 Thread Mike Rapoport
mode is the common case of traversal of kernel page tables, which > > is what nearly all callers use this for. > > ... and what people should be using it for 🙂 > > > > > Secondly it provides an unusual debugging interface that allows for the > > traversal of pa

[PATCH RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts

2025-06-03 Thread Lorenzo Stoakes
The walk_page_range_novma() function is rather confusing - it supports two modes, one used often, the other used only for debugging. The first mode is the common case of traversal of kernel page tables, which is what nearly all callers use this for. Secondly it provides an unusual debugging

Re: vmlinux BTF as a module (was Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux)

2025-05-23 Thread Andrii Nakryiko
On Thu, May 22, 2025 at 6:04 PM Alexei Starovoitov wrote: > > On Wed, May 21, 2025 at 8:00 AM Alan Maguire wrote: > > > > > Hi Alan, > > > > > > Thanks for taking a look at this. I've been following your related effort > > > to allow /s

Re: [PATCH bpf-next v5 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-23 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko : On Tue, 20 May 2025 14:01:16 +0100 you wrote: > I'd like to cut down the memory usage of parsing vmlinux BTF in ebpf-go. > With some upcoming changes the library is sitting at 5MiB for a parse. > Most of that memory

Re: vmlinux BTF as a module (was Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux)

2025-05-22 Thread Alexei Starovoitov
On Wed, May 21, 2025 at 8:00 AM Alan Maguire wrote: > > > Hi Alan, > > > > Thanks for taking a look at this. I've been following your related effort > > to allow /sys/kernel/btf/vmlinux as a module in support of small systems > > with kernel-size constrain

vmlinux BTF as a module (was Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux)

2025-05-21 Thread Alan Maguire
> Hi Alan, > > Thanks for taking a look at this. I've been following your related effort > to allow /sys/kernel/btf/vmlinux as a module in support of small systems > with kernel-size constraints, and wondered how this series might affect > that work? Such support would

Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-20 Thread Tony Ambardar
h64; all worked perfectly. Thanks! Hi Alan, Thanks for taking a look at this. I've been following your related effort to allow /sys/kernel/btf/vmlinux as a module in support of small systems with kernel-size constraints, and wondered how this series might affect that work? Such support would

[PATCH bpf-next v5 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-20 Thread Lorenz Bauer
| 3 +- kernel/bpf/sysfs_btf.c | 32 tools/lib/bpf/btf.c| 89 +- tools/testing/selftests/bpf/prog_tests/btf_sysfs.c | 81 4 files changed, 186 insertions(+), 19 deletions(-) --- base-c

[PATCH v2 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-16 Thread Zi Yan
When running hugevm tests in a machine without kernel config present, e.g., a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*, skip hugevm tests, which reads kernel config to get page table level information. Signed-off-by: Zi Yan Acked-by: Lorenzo Stoakes --- .../selftests

[PATCH v2 0/2] Skip mm selftests instead when kernel features are not present

2025-05-16 Thread Zi Yan
Two guard_regions tests on userfaultfd fail when userfaultfd is not present. Skip them instead. hugevm test reads kernel config to get page table level information and fails when neither /proc/config.gz nor /boot/config-* is present. Skip it instead. Zi Yan (2): selftests/mm: skip

Re: [PATCH 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-15 Thread Pedro Falcato
On Thu, May 15, 2025 at 07:43:40PM +0100, Lorenzo Stoakes wrote: > On Thu, May 15, 2025 at 02:23:33PM -0400, Zi Yan wrote: > > When running hugevm tests in a machine without kernel config present, e.g., > > a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*,

Re: [PATCH 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-15 Thread Lorenzo Stoakes
On Thu, May 15, 2025 at 02:23:33PM -0400, Zi Yan wrote: > When running hugevm tests in a machine without kernel config present, e.g., > a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*, > skip hugevm tests, which reads kernel config to get page table level >

[PATCH 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-15 Thread Zi Yan
When running hugevm tests in a machine without kernel config present, e.g., a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*, skip hugevm tests, which reads kernel config to get page table level information. Signed-off-by: Zi Yan --- .../selftests/mm/va_high_addr_switch.sh

Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-15 Thread Alan Maguire
> I'd like to cut down the memory usage of parsing vmlinux BTF in ebpf-go. > With some upcoming changes the library is sitting at 5MiB for a parse. > Most of that memory is simply copying the BTF blob into user space. > By allowing vmlinux BTF to be mmapped read-only into user space I can > cut mem

Re: [PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-13 Thread Joel Granados
On Fri, May 09, 2025 at 12:01:24PM -0700, Kees Cook wrote: > On Fri, May 09, 2025 at 02:54:13PM +0200, Joel Granados wrote: > > Move cad_pid as well as supporting function proc_do_cad_pid into > > kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec > > inside

[PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-10 Thread Lorenz Bauer
t for mmapable vmlinux BTF libbpf: Use mmap to parse vmlinux BTF from sysfs include/asm-generic/vmlinux.lds.h | 3 +- kernel/bpf/sysfs_btf.c | 32 tools/lib/bpf/btf.c| 85 ++ tools/te

Re: [PATCH 06/12] fork: mv threads-max into kernel/fork.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:10PM +0200, Joel Granados wrote: > make sysctl_max_threads static as it no longer needs to be exported into > sysctl.c. > > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the merge confli

Re: [PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:13PM +0200, Joel Granados wrote: > Move cad_pid as well as supporting function proc_do_cad_pid into > kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec > inside proc_do_cad_pid which requires the copy of the ctl_table to > handle th

Re: [PATCH 08/12] sysctl: Move tainted ctl_table into kernel/panic.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:12PM +0200, Joel Granados wrote: > Move the ctl_table with the "tainted" proc_name into kernel/panic.c. > With it moves the proc_tainted helper function. > > This is part of a greater effort to move ctl tables into their > respective subsyst

Re: [PATCH 12/12] sysctl: Remove superfluous includes from kernel/sysctl.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:16PM +0200, Joel Granados wrote: > Remove the following headers from the include list in sysctl.c. > > * These are removed as the related variables are no longer there. > === > Include Related Var > ==

Re: [PATCH 10/12] sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c

2025-05-09 Thread Kees Cook
On Fri, May 09, 2025 at 02:54:14PM +0200, Joel Granados wrote: > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the merge conflicts in > kernel/sysctl.c. > > Signed-off-by: Joel Granados Another undocumented sysctl. ;) Thi

Re: [PATCH 06/12] fork: mv threads-max into kernel/fork.c

2025-05-09 Thread Luis Chamberlain
On Fri, May 09, 2025 at 02:54:10PM +0200, Joel Granados wrote: > make sysctl_max_threads static as it no longer needs to be exported into > sysctl.c. > > This is part of a greater effort to move ctl tables into their > respective subsystems which will reduce the merge confli

Re: [PATCH 08/12] sysctl: Move tainted ctl_table into kernel/panic.c

2025-05-09 Thread Luis Chamberlain
On Fri, May 09, 2025 at 02:54:12PM +0200, Joel Granados wrote: > Move the ctl_table with the "tainted" proc_name into kernel/panic.c. > With it moves the proc_tainted helper function. > > This is part of a greater effort to move ctl tables into their > respective subsyst

Re: [PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-09 Thread Luis Chamberlain
On Fri, May 09, 2025 at 02:54:13PM +0200, Joel Granados wrote: > Move cad_pid as well as supporting function proc_do_cad_pid into > kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec > inside proc_do_cad_pid which requires the copy of the ctl_table to > handle th

Re: [PATCH 12/12] sysctl: Remove superfluous includes from kernel/sysctl.c

2025-05-09 Thread Luis Chamberlain
On Fri, May 09, 2025 at 02:54:16PM +0200, Joel Granados wrote: > Remove the following headers from the include list in sysctl.c. > > * These are removed as the related variables are no longer there. > === > Include Related Var > ==

[PATCH 10/12] sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c

2025-05-09 Thread Joel Granados
This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados --- kernel/panic.c | 10 ++ kernel/sysctl.c | 10 -- 2 files changed, 10 insertions(+), 10 deletions

[PATCH 09/12] sysctl: move cad_pid into kernel/pid.c

2025-05-09 Thread Joel Granados
Move cad_pid as well as supporting function proc_do_cad_pid into kernel/pic.c. Replaced call to __do_proc_dointvec with proc_dointvec inside proc_do_cad_pid which requires the copy of the ctl_table to handle the temp value. This is part of a greater effort to move ctl tables into their respective

[PATCH 12/12] sysctl: Remove superfluous includes from kernel/sysctl.c

2025-05-09 Thread Joel Granados
are no longer needed as intermediate includes == Include == linux/filter.h linux/binfmts.h Signed-off-by: Joel Granados --- kernel/sysctl.c | 20 1 file changed, 20 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index

[PATCH 06/12] fork: mv threads-max into kernel/fork.c

2025-05-09 Thread Joel Granados
make sysctl_max_threads static as it no longer needs to be exported into sysctl.c. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados --- include/linux/sysctl.h | 3

[PATCH 08/12] sysctl: Move tainted ctl_table into kernel/panic.c

2025-05-09 Thread Joel Granados
Move the ctl_table with the "tainted" proc_name into kernel/panic.c. With it moves the proc_tainted helper function. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joe

Re: [BUG] RCU: Kernel panic on execute from non-executable memory (binderfs + stress-ng)

2025-05-06 Thread Yunseong Kim
>>> callback invocation. >>> >>> Platform: >>>   Architecture: arm64 >>>   Virtualized environment: Apple Silicon M2 (Apple Virtualization Framework) >>>   Kernel version: 6.15.0-rc4+ >>>   Attached Config: CONFIG_PREEMPT_VOLUN

[PATCH bpf-next v3 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-05 Thread Lorenz Bauer
t for mmapable vmlinux BTF libbpf: Use mmap to parse vmlinux BTF from sysfs include/asm-generic/vmlinux.lds.h | 3 +- kernel/bpf/sysfs_btf.c | 37 ++ tools/lib/bpf/btf.c| 83 +++--- tools/te

[PATCH bpf-next v2 0/3] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-02 Thread Lorenz Bauer
er (3): btf: allow mmap of vmlinux btf selftests: bpf: add a test for mmapable vmlinux BTF libbpf: Use mmap to parse vmlinux BTF from sysfs include/asm-generic/vmlinux.lds.h | 3 +- kernel/bpf/sysfs_btf.c | 36 +- tools/lib/bpf/

Re: [PATCH bpf-next 0/2] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-01 Thread Daniel Xu
vmlinux btf > selftests: bpf: add a test for mmapable vmlinux BTF > > include/asm-generic/vmlinux.lds.h | 3 +- > kernel/bpf/sysfs_btf.c | 25 ++- > tools/testing/selftests/bpf/prog_tests/btf_sysfs.c | 79 > ++

[PATCH bpf-next 0/2] Allow mmap of /sys/kernel/btf/vmlinux

2025-05-01 Thread Lorenz Bauer
usage by about 75%. Signed-off-by: Lorenz Bauer --- Lorenz Bauer (2): btf: allow mmap of vmlinux btf selftests: bpf: add a test for mmapable vmlinux BTF include/asm-generic/vmlinux.lds.h | 3 +- kernel/bpf/sysfs_btf.c | 25 ++-

[syzbot] [kernel?] BUG: soft lockup in sys_bpf

2025-04-22 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:82303a059aab selftests/bpf: Mitigate sockmap_ktls disconne.. git tree: bpf console output: https://syzkaller.appspot.com/x/log.txt?x=17564c7058 kernel config: https://syzkaller.appspot.com/x/.config?x=2a31f7155996562

[PATCH 01/12] rcutorture: Make srcu_lockdep.sh check kernel Kconfig

2025-04-18 Thread Joel Fernandes
From: "Paul E. McKenney" The srcu_lockdep.sh currently blindly trusts the rcutorture SRCU-P scenario to build its kernel with lockdep enabled. Of course, this dependency might not be obvious to someone rebalancing SRCU scenarios. This commit therefore adds code to srcu_lockdep.sh tha

[PATCH 01/14] rcutorture: Make srcu_lockdep.sh check kernel Kconfig

2025-04-18 Thread Joel Fernandes
From: "Paul E. McKenney" The srcu_lockdep.sh currently blindly trusts the rcutorture SRCU-P scenario to build its kernel with lockdep enabled. Of course, this dependency might not be obvious to someone rebalancing SRCU scenarios. This commit therefore adds code to srcu_lockdep.sh tha

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-10 Thread Bowman, Terry
> Signed-off-by: Nathan Fontenot >> Signed-off-by: Terry Bowman >> --- >> include/linux/ioport.h | 3 +++ >> kernel/resource.c | 55 +++--- >> 2 files changed, 54 insertions(+), 4 deletions(-) >> >> diff --git a/inclu

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-10 Thread Bowman, Terry
On 4/4/2025 8:25 AM, Andy Shevchenko wrote: > On Fri, Apr 04, 2025 at 02:16:39PM +0100, Jonathan Cameron wrote: >> On Thu, 3 Apr 2025 13:33:12 -0500 Terry Bowman wrote: > >>> Add a release_Sam_region_adjustable() interface to allow for >> >> Who is Sam? (typo) > > Somebody's uncle? > > ... >

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-04 Thread Jonathan Cameron
end to the > common code and a new release_srmem_region_adjustable() is added to > release SOFT RESERVE resources. > > Signed-off-by: Nathan Fontenot > Signed-off-by: Terry Bowman > --- > include/linux/ioport.h | 3 +++ > kernel/resource.c | 55 +++

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-04 Thread Andy Shevchenko
On Fri, Apr 04, 2025 at 02:16:39PM +0100, Jonathan Cameron wrote: > On Thu, 3 Apr 2025 13:33:12 -0500 Terry Bowman wrote: > > Add a release_Sam_region_adjustable() interface to allow for > > Who is Sam? (typo) Somebody's uncle? ... > > #ifdef CONFIG_MEMORY_HOTREMOVE > > extern void release

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-04 Thread kernel test robot
Hi Terry, kernel test robot noticed the following build warnings: [auto build test WARNING on aae0594a7053c60b82621136257c8b648c67b512] url: https://github.com/intel-lab-lkp/linux/commits/Terry-Bowman/kernel-resource-Provide-mem-region-release-for-SOFT-RESERVES/20250404-023601 base

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-03 Thread Bowman, Terry
Hi Andy, Thanks for reviewing this. I'll make updates for all you pointed out below. Regards, Terry On 4/3/2025 1:40 PM, Andy Shevchenko wrote: > On Thu, Apr 03, 2025 at 01:33:12PM -0500, Terry Bowman wrote: >> From: Nathan Fontenot >> >> Add a release_Sam_region_adjustable() interface to allow

[PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-03 Thread Terry Bowman
tenot Signed-off-by: Terry Bowman --- include/linux/ioport.h | 3 +++ kernel/resource.c | 55 +++--- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 5385349f0b8a..718360c9c724 100644

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-03 Thread Andy Shevchenko
On Thu, Apr 03, 2025 at 01:33:12PM -0500, Terry Bowman wrote: > From: Nathan Fontenot > > Add a release_Sam_region_adjustable() interface to allow for > removing SOFT RESERVE memory resources. This extracts out the code > to remove a mem region into a common __release_mem_region_adjustable() > ro

[PATCH v2 01/12] rcutorture: Make srcu_lockdep.sh check kernel Kconfig

2025-03-31 Thread Paul E. McKenney
The srcu_lockdep.sh currently blindly trusts the rcutorture SRCU-P scenario to build its kernel with lockdep enabled. Of course, this dependency might not be obvious to someone rebalancing SRCU scenarios. This commit therefore adds code to srcu_lockdep.sh that verifies that the .config file has

  1   2   3   4   5   6   7   8   9   10   >