History log of /freebsd/sys/kern/kern_mib.c (Results 1 – 25 of 335)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 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 ...


# 0f64fc6a 22-Aug-2024 Zhenlei Huang <zlei@FreeBSD.org>

kern: Align the declaration of kernconfstring with its definition

It is defined as const char[] in config.c which is auto generated by
usr.sbin/config/kernconf.tmpl .

While here prefer macro SYSCTL

kern: Align the declaration of kernconfstring with its definition

It is defined as const char[] in config.c which is auto generated by
usr.sbin/config/kernconf.tmpl .

While here prefer macro SYSCTL_CONST_STRING to avoid casting.

MFC after: 1 week

show more ...


# 5862c891 15-Jul-2024 Kyle Evans <kevans@FreeBSD.org>

kern: zero out stack buffer after copying out random bits

The kern.arandom sysctl handler uses an intermediate buffer on the stack
to hold random data that it subsequently copies out to the sysctl
r

kern: zero out stack buffer after copying out random bits

The kern.arandom sysctl handler uses an intermediate buffer on the stack
to hold random data that it subsequently copies out to the sysctl
request. Err on the side of caution and zero out the stack buffer after
we're done with it to avoid a potential entropy leak later on.

Reviewed by: cem, emaste, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45978

show more ...


# 3e00c11a 12-Jul-2024 Alan Cox <alc@FreeBSD.org>

arm64: Support the L3 ATTR_CONTIGUOUS page size in pagesizes[]

Update pagesizes[] to include the L3 ATTR_CONTIGUOUS (L3C) page size,
which is 64KB when the base page size is 4KB and 2MB when the bas

arm64: Support the L3 ATTR_CONTIGUOUS page size in pagesizes[]

Update pagesizes[] to include the L3 ATTR_CONTIGUOUS (L3C) page size,
which is 64KB when the base page size is 4KB and 2MB when the base page
size is 16KB.

Add support for L3C pages to shm_create_largepage().

Add support for creating L3C page mappings to pmap_enter(psind=1).

Add support for reporting L3C page mappings to mincore(2) and
procstat(8).

Update vm_fault_soft_fast() and vm_fault_populate() to handle multiple
superpage sizes.

Declare arm64 as supporting two superpage reservation sizes, and
simulate two superpage reservation sizes, updating the vm_page's psind
field to reflect the correct page size from pagesizes[]. (The next
patch in this series will replace this simulation. This patch is
already big enough.)

Co-authored-by: Eliot Solomon <ehs3@rice.edu>
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45766

show more ...


Revision tags: release/14.1.0, release/13.3.0
# 969fc091 04-Jan-2024 Mark Johnston <markj@FreeBSD.org>

sysctl: Don't pass CTLFLAG_MPSAFE to SYSCTL_STRING

It is redundant. No functional change intended.

MFC after: 1 week


# 1b8d70b2 30-Dec-2023 Pawel Jakub Dawidek <pjd@FreeBSD.org>

kern: Introduce kern.pid_max_limit sysctl.

The kern.pid_max_limit will hold the PID_MAX value the kernel was
compiled with. The existing kern.pid_max sysctl can be modified and
doesn't really repres

kern: Introduce kern.pid_max_limit sysctl.

The kern.pid_max_limit will hold the PID_MAX value the kernel was
compiled with. The existing kern.pid_max sysctl can be modified and
doesn't really represent maximum PID number in the system, as there
may still be processes created with higher PIDs before kern.pid_max
was lowered.

Reivewed by: kib, zlei
Approved by: oshogbo
Differential Revision: https://reviews.freebsd.org/D43077

show more ...


# 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 ...


# 26b36a64 16-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

sysctl kern.supported_archs: return correct value

in case COMPAT_FREEBSD32 was enabled in config but hardware does not
support executing 32bit binaries.

Reviewed by: markj
Sponsored by: The FreeBSD

sysctl kern.supported_archs: return correct value

in case COMPAT_FREEBSD32 was enabled in config but hardware does not
support executing 32bit binaries.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42641

show more ...


# e256f713 16-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

