amd64 pmap: do not panic on inability to insert ptp into trie
When pmap_enter_pde() needs to destroy existing kernel superpage
mapping, do not remove saved pt page from the pm_root trie. Then the
pt page does not need to be re-inserted into the trie.
If the kernel region is not mapped with the superpage, try to insert the
pt page into pm_root trie before clearing ptes. If failed, we can
return failure without a need to rewind.
Suggested by: alc
dev/mem: use sx instead of rw lock
Some ops require sleepable context to success, like DMAP demotion.
amd64 pmap: preallocate pt page foir pmap_demote_pdpe() in pmap_demote_DMAP()
Allocate the page outside the kernel_pmap locked region, and pass it to
pmap_demote_pdpe() instead of panicing if VM_ALLOC_INTERRUPT failing.