freebsd-dev/sys/riscv
Mitchell Horne 9d1aef8402 riscv: handle superpage in pmap_enter_quick_locked()
Previously, if pmap_enter_l2() was asked to re-map an existing superpage
(the result of madvise(MADV_WILLNEED) on a mapped range), it could
'fail' to do so, falling back to trying pmap_enter_quick_locked() for
each 4K virtual page. Because this function does not check if the l2
entry it finds is a superpage, it would proceed, sometimes resulting in
the creation of false PV entries.

If the relevant range was later munmap'ed, the system would panic during
the process' exit in pmap_remove_pages(), while attempting to clean up
the PV entries for mappings which no longer exist.

Instead, we should return early in the presence of an existing
superpage, as is done in other pmaps.

PR:             266108
Reviewed by:	markj, alc
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36563
2022-10-06 19:02:38 -03:00
..
allwinner aw_wdog: support Allwinner D1 watchdog 2022-04-12 19:51:17 -03:00
conf riscv: move GEOM_PART_GPT option to DEFAULTS 2022-10-03 13:49:54 -03:00
include pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00
riscv riscv: handle superpage in pmap_enter_quick_locked() 2022-10-06 19:02:38 -03:00
sifive riscv sifive: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-10 10:21:38 -07:00