Allow pmap_kremove() to remove 1MB section mappings as well as 4K pages.

This will allow it to undo temporary device mappings such as those made
with pmap_preboot_map_attr().

Reviewed by:	cognet
This commit is contained in:
Ian Lepore 2017-12-20 22:17:27 +00:00
parent df1e0a51ec
commit e3842da22f

View File

@ -1310,10 +1310,16 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa)
PMAP_INLINE void
pmap_kremove(vm_offset_t va)
{
pt1_entry_t *pte1p;
pt2_entry_t *pte2p;
pte2p = pt2map_entry(va);
pte2_clear(pte2p);
pte1p = kern_pte1(va);
if (pte1_is_section(pte1_load(pte1p))) {
pte1_clear(pte1p);
} else {
pte2p = pt2map_entry(va);
pte2_clear(pte2p);
}
}
/*