Commit Graph

344 Commits

Author SHA1 Message Date
thorpej 6626878e7b It is no longer necessary for pmap_pinit() and pmap_release() to be
pmap interface functions, as NetBSD no longer uses statically allocated
pmaps (except for the kernel pmap, which is special-cased anyhow).
1998-05-19 19:00:11 +00:00
thorpej 9556e0bd1e Nuke #if 0'd pmap_bootstrap() declaration. 1998-05-19 18:12:27 +00:00
mrg 6b11eea5b2 reject attempts to map an immutable or append-only file, shared with
write protection.  this stops data corruption where it was possible
to change the in-memory copy of an append-only file (but not the on-disk
copy).  this is documented in NetBSD security advisory 1998-003.  thanks
to darrenr, lukem, cgd, mycroft and mrg for this.
1998-05-10 12:35:58 +00:00
kleink afeaa5bb57 Use size_t to pass the length of the memory region to operate on to chgkprot(),
kernacc(), useracc(), vslock() and vsunlock(); (unsigned) ints are not
adequate on all platforms.
1998-05-09 15:04:39 +00:00
thorpej 73863dd3c9 Pass vslock() and vsunlock() a proc *, rather than implicitly operating
on curproc.
1998-04-30 06:28:57 +00:00
thorpej 2018d40811 Allocate kernel virtual address space for the U-area before allocating
the new proc structure when performing a fork.  This makes it much
easier to abort a fork operation and return an error if we run out
of KVA space.

The U-area pages are still wired down in {,u}vm_fork(), as before.
1998-04-09 00:23:38 +00:00
chuck 9eb2927bec free correct page in incomplete section of MNN, as pointed
out by Soren S. Jorvang.
1998-03-31 03:04:59 +00:00
mycroft 0652b9af01 Mark scheduler() and uvm_scheduler() as never returning. 1998-03-30 06:24:42 +00:00
kleink 6618749e5a Per XPG, if the file descriptor argument to mmap() refers to a file whose
type is not supported (neither VREG nor VCHR, or not a vnode at all), fail
with ENODEV instead of EINVAL.
1998-03-28 16:58:04 +00:00
thorpej 6e89972d82 Split vmspace_alloc() into vmspace_alloc() and vmspace_init(). The latter
can be used for initializing a pre-allocated vmspace.
1998-03-27 01:46:20 +00:00
chuck 3d3a01805a correctly count ru_majflt. the fix pulled in from pr#1397 is incorrect.
calling vm_pager_get() doesn't count as a "majflt" unless the pager
returns VM_PAGER_OK.  when walking an object chain we can get VM_PAGER_FAIL
(indicating that the requested data does not reside in this object
and we must continue to walk the chain) -- we don't want to count this
as a majflt.

