History log of /freebsd/sys/kern/init_main.c (Results 1 – 25 of 894)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5997b193 06-Dec-2024 Zhenlei Huang <zlei@FreeBSD.org>

init_main: Fix logging of the SYSINIT process

The current subsystem, aka `sip->subsystem`, should be logged, rather
than the last one.

Reviewed by: mhorne
Fixes: 5a8fceb3bd9f boottrace: trace annot

init_main: Fix logging of the SYSINIT process

The current subsystem, aka `sip->subsystem`, should be logged, rather
than the last one.

Reviewed by: mhorne
Fixes: 5a8fceb3bd9f boottrace: trace annotations for startup and shutdown
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47903

show more ...


# a7cfcb26 06-Dec-2024 Zhenlei Huang <zlei@FreeBSD.org>

init_main: Use TUNABLE_INT_FETCH to initialize verbose_sysinit

It is too late to initialize verbose_sysinit via TUNABLE_INT, as
TUNABLE_INT runs at the order of SI_SUB_TUNABLES, thus any subsystems

init_main: Use TUNABLE_INT_FETCH to initialize verbose_sysinit

It is too late to initialize verbose_sysinit via TUNABLE_INT, as
TUNABLE_INT runs at the order of SI_SUB_TUNABLES, thus any subsystems
those have order prior or equal to SI_SUB_TUNABLES are not logged.

Reviewed by: kevans
Fixes: c7962400c9a7 Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47907

show more ...


Revision tags: release/14.2.0, release/13.4.0
# 356be134 30-Aug-2024 Zhenlei Huang <zlei@FreeBSD.org>

kernel: Make some compile time constant variables const

Those variables are not going to be changed at runtime. Make them const
to avoid potential overwriting. This will also help spotting accidenta

kernel: Make some compile time constant variables const

Those variables are not going to be changed at runtime. Make them const
to avoid potential overwriting. This will also help spotting accidental
global variables shadowing, since the variable's name such as `version`
is short and commonly used.

This change was inspired by reviewing khng's work D44760.

No functional change intended.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45227

show more ...


# 7412517f 21-Aug-2024 Zhenlei Huang <zlei@FreeBSD.org>

init_main: Sprinkle const qualifiers where appropriate

No functional change intended.

MFC after: 1 week


# 0dd77895 29-Jul-2024 Mark Johnston <markj@FreeBSD.org>

vm: Remove kernel stack swapping support, part 2

After mi_startup() finishes, thread0 becomes the "swapper", whose
responsibility is to swap threads back in on demand. Now that threads
can't be swa

vm: Remove kernel stack swapping support, part 2

After mi_startup() finishes, thread0 becomes the "swapper", whose
responsibility is to swap threads back in on demand. Now that threads
can't be swapped out, there is no use for this thread. Just sleep
forever once sysinits are finished; thread_exit() doesn't work because
thread0 is allocated statically. The thread could be repurposed if that
would be useful.

Tested by: pho
Reviewed by: alc, imp, kib
Differential Revision: https://reviews.freebsd.org/D46113

show more ...


Revision tags: release/14.1.0
# e0c92dd2 25-Mar-2024 Konstantin Belousov <kib@FreeBSD.org>

amd64: initialize td_frame stack area for init(8) main thread

Unitialized td_frame mostly does not matter since all registers are
overwritten on exec to activate init(8). Except PSL_T bit from the

amd64: initialize td_frame stack area for init(8) main thread

Unitialized td_frame mostly does not matter since all registers are
overwritten on exec to activate init(8). Except PSL_T bit from the
%rflags which might leak into fresh init as garbage, causing spurious
SIGTRAPs delivered to init until first syscall is executed.

Reviewed by: emaste, jhb, jhibbits
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44498

show more ...


Revision tags: release/13.3.0
# eccde5f4 21-Feb-2024 Warner Losh <imp@FreeBSD.org>

sys/kern: Remove a few sys/cdefs.h around some elf things

These sys/cdefs.h are no longer needed. Remove them in advance of
other work in this area.

Sponsored by: Netflix


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


Revision tags: release/14.0.0
# 92541c12 25-Sep-2023 Olivier Certner <olce.freebsd@certner.fr>

Open-code proc_set_cred_init()

This function is to be called only when initializing a new process (so,
'proc0' and at fork), and not in any other circumstances. Setting the
process' 'p_ucred' field

Open-code proc_set_cred_init()

