Commit Graph

2184 Commits

Author SHA1 Message Date
msaitoh
811d5a8b03 s/parition/partition/ 2020-09-29 02:49:55 +00:00
skrll
daa069ab66 Whitespace 2020-09-24 06:45:58 +00:00
chs
bcf3e95038 the previous fix for PR 55366 in uvm_amap.c 1.124 was incomplete:
- amap_adjref_anons() must also ignore AMAP_REFALL when updating
   the ppref, not just when deciding whether or not to initialize ppref.
 - UVM_EXTRACT_QREF relies on AMAP_REFALL to work properly,
   and since we can't use AMAP_REFALL then we can't use QREF either.
2020-09-21 18:41:59 +00:00
chs
7fafc0d589 Effectively disable the AMAP_REFALL flag because it is unsafe.
This flag tells the amap code that it does not need to allocate ppref
as part of adding or removing a reference, but that is only correct
if the range of the reference being added or removed is the same
as the range of all other references to the amap, and the point of
this flag is exactly to try to optimize the case where the range is
different and thus this flag would not be correct to use.
Fixes PR 55366.
2020-09-20 23:03:01 +00:00
skrll
023d9a4b2b G/C uvm_pagezerocheck 2020-09-20 10:30:05 +00:00
rin
56973a2d13 Cast pointer arguments of UVMHIST_CALLARGS() into uintptr_t.
Appease GCC9 -Wpointer-to-int-cast on ILP32 environments.
2020-09-10 02:12:57 +00:00
riastradh
9fc453562f Round of uvm.h cleanup.
The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
  to query whether curlwp is the pagedaemon, which should maybe be
  exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
  by it.  We should split up uvm_extern.h but this will serve for now
  to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
  UVMHIST(ubchist), since ubchist is declared in uvm.h but the
  reference evaporates if UVMHIST is not defined, so we reduce header
  file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
  here.

ok chs@
2020-09-05 16:30:10 +00:00
skrll
504fb3492e Remove pte_zero_p and simply check against 0. 2020-08-22 15:34:51 +00:00
skrll
eea3f3e629 Remove the #if defined(__mips_n64) && PAGE_SIZE == 8192 and make the
check MI - all PTs are PAGE_SIZE aligned
2020-08-22 15:32:36 +00:00
skrll
5cda43a53e Whitespace - line continutation alignment 2020-08-22 14:51:44 +00:00
skrll
00774ed075 Trailing whitespace 2020-08-22 13:59:16 +00:00
mrg
831a27a616 fix hpcmips and evbppc builds (wrong type in panic()). 2020-08-20 23:36:45 +00:00
mrg
58e1cf785c move pmap segtab history into a new history of only 1000 entries,
but will overflow much slower than the main pmap history.

move various debug info into kernhist.  make pte array checker
into an array and use it in pmap_segtab_release() and
pmap_pte_reserve().  move check before MD callback(), incase it
wants to change ptes for some reason (they're passed in, but
this callback is currently always NULL.)

clean up some history logs to reduce the number of lines required.
2020-08-20 05:54:32 +00:00
chs
a8aa7072a7 in uao_get(), if we unlock the uobj to read a page from swap,
we must clear the cached page array because it is now stale.
also add a missing call to uvm_page_array_fini() if the I/O fails.
fixes PR 55493.
2020-08-19 15:36:41 +00:00
simonb
bf74807839 Remove trailing \n from UVMHIST_LOG() format strings. 2020-08-19 07:29:00 +00:00
skrll
40a6ec7f3d KNF. Add some whitespace to the TLBINV_MAP macro and tlb_invalidate_op
enum.
2020-08-19 06:11:49 +00:00
skrll
57bc4fb9c6 Unwrap short line KASSERT 2020-08-19 06:08:27 +00:00
skrll
0c8273cd62 Fix inverted logic test in pmap_tlb_shootdown_process for if the victim
is onproc.
2020-08-19 06:07:03 +00:00
simonb
bc5b96679a Fix small tyop in a comment. 2020-08-18 11:48:21 +00:00
chs
752f40af2e fix amap_extend() to handle amaps where we previously failed to allocate
the ppref memory.
2020-08-18 10:40:20 +00:00
skrll
3635371f3e Improve a panic message ever so slightly 2020-08-18 07:25:46 +00:00
mrg
a152fe0b55 add pmaphist calls around seg_tab[] manipulation. hopefully will
help find what causes this:

panic: pmap_segtab_alloc: pm_segtab.seg_tab[1010] != 0 (0x980000004eeb6068): from free list
2020-08-17 08:56:27 +00:00
chs
0d0b0c4dc4 in uvm_findpage(), when uvm_page_array_fill_and_peek() returns a page
that is not the one we want and we make an assertion about dirtiness,
check the dirty status of the page we wanted rather than the page we got.
2020-08-16 00:24:41 +00:00
chs
b0597d5997 use uint64_t rather than int for storing the index of a page within an object. 2020-08-15 07:24:09 +00:00
tnn
68cb89e9f3 add a __diagused to fix non-DIAGNOSTIC kernel 2020-08-15 01:27:22 +00:00
chs
19303cecfc centralize calls from UVM to radixtree into a few functions.
in those functions, assert that the object lock is held in
the correct mode.
2020-08-14 09:06:14 +00:00
skrll
221a897233 s/pmaphist/maphist/ for now 2020-08-11 06:54:14 +00:00
skrll
a9bc40de8f More UVMHIST_LOG. Remove some commented output printfs. 2020-08-11 06:09:44 +00:00
skrll
37a00c7c5d Fix a comment 2020-08-11 05:43:45 +00:00
skrll
8b177c3504 Don't kcpuset_clone every pmap_tlb_shootdown_bystanders. Instead allocate
a kcpuset_t per cpu_info and use that.
2020-08-09 06:26:49 +00:00
skrll
599fa05849 Provide a pmap_segtab_deactivate for symmetry with pmap_segtab_activate
and use it in pmap_deactivate

