Commit Graph

495 Commits

Author SHA1 Message Date
maxv
dec7dd7200 Add a proper defflag for GPROF, and include opt_gprof.h, otherwise we're
not gonna go very far.
2018-02-04 17:31:51 +00:00
msaitoh
7281eb3fdc Make cold __read_mostly like mp_online. 2017-12-26 03:58:03 +00:00
chs
ef2af070d4 add some assertions to verify that CPU_INFO_FOREACH() works right
early in the boot process.  this detects existing bugs on some platforms.
2017-12-15 16:05:51 +00:00
joerg
e64612f440 Revert printf return value change. 2017-10-27 12:25:14 +00:00
utkarsh009
f11595bab5 [syzkaller] Cast all the printf's to (void *)
> as a result of new printf(9) declaration.
2017-10-27 09:59:16 +00:00
ryo
28df50d7bb Make pfil(9) MP-safe (applying psref(9)) 2017-01-16 09:28:40 +00:00
pgoyette
c42fba4183 Actually initialize the sysctl stuff for kernhist! Missed this file
in earlier commits.
2017-01-05 03:22:20 +00:00
pgoyette
7f0851cee1 Add a BIOHIST option. As mentioned on tech-kern. 2016-12-26 23:12:33 +00:00
pgoyette
a1889144f5 Initialize the bufq code right before we're ready to load the strategy
modules.
2016-11-16 12:31:33 +00:00
pgoyette
219154eeef Define a new module class for the bufq_strategy modules. These need to
be loaded and intialized before autoconfigure runs, since some devices
(like disks and floppy drives) want to call bufq_alloc().
2016-11-16 10:42:14 +00:00
pgoyette
556c690963 Modularize the various bufq strategies 2016-11-16 00:46:46 +00:00
pgoyette
a60b99094c * Split sys/kern/sys_process.c into three parts:
1 - ptrace(2) syscall for native emulation
        2 - common ptrace(2) syscall code (shared with compat_netbsd32)
        3 - support routines that are shared with PROCFS and/or KTRACE

* Add module glue for #1 and #2.  Both modules will be built-in to the
  kernel if "options PTRACE" is included in the config file (this is
  the default, defined in sys/conf/std).

* Mark the ptrace(2) syscall as modular in syscalls.master (generated
  files will be committed shortly).

* Conditionalize all remaining portions of PTRACE code on a new kernel
  option PTRACE_HOOKS.

XXX Instead of PROCFS depending on 'options PTRACE', we should probably
    just add a procfs attribute to the sys/kern/sys_process.c file's
    entry in files.kern, and add PROCFS to the "#if defineds" for
    process_domem().  It's really confusing to have two different ways
    of requiring this file.
2016-11-02 00:11:59 +00:00
maxv
2e04133cf9 This is just a temporary stack that holds fake arguments, and that gets
remapped as RW in sys_execve. Still, in this small window, it does not need
to be executable.
2016-09-17 12:09:22 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
palle
3958153370 Added missing "it" to comment in start_init() 2016-06-04 21:10:56 +00:00
christos
b039ee7763 reduce #ifdef mess caused by PaX 2016-05-22 14:26:09 +00:00
macallan
192512b54b fix this properly.
uap is supposed to hold init's argv[], so it's 3 * sizeof(char *), the bug
was to copyout(..., sizeof(args)) which is an array of syscallargs, not argv
*
2016-03-28 16:45:44 +00:00
macallan
3228b500d3 do not assume that syscallarg(const char *) and (char *) are the same size
first step to make n32 kernels run binaries again
2016-03-28 15:45:18 +00:00
christos
8d10f96266 Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
2015-12-08 20:36:14 +00:00
pgoyette
42f5fa5fd3 Modularize drvctl(4) 2015-12-07 11:38:46 +00:00
ozaki-r
f373fa78e6 Fix build dependency of if_llatbl.c
if_llatbl.c is required if inet or inet6 is enabled. Depending on ether
doesn't suit for NDP case.
2015-11-26 01:41:20 +00:00
christos
8b8cf48b88 get rid of the suword {m,j}umbo and check return of copyout. 2015-11-20 18:34:17 +00:00
pgoyette
462d797f59 In sysv_sem.c, defer establishment of exithook so we can initialize the
module code from module_init() rather than waiting until after calling
exec_init().  Use a RUN_ONCE routine at entry to each sys_sem* syscall
to establish the exithook, and no longer KASSERT that the hook has
been set before removing it.  (A manually loaded module can be unloaded
before any syscalls have been invoked.)