This function is to be called only when initializing a new process (so,
'proc0' and at fork), and not in any other circumstances. Setting the
process' 'p_ucred' field to the result of crcowget() on the original
credentials is the only thing it does, hiding the fact that the process'
'p_ucred' field is crushed by the call. Moreover, most of the code it
executes is already encapsulated in crcowget().

To prevent misuse and improve code readability, just remove this
function and replace it with a direct assignment to 'p_ucred'.

Reviewed by: markj (earlier version), kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42255

show more ...


# 1926d5ce 06-Sep-2023 Colin Percival <cperciva@FreeBSD.org>

init_main: Record completed SYSINITs

When removing them from sysinit_list, append them to sysinit_done_list;
print this list from 'show sysinit' along with the list of future
sysinits.

Reviewed by:

init_main: Record completed SYSINITs

When removing them from sysinit_list, append them to sysinit_done_list;
print this list from 'show sysinit' along with the list of future
sysinits.

Reviewed by: jhb, gallatin (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41749

show more ...


# 71679cf4 06-Sep-2023 Colin Percival <cperciva@FreeBSD.org>

init_main: Switch from SLIST to STAILQ, fix order

Constructing an SLIST of SYSINITs by inserting them one by one at the
head of the list resulted in them being sorted in anti-stable order:
When two

init_main: Switch from SLIST to STAILQ, fix order

Constructing an SLIST of SYSINITs by inserting them one by one at the
head of the list resulted in them being sorted in anti-stable order:
When two SYSINITs tied for (subsystem, order), they were executed in
the reverse order to the order in which they appeared in the linker
set.

Note that while this changes struct sysinit, it doesn't affect ABI
since SLIST_ENTRY and STAILQ_ENTRY are compatible (in both cases a
single pointer to the next element).

Fixes: 9a7add6d01f3 "init_main: Switch from sysinit array to SLIST"
Reported by: gallatin
Reviewed by: jhb, gallatin, emaste
Tested by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41748

show more ...


# 9a7add6d 18-Jul-2023 Colin Percival <cperciva@FreeBSD.org>

init_main: Switch from sysinit array to SLIST

This has two effects:
1. We can mergesort the sysinits instead of bubblesorting them, which
shaves about 2 ms off the boot time in Firecracker.
2. Addin

init_main: Switch from sysinit array to SLIST

This has two effects:
1. We can mergesort the sysinits instead of bubblesorting them, which
shaves about 2 ms off the boot time in Firecracker.
2. Adding more sysinits (e.g. from a KLD) can be performed by sorting
them and then merging the sorted lists, which is both faster than
the previous "append and sort" approach and avoids needing malloc.

Reviewed by: jhb (previous version)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D41075

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 41582f28 16-Aug-2023 John Baldwin <jhb@FreeBSD.org>

sys: Add a deprecation warning for 32-bit kernels.

Per recent discussions on arch@ and at the BSDCan developer summit, we
are considering removing support for 32-bit platforms (in some form)
for 15.

sys: Add a deprecation warning for 32-bit kernels.

Per recent discussions on arch@ and at the BSDCan developer summit, we
are considering removing support for 32-bit platforms (in some form)
for 15.0 (at the earliest). A final decision on what will ship in
15.0 will be made closer to the release of 15.0. However, we should
communicate the potential deprecation in 14.0 to provide notice to
users.

This commit adds a warning during boot on 32-bit kernels that they are
deprecated and may be removed in 15.0. More details will be included
in a followup commit to RELNOTES.

Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D41163

show more ...


# 3360b485 12-Jun-2023 Konstantin Belousov <kib@FreeBSD.org>

killpg(2): close a race with fork(2), part1

If the process group member performs fork(), the child could escape
signalling from killpg(). Prevent it by introducing an sx process group
lock pg_killsx

killpg(2): close a race with fork(2), part1

If the process group member performs fork(), the child could escape
signalling from killpg(). Prevent it by introducing an sx process group
lock pg_killsx which is taken interruptibly shared around fork. If there
is a pending signal, do the trip through userspace with ERESTART to
handle signal ASTs. The lock is taken exclusively during killpg().

The lock is also locked exclusive when the process changes group
membership, to avoid escaping a signal by this means, by ensuring that
the process group is stable during fork.

Note that the new lock is before proctree lock, so in some situations we
could only do trylocking to obtain it.

This relatively simple approach cannot work for REAP_KILL, because
process potentially belongs to more than one reaper tree by having
sub-reapers.

Reported by: dchagin
Tested by: dchagin, pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D40493

show more ...


# d706d02e 29-May-2023 Dmitry Chagin <dchagin@FreeBSD.org>

sysentvec: Retire sv_imgact_try as unneeded anymore

The sysentvec sv_imgact_try was used by kern_exec() to allow
non-native ABI to fixup shell path according to ABI root directory.
Since the non-nat

sysentvec: Retire sv_imgact_try as unneeded anymore

The sysentvec sv_imgact_try was used by kern_exec() to allow
non-native ABI to fixup shell path according to ABI root directory.
Since the non-native ABI can now specify its root directory directly
to namei() via pwd_altroot() call this facility is not needed anymore.

Differential Revision: https://reviews.freebsd.org/D40092
MFC after: 2 month

show more ...


# 40b28705 19-May-2023 Colin Percival <cperciva@FreeBSD.org>

mi_startup: Instrument the bubblesort with TSLOG

The bubblesort of SYSINITs is currently responsible for 7% of the
kernel boot time when booting a 1 CPU / 128 MB VM under Firecracker.

It needs to b

mi_startup: Instrument the bubblesort with TSLOG

The bubblesort of SYSINITs is currently responsible for 7% of the
kernel boot time when booting a 1 CPU / 128 MB VM under Firecracker.

It needs to be replaced with a faster sort, but until that happens
at least instrumenting it with TSLOG makes it show up in flamecharts.

show more ...


Revision tags: release/13.2.0, release/12.4.0
# c84c5e00 18-Jul-2022 Mitchell Horne <mhorne@FreeBSD.org>

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Spons

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35583

show more ...


# eca368ec 20-May-2022 Dmitry Chagin <dchagin@FreeBSD.org>

Retire sv_transtrap

Call translate_traps directly from sendsig().

MFC after: 2 weeks


Revision tags: release/13.1.0
# 5a8fceb3 22-Feb-2022 Mitchell Horne <mhorne@FreeBSD.org>

boottrace: trace annotations for startup and shutdown

Add trace events for execution of SYSINITs (both static and dynamically
loaded), and to the various steps in the shutdown/panic/reboot paths.

S

boottrace: trace annotations for startup and shutdown

Add trace events for execution of SYSINITs (both static and dynamically
loaded), and to the various steps in the shutdown/panic/reboot paths.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #23
Differential Revision: https://reviews.freebsd.org/D30187

show more ...


Revision tags: release/12.3.0
# 0aa9ffcd 10-May-2021 Mitchell Horne <mhorne@FreeBSD.org>

init_main.c: sort includes

This is preferred by style(9). Do this ahead of adding another include.

Reviewed by: imp, kevans, allanjude
MFC after: 3 days
Sponsored by: NetApp, Inc.
Sponsored by: Kla

init_main.c: sort includes

This is preferred by style(9). Do this ahead of adding another include.

Reviewed by: imp, kevans, allanjude
MFC after: 3 days
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30186

show more ...


# 893d20c9 29-Jan-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: move fd table sizing out of fdinit

now it is placed with the rest of actual initialisation


# 548a2ec4 24-Jan-2022 Andrew Turner <andrew@FreeBSD.org>

Add PT_GETREGSET

This adds the PT_GETREGSET and PT_SETREGSET ptrace types. These can be
used to access all the registers from a specified core dump note type.
The NT_PRSTATUS and NT_FPREGSET notes a

Add PT_GETREGSET

This adds the PT_GETREGSET and PT_SETREGSET ptrace types. These can be
used to access all the registers from a specified core dump note type.
The NT_PRSTATUS and NT_FPREGSET notes are initially supported. Other
machine-dependant types are expected to be added in the future.

The ptrace addr points to a struct iovec pointing at memory to hold the
registers along with its length. On success the length in the iovec is
updated to tell userspace the actual length the kernel wrote or, if the
base address is NULL, the length the kernel would have written.

Because the data field is an int the arguments are backwards when
compared to the Linux PTRACE_GETREGSET call.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19831

show more ...


# 3fc21fdd 17-Jan-2022 Mark Johnston <markj@FreeBSD.org>

sysent: Add a sv_psstringssz field to struct sysentvec

The size of the ps_strings structure varies between ABIs, so this is
useful for computing the address of the ps_strings structure relative to
t

sysent: Add a sv_psstringssz field to struct sysentvec

The size of the ps_strings structure varies between ABIs, so this is
useful for computing the address of the ps_strings structure relative to
the top of the stack when stack address randomization is enabled.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33704

show more ...


# 86608131 14-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

start_init: use 'p'

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


12345678910>>...36