summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-01-27 22:23:02 +0100
committerRichard Braun <rbraun@sceen.net>2017-01-27 22:23:02 +0100
commit9ec90945e67467d75b0373a8a4b22c6c14e76bee (patch)
treed9e1601397a292c4982d55666ac716bbe1e3aff6
parentaa46b2e057745996c78d85562eed7d00e530aa5c (diff)
x86/pmap: add assertion on mapping creation
The function is described not to allow mapping creation on virtual addresses for which a valid mapping already exists. Add an assertion to make sure that's the case.
-rw-r--r--arch/x86/machine/pmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index 80938dff..888445b0 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -1181,6 +1181,7 @@ pmap_enter_local(struct pmap *pmap, uintptr_t va, phys_addr_t pa,
level--;
}
+ assert(!pmap_pte_valid(*pte));
pte_bits = ((pmap == kernel_pmap) ? PMAP_PTE_G : PMAP_PTE_US)
| pmap_prot_table[prot & VM_PROT_ALL];
pmap_pte_set(pte, pa, pte_bits, pt_level);