History log of /netbsd-current/sys/arch/alpha/include/pmap.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.99 19-Jul-2022 riastradh

alpha: Fix missing includes in pmap.h.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base thorpej-i2c-spi-conf-base
# 1.98 31-May-2021 thorpej

Additional comment about the range (0-1025) that's needed for the PT page
reference count, and thus now many bits we need to scare up.


# 1.97 31-May-2021 thorpej

After a comment by joerg@, go back to using a dedicated field for the
PT page reference count, but add an XXX comment stating the desire to
find a safely-unused field in the vm_page structure when pages are in-
use as PT pages, so that we can save the 8 bytes per page needed for
this.


Revision tags: cjep_staticlib_x-base1
# 1.96 30-May-2021 thorpej

Implement pmap_remove_all().


# 1.95 30-May-2021 thorpej

When removing mappings, hang PV entries to be freed off of the
pmap_tlb_context structure, and free them back in bulk after we
release all of our locks (as we do with PT pages that are freed).


# 1.94 30-May-2021 thorpej

Keep track of a pmap's PV entries with a list hanging off the pmap.


# 1.93 30-May-2021 thorpej

Store the modified / referenced attribute bits in the lower 2 bits of
the PV entry list pointer in struct vm_page_md. This reduces the size
of that structure from 16 bytes to 8, and will go a fair way to making
up for increasing the size of struct pv_entry in a future commit.


# 1.92 30-May-2021 thorpej

Define a macro, VM_MDPAGE_PVS(), for fetching the first pv entry
for a page.


# 1.91 30-May-2021 thorpej

Pages that are in-use as page table pages should never be part of a
UVM loan transaction, so use the vm_page::loan_count field as the PT
page reference count.


# 1.90 30-May-2021 thorpej

Track the PT pages allocated to a pmap in the pmap itself.


# 1.89 30-May-2021 thorpej

Define a pmap_pagelist LIST_HEAD and use it where we used ad hoc LIST_HEADs
of vm_page structures. Define and use a generic routine to free such a list
back to UVM.

In pmap_remove_internal(), KASSERT that no PT pages are queued up to be
freed when removing mappings from the kernel pmap.


# 1.88 29-May-2021 thorpej

Move the pointer to the pmap's lev1map out of the shared pmap structure
and into each CPU's pmap_percpu area. This pointer is constant for the
life of the pmap, and moving it gives us an additional 8 bytes in the
shared pmap structure.

Because the kernel pmap does not have per-CPU data, all places where we
need the kernel pmap's lev1map now just reference kernel_lev1map directly.


# 1.87 29-May-2021 thorpej

Rather than tracking "needs I-sync on return to userspace" in a bitmap,
track it with a separate field in the pmap_percpu. Not only does this
reduce cache line contention ever so slightly, it also frees up a field
in the shared portion of the pmap structure.


# 1.86 29-May-2021 thorpej

Rename pmap_asn_info to pmap_percpu, and pmap::pm_asni to pmap::pm_percpu.
No functional change.


# 1.85 24-May-2021 thorpej

pmap_tlb_shootdown_all_user() can be called in the PV scenario as well
as the forward scenario, for example if a pmap_page_protect() to remove
all mappings results in the freeing of a PT page. It therefore needs
to do the same reference counting dance as pmap_tlb_shootdown_pv().

Also fix a use-after-free error in pmap_page_protect().

Add / tweak some assertions, and shrink the pmap::pm_count field from
long to unsigned int (which gave me a spare unsigned int field for
debugging purposes).

PR port-alpha/56201.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.84 03-Sep-2020 thorpej

branches: 1.84.6; 1.84.8;
Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.98 31-May-2021 thorpej

Additional comment about the range (0-1025) that's needed for the PT page
reference count, and thus now many bits we need to scare up.


# 1.97 31-May-2021 thorpej

After a comment by joerg@, go back to using a dedicated field for the
PT page reference count, but add an XXX comment stating the desire to
find a safely-unused field in the vm_page structure when pages are in-
use as PT pages, so that we can save the 8 bytes per page needed for
this.


Revision tags: cjep_staticlib_x-base1
# 1.96 30-May-2021 thorpej

Implement pmap_remove_all().


# 1.95 30-May-2021 thorpej

When removing mappings, hang PV entries to be freed off of the
pmap_tlb_context structure, and free them back in bulk after we
release all of our locks (as we do with PT pages that are freed).


