Commit Graph

152 Commits

Author SHA1 Message Date
skrll
85ee6e12a8 Fix a UVMHIST_LOG format 2019-12-17 13:25:50 +00:00
ad
b41bcd98f2 Use pageq.list instead of listq.list. 2019-12-14 14:46:11 +00:00
riastradh
c558d9a3e2 Convert pmap_pvt to atomic_load/store. 2019-12-09 04:39:58 +00:00
jmcneill
472bbf0ecf sys/atomic.h for membar_* 2019-12-07 17:56:08 +00:00
skrll
af0cb0a34c Define and use VM_PAGEMD_PVLIST_EMPTY_P 2019-10-20 08:29:38 +00:00
skrll
0126296dc0 Whitespace 2019-10-20 07:58:21 +00:00
skrll
5f7d8e837b Re-order _P() macros to match bit definitions. NFCI 2019-10-20 07:54:29 +00:00
skrll
b6e3ab3307 Whitespace 2019-10-20 07:22:51 +00:00
skrll
8535470345 Remove KASSERT(!VM_PAGEMD_PVLIST_LOCKED_P(mdpg)) - can only assert that it
is owned
2019-10-20 07:18:22 +00:00
skrll
01e9893f42 Use "segmap" for uvm_wait message in pmap_segtab_alloc 2019-09-23 18:20:07 +00:00
skrll
d2a9676ecc s/pte/ptep/ in pmap_pte_process for consistency with other code. NFCI. 2019-09-18 18:29:58 +00:00
skrll
471755a1a7 Whitespace 2019-09-18 18:18:44 +00:00
skrll
930577a55f Provide and use PV_ISKENTER_P. NFCI. 2019-07-12 10:39:12 +00:00
christos
cc833a4d7d use __nothing 2019-06-19 12:55:01 +00:00
skrll
f144d2a709 Once more short line to unwrap 2019-06-19 10:04:40 +00:00
skrll
dd7deb8f88 Unwrap short lines. NFCI. 2019-06-19 10:00:19 +00:00
skrll
ba6c36b14b Make a comment generic and not MIPS specific 2019-06-19 09:56:17 +00:00
maxv
5bd7eba201 Misc changes in RISC-V. Start changing the memory layout, too. 2019-06-01 12:42:27 +00:00
skrll
08ae7ed332 Usee __BIT() 2019-05-20 17:00:57 +00:00
skrll
bcfef4b20f Trailing whitespace 2019-05-20 16:58:49 +00:00
msaitoh
c2f2b1bf58 s/ the the / the / 2019-03-08 08:12:39 +00:00
christos
87fd18f8e5 s/static inline/static __inline/g for consistency. 2018-04-19 21:50:06 +00:00
jdolecek
f0e5de0264 fix the DIAGNOSTIC function pmap_tlb_asid_count() to not expect
that TLBINFO_ASID_INUSE_P() returns just 0 or 1; the underlying
__BITMAP_ISSET() actually returns the matching bit nowadays, which
caused miscounting

fixes PR kern/53054 by Sevan Janiyan
2018-02-25 21:43:03 +00:00
jdolecek
51cdc2d5b6 adjust KASSERT() triggered in PR port-cobalt/53054 to provide more info 2018-02-25 16:44:31 +00:00
jdolecek
f82a61429e KERNEL_PID is > 0 on powerpc/ibm4xx, need to mask all bits <0,
KERNEL_PID> to avoid triggering KASSERT() checking allocated asid
is bigger than KERNEL_PID; adjust also TLBINFO_ASID_INITIAL_FREE()
accordingly

discussed with Nick
2018-02-21 21:53:54 +00:00
jdolecek
f90211bb4c convert to use actual __BITMAP_*() macros from <sys/bitops.h>, and make
it possible to override the ASID bitmap length; default to 256 ASIDs as before

XXX NFCI; compile tested only on evbpcc and evbmips, unfortunately didn't
find any combination of port using the MI pmap_tlb.c and working in QEMU
2018-02-19 22:01:15 +00:00
jdolecek
d80d16cd1e a bit of DRY - add macro for initial free ASID count 2018-02-19 21:40:45 +00:00
jdolecek
4248f17bba make it possible to not use the icache evcnts 2018-02-19 21:20:33 +00:00
pgoyette
8c42a6afbc Remove unneeded casts to (uintptr_t). This is already taken care of in
the xxxHIST_LOG() macros.

