The NetBSD Project

CVS log for src/sys/arch/x86/x86/pmap.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / x86 / x86

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.179 / (download) - annotate - [select for diffs], Tue Nov 13 14:07:42 2012 UTC (6 months, 1 week ago) by chs
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, tls-maxphys-nbase, tls-maxphys-base, khorben-n900, agc-symver-base, agc-symver, HEAD
Changes since 1.178: +30 -28 lines
Diff to previous 1.178 (colored)

add a pmap_kremove_local() that doesn't do TLB invalidations
on other CPUs.  this is only intended for use while writing
kernel crash dumps.  remove unused pmap_map().

Revision 1.178 / (download) - annotate - [select for diffs], Fri Jun 15 13:53:40 2012 UTC (11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.177: +6 -6 lines
Diff to previous 1.177 (colored)

emap: reduce the number of atomic ops.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Apr 20 22:23:24 2012 UTC (13 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Changes since 1.176: +78 -97 lines
Diff to previous 1.176 (colored)

- Convert x86 MD code, mainly pmap(9) e.g. TLB shootdown code, to use
  kcpuset(9) and thus replace hardcoded CPU bitmasks.  This removes the
  limitation of maximum CPUs.

- Support up to 256 CPUs on amd64 architecture by default.

Bug fixes, improvements, completion of Xen part and testing on 64-core
AMD Opteron(tm) Processor 6282 SE (also, as Xen HVM domU with 128 CPUs)
by Manuel Bouyer.

Revision 1.176 / (download) - annotate - [select for diffs], Sat Feb 25 20:03:58 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
CVS Tags: yamt-pagecache-base4, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4
Changes since 1.175: +0 -1 lines
Diff to previous 1.175 (colored)

Revert previous since it does a redundant xpq queue flush.
xen_bcast_invlpg() flushes the queue for us.

Revision 1.175 / (download) - annotate - [select for diffs], Sat Feb 25 19:32:27 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.174: +3 -2 lines
Diff to previous 1.174 (colored)

(xen) Flush the xpq before broadcasting page invalidate.

Revision 1.174 / (download) - annotate - [select for diffs], Sat Feb 25 12:33:53 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.173: +41 -47 lines
Diff to previous 1.173 (colored)

Use pmap_pte_xxx() functions instead of xen specific pte update
functions.

No functional changes.

Revision 1.173 / (download) - annotate - [select for diffs], Fri Feb 24 08:44:44 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored)

kernel page attribute change should be reflected on all cpus, since
the page is going to be released after the _dtor() hook is called.

Revision 1.172 / (download) - annotate - [select for diffs], Fri Feb 24 08:17:20 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.171: +1 -1 lines
Diff to previous 1.171 (colored)

Revert previous

Revision 1.171 / (download) - annotate - [select for diffs], Fri Feb 24 08:11:14 2012 UTC (14 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.170: +3 -3 lines
Diff to previous 1.170 (colored)

kernel page attribute change should be reflected on all cpus, since
the page is going to be released after the _dtor() hook is called.

Revision 1.170 / (download) - annotate - [select for diffs], Thu Feb 23 18:59:21 2012 UTC (14 months, 4 weeks ago) by bouyer
Branch: MAIN
CVS Tags: jmcneill-usbmp-base3
Changes since 1.169: +12 -4 lines
Diff to previous 1.169 (colored)

On Xen, there is variable-sized Xen data after the kernel's text+data+bss
(this include the physical->machine table).
(vaddr_t)(KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2) is after text+data+bss but,
on a domU with lots of RAM (more than 4GB) (so large
xpmap_phys_to_machine_mapping table) this can point to some of Xen's data
setup at bootstrap (either the xpmap_phys_to_machine_mapping table,
some page shared with the hypervisor, or our kernel page table). Using it for
early_zerop will cause of these pages to be unmapped after bootstrap.
This will cause a kernel page fault for the domU, either immediatly or
eventually much later, depending on where early_zerop points to.
To fix this, account for early_zerop when building the bootstrap pages,
and its VA from here.

May fix PR port-xen/38699

Revision 1.169 / (download) - annotate - [select for diffs], Tue Feb 21 21:09:51 2012 UTC (14 months, 4 weeks ago) by rmind
Branch: MAIN
Changes since 1.168: +7 -6 lines
Diff to previous 1.168 (colored)

pmap_kenter_pa: always print about already present mapping.
pmap_bootstrap: add comments.

Revision 1.168 / (download) - annotate - [select for diffs], Tue Feb 21 19:25:05 2012 UTC (14 months, 4 weeks ago) by bouyer
Branch: MAIN
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored)

Revert pmap_pte_flush() -> xpq_flush_queue() in previous.

Revision 1.167 / (download) - annotate - [select for diffs], Tue Feb 21 19:10:13 2012 UTC (14 months, 4 weeks ago) by bouyer
Branch: MAIN
Changes since 1.166: +22 -6 lines
Diff to previous 1.166 (colored)

Avoid early use of xen_kpm_sync(); locks are not available at this time.
Don't call cpu_init() twice.

Makes LOCKDEBUG kernels boot again

Revision 1.166 / (download) - annotate - [select for diffs], Mon Feb 20 20:49:12 2012 UTC (15 months ago) by bouyer
Branch: MAIN
Changes since 1.165: +10 -10 lines
Diff to previous 1.165 (colored)

- Make pmap_write_protect() work with pmap_kernel() too ((va & L2_FRAME)
  strips the high bits of a LP64 address)
- use pmap_protect() in pmap_pdp_ctor() to remap the PDP read-only instead
  of (ab)using pmap_kenter_pa(). No more "mapping already present" on
  console with DIAGNOSTIC kernels
- make sure to zero the whole PDP (NTOPLEVEL_PDES doens't include
  high-level entries on i386 and i386PAE, reserved by Xen). Not sure
  how it has worked before
- remove an always-true test (&& pmap != pmap_kernel(); we KASSERT that
  at the function entry).

Revision 1.165 / (download) - annotate - [select for diffs], Fri Feb 17 18:40:19 2012 UTC (15 months ago) by bouyer
Branch: MAIN
CVS Tags: jmcneill-usbmp-base2
Changes since 1.164: +23 -19 lines
Diff to previous 1.164 (colored)

Apply patch proposed in PR port-xen/45975 (this does not solve the exact
problem reported here but is part of the solution):
xen_kpm_sync() is not working as expected,
leading to races between CPUs.
1 the check (xpq_cpu != &x86_curcpu) is always false because we
  have different x86_curcpu symbols with different addresses in the kernel.
  Fortunably, all addresses dissaemble to the same code.
  Because of this we always use the code intended for bootstrap, which doesn't
  use cross-calls or lock.

2 once 1 above is fixed, xen_kpm_sync() will use xcalls to sync other CPUs,
  which cause it to sleep and pmap.c doesn't like that. It triggers this
  KASSERT() in pmap_unmap_ptes():
  KASSERT(pmap->pm_ncsw == curlwp->l_ncsw);
3 pmap->pm_cpus is not safe for the purpose of xen_kpm_sync(), which
  needs to know on which CPU a pmap is loaded *now*:
  pmap->pm_cpus is cleared before cpu_load_pmap() is called to switch
  to a new pmap, leaving a window where a pmap is still in a CPU's
  ci_kpm_pdir but not in pm_cpus. As a virtual CPU may be preempted
  by the hypervisor at any time, it can be large enough to let another
  CPU free the PTP and reuse it as a normal page.

To fix 2), avoid cross-calls and IPIs completely, and instead
use a mutex to update all CPU's ci_kpm_pdir from the local CPU.
It's safe because we just need to update the table page, a tlbflush IPI will
happen later. As a side effect, we don't need a different code for bootstrap,
fixing 1). The mutex added to struct cpu needs a small headers reorganisation.