i also added code to count ru_minflt.
1998-03-26 21:41:16 +00:00
thorpej 8fc4366b1d PAGE_SHIFT, PAGE_MASK, and PAGE_SIZE are all short-hand for kernel variables.
Protect them with _KERNEL.
1998-03-25 00:45:51 +00:00
phil 975f8de47c VM_PSTRAT_RANDOM does not use varible x. #ifdef x's definition. 1998-03-20 17:40:20 +00:00
thorpej dbc7bbee68 Make the previous change `atomic'. 1998-03-19 06:37:26 +00:00
thorpej daade671ae When unsharing or execing, deactivate the old vmspace before reassigning
and activating the new one.  Pointed out by Chris Demetriou.
1998-03-19 04:19:21 +00:00
thorpej d214d5c30a Add vm_page_alloc1() and vm_page_free1(), which allocate/free single
VM pages, not associated with any object.
1998-03-12 06:25:52 +00:00
mycroft 112daacfa3 As in UVM, automatically convert MAP_PRIVATE device mappings to MAP_SHARED. 1998-03-03 14:35:26 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
drochner 4f80f2803f Add a diagnostic panic() to catch attempts to call vm_page_unwire() with
an unmanaged page argument. This can lead to unpredictable results,
depending on the pmap interface (ie, MACHINE_[NEW_]NONCONTIG).
1998-02-23 14:37:00 +00:00
pk ed1d38cfe3 Add "storage" arguments (all NULL) to pool_create() and pool_prime(). 1998-02-19 23:56:37 +00:00
thorpej 1e3e1bfe09 Include the NFS option header. 1998-02-19 00:55:04 +00:00
cgd 3bbb7f7d45 Move pmap_map() function definition to MD headers, as appropriate. It's
an internal function, and the VM system shouldn't try to prototype it.
(Note that some ports _don't_ prototype it.)
1998-02-18 02:05:32 +00:00
mrg d90485202c - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
1998-02-10 14:08:44 +00:00
thorpej 223caea788 pmap_page_index() is not used in the MACHINE_NEW_NONCONTIG case. 1998-02-08 18:47:06 +00:00
thorpej d319b28938 Round allocations to page size in vm_bootstrap_steal_memory(). 1998-02-08 18:24:52 +00:00
mrg 8f7ee94e13 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

these are the changes to the old Mach VM system to allow both to be
available in the kernel.
1998-02-06 00:14:43 +00:00
mrg 5ef401eaaf oops, forgot to add this file earlier. 1998-02-05 14:58:45 +00:00
ross c297f000b7 NFS swap fix. Most files here are modified purely to add a tsleep() wmesg
string. The actual functional changes are:

	1. in vm_page_alloc(), restore some long lost code by Paul Kranenburg
	that reserves the last few pages for kernel objects, adding an
	additional escape for the pageout daemon.

	2. In vm_wait() (replaces VM_WAIT), recognize the amusing fatal
	deadlock where the pagedemon sleeps on a channel that only it ever
	wakes up, and add a timeout and printf. Mod 1 should generally
	prevent this from happening in any case.

	3. Fix a livelock in vm_pageout_page() caused by a pre-wakeup of
	page consumers prior to the pageout, which can easily fail over
	memory issues in NFS and IP code. Also, ++ cnt.v_pageouts only
	if the pageout succeeded.
1998-01-31 04:02:39 +00:00
drochner c0d5e99849 fix overflow of the vm_physmem[] array 1998-01-20 12:34:35 +00:00
thorpej e76d5a2fe1 Oops, don't need vm_page_physget() if PMAP_STEAL_MEMORY. 1998-01-10 03:02:58 +00:00
thorpej 51902c1094 In vm_page_physload(), check page_shift not cnt.v_page_size for
having been initialized.
1998-01-09 08:50:00 +00:00
thorpej 4001cf8069 In vm_mem_init(), don't test for cnt.v_page_size being == 0. It is perfectly
legitimate for this to be set if vm_set_page_size() hasn't been called (it's
how the page size is communicated to vm_set_page_size()).  Instead, test
for page_shift == 0; this is one of the values that vm_set_page_size()
initializes.
1998-01-09 06:00:50 +00:00
thorpej 54f8b4bf57 In the new non-contig case, redefine pmap_steal_memory() as an alternative
to vm_bootstrap_steal_memory(), since we may need to steal memory from
a direct-mapped segment at this early stage of the game (on e.g. MIPS
and Alpha).

This interface is activated by defining PMAP_STEAL_MEMORY in <machine/pmap.h>.
Otherwise, the pmap_virtual_space() prototype is in-scope for use by
vm_bootstrap_steal_memory().
1998-01-08 23:28:04 +00:00
thorpej 15efce41a3 Zorch pmap_startup() prototype. It was never implemented in machine-dependent
code, and is inlined in the MACHINE_NONCONTIG case of vm_page_bootstrap() now.
1998-01-08 23:13:05 +00:00
thorpej 589a1e440e Clean up and consolidate the old non-contig bootstrap functions, and
rename pmap_steal_memory() to vm_bootstrap_steal_memory().
1998-01-08 23:03:24 +00:00
mrg a20d56e92e add new version of non contiguous memory code, written by chuck cranor,
called "MACHINE_NEW_NONCONGIG".  this is required for UVM, the new VM
system (also written by chuck) that is coming soon.  adds new functions:
	vm_page_physload() -- tell the VM system about an area of memory.
	vm_physseg_find() -- returns index in vm_physmem array that this
		address is in.
and several new versions of old functions/macros defined in vm_page.h.

this is the MI portion.  sparc, and then later i386 portions to come.
all other ports need to change to this ASAP!  (alpha is already being
worked on)
1998-01-08 11:36:16 +00:00
thorpej d8ee45898e Garbage-collect __VM_PMAP_HACK. 1998-01-06 08:36:23 +00:00
perry 24920eefb1 RCSID Police. 1998-01-05 19:40:40 +00:00
thorpej 5739c88a75 Implement address space sharing (by keeping ref counts on the vmspace
structure).  Many thanks to Chuck Cranor for debugging assistence.
1998-01-03 02:53:00 +00:00
thorpej b9f1b716f3 Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
1998-01-03 01:12:59 +00:00
thorpej a322314f51 Split out the code that prepares a VM space for exec into a new
vmspace_exec() function.
1997-12-31 07:47:41 +00:00
pk 443a2a02f4 "pool" routines moved to kern/subr_pool.c 1997-12-15 11:18:41 +00:00
pk 5d1352c448 Guard against synchronous I/O completetion per swap-device. 1997-12-02 13:47:37 +00:00
pk 1736bb9de8 Make the code a bit more readable. 1997-12-01 17:10:48 +00:00
pk d4a6f93147 Make sure the damned buffer heads are initialized... 1997-12-01 16:33:15 +00:00
pk 46f604677d Avoid several race conditions, especially when a transaction ends in error.
Guard sw_reg_start() against synchronous completions of the device
strategy routines, avoiding possibly boundless recursion.
1997-11-29 00:35:43 +00:00
thorpej 97d2a58201 Fix slight argument bogosity with getgroups(), setgroups(), select(),
and swapctl().  For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs.  For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
1997-11-04 21:24:14 +00:00
thorpej 14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
pk d24dbbbfc4 A `simplelock' suffices for most swap device list traversals, as noted
by Chuck Cranor.

Use an exclusive (long-term) lock before applying changes to the swap
lists. This lock is also used by the stats system call because of possible
blocking in copyout().
1997-10-17 19:06:05 +00:00
christos b82d33e84c PR/4269: Chris Demetriou: msync is missing the MS_* flags.
Also change caddr_t syscall arguments to void *
1997-10-16 23:29:26 +00:00