<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/tools, branch releng/15.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>vdso: Build without debug info</title>
<updated>2025-08-22T20:50:26+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-08-22T20:47:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b7e0373acb1d022e9e5acb5be9727def5f941194'/>
<id>b7e0373acb1d022e9e5acb5be9727def5f941194</id>
<content type='text'>
The debug info is not very useful and embeds build paths because
elf-vdso.so.o is built without CFLAGS, breaking reproducibility of
elf-vdso.so.o and thus the kernel.  Just stop passing debug flags to
amd64_vdso.sh.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D52129
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The debug info is not very useful and embeds build paths because
elf-vdso.so.o is built without CFLAGS, breaking reproducibility of
elf-vdso.so.o and thus the kernel.  Just stop passing debug flags to
amd64_vdso.sh.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D52129
</pre>
</div>
</content>
</entry>
<entry>
<title>sysent: add a new NORETURN type flag</title>
<updated>2025-08-08T09:30:17+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-08-08T09:30:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=202ac0975edcc4729e7016a9e9cb921de45e3a70'/>
<id>202ac0975edcc4729e7016a9e9cb921de45e3a70</id>
<content type='text'>
System calls of type NORETURN don't return and their stubs are declare
not to.

Reviewed by:	kevans, kib
Differential Revision:	https://reviews.freebsd.org/D51673
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
System calls of type NORETURN don't return and their stubs are declare
not to.

Reviewed by:	kevans, kib
Differential Revision:	https://reviews.freebsd.org/D51673
</pre>
</div>
</content>
</entry>
<entry>
<title>syscalls: normalize _exit(2) declerations</title>
<updated>2025-08-08T09:30:16+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-08-08T09:30:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e7e964cb2ebde11593786a28cea0238d9a6e24c3'/>
<id>e7e964cb2ebde11593786a28cea0238d9a6e24c3</id>
<content type='text'>
exit(3) is implemented by the runtime and performs a number of shutdown
actions before ultimately calling _exit(2) to terminate the program.  We
historically named the syscall table entry `exit` rather than `_exit`,
but this requires special handling in libc/libsys to cause the `_exit`
symbol to exist while implementing `exit` in libc.

Declare the syscall as `_exit` and flow that through the system.

Because syscall(SYS_exit, code) is fairly widely used, allow a
configured extra line in syscall.h to define SYS_exit to SYS__exit.

I've found no external uses of __sys_exit() so I've not bothered to
create a compatability version of this private symbol.

Reviewed by:	imp, kib, emaste
Differential Revision:	https://reviews.freebsd.org/D51672
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
exit(3) is implemented by the runtime and performs a number of shutdown
actions before ultimately calling _exit(2) to terminate the program.  We
historically named the syscall table entry `exit` rather than `_exit`,
but this requires special handling in libc/libsys to cause the `_exit`
symbol to exist while implementing `exit` in libc.

Declare the syscall as `_exit` and flow that through the system.

Because syscall(SYS_exit, code) is fairly widely used, allow a
configured extra line in syscall.h to define SYS_exit to SYS__exit.

I've found no external uses of __sys_exit() so I've not bothered to
create a compatability version of this private symbol.

Reviewed by:	imp, kib, emaste
Differential Revision:	https://reviews.freebsd.org/D51672
</pre>
</div>
</content>
</entry>
<entry>
<title>arm: Generate the kernel.bin file in zImage format.</title>
<updated>2025-08-07T16:44:40+00:00</updated>
<author>
<name>Michal Meloun</name>
<email>mmel@FreeBSD.org</email>
</author>
<published>2025-05-04T11:29:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e4bfe8e96615b16687271147ee2856e6f2a0c478'/>
<id>e4bfe8e96615b16687271147ee2856e6f2a0c478</id>
<content type='text'>
This allows you to run the kernel using the bootz command, which can be
useful on a board where the manufacturer's u-boot does not support EFI.
The original behavior has not been changed, the zImage binary can still
be run by jumping to the beginning of the binary file.

MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows you to run the kernel using the bootz command, which can be
useful on a board where the manufacturer's u-boot does not support EFI.
The original behavior has not been changed, the zImage binary can still
be run by jumping to the beginning of the binary file.

MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS</title>
<updated>2025-08-03T21:27:28+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-07-17T21:54:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3bd8fab2415bf517d169fed2aa345ef08a977a98'/>
<id>3bd8fab2415bf517d169fed2aa345ef08a977a98</id>
<content type='text'>
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no
vnode lock assertions are checked when INVARIANTS is configured, so bugs
can arise.  This has happened to me more than once, and the overhead
over DEBUG_VFS_LOCKS does not appear to be high enough to prohibit
folding it into INVARIANTS, so let's do that.

The change makes vnode lock assertions useful in plain INVARIANTS
kernels, and guards VOP debug routines on INVARIANTS rather than
DEBUG_VFS_LOCKS.  Further, invariants are now checked by plain
assertions rather than having various sysctls to finely control what
happens the checks fail.  The extra complexity didn't seem particularly
useful and is at odds with how we handle debugging most everywhere else.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51402
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no
vnode lock assertions are checked when INVARIANTS is configured, so bugs
can arise.  This has happened to me more than once, and the overhead
over DEBUG_VFS_LOCKS does not appear to be high enough to prohibit
folding it into INVARIANTS, so let's do that.

