Commit Graph

1718 Commits

Author SHA1 Message Date
christos
54eb2755d8 PR/50744: NONAKA Kimihiro: Protect more stuff with _KERNEL && _KMEMUSER to
make uvm_extern.h compile standalone again for net-snmp.
2016-02-05 04:18:55 +00:00
wiz
97b0e5c3cc Fix typo in comment. 2015-12-06 09:38:54 +00:00
mlelstv
4a1ce99b9b Clean up assertions and catch integer overflow. 2015-12-06 08:53:22 +00:00
martin
76713fa86f We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.
2015-11-26 13:15:34 +00:00
skrll
0ab5498d57 Remove #if 0 / #endif includes 2015-11-11 08:22:36 +00:00
skrll
b70033bc21 Split out the pmap_pv_track stuff for use by others.
Discussed with riastradh@
2015-11-11 08:20:22 +00:00
pgoyette
58afeafa2a Remove unnecessary #include for sys/shm.h - there's nothing here that needs
anything from there.
2015-11-05 00:12:28 +00:00
pgoyette
51126f7011 Now that SYSVSHM is modularized, reattach the linkages from uvm so that
we can correctly clean up on process exit or fork.

Without this, firefox attaches to a shared memory segment but doesn't
detach before exit.  Thus once firefox causes an autoload for sysv_ipc
it cannot be unloaded since the segment still retains references.
2015-11-05 00:10:47 +00:00
mrg
0b782e1e89 disable the previous for now; it fails for me on a different system. 2015-10-26 09:02:49 +00:00
mrg
6e1ac70a71 in uvm_obj_init(), KASSERT(ops), to ensure we have an actual pager ops
set for this object.  suggested by chuq.
2015-10-26 07:13:01 +00:00
christos
4e84514d8c move CTL_VM constants to uvm_param.h, leaving a comment behind. 2015-09-26 20:28:37 +00:00
christos
376cb84211 implement VM_PROC_MAP 2015-09-24 14:35:15 +00:00
matt
eabbabd2c3 Update multiple inclusion macro 2015-09-21 15:50:19 +00:00
pooka
d8e04c9094 to garnish, dust with _KERNEL_OPT 2015-08-24 22:50:32 +00:00
maxv
b36a7fd23d Some changes, to reduce a bit my tech-kern@ patch:
- move the P_PAX_ flags out of #ifdef PAX_ASLR in pax.h
 - add a generic pax_flags_active() function
 - fix a comment in exec_elf.c; interp is not static
 - KNF for return
 - rename pax_aslr() to pax_aslr_mmap()
 - rename pax_segvguard_cb() to pax_segvguard_cleanup_cb()
2015-08-04 18:28:09 +00:00
christos
6fc0455eae include decls for _MODULE 2015-07-30 10:25:49 +00:00
maxv
70f013c0c3 Lock before calling uvm_swap_stats(). Otherwise a race condition could
corrupt memory.
2015-07-30 09:55:57 +00:00
maxv
66b146ac99 Several changes and improvements in KMEM_GUARD:
- merge uvm_kmguard.{c,h} into subr_kmem.c. It is only user there, and
   makes it more consistent. Also, it allows us to enable KMEM_GUARD
   without enabling DEBUG.
 - rename uvm_kmguard_XXX to kmem_guard_XXX, for consistency
 - improve kmem_guard_alloc() so that it supports allocations bigger than
   PAGE_SIZE
 - remove the canary value, and use directly the kmem header as underflow
   pattern.
 - fix some comments

