The NetBSD Project

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

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.21: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:46:02 2023 UTC (12 months ago) by andvar
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -3 lines
fix triple s typos in comments.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Aug 20 23:48:51 2022 UTC (2 years, 3 months ago) by riastradh
Branches: 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
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -2 lines
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.19: download - view: text, markup, annotated - select for diffs
Thu Oct 7 12:52:27 2021 UTC (3 years, 2 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +9 -9 lines
KNF. No functional change.

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:07:59 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.2.2.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.1: +207 -157 lines
Merge changes from current as of 20200406

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Mar 22 00:16:16 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +7 -10 lines
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.13.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:18:33 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.13.2.1: preferred, colored; branchpoint 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13.2.1: +11 -7 lines
Sync with head.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Feb 23 18:57:28 2020 UTC (4 years, 9 months ago) by ad
Branches: MAIN
CVS tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +7 -3 lines
Adjustment to previous: TP_SET_DONE() was wiping out the VA to shoot,
instead of ORing the flag into the array element.  This caused the CPU
initiating the shootdown to occasionally miss an INVLPG.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Feb 22 20:12:40 2020 UTC (4 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +7 -7 lines
add relaxed atomics, ok ad@ riastradh@

Revision 1.13.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:47:28 2020 UTC (4 years, 10 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +69 -62 lines
Sync with head.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Jan 15 13:22:03 2020 UTC (4 years, 10 months ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base2, ad-namecache-base1
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +69 -54 lines
Push the INVLPG limit for shootdowns up to 16 (for UBC).

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Jan 12 13:01:11 2020 UTC (4 years, 10 months ago) by ad
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -10 lines
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.13: download - view: text, markup, annotated - select for diffs
Mon Dec 16 19:17:25 2019 UTC (4 years, 11 months ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +17 -24 lines
Align the TLB packet precisely on the stack, and do 7 INVLPG since it's
what fits in a single line.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Dec 2 20:59:56 2019 UTC (5 years ago) by pgoyette
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -3 lines
Fix tyo in comment

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Dec 2 19:49:12 2019 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +5 -3 lines
Fix a hard hang with Xen MP.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Nov 22 20:04:03 2019 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +3 -4 lines
Minor correction to previous.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Nov 21 21:48:33 2019 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +174 -126 lines
x86 TLB shootdown IPI changes:

- Shave some time off processing.
- Reduce cacheline/bus traffic on systems with many CPUs.
- Reduce time spent at IPL_VM.

Revision 1.2.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:06:54 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +20 -15 lines
Sync with HEAD

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon May 27 17:32:36 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -4 lines
Remove 'ci_svs_kpdirpa', unused. While here fix a few comments here and
there, reduces a future diff.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Apr 21 06:37:21 2019 UTC (5 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +8 -8 lines
Rename the PTE bits.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Feb 21 12:17:52 2019 UTC (5 years, 9 months ago) by maxv
Branches: MAIN
CVS tags: isaki-audio2-base, isaki-audio2
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +3 -2 lines
Another locking issue in NVMM: the {svm,vmx}_tlb_flush functions take VCPU
mutexes which can sleep, but their context does not allow it.

Rewrite the TLB handling code to fix that. It becomes a bit complex. In
short, we use a per-VM generation number, which we increase on each TLB
flush, before sending a broadcast IPI to everybody. The IPIs cause a
#VMEXIT of each VCPU, and each VCPU Loop will synchronize the per-VM gen
with a per-VCPU copy, and apply the flushes as neededi lazily.

The behavior differs between AMD and Intel; in short, on Intel we don't
flush the hTLB (EPT cache) if a context switch of a VCPU occurs, so now,
we need to maintain a kcpuset to know which VCPU's hTLBs are active on
which hCPU. This creates some redundancy on Intel, ie there are cases
where we flush the hTLB several times unnecessarily; but hTLB flushes are
very rare, so there is no real performance regression.

The thing is lock-less and non-blocking, so it solves our problem.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Feb 11 14:59:33 2019 UTC (5 years, 9 months ago) by cherry
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +7 -7 lines
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.1.2.3: download - view: text, markup, annotated - select for diffs
Fri Jan 18 08:50:24 2019 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.1.2.2: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.2: +2 -3 lines
Synch with HEAD

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Jan 6 16:19:12 2019 UTC (5 years, 11 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -3 lines
Flush the host TLB too when dealing with a guest pmap. The pmap is not
active on the host so the pages aren't cached; but the recursive PTE
entries may have been cached by our pmap code.

Revision 1.1.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:28 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1.2.1: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.1: +7 -2 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Nov 7 07:14:51 2018 UTC (6 years, 1 month ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1226, pgoyette-compat-1126
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +7 -2 lines
Add two pmap fields, will be used by NVMM.

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Mon May 21 04:36:03 2018 UTC (6 years, 6 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -4 lines
Sync with HEAD

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat May 19 16:51:32 2018 UTC (6 years, 6 months ago) by jakllsch
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521
Branch point for: phil-wifi
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -4 lines
remove more vestiges of uvm_emap_*(), to fix x86 kernel linking

Revision 1.1: download - view: text, markup, annotated - select for diffs
Mon Jan 22 19:37:45 2018 UTC (6 years, 10 months ago) by jdolecek
Branches: 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
rename sys/arch/x86/x86/pmap_tlb.c to sys/arch/x86/x86/x86_tlb.c, so that
x86 can eventually use uvm/pmap/pmap_tlb.c; step to future PCID support

Diff request

This form allows you to request diffs 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.

Log view options

CVSweb <webmaster@jp.NetBSD.org>