The change makes vnode lock assertions useful in plain INVARIANTS
kernels, and guards VOP debug routines on INVARIANTS rather than
DEBUG_VFS_LOCKS.  Further, invariants are now checked by plain
assertions rather than having various sysctls to finely control what
happens the checks fail.  The extra complexity didn't seem particularly
useful and is at odds with how we handle debugging most everywhere else.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51402
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: Initial revision of inotify</title>
<updated>2025-07-04T14:42:33+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-07-03T20:07:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f1f230439fa48581f40a57f095627f667a9713c3'/>
<id>f1f230439fa48581f40a57f095627f667a9713c3</id>
<content type='text'>
Add an implementation of inotify_init(), inotify_add_watch(),
inotify_rm_watch(), source-compatible with Linux.  This provides
functionality similar to kevent(2)'s EVFILT_VNODE, i.e., it lets
applications monitor filesystem files for accesses.  Compared to
inotify, however, EVFILT_VNODE has the limitation of requiring the
application to open the file to be monitored.  This means that activity
on a newly created file cannot be monitored reliably, and that a file
descriptor per file in the hierarchy is required.

inotify on the other hand allows a directory and its entries to be
monitored at once.  It introduces a new file descriptor type to which
"watches" can be attached; a watch is a pseudo-file descriptor
associated with a file or directory and a set of events to watch for.
When a watched vnode is accessed, a description of the event is queued
to the inotify descriptor, readable with read(2).  Events for files in a
watched directory include the file name.

A watched vnode has its usecount bumped, so name cache entries
originating from a watched directory are not evicted.  Name cache
entries are used to populate inotify events for files with a link in a
watched directory.  In particular, if a file is accessed with, say,
read(2), an IN_ACCESS event will be generated for any watched hard link
of the file.

The inotify_add_watch_at() variant is included so that this
functionality is available in capability mode; plain inotify_add_watch()
is disallowed in capability mode.

When a file in a nullfs mount is watched, the watch is attached to the
lower vnode, such that accesses via either layer generate inotify
events.

Many thanks to Gleb Popov for testing this patch and finding lots of
bugs.

PR:		258010, 215011
Reviewed by:	kib
Tested by:	arrowd
MFC after:	3 months
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D50315
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add an implementation of inotify_init(), inotify_add_watch(),
inotify_rm_watch(), source-compatible with Linux.  This provides
functionality similar to kevent(2)'s EVFILT_VNODE, i.e., it lets
applications monitor filesystem files for accesses.  Compared to
inotify, however, EVFILT_VNODE has the limitation of requiring the
application to open the file to be monitored.  This means that activity
on a newly created file cannot be monitored reliably, and that a file
descriptor per file in the hierarchy is required.

inotify on the other hand allows a directory and its entries to be
monitored at once.  It introduces a new file descriptor type to which
"watches" can be attached; a watch is a pseudo-file descriptor
associated with a file or directory and a set of events to watch for.
When a watched vnode is accessed, a description of the event is queued
to the inotify descriptor, readable with read(2).  Events for files in a
watched directory include the file name.

A watched vnode has its usecount bumped, so name cache entries
originating from a watched directory are not evicted.  Name cache
entries are used to populate inotify events for files with a link in a
watched directory.  In particular, if a file is accessed with, say,
read(2), an IN_ACCESS event will be generated for any watched hard link
of the file.

The inotify_add_watch_at() variant is included so that this
functionality is available in capability mode; plain inotify_add_watch()
is disallowed in capability mode.

When a file in a nullfs mount is watched, the watch is attached to the
lower vnode, such that accesses via either layer generate inotify
events.

Many thanks to Gleb Popov for testing this patch and finding lots of
bugs.

PR:		258010, 215011
Reviewed by:	kib
Tested by:	arrowd
MFC after:	3 months
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D50315
</pre>
</div>
</content>
</entry>
<entry>
<title>vnode_if: Remove some branching around SDT probes in VOP wrappers</title>
<updated>2025-05-22T14:37:49+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-05-22T14:37:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=903d29469ecb4212c2eed382dc0c5d4536d413b0'/>
<id>903d29469ecb4212c2eed382dc0c5d4536d413b0</id>
<content type='text'>
Now that SDT is implemented using hot-patching, SDT_PROBE* no longer
introduces a branch instruction, so the SDT_PROBES_ENABLED() check in
each VOP_*_APV() is not really worth preserving.

Reviewed by:	olce, kib
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D50423
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that SDT is implemented using hot-patching, SDT_PROBE* no longer
introduces a branch instruction, so the SDT_PROBES_ENABLED() check in
each VOP_*_APV() is not really worth preserving.