kernel: add missed FEATUREs compat_freebsd 8-14

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


Revision tags: release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

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

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


Revision tags: release/13.2.0
# 4a1c4de2 05-Feb-2023 Val Packett <val@packett.cool>

Allow sysctl hw.machine/hw.machine_arch in capability mode

There's no harm in reading strings like 'amd64'.

Reviewed by: emaste, manu
Sponsored by: https://www.patreon.com/valpackett
Differential R

Allow sysctl hw.machine/hw.machine_arch in capability mode

There's no harm in reading strings like 'amd64'.

Reviewed by: emaste, manu
Sponsored by: https://www.patreon.com/valpackett
Differential Revision: https://reviews.freebsd.org/D28703

show more ...


Revision tags: release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0
# 0fe74ae6 27-Dec-2020 Jamie Gritton <jamie@FreeBSD.org>

jail: Consistently handle the pr_allow bitmask

Return a boolean (i.e. 0 or 1) from prison_allow, instead of the flag
value itself, which is what sysctl expects.

Add prison_set_allow(), which can se

jail: Consistently handle the pr_allow bitmask

Return a boolean (i.e. 0 or 1) from prison_allow, instead of the flag
value itself, which is what sysctl expects.

Add prison_set_allow(), which can set or clear a permission bit, and
propagates cleared bits down to child jails.

Use prison_allow() and prison_set_allow() in the various jail.allow.*
sysctls, and others that depend on thoe permissions.

Add locking around checking both pr_allow and pr_enforce_statfs in
prison_priv_check().

show more ...


# cd853791 28-Nov-2020 Konstantin Belousov <kib@FreeBSD.org>

Make MAXPHYS tunable. Bump MAXPHYS to 1M.

Replace MAXPHYS by runtime variable maxphys. It is initialized from
MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.

Make b_pag

Make MAXPHYS tunable. Bump MAXPHYS to 1M.