Remove the conditional calls to the various xxx_init() routines from
init_main.c - we now rely on module_init() to handle initialization.

Let each sub-component's xxx_init() routine handle its own sysctl
sub-tree initialization;  this removes another set of #ifdef ugliness.

Tested both built-in and loadable versions and verified that atf
test kernel/t_sysv passes.
2015-11-06 02:26:42 +00:00
mrg
679d7c25a6 introduce a new way of handling SYSCALL_DEBUG messages -- send them to
a kernel history, settable via the SCDEBUG_KERNHIST flag.

this requires a fairly significantly different set of messages than the
normal debug as histories are restricted:
	- each message can take one literal format string and upto 4
	  arguments
	- the arguments can not be strings if you want vmstat -u to
	  work (this could be fixed, and i might, as it would be nice
	  if we could print syscall names as well as numbers.)

introduce SCDEBUG_DEFAULT that is settable in the kernel config.

fix a problem in kernhist_dump_histories() where it would crash when a
history with no allocated entries was found.

extend kernhist_dumpmask() to handle the usbhist and scdebughist.
2015-10-29 00:27:08 +00:00
jmcneill
abe8031d08 initialize MODULE_CLASS_DRIVER modules before the drivers themselves are loaded during autoconfiguration 2015-10-17 13:52:52 +00:00
uebayasi
960ec2b2e8 Handle splash image generation better. 2015-09-14 01:40:03 +00:00
ozaki-r
13b8e486ae Fix building kernels w/o ether 2015-08-31 16:46:14 +00:00
ozaki-r
879526da38 Hook up lltable/llentry with the kernel (and rumpkernel)
It is built and initialized on bootup, but there is no user for now.

Most codes in in.c are imported from FreeBSD as well as lltable/llentry.
2015-08-31 08:02:44 +00:00
hannken
e10a32f7f7 Remove miscfs/syncfs and
- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
  - vfs_syncer_add_to_worklist(struct mount *mp) to add
  - vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@
2015-05-06 15:57:07 +00:00
nat
0fbcd67289 Remove unintended whitespace. 2015-04-30 15:22:32 +00:00
nat
65a1cf7fa9 Added a new option for embedding a splash screen into kernel.
Add: options SPLASHSCREEN
     makeoptions SPLASHSCREEN_IMAGE="path/to/image"
to your config file.  So far it will work on amd64 and RPI/RPI2.

This commit was with ideas, help, and OK from jmcneill@.
2015-04-30 13:46:47 +00:00
pgoyette
1f3e12e9e0 Replace a home-grown run-once implementation with the real RUN_ONCE() 2015-04-27 07:51:28 +00:00
pgoyette
da3aa36f6d Update initialization of sysmon and its components. These are now handled as part of module initialization, and do not require manual invocation. sysmon_taskq is special, since it is potentially used by several non-module users who may need the facility before modules are fully ready. 2015-04-23 23:23:08 +00:00
mrg
d64a5577d7 wait for config_mountroot threads to complete before we tell init it
can start up.  this solves the problem where a console device needs
mountroot to complete attaching, and must create wsdisplay0 before
init tries to open /dev/console.  fixes PR#49709.

