From e53ff134860c0e5337579431de0b651e6895dd67 Mon Sep 17 00:00:00 2001 From: grehan Date: Thu, 29 Jan 2004 00:45:41 +0000 Subject: When UMA_MD_SMALL_ALLOC is defined, pmap_kextract will be called for direct-mapped addresses. Assume that any address less than KVA is one of these and return it. Also assert that an address is KVA does have a valid mapping - callers of pmap_kextract don't check the return value, since they assume that they have a valid virtual address. --- sys/powerpc/aim/mmu_oea.c | 10 ++++++++++ sys/powerpc/powerpc/mmu_oea.c | 10 ++++++++++ sys/powerpc/powerpc/pmap.c | 10 ++++++++++ 3 files changed, 30 insertions(+) (limited to 'sys/powerpc') diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 2f01fb5..2888ff2 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1222,7 +1222,17 @@ pmap_kextract(vm_offset_t va) { struct pvo_entry *pvo; +#ifdef UMA_MD_SMALL_ALLOC + /* + * Allow direct mappings + */ + if (va < VM_MIN_KERNEL_ADDRESS) { + return (va); + } +#endif + pvo = pmap_pvo_find_va(kernel_pmap, va & ~ADDR_POFF, NULL); + KASSERT(pvo != NULL, ("pmap_kextract: no addr found")); if (pvo == NULL) { return (0); } diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index 2f01fb5..2888ff2 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -1222,7 +1222,17 @@ pmap_kextract(vm_offset_t va) { struct pvo_entry *pvo; +#ifdef UMA_MD_SMALL_ALLOC + /* + * Allow direct mappings + */ + if (va < VM_MIN_KERNEL_ADDRESS) { + return (va); + } +#endif + pvo = pmap_pvo_find_va(kernel_pmap, va & ~ADDR_POFF, NULL); + KASSERT(pvo != NULL, ("pmap_kextract: no addr found")); if (pvo == NULL) { return (0); } diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index 2f01fb5..2888ff2 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -1222,7 +1222,17 @@ pmap_kextract(vm_offset_t va) { struct pvo_entry *pvo; +#ifdef UMA_MD_SMALL_ALLOC + /* + * Allow direct mappings + */ + if (va < VM_MIN_KERNEL_ADDRESS) { + return (va); + } +#endif + pvo = pmap_pvo_find_va(kernel_pmap, va & ~ADDR_POFF, NULL); + KASSERT(pvo != NULL, ("pmap_kextract: no addr found")); if (pvo == NULL) { return (0); } -- cgit v1.1