# 1.94 30-May-2021 thorpej

Keep track of a pmap's PV entries with a list hanging off the pmap.


# 1.93 30-May-2021 thorpej

Store the modified / referenced attribute bits in the lower 2 bits of
the PV entry list pointer in struct vm_page_md. This reduces the size
of that structure from 16 bytes to 8, and will go a fair way to making
up for increasing the size of struct pv_entry in a future commit.


# 1.92 30-May-2021 thorpej

Define a macro, VM_MDPAGE_PVS(), for fetching the first pv entry
for a page.


# 1.91 30-May-2021 thorpej

Pages that are in-use as page table pages should never be part of a
UVM loan transaction, so use the vm_page::loan_count field as the PT
page reference count.


# 1.90 30-May-2021 thorpej

Track the PT pages allocated to a pmap in the pmap itself.


# 1.89 30-May-2021 thorpej

Define a pmap_pagelist LIST_HEAD and use it where we used ad hoc LIST_HEADs
of vm_page structures. Define and use a generic routine to free such a list
back to UVM.

In pmap_remove_internal(), KASSERT that no PT pages are queued up to be
freed when removing mappings from the kernel pmap.


# 1.88 29-May-2021 thorpej

Move the pointer to the pmap's lev1map out of the shared pmap structure
and into each CPU's pmap_percpu area. This pointer is constant for the
life of the pmap, and moving it gives us an additional 8 bytes in the
shared pmap structure.

Because the kernel pmap does not have per-CPU data, all places where we
need the kernel pmap's lev1map now just reference kernel_lev1map directly.


# 1.87 29-May-2021 thorpej

Rather than tracking "needs I-sync on return to userspace" in a bitmap,
track it with a separate field in the pmap_percpu. Not only does this
reduce cache line contention ever so slightly, it also frees up a field
in the shared portion of the pmap structure.


# 1.86 29-May-2021 thorpej

Rename pmap_asn_info to pmap_percpu, and pmap::pm_asni to pmap::pm_percpu.
No functional change.


# 1.85 24-May-2021 thorpej

pmap_tlb_shootdown_all_user() can be called in the PV scenario as well
as the forward scenario, for example if a pmap_page_protect() to remove
all mappings results in the freeing of a PT page. It therefore needs
to do the same reference counting dance as pmap_tlb_shootdown_pv().

Also fix a use-after-free error in pmap_page_protect().

Add / tweak some assertions, and shrink the pmap::pm_count field from
long to unsigned int (which gave me a spare unsigned int field for
debugging purposes).

PR port-alpha/56201.


Revision tags: cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.84 03-Sep-2020 thorpej

branches: 1.84.8;
Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


Revision tags: cjep_staticlib_x-base1
# 1.96 30-May-2021 thorpej

Implement pmap_remove_all().


# 1.95 30-May-2021 thorpej

When removing mappings, hang PV entries to be freed off of the
pmap_tlb_context structure, and free them back in bulk after we
release all of our locks (as we do with PT pages that are freed).


# 1.94 30-May-2021 thorpej

Keep track of a pmap's PV entries with a list hanging off the pmap.


# 1.93 30-May-2021 thorpej

Store the modified / referenced attribute bits in the lower 2 bits of
the PV entry list pointer in struct vm_page_md. This reduces the size
of that structure from 16 bytes to 8, and will go a fair way to making
up for increasing the size of struct pv_entry in a future commit.


# 1.92 30-May-2021 thorpej

Define a macro, VM_MDPAGE_PVS(), for fetching the first pv entry
for a page.


# 1.91 30-May-2021 thorpej

Pages that are in-use as page table pages should never be part of a
UVM loan transaction, so use the vm_page::loan_count field as the PT
page reference count.


# 1.90 30-May-2021 thorpej

Track the PT pages allocated to a pmap in the pmap itself.


# 1.89 30-May-2021 thorpej

Define a pmap_pagelist LIST_HEAD and use it where we used ad hoc LIST_HEADs
of vm_page structures. Define and use a generic routine to free such a list
back to UVM.

In pmap_remove_internal(), KASSERT that no PT pages are queued up to be
freed when removing mappings from the kernel pmap.


# 1.88 29-May-2021 thorpej

Move the pointer to the pmap's lev1map out of the shared pmap structure
and into each CPU's pmap_percpu area. This pointer is constant for the
life of the pmap, and moving it gives us an additional 8 bytes in the
shared pmap structure.