to fix 3), introduce a pm_xen_ptp_cpus which is updated from
cpu_pmap_load(), whith the ci_kpm_mtx mutex held. Checking it with
ci_kpm_mtx held will avoid overwriting the wrong pmap's ci_kpm_pdir.

While there I removed the unused pmap_is_active() function;
and added some more details to DIAGNOSTIC panics.

Revision 1.164 / (download) - annotate - [select for diffs], Sat Feb 11 18:59:41 2012 UTC (15 months, 1 week ago) by chs
Branch: MAIN
CVS Tags: netbsd-6-base
Branch point for: netbsd-6
Changes since 1.163: +21 -5 lines
Diff to previous 1.163 (colored)

zero out the unused parts of direct-map page-table pages.
these seem to cause problems even though they aren't actually referenced,
probably due to speculative execution.
fixes PR 45892.

Revision 1.163 / (download) - annotate - [select for diffs], Wed Feb 1 18:55:32 2012 UTC (15 months, 2 weeks ago) by cherry
Branch: MAIN
Changes since 1.162: +2 -11 lines
Diff to previous 1.162 (colored)

amd64/Xen doesn't require special treatment for pmap_is_curpmap(),
since cpu_load_pmap() ensures that the linear map is in place for the
kernel. This emulates normal shared kernel mappings, except for the
recursive mapping of the PDP_BASE, which will point to the per-cpu
pdir, which will be a copy of the pmap_kernel()->pm_pdir; instead of
the user pmap->pm_pdir.

Revision 1.162 / (download) - annotate - [select for diffs], Mon Jan 30 17:56:27 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.161: +2 -6 lines
Diff to previous 1.161 (colored)

Remove obsolete comment

Revision 1.161 / (download) - annotate - [select for diffs], Mon Jan 30 10:33:05 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.160: +16 -5 lines
Diff to previous 1.160 (colored)

On xen, prevent cached PDP objects from being reused by pool_cache(9),
since they are "pinned" on the hypervisor and thus R/O for the domU.

Separately, after every per-cpu pmap pdir entry reset, make sure that
the corresponding L3 PTP pointers are flushed from all cpus with the
pmap loaded. Enforce this immediately via pmap_tlb_shootnow();

Revision 1.160 / (download) - annotate - [select for diffs], Sun Jan 29 11:45:37 2012 UTC (15 months, 3 weeks ago) by drochner
Branch: MAIN
Changes since 1.159: +3 -3 lines
Diff to previous 1.159 (colored)

don't mess with the PDP pool cache before it is initialized,
prevents at least LOCKDEBUG panics

Revision 1.159 / (download) - annotate - [select for diffs], Sun Jan 29 11:37:44 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.158: +2 -6 lines
Diff to previous 1.158 (colored)

remove obsolete comment

Revision 1.158 / (download) - annotate - [select for diffs], Sun Jan 29 11:37:08 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.157: +3 -17 lines
Diff to previous 1.157 (colored)

Remove apte related shootdowns.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Jan 28 08:57:09 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.156: +5 -5 lines
Diff to previous 1.156 (colored)

