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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327049

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);
}
}
/*