kernel - VM rework part 15 - Core pmap work, refactor PG_*
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 20 May 2019 16:29:43 +0000 (09:29 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 20 May 2019 19:39:25 +0000 (12:39 -0700)
commit831a850787c9f10e26859cda6911277adf3477f5
treed4e16067f21cbbd1b1f31e0d1d7fa91ac28ed1bf
parentf16f9121796592a356f4962da34e7071339e4e1f
kernel - VM rework part 15 - Core pmap work, refactor PG_*

* Augment PG_FICTITIOUS.  This takes over some of PG_UNMANAGED's previous
  capabilities.  In addition, the pmap_*() API will work with fictitious
  pages, making mmap() operation (aka of the GPU) more consistent.

* Add PG_UNQUEUED.  This prevents a vm_page from being manipulated in
  the vm_page_queues[] in any way.  This takes over another feature
  of the old PG_UNMANAGED flag.

* Remove PG_UNMANAGED

* Remove PG_DEVICE_IDX.  This is no longer relevant.  We use PG_FICTITIOUS
  for all device pages.

* Refactor vm_contig_pg_alloc(), vm_contig_pg_free(),
  vm_page_alloc_contig(), and vm_page_free_contig().

  These functions now set PG_FICTITIOUS | PG_UNQUEUED on the returned
  pages, and properly clear the bits upon free or if/when a regular
  (but special contig-managed) page is handed over to the normal paging
  system.

  This is combined with making the pmap*() functions work better with
  PG_FICTITIOUS is the primary 'fix' for some of DRMs hacks.
12 files changed:
sys/platform/pc64/include/pmap.h
sys/platform/pc64/vmm/ept.c
sys/platform/pc64/x86_64/pmap.c
sys/vm/device_pager.c
sys/vm/phys_pager.c
sys/vm/vm_contig.c
sys/vm/vm_fault.c
sys/vm/vm_object.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c
sys/vm/vm_swapcache.c