The NetBSD Project

CVS log for src/sys/arch/x86/include/pmap.h

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.134 / (download) - annotate - [select for diffs], Sat Aug 20 23:49:31 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.133: +1 -68 lines
Diff to previous 1.133 (colored) to selected 1.2.4.6 (colored)

x86: Move definition of struct pmap to pmap_private.h.

This makes pmap_resident_count and pmap_wired_count out-of-line
functions instead of inline.  No functional change intended
otherwise.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Aug 20 23:48:50 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.132: +2 -231 lines
Diff to previous 1.132 (colored) to selected 1.2.4.6 (colored)

x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
   further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3.  Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.

Revision 1.132 / (download) - annotate - [select for diffs], Sat Aug 20 23:18:51 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.131: +1 -36 lines
Diff to previous 1.131 (colored) to selected 1.2.4.6 (colored)

x86: Move pl*_i, pl_i_roundup, and ptp_va2o out of x86/pmap.h.

- pl[1-4]_i -> x86/pte.h
- pl_i, pl_i_roundup, ptp_va2o -> x86/pmap.c

Revision 1.131 / (download) - annotate - [select for diffs], Sat Aug 20 23:18:20 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.130: +10 -1 lines
Diff to previous 1.130 (colored) to selected 1.2.4.6 (colored)

x86: Move struct vm_page_md to common x86/pmap.h.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Aug 20 23:15:37 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.129: +1 -44 lines
Diff to previous 1.129 (colored) to selected 1.2.4.6 (colored)

