summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2015-11-11Remove the superfluous typedef uvm_flag_t (unsigned int). Also, fix anmmcc
associated mistake in the uvm manpage. Suggested by and ok tedu@
2015-11-10UVM change needed for vmm.Mike Larkin
discussed with miod, deraadt, and guenther.
2015-11-01refactor pledge_*_check and pledge_fail functionsSebastien Marie
- rename _check function without suffix: a "pledge" function called from anywhere is a "check" function. - makes pledge_fail call the responsability to the _check function. remove it from caller. - make proper use of (potential) returned error of _check() functions. - adds pledge_kill() and pledge_protexec() with and OK deraadt@
2015-10-30Fix two (verified to be harmless) off-by-ones in bounds checks inMiod Vallat
uvm_page_init() (causing uvmexp.npages to be sligthly wrong if pmap_steal_memory() has been used) and uvm_page_physload(). ok guenther@ kettenis@ visa@ beck@
2015-10-23Add 3 new pledge requests. "ps" exposes enough sysctl information forTheo de Raadt
ps-style programs (there are quite a few in the tree, including tmux). "vminfo" exposes a bit more system operation information, which many observation programs want (such as top). settime allows setting the system time, and will be used to pledge-protect the last ntpd process.
2015-10-09Rename tame() to pledge(). This fairly interface has evolved to be moreTheo de Raadt
strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
2015-10-08Lock the page queues by turning uvm_lock_pageq() and uvm_unlock_pageq() intoMark Kettenis
mtx_enter() and mtx_leave() operations. Not 100% this won't blow up but there is only one way to find out, and we need this to make progress on further unlocking uvm. prodded by deraadt@
2015-10-01In uvm_map_splitentry(), grab the kernel lock before calling into the amapMark Kettenis
or pager code. We may end up here without holding the kernel lock from uvm_unmap(). "ja ja" tedu@
2015-09-30implement new "prot_exec" tame(2) request:Sebastien Marie
- by default, a tamed-program don't have the possibility to use PROT_EXEC for mmap(2) or mprotect(2) - for that, use the request "prot_exec" (that could be dropped later) initial idea from deraadt@ and kettenis@ "make complete sense" beck@ ok deraadt@
2015-09-28the kernel lock is no longer needed in the fixed case since uvm_mapTed Unangst
will perform the unmap as necessary, holding the vm lock. reminded by kettenis
2015-09-28add a flag to indicate to uvm_map that it should unmap to make space.Ted Unangst
this pulls all the relevant operations under the same map locking, and relieves calling code from responsibility. ok kettenis matthew
2015-09-26Protect the list of free map entries with a mutex. This should fix theMark Kettenis
crashes seen by sthen@ on i386. ok visa@, guenther@, tedu@
2015-09-26matthew noticed there's a race where we are using the kernel lock to tieTed Unangst
together the unmap and map portions of a fixed mmap. make this explicit by pulling the lock up higher. in preparation for unlocking the syscall. there's still (always has been) a race where if the unmap sleeps, another mmap may see partial results because the map lock isn't held througout. another problem, another day.
2015-09-23Corect a kbind comment to describe the version that was settled on: no oldPhilip Guenther
data, only new
2015-09-21Drop a misleading XXX about PQ_AOBJ. Clear PQ_ANON unconditionally forVisa Hankala
consistency with PQ_AOBJ. Input kettenis@, ok beck@
2015-09-17Back out rev. 1.125. This bit was left behind (intentionally?) when theMark Kettenis
remainder of that commit was backed out. However,clearing the PQ_AOBJ bit here is definitely wrong. Our pagedaemon uses two separate lists to keep track of inactive pages. It uses PQ_SWAPBACKED, which really is both PQ_ANON and PQ_AOBJ to keep track of which inactive queue a page is sitting on. So if you twiddle PQ_AOBJ (or PQ_ANON) for an inactive page, a subsequent uvm_pagefree(9) will remove the page from the wrong queue! This usually goes unnoticed, but if the page happens to be the last one on the queue, the queues get corrupted. The damage quickly spreads to the free page queues and almost certainly results in the uvm_pmr_size_RB_REMOVE_COLOR() faults that people have seen sporadically since the spring of this year. ok visa@, beck@, krw@, guenther@
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-09-12Enable some diagnostics for interrupt-safe maps that are already happening forMark Kettenis
normal maps. ok beck@, miod@, guenther@
2015-09-09Add locking for interrupt-safe maps (those that have the VM_MAP_INTRSAFE flagMark Kettenis
set). Since we cannot sleep in that case, use a mutex instead of an rwlock. This is ok as the more complex code paths in the uvm code are not entered for interrupt-safe maps as paging isn't allowed in those maps. ok tedu@
2015-09-09All our pmap implementations provide pmap_resident_count(), so removeMiod Vallat
#ifndef pmap_resident_count code paths.
2015-09-06sizes for free(); ok semarieTheo de Raadt
2015-09-01size for free(), and make allocation side look similarTheo de Raadt
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-08-27After more than a decade it seems safe to conclude that amap_clean works.Mark Kettenis
ok mpi@, visa@
2015-08-27delete a comment about gcc -WuninitializedTheo de Raadt
2015-08-25In sys_kbind(), pages from uvm_map_extract() must be written to with kcopy()Philip Guenther
ok kettenis@
2015-08-23"XXXMRG: consider making it an inline or macro"Theo de Raadt
no way.
2015-08-21Remove the unused loan_count field and the related uvm logic. Most ofVisa Hankala
the page loaning code is already in the Attic. ok kettenis@, beck@
2015-08-19Make uvm_pmr_isfree() work correctly when RB_NFIND() returnsVisa Hankala
an exact match. ok kettenis@
2015-08-19Sync page_flagbits with reality.Visa Hankala
ok kettenis@
2015-07-20Actually return a value from sys_kbind() in the non-ld.so case, or theMiod Vallat
compiler will warn.
2015-07-20include sys/user.h to unbreak the build on at least arm after rev 1.110Jonathan Gray
ok miod@
2015-07-20Add kbind, a syscall for ld.so to use to securely and efficiently updatePhilip Guenther
memory for lazy binding ok deraadt@
2015-07-19Fix backward test that broke the cacheBob Beck
2015-07-19Change uvm_page[re]alloc_multi to actually use the flags passed in, and returnBob Beck
a value so that they may be called with UVM_PLA_NOWAIT ok kettenis@
2015-07-17Release the kernel lock while tearing down the uvm map in the reaper. SpeedsMark Kettenis
up workloads that fork a lot of processes and, more importantly reduces latency because it makes sure the reaper doesn't hold on to the kernel lock for long periods of time. This almost certainly breaks MP kernels on alpha, macppc, m88k and sgi; hppa might work, but probably doesn't. ok deraadt@, beck@
2015-06-27uvm_pmr_get1page() should return psize_t, not int; dhill@Miod Vallat
2015-06-20Fix a bug that causes uvm_pmr_get1page() to fail for allocations thatMark Kettenis
specify an address constraint even when free pages that meet the constraint are still available. This happens because the old code was using the root of the size tree as a starting point for a search down the address tree. This meant only part of the address tree was searched, and that part could very well not contain any of the pages that met the constraint. Instead, always walk the address tree from its root if the list of single pages is empty and the root of the size tree doesn't meet our constraints. From Visa Hankala. ok deraadt@
2015-05-07Pass a thread pointer instead of its file descriptor table to getvnode(9).Martin Pieuchot
Input and ok millert@
2015-05-07fix indentationJonathan Gray
ok miod@
2015-05-06make SWAP_KEY_GET symmetrical with SWAP_KEY_PUT by having it callDavid Gwynne
a function in uvm_swap_encrypt.c instead of doing stuff inline. lets me remove an extern from the header too. ok kettenis@
2015-05-05emul_native is only used for kernel threads which can't dump core, soPhilip Guenther
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@
2015-05-04reduce the scope of things that include uvm_swap_encrypt.h.David Gwynne
uvm_meter.c needs it to route the sysctl, uvm_swap.c needs it to use the functionality, and uvm_swap_encrypt.c needs it to for obvious reasons. userland sysctl already includes it explicitely. everything else doesnt and shouldnt care. ok miod@
2015-04-23tedu remnants of the previous attempt to implement page zeroing inDavid Gwynne
the idle thread. ok deraadt@
2015-04-23dont need \n on panic stringsDavid Gwynne
2015-04-22having macros provide semicolons is dangerous.David Gwynne
2015-03-30Revert 1.173 (special-casing mips64) now that uvm_map_hint()'s return value isMiod Vallat
constrained to a suitable range.
2015-03-30Extend uvm_map_hint() to get an address range as extra arguments, and makeMiod Vallat
sure it will return an address within that range. Use this in uaddr_rnd_select() to make sure we will not attempt to pick an address beyond what we are allowed to map. In my trees for 9 months, blackmailed s2k15 attendees into agreeing now would be a good time to commit.
2015-03-30#if 0 various unused definitions.Miod Vallat
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@