XXX: pullup-7
2015-03-06 09:28:15 +00:00
uebayasi
e81f2315f4 Yield the main thread only after exiting critical section. 2014-11-27 14:38:09 +00:00
riastradh
66f474049f Make uuidgen(2) generate v4 (random) uuids.
Rip out all the needless MAC address and date/time leakage.  No more
uuid_init necessary, nor contention over a global uuid state.

While here, simplify uuid_snprintf and fix a strict aliasing
violation.
2014-10-04 11:15:44 +00:00
riastradh
7e616d7734 Defer cprng_fast_init until CPUs are detected. 2014-08-14 16:27:55 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
riastradh
4fa7e6020b Initialize ubchist earlier. 2014-07-07 20:14:43 +00:00
rmind
eb664c40a7 Move ipi_sysinit() after configure2(); we want secondary CPUs attached.
Might revisit if the there will be a need to use this interface earlier.
2014-05-19 23:33:19 +00:00
rmind
8011b285c0 Implement MI IPI interface with cross-call support. 2014-05-19 22:47:53 +00:00
apb
03780f96b2 Add "/rescue/init" to the end of the initpaths list, which
now contains: { "/sbin/init", "/sbin/oinit", "/sbin/init.bak",
"/rescue/init", NULL }.

XXX: The kernel's use of initpaths is not documented.
2013-10-02 21:38:55 +00:00
riastradh
5287a42d7a Tighten initialization of rnd softints.
- Do rnd_init_softint as early as possible in main, after configure2,
  and before networking is initialized.

- Initialize the rnd_wakeup softint in rnd_init_softint, not lazily in
  rnd_schedule_wakeup.

ok tls
2013-08-28 12:50:18 +00:00
riastradh
b1574872b8 Back out the recent rnd stop-gap/stop-gap/stop-gap measures.
This reverts

sys/dev/rnd_private.h -> r1.1
sys/kern/init_main.c -> r1.450
sys/kern/kern_rndq.c -> r1.14
sys/kern/kern_rndsink.c -> r1.2

Parts of these changes will be added back, and the rndsource
callbacks will be fixed to avoid the lock recursion bug that
motivated the stop-gaps in the first place.

ok tls
2013-08-27 19:30:10 +00:00
tls
38648a41ea Attempt to resolve locking issues at kernel startup on platforms with
hardware RNGs using the polling mode of operation:

1) Initialize the rng subsystem soft interrupts as early in kernel startup
   as seems safe (we have no MI guarantee that softints are working at all
   until configure2() returns, AFAICT).

   This should have the rnd subsystem able to process events via softint
   before the network subsystem (a notorious early user of entropy) starts.

2) Remove the shortcut calls to rnd_process_events() from
   rnd_schedule_process(), with the result that until the softint is installed
   rnd_process_events() is a NOP.

3) Directly call rnd_process_events() in rnd_extract_data(),
   rnd_maybe_extract(), and rnd_init_softint().  This should suck up any
   samples actually collected as early as possible.
2013-08-25 21:12:56 +00:00
christos
816452912b Initialize the rnd softint explicitly via a function late in main. Avoids
LOCKDEBUG panic since softint_establish() was called via wdcintr -> wddone
from an interrupt context and tried to acquire a non-spin mutex.
2013-06-20 23:21:41 +00:00
christos
27fe772ddc IPSEC has not come in two speeds for a long time now (IPSEC == kame,
FAST_IPSEC). Make everything refer to IPSEC to avoid confusion.
2013-06-05 19:01:26 +00:00
para
82aa1e7edd calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html
2013-03-18 13:36:21 +00:00
pgoyette
e8ac3e27f9 Move boottime50 and its associated sysctl into the compat module. As
noted on tech-kern.  Should fix PR/47579.

OK christos@

Will request pull-up to 6.0 in a few days.
2013-02-21 01:39:54 +00:00
christos
a67c3c8971 printflike maintenance. 2013-02-09 00:31:21 +00:00