Call pmap_md_xtab_{,de}activate from pmap_segtab_{,de}activate to be used
for PMAP_HWPAGEWALKER and any caches ops that might be required.

Provide empty (for now) pmap_md_xtab_{,de}activate functions on the
platforms that use sys/uvm/pmap
2020-08-07 07:19:45 +00:00
skrll
0902b73820 G/C USE_TOPDOWN_VM. __USE_TOPDOWN_VM is used (and hidden) 2020-08-04 06:10:27 +00:00
skrll
77e6c61a75 Provide a TLBINFO_OWNED 2020-08-01 07:14:05 +00:00
riastradh
820a30e585 Split aes_cbc_* and aes_xts_* into their own header files.
aes.h will remain just for key setup; any particular construction using
AES can have its own header file so we can have many of them without
rebuilding everything AES-related whenever one of them changes.

(Planning to add AES-CCM and AES-GCM too.)
2020-07-25 22:14:35 +00:00
skrll
4cd80e9208 unifdef -U_LKM 2020-07-23 19:07:01 +00:00
skrll
3cf96b0176 Always call pmap_segtab_activate in pmap_activate. pmap_segtab_activate
does the right thing if called with non-curlwp.
2020-07-18 16:12:09 +00:00
rin
979cf575ec Fix typo. Use PRIxPADDR rather than casting. 2020-07-15 15:08:26 +00:00
mrg
92714b238f paddr_t can't be printed by "%lx" in some platforms.
fix the eg, i386 build.
2020-07-13 10:46:10 +00:00
mrg
d8b4c02aa4 actually show the start/end that failed start < end in uvm_page_physload(). 2020-07-13 05:52:50 +00:00
rin
b0317a421b PR kern/55467
tmpfs calls pmap_kenter_pa(9) with virtual address with page offset

Bisectioning revealed that the failure starts with this commit:

sys/fs/tmpfs/tmpfs_vnops.c rev 1.142:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/fs/tmpfs/tmpfs_vnops.c#rev1.142

by which tmpfs became to use UBC_FAULTBUSY flag for ubc_uiomove(9).
If this flag is specified, pmap_kenter_pa(9) is called with virtual
address with page offset via ubc_alloc(9):

https://nxr.netbsd.org/xref/src/sys/uvm/uvm_bio.c#616

Most ports seem to neglect silently page offset of va argument for
pmap_kenter_pa(9). However, it causes KASSERT failure correctly for
powerpc/booke. So, truncate page offset there.

Now, tmpfs works just fine on evbppc-booke, and I've confirmed that
no new failures are detected by ATF.

Discussed with chs@. Thanks!
2020-07-09 09:24:32 +00:00
skrll
f3bd60e230 Consistently use UVMHIST(__func__)
Convert UVMHIST_{CALLED,LOG} into UVMHIST_CALLARGS
2020-07-09 05:57:15 +00:00
skrll
4e62681fb0 Trailing whitespace 2020-07-08 13:26:22 +00:00
skrll
9d481aafdf Comment updates 2020-07-08 12:12:16 +00:00
riastradh
937bd5f179 uvm: Make sure swap encryption IV is 128-bit-aligned on stack.
Will help hardware-assisted AES.
2020-06-29 23:40:28 +00:00
riastradh
f2307dc81e uvm(9): Switch from legacy rijndael API to new aes API. 2020-06-29 23:33:46 +00:00
jdolecek
6248b1a15f uvm_emap_size was removed a while ago 2020-06-25 18:20:18 +00:00
mlelstv
b7a193fbbd If ubc_winshift gets constified, the extern declaration must be too. 2020-06-25 16:36:43 +00:00
jdolecek
e4118f4162 make ubc_winshift / ubc_winsize constant, and based on whatever is bigger
of (1 << UBC_WINSHIFT, MAX_PAGE_SIZE)

given that default UBC_WINSHIFT is 13, this changes behaviour only
for mips and powerpc (BookE/OEA), which will now have twice as much
memory used for UBC windows; if this ever becomes a problem, it's
possible to reduce ubc_nwins in MD code similar to what is done on sparc

this eliminates variable-length arrays in ubc_fault(),
ubc_uiomove(), and ubc_zerorange() so that the stack usage can be
determined and checked in compile time
2020-06-25 14:04:30 +00:00
jdolecek
1a9ccc4329 use maximum-size fixed size array instead of variable-length array
in uvm_aio_aiodone() so that the stack usage can be determined and
checked in compile time; this is not called recursively not
particularly deep in call stack, so there is no need to save every
last drop of stack space here
2020-06-25 09:58:44 +00:00
thorpej
cb34023365 <sys/extent.h> not needed here. 2020-06-17 06:24:15 +00:00