Because the kernel pmap does not have per-CPU data, all places where we
need the kernel pmap's lev1map now just reference kernel_lev1map directly.


# 1.87 29-May-2021 thorpej

Rather than tracking "needs I-sync on return to userspace" in a bitmap,
track it with a separate field in the pmap_percpu. Not only does this
reduce cache line contention ever so slightly, it also frees up a field
in the shared portion of the pmap structure.


# 1.86 29-May-2021 thorpej

Rename pmap_asn_info to pmap_percpu, and pmap::pm_asni to pmap::pm_percpu.
No functional change.


# 1.85 24-May-2021 thorpej

pmap_tlb_shootdown_all_user() can be called in the PV scenario as well
as the forward scenario, for example if a pmap_page_protect() to remove
all mappings results in the freeing of a PT page. It therefore needs
to do the same reference counting dance as pmap_tlb_shootdown_pv().

Also fix a use-after-free error in pmap_page_protect().

Add / tweak some assertions, and shrink the pmap::pm_count field from
long to unsigned int (which gave me a spare unsigned int field for
debugging purposes).

PR port-alpha/56201.


Revision tags: cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.84 03-Sep-2020 thorpej

Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.95 30-May-2021 thorpej

When removing mappings, hang PV entries to be freed off of the
pmap_tlb_context structure, and free them back in bulk after we
release all of our locks (as we do with PT pages that are freed).


# 1.94 30-May-2021 thorpej

Keep track of a pmap's PV entries with a list hanging off the pmap.


# 1.93 30-May-2021 thorpej

Store the modified / referenced attribute bits in the lower 2 bits of
the PV entry list pointer in struct vm_page_md. This reduces the size
of that structure from 16 bytes to 8, and will go a fair way to making
up for increasing the size of struct pv_entry in a future commit.


# 1.92 30-May-2021 thorpej

Define a macro, VM_MDPAGE_PVS(), for fetching the first pv entry
for a page.


# 1.91 30-May-2021 thorpej

Pages that are in-use as page table pages should never be part of a
UVM loan transaction, so use the vm_page::loan_count field as the PT
page reference count.


# 1.90 30-May-2021 thorpej

Track the PT pages allocated to a pmap in the pmap itself.


# 1.89 30-May-2021 thorpej

Define a pmap_pagelist LIST_HEAD and use it where we used ad hoc LIST_HEADs
of vm_page structures. Define and use a generic routine to free such a list
back to UVM.

In pmap_remove_internal(), KASSERT that no PT pages are queued up to be
freed when removing mappings from the kernel pmap.


# 1.88 29-May-2021 thorpej

Move the pointer to the pmap's lev1map out of the shared pmap structure
and into each CPU's pmap_percpu area. This pointer is constant for the
life of the pmap, and moving it gives us an additional 8 bytes in the
shared pmap structure.

Because the kernel pmap does not have per-CPU data, all places where we
need the kernel pmap's lev1map now just reference kernel_lev1map directly.


# 1.87 29-May-2021 thorpej

Rather than tracking "needs I-sync on return to userspace" in a bitmap,
track it with a separate field in the pmap_percpu. Not only does this
reduce cache line contention ever so slightly, it also frees up a field
in the shared portion of the pmap structure.


# 1.86 29-May-2021 thorpej

Rename pmap_asn_info to pmap_percpu, and pmap::pm_asni to pmap::pm_percpu.
No functional change.


# 1.85 24-May-2021 thorpej

pmap_tlb_shootdown_all_user() can be called in the PV scenario as well
as the forward scenario, for example if a pmap_page_protect() to remove
all mappings results in the freeing of a PT page. It therefore needs
to do the same reference counting dance as pmap_tlb_shootdown_pv().

Also fix a use-after-free error in pmap_page_protect().

Add / tweak some assertions, and shrink the pmap::pm_count field from
long to unsigned int (which gave me a spare unsigned int field for
debugging purposes).

PR port-alpha/56201.


Revision tags: cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.84 03-Sep-2020 thorpej

Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.85 24-May-2021 thorpej

pmap_tlb_shootdown_all_user() can be called in the PV scenario as well
as the forward scenario, for example if a pmap_page_protect() to remove
all mappings results in the freeing of a PT page. It therefore needs
to do the same reference counting dance as pmap_tlb_shootdown_pv().

Also fix a use-after-free error in pmap_page_protect().

