Home | History | Annotate | Download | only in uvm
History log of /src/sys/uvm/uvm_device.c
RevisionDateAuthorComments
 1.80  07-Jul-2022  riastradh uvm: CTASSERT about MIN_PAGE_SIZE, which is constant.
 1.79  07-Jul-2022  rin Convert CTASSERT(9) for PAGE_{SIZE,MASK} into KASSERT(9).

They are not compile-time constants for sparc.
 1.78  06-Jul-2022  riastradh kern: Work around spurious -Wtype-limits warnings.

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.
 1.77  06-Jul-2022  riastradh mmap(2): Guarantee two's-complement wraparound for D_NEGOFFSAFE.

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.
 1.76  06-Jul-2022  riastradh uvm/uvm_device.c: Sprinkle KNF.
 1.75  06-Jul-2022  riastradh mmap(2): Prohibit overflowing offsets for non-D_NEGOFFSAFE devices.

Reported-by: syzbot+d5a96e7a0ebbd0b76dfc@syzkaller.appspotmail.com
 1.74  06-Jul-2022  riastradh uvm(9): fo_mmap caller guarantees positive size.

No functional change intended, just sprinkling assertions to make it
clearer.
 1.73  28-Mar-2022  riastradh driver(9): New types dev_*_t for device driver devsw operations.

These will serve to replace the archaic and kludgey dev_type_* macros
which should've been typedefs all along.
 1.72  13-Mar-2021  skrll Consistently use %#jx instead of 0x%jx or just %jx in UVMHIST_LOG formats
 1.71  09-Jul-2020  skrll branches: 1.71.2;
Consistently use UVMHIST(__func__)

Convert UVMHIST_{CALLED,LOG} into UVMHIST_CALLARGS
 1.70  24-Feb-2020  rin 0x%#x --> %#x for non-external codes.
Also, stop mixing up 0x%x and %#x in single files as far as possible.
 1.69  23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.68  22-Feb-2020  chs do not wait for memory in pgo_fault methods, just return ENOMEM
and let the uvm_fault code wait if it is appropriate.
 1.67  01-Dec-2019  ad branches: 1.67.2;
__cacheline_aligned on a lock.
 1.66  28-Oct-2017  pgoyette branches: 1.66.4;
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3) format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
but it is possible that I've missed some of them. I would be glad to
update any stragglers that anyone identifies.
 1.65  17-Dec-2016  riastradh branches: 1.65.6; 1.65.8;
Omit needless nullmmap.

Convert the one user of it to nommap. No functional change to the
device driver, since uvm interpreted nullmmap just like nommap.

This slightly changes the uvm ABI so that the function pointer nullop
is no longer interpreted as non-mmappable. I do hereby declare that
I am surfing the kernel version bump from a few hours ago.
 1.64  14-Dec-2014  chs branches: 1.64.2;
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).
 1.63  27-Jan-2012  para branches: 1.63.6; 1.63.22; 1.63.24;
extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
 1.62  12-Jun-2011  rmind branches: 1.62.2; 1.62.6;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.61  23-Apr-2011  rmind branches: 1.61.2;
Replace "malloc" in comments, remove unnecessary header inclusions.
 1.60  12-Feb-2011  jmcneill need uvm_pmap.h for pmap_mmap_flags definition
 1.59  11-Feb-2011  jmcneill add optional MD pmap_mmap_flags macro for passing flags between cdev_mmap
and pmap_enter, ok matt@
 1.58  02-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.57  05-Feb-2010  uebayasi branches: 1.57.2; 1.57.4; 1.57.6; 1.57.8;
vnode.h is not used here.
 1.56  20-Jun-2009  mrg add a workaround for drm:

for device mmap()'s, if the D_NEGOFFSAFE flag is set, do not check
if the offset is negative.

this should go away with the test itself when all drivers are audited
and checked to not fail with negative offsets.
 1.55  17-Dec-2008  cegger branches: 1.55.2;
kill MALLOC and FREE macros.
 1.54  04-Jun-2008  ad branches: 1.54.6; 1.54.8; 1.54.14;
udv_fault: pmap_update before releasing locks.
 1.53  02-Jan-2008  ad branches: 1.53.6; 1.53.8; 1.53.10; 1.53.12;
Merge vmlocking2 to head.
 1.52  08-Dec-2007  ad branches: 1.52.4;
Merge from vmlocking2 (use cdev_mmap()).
 1.51  01-Dec-2007  yamt branches: 1.51.2;
constify pagerops.
 1.50  24-Jun-2007  christos branches: 1.50.6; 1.50.8; 1.50.14;
