From 6d35f6103548ee87583b743f703706eb2c81cf1a Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 21 Feb 2002 06:36:11 +0000 Subject: [PATCH] In pmap_map_chunk(), if we can't use a section mapping, then make sure that the L1 slot for the current VA points to an L2 table, and panic if it doesn't. --- sys/arch/arm/arm32/pmap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm/arm32/pmap.c b/sys/arch/arm/arm32/pmap.c index 9773dd5171a1..5c7b270f9069 100644 --- a/sys/arch/arm/arm32/pmap.c +++ b/sys/arch/arm/arm32/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.44 2002/02/21 05:25:24 thorpej Exp $ */ +/* $NetBSD: pmap.c,v 1.45 2002/02/21 06:36:11 thorpej Exp $ */ /* * Copyright (c) 2001 Richard Earnshaw @@ -142,7 +142,7 @@ #include #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.44 2002/02/21 05:25:24 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.45 2002/02/21 06:36:11 thorpej Exp $"); #ifdef PMAP_DEBUG #define PDEBUG(_lev_,_stat_) \ if (pmap_debug_level >= (_lev_)) \ @@ -3824,6 +3824,15 @@ pmap_map_chunk(vaddr_t l1pt, vaddr_t l2pt, vaddr_t va, paddr_t pa, continue; } + /* + * Ok, we're going to use an L2 table. Make sure + * one is actually in the corresponding L1 slot + * for the current VA. + */ + if ((pde[va >> PDSHIFT] & L1_MASK) != L1_PAGE) + panic("pmap_map_chunk: no L2 table for VA 0x%08lx\n", + va); + /* See if we can use a L2 large page mapping. */ if (((pa | va) & (L2_LPAGE_SIZE - 1)) == 0 && resid >= L2_LPAGE_SIZE) {