No need to pull-up to -8 - the extra cast really won't hurt anything.
2017-10-30 03:25:14 +00:00
pgoyette
7fb159dd6a And replace an instance of "%p" conversion with "%#jx" 2017-10-30 01:19:46 +00:00
kre
cf610eb9fd Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
2017-10-30 00:55:42 +00:00
pgoyette
cb32a134a5 Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.
2017-10-28 00:37:11 +00:00
skrll
67f418007a There's no need to call pmap_tlb_invalidate_addr if pmap_remove_all was
called and PMAP_DEFERRED_ACTIVATE is set.
2017-09-07 06:29:47 +00:00
skrll
e90fc54cd1 Use pte_set 2017-06-24 07:30:17 +00:00
skrll
659c16eaca Trailing whitespace 2017-06-24 05:49:50 +00:00
skrll
8d59a50047 Use __BIT(0) for PV_KENTER. NFC. 2017-06-24 05:39:53 +00:00
skrll
e4bfdd1c38 Whitespace - comment alignment. 2017-06-24 05:34:37 +00:00
skrll
0070107f88 Multiple inclusion protection define consistency 2017-06-24 05:31:03 +00:00
skrll
1e070c27ee Use __BIT(). No functional change. 2017-06-07 07:06:26 +00:00
skrll
04fbf2287d Whitespace 2017-05-26 06:41:42 +00:00
skrll
194ed3d72f Remove incorrect __diagused 2017-05-26 06:40:47 +00:00
skrll
a49520abfd Use the define name PMAP_HWPAGEWALKER and not PMAP_TLB_HWPAGEWALKER 2017-05-26 06:38:56 +00:00
skrll
5dbdb89b56 KASSERT -> KASSERTMSG 2017-05-12 12:18:37 +00:00
skrll
da8d87b170 Trailing whitespace 2017-05-12 12:18:07 +00:00
skrll
2a891dc6da Sprinkle some KASSERTs 2017-05-12 05:45:58 +00:00
skrll
5a99893d60 Fix a comment 2017-05-07 04:15:50 +00:00
skrll
94df2250c7 Remove unused LNAME macro 2017-04-28 17:04:33 +00:00
skrll
74b435937a Fix a UVMHIST_LOG after the "%s" removal 2017-04-28 10:12:35 +00:00
skrll
3ec9103743 Improve a comment 2017-04-22 20:20:19 +00:00
skrll
2a27f4d582 Trailing whitespace 2017-04-22 20:19:53 +00:00
mrg
29bcf0191f avoid using %s in UVMHIST. 2017-03-02 20:11:19 +00:00
skrll
b9250ac781 PHYSMEM -> PHYSSEG to fix build 2016-12-23 09:16:46 +00:00
cherry
3b1622fa3c "Make NetBSD great again!"
Introduce uvm_hotplug(9) to the kernel.

Many thanks, in no particular order to:

TNF, for funding the project.

Chuck Silvers - for multiple API reviews and feedback.
Nick Hudson - for testing on multiple architectures and bugfix patches.
Everyone who helped with boot testing.

