History log of /openbsd-src/sys/uvm/uvm_unix.c (Results 1 – 25 of 73)
Revision Date Author Comments
# e7a40e26 17-Jan-2024 kurt <kurt@openbsd.org>

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 suppre

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@

show more ...


# 13f0bae7 13-Jan-2023 kettenis <kettenis@openbsd.org>

Since the signal trampoline is now execute-only we no longer write it
into core dumps. As a result backtraces through signal handlers no
longer work in gdb and other debuggers.

Fix this by keeping

Since the signal trampoline is now execute-only we no longer write it
into core dumps. As a result backtraces through signal handlers no
longer work in gdb and other debuggers.

Fix this by keeping a read-only mapping of the signal trampoline in the
kernel and writing it into the core dump at the virtual address where it
is mapped in the process.

ok deraadt@, tb@

show more ...


# 64fad640 21-Oct-2020 deraadt <deraadt@openbsd.org>

move the backwards-stack vm_minsaddr check from hppa trap.c to uvm_grow(),
within the correct #ifdef of course.
ok kettenis


# 1df98543 19-Oct-2020 mpi <mpi@openbsd.org>

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.

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@

show more ...


# e7a54d53 13-Oct-2020 mpi <mpi@openbsd.org>

typo in comment


# d82e6535 06-Jul-2020 pirofti <pirofti@openbsd.org>

Add support for timeconting in userland.

This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they

Add support for timeconting in userland.

This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they want to count the passage of time.

If a timecounter clock can be exposed to userland than it needs to set
its tc_user member to a non-zero value. Tested with one or multiple
counters per architecture.

The timing data is shared through a pointer found in the new ELF
auxiliary vector AUX_openbsd_timekeep containing timehands information
that is frequently updated by the kernel.

Timing differences between the last kernel update and the current time
are adjusted in userland by the tc_get_timecount() function inside the
MD usertc.c file.

This permits a much more responsive environment, quite visible in
browsers, office programs and gaming (apparently one is are able to fly
in Minecraft now).

Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!

OK from at least kettenis@, cheloha@, naddy@, sthen@

show more ...


# 782069b1 05-Nov-2019 mpi <mpi@openbsd.org>

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

ok kettenis@, semarie@, deraadt@


# edc99bcd 21-Jun-2019 visa <visa@openbsd.org>

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 rlimi

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@

show more ...


# 02dbcf75 01-Mar-2019 cheloha <cheloha@openbsd.org>

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

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@

show more ...


# 75f71031 09-Mar-2017 guenther <guenther@openbsd.org>

Don't take the vmmap lock when dumping core: it's not actually necessary
and it creates a lock-order-reversal with inode locks

ok stefan@


# 3831a1c1 05-Mar-2017 guenther <guenther@openbsd.org>

Handle unshared amaps in uvm_coredump_walkmap() such that untouched pages
don't get written out to the core file but rather are represented via
segments which have memory size greater than their file

Handle unshared amaps in uvm_coredump_walkmap() such that untouched pages
don't get written out to the core file but rather are represented via
segments which have memory size greater than their file size. This shrinks
core files and eliminates a case where core dumping fails with EFAULT.
This can still happen in the shared amap case.

Based on a problem report from (and testing by) semarie@
ok stefan@

show more ...


# 17448fe7 05-Mar-2017 guenther <guenther@openbsd.org>

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@


# 13ca7240 02-Feb-2017 guenther <guenther@openbsd.org>

When dumping core, skip pages marked as unreadable instead of aborting
the dump.

tracked down with help from semarie@
ok mpi@


# 415d6aa0 16-Sep-2016 dlg <dlg@openbsd.org>

move the uvm_map_addr RB tree from RB macros to the RBT functions

this tree is interesting because it uses all the red black tree
features, specifically the augment callback thats called on tree
top

move the uvm_map_addr RB tree from RB macros to the RBT functions

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@

show more ...


# 81305dc4 12-Aug-2016 kettenis <kettenis@openbsd.org>

Include map entries that have an amap associated with them in the coredump.
This fixes coredumps of processes that use relro to make part of their
writable address space read-only.

ok guenther@


# dfb3c047 04-Apr-2016 stefan <stefan@openbsd.org>

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 alloc

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@

show more ...


# 5c7bcd7e 15-Mar-2016 stefan <stefan@openbsd.org>

Allocate amap slots for a virtual memory range reserved with sbrk lazily.

This avoids wasting kernel memory if the user process does not make
use of the allocated memory.

Testing by sthen@ and tobi

Allocate amap slots for a virtual memory range reserved with sbrk lazily.

This avoids wasting kernel memory if the user process does not make
use of the allocated memory.

Testing by sthen@ and tobiasu@, thanks!

ok deraadt@

show more ...


# 2df12b22 05-May-2015 guenther <guenther@openbsd.org>

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 lea

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@

show more ...


# 7180d9ea 09-Feb-2015 miod <miod@openbsd.org>

Stop using USRSTACK as the edge of the stack, but rather use the vmspace
vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in.

This should have no effect on the existing behavi

Stop using USRSTACK as the edge of the stack, but rather use the vmspace
vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in.

This should have no effect on the existing behaviourrr.

ok kettenis@ deraadt@

show more ...


# 15cd8707 17-Dec-2014 guenther <guenther@openbsd.org>

Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latter
doesn't have all the values and therefore can't be used everywhere.

ok deraadt@ kettenis@


# e087cc70 15-Dec-2014 guenther <guenther@openbsd.org>

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@


# 9084c337 17-Nov-2014 deraadt <deraadt@openbsd.org>

instead of PROT_MASK, use PROT_READ | PROT_WRITE | PROT_EXEC to
show the maxprot available in obreak mappings. (the default remains
PROT_READ | PROT_WRITE, so don't be afraid).
ok tedu


# 1e8cdc2e 16-Nov-2014 deraadt <deraadt@openbsd.org>

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

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

show more ...


# 188f0ea4 11-Jul-2014 jsg <jsg@openbsd.org>

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=12965

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

show more ...


# 35164244 13-Apr-2014 tedu <tedu@openbsd.org>

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


123