Commit Graph

115 Commits

Author SHA1 Message Date
skrll
4aca4be1c8 Make a comment less MIPS specific 2020-04-09 08:55:45 +00:00
ad
cd4b207ac9 Use C99-ism to reduce ifdefs. Pointed out by christos@. 2020-03-16 20:07:44 +00:00
ad
db42bf9228 pmap_pv_track(): use PMAP_PAGE_INIT() otherwise the x86 pmap pukes. 2020-03-16 19:56:39 +00:00
rin
e2a385b1ae Fix build for ports using uvm/pmap; pmap_remove_all() returns a boolean. 2020-03-15 11:36:24 +00:00
ad
be9c6147a4 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.
2020-03-14 14:05:42 +00:00
thorpej
9d7b661e11 pmap_tlb_miss_lock needs to be globally visible. 2020-03-12 23:10:27 +00:00
thorpej
29807ee596 With DEBUG defined, it's possible to execute a TLB-vs-segmap consistency
check from a (soft) interrupt handler.  But if a platform does not otherwise
require the pmap_tlb_miss_lock, then where will be a brief window of
inconsistency that, while harmless, will still fire an assertion in the
consistency check.

Fix this with the following changes:
1- Refactor the pmap_tlb_miss_lock into MI code and rename it from
   pmap_tlb_miss_lock_{enter,exit}() to pmap_tlb_miss_lock_{enter,exit}().
   MD code can still define the "md" hooks as necessary, and if so, will
   override the common implementation.
2- Provde a pmap_bootstrap_common() function to perform common pmap bootstrap
   operations, namely initializing the pmap_tlb_miss_lock if it's needed.
   If MD code overrides the implementation, it's responsible for initializing
   its own lock.
3- Call pmap_bootstrap_common() from the mips, powerpc booke, and riscv
   pmap_bootstrap() routines.  (This required adding one for riscv.)
4- Switch powerpc booke to the common pmap_tlb_miss_lock.
5- Enable pmap_tlb_miss_lock if DEBUG is defined, even if it's not otherwise
   required.

PR port-mips/55062 (Failed assertion in pmap_md_tlb_check_entry())
2020-03-11 13:30:31 +00:00
rin
4ecd76e535 0x%p --> %p for non-external codes. 2020-02-24 12:20:29 +00:00
martin
3027f95766 Revert previous (include of sys/param.h) - the headers requiring this
have been fixed.
2020-01-01 16:50:41 +00:00
ad
be643866ce pg->phys_addr -> VM_PAGE_TO_PHYS(). 2019-12-30 18:28:06 +00:00
martin
9926498798 Add mising sys/param.h include (for COHERENCY_UNIT, now needed in uvm headers) 2019-12-28 08:25:33 +00:00
skrll
399141302f KNF 2019-12-18 11:27:56 +00:00
skrll
9986a0453d Remove duplicate #includes 2019-12-18 10:55:50 +00:00
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