KeK (http://www.kek.org.in) for hosting the primary developers.
2016-12-23 07:15:27 +00:00
mrg
1e9cf43a79 extend the pmap_activate/pmap_deactivate UVMHIST logs to include the
pid, lid, and either l_name or p_comm.
2016-12-01 02:15:08 +00:00
mrg
4df368747f fix the start index generation in pmap_segtab_release() to
ensure it fits in the actual array.  fixes N64 binaries from
triggering later panic.  move the panic check itself into a
common function that is called from a couple of new places too.
2016-11-23 03:30:53 +00:00
christos
9015c01fa3 PR/51540: Henning Petersen: replace , with ; 2016-10-09 14:49:51 +00:00
skrll
061de4b243 Move some code before pmap_enter_pv in pmap_enter so that when we are
re-mapping a VA to a new PA the old mapping is removed first.  This means
the cache alias code need to do less work and works better with the last
va tracking.
2016-10-05 20:50:00 +00:00
skrll
07838e6706 Increment resident_count if we're remapping onto new PA as
pmap_remove -> pmap_pte_remote will decrement it
2016-09-30 12:10:40 +00:00
matt
cfe955c546 When removing a page, make sure to clear its execness regardless of whether
the page is clean or dirty.  This fixes the problem of execpages leaking
into the freepage lists.
2016-09-16 17:27:09 +00:00
mrg
bd0724a2f0 put a variable under the #ifdef it's only used in. 2016-08-20 20:09:47 +00:00
matt
a35e54e697 Don't track kenter_pa/kremove PVs unless we are worrying about cache aliasing. 2016-08-18 21:42:27 +00:00
jakllsch
fb5b48267a Only include static inline pmap_asid_check() if it might be used.
Should fix HEAD-llvm evbppc autobuild.
2016-08-05 20:54:28 +00:00
matt
fbaba5f3ad Lock the tlbinfo if it wasn't when doing a pmap_tlb_pai_check 2016-07-23 20:06:25 +00:00
skrll
bf5805b9c2 Use KERNEL_PID instead of 0 2016-07-14 15:50:31 +00:00
skrll
6f2e9c1031 Fix some comments. 2016-07-14 15:49:43 +00:00
skrll
ccd0ac494d Spell PMAP_TLB_NEED_SHOOTDOWN correctly 2016-07-14 05:00:51 +00:00
skrll
7f64d56466 Trailing whitespace 2016-07-14 04:49:55 +00:00
skrll
44cfabd557 Fix typo for build check 2016-07-12 15:30:46 +00:00
maya
d4a9fd26c1 Fix build by removing accidential duplicate line. 2016-07-11 19:16:03 +00:00
matt
5528d7fdbf Changes so that MIPS can use the common pmap.
Change/augment the virtual cache alias callbacks.
2016-07-11 16:06:09 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
riastradh
16f79cd0ea Use IPL_NONE for pserialized lock. Assert sleepable. (OOPS.) 2016-02-07 18:41:25 +00:00
skrll
0ab5498d57 Remove #if 0 / #endif includes 2015-11-11 08:22:36 +00:00
skrll
b70033bc21 Split out the pmap_pv_track stuff for use by others.
Discussed with riastradh@
2015-11-11 08:20:22 +00:00
pgoyette
58afeafa2a Remove unnecessary #include for sys/shm.h - there's nothing here that needs
anything from there.
2015-11-05 00:12:28 +00:00
matt
eabbabd2c3 Update multiple inclusion macro 2015-09-21 15:50:19 +00:00
matt
9861f869d0 Use PMAP_MAP_POOLPAGE instead of POOL_PHYSTOV since we use PMAP_UNMAP_POOLPAGE.
Use PMAP_ALLOC_POOLPAGE instead of pmap_md_alloc_poolpage.
Cleanup some panic messages.
2015-06-11 08:04:44 +00:00
matt
f7b8434b14 Don't call kcpuset_intersecting_p and then kcpuset_ffs_intersecting since
that the last will tell use what we need to know.
2015-06-11 05:28:42 +00:00
matt
b9c0826d5d Add virtual_start to pmap_limits. This allows MD to steal address space
before pmap_bootstrap.
2015-06-11 05:27:07 +00:00
joerg
7c4334f760 pmap_tlb_intersecting_active_p is not used in some combinations of
platform options as seen by recent ARM changes.
2015-04-18 16:58:31 +00:00
matt
4dc165175b include <sys/evcnt.h> 2015-04-02 06:17:52 +00:00
nonaka
78531cbdd7 Disable pmap_md_tlb_check_entry, when MP. 2015-02-03 10:25:53 +00:00
nonaka
3012a05a13 Avoid race condition between PTE update and TLB miss walk. 2015-01-26 04:47:53 +00:00
nonaka
038a27157d Use PMAP_TLB_MAX instead of MAXCPUS. 2015-01-05 05:35:18 +00:00
nonaka
1383a653f7 fix build failure when UVMHIST is defined. 2014-12-25 08:11:09 +00:00
nonaka
c08471032a fix compile failure. 2014-12-24 04:03:02 +00:00
nonaka
58634b7e37 pmap->pm_active and pmap->pm_onproc must be destroyed. 2014-12-22 11:11:34 +00:00
nonaka
1a8ba8658c Initialize pmap->pm_active and pmap->pm_onproc.
Avoid "panic: kernel diagnostic assertion "!pmap_tlb_intersecting_onproc_p(pm, ti)" failed: file "/usr/src/sys/uvm/pmap/pmap_tlb.c", line 762".
2014-12-19 04:25:52 +00:00
skrll
c304f8b6cf s/0/KERNEL_PID/ for correctness 2014-10-29 10:53:41 +00:00
skrll
a0e8e968e5 Minor comment update. 2014-10-18 09:54:19 +00:00
matt
21b604c9f8 Change cpu_tlb_info definition based on PMAP_TLB_MAX instead of MULTIPROCESSOR 2014-04-03 14:46:25 +00:00
matt
18fc7d3f42 Compare ASIDs, not pmaps. 2014-04-03 14:23:38 +00:00
matt
ad2de1daa9 Make this compile on booke again. 2014-04-03 13:54:59 +00:00
matt
1627c0ae4a Allow this to handle H/W tlbs. Some ARM allow for a cheap way to flush all
entries using an ASID from the TLB.  Add support for taking advantage of it.
Most ARMs don't have an easy way to find out what's in the TLB so make
record_asids can just say all ASIDs are in use.  Fix some off by 1 errors.
2014-03-30 15:26:15 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
matt
89e28d04a5 use _KERNEL_OPT around #include 2014-03-04 06:14:53 +00:00
martin
b59de6cf0c Mark a potentially unused variable 2014-02-25 15:20:29 +00:00
matt
418abeab42 In the non-MP case, just initialize onproc to NULL. 2013-07-22 03:40:36 +00:00
matt
283b482b24 If not MULTIPROCESSOR, just make cpu_tlb_info(ci) return &pmap_tlb0_info 2013-07-22 03:39:55 +00:00
matt
fe1b443aac Make this kcpuset_t instead of the private __cpuset_t
Add improvements for single TLB implementation (PPC, ARM).
2013-07-17 23:15:20 +00:00