Replace MAXPHYS by runtime variable maxphys. It is initialized from
MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.

Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer
cache buffers exactly to atop(maxbcachebuf) (currently it is sized to
atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1.
The +1 for pbufs allow several pbuf consumers, among them vmapbuf(),
to use unaligned buffers still sized to maxphys, esp. when such
buffers come from userspace (*). Overall, we save significant amount
of otherwise wasted memory in b_pages[] for buffer cache buffers,
while bumping MAXPHYS to desired high value.

Eliminate all direct uses of the MAXPHYS constant in kernel and driver
sources, except a place which initialize maxphys. Some random (and
arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted
straight. Some drivers, which use MAXPHYS to size embeded structures,
get private MAXPHYS-like constant; their convertion is out of scope
for this work.

Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs,
dev/siis, where either submitted by, or based on changes by mav.

Suggested by: mav (*)
Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D27225

show more ...


# 1ebef477 01-Nov-2020 Stefan Eßer <se@FreeBSD.org>

Make sysctl user.local a tunable that can be written at run-time

This sysctl value had been provided as a read-only variable that is
compiled into the C library based on the value of _PATH_LOCALBASE

Make sysctl user.local a tunable that can be written at run-time

This sysctl value had been provided as a read-only variable that is
compiled into the C library based on the value of _PATH_LOCALBASE in
paths.h.

After this change, the value is compiled into the kernel as an empty
string, which is translated to _PATH_LOCALBASE by the C library.

This empty string can be overridden at boot time or by a privileged
user at run time and will then be returned by sysctl.

When set to an empty string, the value returned by sysctl reverts to
_PATH_LOCALBASE.

This update does not change the behavior on any system that does
not modify the default value of user.localbase.

I consider this change as experimental and would prefer if the run-time
write permission was reconsidered and the sysctl variable defined with
CLFLAG_RDTUN instead to restrict it to be set at boot time.

MFC after: 1 month

show more ...


# 147eea39 30-Oct-2020 Stefan Eßer <se@FreeBSD.org>

Add read only sysctl variable user.localbase

The value is provided by the C library as for other sysctl variables in
the user tree. It is compiled in and returns the value of _PATH_LOCALBASE
defined

Add read only sysctl variable user.localbase

The value is provided by the C library as for other sysctl variables in
the user tree. It is compiled in and returns the value of _PATH_LOCALBASE
defined in paths.h.

Reviewed by: imp, scottl
Differential Revision: https://reviews.freebsd.org/D27009

show more ...


Revision tags: release/12.2.0
# a0efcf64 02-Sep-2020 Mark Johnston <markj@FreeBSD.org>

Add sysctl(8) formatting for hw.pagesizes.

- Change the type of hw.pagesizes to OPAQUE, since it returns an array.
- Modify the handler to only truncate the returned length if the caller
supplied

Add sysctl(8) formatting for hw.pagesizes.

- Change the type of hw.pagesizes to OPAQUE, since it returns an array.
- Modify the handler to only truncate the returned length if the caller
supplied an output buffer. This allows use of the trick of passing a
NULL output buffer to fetch the output size, while preserving
compatibility if MAXPAGESIZES is increased.
- Add a "S,pagesize" formatter to sysctl(8).

Reviewed by: alc, kib
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26239

show more ...


Revision tags: release/11.4.0
# a2b127ae 15-May-2020 Konstantin Belousov <kib@FreeBSD.org>

Improve comment for compat32 handling of sysctl hw.pagesizes.

Explain why truncation works as intended.
Reformat.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# 6820cbed 15-May-2020 Konstantin Belousov <kib@FreeBSD.org>

Revert r361077 to recommit with proper message.


# e00594d9 15-May-2020 Konstantin Belousov <kib@FreeBSD.org>

Implement RTLD_DEEPBIND.

PR: 246462
Tested by: Martin Birgmeier <d8zNeCFG@aon.at>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24841


# 697503c4 09-May-2020 Konstantin Belousov <kib@FreeBSD.org>

Avoid spurious ENOMEMs from sysctl hw.pagesizes.

Reported by: Paul Floyd <paulf@free.fr>
PR: 246215
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision:

Avoid spurious ENOMEMs from sysctl hw.pagesizes.

Reported by: Paul Floyd <paulf@free.fr>
PR: 246215
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24737

show more ...


# 61bbe53c 27-Apr-2020 John Baldwin <jhb@FreeBSD.org>

Improve MACHINE_ARCH handling for hard vs soft-float on RISC-V.

For userland, MACHINE_ARCH reflects the current ABI via preprocessor
directives. For the kernel, the hw.machine_arch sysctl uses the

Improve MACHINE_ARCH handling for hard vs soft-float on RISC-V.

For userland, MACHINE_ARCH reflects the current ABI via preprocessor
directives. For the kernel, the hw.machine_arch sysctl uses the ELF
header flags of the current process to select the correct MACHINE_ARCH
value.

Reviewed by: imp, kp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24543

show more ...


# 3da4d19b 27-Apr-2020 John Baldwin <jhb@FreeBSD.org>

Extend support in sysctls for supporting multiple native ABIs.

This extends some of the changes in place to support reporting support
for 32-bit ABIs to permit reporting hard-float vs soft-float ABI

Extend support in sysctls for supporting multiple native ABIs.

This extends some of the changes in place to support reporting support
for 32-bit ABIs to permit reporting hard-float vs soft-float ABIs.

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24542

show more ...


# 34086d5b 17-Mar-2020 Conrad Meyer <cem@FreeBSD.org>

Implement sysctl kern.boot_id

Boot IDs are random, opaque 128-bit identifiers that distinguish distinct
system boots. A new ID is generated each time the system boots. Unlike
kern.boottime, the va

Implement sysctl kern.boot_id

Boot IDs are random, opaque 128-bit identifiers that distinguish distinct
system boots. A new ID is generated each time the system boots. Unlike
kern.boottime, the value is not modified by NTP adjustments. It remains fixed
until the machine is restarted.

PR: 244867
Reported by: Ricardo Fraile <rfraile AT rfraile.eu>
MFC after: I do not intend to, but feel free

show more ...


# 75dfc66c 27-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358269 through r358399.


# 7029da5c 26-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly mark

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718

show more ...


12345678910>>...14