Home | History | Annotate | Download | only in libkvm
History log of /src/lib/libkvm/kvm_i386.c
RevisionDateAuthorComments
 1.32  10-Jan-2022  christos Get rid of usrstack/USRSTACK. Document that the old version of getargv is
broken because of ASLR.
 1.31  25-Apr-2020  maxv Switch to the new PTE naming. The old naming is now unused, remove it.
 1.30  19-Feb-2014  dsl Remove the #include <sys/user.h> from all of libkvm.
sys/user.h is a stub that just #includes sys/pcb.h.
There are no 'struct pcb' anywhere in here, so I'm extremely doubtful
any of the builds will fail.
OTOH it might be relying on a header that pcb.h includes.
In any case i386 and amd64 build.
 1.29  05-Oct-2010  jym branches: 1.29.6; 1.29.12;
Import PAE support for kvm(3):
- add kvm_i386pae.c (used for PAE memory translations), and update Makefile
for libkvm build.
- in pdppaddr: pass a flag to indicate PAE mode. Use a bit ignored
by the MMU. Mask address with PG_FRAME to avoid side effects.

Tested with vmstat(1)/netstat(1) to debug core files of PAE and !PAE
kernels. Older kernel dumps will default to native i386 (!PAE) mode.

XXX Currently, savecore(8) will fail to dump a PAE kernel in a !PAE
environment (and reciprocally). So you need to sync and reboot
with a kernel of the same mode as the one that crashed. Once the dump
is successful, this does not matter anymore.
 1.28  20-Sep-2010  jym Change kvm_pa2off() and kvm_kvatop() prototypes (private to kvm(3)):

-int _kvm_kvatop(kvm_t *, u_long, u_long *);
-off_t _kvm_pa2off(kvm_t *, u_long);
+int _kvm_kvatop(kvm_t *, vaddr_t, paddr_t *);
+off_t _kvm_pa2off(kvm_t *, paddr_t);

Basically, use vaddr_t for VA and paddr_t for PA. In addition, for variables
representing addresses, use paddr_t or vaddr_t, depending on the context.

For most arches, vaddr_t and paddr_t are equivalent to unsigned long. However,
the change was needed for exotic situations, like i386 PAE, were unsigned long
is not suitable for PA which are 64 bits long. As this required a complete
change of the function prototypes, all arches had to be adapted accordingly.

Core files from before this commit should still work with the new code; I did
not see any direct dependency between core's structure and kvatop/pa2off.

The change was compile tested for all arches, as it impacts all of them.

See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
 1.27  19-Sep-2010  jym Ansify and KNF all functions within kvm(3). No objection on current-users@.

Used as ground for u_long => vaddr_t/paddr_t replacements in kvm(3)
private functions.

Compile tested for all arches. See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html
 1.26  25-Oct-2008  mrg use <i386/foo.h> in a few places.
 1.25  15-Jan-2008  ad Handle reading from raw disk devices.
 1.24  05-Jan-2008  jld Add address translation support for 4MB pages, which we use to map the
kernel text.
 1.23  05-Jan-2008  jld The address translation routine needs to use the plN_pi macros (for
indexing into the PTP), not the plN_i ones (for indexing into the entire
linear page table); cf. the analogous code for amd64. Fixes ~everything
to do with kernel core dumps on i386.
 1.22  18-Oct-2007  yamt sync with kernel after the merge of yamt-x86pmap branch.
 1.21  27-Aug-2004  thorpej branches: 1.21.16;
pdtpaddr -> pdppaddr
 1.20  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.19  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.18  05-Aug-2001  matt branches: 1.18.2;
Don't include <machine/pmap.h> and <machine/vmparam.h> if _KERNEL isn't
defined. Include them explicitly in the few kvm_arch.c that need them.
 1.17  29-Jun-2000  mrg <vm/vm.h> -> <uvm/uvm_extern.h>
 1.16  26-Jun-2000  mrg remove redundant vm includes
 1.15  02-Jul-1999  simonb More trailing white space.
 1.14  27-Sep-1998  christos Remove lint
 1.13  30-Jun-1998  thorpej Use pread(2) and pwrite(2) rather than lseek(2)/{read,write}(2).
 1.12  18-Feb-1998  thorpej Rewrite _kvm_kvatop() to work with the new crash dump format, and make
the i386 port use libkvm, not libkvm.old.
 1.11  15-Aug-1997  mikel use <sys/cdefs.h> __RCSID() macro
 1.10  14-Aug-1997  gwr Add _kvm_mdopen()
 1.9  18-Mar-1996  thorpej RCS id police.
 1.8  08-Mar-1996  mycroft Clean up a bit.
 1.7  29-Jun-1995  cgd fix a piece of sloppy coding on my part. gdb -k still doesn't work, though.
 1.6  26-Jun-1995  cgd update to match reality.
 1.5  09-Jan-1995  mycroft Eliminate _kvm_uvatop(), in favor of using the machine-independent VM structures.
 1.4  15-Aug-1994  mycroft Update to match current pmap.
 1.3  18-May-1994  pk branches: 1.3.2;
Fix kvm_uvatop().
 1.2  09-May-1994  cgd just punt for now; don't want to deal with this & don't want it to core
 1.1  09-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  09-May-1994  cgd new libkvm
 1.3.2.1  15-Aug-1994  mycroft update from trunk
 1.18.2.2  23-Apr-2002  nathanw Make libkvm able to cope with a LWPified kernel.

Add a kvm_getlwps() function to retrieve the LWPs of a specific process.
 1.18.2.1  05-Aug-2001  nathanw file kvm_i386.c was added on branch nathanw_sa on 2002-04-23 20:10:20 +0000
 1.21.16.3  23-Mar-2008  matt sync with HEAD
 1.21.16.2  09-Jan-2008  matt sync with HEAD
 1.21.16.1  06-Nov-2007  matt sync with HEAD
 1.29.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.6.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")

RSS XML Feed