diff options
author | Richard Braun <rbraun@sceen.net> | 2017-01-27 22:23:02 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-01-27 22:23:02 +0100 |
commit | 9ec90945e67467d75b0373a8a4b22c6c14e76bee (patch) | |
tree | d9e1601397a292c4982d55666ac716bbe1e3aff6 | |
parent | aa46b2e057745996c78d85562eed7d00e530aa5c (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.c | 1 |
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); |