Add / tweak some assertions, and shrink the pmap::pm_count field from
long to unsigned int (which gave me a spare unsigned int field for
debugging purposes).

PR port-alpha/56201.


Revision tags: cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.84 03-Sep-2020 thorpej

Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.84 03-Sep-2020 thorpej

Clean up all of the _PMAP_MAY_USE_PROM_CONSOLE crapola, centralizing the
logic in prom.c, and rename it _PROM_MAY_USE_PROM_CONSOLE in a few places
it's still needed.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.83 29-Aug-2020 thorpej

- Centralize per-CPU pmap initialization into a new pmap_init_cpu()
function. Call in from pmap_bootstrap() for the boot CPU, and
from cpu_hatch() for secondaary CPUs.
- Eliminiate the dedicated I-stream memory barrier IPI; handle it all from
the TLB shootdown IPI. Const poison, and add some additional memory
barriers and a TBIA to the PAUSE IPI.
- Completly rewrite TLB management in the alpha pmap module, borrowing
somoe ideas from the x86 pmap and adapting them to the alpha environment.
See the comments for theory of operation. Add a bunch of stats that
can be reported (disabled by default).
- Add some additional symbol decorations to improve cache behavior on
MP systems. Ensure coherency unit alignment for several structures
in the pmap module. Use hashed locks for pmap structures.
- Start out all new processes on the kernel page tables until their
first trip though pmap_activate() to avoid the potential of polluting
the current ASN in TLB with cross-process mappings.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.82 23-Jul-2020 skrll

unifdef -U_LKM


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.81 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.


Revision tags: is-mlppp-base ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

branches: 1.80.2;
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


# 1.81 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.


Revision tags: ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.80 19-May-2018 thorpej

Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.


Revision tags: netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.79 01-Jan-2014 matt

branches: 1.79.28;
Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
Addresses PR/48488.


# 1.78 04-Nov-2013 christos

convert to flex array


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.77 06-Feb-2012 matt

branches: 1.77.6; 1.77.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 rmind-uvmplock-base jym-xensuspend-base
# 1.76 14-Nov-2010 uebayasi

branches: 1.76.8; 1.76.12;
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.


Revision tags: uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.75 26-Oct-2009 thorpej

branches: 1.75.2; 1.75.4;
Garbage-collect pmap_do_reactivate() and the associated IPI -- nothing has
used them for a long time.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.74 15-Mar-2009 cegger

ansify function definitions


Revision tags: nick-hppapmap-base2 haad-dm-base2 haad-nbase2 haad-dm-base mjf-devfs2-base
# 1.73 09-Dec-2008 pooka

branches: 1.73.2;
In case of no _KERNEL_OPT, always define _PMAP_MAY_USE_PROM_CONSOLE


# 1.72 09-Dec-2008 pooka

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.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.71 28-Apr-2008 martin

branches: 1.71.6; 1.71.8;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.70 10-Mar-2008 ad

branches: 1.70.2; 1.70.4;
Finish moving alpha over to the MI atomic ops.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.69 02-Jan-2008 ad

branches: 1.69.2; 1.69.6;
Merge vmlocking2 to head.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base jmcneill-pm-base nick-csl-alignment-base matt-mips64-base yamt-idlelwp-base8 ppcoea-renovation-base thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base
# 1.68 21-Feb-2007 thorpej

branches: 1.68.10; 1.68.22; 1.68.28; 1.68.30; 1.68.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.67 02-Apr-2006 thorpej

branches: 1.67.14;
Static'ify.


Revision tags: yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.66 16-Feb-2006 perry

branches: 1.66.2; 1.66.4; 1.66.6;
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.65 24-Dec-2005 perry

branches: 1.65.2; 1.65.4; 1.65.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.64 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 yamt-readahead-base3 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 yamt-readahead-base2 netbsd-3-0-RC2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base netbsd-3-0-RC1 yamt-vop-base3 netbsd-2-0-3-RELEASE yamt-vop-base2 thorpej-vnode-attr-base netbsd-2-1-RELEASE yamt-vop-base netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 yamt-km-base4 netbsd-2-0-2-RELEASE yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base ktrace-lwp-base
# 1.63 24-Aug-2003 chs

branches: 1.63.16;
add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.


# 1.62 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.61 02-Aug-2003 matt

Make this compile with gcc3. Change kernel_pmap_store to array of struct
pmap instead of array u_long. A bit of space is wasted but it supresses
the -Wcast-align warning.


