From owner-p4-projects@FreeBSD.ORG Mon Mar 2 18:23:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 925911065690; Mon, 2 Mar 2009 18:23:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 481C4106568A for ; Mon, 2 Mar 2009 18:23:55 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3555D8FC1E for ; Mon, 2 Mar 2009 18:23:55 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n22INsS6024538 for ; Mon, 2 Mar 2009 18:23:54 GMT (envelope-from lulf@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n22INs3j024536 for perforce@freebsd.org; Mon, 2 Mar 2009 18:23:54 GMT (envelope-from lulf@FreeBSD.org) Date: Mon, 2 Mar 2009 18:23:54 GMT Message-Id: <200903021823.n22INs3j024536@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to lulf@FreeBSD.org using -f From: Ulf Lilleengen To: Perforce Change Reviews Cc: Subject: PERFORCE change 158590 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2009 18:23:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=158590 Change 158590 by lulf@lulf_carrot on 2009/03/02 18:23:47 - Return the complete physical address, not just the page. This fixes a panic caused by busdma trying to convert the translated address into the uncached P2 segment, but the conversion modified the physical address, causing troubles when the memory was being used. This was later detected by uma. - Return 0 in case the lookup is unsuccessful. - P1 and P2 segments are only accessible to kernel processes, so is only handled in pmap_kextract. Affected files ... .. //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#11 edit Differences ... ==== //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#11 (text+ko) ==== @@ -284,7 +284,14 @@ vm_paddr_t pmap_kextract(vm_offset_t va) { - return pmap_extract(kernel_pmap, va); + + /* Don't lookup in page tables for P1 and P2 segments. */ + if ((va & AVR32_SEG_MASK) == AVR32_SEG_P1) + return (AVR32_P1_TO_PHYS(va)); + else if ((va & AVR32_SEG_MASK) == AVR32_SEG_P2) + return (AVR32_P2_TO_PHYS(va)); + + return (pmap_extract(kernel_pmap, va)); } /* @@ -735,14 +742,10 @@ { pt_entry_t *ent; - /* Don't lookup in page tables for P1 and P2 segments. */ - if ((va & AVR32_SEG_MASK) == AVR32_SEG_P1) - return (AVR32_P1_TO_PHYS(va)); - else if ((va & AVR32_SEG_MASK) == AVR32_SEG_P2) - return (AVR32_P2_TO_PHYS(va)); - ent = pmap_pte(pmap, va); - return pfn_get(*ent); + if (ent == NULL) + return (0); + return (pfn_get(*ent) | (va & PAGE_MASK)); } vm_page_t