handle UVM_UNKNOWN_OFFSET.
 1.49  22-Feb-2007  thorpej branches: 1.49.4; 1.49.6; 1.49.8;
TRUE -> true, FALSE -> false
 1.48  03-Sep-2006  christos branches: 1.48.8;
use c99 initializers
 1.47  22-Feb-2006  drochner branches: 1.47.2;
kill the "fault_type" argument to pager's pgo_fault() methods
it is never used
(and using it would comprise an abstraction violation imho)
 1.46  11-Dec-2005  christos branches: 1.46.2; 1.46.4; 1.46.6;
merge ktrace-lwp.
 1.45  27-Jun-2005  thorpej branches: 1.45.2;
Small whitespace tweak.
 1.44  27-Jun-2005  thorpej Use ANSI function decls.
 1.43  06-Jun-2005  yamt introduce a macro to initialize uvm_object and use it.
 1.42  24-Mar-2004  junyoung Nuke __P().
 1.41  06-Sep-2002  gehenna branches: 1.41.6;
Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.40  28-Feb-2002  christos branches: 1.40.8;
use the <sys/conf.h> macro to get the mmap footprint.
 1.39  10-Nov-2001  lukem add RCSIDs, and in some cases, slightly cleanup #include order
 1.38  15-Sep-2001  chs branches: 1.38.2;
a whole bunch of changes to improve performance and robustness under load:

- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
 1.37  10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.36  26-May-2001  chs branches: 1.36.2; 1.36.4;
replace vm_page_t with struct vm_page *.
 1.35  26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.34  25-May-2001  chs remove trailing whitespace.
 1.33  24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.32  15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.31  10-Mar-2001  chs eliminate the VM_PAGER_* error codes in favor of the traditional E* codes.
the mapping is:

VM_PAGER_OK 0
VM_PAGER_BAD <unused>
VM_PAGER_FAIL <unused>
VM_PAGER_PEND 0 (see below)
VM_PAGER_ERROR EIO
VM_PAGER_AGAIN EAGAIN
VM_PAGER_UNLOCK EBUSY
VM_PAGER_REFAULT ERESTART

for async i/o requests, it used to be possible for the request to
be convert to sync, and the pager would return VM_PAGER_OK or VM_PAGER_PEND
to indicate whether the caller should perform post-i/o cleanup.
this is no longer allowed; pagers must now return 0 to indicate that
the async i/o was successfully started, and the caller never needs to
worry about doing the post-i/o cleanup.
 1.30  25-Nov-2000  chs branches: 1.30.2;
lots of cleanup:
use queue.h macros and KASSERT().
address amap offsets in pages instead of bytes.
make amap_ref() and amap_unref() take an amap, offset and length
instead of a vm_map_entry_t.
improve whitespace and comments.
 1.29  24-Nov-2000  chs g/c unused pager ops "asyncget" and "aiodone".
 1.28  27-Jun-2000  mrg remove include of <vm/vm.h>
 1.27  27-Jun-2000  simonb In udv_fault(), use an off_t for curr_offset so that the offset passed
to d_mmap isn't truncated on 64 bit architectures.
 1.26  26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.25  26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.24  24-Jun-2000  pk uvm_detach: eliminate degenerate loop construction.
 1.23  24-Jun-2000  pk Insert two missing `simple_unlock()'s' in udv_detach().
 1.22  28-May-2000  drochner branches: 1.22.2;
Don't silently truncate the voff_t offset to vaddr_t when passing it to
udv_attach. Pass the whole voff_t instead and do an explicite overflow
check before it is passed to the device's mmap handler (as "int", sadly).
 1.21  03-Apr-2000  chs branches: 1.21.2;
remove the "shareprot" pagerop. it's not needed anymore since
share maps are long gone.
 1.20  26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
Add a new type voff_t (defined as a synonym for off_t) to describe offsets
into uvm objects, and update the appropriate interfaces to use it, the
most visible effect being the ability to mmap() file offsets beyond
the range of a vaddr_t.

Originally by Chuck Silvers; blame me for problems caused by merging this
into non-UBC.
 1.19  26-Mar-2000  kleink Kill duplicate udv_attach() prototype; it's a public interface, and declared
in uvm_device.h.
 1.18  13-Nov-1999  thorpej Change the pmap_enter() API slightly; pmap_enter() now returns an error
value (KERN_SUCCESS or KERN_RESOURCE_SHORTAGE) indicating if it succeeded
or failed. Change the `wired' and `access_type' arguments to a single
`flags' argument, which includes the access type, and flags:

PMAP_WIRED the old `wired' boolean
PMAP_CANFAIL pmap_enter() is allowed to fail