Fix pae xen build.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Jan 28 07:19:17 2012 UTC (15 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.155: +16 -32 lines
Diff to previous 1.155 (colored)

stop using alternate pde mapping in xen pmap

Revision 1.155 / (download) - annotate - [select for diffs], Fri Jan 27 19:48:39 2012 UTC (15 months, 3 weeks ago) by para
Branch: MAIN
Changes since 1.154: +20 -20 lines
Diff to previous 1.154 (colored)

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged

Revision 1.154 / (download) - annotate - [select for diffs], Sun Jan 22 18:16:35 2012 UTC (15 months, 4 weeks ago) by cherry
Branch: MAIN
Changes since 1.153: +2 -6 lines
Diff to previous 1.153 (colored)

Do not clobber pmap_kernel()'s pdir unnecessarily while syncing per-cpu pdirs

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jan 9 12:58:49 2012 UTC (16 months, 1 week ago) by cherry
Branch: MAIN
Changes since 1.152: +9 -15 lines
Diff to previous 1.152 (colored)

Harden cross-cpu L3 sync - avoid optimisations that may race.
Update ci->ci_kpm_pdir from user pmap, not global pmap_kernel() entry which may get clobbered by other CPUs.
XXX: Look into why we use pmap_kernel() userspace entries at all.

Revision 1.152 / (download) - annotate - [select for diffs], Mon Jan 9 04:55:35 2012 UTC (16 months, 1 week ago) by cherry
Branch: MAIN
Changes since 1.151: +17 -11 lines
Diff to previous 1.151 (colored)

While freeing ptps, remove stale L3 frame entries on all CPUS the pmap is loaded on, not just the current one.

Revision 1.151 / (download) - annotate - [select for diffs], Mon Jan 9 04:39:14 2012 UTC (16 months, 1 week ago) by cherry
Branch: MAIN
Changes since 1.150: +2 -5 lines
Diff to previous 1.150 (colored)

revert previous commit. DIAGNOSTIC should only do strict checks, not muffle current ones

Revision 1.150 / (download) - annotate - [select for diffs], Fri Jan 6 15:15:27 2012 UTC (16 months, 2 weeks ago) by cherry
Branch: MAIN
Changes since 1.149: +5 -2 lines
Diff to previous 1.149 (colored)

Address those pesky DIAGNOSTIC messages. \n
Take a performance hit at fork() for not DTRT. \n
Note: Only applicable for kernels built with "options DIAGNOSTIC" \n

Revision 1.149 / (download) - annotate - [select for diffs], Fri Dec 30 17:57:49 2011 UTC (16 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.148: +3 -29 lines
Diff to previous 1.148 (colored)

Move the per-cpu l3 page allocation code to a separate MD function. Avoids code duplication for xen PAE

Revision 1.148 / (download) - annotate - [select for diffs], Fri Dec 30 16:55:21 2011 UTC (16 months, 3 weeks ago) by cherry
Branch: MAIN
Changes since 1.147: +7 -45 lines
Diff to previous 1.147 (colored)

per-cpu shadow directory pages should be updated locally via cross-calls. Do this.

Revision 1.147 / (download) - annotate - [select for diffs], Fri Dec 9 17:32:51 2011 UTC (17 months, 1 week ago) by chs
Branch: MAIN
Changes since 1.146: +4 -4 lines
Diff to previous 1.146 (colored)

only use PG_G on leaf PTEs.
go back to tlbflush(), all the global entries
that we create in pmap_bootstrap() are permanent.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Dec 8 22:36:42 2011 UTC (17 months, 1 week ago) by rmind
Branch: MAIN
Changes since 1.145: +4 -4 lines
Diff to previous 1.145 (colored)

pmap_bootstrap: use tlbflushg(), not tlbflush(), since we use global pages.

Revision 1.145 / (download) - annotate - [select for diffs], Thu Dec 8 15:35:34 2011 UTC (17 months, 2 weeks ago) by chs
Branch: MAIN
Changes since 1.144: +9 -2 lines
Diff to previous 1.144 (colored)

allow building without direct-map support in non-XEN kernels.

Revision 1.144 / (download) - annotate - [select for diffs], Wed Dec 7 15:47:42 2011 UTC (17 months, 2 weeks ago) by cegger
Branch: MAIN
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

switch from xen3-public to xen-public.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Dec 4 16:24:13 2011 UTC (17 months, 2 weeks ago) by chs
Branch: MAIN
Changes since 1.142: +123 -15 lines
Diff to previous 1.142 (colored)

map all of physical memory using large pages.
ported from openbsd years ago by Murray Armfield,
updated for changes since then by me.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Nov 20 19:41:27 2011 UTC (18 months ago) by jym
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Changes since 1.141: +12 -31 lines
Diff to previous 1.141 (colored)

Expose pmap_pdp_cache publicly to x86/xen pmap. Provide suspend/resume
callbacks for Xen pmap.

Turn static internal callbacks of pmap_pdp_cache.

XXX the implementation of pool_cache_invalidate(9) is still wrong, and
IMHO this needs fixing before -6. See
http://mail-index.netbsd.org/tech-kern/2011/11/18/msg011924.html

Revision 1.141 / (download) - annotate - [select for diffs], Tue Nov 8 17:16:52 2011 UTC (18 months, 1 week ago) by cherry
Branch: MAIN
CVS Tags: yamt-pagecache-base3, jmcneill-audiomp3-base, jmcneill-audiomp3
Changes since 1.140: +2 -7 lines
Diff to previous 1.140 (colored)

Expose the PG_k #define pt/pd bit to both xen and "baremetal" x86. This is required, since kernel pages are mapped with user permissions in XEN/amd64 since the VM kernel runs in ring3. Since XEN/i386(including PAE) runs in ring1, supervisor mode is appropriate for these ports. We need to share this since the pmap implementation is still shared. Once the xen implementation is sufficiently independant of the x86 one, this can be made private to xen/include/xenpmap.h

Revision 1.140 / (download) - annotate - [select for diffs], Tue Nov 8 12:44:29 2011 UTC (18 months, 1 week ago) by njoly
Branch: MAIN
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored)

Fix build.

Revision 1.139 / (download) - annotate - [select for diffs], Sun Nov 6 20:21:05 2011 UTC (18 months, 2 weeks ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base2
Changes since 1.138: +5 -2 lines
Diff to previous 1.138 (colored)

make this compile again.

Revision 1.138 / (download) - annotate - [select for diffs], Sun Nov 6 15:18:18 2011 UTC (18 months, 2 weeks ago) by cherry
Branch: MAIN
Changes since 1.137: +80 -25 lines
Diff to previous 1.137 (colored)

[merging from cherry-xenmp] make pmap_kernel() shadow PMD per-cpu and MP aware.

Revision 1.137 / (download) - annotate - [select for diffs], Tue Oct 18 23:43:06 2011 UTC (19 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.136: +6 -106 lines
Diff to previous 1.136 (colored)

Move Xen specific functions out of x86 native pmap to xen_pmap.c.

Provide a wrapper to trigger pmap pool_cache(9) invalidations without
exposing the caches to outside world.

Revision 1.136 / (download) - annotate - [select for diffs], Tue Oct 18 23:14:28 2011 UTC (19 months ago) by jym
Branch: MAIN
Changes since 1.135: +4 -9 lines
Diff to previous 1.135 (colored)

Make "pmaps" (list of non-kernel pmaps) and "pmaps_lock" externally
visible. Required by pmap MD code that could reside in other
files, notably Xen's pmap.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Oct 11 23:53:31 2011 UTC (19 months, 1 week ago) by yamt
Branch: MAIN
Changes since 1.134: +33 -3 lines
Diff to previous 1.134 (colored)

add comments

Revision 1.134 / (download) - annotate - [select for diffs], Tue Oct 11 23:50:24 2011 UTC (19 months, 1 week ago) by yamt
Branch: MAIN
Changes since 1.133: +12 -11 lines
Diff to previous 1.133 (colored)

sprinkle __read_mostly

Revision 1.133 / (download) - annotate - [select for diffs], Mon Oct 10 01:28:26 2011 UTC (19 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.132: +6 -6 lines
Diff to previous 1.132 (colored)

We don't have printk. Use printf_nolog, and pass the function name.

Revision 1.132 / (download) - annotate - [select for diffs], Tue Sep 27 01:02:37 2011 UTC (19 months, 3 weeks ago) by jym
Branch: MAIN
Changes since 1.131: +8 -10 lines
Diff to previous 1.131 (colored)

Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html

Revision 1.131 / (download) - annotate - [select for diffs], Sun Sep 25 18:39:30 2011 UTC (19 months, 3 weeks ago) by jym
Branch: MAIN
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored)

Fix a small typo in comment: pmaps_lock is the lock that keeps all
pmaps in sync for kernel mappings (including when they are obtained from
pool caches).

Revision 1.130 / (download) - annotate - [select for diffs], Tue Sep 20 00:12:23 2011 UTC (20 months ago) by jym
Branch: MAIN
Changes since 1.129: +118 -2 lines
Diff to previous 1.129 (colored)

Merge jym-xensuspend branch in -current. ok bouyer@.

Goal: save/restore support in NetBSD domUs, for i386, i386 PAE and amd64.

Executive summary:
- split all Xen drivers (xenbus(4), grant tables, xbd(4), xennet(4))
in two parts: suspend and resume, and hook them to pmf(9).
- modify pmap so that Xen hypervisor does not cry out loud in case
it finds "unexpected" recursive memory mappings
- provide a sysctl(7), machdep.xen.suspend, to command suspend from
userland via powerd(8). Note: a suspend can only be handled correctly
when dom0 requested it, so provide a mechanism that will prevent
kernel to blindly validate user's commands

The code is still in experimental state, use at your own risk: restore
can corrupt backend communications rings; this can completely thrash
dom0 as it will loop at a high interrupt level trying to honor
all domU requests.

XXX PAE suspend does not work in amd64 currently, due to (yet again!)
page validation issues with hypervisor. Will fix.

XXX secondary CPUs are not suspended, I will write the handlers
in sync with cherry's Xen MP work.

Tested under i386 and amd64, bear in mind ring corruption though.

No build break expected, GENERICs and XEN* kernels should be fine.
./build.sh distribution still running. In any case: sorry if it does
break for you, contact me directly for reports.

Revision 1.129 / (download) - annotate - [select for diffs], Sun Aug 28 00:51:21 2011 UTC (20 months, 3 weeks ago) by dyoung
Branch: MAIN
Changes since 1.128: +5 -5 lines
Diff to previous 1.128 (colored)

Use __strict_weak_alias().

Revision 1.128 / (download) - annotate - [select for diffs], Sun Aug 14 02:31:08 2011 UTC (21 months, 1 week ago) by rmind
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.127: +50 -75 lines
Diff to previous 1.127 (colored)

Convert few panic() uses to asserts, reduce the scope of variable use.
No functional changes.

Revision 1.127 / (download) - annotate - [select for diffs], Tue Jul 5 14:07:12 2011 UTC (22 months, 2 weeks ago) by yamt
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (colored)

unrelax an assertion

Revision 1.126 / (download) - annotate - [select for diffs], Fri Jun 24 01:39:41 2011 UTC (22 months, 4 weeks ago) by yamt
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

pmap_map_ptes: fix a bug introduced by rmind-uvmplock merge

Revision 1.125 / (download) - annotate - [select for diffs], Thu Jun 23 16:25:09 2011 UTC (22 months, 4 weeks ago) by rmind
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

pmap_map_ptes: use cpu_load_pmap() to handle i386 PAE case.
Spotted by cherry@

Revision 1.124 / (download) - annotate - [select for diffs], Sat Jun 18 21:18:20 2011 UTC (23 months ago) by rmind
Branch: MAIN
Changes since 1.123: +3 -2 lines
Diff to previous 1.123 (colored)

pmap_page_remove: perform TLB shootdown, as it is not caller's responsibility
to perform pmap_update() according to the interface.  Might want to revisit.

Should fix recently reported tmpfs problems.  Thanks to enami@ and hannken@!

Revision 1.123 / (download) - annotate - [select for diffs], Mon Jun 13 04:30:40 2011 UTC (23 months, 1 week ago) by tls
Branch: MAIN
Changes since 1.122: +3 -4 lines
Diff to previous 1.122 (colored)

Fix Xen kernel builds (pmap_is_curpmap can't be static)

Revision 1.122 / (download) - annotate - [select for diffs], Sun Jun 12 03:35:50 2011 UTC (23 months, 1 week ago) by rmind
Branch: MAIN
Changes since 1.121: +317 -695 lines
Diff to previous 1.121 (colored)

Welcome to 5.99.53!  Merge rmind-uvmplock branch:

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

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

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

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

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

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.

Revision 1.121 / (download) - annotate - [select for diffs], Sun May 1 18:52:29 2011 UTC (2 years ago) by jym
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.120: +10 -10 lines
Diff to previous 1.120 (colored)

- Rather use pmap_pte_set() when modifying a PTE.

- Call pmap_pte_flush() when issuing PTE modifications. While it is a NOOP
for native x86, it is not for Xen. It will flush all operations that are
possibly waiting in the queue, like xpq_queue_pte_update(). Do it for
each level, this function is only called at boot time and is not
performance critical.

While here:
- No need to cast early_zerop to void with memset().
- Move common variables out of the #ifdef's.
- KNF

Revision 1.120 / (download) - annotate - [select for diffs], Wed Apr 27 07:42:11 2011 UTC (2 years ago) by plunky
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored)

drop 'inline' here, to avoid C99 vs GNU differences

Revision 1.119 / (download) - annotate - [select for diffs], Thu Apr 14 16:00:21 2011 UTC (2 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.118: +3 -6 lines
Diff to previous 1.118 (colored)

don't bother to register kernel ptp to uvm_object.  from yamt-vmem branch.

Revision 1.118 / (download) - annotate - [select for diffs], Fri Feb 11 23:08:38 2011 UTC (2 years, 3 months ago) by jmcneill
Branch: MAIN
CVS Tags: uebayasi-xip-base7, bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.117: +14 -2 lines
Diff to previous 1.117 (colored)

add bus_space_mmap support for BUS_SPACE_MAP_PREFETCHABLE, ok matt@

Revision 1.117 / (download) - annotate - [select for diffs], Thu Feb 10 00:23:14 2011 UTC (2 years, 3 months ago) by jym
Branch: MAIN
Changes since 1.116: +10 -5 lines
Diff to previous 1.116 (colored)

Use only one function to pin pages with Xen, and provide macros to
call it for different levels (L1 => L4).

Replace all calls to xpq_queue_pin_table(...) in MD code with these new
functions, with proper #ifdef'ing depending on $MACHINE.

Rationale:
- only one function to modify for logging
- pushes responsibility to caller for chosing the proper pin level, rather
than Xen internal functions; this makes the pin level explicit rather than
implicit.

Boot tested for dom0 i386/amd64, PAE included. No functional change intended.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Feb 5 13:50:08 2011 UTC (2 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.115: +9 -5 lines
Diff to previous 1.115 (colored)

assertions

Revision 1.115 / (download) - annotate - [select for diffs], Tue Feb 1 20:20:19 2011 UTC (2 years, 3 months ago) by chuck
Branch: MAIN
Changes since 1.114: +3 -3 lines
Diff to previous 1.114 (colored)

remove no-longer-valid wustl email address for me.
no functional change with this commit.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Feb 1 20:19:32 2011 UTC (2 years, 3 months ago) by chuck
Branch: MAIN
Changes since 1.113: +2 -9 lines
Diff to previous 1.113 (colored)

udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Jul 24 00:45:56 2010 UTC (2 years, 9 months ago) by jym
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.112: +84 -78 lines
Diff to previous 1.112 (colored)

Welcome PAE inside i386 current.

This patch is inspired by work previously done by Jeremy Morse, ported by me
to -current, merged with the work previously done for port-xen, together with
additionals fixes and improvements.

PAE option is disabled by default in GENERIC (but will be enabled in ALL in
the next few days).

In quick, PAE switches the CPU to a mode where physical addresses become
36 bits (64 GiB). Virtual address space remains at 32 bits (4 GiB). To cope
with the increased size of the physical address, they are manipulated as
64 bits variables by kernel and MMU.

When supported by the CPU, it also allows the use of the NX/XD bit that
provides no-execution right enforcement on a per physical page basis.

Notes:

- reworked locore.S

- introduce cpu_load_pmap(), used to switch pmap for the curcpu. Due to the
different handling of pmap mappings with PAE vs !PAE, Xen vs native, details
are hidden within this function. This helps calling it from assembly,
as some features, like BIOS calls, switch to pmap_kernel before mapping
trampoline code in low memory.

- some changes in bioscall and kvm86_call, to reflect the above.

- the L3 is "pinned" per-CPU, and is only manipulated by a
reduced set of functions within pmap. To track the L3, I added two
elements to struct cpu_info, namely ci_l3_pdirpa (PA of the L3), and
ci_l3_pdir (the L3 VA). Rest of the code considers that it runs "just
like" a normal i386, except that the L2 is 4 pages long (PTP_LEVELS is
still 2).

- similar to the ci_pae_l3_pdir{,pa} variables, amd64's xen_current_user_pgd
becomes an element of cpu_info (slowly paving the way for MP world).

- bootinfo_source struct declaration is modified, to cope with paddr_t size
change with PAE (it is not correct to assume that bs_addr is a paddr_t when
compiled with PAE - it should remain 32 bits). bs_addrs is now a
void * array (in bootloader's code under i386/stand/, the bs_addrs
is a physaddr_t, which is an unsigned long).

- fixes in multiboot code (same reason as bootinfo): paddr_t size
change. I used Elf32_* types, use RELOC() where necessary, and move the
memcpy() functions out of the if/else if (I do not expect sym and str tables
to overlap with ELF).

- 64 bits atomic functions for pmap

- all pmap_pdirpa access are now done through the pmap_pdirpa macro. It
hides the L3/L2 stuff from PAE, as well as the pm_pdirpa change in
struct pmap (it now becomes a PDP_SIZE array, with or without PAE).

- manipulation of recursive mappings ( PDIR_SLOT_{,A}PTEs ) is done via
loops on PDP_SIZE.

See also http://mail-index.netbsd.org/port-i386/2010/07/17/msg002062.html

No objection raised on port-i386@ and port-xen@R for about a week.

XXX kvm(3) will be fixed in another patch to properly handle both PAE and !PAE
kernel dumps (VA => PA macros are slightly different, and need proper 64 bits
PA support in kvm_i386).

XXX Mixing PAE and !PAE modules may lead to unwanted/unexpected results. This
cannot be solved easily, and needs lots of thinking before being declared
safe (paddr_t/bus_addr_t size handling, PD/PT macros abstractions).

Revision 1.112 / (download) - annotate - [select for diffs], Thu Jul 15 21:14:31 2010 UTC (2 years, 10 months ago) by jym
Branch: MAIN
Changes since 1.111: +14 -8 lines
Diff to previous 1.111 (colored)

Check the virtual address 'va' for each PDIR_SLOT_PTE entry. PDP_SIZE
is 4 with PAE (Xen only currently), 1 otherwise: loop should be unrolled
when PDP_SIZE is 1.

pmap_alloc_level() is used by pmap_growkernel(), the PDE is a kernel
mapping: mark it so with PG_k. While here, use pmap_pa2pte() for physical
address 'pa'.

No functional change.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jul 7 01:14:53 2010 UTC (2 years, 10 months ago) by chs
Branch: MAIN
Changes since 1.110: +2 -12 lines
Diff to previous 1.110 (colored)

add the guts of TLS support on amd64.  based on joerg's patch,
reworked by me to support 32-bit processes as well.
we now keep %fs and %gs loaded with the user values
while in the kernel, which means we don't need to
reload them when returning to user mode.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Jul 6 20:50:35 2010 UTC (2 years, 10 months ago) by cegger
Branch: MAIN
Changes since 1.109: +69 -6 lines
Diff to previous 1.109 (colored)

Turn PMAP_NOCACHE into MI flag.
Add MI flags PMAP_WRITE_COMBINE, PMAP_WRITE_BACK, PMAP_NOCACHE_OVR.
Update pmap(9) manpage.

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

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

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

No comments on this last version.

Revision 1.109 / (download) - annotate - [select for diffs], Mon May 10 18:46:58 2010 UTC (3 years ago) by dyoung
Branch: MAIN
Changes since 1.108: +19 -111 lines
Diff to previous 1.108 (colored)

Provide pmap_enter_ma(), pmap_extract_ma(), pmap_kenter_ma() in all x86
kernels, and use them in the bus_space(9) implementation instead of ugly
Xen #ifdef-age.  In a non-Xen kernel, the _ma() functions either call or
alias the equivalent _pa() functions.

Reviewed on port-xen@netbsd.org and port-i386@netbsd.org.  Passes
rmind@'s and bouyer@'s inspection.  Tested on i386 and on Xen DOMU /
DOM0.

Revision 1.108 / (download) - annotate - [select for diffs], Tue May 4 23:27:14 2010 UTC (3 years ago) by jym
Branch: MAIN
Changes since 1.107: +6 -8 lines
Diff to previous 1.107 (colored)

Enable the NX bit feature for Xen i386pae and amd64 kernels.

Tested with Xen 3.1 and Xen 3.3, dom0 and domU, by bouyer@ and jym@.

Ok bouyer@.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Apr 18 23:47:51 2010 UTC (3 years, 1 month ago) by jym
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.106: +8 -8 lines
Diff to previous 1.106 (colored)

This patch fixes the NX regression issue observed on amd64 kernels, where
per-page execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).

- replace cpu_feature and ci_feature_flags variables by cpu_feature and
ci_feat_val arrays. This makes it cleaner and brings kernel code closer
to the design of cpuctl(8). A warning will be raised for each CPU that
does not expose the same features as the Boot Processor (BP).

- the blacklist of CPU features is now a macro defined in the
specialreg.h header, instead of hardcoding it inside MD initialization
code; fix comments.

- replace checks against CPUID_TSC with the cpu_hascounter() function.

- clean up the code in init_x86_64(), as cpu_feature variables are set
inside cpu_probe().

- use cpu_init_msrs() for i386. It will be eventually used later for NX
feature under i386 PAE kernels.

- remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already
performed by cpu_hatch() through cpu_init_msrs().

- remove cpu_signature and feature_flags members from struct mpbios_proc
(they were never used).

This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under
a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines.

XXX Should kernel rev be bumped?

XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Mar 31 19:07:32 2010 UTC (3 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.105: +6 -6 lines
Diff to previous 1.105 (colored)

KNF FTW

Revision 1.105 / (download) - annotate - [select for diffs], Fri Feb 26 19:25:07 2010 UTC (3 years, 2 months ago) by jym
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.104: +23 -23 lines
Diff to previous 1.104 (colored)

Fixes regarding paddr_t/pd_entry_t types in MD x86 code, exposed by PAE:

- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.

- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)

- remove casts that are no more needed now that Xen2 support has been dropped

Some fixes are from jmorse@ patches for PAE.

Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.

Reviewed by bouyer@.

See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html

Revision 1.104 / (download) - annotate - [select for diffs], Tue Feb 16 00:48:17 2010 UTC (3 years, 3 months ago) by jym
Branch: MAIN
Changes since 1.103: +30 -25 lines
Diff to previous 1.103 (colored)

- re-factor code in pmap_map_ptes() slightly, and make it PAE-ready for
native i386 by using PDP_SIZE

- introduce pmap_unmap_apdp(), used to clear the APDP entries in PD, and
replace the relevant code parts with this function.

Comes from Jeremy Morse's patch for i386 PAE support. Adjustments by me.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Feb 12 01:55:45 2010 UTC (3 years, 3 months ago) by jym
Branch: MAIN
Changes since 1.102: +2 -7 lines
Diff to previous 1.102 (colored)

Starting with Xen 3 API, MMU_EXTENDED_COMMAND (tlb flush, cache flush, page
pinning/unpinning, set_ldt, invlpg) operations cannot be queued in the
xpq_queue[] any more, as they use their own specific hypercall, mmuext_op().

Their associated xpq_queue_*() functions already call xpq_flush_queue()
before issuing the mmuext_op() hypercall, which makes these xpq_flush_queue()
calls not necessary.

Rapidly discussed with bouyer@ in private mail. XEN3_DOM0/XEN3PAE_DOM0 tested
through a build.sh release, amd64 was only compile tested. No regression
expected.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Feb 10 00:39:30 2010 UTC (3 years, 3 months ago) by jym
Branch: MAIN
Changes since 1.101: +4 -3 lines
Diff to previous 1.101 (colored)

To properly account for the total number of pages allocated for PDP, use
PDP_SIZE, as PAE (i386) requires 4 pages instead of 1.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Feb 9 22:51:14 2010 UTC (3 years, 3 months ago) by jym
Branch: MAIN
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

Fix typos in comments.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 31 00:43:37 2010 UTC (3 years, 3 months ago) by hubertf
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

Replace more printfs with aprint_normal / aprint_verbose
Makes "boot -z" go mostly silent for me.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Jan 10 12:10:23 2010 UTC (3 years, 4 months ago) by jym
Branch: MAIN
Changes since 1.98: +2 -6 lines
Diff to previous 1.98 (colored)

Simplify pmap_init_tmp_pgtbl() a bit.

The first level of the temporary page mappings are also done in the first
iteration of the loop below, so no need to do it before.

ok by joerg@ in private mail.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Nov 25 14:28:50 2009 UTC (3 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored)

Remove IPL_LPT and IPL_IPI aliases, use the actual IPLs.
Fix some broken comments.

Revision 1.97 / (download) - annotate - [select for diffs], Sat Nov 21 03:11:01 2009 UTC (3 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.96: +9 -9 lines
Diff to previous 1.96 (colored)

Use lwp_getpcb() on x86 MD code, clean from struct user usage.

Revision 1.96 / (download) - annotate - [select for diffs], Sat Nov 7 07:32:53 2009 UTC (3 years, 6 months ago) by cegger
Branch: MAIN
Changes since 1.95: +7 -2 lines
Diff to previous 1.95 (colored)

Implement pmap_kenter_pa(9) new flag argument in x86.
Make x86 bus_space(9) using it to eliminate an extra TLB flush.
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
Thanks to Martin Husemann for spotting copy&pasto errors in the original patch version.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Nov 7 07:27:49 2009 UTC (3 years, 6 months ago) by cegger
Branch: MAIN
Changes since 1.94: +7 -7 lines
Diff to previous 1.94 (colored)

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Oct 22 19:50:56 2009 UTC (3 years, 7 months ago) by rmind
Branch: MAIN
Changes since 1.93: +9 -32 lines
Diff to previous 1.93 (colored)

Simplify pmap_remove() a little by avoiding pmap_do_remove() layer, since
possibility to skip wired mappings is not needed anymore.  Apart from that,
no functional differences are intended.

Revision 1.93 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:04 2009 UTC (3 years, 7 months ago) by rmind
Branch: MAIN
Changes since 1.92: +4 -28 lines
Diff to previous 1.92 (colored)

Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Oct 19 18:41:10 2009 UTC (3 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.91: +2 -7 lines
Diff to previous 1.91 (colored)

Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.91 / (download) - annotate - [select for diffs], Mon Aug 17 19:33:07 2009 UTC (3 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.90: +2 -25 lines
Diff to previous 1.90 (colored)

pmap_page_remove(), pmap_test_attrs(), pmap_clear_attrs(): We're passed in
a vm_page, so there is little point in the DIAGNOSTIC test to see that we
have been passed a managed page.

Revision 1.90 / (download) - annotate - [select for diffs], Wed Jul 29 12:02:06 2009 UTC (3 years, 9 months ago) by cegger
Branch: MAIN
Changes since 1.89: +5 -5 lines
Diff to previous 1.89 (colored)

remove Xen2 support.
ok bouyer@

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jul 23 15:26:20 2009 UTC (3 years, 10 months ago) by jym
Branch: MAIN
CVS Tags: jymxensuspend-base
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored)

Fix typos in comments and __PRINTKs.

Revision 1.88 / (download) - annotate - [select for diffs], Sun Jul 19 15:17:29 2009 UTC (3 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.87: +4 -4 lines
Diff to previous 1.87 (colored)

pmap_emap_sync: add an argument, and do not perform pmap_load() during
context switch (pmap_destroy() path seems to be unsafe), instead just
perform tlbflush().  Slightly inefficient, but good enough for now.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jul 19 10:09:11 2009 UTC (3 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.86: +4 -4 lines
Diff to previous 1.86 (colored)

remove unnecessary casts.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Jun 28 15:18:50 2009 UTC (3 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6
Changes since 1.85: +73 -4 lines
Diff to previous 1.85 (colored)

Ephemeral mapping (emap) implementation.  Concept is based on the idea that
activity of other threads will perform the TLB flush for the processes using
emap as a side effect.  To track that, global and per-CPU generation numbers
are used.  This idea was suggested by Andrew Doran; various improvements to
it by me.  Notes:

- For now, zero-copy on pipe is not yet enabled.
- TCP socket code would likely need more work.
- Additional UVM loaning improvements are needed.

Proposed on <tech-kern>, silence there.
Quickly reviewed by <ad>.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Apr 23 12:18:41 2009 UTC (4 years, 1 month ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

pool uses signed int for flags.
undo the int -> u_int change for pmap_pdp_alloc to unbreak the PAE build.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Apr 21 21:30:01 2009 UTC (4 years, 1 month ago) by cegger
Branch: MAIN
Changes since 1.83: +12 -12 lines
Diff to previous 1.83 (colored)

change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@

Revision 1.83 / (download) - annotate - [select for diffs], Sat Apr 18 08:51:45 2009 UTC (4 years, 1 month ago) by cegger
Branch: MAIN
Changes since 1.82: +4 -2 lines
Diff to previous 1.82 (colored)

Introduce PMAP_NOCACHE as first PMAP MD bit in x86. Make use of it in pmap_enter().
This safes one extra TLB flush when mapping dma-safe memory.
Presented on tech-kern@, port-i386@ and port-amd64@
ok ad@

Revision 1.82 / (download) - annotate - [select for diffs], Sat Mar 21 22:55:08 2009 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.81: +16 -3 lines
Diff to previous 1.81 (colored)

Add 2 event counters:

"x86", "io bitmap copy"
"x86", "ldt sync"

Revision 1.81 / (download) - annotate - [select for diffs], Sat Mar 21 14:48:02 2009 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.80: +3 -3 lines
Diff to previous 1.80 (colored)

Correction to previous.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Mar 21 14:41:30 2009 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.79: +74 -49 lines
Diff to previous 1.79 (colored)

PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash

Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
   is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Mar 14 15:36:15 2009 UTC (4 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.78: +3 -6 lines
Diff to previous 1.78 (colored)

Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)

Revision 1.78 / (download) - annotate - [select for diffs], Tue Feb 17 00:09:50 2009 UTC (4 years, 3 months ago) by cegger
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.77: +2 -4 lines
Diff to previous 1.77 (colored)

nuke unused global variable

Revision 1.77 / (download) - annotate - [select for diffs], Thu Dec 18 12:18:20 2008 UTC (4 years, 5 months ago) by cegger
Branch: MAIN
CVS Tags: mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.76: +2 -3 lines
Diff to previous 1.76 (colored)

remove unused malloc.h

Revision 1.76 / (download) - annotate - [select for diffs], Wed Dec 10 11:10:20 2008 UTC (4 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

Make kernel_pmap_ptr a const.  Requested by steve_martin.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Dec 9 20:45:46 2008 UTC (4 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.74: +4 -3 lines
Diff to previous 1.74 (colored)

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 1.74 / (download) - annotate - [select for diffs], Sat Oct 25 14:16:35 2008 UTC (4 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

pmap_page_remove: remove an unnecessary initialization.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Jul 16 18:56:34 2008 UTC (4 years, 10 months ago) by drochner
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, matt-mips64-base2, haad-dm-base1
Changes since 1.72: +4 -2 lines
Diff to previous 1.72 (colored)

add a KASSERT to check the protection bits before using as array index

Revision 1.72 / (download) - annotate - [select for diffs], Wed Jul 16 03:22:04 2008 UTC (4 years, 10 months ago) by chs
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

in pmap_map(), use pmap_kenter_pa() instead of pmap_enter()
so that we don't need to allocate memory to create the mapping.
this should help with getting crash dumps more reliably.

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jun 24 10:00:26 2008 UTC (4 years, 10 months ago) by gmcgarry
Branch: MAIN
Branch point for: haad-dm
Changes since 1.70: +7 -5 lines
Diff to previous 1.70 (colored)

Move #ifdef/#endif outside macro arguments.  Fixes compile with pcc.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jun 23 14:47:51 2008 UTC (4 years, 10 months ago) by reinoud
Branch: MAIN
Changes since 1.69: +10 -10 lines
Diff to previous 1.69 (colored)

Fix pmap.c compilation issues when PMAP_FORK is defined. The locking code was not adapted to the indexing of pmap->pm_obj[]

Revision 1.69 / (download) - annotate - [select for diffs], Mon Jun 16 10:31:03 2008 UTC (4 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.68: +46 -23 lines
Diff to previous 1.68 (colored)

Make pmap_extract() lockless. Reviewed by chs@ who reports a ~1% reduction
in system time during a kernel build on a quad core amd64 system.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jun 6 05:45:16 2008 UTC (4 years, 11 months ago) by cegger
Branch: MAIN
Branch point for: simonb-wapbl
Changes since 1.67: +7 -5 lines
Diff to previous 1.67 (colored)

make this build for xen

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jun 5 21:09:12 2008 UTC (4 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.66: +99 -57 lines
Diff to previous 1.66 (colored)

pmap_remove_all() for x86. Also, always defer freeing ptps to pmap_update().
There may be a better way to do this, but for now this is simple and avoids
potential bugs.

Proposed on tech-kern and discussed with chs@.

Revision 1.66 / (download) - annotate - [select for diffs], Mon Jun 2 19:18:12 2008 UTC (4 years, 11 months ago) by drochner
Branch: MAIN
CVS Tags: yamt-pf42-base3
Changes since 1.65: +5 -5 lines
Diff to previous 1.65 (colored)

make the kernel survive its own KASSERTs (on i386)

Revision 1.65 / (download) - annotate - [select for diffs], Mon Jun 2 14:41:41 2008 UTC (4 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.64: +32 -18 lines
Diff to previous 1.64 (colored)

- Don't bother using sse to copy/zero pages on demand.  It turns out not
  to be worth it.
- If the machine has sse, re-enable zeroing pages in the idle loop and
  use the sse instructions so that we don't blow out the cache.

Revision 1.64 / (download) - annotate - [select for diffs], Wed May 28 11:50:01 2008 UTC (4 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.63: +7 -7 lines
Diff to previous 1.63 (colored)

Remove X86_MAXPROCS. There is still a 32-cpu limit, but it's now using
the MI constants.

Revision 1.63 / (download) - annotate - [select for diffs], Sun May 25 16:01:29 2008 UTC (4 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.62: +2 -5 lines
Diff to previous 1.62 (colored)

remove unused macros.

Revision 1.62 / (download) - annotate - [select for diffs], Tue May 20 09:29:33 2008 UTC (5 years ago) by dogcow
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.61: +2 -8 lines
Diff to previous 1.61 (colored)

due to changes in KERN_UNLOCK_ALL, now always define hold_count.

Revision 1.61 / (download) - annotate - [select for diffs], Sun May 11 16:17:38 2008 UTC (5 years ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Changes since 1.60: +4 -2 lines
Diff to previous 1.60 (colored)

Disable preemption across LDT mods.

Revision 1.60 / (download) - annotate - [select for diffs], Sun May 11 15:59:51 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.59: +3 -4 lines
Diff to previous 1.59 (colored)

Stop using APIC IDs to identify CPUs for software purposes. Allows for
APIC IDs beyond 31, which has been possible for some time now.

Revision 1.59 / (download) - annotate - [select for diffs], Sat May 3 02:56:13 2008 UTC (5 years ago) by ad
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.58: +0 -24 lines
Diff to previous 1.58 (colored)

Back out previous which was not thought through properly.

Revision 1.58 / (download) - annotate - [select for diffs], Sat May 3 00:21:35 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.57: +26 -2 lines
Diff to previous 1.57 (colored)

Implement pmap_remove_all().

Revision 1.57 / (download) - annotate - [select for diffs], Fri May 2 15:26:39 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.56: +9 -3 lines
Diff to previous 1.56 (colored)

- Give x86 BIOS boot the ability to load new style modules and pass them
  into the kernel. Based on a patch by jmcneill@, with many fixes and
  improvements by me.

- Put MEMORY_DISK_DYNAMIC and MODULAR into the GENERIC kernels, so that
  you can load miniroot.kmod from the boot blocks and boot into the
  installer!

Revision 1.56 / (download) - annotate - [select for diffs], Tue Apr 29 00:44:58 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)

Oops... EVCNT_TYPE_IPI -> EVCNT_TYPE_INTR.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Apr 28 23:00:22 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored)

Don't count many items as EVCNT_TYPE_INTR because they clutter up the
systat vmstat display.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Apr 28 17:18:19 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.53: +3 -4 lines
Diff to previous 1.53 (colored)

Stray kpreempt_disable with no matching kpreempt_enable.

Revision 1.53 / (download) - annotate - [select for diffs], Sun Apr 27 22:41:15 2008 UTC (5 years ago) by ad
Branch: MAIN
Changes since 1.52: +14 -8 lines
Diff to previous 1.52 (colored)

Sprinkle more assertions / preemption paranoia.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Apr 27 11:37:48 2008 UTC (5 years ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.51: +89 -49 lines
Diff to previous 1.51 (colored)

- Rename crit_enter/crit_exit to kpreempt_disable/kpreempt_enable.
  DragonflyBSD uses the crit names for something quite different.
- Add a kpreempt_disabled function for diagnostic assertions.
- Add inline versions of kpreempt_enable/kpreempt_disable for primitives.
- Make some more changes for preemption safety to the x86 pmap.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Apr 18 15:49:39 2008 UTC (5 years, 1 month ago) by cegger
Branch: MAIN
Changes since 1.50: +6 -10 lines
Diff to previous 1.50 (colored)

Make this build on Xen and MULTIPROCESSOR.
OK bouyer

Revision 1.50 / (download) - annotate - [select for diffs], Wed Apr 16 16:06:52 2008 UTC (5 years, 1 month ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-pf42-X
Branch point for: yamt-pf42
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

- use aprint_*_dev and device_xname
- use POSIX integer types

Revision 1.49 / (download) - annotate - [select for diffs], Sat Feb 16 22:01:16 2008 UTC (5 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, ad-socklock-base1
Branch point for: mjf-devfs2
Changes since 1.48: +10 -6 lines
Diff to previous 1.48 (colored)

Minor optimisation: for Xen amd64, copy to kernel map only the entries from
user map that are needed.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Feb 7 14:37:40 2008 UTC (5 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.47: +35 -27 lines
Diff to previous 1.47 (colored)

constify.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Jan 31 09:57:27 2008 UTC (5 years, 3 months ago) by wiz
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Fix typo in comment.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jan 30 13:28:29 2008 UTC (5 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.45: +17 -7 lines
Diff to previous 1.45 (colored)

pmap_page_remove: add a reference to the pmap earlier and comment why.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Jan 30 13:26:09 2008 UTC (5 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.44: +10 -6 lines
Diff to previous 1.44 (colored)

pmap_remove_ptes, pmap_remove_pte: fix a panic seen on pkgbuild,
reported by S.P.Zeidler.
after recent locking changes, these assertions are no longer true.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jan 28 11:06:43 2008 UTC (5 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.43: +22 -25 lines
Diff to previous 1.43 (colored)

save a word in pv_entry by making pv_hash SLIST.

although this can slow down pmap_sync_pv if hash lists get long,
we should keep them short anyway.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jan 24 13:55:09 2008 UTC (5 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Fix bad cut'n'paste from bouyer-xeni386, restore use of pool_cache_put()
instead of pool_cache_destruct_object(). Pointed out by yamt@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jan 23 19:46:45 2008 UTC (5 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.41: +208 -65 lines
Diff to previous 1.41 (colored)

Merge the bouyer-xeni386 branch. This brings in PAE support to NetBSD xeni386
(domU only). PAE support is enabled by 'options PAE', see the new XEN3PAE_DOMU
and INSTALL_XEN3PAE_DOMU kernel config files.

See the comments in arch/i386/include/{pte.h,pmap.h} to see how it works.
In short, we still handle it as a 2-level MMU, with the second level page
directory being 4 pages in size. pmap switching is done by switching the
L2 pages in the L3 entries, instead of loading %cr3. This is almost required
by Xen, which handle the last L2 page (the one mapping 0xc0000000 - 0xffffffff)
in a very special way. But this approach should also work for native PAE
support if ever supported (in fact, the pmap should almost suport native
PAE, what's missing is bootstrap code in locore.S).

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 20 22:41:55 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase
Changes since 1.40: +35 -15 lines
Diff to previous 1.40 (colored)

pmap_enter:
- when overwriting an existing mapping for the same page,
  inherit R/M bits so that they won't be lost.
- xen: don't leave ptp on error.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 20 21:56:11 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

pmap_write_protect: remove an unnecessary volatile.

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jan 20 13:43:38 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: bouyer-xeni386-base
Changes since 1.38: +488 -366 lines
Diff to previous 1.38 (colored)

- rewrite P->V tracking.
	- use a hash rather than SPLAY trees.
	  SPLAY tree is a wrong algorithm to use here.
	  will be revisited if it slows down anything other than
	  micro-benchmarks.
	- optimize the single mapping case (it's a common case) by
	  embedding an entry into mdpage.
	- don't keep a pmap pointer as it can be obtained from ptp.
	  (discussed on port-i386 some years ago.)
	  ideally, a single paddr_t should be enough to describe a pte.
	  but it needs some more thoughts as it can increase computational
	  costs.
- pmap_enter: simplify and fix races with pmap_sync_pv.
- don't bother to lock pm_obj[i] where i > 0, unless DIAGNOSTIC.
- kill mp_link to save space.
- add many KASSERTs.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jan 20 13:16:57 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.37: +4 -3 lines
Diff to previous 1.37 (colored)

pmap_write_protect: fix an assumption in the previous.
a pte can have PG_M even if it currently doesn't have PG_RW.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jan 20 12:58:00 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.36: +21 -14 lines
Diff to previous 1.36 (colored)

pmap_write_protect: remove a redundant tlb shootdown.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jan 18 12:03:32 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.35: +2 -6 lines
Diff to previous 1.35 (colored)

remove stale comments

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jan 18 11:35:49 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

pmap_page_remove: don't bother to find the MIN node where any node is fine.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jan 17 13:26:20 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.33: +12 -9 lines
Diff to previous 1.33 (colored)

pmap_sync_pv, pmap_map_pte: use PTE_BASE if possible.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jan 17 10:19:50 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.32: +23 -9 lines
Diff to previous 1.32 (colored)

pmap_sync_pv:
	- fix "need_shootdown" in the case of retry.
	- add some comments.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 17 10:17:07 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.31: +2 -3 lines
Diff to previous 1.31 (colored)

pmap_clear_attrs: remove a redundant assignment

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jan 17 08:49:52 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.30: +100 -108 lines
Diff to previous 1.30 (colored)

- reduce the number of atomic ops in some cases.
- reduce code duplications.
- fix the "pte == 0" assersion failure in pmap_tlb_shootdown.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jan 15 22:08:33 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.29: +2 -6 lines
Diff to previous 1.29 (colored)

update comments

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jan 15 12:00:01 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.28: +6 -4 lines
Diff to previous 1.28 (colored)

pmap_unmap_ptp: save some hypercalls for xen.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jan 15 11:12:03 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.27: +184 -111 lines
Diff to previous 1.27 (colored)

- use cpu-local temporary mapping for P->V operations and kill pmap_main_lock.
  fixes a part of PR/37193 from Andrew Doran.
- use pmap_stats_update_bypte in some more places.

some comments and fixes from Andrew Doran and Manuel Bouyer.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 13 11:34:18 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

pmap_extract_ma: fix a missing pmap_unmap_ptes.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jan 13 07:26:32 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.25: +41 -37 lines
Diff to previous 1.25 (colored)

add functions to update pm_stats and use them in some places.
for pmap_kernel(), use atomic ops to update stats because pmap_map_ptes
doesn't lock the pmap.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 12 09:10:24 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

revert a whitespace change which is against KNF.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 11 20:00:17 2008 UTC (5 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.23: +97 -67 lines
Diff to previous 1.23 (colored)

Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
  pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
  the build will find them via the xen-ma/machine link.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Jan 9 11:13:16 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.22: +2 -5 lines
Diff to previous 1.22 (colored)

remove now unused variable.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jan 8 22:24:10 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.21: +2 -12 lines
Diff to previous 1.21 (colored)

kill unused PMF_USER_RELOAD.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jan 8 22:22:30 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.20: +18 -14 lines
Diff to previous 1.20 (colored)

pmap_map_ptes: fix a access-after-free bug.
add a reference on ci->ci_pmap before acquiring locks, so that it won't
disappear while we are blocking on the locks.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 4 15:55:30 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.19: +9 -6 lines
Diff to previous 1.19 (colored)

i386:
	- make tss per-cpu.  this considerably speeds up context switch for,
	  at least, pentium4, where ltr instruction seems very slow.
i386, xen:
	- kill cpu_maxproc.
kvm86:
	- adapt to per-cpu tss.
	- cleanup and simplify.
	- move kvm86_mp_lock to more meaningful place.
	- disable preemption during a call.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 2 17:33:08 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.18: +6 -6 lines
Diff to previous 1.18 (colored)

pmap_extract_ma:
	- TRUE/FALSE -> true/false
	- (P == FALSE) -> (!P)

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jan 2 12:31:32 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

make pmap_pv_cache static.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jan 2 12:30:31 2008 UTC (5 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.16: +2 -32 lines
Diff to previous 1.16 (colored)

g/c pv_page stuffs.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jan 2 11:48:33 2008 UTC (5 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.15: +2 -20 lines
Diff to previous 1.15 (colored)

Merge vmlocking2 to head.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 20 23:46:11 2007 UTC (5 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.14: +14 -23 lines
Diff to previous 1.14 (colored)

- Make __cpu_simple_lock and similar real functions and patch at runtime.
- Remove old x86 atomic ops.
- Drop text alignment back to 16 on i386 (really, this time).
- Minor cleanup.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Dec 13 21:22:15 2007 UTC (5 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.13: +66 -36 lines
Diff to previous 1.13 (colored)

Reorder some operations for better handling of failures in
xpq_update_foreign(). Note that this also affects native operations, but it
shoulnd't cause problems even for SMP system. Proposed on port-amd64@ and
port-i386@

Don't invalidate the recursive PTE entry in user pmap when switching from
kernel to userland on Xen/amd64. This effectively means that a userland
process can read its own page tables (no write, of course) on Xen/amd64, but
it shouldn't cause security issue (discussed on tech-kern@ some time ago).
This makes NetBSD Xen/amd64 more than 10x faster
building pkgsrc/pkgtools/digest

Revision 1.13 / (download) - annotate - [select for diffs], Sun Dec 9 20:27:51 2007 UTC (5 years, 5 months ago) by jmcneill
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.12: +66 -2 lines
Diff to previous 1.12 (colored)

Merge jmcneill-pm branch.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Dec 9 15:31:03 2007 UTC (5 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: jmcneill-pm-base
Changes since 1.11: +6 -6 lines
Diff to previous 1.11 (colored)

Minor correction to previous.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Dec 9 15:29:53 2007 UTC (5 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.10: +11 -11 lines
Diff to previous 1.10 (colored)

- pmap_reactivate: save an atomic op if possible.
- pmap_tlb_shootdown: use atomic ops instead of _lock_cas().

Revision 1.10 / (download) - annotate - [select for diffs], Wed Nov 28 16:28:44 2007 UTC (5 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base
Branch point for: yamt-kmem, vmlocking2
Changes since 1.9: +7 -7 lines
Diff to previous 1.9 (colored)

Use the new atomic ops.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Nov 23 16:33:25 2007 UTC (5 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.8: +11 -7 lines
Diff to previous 1.8 (colored)

Put back part of revision 1.1.4.8: the L4 page has to be pinned as L4
before before being mapped by APDP_PDE.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Nov 22 16:17:12 2007 UTC (5 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.7: +593 -70 lines
Diff to previous 1.7 (colored)

Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Nov 18 18:09:10 2007 UTC (5 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.6: +3 -6 lines
Diff to previous 1.6 (colored)

#include <sys/atomic.h> instead of local prototypes.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Nov 14 17:55:00 2007 UTC (5 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.5: +4 -10 lines
Diff to previous 1.5 (colored)

- Remove I486_CPU, I586_CPU, I686_CPU options. They buy us nothing and
  clutter the code significantly.
- Remove pccons.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Nov 11 01:30:55 2007 UTC (5 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.4: +4 -10 lines
Diff to previous 1.4 (colored)

pmap_load: pmap_reference() can no longer block.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Nov 10 20:06:25 2007 UTC (5 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.3: +13 -14 lines
Diff to previous 1.3 (colored)

- When computing the TSC frequency, call i8254_delay() and not DELAY().
- Use atomics to adjust the pmap reference count, instead of taking locks.
- Implement I386_{SET,GET}_{FS,GS}BASE, allowing %fs and %gs to be used
  as per-thread registers. This is compatible with FreeBSD.
- Run patches after we have attached CPUs, since we then know if the
  system is uniprocessor or not. Eliminates a lot of #ifdef MULTIPROCESSOR
  and makes running MP kernels on UP systems cheaper.
- Patch out many of the 'lock' prefixes to nops if uniprocessor.
- Do a wbinvd after patching to ensure that the trace/instruction cache
  is up to date.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:17 2007 UTC (5 years, 6 months ago) by ad
Branch: MAIN
Changes since 1.2: +47 -348 lines
Diff to previous 1.2 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Oct 18 15:28:38 2007 UTC (5 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: jmcneill-base
Branch point for: yamt-lazymbuf, vmlocking, mjf-devfs, matt-armv6, jmcneill-pm
Changes since 1.1: +3987 -0 lines
Diff to previous 1.1 (colored)

merge yamt-x86pmap branch.

- reduce differences between amd64 and i386.  notably, share pmap.c
  between them.  it makes several i386 pmap improvements available to
  amd64, including tlb shootdown reduction and bug fixes from Stephan Uphoff.
- implement deferred pmap switching for amd64.
- remove LARGEPAGES option.  always use large pages if available.
  also, make it work on amd64.

Revision 1.1, Sat Sep 29 08:26:33 2007 UTC (5 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, vmlocking-base
Branch point for: yamt-x86pmap, bouyer-xenamd64
FILE REMOVED

file pmap.c was initially added on branch yamt-x86pmap.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>