# 1.60 09-Apr-2003 nathanw

branches: 1.60.2;
POOL_VTOPHYS: Cast argument to ALPHA_K0SEG_TO_PHYS() to vaddr_t to
prevent gcc complaining about bitwise operations on pointers.


# 1.59 09-Apr-2003 thorpej

Add the ability for pool caches to cache the physical address of
objects. Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86. Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.


# 1.58 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.57 24-Sep-2002 ad

Remove the TCWSCONS config now that zstty can do flow control on IOASIC
machines.


# 1.56 22-Sep-2002 chs

it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.


# 1.55 22-Sep-2002 chs

add pmap_remove_all() hook (empty on most platforms so far).


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.54 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.


Revision tags: thorpej-devvp-base
# 1.53 15-Jul-2001 thorpej

branches: 1.53.2; 1.53.4;
Defer sending shootdown IPIs a bit longer. Reduces traffic a fair
bit more.


# 1.52 15-Jul-2001 thorpej

- Tweak the pmap locking protocol slightly -- require that a pmap must
be locked before it can be marked as `active' on a processor.
- Require that pmaps other than the kernel pmap be locked when they
are passed to pmap_tlb_shootdown(). This, combined with the locking
protocol tweak, allow us to get a consistent view of `activeness' of
a pmap, which means we can optmize away a lot of TLB shootdown traffic
for user pmaps.
- Borrow an idea from the i386mp branch; use the normal SHOOTDOWN IPI
to deal with hitting the entire TLB, and garbage-collect the TBIA
and TBIAP IPIs.


# 1.51 30-May-2001 mrg

branches: 1.51.2;
use _KERNEL_OPT


# 1.50 26-May-2001 chs

replace vm_page_t with struct vm_page *.


# 1.49 01-May-2001 thorpej

Delete the pmap_copy() calls.


# 1.48 01-May-2001 thorpej

Use a single linked list for PV entries. This saves 1MB of space
on my 1G RAM AlphaServer.


# 1.47 01-May-2001 thorpej

Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.


# 1.46 29-Apr-2001 thorpej

Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.


# 1.45 29-Apr-2001 thorpej

Add glue for page zero'ing in the idle loop.


Revision tags: thorpej_scsipi_beforemerge
# 1.44 24-Apr-2001 thorpej

Delete a couple of statistics that are not really worth keeping.


# 1.43 24-Apr-2001 thorpej

Gather ASN info into a single structure, and place a variable-length
array of those structures at the end of the pmap structure. We compute
the size of the pmap structure based on the maximum CPU ID for a
particular machine. This gives us better cache behavior and better
memory footprint for the ASN info.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.42 22-Apr-2001 thorpej

Undo a misguided previous change to the pmap_update() API.


# 1.41 22-Apr-2001 thorpej

Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.


# 1.40 21-Apr-2001 thorpej

#define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).


# 1.39 20-Apr-2001 thorpej

pmap_asn_alloc(): In a multiprocessor configuration, it's possible
to arrive here referencing the kernel_lev1map without having the
RESERVED ASN -- another CPU may have caused pmap_lev1map_destroy()
to be called, and that routine only invalidates the ASN for the
CPU that called it. So, in the MULTIPROCESSOR case, simply assign
the RESERVED ASN if we reference the kernel_lev1map rather than
asserting that we already have the RESERVED ASN. Thanks to Bill
Sommerfeld for helping me track down the problem.

Also add a new IPI that causes a CPU to re-activate its address
space if the pmap it's using changes level 1 maps (this probably
won't happen very often, but it's correct to have it).

This makes Alpha MP kernels boot multiuser. In fact, this commit
is being made from my dual-CPU AlphaServer 1200 running an MP kernel.


# 1.38 22-Nov-2000 thorpej

branches: 1.38.2;
Several changes, which get us generally further along with
multiprocessor support:
- Implement MP-safe halt.
- Make the FPU saving code more like Bill's on the i386 MP branch.
XXX This code will no doubt be revisited again.
- Pass the cpu_info and trapframe to IPI handlers, saving some work
in the handlers themselves, and also making it possible for the
"pause" handler to reference register state for DDB.
- Add "machine cpu" to DDB, making it possible to reference other
CPUs registers (and thus get e.g. a traceback) from whichever
CPU is actually running the debugger.
- Garbage-collect "machine halt" and "machine reboot" DDB commands.
They don't have a prayer of working properly in multiprocessor
kernels, and didn't really work all that well in uniprocessor kernels.


# 1.37 19-Nov-2000 thorpej

Implement pmap_growkernel().


# 1.36 26-Aug-2000 thorpej

Snapshot of TLB shootdown bugfixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.35 08-Jun-2000 thorpej

And more ANSI'ification!


Revision tags: minoura-xpg4dl-base
# 1.34 23-May-2000 thorpej

branches: 1.34.2;
Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.


# 1.33 01-Mar-2000 thorpej

Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
the deferred isync, and call it as appropriate in userret().


Revision tags: chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.32 28-Nov-1999 thorpej

- Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default. It
is structured like pmap_protect, and should be *much* faster. This was
actually written quite some time ago, but never committed because it
didn't work properly. Given the recent bugfix to pmap_protect(), "duh,
of course it didn't work properly before...". It seems to work fine now
(have done several builds and run the UVM regression tests using the new
code), but it is currently run-time optional so that some performance
measurements can be easily run against the old and new code.


Revision tags: comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.31 24-May-1999 thorpej

branches: 1.31.2; 1.31.8;
The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock. Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.


# 1.30 23-May-1999 thorpej

Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.


# 1.29 23-May-1999 thorpej

Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.


# 1.28 21-May-1999 thorpej

Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.


# 1.27 15-Apr-1999 thorpej

DEC_KN300 no longer uses PROM console.


Revision tags: netbsd-1-4-base
# 1.26 24-Feb-1999 thorpej

branches: 1.26.2;
First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.


# 1.25 04-Feb-1999 thorpej

Define a macro which has human readable strings corresponding to PGU_*
constants.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.24 22-Sep-1998 thorpej

Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.


# 1.23 14-Aug-1998 thorpej

vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t


Revision tags: eeh-paddr_t-base
# 1.22 24-Jul-1998 thorpej

Provide PMAP_{,UN}MAP_POOLPAGE().


# 1.21 11-Jun-1998 thorpej

Define a macro to test PG_EXEC.


# 1.20 20-May-1998 thorpej

Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor. Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.


# 1.19 19-May-1998 thorpej

Make PT page reference counting more generic so it can be used for other
special use page types.


# 1.18 19-May-1998 thorpej

The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.


# 1.17 19-May-1998 thorpej

Make the page attribute manifest constant names have similar form to
page usage manifest constant names.


# 1.16 19-May-1998 thorpej

Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal").


# 1.15 27-Apr-1998 thorpej

Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address. If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.


# 1.14 15-Apr-1998 mjacob

oops- add missing include


# 1.13 15-Apr-1998 mjacob

add Alpha 4100 support


# 1.12 26-Mar-1998 thorpej

if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates.


# 1.11 26-Mar-1998 thorpej

Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>. To see the history, look at the corresponding
pmap.old.<whatever> file.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base alpha-nwscons-base
# 1.10 06-Apr-1997 cgd

clean up NetBSD RCS ID strings


Revision tags: is-newarp-before-merge is-newarp-base
# 1.9 20-Aug-1996 cgd

branches: 1.9.2;
OLD_PMAP -> NEW_PMAP


# 1.8 09-Jul-1996 cgd

temporarily move new pmap code into a seperate header, so changes to
one version won't spam people compiling with the option to get the other.


# 1.7 02-Jul-1996 cgd

minor cleanups to fit into the NetBSD source tree better (e.g. remove
RCS Log messages). Haven't even tried to compile it yet.


Revision tags: mach-pmap
# 1.6 02-Jul-1996 cgd

pull in the Mach3 alpha pmap, as a base for the new pmap module. Modified
from the mach3 versions only as much as necessary to allow the old
NetBSD/Alpha pmap code to compile. THESE WILL NOT WORK AS-IS, and at
minimum will require code to implement reference- and modified-bit
emulation.


# 1.5 02-Jul-1996 cgd

if OLD_PMAP defined, pull in <machine/pmap.old.h> and ignore the other
contents of this file.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.4 23-Nov-1995 cgd

wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.3 10-Apr-1995 mycroft

Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.


# 1.2 28-Mar-1995 jtc

KERNEL -> _KERNEL


# 1.1 13-Feb-1995 cgd

preliminary Alpha support. note that NOT ALL OF THE MODIFICATIONS TO
THE REST OF THE KERNEL ARE IN THE TREE YET. Also, some of this is
_incredibly_ hack-ish, etc., but it works.