If PMAP_CANFAIL is not specified, the pmap should behave as it always
has in the face of a drastic resource shortage: fall over dead.

Change the fault handler to deal with failure (which indicates resource
shortage) by unlocking everything, waiting for the pagedaemon to free
more memory, then retrying the fault.
 1.17  24-Oct-1999  ross Patch from chuq for uvm r/w map oscillation bug.
Fixes the XalphaNetBSD slowdown.
 1.16  08-Apr-1999  drochner branches: 1.16.2; 1.16.4; 1.16.6;
sanity: use ';' to separate statements
 1.15  26-Mar-1999  mycroft branches: 1.15.2; 1.15.4;
Add a new `access type' argument to pmap_enter(). This indicates what type of
memory access a mapping was caused by. This is passed through from uvm_fault()
and udv_fault(), and in most other cases is 0.
The pmap module may use this to preset R/M information. On MMUs which require
R/M emulation, the implementation may preset the bits and avoid taking another
fault. On MMUs which keep R/M information in hardware, the implementation may
preset its cached bits to speed up the next call to pmap_is_modified() or
pmap_is_referenced().
 1.14  25-Mar-1999  mrg remove now >1 year old pre-release message.
 1.13  24-Mar-1999  cgd modify udv_attach() and its caller (uvm_mmap()) so that it's passed the
offset and size of the requested region to be mapped, so that the
udv_attach() can use the device d_mmap() entry to check mappability
of the requested region.
 1.12  24-Mar-1999  cgd after discussion with chuck, nuke pgo_attach from uvm_pagerops
 1.11  19-Nov-1998  mrg check the return value of d_mmap before pmap_phys_address() gets hold of it.
 1.10  11-Oct-1998  chuck remove unused share map code from UVM:
- udv_fault() no longer has to worry about share map address translations
on device faults. simplify code.
 1.9  13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.8  05-May-1998  kleink branches: 1.8.2;
Remove inclusions of syscall (and syscall argument) related header files;
we don't need them here.
 1.7  09-Mar-1998  mrg KNF.
 1.6  01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.5  10-Feb-1998  mrg - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
 1.4  07-Feb-1998  mrg restore rcsids
 1.3  07-Feb-1998  chs rearrange a bit for clarity.
 1.2  06-Feb-1998  thorpej RCS ID police.
 1.1  05-Feb-1998  mrg branches: 1.1.1;
Initial revision
 1.1.1.1  05-Feb-1998  mrg initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code. i provided some help
getting swap and paging working, and other bug fixes/ideas. chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the UVM kernel code portion.


this will be KNF'd shortly. :-)
 1.8.2.2  08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.8.2.1  30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.15.4.2  09-Aug-1999  chs create a new type "voff_t" for uvm_object offsets
and define it to be "off_t". also, remove pgo_asyncget().
 1.15.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.15.2.1  26-Oct-1999  he Pull up revision 1.17 (requested by ross):
Bugfix for device mmap fault handler, fixes serious performance
problem with alpha X server.
 1.16.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.16.4.1  15-Nov-1999  fvdl Sync with -current
 1.16.2.4  27-Mar-2001  bouyer Sync with HEAD.
 1.16.2.3  12-Mar-2001  bouyer Sync with HEAD.
 1.16.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.16.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.21.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.2.3  30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.22.2.2  24-Jun-2000  thorpej Pull up rev. 1.24:
uvm_detach: eliminate degenerate loop construction.
 1.22.2.1  24-Jun-2000  thorpej Pull up rev. 1.23:
Insert two missing `simple_unlock()'s' in udv_detach().
 1.30.2.6  17-Sep-2002  nathanw Catch up to -current.
 1.30.2.5  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.30.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.30.2.3  21-Sep-2001  nathanw Catch up to -current.
 1.30.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.30.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.36.4.2  01-Oct-2001  fvdl Catch up with -current.
 1.36.4.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.36.2.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.36.2.3  16-Mar-2002  jdolecek Catch up with -current.
 1.36.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.36.2.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.38.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.40.8.1  16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw APIs.
 1.41.6.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.41.6.1  03-Aug-2004  skrll Sync with HEAD
 1.45.2.6  21-Jan-2008  yamt sync with head
 1.45.2.5  07-Dec-2007  yamt sync with head
 1.45.2.4  03-Sep-2007  yamt sync with head.
 1.45.2.3  26-Feb-2007  yamt sync with head.
 1.45.2.2  30-Dec-2006  yamt sync with head.
 1.45.2.1  21-Jun-2006  yamt sync with head.
 1.46.6.1  22-Apr-2006  simonb Sync with head.
 1.46.4.1  09-Sep-2006  rpaulo sync with head
 1.46.2.1  01-Mar-2006  yamt sync with head.
 1.47.2.1  14-Sep-2006  yamt sync with head.
 1.48.8.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.49.8.1  09-Dec-2007  reinoud Pullup to HEAD
 1.49.6.1  11-Jul-2007  mjf Sync with head.
 1.49.4.3  21-Aug-2007  yamt destroy vmobjlock.
 1.49.4.2  20-Aug-2007  ad Sync with HEAD.
 1.49.4.1  13-Mar-2007  ad Pull in the initial set of changes for the vmlocking branch.
 1.50.14.3  18-Feb-2008  mjf Sync with HEAD.
 1.50.14.2  27-Dec-2007  mjf Sync with HEAD.
 1.50.14.1  08-Dec-2007  mjf Sync with HEAD.
 1.50.8.1  09-Jan-2008  matt sync with HEAD
 1.50.6.2  09-Dec-2007  jmcneill Sync with HEAD.
 1.50.6.1  03-Dec-2007  joerg Sync with HEAD.
 1.51.2.3  08-Dec-2007  ad Sync with head.
 1.51.2.2  08-Dec-2007  ad Fix merge error.
 1.51.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.52.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.53.12.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.53.10.3  11-Mar-2010  yamt sync with head
 1.53.10.2  18-Jul-2009  yamt sync with head.
 1.53.10.1  04-May-2009  yamt sync with head.
 1.53.8.1  17-Jun-2008  yamt sync with head.
 1.53.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.53.6.1  05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.54.14.1  21-Apr-2010  matt sync to netbsd-5
 1.54.8.1  23-Jun-2009  snj Pull up following revision(s) (requested by mrg in ticket #826):
sys/sys/conf.h: revision 1.135
sys/uvm/uvm_device.c: revision 1.56
add a workaround for drm:
for device mmap()'s, if the D_NEGOFFSAFE flag is set, do not check
if the offset is negative.
this should go away with the test itself when all drivers are audited
and checked to not fail with negative offsets.
 1.54.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.55.2.1  23-Jul-2009  jym Sync with HEAD.
 1.57.8.2  17-Feb-2011  bouyer Sync with HEAD
 1.57.8.1  08-Feb-2011  bouyer Sync with HEAD
 1.57.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.57.4.5  31-May-2011  rmind sync with head
 1.57.4.4  19-May-2011  rmind Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.
 1.57.4.3  05-Mar-2011  rmind sync with head
 1.57.4.2  17-Mar-2010  rmind Reorganise UVM locking to protect P->V state and serialise pmap(9)
operations on the same page(s) by always locking their owner. Hence
lock order: "vmpage"-lock -> pmap-lock.

Patch, proposed on tech-kern@, from Andrew Doran.
 1.57.4.1  16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.57.2.3  31-Oct-2010  uebayasi We already have a flag PMAP_NOCACHE. s/PMAP_UNMANAGED/PMAN_NOCACHE/.
Pointed out by Chuck Silvers, thanks.
 1.57.2.2  28-May-2010  uebayasi Comment.
 1.57.2.1  27-Apr-2010  uebayasi Always map device pages via cdev as unmanaged for now.

I need this to read/write a NOR FlashROM from userland. Otherwise pmaps
believe the physload'ed ROM region as managed, and map it as cache
enabled, which prevents me from reading ROM command status, etc.
 1.61.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.62.6.1  18-Feb-2012  mrg merge to -current.
 1.62.2.1  17-Apr-2012  yamt sync with head
 1.63.24.2  05-Feb-2017  skrll Sync with HEAD
 1.63.24.1  06-Apr-2015  skrll Sync with HEAD
 1.63.22.1  31-Dec-2014  snj Pull up following revision(s) (requested by chs in ticket #363):
common/lib/libprop/prop_kern.c: revision 1.18
sys/arch/mac68k/dev/grf_compat.c: revision 1.27
sys/arch/x68k/dev/grf.c: revision 1.45
sys/external/bsd/drm/dist/bsd-core/drm_bufs.c: revision 1.12
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.12
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.6
sys/external/bsd/drm2/include/linux/mm.h: revision 1.4
sys/kern/vfs_vnops.c: revision 1.192 via patch
sys/rump/librump/rumpkern/vm.c: revision 1.160
sys/sys/file.h: revision 1.78 via patch
sys/uvm/uvm_device.c: revision 1.64
sys/uvm/uvm_device.h: revision 1.13
sys/uvm/uvm_extern.h: revision 1.192
sys/uvm/uvm_mmap.c: revision 1.150 via patch
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).
 1.63.6.1  03-Dec-2017  jdolecek update from HEAD
 1.64.2.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.64.2.1  20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).
 1.65.8.1  02-Nov-2017  snj Pull up following revision(s) (requested by pgoyette in ticket #335):
share/man/man9/kernhist.9: 1.5-1.8
sys/arch/acorn26/acorn26/pmap.c: 1.39
sys/arch/arm/arm32/fault.c: 1.105 via patch
sys/arch/arm/arm32/pmap.c: 1.350, 1.359
sys/arch/arm/broadcom/bcm2835_bsc.c: 1.7
sys/arch/arm/omap/if_cpsw.c: 1.20
sys/arch/arm/omap/tiotg.c: 1.7
sys/arch/evbarm/conf/RPI2_INSTALL: 1.3
sys/dev/ic/sl811hs.c: 1.98
sys/dev/usb/ehci.c: 1.256
sys/dev/usb/if_axe.c: 1.83
sys/dev/usb/motg.c: 1.18
sys/dev/usb/ohci.c: 1.274
sys/dev/usb/ucom.c: 1.119
sys/dev/usb/uhci.c: 1.277
sys/dev/usb/uhub.c: 1.137
sys/dev/usb/umass.c: 1.160-1.162
sys/dev/usb/umass_quirks.c: 1.100
sys/dev/usb/umass_scsipi.c: 1.55
sys/dev/usb/usb.c: 1.168
sys/dev/usb/usb_mem.c: 1.70
sys/dev/usb/usb_subr.c: 1.221
sys/dev/usb/usbdi.c: 1.175
sys/dev/usb/usbdi_util.c: 1.67-1.70
sys/dev/usb/usbroothub.c: 1.3
sys/dev/usb/xhci.c: 1.75
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.34
sys/kern/kern_history.c: 1.15
sys/kern/kern_xxx.c: 1.74
sys/kern/vfs_bio.c: 1.275-1.276
sys/miscfs/genfs/genfs_io.c: 1.71
sys/sys/kernhist.h: 1.21
sys/ufs/ffs/ffs_balloc.c: 1.63
sys/ufs/lfs/lfs_vfsops.c: 1.361
sys/ufs/lfs/ulfs_inode.c: 1.21
sys/ufs/lfs/ulfs_vnops.c: 1.52
sys/ufs/ufs/ufs_inode.c: 1.102
sys/ufs/ufs/ufs_vnops.c: 1.239
sys/uvm/pmap/pmap.c: 1.37-1.39
sys/uvm/pmap/pmap_tlb.c: 1.22
sys/uvm/uvm_amap.c: 1.108
sys/uvm/uvm_anon.c: 1.64
sys/uvm/uvm_aobj.c: 1.126
sys/uvm/uvm_bio.c: 1.91
sys/uvm/uvm_device.c: 1.66
sys/uvm/uvm_fault.c: 1.201
sys/uvm/uvm_km.c: 1.144
sys/uvm/uvm_loan.c: 1.85
sys/uvm/uvm_map.c: 1.353
sys/uvm/uvm_page.c: 1.194
sys/uvm/uvm_pager.c: 1.111
sys/uvm/uvm_pdaemon.c: 1.109
sys/uvm/uvm_swap.c: 1.175
sys/uvm/uvm_vnode.c: 1.103
usr.bin/vmstat/vmstat.c: 1.219
Reorder to test for null before null deref in debug code
--
Reorder to test for null before null deref in debug code
--
KNF
--
No need for '\n' in UVMHIST_LOG
--
normalise a BIOHIST log message
--
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3)
format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".
[2] I've tried very hard to find "all [the] existing users of
kernhist(9)"
but it is possible that I've missed some of them. I would be glad
to
update any stragglers that anyone identifies.
--
For some reason this single kernel seems to have outgrown its declared
size as a result of the kernhist(9) changes. Bump the size.
XXX The amount of increase may be excessive - anyone with more detailed
XXX knowledge please feel free to further adjust the value
appropriately.
--
Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit
--
And yet another one. :(
--
Use correct mark-up for NetBSD version.
--
More improvements in grammar and readability.
--
Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
--
And replace an instance of "%p" conversion with "%#jx"
--
Whitespace fix. Give Bl tag table a width. Fix Xr.
 1.65.6.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.66.4.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.67.2.1  29-Feb-2020  ad Sync with head.
 1.71.2.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed