Home | History | Annotate | Download | only in include
History log of /src/sys/arch/hppa/include/pmap.h
RevisionDateAuthorComments
 1.41  26-May-2022  skrll port-hppa/56849: Wacko kernel memory accounting in current/hppa

Two fixes:
- Don't include direct mapped memory in pmap statistics
- Decrement pmap statistics counts in pmap_kremove
 1.40  14-Mar-2020  ad pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
 1.39  24-Feb-2020  ad Adjust for UVM locking changes.
 1.38  12-Aug-2019  skrll branches: 1.38.2;
Use __BIT()
 1.37  07-Jan-2013  chs branches: 1.37.38; 1.37.42;
switch to __USE_TOPDOWN_VM.
move the stack to the top of the user address space so that
the available free space is more contiguous.
 1.36  06-Jan-2012  skrll branches: 1.36.6;
Track if a page has an executable mapping and flush the icache (and
dcache) appropriately.

Fixes the lang/python26 build on my C3700 (PA8700) and chuq's J6700 with
PA8500.

Thanks to chuq for ideas and help with this.
 1.35  06-Jan-2012  skrll Comment fix.
 1.34  06-Jan-2012  skrll No need to flush the icache/itlb for pool pages as they're never marked
executable.
 1.33  23-Dec-2011  skrll Define PMAP_NEED_PROCWR and provide pmap_procwr so that the i-cache is
synchronised with the d-cache appropriately.
 1.32  16-Dec-2011  skrll Whitespace.
 1.31  16-Dec-2011  skrll G/C pvh_aliases
 1.30  12-Jun-2011  rmind branches: 1.30.2; 1.30.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.29  14-Nov-2010  uebayasi branches: 1.29.6;
Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
 1.28  06-Jul-2010  cegger Turn PMAP_NOCACHE into MI flag.
Add MI flags PMAP_WRITE_COMBINE, PMAP_WRITE_BACK, PMAP_NOCACHE_OVR.
Update pmap(9) manpage.

hppa: Remove MD PMAP_NOCACHE flag as it exists as MI flag
mips: Rename MD PMAP_NOCACHE to PGC_NOCACHE.

x86: Implement new MI flags using Page-Attribute Tables.
x86: Implement BUS_SPACE_MAP_PREFETCHABLE.

Patch presented on tech-kern@:
http://mail-index.netbsd.org/tech-kern/2010/06/30/msg008458.html

No comments on this last version.
 1.27  21-Jun-2010  skrll Allow PVF_UNCACHEABLE in set/clear of pmap_changebit call (for now).
 1.26  19-Mar-2010  skrll Not all PA CPUs have the U-bit (uncacheable) for non-IO memory. In fact
most don't. Deal with non-equivalent aliases by removing and flushing the
managed mappings, and flushing the unmanaged mappings.

When flushing caches/TLB flush the cache before purging the TLB just in
case the flush enters the mapping into the TLB.
 1.25  06-Mar-2010  skrll branches: 1.25.2;
Add #include "opt_cputype.h" where necessary.
 1.24  22-Feb-2010  skrll Deal with PA2.0 cache move-in rules by purging the TLB as well as
flushing/purging the cache.
 1.23  15-Nov-2009  skrll branches: 1.23.2;
Put PMAP_NOCACHE in the MD space.
 1.22  11-Nov-2009  skrll Use the new flags argument to pmap_kenter_pa for PMAP_NOCACHE.
 1.21  24-May-2009  skrll u_intNN_t -> uintNN_t

"same" code before and after.
 1.20  30-Apr-2009  skrll Remove if defined(HP7100LC_CPU) || defined(HP7300LC_CPU) from around
pmap_hptsize and pdc_hwtlb (for now).
 1.19  30-Apr-2009  skrll Move HPPA_SID_KERNEL into pmap.h and deal with the move.
 1.18  30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.17  09-Dec-2008  pooka branches: 1.17.2;
Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module. pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
 1.16  06-Jan-2008  dsl branches: 1.16.6; 1.16.10; 1.16.16; 1.16.18;
include sys/simplelock.h
 1.15  17-Oct-2007  garbled branches: 1.15.2; 1.15.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.14  12-Jul-2007  skrll branches: 1.14.10;
Like I said - don't futz with the trapframe in pmap_activate. Instead
update the trapframe space and protection register in cpu_lwp_fork and
setregs.
 1.13  18-May-2007  skrll pmap_activate shouldn't play with the trap frame - especially not now it's
called by the MI code.

Implement a way of tracking the vmspace allocated to a process and its
LWPs so that if it changes underneath us we can correct the space id in
the trapframe in pmap_activate for now.

An example of when this happens is vfork/exec.

An exec hook is probably the way to go.
 1.12  07-Apr-2007  skrll branches: 1.12.4;
de-__P()

s/lwp/l/ for argument name in pmap_deactivate.
 1.11  16-Feb-2006  perry branches: 1.11.20; 1.11.24; 1.11.26;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.10  24-Dec-2005  perry branches: 1.10.2; 1.10.4; 1.10.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9  11-Dec-2005  christos merge ktrace-lwp.
 1.8  17-Jan-2005  atatat branches: 1.8.8;
Convert the PMAP_PREFER() macro from two arguments (offset and hint)
to four (adding size and direction).

In order for topdown uvm to be an option on ports using PMAP_PREFER,
they will need to "prefer" lower addresses if topdown is being used.
Additionally, at least one port also needs to know the size.
 1.7  18-Jul-2004  chs branches: 1.7.4;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.6  18-May-2004  chs convert pmap_deactivate() from a macro to an inline function