Reviewed by:	olce, kib
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D50423
</pre>
</div>
</content>
</entry>
<entry>
<title>makesyscalls: emit cpp in syscalls.map</title>
<updated>2025-02-18T22:03:33+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-02-18T22:02:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9355ad0b0bfaba9dc39972819185a7dc787a8950'/>
<id>9355ad0b0bfaba9dc39972819185a7dc787a8950</id>
<content type='text'>
If there are per-platform differences in which syscalls are supported,
we should only try to export implemented ones in libc.  Fortunately,
syscall maps are run though cpp.  This is arguably incomplete as
syscall.mk isn't (and can't practically be) supported.

Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there are per-platform differences in which syscalls are supported,
we should only try to export implemented ones in libc.  Fortunately,
syscall maps are run though cpp.  This is arguably incomplete as
syscall.mk isn't (and can't practically be) supported.

Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</pre>
</div>
</content>
</entry>
<entry>
<title>makesyscalls: deprecate cpp other than includes</title>
<updated>2025-02-18T22:03:26+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-02-18T22:02:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f29905cab576a0ccf454ee2e215f590e0e656d70'/>
<id>f29905cab576a0ccf454ee2e215f590e0e656d70</id>
<content type='text'>
Warn that C preprocessor directives in the config file are deprecated.
They are unsound and support has a number of potential pitfalls.  They
should be replaced by compile-time generation of files plus an overlay
framework to allow things like per-arch variation.

Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Warn that C preprocessor directives in the config file are deprecated.
They are unsound and support has a number of potential pitfalls.  They
should be replaced by compile-time generation of files plus an overlay
framework to allow things like per-arch variation.

Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</pre>
</div>
</content>
</entry>
<entry>
<title>makesyscalls: Restore support for cpp in input</title>
<updated>2025-02-18T22:03:13+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-02-18T22:02:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=42d075f4b7b74eb3c4f943d6bdcc2aeb56be6388'/>
<id>42d075f4b7b74eb3c4f943d6bdcc2aeb56be6388</id>
<content type='text'>
Allow patterns like this in syscalls.master:

	#if 0
	91	AUE_NULL	RESERVED
	#else
	91	AUE_NULL	STD|CAPENABLED {
			int newsyscall(void);
		}
	#endif

makesyscalls.lua and it's predecessor makesyscalls.sh (really an awk
script with a tiny shell prolog) used a single pass parsing model where
lines beginning with `#` were emitted into most generated files as they
were read.  I belive this was initially there to allow includes to be
listed in syscalls.master, but Hyrum's Law[0] applies and people are using
it for things like architecture-specific syscall definitions.

This use of CPP macro is unsound and there are a number of sharp edges
in both the new and old implementations.  The macros are unsound because
not all the files were generate are run through CPP (or if they are not
in the same context) and this will increasingly be true as we generate
more things.  Sharp edges include the fact that anything before the
first syscall would be printed at a different scope (e.g., before an
array is declared).

In this patch I collect each non-#include CPP directive and attach them
to the syscall table or individual entries.  All entries before the
first syscall and after the last are attached to the prolog and epilog
members.  Within the syscall table all entries are attached to the next
system calls's prolog member.  In generators, each prolog entry is
printed regardless of the system call's visibiilty which replicates the
naive single pass model's behavior (including lots of empty blocks
of #if/#else/#endif in the output).  Unlike makesyscalls.lua, I discard
none #define entries at the top of the file and print a warning as their
usefulness appears limited.

[0] https://www.hyrumslaw.com

Reported by:	kevans
Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow patterns like this in syscalls.master:

	#if 0
	91	AUE_NULL	RESERVED
	#else
	91	AUE_NULL	STD|CAPENABLED {
			int newsyscall(void);
		}
	#endif

makesyscalls.lua and it's predecessor makesyscalls.sh (really an awk
script with a tiny shell prolog) used a single pass parsing model where
lines beginning with `#` were emitted into most generated files as they
were read.  I belive this was initially there to allow includes to be
listed in syscalls.master, but Hyrum's Law[0] applies and people are using
it for things like architecture-specific syscall definitions.

This use of CPP macro is unsound and there are a number of sharp edges
in both the new and old implementations.  The macros are unsound because
not all the files were generate are run through CPP (or if they are not
in the same context) and this will increasingly be true as we generate
more things.  Sharp edges include the fact that anything before the
first syscall would be printed at a different scope (e.g., before an
array is declared).

In this patch I collect each non-#include CPP directive and attach them
to the syscall table or individual entries.  All entries before the
first syscall and after the last are attached to the prolog and epilog
members.  Within the syscall table all entries are attached to the next
system calls's prolog member.  In generators, each prolog entry is
printed regardless of the system call's visibiilty which replicates the
naive single pass model's behavior (including lots of empty blocks
of #if/#else/#endif in the output).  Unlike makesyscalls.lua, I discard
none #define entries at the top of the file and print a warning as their
usefulness appears limited.

[0] https://www.hyrumslaw.com

Reported by:	kevans
Reviewed by:	kevans
Sponsored by:	DARPA, AFRL
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1575
</pre>
</div>
</content>
</entry>
</feed>
