OpenBSD CVS

CVS log for src/sys/uvm/uvm_extern.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.174 / (download) - annotate - [select for diffs], Tue Apr 2 08:39:17 2024 UTC (2 months, 1 week ago) by deraadt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.173: +1 -2 lines
Diff to previous 1.173 (colored)

Delete the msyscall mechanism entirely, since mimmutable+pinsyscalls has
replaced it with a more strict mechanism, which happens to be lockless O(1)
rather than micro-lock O(1)+O(log N).  Also nop-out the sys_msyscall(2) guts,
but leave the syscall around for a bit longer so that people can build through
it, since ld.so(1) still wants to call it.

Revision 1.173 / (download) - annotate - [select for diffs], Fri Jan 19 21:20:35 2024 UTC (4 months, 3 weeks ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.172: +1 -3 lines
Diff to previous 1.172 (colored)

remove the guts of pinsyscall(2), it just returns 0 now.
It has been made redundant by the introduction of pinsyscalls(2) which
handles all system calls, rather than just 1.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Jan 17 22:22:25 2024 UTC (4 months, 3 weeks ago) by kurt
Branch: MAIN
Changes since 1.171: +3 -3 lines
Diff to previous 1.171 (colored)

Fix core file writing when a file map into memory has later been truncated
to be smaller than the mapping. Record which memory segments are backed by
vnodes while walking the uvm map and later suppress EFAULT errors caused
by the underlying file being truncated. okay miod@

Revision 1.171 / (download) - annotate - [select for diffs], Fri Aug 18 09:18:52 2023 UTC (9 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.170: +1 -2 lines
Diff to previous 1.170 (colored)

Move the loadavg calculation to sched_bsd.c as update_loadav()

With this uvm_meter() is no more and update_loadav() uses a simple timeout
instead of getting called via schedcpu().

OK deraadt@ mpi@ cheloha@

Revision 1.170 / (download) - annotate - [select for diffs], Wed Jun 21 21:16:21 2023 UTC (11 months, 3 weeks ago) by cheloha
Branch: MAIN
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

Revert "schedcpu, uvm_meter(9): make uvm_meter() an independent timeout"

Sometimes causes boot hang after mounting root partition.

Thread 1: https://marc.info/?l=openbsd-misc&m=168736497407357&w=2
Thread 2: https://marc.info/?l=openbsd-misc&m=168737429214370&w=2

Revision 1.169 / (download) - annotate - [select for diffs], Tue Jun 20 16:30:30 2023 UTC (11 months, 3 weeks ago) by cheloha
Branch: MAIN
Changes since 1.168: +2 -2 lines
Diff to previous 1.168 (colored)

schedcpu, uvm_meter(9): make uvm_meter() an independent timeout

uvm_meter(9) should not base its periodic uvm_loadav() call on the UTC
clock.  It also no longer needs to periodically wake up proc0 because
proc0 doesn't do any work.  schedcpu() itself may change or go away,
but as kettenis@ notes we probably can't completely remove the concept
of a "load average" from OpenBSD, given its long Unix heritage.

So, (1) remove the uvm_meter() call from schedcpu(), (2) make
uvm_meter() an independent timeout started alongside schedcpu() during
scheduler_start(), and (3) delete the vestigial periodic proc0 wakeup.

With input from deraadt@, kettenis@, and claudio@.  deraadt@ cautions
that this change may confuse administrators who hold the load average
in high regard.

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

general agreement with this direction from kettenis@
ok claudio@

Revision 1.168 / (download) - annotate - [select for diffs], Tue May 30 08:30:01 2023 UTC (12 months, 1 week ago) by jsg
Branch: MAIN
Changes since 1.167: +2 -2 lines
Diff to previous 1.167 (colored)

spelling
ok jmc@ guenther@ tb@

Revision 1.167 / (download) - annotate - [select for diffs], Thu Feb 16 04:42:07 2023 UTC (15 months, 3 weeks ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.166: +3 -1 lines
Diff to previous 1.166 (colored)

Add pinsyscall(2).  With this you can tell the kernel the location
(start,len) of the syscall stub in libc.so for a specified syscall
(using SYS_* notation).  Only SYS_execve is supported at this time.
ok gnezdo mortimer kettenis

Revision 1.166 / (download) - annotate - [select for diffs], Thu Nov 17 18:53:05 2022 UTC (18 months, 3 weeks ago) by deraadt
Branch: MAIN
Changes since 1.165: +2 -2 lines
Diff to previous 1.165 (colored)

stack growth from setrlimit was never updated to set UVM_ET_STACK on
the entries, so the check-sp-at-system-call check failed.  Quite strange
it took this long to find this.
ok kettenis

Revision 1.165 / (download) - annotate - [select for diffs], Sun Oct 16 16:16:37 2022 UTC (19 months, 3 weeks ago) by deraadt
Branch: MAIN
Changes since 1.164: +2 -1 lines
Diff to previous 1.164 (colored)

Rather than marking MAP_STACK on entries for sigaltstack() [2 days ago],
go back to the old approach: using a new anon mapping because it removes
any potential gadgetry pre-placed in the region (by making it zero).  But
also bring in a few more validation checks beyond contigious mapping -- it
must not be a syscall region, and the protection must be precisely RW.
This does allow sigaltstack() to shoot zero'd MAP_STACK non-immutable regions
into the main stack area (which will soon be immutable).  I am not sure we
can keep reinforce immutable on the region after we do stack (like maybe
determine this while doing the validation entry walk?)
Sadly, continued support for sigaltstack() does require selecting the guessed
best compromise.
ok kettenis

Revision 1.164 / (download) - annotate - [select for diffs], Fri Oct 7 14:59:39 2022 UTC (20 months ago) by deraadt
Branch: MAIN
Changes since 1.163: +2 -2 lines
Diff to previous 1.163 (colored)

Add mimmutable(2) system call which locks the permissions (PROT_*) of
memory mappings so they cannot be changed by a later mmap(), mprotect(),
or munmap(), which will error with EPERM instead.
ok kettenis

Revision 1.163 / (download) - annotate - [select for diffs], Mon Aug 15 03:21:04 2022 UTC (21 months, 3 weeks ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.162: +1 -3 lines
Diff to previous 1.162 (colored)

remove unused uvm_aiobuf_pool

Revision 1.162 / (download) - annotate - [select for diffs], Tue Jun 7 12:07:45 2022 UTC (2 years ago) by kettenis
Branch: MAIN
Changes since 1.161: +1 -3 lines
Diff to previous 1.161 (colored)

Remove uvm_km_valloc_prefer_wait(9) and uvm_km_free_wakeup(9) now that
nothing uses these functions anymore.

ok mpi@

Revision 1.161 / (download) - annotate - [select for diffs], Sat May 14 15:25:57 2022 UTC (2 years ago) by kettenis
Branch: MAIN
Changes since 1.160: +1 -6 lines
Diff to previous 1.160 (colored)

uvm_km_valloc(9), uvm_km_valloc_try(9), uvm_km_valloc_wait(9) and
uvm_km_valloc_align(9) are no longer used.  Remove these functions.

ok mpi@

Revision 1.160 / (download) - annotate - [select for diffs], Sat Mar 12 08:11:07 2022 UTC (2 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.159: +0 -1 lines
Diff to previous 1.159 (colored)

Revert holding a read lock on the map while copying out data during sysctl(2).

This introduced a lock ordering issue reported by naddy@, anton@ and syzkaller.

Reported-by: syzbot+739bb901045d9b193bde@syzkaller.appspotmail.com

Revision 1.159 / (download) - annotate - [select for diffs], Fri Mar 11 19:24:19 2022 UTC (2 years, 3 months ago) by kettenis
Branch: MAIN
Changes since 1.158: +2 -1 lines
Diff to previous 1.158 (colored)

Hold a read lock on the map while copying out data during a sysctl(2) call
to prevent another thread from unmapping the memory and triggering
an assertion or even corrupting random physical memory pages.

This fix is similar to the change in uvm_glue.c rev. 1.74.  However in this
case we need to be careful since some sysctl(2) calls look at the map of
the current process.  In those cases we must not attempt to lock the map
again.

ok mpi@

Should fix:
Reported-by: syzbot+be89fe83d6c004fcb412@syzkaller.appspotmail.com

Revision 1.158 / (download) - annotate - [select for diffs], Mon Jun 28 11:19:01 2021 UTC (2 years, 11 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.157: +1 -3 lines
Diff to previous 1.157 (colored)

Make anonymous object reference counting independant from the KERNEL_LOCK().

- Use atomic operations for increment/decrement

- Rewrite the loop from uao_swap_off() to only keep a reference to the
  next item in the list.

ok jmatthew@

Revision 1.157 / (download) - annotate - [select for diffs], Fri Mar 12 14:15:49 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.156: +2 -2 lines
Diff to previous 1.156 (colored)

spelling

ok mpi@

Revision 1.156 / (download) - annotate - [select for diffs], Mon Dec 28 14:01:23 2020 UTC (3 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.155: +2 -1 lines
Diff to previous 1.155 (colored)

Use per-CPU counters for fault and stats counters reached in uvm_fault().

ok kettenis@, dlg@

Revision 1.155 / (download) - annotate - [select for diffs], Tue Dec 1 13:56:22 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.154: +4 -3 lines
Diff to previous 1.154 (colored)

Turn uvm_pagealloc() mp-safe by checking uvmexp global with pageqlock held.

Use a new flag, UVM_PLA_USERESERVE, to tell uvm_pmr_getpages() that using
kernel reserved pages is allowed.

Merge duplicated checks waking the pagedaemon to uvm_pmr_getpages().

Add two more pages to the amount reserved for the kernel to compensate the
fact that the pagedaemon may now consume an additional page.

Document locking of some uvmexp fields.

ok kettenis@

Revision 1.154 / (download) - annotate - [select for diffs], Mon Oct 19 08:19:46 2020 UTC (3 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.153: +8 -5 lines
Diff to previous 1.153 (colored)

Serialize accesses to "struct vmspace" and document its refcounting.

The underlying vm_space lock is used as a substitute to the KERNEL_LOCK()
in uvm_grow() to make sure `vm_ssize' is not corrupted.

ok anton@, kettenis@

Revision 1.153 / (download) - annotate - [select for diffs], Sun Sep 13 10:05:25 2020 UTC (3 years, 8 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.152: +4 -2 lines
Diff to previous 1.152 (colored)

Include <sys/systm.h> directly instead of relying on uvm_map.h to pull it.

Revision 1.152 / (download) - annotate - [select for diffs], Thu Dec 12 11:12:36 2019 UTC (4 years, 6 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.151: +1 -4 lines
Diff to previous 1.151 (colored)

Header cleanup.

- reduces gratuitous differences with NetBSD,
- merges multiple '#ifdef _KERNEL' blocks,
- kills unused 'struct vm_map_intrsafe'
- turns 'union vm_map_object' into a anonymous union (following to NetBSD)
- move questionable vm_map_modflags() into uvm/uvm_map.c
- remove guards around MAX_KMAPENT, it is defined&used only once
- document lock differences
- fix tab vs space

ok mlarkin@, visa@

Revision 1.151 / (download) - annotate - [select for diffs], Fri Nov 29 06:34:45 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.150: +2 -1 lines
Diff to previous 1.150 (colored)

Repurpose the "syscalls must be on a writeable page" mechanism to
enforce a new policy: system calls must be in pre-registered regions.
We have discussed more strict checks than this, but none satisfy the
cost/benefit based upon our understanding of attack methods, anyways
let's see what the next iteration looks like.

This is intended to harden (translation: attackers must put extra
effort into attacking) against a mixture of W^X failures and JIT bugs
which allow syscall misinterpretation, especially in environments with
polymorphic-instruction/variable-sized instructions.  It fits in a bit
with libc/libcrypto/ld.so random relink on boot and no-restart-at-crash
behaviour, particularily for remote problems. Less effective once on-host
since someone the libraries can be read.

For static-executables the kernel registers the main program's
PIE-mapped exec section valid, as well as the randomly-placed sigtramp
page.  For dynamic executables ELF ld.so's exec segment is also
labelled valid; ld.so then has enough information to register libc's
exec section as valid via call-once msyscall(2)

For dynamic binaries, we continue to to permit the main program exec
segment because "go" (and potentially a few other applications) have
embedded system calls in the main program.  Hopefully at least go gets
fixed soon.

We declare the concept of embedded syscalls a bad idea for numerous
reasons, as we notice the ecosystem has many of
static-syscall-in-base-binary which are dynamically linked against
libraries which in turn use libc, which contains another set of
syscall stubs.  We've been concerned about adding even one additional
syscall entry point... but go's approach tends to double the entry-point
attack surface.

This was started at a nano-hackathon in Bob Beck's basement 2 weeks
ago during a long discussion with mortimer trying to hide from the SSL
scream-conversations, and finished in more comfortable circumstances
next to a wood-stove at Elk Lakes cabin with UVM scream-conversations.

ok guenther kettenis mortimer, lots of feedback from others
conversations about go with jsing tb sthen

Revision 1.150 / (download) - annotate - [select for diffs], Thu Nov 28 23:42:52 2019 UTC (4 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.149: +1 -3 lines
Diff to previous 1.149 (colored)

uvm_pagealloc_contig() doesn't exist and shouldn't exist

ok kettenis@

Revision 1.149 / (download) - annotate - [select for diffs], Tue Nov 5 08:18:47 2019 UTC (4 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.148: +1 -2 lines
Diff to previous 1.148 (colored)

Kill uvm_deallocate(9) and use uvm_unmap() directly.

ok kettenis@, semarie@, deraadt@

Revision 1.148 / (download) - annotate - [select for diffs], Mon Jul 1 21:13:03 2019 UTC (4 years, 11 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.147: +6 -3 lines
Diff to previous 1.147 (colored)

Document which mechanism protect some fields used w/o KERNEL_LOCK().

ok visa@, semarie@

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

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

Inspired by code in DragonFly BSD and FreeBSD.

OK mpi@, agreement from jmatthew@ and anton@

Revision 1.146 / (download) - annotate - [select for diffs], Thu May 9 20:36:44 2019 UTC (5 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.145: +2 -1 lines
Diff to previous 1.145 (colored)

Ensure that pagedaemon wakeups as a result of failed UVM_PLA_NOWAIT
allocations will recover some memory from the dma_constraint range.

The allocation still fails, the intent is to ensure that the
pagedaemon will free some memory to possibly allow a subsequent
allocation to succeed.

This also adds a UVM_PLA_NOWAKE flag to allow special cases in the
buffer cache to not wake up the pagedaemon until they want to.

ok kettenis@

Revision 1.145 / (download) - annotate - [select for diffs], Fri Mar 1 01:46:18 2019 UTC (5 years, 3 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.144: +3 -2 lines
Diff to previous 1.144 (colored)

New mmap(2) flag: MAP_CONCEAL.

MAP_CONCEAL'd memory is not written to disk in the event of a core dump.
It may grow other qualities in the future.

Wanted by libressl, probably useful elsewhere, too.

Prompted by deraadt@, concept from deraadt@/kettenis@.  With input from
deraadt@, cjeker@, kettenis@, otto@, bcook@, matthew@, guenther@, djm@,
and tedu@.

ok otto@ deraadt@

Revision 1.144 / (download) - annotate - [select for diffs], Wed Oct 31 08:50:25 2018 UTC (5 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.143: +2 -1 lines
Diff to previous 1.143 (colored)

Add support to uvm to establish write-combining mappings.  Use this in the
inteldrm driver to add support for the I915_MMAP_WC flag.

ok deraadt@, jsg@

Revision 1.143 / (download) - annotate - [select for diffs], Thu Apr 12 17:13:44 2018 UTC (6 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.142: +2 -2 lines
Diff to previous 1.142 (colored)

Implement MAP_STACK option for mmap().  Synchronous faults (pagefault and
syscall) confirm the stack register points at MAP_STACK memory, otherwise
SIGSEGV is delivered. sigaltstack() and pthread_attr_setstack() are modified
to create a MAP_STACK sub-region which satisfies alignment requirements.
Observe that MAP_STACK can only be set/cleared by mmap(), which zeroes the
contents of the region -- there is no mprotect() equivalent operation, so
there is no MAP_STACK-adding gadget.
This opportunistic software-emulation of a stack protection bit makes
stack-pivot operations during ROPchain fragile (kind of like removing a
tool from the toolbox).
original discussion with tedu, uvm work by stefan, testing by mortimer
ok kettenis

Revision 1.142 / (download) - annotate - [select for diffs], Sun Apr 30 13:04:49 2017 UTC (7 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.141: +1 -4 lines
Diff to previous 1.141 (colored)

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@

Revision 1.141 / (download) - annotate - [select for diffs], Sun Mar 5 00:45:31 2017 UTC (7 years, 3 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.140: +8 -18 lines
Diff to previous 1.140 (colored)

Generating a coredump requires walking the map twice; change
uvm_coredump_walkmap() to do both with a callback in between
so it can hold locks/change state across the two.

ok stefan@

Revision 1.140 / (download) - annotate - [select for diffs], Sun Feb 12 04:55:08 2017 UTC (7 years, 3 months ago) by guenther
Branch: MAIN
Changes since 1.139: +1 -3 lines
Diff to previous 1.139 (colored)

Split up fork1():
 - FORK_THREAD handling is a totally separate function, thread_fork(),
   that is only used by sys___tfork() and which loses the flags, func,
   arg, and newprocp parameters and gains tcb parameter to guarantee
   the new thread's TCB is set before the creating thread returns
 - fork1() loses its stack and tidptr parameters
Common bits factor out:
 - struct proc allocation and initialization moves to thread_new()
 - maxthread handling moves to fork_check_maxthread()
 - setting the new thread running moves to fork_thread_start()
The MD cpu_fork() function swaps its unused stacksize parameter for
a tcb parameter.

luna88k testing by aoyama@, alpha testing by dlg@
ok mpi@

Revision 1.139 / (download) - annotate - [select for diffs], Sun Jun 5 08:35:57 2016 UTC (8 years ago) by stefan
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.138: +3 -1 lines
Diff to previous 1.138 (colored)

Add uvm_share() to share a memory range between two address spaces

Its primary use is to make guest VM memory accessible to the host
(e.g. vmd(8)). That will later allow us to remove the readpage and
writepage ioctls from vmm(4), and use ordinary loads and stores instead.

"looks good to me" kettenis@

Revision 1.138 / (download) - annotate - [select for diffs], Mon Apr 4 16:34:16 2016 UTC (8 years, 2 months ago) by stefan
Branch: MAIN
Changes since 1.137: +6 -7 lines
Diff to previous 1.137 (colored)

UVM_FLAG_AMAPPAD has no effect anymore, nuke it.

This flag caused amaps to be allocated with additional spare slots, to
make extending them cheaper. However, the kernel never extends amaps,
so allocating spare slots is pointless. Also UVM_FLAG_AMAPPAD only
has an effect in combination with UVM_FLAG_OVERLAY. The only function
that used both flags was sys_obreak, but that function had the use of
UVM_FLAG_OVERLAY removed recently.

While there, kill the unused prototypes amap_flags and amap_refs.
They're defined as macros already.

ok mlarkin@ kettenis@ mpi@

Revision 1.137 / (download) - annotate - [select for diffs], Wed Dec 2 09:50:46 2015 UTC (8 years, 6 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.136: +1 -2 lines
Diff to previous 1.136 (colored)

remove declaration for nonexistant function

ok tedu@

Revision 1.136 / (download) - annotate - [select for diffs], Wed Nov 11 15:59:33 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.135: +3 -4 lines
Diff to previous 1.135 (colored)

Remove the superfluous typedef uvm_flag_t (unsigned int). Also, fix an
associated mistake in the uvm manpage.

Suggested by and ok tedu@

Revision 1.135 / (download) - annotate - [select for diffs], Mon Sep 28 18:33:42 2015 UTC (8 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.134: +3 -1 lines
Diff to previous 1.134 (colored)

add a flag to indicate to uvm_map that it should unmap to make space.
this pulls all the relevant operations under the same map locking, and
relieves calling code from responsibility.
ok kettenis matthew

Revision 1.134 / (download) - annotate - [select for diffs], Wed Sep 9 14:52:12 2015 UTC (8 years, 9 months ago) by miod
Branch: MAIN
Changes since 1.133: +1 -5 lines
Diff to previous 1.133 (colored)

All our pmap implementations provide pmap_resident_count(), so remove
#ifndef pmap_resident_count code paths.

Revision 1.133 / (download) - annotate - [select for diffs], Sun Jul 19 21:21:14 2015 UTC (8 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored)

Change uvm_page[re]alloc_multi to actually use the flags passed in, and return
a value so that they may be called with UVM_PLA_NOWAIT
ok kettenis@

Revision 1.132 / (download) - annotate - [select for diffs], Tue May 5 02:13:46 2015 UTC (9 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.131: +1 -4 lines
Diff to previous 1.131 (colored)

emul_native is only used for kernel threads which can't dump core, so
delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump,
and various #includes that are superfluous.

This leaves compat_linux processes without a coredump callback.  If that
ability is desired, someone should update it to use coredump_elf32() and
verify the results...

ok kettenis@

Revision 1.131 / (download) - annotate - [select for diffs], Sat Feb 7 08:21:24 2015 UTC (9 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.130: +3 -1 lines
Diff to previous 1.130 (colored)

Introduce VM_KERNEL_SPACE_SIZE as a replacement for
(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS). This will allow these to no
longer be constants in the future.

ok guenther@

Revision 1.130 / (download) - annotate - [select for diffs], Fri Feb 6 11:41:55 2015 UTC (9 years, 4 months ago) by beck
Branch: MAIN
Changes since 1.129: +2 -4 lines
Diff to previous 1.129 (colored)

-Split out uvm_mmap and uvm_map into a version for anon's and a version
for everything else.
-Adapt the anon version to be callable without the biglock held.
Done by tedu@, kettenis@ and me.. pounded on a bunch.

This does not yet make mmap a NOLOCK call, but permits it to be so.
ok tedu@, kettenis@, guenther@ jsing@

Revision 1.129 / (download) - annotate - [select for diffs], Thu Feb 5 23:51:06 2015 UTC (9 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.128: +1 -3 lines
Diff to previous 1.128 (colored)

Remove some unneeded <uvm/uvm_extern.h> inclusions.

ok deraadt@, miod@

Revision 1.128 / (download) - annotate - [select for diffs], Wed Dec 17 19:42:15 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.127: +1 -2 lines
Diff to previous 1.127 (colored)

remove lock.h from uvm_extern.h. another holdover from the simpletonlock
era. fix uvm including c files to include lock.h or atomic.h as necessary.
ok deraadt

Revision 1.127 / (download) - annotate - [select for diffs], Tue Dec 16 18:30:04 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.126: +1 -5 lines
Diff to previous 1.126 (colored)

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt

Revision 1.126 / (download) - annotate - [select for diffs], Mon Dec 15 02:24:23 2014 UTC (9 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.125: +20 -15 lines
Diff to previous 1.125 (colored)

Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,
eliminating the must-be-kept-in-sync UVM_INH_* macros

ok deraadt@ tedu@

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

Introduce a new sysctl to retrieve VM map entries

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

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

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

OK tedu@ deraadt@

Revision 1.124 / (download) - annotate - [select for diffs], Fri Nov 21 06:40:40 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.123: +1 -2 lines
Diff to previous 1.123 (colored)

Kill kv_executable flag.  We no longer allow requests for PROT_EXEC
mappings via this interface (nothing uses it, in any case)
ok uebayasi tedu

Revision 1.123 / (download) - annotate - [select for diffs], Sun Nov 16 12:31:00 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.122: +5 -52 lines
Diff to previous 1.122 (colored)

Replace a plethora of historical protection options with just
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h.
PROT_MASK is introduced as the one true way of extracting those bits.
Remove UVM_ADV_* wrapper, using the standard names.
ok doug guenther kettenis

Revision 1.122 / (download) - annotate - [select for diffs], Sat Nov 15 21:42:07 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored)

repair operator precedence in UVM_MAPFLAG() macro; ok tedu

Revision 1.121 / (download) - annotate - [select for diffs], Fri Oct 3 18:06:47 2014 UTC (9 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.120: +2 -1 lines
Diff to previous 1.120 (colored)

Introduce a thread for zeroing pages without holding the kernel lock.  This
way we can do some useful kernel lock in parallel with other things and create
a reservoir of zeroed pages ready for use elsewhere.  This should reduce
latency.  The thread runs at the absolutel lowest priority such that we don't
keep other kernel threads or userland from doing useful work.

Can be easily disabled by disabling the kthread_create(9) call in main().
Which perhaps we should do for non-MP kernels.

ok deraadt@, tedu@

Revision 1.120 / (download) - annotate - [select for diffs], Fri Oct 3 17:41:00 2014 UTC (9 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.119: +10 -9 lines
Diff to previous 1.119 (colored)

Introduce __MAP_NOFAULT, a mmap(2) flag that makes sure a mapping will not
cause a SIGSEGV or SIGBUS when a mapped file gets truncated.  Access to
pages that are not backed by a file on such a mapping will be replaced by
zero-filled anonymous pages.  Makes passing file descriptors of mapped files
usable without having to play tricks with signal handlers.

"steal your mmap flag" deraadt@

Revision 1.119 / (download) - annotate - [select for diffs], Fri Jul 11 16:35:40 2014 UTC (9 years, 11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.118: +1 -8 lines
Diff to previous 1.118 (colored)

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2

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

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

Revision 1.117 / (download) - annotate - [select for diffs], Wed Jul 2 06:09:49 2014 UTC (9 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

Use real parameter types for u{dv,vn}_attach() instead of void *

ok guenther

Revision 1.116 / (download) - annotate - [select for diffs], Fri Jun 13 01:48:52 2014 UTC (10 years ago) by matthew
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

Add support for MAP_INHERIT_ZERO.

This provides a way for a process to designate pages in its address
space that should be replaced by fresh, zero-initialized anonymous
memory in forked child processes, rather than being copied or shared.

ok jmc, kettenis, tedu, deraadt; positive feedback from many more

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

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

particular testing by ajacoutot@ and sebastia@

Revision 1.114 / (download) - annotate - [select for diffs], Tue May 6 11:50:14 2014 UTC (10 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.113: +1 -3 lines
Diff to previous 1.113 (colored)

Include <sys/vmmeter.h> directly instead of relying on it being
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private
function.

The preferred way to get memory stats is through the VM_UVMEXP
sysctl(3) since VM_METER is just a wrapper on top of it.  In the
kernel, use `uvmexp' directly instead of uvm_total().

This change does not remove <sys/vmmeter.h> from <uvm/uvm_extern.h>
to give some more time to port maintainers to fix their ports.

ok guenther@ as part of a larger diff.

Revision 1.113 / (download) - annotate - [select for diffs], Sat May 3 22:44:36 2014 UTC (10 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.112: +2 -1 lines
Diff to previous 1.112 (colored)

Move the u-area allocation and pmap-magic logic to its own function
uvm_uarea_alloc()

function name from NetBSD; arm testing by miod@

Revision 1.112 / (download) - annotate - [select for diffs], Thu Apr 3 21:40:10 2014 UTC (10 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.111: +2 -1 lines
Diff to previous 1.111 (colored)

add a uvm_yield function and use it in the reaper path to prevent the
reaper from hogging the cpu. it will do the kernel lock twiddle trick to
allow other CPUs a chance to run, and also checks if the reaper has been
running for an entire timeslice and should be preempted.
ok deraadt

Revision 1.111 / (download) - annotate - [select for diffs], Fri Mar 28 17:57:11 2014 UTC (10 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.110: +10 -2 lines
Diff to previous 1.110 (colored)

Reduce uvm include madness.  Use <uvm/uvm_extern.h> instead of
<uvm/uvm.h> if possible and remove double inclusions.

ok beck@, mlarkin@, deraadt@

Revision 1.110 / (download) - annotate - [select for diffs], Thu Jan 30 18:16:41 2014 UTC (10 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

Move declaration of struct vm_page_md from <machine/vmparam.h> to
<machine/pmap.h> where it belongs, and compensate in <uvm/uvm_extern.h>
by including <uvm/uvm_pmap.h> before <uvm/uvm_page.h>. Tested on all
MACHINE_ARCH but amd64 and i386 (and hppa64).

Revision 1.109 / (download) - annotate - [select for diffs], Tue Jul 9 15:37:43 2013 UTC (10 years, 11 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

back out the cache flipper temporarily to work out of tree.
will come back soon.
ok deraadt@

Revision 1.108 / (download) - annotate - [select for diffs], Tue Jun 11 19:01:20 2013 UTC (11 years ago) by beck
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

High memory page flipping for the buffer cache.

This change splits the buffer cache free lists into lists of dma reachable
buffers and high memory buffers based on the ranges returned by pmemrange.
Buffers move from dma to high memory as they age, but are flipped to dma
reachable memory if IO is needed to/from and high mem buffer. The total
amount of buffers  allocated is now bufcachepercent of both the dma and
the high memory region.

This change allows the use of large buffer caches on amd64 using more than
4 GB of memory

ok tedu@ krw@ - testing by many.

Revision 1.107 / (download) - annotate - [select for diffs], Thu May 23 01:42:59 2013 UTC (11 years ago) by tedu
Branch: MAIN
Changes since 1.106: +1 -2 lines
Diff to previous 1.106 (colored)

the simplelock is a lie

Revision 1.106 / (download) - annotate - [select for diffs], Tue May 14 20:33:01 2013 UTC (11 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.105: +3 -1 lines
Diff to previous 1.105 (colored)

restore ABI compatibility; guenther

Revision 1.105 / (download) - annotate - [select for diffs], Tue May 14 20:15:25 2013 UTC (11 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.104: +1 -3 lines
Diff to previous 1.104 (colored)

Remove `swapin' and `swapout' from uvm statistics, since we don't swap out
u areas since quite a few years now.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Mar 9 13:01:29 2012 UTC (12 years, 3 months ago) by ariane
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.103: +4 -4 lines
Diff to previous 1.103 (colored)

New vmmap implementation.

no oks (it is really a pain to review properly)
extensively tested, I'm confident it'll be stable
'now is the time' from several icb inhabitants

Diff provides:
- ability to specify different allocators for different regions/maps
- a simpler implementation of the current allocator
- currently in compatibility mode: it will generate similar addresses
  as the old allocator

Revision 1.103 / (download) - annotate - [select for diffs], Fri Jul 8 00:10:59 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.102: +1 -2 lines
Diff to previous 1.102 (colored)

some machines don't boot with the previous uvm reserve enforcement diff.
back it out.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Jul 7 20:52:50 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.101: +2 -1 lines
Diff to previous 1.101 (colored)

Move the uvm reserve enforcement from uvm_pagealloc to pmemrange.

More and more things are allocating outside of uvm_pagealloc these days making
it easy for something like the buffer cache to eat your last page with no
repercussions (other than a hung machine, of course).

ok ariane@ also ok ariane@ again after I spotted and fixed a possible underflow
problem in the calculation.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Jul 6 19:50:38 2011 UTC (12 years, 11 months ago) by beck
Branch: MAIN
Changes since 1.100: +22 -1 lines
Diff to previous 1.100 (colored)


uvm changes for buffer cache improvements.
1) Make the pagedaemon aware of the memory ranges and size of allocations
where memory is being requested, and pass this information on to
bufbackoff(), which will later (not yet) be used to ensure that the
buffer cache gets out of the way in the right area of memory.

Note that this commit does not yet make it *do* that - as currently
the buffer cache is all in dma-able memory and it will simply back
off.

2) Add uvm_pagerealloc_multi - to be used by the buffer cache code
for reallocating pages to particular regions.

much of this work by ariane, with smatterings of me, art,and oga

ok oga@, thib@, ariane@, deraadt@

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jul 3 17:42:51 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.99: +1 -8 lines
Diff to previous 1.99 (colored)

The UVM_STRAT defines have been unused since pmemrange was commited.

They may die now.

``kill it'' thib@

Revision 1.99 / (download) - annotate - [select for diffs], Thu Jun 23 21:42:05 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.98: +2 -1 lines
Diff to previous 1.98 (colored)

Make mbufs and dma_alloc be contig allocations.
Requested by dlg@

ok oga@

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jun 6 17:10:23 2011 UTC (13 years ago) by ariane
Branch: MAIN
Changes since 1.97: +4 -4 lines
Diff to previous 1.97 (colored)

Backout vmmap in order to repair virtual address selection algorithms
outside the tree.

Revision 1.97 / (download) - annotate - [select for diffs], Mon May 30 22:25:24 2011 UTC (13 years ago) by oga
Branch: MAIN
Changes since 1.96: +3 -5 lines
Diff to previous 1.96 (colored)

Remove the freelist member from vm_physseg

The new world order of pmemrange makes this data completely redundant
(being dealt with by the pmemrange constraints instead). Remove all code
that messes with the freelist.

While touching every caller of uvm_page_physload() anyway, add the flags
argument to all callers (all but one is 0 and that one already used
PHYSLOAD_DEVICE) and remove the macro magic to allow callers to continue
without it.

Should shrink the code a bit, as well.

matthew@ pointed out some mistakes i'd made.
``freelist death, I like. Ok.' ariane@
`I agree with the general direction, go ahead and i'll fix any fallout
shortly'' miod@ (68k 88k and vax i could not check would build)

Revision 1.96 / (download) - annotate - [select for diffs], Tue May 24 15:27:36 2011 UTC (13 years ago) by ariane
Branch: MAIN
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (colored)

Reimplement uvm/uvm_map.

vmmap is designed to perform address space randomized allocations,
without letting fragmentation of the address space go through the roof.

Some highlights:
- kernel address space randomization
- proper implementation of guardpages
- roughly 10% system time reduction during kernel build

Tested by alot of people on tech@ and developers.
Theo's machines are still happy.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Apr 18 19:23:46 2011 UTC (13 years, 1 month ago) by art
Branch: MAIN
Changes since 1.94: +21 -28 lines
Diff to previous 1.94 (colored)

Put back the change of pool and malloc into the new km_alloc(9) api.
The problems during the hackathon were not caused by this (most likely).

prodded by deraadt@ and beck@

Revision 1.94 / (download) - annotate - [select for diffs], Wed Apr 6 15:52:13 2011 UTC (13 years, 2 months ago) by art
Branch: MAIN
Changes since 1.93: +9 -1 lines
Diff to previous 1.93 (colored)

Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happening
and we aren't sure what's causing them.

shouted oks by many before I even built a kernel with the diff.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Apr 5 01:28:05 2011 UTC (13 years, 2 months ago) by art
Branch: MAIN
Changes since 1.92: +1 -9 lines
Diff to previous 1.92 (colored)

 - Change pool constraints to use kmem_pa_mode instead of uvm_constraint_range
 - Use km_alloc for all backend allocations in pools.
 - Use km_alloc for the emergmency kentry allocations in uvm_mapent_alloc
 - Garbage collect uvm_km_getpage, uvm_km_getpage_pla and uvm_km_putpage

ariane@ ok

Revision 1.92 / (download) - annotate - [select for diffs], Mon Apr 4 11:56:12 2011 UTC (13 years, 2 months ago) by art
Branch: MAIN
Changes since 1.91: +10 -10 lines
Diff to previous 1.91 (colored)

Some minor fixes:
- Clarify a comment.
- Change all the flags to chars from ints to make the structs smaller.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Apr 4 11:24:45 2011 UTC (13 years, 2 months ago) by art
Branch: MAIN
Changes since 1.90: +96 -4 lines
Diff to previous 1.90 (colored)

New unified allocator of kernel memory.

We've reached the point where we have a dozen allocators that all do more
or less the same thing, but slightly different, with slightly different
semantics, slightly different default behaviors and default behaviors that
most callers don't expect or want. A random sample on the last general
hackathon showed that no one could explain what all the different allocators
did. And every time someone needed to do something slightly different a
new allocator was written.

Unify everything. One single function to allocate multiples of PAGE_SIZE
kernel memory. Four arguments: size, how va is allocated, how pa is allocated
and misc parameters. Same parameters are passed to the free function so that
we don't need to guess what's going on.

Functions are currently unused, we'll do one thing at a time to avoid a
giant commit.

looked at by lots of people, deraadt@ and beck@ are yelling at me to commit.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Apr 2 16:47:17 2011 UTC (13 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.89: +3 -1 lines
Diff to previous 1.89 (colored)

Constrain the buffer cache to use only the dma reachable region of memory.
With this change bufcachepercent will be the percentage of dma reachable
memory that the buffer cache will attempt to use.
ok deraadt@ thib@ oga@

Revision 1.89 / (download) - annotate - [select for diffs], Fri Jul 2 01:25:06 2010 UTC (13 years, 11 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.88: +5 -6 lines
Diff to previous 1.88 (colored)

add an align argument to uvm_km_kmemalloc_pla.

Use uvm_km_kmemalloc_pla with the dma constraint to allocate kernel stacks.

Yes, that means DMA is possible to kernel stacks, but only until we've fixed
all the scary drivers.

deraadt@ ok

Revision 1.88 / (download) - annotate - [select for diffs], Thu Jul 1 21:27:39 2010 UTC (13 years, 11 months ago) by art
Branch: MAIN
Changes since 1.87: +6 -1 lines
Diff to previous 1.87 (colored)

Implement vs{,un}lock_device and use it for physio.

Just like normal vs{,un}lock, but in case the pages we get are not dma
accessible, we bounce them, if they are dma acessible, the functions behave
exactly like normal vslock. The plan for the future is to have fault_wire
allocate dma acessible pages so that we don't need to bounce (especially
in cases where the same buffer is reused for physio over and over again),
but for now, keep it as simple as possible.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jun 27 03:03:49 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.86: +13 -3 lines
Diff to previous 1.86 (colored)

uvm constraints. Add two mandatory MD symbols, uvm_md_constraints
which contains the constraints for DMA/memory allocation for each
architecture, and dma_constraints which contains the range of addresses
that are dma accessable by the system.

This is based on ariane@'s physcontig diff, with lots of bugfixes and
additions the following additions by my self:

Introduce a new function pool_set_constraints() which sets the address
range for which we allocate pages for the pool from, this is now used
for the mbuf/mbuf cluster pools to keep them dma accessible.

The !direct archs no longer stuff pages into the kernel object in
uvm_km_getpage_pla but rather do a pmap_extract() in uvm_km_putpages.

Tested heavily by my self on i386, amd64 and sparc64. Some tests on
alpha and SGI.

"commit it" beck, art, oga, deraadt
"i like the diff" deraadt

Revision 1.86 / (download) - annotate - [select for diffs], Wed Jun 9 08:26:21 2010 UTC (14 years ago) by thib
Branch: MAIN
Changes since 1.85: +2 -1 lines
Diff to previous 1.85 (colored)

Move the prototype for uvm_wait() to uvm_extern.h and remove
uvm_pdaemon.h has it was only holding that one prototype.

OK art@, oga@, miod@, deraadt@

Revision 1.85 / (download) - annotate - [select for diffs], Thu Apr 22 19:02:55 2010 UTC (14 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.84: +9 -8 lines
Diff to previous 1.84 (colored)

Committing on behalf or ariane@.

recommit pmemrange:
        physmem allocator: change the view of free memory from single
        free pages to free ranges.  Classify memory based on region with
        associated use-counter (which is used to construct a priority
        list of where to allocate memory).

	Based on code from tedu@, help from many.

Useable now that bugs have been found and fixed in most architecture's
pmap.c

ok by everyone who has done a pmap or uvm commit in the last year.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Mar 24 00:36:04 2010 UTC (14 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.83: +10 -3 lines
Diff to previous 1.83 (colored)

Bring back PHYSLOAD_DEVICE for uvm_page_physload.

ok kettenis@ beck@ (tentatively) and ariane@. deraadt asked for it to be
commited now.

original commit message:

	extend uvm_page_physload to have the ability to add "device" pages to
	the system.

	This is needed in the case where you need managed pages so you can
	handle faulting and pmap_page_protect() on said pages when you manage
	memory in such regions (i'm looking at you, graphics cards).

	these pages are flagged PG_DEV, and shall never be on the freelists,
	assert this. behaviour remains unchanged in the non-device case,
	specifically for all archs currently in the tree we panic if called
	after bootstrap.

	ok art@ kettenis@, beck@

Revision 1.83 / (download) - annotate - [select for diffs], Fri Feb 12 01:35:14 2010 UTC (14 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.82: +3 -2 lines
Diff to previous 1.82 (colored)

introduce a uvm_km_valloc_try function that won't get a lower level lock
for use by the uvm pseg code.  this is the path of least resistance until
we sort out how many of these functions we really need.  problem found by mikeb
ok kettenis oga

Revision 1.82 / (download) - annotate - [select for diffs], Tue Aug 11 18:43:33 2009 UTC (14 years, 10 months ago) by blambert
Branch: MAIN
Changes since 1.81: +1 -2 lines
Diff to previous 1.81 (colored)

uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lame

inline the loop in the one place it exists, and remove it from uvm

adjust a comment mentioning it accordingly

originally inspired by a diff fixing a comment from oga@

ok art@ beck@ miod@ oga@

Revision 1.81 / (download) - annotate - [select for diffs], Tue Jun 16 23:54:58 2009 UTC (14 years, 11 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.80: +0 -0 lines
Diff to previous 1.80 (colored)

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jun 16 16:42:41 2009 UTC (14 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.79: +2 -7 lines
Diff to previous 1.79 (colored)

Backout pmemrange (which to most people is more well known as physmem
allocator).

"i can't see any obvious problems" oga

Revision 1.79 / (download) - annotate - [select for diffs], Sun Jun 14 03:04:08 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.78: +2 -9 lines
Diff to previous 1.78 (colored)

backout:
> extend uvm_page_physload to have the ability to add "device" pages to the
> system.
since it was overlayed over a system that we warned would go "in to be
tested, but may be pulled out".  oga, you just made me spend 20 minutes
of time I should not have had to spend doing this.

Revision 1.78 / (download) - annotate - [select for diffs], Sun Jun 7 02:01:54 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.77: +10 -3 lines
Diff to previous 1.77 (colored)

extend uvm_page_physload to have the ability to add "device" pages to the
system.

This is needed in the case where you need managed pages so you can
handle faulting and pmap_page_protect() on said pages when you manage
memory in such regions (i'm looking at you, graphics cards).

these pages are flagged PG_DEV, and shall never be on the freelists,
assert this. behaviour remains unchanged in the non-device case,
specifically for all archs currently in the tree we panic if called
after bootstrap.

ok art@, kettenis@, ariane@, beck@.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Jun 1 17:42:33 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.76: +7 -2 lines
Diff to previous 1.76 (colored)

physmem allocator: change the view of free memory from single free pages
to free ranges.
Classify memory based on region with associated use-counter (which is used
to construct a priority list of where to allocate memory).

Based on code from tedu@, help from many.
Ok art@

Revision 1.76 / (download) - annotate - [select for diffs], Mon Apr 20 00:30:18 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.75: +2 -1 lines
Diff to previous 1.75 (colored)

add the UVM_PLA_ZERO flag for uvm_pglistalloc to make it return zeroed
pages.

"go for it" miod@

Revision 1.75 / (download) - annotate - [select for diffs], Tue Apr 14 16:01:04 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.74: +7 -1 lines
Diff to previous 1.74 (colored)

Convert the waitok field of uvm_pglistalloc to "flags", more will be added soon.

For the possibility of sleeping, the first two flags are UVM_PLA_WAITOK
and UVM_PLA_NOWAIT. It is an error not to show intention, so assert that
one of the two is provided. Switch over every caller in the tree to
using the appropriate flag.

ok art@, ariane@

Revision 1.74 / (download) - annotate - [select for diffs], Thu Mar 5 19:52:24 2009 UTC (15 years, 3 months ago) by kettenis
Branch: MAIN
Changes since 1.73: +19 -1 lines
Diff to previous 1.73 (colored)

Make ELF platforms generate ELF core dumps.  Somewhat based on code from
NetBSD.

ok kurt@, drahn@, miod@

Revision 1.73 / (download) - annotate - [select for diffs], Wed Feb 11 11:09:36 2009 UTC (15 years, 4 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.72: +1 -5 lines
Diff to previous 1.72 (colored)

Remove uvm_km_alloc_poolpage1 as it serves no particular purpose
now and valid for __HAVE_PMAP_DIRECT archs only, though implements
both code paths.

Put it's code directly into the uvm_km_getpage for PMAP_DIRECT archs.

No functional change.

ok tedu, art

Revision 1.72 / (download) - annotate - [select for diffs], Tue Nov 4 21:37:06 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.71: +1 -2 lines
Diff to previous 1.71 (colored)

uvmspace_unshare() is never used; ok miod

Revision 1.71 / (download) - annotate - [select for diffs], Thu Oct 23 23:54:02 2008 UTC (15 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

a better fix for the "uvm_km thread runs out of memory" problem.

add a new arg to the backend so it can tell pool to slow down.  when we get
this flag, yield *after* putting the page in the pool's free list.  whatever
we do, don't let the thread sleep.

this makes things better by still letting the thread run when a huge pf
request comes in, but without artificially increasing pressure on the backend
by eating pages without feeding them forward.

ok deraadt

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jun 9 20:30:23 2008 UTC (16 years ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.69: +2 -1 lines
Diff to previous 1.69 (colored)

Define a new flag, UVM_FLAG_HOLE, for uvm_map to create a vm_map_entry of
a new etype, UVM_ET_HOLE, meaning it has no backend.

UVM_ET_HOLE entries (which should be created as UVM_PROT_NONE and with
UVM_FLAG_NOMERGE and UVM_FLAG_HOLE) are skipped in uvm_unmap_remove(), so
that pmap_{k,}remove() is not called on the entry.

This is intended to save time, and behave better, on pmaps with MMU holes
at process exit time.

ok art@, kettenis@ provided feedback as well.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Apr 9 16:58:11 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.68: +2 -1 lines
Diff to previous 1.68 (colored)

Add new stub uvm_shutdown() and call it from the right place in MD boot()

Revision 1.68 / (download) - annotate - [select for diffs], Thu Nov 29 00:26:41 2007 UTC (16 years, 6 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

use a working mutex for the freepage list. ok art deraadt

Revision 1.67 / (download) - annotate - [select for diffs], Mon Sep 10 18:49:45 2007 UTC (16 years, 9 months ago) by miod
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

Introduce a md pmap hook, pmap_remove_holes(), which is supposed to mark
the holes a MMU may have from a given vm_map. This will be automagically
invoked for newly created vmspaces.

On platforms with MMU holes (e.g. sun4, sun4c and vax), this prevents
mmap(2) hints which would end up being in the hole to be accepted as valid,
causing unexpected signals when the process tries to access the hole
(since pmap can not fill the hole anyway).

Unfortunately, the logic mmap() uses to pick a valid address for anonymous
mappings needs work, as it will only try to find an address higher than the
hint, which causes all mmap() with a hint in the hole to fail on vax. This
will be improved later.

Revision 1.66 / (download) - annotate - [select for diffs], Sun May 27 20:59:26 2007 UTC (17 years ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.65: +1 -2 lines
Diff to previous 1.65 (colored)

pagemove() is no longer used.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Apr 11 12:51:51 2007 UTC (17 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

The return value of uvm_grow() (and previously, grow()) has not been used
in 15 years, make it a void function.

ok art@

Revision 1.64 / (download) - annotate - [select for diffs], Wed Apr 11 12:10:42 2007 UTC (17 years, 2 months ago) by art
Branch: MAIN
Changes since 1.63: +1 -7 lines
Diff to previous 1.63 (colored)

Instead of managing pages for intrsafe maps in special objects (aka.
kmem_object) just so that we can remove them, just use pmap_extract
to get the pages to free and simplify a lot of code to not deal with
the list of intrsafe maps, intrsafe objects, etc.

miod@ ok

Revision 1.63 / (download) - annotate - [select for diffs], Wed Nov 29 12:39:50 2006 UTC (17 years, 6 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.62: +1 -2 lines
Diff to previous 1.62 (colored)

We don't use mb_map anymore since a long time already. Remove it.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Nov 29 12:26:14 2006 UTC (17 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.61: +1 -7 lines
Diff to previous 1.61 (colored)

Remove cpu_swapin() and cpu_swapout(), they are no longer necessary (except
for cpu_swapin() on hppa* which is kept).

Revision 1.61 / (download) - annotate - [select for diffs], Wed Nov 29 12:24:18 2006 UTC (17 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

Kernel stack can be swapped. This means that stuff that's on the stack
should never be referenced outside the context of the process to which
this stack belongs unless we do the PHOLD/PRELE dance. Loads of code
doesn't follow the rules here. Instead of trying to track down all
offenders and fix this hairy situation, it makes much more sense
to not swap kernel stacks.

From art@, tested by many some time ago.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Nov 29 12:17:33 2006 UTC (17 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.59: +4 -4 lines
Diff to previous 1.59 (colored)

Add an alignment parameter to uvm_km_alloc1(), and change all callers to
pass zero; this will be used shortly. From art@

Revision 1.59 / (download) - annotate - [select for diffs], Fri Nov 4 21:48:07 2005 UTC (18 years, 7 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.58: +4 -2 lines
Diff to previous 1.58 (colored)

Add an extra flags argument to uvm_io(), to specify whether we want to fix
the protection of the memory mapping we're doing I/O on, or if we want to
leave them as they are. This should only be necessary for breakpoint
insertion in code, so we'll only use it for ptrace requests.

Initially from art@ after discussion with kettenis@ millert@ and I,
tested by many.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Sep 28 00:24:03 2005 UTC (18 years, 8 months ago) by pedro
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57 (colored)

- when we run out of static kernel map entries, grab a fresh page using
  the uvm_km_page allocator and use it instead of calling panic()
- add a counter to uvmexp so we can keep track of how many map entries
  we have in use

idea from tedu@, long ago, okay deraadt@

Revision 1.57 / (download) - annotate - [select for diffs], Mon Sep 12 23:05:06 2005 UTC (18 years, 9 months ago) by miod
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

Change the NKMEMPAGES range to 4-64MB for 32bit arches, and 8-128MB for 64bit
arches; except on sparc where the range is 4-8 for !sun4m and 4-64 for sun4m,
selected at runtime.

Revision 1.56 / (download) - annotate - [select for diffs], Tue May 24 21:11:47 2005 UTC (19 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.55: +6 -4 lines
Diff to previous 1.55 (colored)

add a new field to vm_space and use it to track the number of anon
pages a process uses.  this is now the userland "data size" value.
ok art deraadt tdeval.  thanks testers.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Apr 21 04:39:34 2005 UTC (19 years, 1 month ago) by mickey
Branch: MAIN
Changes since 1.54: +3 -1 lines
Diff to previous 1.54 (colored)

count fpu lazy context switches; deraadt@ ok

Revision 1.54 / (download) - annotate - [select for diffs], Thu Dec 30 08:28:39 2004 UTC (19 years, 5 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.53: +2 -1 lines
Diff to previous 1.53 (colored)

Import M_CANFAIL support from NetBSD, removes a nasty panic during low-mem scenarios, instead generating an ENOMEM backfeed, ok tedu@, prodded by many

Revision 1.5.4.13 / (download) - annotate - [select for diffs], Sat Jun 5 23:13:12 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.5.4.12: +2 -1 lines
Diff to previous 1.5.4.12 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

Merge with the trunk

Revision 1.53 / (download) - annotate - [select for diffs], Thu May 27 04:55:28 2004 UTC (20 years ago) by tedu
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

change uvm_km_getpage to take waitok argument and sleep if appropriate.
change both the nointr and default pool allocators to using uvm_km_getpage.
change pools to default to a maxpages value of 8, so they hoard less memory.
change mbuf pools to use default pool allocator.
pools are now more efficient, use less of kmem_map, and a bit faster.
tested mcbride, deraadt, pedro, drahn, miod to work everywhere

Revision 1.52 / (download) - annotate - [select for diffs], Wed Apr 28 02:20:58 2004 UTC (20 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

remove mb_object*; ok tedu

Revision 1.51 / (download) - annotate - [select for diffs], Mon Apr 19 22:52:33 2004 UTC (20 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.50: +3 -1 lines
Diff to previous 1.50 (colored)

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

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

Revision 1.5.4.12 / (download) - annotate - [select for diffs], Thu Feb 19 11:01:43 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.5.4.11: +1 -2 lines
Diff to previous 1.5.4.11 (colored) to branchpoint 1.5 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.50 / (download) - annotate - [select for diffs], Sun Aug 10 00:04:50 2003 UTC (20 years, 10 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.49: +1 -2 lines
Diff to previous 1.49 (colored)

Remove uvm_useracc(): misleading, gives a false sentiment of security, and
eventually not used anymore. Conforming to art@'s evil plans.

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

Sync SMP branch to -current

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

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

Revision 1.39.2.4 / (download) - annotate - [select for diffs], Mon May 19 22:41:29 2003 UTC (21 years ago) by tedu
Branch: UBC
Changes since 1.39.2.3: +3 -3 lines
Diff to previous 1.39.2.3 (colored) to branchpoint 1.39 (colored) next main 1.40 (colored)

sync

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

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

Revision 1.48 / (download) - annotate - [select for diffs], Thu May 1 09:29:02 2003 UTC (21 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: UBC_SYNC_A
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

typos;
ok art@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Mar 28 10:16:29 2003 UTC (21 years, 2 months ago) by jmc
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

zero'd -> zeroed;

ok art@, miod@

Revision 1.5.4.9 / (download) - annotate - [select for diffs], Fri Mar 28 00:08:48 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.5.4.8: +1 -1 lines
Diff to previous 1.5.4.8 (colored) to branchpoint 1.5 (colored)

Sync the SMP branch with 3.3

Revision 1.39.2.3 / (download) - annotate - [select for diffs], Mon Nov 4 18:02:32 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.39.2.2: +41 -13 lines
Diff to previous 1.39.2.2 (colored) to branchpoint 1.39 (colored)

Huge sync to NetBSD plus lots of bugfixes.
 - uvm is as in netbsd-current minus uvm_map forward merge.
 - various locking bugfixes in nfs.
 - make sure that all specops and fifoops are correct in all vnodeop vectors.
 - make the filesystem code more like filsystem code and less like vm code.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 29 18:30:21 2002 UTC (21 years, 7 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Since memory deallocation can't fail, remove the error return from
uvm_unmap, uvm_deallocate and a few other functions.
Simplifies some code and reduces diff to the UBC branch.

Revision 1.39.2.2 / (download) - annotate - [select for diffs], Tue Jun 11 03:33:03 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.39.2.1: +105 -104 lines
Diff to previous 1.39.2.1 (colored) to branchpoint 1.39 (colored)

Sync UBC branch to -current

Revision 1.5.4.8 / (download) - annotate - [select for diffs], Thu Mar 28 14:54:26 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.5.4.7: +97 -97 lines
Diff to previous 1.5.4.7 (colored) to branchpoint 1.5 (colored)

Merge in -current from roughly a week ago

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 14 03:16:13 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: UBC_SYNC_B, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored)

Final __P removal plus some cosmetic fixups

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

First round of __P removal in sys

Revision 1.5.4.7 / (download) - annotate - [select for diffs], Wed Mar 6 02:17:14 2002 UTC (22 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.5.4.6: +64 -79 lines
Diff to previous 1.5.4.6 (colored) to branchpoint 1.5 (colored)

Merge in trunk

Revision 1.43 / (download) - annotate - [select for diffs], Thu Feb 28 18:50:26 2002 UTC (22 years, 3 months ago) by provos
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

use red-black tree for lookup_entry.  the red-black tree case for
map_findspace is still broken on alpha.  this will make debugging easier.
okay millert@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Feb 25 05:38:50 2002 UTC (22 years, 3 months ago) by provos
Branch: MAIN
Changes since 1.41: +0 -1 lines
Diff to previous 1.41 (colored)

back out red-black tree. they are very fast but alpha UVM is broken and
the tree triggers the bug, PMAP_PREFER case was broken also.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Feb 25 00:20:45 2002 UTC (22 years, 3 months ago) by provos
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

use a red-black tree to find entries in the vm_map. augment the red-black
tree to find free space between entries.  speeds up memory allocation,
etc...

Revision 1.39.2.1 / (download) - annotate - [select for diffs], Sat Feb 2 03:28:26 2002 UTC (22 years, 4 months ago) by art
Branch: UBC
Changes since 1.39: +21 -27 lines
Diff to previous 1.39 (colored)

Merge in UBC performance changes from NetBSD.
Fix a bunch of merge errors from yesterday.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Dec 19 08:58:07 2001 UTC (22 years, 5 months ago) by art
Branch: MAIN
Changes since 1.39: +69 -83 lines
Diff to previous 1.39 (colored)

UBC was a disaster. It worked very good when it worked, but on some
machines or some configurations or in some phase of the moon (we actually
don't know when or why) files disappeared. Since we've not been able to
track down the problem in two weeks intense debugging and we need -current
to be stable, back out everything to a state it had before UBC.

We apologise for the inconvenience.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Dec 6 23:01:07 2001 UTC (22 years, 6 months ago) by niklas
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.38: +2 -3 lines
Diff to previous 1.38 (colored)

remove unnecessary newline

Revision 1.5.4.6 / (download) - annotate - [select for diffs], Wed Dec 5 01:23:58 2001 UTC (22 years, 6 months ago) by niklas
Branch: SMP
Changes since 1.5.4.5: +79 -63 lines
Diff to previous 1.5.4.5 (colored) to branchpoint 1.5 (colored)

Merge in -current

Revision 1.38 / (download) - annotate - [select for diffs], Tue Dec 4 23:22:42 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.37: +4 -5 lines
Diff to previous 1.37 (colored)

Yet another sync to NetBSD uvm.
Today we add a pmap argument to pmap_update() and allocate map entries for
kernel_map from kmem_map instead of using the static entries. This should
get rid of MAX_KMAPENT panics. Also some uvm_loan problems are fixed.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Nov 30 17:24:19 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.36: +1 -3 lines
Diff to previous 1.36 (colored)

Kill uvm_pagealloc_contig. The two drivers that still used it should have
been converted to bus_dma ages ago, but since noone haven't bothered to do that
I haven't bothered to do more than to test that the kernel still builds
with those changes.

Revision 1.36 / (download) - annotate - [select for diffs], Wed Nov 28 19:28:14 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.35: +52 -57 lines
Diff to previous 1.35 (colored)

Sync in more uvm from NetBSD. Mostly just cosmetic stuff.
Contains also support for page coloring.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Nov 28 13:47:39 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

Sync in more uvm changes from NetBSD.
This time we're getting rid of KERN_* and VM_PAGER_* error codes and
use errnos instead.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Nov 27 05:27:12 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.33: +29 -6 lines
Diff to previous 1.33 (colored)

Merge in the unified buffer cache code as found in NetBSD 2001/03/10. The
code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>.

Tested for the past few weeks by many developers, should be in a pretty stable
state, but will require optimizations and additional cleanups.

Revision 1.5.4.5 / (download) - annotate - [select for diffs], Tue Nov 13 23:02:31 2001 UTC (22 years, 7 months ago) by niklas
Branch: SMP
Changes since 1.5.4.4: +161 -40 lines
Diff to previous 1.5.4.4 (colored) to branchpoint 1.5 (colored)

merge in -current

Revision 1.33 / (download) - annotate - [select for diffs], Mon Nov 12 01:26:09 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.32: +19 -7 lines
Diff to previous 1.32 (colored)

Bring in more changes from NetBSD. Mostly pagedaemon improvements.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Nov 10 18:42:31 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.31: +10 -1 lines
Diff to previous 1.31 (colored)

Merge in some parts of the ubc work that has been done in NetBSD that are not
UBC, but prerequsites for it.

- Create a daemon that processes async I/O (swap and paging in the future)
  requests that need processing in process context and that were processed
  in the pagedaemon before.
- Convert some ugly ifdef DIAGNOSTIC code to less intrusive KASSERTs.
- misc other cleanups.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Nov 9 03:32:23 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored)

minor sync to NetBSD.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Nov 7 02:55:50 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.29: +19 -17 lines
Diff to previous 1.29 (colored)

Another sync of uvm to NetBSD. Just minor fiddling, no major changes.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Nov 7 01:18:01 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.28: +4 -3 lines
Diff to previous 1.28 (colored)

Add an alignment argument to uvm_map that specifies an alignment hint
for the virtual address.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Nov 6 18:41:10 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.27: +4 -14 lines
Diff to previous 1.27 (colored)

Let fork1, uvm_fork, and cpu_fork take a function/argument pair as argument,
instead of doing fork1, cpu_set_kpc. This lets us retire cpu_set_kpc and
avoid a multiprocessor race.

This commit breaks vax because it doesn't look like any other arch, someone
working on vax might want to look at this and try to adapt the code to be
more like the rest of the world.

Idea and uvm parts from NetBSD.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Nov 6 13:36:52 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.26: +5 -14 lines
Diff to previous 1.26 (colored)

More sync to NetBSD.
 - Use malloc/free instead of MALLOC/FREE for variable sized allocations.
 - Move the memory inheritance code to sys/mman.h and rename from VM_* to MAP_*
 - various cleanups and simplifications.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Nov 6 01:35:04 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.25: +123 -8 lines
Diff to previous 1.25 (colored)

Move the last content from vm/ to uvm/
The only thing left in vm/ are just dumb wrappers.
vm/vm.h includes uvm/uvm_extern.h
vm/pmap.h includes uvm/uvm_pmap.h
vm/vm_page.h includes uvm/uvm_page.h

Revision 1.25 / (download) - annotate - [select for diffs], Tue Nov 6 00:24:55 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

sync to NetBSD.

Revision 1.5.4.4 / (download) - annotate - [select for diffs], Wed Oct 31 03:32:14 2001 UTC (22 years, 7 months ago) by nate
Branch: SMP
Changes since 1.5.4.3: +91 -15 lines
Diff to previous 1.5.4.3 (colored) to branchpoint 1.5 (colored)

Sync the SMP branch to something just after 3.0

Revision 1.24 / (download) - annotate - [select for diffs], Wed Sep 19 20:50:59 2001 UTC (22 years, 8 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.23: +11 -1 lines
Diff to previous 1.23 (colored)

merge vm/vm_kern.h into uvm/uvm_extern.h; art@ ok

Revision 1.23 / (download) - annotate - [select for diffs], Sun Aug 12 22:41:15 2001 UTC (22 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

merge vm_map.h into uvm_map.h, kinda matches netbsd's approach

Revision 1.22 / (download) - annotate - [select for diffs], Sun Aug 12 21:00:14 2001 UTC (22 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.21: +12 -1 lines
Diff to previous 1.21 (colored)

vm_inherit.h no more

Revision 1.21 / (download) - annotate - [select for diffs], Sun Aug 12 20:18:30 2001 UTC (22 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.20: +16 -2 lines
Diff to previous 1.20 (colored)

vm_extern.h no more

Revision 1.20 / (download) - annotate - [select for diffs], Sun Aug 12 05:18:41 2001 UTC (22 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.19: +30 -1 lines
Diff to previous 1.19 (colored)

vm/vm_prot.h no more

Revision 1.19 / (download) - annotate - [select for diffs], Sat Aug 11 10:57:22 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.18: +9 -5 lines
Diff to previous 1.18 (colored)

Various random fixes from NetBSD.
Including support for zeroing pages in the idle loop (not enabled yet).

Revision 1.18 / (download) - annotate - [select for diffs], Wed Aug 8 02:36:59 2001 UTC (22 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

nuke __attribute__((__noreturn__)) when used in conjunction with __dead

Revision 1.17 / (download) - annotate - [select for diffs], Mon Aug 6 14:03:04 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.16: +8 -8 lines
Diff to previous 1.16 (colored)

Add a new type voff_t (right now it's typedefed as off_t) used for offsets
into objects.

Gives the possibilty to mmap beyond the size of vaddr_t.

From NetBSD.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Aug 2 11:06:38 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.15: +7 -2 lines
Diff to previous 1.15 (colored)

Sysctl for finding out how many pages there are in kmem_map.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jul 26 19:37:13 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored)

Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jul 25 14:47:59 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

Some updates to UVM from NetBSD. Nothing really critical, just a sync.

Revision 1.5.4.3 / (download) - annotate - [select for diffs], Wed Jul 4 11:01:01 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.5.4.2: +17 -6 lines
Diff to previous 1.5.4.2 (colored) to branchpoint 1.5 (colored)

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

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 23 19:24:33 2001 UTC (22 years, 11 months ago) by smart
Branch: MAIN
Changes since 1.12: +12 -3 lines
Diff to previous 1.12 (colored)

Sync with NetBSD 19990911 (just before PMAP_NEW was required)
  - thread_sleep_msg() -> uvm_sleep()
  - initialize reference count lock in uvm_anon_{init,add}()
  - add uao_flush()
  - replace boolean 'islocked' with 'lockflags'
  - in uvm_fault() change FALSE to TRUE to in 'wide' fault handling
  - get rid of uvm_km_get()
  - various bug fixes

Revision 1.5.4.2 / (download) - annotate - [select for diffs], Mon May 14 22:47:45 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.5.4.1: +11 -3 lines
Diff to previous 1.5.4.1 (colored) to branchpoint 1.5 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 10 07:59:06 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.11: +6 -4 lines
Diff to previous 1.11 (colored)

Some locking protocol fixes and better enforcement of wiring limits.

From NetBSD.

Revision 1.11 / (download) - annotate - [select for diffs], Mon May 7 16:08:40 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Few fixes from NetBSD.
 - make sure that vsunlock doesn't unwire mlocked memory.
 - fix locking in uvm_useracc.
 - Return the error uvm_fault_wire in uvm_vslock (will be used soon).

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 9 14:20:50 2001 UTC (23 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored)

More syncing to NetBSD.

Implements mincore(2), mlockall(2) and munlockall(2). mlockall and munlockall
are disabled for the moment.

The rest is mostly cosmetic.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Mar 9 05:34:38 2001 UTC (23 years, 3 months ago) by smart
Branch: MAIN
Changes since 1.8: +8 -2 lines
Diff to previous 1.8 (colored)

Protect protypes, certain macros, and inlines from userland.  Checked userland
with a 'make build'.  From NetBSD.  art@ ok

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jan 29 02:07:43 2001 UTC (23 years, 4 months ago) by niklas
Branch: MAIN
Changes since 1.7: +1 -0 lines
Diff to previous 1.7 (colored)

$OpenBSD$

Revision 1.7 / (download) - annotate - [select for diffs], Wed Dec 6 17:19:01 2000 UTC (23 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +1 -1 lines
Diff to previous 1.6 (colored)

use __x__ formats for __attribute__ arguments; guenther@gac.edu

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Fri Mar 24 09:09:48 2000 UTC (24 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.5: +4 -3 lines
Diff to previous 1.5 (colored)

Sync with -current

Revision 1.6 / (download) - annotate - [select for diffs], Thu Mar 16 22:11:04 2000 UTC (24 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.5: +4 -3 lines
Diff to previous 1.5 (colored)

Bring in some new UVM code from NetBSD (not current).

 - Introduce a new type of map that are interrupt safe and never allow faults
   in them. mb_map and kmem_map are made intrsafe.
 - Add "access protection" to uvm_vslock (to be passed down to uvm_fault and
   later to pmap_enter).
 - madvise(2) now works.
 - various cleanups.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Aug 23 08:13:23 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.4: +12 -11 lines
Diff to previous 1.4 (colored)

sync with NetBSD from 1999.05.24 (there is a reason for this date)
 Mostly cleanups, but also a few improvements to pagedaemon for better
 handling of low memory and/or low swap conditions.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Aug 17 10:32:19 1999 UTC (24 years, 10 months ago) by niklas
Branch: MAIN
Changes since 1.3: +3 -2 lines
Diff to previous 1.3 (colored)

New cpu_fork API to take a stack in which you point the child's stackpointer
to, at the bottom or the top, depending on your architecture's stack growth
direction.  This is in preparation for Linux' clone(2) emulation.
port maintainers, please check that I did the work right.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jul 23 14:47:06 1999 UTC (24 years, 10 months ago) by ho
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

Add uvm_pagealloc_contig

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 26 05:32:06 1999 UTC (25 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

add OpenBSD tags

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 26 01:30:12 1999 UTC (25 years, 3 months ago) by art
Branch: MAIN

Import of uvm from NetBSD. Some local changes, some code disabled

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.