summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2023-07-01Fix build when KERNHIST defined, but not UVMHISTskrll
2023-06-19s/value value/value/ in comment. No functional change.msaitoh
2023-06-12Fix compile for non-MULTIPROCESSOR and PMAP_TLB_MAX > 1 buildsskrll
2023-06-12Fixup UVMHIST buildsskrll
2023-05-15uvm: avoid a deadlock in uvm_map_clean()chs
The locking order between map locks and page "busy" locks is that the page "busy" lock comes first, but uvm_map_clean() breaks this rule by holding a map locked (as reader) while waiting for page "busy" locks. If another thread is in the page-fault path holding a page "busy" lock while waiting for the map lock (as a reader) and at the same time a third thread is blocked waiting for the map lock as a writer (which blocks the page-fault thread), then these three threads will all deadlock with each other. Fix this by marking the map "busy" (to block any modifications) and unlocking the map lock before possibly waiting for any page "busy" locks. Martin Pieuchot reported that the same problem existed in OpenBSD he applied this fix there after several people tested it. fixes PR 56952
2023-04-27Correct a type.skrll
2023-04-22KASSERT(kpreempt_disabled()) before accessing curcpu()skrll
2023-04-20Provide a shared pmap_devmap implementation and convert all pmap_devmapskrll
arrays to use DEVMAP_ENTRY{,_END}
2023-04-09uvm: Simplify assertion in uvn_get.riastradh
No functional change intended.
2023-04-09uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B)riastradh
2023-03-24Unwrap. NFCI.skrll
2023-02-27uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B)riastradh
While here, print some of the inputs with KASSERTMSG.
2023-02-26nkmempages should be size_tskrll
2023-02-26ci_data.cpu_kcpuset -> ci_kcpusetskrll
NFCI.
2023-02-24uvm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals.riastradh
Discussed on tech-kern: https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html
2023-02-19Spaces to TABs. NFCI.skrll
2023-02-12s/strucure/structure/ and s/structues/structures/ in comments.andvar
2022-12-21Rename pmap_md_pdetab_destroy to pmap_md_pdetab_fini to matchskrll
pmap_md_pdetab_init. Call pmap_md_pdetab_fini from pmap_segtab_destroy.
2022-12-21swap: disallow user opens of swap block devicechs
the swap/drum block device was never intended to allow user opens, but when the internal VOP_OPEN() in uvm_swap_init() was added back in rev 1.135, the d_open method was changed from always-fail to always-succeed in order to allow the new initial internal open. this had the side effect of incorrectly allowing user opens too. fix this by replacing the swap_bdevsw d_open with one that succeeds for the first call but fails for all subsequent calls. Reported-by: syzbot+90a23d2f19e5a0a302b3@syzkaller.appspotmail.com
2022-11-23mmap(2): Avoid arithmetic overflow in search for free space.riastradh
PR kern/56900 Reported-by: syzbot+3833ae1d38037a263d05@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=e542bcf59b2564cca1cb38c12f076fb08dcac37e
2022-11-07Fix UVMHIST buildskrll
2022-11-03_KERNEL_OPT protectionskrll
2022-11-03Provide MI PMAP support on AARCH64skrll
2022-11-02KNFskrll
2022-10-28MI PMAP EFI_RUNTIME supportskrll
2022-10-27In pmap_pte_reserve ensure we're atomically swapping out an invalid entryskrll
otherwise concurrent updates might both think they've updated the entry.
2022-10-27No need to hold the pmap_tlb_miss_lock when calling pmap_segtab_destroyskrll
2022-10-27Rename pm_count to pm_refcntskrll
2022-10-27Fix the crash(1) build for mips platformsskrll
2022-10-26ddb/db_active.h: New home for extern db_active.riastradh
This can be included unconditionally, and db_active can then be queried unconditionally; if DDB is not in the kernel, then db_active is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
2022-10-26sys/kernel.h: New home for extern start_init_exec.riastradh
2022-10-26MI PMAP hardware page table walker support.skrll
This is based on code given to me by Matt Thomas a long time ago with many updates and bugs fixes from me.
2022-10-23Correct the pmap_kstart_segtab entry in pmap_kern_segtabskrll
2022-10-20Add a KASSERT to check that tlb_asid_t is a large enough type.skrll
2022-09-25Rename pmap_segtab_t *stp to stb for consistency with a futureskrll
pmap_pdetab_t *ptb. pmap_pdetab_t *ptp would be far too confusing. NFC. Same code before and after.
2022-09-15whitespace - remove spaces before tabsskrll
2022-09-12A simplification and some minor whitespaceskrll
2022-08-20uvm_pdpolicy.h: Fix missing forward declarations and includes.riastradh
2022-08-20uvm/uvm_pmap.h: Fix missing types and forward declarations.riastradh
- Need sys/types.h for vaddr_t, paddr_t, u_int, &c. - Forward-declare struct vm_page so we don't have to rely on machine/pmap.h to do so.
2022-08-06allow KMSAN to work again by restoring the limiting of kva even withchs
NKMEMPAGES_MAX_UNLIMITED. we used to limit kva to 1/8 of physmem but limiting to 1/4 should be enough, and 1/4 still gives the kernel enough kva to map all of the RAM that KMSAN has not stolen. Reported-by: syzbot+ca3710b4c40cdd61aa72@syzkaller.appspotmail.com
2022-08-03for platforms which define NKMEMPAGES_MAX_UNLIMITED, set nkmempageschs
high enough to allow the kernel to map all of RAM into kmem, so that free physical pages rather than kernel virtual space is the limiting factor in allocating kernel memory. this gives ZFS more flexibility in tuning how much memory to use for its ARC cache.
2022-07-07uvm: CTASSERT about MIN_PAGE_SIZE, which is constant.riastradh
2022-07-07Convert CTASSERT(9) for PAGE_{SIZE,MASK} into KASSERT(9).rin
They are not compile-time constants for sparc.
2022-07-06kern: Work around spurious -Wtype-limits warnings.riastradh
This useless garbage warning is apparently designed to make it painful to write portable safe arithmetic and I think we ought to just disable it.
2022-07-06mmap(2): Guarantee two's-complement wraparound for D_NEGOFFSAFE.riastradh
XXX Not sure this should be allowed at all, but this way we don't change the semantics of the existing code which was written under essentially the assumption of -fwrapv.
2022-07-06uvm/uvm_device.c: Sprinkle KNF.riastradh
2022-07-06mmap(2): Prohibit overflowing offsets for non-D_NEGOFFSAFE devices.riastradh
Reported-by: syzbot+d5a96e7a0ebbd0b76dfc@syzkaller.appspotmail.com
2022-07-06uvm(9): fo_mmap caller guarantees positive size.riastradh
No functional change intended, just sprinkling assertions to make it clearer.
2022-07-06mmap(2): Assert size != 0 in non-anonymous case.riastradh
This is guaranteed by a test earlier; adding the assertion just makes it clearer that it applies to the branch where we call fo_mmap -- no functional change intended.
2022-07-06mmap(2): Avoid overflow in rounding and checking size.riastradh