| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
- Sync comments with NetBSD including locking details.
- Remove superfluous parenthesis and spaces.
- Add brackets, even if questionable, to reduce diff with NetBSD
- Use for (;;) instead of while(1)
- Rename a variable from 'result' into 'error'.
- Move uvm_fault() and uvm_fault_upper_lookup()
- Add an locking assert in uvm_fault_upper_lookup()
ok tb@, mlarkin@
|
|
|
|
| |
Reported by and ok jsg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A rwlock is attached to every amap and is shared with all its anon. The
same lock will be used by multiple amaps if they have anons in common.
This should be enough to get the upper part of the fault handler out of the
KERNEL_LOCK() which seems to bring up to 20% improvements in builds.
This is based/copied/adapted from the most recent work done in NetBSD which
is an evolution of the precendent simple_lock scheme.
Tested by many, thanks!
ok kettenis@, mvs@
|
|
|
|
|
|
|
| |
Fix a regression where the valye wasn't correctly overwritten for wired
mapping, introduced in previous refactoring.
ok mvs@
|
|
|
|
|
|
|
| |
We can simulate the current behavior without lbolt by sleeping for 1
second on the &nowake channel.
ok mpi@
|
|
|
|
| |
ok kettenis@, dlg@
|
|
|
|
| |
ok jmatthew@, tb@
|
|
|
|
|
|
| |
No functionnal change.
ok kettenis@, jmatthew@, tb@
|
|
|
|
| |
ok tb@, jmatthew@
|
|
|
|
|
|
|
| |
Separate fault handling code for type 1 and 2 and reduce differences
with NetBSD.
ok tb@, jmatthew@, kettenis@
|
|
|
|
|
|
|
| |
Some minor documentation improvments and style nits but this should
not contain any functionnal change.
ok tb@
|
|
|
|
|
|
|
|
|
| |
It won't be used when amap and anon locking will be introduced.
This "fixes" passing a unrelated/uninitialized pointer in an error path
in case of memory shortage.
ok kettenis@
|
|
|
|
|
|
|
|
|
| |
The name, uvm_fault_check() and logic comes from NetBSD as reuducing diff
with their tree is useful to learn from their experience and backport fixes.
No functional change intended.
ok kettenis@
|
|
|
|
|
|
|
| |
This reduces code duplication, reduces the diff with NetBSD and will help
to introduce locks around global variables.
ok cheloha@
|
| |
|
|
|
|
|
|
| |
Reduce differences with NetBSD.
ok mvs@, kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok visa@, jca@
|
|
|
|
|
|
|
|
|
|
|
| |
UVM_WAIT() doesn't provide much of a useful abstraction. All callers
tsleep forever and no callers set PCATCH, so only 2 of 4 parameters are
actually used. Might as well just use tsleep_nsec(9) directly and make
the uvm code a bit less specialized.
Suggested by mpi@.
ok mpi@ visa@ millert@
|
|
|
|
|
|
|
|
|
|
| |
introduced with __MAP_NOFAULT. The regression let uvm_fault() run
without proper locking and rechecking of state after map version change
if page zero-fill was chosen.
OK kettenis@ deraadt@
Reported-by: syzbot+9972088c1026668c6c5c@syzkaller.appspotmail.com
|
|
|
|
|
|
| |
inteldrm driver to add support for the I915_MMAP_WC flag.
ok deraadt@, jsg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
according to POSIX. Bring regression test and kernel in line for
amd64 and i386. Other architectures have to follow.
OK deraadt@ kettenis@
|
|
|
|
|
|
|
|
|
| |
this tree is interesting because it uses all the red black tree
features, specifically the augment callback thats called on tree
topology changes, and it poisons and checks entries as theyre removed
from and inserted back into the tree respectively.
ok stefan@
|
|
|
|
|
|
|
|
|
|
|
| |
Only fail hard when running out of swap space also, as suggested by
kettenis@
While there, let amap_add() return a success status and handle
amap_add() errors in uvm_fault() similar to other out of RAM situations.
These bits are needed for further amap reorganization diffs.
lots of feedback and ok kettenis@
|
|
|
|
|
|
| |
Found by LLVM/Clang Static Analyzer.
ok mpi@ stefan@
|
|
|
|
| |
ok mpi@ millert@
|
|
|
|
| |
discussed with miod, deraadt, and guenther.
|
|
|
|
| |
#ifndef pmap_resident_count code paths.
|
|
|
|
|
|
| |
the page loaning code is already in the Attic.
ok kettenis@, beck@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
| |
mappable memory (direct or via execve), perhaps because of the address
allocator behind maps and the way wiring counts work?
|
|
|
|
|
| |
comment (one is fixed, one is deleted).
ok kettenis beck
|
|
|
|
|
|
| |
doesn't have all the values and therefore can't be used everywhere.
ok deraadt@ kettenis@
|
|
|
|
|
|
| |
eliminating the must-be-kept-in-sync UVM_INH_* macros
ok deraadt@ tedu@
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
wakeup and clearing the PG_BUSY and PG_WANTED flags, so try to keep those
bits as close together and defenitely avoid calling random code in between.
ok guenther@, tedu@
|
|
|
|
|
|
|
|
|
|
| |
an offset/size/address by shifting by PAGE_SHIFT. Make uvm_objwrire/unwire
use voff_t instead of off_t. The former is the right type here even if it is
equivalent to the latter.
Inspired by a somewhat similar changes in Bitrig.
ok deraadt@, guenther@
|
|
|
|
| |
emphatic ok usual suspects, grudging ok miod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which is the default, unless the fault call is explicitly used to wire a given
page.
The amount of pages being faulted in was borrowed from the FreeBSD VM code,
about 15 years ago, at a time FreeBSD was only reliably running on 4KB page
size systems.
It is questionable whether faulting the same amount of pages, on platforms
where the page size is larger, is a good idea, as it may cause too much I/O.
Add an uvmfault_init() routine, which will compute the proper number of pages
at runtime, depending upon the actual page size, and attempting to fault in
the same overall size the previous code would have done with 4KB pages.
ok tedu@
|
|
|
|
|
|
|
| |
the pmap_update() to the end of the loop, rather than after each loop
iteration - which might not even end up invoking pmap_enter()!
Quiet blessing from guenther@ deraadt@
|
| |
|
| |
|
| |
|
| |
|