so that the kernel builds again.
 1.5  05-Jan-2004  chs add a PMAP_NC flag for pmap_kenter_pa() to specific a non-cached mapping.
use this in mbus_dmamem_map() to fix corruption of DMA memory.
note that this TLB bit is ignored on some CPUs (PA7100 and probably
others of that era), so this doesn't fix the problem in general,
but it does work on newer models and will make things easier later.
 1.4  31-Aug-2003  chs update for LWPs, and some lite cleanup.
 1.3  22-Sep-2002  chs branches: 1.3.6;
it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.2  22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.1  05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2  14-Jul-2002  gehenna catch up with -current.
 1.1.4.1  05-Jun-2002  gehenna file pmap.h was added on branch gehenna-devsw on 2002-07-14 17:47:29 +0000
 1.1.2.3  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.1.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1  05-Jun-2002  jdolecek file pmap.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.3.6.2  17-Jan-2005  skrll Sync with HEAD.
 1.3.6.1  03-Aug-2004  skrll Sync with HEAD
 1.7.4.1  29-Apr-2005  kent sync with -current
 1.8.8.2  21-Jan-2008  yamt sync with head
 1.8.8.1  03-Sep-2007  yamt sync with head.
 1.10.6.1  22-Apr-2006  simonb Sync with head.
 1.10.4.1  09-Sep-2006  rpaulo sync with head
 1.10.2.1  18-Feb-2006  yamt sync with head.
 1.11.26.1  11-Jul-2007  mjf Sync with head.
 1.11.24.3  15-Jul-2007  ad Sync with head.
 1.11.24.2  27-May-2007  ad Sync with head.
 1.11.24.1  10-Apr-2007  ad Sync with head.
 1.11.20.1  15-Apr-2007  yamt sync with head.
 1.12.4.2  03-Oct-2007  garbled Sync with HEAD
 1.12.4.1  22-May-2007  matt Update to HEAD.
 1.14.10.2  09-Jan-2008  matt sync with HEAD
 1.14.10.1  06-Nov-2007  matt sync with HEAD
 1.15.8.1  08-Jan-2008  bouyer Sync with HEAD
 1.15.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.16.18.13  28-Apr-2009  skrll Track unmanaged mappings to deal with loaning and non-equivalient aliases.
 1.16.18.12  11-Feb-2009  skrll -extern struct pmap kernel_pmap_store;
 1.16.18.11  11-Feb-2009  skrll Handle non-equivalent aliases.

Thanks to mjf for help with this.
 1.16.18.10  30-Jan-2009  skrll Add some defines for attributes of pages or mappings of pages
 1.16.18.9  25-Jan-2009  skrll Be careful not to PMAP_UNMAP_POOLPAGE and leave cache aliases.
 1.16.18.8  19-Jan-2009  skrll Sync with HEAD.
 1.16.18.7  09-Dec-2008  mjf Back out my previous change. PMAP_NC is blatantly used, which means I
just broke the build.
 1.16.18.6  08-Dec-2008  mjf Delete PMAP_NC because it's never used. To mark a vmpage as uncacheable
we use pmap_pvh_attrs(TLB_UNCACHEABLE) instead.
 1.16.18.5  02-Dec-2008  skrll Whirespace.
 1.16.18.4  02-Dec-2008  skrll Add PMAP_{,UN}MAP_POOLPAGE
 1.16.18.3  17-Nov-2008  skrll Restore PMAP_NC
 1.16.18.2  17-Nov-2008  skrll G/C some old stuff.
 1.16.18.1  27-Oct-2008  skrll Commit work in progress.
 1.16.16.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.10.4  11-Aug-2010  yamt sync with head.
 1.16.10.3  11-Mar-2010  yamt sync with head
 1.16.10.2  20-Jun-2009  yamt sync with head
 1.16.10.1  04-May-2009  yamt sync with head.
 1.16.6.1  17-Jan-2009  mjf Sync with HEAD.
 1.17.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.2.4  16-Nov-2010  uebayasi Sync with HEAD.
 1.23.2.3  17-Aug-2010  uebayasi Sync with HEAD.
 1.23.2.2  30-Apr-2010  uebayasi Sync with HEAD.
 1.23.2.1  25-Feb-2010  uebayasi Use VM_PAGE_TO_MD(). Only compile tested.
 1.25.2.5  09-Mar-2011  skrll Drop per-page locking i.e. pvh_lock and rely on locking provided by
upper layer, UVM. Sprinkle asserts.
 1.25.2.4  05-Mar-2011  rmind sync with head
 1.25.2.3  03-Jul-2010  rmind sync with head
 1.25.2.2  30-May-2010  rmind sync with head
 1.25.2.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.29.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.30.6.1  18-Feb-2012  mrg merge to -current.
 1.30.2.2  23-Jan-2013  yamt sync with head
 1.30.2.1  17-Apr-2012  yamt sync with head
 1.36.6.1  25-Feb-2013  tls resync with head
 1.37.42.1  10-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1467):

sys/arch/hppa/include/pmap.h: revision 1.41
sys/arch/hppa/hppa/pmap.c: revision 1.117

port-hppa/56849: Wacko kernel memory accounting in current/hppa

Two fixes:
- Don't include direct mapped memory in pmap statistics
- Decrement pmap statistics counts in pmap_kremove
 1.37.38.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.38.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed