OpenBSD CVS

CVS log for src/sys/sys/sysctl.h


[BACK] Up to [local] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.235 / (download) - annotate - [select for diffs], Sun Oct 1 15:58:12 2023 UTC (8 months, 1 week ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.234: +3 -1 lines
Diff to previous 1.234 (colored)

Add sysctl hw.ucomnames to list 'fixed' paths to USB serial
ports.

Suggested by deraadt@, USB route idea from kettenis@. Feedback
from anton@, man page improvements from deraadt@, jmc@,
schwarze@.

ok deraadt@ kettenis@

Revision 1.234 / (download) - annotate - [select for diffs], Tue Jul 4 11:14:00 2023 UTC (11 months, 1 week ago) by jsg
Branch: MAIN
Changes since 1.233: +1 -4 lines
Diff to previous 1.233 (colored)

remove prototypes for removed functions

Revision 1.233 / (download) - annotate - [select for diffs], Wed May 17 22:12:51 2023 UTC (12 months, 3 weeks ago) by kettenis
Branch: MAIN
Changes since 1.232: +19 -2 lines
Diff to previous 1.232 (colored)

Implement battery management sysctl.  This will provide a set of sysctls
to control the charging of laptop batteries:

* hw.battery.chargemode (int)

  -1: force discharge
   0: inhibit charge
   1: auto

In auto mode charging may be controlled by:

* hw.battery.chargestop (int)

  Percentage (0-100) of last full capacity at which the battery should
  stop charging.

* hw.battery.chargestart (int)

  Percentage (0-100) of last full capacity at which the battery should
  start charging.

The idea is that with

  hw.battery.chargemode=1
  hw.battery.chargestop=80
  hw.battery.chargestart=75

the battery would be kept charged within the range between 75% and 80%.

Allowable settings and some details of the behavior may differ between
hardware implementations.

Committing this early to easy testing of further diffs that implement this
functionality in acpithinkpad(4) and aplsmc(4).

ok kn@

Revision 1.232 / (download) - annotate - [select for diffs], Sat Jan 7 05:24:58 2023 UTC (17 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.231: +5 -3 lines
Diff to previous 1.231 (colored)

Add {get,set}thrname(2) for putting thread names in the kernel and
exposed in a new field returned by sysctl(KERN_PROC).  Update
pthread_{get,set}_name_np(3) to use the syscalls.  Show them, when
set, in ps -H and top -H output.

libc and libpthread minor bumps

ok mpi@, mvs@, deraadt@

Revision 1.231 / (download) - annotate - [select for diffs], Mon Nov 7 14:25:44 2022 UTC (19 months ago) by robert
Branch: MAIN
Changes since 1.230: +4 -2 lines
Diff to previous 1.230 (colored)

introduce a new kern.autoconf_serial sysctl that can be used by userland
to monitor state changes of the kernel device tree

input from dnd ok dlg@, deraadt@

Revision 1.230 / (download) - annotate - [select for diffs], Sat Nov 5 19:29:46 2022 UTC (19 months ago) by cheloha
Branch: MAIN
Changes since 1.229: +15 -2 lines
Diff to previous 1.229 (colored)

clockintr(9): initial commit

clockintr(9) is a machine-independent clock interrupt scheduler.  It
emulates most of what the machine-dependent clock interrupt code is
doing on every platform.  Every CPU has a work schedule based on the
system uptime clock.  For now, every CPU has a hardclock(9) and a
statclock().  If schedhz is set, every CPU has a schedclock(), too.

This commit only contains the MI pieces.  All code is conditionally
compiled with __HAVE_CLOCKINTR.  This commit changes no behavior yet.

At a high level, clockintr(9) is configured and used as follows:

1. During boot, the primary CPU calls clockintr_init(9).  Global state
   is initialized.
2. Primary CPU calls clockintr_cpu_init(9).  Local, per-CPU state is
   initialized.  An "intrclock" struct may be installed, too.
3. Secondary CPUs call clockintr_cpu_init(9) to initialize their
   local state.
4. All CPUs repeatedly call clockintr_dispatch(9) from the MD clock
   interrupt handler.  The CPUs complete work and rearm their local
   interrupt clock, if any, during the dispatch.
5. Repeat step (4) until the system shuts down, suspends, or hibernates.
6. During resume, the primary CPU calls inittodr(9) and advances the
   system uptime.
7. Go to step (2).  This time around, clockintr_cpu_init(9) also
   advances the work schedule on the calling CPU to skip events that
   expired during suspend.  This prevents a "thundering herd" of
   useless work during the first clock interrupt.

In the long term, we need an MI clock interrupt scheduler in order to
(1) provide control over the clock interrupt to MI subsystems like
timeout(9) and dt(4) to improve their accuracy, (2) provide drivers
like acpicpu(4) a means for slowing or stopping the clock interrupt on
idle CPUs to conserve power, and (3) reduce the amount of duplicated
code in the MD clock interrupt code.

Before we can do any of that, though, we need to switch every platform
over to using clockintr(9) and do some cleanup.

Prompted by "the vmm(4) time bug," among other problems, and a
discussion at a2k19 on the subject.  Lots of design input from
kettenis@.  Early versions reviewed by kettenis@ and mlarkin@.
Platform-specific help and testing from kettenis@, gkoehler@,
mlarkin@, miod@, aoyama@, visa@, and dv@.  Babysitting and spiritual
guidance from mlarkin@ and kettenis@.

Link: https://marc.info/?l=openbsd-tech&m=166697497302283&w=2

ok kettenis@ mlarkin@

Revision 1.229 / (download) - annotate - [select for diffs], Tue Aug 16 13:29:53 2022 UTC (21 months, 3 weeks ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.228: +3 -3 lines
Diff to previous 1.228 (colored)

Remove obsolete kern.nselcoll sysctl.

OK millert@ deraadt@

Revision 1.228 / (download) - annotate - [select for diffs], Fri May 13 15:32:00 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.227: +8 -7 lines
Diff to previous 1.227 (colored)

Use the process ps_mtx to protect the process sigacts structure.
With this cursig(), postsig() and trapsignal() become safe to be called
without KERNEL_LOCK. As a side-effect sleep with PCATCH no longer needs
the KERNEL_LOCK either. Since sending a signal can happen from interrupt
context raise the ps_mtx IPL to high.
Feedback from mpi@ and kettenis@
OK kettenis@

Revision 1.227 / (download) - annotate - [select for diffs], Fri Feb 25 18:05:49 2022 UTC (2 years, 3 months ago) by rob
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.226: +3 -3 lines
Diff to previous 1.226 (colored)

A few additional changes related to the now 32 bit accounting flag.
Pointers from and discussions with millert and deraadt.
Ok millert@, deraadt@, bluhm@

Revision 1.226 / (download) - annotate - [select for diffs], Tue Feb 22 17:05:51 2022 UTC (2 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.225: +3 -2 lines
Diff to previous 1.225 (colored)

sysctl already passed the commandname as a 24-byte string KI_MAXCOMLEN
because it was padded.  Define it in terms of _MAXCOMLEN from syslimits.h
ok millert

Revision 1.225 / (download) - annotate - [select for diffs], Tue Feb 22 03:34:51 2022 UTC (2 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.224: +5 -3 lines
Diff to previous 1.224 (colored)

The FILL_KPROC() macro should be useable in situations where sys/param.h
hasn't been included, so the use of MIN() is not legit, and a local
version is required.

Revision 1.224 / (download) - annotate - [select for diffs], Mon Feb 14 18:09:08 2022 UTC (2 years, 3 months ago) by rob
Branch: MAIN
Changes since 1.223: +1 -4 lines
Diff to previous 1.223 (colored)

Revert change to ps for displaying chrooted process.
Ok deraadt

Revision 1.223 / (download) - annotate - [select for diffs], Mon Feb 7 22:57:47 2022 UTC (2 years, 4 months ago) by rob
Branch: MAIN
Changes since 1.222: +4 -1 lines
Diff to previous 1.222 (colored)

New status flag: 'c' - process is chrooted.
Feedback and tweaks from deraadt@ guenther@
Ok bluhm@ deraadt@

Revision 1.222 / (download) - annotate - [select for diffs], Tue Jan 25 04:04:41 2022 UTC (2 years, 4 months ago) by gnezdo
Branch: MAIN
Changes since 1.221: +2 -1 lines
Diff to previous 1.221 (colored)

Capture a repeated pattern into sysctl_securelevel_int function

A few variables in the kernel are only writeable before securelevel is
raised. It makes sense to handle them with less code.

OK sthen@ bluhm@

Revision 1.221 / (download) - annotate - [select for diffs], Tue Jan 11 23:59:55 2022 UTC (2 years, 4 months ago) by jsg
Branch: MAIN
Changes since 1.220: +2 -2 lines
Diff to previous 1.220 (colored)

spelling

Revision 1.220 / (download) - annotate - [select for diffs], Tue Dec 7 22:17:03 2021 UTC (2 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.219: +3 -5 lines
Diff to previous 1.219 (colored)

Delete the last emulation callbacks: we're Just ELF, so declare
exec_elf_fixup() and coredump_elf() in <sys/exec_elf.h> and call
them and the MD setregs() directly in kern_exec.c and kern_sig.c

Also delete e_name[] (only used by sysctl), e_errno (unused), and
e_syscallnames[] (only used by SYSCALL_DEBUG) and constipate
syscallnames to 'const char *const[]'

ok kettenis@

Revision 1.219 / (download) - annotate - [select for diffs], Sat Oct 30 23:24:48 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.218: +4 -2 lines
Diff to previous 1.218 (colored)

Change hw.perfpolicy=auto by default, at startup.  If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out.  kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

Revision 1.218 / (download) - annotate - [select for diffs], Mon May 17 17:54:31 2021 UTC (3 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.217: +2 -1 lines
Diff to previous 1.217 (colored)

Forgot this directory in last commit for the UNIX-domain socket buffer
change.

Revision 1.217 / (download) - annotate - [select for diffs], Tue May 4 21:57:15 2021 UTC (3 years, 1 month ago) by bluhm
Branch: MAIN
Changes since 1.216: +3 -3 lines
Diff to previous 1.216 (colored)

Reorder the integer sysctl functions.  Then the traditional 4.4BSD
comment 'As above...' makes sense again.  Improve comments for
sysctl_int_bounded() and sysctl_bounded_arr().
OK gnezdo@ mvs@

Revision 1.216 / (download) - annotate - [select for diffs], Sat May 1 16:18:58 2021 UTC (3 years, 1 month ago) by gnezdo
Branch: MAIN
Changes since 1.215: +2 -2 lines
Diff to previous 1.215 (colored)

Removed unused SYSCTL_INT_UNBOUNDED (no use planned)

Added a comment for SYSCTL_INT_READONLY.

OK mvs@

Revision 1.215 / (download) - annotate - [select for diffs], Fri Apr 30 13:52:48 2021 UTC (3 years, 1 month ago) by bluhm
Branch: MAIN
Changes since 1.214: +4 -1 lines
Diff to previous 1.214 (colored)

Rearrange the implementation of bounded sysctl.  The primitive
functions are sysctl_int() and sysctl_rdint().  This brings us back
the 4.4BSD implementation.  Then sysctl_int_bounded() builds the
magic for range checks on top.  sysctl_bounded_arr() is a wrapper
around it to support multiple variables.
Introduce macros that describe the meaning of the magic boundary
values.  Use these macros in obvious places.
input and OK gnezdo@ mvs@

Revision 1.214 / (download) - annotate - [select for diffs], Wed Mar 10 10:21:47 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.213: +2 -2 lines
Diff to previous 1.213 (colored)

spelling

ok gnezdo@ semarie@ mpi@

Revision 1.213 / (download) - annotate - [select for diffs], Mon Dec 28 18:28:11 2020 UTC (3 years, 5 months ago) by mglocker
Branch: MAIN
Changes since 1.212: +15 -2 lines
Diff to previous 1.212 (colored)

Analog to the the kern.audio.record sysctl parameter for audio(4)
devices, introduce kern.video.record for video(4) devices.  By default
kern.video.record will be set to zero, blanking all data delivered
by device drivers which attach to video(4).

The idea was initially proposed by
Laurence Tratt <laurie AT tratt DOT net>.

ok mpi@

Revision 1.212 / (download) - annotate - [select for diffs], Sat Nov 7 05:24:20 2020 UTC (3 years, 7 months ago) by gnezdo
Branch: MAIN
Changes since 1.211: +2 -2 lines
Diff to previous 1.211 (colored)

Convert ffs_sysctl to sysctl_bounded_args

Requires sysctl_bounded_arr branch to support sysctl_rdint.
The read-only variables are marked by an empty range of [1, 0].

OK millert@

Revision 1.211 / (download) - annotate - [select for diffs], Tue Sep 1 01:53:50 2020 UTC (3 years, 9 months ago) by gnezdo
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.210: +1 -2 lines
Diff to previous 1.210 (colored)

Remove unused sysctl_int_arr(9)

Revision 1.210 / (download) - annotate - [select for diffs], Sun Aug 23 09:35:32 2020 UTC (3 years, 9 months ago) by kn
Branch: MAIN
Changes since 1.209: +1 -5 lines
Diff to previous 1.209 (colored)

Remove unused debug_syncprt, improve debug sysctl handling

"syncprt" is unused since kern/vfs_syscalls.c r1.147 from 2008.

Adding new debug sysctls is a bit opaque and looking at kern/kern_sysctl.c
the only visible difference between used and stub ctldebug structs in the
debugvars[] array is their extern keyword, indicating that it is defined
elsewhere.

sys/sysctl.h declares all debugN members as extern upfront, but these
declarations are not needed.

Remove the unused debug sysctl, rename the only remaining one to something
meaningful and remove forward declarations from /sys/sysctl.h;  this way,
adding new debug sysctls is a matter of adding extern and coming up with a
name, which is nicer to read on its own and better to grep for.

OK mpi

Revision 1.209 / (download) - annotate - [select for diffs], Sat Aug 22 11:47:22 2020 UTC (3 years, 9 months ago) by kn
Branch: MAIN
Changes since 1.208: +4 -4 lines
Diff to previous 1.208 (colored)

Move sysctl(2) CTL_DEBUG from DEBUG to new DEBUG_SYSCTL

Adding "debug.my-knob" sysctls is really helpful to select different
code paths and/or log on demand during runtime without recompile,
but as this code is under DEBUG, lots of other noise comes with it
which is often undesired, at least when looking at specific subsystems
only.

Adding globals to the kernel and breaking into DDB to change them helps,
but that does not work over SSH, hence the need for debug sysctls.

Introduces DEBUG_SYSCTL to make use of the "debug" MIB without the rest of
DEBUG; it's DEBUG_SYSCTL and not SYSCTL_DEBUG because it's not a general
option for all of sysctl(2).

OK gnezdo

Revision 1.208 / (download) - annotate - [select for diffs], Tue Aug 18 04:48:12 2020 UTC (3 years, 9 months ago) by gnezdo
Branch: MAIN
Changes since 1.207: +15 -1 lines
Diff to previous 1.207 (colored)

Add sysctl_bounded_arr as a replacement for sysctl_int_arr

Design by deraadt@

ok deraadt@

Revision 1.207 / (download) - annotate - [select for diffs], Sat Aug 1 23:41:56 2020 UTC (3 years, 10 months ago) by gnezdo
Branch: MAIN
Changes since 1.206: +2 -2 lines
Diff to previous 1.206 (colored)

Move range check inside sysctl_int_arr

Range violations are now consistently reported as EOPNOTSUPP.
Previously they were mixed with ENOPROTOOPT.

OK kn@

Revision 1.206 / (download) - annotate - [select for diffs], Sun May 10 00:56:06 2020 UTC (4 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.205: +5 -5 lines
Diff to previous 1.205 (colored)

Use a double-underscore prefix for local variables declared in macros
that have arguments.  Document this requirement/recommendation in style(9)

prompted by mpi@
ok deraadt@

Revision 1.205 / (download) - annotate - [select for diffs], Fri Mar 13 10:07:01 2020 UTC (4 years, 2 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.204: +2 -2 lines
Diff to previous 1.204 (colored)

In order to unlock flock(2), make writes to the f_iflags field of struct
file atomic. This also gets rid of the last kernel lock protected field
in the scope of struct file.

ok mpi@ visa@

Revision 1.204 / (download) - annotate - [select for diffs], Sun Feb 16 07:55:30 2020 UTC (4 years, 3 months ago) by anton
Branch: MAIN
Changes since 1.203: +2 -2 lines
Diff to previous 1.203 (colored)

Cope with latest changes to the ps_flags field of struct process which
is unsigned by now.

ok millert@ visa@

Revision 1.203 / (download) - annotate - [select for diffs], Sat Feb 15 09:35:48 2020 UTC (4 years, 3 months ago) by anton
Branch: MAIN
Changes since 1.202: +2 -2 lines
Diff to previous 1.202 (colored)

Consistently perform atomic writes to the ps_flags field of struct
process.

ok bluhm@ claudio@ visa@

Revision 1.202 / (download) - annotate - [select for diffs], Sat Feb 1 08:57:27 2020 UTC (4 years, 4 months ago) by anton
Branch: MAIN
Changes since 1.201: +2 -2 lines
Diff to previous 1.201 (colored)

Make writes to the f_flag field of `struct file' MP-safe using atomic
operations. Since the type of f_flag must change in order to use the
atomic(9) API, reorder the struct in order to avoid padding; as pointed
out by tedu@.

ok mpi@ visa@

Revision 1.201 / (download) - annotate - [select for diffs], Thu Jan 30 08:51:27 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.200: +6 -2 lines
Diff to previous 1.200 (colored)

Split `p_priority' into `p_runpri' and `p_slppri'.

Using different fields to remember in which runqueue or sleepqueue
threads currently are will make it easier to split the SCHED_LOCK().

With this change, the (potentially boosted) sleeping priority is no
longer overwriting the thread priority.  This let us get rids of the
logic required to synchronize `p_priority' with `p_usrpri'.

Tested by many, ok visa@

Revision 1.200 / (download) - annotate - [select for diffs], Fri Jan 24 14:00:32 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.199: +3 -3 lines
Diff to previous 1.199 (colored)

New `kern.allowdt' button must be set to open(2) /dev/dt.

dt(4) exposes kernel internals, addresses and content of states to
userland.  As such its interface shouldn't be available without
enabling it consciously.

ok millert@, deraadt@

Revision 1.199 / (download) - annotate - [select for diffs], Tue Dec 24 13:13:54 2019 UTC (4 years, 5 months ago) by bluhm
Branch: MAIN
Changes since 1.198: +3 -3 lines
Diff to previous 1.198 (colored)

Fill in names for consbufsize and consbuf sysctl for nicer kdump(1)
output.

Revision 1.198 / (download) - annotate - [select for diffs], Wed Dec 11 07:30:09 2019 UTC (4 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.197: +2 -2 lines
Diff to previous 1.197 (colored)

Replace p_xstat with ps_xexit and ps_xsig
Convert those to a consolidated status when needed in wait4(), kevent(),
	and sysctl()
Pass exit code and signal separately to exit1()
(This also serves as prep for adding waitid(2))

ok mpi@

Revision 1.197 / (download) - annotate - [select for diffs], Fri Dec 6 08:33:25 2019 UTC (4 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.196: +11 -2 lines
Diff to previous 1.196 (colored)

Sync KVE_ET_* and UVM_ET_* flags.

ok guenther@

Revision 1.196 / (download) - annotate - [select for diffs], Tue Oct 22 21:19:22 2019 UTC (4 years, 7 months ago) by cheloha
Branch: MAIN
Changes since 1.195: +1 -4 lines
Diff to previous 1.195 (colored)

struct proc: change ps_start from utc time to uptime

Allows us to determine how long a process has been running, even if the
UTC clock jumps.

With help from bluhm@ and millert@, who squashed several bugs.

ok bluhm@ millert@

Revision 1.195 / (download) - annotate - [select for diffs], Wed Aug 21 20:44:09 2019 UTC (4 years, 9 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.194: +4 -2 lines
Diff to previous 1.194 (colored)

sysctl(2): add kern.utc_offset: successor to the DST/TIMEZONE options(4)

The DST and TIMEZONE options(4) are incompatible with KARL, so we need
some other way to compensate for an RTC running with a known offset.

Enter kern.utc_offset, an offset in minutes East of UTC.  TIMEZONE has
always been minutes West, but this is inconsistent with how everyone
else talks about timezones, hence the flip.

TIMEZONE has the advantage of being compiled into the binary.  Our new
sysctl(2) has no such luck, so it needs to be set as early as possible
in boot, from sysctl.conf(5), so we can correct the kernel clock from
the RTC's local time to UTC before daemons like ntpd(8) and cron(8)
start.  To encourage this, kern.utc_offset is made immutable after the
securelevel(7) is raised to 1.

Prompted by yasuoka@.  Discussed with deraadt@, kettenis@, yasuoka@.
Additional testing by yasuoka@.

ok deraadt@, yasuoka@

Revision 1.194 / (download) - annotate - [select for diffs], Fri Jul 12 00:04:59 2019 UTC (4 years, 11 months ago) by cheloha
Branch: MAIN
Changes since 1.193: +4 -2 lines
Diff to previous 1.193 (colored)

sysctl(2): add KERN_TIMEOUT_STATS: timeout(9) status and statistics.

With these totals one can track the throughput of the timeout(9) layer
from userspace.

With input from mpi@.

ok mpi@

Revision 1.193 / (download) - annotate - [select for diffs], Wed Jul 3 10:19:45 2019 UTC (4 years, 11 months ago) by dlg
Branch: MAIN
Changes since 1.192: +2 -1 lines
Diff to previous 1.192 (colored)

add the kernel side of net.link.ifrxq.pressure_return and pressure_drop

these values are used as the backpressure thresholds in the interface
rx q processing code. theyre being exposed as tunables to userland
while we are figuring out what the best values for them are.

ok visa@ deraadt@

Revision 1.192 / (download) - annotate - [select for diffs], Tue Jun 25 14:08:57 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.191: +3 -2 lines
Diff to previous 1.191 (colored)

move new element p_pledge to the tailof kinfo_proc to increase
backwards-compat handling.
pointed out by sthen, ok millert

Revision 1.191 / (download) - annotate - [select for diffs], Sun Jun 23 17:18:50 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.190: +3 -1 lines
Diff to previous 1.190 (colored)

add "ps -o pledge" option, which prints a comma-seperated list of pledges
active on each process.  So go forth and "ps agux -o pledge" to find pledges
which can be improved.

(I hesitated adding this before because I am afraid of people
enforcing extra-strict pledge in programs without testing all the use
cases -- thereby breaking software).

Revision 1.190 / (download) - annotate - [select for diffs], Sun Jun 23 16:57:00 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.189: +9 -3 lines
Diff to previous 1.189 (colored)

Export unveil state so that ps(8) can show it.  Two new status flags,
you'll see one, or neither.
'u' - process installed unveils, but not yet locked with unveil(0,0)
      or pledge w/o "unveil"
'U' - process has installed unveils, and locked.
ok rob

Revision 1.189 / (download) - annotate - [select for diffs], Fri Jun 21 09:39:48 2019 UTC (4 years, 11 months ago) by visa
Branch: MAIN
Changes since 1.188: +11 -1 lines
Diff to previous 1.188 (colored)

Make resource limit access MP-safe. So far, the copy-on-write sharing
of resource limit structs has been done between processes. By applying
copy-on-write also between threads, threads can read rlimits in
a nearly lock-free manner.

Inspired by code in DragonFly BSD and FreeBSD.

OK mpi@, agreement from jmatthew@ and anton@

Revision 1.188 / (download) - annotate - [select for diffs], Sat Jun 1 14:11:18 2019 UTC (5 years ago) by mpi
Branch: MAIN
Changes since 1.187: +1 -11 lines
Diff to previous 1.187 (colored)

Revert to using the SCHED_LOCK() to protect time accounting.

It currently creates a lock ordering problem because SCHED_LOCK() is taken
by hardclock().  That means the "priorities" of a thread should be moved
out of the SCHED_LOCK() first in order to make progress.

Reported-by: syzbot+8e4863b3dde88eb706dc@syzkaller.appspotmail.com
via anton@ as well as by kettenis@

Revision 1.187 / (download) - annotate - [select for diffs], Fri May 31 19:51:10 2019 UTC (5 years ago) by mpi
Branch: MAIN
Changes since 1.186: +11 -1 lines
Diff to previous 1.186 (colored)

Use a per-process mutex to protect time accounting instead of SCHED_LOCK().

Note that hardclock(9) still increments p_{u,s,i}ticks without holding a
lock.

ok visa@, cheloha@

Revision 1.186 / (download) - annotate - [select for diffs], Mon May 13 19:21:31 2019 UTC (5 years ago) by bluhm
Branch: MAIN
Changes since 1.185: +2 -2 lines
Diff to previous 1.185 (colored)

When killing a process, the signal is handled by any thread that
does not block the signal.  If all threads block the signal, we
delivered it to the main thread.  This does not conform to POSIX.
If any thread unblocks the signal, it should be delivered immediately
to this thread.
Mark such signals pending at the process instead of a single thread.
Then any thread can handle it later.
OK kettenis@ guenther@

Revision 1.185 / (download) - annotate - [select for diffs], Thu May 9 14:59:30 2019 UTC (5 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.184: +5 -2 lines
Diff to previous 1.184 (colored)

Add a sysctl accessor to struct pf_status. The pf_status only holds the
current status and statistics and can be exported without super-user
rights via sysctl to make it easier for tools like systat to access those.
OK deraadt@, sashan@

Revision 1.184 / (download) - annotate - [select for diffs], Thu Feb 7 15:11:38 2019 UTC (5 years, 4 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.183: +4 -2 lines
Diff to previous 1.183 (colored)

Add lock stack trace saving for witness(4).

This lets witness(4) save a stack trace on each lock acquisition.
The saved traces can be viewed in ddb(4) when showing the currently
held locks, which may help when debugging incorrect locking.

Sample output:

ddb{0}> show all locks
Process 63836 (rm) thread 0xffff8000221e52c8 (435004)
exclusive rrwlock inode r = 0 (0xfffffd8119a092c0) locked @ /usr/src/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x419
#1  _rw_enter+0x2bb
#2  _rrw_enter+0x42
#3  VOP_LOCK+0x3f
#4  vn_lock+0x36
#5  vfs_lookup+0xa1
#6  namei+0x2b3
#7  dounlinkat+0x85
#8  syscall+0x338
#9  Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 1 (0xffffffff81e6a5f0) locked @ /usr/src/sys/arch/amd64/amd64/intr.c:525
#0  witness_lock+0x419
#1  syscall+0x2b6
#2  Xsyscall+0x128

The saving adds overhead, so it is not enabled by default. It can be
taken into use by setting sysctl kern.witness.locktrace=1 at runtime
or by defining WITNESS_LOCKTRACE in the kernel configuration.

Feedback and OK anton@

Revision 1.183 / (download) - annotate - [select for diffs], Thu Jan 31 05:33:51 2019 UTC (5 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.182: +2 -2 lines
Diff to previous 1.182 (colored)

remove remnant of jackport

Revision 1.182 / (download) - annotate - [select for diffs], Tue Jan 29 14:07:15 2019 UTC (5 years, 4 months ago) by visa
Branch: MAIN
Changes since 1.181: +14 -3 lines
Diff to previous 1.181 (colored)

Add a dedicated sysctl(2) node for witness(4).

The new node contains the subsystem's main control variable,
kern.witness.watch. It is aliased by the old name, kern.witnesswatch.
The alias will be removed in the future.

OK anton@ mpi@

Revision 1.181 / (download) - annotate - [select for diffs], Mon Nov 19 16:12:06 2018 UTC (5 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.180: +2 -2 lines
Diff to previous 1.180 (colored)

delete the dns jackport experiment. it has no future.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Nov 17 23:10:08 2018 UTC (5 years, 6 months ago) by cheloha
Branch: MAIN
Changes since 1.179: +4 -2 lines
Diff to previous 1.179 (colored)

Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs.

Because of hw.smt we need a way to determine whether a given CPU is "online"
or "offline" from userspace.  KERN_CPTIME2 is an array, and so cannot be
cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS
with an extensible struct.  At the moment it's just KERN_CPTIME2 with a
flags member, but it can grow as needed.

KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are
few (if any) packages in the wild still using the symbol so breakage in ports
should be near zero.  No other system inherited the symbol from BSDi, either.

Then, use the new sysctl(2) in systat(1) and top(1):

  - systat(1) draws placeholder marks ('-') instead of percentages for
    offline CPUs in the cpu view.

  - systat(1) omits offline CPU ticks when drawing the "big bar" in
    the vmstat view.  The upshot is that the bar isn't half idle when
    half your logical CPUs are disabled.

  - top(1) does not draw lines for offline CPUs; if CPUs toggle on or
    offline in interactive mode we redraw the display to expand/reduce
    space for the new/missing CPUs.  This is consistent with what some
    top(1) implementations do on Linux.

  - top(1) omits offline CPUs from the totals when CPU totals are
    combined into a single line (the '-1' flag).

Originally prompted by deraadt@.  Discussed endlessly with deraadt@,
ketennis@, and sthen@.  Tested by jmc@ and jca@.  Earlier versions also
discussed with jca@.  Earlier versions tested by jmc@, tb@, and many
others.

docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@,
"Is your stuff in yet?" deraadt@

Revision 1.179 / (download) - annotate - [select for diffs], Thu Jul 12 01:23:38 2018 UTC (5 years, 11 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.178: +6 -4 lines
Diff to previous 1.178 (colored)

Add hw.ncpuonline to count the number of online CPUs.

The introduction of hw.smt means that logical CPUs can be disabled
after boot and prior to suspend/resume.  If hw.smt=0 (the default),
there needs to be a way to count the number of hardware threads
available on the system at any given time.

So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it.
hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu()
during boot, while hw.ncpuonline is equal to the number of CPUs available
to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN
equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu.

This is preferable to adding a new sysctl to count the number of
configured CPUs and keeping hw.ncpu equal to the number of online
CPUs because such a change would break software in the ecosystem
that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like.
Such software in base includes top(1), systat(1), and snmpd(8),
and perhaps others.

We don't need additional locking to count the cardinality of a cpuset
in this case because the only interfaces that can modify said cardinality
are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK.

Software using HW_NCPU/hw.ncpu to determine optimal parallism will need
to be updated to use HW_NCPUONLINE/hw.ncpuonline.  Until then, such software
may perform suboptimally.  However, most changes will be similar to the
change included here for libcxx's std::thread:hardware_concurrency():
using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining
optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN
is insufficient.

Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen.
Lots of patch tweaks from kettenis.

ok kettenis, "proceed" deraadt

Revision 1.178 / (download) - annotate - [select for diffs], Tue Jun 19 19:29:52 2018 UTC (5 years, 11 months ago) by kettenis
Branch: MAIN
Changes since 1.177: +4 -2 lines
Diff to previous 1.177 (colored)

SMT (Simultanious Multi Threading) implementations typically share
TLBs and L1 caches between threads.  This can make cache timing
attacks a lot easier and we strongly suspect that this will make
several spectre-class bugs exploitable.  Especially on Intel's SMT
implementation which is better known as Hypter-threading.  We really
should not run different security domains on different processor
threads of the same core.  Unfortunately changing our scheduler to
take this into account is far from trivial.  Since many modern
machines no longer provide the ability to disable Hyper-threading in
the BIOS setup, provide a way to disable the use of additional
processor threads in our scheduler.  And since we suspect there are
serious risks, we disable them by default.  This can be controlled
through a new hw.smt sysctl.  For now this only works on Intel CPUs
when running OpenBSD/amd64.  But we're planning to extend this feature
to CPUs from other vendors and other hardware architectures.

Note that SMT doesn't necessarily have a posive effect on performance;
it highly depends on the workload.  In all likelyhood it will actually
slow down most workloads if you have a CPU with more than two cores.

ok deraadt@

Revision 1.177 / (download) - annotate - [select for diffs], Sat May 26 10:16:14 2018 UTC (6 years ago) by ratchov
Branch: MAIN
Changes since 1.176: +17 -2 lines
Diff to previous 1.176 (colored)

In addition to "on" and "off", allow the audio "record.enable" mixer
knob to take the new "sysctl" value, which is the default. In this
case, the device behavior is determined by the new "kern.audio.record"
sysctl(2), which defaults to zero.

ok florian

Revision 1.176 / (download) - annotate - [select for diffs], Wed May 16 14:53:43 2018 UTC (6 years ago) by visa
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored)

Add kern.witnesswatch sysctl for controlling witness(4). By default,
lock order checking is disabled but it can be enabled at runtime.

Suggested by deraadt@ / mpi@
OK mpi@

Revision 1.175 / (download) - annotate - [select for diffs], Thu Oct 12 09:14:16 2017 UTC (6 years, 7 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.174: +4 -1 lines
Diff to previous 1.174 (colored)

Move sysctl_mq() where it can safely mess with mbuf queue internals.

ok visa@, bluhm@, deraadt@

Revision 1.174 / (download) - annotate - [select for diffs], Wed Jun 14 03:00:40 2017 UTC (6 years, 11 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.173: +4 -4 lines
Diff to previous 1.173 (colored)

tweak sysctl_string and sysctl_tstring to use size_t for lengths, not int

theyre both wrappers around sysctl__string, which is where half the
fix is too.

Revision 1.173 / (download) - annotate - [select for diffs], Tue Jun 13 06:16:31 2017 UTC (6 years, 11 months ago) by dlg
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored)

use size_t for the size of things in memory, not int.

this tweaks the len argument to sysctl_rdstring, sysctl_struct, and
sysctl_rdstruct.

there's probably more to fix.

ok millert@

Revision 1.172 / (download) - annotate - [select for diffs], Mon Feb 27 19:16:56 2017 UTC (7 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.171: +2 -1 lines
Diff to previous 1.171 (colored)

Retire the AF_MPLS protosw struct. Nothing is using it and the code was super
basic anyway. Simplifies the code a lot also by calling the mpls sysctl no
longer via the protosw but instead directly.
OK mpi@ on a previous diff. Also tested by renato@ who actually found a bug
which is now fixed.

Revision 1.171 / (download) - annotate - [select for diffs], Sat Jan 21 05:42:03 2017 UTC (7 years, 4 months ago) by guenther
Branch: MAIN
Changes since 1.170: +2 -2 lines
Diff to previous 1.170 (colored)

p_comm is the process's command and isn't per thread, so move it from
struct proc to struct process.

ok deraadt@ kettenis@

Revision 1.170 / (download) - annotate - [select for diffs], Mon Nov 7 00:26:32 2016 UTC (7 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.169: +5 -3 lines
Diff to previous 1.169 (colored)

Split PID from TID, giving processes a PID unrelated to the TID of their
initial thread

ok jsing@ kettenis@

Revision 1.169 / (download) - annotate - [select for diffs], Fri Oct 7 19:04:44 2016 UTC (7 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored)

introduce a sysctl to hijack dns sockets. when set to a port number,
all dns socket connections will be redirected to localhost:port.
this could be a sockopt on the listening socket, but sysctl is
an easier interface to work with right now.
ok deraadt

Revision 1.168 / (download) - annotate - [select for diffs], Sun Oct 2 23:11:55 2016 UTC (7 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.167: +3 -1 lines
Diff to previous 1.167 (colored)

Add va_nlink information to struct kinfo_file (so bump the shlib minor)

from Sebastien Marie

Revision 1.167 / (download) - annotate - [select for diffs], Sun Sep 25 15:23:37 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.166: +5 -5 lines
Diff to previous 1.166 (colored)

Make a move towards ending 4 decades of kernel snooping.

Add sysctl kern.allowkmem (default 0) which controls the ability to open
/dev/mem or /dev/kmem at securelevel > 0.  Over 15 years we converted 99%
of utilities in the tree to operate on sysctl-nodes (either by themselves
or via code hiding in the guts of -lkvm).

pstat -d and -v & procmap are affected and continued use of them will
require kern.allowkmem=1 in /etc/sysctl.conf.  acpidump (and it's
buddy sendbug) are affected, but we'll work out a solution soon.

There will be some impact in ports.

ok kettenis guenther

Revision 1.166 / (download) - annotate - [select for diffs], Wed Sep 21 14:06:50 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.165: +3 -3 lines
Diff to previous 1.165 (colored)

sysctl KERN_ARND is no longer used (in ports, it only occurs in fallback
paths of libevent).  This interface was the first generation of what
eventually became getentropy(2) and arc4random(3) -- june 1997!
Ports scan by sthen, general agreement guenther

Revision 1.165 / (download) - annotate - [select for diffs], Wed Sep 7 17:30:12 2016 UTC (7 years, 9 months ago) by natano
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored)

Remove usermount remnants. ok tedu

Revision 1.164 / (download) - annotate - [select for diffs], Sun Sep 4 09:22:29 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.163: +2 -2 lines
Diff to previous 1.163 (colored)

Introduce Dynamic Profiling, a ddb(4) based & gprof compatible kernel
profiling framework.

Code patching is used to enable probes when entering functions.  The
probes will call a mcount()-like function to match the behavior of a
GPROF kernel.

Currently only available on amd64 and guarded under DDBPROF.  Support
for other archs will follow soon.

A new sysctl knob, ddb.console, need to be set to 1 in securelevel 0
to be able to use this feature.

Inputs and ok guenther@

Revision 1.163 / (download) - annotate - [select for diffs], Fri May 27 19:45:04 2016 UTC (8 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.162: +3 -3 lines
Diff to previous 1.162 (colored)

W^X violations are no longer permitted by default.  A kernel log message
is generated, and mprotect/mmap return ENOTSUP.  If the sysctl(8) flag
kern.wxabort is set then a SIGABRT occurs instead, for gdb use or coredump
creation.

W^X violating programs can be permitted on a ffs/nfs filesystem-basis,
using the "wxallowed" mount option.  One day far in the future
upstream software developers will understand that W^X violations are a
tremendously risky practice and that style of programming will be
banished outright.  Until then, we recommend most users need to use the
wxallowed option on their /usr/local filesystem.  At least your other
filesystems don't permit such programs.

ok jca kettenis mlarkin natano

Revision 1.162 / (download) - annotate - [select for diffs], Mon May 23 15:48:57 2016 UTC (8 years ago) by deraadt
Branch: MAIN
Changes since 1.161: +3 -3 lines
Diff to previous 1.161 (colored)

remove the sysctl kern.random counters, since none of the remaining
ones are capable of giving valuable works vs does-not-work evidence.
ok tedu

Revision 1.161 / (download) - annotate - [select for diffs], Tue May 10 01:33:03 2016 UTC (8 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.160: +2 -2 lines
Diff to previous 1.160 (colored)

rename an unused field in struct kinfo_file (it related to systrace..)

Revision 1.160 / (download) - annotate - [select for diffs], Mon Apr 25 20:18:31 2016 UTC (8 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.159: +2 -3 lines
Diff to previous 1.159 (colored)

remove systrace remnants

Revision 1.159 / (download) - annotate - [select for diffs], Thu Mar 17 12:30:04 2016 UTC (8 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

Fix a comment about ``p_usrpri'', from Michal Mazurek.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Feb 29 19:44:07 2016 UTC (8 years, 3 months ago) by naddy
Branch: MAIN
Changes since 1.157: +3 -12 lines
Diff to previous 1.157 (colored)

delete the kern.emul/KERN_EMUL sysctl bits since there are no
emulations left; ok millert@ deraadt@, jmc@ (man pages)

Revision 1.157 / (download) - annotate - [select for diffs], Fri Oct 23 10:22:30 2015 UTC (8 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.156: +1 -2 lines
Diff to previous 1.156 (colored)

Introduce a new sysctl NET_RT_IFNAMES that returns only ifnames to ifindex
mappings. This will be used by if_nameindex(3), if_nametoindex(3) and
if_indextoname(3) soon to fix the issues in pledge because of inet6 link
local addressing.
OK mpi@ benno@ deraadt@
The libc version will follow soon so better start updating your kernels

Revision 1.156 / (download) - annotate - [select for diffs], Sat Jul 18 15:51:17 2015 UTC (8 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.155: +3 -3 lines
Diff to previous 1.155 (colored)

Abstract the routing table internals behind an rtable_* API.

Code abusing the radix internals for the routing table should now
includes <net/rtable.h> and only deal with "struct rtentry".

Code using a radix tree for another purpose can still include
<net/radix.h>.

Inputs from and ok claudio@, mikeb@

Revision 1.155 / (download) - annotate - [select for diffs], Wed Feb 11 05:09:33 2015 UTC (9 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.154: +6 -1 lines
Diff to previous 1.154 (colored)

Extend struct kinfo_file a bit so that netstat has all the info it needs.
OK guenther@

Revision 1.154 / (download) - annotate - [select for diffs], Tue Jan 13 10:07:58 2015 UTC (9 years, 4 months ago) by mpf
Branch: MAIN
Changes since 1.153: +4 -2 lines
Diff to previous 1.153 (colored)

Add dmesg -s support, to view the output of rc(8) system startup messages.
Help and feedback by Theo and Miod.
OK deraadt@, manpage-ok jmc@

Revision 1.153 / (download) - annotate - [select for diffs], Fri Dec 12 07:45:46 2014 UTC (9 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.152: +4 -2 lines
Diff to previous 1.152 (colored)

sysctl kern.global_ptrace.
controls whether you can ptrace any process with appropriate privileges
or only one own's children.
ok deraadt

Revision 1.152 / (download) - annotate - [select for diffs], Fri Dec 5 04:12:48 2014 UTC (9 years, 6 months ago) by uebayasi
Branch: MAIN
Changes since 1.151: +48 -2 lines
Diff to previous 1.151 (colored)

Introduce a new sysctl to retrieve VM map entries

This adds a new sysctl KERN_PROC_VMMAP, which returns an array of VM map
entries of a specified process.  This prevents debuggers from iterating
vm_map_entry RB tree via kvm(3).

The name KERN_PROC_VMMAP and struct kinfo_vmentry are chosen from the same
function in FreeBSD.  struct kinfo_vmentry is revised to reduce size, because
OpenBSD does not keep track of filepaths.  The semantic is also changed to
return max buffer size as a hint, and start iteration at the specified base
address.

Much valuable input from deraadt@, guenther@, tedu@

OK tedu@ deraadt@

Revision 1.151 / (download) - annotate - [select for diffs], Wed Nov 19 18:04:54 2014 UTC (9 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.150: +9 -9 lines
Diff to previous 1.150 (colored)

delete the KERN_VNODE sysctl. it fails to provide any isolation from the
kernel struct vnode defintion, and the only consumer (pstat) still needs
kvm to read much of the required information. no great loss to always use
kvm until there's a better replacement interface.
ok deraadt millert uebayasi

Revision 1.150 / (download) - annotate - [select for diffs], Fri Oct 17 01:51:39 2014 UTC (9 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.149: +4 -2 lines
Diff to previous 1.149 (colored)

redo the performance throttling in the kernel.
introduce a new sysctl, hw.perfpolicy, that governs the policy.
when set to anything other than manual, hw.setperf then becomes read only.
phessler was heading in this direction, but this is slightly different. :)

Revision 1.149 / (download) - annotate - [select for diffs], Wed Aug 20 06:23:03 2014 UTC (9 years, 9 months ago) by mikeb
Branch: MAIN
Changes since 1.148: +7 -7 lines
Diff to previous 1.148 (colored)

Bye bye /dev/crypto

The interface has been disabled by default for about 4 years and
currently there's not much value in having it around at all.

ok deraadt

Revision 1.148 / (download) - annotate - [select for diffs], Sun Jul 13 16:41:22 2014 UTC (9 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.147: +4 -2 lines
Diff to previous 1.147 (colored)

Introduce PS_NOBROADCASTKILL a process flag that excludes processes from
receiving broadcast signals (kill -1). The flag can be set via a new
sysctl KERN_PROC_NOBROADCASTKILL. This will be used by iscsid to survive
the mass killing by init(8) when terminating multi-user operations.
With and OK guenther@

Revision 1.147 / (download) - annotate - [select for diffs], Tue Jul 8 17:19:26 2014 UTC (9 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored)

decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.h
don't need to be married.
ok guenther miod beck jsing kettenis

Revision 1.146 / (download) - annotate - [select for diffs], Fri Jul 4 05:58:30 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.145: +3 -4 lines
Diff to previous 1.145 (colored)

Track whether a process is a zombie or not yet fully built via flags
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's
thread data.  This eliminates the need for the thread-level SDEAD state.

Change kvm_getprocs() (both the sysctl() and kvm backends) to report the
"most active" scheduler state for the process's threads.

tweaks kettenis@
feedback and ok matthew@

Revision 1.145 / (download) - annotate - [select for diffs], Thu May 15 03:52:25 2014 UTC (10 years ago) by guenther
Branch: MAIN
Changes since 1.144: +5 -6 lines
Diff to previous 1.144 (colored)

Move from struct proc to process the reference-count-holding pointers
to the process's vmspace and filedescs.  struct proc continues to
keep copies of the pointers, copying them on fork, clearing them
on exit, and (for vmspace) refreshing on exec.
Also, make uvm_swapout_threads() thread aware, eliminating p_swtime
in kernel.

particular testing by ajacoutot@ and sebastia@

Revision 1.144 / (download) - annotate - [select for diffs], Sun Mar 30 21:54:48 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.143: +6 -7 lines
Diff to previous 1.143 (colored)

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@

Revision 1.143 / (download) - annotate - [select for diffs], Wed Mar 26 05:23:41 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

Move p_emul and p_sigcode from proc to process.
Tweak the handling of ktrace EMUL when changing ktracing: only
generate one per process (not one per thread) and pass the correct
proc pointer down to the VFS layer.  Permit generating of NAMI and
CSW records inside ktrace(2) itself.

ok deraadt@ millert@

Revision 1.142 / (download) - annotate - [select for diffs], Sat Mar 22 06:05:45 2014 UTC (10 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.141: +2 -2 lines
Diff to previous 1.141 (colored)

Move p_sigacts from struct proc to struct process.

testing help mpi@

Revision 1.141 / (download) - annotate - [select for diffs], Wed Feb 12 05:47:36 2014 UTC (10 years, 3 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.140: +3 -3 lines
Diff to previous 1.140 (colored)

Eliminate the exit sig handling, which was only invokable via the
Linux-compat clone() syscall when *not* using CLONE_THREAD.  pirofti@
confirms Opera runs in compat without this, so out it goes; one less hair
to choke on in kern_exit.c

ok tedu@ pirofti@

Revision 1.140 / (download) - annotate - [select for diffs], Sat Feb 8 00:51:13 2014 UTC (10 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.139: +2 -5 lines
Diff to previous 1.139 (colored)

only copy wmesg if wchan, after chatting with guenther and millert.
(and no need to copy empty string, it's already been zero filled.)

Revision 1.139 / (download) - annotate - [select for diffs], Tue Oct 22 16:40:26 2013 UTC (10 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.138: +16 -9 lines
Diff to previous 1.138 (colored)

- add UNIX-domain socket info to struct kinfo_file2
- convert netstat from kvm_getfiles() to kvm_getfile2() using that
- delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major)
- rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file
  and KERN_FILE2 to KERN_FILE.

ok deraadt@, millert@
ports scan sthen@

Revision 1.138 / (download) - annotate - [select for diffs], Sun Sep 22 17:28:33 2013 UTC (10 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.137: +5 -3 lines
Diff to previous 1.137 (colored)

Stop merging the per-thread and per-process flags when reporting
them via sysctl(KERN_PROC).  In struct kinfo_proc the per-process
flags move to p_psflags, leaving the per-thread flags in p_flags.
Flag descriptions in ps(1) updated to be less obtuse.

discussed with matthew@ some time ago; ok jca@, manpage bits ok jmc@

Revision 1.137 / (download) - annotate - [select for diffs], Tue Aug 13 05:52:27 2013 UTC (10 years, 10 months ago) by guenther
Branch: MAIN
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types.  Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments.  Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir.  Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility.  Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@

Revision 1.136 / (download) - annotate - [select for diffs], Sun Jun 9 13:10:19 2013 UTC (11 years ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)

Constify the mib argument of sysctl().
ok matthew@ millert@

Revision 1.135 / (download) - annotate - [select for diffs], Mon Jun 3 16:55:22 2013 UTC (11 years ago) by guenther
Branch: MAIN
Changes since 1.134: +4 -4 lines
Diff to previous 1.134 (colored)

Convert some internal APIs to use timespecs instead of timevals

ok matthew@ deraadt@

Revision 1.134 / (download) - annotate - [select for diffs], Mon Apr 15 16:47:14 2013 UTC (11 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.133: +3 -52 lines
Diff to previous 1.133 (colored)

Remove CTL_USER hierarchy from sysctl()
(Use sysconf() or confstr() instead)

ok miod@ millert@

Revision 1.133 / (download) - annotate - [select for diffs], Thu Apr 11 04:30:59 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.132: +4 -1 lines
Diff to previous 1.132 (colored)

copy out a blank string if no wmesg, so userland can rely on reading
p_wmesg[0] and not find junk leftover from before

Revision 1.132 / (download) - annotate - [select for diffs], Sat Apr 6 03:44:34 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.131: +3 -3 lines
Diff to previous 1.131 (colored)

rthreads are always enabled. remove the sysctl.
ok deraadt guenther kettenis matthew

Revision 1.131 / (download) - annotate - [select for diffs], Sun Mar 24 00:09:31 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

pstats is already 0, but the bonus = 0 belongs outside the pointer section

Revision 1.130 / (download) - annotate - [select for diffs], Sat Mar 23 21:22:20 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.129: +7 -15 lines
Diff to previous 1.129 (colored)

pull the suser check for sysctl pointers up higher, out of the loops.
hide a few more pointery things.
ok deraadt

Revision 1.129 / (download) - annotate - [select for diffs], Wed Mar 20 04:26:11 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.128: +9 -8 lines
Diff to previous 1.128 (colored)

p_sigacts can also be zero'd; spotted by tedu

Revision 1.128 / (download) - annotate - [select for diffs], Wed Mar 20 03:43:07 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.127: +13 -7 lines
Diff to previous 1.127 (colored)

When non-root asks sysctl for kinfo proc or file requests, do not fill in
any kernel addresses information.
ok guenther

Revision 1.127 / (download) - annotate - [select for diffs], Tue Dec 18 21:28:45 2012 UTC (11 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.126: +1 -6 lines
Diff to previous 1.126 (colored)

We no longer use struct eproc for kinfo_proc in sysctl.h so there
is no direct need for sys/proc.h or sys/resource.h.  Some consumers
of kinfo_proc need these for the proc flags and rlimit defines like
RLIM_INF so add the appropriate includes to them.
OK deraadt@ sthen@

Revision 1.126 / (download) - annotate - [select for diffs], Wed Dec 5 23:20:24 2012 UTC (11 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.125: +1 -2 lines
Diff to previous 1.125 (colored)

Remove excessive sys/cdefs.h inclusion
ok guenther millert kettenis

Revision 1.125 / (download) - annotate - [select for diffs], Tue Apr 17 23:17:53 2012 UTC (12 years, 1 month ago) by pirofti
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored)

Make it optional for kvm_getprocs() (and related sysctl) to return
thread information.

Add a KERN_PROC_SHOW_THREADS flag that has to be set in order to get the
thread info and make it off by default. This creates backwards compatibility
for applications that relied on a given size/number of items to be returned.

Modify ps(1) and top(1) accordingly.

Okay guenther@.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Apr 12 14:59:18 2012 UTC (12 years, 2 months ago) by pirofti
Branch: MAIN
Changes since 1.123: +18 -10 lines
Diff to previous 1.123 (colored)

Add per thread accounting, mainly for usage & friends.

This expands the already bloated FILL_KPROC macro to take an extra
parameter that indicates if the callee is a thread or a process.

The userland bits are adjusted accordingly and ps(1) and top(1) now
display per thread usage times when -H is used.

Also pkill(1) had to be adjusted so that duplicates don't pop up.

libkvm does basically the same thing as the kernel bits.

Okay guenther@.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Apr 12 10:11:41 2012 UTC (12 years, 2 months ago) by mikeb
Branch: MAIN
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

move accounting flags to struct process; idea and ok guenther

Revision 1.122 / (download) - annotate - [select for diffs], Tue Apr 10 15:50:52 2012 UTC (12 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.121: +5 -5 lines
Diff to previous 1.121 (colored)

Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads.  New sysctl()s KERN_NTHREADS and
KERN_MAXTHREAD count and limit threads.  The nprocs and maxproc kernel
variables are replaced by nprocess, maxprocess, nthreads, and maxthread.

ok tedu@ mikeb@

Revision 1.121 / (download) - annotate - [select for diffs], Fri Mar 23 15:51:26 2012 UTC (12 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.120: +26 -27 lines
Diff to previous 1.120 (colored)

Make rusage totals, itimers, and profile settings per-process instead
of per-rthread.  Handling of per-thread tick and runtime counters
inspired by how FreeBSD does it.

ok kettenis@

Revision 1.120 / (download) - annotate - [select for diffs], Sat Jan 7 05:38:12 2012 UTC (12 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.119: +14 -14 lines
Diff to previous 1.119 (colored)

Add rtable id and thread id to struct kinfo_proc (and fix process id)
and add an 'rtableid' keyword to ps.

Add rtable id, thread id, and socket splice info to struct kinfo_file2
and make fstat display socket splice information.

Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major

Socket splice info and corrections from bluhm@  "Lovely" deraadt@

Revision 1.119 / (download) - annotate - [select for diffs], Wed Dec 14 07:32:16 2011 UTC (12 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

Handle rthreads consistently in ktrace by moving the flags and vnode into
struct process; KTRFAC_ACTIVE becomes P_INKTR.  Also, save the credentials
used to open the file in sys_ktrace() and use them for all writes to the
vnode.

much feedback and ok jsing@

Revision 1.118 / (download) - annotate - [select for diffs], Fri Dec 9 16:14:54 2011 UTC (12 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.117: +4 -2 lines
Diff to previous 1.117 (colored)

Add new KERN_PROC_CWD sysctl to get the current working directory of a process.

ok guenther deraadt

Revision 1.117 / (download) - annotate - [select for diffs], Tue Aug 30 01:09:29 2011 UTC (12 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.116: +7 -7 lines
Diff to previous 1.116 (colored)

Make ps -N/-M work again by correcting kernel vs user address
handling in the FILL_KPROC() macro.

Problems pointed out by Martin Pelikan (martin.pelikan at gmail.com)

Revision 1.116 / (download) - annotate - [select for diffs], Fri Jul 8 18:38:55 2011 UTC (12 years, 11 months ago) by yasuoka
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.115: +2 -1 lines
Diff to previous 1.115 (colored)

this must be included my previous commit.

Include PIPEX in kernel by default.  And add new sysctl variable
`net.pipex.enable' to enable PIPEX.   By default, pipex is disabled
and it will not process packets from wire.  Update man pages and
update HOWTO_PIPEX_NPPPD.txt for testers.

discussed with dlg@, ok deraadt@ mcbride@ claudio@

Revision 1.115 / (download) - annotate - [select for diffs], Tue Jul 5 04:48:02 2011 UTC (12 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.114: +5 -4 lines
Diff to previous 1.114 (colored)

Recommit the reverted sigacts change now that the NFS use-after-free
problem has been tracked down.  This fixes the sharing of the signal
handling state: shared bits go in sigacts, per-rthread bits goes in
struct proc.

ok deraadt@

Revision 1.114 / (download) - annotate - [select for diffs], Fri Jun 24 19:47:49 2011 UTC (12 years, 11 months ago) by naddy
Branch: MAIN
Changes since 1.113: +25 -23 lines
Diff to previous 1.113 (colored)

machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 and
i386.  Stop abusing it on other archs for controling a shutdown by
pressing the soft power button:

* Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it
  allows a power button shutdown.
* Make acpi(4)/acpibtn(4) honor hw.allowpowerdown.
* Switch the various power button intercepts on landisk, sgi, sparc64
  and zaurus over to hw.allowpowerdown.
* Garbage collect the machdep.kbdreset sysctl on all archs other than
  amd64 and i386.

ok miod@

Revision 1.113 / (download) - annotate - [select for diffs], Mon Apr 18 21:44:56 2011 UTC (13 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.112: +4 -5 lines
Diff to previous 1.112 (colored)

Revert the sigacts diff: NFS can apparently retain pointers to processes
until they're zombies and then send them signals (for intr mounts).  Until
that is untangled, the sigacts change is unsafe.  sthen@ was the victim
for this one

Revision 1.112 / (download) - annotate - [select for diffs], Fri Apr 15 17:58:25 2011 UTC (13 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

p_sigacts is NULL for zombies, so FILL_KPROC() and  kvm_proclist() have
to handle that with the sigacts change.

problem observed and diagnosed by claudio@ and kettenis@

Revision 1.111 / (download) - annotate - [select for diffs], Fri Apr 15 04:52:40 2011 UTC (13 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.110: +5 -4 lines
Diff to previous 1.110 (colored)

Correct the sharing of the signal handling state: stuff that should
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves
to struct sigacts, wihle stuff that should be per rthread (ps_oldmask,
SAS_OLDMASK, ps_sigstk) moves to struct proc.  Treat the coredumping
state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread
until our locking around coredumping is better.

Oh, and remove the old SunOS-compat ps_usertramp member.

"I like the sound of this" tedu@

Revision 1.110 / (download) - annotate - [select for diffs], Mon Apr 4 11:13:53 2011 UTC (13 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.109: +4 -2 lines
Diff to previous 1.109 (colored)

sysctl kern.pool_debug=0 will disable POOL_DEBUG on the fly (still defaults
to on, if POOL_DEBUG is compiled in, so that boot-time pool corruption
can be found.  When the sysctl is turned off, performance is almost as
as good as compiling with POOL_DEBUG compiled out.  Not all pool page
headers can be purged of the magic checks.
performance tests by henning
ok ariane kettenis mikeb

Revision 1.109 / (download) - annotate - [select for diffs], Sat Mar 12 04:54:28 2011 UTC (13 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.108: +20 -56 lines
Diff to previous 1.108 (colored)

Replace the old, broken KERN_PROC ABI and its matching functions
in libkvm with the stable-ABI versions that are currently named
KERN_PROC2, kvm_get{proc,argv,envv}2().  The latter names and symbols
will continue to be supported for a few releases.

Committing now that they ports people have had a couple releases
to update pkgs that usd the old functions

Revision 1.108 / (download) - annotate - [select for diffs], Mon Mar 7 07:07:13 2011 UTC (13 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

The scheduling 'nice' value is per-process, not per-thread, so move it
into struct process.

ok tedu@ deraadt@

Revision 1.107 / (download) - annotate - [select for diffs], Tue Nov 2 09:36:09 2010 UTC (13 years, 7 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.106: +4 -2 lines
Diff to previous 1.106 (colored)

export the network livelock counter. part of a diff i committed the
userland side of.

pointed out by claudio@ after i embarassed myself saying "yes, its there!"

Revision 1.106 / (download) - annotate - [select for diffs], Thu Aug 19 18:14:13 2010 UTC (13 years, 9 months ago) by kettenis
Branch: MAIN
Changes since 1.105: +4 -2 lines
Diff to previous 1.105 (colored)

Introduce an MI kern.consdev sysctl that will replace the MD
machdep.console_device that's only implemented on a few architectures.

ok deraadt@, miod@

Revision 1.105 / (download) - annotate - [select for diffs], Mon Jul 26 01:56:27 2010 UTC (13 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.104: +5 -5 lines
Diff to previous 1.104 (colored)

Correct the links between threads, processes, pgrps, and sessions,
so that the process-level stuff is to/from struct process and not
struct proc.  This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.

Tested by many: deraadt, sthen, krw, ray, and in snapshots

Revision 1.104 / (download) - annotate - [select for diffs], Tue Jun 29 00:28:14 2010 UTC (13 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.103: +4 -2 lines
Diff to previous 1.103 (colored)

Eliminate RTHREADS kernel option in favor of a sysctl.  The actual status
(not done) hasn't changed, but now it's less work to test things.
ok art deraadt

Revision 1.103 / (download) - annotate - [select for diffs], Mon Jun 28 18:50:37 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

Add the rtable id as an argument to rn_walktree(). Functions like
rt_if_remove_rtdelete() need to know the table id to be able to correctly
remove nodes.
Problem found by Andrea Parazzini and analyzed by Martin Pelikán.
OK henning@

Revision 1.102 / (download) - annotate - [select for diffs], Sun May 2 00:51:10 2010 UTC (14 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

repeated text in a comment, spotted by adam dutko

Revision 1.101 / (download) - annotate - [select for diffs], Sun Jan 10 03:37:50 2010 UTC (14 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.100: +158 -1 lines
Diff to previous 1.100 (colored)

Reimplement kvm_getproc2()'s support for reading crash dumps and
/dev/mem to be direct instead of going through kvm_getprocs(), as
that function is going to get more an more broken as we move stuff
from struct proc to struct process for rthreads.  To minimize the
code copying, put the common logic of filling in a kinfo_proc2
structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from
both the kernel and user-space.  This also hides the KERN_PROC
#define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's
deprecated.

Positive feedback from millert and blambert; so committing to unblock
further rthreads work.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Jun 15 17:59:44 2009 UTC (14 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.99: +5 -3 lines
Diff to previous 1.99 (colored)

No you cannot remove a sysctl mib once you add it.  It becomes ABI.  That
is how sysctl finds them, so it can *never* be renumbered again, and must
stay

Revision 1.99 / (download) - annotate - [select for diffs], Mon Jun 15 17:01:26 2009 UTC (14 years, 11 months ago) by beck
Branch: MAIN
Changes since 1.98: +3 -5 lines
Diff to previous 1.98 (colored)

Back out all the buffer cache changes I committed during c2k9. This reverts three
commits:

1) The sysctl allowing bufcachepercent to be changed at boot time.
2) The change moving the buffer cache hash chains to a red-black tree
3) The dynamic buffer cache (Which depended on the earlier too).

ok on the backout from marco and todd

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jun 7 03:07:19 2009 UTC (15 years ago) by millert
Branch: MAIN
Changes since 1.97: +97 -2 lines
Diff to previous 1.97 (colored)

Add KERN_FILE2 sysctl analogous to KERN_PROC2 but for file structures,
along with vnode type-specific info to make it more useful for fstat(1).
OK deraadt@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jun 3 21:30:20 2009 UTC (15 years ago) by beck
Branch: MAIN
Changes since 1.96: +4 -2 lines
Diff to previous 1.96 (colored)

add kern.bufcachepercent sysctl to allow adjusting the buffer cache
size on a running system.
ok art@, oga@

Revision 1.96 / (download) - annotate - [select for diffs], Sun Apr 19 17:53:39 2009 UTC (15 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.95: +5 -3 lines
Diff to previous 1.95 (colored)

Count number of cpus found (potentially not attached) and store that
in sysctl hw.ncpufound; ok miod kettenis

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jan 21 21:02:41 2009 UTC (15 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

Pass the new pointer to sysctl_clockrate(), so that trying to change the
value of kern.clockrate with sysctl(3) correctly sets errno on failure.
PR #6040, ok tedu@

Revision 1.94 / (download) - annotate - [select for diffs], Tue Oct 7 02:20:11 2008 UTC (15 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

Do not display file offsets and a few other pieces of information, except
to the user or the superuser.  Display * for those fields instead.  From
PR 5113, but modified to use copyout correctly.
comments from tedu, ok from others

Revision 1.93 / (download) - annotate - [select for diffs], Tue Sep 16 15:48:12 2008 UTC (15 years, 8 months ago) by gollo
Branch: MAIN
Changes since 1.92: +2 -1 lines
Diff to previous 1.92 (colored)

netstat statistics for pflow(4) via pseudo family

ok cluadio@ henning@

Revision 1.92 / (download) - annotate - [select for diffs], Sat Feb 9 15:10:58 2008 UTC (16 years, 4 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.91: +8 -4 lines
Diff to previous 1.91 (colored)

Introduce HW_PHYSMEM64 and HW_USERMEM64 sysctls, which don't overflow on
machines with more than 4GB of memory.  Make sysctl(8) print values obtained
using these sysctls for hw.physmem and hw.usermem.

ok krw@, miod@

Revision 1.91 / (download) - annotate - [select for diffs], Thu Apr 12 22:14:15 2007 UTC (17 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.90: +2 -1 lines
Diff to previous 1.90 (colored)

move p_limit and p_cred into struct process
leave macros behind for now to keep the commit small
ok art beck miod pedro

Revision 1.90 / (download) - annotate - [select for diffs], Fri Jan 12 07:41:31 2007 UTC (17 years, 5 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.89: +1 -3 lines
Diff to previous 1.89 (colored)

Switch some lockmgr locks to rwlocks.
In this commit:
 - gdt lock on amd64
 - sysctl lock
 - malloc sysctl lock
 - disk sysctl lock
 - swap syscall lock

miod@, pedro@ ok (and "looks good" others@)

Revision 1.89 / (download) - annotate - [select for diffs], Tue Dec 12 23:14:28 2006 UTC (17 years, 6 months ago) by dim
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

Complete gwk's previous patch to stop setperf methods from returning
errors to userland: make all cpu_setperf functions return void.

Tested by many, ok gwk@

Revision 1.88 / (download) - annotate - [select for diffs], Mon May 8 22:51:18 2006 UTC (18 years, 1 month ago) by gwk
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.87: +12 -2 lines
Diff to previous 1.87 (colored)

Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,
hook up some sysctls to add system vendor/product/version and UUID reporting.

"get it in" deraadt@

Revision 1.87 / (download) - annotate - [select for diffs], Wed Mar 15 21:02:04 2006 UTC (18 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.86: +2 -1 lines
Diff to previous 1.86 (colored)

add sysctl_int_lower().  This can read, but can only write to a kernel
variable if the result is a lowering of the value; tested matthieu

Revision 1.86 / (download) - annotate - [select for diffs], Mon Feb 6 17:37:28 2006 UTC (18 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

typos from alexey dobriyan;

Revision 1.85 / (download) - annotate - [select for diffs], Tue Dec 13 00:35:23 2005 UTC (18 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.84: +2 -1 lines
Diff to previous 1.84 (colored)

First step in include files overhaul.  Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE.  Also fix several namespace
pollution issues, including the byte order defines.  OK deraadt@

Revision 1.84 / (download) - annotate - [select for diffs], Wed Oct 26 17:22:00 2005 UTC (18 years, 7 months ago) by mickey
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

missing name for KERN_CPTIME2; from form@

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jun 8 22:33:27 2005 UTC (19 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.82: +3 -2 lines
Diff to previous 1.82 (colored)

Add KERN_CPTIME2 on systems where __HAVE_CPUINFO is defined, exposes
spc_cp_time member of struct schedstate_percpu (per-cpu stats).
From art@ during the hackathon.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Mar 10 17:26:10 2005 UTC (19 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.81: +4 -2 lines
Diff to previous 1.81 (colored)

split out uidinfo from kern_proc.c private, use it to store lock count,
restrict lock count per uid to a global limit, add sysctl to adjust limit.
this prevents a user from creating too many locks.  problem noticed
by devon o'dell.  ok deraadt miod pedro

Revision 1.81 / (download) - annotate - [select for diffs], Wed Aug 4 23:33:32 2004 UTC (19 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

tholo forgot to update KERN_MAXID; j@pureftpd.org

Revision 1.80 / (download) - annotate - [select for diffs], Wed Jul 28 17:15:12 2004 UTC (19 years, 10 months ago) by tholo
Branch: MAIN
Changes since 1.79: +20 -1 lines
Diff to previous 1.79 (colored)

This touches only MI code, and adds new time keeping code.  The
code is all conditionalized on __HAVE_TIMECOUNTER, and not
enabled on any platforms.

adjtime(2) support exists, courtesy of nordin@, sysctl(2) support
and a concept of quality for each time source attached exists.

High quality time sources exists for PIIX4 ACPI timer as well as
some AMD power management chips.  This will have to be redone
once we actually add ACPI support (at that time we need to use
the ACPI interfaces to get at these clocks).

ok art@ ken@ miod@ jmc@ and many more

Revision 1.79 / (download) - annotate - [select for diffs], Mon Jun 28 01:34:46 2004 UTC (19 years, 11 months ago) by aaron
Branch: MAIN
Changes since 1.78: +7 -4 lines
Diff to previous 1.78 (colored)

Add new, generic ``evcount'' event counter API to the kernel.  From art@,
with modifications from me.  Includes code for generic interrupt counter
fetching via sysctl.  deraadt@ tholo@ drahn@ millert@ ok

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jun 11 01:32:05 2004 UTC (20 years ago) by deraadt
Branch: MAIN
CVS Tags: SMP_SYNC_A
Changes since 1.77: +4 -1 lines
Diff to previous 1.77 (colored)

export cpuid via kproc2, and make ps & top aware

Revision 1.28.4.15 / (download) - annotate - [select for diffs], Sun Jun 6 23:23:13 2004 UTC (20 years ago) by deraadt
Branch: SMP
Changes since 1.28.4.14: +1 -5 lines
Diff to previous 1.28.4.14 (colored) to branchpoint 1.28 (colored) next main 1.29 (colored)

do not put kernel-only #ifdefs in user-exposed structs!

Revision 1.28.4.14 / (download) - annotate - [select for diffs], Sat Jun 5 23:13:10 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.28.4.13: +9 -4 lines
Diff to previous 1.28.4.13 (colored) to branchpoint 1.28 (colored)

Merge with the trunk

Revision 1.28.4.13 / (download) - annotate - [select for diffs], Sat Jun 5 17:19:55 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.28.4.12: +5 -1 lines
Diff to previous 1.28.4.12 (colored) to branchpoint 1.28 (colored)

Make a few scheduling globals per-cpu, mostly NetBSD code

Revision 1.77 / (download) - annotate - [select for diffs], Mon Apr 19 22:52:33 2004 UTC (20 years, 1 month ago) by tedu
Branch: MAIN
CVS Tags: SMP_SYNC_B
Changes since 1.76: +4 -2 lines
Diff to previous 1.76 (colored)

introduce a new km_page allocator that gets pages from kernel_map using
an interrupt safe thread.
use this as the new backend for mbpool and mclpool, eliminating the mb_map.
introduce a sysctl kern.maxclusters which controls the limit of clusters
allocated.
testing by many people, works everywhere but m68k.  ok deraadt@

this essentially deprecates the NMBCLUSTERS option, don't use it.
this should reduce pressure on the kmem_map and the uvm reserve of static
map entries.

Revision 1.28.4.12 / (download) - annotate - [select for diffs], Sun Mar 14 22:08:21 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.28.4.11: +4 -1 lines
Diff to previous 1.28.4.11 (colored) to branchpoint 1.28 (colored)

Some merged code from NetBSD, more to come

Revision 1.76 / (download) - annotate - [select for diffs], Fri Feb 27 21:46:44 2004 UTC (20 years, 3 months ago) by grange
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.75: +1 -2 lines
Diff to previous 1.75 (colored)

Move setperf_prio to the machdep code, requested by deraadt@

ok deraadt@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Feb 27 21:15:45 2004 UTC (20 years, 3 months ago) by grange
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

Introduce simple priorities mechanism so that concurrent
hw.setperf handlers don't override each other.
Problem reported and tested by danh@.

ok tedu@ deraadt@

Revision 1.74 / (download) - annotate - [select for diffs], Tue Feb 24 21:43:56 2004 UTC (20 years, 3 months ago) by tedu
Branch: MAIN
Changes since 1.73: +3 -1 lines
Diff to previous 1.73 (colored)

sysctl knob for bpf tunables.  some tips from canacar@
ok canacar@ deraadt@ mcbride@

Revision 1.28.4.11 / (download) - annotate - [select for diffs], Thu Feb 19 11:01:34 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.28.4.10: +150 -3 lines
Diff to previous 1.28.4.10 (colored) to branchpoint 1.28 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.73 / (download) - annotate - [select for diffs], Sun Feb 15 11:14:45 2004 UTC (20 years, 3 months ago) by markus
Branch: MAIN
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

add sysctl_int_arr() API similar to BSD/OS; ok itojun, deraadt, miod, henning

Revision 1.72 / (download) - annotate - [select for diffs], Sat Feb 14 15:09:22 2004 UTC (20 years, 4 months ago) by grange
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

Simplify hw.{cpuspeed,setperf} api moving all the sysctl stuff
from the underlying callbacks.

Testing hppa mickey@, ppc drahn@
Ok markus@ tedu@

Revision 1.71 / (download) - annotate - [select for diffs], Wed Jan 7 21:51:30 2004 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.70: +2 -1 lines
Diff to previous 1.70 (colored)

Add p_rlim_rss_cur for ps "lim" field.  OK deraadt@

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jan 7 04:13:02 2004 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.69: +6 -6 lines
Diff to previous 1.69 (colored)

Variables in kinfo_proc2 that are actually sigset_t should be unsigned

Revision 1.69 / (download) - annotate - [select for diffs], Wed Jan 7 03:37:57 2004 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.68: +3 -1 lines
Diff to previous 1.68 (colored)

Add p_emul to kinfo_proc2 for ps

Revision 1.68 / (download) - annotate - [select for diffs], Wed Jan 7 02:13:51 2004 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.67: +128 -2 lines
Diff to previous 1.67 (colored)

Implement KERN_PROC2 sysctl from NetBSD.  This will allow us to
have ps and friends be independent of changes in struct proc et al
in the kernel.  OK deraadt@

Revision 1.67 / (download) - annotate - [select for diffs], Tue Dec 23 20:02:27 2003 UTC (20 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.66: +4 -1 lines
Diff to previous 1.66 (colored)

add cpu_setperf and cpu_cpuspeed externs to make life easier.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Dec 18 23:46:20 2003 UTC (20 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.65: +6 -2 lines
Diff to previous 1.65 (colored)

add new hw sysctls, cpuspeed and setperf to control cpu frequency.
convert longrun support to use new sysctls.
add enhanced speedstep support, based on code by Michael Eriksson.
idea, help testing & ok deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Thu Aug 21 18:56:07 2003 UTC (20 years, 9 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.64: +13 -2 lines
Diff to previous 1.64 (colored)

emulation is now controlled by sysctl.  changes:
add e_flags to struct emul.  this stores on/off and native flags.
check for emul enabled in check_exec().  gather all the emuls into a
emulsw so a sysctl can find them.  create sysctl.  move maxhdrsiz calcualation
into init_main so it cleans up sys_execve codepath.  teach sysctl utility
to grok kern.emul hierarchy.
requested and ok deraadt@  some comments from mickey@

Revision 1.28.4.10 / (download) - annotate - [select for diffs], Sat Jun 7 11:09:08 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.28.4.9: +2 -6 lines
Diff to previous 1.28.4.9 (colored) to branchpoint 1.28 (colored)

Sync SMP branch to -current

Revision 1.64 / (download) - annotate - [select for diffs], Mon Jun 2 23:28:22 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.63: +2 -6 lines
Diff to previous 1.63 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.44.2.3 / (download) - annotate - [select for diffs], Mon May 19 22:32:36 2003 UTC (21 years ago) by tedu
Branch: UBC
Changes since 1.44.2.2: +42 -3 lines
Diff to previous 1.44.2.2 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored)

sync

Revision 1.28.4.9 / (download) - annotate - [select for diffs], Tue May 13 19:36:57 2003 UTC (21 years, 1 month ago) by ho
Branch: SMP
Changes since 1.28.4.8: +4 -2 lines
Diff to previous 1.28.4.8 (colored) to branchpoint 1.28 (colored)

Sync the SMP branch to -current. This includes moving to ELF.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Apr 25 20:06:41 2003 UTC (21 years, 1 month ago) by grange
Branch: MAIN
CVS Tags: UBC_SYNC_A
Changes since 1.62: +4 -2 lines
Diff to previous 1.62 (colored)

sysctl front-end for the hardware monitoring sensors. This adds
new node hw.sensors; information from the sensors can be obtained
via hw.sensors.n, where n is a sensor number. All values are read only
for now. Documentation and back-end drivers are comming.
Tested by henning@ and millert@. Four oks from henning@ and one
from millert@.

Revision 1.28.4.8 / (download) - annotate - [select for diffs], Fri Mar 28 00:41:30 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.28.4.7: +69 -6 lines
Diff to previous 1.28.4.7 (colored) to branchpoint 1.28 (colored)

Sync the SMP branch with 3.3

Revision 1.62 / (download) - annotate - [select for diffs], Tue Jan 21 16:59:23 2003 UTC (21 years, 4 months ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.61: +18 -2 lines
Diff to previous 1.61 (colored)

add kern.watchdog sysctl and generic watchdog interface;
based on feedback and discussions with mickey, henric, fgsch and jakob.
ok art@, mickey@, jakob@, henric@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Jan 13 06:04:16 2003 UTC (21 years, 5 months ago) by art
Branch: MAIN
Changes since 1.60: +19 -2 lines
Diff to previous 1.60 (colored)

Sysctls for fetching intrcnt.

Revision 1.60 / (download) - annotate - [select for diffs], Tue Dec 17 23:11:31 2002 UTC (21 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.59: +6 -2 lines
Diff to previous 1.59 (colored)

Make SysV-style shared memory and semaphore limits sysctl'able.
Instead of allocating a static amount of memory for the data
structures via valloc() in allocsys(), allocate things dynamically
using pool(9) when possible and malloc(9) when not.  The various
members of struct seminfo and struct shminfo are in kern.seminfo
and kern.shminfo respectively (not all members of kern.seminfo are
changable).

The data structures used still leave something to be desired but
things are not made worse in that respect by this commit.

Revision 1.44.2.2 / (download) - annotate - [select for diffs], Tue Oct 29 00:36:49 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.44.2.1: +8 -7 lines
Diff to previous 1.44.2.1 (colored) to branchpoint 1.44 (colored)

sync to -current

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jul 7 22:06:33 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: UBC_SYNC_B, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

document a bit better

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jul 7 18:20:02 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.57: +39 -35 lines
Diff to previous 1.57 (colored)

No, you do NOT go renumbering the sysctl table!

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jul 6 19:14:20 2002 UTC (21 years, 11 months ago) by nordin
Branch: MAIN
Changes since 1.56: +36 -41 lines
Diff to previous 1.56 (colored)

Remove kernel support for NTP. ok deraadt@ and tholo@

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jun 11 11:14:29 2002 UTC (22 years ago) by beck
Branch: MAIN
Changes since 1.55: +4 -2 lines
Diff to previous 1.55 (colored)

kernel changes to make asymmetric crypto work in userland
- modify getfeat to return something more useful to us on devices
  (like lofn and everything else until jason fixes it) that can't
  do rsa stuff, etc and can only do mod_exp..
- error handling fixes so we correctly fail to software when we can't
  deal with a particular key size
- add sysctl kern.userasymcrypto to turn on/off userland asymmetric crypto
  via /dev/crypto - 1 == on, 0 == off, default is off

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:32:34 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.44: +74 -48 lines
Diff to previous 1.44 (colored)

Sync UBC branch to -current

Revision 1.55 / (download) - annotate - [select for diffs], Sun Jun 9 09:51:31 2002 UTC (22 years ago) by art
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored)

Userland might want resource.h.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Jun 9 05:46:15 2002 UTC (22 years ago) by art
Branch: MAIN
Changes since 1.53: +5 -1 lines
Diff to previous 1.53 (colored)

add struct pstats to struct eproc

Revision 1.53 / (download) - annotate - [select for diffs], Sun Jun 9 04:26:40 2002 UTC (22 years ago) by angelos
Branch: MAIN
Changes since 1.52: +4 -2 lines
Diff to previous 1.52 (colored)

Add KERN_MBSTAT

Revision 1.52 / (download) - annotate - [select for diffs], Sat Jun 8 23:32:14 2002 UTC (22 years ago) by angelos
Branch: MAIN
Changes since 1.51: +6 -2 lines
Diff to previous 1.51 (colored)

TTYCOUNT and NUMVNODES

Revision 1.51 / (download) - annotate - [select for diffs], Sat Jun 8 23:16:03 2002 UTC (22 years ago) by angelos
Branch: MAIN
Changes since 1.50: +5 -2 lines
Diff to previous 1.50 (colored)

Add KERN_NFILES, and procargs entry.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jun 8 22:24:47 2002 UTC (22 years ago) by art
Branch: MAIN
Changes since 1.49: +11 -2 lines
Diff to previous 1.49 (colored)

Sysctl for getting process arguments and environment.

Revision 1.49 / (download) - annotate - [select for diffs], Wed May 15 23:17:53 2002 UTC (22 years, 1 month ago) by art
Branch: MAIN
Changes since 1.48: +4 -2 lines
Diff to previous 1.48 (colored)

Implement splassert() for sparc - a tool for finding problems related to
spl handling (already found 3 problems).

Man page in a few seconds.
deraadt@ ok.

Revision 1.28.4.7 / (download) - annotate - [select for diffs], Thu Mar 28 14:52:02 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.28.4.6: +43 -46 lines
Diff to previous 1.28.4.6 (colored) to branchpoint 1.28 (colored)

Merge in -current from roughly a week ago

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 14 19:42:54 2002 UTC (22 years, 3 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.47: +3 -5 lines
Diff to previous 1.47 (colored)

version[] is externed in the systm.h and give it some const

Revision 1.47 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:14 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.46: +46 -47 lines
Diff to previous 1.46 (colored)

First round of __P removal in sys

Revision 1.28.4.6 / (download) - annotate - [select for diffs], Wed Mar 6 02:17:13 2002 UTC (22 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.28.4.5: +5 -1 lines
Diff to previous 1.28.4.5 (colored) to branchpoint 1.28 (colored)

Merge in trunk

Revision 1.46 / (download) - annotate - [select for diffs], Fri Mar 1 02:52:51 2002 UTC (22 years, 3 months ago) by provos
Branch: MAIN
Changes since 1.45: +4 -2 lines
Diff to previous 1.45 (colored)

sysctl for cryptodevallowsoft - /dev/crypto will allow the software engine
to be used if there are no hardware cards.  mostly for debugging and
regression.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Feb 23 08:07:59 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +4 -2 lines
Diff to previous 1.44 (colored)

sysctl kern.usercrypto

Revision 1.28.4.5 / (download) - annotate - [select for diffs], Tue Nov 13 23:02:30 2001 UTC (22 years, 7 months ago) by niklas
Branch: SMP
Changes since 1.28.4.4: +2 -2 lines
Diff to previous 1.28.4.4 (colored) to branchpoint 1.28 (colored)

merge in -current

Revision 1.44 / (download) - annotate - [select for diffs], Tue Nov 6 19:53:21 2001 UTC (22 years, 7 months ago) by miod
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)

Revision 1.28.4.4 / (download) - annotate - [select for diffs], Wed Oct 31 03:30:30 2001 UTC (22 years, 7 months ago) by nate
Branch: SMP
Changes since 1.28.4.3: +14 -2 lines
Diff to previous 1.28.4.3 (colored) to branchpoint 1.28 (colored)

Sync the SMP branch to something just after 3.0

Revision 1.43 / (download) - annotate - [select for diffs], Fri Sep 28 01:42:54 2001 UTC (22 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.42: +13 -3 lines
Diff to previous 1.42 (colored)

sysctl() support for getting the SYSV *info structs and the associated
SYSV structs.  To be used by ipcs(1).  Based on work by simonb@netbsd.org

Revision 1.42 / (download) - annotate - [select for diffs], Sat Aug 18 03:32:16 2001 UTC (22 years, 9 months ago) by art
Branch: MAIN
Changes since 1.41: +4 -2 lines
Diff to previous 1.41 (colored)

Add a possibility to add a random offset to the stack on exec. This makes
it slightly harder to write generic buffer overflows. This doesn't really
give any real security, but it raises the bar for script-kiddies and it's
really cheap.

The range of the random offsets is controlled by the sysctl
kern.stackgap_random (must be a power of 2).

This is disabled by default right now, but we'll set it to a reasonable value
(1024?) soon, after some more testing.

Revision 1.28.4.3 / (download) - annotate - [select for diffs], Wed Jul 4 11:00:34 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.28.4.2: +25 -4 lines
Diff to previous 1.28.4.2 (colored) to branchpoint 1.28 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jun 24 16:00:45 2001 UTC (22 years, 11 months ago) by art
Branch: MAIN
Changes since 1.40: +5 -2 lines
Diff to previous 1.40 (colored)

Add a sysctl for getting pool information out of the kernel.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jun 22 21:32:59 2001 UTC (22 years, 11 months ago) by mickey
Branch: MAIN
Changes since 1.39: +4 -2 lines
Diff to previous 1.39 (colored)

provide sysctl iface for msgbuf; raadtified

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jun 3 04:37:58 2001 UTC (23 years ago) by angelos
Branch: MAIN
Changes since 1.38: +4 -2 lines
Diff to previous 1.38 (colored)

KERN_NPROCS

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jun 3 03:52:12 2001 UTC (23 years ago) by angelos
Branch: MAIN
Changes since 1.37: +6 -2 lines
Diff to previous 1.37 (colored)

Add KERN_FSCALE and KERN_CCPU.

Revision 1.28.4.2 / (download) - annotate - [select for diffs], Mon May 14 22:45:04 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.28.4.1: +27 -17 lines
Diff to previous 1.28.4.1 (colored) to branchpoint 1.28 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.37 / (download) - annotate - [select for diffs], Mon May 14 07:11:35 2001 UTC (23 years, 1 month ago) by angelos
Branch: MAIN
Changes since 1.36: +8 -4 lines
Diff to previous 1.36 (colored)

Disk statistics via sysctl.

Revision 1.36 / (download) - annotate - [select for diffs], Fri May 11 06:36:59 2001 UTC (23 years, 1 month ago) by angelos
Branch: MAIN
Changes since 1.35: +8 -2 lines
Diff to previous 1.35 (colored)

sysctl entries for kmemstats, nselcoll, nchstats, and forkstat.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Mar 16 08:49:08 2001 UTC (23 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

Use a lockmgr lock for keeping down the vslocked memory in sysctl
instead of a home-brew equivalent.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 31 09:59:50 2001 UTC (23 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +4 -2 lines
Diff to previous 1.33 (colored)

add kern.cp_time sysctl, to be used by various things

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jan 3 19:20:59 2001 UTC (23 years, 5 months ago) by angelos
Branch: MAIN
Changes since 1.32: +6 -2 lines
Diff to previous 1.32 (colored)

Add sysctl_quad/sysctl_rdquad routines.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Sep 17 22:00:01 2000 UTC (23 years, 8 months ago) by pjanzen
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.31: +16 -16 lines
Diff to previous 1.31 (colored)

Consistent tabify

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jul 1 02:55:57 2000 UTC (23 years, 11 months ago) by pjanzen
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

correct struct name in comment

Revision 1.30 / (download) - annotate - [select for diffs], Sun Jun 18 17:59:55 2000 UTC (23 years, 11 months ago) by niklas
Branch: MAIN
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

Mark kernel threads as system processes.  Make ps hide them by default,
show them with -k.  Do not try to show RSS based values for them as they
mess up column alignment.  vmstat -f now shows kernel threads separately
from rforks too.

Revision 1.28.4.1 / (download) - annotate - [select for diffs], Thu Mar 2 07:04:47 2000 UTC (24 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.28: +4 -2 lines
Diff to previous 1.28 (colored)

Sync with -current

Revision 1.29 / (download) - annotate - [select for diffs], Tue Feb 22 19:28:05 2000 UTC (24 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.28: +4 -2 lines
Diff to previous 1.28 (colored)

enlarge msgbuf, somewhat line netbsd did

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jun 29 23:52:00 1999 UTC (24 years, 11 months ago) by provos
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.27: +4 -2 lines
Diff to previous 1.27 (colored)

add sysctl kern.arandom to get a random integer. useful when chrooted with
no /dev/arandom.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Aug 16 03:22:55 1998 UTC (25 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

typo

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jul 7 07:12:51 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored)

per XPG, gethostname() with a short buffer returns truncated data - not ENOMEM.
As permitted, make the truncated buffer be NUL terminated.
make getdomainname() match.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jun 2 06:10:30 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.24: +10 -2 lines
Diff to previous 1.24 (colored)

add sysctl and sysconf support for sysvsem, sysvshm, sysvmsg, and fsync; mostly from kleink

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 15 17:20:34 1998 UTC (26 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

Update Berkeley sccsid since this includes the lite2 changes

Revision 1.23 / (download) - annotate - [select for diffs], Mon Dec 8 21:25:34 1997 UTC (26 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +4 -2 lines
Diff to previous 1.22 (colored)

add kern.nosuidcoredump to lock things out even more

Revision 1.22 / (download) - annotate - [select for diffs], Thu Nov 6 15:59:52 1997 UTC (26 years, 7 months ago) by kstailey
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

fix ps(1) LIM column

Revision 1.21 / (download) - annotate - [select for diffs], Thu Nov 6 05:59:11 1997 UTC (26 years, 7 months ago) by csapuntz
Branch: MAIN
Changes since 1.20: +9 -4 lines
Diff to previous 1.20 (colored)

Updates for VFS Lite 2 + soft update.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Oct 6 20:21:11 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.19: +3 -8 lines
Diff to previous 1.19 (colored)

back out vfs lite2 till after 2.2

Revision 1.19 / (download) - annotate - [select for diffs], Mon Oct 6 15:25:35 1997 UTC (26 years, 8 months ago) by csapuntz
Branch: MAIN
Changes since 1.18: +9 -4 lines
Diff to previous 1.18 (colored)

VFS Lite2 Changes

Revision 1.18 / (download) - annotate - [select for diffs], Mon Sep 8 17:28:18 1997 UTC (26 years, 9 months ago) by kstailey
Branch: MAIN
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

unbreak kvm for 32-bit machines.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Sep 5 19:23:25 1997 UTC (26 years, 9 months ago) by kstailey
Branch: MAIN
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

nuke e_spare.  It never bought us any usable compatibility and costs storage.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Sep 5 18:46:29 1997 UTC (26 years, 9 months ago) by kstailey
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

change e_spare back to a long.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Sep 3 13:51:09 1997 UTC (26 years, 9 months ago) by kstailey
Branch: MAIN
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored)

changes for ps "emul" option

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jun 22 04:58:04 1997 UTC (26 years, 11 months ago) by flipk
Branch: MAIN
Changes since 1.13: +4 -2 lines
Diff to previous 1.13 (colored)

wasn't a race after all. properly initialize event_q pointers so the
last one doesn't point off the end.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 21 04:59:47 1997 UTC (26 years, 11 months ago) by flipk
Branch: MAIN
Changes since 1.12: +1 -3 lines
Diff to previous 1.12 (colored)

revert, there's a nasty race condition here.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Jun 14 21:37:10 1997 UTC (27 years ago) by mickey
Branch: MAIN
Changes since 1.11: +4 -2 lines
Diff to previous 1.11 (colored)

split the treatment of the random events
event_q by flipk@
spl fix by deraadt@
gother statistics about whole processing
use 'sysctl kern.random' to view what had happened
also fix wrong vm.psstrings description

Revision 1.11 / (download) - annotate - [select for diffs], Fri Oct 4 01:26:45 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (colored)

usermount sysctl, default to prevent users from using mount syscall

Revision 1.10 / (download) - annotate - [select for diffs], Fri Sep 20 22:53:05 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +6 -2 lines
Diff to previous 1.9 (colored)

`solve' the syn bomb problem as well as currently known; add sysctl's for
SOMAXCONN (kern.somaxconn), SOMINCONN (kern.sominconn), and TCPTV_KEEP_INIT
(net.inet.tcp.keepinittime). when this is not enough (ie. overfull), start
doing tail drop, but slightly prefer the same port.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Aug 11 20:35:12 1996 UTC (27 years, 10 months ago) by niklas
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

Add fs_posix_sysctl prototype

Revision 1.8 / (download) - annotate - [select for diffs], Thu Aug 8 06:36:48 1996 UTC (27 years, 10 months ago) by tholo
Branch: MAIN
Changes since 1.7: +23 -1 lines
Diff to previous 1.7 (colored)

Make {,f}chown(2) behaviour POSIX.1 compliant with SUID / SGID files
Enable CTL_FS processing by sysctl(3)
Add CTL_FS request to disable clearing SUID / SGID bit when a files owner
or group is changed by root
Make sysctl(8) understand CTL_FS requests

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jun 29 21:06:43 1996 UTC (27 years, 11 months ago) by tholo
Branch: MAIN
Changes since 1.6: +26 -26 lines
Diff to previous 1.6 (colored)

Move new KERN_OSVERSION sysctl request so binary compatibility with NetBSD
is preserved

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jun 29 21:02:52 1996 UTC (27 years, 11 months ago) by tholo
Branch: MAIN
Changes since 1.5: +26 -24 lines
Diff to previous 1.5 (colored)

Make uname(1) and uname(3) do sane things for the version field; now will
show only "KERNEL#build".

Revision 1.5 / (download) - annotate - [select for diffs], Sun Apr 21 22:31:59 1996 UTC (28 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.4: +8 -6 lines
Diff to previous 1.4 (colored)

partial sync with netbsd 960418, more to come

Revision 1.4 / (download) - annotate - [select for diffs], Thu Apr 18 21:41:13 1996 UTC (28 years, 1 month ago) by niklas
Branch: MAIN
Changes since 1.3: +8 -3 lines
Diff to previous 1.3 (colored)

Merge of NetBSD 960317

Revision 1.3 / (download) - annotate - [select for diffs], Sat Mar 30 04:51:33 1996 UTC (28 years, 2 months ago) by mickey
Branch: MAIN
Changes since 1.2: +4 -2 lines
Diff to previous 1.2 (colored)

Added: sysctl access to the ddb variables.
Fixed: "netbsd" strings in sym table handling routines.
now it is usefull to change max_{width,line} according
to your real console geometry, just w/ sysctl program.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 3 12:12:22 1996 UTC (28 years, 3 months ago) by niklas
Branch: MAIN
Changes since 1.1: +32 -1 lines
Diff to previous 1.1 (colored)

From NetBSD: 960217 merge

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:53:29 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:53:29 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.