From: Randy Dunlap <rdunlap@infradead.org>
To: Sasha Levin <sashal@kernel.org>,
linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, tools@kernel.org
Subject: Re: [RFC PATCH v4 1/7] kernel/api: introduce kernel API specification framework
Date: Mon, 1 Sep 2025 10:23:26 -0700 [thread overview]
Message-ID: <8d8b9cac-695c-469e-a831-c226b796430b@infradead.org> (raw)
In-Reply-To: <20250825181434.3340805-2-sashal@kernel.org>
Hi Sasha,
On 8/25/25 11:14 AM, Sasha Levin wrote:
> 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 debugging (CONFIG_KAPI_RUNTIME_CHECKS)
> - Export of specifications via debugfs for tooling integration
> - Support for both internal kernel APIs and system calls
>
> The framework stores specifications in a dedicated ELF section and
> provides infrastructure for:
> - Compile-time validation of specifications
> - Runtime querying of API documentation
> - Machine-readable export formats
> - Integration with existing SYSCALL_DEFINE macros
>
> This commit introduces the core infrastructure without modifying any
> existing APIs. Subsequent patches will add specifications to individual
> subsystems.
>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> .gitignore | 1 +
> Documentation/admin-guide/kernel-api-spec.rst | 507 ++++++
To me, none of this feels like Documentation/admin-guide/ material.
I don't think that many sysadmins will be using it.
Maybe Documentation/dev-tools/ ?
Closer to developer material that admin?
> MAINTAINERS | 9 +
> arch/um/kernel/dyn.lds.S | 3 +
> arch/um/kernel/uml.lds.S | 3 +
> arch/x86/kernel/vmlinux.lds.S | 3 +
> include/asm-generic/vmlinux.lds.h | 20 +
> include/linux/kernel_api_spec.h | 1559 +++++++++++++++++
> include/linux/syscall_api_spec.h | 125 ++
> include/linux/syscalls.h | 38 +
> init/Kconfig | 2 +
> kernel/Makefile | 1 +
> kernel/api/Kconfig | 35 +
> kernel/api/Makefile | 7 +
> kernel/api/kernel_api_spec.c | 1155 ++++++++++++
> 15 files changed, 3468 insertions(+)
> create mode 100644 Documentation/admin-guide/kernel-api-spec.rst
> create mode 100644 include/linux/kernel_api_spec.h
> create mode 100644 include/linux/syscall_api_spec.h
> create mode 100644 kernel/api/Kconfig
> create mode 100644 kernel/api/Makefile
> create mode 100644 kernel/api/kernel_api_spec.c
thanks.
--
~Randy
next prev parent reply other threads:[~2025-09-01 17:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 18:14 [RFC PATCH v4 0/7] Kernel API Specification Framework Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 1/7] kernel/api: introduce kernel API specification framework Sasha Levin
2025-09-01 17:23 ` Randy Dunlap [this message]
2025-08-25 18:14 ` [RFC PATCH v4 2/7] kernel/api: enable kerneldoc-based API specifications Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 3/7] kernel/api: add debugfs interface for kernel " Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 4/7] kernel/sched: add specs for sys_sched_setattr() Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 5/7] mm/mlock: add API specification for mlock Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 6/7] fs/exec: add API specification for execveat Sasha Levin
2025-08-25 18:14 ` [RFC PATCH v4 7/7] tools/kapi: Add kernel API specification extraction tool Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d8b9cac-695c-469e-a831-c226b796430b@infradead.org \
--to=rdunlap@infradead.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=tools@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).