OpenBSD CVS

CVS log for src/sys/uvm/uvm_glue.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.84 / (download) - annotate - [select for diffs], Sat Sep 10 20:35:29 2022 UTC (21 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.83: +5 -1 lines
Diff to previous 1.83 (colored)

Remove pmap_collect() when a no-op, define __HAVE_PMAP_COLLECT otherwise.
Use that define to shunt uvm_swapout_threads(), which is a noop when
pmap_collect() does nothing.

ok mpi@

Revision 1.83 / (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.82: +2 -16 lines
Diff to previous 1.82 (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.82 / (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.81: +17 -3 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Fri Feb 18 09:04:38 2022 UTC (2 years, 3 months ago) by kettenis
Branch: MAIN
Changes since 1.80: +4 -3 lines
Diff to previous 1.80 (colored)

Convert KVA allocation to km_alloc(9).

ok mpi@

Revision 1.80 / (download) - annotate - [select for diffs], Fri Mar 26 13:40:05 2021 UTC (3 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

Remove parenthesis around return value to reduce the diff with NetBSD.

No functional change.

ok mlarkin@

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

spelling

ok mpi@

Revision 1.78 / (download) - annotate - [select for diffs], Mon Feb 8 10:51:02 2021 UTC (3 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

Revert the convertion of per-process thread into a SMR_TAILQ.

We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Dec 7 16:55:29 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

Convert the per-process thread list into a SMR_TAILQ.

Currently all iterations are done under KERNEL_LOCK() and therefor use
the *_LOCKED() variant.

From and ok claudio@

Revision 1.76 / (download) - annotate - [select for diffs], Mon Oct 19 17:57:43 2020 UTC (3 years, 7 months ago) by kettenis
Branch: MAIN
Changes since 1.75: +4 -2 lines
Diff to previous 1.75 (colored)

Clear vmspace pointer in struct process before calling uvmspace_free(9).

ok patrick@, mpi@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jun 21 09:39:49 2019 UTC (4 years, 11 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.74: +7 -8 lines
Diff to previous 1.74 (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.74 / (download) - annotate - [select for diffs], Thu Jan 10 20:26:34 2019 UTC (5 years, 5 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.73: +32 -24 lines
Diff to previous 1.73 (colored)

Hold a read lock on the map while doing the actual device I/O during in
physio(9) to prevent another thread from unmapping the memory and triggering
an assertion or even corruption random physical memory pages.

ok deraadt@

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

Revision 1.73 / (download) - annotate - [select for diffs], Mon May 8 09:32:19 2017 UTC (7 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.72: +1 -7 lines
Diff to previous 1.72 (colored)

Unifed PMAP_UAREA, unused since we stopped supporting ARM < v7.

ok kettenis@

Revision 1.72 / (download) - annotate - [select for diffs], Sun Apr 30 13:04:49 2017 UTC (7 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.71: +1 -38 lines
Diff to previous 1.71 (colored)

Unifdef KGDB.

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

ok kettenis@, deraadt@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Feb 14 10:31:15 2017 UTC (7 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.70: +2 -3 lines
Diff to previous 1.70 (colored)

Convert most of the manual checks for CPU hogging to sched_pause().

The distinction between preempt() and yield() stays as it is usueful
to know if a thread decided to yield by itself or if the kernel told
him to go away.

ok tedu@, guenther@

Revision 1.70 / (download) - annotate - [select for diffs], Sun Sep 13 17:08:03 2015 UTC (8 years, 8 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored)

Rename __sysctl syscall to just sysctl, as the userland wrapper is no longer
necessary

ok deraadt@ jsing@

Revision 1.69 / (download) - annotate - [select for diffs], Mon Dec 15 20:38:22 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.68: +7 -3 lines
Diff to previous 1.68 (colored)

don't drop the kernel lock everytime. on a busy system, this results in
the reaper spending more than half its time in uvm_pause. we want the
system to be interactive, but we want throughput too. this seems like a
decent balance.

Revision 1.68 / (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.67: +16 -1 lines
Diff to previous 1.67 (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.67 / (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.66: +4 -5 lines
Diff to previous 1.66 (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.66 / (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.65: +2 -7 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Thu May 15 03:52:25 2014 UTC (10 years ago) by guenther
Branch: MAIN
Changes since 1.64: +52 -72 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Sat May 3 22:49:43 2014 UTC (10 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

Fix whitespace fail in previous commit

Revision 1.63 / (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.62: +23 -8 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Sun Apr 13 23:14:15 2014 UTC (10 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.61: +1 -3 lines
Diff to previous 1.61 (colored)

compress code by turning four line comments into one line comments.
emphatic ok usual suspects, grudging ok miod

Revision 1.61 / (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.60: +11 -2 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Sun Mar 31 17:06:34 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.59: +1 -3 lines
Diff to previous 1.59 (colored)

do not need machine/cpu.h directly

Revision 1.59 / (download) - annotate - [select for diffs], Fri Mar 23 15:51:26 2012 UTC (12 years, 2 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.58: +2 -16 lines
Diff to previous 1.58 (colored)

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

ok kettenis@

Revision 1.58 / (download) - annotate - [select for diffs], Fri Apr 15 21:47:24 2011 UTC (13 years, 1 month ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.57: +18 -1 lines
Diff to previous 1.57 (colored)

move uvm_pageratop from uvm_pager.c local to a general uvm function
(uvm_atopg) and use it in uvm_km_doputpage to replace some handrolled
code. Shrinks the kernel a trivial amount.

ok beck@ and miod@ (who suggested i name it uvm_atopg not uvm_atop)

Revision 1.57 / (download) - annotate - [select for diffs], Thu Apr 7 13:20:25 2011 UTC (13 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

In uvm_vslock_device(), if uvm_pglistalloc() fails, make sure to not pass
an uninitialized variable to uvm_km_free().

Revision 1.56 / (download) - annotate - [select for diffs], Fri Apr 1 15:43:13 2011 UTC (13 years, 2 months ago) by art
Branch: MAIN
Changes since 1.55: +20 -7 lines
Diff to previous 1.55 (colored)

Two problems with vslock_device functions.

 - Fix error handling so that we free stuff on error.
 - We use the mappings to keep track of which pages need to be
   freed so don't unmap before freeing (this is theoretically
   incorrect and will be fixed soon).

This makes fsck happy on bigmem machines (it doesn't leak all
dma:able memory anymore).

beck@, drahn@, oga@ ok

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jul 2 22:38:32 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.54: +7 -7 lines
Diff to previous 1.54 (colored)

Don't bother trying to handle a uvm_pglistalloc failure when called with
UVM_PLA_WAITOK as it will not fail; Rather assert that it didn't fail.

ok tedu@, oga@

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jul 2 20:40:16 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.53: +0 -8 lines
Diff to previous 1.53 (colored)

nuke unused global and a comment.
ok tedu@, oga@

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jul 2 18:26:58 2010 UTC (13 years, 11 months ago) by art
Branch: MAIN
Changes since 1.52: +3 -1 lines
Diff to previous 1.52 (colored)

Add missing pmap_update. pointed out by matthew@

Revision 1.52 / (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.51: +95 -4 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Wed Jun 30 20:20:18 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.50: +3 -8 lines
Diff to previous 1.50 (colored)

knf function decleration nit.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Aug 11 18:43:33 2009 UTC (14 years, 10 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.49: +1 -17 lines
Diff to previous 1.49 (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.49 / (download) - annotate - [select for diffs], Fri Mar 20 15:19:04 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.48: +5 -18 lines
Diff to previous 1.48 (colored)

While working on some stuff in uvm I've gotten REALLY sick of reading
K&R function declarations, so switch them all over to ansi-style, in
accordance with the prophesy.

"go for it" art@

Revision 1.48 / (download) - annotate - [select for diffs], Fri Oct 24 06:32:46 2008 UTC (15 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

it is a good policy to clear the pointer after we free something

Revision 1.47 / (download) - annotate - [select for diffs], Sat May 26 20:26:51 2007 UTC (17 years ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.46: +1 -13 lines
Diff to previous 1.46 (colored)

Dynamic buffer cache. Initial diff from mickey@, okay art@ beck@ toby@
deraadt@ dlg@.

Revision 1.46 / (download) - annotate - [select for diffs], Fri May 18 10:55:34 2007 UTC (17 years ago) by art
Branch: MAIN
Changes since 1.45: +3 -4 lines
Diff to previous 1.45 (colored)

Instead of a silly loop with goto, just use while(1).

Revision 1.45 / (download) - annotate - [select for diffs], Wed Nov 29 12:24:18 2006 UTC (17 years, 6 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.44: +13 -199 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Thu May 25 22:42:22 2006 UTC (18 years ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.43: +6 -1 lines
Diff to previous 1.43 (colored)

Enable optional specific handling of the u-area in pmap via PMAP_UAREA if
defined; from NetBSD. Currently only used on xscale arm to use the mini data
cache for u area mappings instead of the main data cache.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Nov 1 14:18:14 2005 UTC (18 years, 7 months ago) by aaron
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

In uvm_swapout(), protect "p->p_swtime = 0;" with SCHED_LOCK() as is already
done in uvm_swapin().  Looks like this was a mistake made while editing.  No
response from art@.  deraadt@, miod@, pedro@ ok

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 31 11:35:33 2005 UTC (19 years ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.41: +7 -6 lines
Diff to previous 1.41 (colored)

Protect the run queues with SCHED_LOCK, not just spl (ot nothing at all in
one case fixed here).

miod@ "appears to be harmless"
markus@ ok

Revision 1.41 / (download) - annotate - [select for diffs], Sun May 29 03:20:43 2005 UTC (19 years ago) by deraadt
Branch: MAIN
Changes since 1.40: +5 -6 lines
Diff to previous 1.40 (colored)

sched work by niklas and art backed out; causes panics

Revision 1.40 / (download) - annotate - [select for diffs], Wed May 25 23:17:47 2005 UTC (19 years ago) by niklas
Branch: MAIN
Changes since 1.39: +7 -6 lines
Diff to previous 1.39 (colored)

This patch is mortly art's work and was done *a year* ago.  Art wants to thank
everyone for the prompt review and ok of this work ;-)  Yeah, that includes me
too, or maybe especially me.  I am sorry.

Change the sched_lock to a mutex. This fixes, among other things, the infamous
"telnet localhost &" problem.  The real bug in that case was that the sched_lock
which is by design a non-recursive lock, was recursively acquired, and not
enough releases made us hold the lock in the idle loop, blocking scheduling
on the other processors.  Some of the other processors would hold the biglock though,
which made it impossible for cpu 0 to enter the kernel...  A nice deadlock.
Let me just say debugging this for days just to realize that it was all fixed
in an old diff noone ever ok'd was somewhat of an anti-climax.

This diff also changes splsched to be correct for all our architectures.

Revision 1.5.4.12 / (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.11: +1 -0 lines
Diff to previous 1.5.4.11 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

Merge with the trunk

Revision 1.39 / (download) - annotate - [select for diffs], Mon Feb 23 06:19:32 2004 UTC (20 years, 3 months ago) by drahn
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

sync of pmap_update() calls with NetBSD. pmap_update is defined away on
all architectures but arm, where it is needed.

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

Merge of current from two weeks agointo the SMP branch

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Thu Nov 20 22:43:16 2003 UTC (20 years, 6 months ago) by margarida
Branch: OPENBSD_3_3
Changes since 1.34: +11 -3 lines
Diff to previous 1.34 (colored) next main 1.35 (colored)

MFC:
Fix by grange@

Check for round_page() overflow in uvm_vslock()/uvm_vsunlock().

ok millert@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Nov 20 17:54:55 2003 UTC (20 years, 6 months ago) by grange
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Sync comments with NetBSD.
ok millert@

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Thu Nov 20 17:46:49 2003 UTC (20 years, 6 months ago) by brad
Branch: OPENBSD_3_4
Changes since 1.35: +11 -3 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

MFC:
Fix by grange@

Check for round_page() overflow in uvm_vslock()/uvm_vsunlock().

ok millert@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 20 14:44:31 2003 UTC (20 years, 6 months ago) by grange
Branch: MAIN
Changes since 1.36: +11 -3 lines
Diff to previous 1.36 (colored)

Check for round_page() overflow in uvm_vslock()/uvm_vsunlock().
ok millert@ henning@ markus@ drahn@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Nov 8 06:11:10 2003 UTC (20 years, 7 months ago) by nordin
Branch: MAIN
Changes since 1.35: +22 -9 lines
Diff to previous 1.35 (colored)

Avoid a race condition while swapping in a process.
Tested by mickey@, henning@, ericj@, and beck@.
ok mickey@

Revision 1.35 / (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_4_BASE
Branch point for: OPENBSD_3_4
Changes since 1.34: +1 -28 lines
Diff to previous 1.34 (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.10 / (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.9: +5 -4 lines
Diff to previous 1.5.4.9 (colored) to branchpoint 1.5 (colored)

Sync the SMP branch with 3.3

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 29 22:57:10 2003 UTC (21 years, 4 months ago) by mickey
Branch: MAIN
CVS Tags: UBC_SYNC_A, OPENBSD_3_3_BASE
Branch point for: OPENBSD_3_3
Changes since 1.33: +5 -4 lines
Diff to previous 1.33 (colored)

check the uvm_fault_wire() for failure, just like other calls; art@ ok

Revision 1.30.2.3 / (download) - annotate - [select for diffs], Mon Nov 4 18:02:33 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.30.2.2: +125 -7 lines
Diff to previous 1.30.2.2 (colored) to branchpoint 1.30 (colored) next main 1.31 (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.30.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.30.2.1: +4 -4 lines
Diff to previous 1.30.2.1 (colored) to branchpoint 1.30 (colored)

Sync UBC branch to -current

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jun 9 02:11:47 2002 UTC (22 years ago) by jsyn
Branch: MAIN
CVS Tags: UBC_SYNC_B, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

fix the use of "cuz" in the tree; these are all in comments

noticed by aaron@, recommended by deraadt@

Revision 1.5.4.9 / (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.8: +2 -2 lines
Diff to previous 1.5.4.8 (colored) to branchpoint 1.5 (colored)

Merge in -current from roughly a week ago

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

First round of __P removal in sys

Revision 1.5.4.8 / (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.7: +27 -23 lines
Diff to previous 1.5.4.7 (colored) to branchpoint 1.5 (colored)

Merge in trunk

Revision 1.30.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.30: +12 -9 lines
Diff to previous 1.30 (colored)

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

Revision 1.31 / (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.30: +28 -24 lines
Diff to previous 1.30 (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.5.4.7 / (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.6: +23 -28 lines
Diff to previous 1.5.4.6 (colored) to branchpoint 1.5 (colored)

Merge in -current

Revision 1.30 / (download) - annotate - [select for diffs], Tue Dec 4 23:22:42 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (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.29 / (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.28: +17 -19 lines
Diff to previous 1.28 (colored)

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

Revision 1.28 / (download) - annotate - [select for diffs], Wed Nov 28 14:29:13 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.27: +2 -3 lines
Diff to previous 1.27 (colored)

more sync to netbsd. some bugfixes in uvm_km_kmemalloc, lots of fixes in uvm_loan.

Revision 1.27 / (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.26: +9 -11 lines
Diff to previous 1.26 (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.5.4.6 / (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.5: +37 -35 lines
Diff to previous 1.5.4.5 (colored) to branchpoint 1.5 (colored)

merge in -current

Revision 1.26 / (download) - annotate - [select for diffs], Sat Nov 10 19:20:39 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.25: +2 -5 lines
Diff to previous 1.25 (colored)

Move maxdmap and maxsmap to kern_resource.c

Revision 1.25 / (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.24: +29 -25 lines
Diff to previous 1.24 (colored)

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

Revision 1.24 / (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.23: +10 -6 lines
Diff to previous 1.23 (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.23 / (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.22: +2 -2 lines
Diff to previous 1.22 (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.22 / (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.21: +2 -4 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Mon Nov 5 22:14:54 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (colored)

Minor sync to NetBSD.

Revision 1.5.4.5 / (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.4: +8 -34 lines
Diff to previous 1.5.4.4 (colored) to branchpoint 1.5 (colored)

Sync the SMP branch to something just after 3.0

Revision 1.20 / (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.19: +1 -2 lines
Diff to previous 1.19 (colored)

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

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: +7 -32 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], Mon Aug 6 14:03:04 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Wed Jul 25 13:25:33 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Change the pmap_enter interface to merge access_type and the wired boolean
and arbitrary flags into one argument.

One new flag is PMAP_CANFAIL that tells pmap_enter that it can fail if there
are not enough resources to satisfy the request. If this flag is not passed,
pmap_enter should panic as it should have done before this change (XXX - many
pmaps are still not doing that).

Only i386 and alpha implement CANFAIL for now.

Includes uvm updates from NetBSD.

Revision 1.5.4.4 / (download) - annotate - [select for diffs], Wed Jul 4 11:01:03 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.5.4.3: +55 -27 lines
Diff to previous 1.5.4.3 (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.16 / (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.15: +28 -3 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Fri Jun 8 08:09:39 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.14: +4 -5 lines
Diff to previous 1.14 (colored)

Change the paddr_t pmap_extract(struct pmap *, vaddr_t) interface to
boolean_t pmap_extract(struct pmap *, vaddr_t, paddr_t *).
Matches NetBSD. Tested by various people on various platforms.

Revision 1.5.4.3 / (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.2: +6 -9 lines
Diff to previous 1.5.4.2 (colored) to branchpoint 1.5 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.14 / (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.13: +22 -7 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Sat May 5 23:25:54 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.12: +1 -12 lines
Diff to previous 1.12 (colored)

PMAP_NEW and UVM are no longer optional on i386.

Revision 1.12 / (download) - annotate - [select for diffs], Sat May 5 21:26:45 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.11: +10 -10 lines
Diff to previous 1.11 (colored)

Remove the (vaddr_t) casts inside the round_page and trunc_page macros.
We might want to use them on types that are bigger than vaddr_t.

Fix all callers that pass pointers without casts.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Apr 3 15:28:06 2001 UTC (23 years, 2 months ago) by aaron
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.10: +2 -3 lines
Diff to previous 1.10 (colored)

It is unnecessary to wrap uvm_wait() in splhigh(). Also, set p_addr to NULL
when we free it; art@ ok

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 2 21:43:12 2001 UTC (23 years, 2 months ago) by niklas
Branch: MAIN
Changes since 1.9: +3 -6 lines
Diff to previous 1.9 (colored)

On popular demand, the Linux-compatibility clone(2) implementation based
on NetBSD's code, as well as some faked Posix RT extensions by me.  This makes
at least simple linuxthreads tests work.

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

$OpenBSD$

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 7 20:15:28 2000 UTC (23 years, 9 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Convert bzero to memset(X, 0..) and bcopy to memcpy.
This is to match (make diffs smaller) the code in NetBSD.
new gcc inlines those functions, so this could also be a performance win.

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

Sync with -current

Revision 1.7 / (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_7_BASE, OPENBSD_2_7
Changes since 1.6: +13 -7 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Wed Mar 1 19:24:33 2000 UTC (24 years, 3 months ago) by niklas
Branch: MAIN
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored)

Prepare for new pmap

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Tue Feb 29 23:29:00 2000 UTC (24 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored)

In preparation for a new pmap

Revision 1.5 / (download) - annotate - [select for diffs], Fri Sep 3 18:02:21 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: +1 -1 lines
Diff to previous 1.4 (colored)

Change the pmap_enter api to pass down an argument that indicates
the access type that caused this mapping. This is to simplify pmaps
with mod/ref emulation (none for the moment) and in some cases speed
up pmap_is_{referenced,modified}.
At the same time, clean up some mappings that had too high protection.

XXX - the access type is incorrect in old vm, it's only used by uvm and MD code.
The actual use of this in pmap_enter implementations is not in this commit.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Aug 23 08:13:23 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
Changes since 1.3: +3 -8 lines
Diff to previous 1.3 (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.3 / (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.2: +6 -4 lines
Diff to previous 1.2 (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.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.