The NetBSD Project

CVS log for src/sys/kern/kern_module.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.160.2.1 / (download) - annotate - [select for diffs], Wed Feb 22 19:07:09 2023 UTC (12 months ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.160: +12 -4 lines
Diff to previous 1.160 (colored) next main 1.161 (colored)

Pull up following revision(s) (requested by riastradh in ticket #100):

	sys/kern/kern_module.c: revision 1.161

module(9): Make error message for multiple MODULE decls more obvious.

Revision 1.161 / (download) - annotate - [select for diffs], Tue Jan 31 13:21:37 2023 UTC (12 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.160: +12 -4 lines
Diff to previous 1.160 (colored)

module(9): Make error message for multiple MODULE decls more obvious.

Revision 1.160 / (download) - annotate - [select for diffs], Wed Oct 26 23:22:07 2022 UTC (16 months ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.159: +2 -3 lines
Diff to previous 1.159 (colored)

sys/*: Get module_map consistently from sys/module.h.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Sep 6 13:31:09 2022 UTC (17 months, 3 weeks ago) by pgoyette
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.158: +34 -14 lines
Diff to previous 1.158 (colored)

Resequence the sysctl_setup and evcnt stuff so that they always occur
_before_ the module's MODULE_CMD_INIT call.  Also update the unload
code to invoke the sysctl_setup and evcnt stuff _after_ the module's
MODULE_CMD_FINI call.  This makes the behaviour and order consistent
whether the module is built-in or loaded at run-time.

As reported by riastradh@

Revision 1.158 / (download) - annotate - [select for diffs], Fri Aug 12 15:17:10 2022 UTC (18 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.157: +28 -7 lines
Diff to previous 1.157 (colored)

module(9): Don't autounload unaudited modules by default.

Modules that have not been audited for autounload safety don't
recognize the command MODULE_CMD_AUTOUNLOAD and return ENOTTY.  These
modules are not safe to autounload, so don't autounload them.  Since
unload is risky business (if not careful, can lead to use-after-free,
kernel memory corruption, &c.), it needs to be opt-in by default, not
opt-out.

Modules that have been audited can return 0 or EBUSY to explicitly
allow or deny autounload.  Users who want to live on the edge to try
to exercise module autounload even for unaudited modules -- and are
willing to accept the consequences, and maybe contribute to auditing!
-- can set the new sysctl knob kern.module.autounload_unsafe=1.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2022/08/08/msg028282.html

Revision 1.157 / (download) - annotate - [select for diffs], Sun Aug 7 23:03:59 2022 UTC (18 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored)

Revert "module(9): Disable module autounload by default."

Needs more discussion.  Maybe better with an opt-in mechanism to
replace the opt-out mechanism than by disabling it altogether by
default.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Aug 7 21:17:18 2022 UTC (18 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.155: +3 -3 lines
Diff to previous 1.155 (colored)

module(9): Disable module autounload by default.

I don't know why this was ever enabled by default; many modules are
still not safe to unload, let alone autounload.  If any autounload is
to happen by default, it should only be for modules that have opted
into it in some way after audit.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Aug 7 20:44:39 2022 UTC (18 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.154: +3 -3 lines
Diff to previous 1.154 (colored)

module(9): Call callbacks in topological order on load.

They are called in reverse topological order on unload.

dtrace_sdt will rely on this soon to ensure provider definitions are
processed before their uses.

ok chs@

Revision 1.154 / (download) - annotate - [select for diffs], Sat May 7 04:30:41 2022 UTC (21 months, 3 weeks ago) by rin
Branch: MAIN
Changes since 1.153: +7 -3 lines
Diff to previous 1.153 (colored)

Add MODULAR_DEFAULT_VERBOSE option.

Revision 1.153 / (download) - annotate - [select for diffs], Thu Sep 16 21:29:42 2021 UTC (2 years, 5 months ago) by andvar
Branch: MAIN
Changes since 1.152: +3 -3 lines
Diff to previous 1.152 (colored)

fix typos in word "successfully", mainly s/succesfully/successfully/.

Revision 1.151.6.1 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:33 2021 UTC (2 years, 8 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.151: +3 -3 lines
Diff to previous 1.151 (colored) next main 1.152 (colored)

Sync w/ HEAD.

Revision 1.152 / (download) - annotate - [select for diffs], Fri Jun 11 23:41:47 2021 UTC (2 years, 8 months ago) by pgoyette
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.151: +3 -3 lines
Diff to previous 1.151 (colored)

Remove extraneous '\n' from debug message.

Revision 1.151 / (download) - annotate - [select for diffs], Thu Jun 11 19:20:46 2020 UTC (3 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.150: +3 -3 lines
Diff to previous 1.150 (colored)

uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched.  It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.

Revision 1.150 / (download) - annotate - [select for diffs], Mon Jun 8 20:19:50 2020 UTC (3 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored)

Update for proplib(3) API changes.

Revision 1.131.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:03 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.131.2.1: +154 -12 lines
Diff to previous 1.131.2.1 (colored) to branchpoint 1.131 (colored) next main 1.132 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.149 / (download) - annotate - [select for diffs], Sat Apr 4 19:50:54 2020 UTC (3 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.148: +15 -2 lines
Diff to previous 1.148 (colored)

Infrastructure for putting kernel+modules in /netbsd/kernel and
/netbsd/modules respectively instead of /netbsd and
/stand/<arch>/<version>/modules.  This is only supported for x86,
and is turned off by default. To try it, add KERNEL_DIR=yes in your
/mk.conf and install a system from that build.

Revision 1.148 / (download) - annotate - [select for diffs], Fri Mar 20 23:09:01 2020 UTC (3 years, 11 months ago) by pgoyette
Branch: MAIN
Changes since 1.147: +4 -4 lines
Diff to previous 1.147 (colored)

Improve error message - at least indicate which value comes from the
module vs which was requested/wanted by the caller.

Revision 1.143.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:02 2020 UTC (3 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.143.2.1: +72 -4 lines
Diff to previous 1.143.2.1 (colored) to branchpoint 1.143 (colored) next main 1.144 (colored)

Sync with head.

Revision 1.147 / (download) - annotate - [select for diffs], Sat Feb 22 19:51:57 2020 UTC (4 years ago) by pgoyette
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.146: +72 -4 lines
Diff to previous 1.146 (colored)

Teach module infrastructure to attach any static evcnts that might be
defined in a module, similar to the automatic invocation of sysctl(9)
setup functions.  As requested by riastradh@

Revision 1.143.2.1 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:51 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.143: +6 -2 lines
Diff to previous 1.143 (colored)

Sync with head.

Revision 1.146 / (download) - annotate - [select for diffs], Wed Jan 22 22:39:27 2020 UTC (4 years, 1 month ago) by pgoyette
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.145: +6 -2 lines
Diff to previous 1.145 (colored)

Enhance debug message when autoloading a module.  Identify the pid
of the process that triggered the autoload, as well as its p_comm
and the status.

This is only triggered if you've requested DEBUG messages by setting
the kern.module.verbose sysctl(8) variable.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Jan 21 15:26:36 2020 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.144: +0 -79 lines
Diff to previous 1.144 (colored)

oops, undo this (committed accidentally)

Revision 1.144 / (download) - annotate - [select for diffs], Tue Jan 21 15:25:38 2020 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.143: +81 -2 lines
Diff to previous 1.143 (colored)

Don't crash if we are on a hippie trail, head full of zombie

Revision 1.143 / (download) - annotate - [select for diffs], Tue Dec 31 13:07:13 2019 UTC (4 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.142: +3 -3 lines
Diff to previous 1.142 (colored)

Rename uvm_free() -> uvm_availmem().

Revision 1.142 / (download) - annotate - [select for diffs], Sat Dec 21 13:00:24 2019 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.141: +3 -3 lines
Diff to previous 1.141 (colored)

uvmexp.free -> uvm_free()

Revision 1.141 / (download) - annotate - [select for diffs], Thu Dec 12 22:55:20 2019 UTC (4 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.140: +2 -12 lines
Diff to previous 1.140 (colored)

Eliminate per-hook duplication of common code as suggested by
(and with major contributions from) riastradh@

Welcome to 9.99.23

Revision 1.140 / (download) - annotate - [select for diffs], Thu Dec 12 16:36:25 2019 UTC (4 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.139: +3 -2 lines
Diff to previous 1.139 (colored)

Make sure to #include to get required definitions.

Should fix the build break reported by martin@

Revision 1.139 / (download) - annotate - [select for diffs], Thu Dec 12 02:15:43 2019 UTC (4 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.138: +12 -2 lines
Diff to previous 1.138 (colored)

Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !

Revision 1.138 / (download) - annotate - [select for diffs], Thu Aug 8 18:08:41 2019 UTC (4 years, 6 months ago) by pgoyette
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.137: +10 -3 lines
Diff to previous 1.137 (colored)

When modules are unloaded, we call sysctl_teardown() before calling
the module's modcmd(CMD_FINI) code.  If the modcmd() call returns an
error, we attempted to re-instate the module's sysctl stuff.

This doesn't work well for built-in modulesi (where "unload" actually
means "disable"), since they don't have any ``struct kobj''.

So check first, and don't try to find the __link_set_sysctl_funcs for
built-in modules.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Aug 7 00:38:02 2019 UTC (4 years, 6 months ago) by pgoyette
Branch: MAIN
Changes since 1.136: +42 -2 lines
Diff to previous 1.136 (colored)

Many years ago someone created a new __link_set_sysctl_funcs to hold
the list of routines that need to be called for setting up sysctl
variables.  This worked great for all code included in the kernel
itself, but didn't deal with modules that want to create their own
sysctl data.  So, we ended up with a lot of #ifdef _MODULE blocks
so modules could explicitly call their setup functions when loaded
as non-built-in modules.

So today, we complete the task that was started so many years ago.

When modules are loaded, after we've called xxx_modcmd(INIT...) we
check if the module contains its own __link_set_sysctl_funcs, and
if so we call the functions listed.  We add a struct sysctllog member
to the struct module so we can call sysctl_teardown() when the module
gets unloaded.  (The sequence of events ensures that the sysctl stuff
doesn't get created until the rest of the module's init code does any
required memory allocation.)

So, no more need to explicitly call the sysctl setup routines when
built as a loadable module.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Jun 19 15:01:01 2019 UTC (4 years, 8 months ago) by pgoyette
Branch: MAIN
CVS Tags: netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.135: +17 -8 lines
Diff to previous 1.135 (colored)

In case of error resolving symbol references, we cannot rely on the
module's name still being available - it may be destroyed when
kobj_affix() unloads the object.  So make a copy of the name first
so we can use it in a useful error message.

(Without this, I've have affix errors go into an infinite loop
trying to print the error message!)

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jun 11 15:20:57 2019 UTC (4 years, 8 months ago) by pgoyette
Branch: MAIN
Changes since 1.134: +3 -3 lines
Diff to previous 1.134 (colored)

Improve error message

Revision 1.131.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:03 2019 UTC (4 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.131: +118 -68 lines
Diff to previous 1.131 (colored)

Sync with HEAD

Revision 1.134 / (download) - annotate - [select for diffs], Mon Apr 8 11:32:49 2019 UTC (4 years, 10 months ago) by pgoyette
Branch: MAIN
CVS Tags: phil-wifi-20190609, isaki-audio2-base, isaki-audio2
Changes since 1.133: +10 -3 lines
Diff to previous 1.133 (colored)

Improve kernel module validation.  First, set a limit on how much of the
module name field to check when validation name's length.  Second, check
the module's mi_class to ensure it is valid.

Update the commenet in sys/module.h to indicate that the module classes
are now being validated.

Revision 1.133 / (download) - annotate - [select for diffs], Sun Jan 27 02:08:43 2019 UTC (5 years, 1 month ago) by pgoyette
Branch: MAIN
Changes since 1.132: +109 -66 lines
Diff to previous 1.132 (colored)

Merge the [pgoyette-compat] branch

Revision 1.130.2.24 / (download) - annotate - [select for diffs], Wed Oct 3 22:53:52 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.130.2.23: +4 -4 lines
Diff to previous 1.130.2.23 (colored) to branchpoint 1.130 (colored) next main 1.131 (colored)

Better diagnostic message

Revision 1.130.2.23 / (download) - annotate - [select for diffs], Sun Sep 9 11:54:10 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.22: +3 -3 lines
Diff to previous 1.130.2.22 (colored) to branchpoint 1.130 (colored)

When freeing the required list, make sure we calculate its size based
on the size of the contained elements, not on the size of a pointer to
those elements.

Revision 1.130.2.22 / (download) - annotate - [select for diffs], Fri Sep 7 23:32:30 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.21: +2 -60 lines
Diff to previous 1.130.2.21 (colored) to branchpoint 1.130 (colored)

At the request of reviewers, remove the module alias functionality.

We will rely only on module names and duplicate-symbol detection to
detect module conflicts.

Revision 1.130.2.21 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:41 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.20: +3 -3 lines
Diff to previous 1.130.2.20 (colored) to branchpoint 1.130 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.130.2.20 / (download) - annotate - [select for diffs], Thu Sep 6 00:10:55 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.19: +2 -5 lines
Diff to previous 1.130.2.19 (colored) to branchpoint 1.130 (colored)

One more time - let's get this right!

Revision 1.130.2.19 / (download) - annotate - [select for diffs], Wed Sep 5 22:04:51 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.18: +4 -3 lines
Diff to previous 1.130.2.18 (colored) to branchpoint 1.130 (colored)

After releasing the resources, make sure we don't retain pointer to them!

Revision 1.130.2.18 / (download) - annotate - [select for diffs], Wed Sep 5 09:42:57 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.17: +3 -3 lines
Diff to previous 1.130.2.17 (colored) to branchpoint 1.130 (colored)

ooppss - don't forget the structure pointer!

Revision 1.130.2.17 / (download) - annotate - [select for diffs], Wed Sep 5 09:26:59 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.16: +12 -4 lines
Diff to previous 1.130.2.16 (colored) to branchpoint 1.130 (colored)

If a built-in module is "unloaded", release all the resources associated
with the "required" list.  The list will be re-parsed if the module is
later re-enabled.

Revision 1.130.2.16 / (download) - annotate - [select for diffs], Tue Sep 4 11:53:46 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.15: +3 -3 lines
Diff to previous 1.130.2.15 (colored) to branchpoint 1.130 (colored)

Use correct structure member for module's name.

Revision 1.130.2.15 / (download) - annotate - [select for diffs], Tue Sep 4 11:48:38 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.14: +11 -6 lines
Diff to previous 1.130.2.14 (colored) to branchpoint 1.130 (colored)

Add some helpful error messages when things fail.

Revision 1.130.2.14 / (download) - annotate - [select for diffs], Tue Sep 4 11:31:11 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.13: +11 -5 lines
Diff to previous 1.130.2.13 (colored) to branchpoint 1.130 (colored)

If loading a built-in module fails, make sure we reset all the stuff
related to its pre-requisite modules.  Otherwise if we try to load it
again we will panic.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:35 2018 UTC (5 years, 5 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.131: +3 -3 lines
Diff to previous 1.131 (colored)

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.130.2.13 / (download) - annotate - [select for diffs], Mon Jul 9 08:45:41 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.12: +4 -4 lines
Diff to previous 1.130.2.12 (colored) to branchpoint 1.130 (colored)

Put the checks back in the original order, and remove extra ')'

Thanks to soda for finding the real error.

Revision 1.130.2.12 / (download) - annotate - [select for diffs], Mon Jul 9 08:26:29 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.11: +4 -4 lines
Diff to previous 1.130.2.11 (colored) to branchpoint 1.130 (colored)

Reverse order of flags checking to appease compiler.  It seems
that gcc doesn't like

	if (expr && !ISSET(t, f)) ...

Revision 1.130.2.11 / (download) - annotate - [select for diffs], Sun Jul 8 07:33:14 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.10: +9 -9 lines
Diff to previous 1.130.2.10 (colored) to branchpoint 1.130 (colored)

Use SET, CLR, ISSET macros from types.h

NFCI

Revision 1.130.2.10 / (download) - annotate - [select for diffs], Mon Jun 25 08:50:10 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.9: +2 -4 lines
Diff to previous 1.130.2.9 (colored) to branchpoint 1.130 (colored)

Finish de-confliction

Revision 1.130.2.9 / (download) - annotate - [select for diffs], Mon Jun 25 07:22:54 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.8: +217 -30 lines
Diff to previous 1.130.2.8 (colored) to branchpoint 1.130 (colored)

Resolve conflicts with HEAD

Revision 1.131 / (download) - annotate - [select for diffs], Mon May 28 21:04:40 2018 UTC (5 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.130: +212 -27 lines
Diff to previous 1.130 (colored)

add more accessor functions for various struct module fields.
add a mechanism for registering callbacks to be called upon module load/unload.

Revision 1.130.2.8 / (download) - annotate - [select for diffs], Mon Apr 2 00:18:43 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.7: +7 -7 lines
Diff to previous 1.130.2.7 (colored) to branchpoint 1.130 (colored)

Typos (new = old, not old = new!), whitespace, and consistency in
references to the dynamically allocated array of required modules.

Revision 1.130.2.7 / (download) - annotate - [select for diffs], Sun Apr 1 23:06:11 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.6: +54 -25 lines
Diff to previous 1.130.2.6 (colored) to branchpoint 1.130 (colored)

Remove fixed limit on number of modules which can be "required" by
a module.  Instead, allocate the array dynamically, and expand it
when needed.

XXX Note the modctl(2)'s MODCTL_STAT routine needs to be updated
(and versioned) to handle the unlimited size.  For now, the kernel
will simply truncate the required list if it doesn't fit in the
existing export structure.

Revision 1.130.2.6 / (download) - annotate - [select for diffs], Sat Mar 31 08:34:17 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.5: +5 -13 lines
Diff to previous 1.130.2.5 (colored) to branchpoint 1.130 (colored)

Rather than allocating and freeing the recursion stack entry from the pool,
just use an entry allocated on the procedure's stack.  The recursion entry
is very short-lived anyway, and always gets freed before the procedure
exits.

Revision 1.130.2.5 / (download) - annotate - [select for diffs], Fri Mar 30 23:49:42 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.4: +37 -30 lines
Diff to previous 1.130.2.4 (colored) to branchpoint 1.130 (colored)

Use an SLIST-based stack rather than a statically-allocated array for
recursion control.  This eliminates the MAXDEPTH constraint.

XXX We still have a static limit on MAXMODDEPS

Revision 1.130.2.4 / (download) - annotate - [select for diffs], Sun Mar 11 11:47:45 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.3: +23 -11 lines
Diff to previous 1.130.2.3 (colored) to branchpoint 1.130 (colored)

Clean up the EXIST paths (module and/or alias already exists) and make
sure we always return a pointer to the duplicate.

Revision 1.130.2.3 / (download) - annotate - [select for diffs], Sun Mar 11 08:32:21 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.2: +5 -5 lines
Diff to previous 1.130.2.2 (colored) to branchpoint 1.130 (colored)

Since we use pointer semantics when walking the alias lists, declare
the pointer variable accordingly.

Revision 1.130.2.2 / (download) - annotate - [select for diffs], Sun Mar 11 07:25:59 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130.2.1: +8 -8 lines
Diff to previous 1.130.2.1 (colored) to branchpoint 1.130 (colored)

(Re)implement the alias list as a "const char * const (*list)[]" and
store a pointer to this list in the mod_info structure (which lives
in the modules' linkset data).  Don't allow any duplication of module
names _or_ aliases when loading; for dependencies, they will be met
if the required module name matches any loaded module name or alias.

Revision 1.130.2.1 / (download) - annotate - [select for diffs], Sun Mar 11 00:44:32 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.130: +46 -2 lines
Diff to previous 1.130 (colored)

Store the aliases list in the mod_info struct, since it is totally
static data.  This saves us having to make a special xxx_modcmd()
call to retrieve the data.  Update module(9) man page accordingly.

Revision 1.125.2.1 / (download) - annotate - [select for diffs], Thu Dec 21 21:37:03 2017 UTC (6 years, 2 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.125: +33 -2 lines
Diff to previous 1.125 (colored) next main 1.126 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #449):
	sys/kern/kern_module.c: 1.126-1.130
Add additional duplicate-module-name check in case we have two modules
with the same internal name but no conflicting symbol definitions.
When we load a module from the file system, the filename may have no
relationship to the internal module's name.  Furthermore, comparing
the module's filename is insufficient if the file is loaded from an
absolute path.
--
Use KASSERT to ensure that the newly-added module's name can be found.
--
Change a KASSERTMSG into a regular module_error - not nice for the
kernel
to panic when I try to modload the 'ntfs' module.
--
When looking for a duplicate module name, also check the pending list.
--
Remove the check for duplicate-module-name-on-pending-list since it really
doesn't help.  The check really cannot fail, and it only looks at the list
belonging to the current level of recursion.
Instead, verify that the module's modcmd(MODULE_CMD_INIT, ...) does not
introduce a duplicate module name as a result of recursively calling
module_do_load().

Revision 1.130 / (download) - annotate - [select for diffs], Thu Dec 14 22:28:59 2017 UTC (6 years, 2 months ago) by pgoyette
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.129: +17 -14 lines
Diff to previous 1.129 (colored)

Remove the check for duplicate-module-name-on-pending-list since it really
doesn't help.  The check really cannot fail, and it only looks at the list
belonging to the current level of recursion.

Instead, verify that the module's modcmd(MODULE_CMD_INIT, ...) does not
introduce a duplicate module name as a result of recursively calling
module_do_load().

Revision 1.129 / (download) - annotate - [select for diffs], Thu Dec 14 11:45:40 2017 UTC (6 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.128: +10 -2 lines
Diff to previous 1.128 (colored)

When looking for a duplicate module name, also check the pending list.

Revision 1.128 / (download) - annotate - [select for diffs], Thu Dec 14 10:39:32 2017 UTC (6 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.127: +6 -4 lines
Diff to previous 1.127 (colored)

Change a KASSERTMSG into a regular module_error - not nice for the kernel
to panic when I try to modload the 'ntfs' module.

Revision 1.127 / (download) - annotate - [select for diffs], Mon Dec 11 22:00:26 2017 UTC (6 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.126: +4 -3 lines
Diff to previous 1.126 (colored)

Use KASSERT to ensure that the newly-added module's name can be found.

XXX Pull-up to -8

Revision 1.126 / (download) - annotate - [select for diffs], Sun Dec 10 03:08:32 2017 UTC (6 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.125: +19 -2 lines
Diff to previous 1.125 (colored)

Add additional duplicate-module-name check in case we have two modules
with the same internal name but no conflicting symbol definitions.

When we load a module from the file system, the filename may have no
relationship to the internal module's name.  Furthermore, comparing
the module's filename is insufficient if the file is loaded from an
absolute path.

XXX pullup to netbsd-8

Revision 1.86.6.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:44 2017 UTC (6 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.86.6.3: +119 -84 lines
Diff to previous 1.86.6.3 (colored) to branchpoint 1.86 (colored) next main 1.87 (colored)

update from HEAD

Revision 1.101.2.8 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.7: +5 -7 lines
Diff to previous 1.101.2.7 (colored) to branchpoint 1.101 (colored) next main 1.102 (colored)

Sync with HEAD

Revision 1.125 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Changes since 1.124: +5 -7 lines
Diff to previous 1.124 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.115.2.4 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:26 2017 UTC (6 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.115.2.3: +2 -2 lines
Diff to previous 1.115.2.3 (colored) to branchpoint 1.115 (colored) next main 1.116 (colored)

Sync with HEAD

Revision 1.119.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.119: +18 -7 lines
Diff to previous 1.119 (colored) next main 1.120 (colored)

Sync with HEAD

Revision 1.124 / (download) - annotate - [select for diffs], Tue Apr 18 18:07:29 2017 UTC (6 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, bouyer-socketcan-base1
Changes since 1.123: +2 -11 lines
Diff to previous 1.123 (colored)

PR/52174: Remove root test, it is too verbose. XXX: need to come up with
something better.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Apr 11 21:15:57 2017 UTC (6 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.122: +3 -3 lines
Diff to previous 1.122 (colored)

use a different root vnode variable to appease the rump gods.

Revision 1.122 / (download) - annotate - [select for diffs], Tue Apr 11 14:37:07 2017 UTC (6 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored)

return EPERM like the other failures.

Revision 1.121 / (download) - annotate - [select for diffs], Tue Apr 11 14:31:55 2017 UTC (6 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.120: +11 -2 lines
Diff to previous 1.120 (colored)

Don't try to autoload modules before root is mounted.

Revision 1.115.2.3 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:47 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.115.2.2: +18 -7 lines
Diff to previous 1.115.2.2 (colored) to branchpoint 1.115 (colored)

Sync with HEAD

Revision 1.101.2.7 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:56 2017 UTC (7 years ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.6: +18 -7 lines
Diff to previous 1.101.2.6 (colored) to branchpoint 1.101 (colored)

Sync with HEAD

Revision 1.120 / (download) - annotate - [select for diffs], Wed Feb 1 01:51:07 2017 UTC (7 years ago) by maya
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq
Changes since 1.119: +18 -7 lines
Diff to previous 1.119 (colored)

restore r1.118

Revision 1.115.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:49 2017 UTC (7 years, 1 month ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.115.2.1: +2 -2 lines
Diff to previous 1.115.2.1 (colored) to branchpoint 1.115 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.119 / (download) - annotate - [select for diffs], Tue Dec 27 09:34:44 2016 UTC (7 years, 2 months ago) by maya
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.118: +5 -16 lines
Diff to previous 1.118 (colored)

Revert previous commit (to r1.117)

Superfluous warnings in simple userland programs is not a valid reason to
break a security model.

Revision 1.118 / (download) - annotate - [select for diffs], Fri Dec 9 13:06:41 2016 UTC (7 years, 2 months ago) by roy
Branch: MAIN
Changes since 1.117: +18 -7 lines
Diff to previous 1.117 (colored)

When loading a kernel, test if it's already loaded before authorizing.
This allows us to return EEXIST instead of EPERM for higher secure levels.

My use case was to stop npfctl complaining that it could not load bpfjit
on ERLITE when it was compiled into the kernel.
It then went on to complain that NPF performance would be de-graded,
but this is clearly not the case.

Revision 1.101.2.6 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:02 2016 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.5: +22 -17 lines
Diff to previous 1.101.2.5 (colored) to branchpoint 1.101 (colored)

Sync with HEAD

Revision 1.117 / (download) - annotate - [select for diffs], Sat Aug 13 12:05:49 2016 UTC (7 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914
Changes since 1.116: +7 -6 lines
Diff to previous 1.116 (colored)

tidy up messages and indentation

Revision 1.115.2.1 / (download) - annotate - [select for diffs], Sat Aug 6 00:19:09 2016 UTC (7 years, 6 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.115: +17 -13 lines
Diff to previous 1.115 (colored)

Sync with HEAD

Revision 1.116 / (download) - annotate - [select for diffs], Thu Aug 4 06:13:15 2016 UTC (7 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806
Changes since 1.115: +17 -13 lines
Diff to previous 1.115 (colored)

Print the parent module that asked for the builtin to be loaded and failed.
XXX: if a driver is built-in why can't it ask for a filesystem module to
be loaded?

Revision 1.97.2.3 / (download) - annotate - [select for diffs], Sun Jul 10 09:38:38 2016 UTC (7 years, 7 months ago) by martin
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.97.2.2: +18 -4 lines
Diff to previous 1.97.2.2 (colored) to branchpoint 1.97 (colored) next main 1.98 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1183):
	sys/kern/kern_module.c: revision 1.111
Check for duplicate module names before loading modules that were
"pushed" by the boot loader.  The boot loader pushes the module
name for the root file system (unless the root file system is ffs)
even if the file system module is built into the kernel.  When
this happens, we get a lot of "redefined symbol" error messages.
This fix does not alter the behavior of pushing the file system
name.  It simply avoids the redefined symbol errors by detecting
that the module is already built-in to the kernel and not trying
to load another copy.
While here, differentiate the error message text between "failed
to load" and "failed to fetch_info" conditions.
Addresses PR kern/50357

Revision 1.101.2.5 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:20 2016 UTC (7 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.4: +34 -13 lines
Diff to previous 1.101.2.4 (colored) to branchpoint 1.101 (colored)

Sync with HEAD

Revision 1.115 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:43 2016 UTC (7 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.114: +3 -3 lines
Diff to previous 1.114 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.114 / (download) - annotate - [select for diffs], Mon Jul 4 23:55:54 2016 UTC (7 years, 7 months ago) by pgoyette
Branch: MAIN
Changes since 1.113: +5 -5 lines
Diff to previous 1.113 (colored)

Don't declare module_verbose_on or module_autoload_on static.  It is useful
for these variables to be global, so they can be modified by ddb(4)
(entered via "boot -d") early in startup.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Jun 24 23:04:09 2016 UTC (7 years, 8 months ago) by pgoyette
Branch: MAIN
Changes since 1.112: +5 -8 lines
Diff to previous 1.112 (colored)

Simplfy insertion of newly-activated modules into the list.  There's no
good reason to treat modules without dependencies differently from those
which do require other modules.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Jun 23 04:41:03 2016 UTC (7 years, 8 months ago) by pgoyette
Branch: MAIN
Changes since 1.111: +19 -9 lines
Diff to previous 1.111 (colored)

When importing modules from the boot loader we should check for duplicate
module names both in the built-in list and in the list of previously
"pushed" modules.

While here, delay allocating the new 'struct module' until we've passed
the duplicate-name checks.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Jun 16 23:09:44 2016 UTC (7 years, 8 months ago) by pgoyette
Branch: MAIN
Changes since 1.110: +18 -4 lines
Diff to previous 1.110 (colored)

Check for duplicate module names before loading modules that were
"pushed" by the boot loader.  The boot loader pushes the module
name for the root file system (unless the root file system is ffs)
even if the file system module is built into the kernel.  When
this happens, we get a lot of "redefined symbol" error messages.

This fix does not alter the behavior of pushing the file system
name.  It simply avoids the redefined symbol errors by detecting
that the module is already built-in to the kernel and not trying
to load another copy.

While here, differentiate the error message text between "failed
to load" and "failed to fetch_info" conditions.

Addresses PR kern/50357

Revision 1.101.2.4 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:31 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.3: +13 -28 lines
Diff to previous 1.101.2.3 (colored) to branchpoint 1.101 (colored)

Sync with HEAD

Revision 1.97.2.2 / (download) - annotate - [select for diffs], Thu Mar 3 14:47:08 2016 UTC (7 years, 11 months ago) by martin
Branch: netbsd-7
Changes since 1.97.2.1: +27 -31 lines
Diff to previous 1.97.2.1 (colored) to branchpoint 1.97 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1108):
	sys/kern/kern_module.c: revision 1.107-1.110
	sys/kern/kern_ksyms.c: revision 1.82
Add some additional status messages for kern.module.verbose=TRUE

Remove extraneous ')' from previous.

KNF

In module_do_load(), consolidate checking for a pre-existing module,
and return a single error value EEXIST.  When making a recursive
call (to load required modules), treat a pre-existing module as
success.

Without this change, when a module was loaded by specific request
(as opposed to being loaded as a requirement of some other module),
we would always load the module from the file-system, and then
after making various sanity/compatability checks we would destroy
the new copy if there was a pre-existing copy.

Fixes PR kern/40764

XXX Note that if the module exists, we bypass all of the various
XXX "compatability" checks, including whether or not the existing
XXX module is of any particular class!  (In the previous code, we
XXX checked to see if the newly-loaded copy had the correct class,
XXX but not the pre-existing copy, which could have been loaded
XXX from a different path/filename.)

Revision 1.97.2.1.2.1 / (download) - annotate - [select for diffs], Thu Mar 3 14:46:07 2016 UTC (7 years, 11 months ago) by martin
Branch: netbsd-7-0
CVS Tags: netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Changes since 1.97.2.1: +27 -31 lines
Diff to previous 1.97.2.1 (colored) next main 1.97.2.2 (colored)

Pull up following revision(s) (requested by pgoyette in ticket #1108):
	sys/kern/kern_module.c: revision 1.107-1.110
	sys/kern/kern_ksyms.c: revision 1.82
Add some additional status messages for kern.module.verbose=TRUE

Remove extraneous ')' from previous.

KNF

In module_do_load(), consolidate checking for a pre-existing module,
and return a single error value EEXIST.  When making a recursive
call (to load required modules), treat a pre-existing module as
success.

Without this change, when a module was loaded by specific request
(as opposed to being loaded as a requirement of some other module),
we would always load the module from the file-system, and then
after making various sanity/compatability checks we would destroy
the new copy if there was a pre-existing copy.

Fixes PR kern/40764

XXX Note that if the module exists, we bypass all of the various
XXX "compatability" checks, including whether or not the existing
XXX module is of any particular class!  (In the previous code, we
XXX checked to see if the newly-loaded copy had the correct class,
XXX but not the pre-existing copy, which could have been loaded
XXX from a different path/filename.)

Revision 1.110 / (download) - annotate - [select for diffs], Sat Feb 6 22:48:07 2016 UTC (8 years ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319
Changes since 1.109: +13 -28 lines
Diff to previous 1.109 (colored)

In module_do_load(), consolidate checking for a pre-existing module,
and return a single error value EEXIST.  When making a recursive
call (to load required modules), treat a pre-existing module as
success.

Without this change, when a module was loaded by specific request
(as opposed to being loaded as a requirement of some other module),
we would always load the module from the file-system, and then
after making various sanity/compatability checks we would destroy
the new copy if there was a pre-existing copy.

Fixes PR kern/40764

XXX Note that if the module exists, we bypass all of the various
XXX "compatability" checks, including whether or not the existing
XXX module is of any particular class!  (In the previous code, we
XXX checked to see if the newly-loaded copy had the correct class,
XXX but not the pre-existing copy, which could have been loaded
XXX from a different path/filename.)

Revision 1.101.2.3 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:05 2015 UTC (8 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.2: +17 -6 lines
Diff to previous 1.101.2.2 (colored) to branchpoint 1.101 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.109 / (download) - annotate - [select for diffs], Wed Dec 9 16:26:16 2015 UTC (8 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226
Changes since 1.108: +5 -5 lines
Diff to previous 1.108 (colored)

KNF

Revision 1.108 / (download) - annotate - [select for diffs], Tue Nov 3 03:33:43 2015 UTC (8 years, 3 months ago) by pgoyette
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

Remove extraneous ')' from previous.

Revision 1.107 / (download) - annotate - [select for diffs], Tue Nov 3 02:04:12 2015 UTC (8 years, 3 months ago) by pgoyette
Branch: MAIN
Changes since 1.106: +15 -4 lines
Diff to previous 1.106 (colored)

Add some additional status messages for kern.module.verbose=TRUE

Revision 1.101.2.2 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:07 2015 UTC (8 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101.2.1: +7 -7 lines
Diff to previous 1.101.2.1 (colored) to branchpoint 1.101 (colored)

Sync with HEAD

Revision 1.106 / (download) - annotate - [select for diffs], Mon Jun 22 16:35:13 2015 UTC (8 years, 8 months ago) by matt
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.105: +3 -3 lines
Diff to previous 1.105 (colored)

Make module_machine const char *

Revision 1.97.2.1 / (download) - annotate - [select for diffs], Fri May 15 03:44:19 2015 UTC (8 years, 9 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: netbsd-7-0
Changes since 1.97: +6 -2 lines
Diff to previous 1.97 (colored)

Pull up following revision(s) (requested by jnemeth in ticket #762):
	share/man/man4/options.4: revision 1.442
	sys/arch/amd64/conf/ALL: revision 1.18
	sys/arch/amd64/conf/GENERIC: revision 1.396
	sys/arch/dreamcast/conf/GENERIC: revision 1.119
	sys/arch/epoc32/conf/GENERIC: revision 1.6
	sys/arch/evbarm/conf/BCM5301X: revision 1.24
	sys/arch/evbarm/conf/BCM56340: revision 1.9
	sys/arch/evbarm/conf/IMX23_OLINUXINO: revision 1.9
	sys/arch/evbarm/conf/std.beagle: revision 1.13
	sys/arch/evbarm/conf/std.kobo: revision 1.2
	sys/arch/evbarm/conf/std.netwalker: revision 1.10
	sys/arch/evbppc/conf/P2020DS: revision 1.25
	sys/arch/evbppc/conf/RB800: revision 1.30
	sys/arch/evbppc/conf/TWRP1025: revision 1.18
	sys/arch/hp300/conf/GENERIC: revision 1.187
	sys/arch/hpcsh/conf/GENERIC: revision 1.104
	sys/arch/i386/conf/GENERIC: revision 1.1111
	sys/arch/i386/conf/MONOLITHIC: revision 1.17
	sys/arch/landisk/conf/GENERIC: revision 1.43
	sys/arch/luna68k/conf/GENERIC: revision 1.117
	sys/arch/macppc/conf/GENERIC: revision 1.316
	sys/arch/macppc/conf/GENERIC_601: revision 1.5
	sys/arch/mmeye/conf/MMEYE_WLF: revision 1.16
	sys/arch/news68k/conf/GENERIC: revision 1.123
	sys/arch/sandpoint/conf/GENERIC: revision 1.85
	sys/arch/shark/conf/GENERIC: revision 1.119
	sys/arch/sparc/conf/GENERIC: revision 1.246
	sys/arch/sparc64/conf/GENERIC: revision 1.174
	sys/arch/sun3/conf/GENERIC3X: revision 1.125
	sys/arch/sun3/conf/GENERIC: revision 1.169
	sys/arch/x68k/conf/GENERIC: revision 1.177
	sys/arch/zaurus/conf/GENERIC: revision 1.62
	sys/conf/files: revision 1.1099
	sys/kern/kern_module.c: revisions 1.98, 1.99
Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR".  This
option turns on module autoloading by default (which is the current
default).  This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
--
fix typo. (s/MODULE_DEFAULT_AUTOLOAD/MODULAR_DEFAULT_AUTOLOAD/)

Revision 1.101.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:20 2015 UTC (8 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored)

Sync with HEAD

Revision 1.105 / (download) - annotate - [select for diffs], Sun Mar 8 01:17:42 2015 UTC (8 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

Fix thinko

Revision 1.104 / (download) - annotate - [select for diffs], Sat Mar 7 23:20:19 2015 UTC (8 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.103: +4 -4 lines
Diff to previous 1.103 (colored)

Fix compilation.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Feb 28 23:04:34 2015 UTC (9 years ago) by jmcneill
Branch: MAIN
Changes since 1.102: +4 -3 lines
Diff to previous 1.102 (colored)

if the root file-system is not yet mounted, hide "vfs load failed" spam with options DEBUG

Revision 1.102 / (download) - annotate - [select for diffs], Tue Dec 2 13:00:38 2014 UTC (9 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.101: +2 -3 lines
Diff to previous 1.101 (colored)

print kernel module path only in kernels which support paths

Revision 1.101 / (download) - annotate - [select for diffs], Fri Sep 5 06:50:58 2014 UTC (9 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

Missed a C++ keyword (DEBUG case)

Revision 1.100 / (download) - annotate - [select for diffs], Fri Sep 5 05:57:21 2014 UTC (9 years, 5 months ago) by matt
Branch: MAIN
Changes since 1.99: +19 -19 lines
Diff to previous 1.99 (colored)

Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Aug 24 11:36:11 2014 UTC (9 years, 6 months ago) by nonaka
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

fix typo. (s/MODULE_DEFAULT_AUTOLOAD/MODULAR_DEFAULT_AUTOLOAD/)

Revision 1.98 / (download) - annotate - [select for diffs], Sun Aug 24 07:59:23 2014 UTC (9 years, 6 months ago) by jnemeth
Branch: MAIN
Changes since 1.97: +6 -2 lines
Diff to previous 1.97 (colored)

Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR".  This
option turns on module autoloading by default (which is the current
default).  This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.

Revision 1.86.6.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:29 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-maxphys
Changes since 1.86.6.2: +55 -13 lines
Diff to previous 1.86.6.2 (colored) to branchpoint 1.86 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.97 / (download) - annotate - [select for diffs], Mon Aug 11 03:43:25 2014 UTC (9 years, 6 months ago) by jnemeth
Branch: MAIN
CVS Tags: tls-maxphys-base, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.96: +9 -2 lines
Diff to previous 1.96 (colored)

Add the infrastructure for MODULAR support for Xen kernels.  At
the moment, this can only load very simple modules due to missing
symbols.  It is being add at this time to make pullups to the
netbsd-7 branch easier.  It is not enabled by default in any kernels.

Revision 1.95.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:58 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.95: +5 -4 lines
Diff to previous 1.95 (colored) next main 1.96 (colored)

Rebase.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Jul 14 16:06:48 2014 UTC (9 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: tls-earlyentropy-base
Changes since 1.95: +5 -4 lines
Diff to previous 1.95 (colored)

Tell which dependency has failed

Revision 1.83.2.3 / (download) - annotate - [select for diffs], Thu May 22 11:41:03 2014 UTC (9 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.83.2.2: +98 -38 lines
Diff to previous 1.83.2.2 (colored) to branchpoint 1.83 (colored) next main 1.84 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.91.4.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:07 2014 UTC (9 years, 9 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.91: +47 -13 lines
Diff to previous 1.91 (colored) next main 1.92 (colored)

sync with head

Revision 1.95 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:11 2014 UTC (10 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.94: +2 -7 lines
Diff to previous 1.94 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Dec 15 21:09:50 2013 UTC (10 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.93: +38 -6 lines
Diff to previous 1.93 (colored)

Make the auto-unload timeout configurable via sysctl, and if the timeout
is set to zero, disable all auto-unloads (even those that were "scheduled"
previously).

Revision 1.93 / (download) - annotate - [select for diffs], Fri Sep 13 07:18:34 2013 UTC (10 years, 5 months ago) by jnemeth
Branch: MAIN
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

fix compilation error; hi christos!

Revision 1.92 / (download) - annotate - [select for diffs], Thu Sep 12 19:02:05 2013 UTC (10 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.91: +11 -4 lines
Diff to previous 1.91 (colored)

Silence some common module load errors and explain why.

Revision 1.86.6.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:18:57 2013 UTC (10 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.86.6.1: +53 -27 lines
Diff to previous 1.86.6.1 (colored) to branchpoint 1.86 (colored)

resync from head

Revision 1.91 / (download) - annotate - [select for diffs], Sun Mar 24 22:06:37 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900
Branch point for: rmind-smpnet
Changes since 1.90: +4 -2 lines
Diff to previous 1.90 (colored)

downgrade an error to debug.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 10 04:25:06 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: agc-symver-base, agc-symver
Changes since 1.89: +36 -25 lines
Diff to previous 1.89 (colored)

more detailed/consistent error messages.

Revision 1.89 / (download) - annotate - [select for diffs], Tue Mar 5 03:04:00 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.88: +4 -12 lines
Diff to previous 1.88 (colored)

remove extra chatty messages

Revision 1.88 / (download) - annotate - [select for diffs], Sun Mar 3 16:55:26 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.87: +29 -8 lines
Diff to previous 1.87 (colored)

more debugging

Revision 1.86.6.1 / (download) - annotate - [select for diffs], Mon Feb 25 00:29:51 2013 UTC (11 years ago) by tls
Branch: tls-maxphys
Changes since 1.86: +4 -4 lines
Diff to previous 1.86 (colored)

resync with head

Revision 1.87 / (download) - annotate - [select for diffs], Tue Feb 12 19:14:50 2013 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.86: +4 -4 lines
Diff to previous 1.86 (colored)

Can you please tell us the module name that had the wrong version? Thanks.

Revision 1.83.2.2 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:25 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.83.2.1: +4 -10 lines
Diff to previous 1.83.2.1 (colored) to branchpoint 1.83 (colored)

sync with head

Revision 1.85.2.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:30 2012 UTC (12 years ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.85: +2 -9 lines
Diff to previous 1.85 (colored) next main 1.86 (colored)

merge to -current.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Dec 4 19:24:59 2011 UTC (12 years, 2 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys
Changes since 1.85: +2 -9 lines
Diff to previous 1.85 (colored)

Implement the register/deregister/evaluation API for secmodel(9). It
allows registration of callbacks that can be used later for
cross-secmodel "safe" communication.

When a secmodel wishes to know a property maintained by another
secmodel, it has to submit a request to it so the other secmodel can
proceed to evaluating the request. This is done through the
secmodel_eval(9) call; example:

    bool isroot;
    error = secmodel_eval("org.netbsd.secmodel.suser", "is-root",
        cred, &isroot);
    if (error == 0 && !isroot)
            result = KAUTH_RESULT_DENY;

This one asks the suser module if the credentials are assumed to be root
when evaluated by suser module. If the module is present, it will
respond. If absent, the call will return an error.

Args and command are arbitrarily defined; it's up to the secmodel(9) to
document what it expects.

Typical example is securelevel testing: when someone wants to know
whether securelevel is raised above a certain level or not, the caller
has to request this property to the secmodel_securelevel(9) module.
Given that securelevel module may be absent from system's context (thus
making access to the global "securelevel" variable impossible or
unsafe), this API can cope with this absence and return an error.

We are using secmodel_eval(9) to implement a secmodel_extensions(9)
module, which plugs with the bsd44, suser and securelevel secmodels
to provide the logic behind curtain, usermount and user_set_cpu_affinity
modes, without adding hooks to traditional secmodels. This solves a
real issue with the current secmodel(9) code, as usermount or
user_set_cpu_affinity are not really tied to secmodel_suser(9).

The secmodel_eval(9) is also used to restrict security.models settings
when securelevel is above 0, through the "is-securelevel-above"
evaluation:
- curtain can be enabled any time, but cannot be disabled if
securelevel is above 0.
- usermount/user_set_cpu_affinity can be disabled any time, but cannot
be enabled if securelevel is above 0.

Regarding sysctl(7) entries:
curtain and usermount are now found under security.models.extensions
tree. The security.curtain and vfs.generic.usermount are still
accessible for backwards compat.

Documentation is incoming, I am proof-reading my writings.

Written by elad@, reviewed and tested (anita test + interact for rights
tests) by me. ok elad@.

See also
http://mail-index.netbsd.org/tech-security/2011/11/29/msg000422.html

XXX might consider va0 mapping too.

XXX Having a secmodel(9) specific printf (like aprint_*) for reporting
secmodel(9) errors might be a good idea, but I am not sure on how
to design such a function right now.

Revision 1.85 / (download) - annotate - [select for diffs], Mon Nov 28 03:13:31 2011 UTC (12 years, 3 months ago) by jnemeth
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Changes since 1.84: +4 -3 lines
Diff to previous 1.84 (colored)

Move "unloaded module" debug message higher as it appears that name
sometimes points to memory that gets freed causing the system to crash.

Revision 1.24.4.2 / (download) - annotate - [select for diffs], Fri Nov 18 21:22:48 2011 UTC (12 years, 3 months ago) by sborrill
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2
Changes since 1.24.4.1: +3 -3 lines
Diff to previous 1.24.4.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored)

Pull up the following revisions(s) (requested by tron in ticket #1688):
	sys/kern/kern_module.c:	revision 1.84

Return ENOEXEC instead of 0 if the info of a kernel module doesn't have the
expected size. This prevents kernel panics when loading broken modules.

Revision 1.83.2.1 / (download) - annotate - [select for diffs], Thu Nov 10 14:31:48 2011 UTC (12 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored)

sync with head

Revision 1.84 / (download) - annotate - [select for diffs], Sun Nov 6 12:40:04 2011 UTC (12 years, 3 months ago) by tron
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, jmcneill-audiomp3-base, jmcneill-audiomp3
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored)

Return ENOEXEC instead of 0 if the info of a kernel module doesn't have the
expected size. This prevents kernel panics when loading broken modules.

Revision 1.83 / (download) - annotate - [select for diffs], Tue Oct 18 12:25:31 2011 UTC (12 years, 4 months ago) by jmcneill
Branch: MAIN
CVS Tags: yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.82: +10 -2 lines
Diff to previous 1.82 (colored)

Don't try to auto-unload modules unless they were auto-loaded.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Sep 19 00:40:22 2011 UTC (12 years, 5 months ago) by pgoyette
Branch: MAIN
Changes since 1.81: +4 -3 lines
Diff to previous 1.81 (colored)

When "loading" a built-in module needs to autoload a dependant module
which is not already loaded (or was loaded, and then unloaded), make
sure we return a pointer to the built-in module.  Otherwise, when the
initial module tries to update its dependancies' reference counts, we
trigger a KASSERT in module_enqueue().

Revision 1.81 / (download) - annotate - [select for diffs], Wed Sep 14 12:29:22 2011 UTC (12 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80 (colored)

don't increment the number of referenced module as a side effect if we fail.
From jmcneill

Revision 1.80 / (download) - annotate - [select for diffs], Sat Aug 13 21:04:06 2011 UTC (12 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored)

Always provide a meaningful short name for the kobj in the error message,
as well as the function name and the linenumber, without extra line feeds.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Jul 17 20:54:52 2011 UTC (12 years, 7 months ago) by joerg
Branch: MAIN
Changes since 1.78: +2 -4 lines
Diff to previous 1.78 (colored)

Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.

Revision 1.75.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:29 2011 UTC (12 years, 8 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.75: +17 -5 lines
Diff to previous 1.75 (colored) next main 1.76 (colored)

Sync with HEAD.

Revision 1.60.2.4 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:08 2011 UTC (12 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.60.2.3: +6 -3 lines
Diff to previous 1.60.2.3 (colored) to branchpoint 1.60 (colored) next main 1.61 (colored)

sync with head

Revision 1.78 / (download) - annotate - [select for diffs], Sun Apr 17 05:16:28 2011 UTC (12 years, 10 months ago) by mrg
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.77: +7 -4 lines
Diff to previous 1.77 (colored)

add a "module_machine", that defaults to machine.
allows MD code to override the default subdir for modules.

Revision 1.77 / (download) - annotate - [select for diffs], Sat Apr 2 08:11:31 2011 UTC (12 years, 11 months ago) by mbalmer
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored)

Fix misplaced parenthesis.  From henning.petersen@t-online.de, thanks.

Revision 1.60.2.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:15 2011 UTC (12 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.60.2.2: +95 -71 lines
Diff to previous 1.60.2.2 (colored) to branchpoint 1.60 (colored)

sync with head

Revision 1.75.4.1 / (download) - annotate - [select for diffs], Sat Mar 5 15:10:39 2011 UTC (12 years, 11 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.75: +11 -2 lines
Diff to previous 1.75 (colored) next main 1.76 (colored)

Sync with HEAD

Revision 1.76 / (download) - annotate - [select for diffs], Mon Feb 21 09:53:06 2011 UTC (13 years ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.75: +11 -2 lines
Diff to previous 1.75 (colored)

Don't allow disabling a builtin secmodel: too many questionable
security implications.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jan 14 10:18:21 2011 UTC (13 years, 1 month ago) by martin
Branch: MAIN
CVS Tags: jruoho-x86intr-base, bouyer-quota2-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.74: +4 -4 lines
Diff to previous 1.74 (colored)

Using "int" variables with sysctl's CTLTYPE_BOOL is a simple receipt to
loose on big endian machines. So make the variables "bool".

Revision 1.74 / (download) - annotate - [select for diffs], Wed Dec 29 15:07:36 2010 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.73: +10 -9 lines
Diff to previous 1.73 (colored)

Pass potential prop dictionary to modcmd when reenabling a builtin
module.

Revision 1.57.2.3 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:26 2010 UTC (13 years, 4 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.57.2.2: +73 -59 lines
Diff to previous 1.57.2.2 (colored) to branchpoint 1.57 (colored) next main 1.58 (colored)

Sync with HEAD (-D20101022).

Revision 1.73 / (download) - annotate - [select for diffs], Sat Oct 16 18:09:02 2010 UTC (13 years, 4 months ago) by pgoyette
Branch: MAIN
CVS Tags: uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.72: +2 -3 lines
Diff to previous 1.72 (colored)

Remove double-inclusion of <sys/kauth.c>

Revision 1.9.6.6 / (download) - annotate - [select for diffs], Sat Oct 9 03:32:31 2010 UTC (13 years, 4 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.6.5: +76 -61 lines
Diff to previous 1.9.6.5 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

sync with head

Revision 1.72 / (download) - annotate - [select for diffs], Sat Aug 21 13:17:31 2010 UTC (13 years, 6 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11
Changes since 1.71: +75 -60 lines
Diff to previous 1.71 (colored)

Define a set of new kernel locking primitives to implement the recursive
kernconfig_mutex.  Update module subsystem to use this mutex rather than
its own internal (non-recursive) mutex.  Make module_autoload() do its
own locking to be consistent with the rest of the module_xxx() calls.
Update module(9) man page appropriately.

As discussed on tech-kern over the last few weeks.

Welcome to NetBSD 5.99.39 !

Revision 1.57.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:27 2010 UTC (13 years, 6 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.57.2.1: +94 -36 lines
Diff to previous 1.57.2.1 (colored) to branchpoint 1.57 (colored)

Sync with HEAD.

Revision 1.9.6.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:39 2010 UTC (13 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.6.4: +117 -38 lines
Diff to previous 1.9.6.4 (colored) to branchpoint 1.9 (colored)

sync with head.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Aug 11 12:04:49 2010 UTC (13 years, 6 months ago) by pgoyette
Branch: MAIN
CVS Tags: uebayasi-xip-base2
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored)

Keep condvar wmesg within 8 char limit

Revision 1.60.2.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:53 2010 UTC (13 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.60.2.1: +70 -20 lines
Diff to previous 1.60.2.1 (colored) to branchpoint 1.60 (colored)

sync with head

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jun 26 07:23:57 2010 UTC (13 years, 8 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10
Changes since 1.69: +70 -20 lines
Diff to previous 1.69 (colored)

1. Add an allocator for 'struct module *' and use it instead of local
   allocations.

2. Add a new member mod_flags to the 'struct module *' and define
   MODFLG_MUST_FORCE.  If this flag is set and the entry is on the list
   of builtins, it means that the module has been explicitly unloaded
   and any re-loads will require the MODCTL_LOAD_FORCE flag. Provide a
   module_require_force() method to set this flag;  once set, it should
   never be unset.

3. Rename original module_init2() to module_start_unload_thread() to be
   more descriptive of what it does.

4. Add a new module_builtin_require_force() routine that sets the
   MODFLG_MUST_FORCE flag for any module that has not yet successfully
   been initialized.  Call it after module_init_class(MODULE_CLASS_ANY)
   to disable remaining built-in modules.

This makes built-in versions of the xxxVERBOSE modules work once more,
resolving breakage reported by jruoho@ and njoly@.

Discussed on tech-kern, and comments and suggestions implemented.  No
additional discussion for last week.  Tested only on amd64 systems, but
there's nothing here that should be port- or architecture-specific (no
more specific than existing module implementation) so others should not
break.

Revision 1.60.2.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:57 2010 UTC (13 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.60: +53 -24 lines
Diff to previous 1.60 (colored)

sync with head

Revision 1.69 / (download) - annotate - [select for diffs], Wed May 26 23:53:21 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.68: +14 -7 lines
Diff to previous 1.68 (colored)

Feed dust to a few linkset uses and explicitly call the constructor.

Revision 1.68 / (download) - annotate - [select for diffs], Mon May 24 16:37:17 2010 UTC (13 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.67: +4 -2 lines
Diff to previous 1.67 (colored)

Move definition of module_load_vfs_vec from kern_module_vfs.c to
kern_module.c - keeps rump happy.

Thanks, pooka!

Revision 1.67 / (download) - annotate - [select for diffs], Mon May 24 15:34:48 2010 UTC (13 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.66: +4 -25 lines
Diff to previous 1.66 (colored)

Clean up kern_module.c rev 1.66, thanks to pooka@ for review & suggestions

Revision 1.66 / (download) - annotate - [select for diffs], Mon May 24 03:50:25 2010 UTC (13 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.65: +19 -6 lines
Diff to previous 1.65 (colored)

Protect against attempting to load modules from the filesystem until we
have mounted the root file-system.  This allows us to load built-in and
boot-loader-provided modules much earlier during startup.

Revision 1.65 / (download) - annotate - [select for diffs], Sun May 2 11:01:03 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.64: +11 -4 lines
Diff to previous 1.64 (colored)

If a builtin dependency is missing, error instead of panic.  As
pointed out by martin, configurations like builtin nfsserver can
be succesfully linked without including all dependencies (specifically,
nfs).  Until all such weirdosities are fixed, opt for at least a
semifunctional system.

Revision 1.57.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:09 2010 UTC (13 years, 10 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.57: +247 -61 lines
Diff to previous 1.57 (colored)

Sync with HEAD.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Apr 19 11:20:56 2010 UTC (13 years, 10 months ago) by jruoho
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored)

Use CTLTYPE_BOOL.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Apr 16 11:51:23 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.62: +20 -3 lines
Diff to previous 1.62 (colored)

Don't loop eternal if init of a builtin module fails.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Mar 18 18:25:45 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.61: +6 -4 lines
Diff to previous 1.61 (colored)

Print builtin "use -f" message only if not autoloading.  Otherwise
it'll get spammy.

XXX: this should probably be printed iff the toplevel module is
not being autoloaded (i.e. there is a human to interpret the error).
Otherwise disabled dependencies give a misleading EPERM.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Mar 18 17:33:18 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.60: +4 -2 lines
Diff to previous 1.60 (colored)

Never autounload builtin modules (they will never be autoloaded if disabled).

Revision 1.9.6.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:17 2010 UTC (13 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.6.3: +306 -219 lines
Diff to previous 1.9.6.3 (colored) to branchpoint 1.9 (colored)

sync with head

Revision 1.60 / (download) - annotate - [select for diffs], Fri Mar 5 20:10:05 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.59: +5 -2 lines
Diff to previous 1.59 (colored)

Make module_{lookup,enqueue}() static now that it's possible again
(effectively reverts my kern_module rev. 1.53 from some months ago)

Revision 1.59 / (download) - annotate - [select for diffs], Fri Mar 5 18:35:01 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.58: +223 -62 lines
Diff to previous 1.58 (colored)

Move builtin modules to a list in init and load them from there
instead of using linksets directly.  This has two implications:

1) It is now possible to "unload" a builtin module provided it is
   not busy.  This is useful e.g. to disable a kernel feature as
   an immediate workaround to a security problem.  To re-initialize
   the module, modload -f <name> is required.
2) It is possible to use builtin modules which were linked at
   runtime with an external linker (dlopen + rump).

Revision 1.58 / (download) - annotate - [select for diffs], Wed Mar 3 17:58:36 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.57: +5 -4 lines
Diff to previous 1.57 (colored)

Replace unsafe use of TAILQ_FOREACH: as the comment says, the
structures are pulled off the list in the loop and it's anyone's
guess where they go after that.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jan 19 15:23:14 2010 UTC (14 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.56: +3 -6 lines
Diff to previous 1.56 (colored)

Update comment: unloaded modules which were pumped up by the
bootloader are not freed at the end of bootstrap (there should be
none, although this is not asserted.  maybe it should be?).

Revision 1.56 / (download) - annotate - [select for diffs], Fri Jan 1 03:22:13 2010 UTC (14 years, 2 months ago) by dholland
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)

typo in comment

Revision 1.55 / (download) - annotate - [select for diffs], Tue Dec 29 17:49:21 2009 UTC (14 years, 2 months ago) by elad
Branch: MAIN
Changes since 1.54: +21 -21 lines
Diff to previous 1.54 (colored)

Move the listener plugging to module_init(), as it runs after kauth_init()
now. (Leaving only the module kthread creation in module_init2().)

Revision 1.54 / (download) - annotate - [select for diffs], Wed Nov 18 17:40:45 2009 UTC (14 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.53: +36 -154 lines
Diff to previous 1.53 (colored)

* make it possible to include kern_module in a kernel without vfs
  support, i.e. move vfs functionality to a separate module
  (kern_module_vfs.c)
* make module proplist size an MI constant (now 8k) instead of PAGE_SIZE
* change some error values to something else than the karmic EINVAL

Revision 1.53 / (download) - annotate - [select for diffs], Thu Nov 5 14:09:14 2009 UTC (14 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.52: +5 -4 lines
Diff to previous 1.52 (colored)

expose module_{lookup,enqueue}()

Revision 1.52 / (download) - annotate - [select for diffs], Fri Oct 16 00:27:07 2009 UTC (14 years, 4 months ago) by jnemeth
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.51: +6 -2 lines
Diff to previous 1.51 (colored)

allow passing a NULL proplib dictionary to modctl(MODCTL_LOAD, ...)

Revision 1.51 / (download) - annotate - [select for diffs], Sat Oct 3 00:06:37 2009 UTC (14 years, 4 months ago) by elad
Branch: MAIN
Changes since 1.50: +24 -2 lines
Diff to previous 1.50 (colored)

Put module loading policy back in the subsystem.

Revisit: consider moving kauth_init() above module_init() in main().

Revision 1.50 / (download) - annotate - [select for diffs], Fri Oct 2 18:50:14 2009 UTC (14 years, 4 months ago) by elad
Branch: MAIN
Changes since 1.49: +19 -3 lines
Diff to previous 1.49 (colored)

First part of secmodel cleanup and other misc. changes:

  - Separate the suser part of the bsd44 secmodel into its own secmodel
    and directory, pending even more cleanups. For revision history
    purposes, the original location of the files was

        src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
        src/sys/secmodel/bsd44/suser.h

  - Add a man-page for secmodel_suser(9) and update the one for
    secmodel_bsd44(9).

  - Add a "secmodel" module class and use it. Userland program and
    documentation updated.

  - Manage secmodel count (nsecmodels) through the module framework.
    This eliminates the need for secmodel_{,de}register() calls in
    secmodel code.

  - Prepare for secmodel modularization by adding relevant module bits.
    The secmodels don't allow auto unload. The bsd44 secmodel depends
    on the suser and securelevel secmodels. The overlay secmodel depends
    on the bsd44 secmodel. As the module class is only cosmetic, and to
    prevent ambiguity, the bsd44 and overlay secmodels are prefixed with
    "secmodel_".

  - Adapt the overlay secmodel to recent changes (mainly vnode scope).

  - Stop using link-sets for the sysctl node(s) creation.

  - Keep sysctl variables under nodes of their relevant secmodels. In
    other words, don't create duplicates for the suser/securelevel
    secmodels under the bsd44 secmodel, as the latter is merely used
    for "grouping".

  - For the suser and securelevel secmodels, "advertise presence" in
    relevant sysctl nodes (sysctl.security.models.{suser,securelevel}).

  - Get rid of the LKM preprocessor stuff.

  - As secmodels are now modules, there's no need for an explicit call
    to secmodel_start(); it's handled by the module framework. That
    said, the module framework was adjusted to properly load secmodels
    early during system startup.

  - Adapt rump to changes: Instead of using empty stubs for securelevel,
    simply use the suser secmodel. Also replace secmodel_start() with a
    call to secmodel_suser_start().

  - 5.99.20.

Testing was done on i386 ("release" build). Spearated module_init()
changes were tested on sparc and sparc64 as well by martin@ (thanks!).

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/09/25/msg006135.html

Revision 1.41.2.2 / (download) - annotate - [select for diffs], Thu Jul 23 23:32:34 2009 UTC (14 years, 7 months ago) by jym
Branch: jym-xensuspend
Changes since 1.41.2.1: +191 -9 lines
Diff to previous 1.41.2.1 (colored) next main 1.42 (colored)

Sync with HEAD.

Revision 1.9.6.3 / (download) - annotate - [select for diffs], Sat Jun 20 07:20:31 2009 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.6.2: +191 -9 lines
Diff to previous 1.9.6.2 (colored) to branchpoint 1.9 (colored)

sync with head

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jun 17 21:04:25 2009 UTC (14 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base
Changes since 1.48: +7 -7 lines
Diff to previous 1.48 (colored)

Make kobj_stat() return ENOSYS instead of panicking ("not modular")
on non-MODULAR kernels.  Make a few kobj_stat() callers check for
a non-zero return code and deal gracefully.

Revision 1.48 / (download) - annotate - [select for diffs], Tue Jun 9 20:35:02 2009 UTC (14 years, 8 months ago) by jnemeth
Branch: MAIN
Changes since 1.47: +4 -3 lines
Diff to previous 1.47 (colored)

Add the MODCTL_NO_PROP flag to tell the kernel to ignore <module>.prop.

Add the '-P' option to modload(8) to set this flag.

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jun 9 19:09:03 2009 UTC (14 years, 8 months ago) by jnemeth
Branch: MAIN
Changes since 1.46: +42 -3 lines
Diff to previous 1.46 (colored)

Add code to merge the modload "command line" with <module>.prop.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Jun 7 09:47:31 2009 UTC (14 years, 8 months ago) by jnemeth
Branch: MAIN
Changes since 1.45: +121 -5 lines
Diff to previous 1.45 (colored)

Read in a <module>.prop file if it exists and internalize then pass it
to the <module> being loaded.

XXX A <module>.prop file will override anything on the "command line".
This will be fixed in the next commit.

Revision 1.45 / (download) - annotate - [select for diffs], Tue May 26 08:34:23 2009 UTC (14 years, 9 months ago) by jnemeth
Branch: MAIN
Changes since 1.44: +7 -5 lines
Diff to previous 1.44 (colored)

Move all namei flags handling into kobj_load_file().

When I originally wrote this, I was going for maximum flexibility.
However, after a private discussion with dholland@, I see how this
will cause problems with the future world order of namei whenever
that might be.  At the moment, I don't need the extra flexibility,
but if something comes up this may have to be revisited.

Revision 1.44 / (download) - annotate - [select for diffs], Mon May 25 22:33:00 2009 UTC (14 years, 9 months ago) by jnemeth
Branch: MAIN
Changes since 1.43: +21 -5 lines
Diff to previous 1.43 (colored)

Phase 0.5 of my options MODULAR enhancements.  As suggested by ad@,
these commits move all path handling into module_do_load() from
kobj_load_file().  This way the final path used to load a module
is available for loading <module>.plist, which will store parameters
for a module.  The end goal of this project is good support for
MODULAR device drivers.

Revision 1.43 / (download) - annotate - [select for diffs], Sun May 24 14:54:17 2009 UTC (14 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.42: +11 -3 lines
Diff to previous 1.42 (colored)

ddb: don't try to stat builtin modules.

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Wed May 13 17:21:56 2009 UTC (14 years, 9 months ago) by jym
Branch: jym-xensuspend
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.9.6.2 / (download) - annotate - [select for diffs], Mon May 4 08:13:46 2009 UTC (14 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.6.1: +430 -103 lines
Diff to previous 1.9.6.1 (colored) to branchpoint 1.9 (colored)

sync with head.

Revision 1.24.2.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:32:56 2009 UTC (14 years, 11 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.24.2.1: +7 -4 lines
Diff to previous 1.24.2.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored)

Sync with HEAD.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Feb 13 22:41:04 2009 UTC (15 years ago) by apb
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored)

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.

Revision 1.24.4.1 / (download) - annotate - [select for diffs], Mon Feb 2 22:15:15 2009 UTC (15 years ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Changes since 1.24: +5 -2 lines
Diff to previous 1.24 (colored)

Apply patch (requested by ad in ticket #403):
Disable module autoload in 5.0. It's not well enough tested with this
version of the code.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jan 24 22:14:45 2009 UTC (15 years, 1 month ago) by rmind
Branch: MAIN
Branch point for: jym-xensuspend
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored)

Revert path of modules back to "/stand".

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jan 24 00:29:12 2009 UTC (15 years, 1 month ago) by rmind
Branch: MAIN
Changes since 1.39: +4 -4 lines
Diff to previous 1.39 (colored)

Change path to kernel modules from "/stand" to "/kernel".
Needs to go in before 5.0.  Proposed on <tech-kern>.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jan 20 20:12:41 2009 UTC (15 years, 1 month ago) by drochner
Branch: MAIN
Changes since 1.38: +6 -4 lines
Diff to previous 1.38 (colored)

add __gcc__ __format__ __string__ __attributes__ to catch mistakes early

Revision 1.24.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:19:38 2009 UTC (15 years, 1 month ago) by skrll
Branch: nick-hppapmap
Changes since 1.24: +328 -45 lines
Diff to previous 1.24 (colored)

Sync with HEAD.

Revision 1.8.10.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:18 2009 UTC (15 years, 1 month ago) by mjf
Branch: mjf-devfs2
Changes since 1.8.10.3: +356 -47 lines
Diff to previous 1.8.10.3 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

Sync with HEAD.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Dec 28 03:21:02 2008 UTC (15 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: mjf-devfs2-base
Changes since 1.37: +6 -3 lines
Diff to previous 1.37 (colored)

- Don't autounload modules loaded during boot. In my case, ffs got unloaded
  because my cdrom takes too long to initialize.
- Consistently print error messages in all error cases.

Revision 1.21.4.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:08 2008 UTC (15 years, 2 months ago) by haad
Branch: haad-dm
Changes since 1.21.4.1: +354 -48 lines
Diff to previous 1.21.4.1 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 5 12:55:09 2008 UTC (15 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.36: +6 -9 lines
Diff to previous 1.36 (colored)

Back out revision 1.35 which is no longer necessary and causes the system
to try autounloading modules perpetually.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Dec 5 12:51:17 2008 UTC (15 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.35: +4 -3 lines
Diff to previous 1.35 (colored)

PR kern/40110: null, overlay and umap modules loading -> panic (layerfs symbols not there)

Revision 1.35 / (download) - annotate - [select for diffs], Wed Dec 3 15:15:01 2008 UTC (15 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.34: +9 -6 lines
Diff to previous 1.34 (colored)

PR/40097: bouyer@antioche.lip6.fr: MODULAR tries to unload non-module subsystems
Don't try to unload built-in modules, and if a module is busy don't retry
immediately.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Dec 3 12:14:11 2008 UTC (15 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.33: +72 -21 lines
Diff to previous 1.33 (colored)

Add a couple of sysctls:

kern.module.autoload = 1
kern.module.verbose = 0

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 3 11:23:15 2008 UTC (15 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.32: +8 -6 lines
Diff to previous 1.32 (colored)

Correct error messages added in revision 1.32. In part from drochner@.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Nov 27 21:36:51 2008 UTC (15 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.31: +42 -13 lines
Diff to previous 1.31 (colored)

better error messages, and more messages for DIAGNOSTIC.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Nov 25 15:15:28 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Print the size as decimal.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 25 15:14:07 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.29: +67 -2 lines
Diff to previous 1.29 (colored)

Add some basic DDB stuff for modules.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Nov 19 13:07:42 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.28: +8 -2 lines
Diff to previous 1.28 (colored)

module_autoload: disallow path seperators and magic symlinks.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Nov 18 11:56:09 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.27: +15 -3 lines
Diff to previous 1.27 (colored)

Some modules may want to avoid autounload because their use is transient.
Their FINI routine may legitimately succeed even though the module is likely
to be used soon again, for example: exec_script. Add a MODULE_CMD_AUTOUNLOAD
to query whether a module wants to avoid autounload.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Nov 18 11:39:41 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.26: +60 -28 lines
Diff to previous 1.26 (colored)

- Put modules that depend on others at the head of the queue so autounload
  can unload requisite modules with only one pass.

- If loading a requisite module, scan the global queue before checking the
  file system to see if it exists.  If it's already present we don't care.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Nov 14 23:06:45 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.25: +85 -3 lines
Diff to previous 1.25 (colored)

- If the system encounters a severe memory shortage, start unloading
  unused kernel modules.
- Try to unload any autoloaded kernel modules 10 seconds after their
  load was successful.
- Keep a counter to track module load/unload events.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Nov 12 12:36:16 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.24: +10 -10 lines
Diff to previous 1.24 (colored)

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 22 11:19:15 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-0-RC1, matt-mips64-base2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.23: +8 -4 lines
Diff to previous 1.23 (colored)

Make MODCTL_LOAD_FORCE do something.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Oct 22 11:16:29 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.22: +26 -4 lines
Diff to previous 1.22 (colored)

- Be clear about whether module load is explicit or system initiated (auto).
- Require that module_lock is held to autoload, so that any preconditions
  can be safely checked.

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:27 2008 UTC (15 years, 4 months ago) by haad
Branch: haad-dm
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Sync with HEAD.

Revision 1.8.10.3 / (download) - annotate - [select for diffs], Sun Sep 28 10:40:52 2008 UTC (15 years, 5 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.8.10.2: +1 -1 lines
Diff to previous 1.8.10.2 (colored) to branchpoint 1.8 (colored)

Sync with HEAD.

Revision 1.14.2.2 / (download) - annotate - [select for diffs], Thu Sep 18 04:31:42 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.14.2.1: +3 -3 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Aug 1 14:05:15 2008 UTC (15 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, haad-dm-base1
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

expose module_compatible()

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:50 2008 UTC (15 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.14: +81 -66 lines
Diff to previous 1.14 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.9.4.2 / (download) - annotate - [select for diffs], Wed Jun 4 02:05:39 2008 UTC (15 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.9.4.1: +81 -66 lines
Diff to previous 1.9.4.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

sync with head

Revision 1.8.10.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:08 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.8.10.1: +164 -86 lines
Diff to previous 1.8.10.1 (colored) to branchpoint 1.8 (colored)

Sync with HEAD.

Revision 1.21 / (download) - annotate - [select for diffs], Sat May 31 20:14:38 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl
Branch point for: haad-dm
Changes since 1.20: +20 -7 lines
Diff to previous 1.20 (colored)

- Put in place module compatibility check against __NetBSD_Version__,
  as discussed on tech-kern.

- Remove unused module_jettison().

Revision 1.20 / (download) - annotate - [select for diffs], Tue May 20 19:20:38 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.19: +12 -9 lines
Diff to previous 1.19 (colored)

If autoloading a module, don't consider the current working directory.

Revision 1.19 / (download) - annotate - [select for diffs], Tue May 20 19:16:07 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.18: +2 -6 lines
Diff to previous 1.18 (colored)

Remove stale comment.

Revision 1.18 / (download) - annotate - [select for diffs], Tue May 20 17:24:56 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.17: +35 -10 lines
Diff to previous 1.17 (colored)

Allow module class to be passed to module_load(), as a basic sanity check
that we are loading the right kind of module.

Revision 1.17 / (download) - annotate - [select for diffs], Tue May 20 16:04:08 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.16: +6 -6 lines
Diff to previous 1.16 (colored)

Take $MACHINE into account when looking for modules.

Revision 1.16 / (download) - annotate - [select for diffs], Tue May 20 14:11:55 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.15: +13 -3 lines
Diff to previous 1.15 (colored)

PR kern/38694 module dependencies do not work as expected

Autoload modules from the correct path based on kernel version.

Revision 1.15 / (download) - annotate - [select for diffs], Tue May 20 13:34:44 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.14: +14 -46 lines
Diff to previous 1.14 (colored)

- Do local relocs before loading requisite modules, and all others only
  after requisite modules have been loaded. For PR kern/38697.
- Simplify kobj interface slightly to make error handling easier.

Revision 1.9.4.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:08 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-pf42
Changes since 1.9: +96 -33 lines
Diff to previous 1.9 (colored)

sync with head.

Revision 1.9.6.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:25 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9: +96 -33 lines
Diff to previous 1.9 (colored)

sync with head.

Revision 1.14 / (download) - annotate - [select for diffs], Sun May 4 21:35:12 2008 UTC (15 years, 9 months ago) by rumble
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Changes since 1.13: +6 -4 lines
Diff to previous 1.13 (colored)

Fix an error path that previously panicked when module_fetch_info failed.

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 2 12:59:34 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.12: +5 -3 lines
Diff to previous 1.12 (colored)

Re-do yesterday's build fix to hook in the MD stuff if available.

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 1 17:23:16 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.11: +30 -2 lines
Diff to previous 1.11 (colored)

- Add module_find_section(), allows a module to look up data in its object.
- Work around build failure.

Revision 1.11 / (download) - annotate - [select for diffs], Thu May 1 14:44:48 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.10: +62 -24 lines
Diff to previous 1.10 (colored)

Get the pre-loaded module code working.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:03 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.9: +2 -9 lines
Diff to previous 1.9 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.8.10.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:01 2008 UTC (15 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.8: +13 -11 lines
Diff to previous 1.8 (colored)

Sync with HEAD.

Revision 1.8.6.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:13 2008 UTC (15 years, 11 months ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.8: +13 -11 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

sync with head.

Revision 1.9.2.2 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:59 2008 UTC (15 years, 11 months ago) by matt
Branch: matt-armv6
Changes since 1.9.2.1: +667 -0 lines
Diff to previous 1.9.2.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

sync with HEAD

Revision 1.8.2.3 / (download) - annotate - [select for diffs], Mon Mar 17 09:15:33 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.8.2.2: +13 -11 lines
Diff to previous 1.8.2.2 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

sync with head.

Revision 1.9.2.1, Sun Mar 2 11:18:43 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.9: +0 -667 lines
FILE REMOVED

file kern_module.c was added on branch matt-armv6 on 2008-03-23 02:04:59 +0000

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 2 11:18:43 2008 UTC (16 years ago) by jmmv
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, matt-armv6
Changes since 1.8: +13 -11 lines
Diff to previous 1.8 (colored)

Add support for load-time parameters for modules, which are passed through
a dictionary.  As discussed in tech-kern@.

Revision 1.8.4.2 / (download) - annotate - [select for diffs], Mon Feb 18 21:06:46 2008 UTC (16 years ago) by mjf
Branch: mjf-devfs
Changes since 1.8.4.1: +665 -0 lines
Diff to previous 1.8.4.1 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

Sync with HEAD.

Revision 1.8.2.2 / (download) - annotate - [select for diffs], Mon Jan 21 09:46:07 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.8.2.1: +665 -0 lines
Diff to previous 1.8.2.1 (colored) to branchpoint 1.8 (colored)

sync with head

Revision 1.7.2.3 / (download) - annotate - [select for diffs], Sun Jan 20 17:51:43 2008 UTC (16 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.7.2.2: +4 -3 lines
Diff to previous 1.7.2.2 (colored) next main 1.8 (colored)

Sync with HEAD

Revision 1.8.4.1, Sat Jan 19 18:20:39 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.8: +0 -665 lines
FILE REMOVED

file kern_module.c was added on branch mjf-devfs on 2008-02-18 21:06:46 +0000

Revision 1.8.2.1, Sat Jan 19 18:20:39 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.8: +0 -665 lines
FILE REMOVED

file kern_module.c was added on branch yamt-lazymbuf on 2008-01-21 09:46:07 +0000

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jan 19 18:20:39 2008 UTC (16 years, 1 month ago) by rumble
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Branch point for: yamt-lazymbuf, mjf-devfs2, mjf-devfs, keiichi-mipv6
Changes since 1.7: +6 -5 lines
Diff to previous 1.7 (colored)

Ensure that if kobj_load fails we do not call kobj_close followed by
kobj_unload, as an unloaded kobj will already have been freed by an
implicit kobj_unload call in kobj_close. This fixes random panics when a
module fails to load.

Revision 1.7.2.2 / (download) - annotate - [select for diffs], Sat Jan 19 12:15:21 2008 UTC (16 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.7.2.1: +664 -0 lines
Diff to previous 1.7.2.1 (colored)

Sync with HEAD

Revision 1.7.2.1, Sat Jan 19 00:57:35 2008 UTC (16 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.7: +0 -664 lines
FILE REMOVED

file kern_module.c was added on branch bouyer-xeni386 on 2008-01-19 12:15:21 +0000

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jan 19 00:57:35 2008 UTC (16 years, 1 month ago) by rumble
Branch: MAIN
Branch point for: bouyer-xeni386
Changes since 1.6: +18 -5 lines
Diff to previous 1.6 (colored)

Ensure that circular dependencies do not panic the machine by doubly
locking the same file. Remove the special self-dependant case previously
introduced, as the general case handles it properly.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jan 18 16:41:46 2008 UTC (16 years, 1 month ago) by rumble
Branch: MAIN
Changes since 1.5: +9 -2 lines
Diff to previous 1.5 (colored)

Deal with braindead modules that depend on themselves, rather than inducing
an ambiguous panic later on.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jan 18 14:29:44 2008 UTC (16 years, 1 month ago) by rumble
Branch: MAIN
Changes since 1.4: +4 -3 lines
Diff to previous 1.4 (colored)

Avoid NULL pointer deref.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jan 18 01:41:55 2008 UTC (16 years, 1 month ago) by simonb
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Fix tyop in a KASSERT:  s/mod_required/mod->mod_required/

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jan 17 22:35:53 2008 UTC (16 years, 1 month ago) by rumble
Branch: MAIN
Changes since 1.2: +24 -6 lines
Diff to previous 1.2 (colored)

Fix a panic that occurs when a dependency had already been loaded and a
dependant module is loaded by setting modp when returning ENOENT.

Also, be stricter with regards to MAXMODNAME.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jan 16 18:28:32 2008 UTC (16 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.1: +11 -3 lines
Diff to previous 1.1 (colored)

- Include lkm_map if !LKM. XXX
- Add a comment about dependencies.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jan 16 12:34:52 2008 UTC (16 years, 1 month ago) by ad
Branch: MAIN

Pull in my modules code for review/test/hacking.

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.




CVSweb <webmaster@jp.NetBSD.org>