(The UAF fifo is disabled for the moment; we actually need to register
the va and its size, and add a weight support not to consume too much
memory.)
2015-07-27 09:24:28 +00:00
matt
9d9dbf5760 Use %p, %#xl etc. for pointers and addresses. 2015-06-22 06:24:17 +00:00
matt
9861f869d0 Use PMAP_MAP_POOLPAGE instead of POOL_PHYSTOV since we use PMAP_UNMAP_POOLPAGE.
Use PMAP_ALLOC_POOLPAGE instead of pmap_md_alloc_poolpage.
Cleanup some panic messages.
2015-06-11 08:04:44 +00:00
matt
f7b8434b14 Don't call kcpuset_intersecting_p and then kcpuset_ffs_intersecting since
that the last will tell use what we need to know.
2015-06-11 05:28:42 +00:00
matt
b9c0826d5d Add virtual_start to pmap_limits. This allows MD to steal address space
before pmap_bootstrap.
2015-06-11 05:27:07 +00:00
rmind
657547e6a2 ubc_alloc: perform pmap_update() in the error path as we might have
removed the mapping.
2015-05-27 19:43:40 +00:00
joerg
7c4334f760 pmap_tlb_intersecting_active_p is not used in some combinations of
platform options as seen by recent ARM changes.
2015-04-18 16:58:31 +00:00
riastradh
f9d2ab17e3 Limit <sys/rndsource.h> include to kernel. 2015-04-13 22:04:44 +00:00
riastradh
67d6ba47fb Convert remaining MI <sys/rnd.h> stragglers. Many MD ones left. 2015-04-13 16:46:33 +00:00
joerg
7946130d68 UVM_RESERVED_PAGES_PER_CPU must be a param, not a flag. 2015-04-12 12:44:13 +00:00
joerg
3350a13f64 Allow changing the per-cpu emergency page reservation via kernel config. 2015-04-11 19:24:13 +00:00
riastradh
369827c136 Initialize P->V tracking for unmanaged device pages in uvm_init.
Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
2015-04-03 01:03:42 +00:00
matt
4dc165175b include <sys/evcnt.h> 2015-04-02 06:17:52 +00:00
riastradh
d32bef14a2 Call these identities', not life states'. 2015-03-23 07:59:12 +00:00
riastradh
c1cdb89ea5 No, PQ_ANON is set only if owned by anon, not if loaned to anon. 2015-03-21 13:58:31 +00:00
riastradh
04aeec6145 Address O->A loan case in comments, pointed out by chs@. 2015-03-21 13:28:32 +00:00
riastradh
258f7cb150 Elaborate on locking scheme and vm_page states. 2015-03-21 13:11:14 +00:00
riastradh
bfff803e84 Comments explaining UBC_* flags. 2015-03-20 15:41:43 +00:00
mlelstv
e0f31e2bee Detect overflow when rounding length parameter and return ENOMEM.
Fixes PR kern/49692.
2015-03-01 13:43:51 +00:00
maxv
20fc3c6998 Kill kmeminit(). 2015-02-06 18:19:22 +00:00
nonaka
78531cbdd7 Disable pmap_md_tlb_check_entry, when MP. 2015-02-03 10:25:53 +00:00
christos
041f3ba4b3 The diagnostic function uvm_km_check_empty() takes a mutex, so don't call it
if we are using UVM_FLAG_NOWAIT.
2015-02-01 16:26:00 +00:00
nonaka
3012a05a13 Avoid race condition between PTE update and TLB miss walk. 2015-01-26 04:47:53 +00:00
chs
aac13e49e6 skip busy anon pages in uvm_map_clean().
we shouldn't be messing with pages that someone else has busy,
and uvm_map_clean() is just advisory for amap mappings.
2015-01-23 16:13:53 +00:00
chs
c70775aa06 in uvm_mmap_dev(), use the passed-in offset instead of 0.
from Onno van der Linden in PR 49536.
2015-01-10 23:35:02 +00:00
nonaka
038a27157d Use PMAP_TLB_MAX instead of MAXCPUS. 2015-01-05 05:35:18 +00:00
nonaka
1383a653f7 fix build failure when UVMHIST is defined. 2014-12-25 08:11:09 +00:00
nonaka
c08471032a fix compile failure. 2014-12-24 04:03:02 +00:00
nonaka
58634b7e37 pmap->pm_active and pmap->pm_onproc must be destroyed. 2014-12-22 11:11:34 +00:00
nonaka
1a8ba8658c Initialize pmap->pm_active and pmap->pm_onproc.
Avoid "panic: kernel diagnostic assertion "!pmap_tlb_intersecting_onproc_p(pm, ti)" failed: file "/usr/src/sys/uvm/pmap/pmap_tlb.c", line 762".
2014-12-19 04:25:52 +00:00
chs
6d40f9ff57 add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects.  move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap().  add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
2014-12-14 23:48:58 +00:00
msaitoh
db917302c6 Sort in uvmexp_sysctl's order for readability. No functional change. 2014-12-01 04:11:14 +00:00
msaitoh
571ed845ad Fix a bug that "vmstat -s" print uvmexp.ncolors incorrectly. 2014-12-01 04:02:40 +00:00