x86: Split bootspace out of x86/pmap.h into new x86/bootspace.h.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Aug 20 23:13:51 2022 UTC (19 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.128: +1 -9 lines
Diff to previous 1.128 (colored) to selected 1.2.4.6 (colored)

x86: Move page attribute table bits to x86/pat.h.

Revision 1.128 / (download) - annotate - [select for diffs], Sat Jun 18 22:11:01 2022 UTC (22 months ago) by andvar
Branch: MAIN
Changes since 1.127: +2 -2 lines
Diff to previous 1.127 (colored) to selected 1.2.4.6 (colored)

fix typos in word "functions" in comments, mainly s/fuctions/functions/.

Revision 1.125.6.1 / (download) - annotate - [select for diffs], Thu May 13 00:47:29 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.125: +2 -8 lines
Diff to previous 1.125 (colored) next main 1.126 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Apr 30 13:54:26 2021 UTC (2 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.126: +2 -8 lines
Diff to previous 1.126 (colored) to selected 1.2.4.6 (colored)

Merge the x86 gdt function and constant definitions

Revision 1.126 / (download) - annotate - [select for diffs], Fri Apr 30 01:09:29 2021 UTC (2 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored) to selected 1.2.4.6 (colored)

Bump MAX_USERLDT_SIZE to the max size (wastes some memory). wine needs more
than PAGE_SIZE and fails spuriously.
XXX: Note the duplicate definition hacks. Should really create <x86/gdt.h>,
put the just the constants there and unify them.
This would also avoid the hack in: src/tests/lib/libi386/t_user_ldt.c#46

Revision 1.125 / (download) - annotate - [select for diffs], Sun Jul 19 07:35:08 2020 UTC (3 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs
Branch point for: thorpej-i2c-spi-conf
Changes since 1.124: +2 -2 lines
Diff to previous 1.124 (colored) to selected 1.2.4.6 (colored)

Revert most of ad's movs/stos change. Instead do a lot simpler: declare
svs_quad_copy() used by SVS only, with no need for instrumentation, because
SVS is disabled when sanitizers are on.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Jul 14 00:45:53 2020 UTC (3 years, 9 months ago) by yamaguchi
Branch: MAIN
Changes since 1.123: +2 -2 lines
Diff to previous 1.123 (colored) to selected 1.2.4.6 (colored)

Introduce per-cpu IDTs

This is realized by following modifications:
- Add IDT pages and its allocation maps for each cpu in "struct cpu_info"
- Load per-cpu IDTs at cpu_init_idt(struct cpu_info*)
- Copy the IDT entries for cpu0 to other CPUs at attach
   - These are, for example, exceptions, db, system calls, etc.

And, added a kernel option named PCPU_IDT to enable the feature.

Revision 1.123 / (download) - annotate - [select for diffs], Wed Jun 24 18:09:37 2020 UTC (3 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.122: +1 -2 lines
Diff to previous 1.122 (colored) to selected 1.2.4.6 (colored)

remove unused x86_stos

Revision 1.101.2.1 / (download) - annotate - [select for diffs], Sun May 31 10:39:34 2020 UTC (3 years, 10 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored) next main 1.102 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #935):

	sys/arch/xen/x86/x86_xpmap.c: revision 1.89
	sys/arch/x86/include/pmap.h: revision 1.121
	sys/arch/xen/xen/privcmd.c: revision 1.58
	sys/external/mit/xen-include-public/dist/xen/include/public/memory.h: revision 1.2
	sys/arch/xen/include/xenpmap.h: revision 1.44
	sys/arch/xen/include/xenio.h: revision 1.12
	sys/arch/x86/x86/pmap.c: revision 1.394
	(all via patch)

Ajust pmap_enter_ma() for upcoming new Xen privcmd ioctl:
pass flags to xpq_update_foreign()

Introduce a pmap MD flag: PMAP_MD_XEN_NOTR, which cause xpq_update_foreign()
to use the MMU_PT_UPDATE_NO_TRANSLATE flag.
make xpq_update_foreign() return the raw Xen error. This will cause
pmap_enter_ma() to return a negative error number in this case, but the
only user of this code path is privcmd.c and it can deal with it.

Add pmap_enter_gnt()m which maps a set of Xen grant entries at the
specified va in the specified pmap. Use the hooks implemented for EPT to
keep track of mapped grand entries in the pmap, and unmap them
when pmap_remove() is called. This requires pmap_remove() to be split
into a pmap_remove_locked(), to be called from pmap_remove_gnt().

Implement new ioctl, needed by Xen 4.13:
IOCTL_PRIVCMD_MMAPBATCH_V2
IOCTL_PRIVCMD_MMAP_RESOURCE
IOCTL_GNTDEV_MMAP_GRANT_REF
IOCTL_GNTDEV_ALLOC_GRANT_REF

Always enable declarations needed by privcmd.c

Revision 1.122 / (download) - annotate - [select for diffs], Wed May 27 19:33:40 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.121: +4 -10 lines
Diff to previous 1.121 (colored) to selected 1.2.4.6 (colored)

- Add a couple of wrapper functions around STOS and MOVS and use them to zero
  and copy PTEs in preference to memset()/memcpy().

- Remove related SSE / pageidlezero stuff.

Revision 1.121 / (download) - annotate - [select for diffs], Tue May 26 10:10:31 2020 UTC (3 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored) to selected 1.2.4.6 (colored)

Ajust pmap_enter_ma() for upcoming new Xen privcmd ioctl:
pass flags to xpq_update_foreign()
Introduce a pmap MD flag: PMAP_MD_XEN_NOTR, which cause xpq_update_foreign()
to use the MMU_PT_UPDATE_NO_TRANSLATE flag.
make xpq_update_foreign() return the raw Xen error. This will cause
pmap_enter_ma() to return a negative error number in this case, but the
only user of this code path is privcmd.c and it can deal with it.

Add pmap_enter_gnt()m which maps a set of Xen grant entries at the
specified va in the specified pmap. Use the hooks implemented for EPT to
keep track of mapped grand entries in the pmap, and unmap them
when pmap_remove() is called. This requires pmap_remove() to be split
into a pmap_remove_locked(), to be called from pmap_remove_gnt().

Revision 1.120 / (download) - annotate - [select for diffs], Fri May 8 00:49:42 2020 UTC (3 years, 11 months ago) by riastradh
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored) to selected 1.2.4.6 (colored)

Factor randomization out of slotspace_rand.

slotspace_rand becomes deterministic; the randomization moves into
the callers instead.  Why?

There are two callers of slotspace_rand:

- x86/pmap.c pmap_bootstrap
- amd64/amd64.c init_slotspace

When the randomization was introduced, it used an x86-only
`cpu_earlyrng' abstraction that would hash rdseed/rdrand and rdtsc
output together.  Except init_slotspace ran before cpu_probe, so
cpu_feature was not yet filled out, so during init_slotspace, the
only randomization was rdtsc.

In the course of the recent entropy overhaul, I replaced cpu_earlyrng
by entropy_extract, and moved cpu_init_rng much earlier -- but still
after cpu_probe -- in order to reduce the number of abstractions
lying around and the number of copies of rdrand/rdseed logic.  In so
doing I added some annoying complication (see curcpu_available) to
kern_entropy.c to make it work early enough for init_slotspace, and
dropped the rdtsc.

For pmap_bootstrap that didn't substantively change anything.  But
for init_slotspace, it removed the only randomization.  To mitigate
this, this commit pulls the randomization out of slotspace_rand into
pmap_bootstrap and init_slotspace, so that

(a) init_slotspace can use rdtsc and a little private entropy pool in
    order to restore the prior (weak) randomization it had, and

(b) pmap_bootstrap, which runs a little bit later, can continue to
    use entropy_extract normally and get rdrand/rdseed too.

A subsequent commit will move cpu_init_rng just a wee bit later,
after cpu_init_msrs, so the kern_entropy.c complications can go away.
Perhaps someone else more wizardly with x86 can find a way to make
init_slotspace run a little later too, after cpu_probe and after
cpu_init_msrs and after cpu_rng_init, but I am not that wizardly.

Revision 1.119 / (download) - annotate - [select for diffs], Sat Apr 25 15:26:18 2020 UTC (3 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.118: +1 -1 lines
Diff to previous 1.118 (colored) to selected 1.2.4.6 (colored)

Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor

Revision 1.117.2.1 / (download) - annotate - [select for diffs], Sat Apr 25 11:23:57 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.117: +8 -3 lines
Diff to previous 1.117 (colored) next main 1.118 (colored) to selected 1.2.4.6 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.118 / (download) - annotate - [select for diffs], Fri Apr 24 16:27:28 2020 UTC (3 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.117: +8 -3 lines
Diff to previous 1.117 (colored) to selected 1.2.4.6 (colored)

Give the ldt a fixed size of one page (512 slots), and drop the variable-
sized mechanism that was too complex.

This fixes a race between USER_LDT and SVS: during context switches, the
way SVS installs the new ldt relies on the ldt pointer AND the ldt size,
but both cannot be accessed atomically at the same time.

Revision 1.80.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:11 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.80.2.2: +12 -10 lines
Diff to previous 1.80.2.2 (colored) to branchpoint 1.80 (colored) next main 1.81 (colored) to selected 1.2.4.6 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.80.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:07:58 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.80.2.1: +24 -20 lines
Diff to previous 1.80.2.1 (colored) to branchpoint 1.80 (colored) to selected 1.2.4.6 (colored)

Merge changes from current as of 20200406

Revision 1.117 / (download) - annotate - [select for diffs], Sun Apr 5 00:21:11 2020 UTC (4 years ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base1, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.116: +4 -1 lines
Diff to previous 1.116 (colored) to selected 1.2.4.6 (colored)

Allocate PV entries in PAGE_SIZE chunks, and cache partially allocated PV
pages with the pmap.  Worth about 2-3% sys time on build.sh for me.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Mar 22 00:16:16 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.115: +5 -8 lines
Diff to previous 1.115 (colored) to selected 1.2.4.6 (colored)

x86 pmap:

- Give pmap_remove_all() its own version of pmap_remove_ptes() that on native
  x86 does the bare minimum needed to clear out PTPs.  Cuts ~4% sys time on
  'build.sh release' for me.

- pmap_sync_pv(): there's no need to issue a redundant TLB shootdown.  The
  caller waits for the competing operation to finish.

- Bring 'options TLBSTATS' up to date.

Revision 1.115 / (download) - annotate - [select for diffs], Tue Mar 17 22:29:19 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.114: +4 -2 lines
Diff to previous 1.114 (colored) to selected 1.2.4.6 (colored)

Hallelujah, the bug has been found.  Resurrect prior changes, to be fixed
with following commit.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Mar 17 21:02:56 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.113: +2 -4 lines
Diff to previous 1.113 (colored) to selected 1.2.4.6 (colored)

Back out the recent pmap changes until I can figure out what is going on
with pmap_page_remove()  (to pmap.c rev 1.365).

Revision 1.113 / (download) - annotate - [select for diffs], Sat Mar 14 18:24:10 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.112: +4 -2 lines
Diff to previous 1.112 (colored) to selected 1.2.4.6 (colored)

PR kern/55071 (Panic shortly after running X11 due to kernel diagnostic assertion "mutex_owned(&pp->pp_lock)")

- Fix a locking bug in pmap_pp_clear_attrs() and in pmap_pp_remove() do the
  TLB shootdown while still holding the target pmap's lock.

Also:

- Finish PV list locking for x86 & update comments around same.

- Keep track of the min/max index of PTEs inserted into each PTP, and use
  that to clip ranges of VAs passed to pmap_remove_ptes().

- Based on the above, implement a pmap_remove_all() for x86 that clears out
  the pmap in a single pass.  Makes exit() / fork() much cheaper.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Mar 14 14:05:44 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored) to selected 1.2.4.6 (colored)

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 1.111 / (download) - annotate - [select for diffs], Tue Mar 10 22:38:41 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.110: +1 -4 lines
Diff to previous 1.110 (colored) to selected 1.2.4.6 (colored)

- pmap_check_inuse() is expensive so make it DEBUG not DIAGNOSTIC.

- Put PV locking back in place with only a minor performance impact.
  pmap_enter() still needs more work - it's not easy to satisfy all the
  competing requirements so I'll do that with another change.

- Use pmap_find_ptp() (lookup only) in preference to pmap_get_ptp() (alloc).
  Make pm_ptphint indexed by VA not PA.  Replace the per-pmap radixtree for
  dynamic PV entries with a per-PTP rbtree.  Cuts system time during kernel
  build by ~10% for me.

Revision 1.108.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:18:33 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.108.2.1: +3 -1 lines
Diff to previous 1.108.2.1 (colored) to branchpoint 1.108 (colored) next main 1.109 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.110 / (download) - annotate - [select for diffs], Sun Feb 23 15:46:39 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.109: +3 -1 lines
Diff to previous 1.109 (colored) to selected 1.2.4.6 (colored)

UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.

Revision 1.108.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:28 2020 UTC (4 years, 3 months ago) by ad
Branch: ad-namecache
Changes since 1.108: +3 -4 lines
Diff to previous 1.108 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.109 / (download) - annotate - [select for diffs], Sun Jan 12 13:01:11 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.108: +3 -4 lines
Diff to previous 1.108 (colored) to selected 1.2.4.6 (colored)

x86 pmap:

- It turns out that every page the pmap frees is necessarily zeroed.  Tell
  the VM system about this and use the pmap as a source of pre-zeroed pages.

- Redo deferred freeing of PTPs more elegantly, including the integration with
  pmap_remove_all().  This fixes problems with nvmm, and possibly also a crash
  discovered during fuzzing.

Reported-by: syzbot+a97186518c84f1d85c0c@syzkaller.appspotmail.com

Revision 1.108 / (download) - annotate - [select for diffs], Sat Jan 4 22:49:20 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.107: +14 -9 lines
Diff to previous 1.107 (colored) to selected 1.2.4.6 (colored)

x86 pmap improvements, reducing system time during a build by about 15% on
my test machine:

- Replace the global pv_hash with a per-pmap record of dynamically allocated
  pv entries.  The data structure used for this can be changed easily, and
  has no special concurrency requirements.  For now go with radixtree.

- Change pmap_pdp_cache back into a pool; cache the page directory with the
  pmap, and avoid contention on pmaps_lock by adjusting the global list in
  the pool_cache ctor & dtor.  Align struct pmap and its lock, and update
  some comments.

- Simplify pv_entry lists slightly.  Allow both PP_EMBEDDED and dynamically
  allocated entries to co-exist on a single page.  This adds a pointer to
  struct vm_page on x86, but shrinks pv_entry to 32 bytes (which also gets
  it nicely aligned).

- More elegantly solve the chicken-and-egg problem introduced into the pmap
  with radixtree lookup for pages, where we need PTEs mapped and page
  allocations to happen under a single hold of the pmap's lock.  While here
  undo some cut-n-paste.

- Don't adjust pmap_kernel's stats with atomics, because its mutex is now
  held in the places the stats are changed.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Dec 15 19:24:11 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.106: +2 -2 lines
Diff to previous 1.106 (colored) to selected 1.2.4.6 (colored)

uvm_pagerealloc() can now block because of radixtree manipulation, so defer
freeing PTPs until pmap_unmap_ptes(), where we still have the pmap locked
but can finally tolerate context switches again.

To be revisited soon: pmap_map_ptes() seems broken WRT other pmap load.

Reported-by: syzbot+689fb7dab41abff8e75a@syzkaller.appspotmail.com
Reported-by: syzbot+3e7bbf37d37d451b25d7@syzkaller.appspotmail.com
Reported-by: syzbot+689fb7dab41abff8e75a@syzkaller.appspotmail.com
Reported-by: syzbot+689fb7dab41abff8e75a@syzkaller.appspotmail.com
Reported-by: syzbot+3e7bbf37d37d451b25d7@syzkaller.appspotmail.com

Revision 1.106 / (download) - annotate - [select for diffs], Sun Dec 8 20:42:48 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.105: +2 -3 lines
Diff to previous 1.105 (colored) to selected 1.2.4.6 (colored)

Merge x86 pmap changes from yamt-pagecache:

- Deal better with the multi-level pmap object locking kludge.
- Handle uvm_pagealloc() being able to block.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Nov 14 16:23:52 2019 UTC (4 years, 5 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.104: +4 -3 lines
Diff to previous 1.104 (colored) to selected 1.2.4.6 (colored)

Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
 - "shad", to track uninitialized memory with a bit granularity (1:1).
   Each bit set to 1 in the shad corresponds to one uninitialized bit of
   real kernel memory.
 - "orig", to track the origin of the memory with a 4-byte granularity
   (1:1). Each uint32_t cell in the orig indicates the origin of the
   associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
 - a code designating the type of memory (Stack, Pool, etc), and
 - a compressed pointer, which points either (1) to a string containing
   the name of the variable associated with the cell, or (2) to an area
   in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.

Revision 1.104 / (download) - annotate - [select for diffs], Wed Nov 13 12:55:10 2019 UTC (4 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.103: +5 -5 lines
Diff to previous 1.103 (colored) to selected 1.2.4.6 (colored)

Rename:
	PP_ATTRS_M -> PP_ATTRS_D
	PP_ATTRS_U -> PP_ATTRS_A
For consistency.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Oct 5 07:30:03 2019 UTC (4 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.102: +5 -5 lines
Diff to previous 1.102 (colored) to selected 1.2.4.6 (colored)

Switch to the new PTE naming. No binary diff (tested with MKREPRO).

Revision 1.102 / (download) - annotate - [select for diffs], Wed Aug 7 06:23:48 2019 UTC (4 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.101: +2 -1 lines
Diff to previous 1.101 (colored) to selected 1.2.4.6 (colored)

Add support for USER_LDT in SVS. This allows us to have both enabled at
the same time.

We allocate an LDT for each CPU in the GDT and map an area for it, in
addition to the default LDT already present. In context switches between
different processes, we choose between the default or the per-cpu LDT
selector: if the user set specific LDT entries, we memcpy them to the
per-cpu LDT and load the per-cpu selector.

Tested by Naveen Narayanan (with Wine on amd64).

Revision 1.80.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:06:53 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.80: +68 -27 lines
Diff to previous 1.80 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.101 / (download) - annotate - [select for diffs], Wed May 29 16:54:41 2019 UTC (4 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: netbsd-9
Changes since 1.100: +4 -1 lines
Diff to previous 1.100 (colored) to selected 1.2.4.6 (colored)

Add PCID support in SVS. This avoids TLB flushes during kernel<->user
transitions, which greatly reduces the performance penalty introduced by
SVS.

We use two ASIDs, 0 (kern) and 1 (user), and use invpcid to flush pages
in both ASIDs.

The read-only machdep.svs.pcid={0,1} sysctl is added, and indicates whether
SVS+PCID is in use.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Mar 10 16:30:01 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.99: +3 -8 lines
Diff to previous 1.99 (colored) to selected 1.2.4.6 (colored)

Two changes:

 * Allow large pages to be passed in pmap_pdes_valid, this happens under
   DDB when it reads RIP (.text), called via pmap_extract.

 * Invert a branch in pmap_extract, so that 'l_cpu' is not touched if we're
   dealing with the kernel pmap.

This fixes 'boot -d'.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Mar 9 08:42:26 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored) to selected 1.2.4.6 (colored)

Start replacing the x86 PTE bits.

Revision 1.98 / (download) - annotate - [select for diffs], Sat Feb 23 10:59:12 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.97: +9 -1 lines
Diff to previous 1.97 (colored) to selected 1.2.4.6 (colored)

Move PATENTRY into pmap.h, will be used outside.

Revision 1.97 / (download) - annotate - [select for diffs], Wed Feb 13 08:38:25 2019 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.96: +3 -1 lines
Diff to previous 1.96 (colored) to selected 1.2.4.6 (colored)

Add the EPT pmap code, used by Intel-VMX.

The idea is that under NVMM, we don't want to implement the hypervisor page
tables manually in NVMM directly, because we want pageable guests; that is,
we want to allow UVM to unmap guest pages when the host comes under
pressure.

Contrary to AMD-SVM, Intel-VMX uses a different set of PTE bits from
native, and this has three important consequences:

 - We can't use the native PTE bits, so each time we want to modify the
   page tables, we need to know whether we're dealing with a native pmap
   or an EPT pmap. This is accomplished with callbacks, that handle
   everything PTE-related.

 - There is no recursive slot possible, so we can't use pmap_map_ptes().
   Rather, we walk down the EPT trees via the direct map, and that's
   actually a lot simpler (and probably faster too...).

 - The kernel is never mapped in an EPT pmap. An EPT pmap cannot be loaded
   on the host. This has two sub-consequences: at creation time we must
   zero out all of the top-level PTEs, and at destruction time we force
   the page out of the pool cache and into the pool, to ensure that a next
   allocation will invoke pmap_pdp_ctor() to create a native pmap and not
   recycle some stale EPT entries.

To create an EPT pmap, the caller must invoke pmap_ept_transform() on a
newly-allocated native pmap. And that's about it, from then on the EPT
callbacks will be invoked, and the pmap can be destroyed via the usual
pmap_destroy(). The TLB shootdown callback is not initialized however,
it is the responsibility of the hypervisor (NVMM) to set it.

There are some twisted cases that we need to handle. For example if
pmap_is_referenced() is called on a physical page that is entered both by
a native pmap and by an EPT pmap, we take the Accessed bits from the
two pmaps using different PTE sets in each case, and combine them into a
generic PP_ATTRS_U flag (that does not depend on the pmap type).

Given that the EPT layout is a 4-Level tree with the same address space as
native x86_64, we allow ourselves to use a few native macros in EPT, such
as pmap_pa2pte(), rather than re-defining them with "ept" in the name.

Even though this EPT code is rather complex, it is not too intrusive: just
a few callbacks in a few pmap functions, predicted-false to give priority
to native. So this comes with no messy #ifdef or performance cost.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Feb 11 14:59:32 2019 UTC (5 years, 2 months ago) by cherry
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored) to selected 1.2.4.6 (colored)

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Feb 1 11:35:13 2019 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.94: +9 -1 lines
Diff to previous 1.94 (colored) to selected 1.2.4.6 (colored)

Add the remaining pmap callbacks, will be used by NVMM-VMX.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Feb 1 05:44:29 2019 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.93: +8 -7 lines
Diff to previous 1.93 (colored) to selected 1.2.4.6 (colored)

Change the format of the pp_attrs field: instead of using PTE bits
directly, use abstracted bits that are converted from/to PTE bits when
needed (in pmap_sync_pv).

This allows us to use the same pp_attrs for pmaps that have PTE bits at
different locations.

Revision 1.76.2.6 / (download) - annotate - [select for diffs], Wed Dec 26 14:01:45 2018 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.76.2.5: +12 -11 lines
Diff to previous 1.76.2.5 (colored) to branchpoint 1.76 (colored) next main 1.77 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.93 / (download) - annotate - [select for diffs], Mon Dec 17 06:58:54 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.92: +3 -1 lines
Diff to previous 1.92 (colored) to selected 1.2.4.6 (colored)

Add two pmap fields, will be used by NVMM-VMX. Also apply a few cosmetic
changes.

Revision 1.92 / (download) - annotate - [select for diffs], Thu Dec 6 17:26:18 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.91: +10 -11 lines
Diff to previous 1.91 (colored) to selected 1.2.4.6 (colored)

Fix inconsistency, these are indexes and not types, no real functional
change.

Revision 1.76.2.5 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:28 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.76.2.4: +9 -3 lines
Diff to previous 1.76.2.4 (colored) to branchpoint 1.76 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.91 / (download) - annotate - [select for diffs], Mon Nov 19 20:44:51 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.90: +3 -1 lines
Diff to previous 1.90 (colored) to selected 1.2.4.6 (colored)

Introduce pl_pi, will be used soon.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Nov 19 20:28:01 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored) to selected 1.2.4.6 (colored)

Rename 'mask' -> 'frame', we will use the real 'mask' soon.

Revision 1.89 / (download) - annotate - [select for diffs], Wed Nov 7 07:14:51 2018 UTC (5 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.88: +5 -1 lines
Diff to previous 1.88 (colored) to selected 1.2.4.6 (colored)

Add two pmap fields, will be used by NVMM.

Revision 1.76.2.4 / (download) - annotate - [select for diffs], Thu Sep 6 06:55:44 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.76.2.3: +11 -13 lines
Diff to previous 1.76.2.3 (colored) to branchpoint 1.76 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.88 / (download) - annotate - [select for diffs], Wed Aug 29 16:26:25 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored) to selected 1.2.4.6 (colored)

clean up a little

Revision 1.87 / (download) - annotate - [select for diffs], Wed Aug 29 06:28:50 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.86: +1 -8 lines
Diff to previous 1.86 (colored) to selected 1.2.4.6 (colored)

Remove the constants of the DMAP, they are unused, and move NL4_SLOT_DIRECT
into amd64/.

Revision 1.86 / (download) - annotate - [select for diffs], Wed Aug 29 06:17:26 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.85: +1 -3 lines
Diff to previous 1.85 (colored) to selected 1.2.4.6 (colored)

Simplify the ASLR stuff, we don't care about resizable areas now, and it
makes the code more complicated for no good reason.

Revision 1.85 / (download) - annotate - [select for diffs], Mon Aug 20 15:04:52 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.84: +6 -3 lines
Diff to previous 1.84 (colored) to selected 1.2.4.6 (colored)

Add support for kASan on amd64. Written by me, with some parts inspired
from Siddharth Muralee's initial work. This feature can detect several
kinds of memory bugs, and it's an excellent feature.

It can be enabled by uncommenting these three lines in GENERIC:

	#makeoptions 	KASAN=1		# Kernel Address Sanitizer
	#options 	KASAN
	#no options	SVS

The kernel is compiled without SVS, without DMAP and without PCPU area.
A shadow area is created at boot time, and it can cover the upper 128TB
of the address space. This area is populated gradually as we allocate
memory. With this design the memory consumption is kept at its lowest
level.

The compiler calls the __asan_* functions each time a memory access is
done. We verify whether this access is legal by looking at the shadow
area.

We declare our own special memcpy/memset/etc functions, because the
compiler's builtins don't add the __asan_* instrumentation.

Initially all the mappings are marked as valid. During dynamic
allocations, we add a redzone, which we mark as invalid. Any access on
it will trigger a kASan error message. Additionally, the compiler adds
a redzone on global variables, and we mark these redzones as invalid too.
The illegal-access detection works with a 1-byte granularity.

For now, we cover three areas:

	- global variables
	- kmem_alloc-ated areas
	- malloc-ated areas

More will come, but that's a good start.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Aug 12 13:31:16 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored) to selected 1.2.4.6 (colored)

Move the PCPU area from slot 384 to slot 510, to avoid creating too much
fragmentation in the slot space (384 is in the middle of the kernel half
of the VA).

Revision 1.83 / (download) - annotate - [select for diffs], Sun Aug 12 10:50:35 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.82: +3 -1 lines
Diff to previous 1.82 (colored) to selected 1.2.4.6 (colored)

Randomize the main memory on Xen, same as native. Tested on amd64-dom0.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Aug 12 09:05:52 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.81: +4 -3 lines
Diff to previous 1.81 (colored) to selected 1.2.4.6 (colored)

Add a new area, SLAREA_HYPV, which indicates the slots used by the
hypervisor, in our case Xen.

Revision 1.76.2.3 / (download) - annotate - [select for diffs], Sat Jul 28 04:37:42 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.76.2.2: +20 -1 lines
Diff to previous 1.76.2.2 (colored) to branchpoint 1.76 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jul 21 06:09:13 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.80: +20 -1 lines
Diff to previous 1.80 (colored) to selected 1.2.4.6 (colored)

More ASLR. Randomize the location of the direct map at boot time on amd64.
This doesn't need "options KASLR" and works on GENERIC. Will soon be
enabled by default.

The location of the areas is abstracted in a slotspace structure. Ideally
we should always use this structure when touching the L4 slots, instead of
the current cocktail of global variables and constants.

machdep initializes the structure with the default values, and we then
randomize its dmap entry. Ideally machdep should randomize everything at
once, but in the case of the direct map its size is determined a little
later in the boot procedure, so we're forced to randomize its location
later too.

Revision 1.76.2.2 / (download) - annotate - [select for diffs], Mon Jun 25 07:25:47 2018 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.76.2.1: +3 -2 lines
Diff to previous 1.76.2.1 (colored) to branchpoint 1.76 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.80 / (download) - annotate - [select for diffs], Wed Jun 20 11:49:38 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.79: +3 -2 lines
Diff to previous 1.79 (colored) to selected 1.2.4.6 (colored)

Add and use bootspace.smodule. Initialize it in locore/prekern to better
hide the specifics from the "upper" layers. This allows for greater
flexibility.

Revision 1.76.2.1 / (download) - annotate - [select for diffs], Mon May 21 04:36:02 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.76: +2 -7 lines
Diff to previous 1.76 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.79 / (download) - annotate - [select for diffs], Sat May 19 16:55:59 2018 UTC (5 years, 11 months ago) by jakllsch
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.78: +1 -5 lines
Diff to previous 1.78 (colored) to selected 1.2.4.6 (colored)

remove some remaining uvm_emap(9)-related function prototypes

Revision 1.78 / (download) - annotate - [select for diffs], Sat May 19 11:39:37 2018 UTC (5 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.77: +1 -3 lines
Diff to previous 1.77 (colored) to selected 1.2.4.6 (colored)

Remove emap support. Unfortunately it never got to state where it would be
used and usable, due to reliability and limited & complicated MD support.

Going forward, we need to concentrate on interface which do not map anything
into kernel in first place (such as direct map or KVA-less I/O), rather
than making those mappings cheaper to do.

Revision 1.77 / (download) - annotate - [select for diffs], Tue May 8 17:20:44 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (colored) to selected 1.2.4.6 (colored)

Mitigation for the SS bug, CVE-2018-8897. We disabled dbregs a month ago
in -current and -8 so we are not particularly affected anymore.

The #DB handler runs on ist3, if we decide to process the exception we
copy the iret frame on the correct non-ist stack and continue as usual.

Revision 1.64.6.2 / (download) - annotate - [select for diffs], Thu Mar 22 16:59:04 2018 UTC (6 years ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.64.6.1: +5 -1 lines
Diff to previous 1.64.6.1 (colored) to branchpoint 1.64 (colored) next main 1.65 (colored) to selected 1.2.4.6 (colored)

Pull up the following revisions, requested by maxv in ticket #652:

	sys/arch/amd64/amd64/amd64_trap.S	upto 1.39 (partial, patch)
	sys/arch/amd64/amd64/db_machdep.c	1.6 (patch)
	sys/arch/amd64/amd64/genassym.cf	1.65,1.66,1.67 (patch)
	sys/arch/amd64/amd64/locore.S		upto 1.159 (partial, patch)
	sys/arch/amd64/amd64/machdep.c		1.299-1.302 (patch)
	sys/arch/amd64/amd64/trap.c		upto 1.113 (partial, patch)
	sys/arch/amd64/amd64/amd64/vector.S	upto 1.61 (partial, patch)
	sys/arch/amd64/conf/GENERIC		1.477,1.478 (patch)
	sys/arch/amd64/conf/kern.ldscript	1.26 (patch)
	sys/arch/amd64/include/frameasm.h	upto 1.37 (partial, patch)
	sys/arch/amd64/include/param.h		1.25 (patch)
	sys/arch/amd64/include/pmap.h		1.41,1.43,1.44 (patch)
	sys/arch/x86/conf/files.x86		1.91,1.93 (patch)
	sys/arch/x86/include/cpu.h		1.88,1.89 (patch)
	sys/arch/x86/include/pmap.h		1.75 (patch)
	sys/arch/x86/x86/cpu.c			1.144,1.146,1.148,1.149 (patch)
	sys/arch/x86/x86/pmap.c			upto 1.289 (partial, patch)
	sys/arch/x86/x86/vm_machdep.c		1.31,1.32 (patch)
	sys/arch/x86/x86/x86_machdep.c		1.104,1.106,1.108 (patch)
	sys/arch/x86/x86/svs.c			1.1-1.14
	sys/arch/xen/conf/files.compat		1.30 (patch)

Backport SVS. Not enabled yet.

Revision 1.64.6.1 / (download) - annotate - [select for diffs], Fri Mar 16 13:17:56 2018 UTC (6 years, 1 month ago) by martin
Branch: netbsd-8
Changes since 1.64: +32 -1 lines
Diff to previous 1.64 (colored) to selected 1.2.4.6 (colored)

Pull up the following revisions (via patch), requested by maxv in #635:

	sys/arch/amd64/amd64/gdt.c		1.39-1.45 (patch)
	sys/arch/amd64/amd64/amd64/machdep.c	1.284,1.287,1.288 (patch)
	sys/arch/amd64/amd64/include/param.h	1.23 (patch)
	sys/arch/amd64/include/types.h		1.53 (patch)
	sys/arch/x86/include/cpu.h		1.87 (patch)
	sys/arch/x86/include/pmap.h		1.73,1.74 (patch)
	sys/arch/x86/x86/cpu.c			1.142 (patch)
	sys/arch/x86/x86/intr.c			1.117 (partial),1.120 (patch)
	sys/arch/x86/x86/pmap.c			1.276 (patch)

Initialize ist0 in cpu_init_tss.
Backport __HAVE_PCPU_AREA.

Revision 1.76 / (download) - annotate - [select for diffs], Sun Mar 4 10:13:08 2018 UTC (6 years, 1 month ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.75: +1 -12 lines
Diff to previous 1.75 (colored) to selected 1.2.4.6 (colored)

drop pmap_update_2pg(), just call pmap_update_pg() separately for each

Revision 1.75 / (download) - annotate - [select for diffs], Thu Jan 18 07:25:34 2018 UTC (6 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.74: +5 -1 lines
Diff to previous 1.74 (colored) to selected 1.2.4.6 (colored)

Unmap the kernel heap from the user page tables (SVS).

This implementation is optimized and organized in such a way that we
don't need to copy the kernel stack to a safe place during user<->kernel
transitions. We create two VAs that point to the same physical page; one
will be mapped in userland and is offset in order to contain only the
trapframe, the other is mapped in the kernel and maps the entire stack.

Sent on tech-kern@ a week ago.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Jan 11 10:38:13 2018 UTC (6 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.73: +2 -1 lines
Diff to previous 1.73 (colored) to selected 1.2.4.6 (colored)

Add ist0 to pcpu_entry.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jan 5 08:04:21 2018 UTC (6 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.72: +26 -1 lines
Diff to previous 1.72 (colored) to selected 1.2.4.6 (colored)

Add a __HAVE_PCPU_AREA option, enabled by default on native amd64 but not
Xen.

With this option, the CPU structures that must always be present in the
CPU's page tables are moved on L4 slot 384, which means address
0xffffc00000000000.

A new pcpu_area structure is defined. It contains shared structures (IDT,
LDT), and then an array of pcpu_entry structures, indexed by cpu_index(ci).
Theoretically the LDT should be in the array, but this will be done later.

During the boot procedure, cpu0 calls pmap_init_pcpu, which creates a
page tree that is able to map the pcpu_area structure entirely. cpu0 then
immediately maps the shared structures. Later, every CPU goes through
cpu_pcpuarea_init, which allocates physical pages and kenters the relevant
pcpu_entry to them. Finally, each pointer is replaced to point to pcpuarea.

The point of this change is to make sure that the structures that must
always be present in the page tables have their own L4 slot. Until now
their L4 slot was that of pmap_kernel, and making a distinction between
what must be mapped and what does not need to be was complicated.

Even in the non-speculative-bug case this change makes some sense: there
are several x86 instructions that leak the addresses of the CPU structures,
and putting these structures inside pmap_kernel actually offered a way to
compute the address of the kernel heap - which would have made ASLR on it
plainly useless, had we implemented that.

Note that, for now, pcpuarea does not contain rsp0.

Unfortunately this change adds many #ifdefs, and makes the code harder to
understand. There is also some duplication, but that will be solved later.

Revision 1.72 / (download) - annotate - [select for diffs], Thu Dec 28 14:34:39 2017 UTC (6 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.71: +8 -3 lines
Diff to previous 1.71 (colored) to selected 1.2.4.6 (colored)

Use variables in PMAP_DIRECT_*, so that the location of the direct map can
change.

Revision 1.52.2.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:36:50 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.52.2.2: +81 -14 lines
Diff to previous 1.52.2.2 (colored) to branchpoint 1.52 (colored) next main 1.53 (colored) to selected 1.2.4.6 (colored)

update from HEAD

Revision 1.71 / (download) - annotate - [select for diffs], Sat Nov 11 12:51:05 2017 UTC (6 years, 5 months ago) by maxv
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.70: +9 -12 lines
Diff to previous 1.70 (colored) to selected 1.2.4.6 (colored)

Modify the layout of the bootspace structure, in such a way that it can
contain several kernel segments of the same type (eg several .text
segments). Some parts are still a bit messy but will be cleaned up soon.

I cannot compile-test this change on i386, but it seems fine enough.

NOTE: you need to rebuild and reinstall a new prekern after this change.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Oct 29 10:01:22 2017 UTC (6 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.69: +7 -1 lines
Diff to previous 1.69 (colored) to selected 1.2.4.6 (colored)

Add a fifth region, called "head". On kaslr kernels it contains the ELF
Header and the ELF Section Headers. On normal kernels it is empty (the
headers are in the "boot" region).

Note: if you're using GENERIC_KASLR, you also need to rebuild the prekern.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Sep 30 11:43:57 2017 UTC (6 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.68: +39 -0 lines
Diff to previous 1.68 (colored) to selected 1.2.4.6 (colored)

Add a bootspace structure. It describes the physical and virtual space
layout created by the early kernel bootstrap code. Start using it, and
eliminate several references to KERNBASE and other global symbols. While
here clean up xen-i386, it's really tiring.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Sep 29 03:17:18 2017 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored) to selected 1.2.4.6 (colored)

Fix build

sys/arch/x86/x86/cpu.c:920:20: error: 'pmap_largepages' undeclared (first use in this function)
  smp_data.large = (pmap_largepages != 0);
                    ^

Revision 1.55.6.6 / (download) - annotate - [select for diffs], Mon Aug 28 17:51:56 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.55.6.5: +9 -13 lines
Diff to previous 1.55.6.5 (colored) to branchpoint 1.55 (colored) next main 1.56 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.67 / (download) - annotate - [select for diffs], Sat Jun 17 08:07:03 2017 UTC (6 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored) to selected 1.2.4.6 (colored)

Actually, use slot 456 instead, so that it fits a cache line.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Jun 14 14:17:15 2017 UTC (6 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.65: +3 -1 lines
Diff to previous 1.65 (colored) to selected 1.2.4.6 (colored)

Give the direct map 32 slots (16TB of va). This matches MAXPHYSMEM, in
such a way that the direct map is no longer the limiting factor for high
memory systems.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Jun 14 12:49:37 2017 UTC (6 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored) to selected 1.2.4.6 (colored)

Move the direct map from slot 509 to slot 460. We will increase its size
dynamically.

Revision 1.58.2.5 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:09 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.58.2.4: +1 -3 lines
Diff to previous 1.58.2.4 (colored) to branchpoint 1.58 (colored) next main 1.59 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.61.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:53:39 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.61: +5 -11 lines
Diff to previous 1.61 (colored) next main 1.62 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.64 / (download) - annotate - [select for diffs], Thu Mar 23 18:08:06 2017 UTC (7 years ago) by maxv
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.63: +1 -3 lines
Diff to previous 1.63 (colored) to selected 1.2.4.6 (colored)

Remove PG_k completely.

Revision 1.58.2.4 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:22 2017 UTC (7 years, 1 month ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.58.2.3: +5 -9 lines
Diff to previous 1.58.2.3 (colored) to branchpoint 1.58 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.55.4.1.4.2 / (download) - annotate - [select for diffs], Mon Mar 13 07:41:26 2017 UTC (7 years, 1 month ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.55.4.1.4.1: +1 -9 lines
Diff to previous 1.55.4.1.4.1 (colored) to branchpoint 1.55.4.1 (colored) next main 1.55.4.2 (colored) to selected 1.2.4.6 (colored)

Sync with netbsd-7-1-RELEASE

Revision 1.49.2.3 / (download) - annotate - [select for diffs], Mon Mar 6 08:18:44 2017 UTC (7 years, 1 month ago) by snj
Branch: netbsd-6
Changes since 1.49.2.2: +1 -9 lines
Diff to previous 1.49.2.2 (colored) to branchpoint 1.49 (colored) next main 1.50 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1441):
	sys/arch/x86/x86/pmap.c: revision 1.241 via patch
	sys/arch/x86/include/pmap.h: revision 1.63 via patch
Should be PG_k, doesn't change anything.
--
Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.
On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.
However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.
Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.
With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.49.2.2.6.1 / (download) - annotate - [select for diffs], Mon Mar 6 08:18:14 2017 UTC (7 years, 1 month ago) by snj
Branch: netbsd-6-1
Changes since 1.49.2.2: +1 -9 lines
Diff to previous 1.49.2.2 (colored) next main 1.49.2.3 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1441):
	sys/arch/x86/x86/pmap.c: revision 1.241 via patch
	sys/arch/x86/include/pmap.h: revision 1.63 via patch
Should be PG_k, doesn't change anything.
--
Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.
On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.
However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.
Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.
With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.49.2.2.4.1 / (download) - annotate - [select for diffs], Mon Mar 6 08:17:49 2017 UTC (7 years, 1 month ago) by snj
Branch: netbsd-6-0
Changes since 1.49.2.2: +1 -9 lines
Diff to previous 1.49.2.2 (colored) next main 1.49.2.3 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1441):
	sys/arch/x86/x86/pmap.c: revision 1.241 via patch
	sys/arch/x86/include/pmap.h: revision 1.63 via patch
Should be PG_k, doesn't change anything.
--
Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.
On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.
However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.
Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.
With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.55.4.1.2.2 / (download) - annotate - [select for diffs], Mon Mar 6 03:32:45 2017 UTC (7 years, 1 month ago) by snj
Branch: netbsd-7-0
Changes since 1.55.4.1.2.1: +1 -9 lines
Diff to previous 1.55.4.1.2.1 (colored) to branchpoint 1.55.4.1 (colored) next main 1.55.4.2 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1388):
	sys/arch/x86/include/pmap.h: revision 1.63 via patch
	sys/arch/x86/x86/pmap.c: revision 1.241 via patch
Should be PG_k, doesn't change anything.
--
Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.
On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.
However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.
Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.
With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.55.4.3 / (download) - annotate - [select for diffs], Mon Mar 6 03:27:19 2017 UTC (7 years, 1 month ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.55.4.2: +1 -9 lines
Diff to previous 1.55.4.2 (colored) to branchpoint 1.55 (colored) next main 1.56 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1388):
	sys/arch/x86/x86/pmap.c: revision 1.241
Should be PG_k, doesn't change anything.
--
Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.
On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.
However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.
Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.
With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Mar 5 09:08:18 2017 UTC (7 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.62: +1 -9 lines
Diff to previous 1.62 (colored) to selected 1.2.4.6 (colored)

Remove PG_u from the kernel pages on Xen. Otherwise there is no privilege
separation between the kernel and userland.

On Xen-amd64, the kernel runs in ring3 just like userland, and the
separation is guaranteed by the hypervisor - each syscall/trap is
intercepted by Xen and sent manually to the kernel. Before that, the
hypervisor modifies the page tables so that the kernel becomes accessible.
Later, when returning to userland, the hypervisor removes the kernel pages
and flushes the TLB.

However, TLB flushes are costly, and in order to reduce the number of pages
flushed Xen marks the userland pages as global, while keeping the kernel
ones as local. This way, when returning to userland, only the kernel pages
get flushed - which makes sense since they are the only ones that got
removed from the mapping.

Xen differentiates the userland pages by looking at their PG_u bit in the
PTE; if a page has this bit then Xen tags it as global, otherwise Xen
manually adds the bit but keeps the page as local. The thing is, since we
set PG_u in the kernel pages, Xen believes our kernel pages are in fact
userland pages, so it marks them as global. Therefore, when returning to
userland, the kernel pages indeed get removed from the page tree, but are
not flushed from the TLB. Which means that they are still accessible.

With this - and depending on the DTLB size - userland has a small window
where it can read/write to the last kernel pages accessed, which is enough
to completely escalate privileges: the sysent structure systematically gets
read when performing a syscall, and chances are that it will still be
cached in the TLB. Userland can then use this to patch a chosen syscall,
make it point to a userland function, retrieve %gs and compute the address
of its credentials, and finally grant itself root privileges.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Feb 11 14:11:24 2017 UTC (7 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.61: +5 -1 lines
Diff to previous 1.61 (colored) to selected 1.2.4.6 (colored)

Instead of using a global array with per-cpu indexes, embed the tmp VAs
into cpu_info directly. This concerns only {i386, Xen-i386, Xen-amd64},
because amd64 already has a direct map that is way faster than that.

There are two major issues with the global array: maxcpus entries are
allocated while it is unlikely that common i386 machines have so many
cpus, and the base VA of these entries is not cache-line-aligned, which
mostly guarantees cache-line-thrashing each time the VAs are entered.

Now the number of tmp VAs allocated is proportionate to the number of CPUs
attached (which therefore reduces memory consumption), and the base is
properly aligned.

On my 3-core AMD, the number of DC_refills_L2 events triggered when
performing 5x10^6 calls to pmap_zero_page on two dedicated cores is on
average divided by two with this patch.

Discussed on tech-kern a little.

Revision 1.55.4.1.4.1 / (download) - annotate - [select for diffs], Wed Jan 18 08:46:26 2017 UTC (7 years, 3 months ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.55.4.1: +2 -1 lines
Diff to previous 1.55.4.1 (colored) to selected 1.2.4.6 (colored)

Sync with netbsd-5

Revision 1.58.2.3 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:28 2017 UTC (7 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.58.2.2: +2 -1 lines
Diff to previous 1.58.2.2 (colored) to branchpoint 1.58 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.55.4.1.2.1 / (download) - annotate - [select for diffs], Sun Dec 18 07:02:59 2016 UTC (7 years, 4 months ago) by snj
Branch: netbsd-7-0
Changes since 1.55.4.1: +2 -1 lines
Diff to previous 1.55.4.1 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1316):
	sys/arch/x86/x86/pmap.c: revision 1.223
	sys/arch/x86/x86/vm_machdep.c: revision 1.26
	sys/arch/x86/include/pmap.h: revision 1.61
PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
XXX: pullup-7

Revision 1.55.4.2 / (download) - annotate - [select for diffs], Sun Dec 18 07:01:57 2016 UTC (7 years, 4 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-1-RC2, netbsd-7-1-RC1
Changes since 1.55.4.1: +2 -1 lines
Diff to previous 1.55.4.1 (colored) to branchpoint 1.55 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1316):
	sys/arch/x86/x86/pmap.c: revision 1.223
	sys/arch/x86/x86/vm_machdep.c: revision 1.26
	sys/arch/x86/include/pmap.h: revision 1.61
PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
XXX: pullup-7

Revision 1.55.6.5 / (download) - annotate - [select for diffs], Mon Dec 5 10:54:59 2016 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.55.6.4: +2 -1 lines
Diff to previous 1.55.6.4 (colored) to branchpoint 1.55 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.61 / (download) - annotate - [select for diffs], Tue Nov 8 03:05:36 2016 UTC (7 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, nick-nhusb-base-20161204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored) to selected 1.2.4.6 (colored)

PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
XXX: pullup-7

Revision 1.58.2.2 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:06 2016 UTC (7 years, 5 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.58.2.1: +2 -1 lines
Diff to previous 1.58.2.1 (colored) to branchpoint 1.58 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.55.6.4 / (download) - annotate - [select for diffs], Wed Oct 5 20:55:36 2016 UTC (7 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.55.6.3: +6 -4 lines
Diff to previous 1.55.6.3 (colored) to branchpoint 1.55 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.60 / (download) - annotate - [select for diffs], Mon Sep 19 20:46:55 2016 UTC (7 years, 6 months ago) by maya
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161004
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored) to selected 1.2.4.6 (colored)

move function prototype to x86, so it is available to amd64 too

Revision 1.58.2.1 / (download) - annotate - [select for diffs], Tue Jul 26 03:24:19 2016 UTC (7 years, 8 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.59 / (download) - annotate - [select for diffs], Mon Jul 25 12:11:40 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored) to selected 1.2.4.6 (colored)

The L1 entry of the first page of the data segment is overwritten for the
LAPIC page, and set as RWX+PG_N. The LAPIC pa is fixed, and its va resides
in the data segment. Because of this error-prone design, the kernel image
map is not linear, and I first thought it was a bug (as I vaguely said in
PR/51148). Using large pages for the data segment is therefore wrong, since
the first page does not actually belong to the data segment (even if its va
is in the range). This bug is not triggered currently, since local_apic is
not large-page-aligned.

We will certainly have to allocate a va dynamically instead of using the
first page of data; but for now, disable large pages on the data segment,
and map the LAPIC as RW.

This is the last x86-specific RWX page.

Revision 1.55.6.3 / (download) - annotate - [select for diffs], Sat Jul 9 20:24:59 2016 UTC (7 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.55.6.2: +2 -2 lines
Diff to previous 1.55.6.2 (colored) to branchpoint 1.55 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jul 1 11:10:48 2016 UTC (7 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-base, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored) to selected 1.2.4.6 (colored)

Define pmap_pg_nx globally. Will be used soon.

Revision 1.55.6.2 / (download) - annotate - [select for diffs], Sun Dec 27 12:09:45 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.55.6.1: +2 -1 lines
Diff to previous 1.55.6.1 (colored) to branchpoint 1.55 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.57 / (download) - annotate - [select for diffs], Wed Nov 11 08:20:22 2015 UTC (8 years, 5 months ago) by skrll
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.56: +2 -1 lines
Diff to previous 1.56 (colored) to selected 1.2.4.6 (colored)

Split out the pmap_pv_track stuff for use by others.

Discussed with riastradh@

Revision 1.55.4.1 / (download) - annotate - [select for diffs], Thu Apr 23 07:31:16 2015 UTC (8 years, 11 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: netbsd-7-nhusb, netbsd-7-0
Changes since 1.55: +26 -2 lines
Diff to previous 1.55 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by mrg in ticket #718):
	sys/arch/x86/include/pmap.h: revision 1.56
	sys/arch/x86/x86/pmap.c: revision 1.188
	sys/dev/pci/agp_amd64.c: revision 1.8
	sys/dev/pci/agp_i810.c: revision 1.118
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
	sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
	sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
	sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
	sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
	sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
	sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
	sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
	sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
	sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated.  (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support.  it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect.  Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub.  Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started.  my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized.  PR 49833

Revision 1.55.6.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:04 2015 UTC (9 years ago) by skrll
Branch: nick-nhusb
Changes since 1.55: +26 -2 lines
Diff to previous 1.55 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.56 / (download) - annotate - [select for diffs], Fri Apr 3 01:04:23 2015 UTC (9 years ago) by riastradh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.55: +26 -2 lines
Diff to previous 1.55 (colored) to selected 1.2.4.6 (colored)

Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Revision 1.52.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:29 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.52.2.1: +2 -5 lines
Diff to previous 1.52.2.1 (colored) to branchpoint 1.52 (colored) to selected 1.2.4.6 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.43.2.6 / (download) - annotate - [select for diffs], Thu May 22 11:40:13 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.5: +5 -6 lines
Diff to previous 1.43.2.5 (colored) to branchpoint 1.43 (colored) next main 1.44 (colored) to selected 1.2.4.6 (colored)

sync with head.

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

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

Revision 1.54.2.1 / (download) - annotate - [select for diffs], Sun May 18 17:45:30 2014 UTC (9 years, 11 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored) next main 1.55 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.55 / (download) - annotate - [select for diffs], Thu Oct 17 20:59:16 2013 UTC (10 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base, netbsd-7-base
Branch point for: nick-nhusb, netbsd-7
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored) to selected 1.2.4.6 (colored)

__USE() unused variables

Revision 1.54 / (download) - annotate - [select for diffs], Sun Jun 23 23:49:28 2013 UTC (10 years, 9 months ago) by uebayasi
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.53: +1 -4 lines
Diff to previous 1.53 (colored) to selected 1.2.4.6 (colored)

Remove obsolete comment.  OK'ed by rmind@.

Revision 1.43.2.5 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:10 2013 UTC (11 years, 3 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.43.2.4: +2 -1 lines
Diff to previous 1.43.2.4 (colored) to branchpoint 1.43 (colored) to selected 1.2.4.6 (colored)

sync with (a bit old) head

Revision 1.52.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:01:51 2012 UTC (11 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored) to selected 1.2.4.6 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.53 / (download) - annotate - [select for diffs], Tue Nov 13 14:07:42 2012 UTC (11 years, 5 months ago) by chs
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, khorben-n900, agc-symver-base, agc-symver
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored) to selected 1.2.4.6 (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.43.2.4 / (download) - annotate - [select for diffs], Wed May 23 10:07:51 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.3: +7 -4 lines
Diff to previous 1.43.2.3 (colored) to branchpoint 1.43 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.49.2.2 / (download) - annotate - [select for diffs], Wed May 9 03:22:52 2012 UTC (11 years, 11 months ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: netbsd-6-1, netbsd-6-0
Changes since 1.49.2.1: +6 -3 lines
Diff to previous 1.49.2.1 (colored) to branchpoint 1.49 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by rmind in ticket #202):
	sys/arch/x86/include/cpuvar.h: revision 1.46
	sys/arch/xen/include/xenpmap.h: revision 1.34
	sys/arch/i386/include/param.h: revision 1.77
	sys/arch/x86/x86/pmap_tlb.c: revision 1.5
	sys/arch/x86/x86/pmap_tlb.c: revision 1.6
	sys/arch/i386/i386/genassym.cf: revision 1.92
	sys/arch/xen/x86/cpu.c: revision 1.91
	sys/arch/x86/x86/pmap.c: revision 1.177
	sys/arch/xen/x86/xen_pmap.c: revision 1.21
	sys/arch/x86/acpi/acpi_wakeup.c: revision 1.31
	sys/kern/subr_kcpuset.c: revision 1.5
	sys/arch/amd64/include/param.h: revision 1.18
	sys/sys/kcpuset.h: revision 1.5
	sys/arch/x86/x86/mtrr_i686.c: revision 1.26
	sys/arch/x86/x86/mtrr_i686.c: revision 1.27
	sys/arch/xen/x86/x86_xpmap.c: revision 1.43
	sys/arch/x86/x86/cpu.c: revision 1.98
	sys/arch/amd64/amd64/mptramp.S: revision 1.14
	sys/kern/sys_sched.c: revision 1.42
	sys/arch/amd64/amd64/genassym.cf: revision 1.50
	sys/arch/i386/i386/mptramp.S: revision 1.24
	sys/arch/x86/include/pmap.h: revision 1.52
	sys/arch/x86/include/cpu.h: revision 1.50
- 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.
- pmap_tlb_shootdown: do not overwrite tp_cpumask with pm_cpus, but merge
  like pm_kernel_cpus.  Remove unecessary intersection with kcpuset_running.
  Do not reset tp_userpmap if pmap_kernel().
- Remove pmap_tlb_mailbox_t wrapping, which is pointless after recent changes.
- pmap_tlb_invalidate, pmap_tlb_intr: constify for packet structure.
i686_mtrr_init_first: handle the case when there are no variable-size MTRR
registers available (i686_mtrr_vcnt == 0).

Revision 1.48.2.3 / (download) - annotate - [select for diffs], Sun Apr 29 23:04:43 2012 UTC (11 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.48.2.2: +7 -4 lines
Diff to previous 1.48.2.2 (colored) to branchpoint 1.48 (colored) next main 1.49 (colored) to selected 1.2.4.6 (colored)

sync to latest -current.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Apr 20 22:23:24 2012 UTC (12 years ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base6, yamt-pagecache-base5, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Branch point for: tls-maxphys
Changes since 1.51: +7 -4 lines
Diff to previous 1.51 (colored) to selected 1.2.4.6 (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.43.2.3 / (download) - annotate - [select for diffs], Tue Apr 17 00:07:05 2012 UTC (12 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.2: +28 -31 lines
Diff to previous 1.43.2.2 (colored) to branchpoint 1.43 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.48.2.2 / (download) - annotate - [select for diffs], Thu Apr 5 21:33:21 2012 UTC (12 years ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.48.2.1: +1 -4 lines
Diff to previous 1.48.2.1 (colored) to branchpoint 1.48 (colored) to selected 1.2.4.6 (colored)

sync to latest -current.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Mar 11 16:28:02 2012 UTC (12 years, 1 month ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base4, jmcneill-usbmp-base8
Changes since 1.50: +1 -4 lines
Diff to previous 1.50 (colored) to selected 1.2.4.6 (colored)

Alternate PTEs got killed a few weeks ago. Clean up unused prototypes.

Revision 1.49.2.1 / (download) - annotate - [select for diffs], Wed Feb 22 18:56:47 2012 UTC (12 years, 1 month ago) by riz
Branch: netbsd-6
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by bouyer in ticket #29):
	sys/arch/xen/x86/x86_xpmap.c: revision 1.39
	sys/arch/xen/include/hypervisor.h: revision 1.37
	sys/arch/xen/include/intr.h: revision 1.34
	sys/arch/xen/x86/xen_ipi.c: revision 1.10
	sys/arch/x86/x86/cpu.c: revision 1.97
	sys/arch/x86/include/cpu.h: revision 1.48
	sys/uvm/uvm_map.c: revision 1.315
	sys/arch/x86/x86/pmap.c: revision 1.165
	sys/arch/xen/x86/cpu.c: revision 1.81
	sys/arch/x86/x86/pmap.c: revision 1.167
	sys/arch/xen/x86/cpu.c: revision 1.82
	sys/arch/x86/x86/pmap.c: revision 1.168
	sys/arch/xen/x86/xen_pmap.c: revision 1.17
	sys/uvm/uvm_km.c: revision 1.122
	sys/uvm/uvm_kmguard.c: revision 1.10
	sys/arch/x86/include/pmap.h: revision 1.50
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.
When using uvm_km_pgremove_intrsafe() make sure mappings are removed
before returning the pages to the free pool. Otherwise, under Xen,
a page which still has a writable mapping could be allocated for
a PDP by another CPU and the hypervisor would refuse it (this is
PR port-xen/45975).
For this, move the pmap_kremove() calls inside uvm_km_pgremove_intrsafe(),
and do pmap_kremove()/uvm_pagefree() in batch of (at most) 16 entries
(as suggested by Chuck Silvers on tech-kern@, see also
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012727.html and
followups).
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
Revert pmap_pte_flush() -> xpq_flush_queue() in previous.

Revision 1.48.2.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:33:34 2012 UTC (12 years, 2 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.48: +24 -1 lines
Diff to previous 1.48 (colored) to selected 1.2.4.6 (colored)

merge to -current.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Feb 17 18:40:18 2012 UTC (12 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored) to selected 1.2.4.6 (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.49 / (download) - annotate - [select for diffs], Sun Dec 4 16:24:13 2011 UTC (12 years, 4 months ago) by chs
Branch: MAIN
CVS Tags: netbsd-6-base
Branch point for: netbsd-6
Changes since 1.48: +22 -1 lines
Diff to previous 1.48 (colored) to selected 1.2.4.6 (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.48 / (download) - annotate - [select for diffs], Wed Nov 23 01:16:55 2011 UTC (12 years, 4 months ago) by jym
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Changes since 1.47: +1 -17 lines
Diff to previous 1.47 (colored) to selected 1.2.4.6 (colored)

No more users of xpmap_update(). Use pmap_pte_*() functions now.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 23 00:56:56 2011 UTC (12 years, 4 months ago) by jym
Branch: MAIN
Changes since 1.46: +1 -11 lines
Diff to previous 1.46 (colored) to selected 1.2.4.6 (colored)

Move Xen-specific functions to Xen pmap. Requested by cherry@.

Un'ifdef XEN in xen_pmap.c, it is always defined there.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Nov 20 19:41:27 2011 UTC (12 years, 5 months ago) by jym
Branch: MAIN
Changes since 1.45: +14 -11 lines
Diff to previous 1.45 (colored) to selected 1.2.4.6 (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.43.2.2 / (download) - annotate - [select for diffs], Fri Nov 18 00:51:28 2011 UTC (12 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.1: +3 -6 lines
Diff to previous 1.43.2.1 (colored) to branchpoint 1.43 (colored) to selected 1.2.4.6 (colored)

share a lock among pmap uobjs

Revision 1.43.2.1 / (download) - annotate - [select for diffs], Thu Nov 10 14:31:43 2011 UTC (12 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43: +11 -3 lines
Diff to previous 1.43 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.45 / (download) - annotate - [select for diffs], Tue Nov 8 17:16:52 2011 UTC (12 years, 5 months ago) by cherry
Branch: MAIN
CVS Tags: yamt-pagecache-base3, jmcneill-audiomp3-base, jmcneill-audiomp3
Changes since 1.44: +11 -1 lines
Diff to previous 1.44 (colored) to selected 1.2.4.6 (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.44 / (download) - annotate - [select for diffs], Sun Nov 6 11:40:47 2011 UTC (12 years, 5 months ago) by cherry
Branch: MAIN
CVS Tags: yamt-pagecache-base2
Changes since 1.43: +1 -3 lines
Diff to previous 1.43 (colored) to selected 1.2.4.6 (colored)

[merging from cherry-xenmp] Make the xen MMU op queue locking api private. Implement per-cpu queues.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Oct 18 23:14:28 2011 UTC (12 years, 6 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.42: +9 -1 lines
Diff to previous 1.42 (colored) to selected 1.2.4.6 (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.38.2.3 / (download) - annotate - [select for diffs], Tue Sep 20 18:57:52 2011 UTC (12 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.38.2.2: +1 -4 lines
Diff to previous 1.38.2.2 (colored) to branchpoint 1.38 (colored) next main 1.39 (colored) to selected 1.2.4.6 (colored)

Remove the "xpq lock", since we have per-cpu mmu queues now. This may need further testing. Also add some preliminary locking around queue-ops in the network backend driver

Revision 1.42 / (download) - annotate - [select for diffs], Tue Sep 20 00:12:23 2011 UTC (12 years, 7 months ago) by jym
Branch: MAIN
Changes since 1.41: +7 -1 lines
Diff to previous 1.41 (colored) to selected 1.2.4.6 (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.21.2.11 / (download) - annotate - [select for diffs], Sat Aug 27 15:37:29 2011 UTC (12 years, 7 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.10: +35 -19 lines
Diff to previous 1.21.2.10 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD. Most notably: uvm/pmap work done by rmind@, and MP Xen
work of cherry@.

No regression observed on suspend/restore.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Aug 13 12:09:38 2011 UTC (12 years, 8 months ago) by cherry
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.40: +3 -1 lines
Diff to previous 1.40 (colored) to selected 1.2.4.6 (colored)

Add locking around ops to the hypervisor MMU "queue".

Revision 1.38.2.2 / (download) - annotate - [select for diffs], Thu Jun 23 14:19:48 2011 UTC (12 years, 9 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.38.2.1: +33 -19 lines
Diff to previous 1.38.2.1 (colored) to branchpoint 1.38 (colored) to selected 1.2.4.6 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jun 13 04:30:40 2011 UTC (12 years, 10 months ago) by tls
Branch: MAIN
Changes since 1.39: +3 -1 lines
Diff to previous 1.39 (colored) to selected 1.2.4.6 (colored)

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

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jun 12 03:35:50 2011 UTC (12 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.38: +31 -19 lines
Diff to previous 1.38 (colored) to selected 1.2.4.6 (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.33.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:07:06 2011 UTC (12 years, 10 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.33: +19 -17 lines
Diff to previous 1.33 (colored) next main 1.34 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Fri Jun 3 13:27:39 2011 UTC (12 years, 10 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored) to selected 1.2.4.6 (colored)

Initial import of xen MP sources, with kernel and userspace tests.
 - this is a source priview.
 - boots to single user.
 - spurious interrupt and pmap related panics are normal

Revision 1.29.2.11 / (download) - annotate - [select for diffs], Tue May 31 03:04:23 2011 UTC (12 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.10: +7 -9 lines
Diff to previous 1.29.2.10 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.21.2.10 / (download) - annotate - [select for diffs], Thu May 26 22:26:52 2011 UTC (12 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.9: +5 -7 lines
Diff to previous 1.21.2.9 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Pull-up some modifications from -current to my branch.

Revision 1.29.2.10 / (download) - annotate - [select for diffs], Thu May 19 03:42:59 2011 UTC (12 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.9: +2 -2 lines
Diff to previous 1.29.2.9 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.

Revision 1.38 / (download) - annotate - [select for diffs], Sat May 7 23:59:13 2011 UTC (12 years, 11 months ago) by jym
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.37: +5 -7 lines
Diff to previous 1.37 (colored) to selected 1.2.4.6 (colored)

Do as the comment says, use ilog2(). This gets optimized directly at
compile time, no call to fls() is needed.

Revision 1.21.2.9 / (download) - annotate - [select for diffs], Mon May 2 22:49:57 2011 UTC (12 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.8: +3 -3 lines
Diff to previous 1.21.2.8 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Apr 25 22:24:36 2011 UTC (12 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.36: +3 -1 lines
Diff to previous 1.36 (colored) to selected 1.2.4.6 (colored)

comment

Revision 1.36 / (download) - annotate - [select for diffs], Mon Apr 25 22:24:00 2011 UTC (12 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.35: +1 -3 lines
Diff to previous 1.35 (colored) to selected 1.2.4.6 (colored)

remove unused ptei

Revision 1.21.2.8 / (download) - annotate - [select for diffs], Mon Mar 28 23:04:50 2011 UTC (13 years ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.7: +13 -9 lines
Diff to previous 1.21.2.7 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD. TODO before merge:
- shortcut for suspend code in sysmon, when powerd(8) is not running.
Borrow ``xs_watch'' thread context?
- bug hunting in xbd + xennet resume. Rings are currently thrashed upon
resume, so current implementation force flush them on suspend. It's not
really needed.

Revision 1.29.2.9 / (download) - annotate - [select for diffs], Thu Mar 17 04:46:28 2011 UTC (13 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.8: +2 -28 lines
Diff to previous 1.29.2.8 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

- Fix tlbflushg() to behave like tlbflush(), if page global extension (PGE)
  is not (yet) enabled.  This fixes the issue of stale TLB entry, experienced
  early on boot, when PGE is not yet set on primary CPU.
- Rewrite i386/amd64 TLB interrupt handlers in C (only stubs are in assembly),
  which simplifies and unifies (under x86) code, plus fixes few bugs.
- cpu_attach: remove assignment to cpus_running, as primary CPU might not be
  attached first, which causes reset (and thus missed secondary CPUs).

Revision 1.29.2.8 / (download) - annotate - [select for diffs], Tue Mar 8 23:27:50 2011 UTC (13 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.7: +15 -13 lines
Diff to previous 1.29.2.7 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

struct pmap_tlb_mailbox: make tm_pending and tm_gen volatile.

Revision 1.29.2.7 / (download) - annotate - [select for diffs], Sat Mar 5 20:52:28 2011 UTC (13 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.6: +25 -18 lines
Diff to previous 1.29.2.6 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.33.4.2 / (download) - annotate - [select for diffs], Thu Feb 17 12:00:05 2011 UTC (13 years, 2 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.33.4.1: +13 -2 lines
Diff to previous 1.33.4.1 (colored) to branchpoint 1.33 (colored) next main 1.34 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

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

add bus_space_mmap support for BUS_SPACE_MAP_PREFETCHABLE, ok matt@

Revision 1.33.4.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:19:44 2011 UTC (13 years, 2 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.33: +1 -8 lines
Diff to previous 1.33 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.34 / (download) - annotate - [select for diffs], Tue Feb 1 20:19:32 2011 UTC (13 years, 2 months ago) by chuck
Branch: MAIN
Changes since 1.33: +1 -8 lines
Diff to previous 1.33 (colored) to selected 1.2.4.6 (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.21.2.7 / (download) - annotate - [select for diffs], Sun Oct 24 22:48:16 2010 UTC (13 years, 5 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.6: +32 -18 lines
Diff to previous 1.21.2.6 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.28.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:45:31 2010 UTC (13 years, 8 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.28.2.1: +28 -14 lines
Diff to previous 1.28.2.1 (colored) to branchpoint 1.28 (colored) next main 1.29 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.12.10.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:52:55 2010 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.12.10.4: +29 -15 lines
Diff to previous 1.12.10.4 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 24 00:45:56 2010 UTC (13 years, 8 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.32: +6 -8 lines
Diff to previous 1.32 (colored) to selected 1.2.4.6 (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.32 / (download) - annotate - [select for diffs], Thu Jul 15 19:02:26 2010 UTC (13 years, 9 months ago) by jym
Branch: MAIN
Changes since 1.31: +7 -2 lines
Diff to previous 1.31 (colored) to selected 1.2.4.6 (colored)

Make the comment about PDPpaddr more thorough.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jul 6 20:50:35 2010 UTC (13 years, 9 months ago) by cegger
Branch: MAIN
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored) to selected 1.2.4.6 (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.29.2.6 / (download) - annotate - [select for diffs], Mon May 31 01:12:13 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.5: +4 -1 lines
Diff to previous 1.29.2.5 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

- Split off Xen versions of pmap_map_ptes/pmap_unmap_ptes into Xen pmap,
  also move pmap_apte_flush() with pmap_unmap_apdp() there.
- Make Xen buildable.

Revision 1.29.2.5 / (download) - annotate - [select for diffs], Sun May 30 05:17:12 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.4: +18 -6 lines
Diff to previous 1.29.2.4 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.29.2.4 / (download) - annotate - [select for diffs], Wed May 26 04:55:23 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.3: +4 -3 lines
Diff to previous 1.29.2.3 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

Split x86 TLB shootdown code into a separate file.
Code part is under TNF license, as per pmap.c 1.105.2.4 revision.

Revision 1.30 / (download) - annotate - [select for diffs], Mon May 10 18:46:58 2010 UTC (13 years, 11 months ago) by dyoung
Branch: MAIN
Changes since 1.29: +18 -6 lines
Diff to previous 1.29 (colored) to selected 1.2.4.6 (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.28.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:39:57 2010 UTC (13 years, 11 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.29.2.3 / (download) - annotate - [select for diffs], Mon Apr 26 04:48:49 2010 UTC (13 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.2: +5 -5 lines
Diff to previous 1.29.2.2 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

Partly rewrite amd64 TLB shutdown handler for the changes in x86 pmap.
At this point, branch seems to pass preliminar stress tests on amd64.

Revision 1.29.2.2 / (download) - annotate - [select for diffs], Mon Apr 26 02:43:34 2010 UTC (13 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29.2.1: +43 -13 lines
Diff to previous 1.29.2.1 (colored) to branchpoint 1.29 (colored) to selected 1.2.4.6 (colored)

Apply renovated patch to significantly reduce TLB shootdowns in x86 pmap,
also provide TLBSTATS option to measure and track TLB shootdowns.  Details:

http://mail-index.netbsd.org/port-i386/2009/01/11/msg001018.html

Patch from Andrew Doran, proposed on tech-x86 [sic], in January 2009.

XXX: amd64 and xen are not yet; work in progress.

Revision 1.29.2.1 / (download) - annotate - [select for diffs], Tue Mar 16 15:38:04 2010 UTC (14 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.29: +4 -3 lines
Diff to previous 1.29 (colored) to selected 1.2.4.6 (colored)

Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc().  It allows us to share the locks among UVM objects.

Revision 1.12.10.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:03:08 2010 UTC (14 years, 1 month ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.12.10.3: +4 -4 lines
Diff to previous 1.12.10.3 (colored) to branchpoint 1.12 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.29 / (download) - annotate - [select for diffs], Tue Feb 9 22:51:13 2010 UTC (14 years, 2 months ago) by jym
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1
Branch point for: rmind-uvmplock
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.2.4.6 (colored)

Fix typos in comments.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Nov 11 17:08:16 2009 UTC (14 years, 5 months ago) by cegger
Branch: MAIN
CVS Tags: uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored) to selected 1.2.4.6 (colored)

update comment: we use PMAP_NOCACHE for both pmap_enter and pmap_kenter_pa

Revision 1.27 / (download) - annotate - [select for diffs], Sat Nov 7 07:27:48 2009 UTC (14 years, 5 months ago) by cegger
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored) to selected 1.2.4.6 (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.21.2.6 / (download) - annotate - [select for diffs], Sun Nov 1 21:43:29 2009 UTC (14 years, 5 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.5: +7 -1 lines
Diff to previous 1.21.2.5 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

- Upgrade suspend/resume code to comply with Xen2 removal.
- Add support for PAE domUs suspend/resume.
- Fix an issue regarding initialization of the xbd ring I/O that could end
badly during resume, with invalid block operations submitted to dom0 backend.

NetBSD supports PAE under x86_32 by considering the L2 page as being
4 pages long instead of 1.

Xen validates the page types during resume. Sadly, the hypervisor handles
alternative recursive mappings (== PG/PD entries pointing to pages other
than self) inadequately, which could lead to incorrect page pinning.

As a result, the important change with this patch is to clear these alternative
mappings during suspend, and reset them back to their former self upon
resume. For PAE, approx. all 4 PDIR_SLOT_PTEs could be considered as
alternative recursive mappings.

See comments in pmap.c for further details.

Now, let the testing and bug hunting begin.

Revision 1.21.2.5 / (download) - annotate - [select for diffs], Sun Nov 1 13:58:16 2009 UTC (14 years, 5 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.4: +1 -30 lines
Diff to previous 1.21.2.4 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.12.10.3 / (download) - annotate - [select for diffs], Wed Aug 19 18:46:50 2009 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.12.10.2: +2 -2 lines
Diff to previous 1.12.10.2 (colored) to branchpoint 1.12 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.21.2.4 / (download) - annotate - [select for diffs], Fri Jul 24 11:30:28 2009 UTC (14 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.3: +29 -1 lines
Diff to previous 1.21.2.3 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

- rework the page pinning API, so that now a function is provided for
each level of indirection encountered during virtual memory translations. Update
pmap accordingly. Pinning looks cleaner that way, and it offers the possibility
to pin lower level pages if necessary (NetBSD does not do it currently).

- some fixes and comments to explain how page validation/invalidation take
place during save/restore/migrate under Xen. L2 shadow entries from PAE are now
handled, so basically, suspend/resume works with PAE.

- fixes an issue reported by Christoph (cegger@) for xencons suspend/resume
in dom0.

TODO:

- PAE save/restore is currently limited to single-user only, multi-user
support requires modifications in PAE pmap that should be discussed first. See
the comments about the L2 shadow pages cached in pmap_pdp_cache in this commit.

- grant table bug is still there; do not use the kernels of this branch
to test suspend/resume, unless you want to experience bad crashes in dom0,
and push the big red button.

Now there is light at the end of the tunnel :)

Note: XEN2 kernels will neither build nor work with this branch.

Revision 1.21.2.3 / (download) - annotate - [select for diffs], Thu Jul 23 23:31:36 2009 UTC (14 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.2: +7 -1 lines
Diff to previous 1.21.2.2 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 19 15:17:29 2009 UTC (14 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, jymxensuspend-base
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored) to selected 1.2.4.6 (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.12.10.2 / (download) - annotate - [select for diffs], Sat Jul 18 14:52:56 2009 UTC (14 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.12.10.1: +7 -1 lines
Diff to previous 1.12.10.1 (colored) to branchpoint 1.12 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jun 28 15:18:50 2009 UTC (14 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6
Changes since 1.24: +7 -1 lines
Diff to previous 1.24 (colored) to selected 1.2.4.6 (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.21.2.2 / (download) - annotate - [select for diffs], Sun May 31 20:15:36 2009 UTC (14 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21.2.1: +2 -1 lines
Diff to previous 1.21.2.1 (colored) to branchpoint 1.21 (colored) to selected 1.2.4.6 (colored)

Modifications for the Xen suspend/migrate/resume branch:

- introduce xenbus_device_{suspend,resume}() functions. These are routines
used to suspend/resume MI parts of the Xenbus device interfaces, like updating
frontend/backend devices' paths found in XenStore.

- introduce HYPERVISOR_sysctl(), an hypercall used only by Xentools to obtain
information from hypervisor (listing VMs, printing console, etc.). I use it
to query xenconsole from ddb(), as a last resort in case of a panic() in
dom0 (xm being not available). Currently unused in the branch; could be, if
requested.

- disable the rwlock(9) used to protect code that could use transient MFNs.
It could trigger nasty context switches in place it should not to.

- fix some bugs in the xennet/xbd suspend/resume pmf(9) handlers.

- following XenSource's design, talk_to_otherend() is now called
watch_otherend(), and free_otherend_details() is used by Xenbus device
suspend/resume routines.

- some slight modifications in pmap regarding APDP. Introduce an inline
function (pmap_unmap_apdp_pde()) that clears APDP entry for the current pmap.

- similarly, implement pmap_unmap_all_apdp_pdes() that iterates through all
pmaps and tears down APDP, as Xen does not handle them properly.

TODO/XXX:

- pmap_unmap_apdp_pde() does not handle APDP shadow entry of PAE. It will,
once I figure out how PAE uses it.

- revisit the pmap locking issue regarding transient MFNs. As NetBSD does not
use kernel preemption and MP for Xen, this could be skipped momentarily. See
http://mail-index.netbsd.org/port-xen/2009/04/27/msg004903.html for details.

- fix a bug regarding grant tables which could technically DoS a dom0 if
ridiculously high consumer/producer indexes are passed down in the ring during
a resume.

All in all, once the grant table index issue and APDP PAE are fixed, next step
is to torture test this branch.

Tested under i386 PAE and non-PAE, Xen3 dom0 and domU. amd64 is only compile
tested.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Wed May 13 17:18:44 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.21: +9 -6 lines
Diff to previous 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.12.10.1 / (download) - annotate - [select for diffs], Mon May 4 08:12:09 2009 UTC (14 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.12: +14 -20 lines
Diff to previous 1.12 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.20.2.2 / (download) - annotate - [select for diffs], Tue Apr 28 07:34:56 2009 UTC (14 years, 11 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.20.2.1: +9 -6 lines
Diff to previous 1.20.2.1 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Apr 22 10:17:48 2009 UTC (15 years 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.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.2.4.6 (colored)

change pmap flags argument from int to u_int.
forgot to commit this.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Apr 18 08:51:45 2009 UTC (15 years ago) by cegger
Branch: MAIN
Changes since 1.22: +6 -1 lines
Diff to previous 1.22 (colored) to selected 1.2.4.6 (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.20.4.1 / (download) - annotate - [select for diffs], Sat Apr 4 17:39:09 2009 UTC (15 years ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Changes since 1.20: +3 -5 lines
Diff to previous 1.20 (colored) next main 1.21 (colored) to selected 1.2.4.6 (colored)

Pull up following revision(s) (requested by ad in ticket #656):
	sys/arch/amd64/amd64/gdt.c: revision 1.21 via patch
	sys/arch/amd64/amd64/machdep.c: revision 1.129 via patch
	sys/arch/i386/i386/gdt.c: revision 1.47 via patch
	sys/arch/i386/i386/kvm86.c: revision 1.17 via patch
	sys/arch/i386/i386/locore.S: revision 1.85 via patch
	sys/arch/i386/i386/machdep.c: revision 1.666 via patch
	sys/arch/i386/i386/vector.S: revision 1.45 via patch
	sys/arch/i386/include/pcb.h: revision 1.47 via patch
	sys/arch/x86/include/pmap.h: revision 1.22 via patch
	sys/arch/x86/include/sysarch.h: revision 1.8 via patch
	sys/arch/x86/x86/pmap.c: revision 1.80 via patch
	sys/arch/x86/x86/sys_machdep.c: revision 1.17 via patch
	sys/compat/linux/arch/i386/linux_machdep.c: revision 1.143 via patch
	sys/kern/init_main.c: revision 1.384 via patch
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.22 / (download) - annotate - [select for diffs], Sat Mar 21 14:41:30 2009 UTC (15 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.21: +3 -5 lines
Diff to previous 1.21 (colored) to selected 1.2.4.6 (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.20.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:17:09 2009 UTC (15 years, 3 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.20: +1 -6 lines
Diff to previous 1.20 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.12.6.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:28:38 2009 UTC (15 years, 3 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.12.6.3: +0 -5 lines
Diff to previous 1.12.6.3 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.19.2.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:13:38 2008 UTC (15 years, 4 months ago) by haad
Branch: haad-dm
Changes since 1.19.2.1: +1 -6 lines
Diff to previous 1.19.2.1 (colored) to branchpoint 1.19 (colored) next main 1.20 (colored) to selected 1.2.4.6 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Dec 9 20:45:46 2008 UTC (15 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: nick-hppapmap-base2, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base
Branch point for: jym-xensuspend
Changes since 1.20: +1 -6 lines
Diff to previous 1.20 (colored) to selected 1.2.4.6 (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.19.2.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:16:07 2008 UTC (15 years, 6 months ago) by haad
Branch: haad-dm
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.12.6.3 / (download) - annotate - [select for diffs], Sun Sep 28 10:40:11 2008 UTC (15 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.12.6.2: +2 -0 lines
Diff to previous 1.12.6.2 (colored) to branchpoint 1.12 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.14.2.3 / (download) - annotate - [select for diffs], Wed Sep 24 16:38:50 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.14.2.2: +3 -1 lines
Diff to previous 1.14.2.2 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored) to selected 1.2.4.6 (colored)

Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.14.2.2 / (download) - annotate - [select for diffs], Thu Sep 18 04:33:37 2008 UTC (15 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.14.2.1: +2 -1 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) to selected 1.2.4.6 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Sep 16 19:55:31 2008 UTC (15 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, netbsd-5-base, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, matt-mips64-base2, haad-dm-base1, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored) to selected 1.2.4.6 (colored)

Implement the arch-dependent p2m frame lists list.  This adds support for
'xm dump-core' for NetBSD domUs.
From Jean-Yves Migeon (jean-yves dot migeon at espci dot fr)

Revision 1.12.6.2 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:02 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.12.6.1: +2 -7 lines
Diff to previous 1.12.6.1 (colored) to branchpoint 1.12 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Fri Jun 27 15:11:18 2008 UTC (15 years, 9 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored) next main 1.19 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jun 24 10:42:43 2008 UTC (15 years, 9 months ago) by jmcneill
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base
Branch point for: haad-dm
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored) to selected 1.2.4.6 (colored)

Define PMAP_FORK -- this was lost in the vmlocking merge, and is required
by options USER_LDT.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:30:50 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.14: +3 -10 lines
Diff to previous 1.14 (colored) to selected 1.2.4.6 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.12.8.2 / (download) - annotate - [select for diffs], Tue Jun 17 09:14:20 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.12.8.1: +2 -8 lines
Diff to previous 1.12.8.1 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jun 5 21:09:12 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: simonb-wapbl
Changes since 1.17: +2 -8 lines
Diff to previous 1.17 (colored) to selected 1.2.4.6 (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.12.6.1 / (download) - annotate - [select for diffs], Thu Jun 5 19:14:34 2008 UTC (15 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Also fix build.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jun 4 13:08:30 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.16: +7 -1 lines
Diff to previous 1.16 (colored) to selected 1.2.4.6 (colored)

Revert unintentional change.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jun 4 12:41:42 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.15: +2 -8 lines
Diff to previous 1.15 (colored) to selected 1.2.4.6 (colored)

vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.

Revision 1.12.8.1 / (download) - annotate - [select for diffs], Wed Jun 4 02:04:58 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.12: +2 -3 lines
Diff to previous 1.12 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jun 2 19:11:10 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3
Changes since 1.14: +2 -3 lines
Diff to previous 1.14 (colored) to selected 1.2.4.6 (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.14 / (download) - annotate - [select for diffs], Sat May 3 02:56:13 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.13: +7 -2 lines
Diff to previous 1.13 (colored) to selected 1.2.4.6 (colored)

Back out previous which was not thought through properly.

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 3 00:21:35 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.12: +3 -8 lines
Diff to previous 1.12 (colored) to selected 1.2.4.6 (colored)

Implement pmap_remove_all().

Revision 1.2.10.5 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:28 2008 UTC (16 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.2.10.4: +27 -19 lines
Diff to previous 1.2.10.4 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored) to selected 1.2.4.6 (colored)

sync with HEAD

Revision 1.2.8.4 / (download) - annotate - [select for diffs], Mon Feb 18 21:05:16 2008 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.2.8.3: +33 -55 lines
Diff to previous 1.2.8.3 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.6.6 / (download) - annotate - [select for diffs], Mon Feb 4 09:22:49 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.6.5: +24 -3 lines
Diff to previous 1.2.6.5 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jan 23 19:46:45 2008 UTC (16 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, 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: yamt-pf42, yamt-nfs-mp, mjf-devfs2
Changes since 1.11: +24 -3 lines
Diff to previous 1.11 (colored) to selected 1.2.4.6 (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.2.6.5 / (download) - annotate - [select for diffs], Mon Jan 21 09:40:08 2008 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.6.4: +13 -55 lines
Diff to previous 1.2.6.4 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.6.2.7 / (download) - annotate - [select for diffs], Sun Jan 20 17:51:25 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6.2.6: +1 -16 lines
Diff to previous 1.6.2.6 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jan 20 13:43:37 2008 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.10: +1 -16 lines
Diff to previous 1.10 (colored) to selected 1.2.4.6 (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.6.2.6 / (download) - annotate - [select for diffs], Thu Jan 17 19:15:24 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6.2.5: +22 -1 lines
Diff to previous 1.6.2.5 (colored) to branchpoint 1.6 (colored) to selected 1.2.4.6 (colored)

- Fix L2_SLOT_APTE value (not sure how I got this value but it was definitively
  wrong)
- Use global variable for the PAE L3 page adresses, so that pmap.c can get it
  from the bootstrap code
- Extent the size of our virtual PDP from 3 to 4 pages, so that pmap->pm_pdir[]
  is contigous for the whole VA range. The last page is a shadow of
  the kernel's real PDP (L3[3]).
- make pm_pdirpa an array of 4 paddr_t if using PAE. introduce a
  pmap_pdirpa macro to get the physical address of a given PD entry.
- fix pmap_map_pte

The kernel now boots single-user. fsck will cause a kernel fault in
pmap_pdes_invalid() on exit.

Revision 1.6.2.5 / (download) - annotate - [select for diffs], Sun Jan 13 11:26:58 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6.2.4: +3 -3 lines
Diff to previous 1.6.2.4 (colored) to branchpoint 1.6 (colored) to selected 1.2.4.6 (colored)

Work in progress on xeni386 PAE support:
Make xeni386 build with a 64bit paddr_t. For this vaddr_t vs paddr_t vs
pointers usages had to be clarified.
If 'options PAE' is present in a Xen3 kernel, switch paddr_t, pd_entry_t
and pt_entry_t to 64bits, and add the PAE entry in the __xen_guest ELF section.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 11 20:00:17 2008 UTC (16 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.9: +6 -3 lines
Diff to previous 1.9 (colored) to selected 1.2.4.6 (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.6.2.4 / (download) - annotate - [select for diffs], Thu Jan 10 23:44:07 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.6.2.3: +0 -2 lines
Diff to previous 1.6.2.3 (colored) to branchpoint 1.6 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.2.10.4 / (download) - annotate - [select for diffs], Wed Jan 9 01:49:48 2008 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
Changes since 1.2.10.3: +68 -52 lines
Diff to previous 1.2.10.3 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with HEAD

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jan 8 22:24:09 2008 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.8: +1 -2 lines
Diff to previous 1.8 (colored) to selected 1.2.4.6 (colored)

kill unused PMF_USER_RELOAD.

Revision 1.6.2.3 / (download) - annotate - [select for diffs], Wed Jan 2 21:51:20 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6.2.2: +7 -37 lines
Diff to previous 1.6.2.2 (colored) to branchpoint 1.6 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jan 2 12:30:30 2008 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.7: +1 -31 lines
Diff to previous 1.7 (colored) to selected 1.2.4.6 (colored)

g/c pv_page stuffs.

Revision 1.2.8.3 / (download) - annotate - [select for diffs], Thu Dec 27 00:43:24 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.2.8.2: +2 -1 lines
Diff to previous 1.2.8.2 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.5.2.1 / (download) - annotate - [select for diffs], Wed Dec 26 19:42:55 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.5: +8 -7 lines
Diff to previous 1.5 (colored) next main 1.6 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 25 18:33:34 2007 UTC (16 years, 3 months ago) by perry
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.6: +7 -7 lines
Diff to previous 1.6 (colored) to selected 1.2.4.6 (colored)

Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Thu Dec 13 21:26:35 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6.2.1: +1 -2 lines
Diff to previous 1.6.2.1 (colored) to branchpoint 1.6 (colored) to selected 1.2.4.6 (colored)

- make amd64 XEN3 kernels build again
- pin the pdp pages in the PDP cache contructor, and unpin them in the
  destructor. garbage-collect PMF_USER_XPIN.

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Tue Dec 11 23:02:57 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.6: +6 -1 lines
Diff to previous 1.6 (colored) to selected 1.2.4.6 (colored)

Switch i386 to x86/x86/pmap.c

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Tue Dec 11 15:20:51 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-kmem
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored) next main 1.6 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Dec 9 20:27:48 2007 UTC (16 years, 4 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.5: +2 -1 lines
Diff to previous 1.5 (colored) to selected 1.2.4.6 (colored)

Merge jmcneill-pm branch.

Revision 1.2.8.2 / (download) - annotate - [select for diffs], Sat Dec 8 18:18:10 2007 UTC (16 years, 4 months ago) by mjf
Branch: mjf-devfs
Changes since 1.2.8.1: +58 -1 lines
Diff to previous 1.2.8.1 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.6.4 / (download) - annotate - [select for diffs], Fri Dec 7 17:26:57 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.6.3: +61 -16 lines
Diff to previous 1.2.6.3 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with head

Revision 1.2.2.4 / (download) - annotate - [select for diffs], Mon Dec 3 18:40:08 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.2.2.3: +61 -16 lines
Diff to previous 1.2.2.3 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.4.6 / (download) - annotate - [selected], Tue Nov 27 19:35:54 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2.4.5: +58 -1 lines
Diff to previous 1.2.4.5 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with HEAD. amd64 Xen support needs testing.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Nov 22 16:17:12 2007 UTC (16 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base
Branch point for: yamt-kmem, vmlocking2
Changes since 1.4: +58 -1 lines
Diff to previous 1.4 (colored) to selected 1.2.4.6 (colored)

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

Revision 1.2.4.5 / (download) - annotate - [select for diffs], Wed Nov 21 21:53:37 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2.4.4: +4 -16 lines
Diff to previous 1.2.4.4 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.8.1 / (download) - annotate - [select for diffs], Mon Nov 19 00:46:59 2007 UTC (16 years, 5 months ago) by mjf
Branch: mjf-devfs
Changes since 1.2: +4 -17 lines
Diff to previous 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.1.4.4 / (download) - annotate - [select for diffs], Sun Nov 18 19:34:45 2007 UTC (16 years, 5 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.1.4.3: +3 -15 lines
Diff to previous 1.1.4.3 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.4 / (download) - annotate - [select for diffs], Thu Nov 15 19:18:34 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.3: +4 -16 lines
Diff to previous 1.3 (colored) to selected 1.2.4.6 (colored)

Remove support for 80386 level CPUs. PR port-i386/36163.

Revision 1.2.6.3 / (download) - annotate - [select for diffs], Thu Nov 15 11:43:38 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.6.2: +1 -2 lines
Diff to previous 1.2.6.2 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.1.4.3 / (download) - annotate - [select for diffs], Tue Nov 13 16:00:17 2007 UTC (16 years, 5 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.1.4.2: +1 -2 lines
Diff to previous 1.1.4.2 (colored) to branchpoint 1.1 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD

Revision 1.2.4.4 / (download) - annotate - [select for diffs], Sun Nov 11 16:47:02 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2.4.3: +1 -2 lines
Diff to previous 1.2.4.3 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.10.3 / (download) - annotate - [select for diffs], Thu Nov 8 10:59:42 2007 UTC (16 years, 5 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.2.10.2: +1 -2 lines
Diff to previous 1.2.10.2 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with -HEAD

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

Merge from vmlocking:

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

Revision 1.2.10.2 / (download) - annotate - [select for diffs], Tue Nov 6 23:23:38 2007 UTC (16 years, 5 months ago) by matt
Branch: matt-armv6
Changes since 1.2.10.1: +412 -0 lines
Diff to previous 1.2.10.1 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with HEAD

Revision 1.2.4.3 / (download) - annotate - [select for diffs], Sun Oct 28 15:04:59 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2.4.2: +1 -2 lines
Diff to previous 1.2.4.2 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Cosmetic: reduce diff to HEAD.

Revision 1.2.6.2 / (download) - annotate - [select for diffs], Sat Oct 27 11:28:56 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.6.1: +412 -0 lines
Diff to previous 1.2.6.1 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

sync with head.

Revision 1.2.4.2 / (download) - annotate - [select for diffs], Fri Oct 26 15:43:44 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2.4.1: +414 -0 lines
Diff to previous 1.2.4.1 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.1.4.2 / (download) - annotate - [select for diffs], Thu Oct 25 23:59:23 2007 UTC (16 years, 5 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.1.4.1: +58 -1 lines
Diff to previous 1.1.4.1 (colored) to branchpoint 1.1 (colored) to selected 1.2.4.6 (colored)

Finish sync with HEAD. Especially use the new x86 pmap for xenamd64.
For this:
- rename pmap_pte_set() to pmap_pte_testset()
- make pmap_pte_set() a function or macro for non-atomic PTE write
- define and use pmap_pa2pte()/pmap_pte2pa() to read/write PTE entries
- define pmap_pte_flush() which is a nop in x86 case, and flush the
  MMUops queue in the Xen case

Revision 1.1.4.1 / (download) - annotate - [select for diffs], Thu Oct 25 22:36:47 2007 UTC (16 years, 5 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.1: +412 -0 lines
Diff to previous 1.1 (colored) to selected 1.2.4.6 (colored)

Sync with HEAD.

Revision 1.2.2.3 / (download) - annotate - [select for diffs], Wed Oct 24 16:45:43 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.2.2.2: +1 -2 lines
Diff to previous 1.2.2.2 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Use a pool_cache to allocate pv entries. PR port-i386/37193.

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Tue Oct 23 20:36:41 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.2.2.1: +412 -0 lines
Diff to previous 1.2.2.1 (colored) to branchpoint 1.2 (colored) to selected 1.2.4.6 (colored)

Sync with head.

Revision 1.2.10.1, Thu Oct 18 15:28:37 2007 UTC (16 years, 6 months ago) by matt
Branch: matt-armv6
Changes since 1.2: +0 -412 lines
FILE REMOVED

file pmap.h was added on branch matt-armv6 on 2007-11-06 23:23:38 +0000

Revision 1.2.6.1, Thu Oct 18 15:28:37 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2: +0 -412 lines
FILE REMOVED

file pmap.h was added on branch yamt-lazymbuf on 2007-10-27 11:28:56 +0000

Revision 1.2.4.1, Thu Oct 18 15:28:37 2007 UTC (16 years, 6 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.2: +0 -412 lines
FILE REMOVED

file pmap.h was added on branch jmcneill-pm on 2007-10-26 15:43:44 +0000

Revision 1.2.2.1, Thu Oct 18 15:28:37 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.2: +0 -412 lines
FILE REMOVED

file pmap.h was added on branch vmlocking on 2007-10-23 20:36:40 +0000

Revision 1.2 / (download) - annotate - [select for diffs], Thu Oct 18 15:28:37 2007 UTC (16 years, 6 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: +412 -0 lines
Diff to previous 1.1 (colored) to selected 1.2.4.6 (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.2.3 / (download) - annotate - [select for diffs], Thu Oct 18 11:24:50 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.1.2.2: +2 -0 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.2.4.6 (colored)

#ifdef out an unused member for x86_64.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Sun Oct 14 12:05:06 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.1.2.1: +2 -0 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) to selected 1.2.4.6 (colored)

move pl_i_roundup to a header.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Mon Oct 8 06:35:51 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.1: +408 -0 lines
Diff to previous 1.1 (colored) to selected 1.2.4.6 (colored)

merge some parts of x86 pmap.h.

Revision 1.1, Mon Oct 8 06:35:50 2007 UTC (16 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, vmlocking-base
Branch point for: yamt-x86pmap, bouyer-xenamd64
FILE REMOVED

file pmap.h 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>